Download
The Classages compiler is available for download in two forms, the bytecode release and the source code release. The compiler is developed in Java, on top of the Polyglot extensible compiler framework. To install the Classages compiler, Polyglot needs to be installed first. For latest updates of Polyglot and its underlying parser generator PPG (which is in turn built on top of the parser generator CUP) and lexer generator JFlex, please follow the respective hyperlinks above.
Classages has been built successfully on Solaris, and is expected to run on various UNIX platforms. It is known to run with JDK 1.4.
Bytecode Release Installation
- Download the zipped package here.
- Unzip the package and make sure polyglot1_3.jar,
java_cup.jar, classages.jar is in your
CLASSPATH. The third file includes all
the bytecode classes developed for the Classages compiler, while
the first two are the necessary Polyglot bytecode files (version 1.3),
provided as a convenience. (If you would like to rebuild
Polyglot's latest source code, please visit its project page).
Source Code Release Installation
- Download the zipped package
here
and unzip the
package into a directory, which from now on we call HOME.
- Make sure the following items are in your CLASSPATH:
HOME/lib/polyglot1_3.jar and
HOME/lib/java_cup.jar.
- Ensure java is in your PATH.
- Install ant.
- Run ant from the HOME directory:
$ ant classages
By doing this, the generated bytecode files will be placed in the newly created classes subdirectory. You may optionally create a jar file by running:$ ant classages-jar
The jar file will be put in the lib directory. - Ensure the classes subdirectory is in your CLASSPATH, or if a jar file is created, make sure the file is in your CLASSPATH.
Running the compiler
- You may run the Classages compiler via the following command (For
historical reasons, the compiler implementation of the language goes
by a tentative name "newage"):
java <java-args> polyglot.main.Main -ext newage <polyglot-args> <files>
Here <java-args> is the standard argument list of running the java virtual machine, while <polyglot-args> includes various options in Polyglot to modify the default behavior, such as printing out debug information. Please read Polyglot's page for details. One of the useful options is -d, which allows you to specify where the output files of this compilation - including both the translated Java source code, and the bytecode generated from the source code - should go to; they would otherwise be put into the current directory.
<files> is a list of Classages source files. The Classages compiler compiles files with a .newa extension.
- One of the files in <files> might contain a classage
declared as a startup classage, whose name is the same as the
file name without suffix. To execute the application with this classage as
startup point, run:
java <startup-name>
where <startup-name> is the name of the startup classage.