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

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


    return tryStmt;
  }

  public static LinkedListTree newFinallyClause() {
    LinkedListTree tryStmt = ASTUtils.newAST(AS3Parser.FINALLY, "finally");
    tryStmt.appendToken(TokenBuilder.newSpace());
    tryStmt.addChildWithTokens(newBlock());
    return tryStmt;
  }

  public static LinkedListTree newContinueStatement() {
View Full Code Here


    return tryStmt;
  }

  public static LinkedListTree newContinueStatement() {
    LinkedListTree continueStmt = ASTUtils.newAST(AS3Parser.CONTINUE, "continue");
    continueStmt.appendToken(TokenBuilder.newSemi());
    return continueStmt;
  }

  public static ASBinaryExpression newBinaryExpression(LinkedListToken op, Expression left, Expression right) {
    LinkedListTree ast = ASTUtils.newAST(op);
View Full Code Here

    token.afterInsert(TokenBuilder.newSpace());
  }

  public static LinkedListTree newFunctionExpression() {
    LinkedListTree def = ASTUtils.newImaginaryAST(AS3Parser.FUNC_DEF);
    def.appendToken(TokenBuilder.newFunction());
    def.appendToken(TokenBuilder.newSpace());
    // TODO: placeholder for name?
    def.addChildWithTokens(ASTUtils.newParentheticAST(AS3Parser.PARAMS, AS3Parser.LPAREN, "(", AS3Parser.RPAREN, ")"));
    def.appendToken(TokenBuilder.newSpace());
    LinkedListTree block = newBlock();
View Full Code Here

  }

  public static LinkedListTree newFunctionExpression() {
    LinkedListTree def = ASTUtils.newImaginaryAST(AS3Parser.FUNC_DEF);
    def.appendToken(TokenBuilder.newFunction());
    def.appendToken(TokenBuilder.newSpace());
    // TODO: placeholder for name?
    def.addChildWithTokens(ASTUtils.newParentheticAST(AS3Parser.PARAMS, AS3Parser.LPAREN, "(", AS3Parser.RPAREN, ")"));
    def.appendToken(TokenBuilder.newSpace());
    LinkedListTree block = newBlock();
    def.addChildWithTokens(block);
View Full Code Here

    LinkedListTree def = ASTUtils.newImaginaryAST(AS3Parser.FUNC_DEF);
    def.appendToken(TokenBuilder.newFunction());
    def.appendToken(TokenBuilder.newSpace());
    // TODO: placeholder for name?
    def.addChildWithTokens(ASTUtils.newParentheticAST(AS3Parser.PARAMS, AS3Parser.LPAREN, "(", AS3Parser.RPAREN, ")"));
    def.appendToken(TokenBuilder.newSpace());
    LinkedListTree block = newBlock();
    def.addChildWithTokens(block);
    return def;
  }
View Full Code Here

  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 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;
  }

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

    return field;
  }

  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;
  }
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) {
    Map tokens = dupTokStream(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

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.