Nikolay Ognyanov wrote:
> Well, there is nothing else that the extra SUFFIX can belong to 
> according to the
> grammar so this is not derivation/parsing of the statement per the grammar.

ANTLR makes no assumptions where to stop, as when it is in a "deeper" 
rule, it does not know what path it took. The generated code for expr2 
can't tell whether it's possible that it will be followed by a SUFFIX 
(it's 'follow set' is undetermined). There's no real concept of a "start 
rule" definable in a grammar, although inclusion of EOF makes some 
improvements.

> Loring Craymer wrote:
>> Not true; your example can be interpreted either as
>>
>> (expr1:  PREFIX_1 (expr2:  PREFIX_2 SUFFIX) SUFFIX )
>>
>> or as
>>
>> (expr1:  PREFIX_1 (expr2:  PREFIX_2) SUFFIX) SUFFIX
>>
>> with the extra SUFFIX belonging to something else
>>
>> --Loring

-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to