uwol / proleap-cobol-parser

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

Embedding an external preprocessor - like EXEC ADABAS ... #27

Closed Reinhard-Prehofer closed 6 years ago

Reinhard-Prehofer commented 7 years ago

Noone expects you to implement a preprocessor for Adabas for example, however there are a lot of sources around where calls to be resolved by differente preprocessors are written into the cobol sources following a pattern of for example: EXEC ADABAS <adabas-statement> END-EXEC.

(sure there is a similarity to exec sql <sql-statements> end-exec.

Any suggestion/recommandation as of how to proceed with such sources? Source snippets are like following:

001810 EXEC ADABAS COPY          FILE=x4711-DAT12A                      17.01.94
001820                           MEM=vd4711A                            17.01.94
001830                           END-EXEC.                              Y2600120

001890*EXEC ADABAS GENERATE      FILE=x4711-DAT12C                      15.08.96
001900*                          RECORD-BUFFER-NAME=vd4711C             15.08.96
001910*                          PREFIX=T11-                            15.08.96
001920*                          END-EXEC.                              15.08.96

005030    EXEC ADABAS FORMAT-BUFFER                                     10.05.10
005040                FILE=x4711-TAB12A                                 10.05.10
005050                FORMAT-BUFFER-NAME=FB-V0TAB12A                    10.05.10
005060                OFFSET=V                                          10.05.10
005070    END-EXEC.                                                     10.05.10
Reinhard-Prehofer commented 6 years ago

meanwhile we have implemented an Exec-Adabas-PreProcessor which comments out the exec-adabas ... end-exec statements in the Cobol sources and replaces it by the name of a cobol copy book. This cobol copy book will be filled by issuing various batchmode predict statements, all of them resulting into legitimate cobol declarations. ... thus I am closing that issue.