версия под джсон. в графе циклов временно закоммичена старая распаковка
This commit is contained in:
@@ -9,10 +9,8 @@ import com.sun.org.glassfish.gmbal.Description;
|
||||
//объект принадлежащий файлу и относящийся к его строке.
|
||||
public class FileObject implements Selectable {
|
||||
@Expose
|
||||
@Description("DEFAULT ''")
|
||||
public String file = "";
|
||||
@Expose
|
||||
@Description("DEFAULT 1")
|
||||
public int line = 1;
|
||||
public FileObject() {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
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<>();
|
||||
}
|
||||
@@ -6,5 +6,5 @@ import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class LoopsJson {
|
||||
@Expose
|
||||
public List<Loop> values= new Vector<>();
|
||||
public List<Loop> values = new Vector<>();
|
||||
}
|
||||
|
||||
@@ -6,21 +6,24 @@ 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;
|
||||
@Expose
|
||||
private final int perfectLoop;
|
||||
@Expose
|
||||
private final boolean hasOutGoto;
|
||||
private final int hasOutGoto;
|
||||
@Expose
|
||||
private final boolean hasPrints;
|
||||
private final int hasPrints;
|
||||
@Expose
|
||||
private final boolean hasNonRectIters;
|
||||
//
|
||||
private final int hasNonRectIters;
|
||||
@Expose
|
||||
private final int childCount;
|
||||
@Expose
|
||||
@@ -52,6 +55,7 @@ public class Loop extends FileObjectWithMessages {
|
||||
children.addAll(loops);
|
||||
return children;
|
||||
}
|
||||
|
||||
public Loop(String[] packedLoopInfo, Index idx, DBProjectFile father_in) {
|
||||
file = father_in.name;
|
||||
int calls = Integer.parseInt(packedLoopInfo[idx.Inc()]);//+
|
||||
@@ -63,8 +67,8 @@ public class Loop extends FileObjectWithMessages {
|
||||
line = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||
lineNumAfterLoop = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||
perfectLoop = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||
hasOutGoto = (Integer.parseInt(packedLoopInfo[idx.Inc()]) == 1);
|
||||
hasPrints = (Integer.parseInt(packedLoopInfo[idx.Inc()]) == 1);
|
||||
hasOutGoto = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||
hasPrints = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||
childCount = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||
int state = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||
switch (state) {
|
||||
@@ -78,8 +82,8 @@ public class Loop extends FileObjectWithMessages {
|
||||
loopState = LoopState.Loop;
|
||||
break;
|
||||
}
|
||||
hasNonRectIters = (Integer.parseInt(packedLoopInfo[idx.Inc()]) == 1); //+
|
||||
if (hasNonRectIters)
|
||||
hasNonRectIters = Integer.parseInt(packedLoopInfo[idx.Inc()]); //+
|
||||
if (hasNonRectIters==1)
|
||||
non_rect_iters.add(new NonRectIter(father_in, line));
|
||||
////-------------------------------------------------------------------------------
|
||||
// число внешних переходов
|
||||
@@ -135,4 +139,9 @@ public class Loop extends FileObjectWithMessages {
|
||||
public VisualiserFonts getFont() {
|
||||
return loopState.getFont();
|
||||
}
|
||||
public void toMap_r(LinkedHashMap<Integer, Loop> loops_map){
|
||||
loops_map.put(line, this);
|
||||
for (Loop loop: loops)
|
||||
loop.toMap_r(loops_map);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user