Java Reference
In-Depth Information
A.3.1 Scripts
We provide three scripts
8
: The first script,
$j/j--/bin/j--
, is a wrapper for
jminusminus
.Main
. This is the j-- compiler. It has the following command-line syntax:
Usage:j--<options><sourcefile>
wherepossibleoptionsinclude:
-t OnlytokenizeinputandprinttokenstoSTDOUT
-p OnlyparseinputandprintASTtoSTDOUT
-pa Onlyparseandpre-analyzeinputandprintASTtoSTDOUT
-a Onlyparse,pre-analyze,andanalyzeinputandprintASTtoSTDOUT
-s<naive|linear|graph>GenerateSPIMcode.
-r<num>Max.physicalregisters(1-18)availableforallocation;default=8
-d<dir>Specifywheretoplacegeneratedclassfiles;default=.
The second script,
$j/j--/bin/javaccj--
, is a wrapper for
jminusminus.JavaCCMain
.
This is also the j-- compiler, but uses the front end generated by JavaCC. Its command-line
syntax is similar to the script discussed above.
The third script,
$j/j--/bin/clemitter
, is separate from the compiler, and is a wrap-
per for
jminusminus.CLEmitter
. This is the Java class file emitter. It has the following
command-line syntax:
Usage:clemitter<file>
where file is a Java program that uses the
CLEmitter
interface to programmatically generate
a JVM class file. The output is a class file for the program, and the class files the program
was programmed to generate. For example, running the following command:
>$j/j--/bin/clemitter$j/j--/tests/clemitter/GenHelloWorld.java
produces
GenHelloWorld.class
and
HelloWorld.class
files.
HelloWorld.class
can then
be run as,
>javaHelloWorld
producing as output,
>Hello,World!
$j/j--/bin
may be added to the environment variable
PATH
for convenience. This will
allow invoking the scripts without specifying their fully qualified path, as follows:
>j--$j/j--/tests/pass/HelloWorld.java
A.3.2 Ant Targets
The Ant file
$j/j--/build.xml
advertises the following targets:
8
For the scripts to run,j--must be compiled and
j--.jar
file must exist in
$j/j--/lib
.
Search WWH ::
Custom Search