#pragma once #include #include #include "instruction.h" #include "parse.h" class Encoding { }; class OpCode: public Encoding { private: Instruction _instruction; std::vector _arguments; }; class Data: public Encoding { }; using Assembly = std::vector; class Assembler { public: Assembler(){} // passes: // 0. parse // 1. assign sizes and offsets to codes (assign labels) // 2. assemble to code sequence (use labels for offsets) code_sequence encode(const std::string& source){ throw std::runtime_error("Assembler.encode unimplemented");} std::string decode(code_sequence) { throw std::runtime_error("Assembler.decode unimplemented");} };