c-repl/src/include/interpreter.h
2023-11-15 13:40:37 +01:00

22 lines
412 B
C++

#ifndef INTERPRETER_H
#define INTERPRETER_H
#include <variant>
#include <string>
#include <stdexcept>
using namespace std;
using EvalResult = variant<int, monostate>;
class RuntimeError : public runtime_error {
public:
explicit RuntimeError(const string& message)
: runtime_error(message) {}
};
/*
Evaluates the AST, returning the latest calulated value
*/
EvalResult eval(Node &ast);
#endif