OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
skipper.hpp
Go to the documentation of this file.
1 /*=============================================================================
2  Copyright (c) 2001-2011 Joel de Guzman
3 
4  Distributed under the Boost Software License, Version 1.0. (See accompanying
5  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 =============================================================================*/
7 #if !defined(SKIPPER_HPP)
8 #define SKIPPER_HPP
9 
10 #include <boost/spirit/include/qi.hpp>
11 
12 namespace client { namespace parser
13 {
14  namespace qi = boost::spirit::qi;
15  namespace ascii = boost::spirit::ascii;
16 
18  // The skipper grammar
20  template <typename Iterator>
21  struct skipper : qi::grammar<Iterator>
22  {
23  skipper() : skipper::base_type(start)
24  {
25  qi::char_type char_;
26  ascii::space_type space;
27 
28  start =
29  space // tab/space/cr/lf
30  | "/*" >> *(char_ - "*/") >> "*/" // C-style comments
31  ;
32  }
33 
34  qi::rule<Iterator> start;
35  };
36 }}
37 
38 #endif
39 
40 
qi::rule< Iterator > start
Definition: skipper.hpp:34