This commit is contained in:
2025-04-14 00:28:12 -07:00
parent ee8e4d37ff
commit 70d35cf0e3
15 changed files with 236 additions and 4 deletions

View File

@@ -11,6 +11,8 @@ private:
ehs::Str_8 name;
ehs::Array<Instruction> instructions;
static ehs::Array<Architecture> architectures;
public:
Architecture();
@@ -24,7 +26,7 @@ public:
Architecture &operator=(const Architecture &arc);
ehs::UInt_64 Id() const;
ehs::UInt_64 GetId() const;
ehs::Str_8 GetName() const;
@@ -37,4 +39,14 @@ public:
const Instruction *GetInstruction(const ehs::Str_8 &name) const;
bool AddInstruction(Instruction ins);
static bool Has(const ehs::UInt_64 &id);
static bool Has(const ehs::Str_8 &name);
static const Architecture *Get(const ehs::UInt_64 &id);
static const Architecture *Get(const ehs::Str_8 &name);
static bool Add(Architecture arc);
};

View File

@@ -0,0 +1,15 @@
#pragma once
#include <ehs/Array.h>
#include "Token.h"
class Combination
{
private:
ehs::Array<TokenType> tokens;
public:
};

View File

@@ -0,0 +1,11 @@
#pragma once
#include <ehs/Str.h>
#include "Instruction.h"
class Keyword
{
private:
ehs::Str_8 identifier;
Instruction instruction;
};

View File

@@ -0,0 +1,35 @@
#pragma once
#include <ehs/Array.h>
#include <ehs/Str.h>
#include <ehs/Types.h>
#include "Combination.h"
class Language
{
private:
ehs::UInt_64 id;
ehs::Str_8 name;
ehs::Array<ehs::Str_8> keywords;
ehs::Array<ehs::Char_8> separators;
ehs::Array<Combination> interpretations;
public:
Language();
Language(ehs::Str_8 name);
Language(Language &&lang) noexcept;
Language(const Language &lang);
Language &operator=(Language &&lang) noexcept;
Language &operator=(const Language &lang);
ehs::UInt_64 GetId() const;
ehs::Str_8 GetName() const;
};

View File

@@ -0,0 +1,36 @@
#pragma once
#include <ehs/Str.h>
enum class TokenType : ehs::UInt_8
{
VALUE,
KEYWORD,
IDENTIFIER,
UNARY_OPERATOR,
COMPOUND_OPERATOR
};
class Token
{
private:
TokenType type;
ehs::Str_8 value;
public:
Token();
Token(TokenType type, ehs::Str_8 value);
Token(Token &&token) noexcept;
Token(const Token &token);
Token &operator=(Token &&token) noexcept;
Token &operator=(const Token &token);
TokenType GetType() const;
ehs::Str_8 GetValue() const;
};