Package wyvern.targets.Common.wyvernIL.IL

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


  @Override
  public void visit(DefDeclaration meth) {
    List<Statement> stmts = getBodyAST(meth.getBody());
    List<NameBinding> argBindings = meth.getArgBindings();
    List<Def.Param> params = getParams(argBindings);
    statements.add(new Defn(new Def(meth.getName(), params, stmts)));
  }
View Full Code Here


    List<Statement> initalizer = new LinkedList<>();

    DeclSequence decls = cd.getDecls();
    getClassBody(decls, definitions, classDefs, initalizer);
    classDefs.add(new Def("$init", new LinkedList<Def.Param>(), initalizer));
    return new ClassDef(cd.getName(), definitions, classDefs, cd.getOType());
  }
View Full Code Here

  public void getClassBody(DeclSequence decls, List<Definition> definitions, List<Definition> classDefs, List<Statement> initializer) {
    for (Declaration decl : decls.getDeclIterator()) {
      if (decl instanceof DefDeclaration) {
        List<Statement> bodyAST = getBodyAST(((DefDeclaration) decl).getBody());
        Def e = new Def(decl.getName(), getParams(((DefDeclaration) decl).getArgBindings()), bodyAST);
        if (((DefDeclaration) decl).isClassMember())
          classDefs.add(e);
        else
          definitions.add(e);
      } else if (decl instanceof ValDeclaration) {
View Full Code Here

  private TypeDef getTypeDecl(TypeDeclaration interfaceDeclaration, DeclSequence decls) {
    List<Definition> definitions = new LinkedList<>();
    for (Declaration decl : decls.getDeclIterator()) {
      if (decl instanceof DefDeclaration) {
        definitions.add(new Def(decl.getName(), getParams(((DefDeclaration) decl).getArgBindings()), null));
      } else if (decl instanceof ValDeclaration) {
        definitions.add(new ValDef(decl.getName(), null, decl.getType()));
      } else if (decl instanceof VarDeclaration) {
        definitions.add(new VarDef(decl.getName(), null, decl.getType()));
      } else if (decl instanceof TypeDeclaration) {
View Full Code Here

TOP

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

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.