[antlr-interest] funny error message

Gavin Lambert antlr at mirality.co.nz
Thu Feb 14 11:16:13 PST 2008


At 06:49 15/02/2008, Daniels, Troy (US SSA) wrote:
>If this is the only place you use C, shouldn't you define this as
>
>@tokens { C; }
>
>rather than
>
>fragment C: 'C';
>
>(Assume the correct syntax; I haven't moved to v3 yet.)

I agree with you -- but last time I checked ANTLR generated a 
warning when doing that (along the lines of "rule C has no body"), 
which is not especially helpful.

(And it's "tokens", not "@tokens".  But otherwise correct.)



More information about the antlr-interest mailing list