At 09:05 19/08/2009, [email protected] wrote:
>For testing I removed the .* and, while there are no errors, it
>still doesn't match b. as the token MC_INCORRECT unless there
>is a newline after it.
[...]
>MC_QUESTION : INT ('.'|')') ENDOFLINE;
>MC_INCORRECT : LETTER '.' ENDOFLINE;
>MC_CORRECT : '*' MC_INCORRECT;
>
>fragment ENDOFLINE : NEWLINE | { input.LA(1) == EOF }?;
Are you using the debugger or the interpreter to test with? The
interpreter doesn't execute predicates, so it won't work properly;
you need to use the debugger.
It also might pay to try a few variations on the ENDOFLINE rule;
sometimes ANTLR seems to ignore predicates if it thinks that
they're not accomplishing anything. Try this, for example:
fragment ENDOFLINE : { input.LA(1) == EOF }? => | NEWLINE ;
or this:
fragment ENDOFLINE : NEWLINE | EOF ;
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---