#ifndef INTERPRETER_H
#define INTERPRETER_H

#include <string>
#include <stdexcept>
#include "types.h"
#include "memory.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