Fork me on GitHub

javacc:jjtree-javacc

Full name:

org.codehaus.mojo:javacc-maven-plugin:3.0.1:jjtree-javacc

Description:

Preprocesses decorated grammar files (*.jjt) with JJTree and passes the output to JavaCC in order to finally generate a parser with parse tree actions.

Attributes:

  • Requires a Maven project to be executed.
  • The goal is not marked as thread-safe and thus does not support parallel builds.
  • Since version: 2.4.
  • Binds by default to the lifecycle phase: generate-sources.

Optional Parameters

Name Type Since Description
<buildNodeFiles> Boolean 2.4 A flag whether to generate sample implementations for SimpleNode and any other nodes used in the grammar. Default value is true.
User property is: javacc.buildNodeFiles.
<buildParser> Boolean 2.4 A flag that controls whether the parser file (*Parser.java) should be generated or not. If set to false, only the token manager is generated. Default value is true.
User property is: javacc.buildParser.
<buildTokenManager> Boolean 2.4 A flag that controls whether the token manager file (*TokenManager.java) should be generated or not. Setting this to false can speed up the generation process if only the parser part of the grammar changed. Default value is true.
User property is: javacc.buildTokenManager.
<cacheTokens> Boolean 2.4 Setting this option to true causes the generated parser to lookahead for extra tokens ahead of time. Default value is false.
User property is: javacc.cacheTokens.
<choiceAmbiguityCheck> Integer 2.4 This is the number of tokens considered in checking choices of the form "A | B | ..." for ambiguity. Default value is 2.
User property is: javacc.choiceAmbiguityCheck.
<commonTokenAction> Boolean 2.4 When set to true, every call to the token manager's method getNextToken() (see the description of the Java Compiler Compiler API) will cause a call to a user-defined method CommonTokenAction() after the token has been scanned in by the token manager. Default value is false.
User property is: javacc.commonTokenAction.
<debugLookAhead> Boolean 2.4 This is a boolean option whose default value is false. Setting this option to true causes the parser to generate all the tracing information it does when the option debugParser is true, and in addition, also causes it to generated a trace of actions performed during lookahead operation.
User property is: javacc.debugLookAhead.
<debugParser> Boolean 2.4 This option is used to obtain debugging information from the generated parser. Setting this option to true causes the parser to generate a trace of its actions. Default value is false.
User property is: javacc.debugParser.
<debugTokenManager> Boolean 2.4 This option is used to obtain debugging information from the generated token manager. Default value is false.
User property is: javacc.debugTokenManager.
<errorReporting> Boolean 2.4 Setting it to false causes errors due to parse errors to be reported in somewhat less detail. Default value is true.
User property is: javacc.errorReporting.
<excludes> String[] 2.4 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.
<forceLaCheck> Boolean 2.4 This option setting controls lookahead ambiguity checking performed by JavaCC. Default value is false.
User property is: javacc.forceLaCheck.
<grammarEncoding> String 2.6 The file encoding to use for reading the grammar files.
Default value is: ${project.build.sourceEncoding}.
User property is: javacc.grammarEncoding.
<ignoreCase> Boolean 2.4 Setting this option to true causes the generated token manager to ignore case in the token specifications and the input files. Default value is false.
User property is: javacc.ignoreCase.
<includes> String[] 2.4 A set of Ant-like inclusion patterns used to select files from the source directory for processing. By default, the patterns **/*.jj, **/*.JJ, **/*.jjt and **/*.JJT are used to select grammar files.
<interimDirectory> File 2.4 The directory where the AST node files generated by JJTree will be stored. The directory will be registered as a compile source root of the project such that the generated files will participate in later build phases like compiling and packaging.
Default value is: ${project.build.directory}/generated-sources/jjtree.
User property is: javacc.interimDirectory.
<isStatic> Boolean 2.4 If true, all methods and class variables are specified as static in the generated parser and token manager. This allows only one parser object to be present, but it improves the performance of the parser. Default value is true.
User property is: javacc.isStatic.
<javaUnicodeEscape> Boolean 2.4 When set to true, the generated parser uses an input stream object that processes Java Unicode escapes (\uxxxx) before sending characters to the token manager. Default value is false.
User property is: javacc.javaUnicodeEscape.
<jdkVersion> String 2.4 The Java version for which to generate source code. Default value is 1.5 for plugin version 2.6+ and 1.4 in older versions.
User property is: javacc.jdkVersion.
<keepLineColumn> Boolean 2.4 A flag whether to keep line and column information along with a token. Default value is true.
User property is: javacc.keepLineColumn.
<lookAhead> Integer 2.4 The number of tokens to look ahead before making a decision at a choice point during parsing. The default value is 1.
User property is: javacc.lookAhead.
<multi> Boolean 2.4 A flag whether to generate a multi mode parse tree or a single mode parse tree. Default value is false.
User property is: javacc.multi.
<nodeClass> String 2.5 The name of a custom class that extends SimpleNode and will be used as the super class for the generated tree node classes. By default, the tree node classes will directly extend the class SimpleNode.
User property is: javacc.nodeClass.
<nodeDefaultVoid> Boolean 2.4 A flag whether to make each non-decorated production void instead of an indefinite node. Default value is false.
User property is: javacc.nodeDefaultVoid.
<nodeFactory> String 2.4 The name of a custom factory class used to create Node objects. This class must have a method with the signature public static Node jjtCreate(int id). By default, the class SimpleNode will be used as the factory class.
User property is: javacc.nodeFactory.
<nodePackage> String 2.4 The package to generate the AST node classes into. 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 *.node, the tree node classes will be located in the package org.apache.node. By default, the package of the corresponding parser is used.
User property is: javacc.nodePackage.
<nodePrefix> String 2.4 The prefix used to construct node class names from node identifiers in multi mode. Default value is AST.
User property is: javacc.nodePrefix.
<nodeScopeHook> Boolean 2.4 A flag whether user-defined parser methods should be called on entry and exit of every node scope. Default value is false.
User property is: javacc.nodeScopeHook.
<nodeUsesParser> Boolean 2.4 A flag whether the node construction routines need an additional method parameter to receive the parser object. Default value is false.
User property is: javacc.nodeUsesParser.
<otherAmbiguityCheck> Integer 2.4 This is the number of tokens considered in checking all other kinds of choices (i.e., of the forms "(A)*", "(A)+", and "(A)?") for ambiguity. Default value is 1.
User property is: javacc.otherAmbiguityCheck.
<outputDirectory> File 2.4 The directory where the parser files generated by JavaCC will be stored. The directory will be registered as a compile source root of the project such that the generated files will participate in later build phases like compiling and packaging.
Default value is: ${project.build.directory}/generated-sources/javacc.
User property is: javacc.outputDirectory.
<sanityCheck> Boolean 2.4 Enables/disables many syntactic and semantic checks on the grammar file during parser generation. Default value is true.
User property is: javacc.sanityCheck.
<sourceDirectory> File 2.4 The directory where the decorated JavaCC grammar files (*.jjt) are located. It will be recursively scanned for input files to pass to JJTree. The parameters includes and excludes can be used to select a subset of files.
Default value is: ${basedir}/src/main/jjtree.
User property is: javacc.sourceDirectory.
<staleMillis> int 2.4 The granularity in milliseconds of the last modification date for testing whether a grammar file needs recompilation.
Default value is: 0.
User property is: javacc.lastModGranularityMs.
<supportClassVisibilityPublic> Boolean 2.6 A flag whether the generated support classes of the parser should have public or package-private visibility. Default value is true.
User property is: javacc.supportClassVisibilityPublic.
<tokenExtends> String 2.5 The name of the base class for the generated Token class. Default value is java.lang.Object.
User property is: javacc.tokenExtends.
<tokenFactory> String 2.5 The name of a custom factory class used to create Token objects. This class must have a method with the signature public static Token newToken(int ofKind, String image). By default, tokens are created by calling Token.newToken().
User property is: javacc.tokenFactory.
<tokenManagerUsesParser> Boolean 2.4 When set to true, the generated token manager will include a field called parser that references the instantiating parser instance. Default value is false.
User property is: javacc.tokenManagerUsesParser.
<trackTokens> Boolean 2.5 A flag whether to insert the methods jjtGetFirstToken(), jjtSetFirstToken(), getLastToken() and jjtSetLastToken() into the class SimpleNode. Default value is false.
User property is: javacc.trackTokens.
<unicodeInput> Boolean 2.4 When set to true, the generated parser uses uses an input stream object that reads Unicode files. By default, ASCII files are assumed. Default value is false.
User property is: javacc.unicodeInput.
<userCharStream> Boolean 2.4 This flag controls whether the token manager will read characters from a character stream reader as defined by the options javaUnicodeEscape and unicodeInput or whether the token manager reads from a user-supplied implementation of CharStream. Default value is false.
User property is: javacc.userCharStream.
<userTokenManager> Boolean 2.4 The default action is to generate a token manager that works on the specified grammar tokens. If this option is set to true, then the parser is generated to accept tokens from any token manager of type TokenManager - this interface is generated into the generated parser directory. Default value is false.
User property is: javacc.userTokenManager.
<visitor> Boolean 2.4 A flag whether to insert a jjtAccept() method in the node classes and to generate a visitor implementation with an entry for every node type used in the grammar. Default value is false.
User property is: javacc.visitor.
<visitorDataType> String 2.5 The name of a class to use for the data argument of the jjtAccept() and visit() methods. Default value is java.lang.Object.
User property is: javacc.visitorDataType.
<visitorException> String 2.4 The name of an exception class to include in the signature of the generated jjtAccept() and visit() methods. By default, the throws clause of the generated methods is empty such that only unchecked exceptions can be thrown.
User property is: javacc.visitorException.
<visitorReturnType> String 2.5 The name of a class to use as the return type of the jjtAccept() and visit() methods. Default value is java.lang.Object.
User property is: javacc.visitorReturnType.

