// Keywords: (@ #define NUM_KEYWORDS 51 static char* keywords[] = { "Construction", "Terminal", "Universal", "asm", "auto", "break", "case", "catch", "char", "class", "const", "continue", "default", "delete", "do", "double", "else", "enum", "extern", "float", "for", "friend", "goto", "if", "inline", "int", "long", "new", "operator", "private", "protected", "public", "register", "return", "short", "signed", "sizeof", "static", "struct", "switch", "template", "this", "throw", "try", "typedef", "union" "unsigned", "virtual", "void", "volatile", "while"}; @) *operation* int check_keywords() *init* (@ 1 @) *traverse* *from* Cd_graph *through* ->Adjacency,source,* *to* Vertex *wrapper* Cd_graph *prefix* (@ cout << endl << "Checking whether the class names and label " << "names are" << endl << "\tthe keywords of C++ Demeter ..." << endl; if (this->check_keywords1() == 0) return_val = 0; @) *wrapper* Vertex *prefix* (@ char* ident = this->get_vertex_name()->get_val(); int i; for (i = 0; i < NUM_KEYWORDS; i++) { if (strcmp(keywords[i], ident) == 0) { cout << "sem-check: error: on line " << this->get_vertex_name()->get_line_number() << " keyword C++ Demeter '"; this->g_print(); cout << "' is used" << endl; return_val = 0; break; } } @) *operation* int check_keywords1() *init* (@ 1 @) *traverse* *from* Cd_graph *to* Labeled *wrapper* Labeled *prefix* (@ char* ident = this->get_label_name()->get_val(); int i; for (i = 0; i < NUM_KEYWORDS; i++) { if (strcmp(keywords[i], ident) == 0) { cout << "sem-check: error: on line " << this->get_label_name()->get_line_number() << " keyword C++ Demeter '"; this->get_label_name()->g_print(); cout << "' is used" << endl; return_val = 0; break; } } @)