A compiler for the albatross programming language developed in CS473: Compiler Design - Fall 22.
The compiler is written in C which compiles the albatross code into MIPS instructions.
The compiler works in the following stages:
-
Lexing: extracting tokens (Uses flex)
-
Parsing: checking program syntax (Uses yacc)
- AST generation
- Semantic analysis
-
Symbol resolution
-
Type checking
-
AST transformations
-
MIPS instruction generation.
To create the executable of the compiler use make
. This should generate an executable named albatrosscc
.
Then use the albatrosscc
to compile your program.
./albatrosscc <in.albatross> <out.mips>
in.albatross
is some file that contains your albatross program, and out.mips
is the file where the generated mips instructions would be written.
Run the runtests.sh
script to run the tests contained within the tests
directory in the project root.
Checkout the interpreter written for albatross here.