Parameter Details

<buildNodeFiles>

A flag whether to generate sample implementations for SimpleNode and any other nodes used in the grammar. Default value is true.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.buildNodeFiles

<buildParser>

A flag that controls whether the parser file (*Parser.java) should be generated or not. If set to false, only the token manager is generated. Default value is true.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.buildParser

<buildTokenManager>

A flag that controls whether the token manager file (*TokenManager.java) should be generated or not. Setting this to false can speed up the generation process if only the parser part of the grammar changed. Default value is true.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.buildTokenManager

<cacheTokens>

Setting this option to true causes the generated parser to lookahead for extra tokens ahead of time. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.cacheTokens

<choiceAmbiguityCheck>

This is the number of tokens considered in checking choices of the form "A | B | ..." for ambiguity. Default value is 2.
  • Type: java.lang.Integer
  • Since: 2.4
  • Required: No
  • User Property: javacc.choiceAmbiguityCheck

<commonTokenAction>

When set to true, every call to the token manager's method getNextToken() (see the description of the Java Compiler Compiler API) will cause a call to a user-defined method CommonTokenAction() after the token has been scanned in by the token manager. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.commonTokenAction

<debugLookAhead>

This is a boolean option whose default value is false. Setting this option to true causes the parser to generate all the tracing information it does when the option debugParser is true, and in addition, also causes it to generated a trace of actions performed during lookahead operation.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.debugLookAhead

