Package edu.mit.csail.sdg.alloy4compiler.ast

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Expr.resolve()


        }
        if (params.size() != args.size()) return this;
        Context cx2 = new Context(realModule, warnings, cx.unrolls-1);
        for(int n=params.size(), i=0; i<n; i++) {
            Expr tmp = args.get(i);
            if (!(tmp instanceof Macro)) tmp = tmp.resolve(tmp.type(), warnings);
            cx2.put(params.get(i).label, tmp);
        }
        return cx2.check(body);
    }
View Full Code Here


      }

      /** {@inheritDoc} */
      @Override public Expr visit(ExprLet x) throws Err {
         Expr right = visitThis(x.expr);
         right = right.resolve(right.type(), warns);
         ExprVar left = ExprVar.make(x.var.pos, x.var.label, right.type());
         put(left.label, left);
         Expr sub = visitThis(x.sub);
         remove(left.label);
         return ExprLet.make(x.pos, left, right, sub);
View Full Code Here

      CompModule m = CompParser.alloy_parseStream(new ArrayList<Object>(), null, fc, null, -1, "", "", 1);
      if (m.funcs.size()==0) throw new ErrorSyntax("The input does not correspond to an Alloy expression.");
      Expr body = m.funcs.values().iterator().next().get(0).getBody();
      Context cx = new Context(this, null);
      body = cx.check(body);
      body = body.resolve(body.type(), null);
      if (body.errors.size()>0) throw body.errors.pick(); else return body;
   }

   /** Throw an exception if the name is already used, or has @ or /, or is univ/Int/none. */
   private void dup(Pos pos, String name, boolean checkSig) throws Err {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.