I am using Proleap Cobol Parser and at run time it is automatically taking antlr runtime 13 which is not able to deserialize the Adaptive Transition Network (java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).)
The version of Proleap Cobol Parser is 4.7.2 that is currently available at . But when I am using the below dependency management to downgrade my antlr4-runtime version to 4.7.2, some of the methods just simply become unreachable, i.e. not supported.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7.2</version> <!-- Force the correct version -->
<scope>runtime</scope>
</dependency>
</dependencies>
</dependencyManagement>`
I just want the correct the version combo of antlr4-runtime and Proleap Cobol Parser.
I am using Proleap Cobol Parser and at run time it is automatically taking antlr runtime 13 which is not able to deserialize the Adaptive Transition Network (java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).)
The version of Proleap Cobol Parser is 4.7.2 that is currently available at https://github.com/uwol/proleap-cobol-parser. But when I am using the below dependency management to downgrade my antlr4-runtime version to 4.7.2, some of the methods just simply become unreachable, i.e. not supported.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7.2</version> <!-- Force the correct version -->
<scope>runtime</scope>
</dependency>
</dependencies>
</dependencyManagement>`
I just want the correct the version combo of antlr4-runtime and Proleap Cobol Parser.
What worked for me,
cloned the proleap repository
having java and ANTRL4 runtime jar in path
moved to path ...\src\main\antlr4\io\proleap\cobol
e.g. directory containing the two grammers
in this directory executed
java org.antlr.v4.Tool -package io.proleap.cobol -visitor Cobol.g4
java org.antlr.v4.Tool -package io.proleap.cobol -visitor CobolPreprocessor.g4
This generates listeners and vistors and adds package needed.
copied all generated files but the two grammers to
...\src\main\java\io\proleap\cobol
used Java 21 (selected in IntelliJ)
used latest ANTLR4 by setting in pom.xml
<antlr.version>4.13.2<antlr.version>
project compiled error free