tunnelvisionlabs / antlr4cs

The original, highly-optimized C# Target for ANTLR 4
Other
448 stars 103 forks source link

This repo should be archived #381

Open lextm opened 1 year ago

lextm commented 1 year ago

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

  1. Archive this repo on GitHub.
  2. (optional) Mark its NuGet packages as deprecated.

Those steps are critical to ensure new users know what are the right things to use.

The actual migration can be rather easy, like this example.

johnholliday commented 2 months 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:

  1. 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.

  2. 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.

mike-lischkey/vscode-antlr4