refactor(irgen): 完善irgen代码和文档,提升扩展兼容性

This commit is contained in:
jing
2026-03-17 19:03:49 +08:00
parent a091d9108a
commit f19d23c656
8 changed files with 115 additions and 72 deletions

View File

@@ -8,10 +8,10 @@
class SymbolTable {
public:
void Add(const std::string& name, SysYParser::VarDeclContext* decl);
void Add(const std::string& name, SysYParser::VarDefContext* decl);
bool Contains(const std::string& name) const;
SysYParser::VarDeclContext* Lookup(const std::string& name) const;
SysYParser::VarDefContext* Lookup(const std::string& name) const;
private:
std::unordered_map<std::string, SysYParser::VarDeclContext*> table_;
std::unordered_map<std::string, SysYParser::VarDefContext*> table_;
};