Last change
on this file since 25584 was 25584, checked in by davidb, 12 years ago |
Initial cut an a text edit area for GLI that supports color syntax highlighting
|
File size:
729 bytes
|
Line | |
---|
1 | A small JFlex+Cup example
|
---|
2 |
|
---|
3 | It comes from a short article series in the Linux Gazette by Richard
|
---|
4 | A. Sevenich and Christopher Lopes, titled "Compiler Construction
|
---|
5 | Tools". The article series starts at
|
---|
6 |
|
---|
7 | http://www.linuxgazette.com/issue39/sevenich.html
|
---|
8 |
|
---|
9 | Small changes and updates to newest JFlex+Cup versions by Gerwin Klein
|
---|
10 |
|
---|
11 |
|
---|
12 | To compile:
|
---|
13 | >jflex lcalc.flex
|
---|
14 | >java java_cup.Main < ycalc.cup
|
---|
15 | >javac Main.java
|
---|
16 |
|
---|
17 | To run:
|
---|
18 | >java Main test.txt
|
---|
19 |
|
---|
20 |
|
---|
21 | Files:
|
---|
22 |
|
---|
23 | Main.java demo of a main program
|
---|
24 | Makefile makefile to compile and test the example
|
---|
25 | README this file
|
---|
26 | lcalc.flex the lexer spec
|
---|
27 | output.good how the output should look like for the test
|
---|
28 | ycalc.cup the parser spec
|
---|
29 | test.txt sample input for testing
|
---|
30 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.