471,318 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,318 software developers and data experts.

Parser Generator for C#?

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
Jun 27 '08 #1
7 2099
On Sat, 24 May 2008 14:10:18 -0700, je**********@gmail.com wrote:
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
Jun 27 '08 #2
je**********@gmail.com wrote:
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/AN...+CSharp+Target

http://grammatica.percederberg.net/

Arne
Jun 27 '08 #3
In addition to the others mentioned, you could look at
http://www.frontiernet.net/~fredm/pa...istWebPage.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.

<je**********@gmail.comwrote in message
news:6d**********************************@r66g2000 hsg.googlegroups.com...
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

Jun 27 '08 #4
On May 24, 3:10*pm, "jehugalea...@gmail.com" <jehugalea...@gmail.com>
wrote:
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.
Jun 27 '08 #5
On May 24, 3:37*pm, "Fred Mellender" <nospamPlease_fred...@gmail.com>
wrote:
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.

<jehugalea...@gmail.comwrote in message

news:6d**********************************@r66g2000 hsg.googlegroups.com...
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- Hide quoted text -

- Show quoted text -
This is what I'm looking for. Thanks!
Jun 27 '08 #6
je**********@gmail.com wrote:
On May 24, 3:10 pm, "jehugalea...@gmail.com" <jehugalea...@gmail.com>
wrote:
>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#.
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#)
------------------------------------------------------------------------
Jun 27 '08 #7
Frans Bouma [C# MVP] wrote:
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?

--
Arto Viitanen
Jun 27 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Jean de Largentaye | last post: by
2 posts views Thread by alederer | last post: by
12 posts views Thread by pmatos | last post: by
3 posts views Thread by Jang | last post: by
2 posts views Thread by karthik bala guru | last post: by
7 posts views Thread by (Jamie Andrews) | last post: by
6 posts views Thread by Mike C# | last post: by
9 posts views Thread by Peter Michaux | last post: by
28 posts views Thread by Marc Gravell | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.