Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using Java CUP to create a java parser

807597Feb 15 2005 — edited Feb 17 2005
I am trying to create a java parser using Java CUP. I have downloaded CUP and also the Java specification which are given on the website. They appear in separate files (which I think may be part of the problem). I've moved the Java14.cup specification file into the java CUP folder and have used it to create a parser.cup file and sym.cup file.

I am fairly new to this and don't know what to do from here. I have tried compiling the 2 files but the parser.cup file gives the following error:

invalid method declaration; return type required
public Grm14(Lexer l) {

I have tried compiling some of the other files (Lex folder) which come with the java grammar but these give many errors. I think it is to do with putting the files in the same folders and compiling them together but I've tried this and it still gives errors.

Any help would be greatly appreciated!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 17 2005
Added on Feb 15 2005
9 comments
677 views