1 #ifndef STAN_LANG_GRAMMARS_FUNCTIONS_GRAMMAR_HPP 2 #define STAN_LANG_GRAMMARS_FUNCTIONS_GRAMMAR_HPP 9 #include <boost/spirit/include/qi.hpp> 20 template <
typename Iterator>
22 : boost::spirit::qi::grammar<Iterator,
23 std::vector<function_decl_def>(),
24 whitespace_grammar<Iterator> > {
26 std::set<std::pair<std::string,
28 std::set<std::pair<std::string,
35 std::stringstream& error_msgs,
36 bool allow_undefined =
false);
38 boost::spirit::qi::rule<Iterator,
39 std::vector<function_decl_def>(),
43 boost::spirit::qi::rule<Iterator,
44 boost::spirit::qi::locals<bool, int>,
49 boost::spirit::qi::rule<Iterator,
50 std::vector<arg_decl>(),
54 boost::spirit::qi::rule<Iterator,
59 boost::spirit::qi::rule<Iterator,
64 boost::spirit::qi::rule<Iterator,
65 boost::spirit::qi::unused_type,
boost::spirit::qi::rule< Iterator, std::vector< arg_decl >), whitespace_grammar< Iterator > > arg_decls_r
boost::spirit::qi::rule< Iterator, boost::spirit::qi::locals< bool, int >, function_decl_def(), whitespace_grammar< Iterator > > function_r
boost::spirit::qi::rule< Iterator, arg_decl(), whitespace_grammar< Iterator > > arg_decl_r
AST node for the type delclaration for function arguments.
boost::spirit::qi::rule< Iterator, boost::spirit::qi::unused_type, whitespace_grammar< Iterator > > close_arg_decls_r
Probability, optimization and sampling library.
bare_type_grammar< Iterator > bare_type_g
A map from function names to their base declarations and their origin.
boost::spirit::qi::rule< Iterator, std::string(), whitespace_grammar< Iterator > > identifier_r
boost::spirit::qi::rule< Iterator, std::vector< function_decl_def >), whitespace_grammar< Iterator > > functions_r
std::pair< expr_type, std::vector< expr_type > > function_signature_t
The type of a function signature, mapping a vector of argument expression types to a result expressio...
std::set< std::pair< std::string, function_signature_t > > functions_defined_
std::stringstream & error_msgs_
functions_grammar(variable_map &var_map, std::stringstream &error_msgs, bool allow_undefined=false)
statement_grammar< Iterator > statement_g
std::set< std::pair< std::string, function_signature_t > > functions_declared_
AST node for a function declaration and definition including return type name, arguments, and body.