| | |
CUP EOF managing?
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: May 2009
Posts: 2
Reputation:
Solved Threads: 0
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?
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?
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.
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
----------------------------------------------
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
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.
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
----------------------------------------------
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
![]() |
Similar Threads
- Dani's Cookbook (Geeks' Lounge)
- how do you loop fscanf until EOF in c? (C)
- World Cup anybody? (Geeks' Lounge)
- How works EOF (C)
- Managing Multiple Photos or Other Files (Windows tips 'n' tweaks)
Other Threads in the Java Forum
- Previous Thread: Problem with Keith Number
- Next Thread: Image not appear
Views: 506 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for compiler, java
.net 3d 7 ajax apple applet array assembly automation awt bank binary browser c++ c/c++ capture character class classes code columns compile compiler component convert csv datagram design development draw eclipse editor error event exception firefox fractal ftp game google grails gui high-performance html ide image input integer java javafx javascript jetbrains jmf jni jpanel jsp julia jvm lego linux loop machine main method microsoft mysql netbeans newbie object os osx panel php problem programming project projectideas python rsa screen se security set smart socket software sort string sun swing test threads time tools transfer tree trolltech udp web windows







