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

#include "symscope.h"

Public Member Functions

 symbol_scope ()=delete
 
 symbol_scope (const std::shared_ptr< symbol_scope_rep > new_rep)
 
 symbol_scope (const std::string &name)
 
 symbol_scope (const symbol_scope &)=default
 
 ~symbol_scope ()=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 () const
 
octave_value dump () const
 
symbol_scope dup () const
 
void erase_subfunctions ()
 
std::string fcn_file_name () const
 
std::string fcn_name () 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 () const
 
bool has_subfunctions () 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 () const
 
bool is_parent () const
 
bool is_primary_fcn_scope () const
 
bool is_relative (const symbol_scope &scope) const
 
bool is_static () const
 
bool is_valid () const
 
bool is_variable (const std::string &nm) const
 
std::list< octave_valuelocalfunctions () const
 
void lock_subfunctions ()
 
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 mark_static ()
 
void mark_subfunctions_in_scope_as_private (const std::string &class_name)
 
std::string name () const
 
std::size_t nesting_depth () const
 
std::size_t num_symbols () const
 
 operator bool () const
 
symbol_scopeoperator= (const symbol_scope &)=default
 
std::list< std::string > parent_fcn_names () const
 
std::shared_ptr< symbol_scope_repparent_scope () 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 () 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 () const
 
std::map< std::string, octave_valuesubfunctions () const
 
std::list< symbol_recordsymbol_list () const
 
std::map< std::string, symbol_record > & symbols ()
 
const std::map< std::string, symbol_record > & symbols () const
 
void unlock_subfunctions ()
 
void update_nest ()
 
octave_user_codeuser_code () const
 

Static Public Member Functions

static symbol_scope anonymous ()
 
static symbol_scope invalid ()
 

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

Constructor & Destructor Documentation

◆ symbol_scope() [1/4]

symbol_scope::symbol_scope ( )
delete

Referenced by anonymous(), dup(), and invalid().

◆ symbol_scope() [2/4]

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

Definition at line 379 of file symscope.h.

◆ symbol_scope() [3/4]

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

Definition at line 390 of file symscope.h.

◆ symbol_scope() [4/4]

symbol_scope::symbol_scope ( const symbol_scope )
default

◆ ~symbol_scope()

symbol_scope::~symbol_scope ( )
default

Member Function Documentation

◆ anonymous()

static symbol_scope symbol_scope::anonymous ( )
inlinestatic

Definition at line 405 of file symscope.h.

References symbol_scope().

Referenced by base_parser::start_classdef_external_method().

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

References 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 ( ) const
inline

Definition at line 653 of file symscope.h.

◆ dump()

octave_value symbol_scope::dump ( ) const
inline

Definition at line 581 of file symscope.h.

References octave_value().

◆ dup()

symbol_scope symbol_scope::dup ( void  ) const
inline

Definition at line 472 of file symscope.h.

References symbol_scope().

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

◆ erase_subfunctions()

void symbol_scope::erase_subfunctions ( )
inline

Definition at line 550 of file symscope.h.

◆ fcn_file_name()

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

Definition at line 648 of file symscope.h.

◆ fcn_name()

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

Definition at line 597 of file symscope.h.

◆ find_subfunction()

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

Definition at line 526 of file symscope.h.

References name(), and octave_value().

Referenced by stack_frame::find_subfunction().

◆ find_symbol()

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

Definition at line 489 of file symscope.h.

References name().

Referenced by tree_identifier::dup().

◆ get_rep()

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

Definition at line 703 of file symscope.h.

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

◆ has_subfunctions()

bool symbol_scope::has_subfunctions ( ) const
inline

Definition at line 562 of file symscope.h.

◆ insert()

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

Definition at line 500 of file symscope.h.

References name().

Referenced by base_parser::make_identifier().

◆ insert_local()

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

Definition at line 419 of file symscope.h.

References name().

◆ insert_symbol_record()

void symbol_scope::insert_symbol_record ( symbol_record sr)
inline

Definition at line 424 of file symscope.h.

◆ install_nestfunction()

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

Definition at line 518 of file symscope.h.

References 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 511 of file symscope.h.

References name().

Referenced by base_parser::finish_function().

◆ invalid()

◆ is_nested()

bool symbol_scope::is_nested ( ) const
inline

Definition at line 430 of file symscope.h.

◆ is_parent()

bool symbol_scope::is_parent ( ) const
inline

Definition at line 435 of file symscope.h.

◆ is_primary_fcn_scope()

bool symbol_scope::is_primary_fcn_scope ( ) const
inline

Definition at line 664 of file symscope.h.

Referenced by localfunctions().

◆ is_relative()

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

Definition at line 669 of file symscope.h.

References get_rep().

◆ is_static()

bool symbol_scope::is_static ( ) const
inline

Definition at line 451 of file symscope.h.

◆ is_valid()

bool symbol_scope::is_valid ( ) const
inline

Definition at line 410 of file symscope.h.

Referenced by tree_anon_fcn_handle::has_parent_scope(), and operator bool().

◆ is_variable()

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

Definition at line 686 of file symscope.h.

◆ localfunctions()

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

Definition at line 383 of file symscope.cc.

References is_primary_fcn_scope().

◆ lock_subfunctions()

void symbol_scope::lock_subfunctions ( )
inline

Definition at line 531 of file symscope.h.

◆ look_nonlocal()

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

Definition at line 697 of file symscope.h.

References name().

◆ lookup_symbol()

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

Definition at line 495 of file symscope.h.

References name().

◆ mark_as_variable()

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

Definition at line 674 of file symscope.h.

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

Referenced by lexical_feedback::mark_as_variables().

◆ mark_primary_fcn_scope()

void symbol_scope::mark_primary_fcn_scope ( )
inline

Definition at line 658 of file symscope.h.

Referenced by base_parser::push_fcn_symtab().

◆ mark_static()

void symbol_scope::mark_static ( )
inline

Definition at line 456 of file symscope.h.

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

◆ name()

◆ nesting_depth()

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

Definition at line 446 of file symscope.h.

Referenced by tree_evaluator::evaluate_anon_fcn_handle().

◆ num_symbols()

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

Definition at line 414 of file symscope.h.

◆ operator bool()

symbol_scope::operator bool ( ) const
inlineexplicit

Definition at line 412 of file symscope.h.

References is_valid().

◆ operator=()

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

◆ parent_fcn_names()

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

Definition at line 608 of file symscope.h.

Referenced by symbol_scope_rep::localfunctions().

◆ parent_scope()

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

Definition at line 462 of file symscope.h.

◆ persistent_varref()

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

Definition at line 477 of file symscope.h.

◆ persistent_varval()

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

Definition at line 484 of file symscope.h.

References octave_value().

◆ primary_parent_scope()

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

Definition at line 467 of file symscope.h.

◆ rename()

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

Definition at line 505 of file symscope.h.

◆ set_nesting_depth()

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

◆ set_parent()

void symbol_scope::set_parent ( const symbol_scope p)
inline

Definition at line 624 of file symscope.h.

References get_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 630 of file symscope.h.

References get_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 618 of file symscope.h.

◆ stash_subfunction_names()

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

Definition at line 567 of file symscope.h.

◆ subfunction_names()

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

Definition at line 573 of file symscope.h.

◆ subfunctions()

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

Definition at line 543 of file symscope.h.

◆ symbol_list()

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

Definition at line 732 of file symscope.h.

◆ symbols() [1/2]

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

Definition at line 725 of file symscope.h.

◆ symbols() [2/2]

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

Definition at line 718 of file symscope.h.

Referenced by stack_frame::variable_names().

◆ unlock_subfunctions()

void symbol_scope::unlock_subfunctions ( )
inline

Definition at line 537 of file symscope.h.

◆ update_nest()

void symbol_scope::update_nest ( )
inline

Definition at line 691 of file symscope.h.

Referenced by base_parser::finish_function().

◆ user_code()

octave_user_code* symbol_scope::user_code ( ) const
inline

Definition at line 613 of file symscope.h.

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 713 of file symscope.h.

◆ operator==

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

Definition at line 708 of file symscope.h.


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