Lines Matching +full:lookup +full:- +full:table

1 /* sym - symbol table routines */
10 /* to contract no. DE-AC03-76SF00098 between the United States */
37 * sctbl - start-condition symbol table
38 * ndtbl - name-definition symbol table
39 * ccltab - character class text symbol table
63 static struct hash_entry *findsym (const char *sym, hash_table table,
68 /* addsym - add symbol and definitions to symbol table
70 * -1 is returned if the symbol already exists, and the change not made.
73 static int addsym (char sym[], char *str_def, int int_def, hash_table table, int table_size) in addsym() argument
76 struct hash_entry *sym_entry = table[hash_val]; in addsym()
81 if (!strcmp (sym, sym_entry->name)) { /* entry already exists */ in addsym()
82 return -1; in addsym()
85 sym_entry = sym_entry->next; in addsym()
92 flexfatal (_("symbol table memory allocation failed")); in addsym()
94 if ((successor = table[hash_val]) != 0) { in addsym()
95 new_entry->next = successor; in addsym()
96 successor->prev = new_entry; in addsym()
99 new_entry->next = NULL; in addsym()
101 new_entry->prev = NULL; in addsym()
102 new_entry->name = sym; in addsym()
103 new_entry->str_val = str_def; in addsym()
104 new_entry->int_val = int_def; in addsym()
106 table[hash_val] = new_entry; in addsym()
112 /* cclinstal - save the text of a character class */
125 /* ccllookup - lookup the number associated with character class text
132 return findsym (ccltxt, ccltab, CCL_HASH_SIZE)->int_val; in ccllookup()
136 /* findsym - find symbol in symbol table */
138 static struct hash_entry *findsym (const char *sym, hash_table table, int table_size) in findsym() argument
145 table[hashfunct (sym, table_size)]; in findsym()
148 if (!strcmp (sym, sym_entry->name)) in findsym()
150 sym_entry = sym_entry->next; in findsym()
156 /* hashfunct - compute the hash value for "str" and hash size "hash_size" */
175 /* ndinstal - install a name definition */
187 /* ndlookup - lookup a name definition
194 return findsym (nd, ndtbl, NAME_TABLE_HASH_SIZE)->str_val; in ndlookup()
198 /* scextend - increase the maximum number of start conditions */
214 /* scinstal - make a start condition
241 /* sclookup - lookup the number associated with a start condition
248 return findsym (str, sctbl, START_COND_HASH_SIZE)->int_val; in sclookup()