comparison src/pt-check.cc @ 4219:23d06c9e1edd

[project @ 2002-12-06 21:29:17 by jwe]
author jwe
date Fri, 06 Dec 2002 21:29:19 +0000
parents fa3482b34599
children 40153a2affd6
comparison
equal deleted inserted replaced
4218:4a392a01e51a 4219:23d06c9e1edd
34 #include "pt-all.h" 34 #include "pt-all.h"
35 35
36 void 36 void
37 tree_checker::visit_argument_list (tree_argument_list& lst) 37 tree_checker::visit_argument_list (tree_argument_list& lst)
38 { 38 {
39 Pix p = lst.first (); 39 tree_argument_list::iterator p = lst.begin ();
40 40
41 while (p) 41 while (p != lst.end ())
42 { 42 {
43 tree_expression *elt = lst (p); 43 tree_expression *elt = *p++;
44
45 lst.next (p);
46 44
47 if (elt) 45 if (elt)
48 { 46 {
49 if (do_lvalue_check && ! elt->lvalue_ok ()) 47 if (do_lvalue_check && ! elt->lvalue_ok ())
50 gripe ("invalid lvalue in multiple assignment", elt->line ()); 48 gripe ("invalid lvalue in multiple assignment", elt->line ());
119 } 117 }
120 118
121 void 119 void
122 tree_checker::visit_decl_init_list (tree_decl_init_list& lst) 120 tree_checker::visit_decl_init_list (tree_decl_init_list& lst)
123 { 121 {
124 Pix p = lst.first (); 122 tree_decl_init_list::iterator p = lst.begin ();
125 123
126 while (p) 124 while (p != lst.end ())
127 { 125 {
128 tree_decl_elt *elt = lst (p); 126 tree_decl_elt *elt = *p++;
129
130 lst.next (p);
131 127
132 if (elt) 128 if (elt)
133 elt->accept (*this); 129 elt->accept (*this);
134 } 130 }
135 } 131 }
225 } 221 }
226 222
227 void 223 void
228 tree_checker::visit_if_command_list (tree_if_command_list& lst) 224 tree_checker::visit_if_command_list (tree_if_command_list& lst)
229 { 225 {
230 Pix p = lst.first (); 226 tree_if_command_list::iterator p = lst.begin ();
231 227
232 while (p) 228 while (p != lst.end ())
233 { 229 {
234 tree_if_clause *elt = lst (p); 230 tree_if_clause *elt = *p++;
235 231
236 if (elt) 232 if (elt)
237 elt->accept (*this); 233 elt->accept (*this);
238
239 lst.next (p);
240 } 234 }
241 } 235 }
242 236
243 void 237 void
244 tree_checker::visit_index_expression (tree_index_expression& expr) 238 tree_checker::visit_index_expression (tree_index_expression& expr)
246 tree_expression *e = expr.expression (); 240 tree_expression *e = expr.expression ();
247 241
248 if (e) 242 if (e)
249 e->accept (*this); 243 e->accept (*this);
250 244
251 SLList<tree_argument_list *> lst = expr.arg_lists (); 245 std::list<tree_argument_list *> lst = expr.arg_lists ();
252 246
253 Pix p = lst.first (); 247 std::list<tree_argument_list *>::iterator p = lst.begin ();
254 248
255 while (p) 249 while (p != lst.end ())
256 { 250 {
257 tree_argument_list *elt = lst (p); 251 tree_argument_list *elt = *p++;
258 252
259 if (elt) 253 if (elt)
260 elt->accept (*this); 254 elt->accept (*this);
261
262 lst.next (p);
263 } 255 }
264 } 256 }
265 257
266 void 258 void
267 tree_checker::visit_matrix (tree_matrix& lst) 259 tree_checker::visit_matrix (tree_matrix& lst)
268 { 260 {
269 Pix p = lst.first (); 261 tree_matrix::iterator p = lst.begin ();
270 262
271 while (p) 263 while (p != lst.end ())
272 { 264 {
273 tree_argument_list *elt = lst (p); 265 tree_argument_list *elt = *p++;
274 266
275 lst.next (p); 267 if (elt)
268 elt->accept (*this);
269 }
270 }
271
272 void
273 tree_checker::visit_cell (tree_cell& lst)
274 {
275 tree_matrix::iterator p = lst.begin ();
276
277 while (p != lst.end ())
278 {
279 tree_argument_list *elt = *p++;
276 280
277 if (elt) 281 if (elt)
278 elt->accept (*this); 282 elt->accept (*this);
279 } 283 }
280 } 284 }
310 } 314 }
311 315
312 void 316 void
313 tree_checker::visit_parameter_list (tree_parameter_list& lst) 317 tree_checker::visit_parameter_list (tree_parameter_list& lst)
314 { 318 {
315 Pix p = lst.first (); 319 tree_parameter_list::iterator p = lst.begin ();
316 320
317 while (p) 321 while (p != lst.end ())
318 { 322 {
319 tree_identifier *elt = lst (p); 323 tree_identifier *elt = *p++;
320
321 lst.next (p);
322 324
323 if (elt) 325 if (elt)
324 elt->accept (*this); 326 elt->accept (*this);
325 } 327 }
326 } 328 }
396 } 398 }
397 399
398 void 400 void
399 tree_checker::visit_return_list (tree_return_list& lst) 401 tree_checker::visit_return_list (tree_return_list& lst)
400 { 402 {
401 Pix p = lst.first (); 403 tree_return_list::iterator p = lst.begin ();
402 404
403 while (p) 405 while (p != lst.end ())
404 { 406 {
405 tree_index_expression *elt = lst (p); 407 tree_index_expression *elt = *p++;
406
407 lst.next (p);
408 408
409 if (elt) 409 if (elt)
410 elt->accept (*this); 410 elt->accept (*this);
411 } 411 }
412 } 412 }
445 } 445 }
446 446
447 void 447 void
448 tree_checker::visit_statement_list (tree_statement_list& lst) 448 tree_checker::visit_statement_list (tree_statement_list& lst)
449 { 449 {
450 for (Pix p = lst.first (); p != 0; lst.next (p)) 450 for (tree_statement_list::iterator p = lst.begin (); p != lst.end (); p++)
451 { 451 {
452 tree_statement *elt = lst (p); 452 tree_statement *elt = *p;
453 453
454 if (elt) 454 if (elt)
455 elt->accept (*this); 455 elt->accept (*this);
456 } 456 }
457 } 457 }
481 } 481 }
482 482
483 void 483 void
484 tree_checker::visit_subplot_list (subplot_list& lst) 484 tree_checker::visit_subplot_list (subplot_list& lst)
485 { 485 {
486 Pix p = lst.first (); 486 subplot_list::iterator p = lst.begin ();
487 487
488 while (p) 488 while (p != lst.end ())
489 { 489 {
490 subplot *elt = lst (p); 490 subplot *elt = *p++;
491
492 lst.next (p);
493 491
494 if (elt) 492 if (elt)
495 elt->accept (*this); 493 elt->accept (*this);
496 } 494 }
497 } 495 }
549 } 547 }
550 548
551 void 549 void
552 tree_checker::visit_switch_case_list (tree_switch_case_list& lst) 550 tree_checker::visit_switch_case_list (tree_switch_case_list& lst)
553 { 551 {
554 Pix p = lst.first (); 552 tree_switch_case_list::iterator p = lst.begin ();
555 553
556 while (p) 554 while (p != lst.end ())
557 { 555 {
558 tree_switch_case *elt = lst (p); 556 tree_switch_case *elt = *p++;
559 557
560 if (elt) 558 if (elt)
561 elt->accept (*this); 559 elt->accept (*this);
562
563 lst.next (p);
564 } 560 }
565 } 561 }
566 562
567 void 563 void
568 tree_checker::visit_switch_command (tree_switch_command& cmd) 564 tree_checker::visit_switch_command (tree_switch_command& cmd)