Simple compiler written in Rust using:
| Feature | Status | File/s |
|---|---|---|
| Lexer | ✅ | rflex lexer file |
| Grammar | ✅ | rustemo grammar file |
| Symbol table | ✅ | Generate running the executable |
| Tests | ✅ | Run using cargo test |
| Feature | Status | File/s |
|---|---|---|
| Intermediate code(Tree) | ✅ | ast |
| Tests | ✅ | Run using cargo test |
| Feature | Status | File/s |
|---|---|---|
| Assembler output | ✅ | TASM generation |
| Linking script | ✅ | compile.bat |
- Run in debug mode
cargo run -- <INPUT-FILE>- Run in release mode
cargo run --release -- <INPUT-FILE>The executable requires an input file as a parmeter.
The integration test runs the compiler on all the files located at examples folder. Currently it only asserts that the compiler can run without errors on all the files, it does not check that the compilation output is correct.
cargo test
When running the compiler it will output 4 files to the path of the source file
- <source-file-name>.parser
- <source-file-name>.lexer
- <source-file-name>.symbol_table
- <source-file-name>.dot
Usage: lm-compiler <INPUT_FILE>
Arguments:
<INPUT_FILE> Path to the source code file
Options:
-h, --help Print help
-V, --version Print version