JTB 
JAVA TREEBUILDER
RELEASE NOTES
JTB Home 

What's New 

Release Notes 

  • Release Notes
  • Known Issues
  • Planned Features

  •  

    Download 

    Documentation 

    Examples 

    Tutorial 

    Why Visitors? 

    Other Tools 

    User Comments 



    Special Edition for GJ 



    Links: 
  • JavaCC
  • Design Patterns
  • Javasoft
  • GJ
  •  
    Jump to Java! 
     
    This page contains release notes and known issues for the current version of JTB, as well as planned features for future versions of the tool.   The release notes of previous versions may be obtained here

    Release Notes for JTB 1.2.2

    JTB 1.2.2 was released on May 15, 2000.  In JTB 1.2.2, a "-r" option is added and the rest is the same as in JTB 1.2.1.  The following features and changes since JTB 1.1.2 are presented in this version: 
    • The "-r" option allows jtb to generate ObjectDepthFirst.java with an alternative way of passing arguments and return values.
    • JTB automatically generates two more files in visitor directory: ObjectVisitor.java (an interface) and ObjectDepthFirst.java (a default implementation of ObjectVisitor), which support return value and argument in visitors.  The default visit() methods will return null.
    • Every node now has one more accept() method:

    •    public Object accept(visitor.Visitor v, Object argu) {  
            return v.visitor(this,argu);  
         }  
    • All the toolkits, Scheme Tree Builder and Printer, still subclass DepthFirstVisitor.
    • Solve the problem of the location of <EOF> by increasing the column of <EOF> by 1.  See Knows Issues for JTB 1.2 for details.


    Known Issues for JTB 1.2.2

    This section describes currently known problems and bugs in the current version of JTB.  Also listed is a temporary workaround for the problem. 
    • 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:
        1. 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.
        2. Change the return value of the JAVACODE production to the name of the production.
        3. Add something along the lines of
        4. return new your_production_name();
          at the end of the Java code.
    • Pay attention to the location check in TreeDumper.java if you use -printer option.  There is a location check in TreeDumper.java, which may cause problems.
      • <EOL> will cause the current location in TreeDumper changed automatically.  Make sure you set the location correctly, when you have <EOL> in your grammar and use TreeFormatter.java or your own class to change the location variables in NodeToken.
      • JTB increases the column of <EOF> by 1.  JavaCC considers <EOF> and the character before it have the same location.  However, it is illegal according to the location check in TreeDumper of JTB, if you have <EOF> in your grammar.  So the location of <EOF> in JTB is different from that in JavaCC.

    Planned Features

    This section lists features planned for future versions of JTB.  Features which have been implemented in the current 1.2 or lower versions may be found in the old release notes page. 
    • We are experimenting on JTB working with Java programming language that has generic types (e.g. GJ), which allow you to set the return value and arguments of visit() methods more conveniently and safely.

    Maintained by Wanjun Wang, wanjun@purdue.edu.
    Created November 9, 1997. 
    Last modified May 20, 2000.