问题
ANTLR is a great piece of software, but, in my opinion, is a little bit uncomfortable for a C# programmer (the C# porting is out of date, the parser antlr-3.1.3.jar required java, etc) I'm looking for a "more C# native" language tool in order to parse a simple json-like grammar, any suggestion?
回答1:
I've used the GOLD Parser Generator, a freeware tool that you can use to specify BNF grammars, and then generate a parser in almost any target language including C#. You can also modify the way the parser generator generates C# code by altering a text template.
http://www.devincook.com/goldparser/
回答2:
peg-sharp (C# packrat parser) is a simple but valid alternative.
来源:https://stackoverflow.com/questions/5242750/is-there-a-valid-alternative-to-antlr-written-in-c