@Test public void testEnumValue() { CommonParser parser = CommonParser.instance(); Rule rule = parser.input(parser.EnumValue()); assertTrue(matches("a", rule)); assertTrue(matches("A", rule)); assertTrue(matches("abc", rule)); assertTrue(matches("ABC", rule)); assertTrue(matches("_startUnderscore", rule)); assertTrue(matches("has9number", rule)); assertTrue(matches("has-dash", rule)); assertFalse(matches("", rule)); assertFalse(matches("9numberstart", rule)); assertFalse(matches("-dashstart", rule)); assertFalse(matches("\"quoted\"", rule)); assertFalse(matches("has,", rule)); assertFalse(matches("has\\", rule)); assertFalse(matches("has&", rule)); assertFalse(matches("has(", rule)); assertFalse(matches("has)", rule)); assertFalse(matches("has[", rule)); assertFalse(matches("has]", rule)); assertFalse(matches("/startSlash", rule)); assertFalse(matches("@startAt", rule)); assertFalse(matches("", rule)); assertFalse(matches("\"", rule)); assertFalse(matches("\"\"", rule)); }
public Rule EnumValue() { return Sequence( FirstOf(AlphabetChar(), Underscore()), ZeroOrMore(FirstOf(AlphabetChar(), Underscore(), Digit(), Dash()))); }
CommonParser extends BaseParser<AstNode> { public Rule EnumValue() { return Sequence( FirstOf(AlphabetChar(), Underscore()), ZeroOrMore(FirstOf(AlphabetChar(), Underscore(), Digit(), Dash()))); } }
CommonParser extends BaseParser<AstNode> { public Rule EnumValue() { return Sequence( FirstOf(AlphabetChar(), Underscore()), ZeroOrMore(FirstOf(AlphabetChar(), Underscore(), Digit(), Dash()))); }  }
CommonParser extends BaseParser<AstNode> { public Rule EnumValue() { return Sequence( FirstOf(AlphabetChar(), Underscore()), ZeroOrMore(FirstOf(AlphabetChar(), Underscore(), Digit(), Dash()))); }  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> { public Rule EnumValue() { return Sequence( FirstOf(AlphabetChar(), Underscore()), ZeroOrMore(FirstOf(AlphabetChar(), Underscore(), Digit(), Dash()))); }  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; }