Stan  1.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
program_grammar.hpp
Go to the documentation of this file.
1 #ifndef __STAN__GM__PARSER__PROGRAM_GRAMMAR__HPP__
2 #define __STAN__GM__PARSER__PROGRAM_GRAMMAR__HPP__
3 
4 #include <string>
5 #include <sstream>
6 #include <vector>
7 
8 #include <boost/spirit/include/qi.hpp>
9 
10 #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  program(),
24  whitespace_grammar<Iterator> > {
25 
27 
28  // global info for parses
30  std::stringstream error_msgs_;
31 
32  // grammars
36 
37  // rules
38 
39  boost::spirit::qi::rule<Iterator,
40  std::vector<var_decl>(),
43 
44  boost::spirit::qi::rule<Iterator,
45  std::pair<std::vector<var_decl>,
46  std::vector<statement> >(),
49 
50  boost::spirit::qi::rule<Iterator,
51  std::pair<std::vector<var_decl>,
52  std::vector<statement> >(),
55 
56  boost::spirit::qi::rule<Iterator,
57  std::pair<std::vector<var_decl>,
58  std::vector<statement> >(),
61 
62  boost::spirit::qi::rule<Iterator,
63  statement(),
66 
67  boost::spirit::qi::rule<Iterator,
68  std::vector<var_decl>(),
71 
72  boost::spirit::qi::rule<Iterator,
73  program(),
76 
77  };
78 
79 
80  }
81 }
82 
83 #endif

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