Mercurial > hg > octave-nkf
annotate src/pt-loop.h @ 10313:f3b65e1ae355
untabify src header files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 11 Feb 2010 12:16:43 -0500 |
parents | cd96d29c5efa |
children | fd0a3ac60b0e |
rev | line source |
---|---|
2982 | 1 /* |
2 | |
8920 | 3 Copyright (C) 1996, 1997, 2000, 2002, 2004, 2005, 2006, 2007, 2008, 2009 |
7017 | 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 #if !defined (octave_tree_loop_h) | |
25 #define octave_tree_loop_h 1 | |
26 | |
27 class octave_value; | |
28 class octave_lvalue; | |
29 | |
30 class tree_argument_list; | |
31 class tree_expression; | |
32 class tree_statement_list; | |
33 | |
34 class tree_walker; | |
35 | |
3665 | 36 #include "comment-list.h" |
2982 | 37 #include "pt-cmd.h" |
7336 | 38 #include "symtab.h" |
2982 | 39 |
40 // While. | |
41 | |
42 class | |
43 tree_while_command : public tree_command | |
44 { | |
45 public: | |
46 | |
47 tree_while_command (int l = -1, int c = -1) | |
3665 | 48 : tree_command (l, c), expr (0), list (0), lead_comm (0), |
49 trail_comm (0) { } | |
2982 | 50 |
3665 | 51 tree_while_command (tree_expression *e, |
10313 | 52 octave_comment_list *lc = 0, |
53 octave_comment_list *tc = 0, | |
54 int l = -1, int c = -1) | |
3665 | 55 : tree_command (l, c), expr (e), list (0), lead_comm (lc), |
56 trail_comm (tc) { } | |
2982 | 57 |
58 tree_while_command (tree_expression *e, tree_statement_list *lst, | |
10313 | 59 octave_comment_list *lc = 0, |
60 octave_comment_list *tc = 0, | |
61 int l = -1, int c = -1) | |
3665 | 62 : tree_command (l, c), expr (e), list (lst), lead_comm (lc), |
63 trail_comm (tc) { } | |
2982 | 64 |
65 ~tree_while_command (void); | |
66 | |
67 tree_expression *condition (void) { return expr; } | |
68 | |
69 tree_statement_list *body (void) { return list; } | |
70 | |
3665 | 71 octave_comment_list *leading_comment (void) { return lead_comm; } |
72 | |
73 octave_comment_list *trailing_comment (void) { return trail_comm; } | |
74 | |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
75 tree_command *dup (symbol_table::scope_id scope, |
10313 | 76 symbol_table::context_id context) const; |
5861 | 77 |
2982 | 78 void accept (tree_walker& tw); |
79 | |
3484 | 80 protected: |
2982 | 81 |
82 // Expression to test. | |
83 tree_expression *expr; | |
84 | |
85 // List of commands to execute. | |
86 tree_statement_list *list; | |
2988 | 87 |
3665 | 88 // Comment preceding WHILE token. |
89 octave_comment_list *lead_comm; | |
90 | |
91 // Comment preceding ENDWHILE token. | |
92 octave_comment_list *trail_comm; | |
93 | |
3484 | 94 private: |
95 | |
2988 | 96 // No copying! |
97 | |
98 tree_while_command (const tree_while_command&); | |
99 | |
100 tree_while_command& operator = (const tree_while_command&); | |
2982 | 101 }; |
102 | |
3484 | 103 // Do-Until. |
104 | |
105 class | |
106 tree_do_until_command : public tree_while_command | |
107 { | |
108 public: | |
109 | |
110 tree_do_until_command (int l = -1, int c = -1) | |
111 : tree_while_command (l, c) { } | |
112 | |
3665 | 113 tree_do_until_command (tree_expression *e, |
10313 | 114 octave_comment_list *lc = 0, |
115 octave_comment_list *tc = 0, | |
116 int l = -1, int c = -1) | |
3665 | 117 : tree_while_command (e, lc, tc, l, c) { } |
3484 | 118 |
119 tree_do_until_command (tree_expression *e, tree_statement_list *lst, | |
10313 | 120 octave_comment_list *lc = 0, |
121 octave_comment_list *tc = 0, | |
122 int l = -1, int c = -1) | |
3665 | 123 : tree_while_command (e, lst, lc, tc, l, c) { } |
3484 | 124 |
125 ~tree_do_until_command (void) { } | |
126 | |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
127 tree_command *dup (symbol_table::scope_id scope, |
10313 | 128 symbol_table::context_id context) const; |
5861 | 129 |
3484 | 130 void accept (tree_walker& tw); |
131 | |
132 private: | |
133 | |
134 // No copying! | |
135 | |
136 tree_do_until_command (const tree_do_until_command&); | |
137 | |
138 tree_do_until_command& operator = (const tree_do_until_command&); | |
139 }; | |
140 | |
2982 | 141 // For. |
142 | |
143 class | |
144 tree_simple_for_command : public tree_command | |
145 { | |
146 public: | |
147 | |
148 tree_simple_for_command (int l = -1, int c = -1) | |
3665 | 149 : tree_command (l, c), lhs (0), expr (0), list (0), lead_comm (0), |
150 trail_comm (0) { } | |
2982 | 151 |
152 tree_simple_for_command (tree_expression *le, tree_expression *re, | |
10313 | 153 tree_statement_list *lst, |
154 octave_comment_list *lc = 0, | |
155 octave_comment_list *tc = 0, | |
156 int l = -1, int c = -1) | |
3665 | 157 : tree_command (l, c), lhs (le), expr (re), list (lst), |
158 lead_comm (lc), trail_comm (tc) { } | |
2982 | 159 |
160 ~tree_simple_for_command (void); | |
161 | |
162 tree_expression *left_hand_side (void) { return lhs; } | |
163 | |
164 tree_expression *control_expr (void) { return expr; } | |
165 | |
166 tree_statement_list *body (void) { return list; } | |
167 | |
3665 | 168 octave_comment_list *leading_comment (void) { return lead_comm; } |
169 | |
170 octave_comment_list *trailing_comment (void) { return trail_comm; } | |
171 | |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
172 tree_command *dup (symbol_table::scope_id scope, |
10313 | 173 symbol_table::context_id context) const; |
5861 | 174 |
2982 | 175 void accept (tree_walker& tw); |
176 | |
177 private: | |
178 | |
179 // Expression to modify. | |
180 tree_expression *lhs; | |
181 | |
182 // Expression to evaluate. | |
183 tree_expression *expr; | |
184 | |
185 // List of commands to execute. | |
186 tree_statement_list *list; | |
187 | |
3665 | 188 // Comment preceding FOR token. |
189 octave_comment_list *lead_comm; | |
190 | |
191 // Comment preceding ENDFOR token. | |
192 octave_comment_list *trail_comm; | |
193 | |
2988 | 194 // No copying! |
195 | |
196 tree_simple_for_command (const tree_simple_for_command&); | |
197 | |
198 tree_simple_for_command& operator = (const tree_simple_for_command&); | |
2982 | 199 }; |
200 | |
201 class | |
202 tree_complex_for_command : public tree_command | |
203 { | |
204 public: | |
205 | |
206 tree_complex_for_command (int l = -1, int c = -1) | |
3665 | 207 : tree_command (l, c), lhs (0), expr (0), list (0), lead_comm (0), |
208 trail_comm (0) { } | |
2982 | 209 |
210 tree_complex_for_command (tree_argument_list *le, tree_expression *re, | |
10313 | 211 tree_statement_list *lst, |
212 octave_comment_list *lc = 0, | |
213 octave_comment_list *tc = 0, | |
214 int l = -1, int c = -1) | |
3665 | 215 : tree_command (l, c), lhs (le), expr (re), list (lst), |
216 lead_comm (lc), trail_comm (tc) { } | |
2982 | 217 |
218 ~tree_complex_for_command (void); | |
219 | |
220 tree_argument_list *left_hand_side (void) { return lhs; } | |
221 | |
222 tree_expression *control_expr (void) { return expr; } | |
223 | |
224 tree_statement_list *body (void) { return list; } | |
225 | |
3665 | 226 octave_comment_list *leading_comment (void) { return lead_comm; } |
227 | |
228 octave_comment_list *trailing_comment (void) { return trail_comm; } | |
229 | |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
230 tree_command *dup (symbol_table::scope_id scope, |
10313 | 231 symbol_table::context_id context) const; |
5861 | 232 |
2982 | 233 void accept (tree_walker& tw); |
234 | |
235 private: | |
236 | |
237 // Expression to modify. | |
238 tree_argument_list *lhs; | |
239 | |
240 // Expression to evaluate. | |
241 tree_expression *expr; | |
242 | |
243 // List of commands to execute. | |
244 tree_statement_list *list; | |
245 | |
3665 | 246 // Comment preceding FOR token. |
247 octave_comment_list *lead_comm; | |
248 | |
249 // Comment preceding ENDFOR token. | |
250 octave_comment_list *trail_comm; | |
251 | |
2988 | 252 // No copying! |
253 | |
254 tree_complex_for_command (const tree_complex_for_command&); | |
255 | |
256 tree_complex_for_command& operator = (const tree_complex_for_command&); | |
2982 | 257 }; |
258 | |
259 #endif |