Parser Generator for C#?

J

jehugaleahsa

Hello:

I have been looking for a tool similar to Lex and Yacc for C#. I would
like to be able to generate grammars so I can write a simple
interpreter for another piece of code. However, I have to make many
future grammars and was hoping to find a tool that would allow me to
generate as many as I would like.

I was hoping someone had made a port for C#. I haven't had any luck
looking for one, so any direction would be appreciated.

Thanks a lot,
Travis
 
J

j1mb0jay

Hello:

I have been looking for a tool similar to Lex and Yacc for C#. I would
like to be able to generate grammars so I can write a simple interpreter
for another piece of code. However, I have to make many future grammars
and was hoping to find a tool that would allow me to generate as many as
I would like.

I was hoping someone had made a port for C#. I haven't had any luck
looking for one, so any direction would be appreciated.

Thanks a lot,
Travis

Mono

http://www.mono-project.com/Main_Page

Hope this helps

j1mb0jay
 
A

Arne Vajhøj

I have been looking for a tool similar to Lex and Yacc for C#. I would
like to be able to generate grammars so I can write a simple
interpreter for another piece of code. However, I have to make many
future grammars and was hoping to find a tool that would allow me to
generate as many as I would like.

I was hoping someone had made a port for C#. I haven't had any luck
looking for one, so any direction would be appreciated.

There are plenty.

Google places the following high for me:

http://www.ssw.uni-linz.ac.at/coco/#CS

http://www.antlr.org/wiki/display/ANTLR3/Antlr+3+CSharp+Target

http://grammatica.percederberg.net/

Arne
 
J

jehugaleahsa

Hello:

I have been looking for a tool similar to Lex and Yacc for C#. I would
like to be able to generate grammars so I can write a simple
interpreter for another piece of code. However, I have to make many
future grammars and was hoping to find a tool that would allow me to
generate as many as I would like.

I was hoping someone had made a port for C#. I haven't had any luck
looking for one, so any direction would be appreciated.

Thanks a lot,
Travis

Just to clarify, I don't want to be able to parse C# files, I want to
generate parsers using C#.

Thanks for everyone's input.
 
J

jehugaleahsa

In addition to the others mentioned, you could look athttp://www.frontiernet.net/~fredm/parser/LinguistWebPage.htm

It does not generate C# programs, but is a dll called by your C# program
from which you can interact with the parse trees (generated by the parser
from a grammar file and the input text).  The system is written in C# and is
open source so you can modify it as you see fit.









- Show quoted text -

This is what I'm looking for. Thanks!
 
F

Frans Bouma [C# MVP]

Just to clarify, I don't want to be able to parse C# files, I want to
generate parsers using C#.

You can use ANTLR, which is a mature parser generator framework, but a
bit weird perhaps.
You can also use Goldparser. Both are free.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
A

Arto Viitanen

Frans said:
You can use ANTLR, which is a mature parser generator framework, but
a bit weird perhaps.

Has anyone examples on using StringTemplates to generate ILASM
code or to use Reflection.Emit with Antlr?
 
Joined
Apr 8, 2011
Messages
2
Reaction score
0
i want to use some built in lexical analyzer / parser in c#.

i cant find any sample or tutorial for sepcifying how to use it in my code.

if any one has tried any analyzer then please let me know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top