summaryrefslogtreecommitdiffhomepage
path: root/dev/CompilerKit/Compiler.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-11-19 09:20:51 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-11-19 09:20:51 +0100
commita48098479269cdace4d9ce32264a73eef76994dc (patch)
tree43025631e922b4d61b4b19e0f84cde8b7dd785b2 /dev/CompilerKit/Compiler.h
parentd0df8d6dd397b175047db6764e4d64dc1d6d3118 (diff)
feat: new documented codebase and improvements.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/CompilerKit/Compiler.h')
-rw-r--r--dev/CompilerKit/Compiler.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/dev/CompilerKit/Compiler.h b/dev/CompilerKit/Compiler.h
index 3da99ca..a14005b 100644
--- a/dev/CompilerKit/Compiler.h
+++ b/dev/CompilerKit/Compiler.h
@@ -17,7 +17,9 @@ namespace CompilerKit {
class AssemblyFactory;
class AssemblyInterface;
+/// =========================================================== ///
/// @brief Simple assembly factory
+/// =========================================================== ///
class AssemblyFactory final {
public:
explicit AssemblyFactory() = default;
@@ -47,8 +49,10 @@ class AssemblyFactory final {
AssemblyInterface* fMounted{nullptr};
};
+/// =========================================================== ///
/// @brief Assembly to binary generator class.
/// @note This interface creates according to the CPU target of the child class.
+/// =========================================================== ///
class AssemblyInterface {
public:
explicit AssemblyInterface() = default;
@@ -58,11 +62,16 @@ class AssemblyInterface {
virtual UInt32 Arch() noexcept { return AssemblyFactory::kArchAMD64; }
+ /// =========================================================== ///
/// @brief compile to object file.
/// @note Example C++ -> MASM -> AE object.
+ /// =========================================================== ///
virtual Int32 CompileToFormat(std::string src, Int32 arch) = 0;
};
+/// =========================================================== ///
+/// @brief Number casting unions for different sizes.
+/// =========================================================== ///
union NumberCastBase {
NumberCastBase() = default;
~NumberCastBase() = default;
@@ -108,6 +117,9 @@ union NumberCast8 final {
UInt8 raw;
};
+/// =========================================================== ///
+/// @brief Assembly encoder interface.
+/// =========================================================== ///
class EncoderInterface {
public:
explicit EncoderInterface() = default;
@@ -120,6 +132,10 @@ class EncoderInterface {
virtual bool WriteNumber(const std::size_t& pos, std::string& from_what) = 0;
};
+/// =========================================================== ///
+/// @brief Different architecture encoders.
+/// =========================================================== ///
+
#ifdef __ASM_NEED_AMD64__
class EncoderAMD64 final : public EncoderInterface {