generic parameters

This commit is contained in:
Honfika
2013-06-01 00:22:14 +02:00
parent 81a28601da
commit 304289c0ac
124 changed files with 240 additions and 278 deletions
@@ -53,7 +53,7 @@ import java.util.Stack;
*/
public class ActionGraph extends Graph {
public ActionGraph(List code, HashMap<Integer, String> registerNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions, int version) {
public ActionGraph(List<Action> code, HashMap<Integer, String> registerNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions, int version) {
super(new ActionGraphSource(code, version, registerNames, variables, functions), new ArrayList<Integer>());
//this.version = version;
/*heads = makeGraph(code, new ArrayList<GraphPart>());
@@ -63,10 +63,10 @@ public class ActionGraph extends Graph {
}*/
}
public static List<GraphTargetItem> translateViaGraph(HashMap<Integer, String> registerNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions, List code, int version) {
public static List<GraphTargetItem> translateViaGraph(HashMap<Integer, String> registerNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions, List<Action> code, int version) {
ActionGraph g = new ActionGraph(code, registerNames, variables, functions, version);
List localData = new ArrayList();
List<Object> localData = new ArrayList<Object>();
localData.add(registerNames);
return g.translate(localData);
}
@@ -124,7 +124,7 @@ public class ActionGraph extends Graph {
}
@Override
protected List<GraphTargetItem> check(GraphSource code, List localData, List<GraphPart> allParts, Stack<GraphTargetItem> stack, GraphPart parent, GraphPart part, GraphPart stopPart, List<Loop> loops, List<GraphTargetItem> output, HashMap<Loop, List<GraphTargetItem>> forFinalCommands) {
protected List<GraphTargetItem> check(GraphSource code, List<Object> localData, List<GraphPart> allParts, Stack<GraphTargetItem> stack, GraphPart parent, GraphPart part, GraphPart stopPart, List<Loop> loops, List<GraphTargetItem> output, HashMap<Loop, List<GraphTargetItem>> forFinalCommands) {
if (!output.isEmpty()) {
if (output.get(output.size() - 1) instanceof StoreRegisterTreeItem) {
StoreRegisterTreeItem str = (StoreRegisterTreeItem) output.get(output.size() - 1);