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

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


  public static LinkedListTree newObjectField(String name,
                                              LinkedListTree value)
  {
    LinkedListTree field = ASTUtils.newImaginaryAST(AS3Parser.OBJECT_FIELD);
    field.addChildWithTokens(AS3FragmentParser.parseSimpleIdent(name));
    field.appendToken(TokenBuilder.newColon());
    field.appendToken(TokenBuilder.newSpace());
    field.addChildWithTokens(value);
    return field;
  }
View Full Code Here


  {
    LinkedListTree field = ASTUtils.newImaginaryAST(AS3Parser.OBJECT_FIELD);
    field.addChildWithTokens(AS3FragmentParser.parseSimpleIdent(name));
    field.appendToken(TokenBuilder.newColon());
    field.appendToken(TokenBuilder.newSpace());
    field.addChildWithTokens(value);
    return field;
  }

  public static LinkedListTree newThrowStatement(LinkedListTree ast) {
    LinkedListTree thrw = ASTUtils.newAST(AS3Parser.THROW, "throw");
View Full Code Here

  }

  public static LinkedListTree newThrowStatement(LinkedListTree ast) {
    LinkedListTree thrw = ASTUtils.newAST(AS3Parser.THROW, "throw");
    thrw.appendToken(TokenBuilder.newSpace());
    thrw.addChildWithTokens(ast);
    thrw.appendToken(TokenBuilder.newSemi());
    return thrw;
  }

  public static LinkedListTree dup(LinkedListTree ast) {
View Full Code Here

  {
    LinkedListTree ast = ASTUtils.newImaginaryAST(AS3Parser.E4X_FILTER);
    assertNoParent("target expression", target);
    assertNoParent("query expression", target);
    // don't use addChildWithTokens(); special handling below,
    ast.addChildWithTokens(target);
    ast.appendToken(TokenBuilder.newDot());
    ast.appendToken(TokenBuilder.newLParen());
    ast.addChildWithTokens(selector);
    ast.appendToken(TokenBuilder.newRParen());
    return ast;
View Full Code Here

    assertNoParent("query expression", target);
    // don't use addChildWithTokens(); special handling below,
    ast.addChildWithTokens(target);
    ast.appendToken(TokenBuilder.newDot());
    ast.appendToken(TokenBuilder.newLParen());
    ast.addChildWithTokens(selector);
    ast.appendToken(TokenBuilder.newRParen());
    return ast;
  }

  public static LinkedListTree newStarAttribute() {
View Full Code Here

  public static LinkedListTree newExpressionAttribute(LinkedListTree expr) {
    LinkedListTree ast = ASTUtils.newImaginaryAST(AS3Parser.E4X_ATTRI_EXPR);
    ast.appendToken(TokenBuilder.newAt());
    ast.appendToken(TokenBuilder.newLBrack());
    ast.addChildWithTokens(expr);
    ast.appendToken(TokenBuilder.newRBrack());
    return ast;
  }

  public static LinkedListTree newString(String value) {
View Full Code Here

    ast.appendToken(TokenBuilder.newSpace());
    ast.appendToken(TokenBuilder.newNamespace());
    ast.appendToken(TokenBuilder.newSpace());
    ast.appendToken(TokenBuilder.newAssign());
    ast.appendToken(TokenBuilder.newSpace());
    ast.addChildWithTokens(namespace);
    ast.appendToken(TokenBuilder.newSemi());
    return ast;
  }
}
View Full Code Here

    // hide default ctor
  }

  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) {
View Full Code Here

    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();
    pkg.addChildWithTokens(packageBlock);
    String className = typeNameFrom(qualifiedName);
   
View Full Code Here

    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();
    pkg.addChildWithTokens(packageBlock);
   
    LinkedListTree iface = synthesizeAS3Interface(qualifiedName);
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.