@Test public void testInitAnchors() { assertThat( initAnchors(TestParser.class).keySet(), containsInAnyOrder( "EOI", "AsciiButNot", "CloseBrackets", "CloseParens", "EscapedSlash", "EscapedQuote", "TestAddressGroupName", "TestIpAddress", "TestNotOp", "TestIpRange", "TestName", "TestNameRegex", "TestNameRegexDeprecated", "TestParens", "TestReferenceBookName", "TestSpec", "TestSpecifierInput", "TestSpecifierInputTail", "WhiteSpace")); }
static Map<String, Type> initAnchors(Class<?> parserClass) { ImmutableMap.Builder<String, Anchor.Type> completionTypes = ImmutableMap.builder(); completionTypes.put("EOI", Anchor.Type.EOI); for (Method method : parserClass.getMethods()) { Anchor annotation = method.getAnnotation(Anchor.class); if (annotation != null) { completionTypes.put(method.getName(), annotation.value()); } } return completionTypes.build(); }
CommonParser extends BaseParser<AstNode> { static Map<String, Type> initAnchors(Class<?> parserClass) { ImmutableMap.Builder<String, Anchor.Type> completionTypes = ImmutableMap.builder(); completionTypes.put("EOI", Anchor.Type.EOI); for (Method method : parserClass.getMethods()) { Anchor annotation = method.getAnnotation(Anchor.class); if (annotation != null) { completionTypes.put(method.getName(), annotation.value()); } } return completionTypes.build(); } }
CommonParser extends BaseParser<AstNode> { static Map<String, Type> initAnchors(Class<?> parserClass) { ImmutableMap.Builder<String, Anchor.Type> completionTypes = ImmutableMap.builder(); completionTypes.put("EOI", Anchor.Type.EOI); for (Method method : parserClass.getMethods()) { Anchor annotation = method.getAnnotation(Anchor.class); if (annotation != null) { completionTypes.put(method.getName(), annotation.value()); } } return completionTypes.build(); }  }
CommonParser extends BaseParser<AstNode> { static Map<String, Type> initAnchors(Class<?> parserClass) { ImmutableMap.Builder<String, Anchor.Type> completionTypes = ImmutableMap.builder(); completionTypes.put("EOI", Anchor.Type.EOI); for (Method method : parserClass.getMethods()) { Anchor annotation = method.getAnnotation(Anchor.class); if (annotation != null) { completionTypes.put(method.getName(), annotation.value()); } } return completionTypes.build(); }  Rule input(Rule expression); Rule AlphabetChar(); @Anchor(Type.IGNORE) Rule AsciiButNot(String characters); Rule At(); Rule Dash(); Rule Digit(); Rule Dot(); Rule EnumValue(); Rule EscapeChar(); @Anchor(Type.IGNORE) Rule EscapedSlash(); @Anchor(Type.IGNORE) Rule EscapedQuote(); Rule IpAddressUnchecked(); Rule IpPrefixUnchecked(); Rule NameLiteral(); Rule Number(); @Anchor(OPERATOR_END) Rule CloseBrackets(); @Anchor(OPERATOR_END) Rule CloseParens(); Rule Regex(); Rule RegexDeprecated(); Rule Slash(); Rule Tilde(); Rule Underscore(); @Anchor(Type.WHITESPACE) Rule WhiteSpace(); }
CommonParser extends BaseParser<AstNode> { static Map<String, Type> initAnchors(Class<?> parserClass) { ImmutableMap.Builder<String, Anchor.Type> completionTypes = ImmutableMap.builder(); completionTypes.put("EOI", Anchor.Type.EOI); for (Method method : parserClass.getMethods()) { Anchor annotation = method.getAnnotation(Anchor.class); if (annotation != null) { completionTypes.put(method.getName(), annotation.value()); } } return completionTypes.build(); }  Rule input(Rule expression); Rule AlphabetChar(); @Anchor(Type.IGNORE) Rule AsciiButNot(String characters); Rule At(); Rule Dash(); Rule Digit(); Rule Dot(); Rule EnumValue(); Rule EscapeChar(); @Anchor(Type.IGNORE) Rule EscapedSlash(); @Anchor(Type.IGNORE) Rule EscapedQuote(); Rule IpAddressUnchecked(); Rule IpPrefixUnchecked(); Rule NameLiteral(); Rule Number(); @Anchor(OPERATOR_END) Rule CloseBrackets(); @Anchor(OPERATOR_END) Rule CloseParens(); Rule Regex(); Rule RegexDeprecated(); Rule Slash(); Rule Tilde(); Rule Underscore(); @Anchor(Type.WHITESPACE) Rule WhiteSpace(); static Set<String> namedApplications; }