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

#include "symscope.h"

Collaboration diagram for 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)
 
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
 
bool is_variable (const std::string &nm) const
 
std::list< octave_valuelocalfunctions (void) const
 
void lock_subfunctions (void)
 
bool look_nonlocal (const std::string &name, std::size_t offset, symbol_record &result)
 
symbol_record lookup_symbol (const std::string &name) const
 
void mark_as_variable (const std::string &nm)
 
void mark_as_variables (const std::list< std::string > &lst)
 
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
 
std::size_t nesting_depth (void) const
 
std::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 (std::size_t data_offset)
 
octave_value persistent_varval (std::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 (std::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 374 of file symscope.h.

Constructor & Destructor Documentation

◆ symbol_scope() [1/3]

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

Definition at line 379 of file symscope.h.

Referenced by dup().

◆ symbol_scope() [2/3]

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

Definition at line 385 of file symscope.h.

◆ symbol_scope() [3/3]

symbol_scope::symbol_scope ( const symbol_scope )
default

◆ ~symbol_scope()

symbol_scope::~symbol_scope ( void  )
default

Member Function Documentation

◆ cache_dir_name()

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

◆ cache_fcn_file_name()

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

◆ cache_fcn_name()

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

Definition at line 587 of file symscope.h.

References m_rep, and name().

Referenced by base_parser::finish_function().

◆ cache_name()

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

◆ dir_name()

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

◆ dump()

octave_value symbol_scope::dump ( void  ) const
inline

Definition at line 566 of file symscope.h.

References m_rep, and octave_value().

◆ dup()

symbol_scope symbol_scope::dup ( void  ) const
inline

Definition at line 457 of file symscope.h.

References symbol_scope(), and m_rep.

Referenced by tree_anon_fcn_handle::dup(), and tree_evaluator::evaluate_anon_fcn_handle().

◆ erase_subfunctions()

void symbol_scope::erase_subfunctions ( void  )
inline

Definition at line 535 of file symscope.h.

References m_rep.

◆ fcn_file_name()

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

◆ fcn_name()

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

Definition at line 582 of file symscope.h.

References m_rep.

Referenced by parse_tree_validator::visit_index_expression().

◆ find_subfunction()

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

◆ find_symbol()

symbol_record symbol_scope::find_symbol ( const std::string &  name)
inline

◆ get_rep()

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

Definition at line 688 of file symscope.h.

References m_rep.

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

◆ has_subfunctions()

bool symbol_scope::has_subfunctions ( void  ) const
inline

Definition at line 547 of file symscope.h.

References m_rep.

◆ insert()

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

Definition at line 485 of file symscope.h.

References m_rep, and name().

Referenced by base_parser::make_identifier(), and script_stack_frame::set_script_offsets_internal().

◆ insert_local()

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

Definition at line 404 of file symscope.h.

References m_rep, and name().

◆ insert_symbol_record()

void symbol_scope::insert_symbol_record ( symbol_record sr)
inline

Definition at line 409 of file symscope.h.

References m_rep.

◆ install_nestfunction()

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

Definition at line 503 of file symscope.h.

References m_rep, and name().

Referenced by base_parser::finish_function().

◆ install_subfunction()

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

Definition at line 496 of file symscope.h.

References m_rep, and name().

Referenced by base_parser::finish_function().

◆ is_nested()

bool symbol_scope::is_nested ( void  ) const
inline

◆ is_parent()

bool symbol_scope::is_parent ( void  ) const
inline

Definition at line 420 of file symscope.h.

References m_rep.

◆ is_primary_fcn_scope()

bool symbol_scope::is_primary_fcn_scope ( void  ) const
inline

Definition at line 649 of file symscope.h.

References m_rep.

Referenced by localfunctions().

◆ is_relative()

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

Definition at line 654 of file symscope.h.

References get_rep(), and m_rep.

◆ is_static()

bool symbol_scope::is_static ( void  ) const
inline

Definition at line 436 of file symscope.h.

References m_rep.

◆ is_valid()

bool symbol_scope::is_valid ( void  ) const
inline

Definition at line 395 of file symscope.h.

References m_rep.

Referenced by tree_anon_fcn_handle::has_parent_scope().

◆ is_variable()

bool symbol_scope::is_variable ( const std::string &  nm) const
inline

Definition at line 671 of file symscope.h.

References m_rep.

Referenced by parse_tree_validator::visit_index_expression().

◆ localfunctions()

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

Definition at line 373 of file symscope.cc.

References is_primary_fcn_scope(), and m_rep.

◆ lock_subfunctions()

void symbol_scope::lock_subfunctions ( void  )
inline

Definition at line 516 of file symscope.h.

References m_rep.

◆ look_nonlocal()

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

Definition at line 682 of file symscope.h.

References m_rep, and name().

◆ lookup_symbol()

◆ mark_as_variable()

void symbol_scope::mark_as_variable ( const std::string &  nm)
inline

Definition at line 659 of file symscope.h.

References m_rep.

Referenced by lexical_feedback::mark_as_variable().

◆ mark_as_variables()

void symbol_scope::mark_as_variables ( const std::list< std::string > &  lst)
inline

Definition at line 665 of file symscope.h.

References m_rep.

Referenced by lexical_feedback::mark_as_variables().

◆ mark_primary_fcn_scope()

void symbol_scope::mark_primary_fcn_scope ( void  )
inline

Definition at line 643 of file symscope.h.

References m_rep.

Referenced by base_parser::push_fcn_symtab().

◆ mark_static()

void symbol_scope::mark_static ( void  )
inline

Definition at line 441 of file symscope.h.

References m_rep.

Referenced by base_parser::make_anon_fcn_handle().

◆ mark_subfunctions_in_scope_as_private()

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

Definition at line 541 of file symscope.h.

References m_rep.

◆ name()

◆ nesting_depth()

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

Definition at line 431 of file symscope.h.

References m_rep.

Referenced by tree_evaluator::evaluate_anon_fcn_handle(), and user_fcn_stack_frame::get_access_link().

◆ num_symbols()

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

◆ operator bool()

symbol_scope::operator bool ( ) const
inlineexplicit

Definition at line 397 of file symscope.h.

References m_rep.

◆ operator=()

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

◆ parent_fcn_names()

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

Definition at line 593 of file symscope.h.

References m_rep.

Referenced by symbol_scope_rep::localfunctions().

◆ parent_scope()

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

◆ persistent_varref()

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

◆ persistent_varval()

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

◆ primary_parent_scope()

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

Definition at line 452 of file symscope.h.

References m_rep.

◆ rename()

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

Definition at line 490 of file symscope.h.

References m_rep.

Referenced by base_qobject::workspace_widget().

◆ set_nesting_depth()

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

Definition at line 425 of file symscope.h.

References m_rep.

Referenced by tree_evaluator::evaluate_anon_fcn_handle(), and base_parser::finish_function().

◆ set_parent()

void symbol_scope::set_parent ( const symbol_scope p)
inline

Definition at line 609 of file symscope.h.

References get_rep(), and m_rep.

Referenced by tree_evaluator::evaluate_anon_fcn_handle(), and base_parser::finish_function().

◆ set_primary_parent()

void symbol_scope::set_primary_parent ( const symbol_scope p)
inline

Definition at line 615 of file symscope.h.

References get_rep(), and m_rep.

Referenced by tree_evaluator::evaluate_anon_fcn_handle(), and base_parser::finish_function().

◆ set_user_code()

void symbol_scope::set_user_code ( octave_user_code code)
inline

Definition at line 603 of file symscope.h.

References m_rep.

◆ stash_subfunction_names()

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

Definition at line 552 of file symscope.h.

References m_rep.

◆ subfunction_names()

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

Definition at line 558 of file symscope.h.

References m_rep.

◆ subfunctions()

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

Definition at line 528 of file symscope.h.

References m_rep.

◆ symbol_list()

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

◆ symbols() [1/2]

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

Definition at line 710 of file symscope.h.

References m_rep.

◆ symbols() [2/2]

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

◆ unlock_subfunctions()

void symbol_scope::unlock_subfunctions ( void  )
inline

Definition at line 522 of file symscope.h.

References m_rep.

◆ update_nest()

void symbol_scope::update_nest ( void  )
inline

Definition at line 676 of file symscope.h.

References m_rep.

Referenced by base_parser::finish_function().

◆ user_code()

octave_user_code* symbol_scope::user_code ( void  ) const
inline

Definition at line 598 of file symscope.h.

References m_rep.

Referenced by find_private_file().

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 698 of file symscope.h.

◆ operator==

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

Definition at line 693 of file symscope.h.

Member Data Documentation

◆ m_rep


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