patrickhuber / Pliant

MIT License
26 stars 4 forks source link

No msbuild task provided #86

Closed ArsenShnurkov closed 6 years ago

ArsenShnurkov commented 6 years ago

see https://github.com/antlr/antlrcs/tree/master/AntlrBuildTask for example

patrickhuber commented 6 years ago

Can you give some more detail on what you are trying to accomplish with a build task? Pliant doesn't require code generation to visit nodes in the AST. There are many reasons to support code generation, I'm trying to narrow it down to a specific feature that you want.

For example, generation of Syntax Trees that are concrete types based on a grammar instead of using the Syntax Forest and Syntax Tree nodes provided by the library.

ArsenShnurkov commented 6 years ago

I am trying to ensure the typical scenario: 1) developer writes grammar (like mygrammar.g3) according to syntax description (like EBNF) 2) developer adds that mygrammar.g3 file as source file into msbuild script (.csproj) 3) developer includes <import ...> directive of msbuild to include task definition 4) during compilation of application the msbuild calls the task and gives it grammar file as input 5) task calls your tool (like pliant.exe or pliant.dll), the tool converts grammar text into source (*.cs) files 6) then the msbuild completes processing of the build script (.csproj) and building the applied program

Antlr have special task for this. It is possible to make workaround like i did for gppg, but it is less convinient to use.

Pliant doesn't require code generation to visit nodes in the AST.

Yes, but how a grammar will be converted from its text definition into something which will be used as source data for parsing runtime?

I am not sure yet about antlr, but gppg generate tables for LALR parsing.

May be Pliant doesn't require any such things and interprets grammars on the fly.