Package EDU.purdue.jtb.generate
-
Class Summary Class Description AcceptInliner TheAcceptInlinervisitor (an extension ofvisitor) is called byVisitorsGenerator(which callsAcceptInliner.genAcceptMethods(StringBuilder, Spacing, UserClassInfo, VisitorInfo)to "inline" the accept methods on the user classes nodes.
This facilitates the user customization work by preparing all the lines of code the user wants to keep or to modify.BaseNodesGenerator ClassBaseNodesGeneratorcontains methods to generate the base nodes interfaces and classes.CommonCodeGenerator ClassCommonCodeGeneratorcontains methods to generate common pieces of code (fields and methods).JJFileAnnotator TheJJFileAnnotatorvisitor generates the (jtb) annotated .jj file containing the tree-building code.TreeDumperGenerator ClassTreeDumperGeneratorgenerates the TreeDumper visitor which simply prints all the tokens in the tree at the locations given in their beginLine and beginColumn member variables.TreeFormatterGenerator ClassTreeFormatterGeneratorgenerates the TreeFormatter visitor which is a skeleton pretty-printer.
Using some pre-defined methods, users can quickly and easily create a formatter for their grammar.
The formatter will then take a tree, insert token location information into the Tokens of the tree.
TreeDumper can then be used to output the result.
Note that unlike the other automatically generated file, since this one must be edited to be useful, JTB will not overwrite this file automatically.
JTB will take this precaution for the other files only if the "-w" command-line parameter is used.UserFilesGenerator ClassUserFilesGeneratorcontains methods to generate: CODEJAVA the (grammar) user nodes classes (genUserXxx, usingUserClassInfo), the hook interface and empty class files (genXxxEnterExitHook).VisitorsGenerator ClassVisitorsGeneratorcontains methods to generate: CODEJAVA the different IXxxVisitor interfaces and DepthFirstXxxVisitor classes files, the signature files.