JTB(1)
π NAME π
jtb β the syntax tree builder for JavaCC, bestie. fr fr.
β¨ SYNOPSIS β¨
jtb [options] inputfile
π¦ DESCRIPTION π¦
okay so this manual page is gonna give you the brief rundown of the jtb command, and then you can go be iconic with it.
JTB β that's Java Tree Builder β is a syntax tree builder and a visitors generator. The whole vibe is that it sits in front of JavaCC (the Java Compiler Compiler) and does the tree work for you. You hand it a JavaCC grammar file as input (usually something with a .jtb extension, iykyk) and it automatically generates the following:
- a set of syntax tree classes based on the productions in the grammar, utilizing the Visitor design pattern;
- four interfaces:
IVoidVisitor,IVoidArguVisitor,IRetVisitor,IRetArguVisitor; - four depth-first visitors:
DepthFirstVoidVisitor,DepthFirstVoidArguVisitor,DepthFirstRetVisitor,DepthFirstREtArguVisitor, whose default methods simply visit the children of the current node; plus a JavaCC grammar.jjfile (jtb.out.jjby default), with the proper annotations to build the syntax tree during parsing (which then must be compiled with JavaCC).
and then the fun part: new visitors, which subclass any generated one, can then override the default methods and perform various operations on and manipulate the generated syntax tree. main character energy tbh π
π OPTIONS π
-clβ Print a list of the classes generated to standard out. cute little receipt β¨-d dirβ-d diris short for (and overwrites)-nd dir/syntaxtree -vd dir/visitor.-dlβ Generate depth level info.-eβ Suppress JTB semantic error checking. (yes she's being brave, no cap)-fβ Use descriptive node class field names.-hβ Display this help message and quit.-iaβ Inline visitors accept methods on base classes.-jdβ Generate JavaDoc-friendly comments in the nodes and visitor.-nd NAMEβ UseNAMEas the package for the syntax tree nodes.-np NAMEβ UseNAMEas the package for the syntax tree nodes.-ns NAMEβ UseNAMEas the class which all node classes will extend.-o NAMEβ UseNAMEas the filename for the annotated output grammar.-p NAMEβ-p pkgis short for (and overwrites)-np pkg.syntaxtree -vp pkg.visitor.-ppβ Generate parent pointers in all node classes.-printerβ Generate a syntax tree dumping visitor.-siβ Read from standard input rather than a file.-schemeβ Generate Scheme records representing the grammar and a Scheme tree building visitor.-tkβ Generate special tokens into the tree.-vd NAMEβ UseNAMEas the package for the default visitor classes.-vp NAMEβ UseNAMEas the package for the default visitor classes.-wβ Do not overwrite existing files.
π«Ά heads up bestie:-dand-pare short for the other flags and they overwrite them, so if you set both, the shortcut wins. also-wis your friend if you're precious about files you already have. don't say I didn't warn you π
π SEE ALSO π
πΈ AUTHOR πΈ
jtb was written by the UCLA Compilers Group.
This manual page was written by David Paleino <dapal@debian.org>, for the Debian project (and may be used by others).
This manual page was updated by Ludovico Cavedon <cavedon@debian.org>.
okay that's the whole page bestie, go build some syntax trees, you're literally gonna ate πβ¨
this one's from Jun 2010, and it's the JTB(1) page, living in the General Commands Manual section β yeah she's vintage, she's still slaying π
π¦
π¦ where this page comes from
- debian bookworm: jtb 1.4.12-3 Β· BSD-3-clause-ucla AND other
- debian trixie: jtb 1.4.12-3 Β· BSD-3-clause-ucla AND other
- ubuntu jammy: jtb 1.4.12-2 Β· BSD-3-clause-ucla AND other
- ubuntu noble: jtb 1.4.12-3 Β· BSD-3-clause-ucla AND other
- ubuntu questing: jtb 1.4.12-3
- ubuntu resolute: jtb 1.4.12-3build1 Β· BSD-3-clause-ucla AND other
- ubuntu stonking: jtb 1.4.12-3build1 Β· BSD-3-clause-ucla AND other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms