initial commit

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1ad48ade1bc8234b7d7c9fe3d976a5be6a6a6964
This commit is contained in:
raf 2026-02-20 22:01:32 +03:00
commit 618a58b2b8
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
14 changed files with 2119 additions and 0 deletions

45
src/irc/ir_gen.h Normal file
View file

@ -0,0 +1,45 @@
#ifndef NIX_IRC_IR_GEN_H
#define NIX_IRC_IR_GEN_H
#include "types.h"
#include <string>
#include <unordered_map>
#include <vector>
#include <memory>
namespace nix_irc {
class IRGenerator {
public:
IRGenerator();
~IRGenerator();
void set_string_table(const std::unordered_map<std::string, uint32_t>& table);
uint32_t add_string(const std::string& str);
std::shared_ptr<Node> generate(const std::shared_ptr<Node>& ast);
private:
struct Impl;
std::unique_ptr<Impl> pImpl;
};
class NameResolver {
public:
NameResolver();
~NameResolver();
void enter_scope();
void exit_scope();
void bind(const std::string& name);
uint32_t resolve(const std::string& name);
bool is_bound(const std::string& name) const;
private:
struct Impl;
std::unique_ptr<Impl> pImpl;
};
}
#endif