Commit 97758e5c authored by Michael Schwarz's avatar Michael Schwarz
Browse files

fixed error in simulated effect of prec

parent 3ad29e2d
...@@ -302,7 +302,16 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi ...@@ -302,7 +302,16 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
} }
sb.append("precedence "); sb.append("precedence ");
sb.append(p.getSecond().toString().toLowerCase());
if(p.getSecond() == Precedence.Type.NoPrec){
// We insert nonassoc in here. This should never matter
sb.append(Precedence.Type.NonAssoc.toString().toLowerCase());
}
else {
sb.append(p.getSecond().toString().toLowerCase());
}
sb.append(" "); sb.append(" ");
sb.append(p.getFirst().name()); sb.append(p.getFirst().name());
sb.append("; // Inserted by Eclipse plugin"); sb.append("; // Inserted by Eclipse plugin");
...@@ -328,7 +337,8 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi ...@@ -328,7 +337,8 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
// This works because we have guarantee that the graph is a DAG // This works because we have guarantee that the graph is a DAG
HashSet<terminal> toCheck = new HashSet<>(); HashSet<terminal> toCheck = new HashSet<>();
if(edges.get(over).size() == 0){ if(edges.get(over).size() == 0){
return true; // if the node has no outgoing node, than nothing has precedence over it
return false;
} }
toCheck.addAll(edges.get(over)); toCheck.addAll(edges.get(over));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment