OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
include.hpp
Go to the documentation of this file.
1 //
2 // Copyright & License: See Copyright.readme in src directory
3 //
4 
9 #ifndef INCLUDE_HPP_
10 #define INCLUDE_HPP_
11 
12 #include "ast.hpp"
13 #include "skipper.hpp"
14 #include "error_handler.hpp"
15 
16 #include <boost/config/warning_disable.hpp>
17 #include <boost/spirit/include/qi.hpp>
18 #include <boost/spirit/include/phoenix_core.hpp>
19 #include <boost/spirit/include/phoenix_operator.hpp>
20 #include <boost/spirit/include/phoenix_fusion.hpp>
21 #include <boost/spirit/include/phoenix_bind.hpp>
22 #include <boost/fusion/include/adapt_struct.hpp>
23 
24 #include <list>
25 
26 #define BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
27 #define BOOST_SPIRIT_QI_DEBUG
28 
29 namespace SDDS {
30  struct include
31  {
34  };
35 
36  template <attributes A>
38  {
39  static bool apply()
40  {
41  std::string attributeString;
42  switch(A)
43  {
44  case FILENAME:
45  attributeString = "filename";
46  break;
47  case INCLUDE:
48  attributeString = "include";
49  break;
50  default:
51  return true;
52  }
53  std::cerr << attributeString << " not supported yet" << std::endl;
54  return false;
55  }
56  };
57  };
58 
59  struct includeList: std::list<include> {};
60 
61  inline std::ostream& operator<<(std::ostream& out, const include& ) {
62  return out;
63  }
64 }
65 
66 namespace SDDS { namespace parser
67 {
68  namespace qi = boost::spirit::qi;
69  namespace ascii = boost::spirit::ascii;
70  namespace phx = boost::phoenix;
71 
72  template <typename Iterator>
73  struct include_parser: qi::grammar<Iterator, include(), skipper<Iterator> >
74  {
75  include_parser(error_handler<Iterator> & _error_handler);
76 
77  qi::rule<Iterator, include(), skipper<Iterator> > start;
78  qi::rule<Iterator, std::string(), skipper<Iterator> > string, quoted_string,
80  };
81 }}
82 #endif /* INCLUDE_HPP_ */
qi::rule< Iterator, std::string(), skipper< Iterator > > string
Definition: include.hpp:78
qi::rule< Iterator, include(), skipper< Iterator > > start
Definition: include.hpp:77
include_parser(error_handler< Iterator > &_error_handler)
Definition: include_def.hpp:22
qi::rule< Iterator, std::string(), skipper< Iterator > > include_filename
Definition: include.hpp:78
qi::rule< Iterator, std::string(), skipper< Iterator > > quoted_string
Definition: include.hpp:78
std::ostream & operator<<(std::ostream &out, const array &)
Definition: array.hpp:89
Inform & endl(Inform &inf)
Definition: Inform.cpp:42