Skip to content

Commit 623127a

Browse files
authored
Merge pull request #22 from Java-rs/typechecking
2 parents d38927a + 422addf commit 623127a

32 files changed

+1503
-590
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ Cargo.lock
66
*.class
77
lib/testcases/*.json
88
lib/testcases/*.txt
9-
lib/testcases/*-gen.java
9+
lib/testcases/*-gen.java
10+
lib/testcases/*-Test.java

README.md

+41-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,50 @@
11
# RustyJ
22

3-
A Java Compiler written in Rust
3+
A MiniJava Compiler written in Rust.
4+
5+
## MiniJava
6+
7+
MiniJava is a subset of Java. It is a simple object-oriented language that supports classes, single inheritance(not
8+
supported in this compiler), and strong typing.
9+
10+
## Build
11+
12+
### Requirements
13+
14+
- [Rust](https://rustup.rs/)
15+
16+
### Build
17+
18+
```bash
19+
cargo build --release
20+
```
421

522
## Usage
623

724
```bash
8-
cargo run -- <input_file> <output_file>
25+
cargo r -r -- <input_file> <output_file>
926
```
1027

11-
# TODO
28+
# Disclaimer
29+
This compiler was done as a student project and doesn't support many language features and may contain bugs. It is not intended to be used in production.
30+
31+
However, it was a great learning experience, and we hope it can be useful to someone else.
32+
33+
## Parsing
34+
Parsing is done using a [Pest grammar](https://pest.rs/).
35+
36+
## Type Checking
37+
I do not know what to write about type checking as i am clueless
38+
39+
## Code Generation
40+
Code generation is done manually to generate Java Bytecode. The code generation uses two passes.
41+
The first pass generates all instructions and the second one is used to convert relative jumps into absolute jumps.
1242

13-
- [ ] Parser
14-
- [ ] Semantic Analysis
15-
- [ ] Code Generation
43+
## Authors
44+
- Flippchen
45+
- Marion
46+
- mfloto
47+
- Nereuxofficial
48+
- Sander
49+
- Tori
50+
- Val

docs/Project-Doc.md

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Folgende Fehler werden vom Typechecker erkannt:
4444

4545
## Codegenerierung
4646

47+
Geschrieben von: Marion Hinkel, Benedikt Brandmaier, Val Richter
4748
- Wer hat welche Arbeit bei codegen gemacht?
4849
- Was für Arbeit musste alles zusätzlich getan werden, weil wir nicht Java + ASM genutzt haben?
4950

0 commit comments

Comments
 (0)