Class JavaCC
java.lang.Object
org.codehaus.mojo.javacc.ToolFacade
org.codehaus.mojo.javacc.JavaCC
Provides a facade for the mojos to invoke JavaCC.
- Version:
- $Id$
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BooleanThe option BUILD_PARSER.private BooleanThe option BUILD_TOKEN_MANAGER.private BooleanThe option CACHE_TOKENS.private IntegerThe option CHOICE_AMBIGUITY_CHECK.private BooleanThe option COMMON_TOKEN_ACTION.private BooleanThe option DEBUG_LOOK_AHEAD.private BooleanThe option DEBUG_PARSER.private BooleanThe option DEBUG_TOKEN_MANAGER.private BooleanThe option ERROR_REPORTING.private BooleanThe option FORCE_LA_CHECK.private StringThe option GRAMMAR_ENCODING.private BooleanThe option IGNORE_CASE.private FileThe input grammar.private BooleanThe option STATIC.private BooleanThe option JAVA_UNICODE_ESCAPE.private StringThe option JDK_VERSION.private BooleanThe option KEEP_LINE_COLUMN.private IntegerThe option LOOK_AHEAD.private IntegerThe option OTHER_AMBIGUITY_CHECK.private FileThe option OUTPUT_DIRECTORY.private BooleanThe option SANITY_CHECK.private BooleanThe option SUPPORT_CLASS_VISIBILITY_PUBLIC.private StringThe option TOKEN_EXTENDS.private StringThe option TOKEN_FACTORY.private BooleanThe option TOKEN_MANAGER_USES_PARSER.private BooleanThe option UNICODE_INPUT.private BooleanThe option USER_CHAR_STREAM.private BooleanThe option USER_TOKEN_MANAGER. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intexecute()Runs the tool using the previously set parameters.private String[]Assembles the command line arguments for the invocation of JavaCC according to the configuration.voidsetBuildParser(Boolean value) Sets the option BUILD_PARSER.voidsetBuildTokenManager(Boolean value) Sets the option BUILD_TOKEN_MANAGER.voidsetCacheTokens(Boolean value) Sets the option CACHE_TOKENS.voidsetChoiceAmbiguityCheck(Integer value) Sets the option CHOICE_AMBIGUITY_CHECK.voidsetCommonTokenAction(Boolean value) Sets the option COMMON_TOKEN_ACTION.voidsetDebugLookAhead(Boolean value) Sets the option DEBUG_LOOK_AHEAD.voidsetDebugParser(Boolean value) Sets the option DEBUG_PARSER.voidsetDebugTokenManager(Boolean value) Sets the option DEBUG_TOKEN_MANAGER.voidsetErrorReporting(Boolean value) Sets the option ERROR_REPORTING.voidsetForceLaCheck(Boolean value) Sets the option FORCE_LA_CHECK.voidsetGrammarEncoding(String value) Sets the option GRAMMAR_ENCODING.voidsetIgnoreCase(Boolean value) Sets the option IGNORE_CASE.voidsetInputFile(File value) Sets the absolute path to the grammar file to pass into JavaCC for compilation.voidsetJavaUnicodeEscape(Boolean value) Sets the option JAVA_UNICODE_ESCAPE.voidsetJdkVersion(String value) Sets the option JDK_VERSION.voidsetKeepLineColumn(Boolean value) Sets the option KEEP_LINE_COLUMN.voidsetLookAhead(Integer value) Sets the option LOOK_AHEAD.voidsetOtherAmbiguityCheck(Integer value) Sets the option OTHER_AMBIGUITY_CHECK.voidsetOutputDirectory(File value) Sets the absolute path to the output directory.voidsetSanityCheck(Boolean value) Sets the option SANITY_CHECK.voidSets the option STATIC.voidSets the option SUPPORT_CLASS_VISIBILITY_PUBLIC.voidsetTokenExtends(String value) Sets the option TOKEN_EXTENDS.voidsetTokenFactory(String value) Sets the option TOKEN_FACTORY.voidsetTokenManagerUsesParser(Boolean value) Sets the option TOKEN_MANAGER_USES_PARSER.voidsetUnicodeInput(Boolean value) Sets the option UNICODE_INPUT.voidsetUserCharStream(Boolean value) Sets the option USER_CHAR_STREAM.voidsetUserTokenManager(Boolean value) Sets the option USER_TOKEN_MANAGER.toString()Gets a string representation of the command line arguments.Methods inherited from class ToolFacade
getLog, getToolName, run, setLog
-
Field Details
-
inputFile
The input grammar. -
outputDirectory
The option OUTPUT_DIRECTORY. -
grammarEncoding
The option GRAMMAR_ENCODING. -
jdkVersion
The option JDK_VERSION. -
isStatic
The option STATIC. -
lookAhead
The option LOOK_AHEAD. -
choiceAmbiguityCheck
The option CHOICE_AMBIGUITY_CHECK. -
otherAmbiguityCheck
The option OTHER_AMBIGUITY_CHECK. -
debugParser
The option DEBUG_PARSER. -
debugLookAhead
The option DEBUG_LOOK_AHEAD. -
debugTokenManager
The option DEBUG_TOKEN_MANAGER. -
errorReporting
The option ERROR_REPORTING. -
javaUnicodeEscape
The option JAVA_UNICODE_ESCAPE. -
unicodeInput
The option UNICODE_INPUT. -
ignoreCase
The option IGNORE_CASE. -
commonTokenAction
The option COMMON_TOKEN_ACTION. -
userTokenManager
The option USER_TOKEN_MANAGER. -
userCharStream
The option USER_CHAR_STREAM. -
buildParser
The option BUILD_PARSER. -
buildTokenManager
The option BUILD_TOKEN_MANAGER. -
tokenManagerUsesParser
The option TOKEN_MANAGER_USES_PARSER. -
tokenExtends
The option TOKEN_EXTENDS. -
tokenFactory
The option TOKEN_FACTORY. -
sanityCheck
The option SANITY_CHECK. -
forceLaCheck
The option FORCE_LA_CHECK. -
cacheTokens
The option CACHE_TOKENS. -
keepLineColumn
The option KEEP_LINE_COLUMN. -
supportClassVisibilityPublic
The option SUPPORT_CLASS_VISIBILITY_PUBLIC.
-
-
Constructor Details
-
JavaCC
JavaCC()
-
-
Method Details
-
setInputFile
Sets the absolute path to the grammar file to pass into JavaCC for compilation.- Parameters:
value- The absolute path to the grammar file to pass into JavaCC for compilation.
-
setOutputDirectory
Sets the absolute path to the output directory.- Parameters:
value- The absolute path to the output directory for the generated parser file. If this directory does not exist yet, it is created. Note that this path should already include the desired package hierarchy because JavaCC will not append the required sub directories automatically.
-
setGrammarEncoding
Sets the option GRAMMAR_ENCODING.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setJdkVersion
Sets the option JDK_VERSION.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setStatic
Sets the option STATIC.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setLookAhead
Sets the option LOOK_AHEAD.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setChoiceAmbiguityCheck
Sets the option CHOICE_AMBIGUITY_CHECK.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setOtherAmbiguityCheck
Sets the option OTHER_AMBIGUITY_CHECK.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setDebugParser
Sets the option DEBUG_PARSER.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setDebugLookAhead
Sets the option DEBUG_LOOK_AHEAD.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setDebugTokenManager
Sets the option DEBUG_TOKEN_MANAGER.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setErrorReporting
Sets the option ERROR_REPORTING.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setJavaUnicodeEscape
Sets the option JAVA_UNICODE_ESCAPE.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setUnicodeInput
Sets the option UNICODE_INPUT.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setIgnoreCase
Sets the option IGNORE_CASE.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setCommonTokenAction
Sets the option COMMON_TOKEN_ACTION.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setUserTokenManager
Sets the option USER_TOKEN_MANAGER.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setUserCharStream
Sets the option USER_CHAR_STREAM.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setBuildParser
Sets the option BUILD_PARSER.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setBuildTokenManager
Sets the option BUILD_TOKEN_MANAGER.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setTokenManagerUsesParser
Sets the option TOKEN_MANAGER_USES_PARSER.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setTokenExtends
Sets the option TOKEN_EXTENDS.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setTokenFactory
Sets the option TOKEN_FACTORY.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setSanityCheck
Sets the option SANITY_CHECK.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setForceLaCheck
Sets the option FORCE_LA_CHECK.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setCacheTokens
Sets the option CACHE_TOKENS.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setKeepLineColumn
Sets the option KEEP_LINE_COLUMN.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
setSupportClassVisibilityPublic
Sets the option SUPPORT_CLASS_VISIBILITY_PUBLIC.- Parameters:
value- The option value, may benullto use the value provided in the grammar or the default.
-
execute
Runs the tool using the previously set parameters.- Specified by:
executein classToolFacade- Returns:
- The exit code of the tool, non-zero means failure.
- Throws:
Exception- If the tool could not be invoked.
-
generateArguments
Assembles the command line arguments for the invocation of JavaCC according to the configuration.
Note: To prevent conflicts with JavaCC options that might be set directly in the grammar file, only those parameters that have been explicitly set are passed on the command line.- Returns:
- A string array that represents the command line arguments to use for JavaCC.
-
toString
-