Examples of DiagnosticErrorListener


Examples of org.antlr.v4.runtime.DiagnosticErrorListener

//    lexer.setTokenFactory(factory);
    CommonTokenStream tokens = new CommonTokenStream(lexer);
   
    MsonParser parser = new MsonParser(tokens);
//    parser.setTokenFactory(factory);
    parser.addErrorListener(new DiagnosticErrorListener());
    parser.getInterpreter().setPredictionMode(
        PredictionMode.LL_EXACT_AMBIG_DETECTION);
    parser.setBuildParseTree(true);
    ParseTree tree = parser.mson();
    // show tree in text form
View Full Code Here

Examples of org.antlr.v4.runtime.DiagnosticErrorListener

      }

      if ( startRuleName.equals(LEXER_START_RULE_NAME) ) return;

      if ( diagnostics ) {
        parser.addErrorListener(new DiagnosticErrorListener());
        parser.getInterpreter().setPredictionMode(PredictionMode.LL_EXACT_AMBIG_DETECTION);
      }

      if ( printTree || gui || psFile!=null ) {
        parser.setBuildParseTree(true);
View Full Code Here

Examples of org.antlr.v4.runtime.DiagnosticErrorListener

//      long stop = System.currentTimeMillis();
//      lexerTime += stop-start;

      // Create a parser that reads from the scanner
      JavaParser parser = new JavaParser(tokens);
      if ( diag ) parser.addErrorListener(new DiagnosticErrorListener());
      if ( bail ) parser.setErrorHandler(new BailErrorStrategy());
      if ( SLL ) parser.getInterpreter().setPredictionMode(PredictionMode.SLL);

      // start parsing at the compilationUnit rule
      ParserRuleContext t = parser.compilationUnit();
View Full Code Here

Examples of org.antlr.v4.runtime.DiagnosticErrorListener

//      long stop = System.currentTimeMillis();
//      lexerTime += stop-start;

      // Create a parser that reads from the scanner
      Java8Parser parser = new Java8Parser(tokens);
      if ( diag ) parser.addErrorListener(new DiagnosticErrorListener());
      if ( bail ) parser.setErrorHandler(new BailErrorStrategy());
      if ( SLL ) parser.getInterpreter().setPredictionMode(PredictionMode.SLL);

      // start parsing at the compilationUnit rule
      ParserRuleContext t = parser.compilationUnit();
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.