JAVA TREEBUILDER |
SPECIAL
EDITION
FOR GJ
|
Special
Edition
JTB GJ Home
Standard JTB Home Links: |
JTB GJ1.1.2 was released on May 15, 2000.
It is a special version of JTB, which generates syntax trees that work
with GJ.
What's GJGJ is a design that extends the Java programming language with the generic types and methods. For example, GJ can support the following codes:interface Collection<A> {The main benefit of GJ over the current Java programming language lies in the added expressiveness and safety that stems from making type parameters explicit and making type casts implicit. GJ is designed to be fully backwards compatible with the current Java language, and in particular, one can retrofit existing library classes with generic interfaces without changing their codes. For details about GJ and downloading GJ compiler, please go to GJ web page. OverviewJTB GJx.x is a syntax tree builder to be used with the Java Compiler Compiler (JavaCC) parser generator. JTB GJx.x generates type-casting free syntax trees by using gj packages, specifically Vector<A> and Enumeration<A> in gj.util. It takes a plain JavaCC grammar file as input and automatically generates the following:
How to Obtain JTB GJx.xBoth compiled executables and source code for the newest version of JTB GJ are available. You can download them here. Also available are some examples of its use.RequirementsJTB GJx.x requires a Java 1.1 or higher virtual machine. In addition, it is compatible with JavaCC 0.6.x, or higher. GJ compiler is needed to compile the syntax tree generated by JTB GJx.x.Using JTB GJx.xAfter downloading and installing JTB GJx.x, using it is a matter of running it on your .jj JavaCC grammar file with the command% jtbgj yourgrammar.jjThis will generate
To generate your parser, simply run JavaCC on jtb.out.jj with the command % javacc jtb.out.jjOnce you are familiar with the specifics of the tree JTB GJx.x generates (see the documentation for details) as well as programming using the Visitor design pattern, writing your own visitors is a cinch. Simply subclass DepthFirstVisitor, GJDepthFirst, GJNoArguDepthFirst or GJVoidDepthFirst, overriding the methods you need to. You can compile all the generated classes by executing GJ compiler on your class containing the main() method: % gjc filename.javaGJ compiler will generate .class files executable on Java Virtual Machine, so you can run your program by: % java filename We are interested in your opinion of JTB GJ! To find out what you think of it, we use the same questionnaire as that of the standard JTB. We would really appreciate if you took the time to answer. |
Maintained by Wanjun Wang, wanjun@purdue.edu. | Created September 4, 1997.
Last modified May 15, 2000. |