граф циклов в джсоне

This commit is contained in:
2025-03-31 22:12:04 +03:00
parent 76c710b1bc
commit c6d2452530
4 changed files with 20 additions and 15 deletions

View File

@@ -25,6 +25,7 @@ import java.io.IOException;
import java.io.PrintStream;
import java.nio.file.Paths;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Vector;
//по файлам нет смысла делать совместимость.
//так что переименую
@@ -474,9 +475,15 @@ public class DBProjectFile extends ProjectFile {
return res;
}
//---
public void saveAllLoops(){
public void saveLoops(List<Loop> loopNests_in){
AllLoops.clear();
LoopNests.clear();
//--
LoopNests.addAll(loopNests_in);
for (Loop loop: LoopNests){
loop.setFile(this.name);
loop.toMap_r(AllLoops);
}
LoopGraphTitle = "Всего циклов: " +AllLoops.size();
}
}

View File

@@ -29,10 +29,6 @@ public class Loop extends FileObjectWithMessages {
}
}
//---
@Expose
public List<FuncCall> funcCalls = new Vector<>();
// @Expose
// public List<NonRectIter> non_rect_iters = new Vector<>();
@Expose
public List<Integer> extGotos = new Vector<>();
@Expose
@@ -41,6 +37,9 @@ public class Loop extends FileObjectWithMessages {
public List<Integer> ios = new Vector<>();
@Expose
public List<Integer> stops = new Vector<>();
//--
@Expose
public List<FuncCall> funcCalls = new Vector<>();
@Expose
public List<Loop> children = new Vector<>();
//--
@@ -89,4 +88,12 @@ public class Loop extends FileObjectWithMessages {
for (Loop loop: children)
loop.toMap_r(loops_map);
}
@Override
public void setFile(String file_in) {
super.setFile(file_in);
for (FuncCall funcCall: funcCalls)
funcCall.setFile(file_in);
for (Loop child: children)
child.setFile(file_in);
}
}