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

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

    //better efficiency is needed here
    //may be binary search tree for string searching
    //js reserved words
    char* JS[] = {"new","abstract","else","instanceof","super","boolean","enum","int","switch","break","export","interface","synchronised","byte","extends","let"
                ,"this","case","false","long","throw","catch","final","native","throws","char","finally","transient","class","float","null","true"
                ,"const","for","package","try","continue","function","private","typeof","debugger","goto","protected","var","default","if","public","void","delete"
                ,"implements","return","volatile","do","import","short","while","double","in","static","with"};
    
    register int i;
    for(i=0;i<60;i++)
    {   
        key = hashfunction(JS[i]);
        
        if(key >= 0 && key<HASHSIZE && HASH[key]==NULL)
        {
            int s = strlen(JS[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],JS[i]);
        }
        else                                                // collision on 210 float
        {
            key++;
            int s = strlen(JS[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],JS[i]);
        }
    }
}
/**
 * It will build keyword tree of Javscript keywords
 * 
 * @return void
 **/
It will build keyword tree of Javscript keywords

@return void
It will build keyword tree of Javscript keywords @return void
void buildJS()
{
    int key = INT_MIN;
    HASH = (char**)malloc(sizeof(char*)*HASHSIZE);      
    char* JS[] = {"new","abstract","else","instanceof","super","boolean","enum","int","switch","break","export","interface","synchronised","byte","extends","let"
                ,"this","case","false","long","throw","catch","final","native","throws","char","finally","transient","class","float","null","true"
                ,"const","for","package","try","continue","function","private","typeof","debugger","goto","protected","var","default","if","public","void","delete"
                ,"implements","return","volatile","do","import","short","while","double","in","static","with"};
    register int i;
    for(i=0;i<60;i++)
    {   
        key = hashfunction(JS[i]);
        if(key >= 0 && key<HASHSIZE && HASH[key]==NULL)
        {
            int s = strlen(JS[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],JS[i]);
        }
        else                                                
        {
            key++;
            int s = strlen(JS[i]);
            HASH[key] = (char*)malloc(sizeof(char)*(s+1));
            strcpy(HASH[key],JS[i]);
        }
    }
}
void buildJS ( ) { int key = INT_MIN ; HASH = ( char * * ) malloc ( sizeof ( char * ) * HASHSIZE ) ; char * JS [ ] = { " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " } ; register int i ; for ( i = 0 ; i < 60 ; i ++ ) { key = hashfunction ( JS [ i ] ) ; if ( key >= 0 && key < HASHSIZE && HASH [ key ] == NULL ) { int s = strlen ( JS [ i ] ) ; HASH [ key ] = ( char * ) malloc ( sizeof ( char ) * ( s + 1 ) ) ; strcpy ( HASH [ key ] , JS [ i ] ) ; } else { key ++ ; int s = strlen ( JS [ i ] ) ; HASH [ key ] = ( char * ) malloc ( sizeof ( char ) * ( s + 1 ) ) ; strcpy ( HASH [ key ] , JS [ i ] ) ; } } }
It will build keyword tree of Javscript keywords
It will build keyword tree of Javscript keywords
// making hashtable of the size //better efficiency is needed here //may be binary search tree for string searching //js reserved words // collision on 210 float