context wrappers

This commit is contained in:
xensik
2022-03-15 12:39:04 +01:00
parent 3098dacc9e
commit 096316ea67
87 changed files with 805 additions and 309 deletions

View File

@ -16,7 +16,6 @@ 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 read_callback(std::function<std::vector<std::uint8_t>(const std::string&)> func) = 0;
};
} // namespace xsk::gsc

View File

@ -0,0 +1,26 @@
// Copyright 2022 xensik. All rights reserved.
//
// Use of this source code is governed by a GNU GPLv3 license
// that can be found in the LICENSE file.
#pragma once
namespace xsk::gsc
{
class context
{
public:
using ptr = std::unique_ptr<context>;
virtual ~context() = default;
virtual void init(build mode, read_cb_type callback) = 0;
virtual void cleanup() = 0;
virtual auto assembler() -> assembler& = 0;
virtual auto disassembler() -> disassembler& = 0;
virtual auto compiler() -> compiler& = 0;
virtual auto decompiler() -> decompiler& = 0;
};
} // namespace xsk::gsc

View File

@ -8,6 +8,8 @@
namespace xsk::gsc
{
using read_cb_type = std::function<std::vector<std::uint8_t>(const std::string&)>;
enum class build
{
dev,

View File

@ -24,6 +24,7 @@
#include "gsc/interfaces/disassembler.hpp"
#include "gsc/interfaces/compiler.hpp"
#include "gsc/interfaces/decompiler.hpp"
#include "gsc/interfaces/context.hpp"
// ARC Types
#include "arc/location.hpp"