Examples of ANTLRMessage


Examples of org.antlr.v4.tool.ANTLRMessage

    antlr.processGrammarsOnCommandLine();

    if ( !defaultListener && !equeue.errors.isEmpty() ) {
      System.err.println("antlr reports errors from "+options);
      for (int i = 0; i < equeue.errors.size(); i++) {
        ANTLRMessage msg = equeue.errors.get(i);
        System.err.println(msg);
      }
      System.out.println("!!!\ngrammar:");
      try {
        System.out.println(new String(Utils.readFile(tmpdir+"/"+grammarFileName)));
      }
      catch (IOException ioe) {
        System.err.println(ioe.toString());
      }
      System.out.println("###");
    }
    if ( !defaultListener && !equeue.warnings.isEmpty() ) {
      System.err.println("antlr reports warnings from "+options);
      for (int i = 0; i < equeue.warnings.size(); i++) {
        ANTLRMessage msg = equeue.warnings.get(i);
        System.err.println(msg);
      }
    }

    return equeue;
View Full Code Here

Examples of org.antlr.v4.tool.ANTLRMessage

  protected void checkGrammarSemanticsError(ErrorQueue equeue,
                        GrammarSemanticsMessage expectedMessage)
    throws Exception
  {
    ANTLRMessage foundMsg = null;
    for (int i = 0; i < equeue.errors.size(); i++) {
      ANTLRMessage m = equeue.errors.get(i);
      if (m.getErrorType()==expectedMessage.getErrorType() ) {
        foundMsg = m;
      }
    }
    assertNotNull("no error; "+expectedMessage.getErrorType()+" expected", foundMsg);
    assertTrue("error is not a GrammarSemanticsMessage",
View Full Code Here

Examples of org.antlr.v4.tool.ANTLRMessage

  protected void checkGrammarSemanticsWarning(ErrorQueue equeue,
                          GrammarSemanticsMessage expectedMessage)
    throws Exception
  {
    ANTLRMessage foundMsg = null;
    for (int i = 0; i < equeue.warnings.size(); i++) {
      ANTLRMessage m = equeue.warnings.get(i);
      if (m.getErrorType()==expectedMessage.getErrorType() ) {
        foundMsg = m;
      }
    }
    assertNotNull("no error; "+expectedMessage.getErrorType()+" expected", foundMsg);
    assertTrue("error is not a GrammarSemanticsMessage",
View Full Code Here

Examples of org.antlr.v4.tool.ANTLRMessage

  protected void checkError(ErrorQueue equeue,
                ANTLRMessage expectedMessage)
    throws Exception
  {
    //System.out.println("errors="+equeue);
    ANTLRMessage foundMsg = null;
    for (int i = 0; i < equeue.errors.size(); i++) {
      ANTLRMessage m = equeue.errors.get(i);
      if (m.getErrorType()==expectedMessage.getErrorType() ) {
        foundMsg = m;
      }
    }
    assertTrue("no error; "+expectedMessage.getErrorType()+" expected", !equeue.errors.isEmpty());
    assertTrue("too many errors; "+equeue.errors, equeue.errors.size()<=1);
View Full Code Here

Examples of org.antlr.v4.tool.ANTLRMessage

    else {
      for (ANTLRToolListener l : listeners) l.warning(msg);
    }

    if (warnings_are_errors) {
      errMgr.emit(ErrorType.WARNING_TREATED_AS_ERROR, new ANTLRMessage(ErrorType.WARNING_TREATED_AS_ERROR));
    }
  }
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.