GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave::stack_frame Class Referenceabstract

#include "stack-frame.h"

Inheritance diagram for octave::stack_frame:
Collaboration diagram for octave::stack_frame:

Public Types

enum  auto_var_type {
  ARG_NAMES , IGNORED , NARGIN , NARGOUT ,
  SAVED_WARNING_STATES , NUM_AUTO_VARS
}
 
typedef std::map< std::string, octave_valuelocal_vars_map
 
enum  scope_flags { LOCAL , GLOBAL , PERSISTENT }
 

Public Member Functions

 stack_frame (const stack_frame &elt)=default
 
 stack_frame (tree_evaluator &tw, 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)
 
 stack_frame (void)=delete
 
virtual ~stack_frame (void)=default
 
virtual void accept (stack_frame_walker &sfw)=0
 
std::shared_ptr< stack_frameaccess_link (void) const
 
symbol_info_list all_variables (void)
 
void assign (const std::string &name, const octave_value &val)
 
void assign (const symbol_record &sym, const octave_value &val)
 
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)
 
void clear (const symbol_record &sym)
 
void clear_objects (void)
 
virtual void clear_values (void)
 
void clear_variable (const std::string &name)
 
void clear_variable_pattern (const std::string &pattern)
 
void clear_variable_pattern (const string_vector &patterns)
 
void clear_variable_regexp (const std::string &pattern)
 
void clear_variable_regexp (const string_vector &patterns)
 
void clear_variables (void)
 
void column (int c)
 
int column (void) const
 
virtual void display (bool follow=true) const
 
void display_stopped_in_message (std::ostream &os) const
 
void do_non_const_unary_op (octave_value::unary_op op, const symbol_record &sym, const std::string &type, const std::list< octave_value_list > &idx)
 
std::string fcn_file_name (void) const
 
std::string fcn_name (bool print_subfn=true) const
 
octave_value find_subfunction (const std::string &name) const
 
virtual octave_functionfunction (void) const
 
virtual octave_value get_auto_fcn_var (auto_var_type) const =0
 
std::string get_dispatch_class (void) const
 
virtual symbol_scope get_scope (void) const =0
 
virtual scope_flags get_scope_flag (size_t) const
 
symbol_info_list get_symbol_info (void)
 
symbol_info_list glob_symbol_info (const std::string &pattern)
 
size_t index (void) const
 
virtual symbol_record insert_symbol (const std::string &)=0
 
void install_variable (const std::string &name, const octave_value &value, bool global)
 
void install_variable (const symbol_record &sym, const octave_value &value, bool global)
 
virtual bool is_compiled_fcn_frame (void) const
 
bool is_defined (const symbol_record &sym) const
 
bool is_global (const std::string &name) const
 
bool is_global (const symbol_record &sym) const
 
bool is_local_variable (const std::string &name) const
 
bool is_object (const std::string &name) const
 
bool is_object (const symbol_record &sym) const
 
bool is_persistent (const std::string &name) const
 
bool is_persistent (const symbol_record &sym) const
 
virtual bool is_scope_frame (void) const
 
virtual bool is_user_fcn_frame (void) const
 
virtual bool is_user_script_frame (void) const
 
bool is_variable (const std::string &name) const
 
bool is_variable (const symbol_record &sym) const
 
void line (int l)
 
int line (void) const
 
virtual symbol_record lookup_symbol (const std::string &) const =0
 
void make_global (const symbol_record &sym)
 
void make_persistent (const symbol_record &sym)
 
symbol_info_list make_symbol_info_list (const std::list< symbol_record > &symrec_list) const
 
void mark_global (const symbol_record &sym)
 
void mark_persistent (const symbol_record &sym)
 
virtual void mark_scope (const symbol_record &, scope_flags)=0
 
stack_frameoperator= (const stack_frame &elt)=delete
 
std::shared_ptr< stack_frameparent_link (void) const
 
symbol_info_list regexp_symbol_info (const std::string &pattern)
 
