Class JavaCC
- java.lang.Object
- 
- org.apache.tools.ant.ProjectComponent
- 
- org.apache.tools.ant.Task
- 
- org.apache.tools.ant.taskdefs.optional.javacc.JavaCC
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable
 
 public class JavaCC extends Task JavaCC compiler compiler task.
- 
- 
Field SummaryFields Modifier and Type Field Description protected static java.lang.String[]ARCHIVE_LOCATIONSprotected static int[]ARCHIVE_LOCATIONS_VS_MAJOR_VERSIONprotected static java.lang.StringCOM_JAVACC_CLASSprotected static java.lang.StringCOM_JJDOC_CLASSprotected static java.lang.StringCOM_JJTREE_CLASSprotected static java.lang.StringCOM_PACKAGEprotected static java.lang.StringORG_JAVACC_CLASSprotected static java.lang.StringORG_JJDOC_CLASSprotected static java.lang.StringORG_JJTREE_CLASSprotected static java.lang.StringORG_PACKAGE_3_0protected static java.lang.StringORG_PACKAGE_3_1protected static intTASKDEF_TYPE_JAVACCprotected static intTASKDEF_TYPE_JJDOCprotected static intTASKDEF_TYPE_JJTREE- 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description JavaCC()Constructor
 - 
Method SummaryModifier and Type Method Description voidexecute()Run the task.protected static java.io.FilegetArchiveFile(java.io.File home)Helper method to retrieve the path used to store the JavaCC.zip or javacc.jar which is different from versions.protected static java.lang.StringgetMainClass(java.io.File home, int type)Helper method to retrieve main class which is different from versions.protected static java.lang.StringgetMainClass(Path path, int type)Helper method to retrieve main class which is different from versions.protected static intgetMajorVersionNumber(java.io.File home)Helper method to determine the major version number of JavaCC.voidsetBuildparser(boolean buildParser)Sets the BUILD_PARSER grammar option.voidsetBuildtokenmanager(boolean buildTokenManager)Sets the BUILD_TOKEN_MANAGER grammar option.voidsetCachetokens(boolean cacheTokens)Sets the CACHE_TOKENS grammar option.voidsetChoiceambiguitycheck(int choiceAmbiguityCheck)Sets the CHOICE_AMBIGUITY_CHECK grammar option.voidsetCommontokenaction(boolean commonTokenAction)Sets the COMMON_TOKEN_ACTION grammar option.voidsetDebuglookahead(boolean debugLookahead)Sets the DEBUG_LOOKAHEAD grammar option.voidsetDebugparser(boolean debugParser)Sets the DEBUG_PARSER grammar option.voidsetDebugtokenmanager(boolean debugTokenManager)Sets the DEBUG_TOKEN_MANAGER grammar option.voidsetErrorreporting(boolean errorReporting)Sets the ERROR_REPORTING grammar option.voidsetForcelacheck(boolean forceLACheck)Sets the FORCE_LA_CHECK grammar option.voidsetIgnorecase(boolean ignoreCase)Sets the IGNORE_CASE grammar option.voidsetJavacchome(java.io.File javaccHome)The directory containing the JavaCC distribution.voidsetJavaunicodeescape(boolean javaUnicodeEscape)Sets the JAVA_UNICODE_ESCAPE grammar option.voidsetJDKversion(java.lang.String jdkVersion)Sets the JDK_VERSION option.voidsetKeeplinecolumn(boolean keepLineColumn)Sets the KEEP_LINE_COLUMN grammar option.voidsetLookahead(int lookahead)Sets the LOOKAHEAD grammar option.voidsetMaxmemory(java.lang.String max)Corresponds -Xmx.voidsetOptimizetokenmanager(boolean optimizeTokenManager)Sets the OPTIMIZE_TOKEN_MANAGER grammar option.voidsetOtherambiguityCheck(int otherAmbiguityCheck)Sets the OTHER_AMBIGUITY_CHECK grammar option.voidsetOutputdirectory(java.io.File outputDirectory)The directory to write the generated files to.voidsetSanitycheck(boolean sanityCheck)Sets the SANITY_CHECK grammar option.voidsetStatic(boolean staticParser)Sets the STATIC grammar option.voidsetTarget(java.io.File targetFile)The grammar file to process.voidsetUnicodeinput(boolean unicodeInput)Sets the UNICODE_INPUT grammar option.voidsetUsercharstream(boolean userCharStream)Sets the USER_CHAR_STREAM grammar option.voidsetUsertokenmanager(boolean userTokenManager)Sets the USER_TOKEN_MANAGER grammar option.- 
Methods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 - 
Methods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
- 
 
