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

Examples of edu.mit.csail.sdg.alloy4compiler.ast.ExprVar


      return obj;
   }

   /** Add an enumeration. */
   void addEnum(Pos pos, Pos priv, ExprVar name, List<ExprVar> atoms, Pos closingBracket) throws Err {
      ExprVar EXTENDS = ExprVar.make(null, "extends");
      ExprVar THIS = ExprVar.make(null, "this/"+name);
      List<ExprVar> THESE = Arrays.asList(THIS);
      if (atoms==null || atoms.size()==0) throw new ErrorSyntax(pos, "Enumeration must contain at least one name.");
      addSig(name.label, null, null, null, null, WHERE.make(name.pos), ABSTRACT.make(name.pos), PRIVATE.makenull(priv), Attr.ENUM);
      for(ExprVar a:atoms) addSig(a.label, EXTENDS, THESE, null, null, WHERE.make(a.pos), ONE.make(a.pos), PRIVATE.makenull(priv));
      int oldStatus = status;
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));
            }
            Expr ret = null;
            if (!f.isPred) {
View Full Code Here

TOP

Related Classes of edu.mit.csail.sdg.alloy4compiler.ast.ExprVar

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.