evaulator: implement IR evaluation engine

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I980aaef64177b76620e3d1f9f39001046a6a6964
This commit is contained in:
raf 2026-02-21 20:47:22 +03:00
commit c32328f14d
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 519 additions and 1 deletions

35
src/irc/evaluator.h Normal file
View file

@ -0,0 +1,35 @@
#ifndef NIX_IRC_EVALUATOR_H
#define NIX_IRC_EVALUATOR_H
#include "types.h"
#include <memory>
#include <vector>
namespace nix {
class EvalState;
class Value;
class PosIdx;
}
namespace nix_irc {
class IRValue;
class IREnvironment;
class Evaluator {
public:
explicit Evaluator(nix::EvalState& state);
~Evaluator();
void eval_to_nix(const std::shared_ptr<Node>& ir_node,
nix::Value& result,
IREnvironment* env = nullptr);
private:
struct Impl;
std::unique_ptr<Impl> pImpl;
};
}
#endif