// Check that all alternatives of a parameterized alternation class // use all formal parameters in the same order. *operation* int check_alternation_params() *init* (@ 1 @) *traverse* *from* Cd_graph *through* ->Alternat_ns,*,Term_Bar_list *to-stop* Term *carry* *in* Vertex_Comma_list* params = (@ this->get_parameters() @) *along* *from* Adjacency *to* Term *wrapper* Cd_graph *prefix* (@ cout << endl << "Checking that every alternative of a parameterized" << endl << "\talternation class has to use all its formal" << endl << "\tparameters in the same order ..." << endl; @) *wrapper* Term *prefix* (@ int error_flag = 0; if ((params != NULL) && (this->get_actual_parameters() != NULL)) { Term_list_iterator next_Term(*this->get_actual_parameters()); Term* each_Term; Vertex_list_iterator next_Vertex(*params); Vertex* each_Vertex; while(1) { each_Vertex = next_Vertex(); each_Term = next_Term(); if ((each_Vertex != NULL) && (each_Term != NULL)) { if (!each_Vertex->g_equal(each_Term->get_vertex())) { error_flag = 1; break; } } else if ((each_Vertex != NULL) || (each_Term != NULL)) { error_flag = 1; break; } else break; } } else if ((params != NULL) || (this->get_actual_parameters() != NULL)) error_flag = 1; if (error_flag) { cout << "sem-check: error: on line " << this->find_line_number() << " parameters of '"; this->g_print(); cout << "' mismatch with its superclass's" << endl; return_val = 0; } @)