Archive for July, 2008

What is a C++ Functor?

July 20th, 2008 | Category: C++, Programming

I did a presentation on the spirit library in the flesh recently and was surprised to find the big sticking point was C++ functors. So I thought I’d cover the concept here.

Read more

1 comment

Boost Spirit Part II (Attaching Actions to Your Grammar)

July 20th, 2008 | Category: C++, Programming

In the last article we covered how to define a grammar in the boost spirit library. This article will show you how to use the data parsed by the grammar with actions. The code for this example is here.
Read more

5 comments

Boost Spirit Part I (Validating Against a Grammar)

July 01st, 2008 | Category: C++, Programming

I haven’t done a post in a while, but I thought the boost spirit library was worth an entry. Spirit provides a way of specifying and parsing a custom language grammar right inline in C++ without the need for a code generator like lex/yacc. Spirit makes it so easy to specify and use a grammar that you should never hand write even the most trivial parser again.

The full code for this example can be found here.

Read more

5 comments