Examples of ANTLRErrorStrategy


Examples of org.antlr.v4.runtime.ANTLRErrorStrategy

  private EquationGrammarParser getParser(final String equation) {
    final ANTLRInputStream input = new ANTLRInputStream(equation);
    final EquationGrammarLexer lexer = new EquationGrammarLexer(input);
    final TokenStream tokenStream = new CommonTokenStream(lexer);
    final EquationGrammarParser parser = new EquationGrammarParser(tokenStream);
    final ANTLRErrorStrategy handler = new BailErrorStrategy();
    parser.setErrorHandler(handler);
    final ParseTreeListener listener = new EquationGrammerListener();
    parser.addParseListener(listener);
    return parser;
  }
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.