Parser generator for C#?

Associate
Joined
15 Dec 2008
Posts
126
We've made this small domain specific language for a project we're working on now, with a hand-crafted parser We're looking in to building a proper grammar and parser for it as it's getting increasingly difficult to maintain the handbuild code. (Heavily based on regular expression with lots of repeating groups, it's getting pretty nasty by now).

Myself and a collegue both have a bit of experience with Flex+Bison, and we would like to put this stuff into a BNF grammar and use a similar tool to those.

I've been checking out C#Cup & C#Lex and the Garden's Point (GPPG and GPLEX) over the weekend. I'm leaning towards the latter one now as it looks like the production syntax is cleaner and has user definable struct as result type, but the lexer can't do case-insensitive matching. C#Cup seems to be a 1:1 port of it's original Java version, with datatypes as a predifened "Token" class, semantic values as "object" and a bit messier with more code required in the production rules, but C#Lex can do case insensitive matching by adding a directive.

I'm also gonna check out ANTLR when I get some free time again.

Anyone have experience in these tools, or know other similar tools I should look into?
 
Last edited:
Back
Top Bottom