views:

1057

answers:

5

Is there a good parser generator (think lex/yacc or antlr) for .NET? Any that have a license that would not scare lawyers? Lot’s of LGPL but I am working on embedded components and some organizations are not comfortable with me taking an LGPL dependency.

I've heard that Oslo may provide this functionality but I'm not sure if it's a build time dependency or also a runtime dependency. Can anyone clarify what Oslo will provide?

UPDATE
What I would really like is a parser generator that is a build time only dependency. It looks like ANTLR has a runtime component.

+4  A: 

Hmmm you already mentioned Antlr so I am not sure why you aren't consider it ...

Antlr generates C# (http://www.antlr.org/wiki/display/ANTLR3/Antlr%2B3%2BCSharp%2BTarget) and has an BSD license (http://www.antlr.org/license.html) that seems to have very few restrictions.


Irony (http://irony.codeplex.com/) has quite a number of downloads and a (easy on the eyes) MIT license. Appears to have Full source code so it might be possible to "imbed" this directly into your app.

BlueShepherd
I'm getting it reviewed by our legal team now... right now I am considering ANTLR and jayc (used on the mono project).
spoon16
+2  A: 

ANTLR has a runtime component, but you can always take the few classes it uses and include them in your project, at which point you no longer need to reference the runtime assembly. It's licensed under the BSD license - 3 clause for the C# 3 target and 4 clause for the C# 2 target.

280Z28
+2  A: 

I just discovered that F# ships with an implementation of yacc and lex. It looks like I will be able to leverage this parser generator for my .NET needs.

F# Samples

The Parsing sample shows how to use the fsyacc and fslex tools to build parsers and lexers for use with F#. (Mode: Compiled, Runs on: any CLI, including Mono)

Related blog posts:

spoon16
A: 
John Bartholomew
Mister John, using GOlD Parser, can I get easily a SQL Oracle Parser in C# ?? Thx
alhambraeidos
A: 

You could also try Malcolm Crowe's LEX/YACC compiler tools. Lots of good examples.

Kieron
They have a runtime component.
Simeon Pilgrim