annotate libinterp/corefcn/symrec.h @ 24272:dd810f9d26e7

use m_ prefix for symbol_record class data members * symrec.h, symrec.cc (class symbol_record::symbol_record_rep, class symbol_record): Use m_prefix for all class data members. (symbol_record::storage_class): Rename function from xstorage_class. (symbol_record_rep::name, symbol_record_rep::rename): New functions. Use them instead of accessing symbol_record_rep::m_name directly. (class symbol_record::symbol_record_rep): Make all data members private.
author John W. Eaton <jwe@octave.org>
date Fri, 17 Nov 2017 11:36:55 -0500
parents 0dd6c909baa2
children 06c804ae3815
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 /*
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 Copyright (C) 1993-2017 John W. Eaton
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 Copyright (C) 2009 VZLU Prague
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 This file is part of Octave.
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 under the terms of the GNU General Public License as published by
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 the Free Software Foundation; either version 3 of the License, or
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 (at your option) any later version.
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 WITHOUT ANY WARRANTY; without even the implied warranty of
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 GNU General Public License for more details.
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 along with Octave; see the file COPYING. If not, see
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20 <http://www.gnu.org/licenses/>.
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 */
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 #if ! defined (octave_symrec_h)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 #define octave_symrec_h 1
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 #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
28
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 #include <deque>
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 #include <list>
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
31 #include <memory>
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 #include <string>
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 class octave_user_function;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 #include "ov.h"
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 #include "ovl.h"
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 namespace octave
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 {
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
41 class symbol_scope;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 class symbol_record
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 public:
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 typedef size_t context_id;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 // generic variable
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 static const unsigned int local = 1;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 // varargin, argn, .nargin., .nargout.
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53 // (FIXME: is this really used now?)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 static const unsigned int automatic = 2;
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 // formal parameter
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 static const unsigned int formal = 4;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 // not listed or cleared (.nargin., .nargout.)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60 static const unsigned int hidden = 8;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 // inherited from parent scope; not cleared at function exit
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63 static const unsigned int inherited = 16;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65 // global (redirects to global scope)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 static const unsigned int global = 32;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 // not cleared at function exit
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 static const unsigned int persistent = 64;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 // this symbol may NOT become a variable.
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 // (symbol added to a static workspace)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 static const unsigned int added_static = 128;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75 private:
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
77 class symbol_record_rep
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 {
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79 public:
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
81 symbol_record_rep (symbol_scope *s, const std::string& nm,
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 const octave_value& v, unsigned int sc)
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
83 : m_decl_scope (s), m_curr_fcn (nullptr), m_name (nm),
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
84 m_fwd_rep (), m_value_stack (), m_storage_class (sc),
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
85 m_valid (true)
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
86 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
87 m_value_stack.push_back (v);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90 // No copying!
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92 symbol_record_rep (const symbol_record_rep& ov) = delete;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
93
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
94 symbol_record_rep& operator = (const symbol_record_rep&) = delete;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
95
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96 ~symbol_record_rep (void) = default;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
98 void assign (const octave_value& value)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
99 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
100 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
101 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
102 t_fwd_rep->assign (value);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104 }
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 varref () = value;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
107 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
108
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109 void assign (octave_value::assign_op op,
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
110 const std::string& type,
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111 const std::list<octave_value_list>& idx,
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
112 const octave_value& value)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
114 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
116 t_fwd_rep->assign (op, type, idx, value);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
117 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
118 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
119
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
120 varref().assign (op, type, idx, value);
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
121 }
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 void assign (octave_value::assign_op op, const octave_value& value)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
124 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
125 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
126 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
127 t_fwd_rep->assign (op, value);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
128 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
129 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
130
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
131 varref().assign (op, value);
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
132 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
133
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
134 void do_non_const_unary_op (octave_value::unary_op op)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
135 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
136 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
137 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
138 t_fwd_rep->do_non_const_unary_op (op);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
139 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
140 }
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 varref().do_non_const_unary_op (op);
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
143 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
144
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
145 void do_non_const_unary_op (octave_value::unary_op op,
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
146 const std::string& type,
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
147 const std::list<octave_value_list>& idx)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
148 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
149 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
150 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
151 t_fwd_rep->do_non_const_unary_op (op, type, idx);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
152 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
153 }
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 varref().do_non_const_unary_op (op, type, idx);
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
156 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
157
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
158 context_id get_decl_scope_context (void) const;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
159
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
160 octave_value& varref (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
161 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
162 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
163 return t_fwd_rep->varref ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
164
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
165 context_id context = m_decl_scope ? get_decl_scope_context () : 0;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
166
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
167 if (is_global ())
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
168 return xglobal_varref ();
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
169 else if (is_persistent ())
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
170 return xpersistent_varref ();
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
171 else
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
172 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
173 context_id n = m_value_stack.size ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
174 while (n++ <= context)
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
175 m_value_stack.push_back (octave_value ());
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
176
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
177 return m_value_stack[context];
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
178 }
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
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
181 octave_value varval (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
182 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
183 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
184 return t_fwd_rep->varval ();
24263
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 context_id context = m_decl_scope ? get_decl_scope_context () : 0;
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 if (is_global ())
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
189 return xglobal_varval ();
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
190 else if (is_persistent ())
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
191 return xpersistent_varval ();
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
192 else
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
193 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
194 if (context < m_value_stack.size ())
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
195 return m_value_stack[context];
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
196 else
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
197 return octave_value ();
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
198 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
199 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
200
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
201 void push_context (symbol_scope *sid)
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
202 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
203 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
204 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
205 t_fwd_rep->push_context (sid);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
206 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
207 }
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 if (! (is_persistent () || is_global ())
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
210 && sid == decl_scope ())
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
211 m_value_stack.push_back (octave_value ());
24263
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
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
214 // If pop_context returns 0, we are out of values and this element
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
215 // of the symbol table should be deleted. This can happen for
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
216 // functions like
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 // function foo (n)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
219 // if (n > 0)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
220 // foo (n-1);
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
221 // else
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
222 // eval ("x = 1");
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
223 // endif
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
224 // endfunction
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
225 //
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
226 // Here, X should only exist in the final stack frame.
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
227
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
228 size_t pop_context (symbol_scope *sid)
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
229 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
230 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
231 return t_fwd_rep->pop_context (sid);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
232
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
233 size_t retval = 1;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
234
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
235 if (! (is_persistent () || is_global ())
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
236 && sid == decl_scope ())
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
237 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
238 m_value_stack.pop_back ();
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
239 retval = m_value_stack.size ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
240 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
241
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
242 return retval;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
243 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
244
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
245 void clear (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
246 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
247 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
248 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
249 t_fwd_rep->clear ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
250 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
251 }
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 clear (decl_scope ());
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
254 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
255
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
256 void clear (symbol_scope *sid);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
257
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
258 bool is_defined (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
259 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
260 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
261 return t_fwd_rep->is_defined ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
262
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
263 return varval ().is_defined ();
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
264 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
265
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
266 bool is_valid (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
267 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
268 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
269 return t_fwd_rep->is_valid ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
270
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
271 return m_valid;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
272 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
273
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
274 bool is_variable (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
275 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
276 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
277 return t_fwd_rep->is_variable ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
278
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
279 return (! is_local () || is_defined ());
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
280 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
281
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
282 bool is_local (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
283 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
284 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
285 return t_fwd_rep->is_local ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
286
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
287 return m_storage_class & local;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
288 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
289
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
290 bool is_automatic (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
291 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
292 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
293 return t_fwd_rep->is_automatic ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
294
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
295 return m_storage_class & automatic;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
296 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
297
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
298 bool is_formal (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
299 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
300 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
301 return t_fwd_rep->is_formal ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
302
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
303 return m_storage_class & formal;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
304 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
305
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
306 bool is_hidden (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
307 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
308 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
309 return t_fwd_rep->is_hidden ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
310
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
311 return m_storage_class & hidden;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
312 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
313
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
314 bool is_inherited (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
315 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
316 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
317 return t_fwd_rep->is_inherited ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
318
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
319 return m_storage_class & inherited;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
320 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
321
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
322 bool is_global (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
323 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
324 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
325 return t_fwd_rep->is_global ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
326
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
327 return m_storage_class & global;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
328 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
329
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
330 bool is_persistent (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
331 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
332 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
333 return t_fwd_rep->is_persistent ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
334
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
335 return m_storage_class & persistent;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
336 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
337
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
338 bool is_added_static (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
339 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
340 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
341 return t_fwd_rep->is_added_static ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
342
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
343 return m_storage_class & added_static;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
344 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
345
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
346 void mark_local (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
347 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
348 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
349 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
350 t_fwd_rep->mark_local ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
351 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
352 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
353
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
354 m_storage_class |= local;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
355 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
356
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
357 void mark_automatic (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
358 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
359 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
360 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
361 t_fwd_rep->mark_automatic ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
362 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
363 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
364
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
365 m_storage_class |= automatic;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
366 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
367
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
368 void mark_formal (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
369 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
370 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
371 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
372 t_fwd_rep->mark_formal ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
373 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
374 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
375
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
376 m_storage_class |= formal;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
377 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
378
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
379 void mark_hidden (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
380 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
381 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
382 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
383 t_fwd_rep->mark_hidden ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
384 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
385 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
386
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
387 m_storage_class |= hidden;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
388 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
389
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
390 void mark_inherited (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
391 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
392 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
393 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
394 t_fwd_rep->mark_inherited ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
395 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
396 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
397
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
398 m_storage_class |= inherited;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
399 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
400
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
401 void mark_global (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
402 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
403 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
404 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
405 t_fwd_rep->mark_global ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
406 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
407 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
408
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
409 if (is_persistent ())
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
410 error ("can't make persistent variable %s global", m_name.c_str ());
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
411
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
412 m_storage_class |= global;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
413 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
414
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
415 void mark_persistent (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
416 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
417 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
418 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
419 t_fwd_rep->mark_persistent ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
420 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
421 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
422
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
423 if (is_global ())
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
424 error ("can't make global variable %s persistent", m_name.c_str ());
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
425
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
426 m_storage_class |= persistent;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
427 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
428
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
429 void mark_added_static (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
430 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
431 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
432 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
433 t_fwd_rep->mark_added_static ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
434 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
435 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
436
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
437 m_storage_class |= added_static;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
438 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
439
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
440 void unmark_local (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
441 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
442 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
443 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
444 t_fwd_rep->unmark_local ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
445 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
446 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
447
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
448 m_storage_class &= ~local;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
449 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
450
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
451 void unmark_automatic (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
452 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
453 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
454 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
455 t_fwd_rep->unmark_automatic ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
456 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
457 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
458
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
459 m_storage_class &= ~automatic;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
460 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
461
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
462 void unmark_formal (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
463 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
464 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
465 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
466 t_fwd_rep->unmark_formal ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
467 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
468 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
469
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
470 m_storage_class &= ~formal;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
471 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
472
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
473 void unmark_hidden (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
474 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
475 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
476 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
477 t_fwd_rep->unmark_hidden ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
478 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
479 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
480
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
481 m_storage_class &= ~hidden;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
482 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
483
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
484 void unmark_inherited (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
485 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
486 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
487 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
488 t_fwd_rep->unmark_inherited ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
489 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
490 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
491
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
492 m_storage_class &= ~inherited;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
493 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
494
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
495 void unmark_global (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
496 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
497 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
498 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
499 t_fwd_rep->unmark_global ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
500 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
501 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
502
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
503 m_storage_class &= ~global;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
504 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
505
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
506 void unmark_persistent (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
507 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
508 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
509 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
510 t_fwd_rep->unmark_persistent ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
511 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
512 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
513
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
514 m_storage_class &= ~persistent;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
515 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
516
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
517 void unmark_added_static (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
518 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
519 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
520 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
521 t_fwd_rep->unmark_added_static ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
522 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
523 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
524
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
525 m_storage_class &= ~added_static;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
526 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
527
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
528 unsigned int storage_class (void) const { return m_storage_class; }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
529
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
530 void init_persistent (void);
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
531
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
532 void invalidate (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
533 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
534 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
535 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
536 t_fwd_rep->invalidate ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
537 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
538 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
539
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
540 m_valid = false;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
541 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
542
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
543 void erase_persistent (void);
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
544
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
545 symbol_scope *decl_scope (void)
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
546 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
547 if (auto t_fwd_rep = m_fwd_rep.lock ())
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
548 return t_fwd_rep->decl_scope ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
549
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
550 return m_decl_scope;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
551 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
552
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
553 void set_curr_fcn (octave_user_function *fcn)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
554 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
555 if (auto t_fwd_rep = m_fwd_rep.lock ())
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
556 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
557 t_fwd_rep->set_curr_fcn (fcn);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
558 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
559 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
560
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
561 m_curr_fcn = fcn;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
562 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
563
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
564 // We don't forward more than once, so no need to forward the
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
565 // next two.
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
566
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
567 void bind_fwd_rep (const std::shared_ptr<symbol_record_rep>& fwd_rep)
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
568 {
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
569 m_fwd_rep = fwd_rep;
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
570 }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
571
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
572 void unbind_fwd_rep (void) { m_fwd_rep.reset (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
573
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
574 symbol_record_rep * dup (symbol_scope *new_scope) const;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
575
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
576 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
577
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
578 std::string name (void) const { return m_name; }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
579
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
580 void rename (const std::string& new_name) { m_name = new_name; }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
581
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
582 private:
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
583
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
584 symbol_scope *m_decl_scope;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
585
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
586 octave_user_function *m_curr_fcn;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
587
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
588 std::string m_name;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
589
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
590 std::weak_ptr<symbol_record_rep> m_fwd_rep;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
591
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
592 std::deque<octave_value> m_value_stack;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
593
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
594 unsigned int m_storage_class;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
595
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
596 bool m_valid;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
597
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
598 private:
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
599
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
600 octave_value& xglobal_varref (void);
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
601
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
602 octave_value& xpersistent_varref (void);
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
603
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
604 octave_value xglobal_varval (void) const;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
605
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
606 octave_value xpersistent_varval (void) const;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
607 };
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
608
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
609 public:
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
610
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
611 symbol_record (void);
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
612
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
613 symbol_record (symbol_scope *s, const std::string& nm = "",
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
614 const octave_value& v = octave_value (),
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
615 unsigned int sc = local)
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
616 : m_rep (new symbol_record_rep (s, nm, v, sc)) { }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
617
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
618 symbol_record (const symbol_record& sr) = default;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
619
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
620 symbol_record& operator = (const symbol_record& sr) = default;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
621
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
622 ~symbol_record (void) = default;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
623
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
624 symbol_record dup (symbol_scope *sid) const
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
625 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
626 return symbol_record (m_rep->dup (sid));
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
627 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
628
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
629 std::string name (void) const { return m_rep->name (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
630
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
631 void rename (const std::string& new_name) { m_rep->rename (new_name); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
632
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
633 octave_value
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
634 find (const octave_value_list& args = octave_value_list ()) const;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
635
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
636 void assign (const octave_value& value)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
637 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
638 m_rep->assign (value);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
639 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
640
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
641 void assign (octave_value::assign_op op,
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
642 const std::string& type,
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
643 const std::list<octave_value_list>& idx,
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
644 const octave_value& value)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
645 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
646 m_rep->assign (op, type, idx, value);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
647 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
648
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
649 void assign (octave_value::assign_op op, const octave_value& value)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
650 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
651 m_rep->assign (op, value);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
652 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
653
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
654 void do_non_const_unary_op (octave_value::unary_op op)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
655 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
656 m_rep->do_non_const_unary_op (op);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
657 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
658
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
659 void do_non_const_unary_op (octave_value::unary_op op,
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
660 const std::string& type,
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
661 const std::list<octave_value_list>& idx)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
662 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
663 m_rep->do_non_const_unary_op (op, type, idx);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
664 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
665
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
666 // Delete when deprecated varref functions are removed.
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
667 octave_value& varref (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
668 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
669 return m_rep->varref ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
670 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
671
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
672 octave_value varval (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
673 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
674 return m_rep->varval ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
675 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
676
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
677 void push_context (symbol_scope *sid) { m_rep->push_context (sid); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
678
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
679 size_t pop_context (symbol_scope *sid) { return m_rep->pop_context (sid); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
680
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
681 void clear (void) { m_rep->clear (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
682
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
683 void clear (symbol_scope *sid) { m_rep->clear (sid); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
684
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
685 bool is_defined (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
686 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
687 return m_rep->is_defined ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
688 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
689
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
690 bool is_undefined (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
691 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
692 return ! m_rep->is_defined ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
693 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
694
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
695 bool is_valid (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
696 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
697 return m_rep->is_valid ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
698 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
699
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
700 bool is_variable (void) const
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
701 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
702 return m_rep->is_variable ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
703 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
704
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
705 bool is_local (void) const { return m_rep->is_local (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
706 bool is_automatic (void) const { return m_rep->is_automatic (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
707 bool is_formal (void) const { return m_rep->is_formal (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
708 bool is_global (void) const { return m_rep->is_global (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
709 bool is_hidden (void) const { return m_rep->is_hidden (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
710 bool is_inherited (void) const { return m_rep->is_inherited (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
711 bool is_persistent (void) const { return m_rep->is_persistent (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
712 bool is_added_static (void) const { return m_rep->is_added_static (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
713
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
714 void mark_local (void) { m_rep->mark_local (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
715 void mark_automatic (void) { m_rep->mark_automatic (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
716 void mark_formal (void) { m_rep->mark_formal (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
717 void mark_hidden (void) { m_rep->mark_hidden (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
718 void mark_inherited (void) { m_rep->mark_inherited (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
719 void mark_global (void) { m_rep->mark_global (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
720 void mark_persistent (void) { m_rep->mark_persistent (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
721 void mark_added_static (void) { m_rep->mark_added_static (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
722
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
723 void unmark_local (void) { m_rep->unmark_local (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
724 void unmark_automatic (void) { m_rep->unmark_automatic (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
725 void unmark_formal (void) { m_rep->unmark_formal (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
726 void unmark_hidden (void) { m_rep->unmark_hidden (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
727 void unmark_inherited (void) { m_rep->unmark_inherited (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
728 void unmark_global (void) { m_rep->unmark_global (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
729 void unmark_persistent (void) { m_rep->unmark_persistent (); }
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
730 void unmark_added_static (void) { m_rep->unmark_added_static (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
731
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
732 void init_persistent (void) { m_rep->init_persistent (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
733
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
734 void erase_persistent (void) { m_rep->erase_persistent (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
735
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
736 void invalidate (void) { m_rep->invalidate (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
737
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
738 symbol_scope *decl_scope (void) { return m_rep->decl_scope (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
739
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
740 unsigned int storage_class (void) const { return m_rep->storage_class (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
741
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
742 void set_curr_fcn (octave_user_function *fcn)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
743 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
744 m_rep->set_curr_fcn (fcn);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
745 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
746
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
747 void bind_fwd_rep (const symbol_record& sr)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
748 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
749 m_rep->bind_fwd_rep (sr.m_rep);
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
750 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
751
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
752 void unbind_fwd_rep (void) { m_rep->unbind_fwd_rep (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
753
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
754 octave_value dump (void) const { return m_rep->dump (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
755
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
756 private:
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
757
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
758 static octave_value dummy_octave_value;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
759
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
760 std::shared_ptr<symbol_record_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
761
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
762 // NEW_REP must be dynamically allocated or nullptr.
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
763 symbol_record (symbol_record_rep *new_rep) : m_rep (new_rep) { }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
764 };
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
765 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
766
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
767 #endif