symtab.c File Reference

#include "util.h"
#include "trace.h"
#include "except.h"
#include "symtab.h"

Include dependency graph for symtab.c:

Go to the source code of this file.

Functions

static int add_string (ILLsymboltab *h, const char *s, int *symbol)
static void delete_from_list (ILLsymboltab *h, int del_ind, int prev_ind, int x)
static int grow_namelist (ILLsymboltab *h)
static int grow_symboltab (ILLsymboltab *h)
int ILLsymboltab_contains (ILLsymboltab *tab, const char *name)
int ILLsymboltab_copy (ILLsymboltab *src, ILLsymboltab *dst)
int ILLsymboltab_create (ILLsymboltab *h, int init_size)
int ILLsymboltab_delete (ILLsymboltab *h, const char *s)
void ILLsymboltab_free (ILLsymboltab *h)
const char * ILLsymboltab_get (const ILLsymboltab *h, int i)
int ILLsymboltab_getindex (ILLsymboltab *h, const char *name, int *hindex)
int ILLsymboltab_index_ok (ILLsymboltab *h)
int ILLsymboltab_index_reset (ILLsymboltab *h, int icount, char **names)
void ILLsymboltab_init (ILLsymboltab *h)
int ILLsymboltab_lookup (ILLsymboltab *h, const char *s, int *ind)
void ILLsymboltab_prt (FILE *fd, ILLsymboltab *h)
int ILLsymboltab_register (ILLsymboltab *h, const char *s, int itemindex, int *the_prev_index, int *existed)
int ILLsymboltab_rename (ILLsymboltab *h, int i, const char *new_name)
void ILLsymboltab_size (const ILLsymboltab *h, int *p_size)
int ILLsymboltab_uname (ILLsymboltab *symtab, char *name, const char *try_prefix1, const char *try_prefix2)
void ILLsymboltab_unique_name (ILLsymboltab *tab, int i, const char *pref, char uname2[ILL_namebufsize])
static int look_it_up (ILLsymboltab *h, const char *s)
static void make_var (char *new_var, const char *prefix, char *name)
static unsigned int stringhash (const char *key, int tsize)

Variables

static int TRACE = 0


Function Documentation

static int add_string ( ILLsymboltab h,
const char *  s,
int *  symbol 
) [static]

Definition at line 607 of file symtab.c.

References grow_namelist(), ILL_CLEANUP_IF, ILL_RETURN, ILLsymboltab::namelist, ILLsymboltab::strsize, and ILLsymboltab::strspace.

Referenced by ILLsymboltab_register(), and ILLsymboltab_rename().

Here is the call graph for this function:

static void delete_from_list ( ILLsymboltab h,
int  del_ind,
int  prev_ind,
int  x 
) [static]

Definition at line 493 of file symtab.c.

References ILLsymboltab::freedchars, ILLsymboltab::hashtable, ILL_FAILtrue_no_rval, ILL_SYM_NOINDEX, ILLsymboltab::namelist, ILLsymboltab::nametable, ILLsymbolent::next, and ILLsymbolent::symbol.

Referenced by ILLsymboltab_delete(), and ILLsymboltab_rename().

static int grow_namelist ( ILLsymboltab h  )  [static]

Definition at line 561 of file symtab.c.

References ILLsymboltab::freedchars, ILL_SAFE_MALLOC, ILLsymboltab::namelist, ILLsymboltab::nametable, ILLsymboltab::strspace, ILLsymbolent::symbol, and ILLsymboltab::tablesize.

Referenced by add_string().

static int grow_symboltab ( ILLsymboltab h  )  [static]

Definition at line 515 of file symtab.c.

References ILLsymboltab::hashspace, ILLsymboltab::hashtable, ILL_IFFREE, ILL_RETURN, ILL_SAFE_MALLOC, ILL_SYM_NOINDEX, ILLutil_nextprime(), ILLsymboltab::name_space, ILLsymboltab::namelist, ILLsymboltab::nametable, ILLsymbolent::next, stringhash(), and ILLsymboltab::tablesize.

Referenced by ILLsymboltab_register().

