File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Pascal Compiler in Java
2
+
3
+ Created a Compiler for Simple Pascal in Java with SableCC. Simple Pascal is a subset of the normal Pascal.
4
+
5
+ This Compiler takes a Pascal file and creates a * .class file for it, which can be executed using Java as usual.
6
+
7
+ ## Compiling a file and liveness analysis
8
+
9
+ 1 . I attached a ``` build.xml ``` file to use sablecc automatically to use my specified grammar in Java. So just type in your shell:
10
+ ``` > ant ```
11
+ or by hand:
12
+ ``` > java -jar sablecc.jar sablecc.scc ```
13
+
14
+ 2 . Compile all created classes
15
+ ``` > javac *.java ```
16
+
17
+ 3a. Start compiling with:
18
+ ``` > java StupsCompiler -compile <Filename.pas> ```
19
+
20
+ 3b. OR start a liveness analysis for all variables used in the Pascal file
21
+ ``` > java StupsCompiler -liveness <Filename.pas> ```
22
+
23
+ 4 . Create Bytecode with jasmin
24
+ ``` > java -jar jasmin.jar <Filename.j> ```
25
+
26
+ 5 . Execute compiled Pascal file
27
+ ``` > java Filename ```
You can’t perform that action at this time.
0 commit comments