We are trying to parse Cobol sources.
When there are two paragraphs with the same name, but in different sections,
this causes a parser warning.
This only happens with code in the DECLARATIVES.
Versions used:
Cobol: AcuCobol version 10.2.1, fixed format
SonarQube: Enterprise Edition Version 9.6.1 (build 59531)
Source code:
IDENTIFICATION DIVISION.
PROGRAM-ID. PP0034.
PROCEDURE DIVISION.
DECLARATIVES.
I-O-ERROR-OUTPUT SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON OUTPUT.
BEGIN.
.
I-O-ERROR-INPUT SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON INPUT.
BEGIN.
.
I-O-ERROR-EXTEND SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON EXTEND.
BEGIN.
.
END DECLARATIVES.
MAIN SECTION.
BEGIN.
.
SECOND SECTION.
BEGIN.
.
– extract from the parser logging –
WARN: Trying to redefine the paragraph "BEGIN" in file:/build/builds/_NwxSV3v/0/dataserver-utilities/tdeltaplayground/sonar-parse-errors/cobol-src/source/PP0034 at line 15, first definition was in file:/build/builds/_NwxSV3v/0/dataserver-utilities/tdeltaplayground/sonar-parse-errors/cobol-src/source/PP0034 at line 11
So the ‘BEGIN’ paragraphs in the DECLARATIVES cause a warning; the other ones don’t.
Please remove this warning.