support running recursive directory
This commit is contained in:
@ -11,6 +11,7 @@ namespace xsk::gsc
|
||||
class assembler
|
||||
{
|
||||
public:
|
||||
virtual ~assembler() = default;
|
||||
virtual auto output_script() -> std::vector<std::uint8_t> = 0;
|
||||
virtual auto output_stack() -> std::vector<std::uint8_t> = 0;
|
||||
virtual void assemble(const std::string& file, std::vector<std::uint8_t>& data) = 0;
|
||||
|
@ -11,6 +11,7 @@ namespace xsk::gsc
|
||||
class compiler
|
||||
{
|
||||
public:
|
||||
virtual ~compiler() = default;
|
||||
virtual auto output() -> std::vector<gsc::function_ptr> = 0;
|
||||
virtual void compile(const std::string& file, std::vector<std::uint8_t>& data) = 0;
|
||||
virtual void set_readf_callback(std::function<std::vector<std::uint8_t>(const std::string&)> func) = 0;
|
||||
|
@ -11,6 +11,7 @@ namespace xsk::gsc
|
||||
class decompiler
|
||||
{
|
||||
public:
|
||||
virtual ~decompiler() = default;
|
||||
virtual auto output() -> std::vector<std::uint8_t> = 0;
|
||||
virtual void decompile(const std::string& file, std::vector<gsc::function_ptr>& functions) = 0;
|
||||
};
|
||||
|
@ -11,6 +11,7 @@ namespace xsk::gsc
|
||||
class disassembler
|
||||
{
|
||||
public:
|
||||
virtual ~disassembler() = default;
|
||||
virtual auto output() -> std::vector<gsc::function_ptr> = 0;
|
||||
virtual auto output_data() -> std::vector<std::uint8_t> = 0;
|
||||
virtual void disassemble(const std::string& file, std::vector<std::uint8_t>& script, std::vector<std::uint8_t>& stack) = 0;
|
||||
|
@ -11,26 +11,26 @@ namespace xsk::gsc
|
||||
class error : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
error(const std::string& what) : std::runtime_error("[gsc]: "s + what) { }
|
||||
error(const std::string& what) : std::runtime_error("[ERROR]: "s + what) { }
|
||||
};
|
||||
|
||||
class asm_error : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
asm_error(const std::string& what) : std::runtime_error("[gsc assembler]: "s + what) { }
|
||||
asm_error(const std::string& what) : std::runtime_error("[ERROR]:assembler: "s + what) { }
|
||||
};
|
||||
|
||||
class disasm_error : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
disasm_error(const std::string& what) : std::runtime_error("[gsc disassembler]: "s + what) { }
|
||||
disasm_error(const std::string& what) : std::runtime_error("[ERROR]:disassembler: "s + what) { }
|
||||
};
|
||||
|
||||
class comp_error : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
comp_error(gsc::location loc, const std::string& what)
|
||||
: std::runtime_error("[gsc compiler]:" +
|
||||
: std::runtime_error("[ERROR]:compiler:" +
|
||||
*loc.begin.filename + ":" +
|
||||
std::to_string(loc.begin.line) + ":" +
|
||||
std::to_string(loc.begin.column) + ": " + what) { }
|
||||
@ -39,7 +39,7 @@ public:
|
||||
class decomp_error : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
decomp_error(const std::string& what) : std::runtime_error("[gsc decompiler]: "s + what) { }
|
||||
decomp_error(const std::string& what) : std::runtime_error("[ERROR]:decompiler: "s + what) { }
|
||||
};
|
||||
|
||||
} // namespace xsk::gsc
|
||||
|
Reference in New Issue
Block a user