uwol / proleap-cobol-parser

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

CBL statement not recognized #40

Closed albertolovato closed 6 years ago

albertolovato commented 6 years ago

CBL statement specifying compiler options at start of program is not recognized, as in

line 1:7 mismatched input 'CBL' expecting {ID, IDENTIFICATION, PROCESS}

   CBL ARITH(EXTEND)
   IDENTIFICATION DIVISION.
   ...
uwol commented 6 years ago

You are right, that's a bug. Fixed in b39ca6c92411fe7a8b09ef7e2fe9b22aaf349cc7 and added unit tests. PROCESS and CBL statements are now removed by the preprocessor.

I'm not 100% sure, if the syntax in Cobol85Preprocessor.g4 ist complete. If there are any PROCESS ... and CBL ... statements, which are not removed and thus lead to parsing errors in the parsing step, please let me know.

Thanks!

uwol commented 6 years ago

By the way, since today there is a new version 2.2.0-SNAPSHOT, so 2.1.0 does not contain the fix. Just in case you are fetching the parser by MAVEN dependencies instead of GIT.

albertolovato commented 6 years ago

I found a CBL ADV in one of the files I'm parsing; java.lang.RuntimeException: syntax error in line 1:7 mismatched input 'CBL' expecting {ID, IDENTIFICATION}...

uwol commented 6 years ago

Thanks, hopefully fixed in f80ccbd1860eacc0e990c3f061b09a0c63f907cf.

Added a unit test.

uwol commented 6 years ago

Added a lot of other compiler options in that commit. Test suite is green. If this large commit produces problems with your files, please let me know.

uwol commented 6 years ago

fixed some errors in f510b3bc30e7001695179708a6e6660c73d367b2