Package wyvern.targets.Common.wyvernIL.IL.Def

Examples of wyvern.targets.Common.wyvernIL.IL.Def.ValDef


    TLFromAST recVisitor = TLFromASTApply(rec);
    VarRef temp = getTemp(), argsRes = getTemp();
    if (arg != null) {
      VarRef res = getTemp();
      this.statements.addAll(recVisitor.getStatements());
      this.statements.add(new Defn(new ValDef(temp.getName(), recVisitor.getExpr(), rec.getType())));
      this.statements.addAll(argVisitor.getStatements());
      this.statements.add(new Defn(new ValDef(argsRes.getName(), argVisitor.getExpr(), arg.getType())));
      this.statements.add(new Defn(new ValDef(res.getName(), new BinOp(temp, argsRes, name), invocation.getType())));
      this.expr = new Immediate(res);
      return;
    }

    this.statements.addAll(recVisitor.getStatements());
    this.statements.add(new Defn(new ValDef(temp.getName(), recVisitor.getExpr(), rec.getType())));
    this.expr = new Inv(temp, name);
  }
View Full Code Here


    TypedAST func = application.getFunction();

    VarRef funv = getTemp();
    TLFromAST funcVisitor = TLFromASTApply(func);
    this.statements.addAll(funcVisitor.getStatements());
    this.statements.add(new Defn(new ValDef(funv.getName(), funcVisitor.getExpr(), func.getType())));

    TLFromAST argVisitor = TLFromASTApply(arg);
    this.statements.addAll(argVisitor.getStatements());
    VarRef argv = getTemp();
    this.statements.add(new Defn(new ValDef(argv.getName(), argVisitor.getExpr(), arg.getType())));
   
    this.expr = new FnInv (funv, argv);
  }
View Full Code Here

      TLFromAST argVisitor = new TLFromAST();
     
      cArg.accept(argVisitor);
     
      this.statements.addAll(argVisitor.getStatements());
      defs.add(new ValDef(arg.getKey(), argVisitor.getExpr(), arg.getValue().getType()));
    }

    ArrayList<Definition> addedDecls = new ArrayList<>(), addedClassDecls = new ArrayList<>();
    ArrayList<Statement> initalizers = new ArrayList<>();
    new ExnFromAST().getClassBody(new1.getDecls(), addedDecls, addedClassDecls, initalizers);
View Full Code Here

      TLFromAST visitor = new TLFromAST();
      cast.accept(visitor);

      stmts.addAll(visitor.getStatements());
      VarRef tempRef = getTemp();
      stmts.add(new Defn(new ValDef(tempRef.getName(), visitor.getExpr(), object.getType())));
      ops.add(tempRef);
    }

    this.statements = stmts;
    this.expr = new Immediate(new TupleValue(ops));
View Full Code Here

      statements.add(new IfStmt(tl.getExpr(),ifT));
      statements.add(new Goto(next));
      statements.add(ifT);
      List<Statement> bodyAST = getBodyAST(clause.getBody());
      if (bodyAST.size() == 0) {
        statements.add(new Defn(new ValDef(result, new Immediate(new UnitValue()), Unit.getInstance())));
      } else {
        Statement last = bodyAST.get(bodyAST.size()-1);
        List<Statement> notLast = bodyAST.subList(0,bodyAST.size()-1);
        statements.addAll(notLast);

        if (!(last instanceof Pure)) {
          statements.add(last);
          statements.add(new Defn(new ValDef(result, new Immediate(new UnitValue()), Unit.getInstance())));
        } else
          statements.add(new Defn(new ValDef(result, ((Pure)last).getExpression(), ifExpr.getType())));
      }
      statements.add(new Goto(end));
    }
    statements.add(next);
    statements.add(new Goto(end));
View Full Code Here

TOP

Related Classes of wyvern.targets.Common.wyvernIL.IL.Def.ValDef

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.