GNU Octave  4.4.1
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::string &name)
 
 symbol_scope (const std::shared_ptr< symbol_scope_rep > new_rep=nullptr)
 
 symbol_scope (const symbol_scope &)=default
 
 ~symbol_scope (void)=default
 
std::list< symbol_recordall_variables (bool defined_only=true, unsigned int exclude=symbol_record::hidden) const
 
void assign (const std::string &name, const octave_value &value, bool force_add)
 
void assign (const std::string &name, const octave_value &value=octave_value())
 
void bind_script_symbols (const symbol_scope &curr_scope)
 
void cache_name (const std::string &name)
 
void clear_objects (void)
 
void clear_variable (const std::string &name)
 
void clear_variable_pattern (const std::string &pat)
 
void clear_variable_regexp (const std::string &pat)
 
void clear_variables (void)
 
symbol_record::context_id current_context (void) const
 
octave_value dump (void) const
 
symbol_scope dup (void) const
 
void erase_subfunctions (void)
 
octave_value find (const std::string &name, const octave_value_list &args, bool skip_variables, bool local_funcs)
 
octave_value find_subfunction (const std::string &name) const
 
symbol_record find_symbol (const std::string &name)
 
void force_assign (const std::string &name, const octave_value &value)
 
octave_user_functionfunction (void)
 
std::shared_ptr< symbol_scope_repget_rep (void) const
 
std::list< symbol_recordglob (const std::string &pattern, bool vars_only=false) const
 
bool has_subfunctions (void) const
 
void inherit (const symbol_scope &donor_scope)
 
symbol_recordinsert (const std::string &name, bool force_add=false)
 
