proleap-cobol-parser
proleap-cobol-parser copied to clipboard
Alternative way to include copy books
In code I'm parsing some copy books are included with
EXEC SQL INCLUDE <copybook> END-EXEC
instead of COPY <copybook>
.
Would it be sufficient to modify the copyStatement
definition as follows?
copyStatement
: COPY copySource (NEWLINE* (directoryPhrase | familyPhrase | replacingPhrase | SUPPRESS))* NEWLINE* DOT
| EXEC SQL INCLUDE copySource END_EXEC NEWLINE* DOT?
;
INCLUDE: I N C L U D E;
Yes, that could be an option. The complicated thing with EXEC SQL INCLUDE is to get right, where COBOL ends and SQL begins. I'll have to take a look for that, so that we don't mix COBOL parsing with SQL parsing. I suspect, it belongs to COBOL...
We're having a deadline this week, I'll take a look afterwards.