A Compiler that compile Pascal-S to C/RISC-V
First, make directory build
and bin
in the root directory of the project.
mkdir build && mkdir bin
Then, run the following commands to compile the project.
cd build
cmake .. && make
After that, you can run the compiler with the following command.
./bin/pascc -i <input_file>
.
|-- src # Source code
| |-- main.cpp # Main function
| |-- parser # Parser (flex + bison)
| |-- ast # Abstract Syntax Tree
| |-- common # tools
| |-- ir # Intermediate Representation And Semantic Analysis
| |-- builder # Code Generator
| |-- opt # Optimizer
|-- test # Test
To build the docker image, run the following command.
It will build the docker image with the name my-riscv-env
.
docker build -t my-riscv-env . --network=host
To run the docker image, run the following command.
It will run the docker image with the name my-riscv-env
.
docker run -it --name my-riscv-env --mount type=bind,src=[absolute path of folder in host machine],dst=[absolute path in container] my-riscv-env /bin/bash