GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
symtab.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1993-2018 John W. Eaton
4 Copyright (C) 2009 VZLU Prague
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 (octave_symtab_h)
25 #define octave_symtab_h 1
26 
27 #include "octave-config.h"
28 
29 #include <deque>
30 #include <limits>
31 #include <list>
32 #include <map>
33 #include <set>
34 #include <string>
35 
36 #include "glob-match.h"
37 #include "lo-regexp.h"
38 #include "oct-refcount.h"
39 
40 class tree_argument_list;
42 
43 #include "fcn-info.h"
44 #include "ov.h"
45 #include "ovl.h"
46 #include "symscope.h"
47 
48 namespace octave
49 {
50  class OCTINTERP_API symbol_table
51  {
52  public:
53 
57 
58  symbol_table (void)
59  : m_fcn_table (), m_class_precedence_table (),
60  m_parent_map (), m_global_scope ("global scope"),
61  m_top_scope ("top scope"), m_current_scope (m_top_scope)
62  {
63  install_builtins ();
64  }
65 
66  // No copying!
67 
68  symbol_table (const symbol_table&) = delete;
69 
70  symbol_table& operator = (const symbol_table&) = delete;
71 
72  ~symbol_table (void) = default;
73 
74  symbol_scope global_scope (void) { return m_global_scope; }
75  symbol_scope top_scope (void) { return m_top_scope; }
76 
77  symbol_scope current_scope (void) { return m_current_scope; }
78 
80  {
81  if (! m_current_scope)
82  error ("%s: missing scope", who.c_str ());
83 
84  return m_current_scope;
85  }
86 
88  {
89  return m_current_scope ? m_current_scope.current_context () : 0;
90  }
91 
92  void set_scope (const symbol_scope& sid)
93  {
94  set_scope_and_context (sid, 0);
95  }
96 
99  {
100  if (sid == m_global_scope)
101  error ("can't set scope to global");
102 
103  m_current_scope = sid;
104 
105  if (m_current_scope)
106  m_current_scope.set_context (context);
107  }
108 
110  {
111  return sid ? sid.find_symbol (name) : symbol_record ();
112  }
113 
115  {
116  return find_symbol (name, m_current_scope);
117  }
118 
120  {
121  symbol_record sym = find_symbol (name, m_global_scope);
122 
123  sym.mark_global ();
124 
125  return sym;
126  }
127 
128  void
129  inherit (symbol_scope& recipient_scope, const symbol_scope& donor_scope)
130  {
131  if (recipient_scope)
132  recipient_scope.inherit (donor_scope);
133  }
134 
135  void inherit (symbol_scope& recipient_scope)
136  {
137  inherit (recipient_scope, m_current_scope);
138  }
139 
140  bool at_top_level (void) { return m_current_scope == m_top_scope; }
141 
142  // Find a value corresponding to the given name in the table.
144  find (const std::string& name,
145  const octave_value_list& args = octave_value_list (),
146  bool skip_variables = false,
147  bool local_funcs = true);
148 
149  void assign (const std::string& name, const octave_value& value, bool force_add)
150  {
151  if (m_current_scope)
152  m_current_scope.assign (name, value, force_add);
153  }
154 
155  void assign (const std::string& name,
156  const octave_value& value = octave_value ())
157  {
158  if (m_current_scope)
159  m_current_scope.assign (name, value);
160  }
161 
163  {
164  return (m_current_scope
165  ? m_current_scope.varval (name) : octave_value ());
166  }
167 
169  const octave_value& value = octave_value ())
170  {
171  m_global_scope.assign (name, value);
172  }
173 
175  {
176  return m_global_scope.varval (name);
177  }
178 
179  void
181  const octave_value& value = octave_value ())
182  {
183  m_top_scope.assign (name, value);
184  }
185 
187  {
188  return m_top_scope.varval (name);
189  }
190 
191  bool
193  {
194  octave_value val = find_built_in_function (name);
195 
196  return val.is_defined ();
197  }
198 
200  find_method (const std::string& name, const std::string& dispatch_type)
201  {
202  fcn_table_const_iterator p = m_fcn_table.find (name);
203 
204  if (p != m_fcn_table.end ())
205  {
206  octave_value fcn = p->second.find_method (dispatch_type);
207 
208  if (! fcn.is_defined ())
209  fcn = find_submethod (name, dispatch_type);
210 
211  return fcn;
212  }
213  else
214  {
215  fcn_info finfo (name);
216 
217  octave_value fcn = finfo.find_method (dispatch_type);
218 
219  if (! fcn.is_defined ())
220  fcn = find_submethod (name, dispatch_type);
221 
222  if (fcn.is_defined ())
223  m_fcn_table[name] = finfo;
224 
225  return fcn;
226  }
227  }
228 
230  find_submethod (const std::string& name, const std::string& dispatch_type);
231 
234  {
235  fcn_table_const_iterator p = m_fcn_table.find (name);
236 
237  return (p != m_fcn_table.end ()
238  ? p->second.find_built_in_function () : octave_value ());
239  }
240 
243  {
244  fcn_table_iterator p = m_fcn_table.find (name);
245 
246  return (p != m_fcn_table.end ()
247  ? p->second.find_autoload () : octave_value ());
248  }
249 
250  octave_value builtin_find (const std::string& name);
251 
253  fcn_table_find (const std::string& name,
254  const octave_value_list& args = octave_value_list (),
255  bool local_funcs = true);
256 
258  find_function (const std::string& name,
259  const octave_value_list& args = octave_value_list (),
260  bool local_funcs = true);
261 
263  {
264  fcn_table_iterator p = m_fcn_table.find (name);
265 
266  return (p != m_fcn_table.end ()
267  ? p->second.find_user_function () : octave_value ());
268  }
269 
271  {
272  fcn_table_iterator p = m_fcn_table.find (name);
273 
274  return (p != m_fcn_table.end ()
275  ? p->second.find_cmdline_function () : octave_value ());
276  }
277 
279  const octave_value& fcn)
280  {
281  fcn_table_iterator p = m_fcn_table.find (name);
282 
283  if (p != m_fcn_table.end ())
284  {
285  fcn_info& finfo = p->second;
286 
288  }
289  else
290  {
291  fcn_info finfo (name);
292 
294 
295  m_fcn_table[name] = finfo;
296  }
297  }
298 
299  // Install local function FCN named NAME. FILE_NAME is the name of
300  // the file containing the local function.
301 
303  const octave_value& fcn,
304  const std::string& file_name)
305  {
306  fcn_table_iterator p = m_fcn_table.find (name);
307 
308  if (p != m_fcn_table.end ())
309  {
310  fcn_info& finfo = p->second;
311 
312  finfo.install_local_function (fcn, file_name);
313  }
314  else
315  {
316  fcn_info finfo (name);
317 
318  finfo.install_local_function (fcn, file_name);
319 
320  m_fcn_table[name] = finfo;
321  }
322  }
323 
325  const octave_value& fcn)
326  {
327  fcn_table_iterator p = m_fcn_table.find (name);
328 
329  if (p != m_fcn_table.end ())
330  {
331  fcn_info& finfo = p->second;
332 
333  finfo.install_user_function (fcn);
334  }
335  else
336  {
337  fcn_info finfo (name);
338 
339  finfo.install_user_function (fcn);
340 
341  m_fcn_table[name] = finfo;
342  }
343  }
344 
345  // FIXME: should we ensure that FCN really is a built-in function
346  // object?
348  const octave_value& fcn)
349  {
350  fcn_table_iterator p = m_fcn_table.find (name);
351 
352  if (p != m_fcn_table.end ())
353  {
354  fcn_info& finfo = p->second;
355 
357  }
358  else
359  {
360  fcn_info finfo (name);
361 
363 
364  m_fcn_table[name] = finfo;
365  }
366  }
367 
368  void clear_all (bool force = false)
369  {
370  m_current_scope.clear_variables ();
371  m_global_scope.clear_variables ();
372 
373  clear_functions (force);
374  }
375 
376  void clear_global (const std::string& name);
377 
378  void clear_global_pattern (const std::string& pattern);
379 
380  // This is written as two separate functions instead of a single
381  // function with default values so that it will work properly with
382  // unwind_protect.
383 
384  void clear_functions (bool force = false)
385  {
386  fcn_table_iterator p = m_fcn_table.begin ();
387 
388  while (p != m_fcn_table.end ())
389  (p++)->second.clear (force);
390  }
391 
393  {
394  clear_user_function (name);
395  }
396 
398  {
399  // FIXME: are we supposed to do both here?
400 
401  if (m_current_scope)
402  m_current_scope.clear_variable (name);
403 
405  }
406 
408  {
409  glob_match pattern (pat);
410 
411  fcn_table_iterator p = m_fcn_table.begin ();
412 
413  while (p != m_fcn_table.end ())
414  {
415  if (pattern.match (p->first))
416  (p++)->second.clear_user_function ();
417  else
418  p++;
419  }
420  }
421 
423  {
424  // FIXME: are we supposed to do both here?
425 
426  if (m_current_scope)
427  m_current_scope.clear_variable_pattern (pat);
428 
429  clear_function_pattern (pat);
430  }
431 
433  {
434  fcn_table_iterator p = m_fcn_table.find (name);
435 
436  if (p != m_fcn_table.end ())
437  {
438  fcn_info& finfo = p->second;
439 
440  finfo.clear_user_function ();
441  }
442  // FIXME: is this necessary, or even useful?
443  // else
444  // error ("clear: no such function '%s'", name.c_str ());
445  }
446 
447  // This clears oct and mex files, including autoloads.
449  {
450  fcn_table_iterator p = m_fcn_table.find (name);
451 
452  if (p != m_fcn_table.end ())
453  {
454  fcn_info& finfo = p->second;
455 
456  finfo.clear_autoload_function ();
457  finfo.clear_user_function ();
458  }
459  }
460 
462  {
463  fcn_table_iterator p = m_fcn_table.begin ();
464 
465  while (p != m_fcn_table.end ())
466  (p++)->second.clear_mex_function ();
467  }
468 
469  bool set_class_relationship (const std::string& sup_class,
470  const std::string& inf_class);
471 
472  bool is_superiorto (const std::string& a, const std::string& b);
473 
475  const std::string& name)
476  {
477  octave_value fcn = find_built_in_function (name);
478 
479  if (fcn.is_defined ())
480  {
481  fcn_info finfo (alias);
482 
484 
485  m_fcn_table[alias] = finfo;
486  }
487  else
488  panic ("alias: '%s' is undefined", name.c_str ());
489  }
490 
492  const std::string& klass)
493  {
494  fcn_table_iterator p = m_fcn_table.find (name);
495 
496  if (p != m_fcn_table.end ())
497  {
498  fcn_info& finfo = p->second;
499 
500  finfo.install_built_in_dispatch (klass);
501  }
502  else
503  error ("install_built_in_dispatch: '%s' is undefined", name.c_str ());
504  }
505 
506  std::list<symbol_record> glob (const std::string& pattern)
507  {
508  return (m_current_scope
509  ? m_current_scope.glob (pattern) : std::list<symbol_record> ());
510  }
511 
512  std::list<symbol_record> glob_global_variables (const std::string& pattern)
513  {
514  return m_global_scope.glob (pattern);
515  }
516 
517  std::list<symbol_record>
519  {
520  return m_global_scope.regexp (pattern);
521  }
522 
523  std::list<symbol_record> glob_variables (const string_vector& patterns)
524  {
525  std::list<symbol_record> retval;
526 
527  if (! m_current_scope)
528  return retval;
529 
530  size_t len = patterns.numel ();
531 
532  for (size_t i = 0; i < len; i++)
533  {
534  std::list<symbol_record> tmp = m_current_scope.glob (patterns[i]);
535 
536  retval.insert (retval.begin (), tmp.begin (), tmp.end ());
537  }
538 
539  return retval;
540  }
541 
542  std::list<symbol_record> regexp_variables (const string_vector& patterns)
543  {
544  std::list<symbol_record> retval;
545 
546  if (! m_current_scope)
547  return retval;
548 
549  size_t len = patterns.numel ();
550 
551  for (size_t i = 0; i < len; i++)
552  {
553  std::list<symbol_record> tmp = m_current_scope.regexp (patterns[i]);
554 
555  retval.insert (retval.begin (), tmp.begin (), tmp.end ());
556  }
557 
558  return retval;
559  }
560 
561  std::list<std::string> user_function_names (void)
562  {
563  std::list<std::string> retval;
564 
565  for (const auto& nm_finfo : m_fcn_table)
566  {
567  if (nm_finfo.second.is_user_function_defined ())
568  retval.push_back (nm_finfo.first);
569  }
570 
571  if (! retval.empty ())
572  retval.sort ();
573 
574  return retval;
575  }
576 
577  std::list<std::string> global_variable_names (void)
578  {
579  return m_global_scope.variable_names ();
580  }
581 
582  std::list<std::string> top_level_variable_names (void)
583  {
584  return (m_top_scope
585  ? m_top_scope.variable_names () : std::list<std::string> ());
586  }
587 
588  std::list<std::string> variable_names (void)
589  {
590  return (m_current_scope
591  ? m_current_scope.variable_names () : std::list<std::string> ());
592  }
593 
594  std::list<std::string> built_in_function_names (void)
595  {
596  std::list<std::string> retval;
597 
598  for (const auto& nm_finfo : m_fcn_table)
599  {
600  octave_value fcn = nm_finfo.second.find_built_in_function ();
601 
602  if (fcn.is_defined ())
603  retval.push_back (nm_finfo.first);
604  }
605 
606  if (! retval.empty ())
607  retval.sort ();
608 
609  return retval;
610  }
611 
612  std::list<std::string> cmdline_function_names (void)
613  {
614  std::list<std::string> retval;
615 
616  for (const auto& nm_finfo : m_fcn_table)
617  {
618  octave_value fcn = nm_finfo.second.find_cmdline_function ();
619 
620  if (fcn.is_defined ())
621  retval.push_back (nm_finfo.first);
622  }
623 
624  if (! retval.empty ())
625  retval.sort ();
626 
627  return retval;
628  }
629 
630  octave_value dump (void) const;
631 
632  void add_to_parent_map (const std::string& classname,
633  const std::list<std::string>& parent_list)
634  {
635  m_parent_map[classname] = parent_list;
636  }
637 
638  std::list<std::string>
639  parent_classes (const std::string& dispatch_type)
640  {
641  std::list<std::string> retval;
642 
643  const_parent_map_iterator it = m_parent_map.find (dispatch_type);
644 
645  if (it != m_parent_map.end ())
646  retval = it->second;
647 
648  for (const auto& nm : retval)
649  {
650  // Search for parents of parents and append them to the list.
651 
652  // FIXME: should we worry about a circular inheritance graph?
653 
654  std::list<std::string> parents = parent_classes (nm);
655 
656  if (! parents.empty ())
657  retval.insert (retval.end (), parents.begin (), parents.end ());
658  }
659 
660  return retval;
661  }
662 
664  {
665  return m_current_scope ? m_current_scope.function () : nullptr;
666  }
667 
668  void cleanup (void);
669 
671  {
672  fcn_table_iterator p = m_fcn_table.find (name);
673  return p != m_fcn_table.end () ? &p->second : nullptr;
674  }
675 
676  private:
677 
678  typedef std::map<std::string, octave_value>::const_iterator
680  typedef std::map<std::string, octave_value>::iterator
682 
683  typedef std::map<std::string, fcn_info>::const_iterator
685  typedef std::map<std::string, fcn_info>::iterator
687 
688  // Map from function names to function info (private
689  // functions, class constructors, class methods, etc.)
690  // Note that subfunctions are defined in the scope that contains
691  // them.
692  std::map<std::string, fcn_info> m_fcn_table;
693 
694  // Map from class names to set of classes that have lower
695  // precedence.
696  std::map<std::string, std::set<std::string>> m_class_precedence_table;
697 
698  typedef std::map<std::string, std::set<std::string>>::const_iterator
700  typedef std::map<std::string, std::set<std::string>>::iterator
702 
703  // Map from class names to parent class names.
704  std::map<std::string, std::list<std::string>> m_parent_map;
705 
706  typedef std::map<std::string, std::list<std::string>>::const_iterator
708  typedef std::map<std::string, std::list<std::string>>::iterator
710 
713 
715 
716  octave_value dump_fcn_table_map (void) const;
717 
718  // This function is generated automatically by mk-builtins.pl.
719  void install_builtins (void);
720  };
721 
722  extern bool out_of_date_check (octave_value& function,
723  const std::string& dispatch_type = "",
724  bool check_relative = true);
725 
726  extern OCTINTERP_API std::string
727  get_dispatch_type (const octave_value_list& args);
728 
729  extern OCTINTERP_API std::string
731  builtin_type_t& builtin_type);
732 }
733 
734 #endif
std::list< std::string > built_in_function_names(void)
Definition: symtab.h:594
void install_built_in_dispatch(const std::string &name, const std::string &klass)
Definition: symtab.h:491
void panic(const char *fmt,...)
Definition: error.cc:944
OCTINTERP_API void clear_function(const std::string &nm)
void assign(const std::string &name, const octave_value &value=octave_value())
Definition: symtab.h:155
void set_context(symbol_record::context_id context)
Definition: symscope.h:663
symbol_record find_symbol(const std::string &name, symbol_scope &sid)
Definition: symtab.h:109
symbol_scope top_scope(void)
Definition: symtab.h:75
octave_user_function * get_curr_fcn(void)
Definition: symtab.h:663
for(octave_idx_type n=0;n< hcv.numel();n++)
Definition: graphics.cc:10831
symbol_record::context_id current_context(void) const
Definition: symtab.h:87
void mark_global(void)
Definition: symrec.h:677
octave_value varval(const std::string &name) const
Definition: symtab.h:162
std::map< std::string, std::list< std::string > >::const_iterator const_parent_map_iterator
Definition: symtab.h:707
void inherit(const symbol_scope &donor_scope)
Definition: symscope.h:679
void clear_dld_function(const std::string &name)
Definition: symtab.h:448
bool is_built_in_function_name(const std::string &name)
Definition: symtab.h:192
symbol_scope global_scope(void)
Definition: symtab.h:74
void alias_built_in_function(const std::string &alias, const std::string &name)
Definition: symtab.h:474
void install_built_in_function(const std::string &name, const octave_value &fcn)
Definition: symtab.h:347
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:4986
symbol_scope current_scope(void)
Definition: symtab.h:77
void install_built_in_function(const octave_value &f)
Definition: fcn-info.h:305
symbol_record find_symbol(const std::string &name)
Definition: symscope.h:674
void clear_user_function(bool force=false)
Definition: fcn-info.h:317
void install_user_function(const std::string &name, const octave_value &fcn)
Definition: symtab.h:324
std::list< std::string > cmdline_function_names(void)
Definition: symtab.h:612
std::map< std::string, fcn_info >::iterator fcn_table_iterator
Definition: symtab.h:686
void install_local_function(const octave_value &f, const std::string &file_name)
Definition: fcn-info.h:294
void error(const char *fmt,...)
Definition: error.cc:578
void clear_all(bool force=false)
Definition: symtab.h:368
std::list< symbol_record > regexp_variables(const string_vector &patterns)
Definition: symtab.h:542
symbol_record find_symbol(const std::string &name)
Definition: symtab.h:114
std::map< std::string, std::set< std::string > >::const_iterator class_precedence_table_const_iterator
Definition: symtab.h:699
static llvm::LLVMContext & context
Definition: jit-typeinfo.cc:79
bool at_top_level(void)
Definition: symtab.h:140
void assign(const std::string &name, const octave_value &value, bool force_add)
Definition: symtab.h:149
builtin_type_t
Definition: ov-base.h:71
std::list< symbol_record > glob_variables(const string_vector &patterns)
Definition: symtab.h:523
octave_function * fcn
Definition: ov-class.cc:1754
std::list< std::string > parent_classes(const std::string &dispatch_type)
Definition: symtab.h:639
bool is_defined(void) const
Definition: ov-fcn.h:68
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
octave_value find_autoload(const std::string &name)
Definition: symtab.h:242
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
Definition: ov.h:1374
void install_built_in_dispatch(const std::string &klass)
Definition: fcn-info.h:310
std::list< symbol_record > glob(const std::string &pattern)
Definition: symtab.h:506
void install_local_function(const std::string &name, const octave_value &fcn, const std::string &file_name)
Definition: symtab.h:302
nd deftypefn *std::string name
Definition: sysdep.cc:647
std::list< std::string > user_function_names(void)
Definition: symtab.h:561
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
Definition: utils.cc:975
void inherit(symbol_scope &recipient_scope, const symbol_scope &donor_scope)
Definition: symtab.h:129
void install_cmdline_function(const octave_value &f)
Definition: fcn-info.h:289
std::map< std::string, std::set< std::string > > m_class_precedence_table
Definition: symtab.h:696
std::map< std::string, std::list< std::string > >::iterator parent_map_iterator
Definition: symtab.h:709
std::string get_dispatch_type(const octave_value_list &args, builtin_type_t &builtin_type)
Definition: fcn-info.cc:268
void set_scope_and_context(const symbol_scope &sid, symbol_record::context_id context)
Definition: symtab.h:97
double tmp
Definition: data.cc:6252
octave::symbol_record symbol_record
Definition: symtab.h:54
octave_value retval
Definition: data.cc:6246
octave::fcn_info fcn_info
Definition: symtab.h:56
std::list< std::string > global_variable_names(void)
Definition: symtab.h:577
octave_value find_method(const std::string &name, const std::string &dispatch_type)
Definition: symtab.h:200
std::map< std::string, fcn_info >::const_iterator fcn_table_const_iterator
Definition: symtab.h:684
octave_value find_method(const std::string &dispatch_type) const
Definition: fcn-info.h:252
symbol_scope require_current_scope(const std::string &who)
Definition: symtab.h:79
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
std::map< std::string, octave_value >::iterator global_symbols_iterator
Definition: symtab.h:681
void install_user_function(const octave_value &f)
Definition: fcn-info.h:300
symbol_record find_global_symbol(const std::string &name)
Definition: symtab.h:119
octave_value find_user_function(const std::string &name)
Definition: symtab.h:262
static octave_idx_type find(octave_idx_type i, octave_idx_type *pp)
Definition: colamd.cc:103
void clear_mex_functions(void)
Definition: symtab.h:461
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, std::set< std::string > >::iterator class_precedence_table_iterator
Definition: symtab.h:701
void add_to_parent_map(const std::string &classname, const std::list< std::string > &parent_list)
Definition: symtab.h:632
octave_value global_varval(const std::string &name) const
Definition: symtab.h:174
std::map< std::string, fcn_info > m_fcn_table
Definition: symtab.h:692
octave_value top_level_varval(const std::string &name) const
Definition: symtab.h:186
octave::symbol_scope scope
Definition: symtab.h:55
p
Definition: lu.cc:138
bool out_of_date_check(octave_value &function, const std::string &dispatch_type, bool check_relative)
Definition: symtab.cc:116
void clear_functions(bool force=false)
Definition: symtab.h:384
void clear_symbol(const std::string &name)
Definition: symtab.h:397
symbol_scope m_current_scope
Definition: symtab.h:714
void inherit(symbol_scope &recipient_scope)
Definition: symtab.h:135
b
Definition: cellfun.cc:400
void clear_function_pattern(const std::string &pat)
Definition: symtab.h:407
for i
Definition: data.cc:5264
void clear_function(const std::string &name)
Definition: symtab.h:392
void set_scope(const symbol_scope &sid)
Definition: symtab.h:92
std::list< std::string > variable_names(void)
Definition: symtab.h:588
void clear_symbol_pattern(const std::string &pat)
Definition: symtab.h:422
void clear_user_function(const std::string &name)
Definition: symtab.h:432
octave_value find_built_in_function(const std::string &name)
Definition: symtab.h:233
octave_idx_type numel(void) const
Number of elements in the array.
Definition: Array.h:366
void install_cmdline_function(const std::string &name, const octave_value &fcn)
Definition: symtab.h:278
octave_value find_cmdline_function(const std::string &name)
Definition: symtab.h:270
std::list< std::string > top_level_variable_names(void)
Definition: symtab.h:582
symbol_table(void)
Definition: symtab.h:58
symbol_scope m_top_scope
Definition: symtab.h:712
void clear_autoload_function(bool force=false)
Definition: fcn-info.h:322
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
void global_assign(const std::string &name, const octave_value &value=octave_value())
Definition: symtab.h:168
nd group nd example For each display the value
Definition: sysdep.cc:866
void top_level_assign(const std::string &name, const octave_value &value=octave_value())
Definition: symtab.h:180
std::map< std::string, octave_value >::const_iterator global_symbols_const_iterator
Definition: symtab.h:679
std::list< symbol_record > regexp_global_variables(const std::string &pattern)
Definition: symtab.h:518
std::list< symbol_record > glob_global_variables(const std::string &pattern)
Definition: symtab.h:512