[antlr-interest] Newbie Help
Mike Gering
mgering at us.ibm.com
Tue Jan 13 12:50:35 PST 2009
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090113/ec731870/attachment.html
More information about the antlr-interest
mailing list