@Test public void test_no_result() { Rule rule0 = new NoResultRule(keyMatch("b")); Rule rule = new ProductionRule(keyMatch("a"), rule0, keyMatch("c")); new TestRPB().buildRule(rule, builder.productionBuilder("rule", 0)); AmbiguousParser<List<String>> p = (AmbiguousParser) builder.createParser(AmbiguousParser.factory()); List<String> result = p.parse(Context.forString("abc"), "rule").iterator().next(); assertThat(result, contains("a", "c")); }
public RuleKey buildRule(Rule rule, ProductionBuilder pb) { keys.clear(); matchCounter = 0; baseRule = pb; return build(rule, pb).getOriginal(); }
RuleProductionBuilder { public RuleKey buildRule(Rule rule, ProductionBuilder pb) { keys.clear(); matchCounter = 0; baseRule = pb; return build(rule, pb).getOriginal(); } }
RuleProductionBuilder { public RuleKey buildRule(Rule rule, ProductionBuilder pb) { keys.clear(); matchCounter = 0; baseRule = pb; return build(rule, pb).getOriginal(); }  }
RuleProductionBuilder { public RuleKey buildRule(Rule rule, ProductionBuilder pb) { keys.clear(); matchCounter = 0; baseRule = pb; return build(rule, pb).getOriginal(); }  RuleKey buildRule(Rule rule, ProductionBuilder pb); }
RuleProductionBuilder { public RuleKey buildRule(Rule rule, ProductionBuilder pb) { keys.clear(); matchCounter = 0; baseRule = pb; return build(rule, pb).getOriginal(); }  RuleKey buildRule(Rule rule, ProductionBuilder pb);  }