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

#include "symscope.h"

Collaboration diagram for octave::symbol_scope:

Public Member Functions

 symbol_scope (const std::shared_ptr< symbol_scope_rep > new_rep=nullptr)
 
 symbol_scope (const std::string &name)
 
 symbol_scope (const symbol_scope &)=default
 
 ~symbol_scope (void)=default
 
void cache_dir_name (const std::string &name)
 
void cache_fcn_file_name (const std::string &name)
 
void cache_fcn_name (const std::string &name)
 
void cache_name (const std::string &name)
 
void cache_parent_fcn_names (const std::list< std::string > &names)
 
std::string dir_name (void) const
 
octave_value dump (void) const
 
symbol_scope dup (void) const
 
void erase_subfunctions (void)
 
std::string fcn_file_name (void) const
 
std::string fcn_name (void) const
 
octave_value find_subfunction (const std::string &name) const
 
symbol_record find_symbol (const std::string &name)
 
std::shared_ptr< symbol_scope_repget_rep (void) const
 
bool has_subfunctions (void) const
 
symbol_record insert (const std::string &name)
 
symbol_record insert_local (const std::string &name)
 
void insert_symbol_record (symbol_record &sr)
 
void install_nestfunction (const std::string &name, const octave_value &fval, const symbol_scope &fcn_scope)
 
void install_subfunction (const std::string &name, const octave_value &fval)
 
bool is_nested (void) const
 
bool is_parent (void) const
 
bool is_primary_fcn_scope (void) const
 
bool is_relative (const symbol_scope &scope) const
 
bool is_static (void) const
 
bool is_valid (void) const
 
std::list< octave_valuelocalfunctions (void) const
 
void lock_subfunctions (void)
 
bool look_nonlocal (const std::string &name, size_t offset, symbol_record &result)
 
symbol_record lookup_symbol (const std::string &name) const
 
void mark_primary_fcn_scope (void)
 
void mark_static (void)
 
void mark_subfunctions_in_scope_as_private (const std::string &class_name)
 
std::string name (void) const
 
size_t nesting_depth (void) const
 
size_t num_symbols (void) const
 
 operator bool () const
 
symbol_scopeoperator= (const symbol_scope &)=default
 
std::list< std::string > parent_fcn_names (void) const
 
std::shared_ptr< symbol_scope_repparent_scope (void) const
 
octave_valuepersistent_varref (size_t data_offset)
 
octave_value persistent_varval (size_t data_offset) const
 
std::shared_ptr< symbol_scope_repprimary_parent_scope (void) const
 
void rename (const std::string &old_name, const std::string &new_name)
 
void set_nesting_depth (size_t depth)
 
void set_parent (const symbol_scope &p)
 
void set_primary_parent (const symbol_scope &p)
 
void set_user_code (octave_user_code *code)
 
void stash_subfunction_names (const std::list< std::string > &names)
 
std::list< std::string > subfunction_names (void) const
 
std::map< std::string, octave_valuesubfunctions (void) const
 
std::list< symbol_recordsymbol_list (void) const
 
std::map< std::string, symbol_record > & symbols (void)
 
const std::map< std::string, symbol_record > & symbols (void) const
 
void unlock_subfunctions (void)
 
void update_nest (void)
 
octave_user_codeuser_code (void) const
 

Private Attributes

std::shared_ptr< symbol_scope_repm_rep
 

Friends

bool operator!= (const symbol_scope &a, const symbol_scope &b)
 
bool operator== (const symbol_scope &a, const symbol_scope &b)
 

Detailed Description

Definition at line 382 of file symscope.h.

Constructor & Destructor Documentation

◆ symbol_scope() [1/3]

octave::symbol_scope::symbol_scope ( const std::string &  name)
inline

Definition at line 387 of file symscope.h.

Referenced by dup().

◆ symbol_scope() [2/3]

octave::symbol_scope::symbol_scope ( const std::shared_ptr< symbol_scope_rep new_rep = nullptr)
inline

Definition at line 393 of file symscope.h.

◆ symbol_scope() [3/3]

octave::symbol_scope::symbol_scope ( const symbol_scope )
default

◆ ~symbol_scope()

octave::symbol_scope::~symbol_scope ( void  )
default

Member Function Documentation

◆ cache_dir_name()

void octave::symbol_scope::cache_dir_name ( const std::string &  name)
inline

◆ cache_fcn_file_name()

void octave::symbol_scope::cache_fcn_file_name ( const std::string &  name)
inline

◆ cache_fcn_name()

void octave::symbol_scope::cache_fcn_name ( const std::string &  name)
inline

Definition at line 595 of file symscope.h.

References m_rep, and name().

Referenced by octave::base_parser::finish_function().

◆ cache_name()

void octave::symbol_scope::cache_name ( const std::string &  name)
inline

◆ cache_parent_fcn_names()

