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

failed to resolve: could not find impl_tid in antlr_rust #50

Closed
yuriry opened this issue Jul 16, 2022 · 3 comments
Closed

failed to resolve: could not find impl_tid in antlr_rust #50

yuriry opened this issue Jul 16, 2022 · 3 comments

Comments

@yuriry
Copy link

yuriry commented Jul 16, 2022

I'm not sure if my build environment is set up properly when I get the errors below.

Cargo.toml

[package]
name = "parser-test"
version = "0.1.0"
edition = "2021"

[dependencies]
antlr-rust = { git = "https://github.com/rrevenantt/antlr4rust", branch = "v0.3" }

A script that generates rust code from a grammar file:

#!/bin/bash
pushd grammars
java -jar ~/bin/antlr4-4.8-2-SNAPSHOT-complete.jar -Dlanguage=Rust -o ../src/parsers ArrayInit.g4
popd

antlr4-4.8-2-SNAPSHOT-complete.jar is built from rust-target branch.

Tool chain is nightly:

stable-x86_64-unknown-linux-gnu (default)
beta-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (override)

I had to add #![feature(try_blocks)] to main.rs to disable two try expression is experimental errors:

#![feature(try_blocks)]

mod parsers;

parsers/mod.rs:

mod arrayinitparser;
mod arrayinitlexer;
mod arrayinitlistener;

Any help on how to properly setup a working build environment would be greatly appreciated.

image

@yuriry
Copy link
Author

yuriry commented Jul 16, 2022

After checking out v0.3 branch of this project and re-building it using my version of antlr4-4.8-2-SNAPSHOT-complete.jar I got the same errors when running cargo test as in my parser test . What would be the correct version of antlr4-4.8-2-SNAPSHOT-complete.jar to work with v0.3 branch?

@rrevenantt
Copy link
Owner

rrevenantt commented Jul 22, 2022

I have just published a prerelease for v0.3: https://github.com/rrevenantt/antlr4rust/releases/tag/antlr4-4.8-2-Rust0.3.0-beta, does the issue still exists if you use antlr tool available with it?

@yuriry
Copy link
Author

yuriry commented Jul 23, 2022

Thank you so much, it works with master now!

[dependencies]
antlr-rust = { git = "https://github.com/rrevenantt/antlr4rust", branch = "master" }

@yuriry yuriry closed this as completed Jul 23, 2022
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

2 participants