Commit f314f1e1 authored by Michael Schwarz's avatar Michael Schwarz

ReduceReduce reorder working

parent 16caeb32
...@@ -4,6 +4,7 @@ import java.io.IOException; ...@@ -4,6 +4,7 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;
...@@ -37,6 +38,8 @@ import org.eclipse.swt.widgets.Shell; ...@@ -37,6 +38,8 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.IFileEditorInput;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils.Collections;
import de.in.tum.www2.cup.Conflict; import de.in.tum.www2.cup.Conflict;
import de.in.tum.www2.cup.ConflictResolutionManager; import de.in.tum.www2.cup.ConflictResolutionManager;
import de.in.tum.www2.cup.LALRResult; import de.in.tum.www2.cup.LALRResult;
...@@ -563,7 +566,8 @@ public class CupConflictsView extends FailableView ...@@ -563,7 +566,8 @@ public class CupConflictsView extends FailableView
private void applyConnectedResolutionRR() { private void applyConnectedResolutionRR() {
try { try {
ReordersToDo rtd = (ReordersToDo) currentResolution; ReordersToDo rtd = (ReordersToDo) currentResolution;
List<lr_item_core> order = rtd.getItemsOrdered(); LinkedList<lr_item_core> order = rtd.getItemsOrdered();
java.util.Collections.reverse(order);
ReduceReduceReorder rrr = new ReduceReduceReorder(editor.getDocument(),isThresholdPresent()); ReduceReduceReorder rrr = new ReduceReduceReorder(editor.getDocument(),isThresholdPresent());
for(lr_item_core item : order){ for(lr_item_core item : order){
......
...@@ -185,7 +185,7 @@ public class ReordersToDo extends GraphHelper<lr_item_core> implements Resolutio ...@@ -185,7 +185,7 @@ public class ReordersToDo extends GraphHelper<lr_item_core> implements Resolutio
} }
} }
public List<lr_item_core> getItemsOrdered() throws OrderCyclicException{ public LinkedList<lr_item_core> getItemsOrdered() throws OrderCyclicException{
if(!isAcyclic()){ if(!isAcyclic()){
throw new OrderCyclicException("",cycle); throw new OrderCyclicException("",cycle);
} }
......
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