- 
- 
- 
Field Detail- 
TASKDEF_TYPE_JAVACCprotected static final int TASKDEF_TYPE_JAVACC - See Also:
- Constant Field Values
 
 - 
TASKDEF_TYPE_JJTREEprotected static final int TASKDEF_TYPE_JJTREE - See Also:
- Constant Field Values
 
 - 
TASKDEF_TYPE_JJDOCprotected static final int TASKDEF_TYPE_JJDOC - See Also:
- Constant Field Values
 
 - 
ARCHIVE_LOCATIONSprotected static final java.lang.String[] ARCHIVE_LOCATIONS 
 - 
ARCHIVE_LOCATIONS_VS_MAJOR_VERSIONprotected static final int[] ARCHIVE_LOCATIONS_VS_MAJOR_VERSION 
 - 
COM_PACKAGEprotected static final java.lang.String COM_PACKAGE - See Also:
- Constant Field Values
 
 - 
COM_JAVACC_CLASSprotected static final java.lang.String COM_JAVACC_CLASS - See Also:
- Constant Field Values
 
 - 
COM_JJTREE_CLASSprotected static final java.lang.String COM_JJTREE_CLASS - See Also:
- Constant Field Values
 
 - 
COM_JJDOC_CLASSprotected static final java.lang.String COM_JJDOC_CLASS - See Also:
- Constant Field Values
 
 - 
ORG_PACKAGE_3_0protected static final java.lang.String ORG_PACKAGE_3_0 - See Also:
- Constant Field Values
 
 - 
ORG_PACKAGE_3_1protected static final java.lang.String ORG_PACKAGE_3_1 - See Also:
- Constant Field Values
 
 - 
ORG_JAVACC_CLASSprotected static final java.lang.String ORG_JAVACC_CLASS - See Also:
- Constant Field Values
 
 - 
ORG_JJTREE_CLASSprotected static final java.lang.String ORG_JJTREE_CLASS - See Also:
- Constant Field Values
 
 - 
ORG_JJDOC_CLASSprotected static final java.lang.String ORG_JJDOC_CLASS - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
setLookaheadpublic void setLookahead(int lookahead) Sets the LOOKAHEAD grammar option.- Parameters:
- lookahead- an- intvalue.
 
 - 
setChoiceambiguitycheckpublic void setChoiceambiguitycheck(int choiceAmbiguityCheck) Sets the CHOICE_AMBIGUITY_CHECK grammar option.- Parameters:
- choiceAmbiguityCheck- an- intvalue.
 
 - 
setOtherambiguityCheckpublic void setOtherambiguityCheck(int otherAmbiguityCheck) Sets the OTHER_AMBIGUITY_CHECK grammar option.- Parameters:
- otherAmbiguityCheck- an- intvalue.
 
 - 
setStaticpublic void setStatic(boolean staticParser) Sets the STATIC grammar option.- Parameters:
- staticParser- a- booleanvalue.
 
 - 
setDebugparserpublic void setDebugparser(boolean debugParser) Sets the DEBUG_PARSER grammar option.- Parameters:
- debugParser- a- booleanvalue.
 
 - 
setDebuglookaheadpublic void setDebuglookahead(boolean debugLookahead) Sets the DEBUG_LOOKAHEAD grammar option.- Parameters:
- debugLookahead- a- booleanvalue.
 
 - 
setDebugtokenmanagerpublic void setDebugtokenmanager(boolean debugTokenManager) Sets the DEBUG_TOKEN_MANAGER grammar option.- Parameters:
- debugTokenManager- a- booleanvalue.
 
 - 
setOptimizetokenmanagerpublic void setOptimizetokenmanager(boolean optimizeTokenManager) Sets the OPTIMIZE_TOKEN_MANAGER grammar option.- Parameters:
- optimizeTokenManager- a- booleanvalue.
 
 - 
setErrorreportingpublic void setErrorreporting(boolean errorReporting) Sets the ERROR_REPORTING grammar option.- Parameters:
- errorReporting- a- booleanvalue.
 
 - 
setJavaunicodeescapepublic void setJavaunicodeescape(boolean javaUnicodeEscape) Sets the JAVA_UNICODE_ESCAPE grammar option.- Parameters:
- javaUnicodeEscape- a- booleanvalue.
 
 - 
setUnicodeinputpublic void setUnicodeinput(boolean unicodeInput) Sets the UNICODE_INPUT grammar option.- Parameters:
- unicodeInput- a- booleanvalue.
 
 - 
setIgnorecasepublic void setIgnorecase(boolean ignoreCase) Sets the IGNORE_CASE grammar option.- Parameters:
- ignoreCase- a- booleanvalue.
 
 - 
