function.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. =============================================================================*/
  6. #if !defined(BOOST_SPIRIT_MINIC_FUNCTION_HPP)
  7. #define BOOST_SPIRIT_MINIC_FUNCTION_HPP
  8. #include "statement.hpp"
  9. namespace client { namespace parser
  10. {
  11. ///////////////////////////////////////////////////////////////////////////////
  12. // The function grammar
  13. ///////////////////////////////////////////////////////////////////////////////
  14. template <typename Iterator>
  15. struct function : qi::grammar<Iterator, ast::function(), skipper<Iterator> >
  16. {
  17. function(error_handler<Iterator>& error_handler);
  18. statement<Iterator> body;
  19. qi::rule<Iterator, std::string(), skipper<Iterator> > name;
  20. qi::rule<Iterator, ast::identifier(), skipper<Iterator> > identifier;
  21. qi::rule<Iterator, std::list<ast::identifier>(), skipper<Iterator> > argument_list;
  22. qi::rule<Iterator, ast::function(), skipper<Iterator> > start;
  23. };
  24. }}
  25. #endif