Tianle Zhang(tz94): TianleZhang
Hao Jiang(hj110): HaoJiang
Please see the directory "compiler/lexer".
Please see the directory "compiler/parser".
Please see the directory "compiler/semanalysis".
Please see the directory "compiler/ir".
Please see the directory "compiler/ins_sel".
Please see the directory "compiler/reg_alloc".
Install SML-nj and related packages:
sudo apt-get install smlnj
sudo apt-get install ml-lex
sudo apt-get install ml-yacc
The final working compiler is at compiler/reg_alloc. To compile and run in REPL:
cd compiler/reg_alloc
CM.make "sources.cm";
Main.compile <your-tiger-file>
To run a single test case:
./autotest.sh xxx.tig
To run the entire test suit:
./autotest.sh 2>&1 >result.out
Generated files:
xxx.out -- Message produced during the compilation, including compile errors if the tiger code is wrong.
xxx.s -- Generated MIPS assemly without library functions in runtime.s.
xxx.tmp.s -- xxx.s combined with runtime.s & sysspim.s. Can be executed by the command:
spim -file xxx.tmp.s