fsprojects / FsLexYacc

Lexer and parser generators for F#
http://fsprojects.github.io/FsLexYacc/
MIT License
204 stars 68 forks source link

Question: possible to run this as a CLI tool or as a dotnet tool? #212

Open njlr opened 1 month ago

njlr commented 1 month ago

I was wondering if it possible to run this outside of MSBuild.

For example like this:

dotnet tool install FsLexYacc
dotnet tool run fsyacc

I think this would be possible by adding an extra file to the Nuget package?

Settings file 'DotnetToolSettings.xml' was not found in the package.

Or perhaps this is already possible and I am missing something 🙂

Maybe related: https://github.com/fsprojects/FsLexYacc/issues/64

nojaf commented 1 month ago

Hello, this is currently not distributed as a tool (some properties are missing in https://github.com/fsprojects/FsLexYacc/blob/master/src/FsYacc/fsyacc.fsproj).

Downloading the FsLexYacc nuget package does contain the command line tool:

dotnet "C:\Users\nojaf\.nuget\packages\fslexyacc\11.2.0\build\fsyacc\net6.0\fsyacc.dll" --help

gives

fsyacc <filename>
        -o <string>: Name the output file.
        -v: Produce a listing file.
        --module <string>: Define the F# module name to host the generated parser.
        --internal: Generate an internal module
        --open <string>: Add the given module to the list of those to open in both the generated signature and implementation.
        --light: (ignored)
        --light-off: Add #light "off" to the top of the generated file
        --ml-compatibility: Support the use of the global state from the 'Parsing' module in FSharp.PowerPack.dll.
        --tokens: Simply tokenize the specification file itself.
        --lexlib <string>: Specify the namespace for the implementation of the lexer (default: FSharp.Text.Lexing)
        --parslib <string>: Specify the namespace for the implementation of the parser table interpreter (default: FSharp.Text.Parsing)
        --codepage <int>: Assume input lexer specification file is encoded with the given codepage.
        --buffer-type-argument <string>: Generic type argument of the LexBuffer type.
        --help: display this list of options
        -help: display this list of options

Any reason the MSBuild integration is not working for you?