Net4x.Antlr4.Runtime.Standard 4.13.1.26263

dotnet add package Net4x.Antlr4.Runtime.Standard --version 4.13.1.26263
                    
NuGet\Install-Package Net4x.Antlr4.Runtime.Standard -Version 4.13.1.26263
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Net4x.Antlr4.Runtime.Standard" Version="4.13.1.26263" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Net4x.Antlr4.Runtime.Standard" Version="4.13.1.26263" />
                    
Directory.Packages.props
<PackageReference Include="Net4x.Antlr4.Runtime.Standard" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Net4x.Antlr4.Runtime.Standard --version 4.13.1.26263
                    
#r "nuget: Net4x.Antlr4.Runtime.Standard, 4.13.1.26263"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Net4x.Antlr4.Runtime.Standard@4.13.1.26263
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Net4x.Antlr4.Runtime.Standard&version=4.13.1.26263
                    
Install as a Cake Addin
#tool nuget:?package=Net4x.Antlr4.Runtime.Standard&version=4.13.1.26263
                    
Install as a Cake Tool

C# target for ANTLR 4

Note to historical users

Versions of ANTLR 4.4.x and before managed the C# target as part of a separate tool provided by Sam Harwell. As of 4.5, we our releasing a (mono-compatible) C# target together with the main tool.

The current version is written using netstandard2.0 and netstandard2.1, it's possible to use it on different platforms (Windows, MacOS X, Linux, and other).

Releasing the runtime with the tool ensures that you can get the exact same behavior across many languages: Java, C#, Python, JavaScript, Go, Swift and C++.

Getting Started

Step 1: Install Java

The C# target for ANTLR 4 requires Java for generating C# code (but the applications compiled from this C# code will not require Java to be installed). You can install any of the following versions of Java to use this target.

If you already have one of the following installed, you should check to make sure the installation is up-to-date.

  • Java 8 runtime environment (x86 or x64)
  • Java 8 development kit (x86 or x64, provided that the JRE option is also installed during the development kit installation)
  • Java 7 runtime environment (x86 or x64)
  • Java 7 development kit (x86 or x64, provided that the JRE option is also installed during the development kit installation)

Step 2: Download the tool

You need to download the ANTLR tool from the ANTLR web site. This is a Java archive (*.jar) used to generate the C# code from an ANTLR grammar.

Step 3: Add or create a grammar file (*.g4) in your project

To avoid confusing your IDE, we suggest setting the build action to None for this file. See the docs and the book to learn about writing lexer and parser grammars.

Step 4: Generate the C# code

This can be done either from the cmd line, or by adding a custom pre-build command in your project. At minimal, the cmd line should look as follows: java -jar antlr4-4.13.2.jar -Dlanguage=CSharp grammar.g4 This will generate the files, which you can then integrate in your project. This is just a quick start. The tool has many useful options to control generation, please refer to its documentation.

Step 5: Add a reference to the ANTLR runtime in your project

The Antlr 4 standard runtime for C# is now available from NuGet. We trust that you know how to do add NuGet references to your project 😃. The package id is Antlr4.Runtime.Standard. We do not support other packages.

Use the GUI or the following command in the Package Manager Console:

Install-Package Antlr4.Runtime.Standard

Step 6: You're done!

Of course, the generated code is not going to meet your requirement by magic. There are 3 ways to use the generated code:

  • by generating a parse tree, and traversing it using a listener. This is the most common method.
  • by generating a parse tree, and traversing it using a visitor. This requires the -visitor option, and is a bit more work.
  • by providing code within your grammar, which gets executed when your input files are parsed. While the latter works, it is no longer the recommended approach, because it is not portable, and harder to maintain. More importantly, it breaks the parsing when your code breaks.

See the web site for examples of using the generated code.

To learn more about ANTLR 4, read the book.

Visual Studio integration

If you require tighter Visual Studio integration, you can use the tools from Tunnel Vision Labs. (please note however that they use a different tool and runtime)

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net35 is compatible.  net40 is compatible.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Net4x.Antlr4.Runtime.Standard:

Package Downloads
Net4x.SqlParameterizer.Parser

Package Description

Net4x.SqlParameterizer.Library

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.13.1.26263 122 9/20/2026
4.13.1 135 11/29/2025