OLD
RELEASE
NOTES
This page contains release notes and known issues for the old versions
of JTB, as well as features we had planned
to implement in newer versions. The release notes for the current
version may be obtained here.
Release Notes for JTB 1.1
JTB 1.1 was released January 10, 1999. The following features
and changes since JTB 1.1pre4 are present in this version:
-
"kind" field added to NodeToken, equivalent to the JavaCC
Token class kind field--each type of token has a unique
int associated with it. See the JavaCC documentation for
more details.
-
Parent references and getParent() / setParent() methods
added to all Node classes.
-
Added a semantic checking phase to JTB to catch legal JavaCC code which
can cause problems with JTB, more specifically:
-
Productions with the same name as a JTB automatically-generated class (e.g.
Node, NodeOptional, etc.)
-
Productions with a return value other than void.
-
Javacode productions, which must be handled specially (see below).
-
Blocks of Java code within productions.
-
Extraneous parentheses within a production.
-
The Node interface now extends Serializable, allowing
your syntax trees or subtrees to be serialized to an output stream.
-
Command-line option changes:
-
Removed the "=" from the -o, -vp, and -np
options. Before you had to type "-vp=mypackage", now you
type "-vp mypackage". This fixes a bug that users experienced
on the Windows platform.
-
Added a new shortcut option -p for specifying the parent package
of the syntaxtree and visitor packages. Rather
than having to type "-np foo.mypackage.syntaxtree -vp foo.mypackage.visitor",
you can now type simply "-p foo.mypackage". syntaxtree
and visitor are assumed.
-
Added option -e to turn off the new semantic checker.
-
Removed the -vn and JTB debugging options.
-
Fixed several bugs:
-
Blocks of Java code formerly caused JTB to generate incorrect visitor comments.
This has been fixed, but in general, Java blocks are not recommended in
JTB code. Thus, such code is flagged with a warning by JTB.
-
Extra parentheses in a production, such as "( A() B() )" would
cause JTB to produce incorrect parser code. This has been fixed so
that JTB now generates a NodeSequence to represent the term--however,
extra parentheses are currently still flagged as a warning by JTB as a
precaution. We see no reason to use extraneous parentheses in JTB
code.
-
A production such as "( A() | B() { someJavaCode(); } )" would
cause an "Empty NodeChoice" error in JTB. This has been corrected.
Known Issues for JTB 1.1
This section describes currently known problems and bugs in the current
version of JTB. Also listed is a temporary workaround for the problem.
-
Certain lookahead productions are tagged as errors during parsing by
JTB.
-
A bug was reported with the C++ grammar included with JavaCC 0.6.1.
Certain lookaheads may cause JTB to report an error when they are actually
correct. The specific lookahead in the C ++ grammar was as follows:
LOOKAHEAD( { sym.IsFullyScopedTypeName(GetFullyScopedName()) } )
Workaround: put a semicolon after the Java expression.
JAVACODE productions cause JTB to produce erroneous output.
-
JTB will attempt to put JAVACODE productions in the tree, even
if the production is of return type void. For example:
JAVACODE
void skip_to_matching_braces() {
// Code to eat tokens until a matching brace is found
}
void NT() : { }
{
A() skip_to_matching_braces()
}
This will cause JTB to attempt to construct a node of type NT
with children of type A and skip_to_matching_braces,which
is incorrect.
Workaround steps:
-
Make a "dummy" class with the name of your JAVACODE production.
You can copy one of the classes in the syntaxtree directory and
remove all the child references.
-
Change the return value of the JAVACODE production to the name
of the production.
-
Add something along the lines of
return new your_production_name();
at the end of the Java code.
Back
Maintained by Wanjun Wang, wanjun@purdue.edu.
|
Created January 6, 1999.
Last modified June 26, 1999. |