OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
version_def.hpp
Go to the documentation of this file.
1 //
2 // Copyright & License: See Copyright.readme in src directory
3 //
4 
9 #ifndef VERSION_DEF_HPP_
10 #define VERSION_DEF_HPP_
11 
12 #include "version.hpp"
13 
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>
18 
19 namespace SDDS { namespace parser
20 {
21  template <typename Iterator>
22  version_parser<Iterator>::version_parser(error_handler<Iterator> & _error_handler):
23  version_parser::base_type(start)
24  {
25  using qi::on_error;
26  using qi::fail;
27  using phx::function;
28  typedef function<error_handler<Iterator> > error_handler_function;
29 
30  // qi::_1_type _1;
31  qi::_3_type _3;
32  qi::_4_type _4;
33  // qi::_val_type _val;
34  qi::short_type short_;
35  qi::no_skip_type no_skip;
36  qi::lit_type lit;
37 
38  start %= no_skip[lit("SDDS") > short_];
39 
40  BOOST_SPIRIT_DEBUG_NODES(
41  (start)
42  )
43 
44  on_error<fail>(start,
45  error_handler_function(_error_handler)(
46  std::string("Error! Expecting "), _4, _3));
47  }
48 }}
49 #endif /* VERSION_DEF_HPP_ */