26 #if defined (HAVE_CONFIG_H)
49 insert_symbol_record (sym);
70 if (p == m_symbols.end ())
78 auto t_parent = m_parent.lock ();
80 std::size_t offset = 0;
83 && t_parent->look_nonlocal (
name, offset, ret))
84 return m_symbols[
name] = ret;
90 return m_symbols[
name] = ret;
97 std::list<octave_value>
100 std::list<octave_value> retval;
110 for (
const auto& nm : m_subfunction_names)
112 auto nm_fcn_iter = m_subfunctions.find (nm);
114 if (nm_fcn_iter != m_subfunctions.end ())
138 std::map<std::string, octave_value>
m
139 = {{
"name", m_name },
140 {
"nesting_depth", m_nesting_depth },
141 {
"is_static", m_is_static },
143 {
"subfunction_names",
string_vector (m_subfunction_names) },
153 std::map<std::string, octave_value> info_map;
155 for (
const auto& nm_sr : m_symbols)
157 std::string nm = nm_sr.first;
159 info_map[nm] = sr.
dump ();
165 std::list<symbol_record>
168 std::list<symbol_record> retval;
170 for (
const auto& nm_sr : m_symbols)
171 retval.push_back (nm_sr.second);
181 if (p != m_subfunctions.end ())
184 auto t_parent = m_parent.lock ();
187 return t_parent->find_subfunction (
name);
195 for (
auto& nm_sf : m_subfunctions)
204 std::list<std::string>
207 std::list<std::string> retval;
213 retval.push_back (pscope->fcn_name ());
215 pscope = pscope->parent_scope_rep ();
224 m_parent = std::weak_ptr<symbol_scope_rep> (parent);
230 m_primary_parent = std::weak_ptr<symbol_scope_rep> (parent);
247 auto t_parent = m_parent.lock ();
254 if (t_parent == scope)
258 auto t_primary_parent = m_primary_parent.lock ();
260 if (t_primary_parent)
264 if (t_primary_parent == scope)
269 auto scope_primary_parent = scope->primary_parent_scope_rep ();
270 if (t_primary_parent == scope_primary_parent)
283 if (p != m_symbols.end ())
284 p->second.mark_as_variable ();
290 for (
const auto& nm : lst)
301 if (p != m_symbols.end () && p->second.is_variable ())
306 auto t_parent = m_parent.lock ();
308 return t_parent ? t_parent->is_variable (nm) :
false;
317 auto t_parent = m_parent.lock ();
322 for (
auto& nm_sr : m_symbols)
326 std::size_t offset = 0;
329 t_parent->look_nonlocal (nm_sr.first, offset, ours);
336 else if (m_children.size ())
342 for (
auto& scope_obj : m_children)
343 scope_obj.update_nest ();
355 if (p == m_symbols.end ())
357 auto t_parent = m_parent.lock ();
360 return t_parent->look_nonlocal (
name, offset, result);
370 std::size_t t_frame_offset = offset + p->second.frame_offset ();
371 std::size_t t_data_offset = p->second.data_offset ();
382 std::list<octave_value>
386 return std::list<octave_value> ();
389 return m_rep->localfunctions ();
391 std::shared_ptr<symbol_scope_rep> ppsr
392 = m_rep->primary_parent_scope_rep ();
395 return std::list<octave_value> ();
397 return ppsr->localfunctions ();
400 OCTAVE_END_NAMESPACE(
octave)
virtual octave_function * function_value(bool silent=false)
virtual void mark_as_private_function(const std::string &cname="")
octave::symbol_scope scope()
octave_user_code * user_code_value(bool silent=false) const
void set_data_offset(std::size_t offset)
void set_frame_offset(std::size_t offset)
octave_value dump() const
void mark_subfunctions_in_scope_as_private(const std::string &class_name)
std::shared_ptr< symbol_scope_rep > parent_scope_rep() const
octave_value dump_symbols_map() const
void cache_dir_name(const std::string &name)
bool is_relative(const std::shared_ptr< symbol_scope_rep > &scope) const
void set_primary_parent(const std::shared_ptr< symbol_scope_rep > &parent)
std::map< std::string, symbol_record >::iterator table_iterator
std::list< std::string > parent_fcn_names() const
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
std::size_t num_symbols() const
symbol_record insert(const std::string &name)
octave_value find_subfunction(const std::string &name) const
octave_value dump() const
void set_parent(const std::shared_ptr< symbol_scope_rep > &parent)
void mark_as_variable(const std::string &nm)
std::list< symbol_record > symbol_list() const
std::map< std::string, symbol_record >::const_iterator table_const_iterator
void insert_symbol_record(symbol_record &sr)
std::list< octave_value > localfunctions() const
bool look_nonlocal(const std::string &name, std::size_t offset, symbol_record &result)
bool is_primary_fcn_scope() const
std::list< octave_value > localfunctions() const
std::list< std::string > parent_fcn_names() 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()) ? '\'' :'"'))