1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Summary Instructions
If you are a parser and lexical analyzer expert and can understand the examples by just reading them, the following instructions show you how to get started with JavaCC. The instructions below are with respect to Simple1.jj, but you can build any parser using the same set of commands.
1. Run javacc on the grammar input file to generate a bunch of Java files that implement the parser and lexical analyzer (or token manager):
javacc Simple1.jj
2. Now compile the resulting Java programs:
javac *.java
3. The parser is now ready to use. To run the parser, type:
java Simple1
The Simple1 parser and others in this directory are designed to take input from standard input. Simple1 recognizes matching braces followed by zero or more line terminators and then an end of file.
Examples of legal strings in this grammar are:
"{}", "{{{{{}}}}}", etc. |
Partager