Mercurial > octave-nkf
comparison src/pt-misc.h @ 2973:ef3379196bcf
[project @ 1997-05-15 19:27:38 by jwe]
author | jwe |
---|---|
date | Thu, 15 May 1997 19:30:57 +0000 |
parents | 026f342c2019 |
children | 20f5cec4f11c |
comparison
equal
deleted
inserted
replaced
2972:ae2471c4e5c0 | 2973:ef3379196bcf |
---|---|
33 | 33 |
34 class octave_value_list; | 34 class octave_value_list; |
35 class octave_value; | 35 class octave_value; |
36 class tree_command; | 36 class tree_command; |
37 class tree_expression; | 37 class tree_expression; |
38 class tree_simple_assignment_expression; | 38 class tree_simple_assignment; |
39 class tree_index_expression; | 39 class tree_index_expression; |
40 class tree_identifier; | 40 class tree_identifier; |
41 class symbol_record; | 41 class symbol_record; |
42 class symbol_table; | 42 class symbol_table; |
43 | 43 |
93 | 93 |
94 bool print_result (void) { return print_flag; } | 94 bool print_result (void) { return print_flag; } |
95 | 95 |
96 tree_command *command (void) { return cmd; } | 96 tree_command *command (void) { return cmd; } |
97 | 97 |
98 octave_value eval (bool silent, bool in_function_body); | |
99 | |
100 octave_value_list eval (bool silent, int nargout, bool in_function_body); | 98 octave_value_list eval (bool silent, int nargout, bool in_function_body); |
101 | 99 |
102 tree_expression *expression (void) { return expr; } | 100 tree_expression *expression (void) { return expr; } |
103 | 101 |
104 void accept (tree_walker& tw); | 102 void accept (tree_walker& tw); |
139 } | 137 } |
140 } | 138 } |
141 | 139 |
142 void mark_as_function_body (void) { function_body = true; } | 140 void mark_as_function_body (void) { function_body = true; } |
143 | 141 |
144 octave_value eval (bool silent = false); | 142 octave_value_list eval (bool silent = false, int nargout = 0); |
145 | |
146 octave_value_list eval (bool silent, int nargout); | |
147 | 143 |
148 void accept (tree_walker& tw); | 144 void accept (tree_walker& tw); |
149 | 145 |
150 private: | 146 private: |
151 | 147 |
166 | 162 |
167 tree_argument_list (tree_expression *t) | 163 tree_argument_list (tree_expression *t) |
168 : SLList<tree_expression *> () { append (t); } | 164 : SLList<tree_expression *> () { append (t); } |
169 | 165 |
170 ~tree_argument_list (void); | 166 ~tree_argument_list (void); |
167 | |
168 bool all_elements_are_constant (void) const; | |
171 | 169 |
172 octave_value_list convert_to_const_vector (void); | 170 octave_value_list convert_to_const_vector (void); |
173 | 171 |
174 string_vector get_arg_names (void) const; | 172 string_vector get_arg_names (void) const; |
175 | 173 |
258 { | 256 { |
259 public: | 257 public: |
260 | 258 |
261 typedef void (*eval_fcn) (tree_decl_elt &, bool); | 259 typedef void (*eval_fcn) (tree_decl_elt &, bool); |
262 | 260 |
263 tree_decl_elt (void) | 261 tree_decl_elt (tree_identifier *i = 0, tree_expression *e = 0) |
264 : id (0), ass_expr (0) { } | 262 : id (i), expr (e) { } |
265 | |
266 tree_decl_elt (tree_identifier *i) | |
267 : id (i), ass_expr (0) { } | |
268 | |
269 tree_decl_elt (tree_simple_assignment_expression *ass) | |
270 : id (0), ass_expr (ass) { } | |
271 | 263 |
272 ~tree_decl_elt (void); | 264 ~tree_decl_elt (void); |
273 | 265 |
274 void eval (void); | 266 void eval (void); |
275 | 267 |
276 tree_identifier *ident (void) { return id; } | 268 tree_identifier *ident (void) { return id; } |
277 | 269 |
278 tree_simple_assignment_expression *assign_expr (void) { return ass_expr; } | 270 tree_expression *expression (void) { return expr; } |
279 | 271 |
280 void accept (tree_walker& tw); | 272 void accept (tree_walker& tw); |
281 | 273 |
282 private: | 274 private: |
283 | |
284 // Only one of id or ass_expr can be valid at once. | |
285 | 275 |
286 // An identifier to tag with the declared property. | 276 // An identifier to tag with the declared property. |
287 tree_identifier *id; | 277 tree_identifier *id; |
288 | 278 |
289 // An assignemnt expression. Valid only if the left hand side of | 279 // An initializer expression (may be zero); |
290 // the assignment is a simple identifier. | 280 tree_expression *expr; |
291 tree_simple_assignment_expression *ass_expr; | |
292 }; | 281 }; |
293 | 282 |
294 class | 283 class |
295 tree_decl_init_list : public SLList<tree_decl_elt *> | 284 tree_decl_init_list : public SLList<tree_decl_elt *> |
296 { | 285 { |