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

#include "symtab.h"

Collaboration diagram for octave::symbol_table:

Public Types

typedef octave::fcn_info fcn_info
 
typedef octave::symbol_scope scope
 
typedef octave::symbol_record symbol_record
 

Public Member Functions

 symbol_table (void)
 
 symbol_table (const symbol_table &)=delete
 
 ~symbol_table (void)=default
 
void add_to_parent_map (const std::string &classname, const std::list< std::string > &parent_list)
 
void alias_built_in_function (const std::string &alias, const std::string &name)
 
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())
 
bool at_top_level (void)
 
std::list< std::stringbuilt_in_function_names (void)
 
octave_value builtin_find (const std::string &name)
 
void cleanup (void)
 
void clear_all (bool force=false)
 
void clear_dld_function (const std::string &name)
 
void clear_function (const std::string &name)
 
void clear_function_pattern (const std::string &pat)
 
void clear_functions (bool force=false)
 
void clear_global (const std::string &name)
 
void clear_global_pattern (const std::string &pattern)
 
void clear_mex_functions (void)
 
void clear_symbol (const std::string &name)
 
void clear_symbol_pattern (const std::string &pat)
 
void clear_user_function (const std::string &name)
 
std::list< std::stringcmdline_function_names (void)
 
symbol_record::context_id current_context (void) const
 
symbol_scope current_scope (void)
 
octave_value dump (void) const
 
octave_value fcn_table_find (const std::string &name, const octave_value_list &args=octave_value_list(), bool local_funcs=true)
 
octave_value find (const std::string &name, const octave_value_list &args=octave_value_list(), bool skip_variables=false, bool local_funcs=true)
 
octave_value find_autoload (const std::string &name)
 
octave_value find_built_in_function (const std::string &name)
 
octave_value find_cmdline_function (const std::string &name)
 
octave_value find_function (const std::string &name, const octave_value_list &args=octave_value_list(), bool local_funcs=true)
 
symbol_record find_global_symbol (const std::string &name)
 
octave_value find_method (const std::string &name, const std::string &dispatch_type)
 
octave_value find_submethod (const std::string &name, const std::string &dispatch_type)
 
symbol_record find_symbol (const std::string &name, symbol_scope &sid)
 
symbol_record find_symbol (const std::string &name)
 
octave_value find_user_function (const std::string &name)
 
octave_user_functionget_curr_fcn (void)
 
fcn_infoget_fcn_info (const std::string &name)
 
std::list< symbol_recordglob (const std::string &pattern)
 
std::list< symbol_recordglob_global_variables (const std::string &pattern)
 
std::list< symbol_recordglob_variables (const string_vector &patterns)
 
void global_assign (const std::string &name, const octave_value &value=octave_value())
 
symbol_scope global_scope (void)
 
std::list< std::stringglobal_variable_names (void)
 
octave_value global_varval (const std::string &name) const
 
void inherit (symbol_scope &recipient_scope, const symbol_scope &donor_scope)
 
void inherit (symbol_scope &recipient_scope)
 
void install_built_in_dispatch (const std::string &name, const std::string &klass)
 
void install_built_in_function (const std::string &name, const octave_value &fcn)
 
void install_cmdline_function (const std::string &name, const octave_value &fcn)
 
void install_local_function (const std::string &name, const octave_value &fcn, const std::string &file_name)
 
void install_user_function (const std::string &name, const octave_value &fcn)
 
bool is_built_in_function_name (const std::string &name)
 
bool is_superiorto (const std::string &a, const std::string &b)
 
symbol_tableoperator= (const symbol_table &)=delete
 
std::list< std::stringparent_classes (const std::string &dispatch_type)
 
std::list< symbol_recordregexp_global_variables (const std::string &pattern)
 
std::list< symbol_recordregexp_variables (const string_vector &patterns)
 
symbol_scope require_current_scope (const std::string &who)
 
bool set_class_relationship (const std::string &sup_class, const std::string &inf_class)
 
void set_scope (const symbol_scope &sid)
 