Here is the call graph for this function:

int ILLsymboltab_contains ( ILLsymboltab tab,
const char *  name 
)

Definition at line 311 of file symtab.c.

References look_it_up().

Here is the call graph for this function:

int ILLsymboltab_copy ( ILLsymboltab src,
ILLsymboltab dst 
)

Definition at line 136 of file symtab.c.

References ILLsymboltab::hashspace, ILLsymboltab::hashtable, ILL_RETURN, ILL_SAFE_MALLOC, ILLsymboltab_free(), ILLsymboltab::name_space, ILLsymboltab::namelist, ILLsymboltab::nametable, ILLsymboltab::strsize, ILLsymboltab::strspace, and ILLsymboltab::tablesize.

Here is the call graph for this function:

int ILLsymboltab_create ( ILLsymboltab h,
int  init_size 
)

Definition at line 94 of file symtab.c.

References ILLsymboltab::freedchars, ILLsymboltab::hashspace, ILLsymboltab::hashtable, ILL_RETURN, ILL_SAFE_MALLOC, ILL_SYM_NOINDEX, ILLsymboltab_free(), ILLutil_nextprime(), ILLsymboltab::index_ok, ILLsymboltab::name_space, ILLsymboltab::namelist, ILLsymboltab::nametable, ILLsymboltab::strsize, ILLsymboltab::strspace, and ILLsymboltab::tablesize.

Here is the call graph for this function:

int ILLsymboltab_delete ( ILLsymboltab h,
const char *  s 
)

Definition at line 400 of file symtab.c.

References delete_from_list(), ILLsymboltab::hashtable, ILL_CLEANUP_IF, ILL_FAILfalse, ILL_FAILtrue, ILL_RETURN, ILL_SYM_NOINDEX, ILLsymboltab::index_ok, look_it_up(), ILLsymboltab::namelist, ILLsymboltab::nametable, ILLsymbolent::next, NULL, ILLsymbolent::symbol, ILLsymboltab::tablesize, ILLsymboltab::the_hash, ILLsymboltab::the_index, and ILLsymboltab::the_prev_index.

Here is the call graph for this function:

void ILLsymboltab_free ( ILLsymboltab h  ) 

Definition at line 83 of file symtab.c.

References ILLsymboltab::hashtable, ILL_IFFREE, ILLsymboltab_init(), ILLsymboltab::namelist, and ILLsymboltab::nametable.

Here is the call graph for this function:

const char* ILLsymboltab_get ( const ILLsymboltab h,
int  i 
)

Definition at line 173 of file symtab.c.

References ILL_FAILfalse_no_rval, ILLsymboltab::namelist, ILLsymboltab::nametable, NULL, and ILLsymbolent::symbol.

int ILLsymboltab_getindex ( ILLsymboltab h,
const char *  name,
int *  hindex 
)

Definition at line 229 of file symtab.c.

References ILL_CLEANUP, ILL_RETURN, ILLsymbolent::index, ILLsymboltab::index_ok, look_it_up(), ILLsymboltab::nametable, and ILLsymboltab::the_index.

Here is the call graph for this function:

int ILLsymboltab_index_ok ( ILLsymboltab h  ) 

Definition at line 186 of file symtab.c.

References ILLsymboltab::index_ok.

int ILLsymboltab_index_reset ( ILLsymboltab h,
int  icount,
char **  names 
)

Definition at line 192 of file symtab.c.

References ILL_CLEANUP, ILLsymboltab::index_ok, look_it_up(), and ILLsymboltab::tablesize.

Here is the call graph for this function:

void ILLsymboltab_init ( ILLsymboltab h  ) 

Definition at line 69 of file symtab.c.

References ILLsymboltab::freedchars, ILLsymboltab::hashspace, ILLsymboltab::hashtable, ILLsymboltab::name_space, ILLsymboltab::namelist, ILLsymboltab::nametable, NULL, ILLsymboltab::strsize, ILLsymboltab::strspace, and ILLsymboltab::tablesize.

int ILLsymboltab_lookup ( ILLsymboltab h,
const char *  s,
int *  ind 
)

