26 #if defined (HAVE_CONFIG_H)
49 insert_symbol_record (sym);
78 std::size_t offset = 0;
81 && t_parent->look_nonlocal (
name, offset, ret))
97 std::list<octave_value> retval;
135 std::map<std::string, octave_value>
m
150 std::map<std::string, octave_value> info_map;
154 std::string nm = nm_sr.first;
156 info_map[nm] = sr.
dump ();
164 std::list<symbol_record> retval;
167 retval.push_back (nm_sr.second);
183 return t_parent->find_subfunction (
name);
200 std::list<std::string>
203 std::list<std::string> retval;
209 retval.push_back (pscope->fcn_name ());
211 pscope = pscope->parent_scope_rep ();
220 m_parent = std::weak_ptr<symbol_scope_rep> (parent);
250 if (t_parent == scope)
256 if (t_primary_parent)
260 if (t_primary_parent == scope)
265 auto scope_primary_parent = scope->primary_parent_scope_rep ();
266 if (t_primary_parent == scope_primary_parent)
279 p->second.mark_as_variable ();
284 for (
const auto& nm : lst)
294 if (p !=
m_symbols.end () && p->second.is_variable ())
301 return t_parent ? t_parent->is_variable (nm) :
false;
318 std::size_t offset = 0;
321 t_parent->look_nonlocal (nm_sr.first, offset, ours);
335 scope_obj.update_nest ();
351 return t_parent->look_nonlocal (
name, offset, result);
361 std::size_t t_frame_offset = offset + p->second.frame_offset ();
362 std::size_t t_data_offset = p->second.data_offset ();
376 return std::list<octave_value> ();
379 return m_rep->localfunctions ();
381 std::shared_ptr<symbol_scope_rep> ppsr
382 =
m_rep->primary_parent_scope_rep ();
385 return std::list<octave_value> ();
387 return ppsr->localfunctions ();
virtual octave_function * function_value(bool silent=false)
virtual void mark_as_private_function(const std::string &cname="")
octave::symbol_scope scope(void)
OCTINTERP_API octave_user_code * user_code_value(bool silent=false) const
void set_data_offset(std::size_t offset)
std::string name(void) const
void set_frame_offset(std::size_t offset)
octave_value dump(void) const
bool is_formal(void) const
void mark_added_static(void)
std::string m_name
Name for this scope (usually the corresponding filename of the function corresponding to the scope).
std::map< std::string, symbol_record > m_symbols
Map from symbol names to symbol info.
std::list< octave_value > localfunctions(void) const
void mark_subfunctions_in_scope_as_private(const std::string &class_name)
std::list< std::string > m_subfunction_names
The list of subfunctions (if any) in the order they appear in the function file.
std::map< std::string, octave_value > m_subfunctions
Map from symbol names to subfunctions.
octave_value dump(void) const
void cache_dir_name(const std::string &name)
bool m_is_static
If true then no variables can be added.
bool is_relative(const std::shared_ptr< symbol_scope_rep > &scope) const
std::shared_ptr< symbol_scope_rep > parent_scope_rep(void) const
std::list< symbol_record > symbol_list(void) const
std::string name(void) const
std::weak_ptr< symbol_scope_rep > m_primary_parent
Primary (top) parent of nested function (may be null).
void set_primary_parent(const std::shared_ptr< symbol_scope_rep > &parent)
std::map< std::string, symbol_record >::iterator table_iterator
void mark_as_variables(const std::list< std::string > &lst)
bool is_variable(const std::string &nm) const
std::map< std::string, octave_value >::const_iterator subfunctions_const_iterator
symbol_record insert(const std::string &name)
octave_value find_subfunction(const std::string &name) const
std::list< std::string > parent_fcn_names(void) const
std::size_t m_nesting_depth
If true, then this scope belongs to a nested function.
std::string m_dir_name
The directory associated with m_code.
void set_parent(const std::shared_ptr< symbol_scope_rep > &parent)
std::vector< symbol_scope > m_children
Child nested functions.
octave_value dump_symbols_map(void) const
bool is_nested(void) const
void mark_as_variable(const std::string &nm)
std::size_t num_symbols(void) const
std::map< std::string, symbol_record >::const_iterator table_const_iterator
void insert_symbol_record(symbol_record &sr)
std::weak_ptr< symbol_scope_rep > m_parent
Parent of nested function (may be null).
bool look_nonlocal(const std::string &name, std::size_t offset, symbol_record &result)
std::list< std::string > parent_fcn_names(void) const
std::shared_ptr< symbol_scope_rep > m_rep
std::list< octave_value > localfunctions(void) const
bool is_primary_fcn_scope(void) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
octave_value dump_function_map(const std::map< std::string, octave_value > &fcn_map)
std::string canonicalize_file_name(const std::string &name)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))