Hi, I have the following token specifications, and it seems like any
number (i.e. sequence of digits) will not parse as a number.
TOKEN : {
[ ... ]
| < NUMBER: (<DIGIT>)+ ("." (<DIGIT>)+ )? >
| <#DIGIT: ["0" - "9"]>
[...]
}
I also tried rewriting the NUMBER spec, by creating a new token DOT,
and by factoring the <DOT> (<DIGIT>)+ out into yet another token, but
to no avail.
If there's anything wrong with my syntax, JavaCC doesn't complain. The
problem is that in a context where both Identifiers (letters+digits)
and numbers are allowed, it will always choose the identifier. In
context where only numbers are legal, I get a parse exception.
Since when is "5" not a NUMBER? ;-)


|