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 std::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);
591 if (! retval.empty ())
599 std::list<std::string> retval;
603 octave_value fcn = nm_finfo.second.find_built_in_function ();
606 retval.push_back (nm_finfo.first);
609 if (! retval.empty ())
617 std::list<std::string> retval;
621 octave_value fcn = nm_finfo.second.find_cmdline_function ();
624 retval.push_back (nm_finfo.first);
627 if (! retval.empty ())
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
665 const std::list<std::string>& parent_list)
672 std::list<std::string> retval;
679 for (
const auto& nm : retval)
687 if (! parents.empty ())
688 retval.insert (retval.end (), parents.begin (), parents.end ());
706 return p !=
m_fcn_table.end () ? &p->second :
nullptr;
714 std::map<std::string, octave_value> info_map;
718 std::string nm = nm_finfo.first;
719 const fcn_info& finfo = nm_finfo.second;
720 info_map[nm] = finfo.
dump ();
726 DEFMETHOD (__dump_symtab_info__, interp, args, ,
733 int nargin = args.length ();
741 return symtab.
dump ();
744 std::string fname = args(
745 0).
xstring_value (
"__dump_symtab_info__: argument must be a function name");
750 return finfo->
dump ();
756 DEFMETHOD (__get_cmdline_fcn_txt__, interp, args, ,
762 if (args.length () != 1)
765 std::string name = args(
766 0).xstring_value (
"__get_cmdline_fcn_txt__: first argument must be function name");
778 std::ostringstream buf;
784 retval =
ovl (buf.str ());
octave_value find_method(const std::string &dispatch_type) const
octave_value find_scoped_function(const symbol_scope &search_scope) const
void install_built_in_dispatch(const std::string &klass)
octave_value builtin_find(const symbol_scope &search_scope)
octave_value find_built_in_function(void) const
void clear_autoload_function(bool force=false)
void install_user_function(const octave_value &f)
void install_local_function(const octave_value &f, const std::string &file_name)
void install_cmdline_function(const octave_value &f)
octave_value find_autoload(void)
octave_value find(const symbol_scope &search_scope, const octave_value_list &args=octave_value_list())
void clear_user_function(bool force=false)
octave_value find_private_function(const std::string &dir_name) const
octave_value find_cmdline_function(void) const
octave_value dump(void) const
octave_value find_user_function(void)
void install_built_in_function(const octave_value &f)
bool match(const std::string &str) const
tree_evaluator & get_evaluator(void)
OCTINTERP_API std::string xstring_value(const char *fmt,...) const
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
bool is_defined(void) const
OCTINTERP_API octave_user_function * user_function_value(bool silent=false) const
bool is_match(const std::string &buffer) const
octave_value find_scoped_function(const std::string &name, const symbol_scope &search_scope)
octave_value find_method(const std::string &name, const std::string &dispatch_type)
octave_value builtin_find(const std::string &name, const symbol_scope &search_scope=symbol_scope())
void clear_mex_functions(void)
bool is_built_in_function_name(const std::string &name)
octave_value find_private_function(const std::string &dir_name, const std::string &name)
void clear_function(const std::string &name)
void clear_function_pattern(const std::string &pat)
void clear_functions(bool force=false)
void alias_built_in_function(const std::string &alias, const std::string &name)
void add_to_parent_map(const std::string &classname, const std::list< std::string > &parent_list)
std::map< std::string, std::list< std::string > > m_parent_map
fcn_info * get_fcn_info(const std::string &name)
octave_value dump(void) const
void install_cmdline_function(const std::string &name, const octave_value &fcn)
void clear_user_function(const std::string &name)
std::list< std::string > cmdline_function_names(void)
std::map< std::string, std::list< std::string > >::const_iterator const_parent_map_iterator
void install_user_function(const std::string &name, const octave_value &fcn)
interpreter & m_interpreter
void clear_dld_function(const std::string &name)
octave_value find_function(const std::string &name, const symbol_scope &search_scope=symbol_scope())
octave_value find_cmdline_function(const std::string &name)
void install_built_in_function(const std::string &name, const octave_value &fcn)
void install_built_in_dispatch(const std::string &name, const std::string &klass)
octave_value find_built_in_function(const std::string &name)
symbol_scope current_scope(void) const
std::map< std::string, fcn_info >::iterator fcn_table_iterator
std::list< std::string > built_in_function_names(void)
bool is_superiorto(const std::string &a, const std::string &b)
std::map< std::string, fcn_info > m_fcn_table
octave_value dump_fcn_table_map(void) const
octave_value find_autoload(const std::string &name)
octave_value find_user_function(const std::string &name)
std::list< std::string > user_function_names(void)
void clear_function_regexp(const std::string &pat)
void install_local_function(const std::string &name, const octave_value &fcn, const std::string &file_name)
std::map< std::string, std::set< std::string > >::const_iterator class_precedence_table_const_iterator
std::map< std::string, std::set< std::string > > m_class_precedence_table
octave_value fcn_table_find(const std::string &name, const octave_value_list &args=ovl(), const symbol_scope &search_scope=symbol_scope())
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
std::list< std::string > parent_classes(const std::string &dispatch_type)
symbol_scope get_current_scope(void) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
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
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
static octave_value dump_container_map(const std::map< std::string, C< V, A... >> &container_map)