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_CALC7_STATEMENT_HPP)
8#define BOOST_SPIRIT_CALC7_STATEMENT_HPP
9
10#include "expression.hpp"
11
12namespace client { namespace parser
13{
14 ///////////////////////////////////////////////////////////////////////////////
15 // The statement grammar
16 ///////////////////////////////////////////////////////////////////////////////
17 template <typename Iterator>
18 struct statement : qi::grammar<Iterator, ast::statement_list(), ascii::space_type>
19 {
20 statement(error_handler<Iterator>& error_handler);
21
22 expression<Iterator> expr;
23 qi::rule<Iterator, ast::statement_list(), ascii::space_type> statement_list;
24 qi::rule<Iterator, ast::variable_declaration(), ascii::space_type> variable_declaration;
25 qi::rule<Iterator, ast::assignment(), ascii::space_type> assignment;
26 qi::rule<Iterator, std::string(), ascii::space_type> identifier;
27 };
28}}
29
30#endif
31
32
33

source code of boost/libs/spirit/example/qi/compiler_tutorial/calc7/statement.hpp