#include "semcheck.h" /* is_first_cons.c * To check whether the first production is a unparameterized * construction production. * 6/7/90 */ int Cd_graph::is_first_cons() { return adjacencies->is_first_cons(); } int Adjacency_Nlist::is_first_cons() { Adjacency *a_Adjacency = this->car(); int result = a_Adjacency->is_first_cons(); if (result==SUCCESS) return (SUCCESS); else if (result == -1) { sem_out << "\n"; sem_out << "The first production of your class dictionary has to\n" << "be an unparameterized construction production. Your\n" << "first production\n"; a_Adjacency->pp(sem_out); sem_out << " is a parameterized production." << endl; sem_out << "Add for example\n"; sem_out << " Example = "; a_Adjacency->get_source()->pp(sem_out); sem_out << "("; a_Adjacency->get_parameters()->pp(sem_out); sem_out << ")"; sem_out << ".\nas your first production.\n" << endl; } else { sem_out<< "\n"; sem_out<< "The first production of your class dictionary has to\n" << "be an unparameterized production. Your first production\n"; a_Adjacency->pp(sem_out); sem_out << " is not an unparameterized construction production." << endl; sem_out << "Add for example\n"; sem_out << " Example = "; a_Adjacency->get_source()->pp(sem_out); sem_out << ".\nas your first production.\n" << endl; } return (ERROR_CONS); } int Adjacency::is_first_cons() { if (parameters) return -1; return ns->is_first_cons(); } int Neighbors::is_first_cons() { return (ERROR_CONS); // For Repetit_n or Alternat_ns } int Construct_ns::is_first_cons() { return (SUCCESS); }