Examples of MismatchedTokenException


Examples of org.antlr.runtime.MismatchedTokenException

      String query = "ship = load 'x';";
      try {
            ParserTestingUtils.generateLogicalPlan( query );
        } catch(Exception ex) {
            Assert.assertTrue( ex instanceof MismatchedTokenException );
            MismatchedTokenException mex = (MismatchedTokenException)ex;
            Assert.assertTrue( mex.token.getText().equals("ship") );
            return;
        }
        Assert.fail( "Query is supposed to be failing." );
    }
View Full Code Here

Examples of org.antlr.runtime.MismatchedTokenException

      String query = "A = load 'y'; all = load 'x';";
      try {
            ParserTestingUtils.generateLogicalPlan( query );
        } catch(Exception ex) {
            Assert.assertTrue( ex instanceof MismatchedTokenException );
            MismatchedTokenException mex = (MismatchedTokenException)ex;
            Assert.assertTrue( mex.token.getText().equals("all") );
            return;
        }
        Assert.fail( "Query is supposed to be failing." );
    }
View Full Code Here

Examples of org.antlr.runtime.MismatchedTokenException

    }

    protected void mismatch(IntStream input, int ttype, BitSet follow)
        throws RecognitionException {

      throw new MismatchedTokenException(ttype, input);
    }
View Full Code Here

Examples of org.antlr.runtime.MismatchedTokenException

                              null,
                              DroolsEditorType.IDENTIFIER );
            if ( state.failed ) return null;
            return StringUtils.unescapeJava( safeStripStringDelimiters( id.getText() ) );
        } else {
            throw new MismatchedTokenException( DRLLexer.ID,
                                                input );
        }
    }
View Full Code Here

Examples of org.antlr.runtime.MismatchedTokenException

        if ( text != null ) {
            e = new DroolsMismatchedTokenException( ttype,
                                                    text,
                                                    input );
        } else {
            e = new MismatchedTokenException( ttype,
                                              input );
        }
        throw e;
    }
View Full Code Here

Examples of org.antlr.runtime.MismatchedTokenException

     */
    private List<String> createErrorMessage( RecognitionException e ) {
        List<String> codeAndMessage = new ArrayList<String>( 2 );
        String message = "";
        if ( e instanceof MismatchedTokenException ) {
            MismatchedTokenException mte = (MismatchedTokenException) e;
            String expecting = mte instanceof DroolsMismatchedTokenException ? ((DroolsMismatchedTokenException)mte).getTokenText() : getBetterToken( mte.expecting );
            if ( tokenNames != null && mte.expecting >= 0 && mte.expecting < tokenNames.length ) {
                message = String
                        .format(
                                 DroolsParserExceptionFactory.MISMATCHED_TOKEN_MESSAGE_COMPLETE,
View Full Code Here

Examples of org.antlr.runtime.MismatchedTokenException

                              null,
                              DroolsEditorType.IDENTIFIER );
            if ( state.failed ) return null;
            return StringUtils.unescapeJava( safeStripStringDelimiters( id.getText() ) );
        } else {
            throw new MismatchedTokenException( DRL6Lexer.ID,
                                                input );
        }
    }
View Full Code Here

Examples of org.antlr.runtime.MismatchedTokenException

        if ( text != null ) {
            e = new DroolsMismatchedTokenException( ttype,
                                                    text,
                                                    input );
        } else {
            e = new MismatchedTokenException( ttype,
                                              input );
        }
        throw e;
    }
View Full Code Here

Examples of org.antlr.runtime.MismatchedTokenException

                    DroolsEditorType.IDENTIFIER);
            if (state.failed)
                return null;
            return StringUtils.unescapeJava(safeStripStringDelimiters(id.getText()));
        } else {
            throw new MismatchedTokenException(DRL6Lexer.ID,
                    input);
        }
    }
View Full Code Here

Examples of org.antlr.runtime.MismatchedTokenException

        if (text != null) {
            e = new DroolsMismatchedTokenException(ttype,
                    text,
                    input);
        } else {
            e = new MismatchedTokenException(ttype,
                    input);
        }
        throw e;
    }
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.