Subject: Re: [boost] Library for configuration file parsing
From: Michael Caisse (boost_at_[hidden])
Date: 2010-12-03 21:34:20
On 12/02/2010 07:15 AM, Denis Shevchenko wrote:
> On 02.12.2010 17:58, Hartmut Kaiser wrote:
>> All of your stated goals could be achieved by using Spirit underneath
>> as the
>> parser engine for your config file format, no?
>> Regards Hartmut
> Strictly speaking, yes.
> Be honest, I did not use Spirit because (imho) it's difficult-to-study
> library. I may be wrong, but I was easier to write own parser engine
> using Boost.String algo, Boost.Regex and std::algorithm (the more so
> becausethe complexity of parsing there is not so high).
> - Denis
I'm surprised (shocked) at the number of people who initially respond
with this point-of-view. I can only assume that it is the difficulty of
"seeing" BNF looking statements in C++. It must be the fact that it is a
DSEL and people just don't think that could be possible so it looks
foreign and they stop at that.
Surely it isn't reading BNF or some other well described grammar format
that is causing problems. If that is it ... then there is a more serious
problem that a library isn't going to fix.
Spirit itself (Qi and Karma) are quite simple and in my experience
helping people on IRC, within a couple hours most are able to solve
simple problems and by the end of a couple days they are proficient and
prolific. The documentation for Spirit is excellent and in my opinion,
some of the best in all of Boost. For additional docs, have a look at my
boostcon slides and video.
video: <http://blip.tv/file/4143337 >
It would be helpful if you can be more specific about what causes
difficulty for you. We are constantly trying to improve the
documentation and tutorials to make them more accessible. You will see
within the first couple slides in my presentation that I condemn ad-hoc
parsers thrown together using string, regex, algorithm and the like
simply because the implementor thinks the parsing task is "simple".
Spirit allows you to write simple parsers in-line with a syntax that is
easy to understand and maintain.
There seems to be an attitude within our profession in general that
writing ugly code because the task at hand isn't too complex makes it
ok. I have a tendency to disagree.
-- Michael Caisse Object Modeling Designs www.objectmodelingdesigns.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk