[ACCEPTED]-Lex/Yacc for C#?-yacc
I've done a couple of small projects with 13 GPLEX/GPPG, which are pretty straightforward 12 reimplementations of LEX/YACC in C#. I've 11 not used any of the other tools above, so 10 I can't really compare them, but these worked 9 fine.
That 8 being said, I agree, a full LEX/YACC solution 7 probably is overkill for your problem. I 6 would suggest generating a set of bindings 5 using IronPython: it interfaces easily with 4 .NET code, non-programmers seem to find 3 the basic syntax fairly usable, and it gives 2 you a lot of flexibility/power if you choose 1 to use it.
I'm not sure Lex/Yacc will be of any help. You'll 4 just need a basic tokenizer and an interpreter 3 which are faster to write by hand. If you're 2 still into parsing route see Irony.
As a sidenote: have 1 you considered PowerShell and its commandlets?
Also look at Antlr, which has C# support.
Still early CTP so can't be used in production 1 apps but you may be interested in Oslo/MGrammar: http://msdn.microsoft.com/en-us/oslo/
If you don't fear alpha software and want 6 an alternative to Lex / Yacc for creating 5 your own languages, you might look into 4 Oslo. I would recommend you to sit through session 3 recordings of sessions TL27 and TL31 from 2 last years PDC. TL31 directly addresses the creation of 1 Domain Specific Languages using Oslo.
Coco/R is a compiler generator with a .NET 4 implementation. You could try that out, but 3 I'm not sure if getting such a library to 2 work would be faster than writing your own 1 tokenizer.
I would suggest csflex - C# port of flex - most 1 famous unix scanner generator.
I believe that lex/yacc are in one of the 2 SDKs already (i.e. RTM). Either Windows 1 or .NET Framework SDK.
As Anton said, PowerShell is probably the 2 way to go. If you do want a lex/ yacc implementation 1 then Malcolm Crowe has a good set.
Just for the record, implementation of lexer 4 and LALR parser in C# for C#:
It should be 3 similar in use to Lex/Yacc, however those 2 tools (NLT) are not generators! Thus, forget 1 about speed.
More Related questions