Homework in compilers cource.
To use compiler, you first need to generate runtime.o
:
make -C runtime
Then use rc
to launch compiler.
By default, rc
searches for runtime.o
in ./runtime/
folder, but you can
specify custom location via environmental variable RC_RUNTIME
.
Compiler rc
accepts 2 arguments
-
Mode. According to task, compiler supports three modes:
1.1.
-i
: Interpretation1.2.
-s
: Conversion to intermediate form with following interpretation1.3.
-o
: Compilation. Unlike previous modes, it doesn't execute the program, rather creates binary which executes -
Path to file which contains the program.
This repository contains tests written with QuickCheck
. They can be run with stack test
or make build-in-tests
. They check for all basic features of compiler in all described modes and work quite fast.
(Of cource, Preliminaries section could be skipped if you're going to launch tests with make only.)
Repository also contains dedicated testing repository as submodule. One can run those tests with make control-tests
, it may take a week or so several hours.