A simple imperative language compiler. INA, PWr, 2023/24
Maksymilian Neumann
Compilation requires the rust toolchain and an internet connection.
if using ubuntu
$ make
$ ./kompilator <input_file> <output_file>
or universal
$ cargo run -r -- <input_file> <output_file>
or you can build it and use the binary.
$ cargo build -r
it outputs the binary in "path_to_project/target/relese" it should be called kompilator.
usage:
$ ./target/relese/kompilator <input_file> <output_file>
All important source files are in the src directory
Just an entry point to the program. Uses all the other source files. Handles Errors.
This is our lexer/parser. Made using LALRPOP crate wich is an rust alternative to lex/bison. It lexes and parses our input and outputs an AST.
Defines the structure of the AST.
This is where the magic happens. This defines a struct that is first used to build the AST into pseudo-assembly and than into the final file.
Configuration file for cargo.
Custom build script for cargo to complie our lexer/parser.
For Ubuntu. Compiles the program and moves to project folder.