- //if (head.equals(")")) return new ReferenceNode(stringifyChildren(t.child(0)));
- if (head.equals("{")) return new XTree((Seq)walk(t.child(0)));
- if (head.equals("::")) return tag((String)walk(t.child(0)), (Seq)walk(t.child(1)));
- if (head.equals("++")) return plusmax((ElementNode)walk(t.child(0)));
- if (head.equals("...")) return star(new TildeNode(new AtomNode()));
- if (head.equals("+")) return plus((ElementNode)walk(t.child(0)));
- if (head.equals("++/")) return plusmaxfollow((ElementNode)walk(t.child(0)), (ElementNode)walk(t.child(1)));
- if (head.equals("+/")) return plusfollow((ElementNode)walk(t.child(0)), (ElementNode)walk(t.child(1)));
- if (head.equals("**")) return starmax((ElementNode)walk(t.child(0)));
- if (head.equals("*")) return star((ElementNode)walk(t.child(0)));
- if (head.equals("**/")) return starmaxfollow((ElementNode)walk(t.child(0)), (ElementNode)walk(t.child(1)));
- if (head.equals("*/")) return starfollow((ElementNode)walk(t.child(0)), (ElementNode)walk(t.child(1)));
- if (head.equals("?")) return question((ElementNode)walk(t.child(0)));
- if (head.equals("!")) return new DropNode((ElementNode)walk(t.child(0)));
- if (head.equals("^")) return new LiteralNode((String)walk(t.child(0)), true);
- if (head.equals("`")) {
- ElementNode ret = (ElementNode)walk(t.child(0));
- ret.lifted = true;
- return ret;
- }
+ if (head.equals(")")) return new ReferenceNode(stringifyChildren(t.child(0)), true);
+ if (head.equals("{")) return new BracedNode(walkSeq(t.child(0)));
+ if (head.equals("::")) return walkSeq(t.child(1)).tag(walkString(t.child(0)));
+ if (head.equals("...")) return new DropNode(new RepeatNode(new TildeNode(new AtomNode()), null, true, true, false));
+
+ if (head.equals("++")) return new RepeatNode(walkElement(t.child(0)), null, false, true, true);
+ if (head.equals("+")) return new RepeatNode(walkElement(t.child(0)), null, false, true, false);
+ if (head.equals("++/")) return new RepeatNode(walkElement(t.child(0)), walkElement(t.child(1)), false, true, true);
+ if (head.equals("+/")) return new RepeatNode(walkElement(t.child(0)), walkElement(t.child(1)), false, true, false);
+ if (head.equals("**")) return new RepeatNode(walkElement(t.child(0)), null, true, true, true);
+ if (head.equals("*")) return new RepeatNode(walkElement(t.child(0)), null, true, true, false);
+ if (head.equals("**/")) return new RepeatNode(walkElement(t.child(0)), walkElement(t.child(1)), true, true, true);
+ if (head.equals("*/")) return new RepeatNode(walkElement(t.child(0)), walkElement(t.child(1)), true, true, false);
+ if (head.equals("?")) return new RepeatNode(walkElement(t.child(0)), null, true, false, false);
+
+ if (head.equals("!")) return new DropNode(walkElement(t.child(0)));
+ if (head.equals("^")) return new LiteralNode(walkString(t.child(0)), true);
+ if (head.equals("`")) return walkElement(t.child(0)).lifted();