void set_scope_and_context (const symbol_scope &sid, symbol_record::context_id context)
 
void top_level_assign (const std::string &name, const octave_value &value=octave_value())
 
std::list< std::stringtop_level_variable_names (void)
 
octave_value top_level_varval (const std::string &name) const
 
symbol_scope top_scope (void)
 
std::list< std::stringuser_function_names (void)
 
std::list< std::stringvariable_names (void)
 
octave_value varval (const std::string &name) const
 

Private Types

typedef std::map< std::string, std::set< std::string > >::const_iterator class_precedence_table_const_iterator
 
typedef std::map< std::string, std::set< std::string > >::iterator class_precedence_table_iterator
 
typedef std::map< std::string, std::list< std::string > >::const_iterator const_parent_map_iterator
 
typedef std::map< std::string, fcn_info >::const_iterator fcn_table_const_iterator
 
typedef std::map< std::string, fcn_info >::iterator fcn_table_iterator
 
typedef std::map< std::string, octave_value >::const_iterator global_symbols_const_iterator
 
typedef std::map< std::string, octave_value >::iterator global_symbols_iterator
 
typedef std::map< std::string, std::list< std::string > >::iterator parent_map_iterator
 

Private Member Functions

octave_value dump_fcn_table_map (void) const
 
void install_builtins (void)
 

Private Attributes

std::map< std::string, std::set< std::string > > m_class_precedence_table
 
symbol_scope m_current_scope
 
std::map< std::string, fcn_infom_fcn_table
 
symbol_scope m_global_scope
 
std::map< std::string, std::list< std::string > > m_parent_map
 
symbol_scope m_top_scope
 

Detailed Description

Definition at line 50 of file symtab.h.

Member Typedef Documentation

◆ class_precedence_table_const_iterator

Definition at line 699 of file symtab.h.

◆ class_precedence_table_iterator

◆ const_parent_map_iterator

Definition at line 707 of file symtab.h.

◆ fcn_info

Definition at line 56 of file symtab.h.

◆ fcn_table_const_iterator

Definition at line 684 of file symtab.h.

◆ fcn_table_iterator

Definition at line 686 of file symtab.h.

◆ global_symbols_const_iterator

Definition at line 679 of file symtab.h.

◆ global_symbols_iterator

Definition at line 681 of file symtab.h.

◆ parent_map_iterator

Definition at line 709 of file symtab.h.

◆ scope

Definition at line 55 of file symtab.h.

◆ symbol_record

Constructor & Destructor Documentation

◆ symbol_table() [1/2]

octave::symbol_table::symbol_table ( void  )
inline

Definition at line 58 of file symtab.h.

◆ symbol_table() [2/2]

octave::symbol_table::symbol_table ( const symbol_table )
delete

◆ ~symbol_table()

octave::symbol_table::~symbol_table ( void  )
default

Member Function Documentation

◆ add_to_parent_map()

void octave::symbol_table::add_to_parent_map ( const std::string classname,
const std::list< std::string > &  parent_list 
)
inline

Definition at line 632 of file symtab.h.

Referenced by octave_class::octave_class().

◆ alias_built_in_function()

void octave::symbol_table::alias_built_in_function ( const std::string alias,
const std::string name 
)
inline

◆ assign() [1/2]

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

Definition at line 149 of file symtab.h.

References name, and value.

◆ assign() [2/2]

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

Definition at line 155 of file symtab.h.

References name, and value.

◆ at_top_level()

bool octave::symbol_table::at_top_level ( void  )
inline

Definition at line 140 of file symtab.h.

Referenced by octave_link::set_workspace().

◆ built_in_function_names()

std::list<std::string> octave::symbol_table::built_in_function_names ( void  )
inline

Definition at line 594 of file symtab.h.

References fcn, octave_function::is_defined(), retval, and octave_value::sort().

◆ builtin_find()

octave_value octave::symbol_table::builtin_find ( const std::string name)

◆ cleanup()

void octave::symbol_table::cleanup ( void  )

