evaulator: implement IR evaluation engine
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I980aaef64177b76620e3d1f9f39001046a6a6964
This commit is contained in:
parent
4b97433642
commit
c32328f14d
3 changed files with 519 additions and 1 deletions
35
src/irc/evaluator.h
Normal file
35
src/irc/evaluator.h
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue