Stan  2.14.0
probability, sampling & optimization
has_var_vis.hpp
Go to the documentation of this file.
1 #ifndef STAN_LANG_AST_FUN_HAS_VAR_VIS_HPP
2 #define STAN_LANG_AST_FUN_HAS_VAR_VIS_HPP
3 
5 #include <boost/variant/static_visitor.hpp>
6 
7 namespace stan {
8  namespace lang {
9 
10  struct nil;
11  struct int_literal;
12  struct double_literal;
13  struct array_expr;
14  struct variable;
15  struct fun;
16  struct integrate_ode;
17  struct integrate_ode_control;
18  struct index_op;
19  struct index_op_sliced;
20  struct conditional_op;
21  struct binary_op;
22  struct unary_op;
23 
28  struct has_var_vis : public boost::static_visitor<bool> {
33  explicit has_var_vis(const variable_map& var_map);
34 
42  bool operator()(const nil& e) const;
43 
51  bool operator()(const int_literal& e) const;
52 
60  bool operator()(const double_literal& e) const;
61 
69  bool operator()(const array_expr& e) const;
70 
78  bool operator()(const variable& e) const;
79 
87  bool operator()(const integrate_ode& e) const;
88 
96  bool operator()(const integrate_ode_control& e) const;
97 
105  bool operator()(const fun& e) const;
106 
114  bool operator()(const index_op& e) const;
115 
123  bool operator()(const index_op_sliced& e) const;
124 
132  bool operator()(const conditional_op& e) const;
133 
141  bool operator()(const binary_op& e) const;
142 
150  bool operator()(const unary_op& e) const;
151 
156  };
157 
158  }
159 }
160 #endif
Node for holding a double literal.
has_var_vis(const variable_map &var_map)
Construct a non-data variable detection visitor.
Probability, optimization and sampling library.
Structure to hold an array expression.
Definition: array_expr.hpp:17
Structure for an indexed expression.
Definition: index_op.hpp:14
Structure for function application.
Definition: fun.hpp:17
A map from function names to their base declarations and their origin.
Structure for integrate diff eq statement.
Visitor to detect if an expression contains a non-data variable.
Definition: has_var_vis.hpp:28
AST structure for holding an expression with a sequence of indexes.
bool operator()(const nil &e) const
Return true if the specified expression contains a non-data variable.
Structure for the conditional operator.
Structure to hold a variable.
Definition: variable.hpp:14
const variable_map & var_map_
Reference to the global variable declaration mapping.
AST structure for unary operations consisting of an operation and argument.
Definition: unary_op.hpp:14
Node for storing binary operations consisting of an operation and left and right arguments.
Definition: binary_op.hpp:15
The nil structure used as a placeholder for undefined or empty values in several structures.
Definition: nil.hpp:11
Structure for a diff eq integration statement with control parameters for the integrator.

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