Examples of RecognitionException


Examples of org.antlr.runtime.RecognitionException

        assertEquals("unexpected errors: "+equeue, 1, equeue.errors.size());

        int expectedMsgID = ErrorManager.MSG_WILDCARD_AS_ROOT;
        Object expectedArg = null;
        RecognitionException expectedExc = null;
        GrammarSyntaxMessage expectedMessage =
            new GrammarSyntaxMessage(expectedMsgID, g, null, expectedArg, expectedExc);

        checkError(equeue, expectedMessage);       
    }
View Full Code Here

Examples of org.antlr.runtime3_3_0.RecognitionException

      String lineS = elements[3];
      String posS = elements[4];
      Class excClass = null;
      try {
        excClass = Class.forName(excName);
        RecognitionException e =
          (RecognitionException)excClass.newInstance();
        e.index = Integer.parseInt(indexS);
        e.line = Integer.parseInt(lineS);
        e.charPositionInLine = Integer.parseInt(posS);
        listener.recognitionException(e);
View Full Code Here

Examples of org.antlr.v4.runtime.RecognitionException

    public ANTLRErrorStrategy createErrorStrategy() {
        return new BailErrorStrategy() {
            private void bail(Parser recognizer, Exception exc, String additionalHint)
                        throws ParseCancellationException
            {
                RecognitionException re = (RecognitionException)exc.getCause();
                int offendingState = re.getOffendingState();
                Token offendingToken = re.getOffendingToken();
                int offendingTokenType = offendingToken.getType();

                String msg = getErrorMessage(offendingState, offendingTokenType);

                StringBuilder sb = new StringBuilder();
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.antlr.runtime.RecognitionException

      String lineS = elements[3];
      String posS = elements[4];
      Class excClass = null;
      try {
        excClass = Class.forName(excName);
        RecognitionException e =
          (RecognitionException)excClass.newInstance();
        e.index = Integer.parseInt(indexS);
        e.line = Integer.parseInt(lineS);
        e.charPositionInLine = Integer.parseInt(posS);
        listener.recognitionException(e);
View Full Code Here

Examples of org.jostraca.comp.antlr.RecognitionException

    }
    catch( StandardException se ) {
      throw se;
    }
    catch( TokenStreamRecognitionException tsre ) {
      RecognitionException re = tsre.recog;
      if( null != re ) {
        int    lineNumber = re.getLine();
        String line       = TextUtil.getLine( currentContent, lineNumber-1 );
        if( Standard.EMPTY == line ) {
          throw new TemplateParserException( TemplateParserException.CODE_syntax_error, re.getMessage() );
        }
        else {
          throw new TemplateParserException( TemplateParserException.CODE_syntax_error, line );
        }
      }
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.