Options { public static void normalize() { if (getDebugLookahead() && !getDebugParser()) { if (cmdLineSetting.contains("DEBUG_PARSER") || inputFileSetting.contains("DEBUG_PARSER")) { JavaCCErrors .warning("True setting of option DEBUG_LOOKAHEAD overrides " + "false setting of option DEBUG_PARSER."); } optionValues.put("DEBUG_PARSER", TRUE); } optionValues.put("GENERATE_CHAINED_EXCEPTION", jdkVersionAtLeast(1.4)); optionValues.put("GENERATE_GENERICS", jdkVersionAtLeast(1.5)); optionValues.put("GENERATE_STRING_BUILDER", jdkVersionAtLeast(1.5)); optionValues.put("GENERATE_ANNOTATIONS", jdkVersionAtLeast(1.5)); } protected  Options(); static Map<String, Object> getOptions(); static void init(); static boolean isOption(String opt); static Object upgradeValue(String name, Object value); static void setInputFileOption(Object nameloc, Object valueloc,
                                        String name, Object value); static void setCmdLineOption(String arg); static void normalize(); static int getLookahead(); static int getChoiceAmbiguityCheck(); static int getOtherAmbiguityCheck(); static boolean getDebugParser(); static boolean getDebugLookahead(); static boolean getDebugScanner(); static boolean getErrorReporting(); static boolean getJavaUnicodeEscape(); static boolean getUnicodeInput(); static boolean getIgnoreCase(); static boolean getUserScanner(); static boolean getUserCharStream(); static boolean getBuildParser(); static boolean getBuildScanner(); static boolean getScannerUsesParser(); static boolean getSanityCheck(); static boolean getForceLaCheck(); static boolean getCommonTokenAction(); static boolean getCacheTokens(); static boolean getKeepLineColumn(); static boolean getKeepImage(); static String getJdkVersion(); static boolean getGenerateGenerics(); static boolean getGenerateAnnotations(); static boolean jdkVersionAtLeast(double version); static String getTokenExtends(); static String getTokenFactory(); static String getGrammarEncoding(); static File getOutputDirectory();  }
@Test public void testNormalize() { Options.init(); JavaCCErrors.reInit(); assertEquals(false, Options.getDebugLookahead()); assertEquals(false, Options.getDebugParser()); Options.setCmdLineOption("-DEBUG_LOOKAHEAD=TRUE"); Options.normalize(); assertEquals(true, Options.getDebugLookahead()); assertEquals(true, Options.getDebugParser()); assertEquals(0, JavaCCErrors.getWarningCount()); assertEquals(0, JavaCCErrors.getErrorCount()); assertEquals(0, JavaCCErrors.getParseErrorCount()); assertEquals(0, JavaCCErrors.getSemanticErrorCount()); }