1
|
1 // Tree classes. -*- C++ -*- |
|
2 /* |
|
3 |
338
|
4 Copyright (C) 1992, 1993, 1994 John W. Eaton |
1
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
383
|
24 #if !defined (octave_tree_h) |
|
25 #define octave_tree_h 1 |
1
|
26 |
456
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
1
|
31 #include <stdio.h> |
|
32 |
|
33 class ostrstream; |
|
34 |
|
35 #include "builtins.h" |
|
36 #include "tree-base.h" |
|
37 #include "tree-const.h" |
|
38 |
|
39 class symbol_record; |
|
40 class symbol_table; |
|
41 |
|
42 #ifndef TREE_FCN_TYPEDEFS |
|
43 #define TREE_FCN_TYPEDEFS 1 |
|
44 |
|
45 typedef tree_constant (*Text_fcn)(int, char **); |
164
|
46 typedef tree_constant* (*General_fcn)(const tree_constant *, int, int); |
1
|
47 |
|
48 #endif |
|
49 |
|
50 #ifndef NULL_TREE |
|
51 #define NULL_TREE (tree *) NULL |
|
52 #endif |
|
53 |
|
54 #ifndef NULL_TREE_CONST |
|
55 #define NULL_TREE_CONST (tree_constant *) NULL |
|
56 #endif |
|
57 |
|
58 /* |
|
59 * Forward declarations. |
|
60 */ |
|
61 class tree; |
|
62 class tree_constant_rep; |
|
63 class tree_constant; |
|
64 class tree_matrix; |
|
65 class tree_builtin; |
|
66 class tree_identifier; |
|
67 class tree_function; |
|
68 class tree_expression; |
|
69 class tree_prefix_expression; |
|
70 class tree_postfix_expression; |
|
71 class tree_unary_expression; |
|
72 class tree_binary_expression; |
|
73 class tree_assignment_expression; |
|
74 class tree_simple_assignment_expression; |
|
75 class tree_multi_assignment_expression; |
|
76 class tree_colon_expression; |
|
77 class tree_index_expression; |
|
78 class tree_argument_list; |
|
79 class tree_parameter_list; |
|
80 class tree_return_list; |
|
81 class tree_command; |
|
82 class tree_command_list; |
195
|
83 class tree_global_command; |
1
|
84 class tree_while_command; |
|
85 class tree_for_command; |
|
86 class tree_if_command; |
|
87 class tree_break_command; |
|
88 class tree_continue_command; |
|
89 class tree_return_command; |
|
90 class tree_plot_limits; |
|
91 class tree_plot_range; |
|
92 class tree_subplot; |
|
93 class tree_subplot_using; |
|
94 class tree_subplot_style; |
|
95 class tree_subplot_list; |
|
96 class tree_plot_command; |
|
97 |
|
98 /* |
|
99 * General matrices. This allows us to construct matrices from |
|
100 * other matrices, variables, and functions. |
|
101 */ |
|
102 class |
|
103 tree_matrix : public tree |
|
104 { |
|
105 public: |
|
106 tree_matrix (void); |
|
107 tree_matrix (tree *t, tree::matrix_dir d); |
|
108 |
|
109 ~tree_matrix (void); |
|
110 |
|
111 tree_matrix *chain (tree *t, tree::matrix_dir d); |
|
112 tree_matrix *reverse (void); |
|
113 int length (void); |
|
114 |
|
115 tree_return_list *to_return_list (void); |
|
116 |
|
117 tree_constant eval (int print); |
|
118 |
|
119 private: |
|
120 tree::matrix_dir dir; // Direction to the next element. |
|
121 tree *element; |
|
122 tree_matrix *next; |
|
123 }; |
|
124 |
|
125 /* |
|
126 * Builtin functions. |
|
127 */ |
|
128 class |
|
129 tree_builtin : public tree |
|
130 { |
|
131 public: |
195
|
132 tree_builtin (const char *nm = (char *) NULL); |
|
133 |
|
134 tree_builtin (int i_max, int o_max, Mapper_fcn& m_fcn, |
|
135 const char *nm = (char *) NULL); |
|
136 |
|
137 tree_builtin (int i_max, int o_max, Text_fcn t_fcn, |
|
138 const char *nm = (char *) NULL); |
|
139 |
|
140 tree_builtin (int i_max, int o_max, General_fcn t_fcn, |
|
141 const char *nm = (char *) NULL); |
1
|
142 |
|
143 ~tree_builtin (void); |
|
144 |
164
|
145 int is_builtin (void) const; |
1
|
146 |
|
147 tree_constant eval (int print); |
|
148 |
|
149 tree_constant *eval (int print, int nargout); |
|
150 |
482
|
151 tree_constant *eval (const tree_constant *args, int nargin, |
|
152 int nargout, int print); |
1
|
153 |
200
|
154 char *name (void) const; |
1
|
155 |
|
156 int max_expected_args (void); |
|
157 |
|
158 private: |
|
159 int nargin_max; |
|
160 int nargout_max; |
|
161 Mapper_fcn mapper_fcn; |
|
162 Text_fcn text_fcn; |
|
163 General_fcn general_fcn; |
195
|
164 char *my_name; |
1
|
165 }; |
|
166 |
|
167 /* |
|
168 * Symbols from the symbol table. |
|
169 */ |
|
170 class |
|
171 tree_identifier : public tree |
|
172 { |
|
173 friend class tree_index_expression; |
|
174 |
|
175 public: |
143
|
176 tree_identifier (int l = -1, int c = -1); |
|
177 tree_identifier (symbol_record *s, int l = -1, int c = -1); |
1
|
178 |
|
179 ~tree_identifier (void); |
|
180 |
164
|
181 int is_identifier (void) const; |
1
|
182 |
200
|
183 char *name (void) const; |
195
|
184 void rename (const char *n); |
1
|
185 |
|
186 tree_identifier *define (tree_constant *t); |
|
187 tree_identifier *define (tree_function *t); |
|
188 |
|
189 void document (char *s); |
|
190 |
|
191 tree_constant assign (tree_constant& t); |
|
192 tree_constant assign (tree_constant& t, tree_constant *args, int nargs); |
|
193 |
|
194 void bump_value (tree::expression_type); |
|
195 |
338
|
196 int parse_fcn_file (int exec_script = 1); |
339
|
197 int parse_fcn_file (char *ff, int exec_script = 1); |
|
198 void parse_fcn_file (FILE *ffile, char *ff); |
1
|
199 |
|
200 tree *do_lookup (int& script_file_executed); |
|
201 |
|
202 void mark_as_formal_parameter (void); |
|
203 |
195
|
204 void mark_for_possible_ans_assign (void); |
|
205 |
1
|
206 tree_constant eval (int print); |
|
207 |
|
208 tree_constant *eval (int print, int nargout); |
|
209 |
482
|
210 tree_constant *eval (const tree_constant *args, int nargin, |
|
211 int nargout, int print); |
1
|
212 |
|
213 void eval_undefined_error (void); |
|
214 |
|
215 private: |
|
216 symbol_record *sym; |
195
|
217 int maybe_do_ans_assign; |
1
|
218 }; |
|
219 |
|
220 /* |
|
221 * User defined functions. |
|
222 */ |
|
223 class |
|
224 tree_function : public tree |
|
225 { |
|
226 public: |
|
227 tree_function (void); |
|
228 tree_function (tree *cl, symbol_table *st); |
|
229 |
|
230 ~tree_function (void); |
|
231 |
|
232 tree_function *define (tree *t); |
|
233 tree_function *define_param_list (tree_parameter_list *t); |
|
234 tree_function *define_ret_list (tree_parameter_list *t); |
|
235 |
338
|
236 void stash_fcn_file_name (char * s); |
|
237 void stash_fcn_file_time (time_t t); |
1
|
238 |
338
|
239 char *fcn_file_name (void); |
1
|
240 time_t time_parsed (void); |
|
241 |
338
|
242 void mark_as_system_fcn_file (void); |
|
243 int is_system_fcn_file (void) const; |
195
|
244 |
206
|
245 int takes_varargs (void) const; |
367
|
246 void octave_va_start (void); |
|
247 tree_constant octave_va_arg (void); |
206
|
248 |
143
|
249 void stash_function_name (char *s); |
|
250 char *function_name (void); |
|
251 |
1
|
252 tree_constant eval (int print); |
|
253 |
|
254 tree_constant *eval (int print, int nargout); |
|
255 |
482
|
256 tree_constant *eval (const tree_constant *args, int nargin, |
|
257 int nargout, int print); |
1
|
258 |
|
259 int max_expected_args (void); |
|
260 |
143
|
261 void traceback_error (void); |
|
262 |
1
|
263 private: |
|
264 int call_depth; |
|
265 tree_parameter_list *param_list; |
|
266 tree_parameter_list *ret_list; |
|
267 symbol_table *sym_tab; |
|
268 tree *cmd_list; |
143
|
269 char *file_name; |
|
270 char *fcn_name; |
1
|
271 time_t t_parsed; |
338
|
272 int system_fcn_file; |
206
|
273 int varargs_ok; |
210
|
274 int num_named_args; |
206
|
275 const tree_constant *args_passed; |
|
276 int num_args_passed; |
|
277 int curr_arg_number; |
1
|
278 }; |
|
279 |
|
280 /* |
|
281 * A base class for expressions. |
|
282 */ |
|
283 class |
|
284 tree_expression : public tree |
|
285 { |
|
286 public: |
|
287 tree_expression (void); |
|
288 |
|
289 ~tree_expression (void); |
|
290 |
|
291 tree_constant eval (int print); |
|
292 |
|
293 protected: |
|
294 expression_type etype; |
|
295 }; |
|
296 |
|
297 /* |
|
298 * Prefix expressions. |
|
299 */ |
|
300 class |
|
301 tree_prefix_expression : public tree_expression |
|
302 { |
|
303 public: |
143
|
304 tree_prefix_expression (int l = -1, int c = -1); |
|
305 tree_prefix_expression (tree_identifier *t, tree::expression_type et, |
|
306 int l = -1, int c = -1); |
1
|
307 |
|
308 ~tree_prefix_expression (void); |
|
309 |
|
310 tree_constant eval (int print); |
|
311 |
143
|
312 void eval_error (void); |
|
313 |
195
|
314 int is_prefix_expression (void) const; |
|
315 |
1
|
316 private: |
|
317 tree_identifier *id; |
|
318 }; |
|
319 |
|
320 /* |
|
321 * Postfix expressions. |
|
322 */ |
|
323 class |
|
324 tree_postfix_expression : public tree_expression |
|
325 { |
|
326 public: |
143
|
327 tree_postfix_expression (int l = -1, int c = -1); |
|
328 tree_postfix_expression (tree_identifier *t, tree::expression_type et, |
|
329 int l = -1, int c = -1); |
1
|
330 |
|
331 ~tree_postfix_expression (void); |
|
332 |
|
333 tree_constant eval (int print); |
|
334 |
143
|
335 void eval_error (void); |
|
336 |
1
|
337 private: |
|
338 tree_identifier *id; |
|
339 }; |
|
340 |
|
341 /* |
|
342 * Unary expressions. |
|
343 */ |
|
344 class |
|
345 tree_unary_expression : public tree_expression |
|
346 { |
|
347 public: |
143
|
348 tree_unary_expression (int l = -1, int c = -1); |
|
349 tree_unary_expression (tree *a, tree::expression_type t, int l = -1, |
|
350 int c = -1); |
1
|
351 |
|
352 ~tree_unary_expression (void); |
|
353 |
|
354 tree_constant eval (int print); |
|
355 |
143
|
356 void eval_error (void); |
|
357 |
1
|
358 private: |
|
359 tree *op; |
|
360 }; |
|
361 |
|
362 /* |
|
363 * Binary expressions. |
|
364 */ |
|
365 class |
|
366 tree_binary_expression : public tree_expression |
|
367 { |
|
368 public: |
143
|
369 tree_binary_expression (int l = -1, int c = -1); |
|
370 tree_binary_expression (tree *a, tree *b, tree::expression_type t, |
|
371 int l = -1, int c = -1); |
1
|
372 |
|
373 ~tree_binary_expression (void); |
|
374 |
|
375 tree_constant eval (int print); |
|
376 |
143
|
377 void eval_error (void); |
|
378 |
1
|
379 private: |
|
380 tree *op1; |
|
381 tree *op2; |
|
382 }; |
|
383 |
|
384 /* |
|
385 * Assignment expressions. |
|
386 */ |
|
387 class |
|
388 tree_assignment_expression : public tree_expression |
|
389 { |
|
390 public: |
|
391 int in_parens; |
|
392 |
|
393 tree_assignment_expression (void); |
|
394 |
|
395 ~tree_assignment_expression (void); |
|
396 |
|
397 tree_constant eval (int print); |
|
398 |
164
|
399 int is_assignment_expression (void) const; |
1
|
400 }; |
|
401 |
|
402 /* |
|
403 * Simple assignment expressions. |
|
404 */ |
|
405 class |
|
406 tree_simple_assignment_expression : public tree_assignment_expression |
|
407 { |
|
408 public: |
143
|
409 tree_simple_assignment_expression (int l = -1, int c = -1); |
|
410 tree_simple_assignment_expression (tree_identifier *i, tree *r, |
|
411 int l = -1, int c = -1); |
|
412 tree_simple_assignment_expression (tree_index_expression *idx_expr, |
|
413 tree *r, int l = -1, int c = -1); |
1
|
414 |
|
415 ~tree_simple_assignment_expression (void); |
|
416 |
|
417 tree_constant eval (int print); |
|
418 |
143
|
419 void eval_error (void); |
|
420 |
1
|
421 private: |
|
422 tree_identifier *lhs; |
|
423 tree_argument_list *index; |
|
424 tree *rhs; |
|
425 }; |
|
426 |
|
427 /* |
|
428 * Multi-valued assignment expressions. |
|
429 */ |
|
430 class |
|
431 tree_multi_assignment_expression : public tree_assignment_expression |
|
432 { |
|
433 public: |
143
|
434 tree_multi_assignment_expression (int l = -1, int c = -1); |
|
435 tree_multi_assignment_expression (tree_return_list *lst, tree *r, |
|
436 int l = -1, int c = -1); |
1
|
437 |
|
438 ~tree_multi_assignment_expression (void); |
|
439 |
|
440 tree_constant eval (int print); |
|
441 |
|
442 tree_constant *eval (int print, int nargout); |
|
443 |
143
|
444 void eval_error (void); |
|
445 |
1
|
446 private: |
|
447 tree_return_list *lhs; |
|
448 tree *rhs; |
|
449 }; |
|
450 |
|
451 /* |
|
452 * Colon expressions. |
|
453 */ |
|
454 class |
|
455 tree_colon_expression : public tree_expression |
|
456 { |
|
457 public: |
143
|
458 tree_colon_expression (int l = -1, int c = -1); |
|
459 tree_colon_expression (tree *a, tree *b, int l = -1, int c = -1); |
1
|
460 |
|
461 ~tree_colon_expression (void); |
|
462 |
|
463 tree_colon_expression *chain (tree *t); |
|
464 |
|
465 tree_constant eval (int print); |
|
466 |
143
|
467 void eval_error (const char *s); |
|
468 |
1
|
469 private: |
|
470 tree *op1; |
|
471 tree *op2; |
|
472 tree *op3; |
|
473 }; |
|
474 |
|
475 /* |
|
476 * Index expressions. |
|
477 */ |
|
478 class |
|
479 tree_index_expression : public tree_expression |
|
480 { |
|
481 public: |
143
|
482 tree_index_expression (int l = -1, int c = -1); |
|
483 tree_index_expression (tree_identifier *i, int l = -1, int c = -1); |
|
484 tree_index_expression (tree_identifier *i, tree_argument_list *lst, |
|
485 int l = -1, int c = -1); |
1
|
486 |
|
487 ~tree_index_expression (void); |
|
488 |
164
|
489 int is_index_expression (void) const; |
1
|
490 |
|
491 tree_identifier *ident (void); |
|
492 |
|
493 tree_argument_list *arg_list (void); |
|
494 |
195
|
495 void mark_for_possible_ans_assign (void); |
|
496 |
1
|
497 tree_constant eval (int print); |
|
498 |
|
499 tree_constant *eval (int print, int nargout); |
|
500 |
143
|
501 void eval_error (void); |
|
502 |
1
|
503 private: |
|
504 tree_identifier *id; |
|
505 tree_argument_list *list; |
|
506 }; |
|
507 |
|
508 /* |
|
509 * Argument lists. |
|
510 */ |
|
511 class |
|
512 tree_argument_list : public tree |
|
513 { |
|
514 public: |
|
515 tree_argument_list (void); |
|
516 tree_argument_list (tree *t); |
|
517 |
|
518 ~tree_argument_list (void); |
|
519 |
|
520 tree_argument_list *chain (tree *t); |
|
521 tree_argument_list *reverse (void); |
|
522 int length (void); |
|
523 |
|
524 tree_argument_list *next_elem (void); |
|
525 |
|
526 tree_constant *convert_to_const_vector (int& nargs); |
|
527 |
|
528 tree_constant eval (int print); |
|
529 |
|
530 private: |
|
531 tree *arg; |
|
532 tree_argument_list *next; |
|
533 }; |
|
534 |
|
535 /* |
|
536 * Parameter lists. Almost like argument lists, except that the |
|
537 * elements are only supposed to be identifiers, never constants or |
|
538 * expressions. |
|
539 */ |
|
540 class |
|
541 tree_parameter_list : public tree |
|
542 { |
|
543 public: |
|
544 tree_parameter_list (void); |
|
545 tree_parameter_list (tree_identifier *t); |
|
546 |
|
547 ~tree_parameter_list (void); |
|
548 |
|
549 tree_parameter_list *chain (tree_identifier *t); |
|
550 tree_parameter_list *reverse (void); |
|
551 int length (void); |
|
552 |
200
|
553 char *name (void) const; |
1
|
554 |
|
555 void mark_as_formal_parameters (void); |
|
556 |
206
|
557 void mark_varargs (void); |
|
558 int takes_varargs (void) const; |
|
559 |
1
|
560 tree_identifier *define (tree_constant *t); |
|
561 |
395
|
562 void define_from_arg_vector (const tree_constant *args, int nargin); |
|
563 |
|
564 tree_constant *convert_to_const_vector (void); |
|
565 |
1
|
566 tree_parameter_list *next_elem (void); |
|
567 |
|
568 tree_constant eval (int print); |
|
569 |
|
570 private: |
206
|
571 int marked_for_varargs; |
1
|
572 tree_identifier *param; |
|
573 tree_parameter_list *next; |
|
574 }; |
|
575 |
|
576 /* |
|
577 * Return lists. Almost like parameter lists, except that the |
|
578 * elements may also be index expressions. |
|
579 */ |
|
580 class |
|
581 tree_return_list : public tree |
|
582 { |
|
583 public: |
|
584 tree_return_list (void); |
|
585 tree_return_list (tree_identifier *t); |
|
586 tree_return_list (tree_index_expression *t); |
|
587 |
|
588 ~tree_return_list (void); |
|
589 |
|
590 tree_return_list *chain (tree_identifier *t); |
|
591 tree_return_list *chain (tree_index_expression *t); |
|
592 tree_return_list *reverse (void); |
|
593 int length (void); |
|
594 |
|
595 tree_index_expression *idx_expr (void); |
|
596 |
|
597 tree_return_list *next_elem (void); |
|
598 |
|
599 tree_constant eval (int print); |
|
600 |
|
601 private: |
|
602 tree_index_expression *retval; |
|
603 tree_return_list *next; |
|
604 }; |
|
605 |
|
606 /* |
|
607 * A base class for commands. |
|
608 */ |
|
609 class |
|
610 tree_command : public tree |
|
611 { |
|
612 }; |
|
613 |
|
614 /* |
|
615 * A command or two to be executed. |
|
616 */ |
|
617 class |
|
618 tree_command_list : public tree_command |
|
619 { |
|
620 public: |
|
621 tree_command_list (void); |
|
622 tree_command_list (tree *t); |
|
623 |
|
624 ~tree_command_list (void); |
|
625 |
|
626 tree_command_list *chain (tree *t); |
|
627 tree_command_list *reverse (void); |
|
628 |
|
629 void set_print_flag (int print); |
|
630 |
|
631 tree_constant eval (int print); |
|
632 |
|
633 private: |
|
634 tree *command; // Command to execute. |
|
635 int print_flag; // Print result of eval for this command? |
|
636 tree_command_list *next; // Next command in list. |
|
637 }; |
|
638 |
|
639 /* |
195
|
640 * Global. |
|
641 */ |
|
642 class |
|
643 tree_global_command : public tree_command |
|
644 { |
|
645 public: |
|
646 tree_global_command (int l = -1, int c = -1); |
|
647 tree_global_command (symbol_record *s, int l = -1, int c = -1); |
|
648 tree_global_command (symbol_record *s, tree *e, int l = -1, int c = -1); |
|
649 |
|
650 ~tree_global_command (void); |
|
651 |
|
652 tree_global_command *chain (symbol_record *s, int l = -1, int c = -1); |
|
653 tree_global_command *chain (symbol_record *s, tree *e, int l = -1, int c = -1); |
|
654 tree_global_command *reverse (void); |
|
655 |
|
656 tree_constant eval (int print); |
|
657 |
|
658 void eval_error (void); |
|
659 |
|
660 private: |
|
661 symbol_record *sr; // Symbol record from local symbol table. |
|
662 tree *rhs; // RHS of assignment. |
|
663 tree_global_command *next; // Next global command. |
|
664 }; |
|
665 |
|
666 /* |
1
|
667 * While. |
|
668 */ |
|
669 class |
|
670 tree_while_command : public tree_command |
|
671 { |
|
672 public: |
191
|
673 tree_while_command (int l = -1, int c = -1); |
|
674 tree_while_command (tree *e, int l = -1, int c = -1); |
|
675 tree_while_command (tree *e, tree *lst, int l = -1, int c = -1); |
1
|
676 |
|
677 ~tree_while_command (void); |
|
678 |
|
679 tree_constant eval (int print); |
|
680 |
191
|
681 void eval_error (void); |
|
682 |
1
|
683 private: |
|
684 tree *expr; // Expression to test. |
|
685 tree *list; // List of commands to execute. |
|
686 }; |
|
687 |
|
688 /* |
|
689 * For. |
|
690 */ |
|
691 class |
|
692 tree_for_command : public tree_command |
|
693 { |
|
694 public: |
191
|
695 tree_for_command (int l = -1, int c = -1); |
|
696 tree_for_command (tree_index_expression *id, tree *e, tree *lst, |
|
697 int l = -1, int c = -1); |
1
|
698 |
|
699 ~tree_for_command (void); |
|
700 |
|
701 tree_constant eval (int print); |
|
702 |
191
|
703 void eval_error (void); |
|
704 |
1
|
705 private: |
413
|
706 tree_constant do_for_loop_once (tree_constant *rhs, int& quit); |
|
707 |
117
|
708 tree_index_expression *id; // Identifier to modify. |
1
|
709 tree *expr; // Expression to evaluate. |
|
710 tree *list; // List of commands to execute. |
|
711 }; |
|
712 |
|
713 /* |
|
714 * Simple if. |
|
715 */ |
|
716 class |
|
717 tree_if_command : public tree_command |
|
718 { |
|
719 public: |
191
|
720 tree_if_command (int l = -1, int c = -1); |
|
721 tree_if_command (tree *t, int l = -1, int c = -1); |
|
722 tree_if_command (tree *e, tree *t, int l = -1, int c = -1); |
1
|
723 |
|
724 ~tree_if_command (void); |
|
725 |
191
|
726 tree_if_command *chain (tree *t, int l = -1, int c = -1); |
|
727 tree_if_command *chain (tree *t1, tree *t2, int l = -1, int c = -1); |
1
|
728 tree_if_command *reverse (void); |
|
729 |
|
730 tree_constant eval (int print); |
|
731 |
191
|
732 void eval_error (void); |
|
733 |
1
|
734 private: |
|
735 tree *expr; // Expression to test. |
|
736 tree *list; // Commands to execute. |
|
737 tree_if_command *next; // Next if command. |
|
738 }; |
|
739 |
|
740 /* |
|
741 * Break. |
|
742 */ |
|
743 class |
|
744 tree_break_command : public tree_command |
|
745 { |
|
746 public: |
191
|
747 tree_break_command (int l = -1, int c = -1); |
1
|
748 |
|
749 ~tree_break_command (void); |
|
750 |
|
751 tree_constant eval (int print); |
|
752 }; |
|
753 |
|
754 /* |
|
755 * Continue. |
|
756 */ |
|
757 class |
|
758 tree_continue_command : public tree_command |
|
759 { |
|
760 public: |
191
|
761 tree_continue_command (int l = -1, int c = -1); |
1
|
762 |
|
763 ~tree_continue_command (void); |
|
764 |
|
765 tree_constant eval (int print); |
|
766 }; |
|
767 |
|
768 /* |
|
769 * Return. |
|
770 */ |
|
771 class |
|
772 tree_return_command : public tree_command |
|
773 { |
|
774 public: |
191
|
775 tree_return_command (int l = -1, int c = -1); |
1
|
776 |
|
777 ~tree_return_command (void); |
|
778 |
|
779 tree_constant eval (int print); |
|
780 }; |
|
781 |
|
782 #endif |
|
783 |
|
784 /* |
|
785 ;;; Local Variables: *** |
|
786 ;;; mode: C++ *** |
|
787 ;;; page-delimiter: "^/\\*" *** |
|
788 ;;; End: *** |
|
789 */ |