]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/example/qi/compiler_tutorial/mini_c/statement.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / spirit / example / qi / compiler_tutorial / mini_c / statement.hpp
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(BOOST_SPIRIT_MINIC_STATEMENT_HPP)
8 #define BOOST_SPIRIT_MINIC_STATEMENT_HPP
9
10 #include "expression.hpp"
11
12 namespace client { namespace parser
13 {
14 ///////////////////////////////////////////////////////////////////////////////
15 // The statement grammar
16 ///////////////////////////////////////////////////////////////////////////////
17 template <typename Iterator>
18 struct statement : qi::grammar<Iterator, ast::statement_list(), skipper<Iterator> >
19 {
20 statement(error_handler<Iterator>& error_handler);
21
22 expression<Iterator> expr;
23 qi::rule<Iterator, ast::statement_list(), skipper<Iterator> >
24 statement_list, compound_statement;
25
26 qi::rule<Iterator, ast::statement(), skipper<Iterator> > statement_;
27 qi::rule<Iterator, ast::variable_declaration(), skipper<Iterator> > variable_declaration;
28 qi::rule<Iterator, ast::assignment(), skipper<Iterator> > assignment;
29 qi::rule<Iterator, ast::if_statement(), skipper<Iterator> > if_statement;
30 qi::rule<Iterator, ast::while_statement(), skipper<Iterator> > while_statement;
31 qi::rule<Iterator, ast::return_statement(), skipper<Iterator> > return_statement;
32 qi::rule<Iterator, std::string(), skipper<Iterator> > identifier;
33 };
34 }}
35
36 #endif
37
38