reenable XTree
authoradam <adam@megacz.com>
Mon, 26 Mar 2007 07:13:29 +0000 (03:13 -0400)
committeradam <adam@megacz.com>
Mon, 26 Mar 2007 07:13:29 +0000 (03:13 -0400)
darcs-hash:20070326071329-5007d-ca9d9c64769e4e3d3d6cc4a9916684e2ca027956.gz

src/edu/berkeley/sbp/meta/GrammarBuilder.java

index d9b04c2..c7ef44a 100644 (file)
@@ -84,6 +84,7 @@ public class GrammarBuilder {
         if (head.equals("Elements")) return seq2((ElementNode[])Reflection.rebuild(walkChildren(t), ElementNode[].class));
         if (head.equals("NonTerminalReference")) return new ReferenceNode(stringifyChildren(t.child(0)));
         //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 plus((ElementNode)walk(t.child(0)));
@@ -501,9 +502,9 @@ public class GrammarBuilder {
 
     }
 
-    /*
-    public            class XTree                 extends ElementNode {
-        public  Seq body;
+    public class XTree extends ElementNode {
+        public Seq body;
+        public XTree(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);
@@ -518,5 +519,4 @@ public class GrammarBuilder {
             return u2;
         }
     }
-    */
 }