@Test public void test_key_production_priority() { Rule r = new RuleParser("foo^ foo# foo. foo~ bar^ bar# bar. bar~ foo[1] bar[-2] baz[+3]", "foo", 5).parse(); CompositeRule cr = cast(r, CompositeRule.class); RuleKey[] expected = { rk("foo", 6), rk("foo", 0), rk("foo", 5), rk("foo", 5), rk("bar", 6), rk("bar", 0), rk("bar", 5), rk("bar", 0), rk("foo", 1), rk("bar", -2), rk("baz", 3)}; for (int i = 0; i < expected.length; i++) { KeyMatchRule m = cast(cr.getRules().get(i), KeyMatchRule.class); assertThat(i + ":", m.getKey(), is(expected[i])); } }
public Rule parse() { position = start; return parseSubrule(); }
RuleParser { public Rule parse() { position = start; return parseSubrule(); } }
RuleParser { public Rule parse() { position = start; return parseSubrule(); } RuleParser(String string, String defSymbol, int defPriority);  RuleParser(String string, int start, int end, String defSymbol, int defPriority); }
RuleParser { public Rule parse() { position = start; return parseSubrule(); } RuleParser(String string, String defSymbol, int defPriority);  RuleParser(String string, int start, int end, String defSymbol, int defPriority); Rule parse(); }
RuleParser { public Rule parse() { position = start; return parseSubrule(); } RuleParser(String string, String defSymbol, int defPriority);  RuleParser(String string, int start, int end, String defSymbol, int defPriority); Rule parse();  }