<debugParser>

This option is used to obtain debugging information from the generated parser. Setting this option to true causes the parser to generate a trace of its actions. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.debugParser

<debugTokenManager>

This option is used to obtain debugging information from the generated token manager. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.debugTokenManager

<errorReporting>

Setting it to false causes errors due to parse errors to be reported in somewhat less detail. Default value is true.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.errorReporting

<excludes>

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.
  • Type: java.lang.String[]
  • Since: 2.4
  • Required: No

<forceLaCheck>

This option setting controls lookahead ambiguity checking performed by JavaCC. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.forceLaCheck

<grammarEncoding>

The file encoding to use for reading the grammar files.
  • Type: java.lang.String
  • Since: 2.6
  • Required: No
  • User Property: javacc.grammarEncoding
  • Default: ${project.build.sourceEncoding}

<ignoreCase>

Setting this option to true causes the generated token manager to ignore case in the token specifications and the input files. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.ignoreCase

<includes>

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

<interimDirectory>

The directory where the AST node files generated by JJTree will be stored. The directory will be registered as a compile source root of the project such that the generated files will participate in later build phases like compiling and packaging.
  • Type: java.io.File
  • Since: 2.4
  • Required: No
  • User Property: javacc.interimDirectory
  • Default: ${project.build.directory}/generated-sources/jjtree

