Beginnings of a working compiler.

This commit is contained in:
2025-04-27 22:53:48 -07:00
parent ba08245e02
commit 0fc10f4c76
21 changed files with 1239 additions and 71 deletions

View File

@@ -2,6 +2,7 @@
#include <ehs/Array.h>
#include "Register.h"
#include "Instruction.h"
class EHS_LIB_IO Architecture
@@ -11,6 +12,7 @@ private:
ehs::UInt_64 id;
ehs::Str_8 name;
ehs::Array<Register> registers;
ehs::Array<Instruction> instructions;
static ehs::Array<const Architecture *> architectures;
@@ -32,6 +34,16 @@ public:
ehs::Str_8 GetName() const;
bool HasRegister(const ehs::UInt_64 &id) const;
bool HasRegister(const ehs::Str_8 &name) const;
const Register *GetRegister(const ehs::UInt_64 &id) const;
const Register *GetRegister(const ehs::Str_8 &name) const;
bool AddRegister(Register reg);
bool HasInstruction(const ehs::UInt_64 &id) const;
bool HasInstruction(const ehs::Str_8 &name) const;
@@ -51,4 +63,4 @@ public:
static const Architecture *Get(const ehs::Str_8 &name);
static bool Add(Architecture arc);
};
};