Posted By:
Kia_Abdullah
Posted On:
Monday, November 4, 2002 06:49 AM
Hi, I have downloaded the pre-completed Java Grammar from the "Resources and Grammars" section at www.antlr.org. I am new to antlr and was hoping you could help me. There are five files that come with it: * Main.java * tests * java.g (Contains JavaTreeParser) * java.tree.g (Contains JavaRecognizer and JavaLexer) * shiplist (List of file) I have compiled Main.java but it cannot access JavaRecognizer, JavaLexer and JavaTeeParser. This is because I don't know what to do with the grammar files. - Do I leave their names as they are? (java.g and java.tree.g or do I change them to the name of the classes they contain?)
More>>
Hi, I have downloaded the pre-completed Java Grammar from the "Resources and Grammars" section at www.antlr.org. I am new to antlr and was hoping you could help me.
There are five files that come with it:
* Main.java
* tests
* java.g (Contains JavaTreeParser)
* java.tree.g (Contains JavaRecognizer and JavaLexer)
* shiplist (List of file)
I have compiled Main.java but it cannot access JavaRecognizer, JavaLexer and JavaTeeParser. This is because I don't know what to do with the grammar files.
- Do I leave their names as they are? (java.g and java.tree.g or do I change them to the name of the classes they contain?)
- Do I leave them with a .g extension? Windows does not recognise files of this type.
- Do I put them in the same directory as Main.java? The code in Main.java imports the grammars by:
import JavaRecognizer;
import JavaLexer;
but the errors say "class JavaLexer not found" and "class JavaRecognizer not found" etc.
PLEASE tell me what to do with the grammar files. I have tried reading the Reference Manual but it only explains WHAT to put in a grammar file, not what to do with the actual file once you have finished it.
THANK YOU for your time.
Kia
kia76@hotmail.com
<<Less