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