Definition at line 534 of file symtab.cc.

References clear_all(), m_class_precedence_table, m_fcn_table, and m_parent_map.

◆ clear_all()

void octave::symbol_table::clear_all ( bool  force = false)
inline

Definition at line 368 of file symtab.h.

Referenced by cleanup().

◆ clear_dld_function()

void octave::symbol_table::clear_dld_function ( const std::string name)
inline

◆ clear_function()

void octave::symbol_table::clear_function ( const std::string name)
inline

Definition at line 392 of file symtab.h.

References name.

Referenced by Fdaspk(), Fdasrt(), Fdassl(), Flsode(), Fquad(), and G__eigs__().

◆ clear_function_pattern()

void octave::symbol_table::clear_function_pattern ( const std::string pat)
inline

Definition at line 407 of file symtab.h.

References p, and pattern().

◆ clear_functions()

void octave::symbol_table::clear_functions ( bool  force = false)
inline

Definition at line 384 of file symtab.h.

References p.

◆ clear_global()

void octave::symbol_table::clear_global ( const std::string name)

Definition at line 301 of file symtab.cc.

References octave::symbol_scope::clear_variable(), m_global_scope, and name.

◆ clear_global_pattern()

void octave::symbol_table::clear_global_pattern ( const std::string pattern)

◆ clear_mex_functions()

void octave::symbol_table::clear_mex_functions ( void  )
inline

Definition at line 461 of file symtab.h.

References p.

◆ clear_symbol()

void octave::symbol_table::clear_symbol ( const std::string name)
inline

Definition at line 397 of file symtab.h.

References clear_function(), and name.

◆ clear_symbol_pattern()

void octave::symbol_table::clear_symbol_pattern ( const std::string pat)
inline

Definition at line 422 of file symtab.h.

◆ clear_user_function()

void octave::symbol_table::clear_user_function ( const std::string name)
inline

Definition at line 432 of file symtab.h.

References octave::fcn_info::clear_user_function(), name, and p.

Referenced by octave::file_editor_tab::exit_debug_and_clear().

◆ cmdline_function_names()

std::list<std::string> octave::symbol_table::cmdline_function_names ( void  )
inline

Definition at line 612 of file symtab.h.

References fcn, octave_function::is_defined(), retval, and octave_value::sort().

◆ current_context()

symbol_record::context_id octave::symbol_table::current_context ( void  ) const
inline

◆ current_scope()

◆ dump()

octave_value octave::symbol_table::dump ( void  ) const

◆ dump_fcn_table_map()

octave_value octave::symbol_table::dump_fcn_table_map ( void  ) const
private

Definition at line 544 of file symtab.cc.

References octave::fcn_info::dump(), m_fcn_table, nm, octave_value(), and string.

Referenced by dump().

◆ fcn_table_find()

octave_value octave::symbol_table::fcn_table_find ( const std::string name,
const octave_value_list args = octave_value_list (),
bool  local_funcs = true 
)

◆ find()

octave_value octave::symbol_table::find ( const std::string name,
const octave_value_list args = octave_value_list (),
bool  skip_variables = false,
bool  local_funcs = true 
)

◆ find_autoload()

octave_value octave::symbol_table::find_autoload ( const std::string name)
inline

Definition at line 242 of file symtab.h.

References name, octave_value(), and p.

◆ find_built_in_function()

octave_value octave::symbol_table::find_built_in_function ( const std::string name)
inline

Definition at line 233 of file symtab.h.

References name, octave_value(), and p.

◆ find_cmdline_function()

octave_value octave::symbol_table::find_cmdline_function ( const std::string name)
inline

Definition at line 270 of file symtab.h.

References name, octave_value(), and p.

◆ find_function()

◆ find_global_symbol()

symbol_record octave::symbol_table::find_global_symbol ( const std::string name)
inline

Definition at line 119 of file symtab.h.

References octave::symbol_record::mark_global(), and name.

◆ find_method()

◆ find_submethod()

