Mercurial > hg > octave-lyh
diff 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 |
line wrap: on
line diff
--- a/src/pt-check.cc +++ b/src/pt-check.cc @@ -36,13 +36,11 @@ void tree_checker::visit_argument_list (tree_argument_list& lst) { - Pix p = lst.first (); + tree_argument_list::iterator p = lst.begin (); - while (p) + while (p != lst.end ()) { - tree_expression *elt = lst (p); - - lst.next (p); + tree_expression *elt = *p++; if (elt) { @@ -121,13 +119,11 @@ void tree_checker::visit_decl_init_list (tree_decl_init_list& lst) { - Pix p = lst.first (); + tree_decl_init_list::iterator p = lst.begin (); - while (p) + while (p != lst.end ()) { - tree_decl_elt *elt = lst (p); - - lst.next (p); + tree_decl_elt *elt = *p++; if (elt) elt->accept (*this); @@ -227,16 +223,14 @@ void tree_checker::visit_if_command_list (tree_if_command_list& lst) { - Pix p = lst.first (); + tree_if_command_list::iterator p = lst.begin (); - while (p) + while (p != lst.end ()) { - tree_if_clause *elt = lst (p); + tree_if_clause *elt = *p++; if (elt) elt->accept (*this); - - lst.next (p); } } @@ -248,31 +242,41 @@ if (e) e->accept (*this); - SLList<tree_argument_list *> lst = expr.arg_lists (); + std::list<tree_argument_list *> lst = expr.arg_lists (); - Pix p = lst.first (); + std::list<tree_argument_list *>::iterator p = lst.begin (); - while (p) + while (p != lst.end ()) { - tree_argument_list *elt = lst (p); + tree_argument_list *elt = *p++; if (elt) elt->accept (*this); - - lst.next (p); } } void tree_checker::visit_matrix (tree_matrix& lst) { - Pix p = lst.first (); + tree_matrix::iterator p = lst.begin (); - while (p) + while (p != lst.end ()) { - tree_argument_list *elt = lst (p); + tree_argument_list *elt = *p++; + + if (elt) + elt->accept (*this); + } +} - lst.next (p); +void +tree_checker::visit_cell (tree_cell& lst) +{ + tree_matrix::iterator p = lst.begin (); + + while (p != lst.end ()) + { + tree_argument_list *elt = *p++; if (elt) elt->accept (*this); @@ -312,13 +316,11 @@ void tree_checker::visit_parameter_list (tree_parameter_list& lst) { - Pix p = lst.first (); + tree_parameter_list::iterator p = lst.begin (); - while (p) + while (p != lst.end ()) { - tree_identifier *elt = lst (p); - - lst.next (p); + tree_identifier *elt = *p++; if (elt) elt->accept (*this); @@ -398,13 +400,11 @@ void tree_checker::visit_return_list (tree_return_list& lst) { - Pix p = lst.first (); + tree_return_list::iterator p = lst.begin (); - while (p) + while (p != lst.end ()) { - tree_index_expression *elt = lst (p); - - lst.next (p); + tree_index_expression *elt = *p++; if (elt) elt->accept (*this); @@ -447,9 +447,9 @@ void tree_checker::visit_statement_list (tree_statement_list& lst) { - for (Pix p = lst.first (); p != 0; lst.next (p)) + for (tree_statement_list::iterator p = lst.begin (); p != lst.end (); p++) { - tree_statement *elt = lst (p); + tree_statement *elt = *p; if (elt) elt->accept (*this); @@ -483,13 +483,11 @@ void tree_checker::visit_subplot_list (subplot_list& lst) { - Pix p = lst.first (); + subplot_list::iterator p = lst.begin (); - while (p) + while (p != lst.end ()) { - subplot *elt = lst (p); - - lst.next (p); + subplot *elt = *p++; if (elt) elt->accept (*this); @@ -551,16 +549,14 @@ void tree_checker::visit_switch_case_list (tree_switch_case_list& lst) { - Pix p = lst.first (); + tree_switch_case_list::iterator p = lst.begin (); - while (p) + while (p != lst.end ()) { - tree_switch_case *elt = lst (p); + tree_switch_case *elt = *p++; if (elt) elt->accept (*this); - - lst.next (p); } }