sem.h (586B)
1 #pragma once 2 3 #include <libgccjit.h> 4 #include <stdlib.h> 5 6 #include "types.h" 7 #include "parser.h" 8 9 // Symbol table functions 10 void symbol_add(const char *name, TypeInfo *type); 11 TypeInfo *symbol_get_type(const char *name); 12 Symbol *symbol_find(const char *name); 13 14 // Scope management functions 15 Scope scope_init(Node *); 16 void scope_add_symbol(Scope *scope, const char *name, TypeInfo *type); 17 Symbol *scope_find_symbol(Scope *scope, const char *name); 18 19 // Type checking functions 20 int types_equal(TypeInfo *a, TypeInfo *b); 21 22 void scope_build(Scope *, Ast *); 23 void scope_print(Scope *, Ast *);