Sam Barnett-Cormack schrieb:
> Jim Idle wrote:
>> The things you are seeing are standard things that happen when you
>> start out by typing in a grammar from the normative grammar of some
>> language spec. Such language specs are not really written with writing
>> a parser spec in mind (most say this) and even if they are they are
>> usually written with yacc/bison in mind. Consequently they are full of
>> ambiguities that you must left factor as you go.
> 
> Well, I didn't just blindly copy them out, although I'll admit I got
> tied up in left-recursion issues. The grammar actually seems to have
> some ambiguities that would be ambiguous anywhere, actually, which is a
> pain in the neck, by c'est la vie.
> 
> I also didn't want to refactor it anymore than necessary because there
> is a relationship between the structure of rules in the standard and the
> semantic structure, which should help at later stages.

You can undo the left-factoring when doing rewrites of the AST. It helps
if you use imaginary tokens to disambiguate ambiguities for the tree parser.

Johannes

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