Stan  2.14.0
probability, sampling & optimization
statement.hpp
Go to the documentation of this file.
1 #ifndef STAN_LANG_AST_NODE_STATEMENT_HPP
2 #define STAN_LANG_AST_NODE_STATEMENT_HPP
3 
4 #include <boost/variant/recursive_variant.hpp>
5 #include <cstddef>
6 
7 namespace stan {
8  namespace lang {
9 
10  struct nil;
11  struct assignment;
12  struct assgn;
13  struct sample;
14  struct increment_log_prob_statement;
15  struct expression;
16  struct statements;
17  struct for_statement;
18  struct conditional_statement;
19  struct while_statement;
20  struct break_continue_statement;
21  struct print_statement;
22  struct reject_statement;
23  struct return_statement;
24  struct no_op_statement;
25 
29  struct statement {
33  typedef boost::variant<boost::recursive_wrapper<nil>,
34  boost::recursive_wrapper<assignment>,
35  boost::recursive_wrapper<assgn>,
36  boost::recursive_wrapper<sample>,
37  boost::recursive_wrapper<increment_log_prob_statement>,
38  boost::recursive_wrapper<expression>,
39  boost::recursive_wrapper<statements>,
40  boost::recursive_wrapper<for_statement>,
41  boost::recursive_wrapper<conditional_statement>,
42  boost::recursive_wrapper<while_statement>,
43  boost::recursive_wrapper<break_continue_statement>,
44  boost::recursive_wrapper<print_statement>,
45  boost::recursive_wrapper<reject_statement>,
46  boost::recursive_wrapper<return_statement>,
47  boost::recursive_wrapper<no_op_statement> >
49 
53  statement();
54 
61  statement(const statement_t& st); // NOLINT(runtime/explicit)
62 
69  statement(const nil& st); // NOLINT(runtime/explicit)
70 
77  statement(const assignment& st); // NOLINT(runtime/explicit)
78 
85  statement(const assgn& st); // NOLINT(runtime/explicit)
86 
93  statement(const sample& st); // NOLINT(runtime/explicit)
94 
101  statement(const increment_log_prob_statement& st); // NOLINT
102 
109  statement(const expression& st); // NOLINT(runtime/explicit)
110 
117  statement(const statements& st); // NOLINT(runtime/explicit)
118 
125  statement(const for_statement& st); // NOLINT(runtime/explicit)
126 
133  statement(const conditional_statement& st); // NOLINT(runtime/explicit)
134 
141  statement(const while_statement& st); // NOLINT(runtime/explicit)
142 
149  statement(const break_continue_statement& st); // NOLINT
150 
157  statement(const print_statement& st); // NOLINT(runtime/explicit)
158 
165  statement(const reject_statement& st); // NOLINT(runtime/explicit)
166 
173  statement(const no_op_statement& st); // NOLINT(runtime/explicit)
174 
181  statement(const return_statement& st); // NOLINT(runtime/explicit)
182 
189  bool is_no_op_statement() const;
190 
195 
199  std::size_t begin_line_;
200 
204  std::size_t end_line_;
205  };
206 
207  }
208 }
209 #endif
AST node for print statements.
Structure to wrap the variant type of statements.
Definition: statement.hpp:29
bool is_no_op_statement() const
Return true if the basic statement held by the variant type in this wrapper is the no-op statement...
Holder for local variable declarations and a sequence of statements.
Definition: statements.hpp:16
AST node for assignment to variable with multi-indexing.
Definition: assgn.hpp:15
void sample(stan::mcmc::base_mcmc *sampler, int num_warmup, int num_samples, int num_thin, int refresh, bool save, stan::services::sample::mcmc_writer< Model, SampleRecorder, DiagnosticRecorder, MessageRecorder > &mcmc_writer, stan::mcmc::sample &init_s, Model &model, RNG &base_rng, const std::string &prefix, const std::string &suffix, std::ostream &o, StartTransitionCallback &callback, interface_callbacks::writer::base_writer &info_writer, interface_callbacks::writer::base_writer &error_writer)
Definition: sample.hpp:17
AST node for the increment log prob (deprecated) and target increment statements. ...
Probability, optimization and sampling library.
AST node for the reject statement.
AST structure for break and continue statements.
statement_t statement_
The statement variant type held by this wrapper.
Definition: statement.hpp:194
AST node for sampling statements.
Definition: sample.hpp:17
statement()
Construct a default (nil) statement.
boost::variant< boost::recursive_wrapper< nil >, boost::recursive_wrapper< assignment >, boost::recursive_wrapper< assgn >, boost::recursive_wrapper< sample >, boost::recursive_wrapper< increment_log_prob_statement >, boost::recursive_wrapper< expression >, boost::recursive_wrapper< statements >, boost::recursive_wrapper< for_statement >, boost::recursive_wrapper< conditional_statement >, boost::recursive_wrapper< while_statement >, boost::recursive_wrapper< break_continue_statement >, boost::recursive_wrapper< print_statement >, boost::recursive_wrapper< reject_statement >, boost::recursive_wrapper< return_statement >, boost::recursive_wrapper< no_op_statement > > statement_t
The variant type of statements.
Definition: statement.hpp:48
std::size_t begin_line_
The line in the source code where the statement begins.
Definition: statement.hpp:199
AST node for representing while statements.
AST node for the no-operation statement.
AST node for the return statement.
std::size_t end_line_
The line in the source code where the statement ends.
Definition: statement.hpp:204
The nil structure used as a placeholder for undefined or empty values in several structures.
Definition: nil.hpp:11
AST node for representing a for statement.
AST node for conditional statements.
AST node for assignment statements.
Definition: assignment.hpp:14

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