Definition at line 300 of file symtab.c.

References look_it_up(), and ILLsymboltab::the_index.

Here is the call graph for this function:

void ILLsymboltab_prt ( FILE *  fd,
ILLsymboltab h 
)

Definition at line 442 of file symtab.c.

References ILLsymboltab::hashspace, ILLsymboltab::namelist, ILLsymboltab::nametable, stringhash(), ILLsymbolent::symbol, and ILLsymboltab::tablesize.

Here is the call graph for this function:

int ILLsymboltab_register ( ILLsymboltab h,
const char *  s,
int  itemindex,
int *  the_prev_index,
int *  existed 
)

Definition at line 325 of file symtab.c.

References add_string(), grow_symboltab(), ILLsymboltab::hashspace, ILLsymboltab::hashtable, ILL_CLEANUP_IF, ILL_IFTRACE, ILL_RETURN, ILL_SYM_NOINDEX, ILLsymbolent::index, ILLsymboltab::index_ok, look_it_up(), ILLsymboltab::name_space, ILLsymboltab::nametable, ILLsymbolent::next, NULL, stringhash(), ILLsymbolent::symbol, ILLsymboltab::tablesize, ILLsymboltab::the_hash, ILLsymboltab::the_index, and ILLsymboltab::the_prev_index.

Here is the call graph for this function:

int ILLsymboltab_rename ( ILLsymboltab h,
int  i,
const char *  new_name 
)

Definition at line 262 of file symtab.c.

References add_string(), delete_from_list(), ILL_CLEANUP_IF, ILL_FAILfalse, ILL_RETURN, ILL_SYM_NOINDEX, look_it_up(), NULL, and stringhash().

Here is the call graph for this function:

void ILLsymboltab_size ( const ILLsymboltab h,
int *  p_size 
)

Definition at line 318 of file symtab.c.

References ILLsymboltab::tablesize.

int ILLsymboltab_uname ( ILLsymboltab symtab,
char *  name,
const char *  try_prefix1,
const char *  try_prefix2 
)

Definition at line 670 of file symtab.c.

References ILL_FAILfalse, ILL_FAILtrue, ILL_namebufsize, ILLsymboltab_contains(), make_var(), NULL, and ILLsymboltab::tablesize.

Here is the call graph for this function:

void ILLsymboltab_unique_name ( ILLsymboltab tab,
int  i,
const char *  pref,
char  uname2[ILL_namebufsize] 
)

Definition at line 716 of file symtab.c.

References ILL_FAILtrue_no_rval, ILLsymboltab_uname(), and NULL.

Here is the call graph for this function:

static int look_it_up ( ILLsymboltab h,
const char *  s 
) [static]

Definition at line 463 of file symtab.c.

References ILLsymboltab::hashspace, ILLsymboltab::hashtable, ILL_FAILfalse_no_rval, ILL_IFTRACE, ILL_SYM_NOINDEX, ILLsymboltab::namelist, ILLsymboltab::nametable, ILLsymbolent::next, stringhash(), ILLsymboltab::the_hash, ILLsymboltab::the_index, and ILLsymboltab::the_prev_index.

Referenced by ILLsymboltab_contains(), ILLsymboltab_delete(), ILLsymboltab_getindex(), ILLsymboltab_index_reset(), ILLsymboltab_lookup(), ILLsymboltab_register(), and ILLsymboltab_rename().

Here is the call graph for this function:

static void make_var ( char *  new_var,
const char *  prefix,
char *  name 
) [static]

Definition at line 652 of file symtab.c.

References ILL_namebufsize.

Referenced by ILLsymboltab_uname().

static unsigned int stringhash ( const char *  key,
int  tsize 
) [static]

Definition at line 627 of file symtab.c.

Referenced by grow_symboltab(), ILLsymboltab_prt(), ILLsymboltab_register(), ILLsymboltab_rename(), and look_it_up().


Variable Documentation

int TRACE = 0 [static]

Definition at line 33 of file symtab.c.


Generated on Thu Mar 29 09:48:48 2012 for QSopt_ex by  doxygen 1.4.7