Skip to main content
GameDev.net gamedev.net
🔒 Locked

C# small expression parser

Started by Endar Feb 24, 2009 at 7:09 AM 0 replies 2k views
Original Post
Endar
Endar
I'm looking for a 3rd party parser generator of some sort to create a small mathematical based language. It's not going to be anything really intensive, but at work I find myself often having to do a bunch of calculations by hand on a set of vectors while debugging. Also, a lot of what I currently do is in fixed point, not floating point. I thought it would be a good exercise, as well as useful, to write basically a Vector Calculator of sorts so I can do calculations with scalars as well as 2d, 3d, and 4d vectors at least, but maybe I'll write in support for variable dimension vectors. It's not going to be a large grammar like a full programming language, I intend to keep it pretty simple. So, the question was, does anyone know a good expression parser that I can use for C#? I've been using boost::spirit recently, and I know that there is spart, but I was wondering if anything else that is small and convenient has popped up recently? Preferably something where I can define the grammar in code without other external files.
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper
Telastyn
Telastyn
I don't know of any off hand. I have something internally that I use for a slightly larger grammar. Not sure it's small or convenient by others' standards and would need a cleanup if it were to get released.

It was pretty easy to create though if you pattern yourself after boost::spirit. The composite pattern works like a charm here.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.