Package org.antlr.runtime.tree

Examples of org.antlr.runtime.tree.ParseTree


  public void exitRule(String filename, String ruleName) {
    callStack.pop();
  }

  public void consumeToken(Token token) {
    ParseTree ruleNode = (ParseTree)callStack.peek();
    ParseTree elementNode = create(token);
    ruleNode.addChild(elementNode);
  }
View Full Code Here


    ParseTree elementNode = create(token);
    ruleNode.addChild(elementNode);
  }

  public void recognitionException(RecognitionException e) {
    ParseTree ruleNode = (ParseTree)callStack.peek();
    ParseTree errorNode = create(e);
    ruleNode.addChild(errorNode);
  }
View Full Code Here

    if ( parser.getRule(startRule)==null ) {
      System.err.println("Rule "+startRule+" does not exist in "+grammarFileName);
      return;
    }
    Interpreter parseEngine = new Interpreter(parser, tokens);
    ParseTree t = parseEngine.parse(startRule);
    System.out.println(t.toStringTree());
  }
View Full Code Here

TOP

Related Classes of org.antlr.runtime.tree.ParseTree

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.