lexLeo
Loading...
Searching...
No Matches
symtab.h
1// src/core/symtab/include/symtab.h
2
3// for resolution environment (relative to resolver)
4
5#ifndef SYMTAB_H
6#define SYMTAB_H
7
8#include "internal/symtab_internal.h"
9
10#define MAXIMUM_SYMBOL_NAME_LENGTH 255
11typedef struct symbol {
12 char *name; // owned ; must be not NULL and not exceeding MAXIMUM_SYMBOL_NAME_LENGTH characters
13} symbol;
14
15typedef struct symtab symtab;
16
17symtab *symtab_wind_scope(symtab *st); // the caller is responsible for passing either NULL or a well-formed symtab pointer
18symtab *symtab_unwind_scope(symtab *st); // the caller is responsible for passing either NULL or a well-formed symtab pointer
19
20int symtab_intern_symbol(symtab *st, const char *name); // the caller is responsible for st ; do nothing if symbol already interned
21
22symbol *symtab_get_local(symtab *st, const char *name); // the caller is responsible for passing either NULL or a well-formed symtab pointer
23int symtab_remove(symtab *st, const char *name); // the caller is responsible for passing either NULL or a well-formed symtab pointer
24int symtab_contains_local(symtab *st, const char *name);
25symbol *symtab_get(symtab *st, const char *name); // the caller is responsible for passing either NULL or a well-formed symtab pointer
26int symtab_contains(symtab *st, const char *name); // the caller is responsible for passing either NULL or a well-formed symtab pointer
27
28
29
30// DEBUG TOOLS
31
32char *symbol_pool_to_string(void);
33
34#endif //SYMTAB_H
Definition interpreter.c:408
Definition symtab_internal.h:14