Compiler Design
From Ben's Writing
Contents |
Introduction
What follows is my final project for the Compiler Design class. I chose to work alone on this project. I didn't use a version control system, which I now regret, but I did split the stages up into distinct versions (so, I guess, in some sense, there was, in a very generous use of the terminology, some version control).
Download
| Code Generation Phase | plc-0.4.tar.gz (bz2) |
| Type and Scope Checking Phase | plc-0.3.1.tar.gz (bz2) |
| plc-0.3.tar.gz (bz2) | |
| Parser Phase | plc-0.2.tar.gz (bz2) |
| Scanner Phase | plc-0.1.tar.gz |
Installation
To extract use the following:
# zcat plc-VERSION.tar.gz | tar xvf -
or
# bzcat plc-VERSION.tar.bz2 | tar xvf -
or some other equivalent. Then, following the directions of the README:
"To build the project, simply run:
# ./configure # make -j
This will configure and build PLC. Optionally, one can add the
--enable-debug=true flag to the ./configure line:
this will enable trace information about the parsing state. The -j flag for
make compiles multiple files in parallel (helpful if you have distcc, a
dual-core or a dual-processor machine). Like many GNU projects, you can install
the compiler locally, using the following:
# make install
Alternatively, you can run it with no installation:
# cd src # ./plc ../tests/everything.p
The above will run the PLC using everything.p as the input source file. Also in the tests directory are other test files. One is called unknown.p, which has a syntax error in it. This file demonstrates the error handling built in to the PLC."