-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsymtab.h
More file actions
38 lines (32 loc) · 690 Bytes
/
symtab.h
File metadata and controls
38 lines (32 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef _SYMTAB_H_
#define _SYMTAB_H_
#include "datatype.h"
#include "llist.h"
typedef enum
{
SYMBOL_VAR,
SYMBOL_FUNC
} SymbolType_e;
typedef struct
{
char *sym_name;
SymbolType_e sym_type;
Datatype_t *data_type;
} Symbol_t;
typedef struct
{
char *sym_name;
SymbolType_e sym_type;
Datatype_t *data_type;
LList_t args;
} SymbolFunc_t;
typedef struct
{
char *arg_name;
Datatype_t *arg_type;
} SymbolFuncArg_t;
void symtab_init_global_symtab();
int symtab_add_global_symbol(char *symbol_name, SymbolType_e sym_type, Datatype_t *data_type);
int symtab_find_global_symbol(char *symbol_name);
Symbol_t *symtab_get_symbol(int symbol_index);
#endif