<isStatic>

If true, all methods and class variables are specified as static in the generated parser and token manager. This allows only one parser object to be present, but it improves the performance of the parser. Default value is true.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.isStatic

<javaUnicodeEscape>

When set to true, the generated parser uses an input stream object that processes Java Unicode escapes (\uxxxx) before sending characters to the token manager. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.javaUnicodeEscape

<jdkVersion>

The Java version for which to generate source code. Default value is 1.5 for plugin version 2.6+ and 1.4 in older versions.
  • Type: java.lang.String
  • Since: 2.4
  • Required: No
  • User Property: javacc.jdkVersion

<keepLineColumn>

A flag whether to keep line and column information along with a token. Default value is true.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.keepLineColumn

<lookAhead>

The number of tokens to look ahead before making a decision at a choice point during parsing. The default value is 1.
  • Type: java.lang.Integer
  • Since: 2.4
  • Required: No
  • User Property: javacc.lookAhead

<multi>

A flag whether to generate a multi mode parse tree or a single mode parse tree. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.multi

<nodeClass>

The name of a custom class that extends SimpleNode and will be used as the super class for the generated tree node classes. By default, the tree node classes will directly extend the class SimpleNode.
  • Type: java.lang.String
  • Since: 2.5
  • Required: No
  • User Property: javacc.nodeClass

<nodeDefaultVoid>

A flag whether to make each non-decorated production void instead of an indefinite node. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.nodeDefaultVoid

<nodeFactory>

The name of a custom factory class used to create Node objects. This class must have a method with the signature public static Node jjtCreate(int id). By default, the class SimpleNode will be used as the factory class.
  • Type: java.lang.String
  • Since: 2.4
  • Required: No
  • User Property: javacc.nodeFactory

<nodePackage>

The package to generate the AST node classes into. 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 *.node, the tree node classes will be located in the package org.apache.node. By default, the package of the corresponding parser is used.
  • Type: java.lang.String
  • Since: 2.4
  • Required: No
  • User Property: javacc.nodePackage

<nodePrefix>

The prefix used to construct node class names from node identifiers in multi mode. Default value is AST.
  • Type: java.lang.String
  • Since: 2.4
  • Required: No
  • User Property: javacc.nodePrefix

<nodeScopeHook>

A flag whether user-defined parser methods should be called on entry and exit of every node scope. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.nodeScopeHook

<nodeUsesParser>

A flag whether the node construction routines need an additional method parameter to receive the parser object. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.nodeUsesParser

<otherAmbiguityCheck>

This is the number of tokens considered in checking all other kinds of choices (i.e., of the forms "(A)*", "(A)+", and "(A)?") for ambiguity. Default value is 1.
  • Type: java.lang.Integer
  • Since: 2.4
  • Required: No
  • User Property: javacc.otherAmbiguityCheck

