Skip to content

Instantly share code, notes, and snippets.

@GeorgDangl
Last active August 12, 2017 00:06
Show Gist options
  • Save GeorgDangl/2761c001fa99c1189ca8192a9324efaa to your computer and use it in GitHub Desktop.
Save GeorgDangl/2761c001fa99c1189ca8192a9324efaa to your computer and use it in GitHub Desktop.
Using ANTLR4 C# MSBuild tasks
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="Antlr4.Runtime" Version="4.6.4" />
<PackageReference Include="Antlr4.CodeGenerator" Version="4.6.5-beta001">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Antlr4 Include="Calculator.g4">
<Generator>MSBuild:Compile</Generator>
<CustomToolNamespace>Dangl.Calculator.Generated</CustomToolNamespace>
<Listener>False</Listener>
<Visitor>True</Visitor>
</Antlr4>
</ItemGroup>
<!-- Use this if you don't want to depend on the Java tool -->
<PropertyGroup>
<Antlr4UseCSharpGenerator>True</Antlr4UseCSharpGenerator>
</PropertyGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment