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_FUNCTION_HPP)
9#define BOOST_SPIRIT_CONJURE_FUNCTION_HPP
10
11#include "statement.hpp"
12
13namespace client { namespace parser
14{
15 ///////////////////////////////////////////////////////////////////////////////
16 // The function grammar
17 ///////////////////////////////////////////////////////////////////////////////
18 template <typename Iterator, typename Lexer>
19 struct function : qi::grammar<Iterator, ast::function()>
20 {
21 typedef error_handler<typename Lexer::base_iterator_type, Iterator>
22 error_handler_type;
23
24 function(error_handler_type& error_handler, Lexer const& l);
25
26 statement<Iterator, Lexer> body;
27
28 qi::rule<Iterator, ast::identifier()> identifier;
29 qi::rule<Iterator, std::list<ast::identifier>()> argument_list;
30 qi::rule<Iterator, ast::function()> start;
31 };
32}}
33
34#endif
35
36
37

source code of boost/libs/spirit/example/qi/compiler_tutorial/conjure3/function.hpp