metagrammar fix, loop detector (hack)
[sbp.git] / src / edu / berkeley / sbp / ParseFailed.java
index 75baf3a..eb11b11 100644 (file)
@@ -16,9 +16,11 @@ public class ParseFailed extends RuntimeException {
     public Input.Location getLocation() { return location; }
     public String toString() { return message/* + (location==null ? "" : (" at " + location))*/; }
 
+    // FIXME
+    private static HashSet<GSS.Phase.Node> touched = new HashSet<GSS.Phase.Node>();
     public static <Tok> void complain(GSS.Phase<Tok>.Node n, HashMap<String,HashSet<String>> errors, boolean force) {
-        //if (n.touched) return;
-        //n.touched = true;
+        if (touched.contains(n)) return;
+        touched.add(n);
         for(Position p : n.state) {
             if (((p.isFirst() || p.isLast()) && !force) || p.owner().name==null) {
                 for(Node n2 : n.parents())