[antlr-interest] v3: failed predicate?

Terence Parr parrt at cs.usfca.edu
Wed Jan 31 19:55:01 PST 2007


cool
Ter
On Jan 31, 2007, at 7:48 PM, Mark Mandel wrote:

> You can ignore my whinging.. i worked it out... there was nowhere for
> my grammar to go, as I hadn't set the correct gate for it go down.
>
> My bad.
>
> Mark
>
> On 2/1/07, Mark Mandel <mark.mandel at gmail.com> wrote:
>> Anyone? Even a pointer in the right direction?
>>
>> I can't seem to even find out exactly what the error means?
>>
>> I'm guessing it means that the parser expects there to a token of  
>> Type
>> ALIAS at this point, but the gateway condition is false? would  
>> that be
>> correct?
>>
>> Any help would be greatly appreciated.
>>
>> Mark
>>
>> On 1/31/07, Mark Mandel <mark.mandel at gmail.com> wrote:
>> > All,
>> >
>> > I'm running the latest version of ANTLR v3
>> >
>> > I get this error when I run the following input against my grammar:
>> > 'from onetomany.Basic join onetomany.Child'
>> >
>> > rule ALIAS failed predicate: { currentMode == ALIAS_MODE }?
>> >
>> > and I don't know what it means.
>> >
>> > I believe these are the relevant portions of my grammar:
>> >
>> > I've attached the full grammar in case this doesn't explain enough.
>> >
>> > I'm totally stumped.. so any help would be appreciated.
>> >
>> > fromStatement
>> >         :
>> >         FROM^ classClause (joinClause classClause ON  
>> joinCondition)*
>> >         ;
>> >
>> > classClause
>> >         :
>> >         CLASS_IDENTIFIER^ (AS ALIAS)?
>> >         ;
>> >
>> > joinClause
>> >         :
>> >         ((LEFT | RIGHT)? OUTER)? JOIN^
>> >         ;
>> >
>> > joinCondition
>> >         :
>> >         (
>> >         PROPERTY_IDENTIFIER (BOOLEAN_LOGIC PROPERTY_IDENTIFIER)*
>> >         |
>> >         conditionStatement
>> >         )
>> >         ;
>> >
>> > FROM    :
>> >         { currentMode == STRING_MODE }?=>
>> >         'from'
>> >         { setMode(CLASS_IDENTIFIER_MODE); }
>> >         ;
>> > AS      : //special case, not worrying about past mode
>> >         { currentMode == STRING_MODE }?=>
>> >         'as'
>> >         { currentMode = ALIAS_MODE; }
>> >                 ;
>> > ALIAS   :
>> >         { currentMode == ALIAS_MODE }?=>
>> >         LETTER(LETTER|DIGIT|'_')*
>> >         { currentMode = STRING_MODE; }
>> >         ;
>> > JOIN    :
>> >         { currentMode == STRING_MODE }?=>
>> >         'join'
>> >         ;
>> > ON      :
>> >         { currentMode == STRING_MODE }?=>
>> >         'join'
>> >         { setMode(PROPERTY_IDENTIFIER_MODE); }
>> >         ;
>> > CLASS_IDENTIFIER
>> >         :
>> >         { currentMode == CLASS_IDENTIFIER_MODE }?=>
>> >         IDENTIFIER
>> >         { setMode(STRING_MODE);  }
>> >         ;
>> > PROPERTY_IDENTIFIER
>> >         :
>> >         { currentMode == PROPERTY_IDENTIFIER_MODE }?=>
>> >         IDENTIFIER
>> >         { setMode(STRING_MODE);  }
>> >         ;
>> > fragment IDENTIFIER
>> >         :
>> >         LETTER(LETTER|DIGIT|'.'|'_')+
>> >         ;
>> > TIA
>> >
>> > Mark
>> >
>> >
>> > --
>> > E: mark.mandel at gmail.com
>> > W: www.compoundtheory.com
>> >
>> >
>> >
>>
>>
>> --
>> E: mark.mandel at gmail.com
>> W: www.compoundtheory.com
>>
>
>
> -- 
> E: mark.mandel at gmail.com
> W: www.compoundtheory.com



More information about the antlr-interest mailing list