What parser generator software runs on C#, parses languages with left-recursion and can produce an abstract syntax tree?

StackOverflow https://stackoverflow.com/questions/11567051

Question

I spent the morning figuring out the basics ANTLR to find out it's LL, only. I need to keep left recursion in my grammar so that the syntax tree has left-to-right associativity.

EDIT 2: Recently I was in need of another parser-generator. While MPLex and MPPG worked they were somewhat lengthy to configure, so I thought I'd look again. This time I came across Hime Parser Generator - in a matter of an hour or two I had a parser converting basic expressions to LINQ Expressions that could be compiled and invoked. It's stupid simple and I recommend it over MPLex and MPPG.

EDIT 1: GOLD Parser does what I needed but its source isn't available so that barred it from being used.

MPLex and MPPG are official Microsoft products that are Lex/Flex and Bison/Yacc, respectively. There isn't much documentation on them, and they're not quite clones of said open source projects, but it was possible to do what I needed with those. If you don't have to deal with real-world politics, I'd recommend GOLD, as it has a nice debugging GUI and everything, but if you're forced to either open-source or Microsoft-official projects, MPLex and MPPG may be the way to go. Note that said two applications are really just derivatives of GPLEX and GPPG. The latter two may be more up-to-date than Microsoft's derivatives since I think Microsoft abandoned the project. The only documentation I could find for Microsoft's derivatives are contained in two PDF's in the VS 2008 SDK. Microsoft took the pdf's out explaining their usage, in spite of shipping the exe's with VS 2010 SDK. It looks like neither pdf's nor the exe's are going to be shipped with 2012, though.

Was it helpful?

Solution

One of the more popular ones that generates C# code would be: GOLD Parsing System (LALR).

For a comparison of many parser generators, see: http://en.wikipedia.org/wiki/Comparison_of_parser_generators

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top