Commit d9adc3be authored by Johannes Roith's avatar Johannes Roith

Show "under symbol".

parent a2c39ac1
......@@ -12,6 +12,10 @@ public class ShiftReduceConflict extends Conflict
private List<lalr_item> conflict2;
private terminal terminal; // TODO: change to Terminal. Requires link in terminal class
public terminal getTerminal() {
return terminal;
}
public lalr_item getConflictItem1() {
return conflict1;
}
......
......@@ -58,6 +58,7 @@ public class CupConflictsView implements ICupEditorPageVisibility,
private Label conflictTypeLabel;
private Label stateLabel;
private Label symbolLabel;
private Link detailText;
private List<Range> links = new ArrayList<Range>();
......@@ -72,15 +73,19 @@ public class CupConflictsView implements ICupEditorPageVisibility,
setBackground(new Color(Display.getCurrent(), Colors.lightGray));
TableWrapLayout layout = new TableWrapLayout();
layout.numColumns = 2;
layout.verticalSpacing = 3;
layout.numColumns = 3;
layout.verticalSpacing = 8;
setLayout(layout);
this.conflictTypeLabel = new Label(this, SWT.NONE);
FontData[] fD = conflictTypeLabel.getFont().getFontData();
fD[0].setHeight(14);
conflictTypeLabel.setFont( new Font(Display.getCurrent(),fD[0]));
this.stateLabel = new Label(this, SWT.NONE);
this.symbolLabel = new Label(this, SWT.NONE);
this.detailText = new Link(this, SWT.WRAP);
this.detailText.setBackground(new Color(Display.getCurrent(),
Colors.lightGray));
......@@ -105,6 +110,7 @@ public class CupConflictsView implements ICupEditorPageVisibility,
if (conflict instanceof ReduceReduceConflict) {
conflictTypeLabel.setText("Reduce-Reduce conflict");
detailText.setText("");
symbolLabel.setText("");
// TODO!
} else if (conflict instanceof ShiftReduceConflict) {
......@@ -112,6 +118,8 @@ public class CupConflictsView implements ICupEditorPageVisibility,
conflictTypeLabel.setText("Shift-Reduce conflict");
symbolLabel.setText("Under symbol: " + src.getTerminal().name());
ProductionRight conflict1Ast = src.getConflictItem1()
.the_production().getAstNode();
......@@ -119,7 +127,7 @@ public class CupConflictsView implements ICupEditorPageVisibility,
int linkCounter = 0;
StringBuilder builder = new StringBuilder();
builder.append("Conflict between ");
builder.append("between ");
if (conflict1Ast != null) {
builder.append("<a href=\"" + linkCounter++ + "\">");
links.add(conflict1Ast.getRange());
......
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