Commit 42e5f1d1 authored by Michael Schwarz's avatar Michael Schwarz

Reduce Reduce single also special case of connected

parent 4d5ce9e8
......@@ -653,18 +653,12 @@ class ConflictPanel extends Composite {
lr_item_core item2 = new lr_item_core(rrc.getConflictItem2().the_production(),rrc.getConflictItem2().dot_pos());
if(!cupConflictsView.settingOrderAffetsOtherConflicts(item1, item2)){
ReduceReduceReorder rrr = new ReduceReduceReorder(cupConflictsView.getDocument());
if(resolutionOptions.getSelectionIndex() == 1){
rrr.moveItemToVeryEnd(rrc.getConflictItem1());
rrr.moveItemToVeryEnd(rrc.getConflictItem2());
cupConflictsView.insertSingleOrder(item1, item2);
}
else if(resolutionOptions.getSelectionIndex() == 2){
rrr.moveItemToVeryEnd(rrc.getConflictItem2());
rrr.moveItemToVeryEnd(rrc.getConflictItem1());
cupConflictsView.insertSingleOrder(item2, item1);
}
rrr.apply();
}
else {
cupConflictsView.beginConnectedResolutionRR();
......@@ -708,7 +702,6 @@ class ConflictPanel extends Composite {
try {
resolutionButtonRRClick();
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
......
......@@ -565,6 +565,16 @@ public class CupConflictsView extends FailableView
pti.setAssoc(terminal, assoc);
pti.apply(editor.getDocument());
}
void insertSingleOrder(lr_item_core higher,lr_item_core lower){
try {
ReordersToDo rtd = new ReordersToDo();
rtd.insertOrder(higher, lower);
rtd.apply(editor.getDocument());
} catch (OrderCyclicException e) {
e.printStackTrace();
}
}
boolean insertingPrecAffectsOtherConflicts(terminal t) {
Integer affected = terminalsAffectConflicts.get(t);
......
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