Commit feaf6b51 authored by Michael Schwarz's avatar Michael Schwarz 🤔
Browse files

4 way split to account for items that are irrelevant (i.e. (*) in front

of terminal but other terminal taken)
parent e317ef47
...@@ -20,7 +20,7 @@ public class ConflictStateTooltip extends MultipleTextTooltipBase implements ITo ...@@ -20,7 +20,7 @@ public class ConflictStateTooltip extends MultipleTextTooltipBase implements ITo
private CupConflictState cState; private CupConflictState cState;
public ConflictStateTooltip(Display display) { public ConflictStateTooltip(Display display) {
super(display,3); super(display,4);
} }
...@@ -44,6 +44,7 @@ public class ConflictStateTooltip extends MultipleTextTooltipBase implements ITo ...@@ -44,6 +44,7 @@ public class ConflictStateTooltip extends MultipleTextTooltipBase implements ITo
StringBuilder core = new StringBuilder(); StringBuilder core = new StringBuilder();
StringBuilder closure = new StringBuilder(); StringBuilder closure = new StringBuilder();
StringBuilder finished = new StringBuilder(); StringBuilder finished = new StringBuilder();
StringBuilder irrelevantCore = new StringBuilder();
for (Enumeration e = this.cState.getState().items().all(); e.hasMoreElements(); ) { for (Enumeration e = this.cState.getState().items().all(); e.hasMoreElements(); ) {
lalr_item item = (lalr_item)e.nextElement(); lalr_item item = (lalr_item)e.nextElement();
...@@ -57,6 +58,10 @@ public class ConflictStateTooltip extends MultipleTextTooltipBase implements ITo ...@@ -57,6 +58,10 @@ public class ConflictStateTooltip extends MultipleTextTooltipBase implements ITo
finished.append(item.toString().replace("(*)", "\u2022")); finished.append(item.toString().replace("(*)", "\u2022"));
finished.append("\n"); finished.append("\n");
} }
else if(cNode.getTransitionSymbol() != "" && !item.symbol_after_dot().is_non_term() && !item.symbol_after_dot().toString().equals(cNode.getTransitionSymbol())){
irrelevantCore.append(item.toString().replace("(*)", "\u2022"));
irrelevantCore.append("\n");
}
else { else {
core.append(item.toString().replace("(*)", "\u2022")); core.append(item.toString().replace("(*)", "\u2022"));
core.append("\n"); core.append("\n");
...@@ -72,6 +77,7 @@ public class ConflictStateTooltip extends MultipleTextTooltipBase implements ITo ...@@ -72,6 +77,7 @@ public class ConflictStateTooltip extends MultipleTextTooltipBase implements ITo
setText(0,core.toString()); setText(0,core.toString());
setText(1,closure.toString()); setText(1,closure.toString());
setText(2,finished.toString()); setText(2,finished.toString());
setText(3,irrelevantCore.toString());
} }
show(); show();
} }
......
Supports Markdown
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