[antlr-interest] Problem with recursive rules
Mark
mark at antelope.nildram.co.uk
Sun Dec 16 15:13:43 PST 2007
Hi,
Thank you very much for your reply!
I am still having some very strange behaviour though. I have the ollowing
lexical rules:
N : ('0'..'9');
L : (('A'..'Z')|('a'..'z'));
IDENTIFIER
: L ((L|N)*);
However, whenever I generate code I am told that "token definition N is
unreachable" even though it is right there..
Also, AntlrWorks's "interpreter" and "debugger" do not seem to work properly
at all. The debugger apparantly tries to compile a class called "__test__"
which fails to compile because it cannot find the lexer and parser classes
that Antlr generated. It may also be because those classes also do not seem
to compile; the Java compiler gives errors like:
[00:07:14] \tmp\antlrworks\tParser.java:1525: orphaned default
[00:07:14] default();
[00:07:14] ^
[00:07:14] \tmp\antlrworks\tParser.java:1525: : expected
[00:07:14] default();
[00:07:14] ^
[00:07:14] \tmp\antlrworks\tParser.java:1525: illegal start of expression
[00:07:14] default();
[00:07:14] ^
[00:07:14] \tmp\antlrworks\tParser.java:1593: <identifier> expected
[00:07:14] public final void default() throws RecognitionException {
[00:07:14] ^
Is there any solution for this?
Mark
________________________________________________
Message sent using UebiMiau 2.7.2
More information about the antlr-interest
mailing list