CSC_52064 - Project - Mini Go
The goal is to build a compiler for a tiny fragment of
the Go programming language,
called Mini Go, to x86-64 assembly.
All the details are given in the
project statement.
The project is due Sunday March 15, 6pm,
via Moodle.
You must submit an tarball containing
- the sources of your compiler;
- a short report;
- possibly other files, e.g. test files of your own.
Code supplied
The parser and the abstract syntax are provided.
You don't have to read and understand the parser, but you have to
read and understand the abstract syntax trees
(in ast.mli
and tast.mli).
They are two kinds of syntax trees:
- parsed trees = output of the parser = input of the type checker
- typed trees = output of the type checker = input of the compiler
Roadmap
- (labs 4-5) Static Typing
This is described in section 2.
Code to be written in typing.ml.
Test with
bash ./test -2 path-to-your-compiler
(see below)
- (labs 6-7-8-9) Code Generation
This is described in section 3.
Code to be written in compile.ml.
A module X86_64 is provided, to build and then
print x86-64 assembly code.
Test with
bash ./test -3 path-to-your-compiler
(see below)
Test Files
Test files are provided, together with a bash script to test your compiler:
Feel free to add more test files of your own (and if so, do include
them in the tarball when you submit your project on Moodle).
back to the main page