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

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

    char* JAVA[]={"abstract","assert","boolean","break","byte","case","catch","char",
    "class","continue","default","do","double","else","enum","extends","final","finally",
    "float","for","if","implements","import","istanceof","int","interface","long","native",
    "new","null","package","private","protected","public","return","short","static","strictfp",
    "super","switch","synchronized","this","throw","throws","transient","try","void","volatile",
    "while"};

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

        if(key >= 0 && key<HASHSIZE && HASH[key]==NULL)
        {
            int s = strlen(JAVA[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],JAVA[i]);
        }
        else                                        // collisions 209-float 308-private 268-switch
        {
            // printf("collision %d  %s\n",key,JAVA[i]);
            // exit(1);
            key++;
            int s = strlen(JAVA[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],JAVA[i]);
        }
    }
}
/**
 * It will build keyword tree of JAVA keywords
 * 
 * @return void
 **/
It will build keyword tree of JAVA keywords

@return void
It will build keyword tree of JAVA keywords @return void
void buildJAVA()
{
    int key = INT_MIN;
    HASH = (char**)malloc(sizeof(char*)*HASHSIZE);      
    char* JAVA[]={"abstract","assert","boolean","break","byte","case","catch","char",
    "class","continue","default","do","double","else","enum","extends","final","finally",
    "float","for","if","implements","import","istanceof","int","interface","long","native",
    "new","null","package","private","protected","public","return","short","static","strictfp",
    "super","switch","synchronized","this","throw","throws","transient","try","void","volatile",
    "while"};
    register int i=0;
    for(i=0;i<49;i++)
    {
        key = hashfunction(JAVA[i]);
        if(key >= 0 && key<HASHSIZE && HASH[key]==NULL)
        {
            int s = strlen(JAVA[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],JAVA[i]);
        }
        else                                        
        {
            key++;
            int s = strlen(JAVA[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],JAVA[i]);
        }
    }
}
void buildJAVA ( ) { int key = INT_MIN ; HASH = ( char * * ) malloc ( sizeof ( char * ) * HASHSIZE ) ; char * JAVA [ ] = { " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " } ; register int i = 0 ; for ( i = 0 ; i < 49 ; i ++ ) { key = hashfunction ( JAVA [ i ] ) ; if ( key >= 0 && key < HASHSIZE && HASH [ key ] == NULL ) { int s = strlen ( JAVA [ i ] ) ; HASH [ key ] = ( char * ) malloc ( sizeof ( char ) * ( s + 1 ) ) ; strcpy ( HASH [ key ] , JAVA [ i ] ) ; } else { key ++ ; int s = strlen ( JAVA [ i ] ) ; HASH [ key ] = ( char * ) malloc ( sizeof ( char ) * ( s + 1 ) ) ; strcpy ( HASH [ key ] , JAVA [ i ] ) ; } } }
It will build keyword tree of JAVA keywords
It will build keyword tree of JAVA keywords
// making hashtable of the size // collisions 209-float 308-private 268-switch // printf("collision %d  %s\n",key,JAVA[i]); // exit(1);