uwol / proleap-cobol-parser

ProLeap ANTLR4-based parser for COBOL
MIT License
136 stars 74 forks source link

Record Key and File Status not processed correctly. #14

Closed Reinhard-Prehofer closed 6 years ago

Reinhard-Prehofer commented 7 years ago

Not exactly sure what happens, but I suppose: VideoCode of VideoRecord => Record Key may only contain simple Cobol-Names (but not such with an "OF" or "IN") File Status is VideoFileStatus => seems that currently only the default and implicitly declared FILE STATUS is recognized by the parser.

Datei007.cbl.txt

... Output when parsing Datei007.cbl

Preprocessing file Datei007.cbl. Parsing file Datei007.cbl. Collecting units in file Datei007.cbl. Analyzing program units of compilation unit Datei007. call to unknown data element VideoCodeofVideoRecord call to unknown data element VideoTitleofVideoRecord call to unknown data element VideoFileStatus call to unknown data element SeqVideoStatus Analyzing identification divisions of compilation unit Datei007. Analyzing environment divisions of compilation unit Datei007. Analyzing data divisions of compilation unit Datei007. Analyzing procedure divisions of compilation unit Datei007. Analyzing statements of compilation unit Datei007. call to unknown data element VideoCodeofVideoRecord call to unknown data element SupplierCodeofVideoRecord unknown value stmt at [5334 5325 5307 3657 4702 4695 3644 3605 3582 3580 3572 3533 1200 1185 1182] call to unknown data element VideoTitleofVideoRecord call to unknown data element VideoTitleofVideoRecord call to unknown data element VideoTitleofVideoRecord call to unknown data element VideoTitleinVideoRecord call to unknown data element VideoCodeofVideoRecord call to unknown data element VideoCodeofVideoRecord call to unknown data element VideoTitleofVideoRecord call to unknown data element VideoCodeofVideoRecord call to unknown data element VideoCodeofVideoRecord call to unknown data element VideoCodeofVideoRecord call to unknown data element VideoCodeofVideoRecord Anzahl Sections: 8 Section-Name:Anfang Statements:4

Reinhard-Prehofer commented 7 years ago

for ease of use - attached find a simple sample where the file-status is not parsed correctly. FS1.cbl.txt

Preprocessing file FS1.cbl. Preprocessing file FS1.cbl. Parsing file FS1.cbl. Collecting units in file FS1.cbl. Analyzing program units of compilation unit FS1. call to unknown data element Z-FS Analyzing identification divisions of compilation unit FS1. Analyzing environment divisions of compilation unit FS1. Analyzing data divisions of compilation unit FS1. Analyzing procedure divisions of compilation unit FS1. Analyzing statements of compilation unit FS1. call to unknown data element d821e call to unknown data element d821e call to unknown data element z-fs call to unknown data element dd821e call to unknown data element z-fs

uwol commented 6 years ago

This issue addresses multiple bugs:

  1. Calls from FileControlClauses to DataDescriptionEntries were not resolved
  2. Calls from FileDescriptionEntryClauses to DataDescriptionEntries were not resolved
  3. InData and InFile calls such as VideoCode OF VideoRecord and VideoCode IN VideoRecord are not resolved relative to the parent DataDescriptionEntry, e.g. VideoRecord

Fixed bugs 1 and 2 in e6ed6c22d7abad7757c2c63fdecaecf2a1529b37. Added unit test.

Bug 3 to be fixed in later commit.

uwol commented 6 years ago

Fixed bug 3 in 55557df0d93d39eaefbb5c1ef6c7bb3418ab7724. Added a unit test.