- public Seq and2(Seq s, Seq a) { a.alwaysDrop = true; return s.and(a); }
- public Seq andnot2(Seq s, Seq a) { a.alwaysDrop = true; return s.andnot(a); }
- public Seq arrow(Seq s, ElementNode e) { return s.follow(e); }
- public Seq tag(String tagname, Seq s) { return s.tag(tagname); }
- public Seq seq(ElementNode[] elements) { return new Seq(elements); }
- public Seq seq2(ElementNode[] elements) { return new Seq(elements); }
- public ElementNode plusmax(final ElementNode e) { return new RepeatNode(e, null, false, true, true); }
- public ElementNode plus(final ElementNode e) { return new RepeatNode(e, null, false, true, false); }
- public ElementNode plusmaxfollow(final ElementNode e, final ElementNode sep) { return new RepeatNode(e, sep, false, true, true); }
- public ElementNode plusfollow(final ElementNode e, final ElementNode sep) { return new RepeatNode(e, sep, false, true, false); }
- public ElementNode starmax(final ElementNode e) { return new RepeatNode(e, null, true, true, true); }
- public ElementNode star(final ElementNode e) { return new RepeatNode(e, null, true, true, false); }
- public ElementNode starmaxfollow(final ElementNode e, final ElementNode sep) { return new RepeatNode(e, sep, true, true, true); }
- public ElementNode starfollow(final ElementNode e, final ElementNode sep) { return new RepeatNode(e, sep, true, true, false); }
- public ElementNode question(final ElementNode e) { return new RepeatNode(e, null, true, false, false); }
+ // FIXME: doesn't this require a tag?
+ private class BracedNode extends ElementNode {
+ public Seq body;
+ public BracedNode(Seq seq) { this.body = seq; }
+ public Element build(Context cx, NonTerminalNode cnt, boolean dropall) {
+ Union u = new Union(null, false);
+ Sequence s = body.build(cx, u, null, dropall);
+ Union u2 = new Union(null, false);
+ u2.add(Sequence.create(new Element[] {
+ CharAtom.leftBrace,
+ u,
+ CharAtom.rightBrace
+ }, 1));
+ return u2;
+ }
+ }
+
+ public Seq and2(Seq s, Seq a) { a.alwaysDrop = true; return s.and(a); }
+ public Seq andnot2(Seq s, Seq a) { a.alwaysDrop = true; return s.andnot(a); }