lesbegue's alter ego
lesbegue's alter ego

Reputation: 1185

Parser builders for C#/.NET

I want to write a simple DSL in C#. Nothing too complicated. I'm looking for the .NET equivalent of Lex & Yacc. The easiest one I've found so far is GOLD Parser builder. The other choice is to use the lex & yacc available with F#, but I'm not keen to program in F# right now.

If you have any suggestions for the .NET version of Lex or Yacc, I'd love to hear them!

Thanks!

Upvotes: 3

Views: 1922

Answers (5)

Jason Short
Jason Short

Reputation: 5324

There is also a C# Lex and C# CUP that I found on a Vienna University website

C# Lex Manual

Upvotes: 0

John Saunders
John Saunders

Reputation: 161773

I don't know if it's what you're looking for, but Oslo has the ability to create a textual DSL.

It's got more features than that, but you can ignore all the repository and Grand Vision stuff and just produce a grammar you can use to parse your DSL into an AST. Alternatively, you can take advantage of the built-in support for parsing into a set of rows in a database.

Upvotes: 0

Erik Forbes
Erik Forbes

Reputation: 35861

If you really want to stay in C#, I would recommend using the Irony toolkit - it allows you to specify grammars in C# code.

Upvotes: 8

Robert Harvey
Robert Harvey

Reputation: 180787

How much F# programming do you need to do to take advantage of the Lex & Yacc? Can you throw what you need into an F# dll, and reference it from a C# project?

Upvotes: 1

Matthew Flaschen
Matthew Flaschen

Reputation: 284786

ANTLR 3 has a C# target.

Upvotes: 3

Related Questions