33 lines
652 B
C++
33 lines
652 B
C++
|
#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
|