some new attempts at a better dead-node collection; introduces hasPathToRoot
[sbp.git] / src / edu / berkeley / sbp / ParseFailed.java
index 872ffac..fe8e247 100644 (file)
@@ -143,7 +143,7 @@ public class ParseFailed extends Exception {
     static void error(String message, GSS.Phase phase, Object token, Input.Region region) throws ParseFailed {
         error(message,
               token,
-              phase,
+              /*phase*/null,
               region,
               phase.getGSS().getInput(),
               phase.getGSS());
@@ -184,8 +184,9 @@ public class ParseFailed extends Exception {
             */
         }
         HashMap<Element,Input.Location> hm = new HashMap<Element,Input.Location>();
-        for(StateNode no : nodes)
-            barf(hm, no, 0, false, region.getStart());
+        if (nodes!=null)
+            for(StateNode no : nodes)
+                barf(hm, no, 0, false, region.getStart());
         ret.append("\n expected: ");
         Set<Element> hs = hm.keySet();
         if (hs.size() == 1) {