@Test public void test_group() { Rule r = new RuleParser("a (b c) d", "foo", 5).parse(); CompositeRule cr = cast(r, CompositeRule.class); cast(cr.getRules().get(0), KeyMatchRule.class); cast(cr.getRules().get(2), KeyMatchRule.class); ProductionRule gr = cast(cr.getRules().get(1), ProductionRule.class); KeyMatchRule rB = cast(gr.getRules().get(0), KeyMatchRule.class); assertThat(rB.getKey(), is(rk("b", 0))); KeyMatchRule rC = cast(gr.getRules().get(1), KeyMatchRule.class); assertThat(rC.getKey(), is(rk("c", 0))); }
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();  }