• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_CALC8_STATEMENT_HPP)
8 #define BOOST_SPIRIT_CALC8_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(), 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>
24             statement_list, compound_statement;
25 
26         qi::rule<Iterator, ast::statement(), ascii::space_type> statement_;
27         qi::rule<Iterator, ast::variable_declaration(), ascii::space_type> variable_declaration;
28         qi::rule<Iterator, ast::assignment(), ascii::space_type> assignment;
29         qi::rule<Iterator, ast::if_statement(), ascii::space_type> if_statement;
30         qi::rule<Iterator, ast::while_statement(), ascii::space_type> while_statement;
31         qi::rule<Iterator, std::string(), ascii::space_type> identifier;
32     };
33 }}
34 
35 #endif
36 
37 
38