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

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

8
.idea/workspace.xml generated
View File

@@ -7,10 +7,10 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment=""> <list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Project/db_project_info.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Project/db_project_info.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Functions/FuncCall.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Functions/FuncCall.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Functions/FuncCallH.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Functions/FuncCallH.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetGraphLoops.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetGraphLoops.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Functions/FuncInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Functions/FuncInfo.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Loops/Json/LoopJson.java" beforeDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@@ -4,7 +4,7 @@
"ServerUserPassword": "mprit_2011", "ServerUserPassword": "mprit_2011",
"OfferRegistrationOnStart": true, "OfferRegistrationOnStart": true,
"Workspace": "E:\\Tests", "Workspace": "E:\\Tests",
"ProjectsSearchDirectory": "E:\\SAPFOR\\Tests\\BT_inserted\\v1\\v1", "ProjectsSearchDirectory": "E:\\BUG",
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system", "DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
"VisualiserPath": "C:\\Users\\misha\\Downloads", "VisualiserPath": "C:\\Users\\misha\\Downloads",
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F", "Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",

View File

@@ -6,7 +6,9 @@ import _VisualDVM.Passes.Sapfor.SapforAnalysis;
import _VisualDVM.ProjectData.Files.DBProjectFile; import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.SapforData.Loops.Json.LoopsJson; import _VisualDVM.ProjectData.SapforData.Loops.Json.LoopsJson;
import _VisualDVM.ProjectData.SapforData.Loops.Loop; import _VisualDVM.ProjectData.SapforData.Loops.Loop;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.Vector; import java.util.Vector;
public class SPF_GetGraphLoops extends SapforAnalysis { public class SPF_GetGraphLoops extends SapforAnalysis {
@Override @Override
@@ -38,8 +40,8 @@ public class SPF_GetGraphLoops extends SapforAnalysis {
} }
@Override @Override
protected void unpack(String packed) throws Exception { protected void unpack(String packed) throws Exception {
/*
//System.out.println(Utils_.Brackets(packed)); //System.out.println(Utils_.Brackets(packed));
/*old
Vector<String> done_programs = new Vector<>(); Vector<String> done_programs = new Vector<>();
String[] splitedPackedGraph = packed.split("\\|"); String[] splitedPackedGraph = packed.split("\\|");
for (int i = 0; i < splitedPackedGraph.length; i += 2) { for (int i = 0; i < splitedPackedGraph.length; i += 2) {
@@ -59,8 +61,17 @@ public class SPF_GetGraphLoops extends SapforAnalysis {
} }
} }
target.UpdateLoopsCount(); target.UpdateLoopsCount();
//--
*/ */
//--
/*
LoopsJson loopsJson = new LoopsJson();
for (String pname: done_programs){
loopsJson.values.addAll(target.db.files.get(pname).AllLoops.values());
}
File debug = new File(Global.TempDirectory, "loops_json.txt");
FileUtils.writeStringToFile(debug,Utils_.gson.toJson(loopsJson));
*/
/*
int allLoops=0; int allLoops=0;
Vector<String> loops_programs = new Vector<>(); Vector<String> loops_programs = new Vector<>();
System.out.println("packed_loops = "+Utils_.Brackets(packed)); System.out.println("packed_loops = "+Utils_.Brackets(packed));
@@ -79,6 +90,7 @@ public class SPF_GetGraphLoops extends SapforAnalysis {
program.LoopGraphTitle = "Всего циклов: " + program.AllLoops.size(); program.LoopGraphTitle = "Всего циклов: " + program.AllLoops.size();
target.numLoops += program.AllLoops.size(); target.numLoops += program.AllLoops.size();
} }
*/
} }
@Override @Override
protected void FocusResult() { protected void FocusResult() {

View File

@@ -258,7 +258,7 @@ public class DBProjectFile extends ProjectFile {
public DefaultMutableTreeNode show_loop_graph_r(FileObjectWithMessages element) { public DefaultMutableTreeNode show_loop_graph_r(FileObjectWithMessages element) {
DefaultMutableTreeNode res = new DefaultMutableTreeNode(element); DefaultMutableTreeNode res = new DefaultMutableTreeNode(element);
if (element instanceof Loop) { if (element instanceof Loop) {
for (FileObjectWithMessages child : ((Loop) element).getChildren()) for (FileObjectWithMessages child : ((Loop) element).getAllChildren())
res.add(show_loop_graph_r(child)); res.add(show_loop_graph_r(child));
} }
return res; return res;

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