Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANTLR cannot generate Rust code as of version 4.13.1 #84

Closed
woile opened this issue Oct 6, 2023 · 7 comments
Closed

ANTLR cannot generate Rust code as of version 4.13.1 #84

woile opened this issue Oct 6, 2023 · 7 comments

Comments

@woile
Copy link

woile commented Oct 6, 2023

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
Copy link
Contributor

newca12 commented Oct 7, 2023

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
Copy link
Author

woile commented Oct 7, 2023

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

@newca12
Copy link
Contributor

newca12 commented Nov 5, 2023

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

@woile
Copy link
Author

woile commented Nov 5, 2023

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

@woile
Copy link
Author

woile commented Nov 5, 2023

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
Copy link
Author

woile commented Nov 5, 2023

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

@woile woile closed this as completed Nov 5, 2023
@pedro-gilmora
Copy link

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

Hi, can you provide a boilerplate template?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants