Problem with JFlex and CUP.

"Lyndon Webster" <>
9 Mar 2002 03:14:16 -0500

          From comp.compilers

Related articles
Problem with JFlex and CUP. (Lyndon Webster) (2002-03-09)
| List of all articles for this month |

From: "Lyndon Webster" <>
Newsgroups: comp.compilers
Date: 9 Mar 2002 03:14:16 -0500
Organization: Customer of Telstra Big Pond Direct
Keywords: Java, parse
Posted-Date: 09 Mar 2002 03:14:16 EST

Hi all,

I am currently writing the spec files for a scanner and parser for Java
using JFlex and CUP. I have generated both classes (, and
parser and 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..

Lyndon Webster.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.