26 #if ! defined (octave_stack_frame_h)
27 #define octave_stack_frame_h 1
29 #include "octave-config.h"
106 class stack_frame_walker;
169 const std::shared_ptr<stack_frame>&
access_link = std::shared_ptr<stack_frame> ());
177 const std::shared_ptr<stack_frame>&
access_link = std::shared_ptr<stack_frame> ());
217 std::string
fcn_name (
bool print_subfn =
true)
const
227 if (print_subfn && ! parent_fcn_name.empty ())
228 retval = parent_fcn_name +
'>';
231 retval +=
"@<anonymous>";
233 retval += fcn->
name ();
236 retval =
"<unknown>";
251 bool return_list,
bool verbose,
252 const std::string& whos_line_fmt,
253 const std::string& msg);
282 std::string nm = sym.
name ();
283 error (
"can't make function parameter %s persistent", nm.c_str ());
288 std::string nm = sym.
name ();
289 error (
"can't make global variable '%s' persistent", nm.c_str ());
301 std::string nm = sym.
name ();
302 error (
"can't make persistent variable '%s' global", nm.c_str ());
319 std::shared_ptr<stack_frame>
322 std::shared_ptr<stack_frame>
325 std::shared_ptr<stack_frame>
328 virtual std::size_t
size ()
const;
330 virtual void resize (std::size_t);
477 const std::string& type,
478 const std::list<octave_value_list>& idx,
494 const std::string& type,
495 const std::list<octave_value_list>& idx)
504 const std::list<octave_value_list>& idx)
const
511 retval = retval.
subsref (type, idx);
564 virtual void display (
bool follow =
true)
const;
566 virtual void accept (stack_frame_walker& sfw) = 0;
580 nxt->m_is_closure_context =
true;
581 nxt = nxt->access_link ();
625 OCTAVE_END_NAMESPACE(
octave)
virtual bool is_anonymous_function() const
virtual std::string parent_fcn_name() const
virtual std::string fcn_file_name() const
octave_idx_type length() const
void call_object_destructor()
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
octave_value storable_value() const
octave_value & assign(assign_op op, const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
octave_idx_type get_count() const
octave_value & non_const_unary_op(unary_op op)
virtual scope_flags get_scope_flag(std::size_t) const
virtual bool is_scope_frame() const
symbol_info_list glob_symbol_info(const std::string &pattern)
std::string fcn_file_name() const
std::shared_ptr< stack_frame > parent_link() const
bool is_persistent(const std::string &name) const
virtual bool is_user_script_frame() const
std::list< std::string > variable_names() const
virtual void set_nargout(int nargout)
void unmark_persistent(const symbol_record &sym)
void set_dispatch_class(const std::string &class_name)
bool is_object(const std::string &name) const
stack_frame & operator=(const stack_frame &elt)=delete
void make_global(const symbol_record &sym)
virtual octave_value varval(const symbol_record &sym) const =0
void clear(const symbol_record &sym)
static stack_frame * create(tree_evaluator &tw, octave_function *fcn, std::size_t index, const std::shared_ptr< stack_frame > &parent_link, const std::shared_ptr< stack_frame > &static_link)
octave_value value(const symbol_record &sym, const std::string &type, const std::list< octave_value_list > &idx) const
stack_frame(const stack_frame &elt)=default
bool is_global(const symbol_record &sym) const
std::string m_dispatch_class
void clear_variable_regexp(const std::string &pattern)
void mark_global(const symbol_record &sym)
void clear_variable_pattern(const std::string &pattern)
virtual symbol_record lookup_symbol(const std::string &) const =0
virtual int column() const
std::size_t index() const
bool is_global(const std::string &name) const
octave_value find_subfunction(const std::string &name) const
void install_variable(const std::string &name, const octave_value &value, bool global)
symbol_info_list regexp_symbol_info(const std::string &pattern)
virtual unwind_protect * unwind_protect_frame()
virtual void display(bool follow=true) const
virtual void set_scope_flag(std::size_t, scope_flags)
bool is_defined(const symbol_record &sym) const
virtual void accept(stack_frame_walker &sfw)=0
void display_stopped_in_message(std::ostream &os) const
octave_value varval(const std::string &name) const
std::shared_ptr< stack_frame > m_parent_link
bool is_closure_context() const
void clear_parent_static_link()
virtual void set_auto_fcn_var(auto_var_type, const octave_value &)=0
void assign(octave_value::assign_op op, const symbol_record &sym, const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
bool is_persistent(const symbol_record &sym) const
std::shared_ptr< stack_frame > m_access_link
virtual bool is_user_fcn_frame() const
void non_const_unary_op(octave_value::unary_op op, const symbol_record &sym, const std::string &type, const std::list< octave_value_list > &idx)
virtual ~stack_frame()=default
virtual octave_value & varref(const symbol_record &sym)=0
std::string fcn_name(bool print_subfn=true) const
void assign(const symbol_record &sym, const octave_value &val)
virtual octave_value get_auto_fcn_var(auto_var_type) const =0
std::string get_dispatch_class() const
bool is_object(const symbol_record &sym) const
virtual bool is_compiled_fcn_frame() const
std::shared_ptr< stack_frame > static_link() const
void install_variable(const symbol_record &sym, const octave_value &value, bool global)
void clear_variable(const std::string &name)
std::shared_ptr< stack_frame > m_static_link
std::map< std::string, octave_value > local_vars_map
virtual void mark_scope(const symbol_record &, scope_flags)=0
virtual void set_nargin(int nargin)
void assign(const std::string &name, const octave_value &val)
octave_value who(const string_vector &patterns, bool have_regexp, bool return_list, bool verbose, const std::string &whos_line_fmt, const std::string &msg)
void unmark_global(const symbol_record &sym)
virtual scope_flags scope_flag(const symbol_record &) const =0
bool is_local_variable(const std::string &name) const
tree_evaluator & m_evaluator
virtual void break_closure_cycles(const std::shared_ptr< stack_frame > &)
symbol_info_list get_symbol_info()
void mark_persistent(const symbol_record &sym)
virtual symbol_record insert_symbol(const std::string &)=0
void mark_closure_context()
stack_frame(tree_evaluator &tw, std::size_t index, const std::shared_ptr< stack_frame > &parent_link, const std::shared_ptr< stack_frame > &static_link, const std::shared_ptr< stack_frame > &access_link)
bool m_is_closure_context
virtual std::size_t size() const
symbol_info_list all_variables()
virtual void clear_values()
std::size_t parent_frame_index() const
virtual symbol_scope get_scope() const =0
bool is_variable(const std::string &name) const
virtual void resize(std::size_t)
void make_persistent(const symbol_record &sym)
bool is_variable(const symbol_record &sym) const
std::shared_ptr< stack_frame > access_link() const
symbol_info_list make_symbol_info_list(const std::list< symbol_record > &symrec_list) const
octave_value find_subfunction(const std::string &name) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void() error(const char *fmt,...)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))