Subject: JTB Survey Date: Tue, 04 Apr 2000 23:40:51 -0500 From: Duane Buck 1. Please provide a short description of JTB as a recommendation to someone who has never seen or used it before. JTB (together with JCC) lets you build a syntax tree generator for a grammar of your own design. Its not much harder than writing a BNF for your grammar, and you get a syntax tree generator! Extending the supplied visitor classes, you can do anything you can think of, format the source code based on the syntax, add a GRASP Control Structure Diagram (CSD), generate a flow chart, even generate code! 2. How would you classify your use of JTB? What kind of work are you doing or have you done using JTB? I have actually done all of the above in my educational IDE based on Rich Pattis' Karel the Robot. I have changed the syntax so that it is based on Java, and my tool is called Jarel the Robot. I plan to do a lot more with the environment, adding in some more language features, and JTB will make that painless. I also plan to add the original Pascal syntax for those using Pattis' book. 3. What is your opinion on JTB? Did you find the tool useful? Please rate it on a scale from 1 to 10 (worst to best). I think JTB is easy to use. I first used the 1.1 version, and I had to rig things up in kind of a strange way. However, the new 1.2 version adds the ObjectVisitor classes, which give me what I need to code in a much more natural way. I rate it a 10. I don't know how you could improve it much. 4. Have you used other similar tools such as JJTree or ANTLR (specifically, the tree-building aspect of it)? I looked at JJTree, but even the JTB 1.1 version seemed much better to me than JJTree. 5. If you answered yes to number 4, how would you compare JTB with these other tools? Again, please rate it from 1 to 10 in comparison and include anything you have to say, including comments on ease of use, learning curve, etc. I could see that JJTree would be hard to use, and I switched to JTB. It would have been a lot better than nothing, so I would give JJTree a 4 compared to JTB's 10. 6. Please include below any other comments you have regarding JTB. Feel free to include any suggestions for improvement. For the ObjectVisitor classes, I think you should also output classes where the methods pass through the return values. I have to manually edit them as it stands now. Basically, instead of: /** * f0 -> "{" * f1 -> ( MethodDeclaration() )* * f2 -> ConstructorDeclaration() * f3 -> ( MethodDeclaration() )* * f4 -> "}" */ public Object visit(ClassBody n, Object argu) { Object _ret=null; n.f0.accept(this, argu); n.f1.accept(this, argu); n.f2.accept(this, argu); n.f3.accept(this, argu); n.f4.accept(this, argu); return _ret; } I need instead: /** * f0 -> "{" * f1 -> ( MethodDeclaration() )* * f2 -> ConstructorDeclaration() * f3 -> ( MethodDeclaration() )* * f4 -> "}" */ public Object visit(ClassBody n, Object argu) { Object _ret=argu; _ret=n.f0.accept(this, _ret); _ret=n.f1.accept(this, _ret); _ret=n.f2.accept(this, _ret); _ret=n.f3.accept(this, _ret); _ret=n.f4.accept(this, _ret); return _ret; } I think JTB is a great tool. Thanks for your continued efforts, it would be a big loss to me if this tool became unavailable! Duane Buck, Ph.D. Associate Professor Mathematical Sciences Department Otterbein College Westerville, Ohio 43081