This repository implements a simple compiler that turns MiniC code, whose grammar is a subset of ISO C, to RISC-V assembly code.
The code was written by Xiao Wu.
Further updates would be presented on github.
As for the course report, click pdf or md.
- Linux
- Flex, Bison
-
Clone this repo:
git clone https://github.com/Adamink/MiniC2RISC-V.git
-
Compile and install: For Linux shell users, type command
make clean make
-
The executable file is
g--
, to compile a MiniC file, type./g-- example/1.c -o example/1.s
or simply
./g-- example/1.c
-
To run the compiler on examples, type
make example