annotate src/pt-decl.h @ 8523:ad3afaaa19c1

implement non-copying contiguous range indexing
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 15 Jan 2009 07:22:24 +0100
parents 283989f2da9b
children 73c4516fae10
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
1 /*
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
2
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
3 Copyright (C) 1996, 1997, 2000, 2002, 2004, 2005, 2006, 2007
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
4 John W. Eaton
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
5
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
7
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6215
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6215
diff changeset
11 option) any later version.
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
12
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
16 for more details.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
17
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6215
diff changeset
19 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6215
diff changeset
20 <http://www.gnu.org/licenses/>.
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
21
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
22 */
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
23
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
24 #if !defined (octave_tree_decl_h)
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
25 #define octave_tree_decl_h 1
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
26
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
27 class tree_expression;
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
28 class tree_identifier;
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
29
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
30 class tree_walker;
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
31
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
32 #include <string>
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
33
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4212
diff changeset
34 #include "base-list.h"
6215
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
35 #include "oct-lvalue.h"
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
36 #include "pt-cmd.h"
6215
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
37 #include "pt-id.h"
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
38 #include "symtab.h"
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
39
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
40 // List of expressions that make up a declaration statement.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
41
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
42 class
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
43 tree_decl_elt
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
44 {
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
45 public:
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
46
2989
6a7b578b6fb4 [project @ 1997-05-16 07:54:10 by jwe]
jwe
parents: 2988
diff changeset
47 typedef void (*eval_fcn) (tree_decl_elt &);
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
48
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
49 tree_decl_elt (tree_identifier *i = 0, tree_expression *e = 0)
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
50 : id (i), expr (e) { }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
51
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
52 ~tree_decl_elt (void);
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
53
6215
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
54 bool eval (void);
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
55
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
56 bool is_defined (void) { return id ? id->is_defined () : false; }
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
57
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
58 bool is_variable (void) { return id ? id->is_variable () : false; }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
59
6215
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
60 void mark_as_formal_parameter (void)
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
61 {
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
62 if (id)
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
63 id->mark_as_formal_parameter ();
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
64 }
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
65
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
66 bool lvalue_ok (void) { return id ? id->lvalue_ok () : false; }
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
67
8150
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 7767
diff changeset
68 // Do not allow functions return null values
8523
ad3afaaa19c1 implement non-copying contiguous range indexing
Jaroslav Hajek <highegg@gmail.com>
parents: 8150
diff changeset
69 octave_value rvalue (void) { return id ? id->rvalue ().storable_value () : octave_value (); }
6215
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
70
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
71 octave_value_list rvalue (int nargout)
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
72 {
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
73 return id ? id->rvalue (nargout) : octave_value_list ();
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
74 }
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
75
516d3071b34c [project @ 2006-12-15 03:24:12 by jwe]
jwe
parents: 5861
diff changeset
76 octave_lvalue lvalue (void) { return id ? id->lvalue () : octave_lvalue (); }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
77
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
78 tree_identifier *ident (void) { return id; }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
79
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
80 tree_expression *expression (void) { return expr; }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
81
7767
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
82 tree_decl_elt *dup (symbol_table::scope_id scope,
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
83 symbol_table::context_id context);
5861
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5307
diff changeset
84
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
85 void accept (tree_walker& tw);
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
86
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
87 private:
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
88
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
89 // An identifier to tag with the declared property.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
90 tree_identifier *id;
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
91
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
92 // An initializer expression (may be zero);
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
93 tree_expression *expr;
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
94
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
95 // No copying!
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
96
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
97 tree_decl_elt (const tree_decl_elt&);
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
98
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
99 tree_decl_elt& operator = (const tree_decl_elt&);
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
100 };
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
101
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
102 class
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4212
diff changeset
103 tree_decl_init_list : public octave_base_list<tree_decl_elt *>
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
104 {
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
105 public:
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
106
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4212
diff changeset
107 tree_decl_init_list (void) { }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
108
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4212
diff changeset
109 tree_decl_init_list (tree_decl_elt *t) { append (t); }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
110
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
111 ~tree_decl_init_list (void)
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
112 {
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4212
diff changeset
113 while (! empty ())
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
114 {
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4212
diff changeset
115 iterator p = begin ();
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4212
diff changeset
116 delete *p;
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4212
diff changeset
117 erase (p);
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
118 }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
119 }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
120
2989
6a7b578b6fb4 [project @ 1997-05-16 07:54:10 by jwe]
jwe
parents: 2988
diff changeset
121 void eval (tree_decl_elt::eval_fcn);
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
122
7767
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
123 tree_decl_init_list *dup (symbol_table::scope_id scope,
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
124 symbol_table::context_id context);
5861
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5307
diff changeset
125
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
126 void accept (tree_walker& tw);
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
127
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
128 private:
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
129
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
130 // No copying!
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
131
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
132 tree_decl_init_list (const tree_decl_init_list&);
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
133
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
134 tree_decl_init_list& operator = (const tree_decl_init_list&);
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
135 };
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
136
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
137 // Base class for declaration commands -- global, static, etc.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
138
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
139 class
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
140 tree_decl_command : public tree_command
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
141 {
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
142 public:
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
143
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 2989
diff changeset
144 tree_decl_command (const std::string& n, int l = -1, int c = -1)
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
145 : tree_command (l, c), cmd_name (n), init_list (0) { }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
146
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 2989
diff changeset
147 tree_decl_command (const std::string& n, tree_decl_init_list *t,
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
148 int l = -1, int c = -1)
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
149 : tree_command (l, c), cmd_name (n), init_list (t) { }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
150
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
151 ~tree_decl_command (void);
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
152
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
153 tree_decl_init_list *initializer_list (void) { return init_list; }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
154
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
155 void accept (tree_walker& tw);
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
156
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 2989
diff changeset
157 std::string name (void) { return cmd_name; }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
158
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
159 protected:
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
160
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
161 // The name of this command -- global, static, etc.
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 2989
diff changeset
162 std::string cmd_name;
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
163
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
164 // The list of variables or initializers in this declaration command.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
165 tree_decl_init_list *init_list;
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
166
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
167 private:
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
168
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
169 // No copying!
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
170
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
171 tree_decl_command (const tree_decl_command&);
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
172
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
173 tree_decl_command& operator = (const tree_decl_command&);
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
174 };
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
175
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
176 // Global.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
177
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
178 class
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
179 tree_global_command : public tree_decl_command
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
180 {
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
181 public:
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
182
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
183 tree_global_command (int l = -1, int c = -1)
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
184 : tree_decl_command ("global", l, c) { }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
185
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
186 tree_global_command (tree_decl_init_list *t, int l = -1, int c = -1)
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
187 : tree_decl_command ("global", t, l, c) { }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
188
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
189 ~tree_global_command (void) { }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
190
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
191 void eval (void);
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
192
7767
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
193 tree_command *dup (symbol_table::scope_id scope,
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
194 symbol_table::context_id context);
5861
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5307
diff changeset
195
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
196 private:
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
197
2989
6a7b578b6fb4 [project @ 1997-05-16 07:54:10 by jwe]
jwe
parents: 2988
diff changeset
198 static void do_init (tree_decl_elt& elt);
6a7b578b6fb4 [project @ 1997-05-16 07:54:10 by jwe]
jwe
parents: 2988
diff changeset
199
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
200 // No copying!
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
201
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
202 tree_global_command (const tree_global_command&);
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
203
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
204 tree_global_command& operator = (const tree_global_command&);
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
205 };
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
206
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
207 // Static.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
208
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
209 class
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
210 tree_static_command : public tree_decl_command
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
211 {
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
212 public:
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
213
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
214 tree_static_command (int l = -1, int c = -1)
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
215 : tree_decl_command ("static", l, c) { }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
216
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
217 tree_static_command (tree_decl_init_list *t, int l = -1, int c = -1)
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
218 : tree_decl_command ("static", t, l, c) { }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
219
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
220 ~tree_static_command (void) { }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
221
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
222 void eval (void);
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
223
7767
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
224 tree_command *dup (symbol_table::scope_id scope,
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
225 symbol_table::context_id context);
5861
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5307
diff changeset
226
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
227 private:
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
228
2989
6a7b578b6fb4 [project @ 1997-05-16 07:54:10 by jwe]
jwe
parents: 2988
diff changeset
229 static void do_init (tree_decl_elt& elt);
6a7b578b6fb4 [project @ 1997-05-16 07:54:10 by jwe]
jwe
parents: 2988
diff changeset
230
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
231 // No copying!
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
232
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
233 tree_static_command (const tree_static_command&);
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
234
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
235 tree_static_command& operator = (const tree_static_command&);
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
236 };
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
237
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
238 #endif
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
239
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
240 /*
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
241 ;;; Local Variables: ***
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
242 ;;; mode: C++ ***
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
243 ;;; End: ***
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
244 */