Package org.javacc.parser
Class Options
- java.lang.Object
-
- org.javacc.parser.Options
-
- Direct Known Subclasses:
JJDocOptions
public class Options extends java.lang.ObjectA class with static state that stores all option information.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOptions.Language
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringJAVA_TEMPLATE_TYPE_CLASSICThe old style of Java code generation (tight coupling of code to Java IO classes - not GWT compatible)static java.lang.StringJAVA_TEMPLATE_TYPE_MODERN2013/07/22 -- GWT Compliant Output -- no external dependencies on GWT, but generated code adds loose coupling to IO, for 6.1 release, this is opt-in, moving forward to 7.0, after thorough testing, this will likely become the default option with classic being deprecatedstatic Options.Languagelanguagestatic java.lang.StringNONUSER_OPTION__HAS_NAMESPACEstatic java.lang.StringNONUSER_OPTION__LEGACY_EXCEPTION_HANDLINGstatic java.lang.StringNONUSER_OPTION__NAMESPACE_CLOSEThese are options that are not settable by the user themselves, and that are set indirectly via some configuration of user optionsstatic java.lang.StringNONUSER_OPTION__NAMESPACE_OPENstatic java.lang.StringNONUSER_OPTION__PARSER_NAMEprotected static java.util.Map<java.lang.String,java.lang.Object>optionValuesA mapping of option names (Strings) to values (Integer, Boolean, String).static java.lang.StringOUTPUT_LANGUAGE__CPPVarious constants relating to possible values for certain optionsstatic java.lang.StringOUTPUT_LANGUAGE__JAVAstatic java.lang.StringUSEROPTION__BUILD_PARSERstatic java.lang.StringUSEROPTION__BUILD_TOKEN_MANAGERstatic java.lang.StringUSEROPTION__CACHE_TOKENSstatic java.lang.StringUSEROPTION__CHOICE_AMBIGUITY_CHECKstatic java.lang.StringUSEROPTION__COMMON_TOKEN_ACTIONstatic java.lang.StringUSEROPTION__CPP_IGNORE_ACTIONSstatic java.lang.StringUSEROPTION__CPP_NAMESPACEstatic java.lang.StringUSEROPTION__CPP_PARSER_INCLUDEstatic java.lang.StringUSEROPTION__CPP_STACK_LIMITstatic java.lang.StringUSEROPTION__CPP_STOP_ON_FIRST_ERRORstatic java.lang.StringUSEROPTION__CPP_TOKEN_INCLUDEstatic java.lang.StringUSEROPTION__CPP_TOKEN_MANAGER_INCLUDEstatic java.lang.StringUSEROPTION__DEBUG_LOOKAHEADstatic java.lang.StringUSEROPTION__DEBUG_PARSERstatic java.lang.StringUSEROPTION__DEBUG_TOKEN_MANAGERstatic java.lang.StringUSEROPTION__DEPTH_LIMITstatic java.lang.StringUSEROPTION__ERROR_REPORTINGstatic java.lang.StringUSEROPTION__FORCE_LA_CHECKstatic java.lang.StringUSEROPTION__GENERATE_ANNOTATIONSstatic java.lang.StringUSEROPTION__GENERATE_BOILERPLATEstatic java.lang.StringUSEROPTION__GENERATE_CHAINED_EXCEPTIONstatic java.lang.StringUSEROPTION__GENERATE_GENERICSstatic java.lang.StringUSEROPTION__GENERATE_STRING_BUILDERstatic java.lang.StringUSEROPTION__GRAMMAR_ENCODINGstatic java.lang.StringUSEROPTION__IGNORE_CASEstatic java.lang.StringUSEROPTION__JAVA_TEMPLATE_TYPEOptions that the user can specify from .javacc filestatic java.lang.StringUSEROPTION__JAVA_UNICODE_ESCAPEstatic java.lang.StringUSEROPTION__JDK_VERSIONstatic java.lang.StringUSEROPTION__KEEP_LINE_COLUMNstatic java.lang.StringUSEROPTION__LOOKAHEADstatic java.lang.StringUSEROPTION__NO_DFAstatic java.lang.StringUSEROPTION__OTHER_AMBIGUITY_CHECKstatic java.lang.StringUSEROPTION__OUTPUT_DIRECTORYstatic java.lang.StringUSEROPTION__OUTPUT_LANGUAGEstatic java.lang.StringUSEROPTION__PARSER_CODE_GENERATORstatic java.lang.StringUSEROPTION__PARSER_SUPER_CLASSstatic java.lang.StringUSEROPTION__SANITY_CHECKstatic java.lang.StringUSEROPTION__STATICstatic java.lang.StringUSEROPTION__SUPPORT_CLASS_VISIBILITY_PUBLICstatic java.lang.StringUSEROPTION__TOKEN_EXTENDSstatic java.lang.StringUSEROPTION__TOKEN_FACTORYstatic java.lang.StringUSEROPTION__TOKEN_MANAGER_CODE_GENERATORstatic java.lang.StringUSEROPTION__TOKEN_MANAGER_SUPER_CLASSstatic java.lang.StringUSEROPTION__TOKEN_MANAGER_USES_PARSERstatic java.lang.StringUSEROPTION__TOKEN_SUPER_CLASSstatic java.lang.StringUSEROPTION__UNICODE_INPUTstatic java.lang.StringUSEROPTION__USER_CHAR_STREAMstatic java.lang.StringUSEROPTION__USER_TOKEN_MANAGER
-
Constructor Summary
Constructors Modifier Constructor Description protectedOptions()Limit subclassing to derived classes.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanbooleanValue(java.lang.String option)Convenience method to retrieve boolean options.static java.lang.StringgetBooleanType()static booleangetBuildParser()Find the build parser value.static booleangetBuildTokenManager()Find the build token manager value.static booleangetCacheTokens()Find the cache tokens value.static intgetChoiceAmbiguityCheck()Find the choice ambiguity check value.static booleangetCommonTokenAction()Find the common token action value.static booleangetDebugLookahead()Find the debug lookahead value.static booleangetDebugParser()Find the debug parser value.static booleangetDebugTokenManager()Find the debug tokenmanager value.static intgetDepthLimit()Get defined parser recursion depth limit.static booleangetErrorReporting()Find the error reporting value.static booleangetForceLaCheck()Find the force lookahead check value.static booleangetGenerateAnnotations()Should the generated code contain Annotations?static booleangetGenerateChainedException()Should the generated code create Exceptions using a constructor taking a nested exception?static booleangetGenerateGenerics()Should the generated code contain Generics?static booleangetGenerateStringBuilder()Should the generated code use StringBuilder rather than StringBuffer?static java.lang.StringgetGrammarEncoding()Return the file encoding; this will return the file.encoding system property if no value was explicitly setstatic booleangetIgnoreCase()Find the ignore case value.static java.lang.StringgetJavaTemplateType()static booleangetJavaUnicodeEscape()Find the Java unicode escape value.static java.lang.StringgetJdkVersion()Find the JDK version.static booleangetKeepLineColumn()Find the keep line column value.static java.lang.StringgetLongType()static intgetLookahead()Find the lookahead setting.static booleangetNoDfa()static java.util.Map<java.lang.String,java.lang.Object>getOptions()static java.lang.StringgetOptionsString(java.lang.String[] interestingOptions)Returns a string representation of the specified options of interest.static intgetOtherAmbiguityCheck()Find the other ambiguity check value.static java.io.FilegetOutputDirectory()Find the output directory.static java.lang.StringgetOutputLanguage()static java.lang.StringgetParserCodeGenerator()static booleangetSanityCheck()Find the sanity check value.static java.lang.StringgetStackLimit()Get defined parser stack usage limit.static booleangetStatic()Find the static value.static booleangetSupportClassVisibilityPublic()Should the generated code class visibility public?static java.lang.StringgetTokenExtends()Return the Token's superclass.static java.lang.StringgetTokenFactory()Return the Token's factory class.static java.lang.StringgetTokenManagerCodeGenerator()static booleangetTokenManagerUsesParser()Find the token manager uses parser value.static java.lang.StringgetTokenMgrErrorClass()static booleangetUnicodeInput()Find the unicode input value.static booleangetUserCharStream()Find the user charstream value.static java.util.Set<OptionInfo>getUserOptions()Gets all the user options (in order)static booleangetUserTokenManager()Find the user tokenmanager value.static voidinit()Initialize for JavaCCstatic intintValue(java.lang.String option)Convenience method to retrieve integer options.static booleanisGenerateBoilerplateCode()static booleanisLegacyExceptionHandling()As of 6.1 JavaCC now throws subclasses ofRuntimeExceptionrather thanErrors (by default), asErrors typically lead to the closing down of the parent VM and are only to be used in extreme circumstances (failure of parsing is generally not regarded as such).static booleanisOption(java.lang.String opt)Determine if a given command line argument might be an option flag.static booleanisOutputLanguageCpp()static booleanisOutputLanguageJava()static booleanisTokenManagerRequiresParserAccess()static booleanisValidJavaTemplateType(java.lang.String type)static booleanisValidOutputLanguage(java.lang.String language)static booleanjdkVersionAtLeast(double version)Determine if the output language is at least the specified version.static voidnormalize()static java.lang.ObjectobjectValue(java.lang.String option)static voidprocessCPPNamespaceOption(java.lang.String optionValue)static voidsetCmdLineOption(java.lang.String arg)Process a single command-line option.static voidsetInputFileOption(java.lang.Object nameloc, java.lang.Object valueloc, java.lang.String name, java.lang.Object value)static voidsetStringOption(java.lang.String optionName, java.lang.String optionValue)static java.lang.StringstringBufOrBuild()static java.lang.StringstringValue(java.lang.String option)Convenience method to retrieve string options.static java.lang.ObjectupgradeValue(java.lang.String name, java.lang.Object value)Help function to handle cases where the meaning of an option has changed over time.
-
-
-
Field Detail
-
NONUSER_OPTION__NAMESPACE_CLOSE
public static final java.lang.String NONUSER_OPTION__NAMESPACE_CLOSE
These are options that are not settable by the user themselves, and that are set indirectly via some configuration of user options- See Also:
- Constant Field Values
-
NONUSER_OPTION__HAS_NAMESPACE
public static final java.lang.String NONUSER_OPTION__HAS_NAMESPACE
- See Also:
- Constant Field Values
-
NONUSER_OPTION__NAMESPACE_OPEN
public static final java.lang.String NONUSER_OPTION__NAMESPACE_OPEN
- See Also:
- Constant Field Values
-
NONUSER_OPTION__PARSER_NAME
public static final java.lang.String NONUSER_OPTION__PARSER_NAME
- See Also:
- Constant Field Values
-
NONUSER_OPTION__LEGACY_EXCEPTION_HANDLING
public static final java.lang.String NONUSER_OPTION__LEGACY_EXCEPTION_HANDLING
- See Also:
- Constant Field Values
-
USEROPTION__JAVA_TEMPLATE_TYPE
public static final java.lang.String USEROPTION__JAVA_TEMPLATE_TYPE
Options that the user can specify from .javacc file- See Also:
- Constant Field Values
-
USEROPTION__GENERATE_BOILERPLATE
public static final java.lang.String USEROPTION__GENERATE_BOILERPLATE
- See Also:
- Constant Field Values
-
USEROPTION__OUTPUT_LANGUAGE
public static final java.lang.String USEROPTION__OUTPUT_LANGUAGE
- See Also:
- Constant Field Values
-
USEROPTION__PARSER_CODE_GENERATOR
public static final java.lang.String USEROPTION__PARSER_CODE_GENERATOR
- See Also:
- Constant Field Values
-
USEROPTION__TOKEN_MANAGER_CODE_GENERATOR
public static final java.lang.String USEROPTION__TOKEN_MANAGER_CODE_GENERATOR
- See Also:
- Constant Field Values
-
USEROPTION__NO_DFA
public static final java.lang.String USEROPTION__NO_DFA
- See Also:
- Constant Field Values
-
USEROPTION__STATIC
public static final java.lang.String USEROPTION__STATIC
- See Also:
- Constant Field Values
-
USEROPTION__LOOKAHEAD
public static final java.lang.String USEROPTION__LOOKAHEAD
- See Also:
- Constant Field Values
-
USEROPTION__IGNORE_CASE
public static final java.lang.String USEROPTION__IGNORE_CASE
- See Also:
- Constant Field Values
-
USEROPTION__UNICODE_INPUT
public static final java.lang.String USEROPTION__UNICODE_INPUT
- See Also:
- Constant Field Values
-
USEROPTION__JAVA_UNICODE_ESCAPE
public static final java.lang.String USEROPTION__JAVA_UNICODE_ESCAPE
- See Also:
- Constant Field Values
-
USEROPTION__ERROR_REPORTING
public static final java.lang.String USEROPTION__ERROR_REPORTING
- See Also:
- Constant Field Values
-
USEROPTION__DEBUG_TOKEN_MANAGER
public static final java.lang.String USEROPTION__DEBUG_TOKEN_MANAGER
- See Also:
- Constant Field Values
-
USEROPTION__DEBUG_LOOKAHEAD
public static final java.lang.String USEROPTION__DEBUG_LOOKAHEAD
- See Also:
- Constant Field Values
-
USEROPTION__DEBUG_PARSER
public static final java.lang.String USEROPTION__DEBUG_PARSER
- See Also:
- Constant Field Values
-
USEROPTION__OTHER_AMBIGUITY_CHECK
public static final java.lang.String USEROPTION__OTHER_AMBIGUITY_CHECK
- See Also:
- Constant Field Values
-
USEROPTION__CHOICE_AMBIGUITY_CHECK
public static final java.lang.String USEROPTION__CHOICE_AMBIGUITY_CHECK
- See Also:
- Constant Field Values
-
USEROPTION__CACHE_TOKENS
public static final java.lang.String USEROPTION__CACHE_TOKENS
- See Also:
- Constant Field Values
-
USEROPTION__COMMON_TOKEN_ACTION
public static final java.lang.String USEROPTION__COMMON_TOKEN_ACTION
- See Also:
- Constant Field Values
-
USEROPTION__FORCE_LA_CHECK
public static final java.lang.String USEROPTION__FORCE_LA_CHECK
- See Also:
- Constant Field Values
-
USEROPTION__SANITY_CHECK
public static final java.lang.String USEROPTION__SANITY_CHECK
- See Also:
- Constant Field Values
-
USEROPTION__BUILD_TOKEN_MANAGER
public static final java.lang.String USEROPTION__BUILD_TOKEN_MANAGER
- See Also:
- Constant Field Values
-
USEROPTION__BUILD_PARSER
public static final java.lang.String USEROPTION__BUILD_PARSER
- See Also:
- Constant Field Values
-
USEROPTION__USER_CHAR_STREAM
public static final java.lang.String USEROPTION__USER_CHAR_STREAM
- See Also:
- Constant Field Values
-
USEROPTION__USER_TOKEN_MANAGER
public static final java.lang.String USEROPTION__USER_TOKEN_MANAGER
- See Also:
- Constant Field Values
-
USEROPTION__JDK_VERSION
public static final java.lang.String USEROPTION__JDK_VERSION
- See Also:
- Constant Field Values
-
USEROPTION__SUPPORT_CLASS_VISIBILITY_PUBLIC
public static final java.lang.String USEROPTION__SUPPORT_CLASS_VISIBILITY_PUBLIC
- See Also:
- Constant Field Values
-
USEROPTION__GENERATE_ANNOTATIONS
public static final java.lang.String USEROPTION__GENERATE_ANNOTATIONS
- See Also:
- Constant Field Values
-
USEROPTION__GENERATE_STRING_BUILDER
public static final java.lang.String USEROPTION__GENERATE_STRING_BUILDER
- See Also:
- Constant Field Values
-
USEROPTION__GENERATE_GENERICS
public static final java.lang.String USEROPTION__GENERATE_GENERICS
- See Also:
- Constant Field Values
-
USEROPTION__GENERATE_CHAINED_EXCEPTION
public static final java.lang.String USEROPTION__GENERATE_CHAINED_EXCEPTION
- See Also:
- Constant Field Values
-
USEROPTION__OUTPUT_DIRECTORY
public static final java.lang.String USEROPTION__OUTPUT_DIRECTORY
- See Also:
- Constant Field Values
-
USEROPTION__KEEP_LINE_COLUMN
public static final java.lang.String USEROPTION__KEEP_LINE_COLUMN
- See Also:
- Constant Field Values
-
USEROPTION__GRAMMAR_ENCODING
public static final java.lang.String USEROPTION__GRAMMAR_ENCODING
- See Also:
- Constant Field Values
-
USEROPTION__TOKEN_FACTORY
public static final java.lang.String USEROPTION__TOKEN_FACTORY
- See Also:
- Constant Field Values
-
USEROPTION__TOKEN_EXTENDS
public static final java.lang.String USEROPTION__TOKEN_EXTENDS
- See Also:
- Constant Field Values
-
USEROPTION__DEPTH_LIMIT
public static final java.lang.String USEROPTION__DEPTH_LIMIT
- See Also:
- Constant Field Values
-
USEROPTION__TOKEN_MANAGER_USES_PARSER
public static final java.lang.String USEROPTION__TOKEN_MANAGER_USES_PARSER
- See Also:
- Constant Field Values
-
USEROPTION__TOKEN_SUPER_CLASS
public static final java.lang.String USEROPTION__TOKEN_SUPER_CLASS
- See Also:
- Constant Field Values
-
USEROPTION__PARSER_SUPER_CLASS
public static final java.lang.String USEROPTION__PARSER_SUPER_CLASS
- See Also:
- Constant Field Values
-
USEROPTION__TOKEN_MANAGER_SUPER_CLASS
public static final java.lang.String USEROPTION__TOKEN_MANAGER_SUPER_CLASS
- See Also:
- Constant Field Values
-
USEROPTION__CPP_NAMESPACE
public static final java.lang.String USEROPTION__CPP_NAMESPACE
- See Also:
- Constant Field Values
-
USEROPTION__CPP_IGNORE_ACTIONS
public static final java.lang.String USEROPTION__CPP_IGNORE_ACTIONS
- See Also:
- Constant Field Values
-
USEROPTION__CPP_STOP_ON_FIRST_ERROR
public static final java.lang.String USEROPTION__CPP_STOP_ON_FIRST_ERROR
- See Also:
- Constant Field Values
-
USEROPTION__CPP_STACK_LIMIT
public static final java.lang.String USEROPTION__CPP_STACK_LIMIT
- See Also:
- Constant Field Values
-
USEROPTION__CPP_TOKEN_INCLUDE
public static final java.lang.String USEROPTION__CPP_TOKEN_INCLUDE
- See Also:
- Constant Field Values
-
USEROPTION__CPP_PARSER_INCLUDE
public static final java.lang.String USEROPTION__CPP_PARSER_INCLUDE
- See Also:
- Constant Field Values
-
USEROPTION__CPP_TOKEN_MANAGER_INCLUDE
public static final java.lang.String USEROPTION__CPP_TOKEN_MANAGER_INCLUDE
- See Also:
- Constant Field Values
-
OUTPUT_LANGUAGE__CPP
public static final java.lang.String OUTPUT_LANGUAGE__CPP
Various constants relating to possible values for certain options- See Also:
- Constant Field Values
-
OUTPUT_LANGUAGE__JAVA
public static final java.lang.String OUTPUT_LANGUAGE__JAVA
- See Also:
- Constant Field Values
-
language
public static Options.Language language
-
JAVA_TEMPLATE_TYPE_MODERN
public static final java.lang.String JAVA_TEMPLATE_TYPE_MODERN
2013/07/22 -- GWT Compliant Output -- no external dependencies on GWT, but generated code adds loose coupling to IO, for 6.1 release, this is opt-in, moving forward to 7.0, after thorough testing, this will likely become the default option with classic being deprecated- See Also:
- Constant Field Values
-
JAVA_TEMPLATE_TYPE_CLASSIC
public static final java.lang.String JAVA_TEMPLATE_TYPE_CLASSIC
The old style of Java code generation (tight coupling of code to Java IO classes - not GWT compatible)- See Also:
- Constant Field Values
-
optionValues
protected static java.util.Map<java.lang.String,java.lang.Object> optionValues
A mapping of option names (Strings) to values (Integer, Boolean, String). This table is initialized by the main program. Its contents defines the set of legal options. Its initial values define the default option values, and the option types can be determined from these values too.
-
-
Method Detail
-
init
public static void init()
Initialize for JavaCC
-
intValue
public static int intValue(java.lang.String option)
Convenience method to retrieve integer options.
-
booleanValue
public static boolean booleanValue(java.lang.String option)
Convenience method to retrieve boolean options.
-
stringValue
public static java.lang.String stringValue(java.lang.String option)
Convenience method to retrieve string options.
-
objectValue
public static java.lang.Object objectValue(java.lang.String option)
-
getOptions
public static java.util.Map<java.lang.String,java.lang.Object> getOptions()
-
getOptionsString
public static java.lang.String getOptionsString(java.lang.String[] interestingOptions)
Returns a string representation of the specified options of interest. Used when, for example, generating Token.java to record the JavaCC options that were used to generate the file. All of the options must be boolean values.- Parameters:
interestingOptions- the options of interest, eg {Options.USEROPTION__STATIC, Options.USEROPTION__CACHE_TOKENS}- Returns:
- the string representation of the options, eg "STATIC=true,CACHE_TOKENS=false"
-
getTokenMgrErrorClass
public static java.lang.String getTokenMgrErrorClass()
-
isOption
public static boolean isOption(java.lang.String opt)
Determine if a given command line argument might be an option flag. Command line options start with a dash (-).- Parameters:
opt- The command line argument to examine.- Returns:
- True when the argument looks like an option flag.
-
upgradeValue
public static java.lang.Object upgradeValue(java.lang.String name, java.lang.Object value)Help function to handle cases where the meaning of an option has changed over time. If the user has supplied an option in the old format, it will be converted to the new format.- Parameters:
name- The name of the option being checked.value- The option's value.- Returns:
- The upgraded value.
-
setInputFileOption
public static void setInputFileOption(java.lang.Object nameloc, java.lang.Object valueloc, java.lang.String name, java.lang.Object value)
-
setCmdLineOption
public static void setCmdLineOption(java.lang.String arg)
Process a single command-line option. The option is parsed and stored in the optionValues map.- Parameters:
arg-
-
normalize
public static void normalize()
-
getLookahead
public static int getLookahead()
Find the lookahead setting.- Returns:
- The requested lookahead value.
-
getChoiceAmbiguityCheck
public static int getChoiceAmbiguityCheck()
Find the choice ambiguity check value.- Returns:
- The requested choice ambiguity check value.
-
getOtherAmbiguityCheck
public static int getOtherAmbiguityCheck()
Find the other ambiguity check value.- Returns:
- The requested other ambiguity check value.
-
getStatic
public static boolean getStatic()
Find the static value.- Returns:
- The requested static value.
-
getParserCodeGenerator
public static java.lang.String getParserCodeGenerator()
-
getTokenManagerCodeGenerator
public static java.lang.String getTokenManagerCodeGenerator()
-
getNoDfa
public static boolean getNoDfa()
-
getDebugParser
public static boolean getDebugParser()
Find the debug parser value.- Returns:
- The requested debug parser value.
-
getDebugLookahead
public static boolean getDebugLookahead()
Find the debug lookahead value.- Returns:
- The requested debug lookahead value.
-
getDebugTokenManager
public static boolean getDebugTokenManager()
Find the debug tokenmanager value.- Returns:
- The requested debug tokenmanager value.
-
getErrorReporting
public static boolean getErrorReporting()
Find the error reporting value.- Returns:
- The requested error reporting value.
-
getJavaUnicodeEscape
public static boolean getJavaUnicodeEscape()
Find the Java unicode escape value.- Returns:
- The requested Java unicode escape value.
-
getUnicodeInput
public static boolean getUnicodeInput()
Find the unicode input value.- Returns:
- The requested unicode input value.
-
getIgnoreCase
public static boolean getIgnoreCase()
Find the ignore case value.- Returns:
- The requested ignore case value.
-
getUserTokenManager
public static boolean getUserTokenManager()
Find the user tokenmanager value.- Returns:
- The requested user tokenmanager value.
-
getUserCharStream
public static boolean getUserCharStream()
Find the user charstream value.- Returns:
- The requested user charstream value.
-
getBuildParser
public static boolean getBuildParser()
Find the build parser value.- Returns:
- The requested build parser value.
-
getBuildTokenManager
public static boolean getBuildTokenManager()
Find the build token manager value.- Returns:
- The requested build token manager value.
-
getTokenManagerUsesParser
public static boolean getTokenManagerUsesParser()
Find the token manager uses parser value.- Returns:
- The requested token manager uses parser value;
-
getSanityCheck
public static boolean getSanityCheck()
Find the sanity check value.- Returns:
- The requested sanity check value.
-
getForceLaCheck
public static boolean getForceLaCheck()
Find the force lookahead check value.- Returns:
- The requested force lookahead value.
-
getCommonTokenAction
public static boolean getCommonTokenAction()
Find the common token action value.- Returns:
- The requested common token action value.
-
getCacheTokens
public static boolean getCacheTokens()
Find the cache tokens value.- Returns:
- The requested cache tokens value.
-
getKeepLineColumn
public static boolean getKeepLineColumn()
Find the keep line column value.- Returns:
- The requested keep line column value.
-
getJdkVersion
public static java.lang.String getJdkVersion()
Find the JDK version.- Returns:
- The requested jdk version.
-
getGenerateChainedException
public static boolean getGenerateChainedException()
Should the generated code create Exceptions using a constructor taking a nested exception?- Returns:
-
isGenerateBoilerplateCode
public static boolean isGenerateBoilerplateCode()
-
isLegacyExceptionHandling
public static boolean isLegacyExceptionHandling()
As of 6.1 JavaCC now throws subclasses ofRuntimeExceptionrather thanErrors (by default), asErrors typically lead to the closing down of the parent VM and are only to be used in extreme circumstances (failure of parsing is generally not regarded as such). If this value is set to true, then thenErrors will be thrown (for compatibility with older .jj files)- Returns:
- true if throws errors (legacy), false if use
RuntimeExceptions (better approach)
-
getGenerateGenerics
public static boolean getGenerateGenerics()
Should the generated code contain Generics?- Returns:
-
getGenerateStringBuilder
public static boolean getGenerateStringBuilder()
Should the generated code use StringBuilder rather than StringBuffer?- Returns:
-
getGenerateAnnotations
public static boolean getGenerateAnnotations()
Should the generated code contain Annotations?- Returns:
-
getSupportClassVisibilityPublic
public static boolean getSupportClassVisibilityPublic()
Should the generated code class visibility public?- Returns:
-
jdkVersionAtLeast
public static boolean jdkVersionAtLeast(double version)
Determine if the output language is at least the specified version.- Parameters:
version- the version to check against. E.g.1.5- Returns:
- true if the output version is at least the specified version.
-
getTokenExtends
public static java.lang.String getTokenExtends()
Return the Token's superclass.- Returns:
- The required base class for Token.
-
getTokenFactory
public static java.lang.String getTokenFactory()
Return the Token's factory class.- Returns:
- The required factory class for Token.
-
getGrammarEncoding
public static java.lang.String getGrammarEncoding()
Return the file encoding; this will return the file.encoding system property if no value was explicitly set- Returns:
- The file encoding (e.g., UTF-8, ISO_8859-1, MacRoman)
-
getOutputDirectory
public static java.io.File getOutputDirectory()
Find the output directory.- Returns:
- The requested output directory.
-
stringBufOrBuild
public static java.lang.String stringBufOrBuild()
-
isValidOutputLanguage
public static boolean isValidOutputLanguage(java.lang.String language)
-
isValidJavaTemplateType
public static boolean isValidJavaTemplateType(java.lang.String type)
-
getOutputLanguage
public static java.lang.String getOutputLanguage()
- Returns:
- the output language. default java
-
getJavaTemplateType
public static java.lang.String getJavaTemplateType()
-
setStringOption
public static void setStringOption(java.lang.String optionName, java.lang.String optionValue)
-
processCPPNamespaceOption
public static void processCPPNamespaceOption(java.lang.String optionValue)
-
getLongType
public static java.lang.String getLongType()
-
getBooleanType
public static java.lang.String getBooleanType()
-
isOutputLanguageJava
public static boolean isOutputLanguageJava()
-
isOutputLanguageCpp
public static boolean isOutputLanguageCpp()
-
isTokenManagerRequiresParserAccess
public static boolean isTokenManagerRequiresParserAccess()
-
getDepthLimit
public static int getDepthLimit()
Get defined parser recursion depth limit.- Returns:
- The requested recursion limit.
-
getStackLimit
public static java.lang.String getStackLimit()
Get defined parser stack usage limit.- Returns:
- The requested stack usage limit.
-
getUserOptions
public static java.util.Set<OptionInfo> getUserOptions()
Gets all the user options (in order)- Returns:
-
-