可以处理生成加法的IR

This commit is contained in:
jing
2025-12-28 18:44:48 +08:00
parent 77bee889d7
commit e941cced9b
42 changed files with 919 additions and 158 deletions

16
src/sem/SymbolTable.h Normal file
View File

@@ -0,0 +1,16 @@
// 极简符号表:记录局部变量是否定义。
#pragma once
#include <string>
#include <unordered_map>
class SymbolTable {
public:
void Add(const std::string& name) { table_[name] = true; }
bool Contains(const std::string& name) const {
return table_.find(name) != table_.end();
}
private:
std::unordered_map<std::string, bool> table_;
};