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

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


        final Func f = x.fun;
        final int n = f.count();
        final Object candidate = n==0 ? cacheForConstants.get(f) : null;
        if (candidate!=null) return candidate;
        final Expr body = f.getBody();
        if (body.type().arity()<0 || body.type().arity()!=f.returnDecl.type().arity()) throw new ErrorType(body.span(), "Function return value not fully resolved.");
        for(Func ff:current_function) if (ff==f) throw new ErrorSyntax(x.span(), ""+f+" cannot call itself recursively!");
        Env<ExprVar,Object> newenv = new Env<ExprVar,Object>();
        List<SimTupleset> list = new ArrayList<SimTupleset>(x.args.size());
        for(int i=0; i<n; i++) { SimTupleset ts = cset(x.args.get(i)); newenv.put(f.get(i), ts);  list.add(ts); }
        final SimCallback cb = callbacks.get(f);
View Full Code Here


            {
              Expr RESULT =null;
        Pos a = (Pos)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-3)).value;
        List<Expr> b = (List<Expr>)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-1)).value;
        Pos c = (Pos)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.peek()).value;
         Expr aa=ExprVar.make(a, "int");             for(Expr bb:b) aa=t(aa.span().merge(bb.span()), c, bb, aa, c); RESULT=aa;
              CUP$CompParser$result = parser.getSymbolFactory().newSymbol("BracketExprB",5, RESULT);
            }
          return CUP$CompParser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
 
View Full Code Here

            {
              Expr RESULT =null;
        Pos a = (Pos)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-3)).value;
        List<Expr> b = (List<Expr>)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-1)).value;
        Pos c = (Pos)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.peek()).value;
         Expr aa=ExprVar.make(a, "int");             for(Expr bb:b) aa=t(aa.span().merge(bb.span()), c, bb, aa, c); RESULT=aa;
              CUP$CompParser$result = parser.getSymbolFactory().newSymbol("BracketExprB",5, RESULT);
            }
          return CUP$CompParser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
 
View Full Code Here

            {
              Expr RESULT =null;
        Pos a = (Pos)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-3)).value;
        List<Expr> b = (List<Expr>)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-1)).value;
        Pos c = (Pos)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.peek()).value;
         Expr aa=ExprVar.make(a, "pred/totalOrder"); for(Expr bb:b) aa=t(aa.span().merge(bb.span()), c, bb, aa, c); RESULT=aa;
              CUP$CompParser$result = parser.getSymbolFactory().newSymbol("BracketExprB",5, RESULT);
            }
          return CUP$CompParser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
 
View Full Code Here

            {
              Expr RESULT =null;
        Pos a = (Pos)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-3)).value;
        List<Expr> b = (List<Expr>)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-1)).value;
        Pos c = (Pos)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.peek()).value;
         Expr aa=ExprVar.make(a, "disj");            for(Expr bb:b) aa=t(aa.span().merge(bb.span()), c, bb, aa, c); RESULT=aa;
              CUP$CompParser$result = parser.getSymbolFactory().newSymbol("BracketExprB",5, RESULT);
            }
          return CUP$CompParser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
 
View Full Code Here

            {
              Expr RESULT =null;
        Expr a = (Expr)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-3)).value;
        List<Expr> b = (List<Expr>)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-1)).value;
        Pos c = (Pos)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.peek()).value;
         Expr aa=a;                                  for(Expr bb:b) aa=t(aa.span().merge(bb.span()), c, bb, aa, c); RESULT=aa;
              CUP$CompParser$result = parser.getSymbolFactory().newSymbol("BracketExprB",5, RESULT);
            }
          return CUP$CompParser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
 
View Full Code Here

   if (e==null) e = ExprConstant.Op.TRUE.make(o, 0);
   ExprVar cc = (c!=null && c.size()>0) ? c.remove(c.size()-1) : null;
   for(ExprVar bb:b) {
      parser.alloymodule.addSig(bb.label, cc, c, d, e,
         AttrType.WHERE   .makenull(bb.pos.merge(e==null ? o : e.span())),
         AttrType.ABSTRACT.makenull(a.get(0)),
         AttrType.LONE    .makenull(a.get(1)),
         AttrType.ONE     .makenull(a.get(2)),
         AttrType.SOME    .makenull(a.get(3)),
         AttrType.PRIVATE .makenull(a.get(4)));
View Full Code Here

        Pos p = (Pos)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-5)).value;
        Pos o = (Pos)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-4)).value;
        ExprVar f = (ExprVar)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-3)).value;
        ExprVar n = (ExprVar)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-1)).value;
        Expr v = (Expr)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.peek()).value;
         nod(n); parser.alloymodule.addFunc(o.merge(v.span()), p, n.label, f   , null , null, v);
              CUP$CompParser$result = parser.getSymbolFactory().newSymbol("Predicate",53, RESULT);
            }
          return CUP$CompParser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
 
View Full Code Here

        Pos o = (Pos)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-7)).value;
        ExprVar f = (ExprVar)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-6)).value;
        ExprVar n = (ExprVar)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-4)).value;
        List<Decl> d = (List<Decl>)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-2)).value;
        Expr v = (Expr)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.peek()).value;
         nod(n); parser.alloymodule.addFunc(o.merge(v.span()), p, n.label, f   , d    , null, v);
              CUP$CompParser$result = parser.getSymbolFactory().newSymbol("Predicate",53, RESULT);
            }
          return CUP$CompParser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
 
View Full Code Here

        Pos o = (Pos)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-7)).value;
        ExprVar f = (ExprVar)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-6)).value;
        ExprVar n = (ExprVar)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-4)).value;
        List<Decl> d = (List<Decl>)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.elementAt(CUP$CompParser$top-2)).value;
        Expr v = (Expr)((java_cup_11a.runtime.Symbol) CUP$CompParser$stack.peek()).value;
         nod(n); parser.alloymodule.addFunc(o.merge(v.span()), p, n.label, f   , d    , null, v);
              CUP$CompParser$result = parser.getSymbolFactory().newSymbol("Predicate",53, RESULT);
            }
          return CUP$CompParser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
 
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.