Lex/Yacc for C#?

前端 未结 12 1742
隐瞒了意图╮
隐瞒了意图╮ 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:33

    I'm not sure Lex/Yacc will be of any help. You'll just need a basic tokenizer and an interpreter which are faster to write by hand. If you're still into parsing route see Irony.

    As a sidenote: have you considered PowerShell and its commandlets?

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

    If you don't fear alpha software and want an alternative to Lex / Yacc for creating your own languages, you might look into Oslo. I would recommend you to sit through session recordings of sessions TL27 and TL31 from last years PDC. TL31 directly addresses the creation of Domain Specific Languages using Oslo.

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

    As Anton said, PowerShell is probably the way to go. If you do want a lex/ yacc implementation then Malcolm Crowe has a good set.

    Edit: Direct Link to the Compiler Tools

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

    Still early CTP so can't be used in production apps but you may be interested in Oslo/MGrammar: http://msdn.microsoft.com/en-us/oslo/

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

    Jison is getting a lot of traction recently. It is a Bison port to javascript. Because of it's extremely simple nature, I've ported the jison parsing/lexing template to php, and now to C#. It is still very new, but if you get a chance, take a look at it here: https://github.com/robertleeplummerjr/jison/tree/master/ports/csharp/Jison

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

    Coco/R is a compiler generator with a .NET implementation. You could try that out, but I'm not sure if getting such a library to work would be faster than writing your own tokenizer.

    http://www.ssw.uni-linz.ac.at/Research/Projects/Coco/

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