переименование/лишние поля

This commit is contained in:
2025-03-30 15:30:38 +03:00
parent 18227f565a
commit cc21931ebe
6 changed files with 39 additions and 77 deletions

View File

@@ -1,41 +0,0 @@
package _VisualDVM.ProjectData.SapforData.Loops.Json;
import _VisualDVM.ProjectData.SapforData.Functions.FuncCall;
import _VisualDVM.ProjectData.SapforData.Loops.*;
import com.google.gson.annotations.Expose;
import java.util.List;
import java.util.Vector;
public class LoopJson {
@Expose
String file;
@Expose
int line;
@Expose
int lineNumAfterLoop;
@Expose
int perfectLoop;
@Expose
int hasOutGoto;
@Expose
int hasPrints;
@Expose
int hasNonRectIters;
@Expose
int childCount;
@Expose
public LoopState loopState;
@Expose
public List<FuncCall> func_calls = new Vector<>();
@Expose
public List<NonRectIter> non_rect_iters = new Vector<>();
@Expose
public List<EGoto> e_gotos = new Vector<>();
@Expose
public List<IGoto> i_gotos = new Vector<>();
@Expose
public List<IO> ios = new Vector<>();
@Expose
public List<Stop> stops = new Vector<>();
@Expose
public List<Loop> loops = new Vector<>();
}

View File

@@ -6,26 +6,15 @@ import _VisualDVM.ProjectData.Messages.Message;
import _VisualDVM.ProjectData.SapforData.FileObjectWithMessages;
import _VisualDVM.ProjectData.SapforData.Functions.FuncCall;
import com.google.gson.annotations.Expose;
import com.sun.org.glassfish.gmbal.Description;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Vector;
public class Loop extends FileObjectWithMessages {
//public String file = "";
//public int line = 1;
@Expose
private final int lineNumAfterLoop;
private int lineNumAfterLoop;
@Expose
private final int perfectLoop;
@Expose
private final int hasOutGoto;
@Expose
private final int hasPrints;
@Expose
private final int hasNonRectIters;
@Expose
private final int childCount;
private int perfectLoop;
@Expose
public LoopState loopState;
//---
@@ -42,20 +31,21 @@ public class Loop extends FileObjectWithMessages {
@Expose
public List<Stop> stops = new Vector<>();
@Expose
public List<Loop> loops = new Vector<>();
public List<Loop> children = new Vector<>();
//--
public List<FileObjectWithMessages> getChildren(){
List<FileObjectWithMessages> children = new Vector<>();
children.addAll(func_calls);
children.addAll(non_rect_iters);
children.addAll(e_gotos);
children.addAll(i_gotos);
children.addAll(ios);
children.addAll(stops);
children.addAll(loops);
return children;
public List<FileObjectWithMessages> getAllChildren(){
List<FileObjectWithMessages> all_children = new Vector<>();
all_children.addAll(func_calls);
all_children.addAll(non_rect_iters);
all_children.addAll(e_gotos);
all_children.addAll(i_gotos);
all_children.addAll(ios);
all_children.addAll(stops);
all_children.addAll(children);
return all_children;
}
/*
public Loop(String[] packedLoopInfo, Index idx, DBProjectFile father_in) {
file = father_in.name;
int calls = Integer.parseInt(packedLoopInfo[idx.Inc()]);//+
@@ -82,8 +72,8 @@ public class Loop extends FileObjectWithMessages {
loopState = LoopState.Loop;
break;
}
hasNonRectIters = Integer.parseInt(packedLoopInfo[idx.Inc()]); //+
if (hasNonRectIters==1)
hasNonRectangularBounds = Integer.parseInt(packedLoopInfo[idx.Inc()]); //+
if (hasNonRectangularBounds ==1)
non_rect_iters.add(new NonRectIter(father_in, line));
////-------------------------------------------------------------------------------
// число внешних переходов
@@ -113,12 +103,13 @@ public class Loop extends FileObjectWithMessages {
//--------------------------------------------------------------------------------
for (int i = 0; i < childCount; ++i) {
Loop nextChild = new Loop(packedLoopInfo, idx, father_in);
loops.add(nextChild);
children.add(nextChild);
}
father_in.AllLoops.put(line, this);
//нельзя использовать конструктор с параметрами из за особеностей распаковки.
CheckMessagesPresence();
}
*/
@Override
public String TypeKey() {
return loopState.toString();
@@ -141,7 +132,7 @@ public class Loop extends FileObjectWithMessages {
}
public void toMap_r(LinkedHashMap<Integer, Loop> loops_map){
loops_map.put(line, this);
for (Loop loop: loops)
for (Loop loop: children)
loop.toMap_r(loops_map);
}
}