virtual void resize (size_t)
 
virtual scope_flags scope_flag (const symbol_record &) const =0
 
virtual void set_auto_fcn_var (auto_var_type, const octave_value &)=0
 
void set_dispatch_class (const std::string &class_name)
 
virtual void set_scope_flag (size_t, scope_flags)
 
virtual size_t size (void) const
 
std::shared_ptr< stack_framestatic_link (void) const
 
void unmark_global (const symbol_record &sym)
 
void unmark_persistent (const symbol_record &sym)
 
virtual unwind_protectunwind_protect_frame (void)
 
octave_value value (const symbol_record &sym, const std::string &type, const std::list< octave_value_list > &idx) const
 
std::list< std::string > variable_names (void) const
 
virtual octave_valuevarref (const symbol_record &sym)=0
 
virtual octave_valuevarref (size_t data_offset)
 
octave_value varval (const std::string &name) const
 
virtual octave_value varval (const symbol_record &sym) const =0
 
virtual octave_value varval (size_t data_offset) const
 
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)
 
octave_value workspace (void)
 

Static Public Member Functions

static stack_framecreate (tree_evaluator &tw, const symbol_scope &scope, size_t index, const std::shared_ptr< stack_frame > &parent_link, const std::shared_ptr< stack_frame > &static_link)
 
static stack_framecreate (tree_evaluator &tw, octave_function *fcn, size_t index, const std::shared_ptr< stack_frame > &parent_link, const std::shared_ptr< stack_frame > &static_link)
 
static stack_framecreate (tree_evaluator &tw, octave_user_function *fcn, size_t index, const std::shared_ptr< stack_frame > &parent_link, const std::shared_ptr< stack_frame > &static_link, const local_vars_map &local_vars)
 
static stack_framecreate (tree_evaluator &tw, octave_user_function *fcn, 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=std::shared_ptr< stack_frame >())
 
static stack_framecreate (tree_evaluator &tw, octave_user_script *script, size_t index, const std::shared_ptr< stack_frame > &parent_link, const std::shared_ptr< stack_frame > &static_link)
 

Protected Attributes

std::shared_ptr< stack_framem_access_link
 
int m_column
 
std::string m_dispatch_class
 
tree_evaluatorm_evaluator
 
size_t m_index
 
int m_line
 
std::shared_ptr< stack_framem_parent_link
 
std::shared_ptr< stack_framem_static_link
 

Detailed Description

Definition at line 108 of file stack-frame.h.

Member Typedef Documentation

◆ local_vars_map

typedef std::map<std::string, octave_value> octave::stack_frame::local_vars_map

Definition at line 112 of file stack-frame.h.

Member Enumeration Documentation

◆ auto_var_type

Enumerator
ARG_NAMES 
IGNORED 
NARGIN 
NARGOUT 
SAVED_WARNING_STATES 
NUM_AUTO_VARS 

Definition at line 130 of file stack-frame.h.

◆ scope_flags

Enumerator
LOCAL 
GLOBAL 
PERSISTENT 

Definition at line 120 of file stack-frame.h.

Constructor & Destructor Documentation

◆ stack_frame() [1/3]

octave::stack_frame::stack_frame ( void  )
delete

◆ stack_frame() [2/3]

octave::stack_frame::stack_frame ( tree_evaluator tw,
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 
)
inline

Definition at line 142 of file stack-frame.h.

◆ stack_frame() [3/3]

octave::stack_frame::stack_frame ( const stack_frame elt)
default

◆ ~stack_frame()

virtual octave::stack_frame::~stack_frame ( void  )
virtualdefault

Member Function Documentation

◆ accept()

◆ access_link()

◆ all_variables()

symbol_info_list octave::stack_frame::all_variables ( void  )

Definition at line 1149 of file stack-frame.cc.

References accept(), and octave::symbol_info_accumulator::symbol_info().

Referenced by get_symbol_info(), and workspace().

◆ assign() [1/3]