void octave::symbol_scope::cache_parent_fcn_names ( const std::list< std::string > &  names)
inline

Definition at line 606 of file symscope.h.

References m_rep.

Referenced by octave::base_parser::finish_function().

◆ dir_name()

std::string octave::symbol_scope::dir_name ( void  ) const
inline

◆ dump()

octave_value octave::symbol_scope::dump ( void  ) const
inline

Definition at line 574 of file symscope.h.

References m_rep, and octave_value().

Referenced by octave_user_code::dump().

◆ dup()

symbol_scope octave::symbol_scope::dup ( void  ) const
inline

Definition at line 465 of file symscope.h.

References symbol_scope(), and m_rep.

Referenced by octave::tree_anon_fcn_handle::dup(), and octave::tree_anon_fcn_handle::evaluate().

◆ erase_subfunctions()

void octave::symbol_scope::erase_subfunctions ( void  )
inline

Definition at line 543 of file symscope.h.

References m_rep.

Referenced by octave_user_function::erase_subfunctions().

◆ fcn_file_name()

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

◆ fcn_name()

std::string octave::symbol_scope::fcn_name ( void  ) const
inline

Definition at line 590 of file symscope.h.

References m_rep.

Referenced by octave::base_parser::finish_function().

◆ find_subfunction()

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

◆ find_symbol()

◆ get_rep()

std::shared_ptr<symbol_scope_rep> octave::symbol_scope::get_rep ( void  ) const
inline

Definition at line 685 of file symscope.h.

References m_rep.

Referenced by is_relative(), set_parent(), and set_primary_parent().

◆ has_subfunctions()

bool octave::symbol_scope::has_subfunctions ( void  ) const
inline

Definition at line 555 of file symscope.h.

References m_rep.

Referenced by octave_user_function::has_subfunctions().

◆ insert()

symbol_record octave::symbol_scope::insert ( const std::string &  name)
inline

◆ insert_local()

symbol_record octave::symbol_scope::insert_local ( const std::string &  name)
inline

Definition at line 412 of file symscope.h.

References m_rep, and name().

◆ insert_symbol_record()

void octave::symbol_scope::insert_symbol_record ( symbol_record sr)
inline

Definition at line 417 of file symscope.h.

References m_rep.

◆ install_nestfunction()

void octave::symbol_scope::install_nestfunction ( const std::string &  name,
const octave_value fval,
const symbol_scope fcn_scope 
)
inline

Definition at line 511 of file symscope.h.

References m_rep, and name().

Referenced by octave::base_parser::finish_function().

◆ install_subfunction()

void octave::symbol_scope::install_subfunction ( const std::string &  name,
const octave_value fval 
)
inline

Definition at line 504 of file symscope.h.

References m_rep, and name().

Referenced by octave::base_parser::finish_function().

◆ is_nested()

bool octave::symbol_scope::is_nested ( void  ) const
inline

◆ is_parent()

bool octave::symbol_scope::is_parent ( void  ) const
inline

Definition at line 428 of file symscope.h.

References m_rep.

◆ is_primary_fcn_scope()

bool octave::symbol_scope::is_primary_fcn_scope ( void  ) const
inline

Definition at line 663 of file symscope.h.

References m_rep.

Referenced by localfunctions().

◆ is_relative()

bool octave::symbol_scope::is_relative ( const symbol_scope scope) const
inline

Definition at line 668 of file symscope.h.

References get_rep(), and m_rep.

◆ is_static()

bool octave::symbol_scope::is_static ( void  ) const
inline

Definition at line 444 of file symscope.h.

References m_rep.

◆ is_valid()

bool octave::symbol_scope::is_valid ( void  ) const
inline

Definition at line 403 of file symscope.h.

References m_rep.

Referenced by octave::tree_anon_fcn_handle::has_parent_scope().

◆ localfunctions()

std::list< octave_value > octave::symbol_scope::localfunctions ( void  ) const

Definition at line 327 of file symscope.cc.

References is_primary_fcn_scope(), and m_rep.

◆ lock_subfunctions()

void octave::symbol_scope::lock_subfunctions ( void  )
inline

Definition at line 524 of file symscope.h.

References m_rep.

Referenced by octave_user_function::lock_subfunctions().

◆ look_nonlocal()

bool octave::symbol_scope::look_nonlocal ( const std::string &  name,
size_t  offset,
symbol_record result 
)
inline

Definition at line 679 of file symscope.h.

References m_rep, and name().

◆ lookup_symbol()

◆ mark_primary_fcn_scope()

void octave::symbol_scope::mark_primary_fcn_scope ( void  )
inline

Definition at line 657 of file symscope.h.

References m_rep.

Referenced by octave::base_parser::push_fcn_symtab().

◆ mark_static()

void octave::symbol_scope::mark_static ( void  )
inline

Definition at line 449 of file symscope.h.

References m_rep.

