@@ -40301,7 +40301,34 @@ public Vector cobolDataDefinitions(java.util.Map context, Vector invs)
4030140301 }
4030240302 return res;
4030340303 }
40304+
40305+ if ("fileSection".equals(tag))
40306+ { // FILE SECTION . fileDescriptionEntry*
40307+
40308+ for (int i = 3; i < terms.size(); i++)
40309+ { ASTTerm tt = (ASTTerm) terms.get(i);
40310+ Vector ttres = tt.cobolDataDefinitions(context, invs);
40311+ res.addAll(ttres);
40312+ }
40313+ return res;
40314+ }
4030440315
40316+ if ("fileDescriptionEntry".equals(tag))
40317+ { // (FD | SD) fileName (.? fileDescriptionEntryClause)* . dataDescriptionEntry*
40318+
40319+ context.put("container", null);
40320+ context.put("previousLevel", new Integer(-1));
40321+ context.put("startPosition", new Integer(1));
40322+
40323+ for (int i = 2; i < terms.size(); i++)
40324+ { ASTTerm tt = (ASTTerm) terms.get(i);
40325+ if ("dataDescriptionEntry".equals(tt.getTag()))
40326+ { Vector ttres = tt.cobolDataDefinitions(context, invs); res.addAll(ttres);
40327+ }
40328+ }
40329+ return res;
40330+ }
40331+
4030540332 if ("dataDescriptionEntry".equals(tag))
4030640333 { // dataDescriptionEntryFormat1 |
4030740334 // dataDescriptionEntryFormat2 |
@@ -40381,7 +40408,8 @@ public Vector cobolDataDefinitions(java.util.Map context, Vector invs)
4038140408 }
4038240409
4038340410 if (container == null) // no container, so top-level attribute
40384- { if ("FILLER".equals(fieldName)) { }
40411+ { if ("FILLER".equals(fieldName))
40412+ { /* Should not occur */ }
4038540413 else
4038640414 { Attribute att =
4038740415 new Attribute(fieldName, typ,
@@ -40395,11 +40423,19 @@ public Vector cobolDataDefinitions(java.util.Map context, Vector invs)
4039540423 { int contLevel = container.levelNumber;
4039640424 int contMult = container.cardinalityValue;
4039740425
40398- Integer startPosition = (Integer) context.get("startPosition");
40426+ Integer startPosition =
40427+ (Integer) context.get("startPosition");
40428+
40429+ int startPos = 1;
40430+ int endPos = wdth;
40431+
4039940432 if (startPosition != null)
40400- { int startPos = startPosition.intValue();
40401- int endPos = startPos + wdth - 1;
40433+ { startPos = startPosition.intValue();
40434+ endPos = startPos + wdth - 1;
4040240435 context.put("startPosition", endPos + 1);
40436+
40437+ if ("FILLER".equals(fieldName))
40438+ { fieldName = "FILLER_" + startPos + "_" + endPos; }
4040340439
4040440440 String cname = container.getName();
4040540441 String ownername =
@@ -40532,28 +40568,40 @@ else if (multiplicity == 1 & contMult > 1)
4053240568 else
4053340569 { context.put("startPosition", 1 + wdth); }
4053440570
40535- Integer previousLevel = (Integer) context.get("previousLevel");
40571+ Integer previousLevel =
40572+ (Integer) context.get("previousLevel");
4053640573 int prevLevel = previousLevel.intValue();
4053740574
4053840575 if (levelNumber >= prevLevel)
4053940576 { // attribute of container
40540- if ("FILLER".equals(fieldName)) {}
40577+ if ("FILLER".equals(fieldName))
40578+ { fieldName = "FILLER_" + startPos + "_" + endPos; }
4054140579 else
40542- { Attribute att =
40580+ { ASTTerm.setTaggedValue(fieldName, "startPosition",
40581+ "" + startPos);
40582+ ASTTerm.setTaggedValue(fieldName, "endPosition",
40583+ "" + endPos);
40584+ } // For the CSTL.
40585+
40586+ Attribute att =
4054340587 new Attribute(fieldName, typ,
4054440588 ModelElement.INTERNAL);
40545- container.addAttribute(att);
40546- } // could itself be composite
40589+ att.setWidth(wdth);
40590+ container.addAttribute(att);
40591+ // could itself be composite
40592+
4054740593 context.put("previousLevel",
4054840594 new Integer(levelNumber));
4054940595 }
4055040596 else if (levelNumber < prevLevel)
4055140597 { // attribute of another container
40552- if ("FILLER".equals(fieldName)) {}
40598+ if ("FILLER".equals(fieldName))
40599+ { fieldName = "FILLER_" + startPos + "_" + endPos; }
4055340600 else
4055440601 { Attribute att =
4055540602 new Attribute(fieldName, typ,
4055640603 ModelElement.INTERNAL);
40604+ att.setWidth(wdth);
4055740605 Entity actualContainer =
4055840606 container.findContainer(levelNumber);
4055940607 if (actualContainer != null)
0 commit comments