32 lines
555 B
C++
32 lines
555 B
C++
|
#ifndef jk_COMPILER_HPP
|
||
|
#define jk_COMPILER_HPP
|
||
|
|
||
|
#include "commons.hpp"
|
||
|
#include "SymTable.hpp"
|
||
|
#include "Logger.hpp"
|
||
|
#include "Node.hpp"
|
||
|
#include "Program.hpp"
|
||
|
#include "VM.hpp"
|
||
|
|
||
|
namespace jk
|
||
|
{
|
||
|
JK_ERROR(compile_error);
|
||
|
|
||
|
class Compiler
|
||
|
{
|
||
|
public:
|
||
|
explicit Compiler(std::shared_ptr<SymTable> sym,
|
||
|
Logger& logger);
|
||
|
virtual ~Compiler();
|
||
|
|
||
|
void compile(std::shared_ptr<Node> node,
|
||
|
std::shared_ptr<Program> program);
|
||
|
|
||
|
private:
|
||
|
std::shared_ptr<SymTable> m_sym;
|
||
|
Logger& m_logger;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
#endif
|