LispBM
symrepr.h
Go to the documentation of this file.
1  /*
2  Copyright 2018, 2021, 2022 Joel Svensson svenssonjoel@yahoo.se
3  2022 Benjamin Vedder
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
28 #ifndef SYMTAB_H_
29 #define SYMTAB_H_
30 
31 #include <stdint.h>
32 #include <stdbool.h>
33 
34 #include "lbm_types.h"
35 #include "lbm_defines.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 typedef void (*symrepr_name_iterator_fun)(const char *);
42 
43 
48 int lbm_symrepr_init(void);
53 void lbm_symrepr_name_iterator(symrepr_name_iterator_fun f);
60 int lbm_add_symbol(char *name, lbm_uint *id);
67 int lbm_add_symbol_flash(char *name, lbm_uint* id);
74 int lbm_str_to_symbol(char *name, lbm_uint *sym_id);
81 int lbm_add_variable_symbol(char *name, lbm_uint* id);
88 int lbm_add_variable_symbol_const(char *name, lbm_uint* id);
95 int lbm_add_symbol_const(char *name, lbm_uint *id);
103 int lbm_add_extension_symbol(char *name, lbm_uint* id);
111 int lbm_add_extension_symbol_const(char *name, lbm_uint* id);
118 int lbm_get_symbol_by_name(char *name, lbm_uint *id);
124 const char* lbm_get_name_by_symbol(lbm_uint id);
125 
126 int lbm_get_num_variables(void);
127 
146 
147 
148 extern lbm_value symbol_x;
149 extern lbm_value symbol_y;
150 
151 #ifdef __cplusplus
152 }
153 #endif
154 #endif
uint32_t lbm_value
Definition: lbm_types.h:43
const char * lbm_get_name_by_symbol(lbm_uint id)
int lbm_add_extension_symbol(char *name, lbm_uint *id)
int lbm_get_symbol_by_name(char *name, lbm_uint *id)
int lbm_add_symbol_flash(char *name, lbm_uint *id)
void lbm_symrepr_name_iterator(symrepr_name_iterator_fun f)
int lbm_add_symbol_const(char *name, lbm_uint *id)
int lbm_add_symbol(char *name, lbm_uint *id)
lbm_uint lbm_get_symbol_table_size_names(void)
lbm_uint lbm_get_symbol_table_size_names_flash(void)
lbm_uint lbm_get_symbol_table_size_flash(void)
int lbm_add_extension_symbol_const(char *name, lbm_uint *id)
int lbm_str_to_symbol(char *name, lbm_uint *sym_id)
int lbm_add_variable_symbol_const(char *name, lbm_uint *id)
lbm_uint lbm_get_symbol_table_size(void)
int lbm_add_variable_symbol(char *name, lbm_uint *id)
int lbm_symrepr_init(void)