1 #ifndef STAN_LANG_AST_NODE_FUNCTION_DECL_DEF_DEF_HPP 2 #define STAN_LANG_AST_NODE_FUNCTION_DECL_DEF_DEF_HPP 3 4 #include <stan/lang/ast.hpp> 5 #include <string> 6 #include <vector> 7 8 namespace stan { 9 namespace lang { 10 function_decl_def()11 function_decl_def::function_decl_def() { } 12 function_decl_def(const bare_expr_type & return_type,const std::string & name,const std::vector<var_decl> & arg_decls,const statement & body)13 function_decl_def::function_decl_def(const bare_expr_type& return_type, 14 const std::string& name, 15 const std::vector<var_decl>& arg_decls, 16 const statement& body) 17 : return_type_(return_type), name_(name), arg_decls_(arg_decls), 18 body_(body) { 19 } 20 has_only_int_args() const21 bool function_decl_def::has_only_int_args() const { 22 for (size_t i = 0; i < arg_decls_.size(); ++i) 23 if (!arg_decls_[i].bare_type().innermost_type().is_int_type()) 24 return false; 25 return true; 26 } 27 28 } 29 } 30 #endif 31