This update adds precise garbage collection to the compiler and the runtime.
[IRC.git] / Robust / src / README
1 I. Compiling a simple test program
2
3 1) Go to the Robust directory and type "cvs update"
4
5 2) Go into the src directory and build the compiler by typing:
6 make clean
7 make
8
9 3) To run the compiler on a source file (For example to compile
10 Tests/Array.java):
11 java -cp ../cup/:. Main.Main -mainclass Array Tests/Array.java
12 NOTE: The mainclass option specifies the class that contains the main method
13
14 4) To compiler and link the output of the compiler do:
15 gcc -IRuntime -I. -O0 -g methods.c Runtime/runtime.c
16
17 5) To run the binary type:
18 ./a.out
19
20
21
22 II. Command line options
23
24 To see all the legal command line options for the compiler type:
25 java -cp ../cup:. Main.Main -help
26
27
28
29 III. Using Garbage Collection 
30 (DEPRECATED...THIS IS FOR CONSERVATIVE GC ONLY...WE NOW HAVE PRECISE GC.)
31
32
33 1) Download the Hans Boehm garbage collector
34
35 2) Make a directory called gc in the Runtime directory & untar the gc into this directory
36
37 3) ./configure --prefix={RUNTIME DIRECTORY}; make;make install to build
38 (Modify the prefix to the appropriate path for the runtime directory.
39
40 4) Make sure the gc libraries are placed in Runtime/lib and the include files in Runtime/include
41
42 5) Change step 4 in the build procedure to:
43 gcc -IRuntime -I. -IRuntime/include -DBOEHM_GC -LRuntime/lib/ -lgc -O9 -g methods.c Runtime/runtime.c
44
45 IV. High level organization of the compiler:
46 1. Lexer is in src/Lex
47 2. Parser is built from the grammar in Parse/java14.cup
48 3. Internal Representations are in the the IR subdirectory
49 3a. Tree representation is in IR/Tree (constructed by IR/Tree/BuildTree)
50 3b. Flattened representation in is IR/Flat (constructed by IR/Flat/BuildFlat)
51 4. Code is generated from the flattened representation by IR/Flat/BuildCode
52 5. Main/Main.java is the top level
53 6. ClassLibrary contains the class library
54 7. Runtime contains the runtime