void octave::stack_frame::assign ( const std::string &  name,
const octave_value val 
)
inline

Definition at line 454 of file stack-frame.h.

References assign(), insert_symbol(), and name.

◆ assign() [2/3]

void octave::stack_frame::assign ( const symbol_record sym,
const octave_value val 
)
inline

◆ assign() [3/3]

void octave::stack_frame::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 
)
inline

Definition at line 461 of file stack-frame.h.

References octave_value::assign(), assign(), octave_value::op_asn_eq, and varref().

◆ clear()

void octave::stack_frame::clear ( const symbol_record sym)
inline

◆ clear_objects()

void octave::stack_frame::clear_objects ( void  )

Definition at line 1333 of file stack-frame.cc.

References accept().

◆ clear_values()

void octave::stack_frame::clear_values ( void  )
virtual

Reimplemented in octave::user_fcn_stack_frame.

Definition at line 1081 of file stack-frame.cc.

References warning().

◆ clear_variable()

void octave::stack_frame::clear_variable ( const std::string &  name)

Definition at line 1340 of file stack-frame.cc.

References accept(), and name.

◆ clear_variable_pattern() [1/2]

void octave::stack_frame::clear_variable_pattern ( const std::string &  pattern)

Definition at line 1347 of file stack-frame.cc.

References accept().

◆ clear_variable_pattern() [2/2]

void octave::stack_frame::clear_variable_pattern ( const string_vector patterns)

Definition at line 1354 of file stack-frame.cc.

References accept().

◆ clear_variable_regexp() [1/2]

void octave::stack_frame::clear_variable_regexp ( const std::string &  pattern)

Definition at line 1361 of file stack-frame.cc.

References accept().

◆ clear_variable_regexp() [2/2]

void octave::stack_frame::clear_variable_regexp ( const string_vector patterns)

Definition at line 1368 of file stack-frame.cc.

References accept().

◆ clear_variables()

void octave::stack_frame::clear_variables ( void  )

Definition at line 1375 of file stack-frame.cc.

References accept().

◆ column() [1/2]

void octave::stack_frame::column ( int  c)
inline

Definition at line 205 of file stack-frame.h.

References m_column.

◆ column() [2/2]

int octave::stack_frame::column ( void  ) const
inline

Definition at line 206 of file stack-frame.h.

References m_column.

◆ create() [1/5]

stack_frame * octave::stack_frame::create ( tree_evaluator tw,
const symbol_scope scope,
size_t  index,
const std::shared_ptr< stack_frame > &  parent_link,
const std::shared_ptr< stack_frame > &  static_link 
)
static

Definition at line 1069 of file stack-frame.cc.

References index(), parent_link(), and static_link().

◆ create() [2/5]

stack_frame * octave::stack_frame::create ( tree_evaluator tw,
octave_function fcn,
size_t  index,
const std::shared_ptr< stack_frame > &  parent_link,
const std::shared_ptr< stack_frame > &  static_link 
)
static

Definition at line 1034 of file stack-frame.cc.

References index(), parent_link(), and static_link().

Referenced by octave::call_stack::push().

◆ create() [3/5]

stack_frame * octave::stack_frame::create ( tree_evaluator tw,
octave_user_function fcn,
size_t  index,
const std::shared_ptr< stack_frame > &  parent_link,
const std::shared_ptr< stack_frame > &  static_link,
const local_vars_map local_vars 
)
static

Definition at line 1060 of file stack-frame.cc.

References index(), parent_link(), and static_link().

◆ create() [4/5]

stack_frame * octave::stack_frame::create ( tree_evaluator tw,
octave_user_function fcn,
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 = std::shared_ptr<stack_frame> () 
)
static

Definition at line 1051 of file stack-frame.cc.

References access_link(), index(), parent_link(), and static_link().

◆ create() [5/5]

stack_frame * octave::stack_frame::create ( tree_evaluator tw,
octave_user_script script,
size_t  index,
const std::shared_ptr< stack_frame > &  parent_link,
const std::shared_ptr< stack_frame > &  static_link 
)
static

