Open lextm opened 1 year ago
Just to clarify for others who may venture this way...
Here is my setup in VS2022
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Remove="ECML.g4" />
</ItemGroup>
<ItemGroup>
<Antlr4 Include="ECML.g4">
<Listener>False</Listener>
<AntOutDir>Generated</AntOutDir>
<Package>ECML</Package>
</Antlr4>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Antlr4.Runtime.Standard" Version="4.13.1" />
<PackageReference Include="Antlr4BuildTasks" Version="12.8.0" />
<PackageReference Include="CXuesong.LanguageServer.VsCode" Version="0.3.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
</Project>
Notes:
You can select the .G4 file and switch to the Properties window, changing the Build Action to 'ANTLR 4 grammar', and then edit the properties to your liking.
You can use VSCode with Mike Lischke's EXCELLENT extension to edit the language grammar for a great editing and debugging experience. It will generate duplicate code into the .antlr subfolder, which is excluded from the VS2022 project, so you get the best of both worlds.
Since NuGet packages from this repo only cover ANTLR 4.6 and below and end users should migrate to Antlr4.Runtime.Standard (and Antlr4BuildTasks), I think it is time to
Those steps are critical to ensure new users know what are the right things to use.