<?xml version="1.0" encoding="UTF-8"?>
<?asciidoc-toc maxdepth="2"?>
<?asciidoc-numbered?>
<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
<info>
<title>JavaCC Gradle Plugin</title>
<date>2023-12-20</date>
</info>
<note>
<simpara>Version 5 of this plugin will only work with Gradle 8.5 and JDK 17.</simpara>
</note>
<section xml:id="asciidocsummary">
<title>Summary</title>
<simpara>This plugin generates Java code from JavaCC and JJTree files. See <link xl:href="https://javacc.github.io/javacc/">Java Compiler Compiler tm (JavaCC tm) - The Java Parser Generator</link>.</simpara>
</section>
<section xml:id="asciidocusage">
<title>Usage</title>
<simpara>To apply the JavaCC Gradle Plugin to your projects, add the following in your build script:</simpara>
<details open>
<summary>Groovy</summary>
<formalpara>
<title>build.gradle</title>
<para>
<programlisting language="groovy" linenumbering="unnumbered">plugins {
    id 'com.intershop.gradle.javacc' version '5.0.0'
}

javacc {
    // configuration container for all javacc configurations
    configs {
        template {
            inputFile = file('jj/TemplateParser.jj')
            packageName = 'com.corporate.internal.parser'
            lookahead = '2'
        }
    }
}</programlisting>
</para>
</formalpara>
</details>
<details>
<summary>Kotlin</summary>
<formalpara>
<title>build.gradle.kts</title>
<para>
<programlisting language="kotlin" linenumbering="unnumbered">plugins {
    id("com.intershop.gradle.javacc") version "5.0.0"
}

javacc {
    // configuration container for all javacc configurations
    configs {
        register("template") {
            inputFile = file("jj/TemplateParser.jj")
            packageName = "com.corporate.internal.parser"
            lookahead = "2"
        }
    }
}</programlisting>
</para>
</formalpara>
</details>
<simpara>This plugin applies code generation to a project. If the JavaBasePlugin is applied to the project, generated java
sources will be added to the specified source set. Per default the main source set is used.</simpara>
<important>
<simpara>This plugin uses <literal>net.java.dev.javacc:javacc:7.0.13</literal>. It is possible to overwrite the project dependency configuration 'javacc', if you want to use another library for JavaCC code generation.</simpara>
</important>
</section>
<section xml:id="asciidoctasks">
<title>Tasks</title>
<simpara>The JavaCC Gradle plugin adds one task <literal>javacc</literal> to the project. This task depends on all other plugin task. It is a task added for each configuration.</simpara>
<informaltable frame="all" rowsep="1" colsep="1">
<?dbhtml table-width="95%, options="?>
<?dbfo table-width="95%, options="?>
<?dblatex table-width="95%, options="?>
<tgroup cols="3">
<colspec colname="col_1" colwidth="100.9375*"/>
<colspec colname="col_2" colwidth="121.125*"/>
<colspec colname="col_3" colwidth="181.6875*"/>
<tbody>
<row>
<entry align="left" valign="top"><simpara>Task name</simpara></entry>
<entry align="left" valign="top"><simpara>Type</simpara></entry>
<entry align="left" valign="top"><simpara>Description</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara>javacc</simpara></entry>
<entry align="left" valign="top"><simpara>Task</simpara></entry>
<entry align="left" valign="top"><simpara>Overall <literal>javaCC</literal> code generation taks of a project. This tasks depends onl la</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara>javacc&lt;configuration name&gt;</simpara></entry>
<entry align="left" valign="top"><simpara>com.intershop.build.javacc.task.JavaCCTask</simpara></entry>
<entry align="left" valign="top"><simpara>This task generates Java code for the specified configuration.</simpara></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section xml:id="asciidocproject-extension-javacc">
<title>Project Extension 'javacc'</title>
<simpara>This plugin adds an extension <emphasis role="strong"><literal>javacc</literal></emphasis> to the project.</simpara>
<section xml:id="asciidocproperties">
<title>Properties</title>
<informaltable frame="all" rowsep="1" colsep="1">
<?dbhtml table-width="90%, options="?>
<?dbfo table-width="90%, options="?>
<?dblatex table-width="90%, options="?>
<tgroup cols="4">
<colspec colname="col_1" colwidth="65.025*"/>
<colspec colname="col_2" colwidth="65.025*"/>
<colspec colname="col_3" colwidth="65.025*"/>
<colspec colname="col_4" colwidth="187.4249*"/>
<tbody>
<row>
<entry align="left" valign="top"><simpara>Property</simpara></entry>
<entry align="left" valign="top"><simpara>Type</simpara></entry>
<entry align="left" valign="top"><simpara>Default value</simpara></entry>
<entry align="left" valign="top"><simpara>Description</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">javaCCVersion</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"><simpara>'4.2'</simpara></entry>
<entry align="left" valign="top"><simpara>The version of JavaCC.</simpara></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section xml:id="asciidocmethods">
<title>Methods</title>
<informaltable frame="all" rowsep="1" colsep="1">
<?dbhtml table-width="95%"?>
<?dbfo table-width="95%"?>
<?dblatex table-width="95%"?>
<tgroup cols="3">
<colspec colname="col_1" colwidth="80.75*"/>
<colspec colname="col_2" colwidth="60.5625*"/>
<colspec colname="col_3" colwidth="262.4375*"/>
<thead>
<row>
<entry align="left" valign="top">Method</entry>
<entry align="left" valign="top">Type</entry>
<entry align="left" valign="top">Description</entry>
</row>
</thead>
<tbody>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">configs</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><link linkend="javaCC">JavaCC</link></simpara></entry>
<entry align="left" valign="top"><simpara>This contains all Java code generation configurations.</simpara></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<section xml:id="asciidocobject-javacc-javacc">
<title><anchor xml:id="javaCC" xreflabel="[javaCC]"/>Object 'javacc' (JavaCC)</title>
<informaltable frame="all" rowsep="1" colsep="1">
<?dbhtml table-width="90%, options="?>
<?dbfo table-width="90%, options="?>
<?dblatex table-width="90%, options="?>
<tgroup cols="4">
<colspec colname="col_1" colwidth="65.025*"/>
<colspec colname="col_2" colwidth="65.025*"/>
<colspec colname="col_3" colwidth="57.375*"/>
<colspec colname="col_4" colwidth="195.075*"/>
<thead>
<row>
<entry align="left" valign="top">Property</entry>
<entry align="left" valign="top">Type</entry>
<entry align="left" valign="top">Default value</entry>
<entry align="left" valign="top">Description</entry>
</row>
</thead>
<tbody>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">outputDir</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>File</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>&lt;project.buildDir&gt;/generated/javacc/&lt;config name&gt;</literal></simpara></entry>
<entry align="left" valign="top"><simpara>Generated code will be written under this directory.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">args</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>List&lt;String&gt;</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>Additional command line arguments passed to javaCC</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">sourceSetName</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>'main'</literal></simpara></entry>
<entry align="left" valign="top"><simpara>Generated source code will be added to the source set.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">inputFile</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>File</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>The input jj-File for the code generation.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">packageName</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>A special package name for the code generation. The output directory will be extended with this configuration.</simpara></entry>
</row>
<row>
<entry align="right" valign="top" namest="col_1" nameend="col_4"><simpara>The following variables are integer variables.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">lookahead</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>int</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>LOOKAHEAD: The number of tokens to look ahead before making a decision at a choice point during parsing. The default value is 1.<?asciidoc-br?>
The smaller this number, the faster the parser. This number may be overridden for specific productions within the grammar as described later.<?asciidoc-br?>
See the description of the lookahead algorithm for complete details on how lookahead works.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">choiceAmbiguityCheck</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>int</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>CHOICE_AMBIGUITY_CHECK: This is an integer option whose default value is 2.<?asciidoc-br?>
This is the number of tokens considered in checking choices of the form "A | B | &#8230;&#8203;" for ambiguity.<?asciidoc-br?>
For example, if there is a common two token prefix for both A and B, but no common three token prefix,<?asciidoc-br?>
(assume this option is set to 3) then JavaCC can tell you to use a lookahead of 3 for disambiguation purposes.<?asciidoc-br?>
And if A and B have a common three token prefix, then JavaCC only tell you that you need to have a lookahead of 3 or more.<?asciidoc-br?>
Increasing this can give you more comprehensive ambiguity information at the cost of more processing time.<?asciidoc-br?>
For large grammars such as the Java grammar, increasing this number any further causes the checking to take too much time.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">otherAmbiguityCheck</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>int</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>OTHER_AMBIGUITY_CHECK: This is an integer option whose default value is 1.<?asciidoc-br?>
This is the number of tokens considered in checking all other kinds of choices (i.e., of the forms "(A)*", "(A)+", and "(A)?")<?asciidoc-br?>
for ambiguity. This takes more time to do than the choice checking, and hence the default value is set to 1 rather than 2.</simpara></entry>
</row>
<row>
<entry align="right" valign="top" namest="col_1" nameend="col_4"><simpara>The following variables will be interpreted as boolean.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">staticParam</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>STATIC: This is a boolean option whose default value is true.<?asciidoc-br?>
If true, all methods and class variables are specified as static in the generated parser and token manager.<?asciidoc-br?>
This allows only one parser object to be present, but it improves the performance of the parser.<?asciidoc-br?>
To perform multiple parses during one run of your Java program, you will have to call the ReInit()<?asciidoc-br?>
method to reinitialize your parser if it is static. If the parser is non-static, you may use the "new" operator<?asciidoc-br?>
to construct as many parsers as you wish. These can all be used simultaneously from different threads.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">supportClassVisibilityPublic</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>SUPPORT_CLASS_VISIBILITY_PUBLIC: This is a boolean option whose default value is true.<?asciidoc-br?>
The default action is to generate support classes (such as Token.java, ParseException.java etc) with Public visibility.<?asciidoc-br?>
If set to false, the classes will be generated with package-private visibility.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">debugParser</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>DEBUG_PARSER: This is a boolean option whose default value is false.<?asciidoc-br?>
This option is used to obtain debugging information from the generated parser. Setting this option to true causes<?asciidoc-br?>
the parser to generate a trace of its actions. Tracing may be disabled by calling the method disable_tracing()<?asciidoc-br?>
in the generated parser class. Tracing may be subsequently enabled by calling the method enable_tracing() in the generated parser class.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">debugLookahead</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>DEBUG_LOOKAHEAD: This is a boolean option whose default value is false.<?asciidoc-br?>
Setting this option to true causes the parser to generate all the tracing information it does when the option<?asciidoc-br?>
DEBUG_PARSER is true, and in addition, also causes it to generated a trace of actions performed during lookahead operation.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">debugTokenManager</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>DEBUG_TOKEN_MANAGER: This is a boolean option whose default value is false.<?asciidoc-br?>
This option is used to obtain debugging information from the generated token manager. Setting this option to true causes<?asciidoc-br?>
the token manager to generate a trace of its actions. This trace is rather large and should only be used when you have a<?asciidoc-br?>
lexical error that has been reported to you and you cannot understand why. Typically, in this situation, you can determine<?asciidoc-br?>
the problem by looking at the last few lines of this trace.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">errorReporting</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>ERROR_REPORTING: This is a boolean option whose default value is true.<?asciidoc-br?>
Setting it to false causes errors due to parse errors to be reported in somewhat less detail. The only reason to set<?asciidoc-br?>
this option to false is to improve performance.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">javaUnicodeEscape</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>JAVA_UNICODE_ESCAPE: This is a boolean option whose default value is false.<?asciidoc-br?>
When set to true, the generated parser uses an input stream object that processes Java Unicode escapes (\u&#8230;&#8203;) before<?asciidoc-br?>
sending characters to the token manager. By default, Java Unicode escapes are not processed. This option is ignored if<?asciidoc-br?>
either of options USER_TOKEN_MANAGER, USER_CHAR_STREAM is set to true.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">unicodeInput</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>UNICODE_INPUT: This is a boolean option whose default value is false.<?asciidoc-br?>
When set to true, the generated parser uses uses an input stream object that reads Unicode files. By default,<?asciidoc-br?>
ASCII files are assumed. This option is ignored if either of options USER_TOKEN_MANAGER, USER_CHAR_STREAM is set to true.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">ignoreCase</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>IGNORE_CASE: This is a boolean option whose default value is false.<?asciidoc-br?>
Setting this option to true causes the generated token manager to ignore case in the token specifications and the input files.<?asciidoc-br?>
This is useful for writing grammars for languages such as HTML. It is also possible to localize the effect of IGNORE_CASE<?asciidoc-br?>
by using an alternate mechanism described later.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">commonTokenAction</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>COMMON_TOKEN_ACTION: This is a boolean option whose default value is false.<?asciidoc-br?>
When set to true, every call to the token manager&#8217;s method "getNextToken" (see the description of the Java Compiler Compiler API)<?asciidoc-br?>
will cause a call to a used defined method "CommonTokenAction" after the token has been scanned in by the token manager.<?asciidoc-br?>
The user must define this method within the TOKEN_MGR_DECLS section. The signature of this method is: void CommonTokenAction(Token t)</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">userTokenManager</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>USER_TOKEN_MANAGER: This is a boolean option whose default value is false.<?asciidoc-br?>
The default action is to generate a token manager that works on the specified grammar tokens. If this option is set<?asciidoc-br?>
to true, then the parser is generated to accept tokens from any token manager of type "TokenManager" - this interface<?asciidoc-br?>
is generated into the generated parser directory.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">userCharStream</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>USER_CHAR_STREAM: This is a boolean option whose default value is false.<?asciidoc-br?>
The default action is to generate a character stream reader as specified by the options JAVA_UNICODE_ESCAPE and UNICODE_INPUT.<?asciidoc-br?>
The generated token manager receives characters from this stream reader. If this option is set to true, then the token manager<?asciidoc-br?>
is generated to read characters from any character stream reader of type "CharStream.java". This file is generated into the<?asciidoc-br?>
generated parser directory. This option is ignored if USER_TOKEN_MANAGER is set to true.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">buildParser</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>BUILD_PARSER: This is a boolean option whose default value is true.<?asciidoc-br?>
The default action is to generate the parser file ("MyParser.java" in the above example). When set to false, the parser<?asciidoc-br?>
file is not generated. Typically, this option is set to false when you wish to generate only the token manager and use<?asciidoc-br?>
it without the associated parser.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">buildTokenManager</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>BUILD_TOKEN_MANAGER: This is a boolean option whose default value is true.<?asciidoc-br?>
The default action is to generate the token manager file ("MyParserTokenManager.java" in the above example).<?asciidoc-br?>
When set to false the token manager file is not generated. The only reason to set this option to false is to save<?asciidoc-br?>
some time during parser generation when you fix problems in the parser part of the grammar file and leave the lexical<?asciidoc-br?>
specifications untouched.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">tokenManagerUsesParser</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>TOKEN_MANAGER_USES_PARSER: This is a boolean option whose default value is false.<?asciidoc-br?>
When set to true, the generated token manager will include a field called parser that references the instantiating parser<?asciidoc-br?>
instance (of type MyParser in the above example). The main reason for having a parser in a token manager is using some of<?asciidoc-br?>
its logic in lexical actions. This option has no effect if the STATIC option is set to true.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">sanityCheck</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>SANITY_CHECK: This is a boolean option whose default value is true.<?asciidoc-br?>
JavaCC performs many syntactic and semantic checks on the grammar file during parser generation. Some checks such as<?asciidoc-br?>
detection of left recursion, detection of ambiguity, and bad usage of empty expansions may be suppressed for faster<?asciidoc-br?>
parser generation by setting this option to false. Note that the presence of these errors (even if they are not detected<?asciidoc-br?>
and reported by setting this option to false) can cause unexpected behavior from the generated parser.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">forceLaCheck</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>FORCE_LA_CHECK: This is a boolean option whose default value is false.<?asciidoc-br?>
This option setting controls lookahead ambiguity checking performed by JavaCC. By default (when this option is false),<?asciidoc-br?>
lookahead ambiguity checking is performed for all choice points where the default lookahead of 1 is used. Lookahead<?asciidoc-br?>
ambiguity checking is not performed at choice points where there is an explicit lookahead specification, or if the option<?asciidoc-br?>
LOOKAHEAD is set to something other than 1. Setting this option to true performs lookahead ambiguity checking at all choice<?asciidoc-br?>
points regardless of the lookahead specifications in the grammar file.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">cacheTokens</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>CACHE_TOKENS: This is a boolean option whose default value is false.<?asciidoc-br?>
Setting this option to true causes the generated parser to lookahead for extra tokens ahead of time. This facilitates<?asciidoc-br?>
some performance improvements. However, in this case (when the option is true), interactive applications may not work<?asciidoc-br?>
since the parser needs to work synchronously with the availability of tokens from the input stream. In such cases, it&#8217;s<?asciidoc-br?>
best to leave this option at its default value.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">keepLineColumn</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>KEEP_LINE_COLUMN:  This is a boolean option whose default value is true.<?asciidoc-br?>
If you set this option to false, the generated CharStream will not have any line/column tracking code. It will be your<?asciidoc-br?>
responsibility  to do it some other way. This is needed for systems which don&#8217;t care about giving error messages etc.</simpara></entry>
</row>
<row>
<entry align="right" valign="top" namest="col_1" nameend="col_4"><simpara>The following variables will be interpreted as string.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">tokenExtends</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>TOKEN_EXTENDS: This is a string option whose default value is "", meaning that the generated Token class will extend java.lang.Object.<?asciidoc-br?>
This option may be set to the name of a class that will be used as the base class for the generated Token class.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">tokenFactory</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>TOKEN_FACTORY: This is a string option whose default value is "", meaning that Tokens will be created by calling Token.newToken().<?asciidoc-br?>
If set the option names a Token factory class containing a public static Token newToken(int ofKind, String image) method.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">jdkVersion</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>JDK_VERSION: This is a string option whose default value is "1.4"</simpara></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<informaltable frame="all" rowsep="1" colsep="1">
<?dbhtml table-width="90%, options="?>
<?dbfo table-width="90%, options="?>
<?dblatex table-width="90%, options="?>
<tgroup cols="3">
<colspec colname="col_1" colwidth="65.025*"/>
<colspec colname="col_2" colwidth="65.025*"/>
<colspec colname="col_3" colwidth="252.45*"/>
<tbody>
<row>
<entry align="left" valign="top"><simpara>Method</simpara></entry>
<entry align="left" valign="top"><simpara>Parameter</simpara></entry>
<entry align="left" valign="top"><simpara>Description</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">addArg</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"><simpara>Add an additional command line argument passed to JavaCC</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">addArgs</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>List&lt;String&gt;</literal></simpara></entry>
<entry align="left" valign="top"><simpara>Add  additional command line arguments passed to JavaCC</simpara></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<informaltable frame="all" rowsep="1" colsep="1">
<?dbhtml table-width="90%, options="?>
<?dbfo table-width="90%, options="?>
<?dblatex table-width="90%, options="?>
<tgroup cols="3">
<colspec colname="col_1" colwidth="65.025*"/>
<colspec colname="col_2" colwidth="65.025*"/>
<colspec colname="col_3" colwidth="252.45*"/>
<thead>
<row>
<entry align="left" valign="top">Closure</entry>
<entry align="left" valign="top">Parameter</entry>
<entry align="left" valign="top">Description</entry>
</row>
</thead>
<tbody>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">jjtree</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><link linkend="jjtree">JJTree</link></simpara></entry>
<entry align="left" valign="top"><simpara>Add an additional configuration for JJTree</simpara></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section xml:id="asciidocobject-jjtree-jjtree">
<title><anchor xml:id="jjtree" xreflabel="[jjtree]"/>Object 'jjtree' (JJTree)</title>
<informaltable frame="all" rowsep="1" colsep="1">
<?dbhtml table-width="90%, options="?>
<?dbfo table-width="90%, options="?>
<?dblatex table-width="90%, options="?>
<tgroup cols="4">
<colspec colname="col_1" colwidth="65.025*"/>
<colspec colname="col_2" colwidth="65.025*"/>
<colspec colname="col_3" colwidth="57.375*"/>
<colspec colname="col_4" colwidth="195.075*"/>
<tbody>
<row>
<entry align="left" valign="top"><simpara>Property</simpara></entry>
<entry align="left" valign="top"><simpara>Type</simpara></entry>
<entry align="left" valign="top"><simpara>Default value</simpara></entry>
<entry align="left" valign="top"><simpara>Description</simpara></entry>
</row>
<row>
<entry align="right" valign="top" namest="col_1" nameend="col_4"><simpara>The following variables will be interpreted as boolean.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">multi</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>MULTI (default: false) Generate a multi mode parse tree. The default for this is false, generating a simple mode parse tree.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">nodeDefaultVoid</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>NODE_DEFAULT_VOID (default: false) Instead of making each non-decorated production an indefinite node, make it void instead.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">nodeScopeHook</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>NODE_SCOPE_HOOK (default: false) Insert calls to user-defined parser methods on entry and exit of every node scope. See Node Scope Hooks.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">nodeUsesParser</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>NODE_USES_PARSER (default: false)JJTree will use an alternate form of the node construction routines where it passes the parser object in.<?asciidoc-br?>
For example, <?asciidoc-br?>
public static Node MyNode.jjtCreate(MyParser p, int id);<?asciidoc-br?>
MyNode(MyParser p, int id);</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">buildNodeFiles</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>BUILD_NODE_FILES (default: true) Generate sample implementations for SimpleNode and any other nodes used in the grammar.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">staticParam</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>STATIC (default: true) Generate code for a static parser. The default for this is true. This must be used consistently with the equivalent JavaCC options.<?asciidoc-br?>
The value of this option is emitted in the JavaCC source.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">trackTokens</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>TRACK_TOKENS (default: false) Insert jjtGetFirstToken(), jjtSetFirstToken(), getLastToken(),  and jjtSetLastToken() methods in SimpleNode.<?asciidoc-br?>
The FirstToken is automatically set up on entry to a node scope; the LastToken is automatically set up on exit from a node scope.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">visitor</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>VISITOR (default: false) Insert a jjtAccept() method in the node classes, and generate a visitor implementation with an entry for every node type used in the grammar.</simpara></entry>
</row>
<row>
<entry align="right" valign="top" namest="col_1" nameend="col_4"><simpara>The following variables will be interpreted as string.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">nodeClass</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>NODE_CLASS (default: "") If set defines the name of a user-supplied class that will extend SimpleNode. Any tree nodes created will then be subclasses of NODE_CLASS.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">nodePrefix</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"><simpara>'AST'</simpara></entry>
<entry align="left" valign="top"><simpara>NODE_PREFIX (default: "AST") The prefix used to construct node class names from node identifiers in multi mode. The default for this is AST.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">nodePackage</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>NODE_PACKAGE (default: "") The package to generate the node classes into. The default for this is the parser package.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">nodeExtends</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>NODE_EXTENDS (default: "") Deprecated<?asciidoc-br?>
The superclass for the SimpleNode class. By providing a custom superclass you<?asciidoc-br?>
may be able to avoid the need to edit the generated SimpleNode.java.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">nodeFactory</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>NODE_FACTORY (default: "") Specify a class containing a factory method with following signature to construct nodes: public static Node jjtCreate(int id)<?asciidoc-br?>
For backwards compatibility, the value false may also be specified, meaning that SimpleNode will be used as the factory class.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">visitorDataType</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>VISITOR_DATA_TYPE (default: "Object") If this option is set, it is used in the signature of the generated jjtAccept() methods and the visit() methods as the type of the data argument.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">visitorReturnType</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>VISITOR_RETURN_TYPE (default: "Object") If this option is set, it is used in the signature of the generated jjtAccept() methods and the visit() methods as the return type of the method.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">visitorException</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>VISITOR_EXCEPTION (default: "") If this option is set, it is used in the signature of the generated jjtAccept() methods and the visit() methods.</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">args</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>List&lt;String&gt;</literal></simpara></entry>
<entry align="left" valign="top"></entry>
<entry align="left" valign="top"><simpara>Additional command line arguments passed to jjTree</simpara></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<informaltable frame="all" rowsep="1" colsep="1">
<?dbhtml table-width="90%, options="?>
<?dbfo table-width="90%, options="?>
<?dblatex table-width="90%, options="?>
<tgroup cols="3">
<colspec colname="col_1" colwidth="65.025*"/>
<colspec colname="col_2" colwidth="65.025*"/>
<colspec colname="col_3" colwidth="252.45*"/>
<tbody>
<row>
<entry align="left" valign="top"><simpara>Method</simpara></entry>
<entry align="left" valign="top"><simpara>Parameter</simpara></entry>
<entry align="left" valign="top"><simpara>Description</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">addArg</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>String</literal></simpara></entry>
<entry align="left" valign="top"><simpara>Add an additional command line argument passed to JavaCC</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">addArgs</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><literal>List&lt;String&gt;</literal></simpara></entry>
<entry align="left" valign="top"><simpara>Add  additional command line arguments passed to JavaCC</simpara></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</section>
<section xml:id="asciidocadd-additional-java-vm-settings-for-process-runner">
<title>Add additional Java VM settings for process runner</title>
<programlisting language="groovy" linenumbering="unnumbered">tasks.withType(com.intershop.gradle.javacc.task.JavaCCTask) {
    forkOptions { JavaForkOptions options ->
        options.setMaxHeapSize('64m')
        options.jvmArgs += ['-Dhttp.proxyHost=10.0.0.100', '-Dhttp.proxyPort=8800']
    }
}</programlisting>
</section>
</section>
<section xml:id="asciidoclicense">
<title>License</title>
<simpara>Copyright 2014-2019 Intershop Communications.</simpara>
<simpara>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at</simpara>
<simpara><link xl:href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</link></simpara>
<simpara>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</simpara>
</section>
</article>