@@ -355,9 +355,9 @@ public ASTTerm replaceAmbiguousCobolNames(Vector rnames)
355355
356356 String rname = (String) rnames.get(0);
357357
358- JOptionPane.showMessageDialog(null, this +
358+ /* JOptionPane.showMessageDialog(null, this +
359359 " Basic data item: " + fld + " in " + rname,
360- " ", JOptionPane.INFORMATION_MESSAGE);
360+ " ", JOptionPane.INFORMATION_MESSAGE); */
361361
362362 if (ASTTerm.cobolAmbiguousDataNames.contains(fld))
363363 { ASTTerm newname =
@@ -381,9 +381,9 @@ else if ("dataDescriptionEntryFormat1".equals(tag) &&
381381 ASTTerm rec = (ASTTerm) terms.get(1);
382382 String ename = rec.literalForm();
383383
384- JOptionPane.showMessageDialog(null, this +
384+ /* JOptionPane.showMessageDialog(null, this +
385385 " Record data: " + ename,
386- " ", JOptionPane.INFORMATION_MESSAGE);
386+ " ", JOptionPane.INFORMATION_MESSAGE); */
387387
388388 Vector newterms = new Vector();
389389 newterms.add(terms.get(0));
@@ -41338,6 +41338,36 @@ else if (res == intType && typ == longType)
4133841338 return stringType;
4133941339 }
4134041340
41341+ public boolean cobolIsSigned()
41342+ { if ("dataPictureClause".equals(tag))
41343+ { // (PIC | PICTURE) IS? pictureString
41344+
41345+ int sze = terms.size();
41346+ ASTTerm ptrm = (ASTTerm) terms.get(sze-1);
41347+ System.out.println(">> " + ptrm + " is signed: " + ptrm.cobolIsSigned());
41348+ return ptrm.cobolIsSigned();
41349+ }
41350+
41351+ if ("pictureString".equals(tag))
41352+ { boolean res = false;
41353+ for (int i = 0; i < terms.size(); i++)
41354+ { ASTTerm tt = (ASTTerm) terms.get(i);
41355+ boolean bb = tt.cobolIsSigned();
41356+ if (bb == true)
41357+ { return true; }
41358+ }
41359+
41360+ return res;
41361+ }
41362+
41363+ if ("pictureChars".equals(tag))
41364+ { ASTTerm val = (ASTTerm) terms.get(0);
41365+ return "S".equals(val.literalForm());
41366+ }
41367+
41368+ return false;
41369+ }
41370+
4134141371 public int cobolOccursTimes()
4134241372 { if ("dataOccursClause".equals(tag))
4134341373 { // OCCURS integerLiteral dataOccursTo? TIMES?
@@ -41582,6 +41612,7 @@ public Vector cobolDataDefinitions(java.util.Map context, Vector invs)
4158241612 int fractwidth = pictureClause.cobolFractionWidth();
4158341613 Type typ = pictureClause.cobolDataType();
4158441614 int wdth = pictureClause.cobolDataWidth();
41615+ boolean isSigned = pictureClause.cobolIsSigned();
4158541616
4158641617 ASTTerm t2 = (ASTTerm) terms.get(1);
4158741618 if (t2.getTag().equals("dataName"))
@@ -41662,12 +41693,14 @@ public Vector cobolDataDefinitions(java.util.Map context, Vector invs)
4166241693 typ.setElementType(elemT);
4166341694 }
4166441695
41696+ boolean isSigned = pictureClause.cobolIsSigned();
4166541697 integerWidth = pictureClause.cobolIntegerWidth();
4166641698 fractionalWidth =
4166741699 pictureClause.cobolFractionWidth();
4166841700
4166941701 JOptionPane.showMessageDialog(null,
4167041702 "Type of " + fieldName + " is " + typ +
41703+ " Signed: " + isSigned +
4167141704 " Width: " + wdth + " " + integerWidth + " " +
4167241705 fractionalWidth,
4167341706 "",
@@ -41985,13 +42018,14 @@ else if (levelNumber >= prevLevel)
4198542018 }
4198642019 }
4198742020
41988- JOptionPane.showMessageDialog(null,
42021+ /* JOptionPane.showMessageDialog(null,
4198942022 fieldName +
4199042023 " is subrecord of " + ownername +
4199142024 " from " + startPos,
4199242025 "",
4199342026 JOptionPane.INFORMATION_MESSAGE);
41994-
42027+ */
42028+
4199542029 context.put("container", newent);
4199642030 context.put("previousLevel", new Integer(levelNumber));
4199742031 context.put("startPosition", new Integer(1));
@@ -42187,6 +42221,7 @@ public static boolean is88Entry(ASTTerm trm)
4218742221 int fractwidth =
4218842222 pictureClause.cobolFractionWidth();
4218942223 Type typ = pictureClause.cobolDataType();
42224+ boolean isSigned = pictureClause.cobolIsSigned();
4219042225
4219142226 ASTTerm t2 = (ASTTerm) ctrm.terms.get(1);
4219242227 if (t2.getTag().equals("dataName"))
@@ -42202,16 +42237,25 @@ public static boolean is88Entry(ASTTerm trm)
4220242237
4220342238 JOptionPane.showMessageDialog(null,
4220442239 "Type of " + fname + " is " + typ +
42205- " Width " + wdth +
42206- " Integer width " + intwidth +
42207- " Fract width " + fractwidth,
42240+ " Signed: " + isSigned +
42241+ " Width: " + wdth +
42242+ " Integer width: " + intwidth +
42243+ " Fract width: " + fractwidth,
4220842244 "",
4220942245 JOptionPane.INFORMATION_MESSAGE);
4221042246
4221142247 if (typ != null)
4221242248 { String dval = typ.defaultValue();
4221342249 ASTTerm.setTaggedValue(fname, "defaultValue",
42214- dval);
42250+ dval);
42251+ Constraint consV =
42252+ Constraint.getDataConstraint(fname,
42253+ typ,intwidth,fractwidth,
42254+ isSigned);
42255+ if (consV != null)
42256+ { consV.ownerName = progname;
42257+ invs.add(consV);
42258+ }
4221542259 }
4221642260 }
4221742261 else
@@ -42290,7 +42334,8 @@ public static boolean is88Entry(ASTTerm trm)
4229042334 if (pictureClause != null)
4229142335 { wdth = pictureClause.cobolDataWidth() * multiplicity;
4229242336 typ = pictureClause.cobolDataType();
42293-
42337+ boolean isSigned = pictureClause.cobolIsSigned();
42338+
4229442339 if (multiplicity > 1)
4229542340 { Type elemT = typ;
4229642341 typ = new Type("Sequence", null);
@@ -42309,6 +42354,7 @@ public static boolean is88Entry(ASTTerm trm)
4230942354
4231042355 JOptionPane.showMessageDialog(null,
4231142356 "Type of " + fieldName + " is " + typ +
42357+ " Signed: " + isSigned +
4231242358 " Width: " + wdth +
4231342359 " Integer width: " + integerWidth +
4231442360 " Fraction width: " + fractionalWidth +
@@ -42334,7 +42380,15 @@ public static boolean is88Entry(ASTTerm trm)
4233442380 ASTTerm.setTaggedValue(
4233542381 fieldName, "defaultValue",
4233642382 dval);
42337-
42383+ Constraint consV =
42384+ Constraint.getDataConstraint(fieldName,
42385+ typ,integerWidth,fractionalWidth,
42386+ isSigned);
42387+
42388+ if (multiplicity == 1 && consV != null)
42389+ { consV.ownerName = progname;
42390+ invs.add(consV);
42391+ }
4233842392 }
4233942393
4234042394 int dIndex = fieldName.lastIndexOf("$");
@@ -42778,15 +42832,15 @@ else if (multiplicity > 1 & contMult > 1)
4277842832 cent.addAttribute(att);
4277942833 ownername =
4278042834 cname.substring(0,cname.length()-6);
42781-
42835+ /*
4278242836 JOptionPane.showMessageDialog(null,
4278342837 fieldName +
4278442838 " is subrecord of " + ownername +
4278542839 " from " + startPos +
4278642840 " multiplicity " + multiplicity,
4278742841 "",
4278842842 JOptionPane.INFORMATION_MESSAGE);
42789-
42843+ */
4279042844 // context.put("container", newent);
4279142845 // context.put("previousLevel", new Integer(levelNumber));
4279242846 // context.put("startPosition", new Integer(1));
0 commit comments