Posted By:
JJ_Treadway
Posted On:
Sunday, January 29, 2012 07:12 PM
I am having trouble integrating ANTLR with Eclipse. I've tried two approaches, both of which have failed. First approach: I followed the instructions in this video and got to the point of being able to create a *.g file in my Eclipse project, but Eclipse got stuck on "building workspace" forever and anything I tried to do (i.e. save, run, exit) would just bring up a window saying "waiting for operation 'building workspace' to complete". It wouldn't let me cancel the building workspace operation either. I would end up having to force quit Eclipse in the Task Manager. Second approach: I downloaded ANTLRWorks and used it to make a simple grammar called "test2". I then us
More>>
I am having trouble integrating ANTLR with Eclipse. I've tried two approaches, both of which have failed.
First approach:
I followed the instructions in
this video
and got to the point of being able to create a *.g file in my Eclipse project, but Eclipse got stuck on "building workspace" forever and anything I tried to do (i.e. save, run, exit) would just bring up a window saying "waiting for operation 'building workspace' to complete". It wouldn't let me cancel the building workspace operation either. I would end up having to force quit Eclipse in the Task Manager.
Second approach:
I downloaded ANTLRWorks and used it to make a simple grammar called "test2". I then used ANTLRWorks to generate the files "test2Lexer.java" and "test2Parser.java". I put those two files into a new Eclipse project, but there are errors on the line "import org.antlr.runtime.*;" and on all references to classes within that package. I then right click on "default package" (where the two source files are stored in Eclipse) and select "Import" and import the file "antlr-3.4-complete-no-antlrv2.jar" that I downloaded from antlr.org. Eclipse no longer marks the "import org.antlr.runtime.*;" line as an error, but it still marks all references to classes in that package as errors.
Can anybody tell me what's wrong with either of these approaches and how to fix it?
<<Less