-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
23 lines (15 loc) · 868 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
A JFlex+Cup implementation for the C- compiler
(Only works with Java 1.8 or higher)
NOTE: To compile you must change CUPPLACE to where cup is located
For me this was ../cup/java-cup-11b.jar
To build the Compiler, type "make" in the current directory.
To compile source code like "1.cm", type
"java -classpath ../cup/java-cup-11b.jar:. Main 1.cm"
The syntax tree will be displayed on the screen followed by the program's scopes
and it's variables.
To rebuild the parser, type "make clean" and type "make" again.
Also note that all the abstract syntax tree structures are defined under
the directory "absyn" and within "Absyn.java" class, the showTree function
is implemented. In addition, since some java files are generated automatically,
they may contain variables that are not used, which are safe to ignore in
the compilation process.