mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-06 15:08:45 +00:00
36 lines
861 B
C++
36 lines
861 B
C++
#pragma once
|
|
|
|
#include <cstddef>
|
|
|
|
// for clangd
|
|
#include "parse_tree.hpp"
|
|
|
|
namespace info {
|
|
class GlobalInfo;
|
|
class Context;
|
|
} // namespace info
|
|
|
|
namespace interpreter {
|
|
class Visitor;
|
|
|
|
struct Node {
|
|
//public:
|
|
//Node(info::GlobalInfo& global_info) : global_info_(global_info) {}
|
|
|
|
// ?? not needed ?? virtual void Accept(Visitor* visitor);
|
|
|
|
/* ------------ use visitor instead ------------
|
|
virtual void build(parser::ParseTree::Cursor& cursor) = 0; // build tree from parse tree
|
|
|
|
virtual void find_symbols() = 0; // find types, typeclasses, namespaces, ..
|
|
virtual void assign_types() = 0; // typecheck
|
|
virtual void execute(info::Context& context) = 0; // execute part of tree
|
|
*/
|
|
/*private:
|
|
size_t start_position_; // ??
|
|
size_t end_position_; // ??
|
|
Node* parent_; // ??
|
|
info::GlobalInfo& global_info_;*/
|
|
};
|
|
|
|
} // namespace interpreter
|