Definition at line 1042 of file stack-frame.cc.

References index(), parent_link(), and static_link().

◆ display()

◆ display_stopped_in_message()

void octave::stack_frame::display_stopped_in_message ( std::ostream &  os) const

Definition at line 1382 of file stack-frame.cc.

References fcn_file_name(), fcn_name(), index(), and line().

◆ do_non_const_unary_op()

void octave::stack_frame::do_non_const_unary_op ( octave_value::unary_op  op,
const symbol_record sym,
const std::string &  type,
const std::list< octave_value_list > &  idx 
)
inline

Definition at line 477 of file stack-frame.h.

References octave_value::do_non_const_unary_op(), and varref().

◆ fcn_file_name()

std::string octave::stack_frame::fcn_file_name ( void  ) const
inline

Definition at line 208 of file stack-frame.h.

References octave_function::fcn_file_name().

Referenced by display_stopped_in_message().

◆ fcn_name()

std::string octave::stack_frame::fcn_name ( bool  print_subfn = true) const
inline

◆ find_subfunction()

octave_value octave::stack_frame::find_subfunction ( const std::string &  name) const
inline

Definition at line 508 of file stack-frame.h.

References octave::symbol_scope::find_subfunction(), get_scope(), and name.

◆ function()

virtual octave_function* octave::stack_frame::function ( void  ) const
inlinevirtual

◆ get_auto_fcn_var()

virtual octave_value octave::stack_frame::get_auto_fcn_var ( auto_var_type  ) const
pure virtual

◆ get_dispatch_class()

std::string octave::stack_frame::get_dispatch_class ( void  ) const
inline

Definition at line 538 of file stack-frame.h.

References m_dispatch_class.

◆ get_scope()

◆ get_scope_flag()

◆ get_symbol_info()

symbol_info_list octave::stack_frame::get_symbol_info ( void  )
inline

Definition at line 271 of file stack-frame.h.

References all_variables().

◆ glob_symbol_info()

symbol_info_list octave::stack_frame::glob_symbol_info ( const std::string &  pattern)

Definition at line 1215 of file stack-frame.cc.

References accept(), and octave::symbol_info_accumulator::symbol_info().

◆ index()

size_t octave::stack_frame::index ( void  ) const
inline

Definition at line 200 of file stack-frame.h.

References m_index.

Referenced by create(), and display_stopped_in_message().

◆ insert_symbol()

virtual symbol_record octave::stack_frame::insert_symbol ( const std::string &  )
pure virtual

◆ install_variable() [1/2]

void octave::stack_frame::install_variable ( const std::string &  name,
const octave_value value,
bool  global 
)
inline

Definition at line 416 of file stack-frame.h.

References insert_symbol(), install_variable(), name, and value().

◆ install_variable() [2/2]

◆ is_compiled_fcn_frame()

virtual bool octave::stack_frame::is_compiled_fcn_frame ( void  ) const
inlinevirtual

Reimplemented in octave::compiled_fcn_stack_frame.

Definition at line 193 of file stack-frame.h.

◆ is_defined()

bool octave::stack_frame::is_defined ( const symbol_record sym) const
inline

Definition at line 341 of file stack-frame.h.

References varval().

Referenced by octave::symbol_info_accumulator::filter().

◆ is_global() [1/2]

bool octave::stack_frame::is_global ( const std::string &  name) const
inline

Definition at line 394 of file stack-frame.h.

References is_global(), lookup_symbol(), and name.

◆ is_global() [2/2]

bool octave::stack_frame::is_global ( const symbol_record sym) const
inline

◆ is_local_variable()

bool octave::stack_frame::is_local_variable ( const std::string &  name) const
inline

Definition at line 362 of file stack-frame.h.

References is_global(), is_variable(), lookup_symbol(), and name.

◆ is_object() [1/2]

bool octave::stack_frame::is_object ( const std::string &  name) const
inline

