#ifndef VARIABLE_HPP
#define VARIABLE_HPP

#include "symbol.hpp"
#include "context.hpp"
//#include "reference.hpp"

class variable : public symbol_impl {
    std::string name;

public :
    explicit variable(const std::string& n) : name(n) {}

    variable* clone() const override {
        return new variable(name);
    }

    symbol_impl* evaluate(const interpreter_context& context) const override {
        return context.evaluate_identifier(name);
    }

    std::string serialize(const interpreter_context& context) const override {
        return name;
    }

    const std::string& type() const override {
        return type_name;
    }

    bool is_litteral() const override {
        return false;
    }

    static const std::string type_name;
};

#endif
