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