26 #if defined (HAVE_CONFIG_H)
54 : m_interpreter (interp), m_fcn_table (), m_class_precedence_table (),
84 return p->second.find_scoped_function (search_scope);
100 const std::string&
name)
108 return p->second.find_private_function (dir_name);
126 const std::string& dispatch_type)
134 return p->second.find_method (dispatch_type);
153 return p->second.find_built_in_function ();
175 return p->second.find_autoload ();
202 return p->second.builtin_find (search_scope);
232 return p->second.find (search_scope, args);
257 size_t pos =
name.find_first_of (
'/');
259 if (pos == std::string::npos)
262 std::string method =
name.substr (pos+1);
263 std::string dispatch_type =
name.substr (1, pos-1);
296 return p->second.find_user_function ();
318 return p->second.find_cmdline_function ();
358 const std::string& file_name)
431 (p++)->second.clear (force);
447 if (pattern.
match (p->first))
448 (p++)->second.clear_user_function ();
463 (p++)->second.clear_user_function ();
503 (p++)->second.clear_mex_function ();
511 const std::string& inf_class)
544 const std::set<std::string>& inferior_classes = p->second;
545 std::set<std::string>::const_iterator q = inferior_classes.find (b);
546 return (q != inferior_classes.end ());
550 const std::string&
name)
563 panic (
"alias: '%s' is undefined",
name.c_str ());
567 const std::string& klass)
578 error (
"install_built_in_dispatch: '%s' is undefined",
name.c_str ());
583 std::list<std::string>
retval;
587 if (nm_finfo.second.is_user_function_defined ())
588 retval.push_back (nm_finfo.first);
599 std::list<std::string>
retval;
603 octave_value fcn = nm_finfo.second.find_built_in_function ();
606 retval.push_back (nm_finfo.first);
617 std::list<std::string>
retval;
621 octave_value fcn = nm_finfo.second.find_cmdline_function ();
624 retval.push_back (nm_finfo.first);
633 template <
template <
typename,
typename...>
class C,
typename V,
638 if (container_map.empty ())
641 std::map<std::string, octave_value> info_map;
643 for (
const auto& nm_container : container_map)
645 std::string nm = nm_container.first;
646 const C<
V,
A...>& container = nm_container.second;
647 info_map[nm] =
Cell (container);
655 std::map<std::string, octave_value>
m
664 const std::list<std::string>& parent_list)
671 std::list<std::string>
retval;
678 for (
const auto& nm :
retval)
686 if (! parents.empty ())
705 return p !=
m_fcn_table.end () ? &p->second :
nullptr;
713 std::map<std::string, octave_value> info_map;
717 std::string nm = nm_finfo.first;
718 const fcn_info& finfo = nm_finfo.second;
719 info_map[nm] = finfo.
dump ();
818 DEFMETHOD (__dump_symtab_info__, interp, args, ,
825 int nargin = args.length ();
833 return symtab.
dump ();
836 std::string fname = args(0).
xstring_value (
"__dump_symtab_info__: argument must be a function name");
841 return finfo->
dump ();
847 DEFMETHOD (__get_cmdline_fcn_txt__, interp, args, ,
853 if (args.length () != 1)
856 std::string
name = args(0).xstring_value (
"__get_cmdline_fcn_txt__: first argument must be function name");
868 std::ostringstream buf;
Array< T > & insert(const Array< T > &a, const Array< octave_idx_type > &idx)
Insert an array into another at a specified position.
Array< T > sort(int dim=0, sortmode mode=ASCENDING) const
Size of the specified dimension.
bool match(const std::string &str) const
void install_local_function(const octave_value &f, const std::string &file_name)
void clear_user_function(bool force=false)
octave_value dump(void) const
void clear_autoload_function(bool force=false)
octave_value find(const symbol_scope &search_scope, const octave_value_list &args=octave_value_list())
octave_value find_built_in_function(void) const
octave_value builtin_find(const symbol_scope &search_scope)
octave_value find_user_function(void)
void install_built_in_dispatch(const std::string &klass)
octave_value find_private_function(const std::string &dir_name) const
void install_user_function(const octave_value &f)
void install_built_in_function(const octave_value &f)
octave_value find_cmdline_function(void) const
octave_value find_autoload(void)
octave_value find_scoped_function(const symbol_scope &search_scope) const
octave_value find_method(const std::string &dispatch_type) const
void install_cmdline_function(const octave_value &f)
void clear_symbol(const std::string &name)
void assign(const std::string &name, const octave_value &val=octave_value())
void global_assign(const std::string &name, const octave_value &val=octave_value())
octave_value varval(const std::string &name) const
octave_value global_varval(const std::string &name) const
std::list< std::string > variable_names(void)
std::list< std::string > top_level_variable_names(void)
void top_level_assign(const std::string &name, const octave_value &val=octave_value())
void clear_global_variable(const std::string &name)
void clear_global_variable_pattern(const std::string &pattern)
octave_value top_level_varval(const std::string &name) const
bool at_top_level(void) const
void clear_all(bool force=false)
void clear_symbol_pattern(const std::string &pat)
std::list< std::string > global_variable_names(void)
tree_evaluator & get_evaluator(void)
bool is_match(const std::string &buffer)
octave_value find_user_function(const std::string &name)
std::map< std::string, std::list< std::string > >::const_iterator const_parent_map_iterator
octave_value varval(const std::string &name) const
octave_value find_cmdline_function(const std::string &name)
octave_value builtin_find(const std::string &name, const symbol_scope &search_scope=symbol_scope())
void clear_all(bool force=false)
std::map< std::string, fcn_info > m_fcn_table
octave_value top_level_varval(const std::string &name) const
octave_value dump_fcn_table_map(void) const
bool is_built_in_function_name(const std::string &name)
void clear_global_pattern(const std::string &pattern)
void install_built_in_function(const std::string &name, const octave_value &fcn)
fcn_info * get_fcn_info(const std::string &name)
symbol_table(interpreter &interp)
octave_value find_function(const std::string &name, const symbol_scope &search_scope=symbol_scope())
void install_user_function(const std::string &name, const octave_value &fcn)
bool set_class_relationship(const std::string &sup_class, const std::string &inf_class)
std::map< std::string, fcn_info >::const_iterator fcn_table_const_iterator
bool is_superiorto(const std::string &a, const std::string &b)
void clear_function(const std::string &name)
void install_local_function(const std::string &name, const octave_value &fcn, const std::string &file_name)
std::list< std::string > user_function_names(void)
std::list< std::string > parent_classes(const std::string &dispatch_type)
void install_cmdline_function(const std::string &name, const octave_value &fcn)
void add_to_parent_map(const std::string &classname, const std::list< std::string > &parent_list)
std::list< std::string > top_level_variable_names(void)
std::map< std::string, std::set< std::string > >::const_iterator class_precedence_table_const_iterator
octave_value fcn_table_find(const std::string &name, const octave_value_list &args=ovl(), const symbol_scope &search_scope=symbol_scope())
void clear_function_pattern(const std::string &pat)
void clear_dld_function(const std::string &name)
void clear_symbol_pattern(const std::string &pattern)
std::map< std::string, std::set< std::string > > m_class_precedence_table
void clear_functions(bool force=false)
void assign(const std::string &name, const octave_value &value=octave_value())
symbol_scope current_scope(void) const
void clear_symbol(const std::string &name)
octave_value dump(void) const
void alias_built_in_function(const std::string &alias, const std::string &name)
octave_value find_method(const std::string &name, const std::string &dispatch_type)
void clear_function_regexp(const std::string &pat)
octave_value find_scoped_function(const std::string &name, const symbol_scope &search_scope)
interpreter & m_interpreter
octave_value find_private_function(const std::string &dir_name, const std::string &name)
void top_level_assign(const std::string &name, const octave_value &value=octave_value())
void clear_mex_functions(void)
void clear_global(const std::string &name)
void install_built_in_dispatch(const std::string &name, const std::string &klass)
octave_value global_varval(const std::string &name) const
octave_value find_autoload(const std::string &name)
void clear_user_function(const std::string &name)
void global_assign(const std::string &name, const octave_value &value=octave_value())
std::map< std::string, std::list< std::string > > m_parent_map
octave_value find_built_in_function(const std::string &name)
std::list< std::string > global_variable_names(void)
std::list< std::string > built_in_function_names(void)
std::map< std::string, fcn_info >::iterator fcn_table_iterator
std::list< std::string > variable_names(void)
std::list< std::string > cmdline_function_names(void)
void install_builtins(void)
symbol_scope get_current_scope(void) const
octave_user_function * user_function_value(bool silent=false) const
bool is_defined(void) const
std::string xstring_value(const char *fmt,...) const
OCTINTERP_API void print_usage(void)
#define DEFMETHOD(name, interp_name, args_name, nargout_name, doc)
Macro to define a builtin method.
OCTAVE_NORETURN void panic(const char *fmt,...)
void error(const char *fmt,...)
F77_RET_T const F77_INT const F77_INT const F77_INT const F77_DBLE const F77_DBLE F77_INT F77_DBLE * V
F77_RET_T const F77_INT F77_CMPLX * A
F77_RET_T const F77_DBLE const F77_DBLE * f
static octave_value dump_container_map(const std::map< std::string, C< V, A... >> &container_map)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
octave_value::octave_value(const Array< char > &chm, char type) return retval
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.