17 #ifndef DESCRIPTION_DEF_HPP_
18 #define DESCRIPTION_DEF_HPP_
22 #include <boost/spirit/include/phoenix_core.hpp>
23 #include <boost/spirit/include/phoenix_operator.hpp>
24 #include <boost/spirit/include/phoenix_fusion.hpp>
25 #include <boost/spirit/include/phoenix_bind.hpp>
27 namespace SDDS {
namespace parser
29 template <
typename Iterator>
30 description_parser<Iterator>::description_parser(error_handler<Iterator> & _error_handler):
31 description_parser::base_type(start)
36 typedef function<error_handler<Iterator> > error_handler_function;
41 qi::lexeme_type lexeme;
46 quoted_string %= lexeme[
'"' >> +(char_ -
'"') >>
'"'];
47 description_text = lit(
"text") >
'=' > quoted_string;
48 description_content = lit(
"contents") >
'=' > quoted_string;
52 > ((description_text[phx::at_c<0>(_val) = _1]
53 > -(
',' > description_content[phx::at_c<1>(_val) = _1]))
54 |(description_content[phx::at_c<1>(_val) = _1]
55 > -(
',' > description_text[phx::at_c<0>(_val) = _1])))
58 BOOST_SPIRIT_DEBUG_NODES(
63 error_handler_function(_error_handler)(
64 std::string(
"Error! Expecting "), _4, _3));