comparison src/pt-cmd.h @ 2764:2c0f259cf83d

[project @ 1997-03-01 02:30:26 by jwe]
author jwe
date Sat, 01 Mar 1997 02:30:29 +0000
parents 5c773d4745d6
children 52e7c4509983
comparison
equal deleted inserted replaced
2763:d9d00d7e271e 2764:2c0f259cf83d
32 class octave_value_list; 32 class octave_value_list;
33 33
34 class tree_statement_list; 34 class tree_statement_list;
35 class tree_global_init_list; 35 class tree_global_init_list;
36 class tree_if_command_list; 36 class tree_if_command_list;
37 class tree_switch_case_list;
37 class tree_expression; 38 class tree_expression;
38 class tree_index_expression; 39 class tree_index_expression;
39 class tree_identifier; 40 class tree_identifier;
40 class tree_return_list; 41 class tree_return_list;
41 class octave_value; 42 class octave_value;
44 class tree_command; 45 class tree_command;
45 class tree_global_command; 46 class tree_global_command;
46 class tree_while_command; 47 class tree_while_command;
47 class tree_for_command; 48 class tree_for_command;
48 class tree_if_command; 49 class tree_if_command;
50 class tree_switch_command;
49 class tree_try_catch_command; 51 class tree_try_catch_command;
50 class tree_unwind_protect_command; 52 class tree_unwind_protect_command;
51 class tree_no_op_command; 53 class tree_no_op_command;
52 class tree_break_command; 54 class tree_break_command;
53 class tree_continue_command; 55 class tree_continue_command;
210 212
211 ~tree_if_command (void); 213 ~tree_if_command (void);
212 214
213 void eval (void); 215 void eval (void);
214 216
215 void eval_error (void);
216
217 tree_if_command_list *cmd_list (void) { return list; } 217 tree_if_command_list *cmd_list (void) { return list; }
218 218
219 void accept (tree_walker& tw); 219 void accept (tree_walker& tw);
220 220
221 private: 221 private:
222 222
223 // List of if commands (if, elseif, elseif, ... else, endif) 223 // List of if commands (if, elseif, elseif, ... else, endif)
224 tree_if_command_list *list; 224 tree_if_command_list *list;
225 };
226
227 // Switch.
228
229 class
230 tree_switch_command : public tree_command
231 {
232 public:
233
234 tree_switch_command (int l = -1, int c = -1)
235 : tree_command (l, c), expr (0), list (0) { }
236
237 tree_switch_command (tree_expression *e, tree_switch_case_list *lst,
238 int l = -1, int c = -1)
239 : tree_command (l, c), expr (e), list (lst) { }
240
241 ~tree_switch_command (void);
242
243 void eval (void);
244
245 void eval_error (void);
246
247 tree_expression *switch_value (void) { return expr; }
248
249 tree_switch_case_list *case_list (void) { return list; }
250
251 void accept (tree_walker& tw);
252
253 private:
254
255 // Value on which to switch.
256 tree_expression *expr;
257
258 // List of cases (case 1, case 2, ..., default)
259 tree_switch_case_list *list;
225 }; 260 };
226 261
227 // Simple exception handling. 262 // Simple exception handling.
228 263
229 class 264 class