c-repl/src/include/interpreter.h

28 lines
560 B
C++

#ifndef INTERPRETER_H
#define INTERPRETER_H
#include <string>
#include <stdexcept>
#include "types.h"
#include "memory.h"
#include "errors.h"
using namespace std;
/*
Evaluates the AST, returning the latest calulated value
*/
EvalResult eval(Node &ast, Memory& memory);
class BreakException : public InternalError {
public:
explicit BreakException(CodePosition pos)
: InternalError(pos) {}
};
class ContinueException : public InternalError {
public:
explicit ContinueException(CodePosition pos)
: InternalError(pos) {}
};
#endif