OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
version_def.hpp
Go to the documentation of this file.
1 //
2 // Struct version
3 //
4 // Copyright (c) 2015, Christof Metzger-Kraus, Helmholtz-Zentrum Berlin
5 // All rights reserved
6 //
7 // This file is part of OPAL.
8 //
9 // OPAL is free software: you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation, either version 3 of the License, or
12 // (at your option) any later version.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
16 //
17 #ifndef VERSION_DEF_HPP_
18 #define VERSION_DEF_HPP_
19 
20 #include "version.hpp"
21 
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>
26 
27 namespace SDDS { namespace parser
28 {
29  template <typename Iterator>
30  version_parser<Iterator>::version_parser(error_handler<Iterator> & _error_handler):
31  version_parser::base_type(start)
32  {
33  using qi::on_error;
34  using qi::fail;
35  using phx::function;
36  typedef function<error_handler<Iterator> > error_handler_function;
37 
38  // qi::_1_type _1;
39  qi::_3_type _3;
40  qi::_4_type _4;
41  // qi::_val_type _val;
42  qi::short_type short_;
43  qi::no_skip_type no_skip;
44  qi::lit_type lit;
45 
46  start %= no_skip[lit("SDDS") > short_];
47 
48  BOOST_SPIRIT_DEBUG_NODES(
49  (start)
50  )
51 
52  on_error<fail>(start,
53  error_handler_function(_error_handler)(
54  std::string("Error! Expecting "), _4, _3));
55  }
56 }}
57 #endif /* VERSION_DEF_HPP_ */
Definition: array.hpp:33