Everywhere: Start implementation of step2

This commit is contained in:
Riyyi
2023-03-24 21:46:01 +01:00
parent b51a3bf15b
commit da0b0a91a6
8 changed files with 419 additions and 2 deletions
+32
View File
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2023 Riyyi
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#include "ast.h"
#include "environment.h"
namespace blaze {
class Eval {
public:
Eval(ASTNode* ast, Environment* env);
virtual ~Eval() = default;
void eval();
ASTNode* ast() const { return m_ast; }
private:
ASTNode* evalImpl(ASTNode* ast, Environment* env);
ASTNode* evalAst(ASTNode* ast, Environment* env);
ASTNode* apply(List* evaluated_list);
ASTNode* m_ast { nullptr };
Environment* m_env { nullptr };
};
} // namespace blaze