30 lines
608 B
C++
30 lines
608 B
C++
#ifndef roza_COMPILER_HPP
|
|
#define roza_COMPILER_HPP
|
|
|
|
#include "commons.hpp"
|
|
#include "Program.hpp"
|
|
#include "Node.hpp"
|
|
#include "opcodes.hpp"
|
|
#include "StatusLog.hpp"
|
|
#include "SymTable.hpp"
|
|
|
|
namespace roza
|
|
{
|
|
class Compiler
|
|
{
|
|
public:
|
|
explicit Compiler(StatusLog& log);
|
|
virtual ~Compiler();
|
|
|
|
std::shared_ptr<Program> compile(std::shared_ptr<Node> root);
|
|
void compile_node(std::shared_ptr<Node> root, std::shared_ptr<Program> prog);
|
|
void compile_children(std::shared_ptr<Node> root, std::shared_ptr<Program> prog);
|
|
|
|
private:
|
|
StatusLog& m_log;
|
|
SymTable m_sym;
|
|
};
|
|
}
|
|
|
|
#endif
|