-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Missing Nuget 4.13.2 #4747
Comments
Don't use Antlr4, Antlr4.Runtime, Antlr4.CodeGenerator! The ancient "Antlr4cs" nuget packages were forked from "Official" Antlr many years ago. They are now incompatible with "Official Antlr4", which is the code and packages published from this repo. Use the "Official Antlr 4.13.2" Tool .jar from https://github.com/antlr/website-antlr4/tree/gh-pages/download with the Antlr4.Runtime.Standard. Note, there is a 4.13.2 Antlr Tool jar, but there is NOT a 4.13.2 Antlr4.Runtime.Standard because there were no significant changes in the Antlr4 CSharp runtime. To avoid thinking about compatibility issues, just use Antlr 4.13.1 Tool jar with 4.13.1 Antlr4.Runtime.Standard. However, I just recommend you avoid trying to mix and match tool with runtime, trying to run the Antlr tool manually at the command line, and just use Antlr4BuildTasks, which I wrote. This Nuget package replaces the old Antlr4 Nuget package, integrating the "Official" Antlr tool directly into the build. Antlr4BuildTasks downloads and installs compatible versions of the Antlr tool .jar with Antlr4.Runtime.Standard. It also downloads not only the right Antlr tool jar, but a Java Runtime Environment (JRE) so you avoid all those issues as well. It generates the .cs for parser and lexer, and puts them into the obj/ directory. They are generated files, just like .obj's, just like .exe's. You don't check in generated code, just like you don't check in .objs and .exes into a version control system: it's just bad practice. To work with Antlr4BuildTasks, just place your .g4's in a directory with the driver code. Then, create a .csproj with an
The Antlr4BuildTasks also has a properties specification for use with Visual Studio 2022, so you can set the options for the Antlr4 tool through a nice UI. In VS2022, go to the "Solution Explorer", then right-click on the .g4 file you want to select, then click on "Properties". It'll open with a window to set up the options for running the Antlr Tool. |
I'm targeting c# and the latest available version of the antlr.runtime is 4.6.6, there is no 4.13.2 available in the nuget repository, the documentation points to a nugget gallery that does not exist.
https://www.nuget.org/packages/Antlr4.Runtime.Standard/4.13.2
I attempted to download 4.6.6 of antlr to recompile my libraries but that's not available or at least I cannot find it from the downloads page.
The text was updated successfully, but these errors were encountered: