I'm learning Antlr (version 2.7.7) and cannot figure out how to
disambiguate a simple grammar:
programmatic_unit
: simple_name a b
;
a
: (STAR simple_name )*
(SLASH simple_name)*
;
b
:
( (STAR)
INT)?
;
simple_name
: NAME_FRAG
((SPACE)? NAME_FRAG)*
;
The generator complains that the "a" rule above is nondeterministic upon
STAR. I understand (I think) why -- when matching programmatic_unit/a, it
is ambiguous whether to use "a" or "b" when STAR is the next token. But
how do I repair the grammar? Any advice would be very welcome.
Thanks,
Mike
IBM
(919) 732-5020
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address