Package wyvern.tools.typedAST.interfaces

Examples of wyvern.tools.typedAST.interfaces.CoreAST.accept()


      return null;
    if (!(in instanceof CoreAST))
      throw new RuntimeException();
    CoreAST ast = (CoreAST) in;
    TLFromAST t = new TLFromAST();
    ast.accept(t);
    return t;
  }
  private List<Statement> getBodyAST(TypedAST in) {
    if (!(in instanceof CoreAST))
      throw new RuntimeException();
View Full Code Here


  private List<Statement> getBodyAST(TypedAST in) {
    if (!(in instanceof CoreAST))
      throw new RuntimeException();
    CoreAST ast = (CoreAST) in;
    ExnFromAST t = new ExnFromAST();
    ast.accept(t);
    return t.statements;
  }

  @Override
  public void visit(ValDeclaration valDeclaration) {
View Full Code Here

        throw new RuntimeException();
      }

      CoreAST cast = (CoreAST)ast;
      ExnFromAST visitor = new ExnFromAST();
      cast.accept(visitor);

      foo.addAll(visitor.getStatments());
    }

    this.statements = foo;
View Full Code Here

      throw new RuntimeException();
    CoreAST cast = (CoreAST) input;
    TLFromAST.flushInts();
    New.resetGenNum();
    ExnFromAST visitor = new ExnFromAST();
    cast.accept(visitor);
    return visitor.getStatments();
  }
  private static String join(List<Statement> list) {

    StringBuilder sb = new StringBuilder();
View Full Code Here

      return null;
    if (!(in instanceof CoreAST))
      throw new RuntimeException();
    CoreAST ast = (CoreAST) in;
    TLFromAST t = new TLFromAST();
    ast.accept(t);
    return t;
  }
  private List<Statement> getBodyAST(TypedAST in) {
    if (!(in instanceof CoreAST))
      throw new RuntimeException();
View Full Code Here

  private List<Statement> getBodyAST(TypedAST in) {
    if (!(in instanceof CoreAST))
      throw new RuntimeException();
    CoreAST ast = (CoreAST) in;
    ExnFromAST t = new ExnFromAST();
    ast.accept(t);
    return t.getStatments();
  }

  @Override
  public void visit(Fn fn) {
View Full Code Here

      throw new RuntimeException();
   
    CoreAST cBody = (CoreAST) body;
    ExnFromAST visitor = new ExnFromAST();
   
    cBody.accept(visitor);
    innerStatements.addAll(visitor.getStatments());
    LinkedList<Def.Param> params = new LinkedList<>();
    for (NameBinding binding : bindings) {
      params.add(new Def.Param(binding.getName(), binding.getType()));
    }
View Full Code Here

        throw new RuntimeException();
     
      CoreAST cArg = (CoreAST) arg.getValue();
      TLFromAST argVisitor = new TLFromAST();
     
      cArg.accept(argVisitor);
     
      this.statements.addAll(argVisitor.getStatements());
      defs.add(new ValDef(arg.getKey(), argVisitor.getExpr(), arg.getValue().getType()));
    }
View Full Code Here

        throw new RuntimeException();
      }

      CoreAST cast = (CoreAST) object;
      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);
View Full Code Here

   
    TLFromAST dstVisitor = new TLFromAST();
    cDst.accept(dstVisitor);
   
    TLFromAST srcVisitor = new TLFromAST();
    cSrc.accept(srcVisitor);
   
    this.statements.addAll(dstVisitor.getStatements());   
    this.statements.addAll(srcVisitor.getStatements());
    this.statements.add(new Assign(dstVisitor.getExpr(), srcVisitor.getExpr()));
  }
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.