GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
symtab.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1993-2018 John W. Eaton
4 Copyright (C) 2009 VZLU Prague, a.s.
5 
6 This file is part of Octave.
7 
8 Octave is free software: you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <https://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if defined (HAVE_CONFIG_H)
25 # include "config.h"
26 #endif
27 
28 #include <sstream>
29 
30 #include "file-ops.h"
31 #include "file-stat.h"
32 #include "oct-env.h"
33 #include "oct-time.h"
34 
35 #include "bp-table.h"
36 #include "defun.h"
37 #include "dirfns.h"
38 #include "fcn-info.h"
39 #include "interpreter-private.h"
40 #include "interpreter.h"
41 #include "load-path.h"
42 #include "ov-classdef.h"
43 #include "ov-fcn.h"
44 #include "ov-usr-fcn.h"
45 #include "pager.h"
46 #include "parse.h"
47 #include "pt-pr-code.h"
48 #include "symrec.h"
49 #include "symscope.h"
50 #include "symtab.h"
51 #include "unwind-prot.h"
52 #include "utils.h"
53 
54 // Should Octave always check to see if function files have changed
55 // since they were last compiled?
57 
58 namespace octave
59 {
60  static void
63  {
64  size_t pos = name.rfind ('.');
65 
66  fname.clear ();
67  pname.clear ();
68 
69  if (pos != std::string::npos)
70  {
71  fname = name.substr (pos + 1);
72  pname = name.substr (0, pos);
73  }
74  else
75  fname = name;
76  }
77 
78  // Check the load path to see if file that defined this is still
79  // visible. If the file is no longer visible, then erase the
80  // definition and move on. If the file is visible, then we also
81  // need to check to see whether the file has changed since the
82  // function was loaded/parsed. However, this check should only
83  // happen once per prompt (for files found from relative path
84  // elements, we also check if the working directory has changed
85  // since the last time the function was loaded/parsed).
86  //
87  // FIXME: perhaps this should be done for all loaded functions when
88  // the prompt is printed or the directory has changed, and then we
89  // would not check for it when finding symbol definitions.
90 
91  static inline bool
92  load_out_of_date_fcn (const std::string& ff, const std::string& dir_name,
93  octave_value& function,
94  const std::string& dispatch_type = "",
95  const std::string& package_name = "")
96  {
97  bool retval = false;
98 
99  octave_value ov_fcn
100  = octave::load_fcn_from_file (ff, dir_name, dispatch_type,
101  package_name);
102 
103  if (ov_fcn.is_defined ())
104  {
105  retval = true;
106 
107  function = ov_fcn;
108  }
109  else
110  function = octave_value ();
111 
112  return retval;
113  }
114 
115  bool
117  const std::string& dispatch_type,
118  bool check_relative)
119  {
120  bool retval = false;
121 
122  octave_function *fcn = function.function_value (true);
123 
124  if (fcn)
125  {
126  // FIXME: we need to handle subfunctions properly here.
127 
128  if (! fcn->is_subfunction ())
129  {
130  std::string ff = fcn->fcn_file_name ();
131 
132  if (! ff.empty ())
133  {
134  sys::time tc = fcn->time_checked ();
135 
136  bool relative = check_relative && fcn->is_relative ();
137 
138  if (tc <= Vlast_prompt_time
139  || (relative && tc < Vlast_chdir_time))
140  {
141  bool clear_breakpoints = false;
142  std::string nm = fcn->name ();
143  std::string pack = fcn->package_name ();
144  std::string canonical_nm = fcn->canonical_name ();
145 
146  bool is_same_file = false;
147 
149  std::string dir_name;
150 
151  if (check_relative)
152  {
153  int nm_len = nm.length ();
154 
156  && ((nm_len > 4
157  && (nm.substr (nm_len-4) == ".oct"
158  || nm.substr (nm_len-4) == ".mex"))
159  || (nm_len > 2
160  && nm.substr (nm_len-2) == ".m")))
161  file = nm;
162  else
163  {
164  // We don't want to make this an absolute name,
165  // because load_fcn_file looks at the name to
166  // decide whether it came from a relative lookup.
167 
168  if (! dispatch_type.empty ())
169  {
170  load_path& lp = __get_load_path__ ("out_of_date_check");
171 
172  file = lp.find_method (dispatch_type, nm,
173  dir_name, pack);
174 
175  if (file.empty ())
176  {
177  std::string s_name;
178  std::string s_pack;
179 
180  symbol_table& symtab
181  = __get_symbol_table__ ("out_of_date_check");
182 
183  const std::list<std::string>& plist
184  = symtab.parent_classes (dispatch_type);
185 
186  std::list<std::string>::const_iterator it
187  = plist.begin ();
188 
189  while (it != plist.end ())
190  {
191  split_name_with_package (*it, s_name,
192  s_pack);
193 
194  file = lp.find_method (*it, nm, dir_name,
195  s_pack);
196  if (! file.empty ())
197  {
198  pack = s_pack;
199  break;
200  }
201 
202  it++;
203  }
204  }
205  }
206 
207  // Maybe it's an autoload?
208  if (file.empty ())
209  file = lookup_autoload (nm);
210 
211  if (file.empty ())
212  {
213  load_path& lp = __get_load_path__ ("out_of_date_check");
214  file = lp.find_fcn (nm, dir_name, pack);
215  }
216  }
217 
218  if (! file.empty ())
219  is_same_file = same_file (file, ff);
220  }
221  else
222  {
223  is_same_file = true;
224  file = ff;
225  }
226 
227  if (file.empty ())
228  {
229  // Can't see this function from current
230  // directory, so we should clear it.
231 
232  function = octave_value ();
233 
234  clear_breakpoints = true;
235  }
236  else if (is_same_file)
237  {
238  // Same file. If it is out of date, then reload it.
239 
240  sys::time ottp = fcn->time_parsed ();
241  time_t tp = ottp.unix_time ();
242 
244 
245  if (! (Vignore_function_time_stamp == 2
247  && fcn->is_system_fcn_file ())))
248  {
249  sys::file_stat fs (ff);
250 
251  if (fs)
252  {
253  if (fs.is_newer (tp))
254  {
255  retval = load_out_of_date_fcn (ff, dir_name,
256  function,
257  dispatch_type,
258  pack);
259 
260  clear_breakpoints = true;
261  }
262  }
263  else
264  {
265  function = octave_value ();
266 
267  clear_breakpoints = true;
268  }
269  }
270  }
271  else
272  {
273  // Not the same file, so load the new file in
274  // place of the old.
275 
276  retval = load_out_of_date_fcn (file, dir_name, function,
277  dispatch_type, pack);
278 
279  clear_breakpoints = true;
280  }
281 
282  // If the function has been replaced then clear any
283  // breakpoints associated with it
284  if (clear_breakpoints)
285  {
286  octave::bp_table& bptab
287  = octave::__get_bp_table__ ("out_of_date_check");
288 
289  bptab.remove_all_breakpoints_in_file (canonical_nm,
290  true);
291  }
292  }
293  }
294  }
295  }
296 
297  return retval;
298  }
299 
300  void
302  {
304  }
305 
306  void
308  {
310  }
311 
312  // Insert INF_CLASS in the set of class names that are considered
313  // inferior to SUP_CLASS. Return FALSE if INF_CLASS is currently
314  // marked as superior to SUP_CLASS.
315 
316  bool
318  const std::string& inf_class)
319  {
320  if (is_superiorto (inf_class, sup_class))
321  return false;
322 
323  // If sup_class doesn't have an entry in the precedence table,
324  // this will automatically create it, and associate to it a
325  // singleton set {inf_class} of inferior classes.
326  m_class_precedence_table[sup_class].insert (inf_class);
327 
328  return true;
329  }
330 
331  // Has class A been marked as superior to class B? Also returns
332  // TRUE if B has been marked as inferior to A, since we only keep
333  // one table, and convert inferiorto information to a superiorto
334  // relationship. Two calls are required to determine whether there
335  // is no relationship between two classes:
336  //
337  // if (symbol_table::is_superiorto (a, b))
338  // // A is superior to B, or B has been marked inferior to A.
339  // else if (symbol_table::is_superiorto (b, a))
340  // // B is superior to A, or A has been marked inferior to B.
341  // else
342  // // No relation.
343 
344  bool
346  {
348  // If a has no entry in the precedence table, return false
349  if (p == m_class_precedence_table.end ())
350  return false;
351 
352  const std::set<std::string>& inferior_classes = p->second;
353  std::set<std::string>::const_iterator q = inferior_classes.find (b);
354  return (q != inferior_classes.end ());
355  }
356 
359  bool skip_variables, bool local_funcs)
360  {
361  return (m_current_scope
362  ? m_current_scope.find (name, args, skip_variables, local_funcs)
363  : octave_value ());
364  }
365 
368  {
370 
371  if (p != m_fcn_table.end ())
372  return p->second.builtin_find ();
373  else
374  {
375  fcn_info finfo (name);
376 
377  octave_value fcn = finfo.builtin_find ();
378 
379  if (fcn.is_defined ())
380  m_fcn_table[name] = finfo;
381 
382  return fcn;
383  }
384 
385  return octave_value ();
386  }
387 
390  const octave_value_list& args, bool local_funcs)
391  {
393 
394  if (p != m_fcn_table.end ())
395  return p->second.find (args, local_funcs);
396  else
397  {
398  fcn_info finfo (name);
399 
400  octave_value fcn = finfo.find (args, local_funcs);
401 
402  if (fcn.is_defined ())
403  m_fcn_table[name] = finfo;
404 
405  return fcn;
406  }
407 
408  return octave_value ();
409  }
410 
413  const octave_value_list& args, bool local_funcs)
414  {
416 
417  if (! name.empty () && name[0] == '@')
418  {
419  // Look for a class specific function.
420  std::string dispatch_type =
421  name.substr (1, name.find_first_of (sys::file_ops::dir_sep_str ()) - 1);
422 
424  size_t pos = name.find_last_of (sys::file_ops::dir_sep_str ());
425  if (pos != std::string::npos)
426  method = name.substr (pos + 1);
427 
428  retval = find_method (method, dispatch_type);
429  }
430  else
431  {
432  size_t pos = name.find_first_of ('>');
433 
434  if (pos == std::string::npos)
435  retval = find (name, args, true, local_funcs);
436  else
437  {
438  std::string fcn_scope = name.substr (0, pos);
439  symbol_scope stored_scope = m_current_scope;
441  octave_value parent = find_function (name.substr (0, pos),
442  octave_value_list (), false);
443 
444  if (parent.is_defined ())
445  {
446  octave_function *parent_fcn = parent.function_value ();
447 
448  if (parent_fcn)
449  {
450  m_current_scope = parent_fcn->scope ();
451 
453  retval = find_function (name.substr (pos + 1), args);
454  }
455  }
456 
457  m_current_scope = stored_scope;
458  }
459  }
460 
461  return retval;
462  }
463 
464  // look for @class/method>subfunction
467  const std::string& dispatch_type)
468  {
470 
471  std::string full_name = '@' + dispatch_type +
473  size_t pos = full_name.find_first_of ('>');
474 
475  if (pos != std::string::npos)
476  {
477  std::string fcn_scope = full_name.substr (0, pos);
478  symbol_scope stored_scope = m_current_scope;
480  octave_value parent = find_function (full_name.substr (0, pos),
481  octave_value_list (), false);
482  if (parent.is_defined ())
483  {
484  octave_function *parent_fcn = parent.function_value ();
485 
486  if (parent_fcn)
487  {
488  m_current_scope = parent_fcn->scope ();
489 
491  fcn = find_function (full_name.substr (pos + 1),
492  octave_value_list ());
493  }
494  }
495 
496  m_current_scope = stored_scope;
497  }
498 
499  return fcn;
500  }
501 
502  template <template <typename, typename...> class C, typename V,
503  typename... A>
504  static octave_value
505  dump_container_map (const std::map<std::string, C<V, A...>>& container_map)
506  {
507  if (container_map.empty ())
508  return octave_value (Matrix ());
509 
510  std::map<std::string, octave_value> info_map;
511 
512  for (const auto& nm_container : container_map)
513  {
514  std::string nm = nm_container.first;
515  const C<V, A...>& container = nm_container.second;
516  info_map[nm] = Cell (container);
517  }
518 
519  return octave_value (info_map);
520  }
521 
523  symbol_table::dump (void) const
524  {
525  std::map<std::string, octave_value> m
526  = {{ "function_info", dump_fcn_table_map () },
527  { "precedence_table", dump_container_map (m_class_precedence_table) },
528  { "parent_classes", dump_container_map (m_parent_map) }};
529 
530  return octave_value (m);
531  }
532 
533  void
535  {
536  clear_all (true);
537 
538  m_fcn_table.clear ();
539  m_class_precedence_table.clear ();
540  m_parent_map.clear ();
541  }
542 
545  {
546  if (m_fcn_table.empty ())
547  return octave_value (Matrix ());
548 
549  std::map<std::string, octave_value> info_map;
550 
551  for (const auto& nm_finfo : m_fcn_table)
552  {
553  std::string nm = nm_finfo.first;
554  const fcn_info& finfo = nm_finfo.second;
555  info_map[nm] = finfo.dump ();
556  }
557 
558  return octave_value (info_map);
559  }
560 }
561 
562 DEFUN (ignore_function_time_stamp, args, nargout,
563  doc: /* -*- texinfo -*-
564 @deftypefn {} {@var{val} =} ignore_function_time_stamp ()
565 @deftypefnx {} {@var{old_val} =} ignore_function_time_stamp (@var{new_val})
566 Query or set the internal variable that controls whether Octave checks
567 the time stamp on files each time it looks up functions defined in
568 function files.
569 
570 If the internal variable is set to @qcode{"system"}, Octave will not
571 automatically recompile function files in subdirectories of
572 @file{@var{octave-home}/lib/@var{version}} if they have changed since they were last compiled, but will recompile other function files in the search path if they change.
573 
574 If set to @qcode{"all"}, Octave will not recompile any function files
575 unless their definitions are removed with @code{clear}.
576 
577 If set to @qcode{"none"}, Octave will always check time stamps on files to
578 determine whether functions defined in function files need to recompiled.
579 @end deftypefn */)
580 {
581  int nargin = args.length ();
582 
583  if (nargin > 1)
584  print_usage ();
585 
587 
588  if (nargout > 0 || nargin == 0)
589  {
591  {
592  case 1:
593  retval = "system";
594  break;
595 
596  case 2:
597  retval = "all";
598  break;
599 
600  default:
601  retval = "none";
602  break;
603  }
604  }
605 
606  if (nargin == 1)
607  {
608  std::string sval = args(0).xstring_value ("ignore_function_time_stamp: first argument must be a string");
609 
610  if (sval == "all")
612  else if (sval == "system")
614  else if (sval == "none")
616  else
617  error (R"(ignore_function_time_stamp: argument must be one of "all", "system", or "none")");
618  }
619 
620  return retval;
621 }
622 
623 /*
624 %!shared old_state
625 %! old_state = ignore_function_time_stamp ();
626 %!test
627 %! state = ignore_function_time_stamp ("all");
628 %! assert (state, old_state);
629 %! assert (ignore_function_time_stamp (), "all");
630 %! state = ignore_function_time_stamp ("system");
631 %! assert (state, "all");
632 %! assert (ignore_function_time_stamp (), "system");
633 %! ignore_function_time_stamp (old_state);
634 
635 ## Test input validation
636 %!error (ignore_function_time_stamp ("all", "all"))
637 %!error (ignore_function_time_stamp ("UNKNOWN_VALUE"))
638 %!error (ignore_function_time_stamp (42))
639 */
640 
641 DEFMETHOD (__current_scope__, interp, , ,
642  doc: /* -*- texinfo -*-
643 @deftypefn {} {[@var{scope}, @var{context}] =} __current_scope__ ()
644 Return the current scope and context as integers.
645 @seealso{__dump_symtab_info__}
646 @end deftypefn */)
647 {
648  octave::symbol_table& symtab = interp.get_symbol_table ();
649 
650  octave::symbol_scope scope = symtab.current_scope ();
651 
652  std::string nm = scope ? scope.name () : "<unknown>";
653 
654  return ovl (nm, symtab.current_context ());
655 }
656 
657 DEFMETHOD (__dump_symtab_info__, interp, args, ,
658  doc: /* -*- texinfo -*-
659 @deftypefn {} {} __dump_symtab_info__ ()
660 @deftypefnx {} {} __dump_symtab_info__ (@var{function})
661 Undocumented internal function.
662 @seealso{__current_scope__}
663 @end deftypefn */)
664 {
665  int nargin = args.length ();
666 
667  if (nargin > 1)
668  print_usage ();
669 
670  octave::symbol_table& symtab = interp.get_symbol_table ();
671 
672  if (nargin == 0)
673  return symtab.dump ();
674  else
675  {
676  std::string fname = args(0).xstring_value ("__dump_symtab_info__: argument must be a function name");
677 
678  octave::fcn_info *finfo = symtab.get_fcn_info (fname);
679 
680  if (finfo)
681  return finfo->dump ();
682  }
683 
684  return ovl ();
685 }
686 
687 DEFMETHOD (__get_cmdline_fcn_txt__, interp, args, ,
688  doc: /* -*- texinfo -*-
689 @deftypefn {} {} __get_cmdline_fcn_txt__ (@var{name})
690 Undocumented internal function.
691 @end deftypefn */)
692 {
693  if (args.length () != 1)
694  print_usage ();
695 
696  std::string name = args(0).xstring_value ("__get_cmd_line_function_text__: first argument must be function name");
697 
698  octave::symbol_table& symtab = interp.get_symbol_table ();
699 
701 
703 
705 
706  if (f)
707  {
708  std::ostringstream buf;
709 
710  octave::tree_print_code tpc (buf);
711 
712  f->accept (tpc);
713 
714  retval = ovl (buf.str ());
715  }
716 
717  return retval;
718 }
719 
720 // FIXME: should we have functions like this in Octave?
721 //
722 // DEFMETHOD (set_variable, interp, args, , "set_variable (NAME, VALUE)")
723 // {
724 // if (args.length () != 2)
725 // print_usage ();
726 //
727 // std::string name = args(0).xstring_value ("set_variable: variable NAME must be a string");
728 //
729 // octave::symbol_table& symtab = interp.get_symbol_table ();
730 //
731 // symtab.assign (name, args(1));
732 //
733 // return ovl ();
734 // }
735 //
736 // DEFMETHOD (variable_value, interp, args, , "VALUE = variable_value (NAME)")
737 // {
738 // if (args.length () != 1)
739 // print_usage ();
740 //
741 // octave_value retval;
742 //
743 // std::string name = args(0).xstring_value ("variable_value: variable NAME must be a string");
744 //
745 // octave::symbol_table& symtab = interp.get_symbol_table ();
746 //
747 // retval = symtab.varval (name);
748 //
749 // if (retval.is_undefined ())
750 // error ("variable_value: '%s' is not a variable in the current scope",
751 // name.c_str ());
752 //
753 // return retval;
754 // }
755 
756 /*
757 bug #34497: 'clear -f' does not work for command line functions
758 
759 This test relies on bar being a core function that is implemented in an m-file.
760 If the first assert fails, this is no longer the case and the tests need to be
761 updated to use some other function.
762 
763 %!assert <34497> (! strcmp (which ("bar"), ""))
764 
765 %!function x = bar ()
766 %! x = 5;
767 %!endfunction
768 %!test
769 %! assert (bar == 5);
770 %! assert (strcmp (which ("bar"), "command-line function"));
771 %! clear -f bar;
772 %! assert (! strcmp (which ("bar"), ""));
773 
774 %!function x = bar ()
775 %! x = 5;
776 %!endfunction
777 %!test
778 %! assert (bar == 5);
779 %! assert (strcmp (which ("bar"), "command-line function"));
780 %! clear bar;
781 %! assert (! strcmp (which ("bar"), ""));
782 */
virtual octave::symbol_scope scope(void)
Definition: ov-fcn.h:88
octave_value find_function(const std::string &name, const octave_value_list &args=octave_value_list(), bool local_funcs=true)
Definition: symtab.cc:412
F77_RET_T const F77_INT const F77_INT const F77_INT const F77_DBLE const F77_DBLE F77_INT F77_DBLE * V
Definition: Cell.h:37
For example cd octave end example noindent changes the current working directory to file
Definition: dirfns.cc:124
virtual octave::sys::time time_parsed(void) const
Definition: ov-fcn.h:90
bool same_file(const std::string &f, const std::string &g)
Definition: utils.cc:130
symbol_record::context_id current_context(void) const
Definition: symtab.h:87
#define DEFMETHOD(name, interp_name, args_name, nargout_name, doc)
Macro to define a builtin method.
Definition: defun.h:135
#define C(a, b)
Definition: Faddeeva.cc:246
fname
Definition: load-save.cc:767
static void split_name_with_package(const std::string &name, std::string &fname, std::string &pname)
Definition: symtab.cc:61
OCTINTERP_API void print_usage(void)
Definition: defun.cc:54
octave_value fcn_table_find(const std::string &name, const octave_value_list &args=octave_value_list(), bool local_funcs=true)
Definition: symtab.cc:389
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE * f
symbol_scope current_scope(void)
Definition: symtab.h:77
bool is_relative(void) const
Definition: ov-fcn.h:180
std::map< std::string, fcn_info >::iterator fcn_table_iterator
Definition: symtab.h:686
octave_value dump_fcn_table_map(void) const
Definition: symtab.cc:544
OCTINTERP_API octave_value load_fcn_from_file(const std::string &file_name, const std::string &dir_name="", const std::string &dispatch_type="", const std::string &package_name="", const std::string &fcn_name="", bool autoload=false)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
Definition: defun.h:53
void error(const char *fmt,...)
Definition: error.cc:578
void clear_all(bool force=false)
Definition: symtab.h:368
bool is_superiorto(const std::string &a, const std::string &b)
Definition: symtab.cc:345
std::map< std::string, std::set< std::string > >::const_iterator class_precedence_table_const_iterator
Definition: symtab.h:699
void clear_variable(const std::string &name)
Definition: symscope.h:767
octave::sys::time Vlast_prompt_time
Definition: input.cc:84
bool is_defined(void) const
Definition: ov.h:523
OCTINTERP_API std::string lookup_autoload(const std::string &nm)
void clear_global_pattern(const std::string &pattern)
Definition: symtab.cc:307
std::string find_method(const std::string &class_name, const std::string &meth, std::string &dir_name, const std::string &pack_name="")
Definition: load-path.h:77
virtual std::string fcn_file_name(void) const
Definition: ov-fcn.h:74
std::string dir_sep_str(void)
Definition: file-ops.cc:233
octave_function * fcn
Definition: ov-class.cc:1754
std::list< std::string > parent_classes(const std::string &dispatch_type)
Definition: symtab.h:639
static octave_value dump_container_map(const std::map< std::string, C< V, A... >> &container_map)
Definition: symtab.cc:505
bool is_defined(void) const
Definition: ov-fcn.h:68
static bool load_out_of_date_fcn(const std::string &ff, const std::string &dir_name, octave_value &function, const std::string &dispatch_type="", const std::string &package_name="")
Definition: symtab.cc:92
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:400
std::map< std::string, std::list< std::string > > m_parent_map
Definition: symtab.h:704
symbol_table & __get_symbol_table__(const std::string &who)
nd deftypefn *std::string name
Definition: sysdep.cc:647
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
Definition: utils.cc:975
F77_RET_T const F77_INT F77_CMPLX * A
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
Definition: ov-usr-fcn.cc:997
std::string find_fcn(const std::string &fcn, std::string &dir_name, const std::string &pack_name="")
Definition: load-path.h:109
std::map< std::string, std::set< std::string > > m_class_precedence_table
Definition: symtab.h:696
bool set_class_relationship(const std::string &sup_class, const std::string &inf_class)
Definition: symtab.cc:317
virtual bool is_subfunction(void) const
Definition: ov-fcn.h:96
intmap remove_all_breakpoints_in_file(const std::string &fname, bool silent=false)
Definition: bp-table.cc:695
static int Vignore_function_time_stamp
Definition: symtab.cc:56
octave_value dump(void) const
Definition: symtab.cc:523
static bool absolute_pathname(const std::string &s)
Definition: oct-env.cc:108
octave_function * function_value(bool silent=false) const
octave_user_function * user_function_value(bool silent=false) const
octave_value find_method(const std::string &name, const std::string &dispatch_type)
Definition: symtab.h:200
Definition: dMatrix.h:36
virtual octave::sys::time time_checked(void) const
Definition: ov-fcn.h:93
time_t unix_time(void) const
Definition: oct-time.h:110
symbol_scope m_global_scope
Definition: symtab.h:711
is longer than or if then or only for unique occurrences of the complete pattern(false). The default is true. If a cell array of strings ar
Definition: strfind.cc:190
octave_value find(const std::string &name, const octave_value_list &args=octave_value_list(), bool skip_variables=false, bool local_funcs=true)
Definition: symtab.cc:358
load_path & __get_load_path__(const std::string &who)
std::string pname
Definition: graphics.cc:11810
octave::sys::time Vlast_chdir_time
Definition: dirfns.cc:69
std::string canonical_name(void) const
Definition: ov-fcn.h:184
virtual bool is_system_fcn_file(void) const
Definition: ov-fcn.h:72
std::string package_name(void) const
Definition: ov-fcn.h:126
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
fcn_info * get_fcn_info(const std::string &name)
Definition: symtab.h:670
std::map< std::string, fcn_info > m_fcn_table
Definition: symtab.h:692
virtual void mark_fcn_file_up_to_date(const octave::sys::time &)
Definition: ov-fcn.h:86
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).isinteger())
bp_table & __get_bp_table__(const std::string &who)
p
Definition: lu.cc:138
octave_value find(const octave_value_list &args=octave_value_list(), bool local_funcs=true)
Definition: fcn-info.h:241
octave_map map(dims)
bool out_of_date_check(octave_value &function, const std::string &dispatch_type, bool check_relative)
Definition: symtab.cc:116
std::string method
Definition: urlwrite.cc:123
octave_idx_type length(void) const
Definition: ovl.h:96
symbol_scope m_current_scope
Definition: symtab.h:714
b
Definition: cellfun.cc:400
octave_value builtin_find(const std::string &name)
Definition: symtab.cc:367
octave::sys::file_stat fs(filename)
args.length() nargin
Definition: file-io.cc:589
octave_value dump(void) const
Definition: fcn-info.h:329
void clear_global(const std::string &name)
Definition: symtab.cc:301
virtual octave_function * function_value(bool silent=false)
Definition: ov-base.cc:871
void cleanup(void)
Definition: symtab.cc:534
octave_value find_cmdline_function(const std::string &name)
Definition: symtab.h:270
std::string name(void) const
Definition: ov-fcn.h:182
octave_value retval
Definition: symtab.cc:586
std::string name(void) const
Definition: symscope.h:919
symbol_scope m_top_scope
Definition: symtab.h:712
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
Definition: utils.cc:888
octave_value find(const std::string &name, const octave_value_list &args, bool skip_variables, bool local_funcs)
Definition: symscope.h:686
octave_value find_submethod(const std::string &name, const std::string &dispatch_type)
Definition: symtab.cc:466
bool is_newer(const sys::time &time) const
Definition: file-stat.h:149
octave_value builtin_find(void)
Definition: fcn-info.h:247
void clear_variable_pattern(const std::string &pat)
Definition: symscope.h:773