рефакторинг объектов сапфора для подготовки к джсону
This commit is contained in:
22
.idea/workspace.xml
generated
22
.idea/workspace.xml
generated
@@ -7,18 +7,18 @@
|
|||||||
</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 afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Loops/Json/LoopsJson.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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/ComponentsServer/BugReport/BugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReport.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Common/Database/Objects/DBObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Database/Objects/DBObject.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/Json/RecipientJson.java" beforeDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Files/DBProjectFile.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Files/DBProjectFile.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/Json/RecipientsJson.java" beforeDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Messages/Message.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Messages/Message.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/Json/VisualiserSettingJson.java" beforeDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/ArrayDecl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/ArrayDecl.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/Json/VisualiserSettingsJson.java" beforeDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/FileObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/FileObject.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReportsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReportsDatabase.java" 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$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.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/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Functions/FuncParam.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Functions/FuncParam.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AddBugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AddBugReport.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/FileInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/FileInfo.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishBugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishBugReport.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Loops/Loop.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Loops/Loop.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SaveBugReportRecipients.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SaveBugReportRecipients.java" afterDir="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" />
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"ServerUserPassword": "mprit_2011",
|
"ServerUserPassword": "mprit_2011",
|
||||||
"OfferRegistrationOnStart": true,
|
"OfferRegistrationOnStart": true,
|
||||||
"Workspace": "E:\\Tests",
|
"Workspace": "E:\\Tests",
|
||||||
"ProjectsSearchDirectory": "E:\\BUG",
|
"ProjectsSearchDirectory": "E:\\SAPFOR\\Tests\\BT_inserted\\v1\\v1",
|
||||||
"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",
|
||||||
|
|||||||
@@ -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).children)
|
for (FileObjectWithMessages child : ((Loop) element).getChildren())
|
||||||
res.add(show_loop_graph_r(child));
|
res.add(show_loop_graph_r(child));
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@@ -1,18 +1,29 @@
|
|||||||
package _VisualDVM.ProjectData.Messages;
|
package _VisualDVM.ProjectData.Messages;
|
||||||
|
import Common.Database.Objects.iDBObject;
|
||||||
import Common.Passes.PassException;
|
import Common.Passes.PassException;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.Constants;
|
import _VisualDVM.Constants;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.Mode;
|
import _VisualDVM.Mode;
|
||||||
import _VisualDVM.ProjectData.SapforData.FileObject;
|
import com.google.gson.annotations.Expose;
|
||||||
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
public class Message extends FileObject {
|
public class Message extends iDBObject {
|
||||||
private static HashMap<String, String> codedMessages;
|
private static HashMap<String, String> codedMessages;
|
||||||
private static HashMap<String, String> codedMessages2;
|
private static HashMap<String, String> codedMessages2;
|
||||||
|
@Expose
|
||||||
|
@Description("DEFAULT ''")
|
||||||
|
public String file = "";
|
||||||
|
@Expose
|
||||||
|
@Description("DEFAULT 1")
|
||||||
|
public int line = 1;
|
||||||
|
@Expose
|
||||||
public int group;
|
public int group;
|
||||||
|
@Expose
|
||||||
public String group_s = "#";
|
public String group_s = "#";
|
||||||
|
@Expose
|
||||||
public String value;
|
public String value;
|
||||||
public Message() {
|
public Message() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,12 @@ package _VisualDVM.ProjectData.SapforData.Arrays;
|
|||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||||
import _VisualDVM.ProjectData.SapforData.FileObjectWithMessages;
|
import _VisualDVM.ProjectData.SapforData.FileObjectWithMessages;
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
// это то что отображается в боковом графе файла. не путать с сапфоровским ProjectArray
|
// это то что отображается в боковом графе файла. не путать с сапфоровским ProjectArray
|
||||||
public class ArrayDecl extends FileObjectWithMessages {
|
public class ArrayDecl extends FileObjectWithMessages {
|
||||||
|
@Expose
|
||||||
public String array_name;
|
public String array_name;
|
||||||
|
@Expose
|
||||||
public ArrayLocation array_loc;
|
public ArrayLocation array_loc;
|
||||||
public ArrayDecl(String array_name_in, ArrayLocation array_loc_in, DBProjectFile father_in, int lineNum_in) {
|
public ArrayDecl(String array_name_in, ArrayLocation array_loc_in, DBProjectFile father_in, int lineNum_in) {
|
||||||
super(father_in, lineNum_in);
|
super(father_in, lineNum_in);
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
package _VisualDVM.ProjectData.SapforData;
|
package _VisualDVM.ProjectData.SapforData;
|
||||||
import Common.Database.Objects.iDBObject;
|
import Common.Database.Objects.iDBObject;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
|
import Common.Visual.Selectable;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
//объект принадлежащий файлу и относящийся к его строке.
|
//объект принадлежащий файлу и относящийся к его строке.
|
||||||
public abstract class FileObject extends iDBObject {
|
public class FileObject implements Selectable {
|
||||||
|
@Expose
|
||||||
@Description("DEFAULT ''")
|
@Description("DEFAULT ''")
|
||||||
public String file = "";
|
public String file = "";
|
||||||
|
@Expose
|
||||||
@Description("DEFAULT 1")
|
@Description("DEFAULT 1")
|
||||||
public int line = 1;
|
public int line = 1;
|
||||||
public FileObject() {
|
public FileObject() {
|
||||||
@@ -15,14 +19,25 @@ public abstract class FileObject extends iDBObject {
|
|||||||
public FileObject(String file_in) {
|
public FileObject(String file_in) {
|
||||||
file = file_in;
|
file = file_in;
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public String getSelectionText() {
|
|
||||||
return "файл " + Utils_.Brackets(file) + " строка: " + line;
|
|
||||||
}
|
|
||||||
public DBProjectFile getFather() {
|
public DBProjectFile getFather() {
|
||||||
return Global.mainModule.getProject().db.files.Data.get(file);
|
return Global.mainModule.getProject().db.files.Data.get(file);
|
||||||
}
|
}
|
||||||
public void Show(boolean focus) {
|
public void Show(boolean focus) {
|
||||||
Global.mainModule.getUI().getMainWindow().getProjectWindow().GotoFile(file, line, focus);
|
Global.mainModule.getUI().getMainWindow().getProjectWindow().GotoFile(file, line, focus);
|
||||||
}
|
}
|
||||||
|
//Selectable----
|
||||||
|
@Description("IGNORE")
|
||||||
|
boolean selected=false;
|
||||||
|
public String getSelectionText() {
|
||||||
|
return "файл " + Utils_.Brackets(file) + " строка: " + line;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean isSelected() {
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void select(boolean flag) {
|
||||||
|
selected = flag;
|
||||||
|
}
|
||||||
|
//-------
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,41 @@
|
|||||||
package _VisualDVM.ProjectData.SapforData.Functions;
|
package _VisualDVM.ProjectData.SapforData.Functions;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
|
import Common.Visual.Selectable;
|
||||||
import Common.Visual.UI;
|
import Common.Visual.UI;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||||
import _VisualDVM.ProjectData.SapforData.FileObjectWithMessages;
|
import _VisualDVM.ProjectData.SapforData.FileObjectWithMessages;
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
public class FuncCall extends FileObjectWithMessages{
|
public class FuncCall extends FileObjectWithMessages{
|
||||||
|
@Description("IGNORE")
|
||||||
|
private boolean selected = false;
|
||||||
|
@Expose
|
||||||
public String funcName = ""; //не нужны дополнительные поля.имя функции это уже ключ.
|
public String funcName = ""; //не нужны дополнительные поля.имя функции это уже ключ.
|
||||||
|
@Expose
|
||||||
public boolean canBeInlined = false;
|
public boolean canBeInlined = false;
|
||||||
|
@Expose
|
||||||
public int parent_offset = 0;
|
public int parent_offset = 0;
|
||||||
|
//---
|
||||||
public FuncCall(DBProjectFile father_in, String funcName_in, int line_in) {
|
public FuncCall(DBProjectFile father_in, String funcName_in, int line_in) {
|
||||||
super(father_in, line_in);
|
super(father_in, line_in);
|
||||||
funcName = funcName_in;
|
funcName = funcName_in;
|
||||||
}
|
}
|
||||||
public FuncCall() {
|
public FuncCall() {
|
||||||
}
|
}
|
||||||
|
//selectable
|
||||||
@Override
|
@Override
|
||||||
public String getSelectionText() {
|
public String Description() {
|
||||||
return "вызов в строке " + line;
|
return "вызов " + Utils_.Brackets(funcName);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean isSelectionEnabled() {
|
public boolean isSelectionEnabled() {
|
||||||
return canBeInlined;
|
return canBeInlined;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String Description() {
|
public String getSelectionText() {
|
||||||
return "вызов " + Utils_.Brackets(funcName);
|
return "вызов в строке " + line;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void Select(boolean flag) {
|
public void Select(boolean flag) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import Common.Utils.Index;
|
|||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||||
import _VisualDVM.ProjectData.SapforData.FileObjectWithMessages;
|
import _VisualDVM.ProjectData.SapforData.FileObjectWithMessages;
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
import com.mxgraph.model.mxCell;
|
import com.mxgraph.model.mxCell;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
@@ -10,12 +11,19 @@ import java.util.LinkedHashMap;
|
|||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class FuncInfo extends FileObjectWithMessages {
|
public class FuncInfo extends FileObjectWithMessages {
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
|
@Expose
|
||||||
public int lineEnd;
|
public int lineEnd;
|
||||||
|
@Expose
|
||||||
public String funcName;
|
public String funcName;
|
||||||
|
@Expose
|
||||||
public FunctionType type;
|
public FunctionType type;
|
||||||
|
@Expose
|
||||||
public boolean doNotInline;
|
public boolean doNotInline;
|
||||||
|
@Expose
|
||||||
public boolean doNotAnalyze;
|
public boolean doNotAnalyze;
|
||||||
|
@Expose
|
||||||
public boolean needToInline;
|
public boolean needToInline;
|
||||||
|
@Expose
|
||||||
public FuncParam parameters;
|
public FuncParam parameters;
|
||||||
//вызовы функций в теле этой функции
|
//вызовы функций в теле этой функции
|
||||||
public Vector<FuncCall> calls = new Vector<>();
|
public Vector<FuncCall> calls = new Vector<>();
|
||||||
@@ -66,7 +74,6 @@ public class FuncInfo extends FileObjectWithMessages {
|
|||||||
public ImageIcon GetDisabledIcon() {
|
public ImageIcon GetDisabledIcon() {
|
||||||
return Utils_.getIcon("/icons/Function.png");
|
return Utils_.getIcon("/icons/Function.png");
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public void SelectAllChildren(boolean select) {
|
public void SelectAllChildren(boolean select) {
|
||||||
for (String file_name : own_calls.keySet())
|
for (String file_name : own_calls.keySet())
|
||||||
for (FuncCall fc : own_calls.get(file_name))
|
for (FuncCall fc : own_calls.get(file_name))
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
package _VisualDVM.ProjectData.SapforData.Functions;
|
package _VisualDVM.ProjectData.SapforData.Functions;
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class FuncParam {
|
public class FuncParam {
|
||||||
static final int IN_BIT = 16;
|
static final int IN_BIT = 16;
|
||||||
static final int OUT_BIT = 256;
|
static final int OUT_BIT = 256;
|
||||||
|
@Expose
|
||||||
Vector<Integer> inout_types;
|
Vector<Integer> inout_types;
|
||||||
|
@Expose
|
||||||
Vector<String> identificators;
|
Vector<String> identificators;
|
||||||
|
@Expose
|
||||||
Vector<String> parametersT;
|
Vector<String> parametersT;
|
||||||
|
@Expose
|
||||||
int countOfPars;
|
int countOfPars;
|
||||||
public FuncParam() {
|
public FuncParam() {
|
||||||
countOfPars = 0;
|
countOfPars = 0;
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
package _VisualDVM.ProjectData.SapforData.Includes;
|
package _VisualDVM.ProjectData.SapforData.Includes;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.ProjectData.SapforData.FileObject;
|
import _VisualDVM.ProjectData.SapforData.FileObject;
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class FileInfo extends FileObject {
|
public class FileInfo extends FileObject {
|
||||||
public Vector<DependencyInfo> dependencies = new Vector<>();
|
@Expose
|
||||||
|
public List<DependencyInfo> dependencies = new Vector<>();
|
||||||
public FileInfo(String file_in) {
|
public FileInfo(String file_in) {
|
||||||
super(file_in);
|
super(file_in);
|
||||||
}
|
}
|
||||||
@@ -13,15 +16,12 @@ public class FileInfo extends FileObject {
|
|||||||
public String getSelectionText() {
|
public String getSelectionText() {
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public boolean isSelectionEnabled() {
|
public boolean isSelectionEnabled() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public ImageIcon GetDisabledIcon() {
|
public ImageIcon GetDisabledIcon() {
|
||||||
return Utils_.getIcon("/Common/icons/File.png");
|
return Utils_.getIcon("/Common/icons/File.png");
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public void SelectAllChildren(boolean select) {
|
public void SelectAllChildren(boolean select) {
|
||||||
for (DependencyInfo di : dependencies)
|
for (DependencyInfo di : dependencies)
|
||||||
di.Select(select);
|
di.Select(select);
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package _VisualDVM.ProjectData.SapforData.Loops.Json;
|
||||||
|
import _VisualDVM.ProjectData.SapforData.Loops.Loop;
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Vector;
|
||||||
|
public class LoopsJson {
|
||||||
|
@Expose
|
||||||
|
public List<Loop> values= new Vector<>();
|
||||||
|
}
|
||||||
@@ -5,25 +5,60 @@ import _VisualDVM.ProjectData.Files.DBProjectFile;
|
|||||||
import _VisualDVM.ProjectData.Messages.Message;
|
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 java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class Loop extends FileObjectWithMessages {
|
public class Loop extends FileObjectWithMessages {
|
||||||
|
@Expose
|
||||||
private final int lineNumAfterLoop;
|
private final int lineNumAfterLoop;
|
||||||
|
@Expose
|
||||||
private final int perfectLoop;
|
private final int perfectLoop;
|
||||||
|
@Expose
|
||||||
private final boolean hasOutGoto;
|
private final boolean hasOutGoto;
|
||||||
|
@Expose
|
||||||
private final boolean hasPrints;
|
private final boolean hasPrints;
|
||||||
|
@Expose
|
||||||
private final boolean hasNonRectIters;
|
private final boolean hasNonRectIters;
|
||||||
//
|
//
|
||||||
|
@Expose
|
||||||
private final int childCount;
|
private final int childCount;
|
||||||
|
@Expose
|
||||||
public LoopState loopState;
|
public LoopState loopState;
|
||||||
public Vector<FileObjectWithMessages> children = new Vector<>();
|
//---
|
||||||
|
@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<>();
|
||||||
|
//--
|
||||||
|
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 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()]);//+
|
||||||
for (int k = 0; k < calls; ++k) {
|
for (int k = 0; k < calls; ++k) {
|
||||||
String c_name = packedLoopInfo[idx.Inc()];
|
String c_name = packedLoopInfo[idx.Inc()];
|
||||||
int c_line = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
int c_line = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||||
children.add(new FuncCall(father_in, c_name, c_line));
|
func_calls.add(new FuncCall(father_in, c_name, c_line));
|
||||||
}
|
}
|
||||||
line = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
line = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||||
lineNumAfterLoop = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
lineNumAfterLoop = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||||
@@ -43,38 +78,38 @@ public class Loop extends FileObjectWithMessages {
|
|||||||
loopState = LoopState.Loop;
|
loopState = LoopState.Loop;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
hasNonRectIters = (Integer.parseInt(packedLoopInfo[idx.Inc()]) == 1);
|
hasNonRectIters = (Integer.parseInt(packedLoopInfo[idx.Inc()]) == 1); //+
|
||||||
if (hasNonRectIters)
|
if (hasNonRectIters)
|
||||||
children.add(new NonRectIter(father_in, line));
|
non_rect_iters.add(new NonRectIter(father_in, line));
|
||||||
////-------------------------------------------------------------------------------
|
////-------------------------------------------------------------------------------
|
||||||
// число внешних переходов
|
// число внешних переходов
|
||||||
int e_gotos = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
int e_gotos_size = Integer.parseInt(packedLoopInfo[idx.Inc()]); //+
|
||||||
for (int k = 0; k < e_gotos; ++k) {
|
for (int k = 0; k < e_gotos_size; ++k) {
|
||||||
int c_line = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
int c_line = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||||
children.add(new EGoto(father_in, c_line));
|
e_gotos.add(new EGoto(father_in, c_line));
|
||||||
}
|
}
|
||||||
//число внутренних переходов
|
//число внутренних переходов
|
||||||
int i_gotos = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
int i_gotos_size = Integer.parseInt(packedLoopInfo[idx.Inc()]); //+
|
||||||
for (int k = 0; k < i_gotos; ++k) {
|
for (int k = 0; k < i_gotos_size; ++k) {
|
||||||
int c_line = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
int c_line = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||||
children.add(new IGoto(father_in, c_line));
|
i_gotos.add(new IGoto(father_in, c_line));
|
||||||
}
|
}
|
||||||
//число операторов печати
|
//число операторов печати
|
||||||
int IO = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
int IOs_size = Integer.parseInt(packedLoopInfo[idx.Inc()]); //+
|
||||||
for (int k = 0; k < IO; ++k) {
|
for (int k = 0; k < IOs_size; ++k) {
|
||||||
int c_line = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
int c_line = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||||
children.add(new IO(father_in, c_line));
|
ios.add(new IO(father_in, c_line));
|
||||||
}
|
}
|
||||||
//число операторов останова (STOPб PAUSE)
|
//число операторов останова (STOPб PAUSE)
|
||||||
int stop = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
int stops_size = Integer.parseInt(packedLoopInfo[idx.Inc()]); //++
|
||||||
for (int k = 0; k < stop; ++k) {
|
for (int k = 0; k < stops_size; ++k) {
|
||||||
int c_line = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
int c_line = Integer.parseInt(packedLoopInfo[idx.Inc()]);
|
||||||
children.add(new Stop(father_in, c_line));
|
stops.add(new Stop(father_in, c_line));
|
||||||
}
|
}
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
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);
|
||||||
children.add(nextChild);
|
loops.add(nextChild);
|
||||||
}
|
}
|
||||||
father_in.AllLoops.put(line, this);
|
father_in.AllLoops.put(line, this);
|
||||||
//нельзя использовать конструктор с параметрами из за особеностей распаковки.
|
//нельзя использовать конструктор с параметрами из за особеностей распаковки.
|
||||||
|
|||||||
Reference in New Issue
Block a user