Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost::Spirit::Qi parsing into list
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-02-08 09:07:40


On 2/8/2011 12:48 PM, Slide wrote:
> I am looking at using Boost::Spirit for parsing a set of hardware
> register definitions. From the examples I have seen, it looks like one
> mainly creates a structure and then that is what is returned from the
> parsing of the input. I was wondering if anyone could point me towards
> some examples that might parse out a list of items and return them.
> The end goal is to parse in the register definitions and then generate
> C/C++ code from those register definitions to define a hardware access
> layer that can be used by my other libraries on my chip. So, I would
> parse the register definitions into a vector and then iterate over
> that vector to generate the necessary code.

Check out the examples directory. There are tons of examples there.
Check out boost/libs/spirit/example/qi/num_list1.cpp up to num_list4.cpp
It's fully documented in the tutorial section.

Cheers,

-- 
Joel de Guzman
http://www.boostpro.com
http://boost-spirit.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net