LispBM
|
Go to the source code of this file.
Typedefs | |
typedef void(* | symrepr_name_iterator_fun) (const char *) |
Functions | |
int | lbm_symrepr_init (void) |
void | lbm_symrepr_name_iterator (symrepr_name_iterator_fun f) |
int | lbm_add_symbol (char *name, lbm_uint *id) |
int | lbm_add_symbol_flash (char *name, lbm_uint *id) |
int | lbm_str_to_symbol (char *name, lbm_uint *sym_id) |
int | lbm_add_variable_symbol (char *name, lbm_uint *id) |
int | lbm_add_variable_symbol_const (char *name, lbm_uint *id) |
int | lbm_add_symbol_const (char *name, lbm_uint *id) |
int | lbm_add_extension_symbol (char *name, lbm_uint *id) |
int | lbm_add_extension_symbol_const (char *name, lbm_uint *id) |
int | lbm_get_symbol_by_name (char *name, lbm_uint *id) |
const char * | lbm_get_name_by_symbol (lbm_uint id) |
int | lbm_get_num_variables (void) |
lbm_uint | lbm_get_symbol_table_size (void) |
lbm_uint | lbm_get_symbol_table_size_flash (void) |
lbm_uint | lbm_get_symbol_table_size_names (void) |
lbm_uint | lbm_get_symbol_table_size_names_flash (void) |
Variables | |
lbm_value | symbol_x |
lbm_value | symbol_y |
symrepr.h implements the symbol table and symbol creation and lookup functions.
The symbol table is implemented as a linked list in the arrays and symbols memory defined in lispbm_memory.h. So lbm_memory_init must be run before the symbol table is initialized and used.
int lbm_add_extension_symbol | ( | char * | name, |
lbm_uint * | id | ||
) |
Add an extension symbol to the symbol table. The name is assumed to be a statically allocated constant.
name | Name of the symbol. |
id | Resulting id is returned through this argument. |
int lbm_add_extension_symbol_const | ( | char * | name, |
lbm_uint * | id | ||
) |
Add an extension symbol to the symbol table. The name is assumed to be statically allocated.
name | Statically allocated name string. |
id | Resulting id is returned through this argument. |
int lbm_add_symbol | ( | char * | name, |
lbm_uint * | id | ||
) |
Add a symbol to the symbol table. The symbol name string is copied to arrays and symbols memory.
name | String representation of the symbol. |
id | Resulting id is returned through this argument. |
int lbm_add_symbol_const | ( | char * | name, |
lbm_uint * | id | ||
) |
Add a symbol to the symbol table. The name is assumed to be a statically allocated string.
name | Statically allocated name string. |
id | Resulting id is returned through this argument. |
int lbm_add_symbol_flash | ( | char * | name, |
lbm_uint * | id | ||
) |
Add a symbol to the symbol table. The symbol name string is copied to flash.
name | String representation of the symbol. |
id | Resulting id is returned through this argument. |
int lbm_add_variable_symbol | ( | char * | name, |
lbm_uint * | id | ||
) |
Add a variable-symbol to the symbol table. The symbol name string is copied to arrays and symbols memory.
name | String representation of the symbol. |
id | Resulting id is returned through this argument. |
int lbm_add_variable_symbol_const | ( | char * | name, |
lbm_uint * | id | ||
) |
Add a variable-symbol to the symbol table. The symbol name is considered to be a statically allocated constant.
name | String representation of the symbol. |
id | Resulting id is returned through this argument. |
const char* lbm_get_name_by_symbol | ( | lbm_uint | id | ) |
Look up a symbol name from the symbol table given an id.
id | The id to look up in the symbol table. |
int lbm_get_symbol_by_name | ( | char * | name, |
lbm_uint * | id | ||
) |
Look up an id from the symbol table given a name.
name | Name string to look up. |
id | Resulting id is returned through this argument. |
lbm_uint lbm_get_symbol_table_size | ( | void | ) |
lbm_uint lbm_get_symbol_table_size_flash | ( | void | ) |
lbm_uint lbm_get_symbol_table_size_names | ( | void | ) |
lbm_uint lbm_get_symbol_table_size_names_flash | ( | void | ) |
int lbm_str_to_symbol | ( | char * | name, |
lbm_uint * | sym_id | ||
) |
Name of symbol to symbol. If the symbol exists the ID of the symbol is returned. If the name does not match any existing symbol, one is created and that ID is returned.
name | String name of symbol. |
id | Resulting ID is returned through this argument. |
int lbm_symrepr_init | ( | void | ) |
Initialize the symbol table.
void lbm_symrepr_name_iterator | ( | symrepr_name_iterator_fun | f | ) |
Iterate over all symbol names as strings
symrepr_name_iterator_fun | function taking a string |