}
return ret;
}
- public Object _plus__slash_(final Element r, Object s) { return rep(r, (Element)s, false, false); }
- public Object _star__slash_(final Element r, Object s) { return rep(r, (Element)s, false, true); }
- public Object _star__star_(final Element r) { return rep(r, null, true, true); }
- public Object _plus__plus_(final Element r) { return rep(r, null, true, false); }
+ public Element rep(Element e, Element sep, boolean maximal, boolean zero) {
+ Element ret = zero ? Repeat.many0(e, sep) : Repeat.many1(e, sep);
+ return maximal ? Repeat.maximal(ret) : ret;
+ }
+ public Object _plus__slash_(final Element r, Element s) { return Repeat.many1(r, s); }
+ public Object _star__slash_(final Element r, Element s) { return Repeat.many0(r, s); }
+ public Object _star__star_(final Element r) { return Repeat.maximal(Repeat.many0(r)); }
+ public Object _plus__plus_(final Element r) { return Repeat.maximal(Repeat.many1(r)); }
public Element _question_(final Element r) { return Repeat.maybe(r); }
public MetaGrammar gram(Object o, MetaGrammar g, Object o2) { return g; }
public MetaGrammar grammar(Object[] o) { return this; }
o3[o3.length-1] = o2;
return rewrite(o3);
}
-
- public static class PreBrace {
- public final Object[] o;
- public PreBrace(Object[] o) { this.o = o; }
- }
-
- public Element rep(Element e, Element sep, boolean maximal, boolean zero) {
- Element ret = zero ? Repeat.many0(e, sep) : Repeat.many1(e, sep);
- return maximal ? Repeat.maximal(ret) : ret;
- }
public static class PreSequence {
public PreSequence not(Sequence s) { not.add(s); return this; }