void insert_symbol_record (const 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_global (const std::string &name) const
 
bool is_local_variable (const std::string &name) const
 
bool is_nested (void) const
 
bool is_static (void) const
 
bool is_valid (void) const
 
bool is_variable (const std::string &name) const
 
void lock_subfunctions (void)
 
bool look_nonlocal (const std::string &name, symbol_record &result)
 
void mark_automatic (const std::string &name)
 
void mark_global (const std::string &name)
 
void mark_hidden (const std::string &name)
 
void mark_nested (void)
 
void mark_static (void)
 
void mark_subfunctions_in_scope_as_private (const std::string &class_name)
 
std::string name (void) const
 
 operator bool () const
 
symbol_scopeoperator= (const symbol_scope &)=default
 
std::shared_ptr< symbol_scope_repparent_scope (void) const
 
void pop_context (void)
 
void push_context (void)
 
void refresh (void)
 
std::list< symbol_recordregexp (const std::string &pattern, bool vars_only=false) const
 
void rename (const std::string &old_name, const std::string &new_name)
 
void set_context (symbol_record::context_id context)
 
void set_function (octave_user_function *fcn)
 
void set_parent (const symbol_scope &p)
 
void stash_subfunction_names (const std::list< std::string > &names)
 
std::list< std::stringsubfunction_names (void) const
 
std::map< std::string, octave_valuesubfunctions (void) const
 
void unbind_script_symbols (void)
 
void unlock_subfunctions (void)
 
void update_nest (void)
 
std::list< std::stringvariable_names (void)
 
octave_value varval (const std::string &name) const
 

Private Member Functions

octave_value dump_symbols_map (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 600 of file symscope.h.

Constructor & Destructor Documentation

◆ symbol_scope() [1/3]

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

Definition at line 605 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 611 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

◆ all_variables()

std::list<symbol_record> octave::symbol_scope::all_variables ( bool  defined_only = true,
unsigned int  exclude = symbol_record::hidden 
) const
inline

◆ assign() [1/2]

void octave::symbol_scope::assign ( const std::string name,
const octave_value value,
bool  force_add 
)
inline

◆ assign() [2/2]

void octave::symbol_scope::assign ( const std::string name,
const octave_value value = octave_value () 
)
inline

Definition at line 714 of file symscope.h.

References m_rep, name(), and value.

◆ bind_script_symbols()

void octave::symbol_scope::bind_script_symbols ( const symbol_scope curr_scope)
inline

Definition at line 958 of file symscope.h.

References get_rep(), and m_rep.

Referenced by octave_user_script::call().

◆ cache_name()

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

Definition at line 924 of file symscope.h.

References m_rep, and name().

Referenced by octave_fcn_handle::octave_fcn_handle(), and octave_fcn_handle::parse_anon_fcn_handle().

◆ clear_objects()

void octave::symbol_scope::clear_objects ( void  )
inline

Definition at line 761 of file symscope.h.

References m_rep.

◆ clear_variable()

void octave::symbol_scope::clear_variable ( const std::string name)
inline

Definition at line 767 of file symscope.h.

References m_rep, and name().

Referenced by octave::symbol_table::clear_global().

◆ clear_variable_pattern()

void octave::symbol_scope::clear_variable_pattern ( const std::string pat)
inline

Definition at line 773 of file symscope.h.

References m_rep.

Referenced by octave::symbol_table::clear_global_pattern(), and maybe_missing_function_hook().

◆ clear_variable_regexp()

void octave::symbol_scope::clear_variable_regexp ( const std::string pat)
inline

Definition at line 779 of file symscope.h.

References m_rep.

Referenced by maybe_missing_function_hook().

◆ clear_variables()

void octave::symbol_scope::clear_variables ( void  )
inline

Definition at line 755 of file symscope.h.

References m_rep.

◆ current_context()

◆ dump()

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

Definition at line 914 of file symscope.h.

References m_rep, and octave_value().

Referenced by octave_user_function::dump().

◆ dump_symbols_map()

octave_value octave::symbol_scope::dump_symbols_map ( void  ) const
inlineprivate

Definition at line 989 of file symscope.h.

References m_rep, and octave_value().

◆ dup()

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

◆ erase_subfunctions()

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

Definition at line 886 of file symscope.h.

References m_rep.

Referenced by octave_user_function::erase_subfunctions().

◆ find()

octave_value octave::symbol_scope::find ( const std::string name,
const octave_value_list args,
bool  skip_variables,
bool  local_funcs 
)
inline

Definition at line 686 of file symscope.h.

References m_rep, name(), and octave_value().

Referenced by octave::symbol_table::find().

◆ find_subfunction()

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

Definition at line 862 of file symscope.h.

References m_rep, name(), and octave_value().

Referenced by octave::fcn_info::fcn_info_rep::x_builtin_find().

◆ find_symbol()

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

◆ force_assign()

void octave::symbol_scope::force_assign ( const std::string name,
const octave_value value 
)
inline

◆ function()

octave_user_function* octave::symbol_scope::function ( void  )
inline

◆ get_rep()

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

◆ glob()

std::list<symbol_record> octave::symbol_scope::glob ( const std::string pattern,
bool  vars_only = false 
) const
inline

Definition at line 817 of file symscope.h.

References m_rep, and pattern().

Referenced by save_vars().

◆ has_subfunctions()

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

Definition at line 898 of file symscope.h.

References m_rep.

Referenced by octave_user_function::has_subfunctions().

◆ inherit()

void octave::symbol_scope::inherit ( const symbol_scope donor_scope)
inline

Definition at line 679 of file symscope.h.

References get_rep(), and m_rep.

Referenced by octave::symbol_table::inherit(), and octave::tree_evaluator::visit_anon_fcn_handle().

◆ insert()

symbol_record& octave::symbol_scope::insert ( const std::string name,
bool  force_add = false 
)
inline

Definition at line 695 of file symscope.h.

References m_rep, and name().

◆ insert_symbol_record()

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

Definition at line 625 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 854 of file symscope.h.

References m_rep, and name().

◆ install_subfunction()

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

Definition at line 847 of file symscope.h.

References m_rep, and name().

◆ is_global()

bool octave::symbol_scope::is_global ( const std::string name) const
inline

Definition at line 842 of file symscope.h.

References m_rep, and name().

Referenced by do_isglobal(), and octave::tree_evaluator::visit_decl_elt().

◆ is_local_variable()

bool octave::symbol_scope::is_local_variable ( const std::string name) const
inline

Definition at line 837 of file symscope.h.

References m_rep, and name().

◆ is_nested()

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

Definition at line 631 of file symscope.h.

References m_rep.

◆ is_static()

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

Definition at line 642 of file symscope.h.

References m_rep.

◆ is_valid()

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

Definition at line 621 of file symscope.h.

References m_rep.

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

◆ is_variable()

bool octave::symbol_scope::is_variable ( const std::string name) const
inline

Definition at line 732 of file symscope.h.

References m_rep, and name().

Referenced by do_who(), and save_vars().

◆ lock_subfunctions()

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

Definition at line 867 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,
symbol_record result 
)
inline

Definition at line 953 of file symscope.h.

References m_rep, name(), and result.

◆ mark_automatic()

void octave::symbol_scope::mark_automatic ( const std::string name)
inline

Definition at line 785 of file symscope.h.

References m_rep, and name().

◆ mark_global()

void octave::symbol_scope::mark_global ( const std::string name)
inline

Definition at line 801 of file symscope.h.

References m_rep, and name().

◆ mark_hidden()

void octave::symbol_scope::mark_hidden ( const std::string name)
inline

Definition at line 791 of file symscope.h.

References m_rep, and name().

◆ mark_nested()

void octave::symbol_scope::mark_nested ( void  )
inline

Definition at line 636 of file symscope.h.

References m_rep.

◆ mark_static()

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

Definition at line 647 of file symscope.h.

References m_rep.

◆ 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 892 of file symscope.h.

References m_rep.

Referenced by octave_user_function::mark_as_private_function().

◆ name()

◆ operator bool()

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

Definition at line 623 of file symscope.h.

References m_rep.

◆ operator=()

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

◆ parent_scope()

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

Definition at line 653 of file symscope.h.

References m_rep.

Referenced by octave_user_function::parent_fcn_scope(), and octave::fcn_info::fcn_info_rep::xfind().

◆ pop_context()

void octave::symbol_scope::pop_context ( void  )
inline

Definition at line 743 of file symscope.h.

References m_rep.

Referenced by octave_user_function::call().

◆ push_context()

void octave::symbol_scope::push_context ( void  )
inline

Definition at line 737 of file symscope.h.

References m_rep.

Referenced by octave_user_function::call().

◆ refresh()

void octave::symbol_scope::refresh ( void  )
inline

Definition at line 749 of file symscope.h.

References m_rep.

Referenced by octave_user_function::call().

◆ regexp()

std::list<symbol_record> octave::symbol_scope::regexp ( const std::string pattern,
bool  vars_only = false 
) const
inline

Definition at line 825 of file symscope.h.

References m_rep, and pattern().

◆ rename()

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

Definition at line 701 of file symscope.h.

References m_rep.

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

◆ set_context()

void octave::symbol_scope::set_context ( symbol_record::context_id  context)
inline

Definition at line 663 of file symscope.h.

References octave::context, and m_rep.

Referenced by octave::symbol_table::set_scope_and_context().

◆ set_function()

void octave::symbol_scope::set_function ( octave_user_function fcn)
inline

Definition at line 935 of file symscope.h.

References fcn, and m_rep.

◆ set_parent()

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

◆ stash_subfunction_names()

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

Definition at line 903 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 909 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 879 of file symscope.h.

References m_rep.

Referenced by octave_user_function::subfunctions().

◆ unbind_script_symbols()

void octave::symbol_scope::unbind_script_symbols ( void  )
inline

Definition at line 964 of file symscope.h.

References m_rep.

Referenced by octave_user_script::call().

◆ unlock_subfunctions()

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

Definition at line 873 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 947 of file symscope.h.

References m_rep.

◆ variable_names()

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

Definition at line 832 of file symscope.h.

References m_rep.

◆ varval()

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 980 of file symscope.h.

◆ operator==

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

Definition at line 975 of file symscope.h.

Member Data Documentation

◆ m_rep


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