[antlr-interest] Can antlr v3 lex star | tristar properly?

Steve Bennett stevagewp at gmail.com
Wed Nov 21 05:00:01 PST 2007


On 11/21/07, Guntis Ozols <guntiso at latnet.lv> wrote:
> Is there a way to lex this simple grammar (I am using ANTLRWorks 1.1.4):

Now, I know you said "lex" but just in case, this works:

----
stars: (tristar | star )*;

tristar: '*''*''*';
star: '*';
----

Can someone explain to me why this is so hard using just lexing rules?
What goes wrong?

Steve


More information about the antlr-interest mailing list