ASCII version of char_
and all char related parsers. Other encodings are also provided
(e.g. also an ISO8859.1)

boost::spirit::arg_names

Special phoenix placeholders for spirit

Note

If you feel uneasy with using whole namespaces, feel free to qualify
your code, use namespace aliases, etc. For the purpose of this tutorial,
we will be presenting unqualified names for both Spirit and Phoenix.
No worries, we will always present the full working code, so you won't
get lost. In fact, all examples in this tutorial have a corresponding
cpp file that QuickBook (the documentation tool we are using) imports
in here as code snippets.

Now the actual parser:

template<typenameIterator>booladder(Iteratorfirst,Iteratorlast,double&n){boolr=qi::phrase_parse(first,last,// Begin grammar(double_[ref(n)=_1]>>*(','>>double_[ref(n)+=_1])),// End grammarspace);if(first!=last)// fail if we did not get a full matchreturnfalse;returnr;}

This is almost like our original numbers list example. We're incrementally
building on top of our examples. This time though, like in the complex
number example, we'll be adding the smarts. There's an accumulator (double&n) that adds the numbers parsed. On a
successful parse, this number is the sum of all the parsed numbers.

The first double_ parser
attaches this action:

ref(n)=_1

This assigns the parsed result (actually, the attribute of double_) to n.
ref(n) tells
Phoenix that n is a mutable reference. _1 is a Phoenix
placeholder for the parsed result attribute.