You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, there's no F# target for the standard Antlr4 tool. And, there isn't one either for the Antlr4cs tool and runtime, which is a rewrite of Antlr4 in C# by Sam Harwell.
But, I think you can place the code in a separate csproj and can then interop with F#. I would recommend you pull your .g4's into a directory, and download the Trash trgen dotnet tool (dotnet tool install -g trgen), then in a shell prompt trgen -s name-of-start-rule. It looks in your current directory containing the Antlr grammar, then will create a csproj you can call from F#. You should modify the generated parser driver code for what you need.
In th project file there is the option
<DOptions>language=CSharp</DOptions>
Setting it to
<DOptions>language=FSharp</DOptions>
results in the error:
The "RunAntlrTool" task returned false but did not log an error
Is it possible to set it to F# / to generate F# code with ANTLR? Or is the only option to create a separate C# project in which the code is generated?
The text was updated successfully, but these errors were encountered: