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

Examples of uk.co.badgersinfoil.metaas.impl.antlr.LinkedListTree


    addStatement(tryStmt);
    return new ASTASTryStatement(tryStmt);
  }

  public ASContinueStatement newContinue() {
    LinkedListTree breakStmt = ASTBuilder.newContinueStatement();
    addStatement(breakStmt);
    return new ASTASContinueStatement(breakStmt);
  }
View Full Code Here


    addStatement(breakStmt);
    return new ASTASContinueStatement(breakStmt);
  }

  public ASThrowStatement newThrow(Expression t) {
    LinkedListTree throwStmt = ASTBuilder.newThrowStatement(ast(t));
    addStatement(throwStmt);
    return new ASTASThrowStatement(throwStmt);
  }
View Full Code Here

    addStatement(throwStmt);
    return new ASTASThrowStatement(throwStmt);
  }

  public ASDefaultXMLNamespaceStatement newDefaultXMLNamespace(String namespace) {
    LinkedListTree nsStmt = ASTBuilder.newDefaultXMLNamespace(ASTBuilder.newString(namespace));
    addStatement(nsStmt);
    return new ASTASDefaultXMLNamespaceStatement(nsStmt);
  }
View Full Code Here

   * NB doesn't do indentation properly, so add the block to the statement
   * before the statement is added to its container.
   */
  private static LinkedListTree appendBlock(LinkedListTree ast) {
    ast.appendToken(TokenBuilder.newSpace());
    LinkedListTree block = ASTBuilder.newBlock();
    ast.addChildWithTokens(block);
    return block;
  }
View Full Code Here

      parser = regexpParserOn(new StringReader(tail), stream);
    } catch (IOException e) {
      // TODO: better exception type?
      throw new RuntimeException(e);
    }
    LinkedListTree ast = AS3FragmentParser.tree(parser.regexpLiteral());
    tail = parser.getInputTail();
    // skip over the regexp in the original, underlying CharStream
    cs.seek(cs.index() + (initialTailLength - tail.length()));
    LinkedListTokenSource source = (LinkedListTokenSource)stream.getTokenSource();
    stream.setTokenSource(source)// cause any remembered RegexpSimple state to be dropped
View Full Code Here

  public ASTASWithStatement(LinkedListTree ast) {
    super(ast);
  }

  protected StatementContainer getStatementContainer() {
    LinkedListTree body = body();
    if (body.getType() != AS3Parser.BLOCK) {
      throw new SyntaxException("'with' body is not a block");
    }
    return new ASTStatementList(body);
  }
View Full Code Here

  private LinkedListTree scope() {
    return ast.getFirstChild();
  }

  public void setScope(String expr) {
    LinkedListTree cond = AS3FragmentParser.parseCondition(expr);
    ast.setChildWithTokens(INDEX_CONDITION, cond);
  }
View Full Code Here

  }

  public List getCatchClauses() {
    List results = new ArrayList();
    ASTIterator i = new ASTIterator(ast);
    LinkedListTree catchClause;
    while ((catchClause = i.search(AS3Parser.CATCH)) != null) {
      results.add(new ASTASCatchClause(catchClause));
    }
    return Collections.unmodifiableList(results);
  }
View Full Code Here

  private LinkedListTree finallyClause() {
    return ASTUtils.findChildByType(ast, AS3Parser.FINALLY);
  }

  public ASFinallyClause getFinallyClause() {
    LinkedListTree finallyClause = finallyClause();
    if (finallyClause == null) {
      return null;
    }
    return new ASTASFinallyClause(finallyClause);
  }
View Full Code Here

    }
    return new ASTASFinallyClause(finallyClause);
  }

  public ASFinallyClause newFinallyClause() {
    LinkedListTree finallyClause = finallyClause();
    if (finallyClause != null) {
      throw new SyntaxException("only one finally-clause allowed");
    }
    finallyClause = ASTBuilder.newFinallyClause();
    ast.addChildWithTokens(finallyClause);
View Full Code Here

TOP

Related Classes of uk.co.badgersinfoil.metaas.impl.antlr.LinkedListTree

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.