[antlr-interest] [BUG] 3.0b4 no complaint on parser reference to lexical fragment

John B. Brodie jbb at acm.org
Mon Nov 13 20:03:47 PST 2006


>> >I have a hard time to believe that this is a real-world scenario.
>> 
>> I have helped new users to resolve this on at least 2 
>> occasions. Most recently just this past Sunday immediately 
>> before I started this thread.
>
>As I said, this sounds like a training issue.

Ok. Fine. Lets for the moment agree that this is a "training issue".

So how do you propose that a user resolve this "training issue"?

Should she/he simply post a mesage to the antlr-interest mailing saying
"my grammar doesn't work, please help"?

or

Should the org.antlr.Tool provide an error message stating that their parser
has referred to a token type that the lexer can not produce?

Seeking guidance...
   -jbb




note I am assuming that anywhere in the lexer that one might be
tempted to write something like this (and *ALL* of its permutations):

A: 'a' { type = C; }
B: 'b' C;
fragment C: 'c';

would be replaced with an equivalent like this (and similar for all
permutations):

tokens{ C; }
A: 'a' { type = C; }
B: 'b' Cprime;
fragment Cprime: 'c';



More information about the antlr-interest mailing list