добавление учета пробелов в сравнение
This commit is contained in:
2025-07-13 19:33:57 +03:00
parent 6263934cbb
commit c5cd8113c0
29 changed files with 158 additions and 238 deletions

View File

@@ -257,9 +257,8 @@ public class DBProjectFile extends ProjectFile {
break;
}
}
public void AddNewMessage(Message message) throws Exception{
switch (message.type){
public void AddNewMessage(Message message) throws Exception {
switch (message.type) {
case 0:
MessageWarning warning = new MessageWarning(name, message.line, message.value, message.group);
father.db.Insert(warning);
@@ -282,8 +281,6 @@ public class DBProjectFile extends ProjectFile {
break;
}
}
public DefaultMutableTreeNode show_loop_graph_r(FileObjectWithMessages element) {
DefaultMutableTreeNode res = new DefaultMutableTreeNode(element);
if (element instanceof Loop) {

View File

@@ -26,18 +26,6 @@ public class Message extends iDBObject {
//--
@Description("DEFAULT ''")
public String file = "";
public String getGroup_s() {
switch (group) {
case 0:
return "#m0000";
case Constants.parser_group: //сообщения от парсера.
return "#parser";
case Constants.compiler_group:
return "#compiler";
default:
return "#"+group;
}
}
//--
public Message() {
}
@@ -45,7 +33,7 @@ public class Message extends iDBObject {
) throws Exception {
file = file_in;
line = line_in;
group=group_in;
group = group_in;
if ((group == Constants.parser_group) ||
(group == Constants.compiler_group) ||
(Global.mode != Mode.Normal)) {
@@ -455,4 +443,16 @@ public class Message extends iDBObject {
}
}
}
public String getGroup_s() {
switch (group) {
case 0:
return "#m0000";
case Constants.parser_group: //сообщения от парсера.
return "#parser";
case Constants.compiler_group:
return "#compiler";
default:
return "#" + group;
}
}
}

View File

@@ -39,14 +39,6 @@ public class AlignRule {
alignRuleWith.add(new AlignRuleWidthJson(dimNum, a, b));
}
}
public void Init(){
//--
alignArray_address = new BigInteger(packedAlignArrayAddress);
alignWith_address = new BigInteger(packedAlignWithAddress);
//--
packedAlignArrayAddress = null;
packedAlignWithAddress = null;
}
private static Pair<String, String> convertDigitToPositive(int digit) {
String buf = "";
String sign = " + ";
@@ -58,6 +50,14 @@ public class AlignRule {
buf += String.valueOf(digit);
return new Pair<>(sign, buf);
}
public void Init() {
//--
alignArray_address = new BigInteger(packedAlignArrayAddress);
alignWith_address = new BigInteger(packedAlignWithAddress);
//--
packedAlignArrayAddress = null;
packedAlignWithAddress = null;
}
public ProjectArray getAlignArray() {
return parent_region.arraysMap.get(alignArray_address);
}
@@ -115,7 +115,7 @@ public class AlignRule {
retVal += getAlignArray().TypeString() + " ";
arrayString += getAlignArray().shortName + "(";
for (int i = 0; i < alignRule.size(); ++i) {
arrayString += genStringExpr(ProjectArray.alignNames[i], alignRule.get(i).getKey(),alignRule.get(i).getValue() );
arrayString += genStringExpr(ProjectArray.alignNames[i], alignRule.get(i).getKey(), alignRule.get(i).getValue());
if (i != alignRule.size() - 1)
arrayString += ",";
}
@@ -142,7 +142,7 @@ public class AlignRule {
for (int i = 0; i < alignRuleWith.size(); ++i) {
if (alignRuleWith.get(i).getDimNum() != -1) {
alignEachDim.set(alignRuleWith.get(i).getDimNum(),
genStringExpr(ProjectArray.alignNames[i], alignRuleWith.get(i).getA(),alignRuleWith.get(i).getB() ));
genStringExpr(ProjectArray.alignNames[i], alignRuleWith.get(i).getA(), alignRuleWith.get(i).getB()));
//коэццициенты находятся здесь!!------------------------------------------------------------------->>
getAlignArray().ac_current.put(i,
new Dimension(i,

View File

@@ -7,22 +7,21 @@ public class AlignRuleWidthJson {
public int a;
@Expose
public int b;
//dim -> a * dim_t + b
public int getDimNum(){
return dimNum;
public AlignRuleWidthJson() {
}
public int getA(){
return a;
}
public int getB(){
return b;
}
public AlignRuleWidthJson(){
}
public AlignRuleWidthJson(int i_in, int a_in, int b_in){
public AlignRuleWidthJson(int i_in, int a_in, int b_in) {
dimNum = i_in;
a = a_in;
b = b_in;
}
//dim -> a * dim_t + b
public int getDimNum() {
return dimNum;
}
public int getA() {
return a;
}
public int getB() {
return b;
}
}

View File

@@ -5,5 +5,5 @@ import java.util.List;
import java.util.Vector;
public class ArraysJson {
@Expose
public List<ProjectArray> allArrays=new Vector<>();
public List<ProjectArray> allArrays = new Vector<>();
}

View File

@@ -1,15 +1,12 @@
package _VisualDVM.ProjectData.SapforData.Arrays;
import Common.Database.Objects.DBObject;
import Common.Utils.Index;
import Common.Utils.IntegerPairJson;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.ProjectData.DBArray.DBArray;
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateDimension;
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateDimensionState;
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateLink;
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
import _VisualDVM.ProjectData.SapforData.Regions.UI.ArrayAlignmentBar;
import com.google.gson.annotations.Expose;
@@ -21,6 +18,9 @@ import java.util.List;
import java.util.Vector;
import java.util.stream.Collectors;
public class ProjectArray extends DBObject {
//--
//----------------------------------------------------------------------
public static final String[] alignNames = {"i", "j", "k", "l", "m", "n", "q", "r", "s", "t", "u", "w", "x", "y", "z"};
@Expose
public long id;
@Expose
@@ -34,10 +34,6 @@ public class ProjectArray extends DBObject {
@Expose
public int typeSize;
@Expose
int state;
@Expose
int location;
@Expose
public String locName;
@Expose
public int isTemplFlag;
@@ -45,17 +41,6 @@ public class ProjectArray extends DBObject {
public int isLoopArrayFlag;
@Expose
public Vector<ArrayDecl> declPlaces = new Vector<>();
@Expose
List<Integer> deprecateToDist = new Vector<>();
@Expose
List<Integer> mappedDims = new Vector<>();
@Expose
Vector<IntegerPairJson> sizes = new Vector<>();
@Expose
Vector<String> regions = new Vector<>();
//--
//----------------------------------------------------------------------
public static final String[] alignNames = {"i", "j", "k", "l", "m", "n", "q", "r", "s", "t", "u", "w", "x", "y", "z"};
public String UniqKey;
public BigInteger address;
//только для шаблонов. для ФИЛЬТРА управления распределением измерений.
@@ -73,6 +58,33 @@ public class ProjectArray extends DBObject {
public LinkedHashMap<Integer, Dimension> ac_new;
//https://stackoverflow.com/questions/4941372/how-to-insert-image-into-jtable-cell
public ArrayAlignmentBar bar = null;
@Expose
int state;
@Expose
int location;
@Expose
List<Integer> deprecateToDist = new Vector<>();
@Expose
List<Integer> mappedDims = new Vector<>();
@Expose
Vector<IntegerPairJson> sizes = new Vector<>();
@Expose
Vector<String> regions = new Vector<>();
public static String fill_binary(int d, String binary) {
int delta = Math.abs(binary.length() - d);
String res = binary;
for (int i = 0; i < delta; ++i) {
res = ("0" + res);
}
return res;
}
//длина должна быть равной, ищем есть ли совпадающие позиции с единицами
public static boolean mask(String banned, String variant) {
for (int i = 0; i < variant.length(); ++i)
if ((variant.toCharArray()[i] == '1') && (banned.toCharArray()[i] == '1')) //попался, масконосец!
return true;
return false;
}
//------
public void print() {
Vector<String> res = new Vector<>();
@@ -119,21 +131,6 @@ public class ProjectArray extends DBObject {
ac_new = new LinkedHashMap<>();
//--FileForm
}
public static String fill_binary(int d, String binary) {
int delta = Math.abs(binary.length() - d);
String res = binary;
for (int i = 0; i < delta; ++i) {
res = ("0" + res);
}
return res;
}
//длина должна быть равной, ищем есть ли совпадающие позиции с единицами
public static boolean mask(String banned, String variant) {
for (int i = 0; i < variant.length(); ++i)
if ((variant.toCharArray()[i] == '1') && (banned.toCharArray()[i] == '1')) //попался, масконосец!
return true;
return false;
}
public String printLinks() {
Vector<String> res = links.keySet().stream().map(Object::toString).collect(Collectors.toCollection(Vector::new));
return String.join(" ", res);

View File

@@ -5,5 +5,5 @@ import java.util.List;
import java.util.Vector;
public class GCOVJson {
@Expose
public List<FileGCOVJson> allGCov= new Vector<>();
public List<FileGCOVJson> allGCov = new Vector<>();
}

View File

@@ -1,7 +1,6 @@
package _VisualDVM.ProjectData.SapforData.Includes.Analysis;
import Common.Utils.Utils_;
import _VisualDVM.ProjectData.SapforData.FileObject;
import _VisualDVM.ProjectData.SapforData.Includes.Analysis.Include;
import com.google.gson.annotations.Expose;
import javax.swing.*;

View File

@@ -1,10 +1,7 @@
package _VisualDVM.ProjectData.SapforData.Regions;
import Common.Database.Objects.DBObject;
import Common.Utils.Index;
import Common.Utils.IntegerPairJson;
import Common.Utils.Pair;
import Common.Utils.Utils_;
import Common.Visual.UI;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.SapforData.Arrays.AlignRule;
@@ -30,6 +27,21 @@ public class ParallelRegion extends DBObject {
public Vector<AlignRule> alignRules;
//----
public Vector<String> rules;
//--
public BigInteger regionId;
//name in program
// file -> <start, end> lines
public LinkedHashMap<String, List<IntegerPairJson>> lines; //+
//ключ - адрес. меняем
public LinkedHashMap<BigInteger, ProjectArray> arraysMap; //+
//for directive creating
public int maxdim = 0;
public Vector<String> fragments; //+
public int lines_count = 0;
public int loops_count = 0;
public int arrays_count = 0;
public int fd_count = 0;
public int fc_count = 0;
public void genRules(LinkedHashMap<BigInteger, ProjectArray> Arrays) {
rules.clear();
int maxLen = 0;
@@ -48,26 +60,11 @@ public class ParallelRegion extends DBObject {
for (String r : v)
rules.add(r);
}
//--
public BigInteger regionId;
//name in program
// file -> <start, end> lines
public LinkedHashMap<String, List<IntegerPairJson>> lines; //+
//ключ - адрес. меняем
public LinkedHashMap<BigInteger, ProjectArray> arraysMap; //+
//for directive creating
public int maxdim = 0;
public Vector<String> fragments; //+
public int lines_count = 0;
public int loops_count = 0;
public int arrays_count = 0;
public int fd_count = 0;
public int fc_count = 0;
public void Init() {
arraysMap = new LinkedHashMap<>();
lines = new LinkedHashMap<>();
fragments = new Vector<>();
rules=new Vector<>();
rules = new Vector<>();
//--
if (packedRegionId != null)
regionId = new BigInteger(packedRegionId);
@@ -75,14 +72,14 @@ public class ParallelRegion extends DBObject {
for (ProjectArray array : packedArrays) {
array.Init();//имена и адреса.
arraysMap.put(array.address, array);
if (array.isTemplFlag==1){
if (array.isTemplFlag == 1) {
maxdim = Math.max(maxdim, array.dimSize);
Global.mainModule.getProject().templates.add(array);
array.regIDs.add(regionId);
} else if (array.isLoopArrayFlag != 1) arrays_count++;
}
//---
for (AlignRule rule: alignRules) {
for (AlignRule rule : alignRules) {
rule.Init();
rule.parent_region = this;
}