Class JTBMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.javacc.AbstractPreprocessorMojo
org.codehaus.mojo.javacc.JTBMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class JTBMojo extends AbstractPreprocessorMojo
Deprecated.
As of version 2.4, use the jtb-javacc goal instead.
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.
Since:
2.2
Version:
$Id: JTBMojo.java 7743 2008-09-28 15:22:44Z bentmann $
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Boolean
    Deprecated.
    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.
    private String[]
    Deprecated.
    A set of Ant-like exclusion patterns used to prevent certain files from being processed.
    private String[]
    Deprecated.
    A set of Ant-like inclusion patterns used to select files from the source directory for processing.
    private Boolean
    Deprecated.
    If true, all generated comments will be wrapped in <pre> tags so that they are formatted correctly in API docs.
    private String
    Deprecated.
    This option specifies the package for the generated AST nodes.
    private String
    Deprecated.
    The qualified name of a user-defined class from which all AST nodes will inherit.
    private File
    Deprecated.
    The directory where the output Java files will be located.
    private String
    Deprecated.
    This option is short for nodePackageName = <packageName>.syntaxtree and visitorPackageName = <packageName>.visitor.
    private Boolean
    Deprecated.
    If true, all nodes will contain fields for its parent node.
    private Boolean
    Deprecated.
    If true, JTB will generate a syntax tree dumping visitor.
    private Boolean
    Deprecated.
    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.
    private File
    Deprecated.
    The directory where the JavaCC grammar files (*.jtb) are located.
    private Boolean
    Deprecated.
    If true, JTB will include JavaCC "special tokens" in the AST.
    private int
    Deprecated.
    The granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
    private Boolean
    Deprecated.
    If true, JTB will suppress its semantic error checking.
    private File
    Deprecated.
    The directory to store the processed input files for later detection of stale sources.
    private String
    Deprecated.
    This option specifies the package for the generated visitors.

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String[]
    Deprecated.
    Gets a set of Ant-like exclusion patterns used to unselect files from the source directory for processing.
    protected String[]
    Deprecated.
    Gets a set of Ant-like inclusion patterns used to select files from the source directory for processing.
    private String
    Deprecated.
    Gets the effective package name for the AST node files.
    protected File
    Deprecated.
    Gets the absolute path to the directory where the generated Java files for the parser will be stored.
    protected File
    Deprecated.
    Gets the absolute path to the directory where the grammar files are located.
    protected int
    Deprecated.
    Gets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
    protected File
    Deprecated.
    Gets the absolute path to the directory where the processed input files will be stored for later detection of stale sources.
    private String
    Deprecated.
    Gets the effective package name for the visitor files.
    private JTB
    Deprecated.
    Creates a new facade to invoke JTB.
    protected void
    Deprecated.
    Passes the specified grammar file through the tool.

    Methods inherited from class org.codehaus.mojo.javacc.AbstractPreprocessorMojo

    addCompileSourceRoot, createTimestamp, execute

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • packageName

      private String packageName
      Deprecated.
      This option is short for nodePackageName = <packageName>.syntaxtree and visitorPackageName = <packageName>.visitor. Note that this option takes precedence over nodePackageName and visitorPackageName if specified.
    • nodePackageName

      private String nodePackageName
      Deprecated.
      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.
    • visitorPackageName

      private String visitorPackageName
      Deprecated.
      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.
    • supressErrorChecking

      private Boolean supressErrorChecking
      Deprecated.
      If true, JTB will suppress its semantic error checking. Default value is false.
    • javadocFriendlyComments

      private Boolean javadocFriendlyComments
      Deprecated.
      If true, all generated comments will be wrapped in <pre> tags so that they are formatted correctly in API docs. Default value is false.
    • descriptiveFieldNames

      private Boolean descriptiveFieldNames
      Deprecated.
      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.
    • nodeParentClass

      private String nodeParentClass
      Deprecated.
      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.
    • parentPointers

      private Boolean parentPointers
      Deprecated.
      If true, all nodes will contain fields for its parent node. Default value is false.
    • specialTokens

      private Boolean specialTokens
      Deprecated.
      If true, JTB will include JavaCC "special tokens" in the AST. Default value is false.
    • scheme

      private Boolean scheme
      Deprecated.
      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.
    • printer

      private Boolean printer
      Deprecated.
      If true, JTB will generate a syntax tree dumping visitor. Default value is false.
    • sourceDirectory

      private File sourceDirectory
      Deprecated.
      The directory where the JavaCC grammar files (*.jtb) are located. It will be recursively scanned for input files to pass to JTB.
    • outputDirectory

      private File outputDirectory
      Deprecated.
      The directory where the output Java files will be located.
    • timestampDirectory

      private File timestampDirectory
      Deprecated.
      The directory to store the processed input files for later detection of stale sources.
    • staleMillis

      private int staleMillis
      Deprecated.
      The granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
    • includes

      private String[] includes
      Deprecated.
      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.
    • excludes

      private String[] excludes
      Deprecated.
      A set of Ant-like exclusion patterns used to prevent certain files from being processed. By default, this set is empty such that no files are excluded.
  • Constructor Details

    • JTBMojo

      public JTBMojo()
      Deprecated.
  • Method Details

    • getSourceDirectory

      protected File getSourceDirectory()
      Deprecated.
      Gets the absolute path to the directory where the grammar files are located.
      Specified by:
      getSourceDirectory in class AbstractPreprocessorMojo
      Returns:
      The absolute path to the directory where the grammar files are located, never null.
    • getIncludes

      protected String[] getIncludes()
      Deprecated.
      Gets a set of Ant-like inclusion patterns used to select files from the source directory for processing.
      Specified by:
      getIncludes in class AbstractPreprocessorMojo
      Returns:
      A set of Ant-like inclusion patterns used to select files from the source directory for processing, can be null if all files should be included.
    • getExcludes

      protected String[] getExcludes()
      Deprecated.
      Gets a set of Ant-like exclusion patterns used to unselect files from the source directory for processing.
      Specified by:
      getExcludes in class AbstractPreprocessorMojo
      Returns:
      A set of Ant-like inclusion patterns used to unselect files from the source directory for processing, can be null if no files should be excluded.
    • getOutputDirectory

      protected File getOutputDirectory()
      Deprecated.
      Gets the absolute path to the directory where the generated Java files for the parser will be stored.
      Specified by:
      getOutputDirectory in class AbstractPreprocessorMojo
      Returns:
      The absolute path to the directory where the generated Java files for the parser will be stored, never null.
    • getTimestampDirectory

      protected File getTimestampDirectory()
      Deprecated.
      Gets the absolute path to the directory where the processed input files will be stored for later detection of stale sources.
      Specified by:
      getTimestampDirectory in class AbstractPreprocessorMojo
      Returns:
      The absolute path to the directory where the processed input files will be stored for later detection of stale sources, never null.
    • getStaleMillis

      protected int getStaleMillis()
      Deprecated.
      Gets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
      Specified by:
      getStaleMillis in class AbstractPreprocessorMojo
      Returns:
      The granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
    • processGrammar

      protected void processGrammar(GrammarInfo grammarInfo) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Deprecated.
      Passes the specified grammar file through the tool.
      Specified by:
      processGrammar in class AbstractPreprocessorMojo
      Parameters:
      grammarInfo - The grammar info describing the grammar file to process, must not be null.
      Throws:
      org.apache.maven.plugin.MojoExecutionException - If the invocation of the tool failed.
      org.apache.maven.plugin.MojoFailureException - If the tool reported a non-zero exit code.
    • getNodePackageName

      private String getNodePackageName()
      Deprecated.
      Gets the effective package name for the AST node files.
      Returns:
      The effective package name for the AST node files, never null.
    • getVisitorPackageName

      private String getVisitorPackageName()
      Deprecated.
      Gets the effective package name for the visitor files.
      Returns:
      The effective package name for the visitor files, never null.
    • newJTB

      private JTB newJTB()
      Deprecated.
      Creates a new facade to invoke JTB. Most options for the invocation are derived from the current values of the corresponding mojo parameters. The caller is responsible to set the input file, output directories and packages on the returned facade.
      Returns:
      The facade for the tool invocation, never null.