setCommontokenactionpublic void setCommontokenaction(boolean commonTokenAction) Sets the COMMON_TOKEN_ACTION grammar option.- Parameters:
- commonTokenAction- a- booleanvalue.
 
 - 
setUsertokenmanagerpublic void setUsertokenmanager(boolean userTokenManager) Sets the USER_TOKEN_MANAGER grammar option.- Parameters:
- userTokenManager- a- booleanvalue.
 
 - 
setUsercharstreampublic void setUsercharstream(boolean userCharStream) Sets the USER_CHAR_STREAM grammar option.- Parameters:
- userCharStream- a- booleanvalue.
 
 - 
setBuildparserpublic void setBuildparser(boolean buildParser) Sets the BUILD_PARSER grammar option.- Parameters:
- buildParser- a- booleanvalue.
 
 - 
setBuildtokenmanagerpublic void setBuildtokenmanager(boolean buildTokenManager) Sets the BUILD_TOKEN_MANAGER grammar option.- Parameters:
- buildTokenManager- a- booleanvalue.
 
 - 
setSanitycheckpublic void setSanitycheck(boolean sanityCheck) Sets the SANITY_CHECK grammar option.- Parameters:
- sanityCheck- a- booleanvalue.
 
 - 
setForcelacheckpublic void setForcelacheck(boolean forceLACheck) Sets the FORCE_LA_CHECK grammar option.- Parameters:
- forceLACheck- a- booleanvalue.
 
 - 
setCachetokenspublic void setCachetokens(boolean cacheTokens) Sets the CACHE_TOKENS grammar option.- Parameters:
- cacheTokens- a- booleanvalue.
 
 - 
setKeeplinecolumnpublic void setKeeplinecolumn(boolean keepLineColumn) Sets the KEEP_LINE_COLUMN grammar option.- Parameters:
- keepLineColumn- a- booleanvalue.
 
 - 
setJDKversionpublic void setJDKversion(java.lang.String jdkVersion) Sets the JDK_VERSION option.- Parameters:
- jdkVersion- the version to use.
- Since:
- Ant1.7
 
 - 
setOutputdirectorypublic void setOutputdirectory(java.io.File outputDirectory) The directory to write the generated files to. If not set, the files are written to the directory containing the grammar file.- Parameters:
- outputDirectory- the output directory.
 
 - 
setTargetpublic void setTarget(java.io.File targetFile) The grammar file to process.- Parameters:
- targetFile- the grammar file.
 
 - 
setJavacchomepublic void setJavacchome(java.io.File javaccHome) The directory containing the JavaCC distribution.- Parameters:
- javaccHome- the directory.
 
 - 
setMaxmemorypublic void setMaxmemory(java.lang.String max) Corresponds -Xmx.- Parameters:
- max- max memory parameter.
- Since:
- Ant 1.8.3
 
 - 
executepublic void execute() throws BuildExceptionRun the task.- Overrides:
- executein class- Task
- Throws:
- BuildException- on error.
 
 - 
getArchiveFileprotected static java.io.File getArchiveFile(java.io.File home) throws BuildExceptionHelper method to retrieve the path used to store the JavaCC.zip or javacc.jar which is different from versions.- Parameters:
- home- the javacc home path directory.
- Returns:
- the file object pointing to the JavaCC archive.
- Throws:
- BuildException- thrown if the home directory is invalid or if the archive could not be found despite attempts to do so.
 
 - 
getMainClassprotected static java.lang.String getMainClass(java.io.File home, int type) throws BuildExceptionHelper method to retrieve main class which is different from versions.- Parameters:
- home- the javacc home path directory.
- type- the taskdef.
- Returns:
- the main class for the taskdef.
- Throws:
- BuildException- thrown if the home directory is invalid or if the archive could not be found despite attempts to do so.
 
 - 
getMainClassprotected static java.lang.String getMainClass(Path path, int type) throws BuildException Helper method to retrieve main class which is different from versions.- Parameters:
- path- classpath to search in.
- type- the taskdef.
- Returns:
- the main class for the taskdef.
- Throws:
- BuildException- thrown if the home directory is invalid or if the archive could not be found despite attempts to do so.
- Since:
- Ant 1.7
 
 - 
getMajorVersionNumberprotected static int getMajorVersionNumber(java.io.File home) throws BuildExceptionHelper method to determine the major version number of JavaCC.- Parameters:
- home- the javacc home path directory.
- Returns:
- a the major version number
- Throws:
- BuildException- thrown if the home directory is invalid or if the archive could not be found despite attempts to do so.
 
 
- 
 
-