diff -r cece842c7417 -r 0919986a5c98 absyntax_utils/decompose_var_instance_name.cc --- a/absyntax_utils/decompose_var_instance_name.cc Tue Dec 15 16:29:44 2009 +0100 +++ b/absyntax_utils/decompose_var_instance_name.cc Tue Dec 15 20:50:30 2009 +0100 @@ -46,21 +46,22 @@ previously_returned_variable_name = NULL; } -symbol_c *decompose_var_instance_name_c::next_part(void) { +symbol_c *decompose_var_instance_name_c::next_part(bool increment) { /* We must always start from the top! * See note in the structured_variable_c visitor * to understand why... */ symbol_c *res = (symbol_c *)variable_name->accept(*this); - next_variable_name = current_recursive_variable_name; + if (increment) + next_variable_name = current_recursive_variable_name; if (previously_returned_variable_name == res) - return NULL; - previously_returned_variable_name = res; + return NULL; + if (increment) + previously_returned_variable_name = res; return res; } - /*************************/ /* B.1 - Common elements */ /*************************/ @@ -123,7 +124,7 @@ * so we do not have to recursevily visit it again... * return (void *)symbol->field_selector->accept(*this); -> NOT REQUIRED!! */ - return (void *)symbol->field_selector; + return (void *)symbol->field_selector; } current_recursive_variable_name = symbol;