1 /*============================================================================= 2 Copyright (c) 2001-2011 Joel de Guzman 3 Copyright (c) 2001-2011 Hartmut Kaiser 4 5 Distributed under the Boost Software License, Version 1.0. (See accompanying 6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 =============================================================================*/ 8 #if !defined(BOOST_SPIRIT_CONJURE_STATEMENT_HPP) 9 #define BOOST_SPIRIT_CONJURE_STATEMENT_HPP 10 11 #include "expression.hpp" 12 13 namespace client { namespace parser 14 { 15 /////////////////////////////////////////////////////////////////////////////// 16 // The statement grammar 17 /////////////////////////////////////////////////////////////////////////////// 18 template <typename Iterator, typename Lexer> 19 struct statement : qi::grammar<Iterator, ast::statement_list()> 20 { 21 typedef error_handler<typename Lexer::base_iterator_type, Iterator> 22 error_handler_type; 23 24 statement(error_handler_type& error_handler, Lexer const& l); 25 26 expression<Iterator, Lexer> expr; 27 28 qi::rule<Iterator, ast::statement_list()> 29 statement_list, compound_statement; 30 31 qi::rule<Iterator, ast::statement()> statement_; 32 qi::rule<Iterator, ast::variable_declaration()> variable_declaration; 33 qi::rule<Iterator, ast::assignment()> assignment; 34 qi::rule<Iterator, ast::if_statement()> if_statement; 35 qi::rule<Iterator, ast::while_statement()> while_statement; 36 qi::rule<Iterator, ast::return_statement()> return_statement; 37 }; 38 }} 39 40 #endif 41 42 43