|Problem with JFlex and CUP. email@example.com (Lyndon Webster) (2002-03-09)|
|From:||"Lyndon Webster" <firstname.lastname@example.org>|
|Date:||9 Mar 2002 03:14:16 -0500|
|Organization:||Customer of Telstra Big Pond Direct|
|Posted-Date:||09 Mar 2002 03:14:16 EST|
I am currently writing the spec files for a scanner and parser for Java
using JFlex and CUP. I have generated both classes (Scanner.java, and
parser and sym.java) and have a test driver to check they work correctly.
Things progress fine until I get an Exception "Symbol recycling detected
(fix your scanner)".
What does this mean (exactly)? I have looked through the super-classes of
the parser and found that the if() statement causing this error is
referencing a boolean parameter "used_by_parser" and the (limited) comment
detailing this statement says that the parser "checks the current token for
freshness". For some reason, which I don't fully understand, this
particular token isn't "fresh" and so it throws an error.
How do I "fix my scanner" to prevent this happening?
The string causing this error is a keyword and I've noticed that if I move
the word to another part of the input text file, the scanner seems to work
fine, although this isn't a solution to the problem (obviously) because the
format of the input file has changed (which is what I'm trying to
Any help would be most appreciated.
Thanks in advance..
Return to the
Search the comp.compilers archives again.