-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwhite_space.hpp
35 lines (27 loc) · 1.13 KB
/
white_space.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef WHITE_SPACE_HPP_
#define WHITE_SPACE_HPP_
#include <boost/spirit/include/qi.hpp>
///////////////////////////////////////////////////////////////////////////////
// White-space and comments grammar definition
///////////////////////////////////////////////////////////////////////////////
template <typename Iterator>
struct white_space : boost::spirit::qi::grammar<Iterator>
{
white_space() : white_space::base_type(start)
{
using boost::spirit::ascii::char_;
start =
boost::spirit::qi::space // tab/space/cr/lf
| "/*" >> *(char_ - "*/") >> "*/" // C-style comments
;
// Enable debugging
// debug(start);
}
boost::spirit::qi::rule<Iterator> start;
};
#endif /* WHITE_SPACE_HPP_ */