Package org.jostraca.comp.antlr.collections

Examples of org.jostraca.comp.antlr.collections.AST


 
  public final void pexpr() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST pexpr_AST = null;
   
    try {      // for error handling
      switch ( LA(1)) {
      case LP:
      {
        match(LP);
        expr();
        astFactory.addASTChild(currentAST, returnAST);
        match(RP);
        pexpr_AST = (AST)currentAST.root;
        break;
      }
      case TRUE:
      {
        AST tmp13_AST = null;
        tmp13_AST = astFactory.create(LT(1));
        astFactory.addASTChild(currentAST, tmp13_AST);
        match(TRUE);
        pexpr_AST = (AST)currentAST.root;
        break;
      }
      case FALSE:
      {
        AST tmp14_AST = null;
        tmp14_AST = astFactory.create(LT(1));
        astFactory.addASTChild(currentAST, tmp14_AST);
        match(FALSE);
        pexpr_AST = (AST)currentAST.root;
        break;
View Full Code Here


        }
    return n;
    }

    private void doWorkForFindAll(Vector v, AST target, boolean partialMatch) {
        AST sibling;

        // Start walking sibling lists, looking for matches.
        siblingWalk:
        for (sibling = this;
             sibling != null;
             sibling = sibling.getNextSibling()) {
            if ((partialMatch && sibling.equalsTreePartial(target)) ||
                (!partialMatch && sibling.equalsTree(target))) {
                v.appendElement(sibling);
            }
            // regardless of match or not, check any children for matches
            if (sibling.getFirstChild() != null) {
                ((BaseAST)sibling.getFirstChild()).doWorkForFindAll(v, target, partialMatch);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.jostraca.comp.antlr.collections.AST

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.