Package org.antlr.runtime

Examples of org.antlr.runtime.FailedPredicateException


                                     expected,
                                     formatParserLocation() );
            codeAndMessage.add( message );
            codeAndMessage.add( "ERR 108" );
        } else if ( e instanceof FailedPredicateException ) {
            FailedPredicateException fpe = (FailedPredicateException) e;
            message = String.format(
                                     DroolsParserExceptionFactory.FAILED_PREDICATE_MESSAGE,
                                     e.line,
                                     e.charPositionInLine,
                                     fpe.ruleName,
View Full Code Here


                    e.line, e.charPositionInLine, getBetterToken(e.token),
                    mse.expecting, formatParserLocation());
            codeAndMessage.add(message);
            codeAndMessage.add("ERR 108");
        } else if (e instanceof FailedPredicateException) {
            FailedPredicateException fpe = (FailedPredicateException) e;
            message = String.format(
                    DroolsParserExceptionFactory.FAILED_PREDICATE_MESSAGE,
                    e.line, e.charPositionInLine, fpe.ruleName,
                    fpe.predicateText, formatParserLocation());
            codeAndMessage.add(message);
View Full Code Here

          e.line, e.charPositionInLine, getBetterToken(e.token),
          mse.expecting, formatParserLocation());
      codeAndMessage.add(message);
      codeAndMessage.add("ERR 106");
    } else if (e instanceof FailedPredicateException) {
      FailedPredicateException fpe = (FailedPredicateException) e;
      message = String.format(
          DroolsParserExceptionFactory.FAILED_PREDICATE_MESSAGE,
          e.line, e.charPositionInLine, fpe.ruleName,
          fpe.predicateText, formatParserLocation());
      codeAndMessage.add(message);
View Full Code Here

            // src/main/resources/org/drools/lang/dsl/DSLMap.g:247:4: ({...}?value= LITERAL -> VT_CONDITION[$value] )
            // src/main/resources/org/drools/lang/dsl/DSLMap.g:247:4: {...}?value= LITERAL
            {
            if ( !(validateIdentifierKey("condition")||validateIdentifierKey("when")) ) {
                if (backtracking>0) {failed=true; return retval;}
                throw new FailedPredicateException(input, "condition_key", "validateIdentifierKey(\"condition\")||validateIdentifierKey(\"when\")");
            }
            value=(Token)input.LT(1);
            match(input,LITERAL,FOLLOW_LITERAL_in_condition_key1259); if (failed) return retval;
            if ( backtracking==0 ) stream_LITERAL.add(value);
View Full Code Here

            // src/main/resources/org/drools/lang/dsl/DSLMap.g:252:4: ({...}?value= LITERAL -> VT_CONSEQUENCE[$value] )
            // src/main/resources/org/drools/lang/dsl/DSLMap.g:252:4: {...}?value= LITERAL
            {
            if ( !(validateIdentifierKey("consequence")||validateIdentifierKey("then")) ) {
                if (backtracking>0) {failed=true; return retval;}
                throw new FailedPredicateException(input, "consequence_key", "validateIdentifierKey(\"consequence\")||validateIdentifierKey(\"then\")");
            }
            value=(Token)input.LT(1);
            match(input,LITERAL,FOLLOW_LITERAL_in_consequence_key1282); if (failed) return retval;
            if ( backtracking==0 ) stream_LITERAL.add(value);
View Full Code Here

            // src/main/resources/org/drools/lang/dsl/DSLMap.g:257:4: ({...}?value= LITERAL -> VT_KEYWORD[$value] )
            // src/main/resources/org/drools/lang/dsl/DSLMap.g:257:4: {...}?value= LITERAL
            {
            if ( !(validateIdentifierKey("keyword")) ) {
                if (backtracking>0) {failed=true; return retval;}
                throw new FailedPredicateException(input, "keyword_key", "validateIdentifierKey(\"keyword\")");
            }
            value=(Token)input.LT(1);
            match(input,LITERAL,FOLLOW_LITERAL_in_keyword_key1305); if (failed) return retval;
            if ( backtracking==0 ) stream_LITERAL.add(value);
View Full Code Here

            // src/main/resources/org/drools/lang/dsl/DSLMap.g:262:4: ({...}?value= LITERAL -> VT_ANY[$value] )
            // src/main/resources/org/drools/lang/dsl/DSLMap.g:262:4: {...}?value= LITERAL
            {
            if ( !(validateIdentifierKey("*")) ) {
                if (backtracking>0) {failed=true; return retval;}
                throw new FailedPredicateException(input, "any_key", "validateIdentifierKey(\"*\")");
            }
            value=(Token)input.LT(1);
            match(input,LITERAL,FOLLOW_LITERAL_in_any_key1328); if (failed) return retval;
            if ( backtracking==0 ) stream_LITERAL.add(value);

View Full Code Here

                            message.append("mismatched token '"+
                                                               e.token+
                                                               "' expecting set "+mse.expecting);
                    }
                    else if ( e instanceof FailedPredicateException ) {
                            FailedPredicateException fpe = (FailedPredicateException)e;
                            message.append("rule "+fpe.ruleName+" failed predicate: {"+
                                                               fpe.predicateText+"}?");
        }
                     return message.toString();
            }  
View Full Code Here

                                     expected,
                                     formatParserLocation() );
            codeAndMessage.add( message );
            codeAndMessage.add( "ERR 108" );
        } else if ( e instanceof FailedPredicateException ) {
            FailedPredicateException fpe = (FailedPredicateException) e;
            message = String.format(
                                     FAILED_PREDICATE_MESSAGE,
                                     e.line,
                                     e.charPositionInLine,
                                     fpe.ruleName,
View Full Code Here

      MismatchedNotSetException mse = (MismatchedNotSetException)e;
      msg = "mismatched input "+parser.getTokenErrorDisplay(e.token)+
        " expecting set "+mse.expecting;
    }
    else if ( e instanceof FailedPredicateException ) {
      FailedPredicateException fpe = (FailedPredicateException)e;
      msg = "rule "+fpe.ruleName+" failed predicate: {"+
        fpe.predicateText+"}?";
    }
    return msg;
  }
View Full Code Here

TOP

Related Classes of org.antlr.runtime.FailedPredicateException

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.