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.0
-
Changes between versions 0.9.0a and 1.0:
-
Default visitor method names are now overloaded, each with the name visit(SomeNode
n) as opposed to the previous naming scheme of visitSomeNode(SomeNode
n).
-
Added command-line option "-vn" to generate files using the older
naming scheme (for backward compatiblity).
Known Issues for JTB 1.0
This section describes currently known problems and bugs in the current
version of JTB. Also listed is a temporary workaround for the problem
until it is addressed in a future version.
-
Java blocks within productions.
-
Productions containing Java blocks will cause problems in the Visitor.java
file. Each visit() method has a set of comments above them showing
which fields correspond to which part of the production. When Java
blocks appear in the production, they (incorrectly) are added to the comments,
but without the "//" to denote a comment.
-
This probably should not cause any problems since we are unable to think
of any situation where a JTB grammar would need Java code within a production.
However, if your grammar for some reason requires Java code within a production,
a solution is to manually edit Visitor.java remove the erroneous
lines from the file.
-
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.
There is no way to access JavaCC special tokens.
-
This was overlooked in the design of JTB 1.0, unfortunately.
-
The next version of JTB will allow special tokens to be accessed in the
tree, if desired (available in JTB 1.1pre3 and later).
Extraneous parentheses cause JTB to produce erroneous output.
-
Parentheses within a nonterminal should only be used in special constructs,
such as optionals, lists, or optional lists.
-
Extra sets of parentheses cause JTB to improperly annotate the grammar
and syntax tree class for the offending nonterminal.
-
A semantic checker will be added to JTB 1.1 to catch problem grammars such
as these.
Planned Features
The following features are under consideration for addition into the next
version of JTB. Bold and italic text shows current status of
the planned features, or the version in which they are implemented.
-
Visitor will be made an interface. The current default visitor
will be renamed to DepthFirstVisitor and will implement the Visitor
interface. Available in 1.1pre3.
-
A semantic analysis phase will be added to JTB to detect things which JavaCC
allows but are unneeded or unused by JTB. For example, a warning
will be issued for the following situations:
-
When productions have a return value other than void since JTB
automatically alters the return value of all productions in the annotated
grammar.
-
For blocks of Java code within productions since to our knowledge they
are generally unnecessary in JTB grammars.
-
When any productions have a name reserved by an automatically generated
JTB class (e.g. Node, NodeList, etc.)
-
JTB may be equipped with the ability to generate a sort of toolkit of visitors
for a grammar, including the aforementioned DepthFirstTraversal
and a Scheme tree generator. Scheme tree generator implemented
in 1.1pre1, tree formatter and dumper available in 1.1pre4.
-
Accessor methods such as getF0() may be added to preserve encapsulation.
The children references of the nodes will be made private if we decide
to do this.
-
Memory usage will be improved. Available in 1.1pre1 and later.
-
The JavaPrinter example will be updated
for use with JavaCC 0.7. done
-
JavaCC special tokens will be made available in the JTB-generated parse
tree. Available in 1.1pre2.
-
Users have requested that the JavaCC Token fields beginLine,
endLine, beginColumn, and endColumn be added
to the NodeToken class. So that special tokens also have
access to these values, the structure of storing special tokens currently
implemented in 1.1pre2 will have to be altered. Rather than storing
a Vector of Strings, it will store a Vector
of NodeTokens. These will be all the special tokens preceding
the current token. Available in 1.1pre3.
-
A parent reference may be added to the Node interface.
-
We are investigating the idea of automatically generating a skeleton pretty
printer visitor which the user can tailor to the grammar. Available
in 1.1pre4.
Back
Maintained by Wanjun Wang, wanjun@purdue.edu.
|
Created January 6, 1999.
Last modified June 26, 1999. |