tags:

views:

529

answers:

4

I need to write a simple parser to a sort of Domain Specific Language.
It needs to have basic arithmatics with proper operators evaluation order and a syntax to call functions of the underlying environment which can be overloaded.
What is the simplest way to write such a parser? Is there something I can adapt or use out of the box? I'm writing in C++.

+2  A: 

ANTLR will help you a lot.

Elroy
+2  A: 

I used Ragel parse some data. It worked pretty well for me.

nuriaion
+3  A: 

Take a look at Boost Spirit.

dirkgently
+1  A: 

See MetaII parser technology. This tutorial walks you through everything:

http://www.bayfronttechnologies.com/mc_tutorial.html

Ira Baxter