Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
functions_grammar.hpp
Go to the documentation of this file.
1 #ifndef STAN__GM__PARSER__FUNCTIONS_GRAMMAR_HPP__
2 #define STAN__GM__PARSER__FUNCTIONS_GRAMMAR_HPP__
3 
4 #include <set>
5 #include <string>
6 #include <sstream>
7 #include <vector>
8 
9 #include <boost/spirit/include/qi.hpp>
10 
11 #include <stan/gm/ast.hpp>
15 
16 namespace stan {
17 
18  namespace gm {
19 
20  template <typename Iterator>
22  : boost::spirit::qi::grammar<Iterator,
23  std::vector<function_decl_def>(),
24  whitespace_grammar<Iterator> > {
25 
26  // global variable info
28 
29  // local info to keep track of which functions declared defined
30  // so far
31  std::set<std::pair<std::string,
33  std::set<std::pair<std::string,
35 
36  std::stringstream& error_msgs_;
37 
38  // grammars
41 
42  // constructor
44  std::stringstream& error_msgs);
45 
46  // rules
47  boost::spirit::qi::rule<Iterator,
48  std::vector<function_decl_def>(),
51 
52  boost::spirit::qi::rule<Iterator,
53  boost::spirit::qi::locals<bool,int>,
57 
58  boost::spirit::qi::rule<Iterator,
59  std::vector<arg_decl>(),
62 
63  boost::spirit::qi::rule<Iterator,
64  arg_decl(),
67 
68  boost::spirit::qi::rule<Iterator,
69  std::string(),
72 
73  };
74 
75 
76  }
77 }
78 
79 
80 #endif
bare_type_grammar< Iterator > bare_type_g
boost::spirit::qi::rule< Iterator, std::vector< arg_decl >), whitespace_grammar< Iterator > > arg_decls_r
boost::spirit::qi::rule< Iterator, arg_decl(), whitespace_grammar< Iterator > > arg_decl_r
boost::spirit::qi::rule< Iterator, boost::spirit::qi::locals< bool, int >, function_decl_def(), whitespace_grammar< Iterator > > function_r
functions_grammar(variable_map &var_map, std::stringstream &error_msgs)
statement_grammar< Iterator > statement_g
std::set< std::pair< std::string, function_signature_t > > functions_declared_
boost::spirit::qi::rule< Iterator, std::vector< function_decl_def >), whitespace_grammar< Iterator > > functions_r
boost::spirit::qi::rule< Iterator, std::string(), whitespace_grammar< Iterator > > identifier_r
std::set< std::pair< std::string, function_signature_t > > functions_defined_
std::stringstream & error_msgs_
std::pair< expr_type, std::vector< expr_type > > function_signature_t
Definition: ast.hpp:104

     [ Stan Home Page ] © 2011–2014, Stan Development Team.