Terence Parr wrote:
>
> On Mar 6, 2009, at 2:02 PM, Sam Barnett-Cormack wrote:
>
>> Terence Parr wrote:
>>> Hi Guys,quikly scanning...$text means text for entire rule; if
>>> hoisted out of rule it makes no sense. sem predicates should only use
>>> functions of input.LT(i) if they get hoisted.
>>
>> So can I replace
>>
>> objIdComponents options{backtrack=true;}
>> : nameForm {isStandardOIDName($text)}?
>> | numberForm
>> | nameAndNumberForm
>> | definedValue
>> ;
>>
>> with
>>
>> objIdComponents options{backtrack=true;}
>> : nameForm {isStandardOIDName($nameForm.text)}?
>> | numberForm
>> | nameAndNumberForm
>> | definedValue
>> ;
>>
>
> Well, that won't behoisted into any decisions.
>
> you need
>
> : {isStandardOIDName(input.LT(1).getText())}? nameForm
Okay... it seems like things involving $text *do* get hoisted, just they
end up as errors in the Java... but in any case, I'll do that once I can
get at my code again. This may involve transplanting a hard drive...
Sam
--
Sam Barnett-Cormack
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---