function.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  3. Copyright (c) 2001-2011 Hartmut Kaiser
  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_CONJURE_FUNCTION_HPP)
  8. #define BOOST_SPIRIT_CONJURE_FUNCTION_HPP
  9. #include "statement.hpp"
  10. namespace client { namespace parser
  11. {
  12. ///////////////////////////////////////////////////////////////////////////////
  13. // The function grammar
  14. ///////////////////////////////////////////////////////////////////////////////
  15. template <typename Iterator, typename Lexer>
  16. struct function : qi::grammar<Iterator, ast::function()>
  17. {
  18. typedef error_handler<typename Lexer::base_iterator_type, Iterator>
  19. error_handler_type;
  20. function(error_handler_type& error_handler, Lexer const& l);
  21. statement<Iterator, Lexer> body;
  22. qi::rule<Iterator, ast::identifier()> identifier;
  23. qi::rule<Iterator, std::list<ast::identifier>()> argument_list;
  24. qi::rule<Iterator, ast::function()> start;
  25. };
  26. }}
  27. #endif