[antlr-interest] Problem with *

Jens Bartelheimer jens.bartelheimer at gmx.de
Mon Feb 6 14:22:33 PST 2006


Hi,

I am new to antlr and I have a problem with the Star *.

If I only parse a String with a star the first rule recognize the star, 
the second with a token not.

Why?

1st:
----

getTest
{
}
    :   "*"
        {
    System.out.println("Star gefunden");
        }
    ;


2nd:
getTest
{
}
    :   STAR
        {
    System.out.println("Star found");
        }
    ;

Lexer:
STAR: '*';

raises: line 1:1: expecting STAR, found '*'




More information about the antlr-interest mailing list