Skip to content

Martoon-00/toy-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
May 8, 2017
Jan 23, 2018
Jan 23, 2018
Jan 23, 2018
Jan 23, 2018
Mar 29, 2017
Mar 31, 2017
May 8, 2017
Jun 24, 2017
Feb 6, 2017
Jan 23, 2018
Jun 4, 2017
Feb 6, 2017
Jan 23, 2018
May 8, 2017
Jun 17, 2017

Repository files navigation

Toy-compiler

Build Status

Homework in compilers cource.


Preliminaries

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.

Execution

Compiler rc accepts 2 arguments

  1. Mode. According to task, compiler supports three modes:

    1.1. -i: Interpretation

    1.2. -s: Conversion to intermediate form with following interpretation

    1.3. -o: Compilation. Unlike previous modes, it doesn't execute the program, rather creates binary which executes

  2. Path to file which contains the program.

Tests

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.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published