intermediate checkpoint
[sbp.git] / src / edu / berkeley / sbp / Parser.java
index ead3551..c270a90 100644 (file)
@@ -37,7 +37,7 @@ public abstract class Parser<T extends Token, R> {
         GSS gss = new GSS();
         Token.Location loc = input.getLocation();
         GSS.Phase current = gss.new Phase(null, this, null, input.next(1, 0, 0), loc, null);
-        current.newNode(null, null, pt.start, true);
+        current.newNode(null, Forest.leaf(null, null, null), pt.start, true);
         int count = 1;
         for(;;) {
             loc = input.getLocation();
@@ -382,6 +382,7 @@ public abstract class Parser<T extends Token, R> {
             }
             private void finish(GSS.Phase.Node parent, Forest result, GSS.Phase target) {
                 State state = parent.state.gotoSetNonTerminals.get(position.owner());
+                if (result==null) throw new Error();
                 if (state!=null)
                     target.newNode(parent, result, state, numPop<=0, this);
             }