Definition at line 376 of file stack-frame.h.

References is_object(), lookup_symbol(), and name.

◆ is_object() [2/2]

bool octave::stack_frame::is_object ( const symbol_record sym) const
inline

Definition at line 369 of file stack-frame.h.

References octave_value::isobject(), and varval().

Referenced by is_object(), and octave::symbol_cleaner::maybe_clear_symbol().

◆ is_persistent() [1/2]

bool octave::stack_frame::is_persistent ( const std::string &  name) const
inline

Definition at line 406 of file stack-frame.h.

References is_persistent(), lookup_symbol(), and name.

◆ is_persistent() [2/2]

bool octave::stack_frame::is_persistent ( const symbol_record sym) const
inline

Definition at line 401 of file stack-frame.h.

References PERSISTENT, and scope_flag().

Referenced by clear(), is_persistent(), make_global(), and make_symbol_info_list().

◆ is_scope_frame()

virtual bool octave::stack_frame::is_scope_frame ( void  ) const
inlinevirtual

Reimplemented in octave::scope_stack_frame.

Definition at line 196 of file stack-frame.h.

◆ is_user_fcn_frame()

virtual bool octave::stack_frame::is_user_fcn_frame ( void  ) const
inlinevirtual

Reimplemented in octave::user_fcn_stack_frame.

Definition at line 195 of file stack-frame.h.

◆ is_user_script_frame()

virtual bool octave::stack_frame::is_user_script_frame ( void  ) const
inlinevirtual

Reimplemented in octave::script_stack_frame.

Definition at line 194 of file stack-frame.h.

◆ is_variable() [1/2]

bool octave::stack_frame::is_variable ( const std::string &  name) const
inline

Definition at line 355 of file stack-frame.h.

References is_variable(), lookup_symbol(), and name.

◆ is_variable() [2/2]

bool octave::stack_frame::is_variable ( const symbol_record sym) const
inline

Definition at line 348 of file stack-frame.h.

References octave_value::is_defined(), and varval().

Referenced by is_local_variable(), is_variable(), and variable_names().

◆ line() [1/2]

void octave::stack_frame::line ( int  l)
inline

Definition at line 202 of file stack-frame.h.

References m_line.

◆ line() [2/2]

int octave::stack_frame::line ( void  ) const
inline

Definition at line 203 of file stack-frame.h.

References m_line.

Referenced by display_stopped_in_message().

◆ lookup_symbol()

virtual symbol_record octave::stack_frame::lookup_symbol ( const std::string &  ) const
pure virtual

◆ make_global()

void octave::stack_frame::make_global ( const symbol_record sym)
inline

◆ make_persistent()

void octave::stack_frame::make_persistent ( const symbol_record sym)
inline

◆ make_symbol_info_list()

symbol_info_list octave::stack_frame::make_symbol_info_list ( const std::list< symbol_record > &  symrec_list) const

◆ mark_global()

void octave::stack_frame::mark_global ( const symbol_record sym)
inline

Definition at line 321 of file stack-frame.h.

References GLOBAL, and mark_scope().

Referenced by install_variable(), and make_global().

◆ mark_persistent()

void octave::stack_frame::mark_persistent ( const symbol_record sym)
inline

Definition at line 331 of file stack-frame.h.

References mark_scope(), and PERSISTENT.

Referenced by make_persistent().

◆ mark_scope()

virtual void octave::stack_frame::mark_scope ( const symbol_record ,
scope_flags   
)
pure virtual

◆ operator=()

stack_frame& octave::stack_frame::operator= ( const stack_frame elt)
delete

◆ parent_link()

std::shared_ptr<stack_frame> octave::stack_frame::parent_link ( void  ) const
inline

Definition at line 309 of file stack-frame.h.

References m_parent_link.

Referenced by create().

◆ regexp_symbol_info()

symbol_info_list octave::stack_frame::regexp_symbol_info ( const std::string &  pattern)

Definition at line 1224 of file stack-frame.cc.

