Stan  2.14.0
probability, sampling & optimization
Public Member Functions | Public Attributes | List of all members
stan::lang::returns_type_vis Struct Reference

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>

Inheritance diagram for stan::lang::returns_type_vis:

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

§ returns_type_vis()

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.

Parameters
[in]return_typetype of return expression
[in,out]error_msgsstream to which error messages are written

Definition at line 21 of file returns_type_vis_def.hpp.

Member Function Documentation

§ operator()() [1/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 25 of file returns_type_vis_def.hpp.

§ operator()() [2/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 31 of file returns_type_vis_def.hpp.

§ operator()() [3/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 37 of file returns_type_vis_def.hpp.

§ operator()() [4/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 43 of file returns_type_vis_def.hpp.

§ operator()() [5/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 49 of file returns_type_vis_def.hpp.

§ operator()() [6/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 56 of file returns_type_vis_def.hpp.

§ operator()() [7/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 80 of file returns_type_vis_def.hpp.

§ operator()() [8/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 91 of file returns_type_vis_def.hpp.

§ operator()() [9/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 111 of file returns_type_vis_def.hpp.

§ operator()() [10/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 96 of file returns_type_vis_def.hpp.

§ operator()() [11/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 101 of file returns_type_vis_def.hpp.

§ operator()() [12/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 62 of file returns_type_vis_def.hpp.

§ operator()() [13/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 68 of file returns_type_vis_def.hpp.

§ operator()() [14/15]

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.

Parameters
[in]ststatement
Returns
false

Definition at line 74 of file returns_type_vis_def.hpp.

§ operator()() [15/15]

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.

Parameters
[in]ststatement
Returns
true if the specifieid return type returns an expression of the type specified at construction time

Definition at line 125 of file returns_type_vis_def.hpp.

Member Data Documentation

§ error_msgs_

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.

§ return_type_

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.


The documentation for this struct was generated from the following files:

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