24 #include <boost/config/warning_disable.hpp>
25 #include <boost/spirit/include/qi.hpp>
26 #include <boost/fusion/include/adapt_struct.hpp>
28 #define BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
29 #define BOOST_SPIRIT_QI_DEBUG
49 std::cerr <<
"can't handle binary data yet" <<
std::endl;
55 template <attributes A>
60 std::string attributeString;
64 attributeString =
"lines_per_row";
67 attributeString =
"no_row_count";
70 attributeString =
"fixed_row_count";
73 attributeString =
"additional_header_lines";
76 attributeString =
"column_major_order";
79 attributeString =
"endian";
84 std::cerr << attributeString <<
" not supported yet" <<
std::endl;
91 out <<
"mode = " << data_.
mode_m;
102 namespace SDDS {
namespace parser
104 namespace qi = boost::spirit::qi;
105 namespace ascii = boost::spirit::ascii;
106 namespace phx = boost::phoenix;
108 template <
typename Iterator>
109 struct data_parser: qi::grammar<Iterator, data(), skipper<Iterator> >
111 data_parser(error_handler<Iterator> & _error_handler);
113 qi::rule<Iterator, data(), skipper<Iterator> > start;
114 qi::rule<Iterator,
ast::datamode(), skipper<Iterator> > data_mode;
115 qi::rule<Iterator, long(), skipper<Iterator> > data_lines,
116 data_row, data_fixed, data_additional;
117 qi::rule<Iterator, short(), skipper<Iterator> > data_column;
118 qi::rule<Iterator,
ast::endianess(), skipper<Iterator> > data_endian;
119 qi::rule<Iterator, ast::nil(), skipper<Iterator> > data_unsupported_pre,
120 data_unsupported_post;
121 qi::symbols<char, ast::endianess> dataendian;
122 qi::symbols<char, ast::datamode>
datamode;
Inform & endl(Inform &inf)
BOOST_FUSION_ADAPT_STRUCT(SDDS::data,(SDDS::ast::datamode, mode_m)(long, numberRows_m)) namespace SDDS
std::ostream & operator<<(std::ostream &out, const array &)
@ ADDITIONAL_HEADER_LINES