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:
Cloneable
JavaCC compiler compiler task.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String[]protected static final int[]protected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final intprotected static final intprotected static final intFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Run the task.protected static FilegetArchiveFile(File home) Helper method to retrieve the path used to store the JavaCC.zip or javacc.jar which is different from versions.protected static StringgetMainClass(File home, int type) Helper method to retrieve main class which is different from versions.protected static StringgetMainClass(Path path, int type) Helper method to retrieve main class which is different from versions.protected static intgetMajorVersionNumber(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(File javaccHome) The directory containing the JavaCC distribution.voidsetJavaunicodeescape(boolean javaUnicodeEscape) Sets the JAVA_UNICODE_ESCAPE grammar option.voidsetJDKversion(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(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(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.voidThe 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.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Field Details
-
TASKDEF_TYPE_JAVACC
protected static final int TASKDEF_TYPE_JAVACC- See Also:
-
TASKDEF_TYPE_JJTREE
protected static final int TASKDEF_TYPE_JJTREE- See Also:
-
TASKDEF_TYPE_JJDOC
protected static final int TASKDEF_TYPE_JJDOC- See Also:
-
ARCHIVE_LOCATIONS
-
ARCHIVE_LOCATIONS_VS_MAJOR_VERSION
protected static final int[] ARCHIVE_LOCATIONS_VS_MAJOR_VERSION -
COM_PACKAGE
- See Also:
-
COM_JAVACC_CLASS
- See Also:
-
COM_JJTREE_CLASS
- See Also:
-
COM_JJDOC_CLASS
- See Also:
-
ORG_PACKAGE_3_0
- See Also:
-
ORG_PACKAGE_3_1
- See Also:
-
ORG_JAVACC_CLASS
- See Also:
-
ORG_JJTREE_CLASS
- See Also:
-
ORG_JJDOC_CLASS
- See Also:
-
-
Constructor Details
-
JavaCC
public JavaCC()Constructor
-
-
Method Details
-
setLookahead
public void setLookahead(int lookahead) Sets the LOOKAHEAD grammar option.- Parameters:
lookahead- anintvalue.
-
setChoiceambiguitycheck
public void setChoiceambiguitycheck(int choiceAmbiguityCheck) Sets the CHOICE_AMBIGUITY_CHECK grammar option.- Parameters:
choiceAmbiguityCheck- anintvalue.
-
setOtherambiguityCheck
public void setOtherambiguityCheck(int otherAmbiguityCheck) Sets the OTHER_AMBIGUITY_CHECK grammar option.- Parameters:
otherAmbiguityCheck- anintvalue.
-
setStatic
public void setStatic(boolean staticParser) Sets the STATIC grammar option.- Parameters:
staticParser- abooleanvalue.
-
setDebugparser
public void setDebugparser(boolean debugParser) Sets the DEBUG_PARSER grammar option.- Parameters:
debugParser- abooleanvalue.
-
setDebuglookahead
public void setDebuglookahead(boolean debugLookahead) Sets the DEBUG_LOOKAHEAD grammar option.- Parameters:
debugLookahead- abooleanvalue.
-
setDebugtokenmanager
public void setDebugtokenmanager(boolean debugTokenManager) Sets the DEBUG_TOKEN_MANAGER grammar option.- Parameters:
debugTokenManager- abooleanvalue.
-
setOptimizetokenmanager
public void setOptimizetokenmanager(boolean optimizeTokenManager) Sets the OPTIMIZE_TOKEN_MANAGER grammar option.- Parameters:
optimizeTokenManager- abooleanvalue.
-
setErrorreporting
public void setErrorreporting(boolean errorReporting) Sets the ERROR_REPORTING grammar option.- Parameters:
errorReporting- abooleanvalue.
-
setJavaunicodeescape
public void setJavaunicodeescape(boolean javaUnicodeEscape) Sets the JAVA_UNICODE_ESCAPE grammar option.- Parameters:
javaUnicodeEscape- abooleanvalue.
-
setUnicodeinput
public void setUnicodeinput(boolean unicodeInput) Sets the UNICODE_INPUT grammar option.- Parameters:
unicodeInput- abooleanvalue.
-
setIgnorecase
public void setIgnorecase(boolean ignoreCase) Sets the IGNORE_CASE grammar option.- Parameters:
ignoreCase- abooleanvalue.
-
setCommontokenaction
public void setCommontokenaction(boolean commonTokenAction) Sets the COMMON_TOKEN_ACTION grammar option.- Parameters:
commonTokenAction- abooleanvalue.
-
setUsertokenmanager
public void setUsertokenmanager(boolean userTokenManager) Sets the USER_TOKEN_MANAGER grammar option.- Parameters:
userTokenManager- abooleanvalue.
-
setUsercharstream
public void setUsercharstream(boolean userCharStream) Sets the USER_CHAR_STREAM grammar option.- Parameters:
userCharStream- abooleanvalue.
-
setBuildparser
public void setBuildparser(boolean buildParser) Sets the BUILD_PARSER grammar option.- Parameters:
buildParser- abooleanvalue.
-
setBuildtokenmanager
public void setBuildtokenmanager(boolean buildTokenManager) Sets the BUILD_TOKEN_MANAGER grammar option.- Parameters:
buildTokenManager- abooleanvalue.
-
setSanitycheck
public void setSanitycheck(boolean sanityCheck) Sets the SANITY_CHECK grammar option.- Parameters:
sanityCheck- abooleanvalue.
-
setForcelacheck
public void setForcelacheck(boolean forceLACheck) Sets the FORCE_LA_CHECK grammar option.- Parameters:
forceLACheck- abooleanvalue.
-
setCachetokens
public void setCachetokens(boolean cacheTokens) Sets the CACHE_TOKENS grammar option.- Parameters:
cacheTokens- abooleanvalue.
-
setKeeplinecolumn
public void setKeeplinecolumn(boolean keepLineColumn) Sets the KEEP_LINE_COLUMN grammar option.- Parameters:
keepLineColumn- abooleanvalue.
-
setJDKversion
Sets the JDK_VERSION option.- Parameters:
jdkVersion- the version to use.- Since:
- Ant1.7
-
setOutputdirectory
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.
-
setTarget
The grammar file to process.- Parameters:
targetFile- the grammar file.
-
setJavacchome
The directory containing the JavaCC distribution.- Parameters:
javaccHome- the directory.
-
setMaxmemory
Corresponds -Xmx.- Parameters:
max- max memory parameter.- Since:
- Ant 1.8.3
-
execute
Run the task.- Overrides:
executein classTask- Throws:
BuildException- on error.
-
getArchiveFile
Helper 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.
-
getMainClass
Helper 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.
-
getMainClass
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
-
getMajorVersionNumber
Helper 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.
-