Add a symbol table with type info

This commit is contained in:
2025-03-09 00:53:13 +01:00
parent 868db6e0bf
commit f739194e06
9 changed files with 471 additions and 342 deletions

View File

@ -63,14 +63,16 @@ namespace gcc
return error_mark_node;
}
void do_semantic_analysis(std::shared_ptr<symbol_table> symbols, std::unique_ptr<boot::program>& ast)
void do_semantic_analysis(const char *path, std::unique_ptr<boot::program>& ast,
std::shared_ptr<symbol_table> symbols)
{
boot::declaration_visitor declaration_visitor;
auto info_table = boot::builtin_symbol_table();
boot::declaration_visitor declaration_visitor(path, info_table);
declaration_visitor.visit(ast.get());
for (auto unresolved : declaration_visitor.unresolved)
{
auto inner_alias = elna::gcc::get_inner_alias(symbols, boot::type(unresolved.second));
auto inner_alias = get_inner_alias(symbols, boot::type(unresolved.second));
symbols->enter(unresolved.first, inner_alias);
}
}