STRUCTURE OF  THE SEMANTICS REPRESENTATION  OF A GENERAL  PHRASE

//  A list node, used in the structure for NP's

struct list_rec{
        char attr[20];
        char value[20];
        struct list_rec *next;
};
 

// Semantic representation of NP's

struct npsem_rec{
        char type[20];
        struct list_rec *attr;
        char dir;
        char ord;
};

// Represents a funtion, used by prepositions and verbs

struct functs_rec{
        char funct[20]; /* Name of the function used */
        int nextarg;    /* Next empty erg */
        int argspec[2][10]; /* from where the arguments comes and type of the argument */
        union sem_rec *argl[10]; /* List of arguments ..... max is 10 assumed*/
};

//  Represents the semantics of a modifier

struct modsem_rec {
        char position; /* b  a */
        char typesem;
        char from[4]; /* 0,1-9,10,100 */
        char entry[4][20]; /* 0,1-9,10,100 */
};

// Union of all the above semantics

union sem_rec{
        struct npsem_rec npsem;
        struct functs_rec functsem;
        struct modsem_rec modsem;
        int conjsem[2]; /* This represents the semantics of a binary conjuncton . it specifies the sequence in which the procedure for individual sentences should be run  */
};

// Structure used by a general phrase to represent the semantics associated with it.

struct phr{
        char word[20];
        char cat[20];
        char spec[7];
        char comp[100];
        char typesem;
        union sem_rec sem;
};