[antlr-interest] "unexpected token" error
Monty Zukowski
monty at codetransform.com
Tue Mar 8 07:03:28 PST 2005
togol machillan wrote:
> Hi,
>
> Another newbie question. I hope somebody can help me out here.
>
> I have the following lexer rules (omitting some which are clear by name)
>
> VALUE options {testLiterals = true; }
> : CAPITAL_LETTER (CAPITAL_LETTER|DIGIT|','|'-')*
> ;
>
> FIGURE: ('-')? ((DIGIT)+ '.' (DIGIT)* | '.'(DIGIT)+ );
>
> ASSIGNMENT: VALUE '=' (VALUE|FIGURE)
> ;
>
> I want the ASSIGNMENT rule to match a token like MOLE-FRAC=1.0 or STOIC=IN, for example. But when I include this rule, the program throws the unexpected token: error at the point where first space character occurs in the input file. Is this due to some problem with the greedy nature of the the VALUE rule?
>
> Thanks in advance.
>
> Regards,
>
> Togol Mach
What does your whitespace rule look like?
Monty
More information about the antlr-interest
mailing list