Antlr4CodeGenerator.Tool
2.3.0
dotnet tool install --global Antlr4CodeGenerator.Tool --version 2.3.0
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local Antlr4CodeGenerator.Tool --version 2.3.0
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Antlr4CodeGenerator.Tool&version=2.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package Antlr4CodeGenerator.Tool --version 2.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Antlr4 CodeGenerator tool
Just a commandline wrapper around the ANTLR (Java) tool (Version 4.13.1) for generating grammar artifacts.
The ANTLR (Java) tool is bundled, so no need to download it.
Dependencies
- Java runtime
Installation
Install as dotnet global tool:
dotnet tool install --global Antlr4CodeGenerator.Tool
Install as dotnet local tool (inside a dotnet project where you want to generate language artifacts):
- See also sample project
- Enable local dotnet tools for your project by the following command on solution file directory level:
dotnet new tool-manifest
- Install as local tool to your project:
dotnet tool install Antlr4CodeGenerator.Tool
Usage
This tool only proxies the arguments to the ANTLR (Java) tool. (See also ANTLR (Java) tool arguments documentation)
global tool:
dotnet antlr4-tool -Dlanguage=CSharp MyGrammar.g4
local tool via MsBuild target:
- See also sample project
<Target Name="GenerateAntlrArtifacts" BeforeTargets="BeforeResolveReferences"> <PropertyGroup> <_GrammarFile>$(ProjectDir)calculator.g4</_GrammarFile> <_Generated>$(ProjectDir).generated\</_Generated> <_Namespace>MyCalculator</_Namespace> </PropertyGroup> <Exec Command="dotnet antlr4-tool -Dlanguage=CSharp -o "$(_Generated)" -visitor -listener -package $(_Namespace) "$(_GrammarFile)"" /> </Target>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
2.3.0 | 122 | 6/24/2024 |
2.3.0-alpha0002 | 214 | 9/25/2023 |
2.2.0 | 662 | 9/25/2023 |
2.1.0 | 964 | 4/1/2023 |
2.1.0-antlr4-12-0001 | 232 | 4/1/2023 |
2.0.0 | 933 | 10/29/2022 |
1.3.0-updates0004 | 258 | 10/29/2022 |
1.3.0-updates0003 | 227 | 10/29/2022 |
1.3.0-updates0002 | 212 | 10/29/2022 |
1.3.0-updates0001 | 192 | 10/29/2022 |
1.2.0 | 1,712 | 5/9/2020 |
1.2.0-alpha0013 | 396 | 5/9/2020 |
1.2.0-alpha0012 | 372 | 5/9/2020 |
1.1.0 | 529 | 5/8/2020 |