We are trying to parse Cobol sources.
Having a ‘CLASS’ definition in the ‘SPECIAL-NAMES’ paragraph causes the parser to fail, while the compiler has no problems with it.
Adding a ‘.’ at the end of the CLASS definition fixes the parsing error, but that does not compile!
Versions used:
Cobol: AcuCobol version 10.2.1, fixed format
SonarQube: Enterprise Edition Version 9.6.1 (build 59531)
– extract from the parser logging –
ERROR: Unable to parse COBOL source file : /build/builds/_NwxSV3v/0/dataserver-utilities/tdeltaplayground/sonar-parse-errors/cobol-src/source/PP0029 at line 11
Original contents starting from line 1 till line 15:
IDENTIFICATION DIVISION.
PROGRAM-ID. PP0029.
ENVIRONMENT DIVISION.
*------------------------------------------------[ configuration ]
CONFIGURATION SECTION.
SPECIAL-NAMES.
CLASS CLASS-NAME "0" THRU "9", "A" THRU "Z", "-", " "
CRT STATUS IS CRT-KEY.
WORKING-STORAGE SECTION.
01 CRT-KEY PIC 999.
PROCEDURE DIVISION.
GOBACK.
Preprocessed contents:
Parse error at line 11:
1: IDENTIFICATION DIVISION .
2: PROGRAM-ID . PP0029 .
3: ENVIRONMENT DIVISION .
5: CONFIGURATION SECTION .
6: SPECIAL-NAMES .
10: CLASS CLASS-NAME "0" THRU "9" , "A" THRU "Z" , "-" , " "
11: CRT STATUS IS CRT-KEY .
^
12: WORKING-STORAGE SECTION .
13: 01 CRT-KEY PIC 999 .
14: PROCEDURE DIVISION .
15: GOBACK .
16: EOF
```
Please fix this parse-error