Examples of grammarSpec()


Examples of org.antlr.v4.parse.ToolANTLRParser.grammarSpec()

      CommonTokenStream tokens = new CommonTokenStream(lexer);
      lexer.tokens = tokens;
      ToolANTLRParser p = new ToolANTLRParser(tokens, this);
      p.setTreeAdaptor(adaptor);
      try {
        ParserRuleReturnScope r = p.grammarSpec();
        GrammarAST root = (GrammarAST)r.getTree();
        if ( root instanceof GrammarRootAST) {
          ((GrammarRootAST)root).hasErrors = lexer.getNumberOfSyntaxErrors()>0 || p.getNumberOfSyntaxErrors()>0;
          assert ((GrammarRootAST)root).tokenStream == tokens;
          if ( grammarOptions!=null ) {
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.