References accept(), and octave::symbol_info_accumulator::symbol_info().

◆ resize()

void octave::stack_frame::resize ( size_t  )
virtual

◆ scope_flag()

virtual scope_flags octave::stack_frame::scope_flag ( const symbol_record ) const
pure virtual

◆ set_auto_fcn_var()

virtual void octave::stack_frame::set_auto_fcn_var ( auto_var_type  ,
const octave_value  
)
pure virtual

◆ set_dispatch_class()

void octave::stack_frame::set_dispatch_class ( const std::string &  class_name)
inline

Definition at line 540 of file stack-frame.h.

References m_dispatch_class.

◆ set_scope_flag()

void octave::stack_frame::set_scope_flag ( size_t  ,
scope_flags   
)
virtual

Reimplemented in octave::base_value_stack_frame.

Definition at line 1260 of file stack-frame.cc.

References panic_impossible.

◆ size()

◆ static_link()

◆ unmark_global()

void octave::stack_frame::unmark_global ( const symbol_record sym)
inline

Definition at line 326 of file stack-frame.h.

References LOCAL, and mark_scope().

Referenced by clear().

◆ unmark_persistent()

void octave::stack_frame::unmark_persistent ( const symbol_record sym)
inline

Definition at line 336 of file stack-frame.h.

References LOCAL, and mark_scope().

Referenced by clear().

◆ unwind_protect_frame()

virtual unwind_protect* octave::stack_frame::unwind_protect_frame ( void  )
inlinevirtual

Reimplemented in octave::user_fcn_stack_frame, and octave::script_stack_frame.

Definition at line 243 of file stack-frame.h.

◆ value()

octave_value octave::stack_frame::value ( const symbol_record sym,
const std::string &  type,
const std::list< octave_value_list > &  idx 
) const
inline

Definition at line 488 of file stack-frame.h.

References octave_value_list::length(), octave_value(), retval, and varval().

Referenced by install_variable(), and make_symbol_info_list().

◆ variable_names()

std::list< std::string > octave::stack_frame::variable_names ( void  ) const

◆ varref() [1/2]

◆ varref() [2/2]

octave_value & octave::stack_frame::varref ( size_t  data_offset)
virtual

Reimplemented in octave::base_value_stack_frame.

Definition at line 1324 of file stack-frame.cc.

References panic_impossible.

◆ varval() [1/3]

octave_value octave::stack_frame::varval ( const std::string &  name) const
inline

Definition at line 432 of file stack-frame.h.

References lookup_symbol(), name, octave_value(), and varval().

◆ varval() [2/3]

◆ varval() [3/3]

octave_value octave::stack_frame::varval ( size_t  data_offset) const
virtual

Reimplemented in octave::base_value_stack_frame.

Definition at line 1315 of file stack-frame.cc.

References panic_impossible.

◆ who()

octave_value octave::stack_frame::who ( const string_vector patterns,
bool  have_regexp,
bool  return_list,
bool  verbose,
const std::string &  whos_line_fmt,
const std::string &  msg 
)

◆ workspace()

Member Data Documentation

◆ m_access_link

◆ m_column

int octave::stack_frame::m_column
protected

Definition at line 563 of file stack-frame.h.

Referenced by column(), and display().

◆ m_dispatch_class

std::string octave::stack_frame::m_dispatch_class
protected

Definition at line 584 of file stack-frame.h.

Referenced by get_dispatch_class(), and set_dispatch_class().

◆ m_evaluator

◆ m_index

size_t octave::stack_frame::m_index
protected

Definition at line 566 of file stack-frame.h.

Referenced by display(), and index().

◆ m_line

int octave::stack_frame::m_line
protected

Definition at line 562 of file stack-frame.h.

Referenced by display(), and line().

◆ m_parent_link

std::shared_ptr<stack_frame> octave::stack_frame::m_parent_link
protected

Definition at line 570 of file stack-frame.h.

Referenced by display(), and parent_link().

◆ m_static_link


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