octave_value octave::symbol_table::find_submethod ( const std::string name,
const std::string dispatch_type 
)

◆ find_symbol() [1/2]

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

Definition at line 109 of file symtab.h.

References octave::symbol_scope::find_symbol(), and name.

Referenced by do_who(), and octave::jit_convert::get_variable().

◆ find_symbol() [2/2]

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

Definition at line 114 of file symtab.h.

References name.

◆ find_user_function()

octave_value octave::symbol_table::find_user_function ( const std::string name)
inline

Definition at line 262 of file symtab.h.

References name, octave_value(), and p.

◆ get_curr_fcn()

octave_user_function* octave::symbol_table::get_curr_fcn ( void  )
inline

Definition at line 663 of file symtab.h.

◆ get_fcn_info()

fcn_info* octave::symbol_table::get_fcn_info ( const std::string name)
inline

Definition at line 670 of file symtab.h.

References name, and p.

◆ glob()

std::list<symbol_record> octave::symbol_table::glob ( const std::string pattern)
inline

Definition at line 506 of file symtab.h.

References pattern().

◆ glob_global_variables()

std::list<symbol_record> octave::symbol_table::glob_global_variables ( const std::string pattern)
inline

Definition at line 512 of file symtab.h.

References pattern().

Referenced by do_who().

◆ glob_variables()

std::list<symbol_record> octave::symbol_table::glob_variables ( const string_vector patterns)
inline

Definition at line 523 of file symtab.h.

References i, Array< T >::numel(), retval, and tmp.

Referenced by do_who().

◆ global_assign()

void octave::symbol_table::global_assign ( const std::string name,
const octave_value value = octave_value () 
)
inline

Definition at line 168 of file symtab.h.

References name, and value.

Referenced by mexPutVariable().

◆ global_scope()

symbol_scope octave::symbol_table::global_scope ( void  )
inline

Definition at line 74 of file symtab.h.

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

◆ global_variable_names()

std::list<std::string> octave::symbol_table::global_variable_names ( void  )
inline

Definition at line 577 of file symtab.h.

◆ global_varval()

octave_value octave::symbol_table::global_varval ( const std::string name) const
inline

Definition at line 174 of file symtab.h.

References name.

Referenced by octave::symbol_scope_rep::find(), and mexGetVariable().

◆ inherit() [1/2]

void octave::symbol_table::inherit ( symbol_scope recipient_scope,
const symbol_scope donor_scope 
)
inline

Definition at line 129 of file symtab.h.

References octave::symbol_scope::inherit().

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

◆ inherit() [2/2]

void octave::symbol_table::inherit ( symbol_scope recipient_scope)
inline

Definition at line 135 of file symtab.h.

◆ install_built_in_dispatch()

void octave::symbol_table::install_built_in_dispatch ( const std::string name,
const std::string klass 
)
inline

Definition at line 491 of file symtab.h.

References error(), octave::fcn_info::install_built_in_dispatch(), name, and p.

Referenced by install_builtin_dispatch().

◆ install_built_in_function()

void octave::symbol_table::install_built_in_function ( const std::string name,
const octave_value fcn 
)
inline

◆ install_builtins()

void octave::symbol_table::install_builtins ( void  )
private

◆ install_cmdline_function()

void octave::symbol_table::install_cmdline_function ( const std::string name,
const octave_value fcn 
)
inline

◆ install_local_function()

void octave::symbol_table::install_local_function ( const std::string name,
const octave_value fcn,
const std::string file_name 
)
inline

Definition at line 302 of file symtab.h.

References fcn, octave::fcn_info::install_local_function(), name, and p.

◆ install_user_function()

void octave::symbol_table::install_user_function ( const std::string name,
const octave_value fcn 
)
inline

Definition at line 324 of file symtab.h.

References fcn, octave::fcn_info::install_user_function(), name, and p.

◆ is_built_in_function_name()

bool octave::symbol_table::is_built_in_function_name ( const std::string name)
inline

Definition at line 192 of file symtab.h.

References name, and val.

