Lex/Yacc for C#?

前端 未结 12 1743
隐瞒了意图╮
隐瞒了意图╮ 2020-11-29 06:21

Actually, maybe not full-blown Lex/Yacc. I\'m implementing a command-interpreter front-end to administer a webapp. I\'m looking for something that\'ll take a grammar definit

相关标签:
12条回答
  • 2020-11-29 06:22

    I would suggest csflex - C# port of flex - most famous unix scanner generator.

    0 讨论(0)
  • 2020-11-29 06:25

    Also look at Antlr, which has C# support.

    0 讨论(0)
  • 2020-11-29 06:27

    Just for the record, implementation of lexer and LALR parser in C# for C#:

    http://code.google.com/p/naive-language-tools/

    It should be similar in use to Lex/Yacc, however those tools (NLT) are not generators! Thus, forget about speed.

    0 讨论(0)
  • 2020-11-29 06:30

    I believe that lex/yacc are in one of the SDKs already (i.e. RTM). Either Windows or .NET Framework SDK.

    0 讨论(0)
  • 2020-11-29 06:31

    Gardens Point Parser Generator here provides Yacc/Bison functionality for C#. It can be donwloaded here. A usefull example using GPPG is provided here

    0 讨论(0)
  • 2020-11-29 06:32

    I've done a couple of small projects with GPLEX/GPPG, which are pretty straightforward reimplementations of LEX/YACC in C#. I've not used any of the other tools above, so I can't really compare them, but these worked fine.

    GPPG can be found here and GPLEX here.

    That being said, I agree, a full LEX/YACC solution probably is overkill for your problem. I would suggest generating a set of bindings using IronPython: it interfaces easily with .NET code, non-programmers seem to find the basic syntax fairly usable, and it gives you a lot of flexibility/power if you choose to use it.

    0 讨论(0)
提交回复
热议问题