Package org.antlr.runtime

Examples of org.antlr.runtime.MissingTokenException


    }

    public static String getErrorMessage(Throwable e, String[] tokenNames) {
        String msg;
        if (e instanceof MissingTokenException) {
            MissingTokenException mte = (MissingTokenException)e;
            String tokenName;
            if (mte.expecting== Token.EOF) {
                tokenName = "EOF";
            } else {
                tokenName = tokenNames[mte.expecting];
View Full Code Here


      }
      msg = "extraneous input "+parser.getTokenErrorDisplay(ute.getUnexpectedToken())+
        " expecting "+tokenName;
    }
    else if ( e instanceof MissingTokenException ) {
      MissingTokenException mte = (MissingTokenException)e;
      String tokenName="<unknown>";
      if ( mte.expecting== Token.EOF ) {
        tokenName = "EOF";
      }
      else {
View Full Code Here

    private void failMissingTokenException() throws MissingTokenException {
        if ( state.backtracking > 0 ) {
            state.failed = true;
        } else {
            throw new MissingTokenException( DRLLexer.STRING,
                                             input,
                                             null );
        }
    }
View Full Code Here

            return matchedSymbol;
        }
        // can't recover with single token deletion, try insertion
        if ( mismatchIsMissingToken( input,
                                     follow ) ) {
            e = new MissingTokenException( ttype,
                                           input,
                                           null );
            reportError( e ); // report after inserting so AW sees the token in the exception
            return null;
        }
View Full Code Here

    private void failMissingTokenException() throws MissingTokenException {
        if ( state.backtracking > 0 ) {
            state.failed = true;
        } else {
            throw new MissingTokenException( DRL6Lexer.STRING,
                                             input,
                                             null );
        }
    }
View Full Code Here

            return matchedSymbol;
        }
        // can't recover with single token deletion, try insertion
        if ( mismatchIsMissingToken( input,
                                     follow ) ) {
            e = new MissingTokenException( ttype,
                                           input,
                                           null );
            reportError( e ); // report after inserting so AW sees the token in the exception
            return null;
        }
View Full Code Here

    void failMissingTokenException() throws MissingTokenException {
        if (state.backtracking > 0) {
            state.failed = true;
        } else {
            throw new MissingTokenException(DRL6Lexer.STRING,
                    input,
                    null);
        }
    }
View Full Code Here

            return matchedSymbol;
        }
        // can't recover with single token deletion, try insertion
        if (mismatchIsMissingToken(input,
                follow)) {
            e = new MissingTokenException(ttype,
                    input,
                    null);
            reportError(e); // report after inserting so AW sees the token in the exception
            return null;
        }
View Full Code Here

    private void failMissingTokenException() throws MissingTokenException {
        if ( state.backtracking > 0 ) {
            state.failed = true;
        } else {
            throw new MissingTokenException( DRLLexer.STRING,
                                             input,
                                             null );
        }
    }
View Full Code Here

            return matchedSymbol;
        }
        // can't recover with single token deletion, try insertion
        if ( mismatchIsMissingToken( input,
                                     follow ) ) {
            e = new MissingTokenException( ttype,
                                           input,
                                           null );
            reportError( e ); // report after inserting so AW sees the token in the exception
            return null;
        }
View Full Code Here

TOP

Related Classes of org.antlr.runtime.MissingTokenException

Copyright © 2018 www.massapicom. 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.