494
|
1 /* |
|
2 |
1827
|
3 Copyright (C) 1996 John W. Eaton |
494
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
494
|
20 |
|
21 */ |
|
22 |
1297
|
23 #if defined (__GNUG__) |
|
24 #pragma implementation |
|
25 #endif |
|
26 |
494
|
27 #ifdef HAVE_CONFIG_H |
1192
|
28 #include <config.h> |
494
|
29 #endif |
|
30 |
|
31 #include <iostream.h> |
|
32 |
1059
|
33 // Nonzero means we're breaking out of a loop or function body. |
578
|
34 int breaking = 0; |
|
35 |
|
36 // Nonzero means we're jumping to the end of a loop. |
|
37 int continuing = 0; |
|
38 |
|
39 // Nonzero means we're returning from a function. Global because it |
|
40 // is also needed in tree-expr.cc. |
|
41 int returning = 0; |
|
42 |
494
|
43 #include "error.h" |
|
44 #include "gripes.h" |
1352
|
45 #include "oct-map.h" |
|
46 #include "symtab.h" |
1742
|
47 #include "pt-cmd.h" |
|
48 #include "pt-const.h" |
|
49 #include "pt-exp.h" |
|
50 #include "pt-fvc.h" |
|
51 #include "pt-misc.h" |
|
52 #include "pt-mvr.h" |
2124
|
53 #include "pt-walk.h" |
916
|
54 #include "unwind-prot.h" |
1352
|
55 #include "user-prefs.h" |
|
56 #include "variables.h" |
494
|
57 |
|
58 // Decide if it's time to quit a for or while loop. |
1827
|
59 static inline bool |
494
|
60 quit_loop_now (void) |
|
61 { |
1228
|
62 // Maybe handle `continue N' someday... |
494
|
63 |
|
64 if (continuing) |
|
65 continuing--; |
|
66 |
1827
|
67 bool quit = (returning || breaking || continuing); |
494
|
68 |
|
69 if (breaking) |
|
70 breaking--; |
|
71 |
|
72 return quit; |
|
73 } |
|
74 |
|
75 // But first, some extra functions used by the tree classes. |
|
76 |
|
77 // We seem to have no use for this now. Maybe it will be needed at |
|
78 // some future date, so here it is. |
|
79 #if 0 |
578
|
80 |
|
81 // Convert a linked list of trees to a vector of pointers to trees. |
|
82 |
494
|
83 static tree ** |
|
84 list_to_vector (tree *list, int& len) |
|
85 { |
|
86 len = list->length () + 1; |
|
87 |
|
88 tree **args = new tree * [len]; |
|
89 |
1228
|
90 // args[0] may eventually hold something useful, like the function |
|
91 // name. |
|
92 |
494
|
93 tree *tmp_list = list; |
|
94 for (int k = 1; k < len; k++) |
|
95 { |
|
96 args[k] = tmp_list; |
|
97 tmp_list = tmp_list->next_elem (); |
|
98 } |
|
99 return args; |
|
100 } |
|
101 #endif |
|
102 |
578
|
103 // Global. |
494
|
104 |
578
|
105 tree_global_command::~tree_global_command (void) |
494
|
106 { |
578
|
107 delete init_list; |
494
|
108 } |
|
109 |
|
110 void |
578
|
111 tree_global_command::eval (void) |
494
|
112 { |
578
|
113 if (init_list) |
|
114 init_list->eval (); |
494
|
115 |
|
116 if (error_state > 0) |
|
117 ::error ("evaluating global command near line %d, column %d", |
|
118 line (), column ()); |
|
119 } |
|
120 |
581
|
121 void |
2124
|
122 tree_global_command::accept (tree_walker& tw) |
581
|
123 { |
2124
|
124 tw.visit_global_command (*this); |
581
|
125 } |
|
126 |
578
|
127 // While. |
494
|
128 |
|
129 tree_while_command::~tree_while_command (void) |
|
130 { |
|
131 delete expr; |
|
132 delete list; |
|
133 } |
|
134 |
578
|
135 void |
|
136 tree_while_command::eval (void) |
494
|
137 { |
|
138 if (error_state) |
578
|
139 return; |
494
|
140 |
1491
|
141 if (! expr) |
|
142 panic_impossible (); |
|
143 |
494
|
144 for (;;) |
|
145 { |
1491
|
146 if (expr->is_logically_true ("while")) |
494
|
147 { |
529
|
148 if (list) |
494
|
149 { |
578
|
150 list->eval (1); |
494
|
151 if (error_state) |
|
152 { |
|
153 eval_error (); |
578
|
154 return; |
494
|
155 } |
|
156 } |
|
157 |
|
158 if (quit_loop_now ()) |
|
159 break; |
|
160 } |
|
161 else |
|
162 break; |
|
163 } |
|
164 } |
|
165 |
|
166 void |
|
167 tree_while_command::eval_error (void) |
|
168 { |
|
169 if (error_state > 0) |
|
170 ::error ("evaluating while command near line %d, column %d", |
|
171 line (), column ()); |
|
172 } |
|
173 |
581
|
174 void |
2124
|
175 tree_while_command::accept (tree_walker& tw) |
581
|
176 { |
2124
|
177 tw.visit_while_command (*this); |
581
|
178 } |
|
179 |
578
|
180 // For. |
494
|
181 |
|
182 tree_for_command::~tree_for_command (void) |
|
183 { |
|
184 delete id; |
1228
|
185 delete id_list; |
494
|
186 delete expr; |
|
187 delete list; |
|
188 } |
|
189 |
1168
|
190 inline void |
1228
|
191 tree_for_command::do_for_loop_once (tree_return_list *lst, |
2086
|
192 const octave_value_list& rhs, bool& quit) |
1228
|
193 { |
1827
|
194 quit = false; |
1228
|
195 |
|
196 tree_oct_obj *tmp = new tree_oct_obj (rhs); |
|
197 tree_multi_assignment_expression tmp_ass (lst, tmp, 1); |
1827
|
198 tmp_ass.eval (false); |
1228
|
199 |
|
200 if (error_state) |
|
201 { |
|
202 eval_error (); |
|
203 return; |
|
204 } |
|
205 |
|
206 if (list) |
|
207 { |
|
208 list->eval (1); |
|
209 if (error_state) |
|
210 { |
|
211 eval_error (); |
1827
|
212 quit = true; |
1228
|
213 return; |
|
214 } |
|
215 } |
|
216 |
|
217 quit = quit_loop_now (); |
|
218 } |
|
219 |
|
220 inline void |
|
221 tree_for_command::do_for_loop_once (tree_index_expression *idx_expr, |
2086
|
222 const octave_value& rhs, bool& quit) |
1168
|
223 { |
1827
|
224 quit = false; |
1168
|
225 |
2086
|
226 octave_value *tmp = new octave_value (rhs); |
1827
|
227 tree_simple_assignment_expression tmp_ass (idx_expr, tmp, true); |
|
228 tmp_ass.eval (false); |
1168
|
229 |
|
230 if (error_state) |
|
231 { |
|
232 eval_error (); |
|
233 return; |
|
234 } |
|
235 |
|
236 if (list) |
|
237 { |
|
238 list->eval (1); |
|
239 if (error_state) |
|
240 { |
|
241 eval_error (); |
1827
|
242 quit = true; |
1168
|
243 return; |
|
244 } |
|
245 } |
|
246 |
|
247 quit = quit_loop_now (); |
|
248 } |
|
249 |
|
250 inline void |
|
251 tree_for_command::do_for_loop_once (tree_identifier *ident, |
2086
|
252 octave_value& rhs, bool& quit) |
1168
|
253 { |
1827
|
254 quit = false; |
1168
|
255 |
|
256 ident->assign (rhs); |
|
257 |
|
258 if (error_state) |
|
259 { |
|
260 eval_error (); |
|
261 return; |
|
262 } |
|
263 |
|
264 if (list) |
|
265 { |
|
266 list->eval (1); |
|
267 if (error_state) |
|
268 { |
|
269 eval_error (); |
1827
|
270 quit = true; |
1168
|
271 return; |
|
272 } |
|
273 } |
|
274 |
|
275 quit = quit_loop_now (); |
|
276 } |
|
277 |
|
278 #define DO_LOOP(val) \ |
|
279 do \ |
|
280 { \ |
|
281 if (ident) \ |
|
282 for (int i = 0; i < steps; i++) \ |
|
283 { \ |
2086
|
284 octave_value rhs (val); \ |
1827
|
285 bool quit = false; \ |
1168
|
286 do_for_loop_once (ident, rhs, quit); \ |
|
287 if (quit) \ |
|
288 break; \ |
|
289 } \ |
1228
|
290 else if (id_list) \ |
|
291 for (int i = 0; i < steps; i++) \ |
|
292 { \ |
2086
|
293 octave_value_list rhs (val); \ |
1827
|
294 bool quit = false; \ |
1228
|
295 do_for_loop_once (id_list, rhs, quit); \ |
|
296 if (quit) \ |
|
297 break; \ |
|
298 } \ |
1168
|
299 else \ |
|
300 for (int i = 0; i < steps; i++) \ |
|
301 { \ |
2086
|
302 octave_value rhs (val); \ |
1827
|
303 bool quit = false; \ |
1228
|
304 do_for_loop_once (tmp_id, rhs, quit); \ |
1168
|
305 if (quit) \ |
|
306 break; \ |
|
307 } \ |
|
308 } \ |
|
309 while (0) |
|
310 |
578
|
311 void |
|
312 tree_for_command::eval (void) |
494
|
313 { |
529
|
314 if (error_state || ! expr) |
578
|
315 return; |
494
|
316 |
2086
|
317 octave_value tmp_expr = expr->eval (false); |
494
|
318 |
|
319 if (error_state || tmp_expr.is_undefined ()) |
|
320 { |
|
321 eval_error (); |
578
|
322 return; |
494
|
323 } |
|
324 |
1228
|
325 tree_index_expression *tmp_id = id; |
|
326 if (id_list && id_list->length () == 1) |
|
327 tmp_id = id_list->front (); |
|
328 |
1168
|
329 tree_identifier *ident = 0; |
1228
|
330 if (tmp_id && ! tmp_id->arg_list ()) |
1168
|
331 { |
1228
|
332 tree_indirect_ref *idr = tmp_id->ident (); |
1168
|
333 if (idr->is_identifier_only ()) |
|
334 ident = idr->ident (); |
|
335 } |
|
336 |
1234
|
337 if (id_list && ! ident && ! tmp_expr.is_map ()) |
1228
|
338 { |
|
339 error ("in statement `for [X, Y] = VAL', VAL must be a structure"); |
|
340 return; |
|
341 } |
|
342 |
620
|
343 if (tmp_expr.is_scalar_type ()) |
|
344 { |
1827
|
345 bool quit = false; |
1168
|
346 if (ident) |
|
347 do_for_loop_once (ident, tmp_expr, quit); |
1228
|
348 else if (id_list) |
|
349 { |
2086
|
350 octave_value_list rhs (tmp_expr); |
1228
|
351 do_for_loop_once (id_list, rhs, quit); |
|
352 } |
1168
|
353 else |
1228
|
354 do_for_loop_once (tmp_id, tmp_expr, quit); |
620
|
355 } |
|
356 else if (tmp_expr.is_matrix_type ()) |
494
|
357 { |
620
|
358 Matrix m_tmp; |
|
359 ComplexMatrix cm_tmp; |
|
360 int nr; |
|
361 int steps; |
|
362 if (tmp_expr.is_real_matrix ()) |
|
363 { |
|
364 m_tmp = tmp_expr.matrix_value (); |
|
365 nr = m_tmp.rows (); |
|
366 steps = m_tmp.columns (); |
|
367 } |
|
368 else |
|
369 { |
|
370 cm_tmp = tmp_expr.complex_matrix_value (); |
|
371 nr = cm_tmp.rows (); |
|
372 steps = cm_tmp.columns (); |
|
373 } |
494
|
374 |
1168
|
375 if (tmp_expr.is_real_matrix ()) |
620
|
376 { |
|
377 if (nr == 1) |
1168
|
378 DO_LOOP(m_tmp (0, i)); |
620
|
379 else |
1168
|
380 DO_LOOP(m_tmp.extract (0, i, nr-1, i)); |
|
381 } |
|
382 else |
|
383 { |
|
384 if (nr == 1) |
|
385 DO_LOOP(cm_tmp (0, i)); |
|
386 else |
|
387 DO_LOOP(cm_tmp.extract (0, i, nr-1, i)); |
620
|
388 } |
|
389 } |
|
390 else if (tmp_expr.is_string ()) |
|
391 { |
494
|
392 gripe_string_invalid (); |
620
|
393 } |
|
394 else if (tmp_expr.is_range ()) |
|
395 { |
|
396 Range rng = tmp_expr.range_value (); |
494
|
397 |
620
|
398 int steps = rng.nelem (); |
|
399 double b = rng.base (); |
|
400 double increment = rng.inc (); |
494
|
401 |
1168
|
402 if (ident) |
620
|
403 { |
1168
|
404 for (int i = 0; i < steps; i++) |
|
405 { |
|
406 double tmp_val = b + i * increment; |
|
407 |
2086
|
408 octave_value rhs (tmp_val); |
1168
|
409 |
1827
|
410 bool quit = false; |
1168
|
411 do_for_loop_once (ident, rhs, quit); |
494
|
412 |
1168
|
413 if (quit) |
|
414 break; |
|
415 } |
|
416 } |
1228
|
417 else if (id_list) |
|
418 { |
|
419 for (int i = 0; i < steps; i++) |
|
420 { |
|
421 double tmp_val = b + i * increment; |
|
422 |
2086
|
423 octave_value_list rhs (tmp_val); |
1228
|
424 |
1827
|
425 bool quit = false; |
1228
|
426 do_for_loop_once (id_list, rhs, quit); |
|
427 |
|
428 if (quit) |
|
429 break; |
|
430 } |
|
431 } |
1168
|
432 else |
|
433 { |
|
434 for (int i = 0; i < steps; i++) |
|
435 { |
|
436 double tmp_val = b + i * increment; |
494
|
437 |
2086
|
438 octave_value rhs (tmp_val); |
1168
|
439 |
1827
|
440 bool quit = false; |
1228
|
441 do_for_loop_once (tmp_id, rhs, quit); |
|
442 |
|
443 if (quit) |
|
444 break; |
|
445 } |
|
446 } |
|
447 } |
|
448 else if (tmp_expr.is_map ()) |
|
449 { |
|
450 if (ident) |
|
451 { |
|
452 Octave_map tmp_val (tmp_expr.map_value ()); |
|
453 |
|
454 for (Pix p = tmp_val.first (); p != 0; tmp_val.next (p)) |
|
455 { |
2086
|
456 octave_value rhs (tmp_val.contents (p)); |
1228
|
457 |
1827
|
458 bool quit = false; |
1228
|
459 do_for_loop_once (ident, rhs, quit); |
|
460 |
|
461 if (quit) |
|
462 break; |
|
463 } |
|
464 } |
|
465 else if (id_list) |
|
466 { |
|
467 // Cycle through structure elements. First element of |
|
468 // id_list is set to value and the second is set to the name |
|
469 // of the structure element. |
|
470 |
|
471 Octave_map tmp_val (tmp_expr.map_value ()); |
|
472 |
|
473 for (Pix p = tmp_val.first (); p != 0; tmp_val.next (p)) |
|
474 { |
2086
|
475 octave_value_list tmp; |
1228
|
476 tmp (1) = tmp_val.key (p); |
|
477 tmp (0) = tmp_val.contents (p); |
|
478 |
1827
|
479 bool quit = false; |
1228
|
480 do_for_loop_once (id_list, tmp, quit); |
|
481 |
|
482 if (quit) |
|
483 break; |
|
484 } |
|
485 } |
|
486 else |
|
487 { |
|
488 Octave_map tmp_val (tmp_expr.map_value ()); |
|
489 |
|
490 for (Pix p = tmp_val.first (); p != 0; tmp_val.next (p)) |
|
491 { |
2086
|
492 octave_value rhs = tmp_val.contents (p); |
1228
|
493 |
1827
|
494 bool quit = false; |
1228
|
495 do_for_loop_once (tmp_id, rhs, quit); |
1168
|
496 |
|
497 if (quit) |
|
498 break; |
|
499 } |
620
|
500 } |
|
501 } |
|
502 else |
|
503 { |
|
504 ::error ("invalid type in for loop expression near line %d, column %d", |
|
505 line (), column ()); |
494
|
506 } |
|
507 } |
|
508 |
|
509 void |
|
510 tree_for_command::eval_error (void) |
|
511 { |
|
512 if (error_state > 0) |
|
513 ::error ("evaluating for command near line %d, column %d", |
|
514 line (), column ()); |
|
515 } |
|
516 |
578
|
517 void |
2124
|
518 tree_for_command::accept (tree_walker& tw) |
581
|
519 { |
2124
|
520 tw.visit_for_command (*this); |
581
|
521 } |
|
522 |
578
|
523 // If. |
494
|
524 |
|
525 tree_if_command::~tree_if_command (void) |
|
526 { |
|
527 delete list; |
|
528 } |
|
529 |
|
530 void |
578
|
531 tree_if_command::eval (void) |
494
|
532 { |
578
|
533 if (list) |
|
534 list->eval (); |
|
535 |
494
|
536 if (error_state > 0) |
|
537 ::error ("evaluating if command near line %d, column %d", |
|
538 line (), column ()); |
|
539 } |
|
540 |
581
|
541 void |
2124
|
542 tree_if_command::accept (tree_walker& tw) |
581
|
543 { |
2124
|
544 tw.visit_if_command (*this); |
581
|
545 } |
|
546 |
916
|
547 // Simple exception handling. |
|
548 |
1489
|
549 tree_try_catch_command::~tree_try_catch_command (void) |
|
550 { |
|
551 delete try_code; |
|
552 delete catch_code; |
|
553 } |
|
554 |
|
555 static void |
|
556 do_catch_code (void *ptr) |
|
557 { |
|
558 tree_statement_list *list = (tree_statement_list *) ptr; |
|
559 |
|
560 // Set up for letting the user print any messages from errors that |
|
561 // occurred in the body of the try_catch statement. |
|
562 |
|
563 buffer_error_messages = 0; |
|
564 bind_global_error_variable (); |
|
565 add_unwind_protect (clear_global_error_variable, 0); |
|
566 |
|
567 // Similarly, if we have seen a return or break statement, allow all |
|
568 // the catch code to run before returning or handling the break. |
|
569 // We don't have to worry about continue statements because they can |
|
570 // only occur in loops. |
|
571 |
|
572 unwind_protect_int (returning); |
|
573 returning = 0; |
|
574 |
|
575 unwind_protect_int (breaking); |
|
576 breaking = 0; |
|
577 |
|
578 if (list) |
1827
|
579 list->eval (true); |
1489
|
580 |
|
581 // This is the one for breaking. (The unwind_protects are popped |
|
582 // off the stack in the reverse of the order they are pushed on). |
|
583 |
|
584 // XXX FIXME XXX -- inside a try-catch, should break work like |
|
585 // a return, or just jump to the end of the try_catch block? |
|
586 // The following code makes it just jump to the end of the block. |
|
587 |
|
588 run_unwind_protect (); |
|
589 if (breaking) |
|
590 breaking--; |
|
591 |
|
592 // This is the one for returning. |
|
593 |
|
594 if (returning) |
|
595 discard_unwind_protect (); |
|
596 else |
|
597 run_unwind_protect (); |
|
598 |
|
599 run_unwind_protect (); |
|
600 } |
|
601 |
|
602 void |
|
603 tree_try_catch_command::eval (void) |
|
604 { |
|
605 begin_unwind_frame ("tree_try_catch::eval"); |
|
606 |
|
607 add_unwind_protect (do_catch_code, catch_code); |
|
608 |
|
609 if (catch_code) |
|
610 { |
|
611 unwind_protect_int (buffer_error_messages); |
|
612 buffer_error_messages = 1; |
|
613 } |
|
614 |
|
615 if (try_code) |
1827
|
616 try_code->eval (true); |
1489
|
617 |
|
618 if (catch_code && error_state) |
|
619 { |
|
620 error_state = 0; |
|
621 run_unwind_frame ("tree_try_catch::eval"); |
|
622 } |
|
623 else |
|
624 { |
|
625 error_state = 0; |
|
626 discard_unwind_frame ("tree_try_catch::eval"); |
|
627 } |
|
628 } |
|
629 |
|
630 void |
2124
|
631 tree_try_catch_command::accept (tree_walker& tw) |
1489
|
632 { |
2124
|
633 tw.visit_try_catch_command (*this); |
1489
|
634 } |
|
635 |
|
636 // Simple exception handling. |
|
637 |
916
|
638 tree_unwind_protect_command::~tree_unwind_protect_command (void) |
|
639 { |
|
640 delete unwind_protect_code; |
|
641 delete cleanup_code; |
|
642 } |
|
643 |
|
644 static void |
|
645 do_unwind_protect_cleanup_code (void *ptr) |
|
646 { |
|
647 tree_statement_list *list = (tree_statement_list *) ptr; |
|
648 |
1228
|
649 // We want to run the cleanup code without error_state being set, |
|
650 // but we need to restore its value, so that any errors encountered |
|
651 // in the first part of the unwind_protect are not completely |
|
652 // ignored. |
916
|
653 |
|
654 unwind_protect_int (error_state); |
1266
|
655 error_state = 0; |
916
|
656 |
1266
|
657 // Similarly, if we have seen a return or break statement, allow all |
|
658 // the cleanup code to run before returning or handling the break. |
|
659 // We don't have to worry about continue statements because they can |
|
660 // only occur in loops. |
|
661 |
|
662 unwind_protect_int (returning); |
|
663 returning = 0; |
|
664 |
|
665 unwind_protect_int (breaking); |
|
666 breaking = 0; |
916
|
667 |
|
668 if (list) |
1827
|
669 list->eval (true); |
916
|
670 |
1266
|
671 // This is the one for breaking. (The unwind_protects are popped |
|
672 // off the stack in the reverse of the order they are pushed on). |
|
673 |
|
674 // XXX FIXME XXX -- inside an unwind_protect, should break work like |
|
675 // a return, or just jump to the end of the unwind_protect block? |
|
676 // The following code makes it just jump to the end of the block. |
|
677 |
|
678 run_unwind_protect (); |
|
679 if (breaking) |
|
680 breaking--; |
|
681 |
|
682 // This is the one for returning. |
|
683 |
|
684 if (returning) |
|
685 discard_unwind_protect (); |
|
686 else |
|
687 run_unwind_protect (); |
|
688 |
1228
|
689 // We don't want to ignore errors that occur in the cleanup code, so |
|
690 // if an error is encountered there, leave error_state alone. |
|
691 // Otherwise, set it back to what it was before. |
916
|
692 |
|
693 if (error_state) |
|
694 discard_unwind_protect (); |
|
695 else |
|
696 run_unwind_protect (); |
|
697 } |
|
698 |
|
699 void |
|
700 tree_unwind_protect_command::eval (void) |
|
701 { |
|
702 add_unwind_protect (do_unwind_protect_cleanup_code, cleanup_code); |
|
703 |
|
704 if (unwind_protect_code) |
1827
|
705 unwind_protect_code->eval (true); |
916
|
706 |
1489
|
707 run_unwind_protect (); |
916
|
708 } |
|
709 |
|
710 void |
2124
|
711 tree_unwind_protect_command::accept (tree_walker& tw) |
916
|
712 { |
2124
|
713 tw.visit_unwind_protect_command (*this); |
916
|
714 } |
|
715 |
578
|
716 // Break. |
494
|
717 |
578
|
718 void |
|
719 tree_break_command::eval (void) |
494
|
720 { |
|
721 if (! error_state) |
|
722 breaking = 1; |
|
723 } |
|
724 |
581
|
725 void |
2124
|
726 tree_break_command::accept (tree_walker& tw) |
581
|
727 { |
2124
|
728 tw.visit_break_command (*this); |
581
|
729 } |
|
730 |
578
|
731 // Continue. |
494
|
732 |
578
|
733 void |
|
734 tree_continue_command::eval (void) |
494
|
735 { |
|
736 if (! error_state) |
|
737 continuing = 1; |
|
738 } |
|
739 |
581
|
740 void |
2124
|
741 tree_continue_command::accept (tree_walker& tw) |
581
|
742 { |
2124
|
743 tw.visit_continue_command (*this); |
581
|
744 } |
|
745 |
578
|
746 // Return. |
494
|
747 |
578
|
748 void |
|
749 tree_return_command::eval (void) |
494
|
750 { |
|
751 if (! error_state) |
|
752 returning = 1; |
|
753 } |
|
754 |
581
|
755 void |
2124
|
756 tree_return_command::accept (tree_walker& tw) |
581
|
757 { |
2124
|
758 tw.visit_return_command (*this); |
581
|
759 } |
|
760 |
494
|
761 /* |
|
762 ;;; Local Variables: *** |
|
763 ;;; mode: C++ *** |
|
764 ;;; End: *** |
|
765 */ |