src/function.c
void buildC()
{
    int key = INT_MIN;

    HASH = (char**)malloc(sizeof(char*)*HASHSIZE);      // making hashtable of the size

    char* C[] = {"auto","else","long","switch","break","enum","register","typedef","case",
    "extern","return","union","char","float","short","unsigned","const","for","signed"
    ,"void","continue","goto","sizeof","volatile","default","if","static","while","do",
    "int","struct","double","bool","true","false"};

    register int i;
    for(i=0;i<35;i++)
    {
        key = hashfunction(C[i]);

        if(key >= 0 && key<HASHSIZE && HASH[key]==NULL)
        {
            int s = strlen(C[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],C[i]);
        }
        else                                        // collision on 349 continue  181 - goto
        {
            // printf("collision %d  %s\n",key,C[i]);
            key++;
            int s = strlen(C[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],C[i]);
        }
    }
}
/**
 * It will build keyword tree of C keywords
 * 
 * @return void
 **/
It will build keyword tree of C keywords

@return void
It will build keyword tree of C keywords @return void
void buildC()
{
    int key = INT_MIN;
    HASH = (char**)malloc(sizeof(char*)*HASHSIZE);      
    char* C[] = {"auto","else","long","switch","break","enum","register","typedef","case",
    "extern","return","union","char","float","short","unsigned","const","for","signed"
    ,"void","continue","goto","sizeof","volatile","default","if","static","while","do",
    "int","struct","double","bool","true","false"};
    register int i;
    for(i=0;i<35;i++)
    {
        key = hashfunction(C[i]);
        if(key >= 0 && key<HASHSIZE && HASH[key]==NULL)
        {
            int s = strlen(C[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],C[i]);
        }
        else                                        
        {
            key++;
            int s = strlen(C[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],C[i]);
        }
    }
}
void buildC ( ) { int key = INT_MIN ; HASH = ( char * * ) malloc ( sizeof ( char * ) * HASHSIZE ) ; char * C [ ] = { " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " } ; register int i ; for ( i = 0 ; i < 35 ; i ++ ) { key = hashfunction ( C [ i ] ) ; if ( key >= 0 && key < HASHSIZE && HASH [ key ] == NULL ) { int s = strlen ( C [ i ] ) ; HASH [ key ] = ( char * ) malloc ( sizeof ( char ) * ( s + 1 ) ) ; strcpy ( HASH [ key ] , C [ i ] ) ; } else { key ++ ; int s = strlen ( C [ i ] ) ; HASH [ key ] = ( char * ) malloc ( sizeof ( char ) * ( s + 1 ) ) ; strcpy ( HASH [ key ] , C [ i ] ) ; } } }
It will build keyword tree of C keywords
It will build keyword tree of C keywords
// making hashtable of the size // collision on 349 continue  181 - goto // printf("collision %d  %s\n",key,C[i]);