8000 Rust Grammar file · Issue #95 · antlr/antlr4-lab · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Rust Grammar file #95

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

Open
jalexcole opened this issue Jan 16, 2025 · 1 comment
Open

Rust Grammar file #95

jalexcole opened this issue Jan 16, 2025 · 1 comment

Comments

@jalexcole
Copy link

Rust grammar file is missing

@kaby76
Copy link
Collaborator
kaby76 commented Jan 16, 2025

You cannot use the rust grammar from grammars-v4 in antlr-lab. It's impossible because the website uses the "interpreter" form of the parser engine. The rust grammar contains target language specific files. These have to be compiled for the target.

The grammars-v4 repo contains grammars.json. This file is used by antlr-lab when the HTML server starts up. It very carefully weeds out all grammars that contain any target-specific code by finding any action in any of the .g4's.

You must either:

  • generate the parser for Java, compile with the .java files from Java/, and use "TestRig" (alias grun='java -cp "c:/Users/Kenne/.m2/antlr4-4.12.0-complete.jar;." org.antlr.v4.gui.TestRig').
  • generate a driver for the parser. Trash does this. For the CSharp target, the toolkit has a multitude of tree display options. TestRig is really limited.

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
0