comparison src/pt-cmd.h @ 1228:38b876e46ff6

[project @ 1995-04-10 00:56:17 by jwe]
author jwe
date Mon, 10 Apr 1995 00:57:04 +0000
parents e2036dce97ea
children 0a5e9e8892a0
comparison
equal deleted inserted replaced
1227:766e2a1a4e7b 1228:38b876e46ff6
23 23
24 #if !defined (octave_tree_cmd_h) 24 #if !defined (octave_tree_cmd_h)
25 #define octave_tree_cmd_h 1 25 #define octave_tree_cmd_h 1
26 26
27 #include <iostream.h> 27 #include <iostream.h>
28
29 class Octave_object;
28 30
29 class tree_statement_list; 31 class tree_statement_list;
30 class tree_global_init_list; 32 class tree_global_init_list;
31 class tree_if_command_list; 33 class tree_if_command_list;
32 class tree_expression; 34 class tree_expression;
33 class tree_index_expression; 35 class tree_index_expression;
34 class tree_identifier; 36 class tree_identifier;
37 class tree_return_list;
35 class tree_constant; 38 class tree_constant;
36 class symbol_record; 39 class symbol_record;
37 40
38 class tree_command; 41 class tree_command;
39 class tree_global_command; 42 class tree_global_command;
126 { 129 {
127 public: 130 public:
128 tree_for_command (int l = -1, int c = -1) : tree_command (l, c) 131 tree_for_command (int l = -1, int c = -1) : tree_command (l, c)
129 { 132 {
130 id = 0; 133 id = 0;
134 id_list = 0;
131 expr = 0; 135 expr = 0;
132 list = 0; 136 list = 0;
133 } 137 }
134 138
135 tree_for_command (tree_index_expression *ident, tree_expression *e, 139 tree_for_command (tree_index_expression *ident, tree_expression *e,
136 tree_statement_list *lst, int l = -1, int c = -1) 140 tree_statement_list *lst, int l = -1, int c = -1)
137 : tree_command (l, c) 141 : tree_command (l, c)
138 { 142 {
139 id = ident; 143 id = ident;
144 id_list = 0;
140 expr = e; 145 expr = e;
141 list = lst; 146 list = lst;
142 } 147 }
143 148
149 tree_for_command (tree_return_list *ident, tree_expression *e,
150 tree_statement_list *lst, int l = -1, int c = -1)
151 : tree_command (l, c)
152 {
153 id = 0;
154 id_list = ident;
155 expr = e;
156 list = lst;
157 }
158
144 ~tree_for_command (void); 159 ~tree_for_command (void);
145 160
146 void eval (void); 161 void eval (void);
147 162
148 void eval_error (void); 163 void eval_error (void);
149 164
150 void print_code (ostream& os); 165 void print_code (ostream& os);
151 166
152 private: 167 private:
168 void do_for_loop_once (tree_return_list *lst,
169 const Octave_object& rhs, int& quit);
170
171 void do_for_loop_once (tree_index_expression *idx_expr,
172 const tree_constant& rhs, int& quit);
173
153 void do_for_loop_once (tree_identifier *ident, 174 void do_for_loop_once (tree_identifier *ident,
154 tree_constant& rhs, int& quit); 175 tree_constant& rhs, int& quit);
155 176
156 void do_for_loop_once (tree_constant& rhs, int& quit);
157
158 tree_index_expression *id; // Identifier to modify. 177 tree_index_expression *id; // Identifier to modify.
178 tree_return_list *id_list; // List of identifiers to modify.
159 tree_expression *expr; // Expression to evaluate. 179 tree_expression *expr; // Expression to evaluate.
160 tree_statement_list *list; // List of commands to execute. 180 tree_statement_list *list; // List of commands to execute.
161 }; 181 };
162 182
163 // If. 183 // If.