Parsing error with Cobol AcuCobol Dialect

We are trying to parse Cobol sources.

We have a number of parsing issues; I will first post one, to check for your response.
Dependent on the feedback I will then post the rest.

First issue: Parsing error on JUSTIFIED clause in DISPLAY statement.

Versions used:
SonarScanner: 4.6.2.2472
Java: 11.0.16.1 Red Hat, Inc. (64-bit)
Linux: 3.10.0-1160.80.1.el7.x86_64 amd64
Cobol: AcuCobol version 10.2.1
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/PP0030 at line 7

Original contents starting from line 1 till line 8:
IDENTIFICATION DIVISION.
PROGRAM-ID. PP0030.
WORKING-STORAGE SECTION.
01 VARIABLE PIC X(20).
PROCEDURE DIVISION.
* The ‘JUSTIFIED (RIGHT)’ causes the parsing to fail:
DISPLAY VARIABLE JUSTIFIED RIGHT
GOBACK.

Preprocessed contents:
Parse error at line 7:

1:  IDENTIFICATION DIVISION .
2:  PROGRAM-ID . PP0030 .
3:  WORKING-STORAGE SECTION .
4:  01 VARIABLE PIC X ( 20 ) .
5:  PROCEDURE DIVISION .
7:  DISPLAY VARIABLE JUSTIFIED RIGHT
                    ^
8:  GOBACK .
9:  EOF

Compilation of this code is successfull.

Please take care of this issue.

Also please provide feedback on any info missing in the topic, as I have 18 more coming, and I want to do those as best I can.

Hi!

Welcome to the community!

It seems we have a problem with our parser with AcuCOBOL JUSTIFIED clause.
I created SONARCOBOL-1648 to track it.
Thanks for your feedback!

I think that you described this issue rather well. Thank you for providing a rather small reproducer, it definitely helps!

Depending on the cases, it can be useful to know more about the COBOL-specific analysis parameters such as sonar.cobol.dialect or sonar.cobol.sourceFormat. In this case, they were implicit.

Knowing the SonarQube version is useful because it allows us to know which version of our COBOL analyzer is used. However, the versions of SonarScanner, Java, and Linux are rarely relevant for parsing errors.

18 parsing errors look like a lot. Are they all different?
Maybe you can send 3 or 4 more issues and we can have a look at them.
You may send an extract of the analysis logs using the block code formatting syntax.

Thank you for your prompt reply and tips.

I will send in 4 more parsing issues, and then wait for another response.