2982
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1996, 1997, 2001, 2002, 2004, 2005, 2006, 2007 |
|
4 John W. Eaton |
2982
|
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 |
7016
|
10 Free Software Foundation; either version 3 of the License, or (at your |
|
11 option) any later version. |
2982
|
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 |
7016
|
19 along with Octave; see the file COPYING. If not, see |
|
20 <http://www.gnu.org/licenses/>. |
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 |
5861
|
51 tree_command * |
7336
|
52 tree_break_command::dup (symbol_table::scope_id) |
5861
|
53 { |
|
54 return new tree_break_command (line (), column ()); |
|
55 } |
|
56 |
2982
|
57 void |
4207
|
58 tree_break_command::accept (tree_walker& tw) |
2982
|
59 { |
4207
|
60 tw.visit_break_command (*this); |
2982
|
61 } |
|
62 |
|
63 // Continue. |
|
64 |
2985
|
65 // Nonzero means we're jumping to the end of a loop. |
4207
|
66 int tree_continue_command::continuing = 0; |
2985
|
67 |
4207
|
68 void |
|
69 tree_continue_command::eval (void) |
2982
|
70 { |
3770
|
71 MAYBE_DO_BREAKPOINT; |
|
72 |
2982
|
73 if (! error_state) |
|
74 continuing = 1; |
|
75 } |
|
76 |
5861
|
77 tree_command * |
7336
|
78 tree_continue_command::dup (symbol_table::scope_id) |
5861
|
79 { |
|
80 return new tree_continue_command (line (), column ()); |
|
81 } |
|
82 |
2982
|
83 void |
4207
|
84 tree_continue_command::accept (tree_walker& tw) |
2982
|
85 { |
4207
|
86 tw.visit_continue_command (*this); |
2982
|
87 } |
|
88 |
|
89 // Return. |
|
90 |
5501
|
91 // Nonzero means we're returning from a function. |
4207
|
92 int tree_return_command::returning = 0; |
2985
|
93 |
4207
|
94 void |
|
95 tree_return_command::eval (void) |
2982
|
96 { |
3770
|
97 MAYBE_DO_BREAKPOINT; |
|
98 |
2982
|
99 if (! error_state) |
|
100 returning = 1; |
|
101 } |
|
102 |
5861
|
103 tree_command * |
7336
|
104 tree_return_command::dup (symbol_table::scope_id) |
5861
|
105 { |
|
106 return new tree_return_command (line (), column ()); |
|
107 } |
|
108 |
2982
|
109 void |
4207
|
110 tree_return_command::accept (tree_walker& tw) |
2982
|
111 { |
4207
|
112 tw.visit_return_command (*this); |
2982
|
113 } |
|
114 |
|
115 /* |
|
116 ;;; Local Variables: *** |
|
117 ;;; mode: C++ *** |
|
118 ;;; End: *** |
|
119 */ |