annotate libinterp/corefcn/symrec.h @ 24352:bff8e3884a88

restructure global variable handling in symbol table * symrec.h, symrec.cc (symbol_record::symbol_record_rep::xglobal_varref, symbol_record::symbol_record_rep::xglobal_varval): Delete. (symbol_record::find): Don't treat globals specially. (symbol_record::symbol_record_rep::varref, (symbol_record::symbol_record_rep::varval): Handle globals like other variables, but with context always equal to 0. (symbol_record::symbol_record_rep::clear): For globals, unbind forward rep instead of calling unmark_global. (symbol_record::symbol_record_rep::unmark_global): Delete. (symbol_record::symbol_record_rep::mark_global): Don't forward. (symbol_record::symbol_record_rep::bind_fwd_rep, symbol_record::symbol_record_rep::unbind_fwd_rep): Do forward. (symbol_record::varref, symbol_record::unmark_global): Delete. * symscope.h, symscope.cc (symbol_scope::clear_global_pattern, symbol_scope::clear_global, symbol_scope::varref): Delete. * symtab.h, symtab.cc (symbol_table::find_global_symbol, symbol_table::clear_global_pattern, symbol_table::clear_global): New functions. (symbol_table::erase_global, symbol_table::global_varref): Delete. (symbol_table::clear_all): Call clear_variables for the global scope instead of clear_global_pattern for the current scope. (symbol_table::m_global_symbols): Delete variable and all uses. * variables.cc (do_clear_globals): Call clear_variable for the symbols in the current scope that are linked to global symbols and symtab::clear_global for the actual global symbols. * pt-eval.cc (tree_evaluator::visit_tree_decl_elt): Find global symbol and link ID to it instead of calling mark_global for ID. * pt-id.h, pt-id.cc (tree_identifier::link_to_global): New function. (tree_identifier::mark_global): Delete.
author John W. Eaton <jwe@octave.org>
date Thu, 30 Nov 2017 15:10:12 -0500
parents bccb49573786
children 8b14ba8296af
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)
24351
bccb49573786 delete unused symbol_record_rep member variable
John W. Eaton <jwe@octave.org>
parents: 24348
diff changeset
83 : m_decl_scope (s), m_name (nm),
24272
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
24325
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
165 context_id context = 0;
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
166
24352
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
167 if (m_decl_scope && ! (is_persistent () || is_global ()))
24325
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
168 context = get_decl_scope_context ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
169
24325
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
170 context_id n = m_value_stack.size ();
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
171 while (n++ <= context)
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
172 m_value_stack.push_back (octave_value ());
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
173
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
174 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
175 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
176
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
177 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
178 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
179 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
180 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
181
24325
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
182 context_id context = 0;
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
183
24352
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
184 if (m_decl_scope && ! (is_persistent () || is_global ()))
24325
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
185 context = get_decl_scope_context ();
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
186
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
187 if (context < m_value_stack.size ())
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
188 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
189 else
24325
bc65aa8a5ff1 don't store persistent variables separately in scope object
John W. Eaton <jwe@octave.org>
parents: 24324
diff changeset
190 return octave_value ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
191 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
192
24348
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
193 void push_context (void)
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
194 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
195 if (auto t_fwd_rep = m_fwd_rep.lock ())
24348
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
196 return;
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
197
24348
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
198 if (! (is_persistent () || is_global ()))
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
199 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
200 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
201
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
202 // 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
203 // 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
204 // functions like
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
205 //
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
206 // function foo (n)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
207 // if (n > 0)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
208 // foo (n-1);
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
209 // else
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
210 // eval ("x = 1");
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
211 // endif
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
212 // endfunction
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 // 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
215
24348
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
216 size_t pop_context (void)
24263
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 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
219
24348
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
220 if (auto t_fwd_rep = m_fwd_rep.lock ())
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
221 return retval;
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
222
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
223 if (! (is_persistent () || is_global ()))
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
224 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
225 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
226 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
227 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
228
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
229 return retval;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
230 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
231
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
232 void clear (void)
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
233 {
24348
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
234 // There is no need to do anything with a fowarded
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
235 // symbol_record_rep here.
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
236 //
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
237 // For scripts, we are never executing in the script "scope".
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
238 //
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
239 // For globals, we are only interested in breaking the link to
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
240 // the global value and clearing the local value, not the
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
241 // global one.
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
242
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
243 // For persistent values, we clear the value then unmark so
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
244 // that we clear the first element of the value stack.
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
245
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
246 if (auto t_fwd_rep = m_fwd_rep.lock ())
24348
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
247 return;
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
248
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
249 if (! (is_hidden () || is_inherited ()))
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
250 {
24348
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
251 if (is_global ())
24352
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
252 unbind_fwd_rep ();
24348
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
253
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
254 assign (octave_value ());
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
255
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
256 if (is_persistent ())
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
257 unmark_persistent ();
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
258 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
259 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
260
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
261 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
262 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
263 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
264 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
265
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
266 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
267 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
268
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
269 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
270 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
271 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
272 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
273
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
274 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
275 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
276
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
277 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
278 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
279 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
280 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
281
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
282 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
283 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
284
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
285 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
286 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
287 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
288 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
289
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
290 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
291 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
292
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
293 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
294 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
295 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
296 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
297
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
298 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
299 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
300
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
301 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
302 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
303 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
304 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
305
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
306 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
307 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
308
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
309 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
310 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
311 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
312 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
313
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
314 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
315 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
316
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
317 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
318 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
319 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
320 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
321
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
322 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
323 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
324
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
325 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
326 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
327 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
328 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
329
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
330 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
331 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
332
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
333 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
334 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
335 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
336 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
337
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
338 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
339 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
340
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
341 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
342 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
343 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
344 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
345
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
346 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
347 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
348
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
349 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
350 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
351 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
352 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
353 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
354 return;
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
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
357 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
358 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
359
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
360 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
361 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
362 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
363 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
364 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
365 return;
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
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
368 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
369 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
370
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
371 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
372 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
373 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
374 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
375 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
376 return;
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
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
379 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
380 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
381
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
382 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
383 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
384 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
385 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
386 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
387 return;
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
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
390 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
391 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
392
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
393 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
394 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
395 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
396 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
397 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
398 return;
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
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
401 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
402 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
403
24352
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
404 // This flag should only be set for a symbol record that is
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
405 // actually in the global symbol_scope, and that should only
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
406 // happen when it is added to the global symbol_scope.
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
407
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
408 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
409 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
410 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
411 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
412
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
413 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
414 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
415 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
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 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
418 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
419 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
420
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
421 if (is_global ())
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
422 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
423
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
424 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
425 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
426
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
427 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
428 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
429 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
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 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
432 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
433 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
434
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
435 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
436 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
437
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
438 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
439 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
440 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
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 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
443 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
444 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
445
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
446 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
447 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
448
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
449 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
450 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
451 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
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 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
454 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
455 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
456
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
457 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
458 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
459
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
460 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
461 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
462 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
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 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
465 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
466 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
467
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
468 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
469 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
470
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
471 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
472 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
473 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
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 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
476 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
477 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
478
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
479 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
480 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
481
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
482 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
483 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
484 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
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 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
487 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
488 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
489
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
490 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
491 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
492
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
493 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
494 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
495 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
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 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
498 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
499 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
500
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
501 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
502 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
503
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
504 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
505 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
506 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
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 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
509 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
510 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
511
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
512 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
513 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
514
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
515 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
516
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
517 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
518
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
519 void invalidate (void)
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 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
522 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
523 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
524 return;
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
525 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
526
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
527 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
528 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
529
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
530 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
531 {
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
532 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
533 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
534
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
535 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
536 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
537
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
538 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
539 {
24352
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
540 if (auto t_fwd_rep = m_fwd_rep.lock ())
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
541 t_fwd_rep->bind_fwd_rep (fwd_rep);
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
542
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
543 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
544 }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
545
24352
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
546 void unbind_fwd_rep (void)
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
547 {
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
548 if (auto t_fwd_rep = m_fwd_rep.lock ())
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
549 t_fwd_rep->unbind_fwd_rep ();
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
550
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
551 m_fwd_rep.reset ();
bff8e3884a88 restructure global variable handling in symbol table
John W. Eaton <jwe@octave.org>
parents: 24351
diff changeset
552 }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
553
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
554 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
555
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
556 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
557
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
558 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
559
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
560 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
561
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
562 private:
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
563
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
564 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
565
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
566 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
567
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
568 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
569
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
570 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
571
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
572 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
573
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
574 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
575 };
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
576
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
577 public:
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
578
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
579 symbol_record (void);
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
580
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
581 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
582 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
583 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
584 : 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
585
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
586 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
587
24271
0dd6c909baa2 use shared_ptr and weak_ptr to manage symbol_record object
John W. Eaton <jwe@octave.org>
parents: 24269
diff changeset
588 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
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 ~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
591
24269
f494b87d2a93 rename scope to symbol_scope
John W. Eaton <jwe@octave.org>
parents: 24263
diff changeset
592 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
593 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
594 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
595 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
596
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
597 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
598
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
599 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
600
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
601 octave_value
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
602 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
603
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
604 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
605 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
606 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
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 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
610 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
611 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
612 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
613 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
614 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
615 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
616
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
617 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
618 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
619 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
620 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
621
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
622 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
623 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
624 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
625 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
626
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
627 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
628 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
629 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
630 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
631 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
632 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
633
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
634 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
635 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
636 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
637 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
638
24348
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
639 void push_context (void) { m_rep->push_context (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
640
24348
64691264dd21 eliminate some uses of decl_scope in symbol_record class
John W. Eaton <jwe@octave.org>
parents: 24325
diff changeset
641 size_t pop_context (void) { return m_rep->pop_context (); }
24263
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
642
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
643 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
644
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
645 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
646 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
647 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
648 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
649
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
650 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
651 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
652 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
653 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
654
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
655 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
656 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
657 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
658 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
659
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
660 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
661 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
662 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
663 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
664
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
665 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
666 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
667 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
668 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
669 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
670 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
671 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
672 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
673
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
674 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
675 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
676 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
677 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
678 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
679 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
680 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
681 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
682
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
683 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
684 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
685 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
686 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
687 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
688 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
689 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
690
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
691 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
692
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
693 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
694
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
695 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
696
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
697 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
698
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
699 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
700 {
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
701 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
702 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
703
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
704 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
705
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
706 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
707
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
708 private:
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
709
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
710 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
711
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
712 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
713
24272
dd810f9d26e7 use m_ prefix for symbol_record class data members
John W. Eaton <jwe@octave.org>
parents: 24271
diff changeset
714 // 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
715 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
716 };
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
717 }
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
718
3b302b2890d7 disentangle symbol_record, scope, and fcn_info from symbol_table class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
719 #endif