Package org.codehaus.mojo.javacc
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 Boolean
The option BUILD_PARSER.private Boolean
The option BUILD_TOKEN_MANAGER.private Boolean
The option CACHE_TOKENS.private Integer
The option CHOICE_AMBIGUITY_CHECK.private Boolean
The option COMMON_TOKEN_ACTION.private Boolean
The option DEBUG_LOOK_AHEAD.private Boolean
The option DEBUG_PARSER.private Boolean
The option DEBUG_TOKEN_MANAGER.private Boolean
The option ERROR_REPORTING.private Boolean
The option FORCE_LA_CHECK.private String
The option GRAMMAR_ENCODING.private Boolean
The option IGNORE_CASE.private File
The input grammar.private Boolean
The option STATIC.private Boolean
The option JAVA_UNICODE_ESCAPE.private String
The option JDK_VERSION.private Boolean
The option KEEP_LINE_COLUMN.private Integer
The option LOOK_AHEAD.private Integer
The option OTHER_AMBIGUITY_CHECK.private File
The option OUTPUT_DIRECTORY.private Boolean
The option SANITY_CHECK.private Boolean
The option SUPPORT_CLASS_VISIBILITY_PUBLIC.private String
The option TOKEN_EXTENDS.private String
The option TOKEN_FACTORY.private Boolean
The option TOKEN_MANAGER_USES_PARSER.private Boolean
The option UNICODE_INPUT.private Boolean
The option USER_CHAR_STREAM.private Boolean
The option USER_TOKEN_MANAGER. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
execute()
Runs the tool using the previously set parameters.private String[]
Assembles the command line arguments for the invocation of JavaCC according to the configuration.void
setBuildParser
(Boolean value) Sets the option BUILD_PARSER.void
setBuildTokenManager
(Boolean value) Sets the option BUILD_TOKEN_MANAGER.void
setCacheTokens
(Boolean value) Sets the option CACHE_TOKENS.void
setChoiceAmbiguityCheck
(Integer value) Sets the option CHOICE_AMBIGUITY_CHECK.void
setCommonTokenAction
(Boolean value) Sets the option COMMON_TOKEN_ACTION.void
setDebugLookAhead
(Boolean value) Sets the option DEBUG_LOOK_AHEAD.void
setDebugParser
(Boolean value) Sets the option DEBUG_PARSER.void
setDebugTokenManager
(Boolean value) Sets the option DEBUG_TOKEN_MANAGER.void
setErrorReporting
(Boolean value) Sets the option ERROR_REPORTING.void
setForceLaCheck
(Boolean value) Sets the option FORCE_LA_CHECK.void
setGrammarEncoding
(String value) Sets the option GRAMMAR_ENCODING.void
setIgnoreCase
(Boolean value) Sets the option IGNORE_CASE.void
setInputFile
(File value) Sets the absolute path to the grammar file to pass into JavaCC for compilation.void
setJavaUnicodeEscape
(Boolean value) Sets the option JAVA_UNICODE_ESCAPE.void
setJdkVersion
(String value) Sets the option JDK_VERSION.void
setKeepLineColumn
(Boolean value) Sets the option KEEP_LINE_COLUMN.void
setLookAhead
(Integer value) Sets the option LOOK_AHEAD.void
setOtherAmbiguityCheck
(Integer value) Sets the option OTHER_AMBIGUITY_CHECK.void
setOutputDirectory
(File value) Sets the absolute path to the output directory.void
setSanityCheck
(Boolean value) Sets the option SANITY_CHECK.void
Sets the option STATIC.void
Sets the option SUPPORT_CLASS_VISIBILITY_PUBLIC.void
setTokenExtends
(String value) Sets the option TOKEN_EXTENDS.void
setTokenFactory
(String value) Sets the option TOKEN_FACTORY.void
setTokenManagerUsesParser
(Boolean value) Sets the option TOKEN_MANAGER_USES_PARSER.void
setUnicodeInput
(Boolean value) Sets the option UNICODE_INPUT.void
setUserCharStream
(Boolean value) Sets the option USER_CHAR_STREAM.void
setUserTokenManager
(Boolean value) Sets the option USER_TOKEN_MANAGER.toString()
Gets a string representation of the command line arguments.Methods inherited from class org.codehaus.mojo.javacc.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 benull
to use the value provided in the grammar or the default.
-
setJdkVersion
Sets the option JDK_VERSION.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setStatic
Sets the option STATIC.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setLookAhead
Sets the option LOOK_AHEAD.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setChoiceAmbiguityCheck
Sets the option CHOICE_AMBIGUITY_CHECK.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setOtherAmbiguityCheck
Sets the option OTHER_AMBIGUITY_CHECK.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setDebugParser
Sets the option DEBUG_PARSER.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setDebugLookAhead
Sets the option DEBUG_LOOK_AHEAD.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setDebugTokenManager
Sets the option DEBUG_TOKEN_MANAGER.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setErrorReporting
Sets the option ERROR_REPORTING.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setJavaUnicodeEscape
Sets the option JAVA_UNICODE_ESCAPE.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setUnicodeInput
Sets the option UNICODE_INPUT.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setIgnoreCase
Sets the option IGNORE_CASE.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setCommonTokenAction
Sets the option COMMON_TOKEN_ACTION.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setUserTokenManager
Sets the option USER_TOKEN_MANAGER.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setUserCharStream
Sets the option USER_CHAR_STREAM.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setBuildParser
Sets the option BUILD_PARSER.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setBuildTokenManager
Sets the option BUILD_TOKEN_MANAGER.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setTokenManagerUsesParser
Sets the option TOKEN_MANAGER_USES_PARSER.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setTokenExtends
Sets the option TOKEN_EXTENDS.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setTokenFactory
Sets the option TOKEN_FACTORY.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setSanityCheck
Sets the option SANITY_CHECK.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setForceLaCheck
Sets the option FORCE_LA_CHECK.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setCacheTokens
Sets the option CACHE_TOKENS.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setKeepLineColumn
Sets the option KEEP_LINE_COLUMN.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
setSupportClassVisibilityPublic
Sets the option SUPPORT_CLASS_VISIBILITY_PUBLIC.- Parameters:
value
- The option value, may benull
to use the value provided in the grammar or the default.
-
execute
Runs the tool using the previously set parameters.- Specified by:
execute
in 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
Gets a string representation of the command line arguments.
-