9 #ifndef DESCRIPTION_DEF_HPP_
10 #define DESCRIPTION_DEF_HPP_
14 #include <boost/spirit/include/phoenix_core.hpp>
15 #include <boost/spirit/include/phoenix_operator.hpp>
16 #include <boost/spirit/include/phoenix_fusion.hpp>
17 #include <boost/spirit/include/phoenix_bind.hpp>
19 namespace SDDS {
namespace parser
21 template <
typename Iterator>
22 description_parser<Iterator>::description_parser(error_handler<Iterator> & _error_handler):
23 description_parser::base_type(start)
28 typedef function<error_handler<Iterator> > error_handler_function;
33 qi::lexeme_type lexeme;
38 quoted_string %= lexeme[
'"' >> +(char_ -
'"') >>
'"'];
39 description_text = lit(
"text") >
'=' > quoted_string;
40 description_content = lit(
"contents") >
'=' > quoted_string;
44 > ((description_text[phx::at_c<0>(_val) = _1]
45 > -(
',' > description_content[phx::at_c<1>(_val) = _1]))
46 |(description_content[phx::at_c<1>(_val) = _1]
47 > -(
',' > description_text[phx::at_c<0>(_val) = _1])))
50 BOOST_SPIRIT_DEBUG_NODES(
55 error_handler_function(_error_handler)(
56 std::
string("Error! Expecting "), _4, _3));