Problem with JFlex and CUP.

"Lyndon Webster" <webster@rlmsystems.com.au>
9 Mar 2002 03:14:16 -0500

          From comp.compilers

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

From: "Lyndon Webster" <webster@rlmsystems.com.au>
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 (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
validate!).


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.