javacc:jtb

Full name:

org.codehaus.mojo:javacc-maven-plugin:2.4.1:jtb

This plugin goal has been deprecated:

As of version 2.4, use the jtb-javacc goal instead.

Description:

Parses a JTB file and transforms it into source files for an AST and a JavaCC grammar file which automatically builds the AST.

Note:JTB requires Java 1.5 or higher. This goal will not work with earlier versions of the JRE.

Attributes:

  • Requires a Maven 2.0 project to be executed.
  • Since version: 2.2.
  • Binds by default to the lifecycle phase: generate-sources.

Optional Parameters

Name Type Since Description
descriptiveFieldNames Boolean 2.2 Setting this option to true causes JTB to generate field names that reflect the structure of the tree instead of generic names like f0, f1 etc. Default value is false.
excludes String[] 2.2 A set of Ant-like exclusion patterns used to prevent certain files from being processed. By default, this set if empty such that no files are excluded.
includes String[] 2.2 A set of Ant-like inclusion patterns used to select files from the source directory for processing. By default, the patterns **/*.jtb and **/*.JTB are used to select grammar files.
javadocFriendlyComments Boolean 2.2 If true, all generated comments will be wrapped in <pre> tags so that they are formatted correctly in API docs. Default value is false.
nodePackageName String 2.2 This option specifies the package for the generated AST nodes. This value may use a leading asterisk to reference the package of the corresponding parser. For example, if the parser package is org.apache and this parameter is set to *.demo, the tree node classes will be located in the package org.apache.demo. Default value is *.syntaxtree.
nodeParentClass String 2.2 The qualified name of a user-defined class from which all AST nodes will inherit. By default, AST nodes will inherit from the generated class Node.
outputDirectory File 2.2 The directory where the output Java files will be located. Default value is: ${project.build.directory}/generated-sources/jtb.
packageName String 2.2 This option is short for nodePackageName = <packageName>.syntaxtree and visitorPackageName = <packageName>.visitor. Note that this option takes precedence over nodePackageName and visitorPackageName if specified.
parentPointers Boolean 2.2 If true, all nodes will contain fields for its parent node. Default value is false.
printer Boolean 2.2 If true, JTB will generate a syntax tree dumping visitor. Default value is false.
scheme Boolean 2.2 If true, JTB will generate the following files to support the Schema programming language:
  • Scheme records representing the grammar.
  • A Scheme tree building visitor.
Default value is false.
sourceDirectory File 2.2 The directory where the JavaCC grammar files (*.jtb) are located. It will be recursively scanned for input files to pass to JTB. Default value is: ${basedir}/src/main/jtb.
specialTokens Boolean 2.2 If true, JTB will include JavaCC "special tokens" in the AST. Default value is false.
staleMillis int 2.2 The granularity in milliseconds of the last modification date for testing whether a source needs recompilation. Default value is: 0.
supressErrorChecking Boolean 2.2 If true, JTB will suppress its semantic error checking. Default value is false.
timestampDirectory File 2.2 The directory to store the processed input files for later detection of stale sources. Default value is: ${project.build.directory}/generated-sources/jtb-timestamp.
visitorPackageName String 2.2 This option specifies the package for the generated visitors. This value may use a leading asterisk to reference the package of the corresponding parser. For example, if the parser package is org.apache and this parameter is set to *.demo, the visitor classes will be located in the package org.apache.demo. Default value is *.visitor.

Parameter Details

descriptiveFieldNames :

Setting this option to true causes JTB to generate field names that reflect the structure of the tree instead of generic names like f0, f1 etc. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.2
  • Required: No
  • Expression: ${descriptiveFieldNames}

excludes :

A set of Ant-like exclusion patterns used to prevent certain files from being processed. By default, this set if empty such that no files are excluded.
  • Type: java.lang.String[]
  • Since: 2.2
  • Required: No

includes :

A set of Ant-like inclusion patterns used to select files from the source directory for processing. By default, the patterns **/*.jtb and **/*.JTB are used to select grammar files.
  • Type: java.lang.String[]
  • Since: 2.2
  • Required: No

javadocFriendlyComments :

If true, all generated comments will be wrapped in <pre> tags so that they are formatted correctly in API docs. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.2
  • Required: No
  • Expression: ${javadocFriendlyComments}

nodePackageName :

This option specifies the package for the generated AST nodes. This value may use a leading asterisk to reference the package of the corresponding parser. For example, if the parser package is org.apache and this parameter is set to *.demo, the tree node classes will be located in the package org.apache.demo. Default value is *.syntaxtree.
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • Expression: ${nodePackageName}

nodeParentClass :

The qualified name of a user-defined class from which all AST nodes will inherit. By default, AST nodes will inherit from the generated class Node.
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • Expression: ${nodeParentClass}

outputDirectory :

The directory where the output Java files will be located.
  • Type: java.io.File
  • Since: 2.2
  • Required: No
  • Expression: ${outputDirectory}
  • Default: ${project.build.directory}/generated-sources/jtb

packageName :

This option is short for nodePackageName = <packageName>.syntaxtree and visitorPackageName = <packageName>.visitor. Note that this option takes precedence over nodePackageName and visitorPackageName if specified.
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • Expression: ${package}

parentPointers :

If true, all nodes will contain fields for its parent node. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.2
  • Required: No
  • Expression: ${parentPointers}

printer :

If true, JTB will generate a syntax tree dumping visitor. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.2
  • Required: No
  • Expression: ${printer}

scheme :

If true, JTB will generate the following files to support the Schema programming language:
  • Scheme records representing the grammar.
  • A Scheme tree building visitor.
Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.2
  • Required: No
  • Expression: ${scheme}

sourceDirectory :

The directory where the JavaCC grammar files (*.jtb) are located. It will be recursively scanned for input files to pass to JTB.
  • Type: java.io.File
  • Since: 2.2
  • Required: No
  • Expression: ${sourceDirectory}
  • Default: ${basedir}/src/main/jtb

specialTokens :

If true, JTB will include JavaCC "special tokens" in the AST. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.2
  • Required: No
  • Expression: ${specialTokens}

staleMillis :

The granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
  • Type: int
  • Since: 2.2
  • Required: No
  • Expression: ${lastModGranularityMs}
  • Default: 0

supressErrorChecking :

If true, JTB will suppress its semantic error checking. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.2
  • Required: No
  • Expression: ${supressErrorChecking}

timestampDirectory :

The directory to store the processed input files for later detection of stale sources.
  • Type: java.io.File
  • Since: 2.2
  • Required: No
  • Expression: ${timestampDirectory}
  • Default: ${project.build.directory}/generated-sources/jtb-timestamp

visitorPackageName :

This option specifies the package for the generated visitors. This value may use a leading asterisk to reference the package of the corresponding parser. For example, if the parser package is org.apache and this parameter is set to *.demo, the visitor classes will be located in the package org.apache.demo. Default value is *.visitor.
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • Expression: ${visitorPackageName}