[antlr-interest] Bug in generation code

Johannes Luber jaluber at gmx.de
Thu Oct 11 14:48:41 PDT 2007


Gavin Lambert wrote:
> At 04:52 11/10/2007, Johannes Luber wrote:
>>The problem is with this line:
>>
>>( modifier=('protected'|'public'|'private'|'fragment') )?
>>
>>While the strings are recognized correctly, they aren't set as
>>value to modifier. In other words, 'fragment' is simply swallowed.
>>I suppose this is a problem with Java.stg. Or is the source
>>somewhere else?
> 
> You can work around this by making it a subrule.

Thanks for the tip!
> 
> Also, you've defined a "tokens" entry for FRAGMENT, so you should
> probably be using that instead of repeating the string.
> 
That was actually an older grammar written by Ter - I replaced all
literals with tokens anyway. BTW, how is your ANTLR derivative named
again? I'd like to ask if you overlooked an email with some critiques
regarding your project, but I can't find that email again. :(

Johannes


More information about the antlr-interest mailing list