Перевод объявлений массивов в json
This commit is contained in:
5
.idea/workspace.xml
generated
5
.idea/workspace.xml
generated
@@ -7,9 +7,12 @@
|
|||||||
</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/Arrays/ArraysJson.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/ProjectData/SapforData/Arrays/ArrayDecl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/ArrayDecl.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetAllDeclaratedArrays.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetAllDeclaratedArrays.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/ProjectArray.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/ProjectArray.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/ProjectArray.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/ProjectArray.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/FileObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/FileObject.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" />
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
"FortranWrapsOn": false,
|
"FortranWrapsOn": false,
|
||||||
"ExtensionsOn": false,
|
"ExtensionsOn": false,
|
||||||
"ComparsionDiffMergeOn": true,
|
"ComparsionDiffMergeOn": true,
|
||||||
"ShowFullArraysDeclarations": false,
|
"ShowFullArraysDeclarations": true,
|
||||||
"ShowFullTabsNames": true,
|
"ShowFullTabsNames": true,
|
||||||
"SmallScreen": false,
|
"SmallScreen": false,
|
||||||
"BugReportsAgeLimit": 1,
|
"BugReportsAgeLimit": 1,
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
package _VisualDVM.Passes.All;
|
package _VisualDVM.Passes.All;
|
||||||
import Common.Utils.Index;
|
import Common.Utils.Index;
|
||||||
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||||
|
import _VisualDVM.ProjectData.SapforData.Arrays.ArraysJson;
|
||||||
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
|
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
|
||||||
|
|
||||||
|
import javax.rmi.CORBA.Util;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
public class SPF_GetAllDeclaratedArrays extends SapforAnalysis {
|
public class SPF_GetAllDeclaratedArrays extends SapforAnalysis {
|
||||||
@Override
|
@Override
|
||||||
@@ -26,6 +29,18 @@ public class SPF_GetAllDeclaratedArrays extends SapforAnalysis {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void unpack(String packed) throws Exception {
|
public void unpack(String packed) throws Exception {
|
||||||
|
System.out.println("packed="+ Utils_.Brackets(packed));
|
||||||
|
ArraysJson arraysJson = Utils_.gson.fromJson(packed, ArraysJson.class);
|
||||||
|
System.out.println("size="+arraysJson.allArrays.size());
|
||||||
|
for (ProjectArray array: arraysJson.allArrays){
|
||||||
|
array.Init();
|
||||||
|
target.declaratedArrays.put(array.id, array);
|
||||||
|
array.print();
|
||||||
|
}
|
||||||
|
for (DBProjectFile file : target.db.files.Data.values())
|
||||||
|
file.ArrayGraphTitle = "Объявлений: " + file.array_decls.size();
|
||||||
|
target.UpdateArraysCount();
|
||||||
|
/*
|
||||||
if (packed.toCharArray()[packed.length() - 1] == '\0')
|
if (packed.toCharArray()[packed.length() - 1] == '\0')
|
||||||
packed = packed.substring(packed.length() - 1);
|
packed = packed.substring(packed.length() - 1);
|
||||||
if (packed.length() == 0)
|
if (packed.length() == 0)
|
||||||
@@ -42,6 +57,7 @@ public class SPF_GetAllDeclaratedArrays extends SapforAnalysis {
|
|||||||
for (DBProjectFile file : target.db.files.Data.values())
|
for (DBProjectFile file : target.db.files.Data.values())
|
||||||
file.ArrayGraphTitle = "Объявлений: " + file.array_decls.size();
|
file.ArrayGraphTitle = "Объявлений: " + file.array_decls.size();
|
||||||
target.UpdateArraysCount();
|
target.UpdateArraysCount();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected boolean alwaysCheck() {
|
protected boolean alwaysCheck() {
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import _VisualDVM.ProjectData.SapforData.FileObjectWithMessages;
|
|||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
// это то что отображается в боковом графе файла. не путать с сапфоровским ProjectArray
|
// это то что отображается в боковом графе файла. не путать с сапфоровским ProjectArray
|
||||||
public class ArrayDecl extends FileObjectWithMessages {
|
public class ArrayDecl extends FileObjectWithMessages {
|
||||||
|
@Expose
|
||||||
|
public String file = "";
|
||||||
@Expose
|
@Expose
|
||||||
public String array_name;
|
public String array_name;
|
||||||
@Expose
|
@Expose
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package _VisualDVM.ProjectData.SapforData.Arrays;
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Vector;
|
||||||
|
public class ArraysJson {
|
||||||
|
@Expose
|
||||||
|
public List<ProjectArray> allArrays=new Vector<>();
|
||||||
|
}
|
||||||
@@ -58,6 +58,22 @@ public class ProjectArray extends DBObject {
|
|||||||
//json-------------------
|
//json-------------------
|
||||||
public String UniqKey;
|
public String UniqKey;
|
||||||
public BigInteger address;
|
public BigInteger address;
|
||||||
|
public void print(){
|
||||||
|
Vector<String> res = new Vector<>();
|
||||||
|
res.add(">");
|
||||||
|
res.add("id="+id);
|
||||||
|
res.add("name="+name);
|
||||||
|
res.add("shortName="+shortName);
|
||||||
|
res.add("dimSize="+dimSize);
|
||||||
|
res.add("typeSize="+typeSize);
|
||||||
|
res.add("state="+state);
|
||||||
|
res.add("location="+location);
|
||||||
|
res.add("locName="+locName);
|
||||||
|
res.add("isTempFlag="+isTemplFlag);
|
||||||
|
res.add("isLoopArrayFlag="+isLoopArrayFlag);
|
||||||
|
res.add("<");
|
||||||
|
System.out.println(String.join("\n",res));
|
||||||
|
}
|
||||||
|
|
||||||
//--
|
//--
|
||||||
public ArrayState getState() {
|
public ArrayState getState() {
|
||||||
@@ -144,6 +160,7 @@ public class ProjectArray extends DBObject {
|
|||||||
public void Init(){
|
public void Init(){
|
||||||
//короткое имя+ функция/модуль/комон+ размерность
|
//короткое имя+ функция/модуль/комон+ размерность
|
||||||
UniqKey = shortName + locName + dimSize;
|
UniqKey = shortName + locName + dimSize;
|
||||||
|
address = BigInteger.ONE;
|
||||||
}
|
}
|
||||||
public static String fill_binary(int d, String binary) {
|
public static String fill_binary(int d, String binary) {
|
||||||
int delta = Math.abs(binary.length() - d);
|
int delta = Math.abs(binary.length() - d);
|
||||||
|
|||||||
Reference in New Issue
Block a user