Lines Matching refs:table

35      * Link to the next symbol in the table with the same name
43 * Link to the next symbol in the table with the same scope
76 /** Hash table containing all symbols in the symbol table. */
87 _mesa_symbol_table_pop_scope(struct _mesa_symbol_table *table)
89 struct scope_level *const scope = table->current_scope;
92 table->current_scope = scope->next;
93 table->depth--;
99 struct hash_entry *hte = _mesa_hash_table_search(table->ht,
103 * the hash table to point to it.
108 _mesa_hash_table_remove(table->ht, hte);
119 _mesa_symbol_table_push_scope(struct _mesa_symbol_table *table)
127 scope->next = table->current_scope;
128 table->current_scope = scope;
129 table->depth++;
134 find_symbol(struct _mesa_symbol_table *table, const char *name)
136 struct hash_entry *entry = _mesa_hash_table_search(table->ht, name);
150 _mesa_symbol_table_symbol_scope(struct _mesa_symbol_table *table,
153 struct symbol *const sym = find_symbol(table, name);
156 assert(sym->depth <= table->depth);
157 return table->depth - sym->depth;
165 _mesa_symbol_table_find_symbol(struct _mesa_symbol_table *table,
168 struct symbol *const sym = find_symbol(table, name);
177 _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *table,
181 struct symbol *sym = find_symbol(table, name);
183 if (sym && sym->depth == table->depth)
205 new_sym->next_with_same_scope = table->current_scope->symbols;
207 new_sym->depth = table->depth;
209 table->current_scope->symbols = new_sym;
211 _mesa_hash_table_insert(table->ht, new_sym->name, new_sym);
217 _mesa_symbol_table_replace_symbol(struct _mesa_symbol_table *table,
221 struct symbol *sym = find_symbol(table, name);
232 _mesa_symbol_table_add_global_symbol(struct _mesa_symbol_table *table,
237 struct symbol *sym = find_symbol(table, name);
250 for (top_scope = table->current_scope; top_scope->next != NULL;
282 _mesa_hash_table_insert(table->ht, sym->name, sym);
292 struct _mesa_symbol_table *table = calloc(1, sizeof(*table));
294 if (table != NULL) {
295 table->ht = _mesa_hash_table_create(NULL, _mesa_hash_string,
298 _mesa_symbol_table_push_scope(table);
301 return table;
306 _mesa_symbol_table_dtor(struct _mesa_symbol_table *table)
308 while (table->current_scope != NULL) {
309 _mesa_symbol_table_pop_scope(table);
312 _mesa_hash_table_destroy(table->ht, NULL);
313 free(table);