- 添加 .gitignore 文件,忽略编译器生成的二进制文件 - 重构 lexer.c 文件,改进了关键字处理和字符串处理 - 更新前端的前端、解析器和 AST 相关文件,以适应新的词法分析器 - 优化了 token 相关的定义和函数,引入了新的 token 类型
18 lines
477 B
C
18 lines
477 B
C
#ifndef __SMCC_STRPOOL_H__
|
|
#define __SMCC_STRPOOL_H__
|
|
|
|
#include <lib/core.h>
|
|
#include <lib/rt/rt_alloc.h>
|
|
#include <lib/utils/ds/hashtable.h>
|
|
|
|
typedef struct strpool {
|
|
hash_table_t ht; // 用于快速查找字符串
|
|
long_alloc_t stralloc; // 专门用于字符串存储的分配器
|
|
} strpool_t;
|
|
|
|
void init_strpool(strpool_t* pool);
|
|
const char* strpool_intern(strpool_t* pool, const char* str);
|
|
void strpool_destroy(strpool_t* pool);
|
|
|
|
#endif // __SMCC_STRPOOL_H__
|