Mercurial > octave
annotate libinterp/corefcn/symscope.h @ 31605:e88a07dec498 stable
maint: Use macros to begin/end C++ namespaces.
* oct-conf-post-public.in.h: Define two macros (OCTAVE_BEGIN_NAMESPACE,
OCTAVE_END_NAMESPACE) that can be used to start/end a namespace.
* mk-opts.pl, build-env.h, build-env.in.cc, __betainc__.cc, __contourc__.cc,
__dsearchn__.cc, __eigs__.cc, __expint__.cc, __ftp__.cc, __gammainc__.cc,
__ichol__.cc, __ilu__.cc, __isprimelarge__.cc, __lin_interpn__.cc,
__magick_read__.cc, __pchip_deriv__.cc, __qp__.cc, amd.cc, auto-shlib.cc,
auto-shlib.h, balance.cc, base-text-renderer.cc, base-text-renderer.h,
besselj.cc, bitfcns.cc, bsxfun.cc, c-file-ptr-stream.cc, c-file-ptr-stream.h,
call-stack.cc, call-stack.h, ccolamd.cc, cellfun.cc, chol.cc, colamd.cc,
colloc.cc, conv2.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, data.h, debug.cc,
defaults.cc, defaults.h, defun-int.h, defun.cc, det.cc, dirfns.cc, display.cc,
display.h, dlmread.cc, dmperm.cc, dot.cc, dynamic-ld.cc, dynamic-ld.h, eig.cc,
ellipj.cc, environment.cc, environment.h, error.cc, error.h, errwarn.h,
event-manager.cc, event-manager.h, event-queue.cc, event-queue.h, fcn-info.cc,
fcn-info.h, fft.cc, fft2.cc, fftn.cc, file-io.cc, filter.cc, find.cc,
ft-text-renderer.cc, ft-text-renderer.h, gcd.cc, getgrent.cc, getpwent.cc,
getrusage.cc, givens.cc, gl-render.cc, gl-render.h, gl2ps-print.cc,
gl2ps-print.h, graphics-toolkit.cc, graphics-toolkit.h, graphics.cc,
graphics.in.h, gsvd.cc, gtk-manager.cc, gtk-manager.h, hash.cc, help.cc,
help.h, hess.cc, hex2num.cc, hook-fcn.cc, hook-fcn.h, input.cc, input.h,
interpreter-private.cc, interpreter-private.h, interpreter.cc, interpreter.h,
inv.cc, jsondecode.cc, jsonencode.cc, kron.cc, latex-text-renderer.cc,
latex-text-renderer.h, load-path.cc, load-path.h, load-save.cc, load-save.h,
lookup.cc, ls-ascii-helper.cc, ls-ascii-helper.h, ls-oct-text.cc, ls-utils.cc,
ls-utils.h, lsode.cc, lu.cc, mappers.cc, matrix_type.cc, max.cc, mex-private.h,
mex.cc, mgorth.cc, nproc.cc, oct-fstrm.cc, oct-fstrm.h, oct-hdf5-types.cc,
oct-hdf5-types.h, oct-hist.cc, oct-hist.h, oct-iostrm.cc, oct-iostrm.h,
oct-opengl.h, oct-prcstrm.cc, oct-prcstrm.h, oct-procbuf.cc, oct-procbuf.h,
oct-process.cc, oct-process.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h,
oct-strstrm.cc, oct-strstrm.h, oct-tex-lexer.in.ll, oct-tex-parser.yy,
ordqz.cc, ordschur.cc, pager.cc, pager.h, pinv.cc, pow2.cc, pr-flt-fmt.cc,
pr-output.cc, procstream.cc, procstream.h, psi.cc, qr.cc, quad.cc, quadcc.cc,
qz.cc, rand.cc, rcond.cc, regexp.cc, schur.cc, settings.cc, settings.h,
sighandlers.cc, sighandlers.h, sparse-xdiv.cc, sparse-xdiv.h, sparse-xpow.cc,
sparse-xpow.h, sparse.cc, spparms.cc, sqrtm.cc, stack-frame.cc, stack-frame.h,
stream-euler.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc, sylvester.cc,
symbfact.cc, syminfo.cc, syminfo.h, symrcm.cc, symrec.cc, symrec.h,
symscope.cc, symscope.h, symtab.cc, symtab.h, syscalls.cc, sysdep.cc, sysdep.h,
text-engine.cc, text-engine.h, text-renderer.cc, text-renderer.h, time.cc,
toplev.cc, tril.cc, tsearch.cc, typecast.cc, url-handle-manager.cc,
url-handle-manager.h, urlwrite.cc, utils.cc, utils.h, variables.cc,
variables.h, xdiv.cc, xdiv.h, xnorm.cc, xnorm.h, xpow.cc, xpow.h,
__delaunayn__.cc, __fltk_uigetfile__.cc, __glpk__.cc, __init_fltk__.cc,
__init_gnuplot__.cc, __ode15__.cc, __voronoi__.cc, audiodevinfo.cc,
audioread.cc, convhulln.cc, fftw.cc, gzip.cc, mk-build-env-features.sh,
mk-builtins.pl, cdef-class.cc, cdef-class.h, cdef-fwd.h, cdef-manager.cc,
cdef-manager.h, cdef-method.cc, cdef-method.h, cdef-object.cc, cdef-object.h,
cdef-package.cc, cdef-package.h, cdef-property.cc, cdef-property.h,
cdef-utils.cc, cdef-utils.h, ov-base.cc, ov-base.h, ov-bool-mat.cc,
ov-builtin.h, ov-cell.cc, ov-class.cc, ov-class.h, ov-classdef.cc,
ov-classdef.h, ov-complex.cc, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn.h,
ov-java.cc, ov-java.h, ov-mex-fcn.h, ov-null-mat.cc, ov-oncleanup.cc,
ov-struct.cc, ov-typeinfo.cc, ov-typeinfo.h, ov-usr-fcn.cc, ov-usr-fcn.h,
ov.cc, ov.h, octave.cc, octave.h, mk-ops.sh, op-b-b.cc, op-b-bm.cc,
op-b-sbm.cc, op-bm-b.cc, op-bm-bm.cc, op-bm-sbm.cc, op-cdm-cdm.cc, op-cell.cc,
op-chm.cc, op-class.cc, op-cm-cm.cc, op-cm-cs.cc, op-cm-m.cc, op-cm-s.cc,
op-cm-scm.cc, op-cm-sm.cc, op-cs-cm.cc, op-cs-cs.cc, op-cs-m.cc, op-cs-s.cc,
op-cs-scm.cc, op-cs-sm.cc, op-dm-dm.cc, op-dm-scm.cc, op-dm-sm.cc,
op-dm-template.cc, op-dms-template.cc, op-fcdm-fcdm.cc, op-fcm-fcm.cc,
op-fcm-fcs.cc, op-fcm-fm.cc, op-fcm-fs.cc, op-fcn.cc, op-fcs-fcm.cc,
op-fcs-fcs.cc, op-fcs-fm.cc, op-fcs-fs.cc, op-fdm-fdm.cc, op-fm-fcm.cc,
op-fm-fcs.cc, op-fm-fm.cc, op-fm-fs.cc, op-fs-fcm.cc, op-fs-fcs.cc,
op-fs-fm.cc, op-fs-fs.cc, op-i16-i16.cc, op-i32-i32.cc, op-i64-i64.cc,
op-i8-i8.cc, op-int-concat.cc, op-m-cm.cc, op-m-cs.cc, op-m-m.cc, op-m-s.cc,
op-m-scm.cc, op-m-sm.cc, op-mi.cc, op-pm-pm.cc, op-pm-scm.cc, op-pm-sm.cc,
op-pm-template.cc, op-range.cc, op-s-cm.cc, op-s-cs.cc, op-s-m.cc, op-s-s.cc,
op-s-scm.cc, op-s-sm.cc, op-sbm-b.cc, op-sbm-bm.cc, op-sbm-sbm.cc,
op-scm-cm.cc, op-scm-cs.cc, op-scm-m.cc, op-scm-s.cc, op-scm-scm.cc,
op-scm-sm.cc, op-sm-cm.cc, op-sm-cs.cc, op-sm-m.cc, op-sm-s.cc, op-sm-scm.cc,
op-sm-sm.cc, op-str-m.cc, op-str-s.cc, op-str-str.cc, op-struct.cc,
op-ui16-ui16.cc, op-ui32-ui32.cc, op-ui64-ui64.cc, op-ui8-ui8.cc, ops.h,
anon-fcn-validator.cc, anon-fcn-validator.h, bp-table.cc, bp-table.h,
comment-list.cc, comment-list.h, filepos.h, lex.h, lex.ll, oct-lvalue.cc,
oct-lvalue.h, oct-parse.yy, parse.h, profiler.cc, profiler.h,
pt-anon-scopes.cc, pt-anon-scopes.h, pt-arg-list.cc, pt-arg-list.h,
pt-args-block.cc, pt-args-block.h, pt-array-list.cc, pt-array-list.h,
pt-assign.cc, pt-assign.h, pt-binop.cc, pt-binop.h, pt-bp.cc, pt-bp.h,
pt-cbinop.cc, pt-cbinop.h, pt-cell.cc, pt-cell.h, pt-check.cc, pt-check.h,
pt-classdef.cc, pt-classdef.h, pt-cmd.h, pt-colon.cc, pt-colon.h, pt-const.cc,
pt-const.h, pt-decl.cc, pt-decl.h, pt-eval.cc, pt-eval.h, pt-except.cc,
pt-except.h, pt-exp.cc, pt-exp.h, pt-fcn-handle.cc, pt-fcn-handle.h, pt-id.cc,
pt-id.h, pt-idx.cc, pt-idx.h, pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.cc,
pt-mat.h, pt-misc.cc, pt-misc.h, pt-pr-code.cc, pt-pr-code.h, pt-select.cc,
pt-select.h, pt-spmd.cc, pt-spmd.h, pt-stmt.cc, pt-stmt.h, pt-tm-const.cc,
pt-tm-const.h, pt-unop.cc, pt-unop.h, pt-vm-eval.cc, pt-walk.cc, pt-walk.h,
pt.cc, pt.h, token.cc, token.h, Range.cc, Range.h, idx-vector.cc, idx-vector.h,
range-fwd.h, CollocWt.cc, CollocWt.h, aepbalance.cc, aepbalance.h, chol.cc,
chol.h, gepbalance.cc, gepbalance.h, gsvd.cc, gsvd.h, hess.cc, hess.h,
lo-mappers.cc, lo-mappers.h, lo-specfun.cc, lo-specfun.h, lu.cc, lu.h,
oct-convn.cc, oct-convn.h, oct-fftw.cc, oct-fftw.h, oct-norm.cc, oct-norm.h,
oct-rand.cc, oct-rand.h, oct-spparms.cc, oct-spparms.h, qr.cc, qr.h, qrp.cc,
qrp.h, randgamma.cc, randgamma.h, randmtzig.cc, randmtzig.h, randpoisson.cc,
randpoisson.h, schur.cc, schur.h, sparse-chol.cc, sparse-chol.h, sparse-lu.cc,
sparse-lu.h, sparse-qr.cc, sparse-qr.h, svd.cc, svd.h, child-list.cc,
child-list.h, dir-ops.cc, dir-ops.h, file-ops.cc, file-ops.h, file-stat.cc,
file-stat.h, lo-sysdep.cc, lo-sysdep.h, lo-sysinfo.cc, lo-sysinfo.h,
mach-info.cc, mach-info.h, oct-env.cc, oct-env.h, oct-group.cc, oct-group.h,
oct-password.cc, oct-password.h, oct-syscalls.cc, oct-syscalls.h, oct-time.cc,
oct-time.h, oct-uname.cc, oct-uname.h, action-container.cc, action-container.h,
base-list.h, cmd-edit.cc, cmd-edit.h, cmd-hist.cc, cmd-hist.h, f77-fcn.h,
file-info.cc, file-info.h, lo-array-errwarn.cc, lo-array-errwarn.h, lo-hash.cc,
lo-hash.h, lo-ieee.h, lo-regexp.cc, lo-regexp.h, lo-utils.cc, lo-utils.h,
oct-base64.cc, oct-base64.h, oct-glob.cc, oct-glob.h, oct-inttypes.h,
oct-mutex.cc, oct-mutex.h, oct-refcount.h, oct-shlib.cc, oct-shlib.h,
oct-sparse.cc, oct-sparse.h, oct-string.h, octave-preserve-stream-state.h,
pathsearch.cc, pathsearch.h, quit.cc, quit.h, unwind-prot.cc, unwind-prot.h,
url-transfer.cc, url-transfer.h : Use new macros to begin/end C++ namespaces.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 01 Dec 2022 14:23:45 -0800 |
parents | 796f54d4ddbf |
children | aac27ad79be6 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30390
diff
changeset
|
3 // Copyright (C) 1993-2022 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
24269
f494b87d2a93
rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents:
24263
diff
changeset
|
26 #if ! defined (octave_symscope_h) |
f494b87d2a93
rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents:
24263
diff
changeset
|
27 #define octave_symscope_h 1 |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 #include "octave-config.h" |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 #include <deque> |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 #include <list> |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 #include <map> |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
34 #include <memory> |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 #include <set> |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 #include <string> |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 #include "glob-match.h" |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 #include "lo-regexp.h" |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 #include "oct-refcount.h" |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
42 class tree_argument_list; |
28026
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
43 class octave_user_code; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
44 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
45 #include "ov.h" |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
46 #include "ovl.h" |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 #include "symrec.h" |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 |
31605
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
49 OCTAVE_BEGIN_NAMESPACE(octave) |
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
50 |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
51 class symbol_scope; |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
52 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
53 class symbol_scope_rep |
24706
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
54 : public std::enable_shared_from_this<symbol_scope_rep> |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
55 { |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 public: |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 typedef std::map<std::string, symbol_record>::const_iterator |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30108
diff
changeset
|
59 table_const_iterator; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 typedef std::map<std::string, symbol_record>::iterator |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30108
diff
changeset
|
61 table_iterator; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
62 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
63 typedef std::map<std::string, octave_value>::const_iterator |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30108
diff
changeset
|
64 subfunctions_const_iterator; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 typedef std::map<std::string, octave_value>::iterator |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30108
diff
changeset
|
66 subfunctions_iterator; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
68 symbol_scope_rep (const std::string& name = "") |
30108
3efce22b7350
eliminate duplicate parent function name info in symbol scope objects
John W. Eaton <jwe@octave.org>
parents:
30104
diff
changeset
|
69 : m_name (name), m_symbols (), m_subfunctions (), |
3efce22b7350
eliminate duplicate parent function name info in symbol scope objects
John W. Eaton <jwe@octave.org>
parents:
30104
diff
changeset
|
70 m_persistent_values (), m_code (nullptr), m_fcn_name (), |
3efce22b7350
eliminate duplicate parent function name info in symbol scope objects
John W. Eaton <jwe@octave.org>
parents:
30104
diff
changeset
|
71 m_fcn_file_name (), m_dir_name (), m_parent (), |
3efce22b7350
eliminate duplicate parent function name info in symbol scope objects
John W. Eaton <jwe@octave.org>
parents:
30104
diff
changeset
|
72 m_primary_parent (), m_children (), m_nesting_depth (0), |
3efce22b7350
eliminate duplicate parent function name info in symbol scope objects
John W. Eaton <jwe@octave.org>
parents:
30104
diff
changeset
|
73 m_is_static (false), m_is_primary_fcn_scope (false) |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
74 { |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
75 // All scopes have ans as the first symbol, initially undefined. |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
76 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
77 insert_local ("ans"); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
78 } |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
79 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
80 // No copying! |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
81 |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
82 symbol_scope_rep (const symbol_scope&) = delete; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
83 |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
84 symbol_scope_rep& operator = (const symbol_scope&) = delete; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
85 |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
86 ~symbol_scope_rep (void) = default; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
87 |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
88 std::size_t num_symbols (void) const { return m_symbols.size (); } |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
89 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
90 // Simply inserts symbol. No non-local searching. |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
91 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
92 symbol_record insert_local (const std::string& name); |
26040
0af4653e48a4
install auto function vars in symbol scope when parsing function
John W. Eaton <jwe@octave.org>
parents:
25438
diff
changeset
|
93 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
94 void insert_symbol_record (symbol_record& sr); |
26040
0af4653e48a4
install auto function vars in symbol scope when parsing function
John W. Eaton <jwe@octave.org>
parents:
25438
diff
changeset
|
95 |
26060
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
96 bool is_nested (void) const { return m_nesting_depth > 0; } |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
97 |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
98 std::size_t nesting_depth (void) const { return m_nesting_depth; } |
26060
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
99 |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
100 void set_nesting_depth (std::size_t depth) { m_nesting_depth = depth; } |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
101 |
26825
6e9034836239
allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents:
26661
diff
changeset
|
102 bool is_parent (void) const { return ! m_children.empty (); } |
6e9034836239
allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents:
26661
diff
changeset
|
103 |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
104 bool is_static (void) const { return m_is_static; } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
105 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
106 void mark_static (void) { m_is_static = true; } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
107 |
24706
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
108 std::shared_ptr<symbol_scope_rep> parent_scope_rep (void) const |
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
109 { |
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
110 return m_parent.lock (); |
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
111 } |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
112 |
26060
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
113 std::shared_ptr<symbol_scope_rep> primary_parent_scope_rep (void) const |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
114 { |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
115 return m_primary_parent.lock (); |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
116 } |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
117 |
24706
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
118 std::shared_ptr<symbol_scope_rep> dup (void) const |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
119 { |
24706
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
120 std::shared_ptr<symbol_scope_rep> new_sid |
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
121 = std::shared_ptr<symbol_scope_rep> (new symbol_scope_rep (m_name)); |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
122 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
123 for (const auto& nm_sr : m_symbols) |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
124 new_sid->m_symbols[nm_sr.first] = nm_sr.second.dup (); |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
125 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
126 new_sid->m_subfunctions = m_subfunctions; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
127 new_sid->m_persistent_values = m_persistent_values; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
128 new_sid->m_subfunction_names = m_subfunction_names; |
27745
7a45100a40c4
allow private scripts to be called from other private scripts
John W. Eaton <jwe@octave.org>
parents:
26940
diff
changeset
|
129 new_sid->m_code = m_code; |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
130 new_sid->m_fcn_name = m_fcn_name; |
28026
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
131 new_sid->m_fcn_file_name = m_fcn_file_name; |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
132 new_sid->m_dir_name = m_dir_name; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
133 new_sid->m_parent = m_parent; |
26060
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
134 new_sid->m_primary_parent = m_primary_parent; |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
135 new_sid->m_children = m_children; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
136 new_sid->m_nesting_depth = m_nesting_depth; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
137 new_sid->m_is_static = m_is_static; |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
138 new_sid->m_is_primary_fcn_scope = m_is_primary_fcn_scope; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
139 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
140 return new_sid; |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
141 } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
142 |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
143 octave_value& persistent_varref (std::size_t data_offset) |
24362
3fc24b792a24
avoid including symtab.h, symscope.h, or symrec.h unnecessarily
John W. Eaton <jwe@octave.org>
parents:
24361
diff
changeset
|
144 { |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
145 return m_persistent_values[data_offset]; |
24362
3fc24b792a24
avoid including symtab.h, symscope.h, or symrec.h unnecessarily
John W. Eaton <jwe@octave.org>
parents:
24361
diff
changeset
|
146 } |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
147 |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
148 octave_value persistent_varval (std::size_t data_offset) const |
24362
3fc24b792a24
avoid including symtab.h, symscope.h, or symrec.h unnecessarily
John W. Eaton <jwe@octave.org>
parents:
24361
diff
changeset
|
149 { |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
150 auto p = m_persistent_values.find (data_offset); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
151 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
152 return p == m_persistent_values.end () ? octave_value () : p->second; |
24362
3fc24b792a24
avoid including symtab.h, symscope.h, or symrec.h unnecessarily
John W. Eaton <jwe@octave.org>
parents:
24361
diff
changeset
|
153 } |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
154 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
155 symbol_record find_symbol (const std::string& name) |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
156 { |
25337
3ff9192b676e
use auto keyword to declare iterator variables where possible
John W. Eaton <jwe@octave.org>
parents:
25203
diff
changeset
|
157 auto p = m_symbols.find (name); |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
158 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
159 if (p == m_symbols.end ()) |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
160 return insert (name); |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
161 else |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
162 return p->second; |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
163 } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
164 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
165 symbol_record lookup_symbol (const std::string& name) const |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
166 { |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
167 auto p = m_symbols.find (name); |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
168 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
169 return p == m_symbols.end () ? symbol_record () : p->second; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
170 } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
171 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
172 symbol_record insert (const std::string& name); |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
173 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
174 void rename (const std::string& old_name, const std::string& new_name) |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
175 { |
25337
3ff9192b676e
use auto keyword to declare iterator variables where possible
John W. Eaton <jwe@octave.org>
parents:
25203
diff
changeset
|
176 auto p = m_symbols.find (old_name); |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
177 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
178 if (p != m_symbols.end ()) |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
179 { |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
180 symbol_record sr = p->second; |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
181 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
182 sr.rename (new_name); |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
183 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
184 m_symbols.erase (p); |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
185 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
186 m_symbols[new_name] = sr; |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
187 } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
188 } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
189 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
190 void install_subfunction (const std::string& name, |
24705
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
191 const octave_value& fval) |
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
192 { |
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
193 m_subfunctions[name] = fval; |
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
194 } |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
195 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
196 void install_nestfunction (const std::string& name, |
24705
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
197 const octave_value& fval, |
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
198 const symbol_scope& fcn_scope) |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
199 { |
24705
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
200 m_subfunctions[name] = fval; |
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
201 |
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
202 m_children.push_back (fcn_scope); |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
203 } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
204 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
205 octave_value find_subfunction (const std::string& name) const; |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
206 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
207 void lock_subfunctions (void) |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
208 { |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
209 for (auto& nm_sf : m_subfunctions) |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
210 nm_sf.second.lock (); |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
211 } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
212 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
213 void unlock_subfunctions (void) |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
214 { |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
215 for (auto& nm_sf : m_subfunctions) |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
216 nm_sf.second.unlock (); |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
217 } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
218 |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
219 // Pairs of name, function objects. |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
220 std::map<std::string, octave_value> subfunctions (void) const |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
221 { |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
222 return m_subfunctions; |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
223 } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
224 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
225 void erase_subfunctions (void) |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
226 { |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
227 m_subfunctions.clear (); |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
228 } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
229 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
230 void mark_subfunctions_in_scope_as_private (const std::string& class_name); |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
231 |
24285
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
232 bool has_subfunctions (void) const |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
233 { |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
234 return ! m_subfunction_names.empty (); |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
235 } |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
236 |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
237 void stash_subfunction_names (const std::list<std::string>& names) |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
238 { |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
239 m_subfunction_names = names; |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
240 } |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
241 |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
242 std::list<std::string> subfunction_names (void) const |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
243 { |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
244 return m_subfunction_names; |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
245 } |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
246 |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
247 std::list<octave_value> localfunctions (void) const; |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
248 |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
249 octave_value dump (void) const; |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
250 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
251 std::string name (void) const { return m_name; } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
252 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
253 void cache_name (const std::string& name) { m_name = name; } |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
254 |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
255 std::string fcn_name (void) const { return m_fcn_name; } |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
256 |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
257 void cache_fcn_name (const std::string& name) { m_fcn_name = name; } |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
258 |
30108
3efce22b7350
eliminate duplicate parent function name info in symbol scope objects
John W. Eaton <jwe@octave.org>
parents:
30104
diff
changeset
|
259 std::list<std::string> parent_fcn_names (void) const; |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
260 |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30108
diff
changeset
|
261 octave_user_code * user_code (void) const { return m_code; } |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
262 |
27745
7a45100a40c4
allow private scripts to be called from other private scripts
John W. Eaton <jwe@octave.org>
parents:
26940
diff
changeset
|
263 void set_user_code (octave_user_code *code) { m_code = code; } |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
264 |
24706
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
265 void set_parent (const std::shared_ptr<symbol_scope_rep>& parent); |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
266 |
26060
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
267 void set_primary_parent (const std::shared_ptr<symbol_scope_rep>& parent); |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
268 |
28026
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
269 void cache_fcn_file_name (const std::string& name) |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
270 { |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
271 m_fcn_file_name = name; |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
272 } |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
273 |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
274 std::string fcn_file_name (void) const { return m_fcn_file_name; } |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
275 |
28026
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
276 void cache_dir_name (const std::string& name); |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
277 |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
278 std::string dir_name (void) const { return m_dir_name; } |
28026
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
279 |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
280 void mark_primary_fcn_scope (void) { m_is_primary_fcn_scope = true; } |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
281 |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
282 bool is_primary_fcn_scope (void) const { return m_is_primary_fcn_scope; } |
28026
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
283 |
26060
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
284 bool is_relative (const std::shared_ptr<symbol_scope_rep>& scope) const; |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
285 |
29864
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
286 void mark_as_variable (const std::string& nm); |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
287 void mark_as_variables (const std::list<std::string>& lst); |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
288 |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
289 bool is_variable (const std::string& nm) const; |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
290 |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
291 void update_nest (void); |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
292 |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
293 bool look_nonlocal (const std::string& name, std::size_t offset, |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
294 symbol_record& result); |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
295 |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
296 octave_value dump_symbols_map (void) const; |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
297 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
298 const std::map<std::string, symbol_record>& symbols (void) const |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
299 { |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
300 return m_symbols; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
301 } |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
302 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
303 std::map<std::string, symbol_record>& symbols (void) |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
304 { |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
305 return m_symbols; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
306 } |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
307 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
308 std::list<symbol_record> symbol_list (void) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
309 |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
310 private: |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
311 |
24940
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
312 //! Name for this scope (usually the corresponding filename of the |
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
313 //! function corresponding to the scope). |
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
314 |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
315 std::string m_name; |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
316 |
24940
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
317 //! Map from symbol names to symbol info. |
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
318 |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
319 std::map<std::string, symbol_record> m_symbols; |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
320 |
24940
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
321 //! Map from symbol names to subfunctions. |
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
322 |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
323 std::map<std::string, octave_value> m_subfunctions; |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
324 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
325 //! Map from data offset to persistent values in this scope. |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
326 std::map<std::size_t, octave_value> m_persistent_values; |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
327 |
24940
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
328 //! The list of subfunctions (if any) in the order they appear in |
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
329 //! the function file. |
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
330 |
24285
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
331 std::list<std::string> m_subfunction_names; |
d22d2936f580
store subfunction names in scope instead of function object
John W. Eaton <jwe@octave.org>
parents:
24272
diff
changeset
|
332 |
24940
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
333 //! The associated user code (may be null). |
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
334 |
27745
7a45100a40c4
allow private scripts to be called from other private scripts
John W. Eaton <jwe@octave.org>
parents:
26940
diff
changeset
|
335 octave_user_code *m_code; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
336 |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
337 //! Simple name of the function corresponding to this scope. |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
338 |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
339 std::string m_fcn_name; |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
340 |
28026
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
341 //! The file name associated with m_code. |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
342 |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
343 std::string m_fcn_file_name; |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
344 |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
345 //! The directory associated with m_code. |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
346 |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
347 std::string m_dir_name; |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
348 |
24940
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
349 //! Parent of nested function (may be null). |
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
350 |
24706
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
351 std::weak_ptr<symbol_scope_rep> m_parent; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
352 |
26060
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
353 //! Primary (top) parent of nested function (may be null). Used |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
354 //! to determine whether two nested functions are related. |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
355 |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
356 std::weak_ptr<symbol_scope_rep> m_primary_parent; |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
357 |
24940
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
358 //! Child nested functions. |
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
359 |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
360 std::vector<symbol_scope> m_children; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
361 |
24940
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
362 //! If true, then this scope belongs to a nested function. |
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
363 |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
364 std::size_t m_nesting_depth; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
365 |
24940
7edf1fb1d4b2
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24706
diff
changeset
|
366 //! If true then no variables can be added. |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
367 |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
368 bool m_is_static; |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
369 |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
370 //! If true, this is the scope of a primary function. |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
371 bool m_is_primary_fcn_scope; |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
372 }; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
373 |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
374 class symbol_scope |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
375 { |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
376 public: |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
377 |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
378 // Create a valid but possibly unnamed scope. |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
379 symbol_scope (const std::string& name) |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
380 : m_rep (new symbol_scope_rep (name)) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
381 { } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
382 |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
383 // NEW_REP must be dynamically allocated or nullptr. If it is |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
384 // nullptr, the scope is invalid. |
24706
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
385 symbol_scope (const std::shared_ptr<symbol_scope_rep> new_rep = nullptr) |
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
386 : m_rep (new_rep) |
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
387 { } |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
388 |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
389 symbol_scope (const symbol_scope&) = default; |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
390 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
391 symbol_scope& operator = (const symbol_scope&) = default; |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
392 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
393 ~symbol_scope (void) = default; |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
394 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
395 bool is_valid (void) const { return bool (m_rep); } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
396 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
397 explicit operator bool () const { return bool (m_rep); } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
398 |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
399 std::size_t num_symbols (void) const |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
400 { |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
401 return m_rep ? m_rep->num_symbols () : 0; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
402 } |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
403 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
404 symbol_record insert_local (const std::string& name) |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
405 { |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
406 return m_rep ? m_rep->insert_local (name) : symbol_record (); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
407 } |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
408 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
409 void insert_symbol_record (symbol_record& sr) |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
410 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
411 if (m_rep) |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
412 m_rep->insert_symbol_record (sr); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
413 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
414 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
415 bool is_nested (void) const |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
416 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
417 return m_rep ? m_rep->is_nested () : false; |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
418 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
419 |
26825
6e9034836239
allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents:
26661
diff
changeset
|
420 bool is_parent (void) const |
6e9034836239
allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents:
26661
diff
changeset
|
421 { |
6e9034836239
allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents:
26661
diff
changeset
|
422 return m_rep ? m_rep->is_parent () : false; |
6e9034836239
allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents:
26661
diff
changeset
|
423 } |
6e9034836239
allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents:
26661
diff
changeset
|
424 |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
425 void set_nesting_depth (std::size_t depth) |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
426 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
427 if (m_rep) |
26060
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
428 m_rep->set_nesting_depth (depth); |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
429 } |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
430 |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
431 std::size_t nesting_depth (void) const |
26060
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
432 { |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
433 return m_rep ? m_rep->nesting_depth () : 0; |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
434 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
435 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
436 bool is_static (void) const |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
437 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
438 return m_rep ? m_rep->is_static () : false; |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
439 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
440 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
441 void mark_static (void) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
442 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
443 if (m_rep) |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
444 m_rep->mark_static (); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
445 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
446 |
24706
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
447 std::shared_ptr<symbol_scope_rep> parent_scope (void) const |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
448 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
449 return m_rep ? m_rep->parent_scope_rep () : nullptr; |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
450 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
451 |
26060
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
452 std::shared_ptr<symbol_scope_rep> primary_parent_scope (void) const |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
453 { |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
454 return m_rep ? m_rep->primary_parent_scope_rep () : nullptr; |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
455 } |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
456 |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
457 symbol_scope dup (void) const |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
458 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
459 return symbol_scope (m_rep ? m_rep->dup () : nullptr); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
460 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
461 |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
462 octave_value& persistent_varref (std::size_t data_offset) |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
463 { |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
464 static octave_value dummy_value; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
465 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
466 return m_rep ? m_rep->persistent_varref (data_offset) : dummy_value; |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
467 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
468 |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
469 octave_value persistent_varval (std::size_t data_offset) const |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
470 { |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
471 return m_rep ? m_rep->persistent_varval (data_offset) : octave_value (); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
472 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
473 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
474 symbol_record find_symbol (const std::string& name) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
475 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
476 return m_rep ? m_rep->find_symbol (name) : symbol_record (); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
477 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
478 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
479 // Like find_symbol, but does not insert. |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
480 symbol_record lookup_symbol (const std::string& name) const |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
481 { |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
482 return m_rep ? m_rep->lookup_symbol (name) : symbol_record (); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
483 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
484 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
485 symbol_record insert (const std::string& name) |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
486 { |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
487 return m_rep ? m_rep->insert (name) : symbol_record (); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
488 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
489 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
490 void rename (const std::string& old_name, const std::string& new_name) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
491 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
492 if (m_rep) |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
493 m_rep->rename (old_name, new_name); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
494 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
495 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
496 void install_subfunction (const std::string& name, |
24705
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
497 const octave_value& fval) |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
498 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
499 if (m_rep) |
24705
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
500 m_rep->install_subfunction (name, fval); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
501 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
502 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
503 void install_nestfunction (const std::string& name, |
24705
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
504 const octave_value& fval, |
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
505 const symbol_scope& fcn_scope) |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
506 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
507 if (m_rep) |
24705
8b346a19108e
mark objects as nested or subfunctions when parsing
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
508 m_rep->install_nestfunction (name, fval, fcn_scope); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
509 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
510 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
511 octave_value find_subfunction (const std::string& name) const |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
512 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
513 return m_rep ? m_rep->find_subfunction (name) : octave_value (); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
514 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
515 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
516 void lock_subfunctions (void) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
517 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
518 if (m_rep) |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
519 m_rep->lock_subfunctions (); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
520 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
521 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
522 void unlock_subfunctions (void) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
523 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
524 if (m_rep) |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
525 m_rep->unlock_subfunctions (); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
526 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
527 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
528 std::map<std::string, octave_value> subfunctions (void) const |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
529 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
530 return (m_rep |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
531 ? m_rep->subfunctions () |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
532 : std::map<std::string, octave_value> ()); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
533 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
534 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
535 void erase_subfunctions (void) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
536 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
537 if (m_rep) |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
538 m_rep->erase_subfunctions (); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
539 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
540 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
541 void mark_subfunctions_in_scope_as_private (const std::string& class_name) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
542 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
543 if (m_rep) |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
544 m_rep->mark_subfunctions_in_scope_as_private (class_name); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
545 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
546 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
547 bool has_subfunctions (void) const |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
548 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
549 return m_rep ? m_rep->has_subfunctions () : false; |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
550 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
551 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
552 void stash_subfunction_names (const std::list<std::string>& names) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
553 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
554 if (m_rep) |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
555 m_rep->stash_subfunction_names (names); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
556 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
557 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
558 std::list<std::string> subfunction_names (void) const |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
559 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
560 return m_rep ? m_rep->subfunction_names () : std::list<std::string> (); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
561 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
562 |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
563 // List of function handle objects. |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
564 std::list<octave_value> localfunctions (void) const; |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
565 |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
566 octave_value dump (void) const |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
567 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
568 return m_rep ? m_rep->dump () : octave_value (); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
569 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
570 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
571 std::string name (void) const |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
572 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
573 return m_rep ? m_rep->name () : ""; |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
574 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
575 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
576 void cache_name (const std::string& name) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
577 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
578 if (m_rep) |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
579 m_rep->cache_name (name); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
580 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
581 |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
582 std::string fcn_name (void) const |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
583 { |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
584 return m_rep ? m_rep->fcn_name () : ""; |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
585 } |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
586 |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
587 void cache_fcn_name (const std::string& name) |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
588 { |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
589 if (m_rep) |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
590 m_rep->cache_fcn_name (name); |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
591 } |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
592 |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
593 std::list<std::string> parent_fcn_names (void) const |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
594 { |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
595 return m_rep ? m_rep->parent_fcn_names () : std::list<std::string> (); |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
596 } |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
597 |
27745
7a45100a40c4
allow private scripts to be called from other private scripts
John W. Eaton <jwe@octave.org>
parents:
26940
diff
changeset
|
598 octave_user_code * user_code (void) const |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
599 { |
27745
7a45100a40c4
allow private scripts to be called from other private scripts
John W. Eaton <jwe@octave.org>
parents:
26940
diff
changeset
|
600 return m_rep ? m_rep->user_code () : nullptr; |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
601 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
602 |
27745
7a45100a40c4
allow private scripts to be called from other private scripts
John W. Eaton <jwe@octave.org>
parents:
26940
diff
changeset
|
603 void set_user_code (octave_user_code *code) |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
604 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
605 if (m_rep) |
27745
7a45100a40c4
allow private scripts to be called from other private scripts
John W. Eaton <jwe@octave.org>
parents:
26940
diff
changeset
|
606 m_rep->set_user_code (code); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
607 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
608 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
609 void set_parent (const symbol_scope& p) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
610 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
611 if (m_rep) |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
612 m_rep->set_parent (p.get_rep ()); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
613 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
614 |
26060
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
615 void set_primary_parent (const symbol_scope& p) |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
616 { |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
617 if (m_rep) |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
618 m_rep->set_primary_parent (p.get_rep ()); |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
619 } |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
620 |
28026
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
621 void cache_fcn_file_name (const std::string& name) |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
622 { |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
623 if (m_rep) |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
624 m_rep->cache_fcn_file_name (name); |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
625 } |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
626 |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
627 void cache_dir_name (const std::string& name) |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
628 { |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
629 if (m_rep) |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
630 m_rep->cache_dir_name (name); |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
631 } |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
632 |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
633 std::string fcn_file_name (void) const |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
634 { |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
635 return m_rep ? m_rep->fcn_file_name () : ""; |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
636 } |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
637 |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
638 std::string dir_name (void) const |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
639 { |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
640 return m_rep ? m_rep->dir_name () : ""; |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
641 } |
262cdfc6faf9
allow reloading of handles to private functions (bug #57439)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
642 |
28432
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
643 void mark_primary_fcn_scope (void) |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
644 { |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
645 if (m_rep) |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
646 m_rep->mark_primary_fcn_scope (); |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
647 } |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
648 |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
649 bool is_primary_fcn_scope (void) const |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
650 { |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
651 return m_rep ? m_rep->is_primary_fcn_scope () : false; |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
652 } |
71c34141cc2d
refactor handling of parent functions and localfunctions
John W. Eaton <jwe@octave.org>
parents:
28026
diff
changeset
|
653 |
26060
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
654 bool is_relative (const symbol_scope& scope) const |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
655 { |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
656 return m_rep ? m_rep->is_relative (scope.get_rep ()) : false; |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
657 } |
edcb09d4b1f5
store nesting depth and primary parent info in nested function scopes
John W. Eaton <jwe@octave.org>
parents:
26040
diff
changeset
|
658 |
29864
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
659 void mark_as_variable (const std::string& nm) |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
660 { |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
661 if (m_rep) |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
662 m_rep->mark_as_variable (nm); |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
663 } |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
664 |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
665 void mark_as_variables (const std::list<std::string>& lst) |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
666 { |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
667 if (m_rep) |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
668 m_rep->mark_as_variables (lst); |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
669 } |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
670 |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
671 bool is_variable (const std::string& nm) const |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
672 { |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
673 return m_rep ? m_rep->is_variable (nm) : false; |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
674 } |
e2e493712818
improve previous change for command syntax parsing (bug #60882)
John W. Eaton <jwe@octave.org>
parents:
29572
diff
changeset
|
675 |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
676 void update_nest (void) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
677 { |
24377
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
678 if (m_rep) |
ea3458c1d884
improve handling of invalid symbol_scope objects (bug #52607)
John W. Eaton <jwe@octave.org>
parents:
24362
diff
changeset
|
679 m_rep->update_nest (); |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
680 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
681 |
29572
aef11bb4e6d1
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
682 bool look_nonlocal (const std::string& name, std::size_t offset, |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
683 symbol_record& result) |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
684 { |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
685 return m_rep ? m_rep->look_nonlocal (name, offset, result) : false; |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
686 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
687 |
24706
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
688 std::shared_ptr<symbol_scope_rep> get_rep (void) const |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
689 { |
24706
30e1d0bf7ade
use weak_ptr for symbol_scope_rep and symbol_record_rep pointers (bug #53092)
John W. Eaton <jwe@octave.org>
parents:
24705
diff
changeset
|
690 return m_rep; |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
691 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
692 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
693 friend bool operator == (const symbol_scope& a, const symbol_scope& b) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
694 { |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
695 return a.m_rep == b.m_rep; |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
696 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
697 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
698 friend bool operator != (const symbol_scope& a, const symbol_scope& b) |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
699 { |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
700 return a.m_rep != b.m_rep; |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
701 } |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
702 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
703 const std::map<std::string, symbol_record>& symbols (void) const |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
704 { |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
705 static const std::map<std::string, symbol_record> empty_map; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
706 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
707 return m_rep ? m_rep->symbols () : empty_map; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
708 } |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
709 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
710 std::map<std::string, symbol_record>& symbols (void) |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
711 { |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
712 static std::map<std::string, symbol_record> empty_map; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
713 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
714 return m_rep ? m_rep->symbols () : empty_map; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
715 } |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
716 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
717 std::list<symbol_record> symbol_list (void) const |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
718 { |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
719 static const std::list<symbol_record> empty_list; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
720 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
721 return m_rep ? m_rep->symbol_list () : empty_list; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
722 } |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
723 |
24361
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
724 private: |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
725 |
8bcfddad15ec
use shared_ptr to manage symbol_scope objects
John W. Eaton <jwe@octave.org>
parents:
24356
diff
changeset
|
726 std::shared_ptr<symbol_scope_rep> m_rep; |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
727 }; |
31605
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
728 |
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
729 OCTAVE_END_NAMESPACE(octave) |
24263
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
730 |
3b302b2890d7
disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
731 #endif |