Tiger-Compiler
Tiger-Compiler copied to clipboard
A Tiger compiler on x86 machines running Linux.
A Tiger Compiler
The Tiger Language
Written by Andrew W.Appel, the author of Tiger Book, the Tiger language is a small language with nested functions, records values with implicit pointers, arraya, integer and string variables, and a few simple structured control constructs.
For more details, see the Appendix section of that book.
Prerequisites
Assumed you are in the root folder.
CentOS
-
./travis_scripts/install_centos.sh
CentOS Docker
-
./travis_scripts/install_centos_docker.sh
Build
-
cd Compiler
-
make
Then the generated compiler will be hosted in builds
folder named tiger.
Compiler Usage
-
cd Compiler
-
./builds/tiger-compiler ./testcases/testXXX.tig
The generated executable file will be under the testcases
folder with name testXXX
.
Debug
Debug with STL
I'll make this a prerequisite which is going to be included in the above shell scripts. At this time you can setup all necessary stuffs using instructions at this site http://sourceware.org/gdb/wiki/STLSupport.
Debug in Docker
Lanuch your docker with following options added --privileged --cap-add=SYS_PTRACE
.
Unit Test
Module Status
Module Coverage
First make sure that you have installed a browser such as firefox, the commands following will try to open the results via it.
-
cd Compiler/Coverage-Report
. -
make
.
Todo
See Compiler/TODO.