CUP EOF managing?

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2009
Posts: 2
Reputation: Sikter is an unknown quantity at this point 
Solved Threads: 0
Sikter Sikter is offline Offline
Newbie Poster

CUP EOF managing?

 
0
  #1
Oct 25th, 2009
Hello! I'm in a dilly of a pickle here and can't seem to get any
answers on the web. My problem is one of EOF token recognition with
CUP.
When I define EOF as one of my terminals, CUP complains:
Duplicate terminal (EOF) created
So, I take it out, and CUP complains:
Error at 86(24): java_cup.runtime.Symbol "EOF" has not been declared
So what's this all about? Everything else works just fine if I remove
all references to that evil and allusive EOF symbol. The parse works
its way through, but then craps out due to a null pointer exception at
the end of file.
I am using JLex with the %cup compatibility flag and have the standard:
%eofval{
return new Symbol(sym.EOF);
%eofval}
in my lex file.
Can anyone offer any suggestions on how to proceed? Or point me in the
direction of someone or someplace that could give me a few suggestions?
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,467
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 267
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven
 
0
  #2
Oct 25th, 2009
Yeah, ask at a site that pertains to this JLex and/or CUP thing you're using. I, myself, have never heard of them.

Truth be told, this problem doesn't seem to apply to Java, at all, but rather to these tools that you're using.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 2
Reputation: Sikter is an unknown quantity at this point 
Solved Threads: 0
Sikter Sikter is offline Offline
Newbie Poster
 
0
  #3
Oct 25th, 2009
Cup and jflex are java tools for syntax and lexical analasys, so i thought this is the place to create a thread, if there's more apropriate place on forum for this kind of issues please admin move the thread. Thx.
Last edited by Sikter; Oct 25th, 2009 at 5:41 pm.
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,467
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 267
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven
 
0
  #4
Oct 25th, 2009
Yes, I can see that they are either tools to create Java code, or tools written in Java, but neither of those makes the problem a Java problem.

Looking at the homepage for this "CUP" thing (http://www2.cs.tum.edu/projects/cup/) shows a list of related persons with links to their web pages. At least some of those webpages contain email addresses. I would say to start there.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Reply

Tags
compiler, java

Message:



Similar Threads
Other Threads in the Java Forum


Views: 511 | Replies: 3
Thread Tools Search this Thread



Tag cloud for compiler, java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC