![]() |
Stan
2.14.0
probability, sampling & optimization
|
Visitor for reporting an error message if the statement is not a return statement with a type specified at construction time. More...
#include <returns_type_vis.hpp>
Public Member Functions | |
returns_type_vis (const expr_type &return_type, std::ostream &error_msgs) | |
Construct visitor expecting a return statement with an expression of the specified type, writing error messages to the specified stream. More... | |
bool | operator() (const nil &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const assignment &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const assgn &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const sample &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const increment_log_prob_statement &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const expression &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const statements &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const for_statement &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const conditional_statement &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const while_statement &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const break_continue_statement &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const print_statement &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const reject_statement &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const no_op_statement &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
bool | operator() (const return_statement &st) const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time. More... | |
Public Attributes | |
expr_type | return_type_ |
The type of the returned expression expected. More... | |
std::ostream & | error_msgs_ |
Stream to which error messages are written. More... | |
Visitor for reporting an error message if the statement is not a return statement with a type specified at construction time.
Definition at line 31 of file returns_type_vis.hpp.
stan::lang::returns_type_vis::returns_type_vis | ( | const expr_type & | return_type, |
std::ostream & | error_msgs | ||
) |
Construct visitor expecting a return statement with an expression of the specified type, writing error messages to the specified stream.
[in] | return_type | type of return expression |
[in,out] | error_msgs | stream to which error messages are written |
Definition at line 21 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const nil & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 25 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const assignment & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 31 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const assgn & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 37 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const sample & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 43 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const increment_log_prob_statement & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 49 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const expression & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 56 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const statements & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 80 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const for_statement & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 91 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const conditional_statement & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 111 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const while_statement & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 96 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const break_continue_statement & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 101 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const print_statement & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 62 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const reject_statement & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 68 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const no_op_statement & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 74 of file returns_type_vis_def.hpp.
bool stan::lang::returns_type_vis::operator() | ( | const return_statement & | st | ) | const |
Return true if the specified statement is a return statement with an expression of the type specified at construction time.
[in] | st | statement |
Definition at line 125 of file returns_type_vis_def.hpp.
std::ostream& stan::lang::returns_type_vis::error_msgs_ |
Stream to which error messages are written.
Definition at line 202 of file returns_type_vis.hpp.
expr_type stan::lang::returns_type_vis::return_type_ |
The type of the returned expression expected.
Definition at line 197 of file returns_type_vis.hpp.