Subject: Re: [boost] Library for configuration file parsing
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-12-01 12:08:13
Marsh Ray wrote:
> All I was trying to say was that I could really use a no-fuss,
> bulletproof JSON facility and Spirit seemed like overkill for this
> simple format.
The benefit of using spirit to make a parser is that reduces the
task to rendering the grammer as BNF or PEG syntax. Subsequent
maintainence is reduced to tweaking the grammar.
Writing a "correct" and "robust" parser for some grammer x in C
or C++ is much more work than it first appears. It is also extremely
tedious and error prone. The worst is that it is very easy to make
a "first cut" which works "pretty well" and that decieves one into
thinking that he's about done when in fact there is a lot of tweaks
in the pipeline end point cases, and lots of unanticipated errors.
Using spirit mostly eliminates these problems. Spirit does take
some time to learn. Using a declarative syntax takes getting used
to. And there are hiccups with TMP. But all in all, it is a
much better way to get the most of one's brain. It results in a
better defined, more complete, more robust, more correct
and cheaper to maintain and upgrade final product. I personally
would be suspicious of a library submission which could
use it but declines to do so. Actually, parsing a JSON file
would best rendered as an example application for spirit.
> - Marsh
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk