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.1
JTB 1.1.1 was released January 31, 1999. The following features
and changes since JTB 1.1 are present in this version:
-
Line number reporting has been added to most of the error and warning messages.
-
Fixed the lookahead bug which caused a parse error in JTB whenever a lookahead
statement contained a Java expression, such as
LOOKAHEAD( { sym.IsFullyScopedTypeName(GetFullyScopedName()) }
)
-
Fixed two token manager declaration bugs.
-
Token manager declarations were formerly formatted erroneously in jtb.out.jj.
-
In order to conform to the JavaCC grammar, the grammar for a token manager
declaration has been changed to the following:
TokenManagerDecls ::= "TOKEN_MGR_DECLS" ":" ClassBody
Known Issues for JTB 1.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.
-
Node class constructors do not check if the parameters passed to them
are null before attempting to call setParent() on the parameters.
-
If for some reason you need to create your syntax tree by hand and leave
parts of the tree null, this bug is a big problem. It will be fixed
in the next version of JTB.
-
Workaround: there is no easy workaround. There are a few alternatives:
-
Rewrite the code of the Node class constructors.
-
Use an earlier version of JTB.
-
Fix the JTB bug by manually editing the JTB source code.
-
Wait for the bug fix.
-
JavaCC reserved words (such as EOF, JAVACODE,
TOKEN, etc.) cannot be used as identifiers in Java code sections
of a JTB input file. This includes Java blocks, Javacode productions,
and between the PARSER_BEGIN and PARSER_END keywords
of a grammar file.
-
Fixing this bug will involve numerous changes to the JTB grammar (and thus,
the visitors as well). This is likely to introduce bugs into JTB.
Since the effort to fix the bug is so much greater than the potential benefit
of the bug fix, this bug will probably not be fixed.
-
Workaround: don't use these tokens as identifiers.
-
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.
Planned Features
This section lists features planned for future versions of JTB. Features
which have been implemented in the current 1.1 betas may be found in the
old release notes page.
-
An option will be added to generate more descriptive Node field names based
on the name of the class of the child as opposed to names such as f0,
f1, f2, etc.
-
Parent references in Nodes will become an option which can be
disabled.
-
The null parameter setParent() bug will be fixed.
-
A new constructor will be added to all Node classes that will automatically
create NodeTokens for productions which contain non-changing regular
expressions (e.g. < PLUS : "+" >). This will make it
more convenient to create a syntax tree by hand.
-
An option will be added to allow the user to specify the name of a class
that all Node classes will extend. This will allow you to add functionality
to all Node classes without having to edit them.
We are investigating the idea of visitor templates which allow you
to set the return types and parameters of visit() methods.
Back
Maintained by Wanjun Wang, wanjun@purdue.edu.
|
Created January 6, 1999.
Last modified June 26, 1999. |