rrevenantt / antlr4rust

ANTLR4 parser generator runtime for Rust programming laguage
Other
398 stars 70 forks source link

ANTLR cannot generate Rust code as of version 4.13.1 #84

Closed woile closed 9 months ago

woile commented 10 months ago

I get this error:

error(31):  ANTLR cannot generate Rust code as of version 4.13.1

I've followed the steps described:

git clone -b rust-target https://github.com/rrevenantt/antlr4
git submodule update --init --recursive --remote 
mvn -DskipTests install

Running the following fails:

antlr4 -Dlanguage=Rust Idl.g4

I was trying to build Avro's g4: https://github.com/apache/avro/blob/main/share/idl_grammar/org/apache/avro/idl/Idl.g4

newca12 commented 10 months ago

The error you get show that you are using the latest upstream fat jar with no support for the Rust target (similar to #82), you should use the generated fat jar located in antlr4/tool/target/antlr4-4.8-2-SNAPSHOT-complete.jar

woile commented 10 months ago

I've used that one, and I get the same error

newca12 commented 9 months ago

There is no issue here, you just have to follow instructions carefully, Avro's g4 is building fine with Rust target.

woile commented 9 months ago

Any idea what may I be missing? I'm gonna give it another try. Thanks

woile commented 9 months ago

I've removed the folder, followed the steps again, and finally run:

 java -jar ./antlr4/tool/target/antlr4-4.8-2-SNAPSHOT-complete.jar -Dlanguage=Rust Idl.g4

And I still get error(31): ANTLR cannot generate Rust code as of version 4.8

$ java -version
openjdk version "11.0.18" 2023-01-17 LTS
$ mvn -version
Apache Maven 3.9.4

thoughts?

woile commented 9 months ago

Well I downloaded the released version of this jar and it works 🤷🏻