This repository has been archived on 2023-09-10. You can view files and clone it, but cannot push or open issues/pull-requests.
joko/lib/StaticFunction.hpp

33 lines
652 B
C++
Raw Normal View History

2023-09-10 14:16:20 +00:00
#ifndef jk_STATICFUNCTION_HPP
#define jk_STATICFUNCTION_HPP
#include "commons.hpp"
#include "Program.hpp"
#include "SymTable.hpp"
#include "Node.hpp"
namespace jk
{
using static_fun_t =
std::function<void
(std::shared_ptr<Node>,
std::shared_ptr<Program>,
std::shared_ptr<SymTable>)>;
class StaticFunction
{
public:
explicit StaticFunction(static_fun_t fun);
virtual ~StaticFunction();
void call(std::shared_ptr<Node> node,
std::shared_ptr<Program> program,
std::shared_ptr<SymTable> sym);
private:
static_fun_t m_fun;
};
}
#endif