Boost logo

Boost Users :

Subject: Re: [Boost-users] [wave] How to enumerate all function declarations in a preprocessed header
From: David Larsson (laserallan_at_[hidden])
Date: 2009-05-10 17:01:57

Thanks, that was what I needed to get going.

On Sun, May 10, 2009 at 5:37 PM, Hartmut Kaiser <hartmut.kaiser_at_[hidden]>wrote:

> > I'm trying to use booost.wave to parse some C headers and generate code
> > for
> > each function declaration found.
> >
> > How would you write code that identifies all function declarations?
> >
> > Is there any higher level structure that helps me finding this or do I
> > need to
> > create some state machine that matches the pattern for a function
> > declaration
> > from what's found in the token iterator?
> Wave is a tokenizing preprocessor. That means all it can do is to return
> the
> recognized C++ tokens as seen in the input stream. In order to make some
> sense out of the token stream you need to write a parser matching the input
> you're looking for. You might want to look at one of Wave's examples,
> Hannibal, which is a partial C++ parser written using Spirit V1.8. In your
> case a much simpler grammar should be sufficient, though, as you're looking
> for function declarations only. Another pointer could be:
> Those guys were using
> Spirit/Wave to instrument C++ code for template metaprogramming debugging
> purposes.
> Regards Hartmut
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at