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 |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
2982
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include <config.h> |
|
26 #endif |
|
27 |
|
28 #include "error.h" |
3770
|
29 #include "oct-obj.h" |
|
30 #include "pt-bp.h" |
2982
|
31 #include "pt-jump.h" |
|
32 #include "pt-walk.h" |
|
33 |
3770
|
34 class octave_value_list; |
|
35 |
2982
|
36 // Break. |
|
37 |
2985
|
38 // Nonzero means we're breaking out of a loop or function body. |
4207
|
39 int tree_break_command::breaking = 0; |
2985
|
40 |
4207
|
41 void |
|
42 tree_break_command::eval (void) |
2982
|
43 { |
3770
|
44 // Even if we have an error we should still enter debug mode. |
|
45 MAYBE_DO_BREAKPOINT; |
|
46 |
2982
|
47 if (! error_state) |
|
48 breaking = 1; |
|
49 } |
|
50 |
|
51 void |
4207
|
52 tree_break_command::accept (tree_walker& tw) |
2982
|
53 { |
4207
|
54 tw.visit_break_command (*this); |
2982
|
55 } |
|
56 |
|
57 // Continue. |
|
58 |
2985
|
59 // Nonzero means we're jumping to the end of a loop. |
4207
|
60 int tree_continue_command::continuing = 0; |
2985
|
61 |
4207
|
62 void |
|
63 tree_continue_command::eval (void) |
2982
|
64 { |
3770
|
65 MAYBE_DO_BREAKPOINT; |
|
66 |
2982
|
67 if (! error_state) |
|
68 continuing = 1; |
|
69 } |
|
70 |
|
71 void |
4207
|
72 tree_continue_command::accept (tree_walker& tw) |
2982
|
73 { |
4207
|
74 tw.visit_continue_command (*this); |
2982
|
75 } |
|
76 |
|
77 // Return. |
|
78 |
5501
|
79 // Nonzero means we're returning from a function. |
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 */ |