Referenced by octave::load_path::package_info::add_to_fcn_map().

◆ is_superiorto()

bool octave::symbol_table::is_superiorto ( const std::string a,
const std::string b 
)

Definition at line 345 of file symtab.cc.

References a, b, m_class_precedence_table, and p.

Referenced by octave::get_dispatch_type(), and set_class_relationship().

◆ operator=()

symbol_table& octave::symbol_table::operator= ( const symbol_table )
delete

◆ parent_classes()

std::list<std::string> octave::symbol_table::parent_classes ( const std::string dispatch_type)
inline

◆ regexp_global_variables()

std::list<symbol_record> octave::symbol_table::regexp_global_variables ( const std::string pattern)
inline

Definition at line 518 of file symtab.h.

References pattern().

Referenced by do_who().

◆ regexp_variables()

std::list<symbol_record> octave::symbol_table::regexp_variables ( const string_vector patterns)
inline

Definition at line 542 of file symtab.h.

References i, Array< T >::numel(), retval, and tmp.

Referenced by do_who().

◆ require_current_scope()

symbol_scope octave::symbol_table::require_current_scope ( const std::string who)
inline

Definition at line 79 of file symtab.h.

References error().

Referenced by install_loaded_variable().

◆ set_class_relationship()

bool octave::symbol_table::set_class_relationship ( const std::string sup_class,
const std::string inf_class 
)

Definition at line 317 of file symtab.cc.

References is_superiorto(), and m_class_precedence_table.

◆ set_scope()

void octave::symbol_table::set_scope ( const symbol_scope sid)
inline

◆ set_scope_and_context()

◆ top_level_assign()

void octave::symbol_table::top_level_assign ( const std::string name,
const octave_value value = octave_value () 
)
inline

Definition at line 180 of file symtab.h.

References name, and value.

◆ top_level_variable_names()

std::list<std::string> octave::symbol_table::top_level_variable_names ( void  )
inline

Definition at line 582 of file symtab.h.

◆ top_level_varval()

octave_value octave::symbol_table::top_level_varval ( const std::string name) const
inline

Definition at line 186 of file symtab.h.

References name.

◆ top_scope()

symbol_scope octave::symbol_table::top_scope ( void  )
inline

Definition at line 75 of file symtab.h.

Referenced by octave::call_stack::call_stack(), and dump_octave_core().

◆ user_function_names()

std::list<std::string> octave::symbol_table::user_function_names ( void  )
inline

Definition at line 561 of file symtab.h.

References retval, and octave_value::sort().

◆ variable_names()

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

Definition at line 588 of file symtab.h.

◆ varval()

octave_value octave::symbol_table::varval ( const std::string name) const
inline

Definition at line 162 of file symtab.h.

References name, and octave_value().

Member Data Documentation

◆ m_class_precedence_table

std::map<std::string, std::set<std::string> > octave::symbol_table::m_class_precedence_table
private

Definition at line 696 of file symtab.h.

Referenced by cleanup(), dump(), is_superiorto(), and set_class_relationship().

◆ m_current_scope

symbol_scope octave::symbol_table::m_current_scope
private

Definition at line 714 of file symtab.h.

Referenced by find(), find_function(), and find_submethod().

◆ m_fcn_table

std::map<std::string, fcn_info> octave::symbol_table::m_fcn_table
private

Definition at line 692 of file symtab.h.

Referenced by builtin_find(), cleanup(), dump_fcn_table_map(), and fcn_table_find().

◆ m_global_scope

symbol_scope octave::symbol_table::m_global_scope
private

Definition at line 711 of file symtab.h.

Referenced by clear_global(), and clear_global_pattern().

◆ m_parent_map

std::map<std::string, std::list<std::string> > octave::symbol_table::m_parent_map
private

Definition at line 704 of file symtab.h.

Referenced by cleanup(), and dump().

◆ m_top_scope

symbol_scope octave::symbol_table::m_top_scope
private

Definition at line 712 of file symtab.h.

Referenced by find_function(), and find_submethod().


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