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

Steve Bennett stevagewp at gmail.com
Wed Nov 21 16:02:39 PST 2007


On 11/22/07, Kay Röpke <kroepke at classdump.org> wrote:
> No, it doesn't. It will always match 'star', and never 'tristar'
> unless you use a predicate like this:
>
> stars: ((tristar)=>tristar | star)*;
>
> tristar: '*''*''*';
> star: '*' {System.out.println("star");};
>
> Watch what happens in ANTLRWorks!

Grr. It works in the Interpreter. Why the different logic?

Steve


More information about the antlr-interest mailing list