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 .jj file (jtb.out.jj by 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 dir is 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 β€” Use NAME as the package for the syntax tree nodes.
  • -np NAME β€” Use NAME as the package for the syntax tree nodes.
  • -ns NAME β€” Use NAME as the class which all node classes will extend.
  • -o NAME β€” Use NAME as the filename for the annotated output grammar.
  • -p NAME β€” -p pkg is 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 β€” Use NAME as the package for the default visitor classes.
  • -vp NAME β€” Use NAME as the package for the default visitor classes.
  • -w β€” Do not overwrite existing files.
🫢 heads up bestie: -d and -p are short for the other flags and they overwrite them, so if you set both, the shortcut wins. also -w is 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