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

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


      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


            for(Decl d: f.decls) {
               TempList<ExprVar> tmpvars = new TempList<ExprVar>();
               Expr val = cx.check(d.expr).resolve_as_set(warns);
               if (!val.errors.isEmpty()) { err = true; errors = errors.make(val.errors); }
               for(ExprHasName n: d.names) {
                  ExprVar v = ExprVar.make(n.span(), n.label, val.type());
                  cx.put(n.label, v);
                  tmpvars.add(v);
                  rep.typecheck((f.isPred?"pred ":"fun ")+fullname+", Param "+n.label+": "+v.type()+"\n");
               }
               tmpdecls.add(new Decl(d.isPrivate, d.disjoint, d.disjoint2, tmpvars.makeConst(), val));
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.