Package uk.co.badgersinfoil.metaas.impl.antlr

Examples of uk.co.badgersinfoil.metaas.impl.antlr.LinkedListTree.appendToken()


        }
        return;
      }
    }
    LinkedListTree mod = ASTUtils.newAST(modInfo.tokenType, modInfo.keyword);
    mod.appendToken(TokenBuilder.newSpace());
    modifiers.addChildWithTokens(mod);
  }

  private static boolean isVisibilityKeyword(LinkedListTree mod) {
    return getModInfo(mod.getType()) != null;
View Full Code Here


      return ASTUtils.newPlaceholderAST(AS3Parser.MODIFIERS);
    }
    LinkedListTree modifiers = ASTUtils.newImaginaryAST(AS3Parser.MODIFIERS);
    ModInfo modInfo = getModInfo(visibility);
    LinkedListTree mod = ASTUtils.newAST(modInfo.tokenType, modInfo.keyword);
    mod.appendToken(TokenBuilder.newSpace());
    modifiers.addChildWithTokens(mod);
    return modifiers;
  }
}
View Full Code Here

  }

  public static LinkedListTree newExprStmt(LinkedListTree expr) {
    LinkedListTree exprStmt = ASTUtils.newImaginaryAST(AS3Parser.EXPR_STMNT);
    exprStmt.addChildWithTokens(expr);
    exprStmt.appendToken(TokenBuilder.newSemi());
    return exprStmt;
  }

  public static AS3ASTCompilationUnit synthesizeClass(String qualifiedName) {
    LinkedListTree unit = ASTUtils.newImaginaryAST(AS3Parser.COMPILATION_UNIT);
View Full Code Here

  }

  public static AS3ASTCompilationUnit synthesizeClass(String qualifiedName) {
    LinkedListTree unit = ASTUtils.newImaginaryAST(AS3Parser.COMPILATION_UNIT);
    LinkedListTree pkg = ASTUtils.newAST(AS3Parser.PACKAGE, "package");
    pkg.appendToken(TokenBuilder.newSpace());
    unit.addChildWithTokens(pkg);
    pkg.appendToken(TokenBuilder.newSpace());
    String packageName = packageNameFrom(qualifiedName);
    if (packageName != null) {
      pkg.addChildWithTokens(AS3FragmentParser.parseIdent(packageName));
View Full Code Here

  public static AS3ASTCompilationUnit synthesizeClass(String qualifiedName) {
    LinkedListTree unit = ASTUtils.newImaginaryAST(AS3Parser.COMPILATION_UNIT);
    LinkedListTree pkg = ASTUtils.newAST(AS3Parser.PACKAGE, "package");
    pkg.appendToken(TokenBuilder.newSpace());
    unit.addChildWithTokens(pkg);
    pkg.appendToken(TokenBuilder.newSpace());
    String packageName = packageNameFrom(qualifiedName);
    if (packageName != null) {
      pkg.addChildWithTokens(AS3FragmentParser.parseIdent(packageName));
    }
    LinkedListTree packageBlock = newBlock();
View Full Code Here

  public static ASCompilationUnit synthesizeInterface(String qualifiedName) {
    LinkedListTree unit = ASTUtils.newImaginaryAST(AS3Parser.COMPILATION_UNIT);
    LinkedListTree pkg = ASTUtils.newAST(AS3Parser.PACKAGE, "package");
    unit.addChildWithTokens(pkg);
    pkg.appendToken(TokenBuilder.newSpace());
    String packageName = packageNameFrom(qualifiedName);
    if (packageName != null) {
      pkg.addChildWithTokens(AS3FragmentParser.parseIdent(packageName));
    }
    LinkedListTree packageBlock = newBlock();
View Full Code Here

  private static LinkedListTree synthesizeAS3Interface(String qualifiedName) {
    LinkedListTree iface = ASTUtils.newImaginaryAST(AS3Parser.INTERFACE_DEF);
    LinkedListTree modifiers = ASTUtils.newImaginaryAST(AS3Parser.MODIFIERS);
    iface.addChildWithTokens(modifiers);
    modifiers.addChildWithTokens(ASTUtils.newAST(AS3Parser.PUBLIC, "public"));
    modifiers.appendToken(TokenBuilder.newSpace());
    iface.appendToken(TokenBuilder.newInterface());
    iface.appendToken(TokenBuilder.newSpace());
    iface.addChildWithTokens(ASTUtils.newAST(AS3Parser.IDENT, typeNameFrom(qualifiedName)));
    iface.appendToken(TokenBuilder.newSpace());
    iface.addChildWithTokens(newTypeBlock());
View Full Code Here

    return ast.getLastChild();
  }

  public ASSwitchCase newCase(String expr) {
    LinkedListTree caseStmt = ASTUtils.newAST(AS3Parser.CASE, "case");
    caseStmt.appendToken(TokenBuilder.newSpace());
    caseStmt.addChildWithTokens(AS3FragmentParser.parseExpr(expr));
    caseStmt.appendToken(TokenBuilder.newColon());
    LinkedListTree stmtList = ASTUtils.newPlaceholderAST(AS3Parser.SWITCH_STATEMENT_LIST);
    caseStmt.addChildWithTokens(stmtList);
    ASTUtils.addChildWithIndentation(block(), caseStmt);
View Full Code Here

  public ASSwitchCase newCase(String expr) {
    LinkedListTree caseStmt = ASTUtils.newAST(AS3Parser.CASE, "case");
    caseStmt.appendToken(TokenBuilder.newSpace());
    caseStmt.addChildWithTokens(AS3FragmentParser.parseExpr(expr));
    caseStmt.appendToken(TokenBuilder.newColon());
    LinkedListTree stmtList = ASTUtils.newPlaceholderAST(AS3Parser.SWITCH_STATEMENT_LIST);
    caseStmt.addChildWithTokens(stmtList);
    ASTUtils.addChildWithIndentation(block(), caseStmt);
    return new ASTASSwitchCase(caseStmt);
  }
View Full Code Here

    return new ASTASSwitchCase(caseStmt);
  }

  public ASSwitchDefault newDefault() {
    LinkedListTree defaultStmt = ASTUtils.newAST(AS3Parser.DEFAULT, "default");
    defaultStmt.appendToken(TokenBuilder.newColon());
    LinkedListTree stmtList = ASTUtils.newPlaceholderAST(AS3Parser.SWITCH_STATEMENT_LIST);
    defaultStmt.addChildWithTokens(stmtList);
    ASTUtils.addChildWithIndentation(block(), defaultStmt);
    return new ASTASSwitchDefault(defaultStmt);
  }
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.