Index of /rsync/frontends/tiger
Name Last modified Size Description
Parent Directory -
ChangeLog 06-Aug-2008 22:26 15K
DEPEND 06-Aug-2008 22:26 2.0K
alloc.c-- 06-Aug-2008 22:26 482
ast.cmi 06-Aug-2008 22:26 2.3K
ast.ml 06-Aug-2008 22:26 5.4K
ast.mli 06-Aug-2008 22:26 1.4K
ast.nw 07-Mar-2005 22:36 8.3K
autodefs.ocaml 17-Dec-2002 13:37 1.5K
canonical.ml 06-Aug-2008 22:26 3.0K
canonical.mli 06-Aug-2008 22:26 62
canonical.nw 05-Jun-2004 11:35 3.7K
codegen.ml 06-Aug-2008 22:26 2.6K
codegen.mli 06-Aug-2008 22:26 112
codegen.nw 28-Jun-2004 09:29 4.8K
configure 06-Aug-2008 22:26 258
doc.tex 28-Oct-2004 14:26 6.7K
doc.toc 06-Jun-2004 19:06 5.0K
driver.ml 06-Aug-2008 22:26 2.1K
driver.nw 07-Mar-2005 22:36 3.5K
environment.ml 06-Aug-2008 22:26 2.7K
environment.mli 06-Aug-2008 22:26 1.4K
environment.nw 05-Jun-2004 11:35 8.9K
error.cmi 06-Aug-2008 22:26 1.1K
error.cmo 06-Aug-2008 22:26 1.9K
error.ml 06-Aug-2008 22:26 1.8K
error.mli 06-Aug-2008 22:26 639
error.nw 05-Jun-2004 11:35 4.0K
frame.ml 06-Aug-2008 22:26 2.9K
frame.mli 06-Aug-2008 22:26 636
frame.nw 11-Nov-2004 15:22 8.3K
gc.c 06-Aug-2008 22:26 3.7K
gc.h 06-Aug-2008 22:26 68
gc.nw 27-Nov-2004 19:02 7.2K
ldb/ 06-Aug-2008 22:26 -
lexer.ml 06-Aug-2008 22:26 14K
lexer.mll 06-Aug-2008 22:26 3.1K
mkfile 19-Jul-2004 18:00 5.1K
option.cmi 06-Aug-2008 22:26 597
option.cmo 06-Aug-2008 22:26 1.5K
option.ml 06-Aug-2008 22:26 922
option.mli 06-Aug-2008 22:26 256
option.nw 05-Jun-2004 11:35 2.3K
parser.ml 06-Aug-2008 22:26 52K
parser.mli 06-Aug-2008 22:26 566
parser.mly 06-Aug-2008 22:26 7.0K
parser.nw 07-Mar-2005 22:36 11K
parser.output 06-Aug-2008 22:26 64K
rules.mk 06-Jun-2004 19:06 2.2K
runtime.c-- 06-Aug-2008 22:26 926
runtime.nw 28-Jun-2004 09:29 4.6K
semantics.ml 06-Aug-2008 22:26 12K
semantics.mli 06-Aug-2008 22:26 296
semantics.nw 07-Mar-2005 22:36 25K
shortman.pdf 04-Jun-2003 12:24 99K
stdlib.c 06-Aug-2008 22:26 1.7K
stdlib.h 06-Aug-2008 22:26 606
stdlib.nw 07-Mar-2005 22:36 7.5K
stdlibcmm.c-- 06-Aug-2008 22:26 2.3K
symbol.cmi 06-Aug-2008 22:26 1.2K
symbol.cmo 06-Aug-2008 22:26 1.9K
symbol.ml 06-Aug-2008 22:26 1.5K
symbol.mli 06-Aug-2008 22:26 548
symbol.nw 05-Jun-2004 11:35 4.5K
test/ 06-Aug-2008 22:26 -
tiger.ld 21-Oct-2003 04:05 151
translate.ml 06-Aug-2008 22:26 6.9K
translate.mli 06-Aug-2008 22:26 1.0K
translate.nw 07-Mar-2005 22:36 16K
tree.cmi 06-Aug-2008 22:26 1.7K
tree.ml 06-Aug-2008 22:26 4.0K
tree.mli 06-Aug-2008 22:26 1.0K
tree.nw 05-Jun-2004 11:35 8.3K
Tiger front-end for C--
This directory contains source code for a Tiger language
compiler. This compiler is a front end for the Quick C-- compiler
primarily used for testing Quick C--. The Tiger language is described
in "Modern Compiler Implementation in ML" by Andrew W. Appel. To quote
from Appendix A of this book:
The Tiger language is a small language with nested functions,
record values with implicit pointers, arrays, integer and
string variables, and a few simple structured control constructs.
BUILDING
----------------------------------------------------------------------
In order to build the Tiger compiler, you will first need a Quick C--
source tree that has been successfully built. Some components of the
Tiger compiler depend on intermediate build results from the Quick C--
source tree.
Edit the mkfile and set the location of your qc-- source tree. Also,
if the noweb tools or ocaml are not in your PATH, you will need to
specify the locations of each of these.
Build the dependencies file:
mk depend
Build the compiler, libraries, and tools:
mk all
Build a native binary "tigerc.opt": (optional)
mk all.opt
Build source documentation: (optional)
mk doc
The following files are produced:
tigerc - the tiger compiler
tigerc.opt - the tiger compiler native binary (optional)
stdlib.a - the tiger standard library
runtime.o - the stand-alone startup code
client - a qc-- interpreter client for tiger
tigerc.ps - source code documentation (optional)
tigerc.pdf - source code documentation (optional)
USING THE COMPILER
----------------------------------------------------------------------
The tigerc program converts a tiger program into an equivalent c--
program which can then be compiled with qc--. Since this compiler is
intended to be used for testing qc--, it does not attempt to call qc--
or the system linker to produce an executable program. In it's most
basic usage:
tigerc source.tig > source.c--
The tiger compiler supports two implementations of exceptions. The
default implementation uses a C-- "cut to". Alternatively, you can
generate code for the stack unwinding implementation:
tigerc -unwind source.tig > source.c--
For additional command line options see:
tigerc -help
A simple standard library and startup code are included with the
compiler. In order to create an executable, these will have to be
linked with the final result. The qc-- compiler can handle this for
us:
qc-- -globals -o source runtime.o stdlib.a source.c--
The Quick C-- interpreter client can be used to run code compiled for
the interpreter. The client registers the tiger standard library
functions and sets up the garbage collector before running the source
program:
qc-- -interp source.c--
client source.qs
ADDITIONAL NOTES
----------------------------------------------------------------------