24 #if defined (HAVE_CONFIG_H) 45 bool skip_variables,
bool local_funcs)
66 if (
val.is_defined ())
115 std::map<std::string, octave_value> m
126 std::map<std::string, octave_value> info_map;
149 return t_parent->find_subfunction (
name);
169 m_parent = std::weak_ptr<symbol_scope_rep> (parent);
185 &&
m_is_nested && t_parent->look_nonlocal (nm_sr.first, ours))
188 error (
"global and persistent may only be used in the topmost level in which a nested variable is used");
203 scope_obj.update_nest ();
216 return t_parent->look_nonlocal (
name,
result);
218 else if (!
p->second.is_automatic ())
220 result.bind_fwd_rep (shared_from_this (),
p->second);
229 (
const std::shared_ptr<symbol_scope_rep>& curr_scope)
231 for (
auto& nm_sr : m_symbols)
232 nm_sr.second.bind_fwd_rep (curr_scope,
233 curr_scope->find_symbol (nm_sr.first));
240 nm_sr.second.unbind_fwd_rep ();
void set_parent(const std::shared_ptr< symbol_scope_rep > &parent)
octave_value dump(context_id context) const
octave_value dump_function_map(const std::map< std::string, octave_value > &fcn_map)
void bind_script_symbols(const std::shared_ptr< symbol_scope_rep > &curr_scope)
octave_value dump(void) const
bool is_global(void) const
void unbind_script_symbols(void)
symbol_record::context_id m_context
octave_value find(const std::string &name, const octave_value_list &args, bool skip_variables, bool local_funcs)
octave_value fcn_table_find(const std::string &name, const octave_value_list &args=octave_value_list(), bool local_funcs=true)
identity matrix If supplied two scalar respectively For allows like xample val
void error(const char *fmt,...)
std::vector< symbol_scope > m_children
Child nested functions.
std::map< std::string, octave_value > m_subfunctions
Map from symbol names to subfunctions.
std::map< std::string, symbol_record > m_symbols
Map from symbol names to symbol info.
bool is_defined(void) const
bool is_persistent(void) const
bool m_is_nested
If true, then this scope belongs to a nested function.
std::string name(void) const
bool m_is_static
If true then no variables can be added.
symbol_table & __get_symbol_table__(const std::string &who)
nd deftypefn *std::string name
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
virtual void mark_as_private_function(const std::string &cname="")
bool is_formal(void) const
With real return the complex result
std::string m_name
Name for this scope (usually the corresponding filename of the function corresponding to the scope)...
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
symbol_record & insert(const std::string &name, bool force_add=false)
octave_value global_varval(const std::string &name) const
std::weak_ptr< symbol_scope_rep > m_parent
Parent of nested function (may be null).
std::map< std::string, octave_value >::const_iterator subfunctions_const_iterator
std::map< std::string, symbol_record >::iterator table_iterator
virtual octave_function * function_value(bool silent=false)
octave_value varval(context_id context) const
octave_value find_subfunction(const std::string &name) const
void mark_subfunctions_in_scope_as_private(const std::string &class_name)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
void mark_added_static(void)
octave_value dump_symbols_map(void) const
bool look_nonlocal(const std::string &name, symbol_record &result)