1 #ifndef STAN_LANG_AST_FUN_VAR_OCCURS_VIS_DEF_HPP 2 #define STAN_LANG_AST_FUN_VAR_OCCURS_VIS_DEF_HPP 10 : var_name_(e.name_) {
34 for (
size_t i = 0; i < e.
args_.size(); ++i)
35 if (boost::apply_visitor(*
this, e.
args_[i].expr_))
50 return boost::apply_visitor(*
this, e.
expr_.
expr_);
54 return boost::apply_visitor(*
this, e.
expr_.
expr_);
58 return boost::apply_visitor(*
this, e.
cond_.
expr_)
64 return boost::apply_visitor(*
this, e.
left.
expr_)
var_occurs_vis(const variable &e)
Construct a visitor to detect whether the specified variable occurs in a statement.
std::string name_
Name of variable.
Node for holding a double literal.
Probability, optimization and sampling library.
Structure to hold an array expression.
Structure for an indexed expression.
std::vector< expression > args_
Sequence of argument expressions for function.
Structure for function application.
expression expr_
Expression being indexed.
Structure for integrate diff eq statement.
bool operator()(const nil &e) const
Return true if the variable occurs in the specified expression.
expression cond_
Condition (integer).
expression true_val_
Return value if condition is true.
expression left
First argument.
const std::string var_name_
The name of the variable for which to search.
AST structure for holding an expression with a sequence of indexes.
Structure for the conditional operator.
Structure to hold a variable.
expression right
Second argument.
expression subject
Argument.
AST structure for unary operations consisting of an operation and argument.
Node for storing binary operations consisting of an operation and left and right arguments.
The nil structure used as a placeholder for undefined or empty values in several structures.
expression false_val_
Return value if condition is false.
Structure for a diff eq integration statement with control parameters for the integrator.
expression expr_
Expression being indexed.