26#if defined (HAVE_CONFIG_H)
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
149 std::map<std::string, octave_value> info_map;
153 std::string nm = nm_sr.first;
155 info_map[nm] = sr.
dump ();
163 std::list<symbol_record> retval;
166 retval.push_back (nm_sr.second);
182 return t_parent->find_subfunction (
name);
199 std::list<std::string>
202 std::list<std::string> retval;
208 retval.push_back (pscope->fcn_name ());
210 pscope = pscope->parent_scope_rep ();
219 m_parent = std::weak_ptr<symbol_scope_rep> (parent);
249 if (t_parent == scope)
255 if (t_primary_parent)
259 if (t_primary_parent == scope)
264 auto scope_primary_parent = scope->primary_parent_scope_rep ();
265 if (t_primary_parent == scope_primary_parent)
278 p->second.mark_as_variable ();
283 for (
const auto& nm : lst)
293 if (p !=
m_symbols.end () && p->second.is_variable ())
300 return t_parent ? t_parent->is_variable (nm) :
false;
317 std::size_t offset = 0;
320 t_parent->look_nonlocal (nm_sr.first, offset, ours);
334 scope_obj.update_nest ();
349 return t_parent->look_nonlocal (
name, offset, result);
359 std::size_t t_frame_offset = offset + p->second.frame_offset ();
360 std::size_t t_data_offset = p->second.data_offset ();
374 return std::list<octave_value> ();
377 return m_rep->localfunctions ();
379 std::shared_ptr<symbol_scope_rep> ppsr
380 =
m_rep->primary_parent_scope_rep ();
383 return std::list<octave_value> ();
385 return ppsr->localfunctions ();
void set_data_offset(std::size_t offset)
void mark_added_static(void)
bool is_formal(void) const
octave_value dump(void) const
void set_frame_offset(std::size_t offset)
std::string name(void) const
std::weak_ptr< symbol_scope_rep > m_primary_parent
Primary (top) parent of nested function (may be null).
std::string m_name
Name for this scope (usually the corresponding filename of the function corresponding to the scope).
std::vector< symbol_scope > m_children
Child nested functions.
std::map< std::string, octave_value >::const_iterator subfunctions_const_iterator
std::string name(void) const
std::string m_dir_name
The directory associated with m_code.
std::map< std::string, octave_value > m_subfunctions
Map from symbol names to subfunctions.
bool is_relative(const std::shared_ptr< symbol_scope_rep > &scope) const
octave_value dump(void) const
void set_parent(const std::shared_ptr< symbol_scope_rep > &parent)
std::map< std::string, symbol_record > m_symbols
Map from symbol names to symbol info.
bool is_variable(const std::string &nm) const
symbol_record insert_local(const std::string &name)
void mark_subfunctions_in_scope_as_private(const std::string &class_name)
void mark_as_variable(const std::string &nm)
octave_value dump_symbols_map(void) const
std::list< std::string > m_subfunction_names
The list of subfunctions (if any) in the order they appear in the function file.
symbol_record insert(const std::string &name)
octave_value find_subfunction(const std::string &name) const
std::list< octave_value > localfunctions(void) const
std::map< std::string, symbol_record >::const_iterator table_const_iterator
bool m_is_static
If true then no variables can be added.
std::size_t num_symbols(void) const
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)
bool is_nested(void) 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.
void set_primary_parent(const std::shared_ptr< symbol_scope_rep > &parent)
std::map< std::string, symbol_record >::iterator table_iterator
void insert_symbol_record(symbol_record &sr)
void mark_as_variables(const std::list< std::string > &lst)
std::shared_ptr< symbol_scope_rep > parent_scope_rep(void) const
void cache_dir_name(const std::string &name)
std::list< symbol_record > symbol_list(void) const
std::shared_ptr< symbol_scope_rep > m_rep
std::list< std::string > parent_fcn_names(void) const
bool is_primary_fcn_scope(void) const
std::list< octave_value > localfunctions(void) const
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
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()) ? '\'' :'"'))