#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "kite_object.h"
Functions | |
kite_symtab_t * | kite_new_symtab () |
void | kite_copy_symtab_elements (kite_thread_t *thd, kite_symtab_t **dest, kite_symtab_t *src, kite_object_t *p) |
void | kite_copy_symtab (kite_symtab_t **dest, kite_symtab_t *src) |
void | kite_destruct_symtab (kite_thread_t *thd, kite_symtab_t **obj, int r) |
void | kite_symtab_insert (kite_thread_t *thd, kite_symtab_t **st, kite_symtab_t *obj) |
void | kite_symtab_remove (kite_thread_t *thd, kite_symtab_t **st, char *name, int n) |
void kite_copy_symtab | ( | kite_symtab_t ** | ret, | |
kite_symtab_t * | symt | |||
) |
Copy entire symbol table.
[out] | ret | The variable to place the new symbol table. |
symt | The symbol table to copy. |
References kite_symtab_t::docstring, kite_symtab_t::global, kite_copy_symtab(), kite_reference_object(), kite_symtab_t::left, kite_symtab_t::name, kite_symtab_t::right, and kite_symtab_t::value.
Referenced by kite_copy_symtab().
void kite_copy_symtab_elements | ( | kite_thread_t * | thd, | |
kite_symtab_t ** | ret, | |||
kite_symtab_t * | symt, | |||
kite_object_t * | p | |||
) |
Copy entire symbol table into another possibly existing table, setting parent as appropriate.
thd | The current thread. | |
[in,out] | ret | The symbol table to copy to (*ret = NULL to make a new table) |
symt | The symbol table to copy. | |
p | The new parent for each object copied from the table. |
References kite_symtab_t::docstring, kite_copy_symtab_elements(), kite_reference_object(), kite_symtab_insert(), kite_symtab_t::left, kite_symtab_t::name, kite_object_t::parent, kite_symtab_t::right, and kite_symtab_t::value.
Referenced by kite_copy_symtab_elements().
void kite_destruct_symtab | ( | kite_thread_t * | thd, | |
kite_symtab_t ** | symt, | |||
int | ref | |||
) |
Destroy symbol table.
thd | The current thread. | |
[in,out] | symt | The symbol table to remove. |
ref | If TRUE, dereference objects inside symbol table. |
References kite_dereference_object(), and kite_destruct_symtab().
Referenced by kite_destruct_object_nofree(), kite_destruct_symtab(), kite_free_vm(), and kite_vm_call_object().
kite_symtab_t* kite_new_symtab | ( | ) |
Create a new symbol table object.
void kite_symtab_insert | ( | kite_thread_t * | thd, | |
kite_symtab_t ** | symt, | |||
kite_symtab_t * | entry | |||
) |
Insert entry into symbol table.
thd | The current thread. | |
symt | The symbol table to insert into. | |
entry | The entry to insert. |
References kite_symtab_t::global, kite_dereference_object(), kite_symtab_insert(), kite_symtab_t::left, kite_symtab_t::name, and kite_symtab_t::right.
Referenced by kite_add_method(), kite_add_property(), kite_copy_symtab_elements(), kite_loader_register(), kite_symtab_insert(), and kite_vm_call_object().
void kite_symtab_remove | ( | kite_thread_t * | thd, | |
kite_symtab_t ** | symt, | |||
char * | name, | |||
int | num | |||
) |
Remove entry from symbol table.
thd | The current thread. | |
[in,out] | symt | The symbol table to remove from. |
name | The name of the entry to remove. | |
num | The number of arguments (or global vs non-global property) to remove. |
References kite_symtab_t::docstring, kite_dereference_object(), kite_symtab_remove(), kite_symtab_t::left, kite_symtab_t::name, kite_symtab_t::right, and kite_symtab_t::value.
Referenced by kite_remove_method(), kite_remove_property(), and kite_symtab_remove().