2982
|
1 /* |
|
2 |
|
3 Copyright (C) 1996, 1997 John W. Eaton |
|
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 |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #ifdef HAVE_CONFIG_H |
|
24 #include <config.h> |
|
25 #endif |
|
26 |
|
27 #include "error.h" |
3770
|
28 #include "oct-obj.h" |
|
29 #include "pt-bp.h" |
2982
|
30 #include "pt-jump.h" |
|
31 #include "pt-walk.h" |
|
32 |
3770
|
33 class octave_value_list; |
|
34 |
2982
|
35 // Break. |
|
36 |
2985
|
37 // Nonzero means we're breaking out of a loop or function body. |
4207
|
38 int tree_break_command::breaking = 0; |
2985
|
39 |
4207
|
40 void |
|
41 tree_break_command::eval (void) |
2982
|
42 { |
3770
|
43 // Even if we have an error we should still enter debug mode. |
|
44 MAYBE_DO_BREAKPOINT; |
|
45 |
2982
|
46 if (! error_state) |
|
47 breaking = 1; |
|
48 } |
|
49 |
|
50 void |
4207
|
51 tree_break_command::accept (tree_walker& tw) |
2982
|
52 { |
4207
|
53 tw.visit_break_command (*this); |
2982
|
54 } |
|
55 |
|
56 // Continue. |
|
57 |
2985
|
58 // Nonzero means we're jumping to the end of a loop. |
4207
|
59 int tree_continue_command::continuing = 0; |
2985
|
60 |
4207
|
61 void |
|
62 tree_continue_command::eval (void) |
2982
|
63 { |
3770
|
64 MAYBE_DO_BREAKPOINT; |
|
65 |
2982
|
66 if (! error_state) |
|
67 continuing = 1; |
|
68 } |
|
69 |
|
70 void |
4207
|
71 tree_continue_command::accept (tree_walker& tw) |
2982
|
72 { |
4207
|
73 tw.visit_continue_command (*this); |
2982
|
74 } |
|
75 |
|
76 // Return. |
|
77 |
2985
|
78 // Nonzero means we're returning from a function. Global because it |
|
79 // is also needed in tree-expr.cc. |
4207
|
80 int tree_return_command::returning = 0; |
2985
|
81 |
4207
|
82 void |
|
83 tree_return_command::eval (void) |
2982
|
84 { |
3770
|
85 MAYBE_DO_BREAKPOINT; |
|
86 |
2982
|
87 if (! error_state) |
|
88 returning = 1; |
|
89 } |
|
90 |
|
91 void |
4207
|
92 tree_return_command::accept (tree_walker& tw) |
2982
|
93 { |
4207
|
94 tw.visit_return_command (*this); |
2982
|
95 } |
|
96 |
|
97 /* |
|
98 ;;; Local Variables: *** |
|
99 ;;; mode: C++ *** |
|
100 ;;; End: *** |
|
101 */ |