Package wycc.util

Examples of wycc.util.Pair


      Pair<Expr, Environment> p = propagateCondition(uop.mhs, !sign,
          environment, context);
      uop.mhs = p.first();
      checkIsSubtype(Type.T_BOOL, uop.mhs, context);
      uop.type = Nominal.T_BOOL;
      return new Pair(uop, p.second());
    } else {
      // Nothing else other than logical not is valid at this point.
      syntaxError(errorMessage(INVALID_BOOLEAN_EXPRESSION), context, expr);
      return null; // deadcode
    }
View Full Code Here


    // TODO: could do more here!

    remap(environment, index, entry);

    return new Pair(environment, environment);
  }
View Full Code Here

    Constant c = environment.get(code.operand);
    if(c instanceof Alias) {
      environment.set(code.operand,null);
    }

    return new Pair(environment, environment);
  }
View Full Code Here

          if (values.contains(constant)) {
            WhileyFile.syntaxError(
                errorMessage(DUPLICATE_CASE_LABEL),
                context, c);
          }
          cases.add(new Pair(constant, target));
          values.add(constant);
        }

        for (Stmt st : c.stmts) {
          generate(st, environment, codes, context);
View Full Code Here

    if (!in.contains(igoto.leftOperand) || !in.contains(igoto.rightOperand)) {
      syntaxError(errorMessage(VARIABLE_POSSIBLY_UNITIALISED), filename,
          entry);
    }

    return new Pair(in, in);
  }
View Full Code Here

    if (!in.contains(iftype.operand)) {
      syntaxError(errorMessage(VARIABLE_POSSIBLY_UNITIALISED), filename,
          entry);
    }

    return new Pair(in,in);
  }
View Full Code Here

      for (Pair<Constant, String> p : branches) {
        String nlabel = labels.get(p.second());
        if (nlabel == null) {
          nbranches.add(p);
        } else {
          nbranches.add(new Pair(p.first(), nlabel));
        }
      }

      String nlabel = labels.get(defaultTarget);
      if (nlabel == null) {
View Full Code Here

      for (Pair<Type, String> p : catches) {
        String nlabel = labels.get(p.second());
        if (nlabel == null) {
          nbranches.add(p);
        } else {
          nbranches.add(new Pair(p.first(), nlabel));
        }
      }

      String ntarget = labels.get(target);
      if (ntarget != null) {
View Full Code Here

        // Returns a pair, (expr, result)
        Pair<String, String> pair = translateAssertCode(declaration.condition);

        // Add the declaration and expected result to assertions, this will be used when we verify
        // the translated file
        assertions.add(new Pair(declaration, pair.second()));

        // Add the extra conditions and then the code
        // The extra conditions here aren't surrounded by a quantifier, so we must add them each as
        // assertions
        List<String> extras = conditions.pop();
View Full Code Here

                Map<Integer, Code> binding = new HashMap();
                binding.put(0, Code.FunCall(type, Code.Variable(type.from(), 1), code.nid));

                // Substitute and instantiate to get the new operand for the assertion
                Code operand = function.constraint.substitute(binding).instantiate(generics);
                Pair<SemanticType, Integer>[] types = new Pair[] {new Pair(type.from(), 1)};
                // TODO: What type should a quantifier have?
                Code assertion = Code.Quantifier(SemanticType.Bool, Code.Op.FORALL, operand, types);

                block.append(new Stmt.Assert(translate(assertion)));
            }
View Full Code Here

TOP

Related Classes of wycc.util.Pair

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.