[antlr-interest] Can antlr v3 lex star | tristar properly?
Clifford Heath
clifford.heath at gmail.com
Wed Nov 21 14:28:48 PST 2007
Jim Idle wrote:
> fragment STAR
> : '*' ;
>
> TRISTAR
> : '*'
> ( '*' '*'
> | { $type = STAR; }
> )
> ;
Jim,
I'm missing something here. Is the fragment STAR only
required to tell ANTLR that there's a token called STAR?
Because your example doesn't use it in the TRISTAR rule.
Assuming that's what you meant, would it be the same to
just have defined STAR in the @tokens section?
Clifford Heath.
More information about the antlr-interest
mailing list