Referenced by octave::base_parser::make_anon_fcn_handle().

◆ mark_subfunctions_in_scope_as_private()

void octave::symbol_scope::mark_subfunctions_in_scope_as_private ( const std::string &  class_name)
inline

Definition at line 549 of file symscope.h.

References m_rep.

Referenced by octave_user_function::mark_as_private_function().

◆ name()

◆ nesting_depth()

size_t octave::symbol_scope::nesting_depth ( void  ) const
inline

◆ num_symbols()

size_t octave::symbol_scope::num_symbols ( void  ) const
inline

◆ operator bool()

octave::symbol_scope::operator bool ( ) const
inlineexplicit

Definition at line 405 of file symscope.h.

References m_rep.

◆ operator=()

symbol_scope& octave::symbol_scope::operator= ( const symbol_scope )
default

◆ parent_fcn_names()

std::list<std::string> octave::symbol_scope::parent_fcn_names ( void  ) const
inline

Definition at line 601 of file symscope.h.

References m_rep.

Referenced by octave::base_parser::finish_function(), and octave::symbol_scope_rep::localfunctions().

◆ parent_scope()

std::shared_ptr<symbol_scope_rep> octave::symbol_scope::parent_scope ( void  ) const
inline

◆ persistent_varref()

octave_value& octave::symbol_scope::persistent_varref ( size_t  data_offset)
inline

◆ persistent_varval()

octave_value octave::symbol_scope::persistent_varval ( size_t  data_offset) const
inline

◆ primary_parent_scope()

std::shared_ptr<symbol_scope_rep> octave::symbol_scope::primary_parent_scope ( void  ) const
inline

Definition at line 460 of file symscope.h.

References m_rep.

◆ rename()

void octave::symbol_scope::rename ( const std::string &  old_name,
const std::string &  new_name 
)
inline

Definition at line 498 of file symscope.h.

References m_rep.

Referenced by octave::main_window::handle_rename_variable_request().

◆ set_nesting_depth()

void octave::symbol_scope::set_nesting_depth ( size_t  depth)
inline

Definition at line 433 of file symscope.h.

References m_rep.

Referenced by octave::tree_anon_fcn_handle::evaluate(), and octave::base_parser::finish_function().

◆ set_parent()

void octave::symbol_scope::set_parent ( const symbol_scope p)
inline

◆ set_primary_parent()

void octave::symbol_scope::set_primary_parent ( const symbol_scope p)
inline

Definition at line 629 of file symscope.h.

References get_rep(), and m_rep.

Referenced by octave::tree_anon_fcn_handle::evaluate(), and octave::base_parser::finish_function().

◆ set_user_code()

void octave::symbol_scope::set_user_code ( octave_user_code code)
inline

Definition at line 617 of file symscope.h.

References m_rep.

Referenced by octave_user_code::~octave_user_code().

◆ stash_subfunction_names()

void octave::symbol_scope::stash_subfunction_names ( const std::list< std::string > &  names)
inline

Definition at line 560 of file symscope.h.

References m_rep.

Referenced by octave_user_function::stash_subfunction_names().

◆ subfunction_names()

std::list<std::string> octave::symbol_scope::subfunction_names ( void  ) const
inline

Definition at line 566 of file symscope.h.

References m_rep.

Referenced by octave_user_function::subfunction_names().

◆ subfunctions()

std::map<std::string, octave_value> octave::symbol_scope::subfunctions ( void  ) const
inline

Definition at line 536 of file symscope.h.

References m_rep.

Referenced by octave_user_function::subfunctions().

◆ symbol_list()

std::list<symbol_record> octave::symbol_scope::symbol_list ( void  ) const
inline

◆ symbols() [1/2]

std::map<std::string, symbol_record>& octave::symbol_scope::symbols ( void  )
inline

Definition at line 707 of file symscope.h.

References m_rep.

◆ symbols() [2/2]

const std::map<std::string, symbol_record>& octave::symbol_scope::symbols ( void  ) const
inline

◆ unlock_subfunctions()

void octave::symbol_scope::unlock_subfunctions ( void  )
inline

Definition at line 530 of file symscope.h.

References m_rep.

Referenced by octave_user_function::unlock_subfunctions().

◆ update_nest()

void octave::symbol_scope::update_nest ( void  )
inline

Definition at line 673 of file symscope.h.

References m_rep.

Referenced by octave::base_parser::finish_function().

◆ user_code()

octave_user_code* octave::symbol_scope::user_code ( void  ) const
inline

Definition at line 612 of file symscope.h.

References m_rep.

Referenced by octave::find_private_file().

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const symbol_scope a,
const symbol_scope b 
)
friend

Definition at line 695 of file symscope.h.

◆ operator==

bool operator== ( const symbol_scope a,
const symbol_scope b 
)
friend

Definition at line 690 of file symscope.h.

Member Data Documentation

◆ m_rep


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