<outputDirectory>

The directory where the parser files generated by JavaCC will be stored. The directory will be registered as a compile source root of the project such that the generated files will participate in later build phases like compiling and packaging.
  • Type: java.io.File
  • Since: 2.4
  • Required: No
  • User Property: javacc.outputDirectory
  • Default: ${project.build.directory}/generated-sources/javacc

<sanityCheck>

Enables/disables many syntactic and semantic checks on the grammar file during parser generation. Default value is true.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.sanityCheck

<sourceDirectory>

The directory where the decorated JavaCC grammar files (*.jjt) are located. It will be recursively scanned for input files to pass to JJTree. The parameters includes and excludes can be used to select a subset of files.
  • Type: java.io.File
  • Since: 2.4
  • Required: No
  • User Property: javacc.sourceDirectory
  • Default: ${basedir}/src/main/jjtree

<staleMillis>

The granularity in milliseconds of the last modification date for testing whether a grammar file needs recompilation.
  • Type: int
  • Since: 2.4
  • Required: No
  • User Property: javacc.lastModGranularityMs
  • Default: 0

<supportClassVisibilityPublic>

A flag whether the generated support classes of the parser should have public or package-private visibility. Default value is true.
  • Type: java.lang.Boolean
  • Since: 2.6
  • Required: No
  • User Property: javacc.supportClassVisibilityPublic

<tokenExtends>

The name of the base class for the generated Token class. Default value is java.lang.Object.
  • Type: java.lang.String
  • Since: 2.5
  • Required: No
  • User Property: javacc.tokenExtends

<tokenFactory>

The name of a custom factory class used to create Token objects. This class must have a method with the signature public static Token newToken(int ofKind, String image). By default, tokens are created by calling Token.newToken().
  • Type: java.lang.String
  • Since: 2.5
  • Required: No
  • User Property: javacc.tokenFactory

<tokenManagerUsesParser>

When set to true, the generated token manager will include a field called parser that references the instantiating parser instance. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.tokenManagerUsesParser

<trackTokens>

A flag whether to insert the methods jjtGetFirstToken(), jjtSetFirstToken(), getLastToken() and jjtSetLastToken() into the class SimpleNode. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.5
  • Required: No
  • User Property: javacc.trackTokens

<unicodeInput>

When set to true, the generated parser uses uses an input stream object that reads Unicode files. By default, ASCII files are assumed. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.unicodeInput

<userCharStream>

This flag controls whether the token manager will read characters from a character stream reader as defined by the options javaUnicodeEscape and unicodeInput or whether the token manager reads from a user-supplied implementation of CharStream. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.userCharStream

<userTokenManager>

The default action is to generate a token manager that works on the specified grammar tokens. If this option is set to true, then the parser is generated to accept tokens from any token manager of type TokenManager - this interface is generated into the generated parser directory. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.userTokenManager

<visitor>

A flag whether to insert a jjtAccept() method in the node classes and to generate a visitor implementation with an entry for every node type used in the grammar. Default value is false.
  • Type: java.lang.Boolean
  • Since: 2.4
  • Required: No
  • User Property: javacc.visitor

<visitorDataType>

The name of a class to use for the data argument of the jjtAccept() and visit() methods. Default value is java.lang.Object.
  • Type: java.lang.String
  • Since: 2.5
  • Required: No
  • User Property: javacc.visitorDataType

<visitorException>

The name of an exception class to include in the signature of the generated jjtAccept() and visit() methods. By default, the throws clause of the generated methods is empty such that only unchecked exceptions can be thrown.
  • Type: java.lang.String
  • Since: 2.4
  • Required: No
  • User Property: javacc.visitorException

<visitorReturnType>

The name of a class to use as the return type of the jjtAccept() and visit() methods. Default value is java.lang.Object.
  • Type: java.lang.String
  • Since: 2.5
  • Required: No
  • User Property: javacc.visitorReturnType