Skip to content

Commit 4ada31d

Browse files
committed
Create README.md
1 parent cfd8f09 commit 4ada31d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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```

0 commit comments

Comments
 (0)