Backup
This commit is contained in:
10
include/arctyx/Arctyx.h
Normal file
10
include/arctyx/Arctyx.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include <ehs/Types.h>
|
||||
|
||||
class Arctyx
|
||||
{
|
||||
private:
|
||||
static void Initialize();
|
||||
|
||||
static void Uninitialize();
|
||||
};
|
@@ -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);
|
||||
};
|
15
include/arctyx/compiler/Combination.h
Normal file
15
include/arctyx/compiler/Combination.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <ehs/Array.h>
|
||||
|
||||
#include "Token.h"
|
||||
|
||||
class Combination
|
||||
{
|
||||
private:
|
||||
ehs::Array<TokenType> tokens;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
};
|
11
include/arctyx/compiler/Keyword.h
Normal file
11
include/arctyx/compiler/Keyword.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
#include <ehs/Str.h>
|
||||
|
||||
#include "Instruction.h"
|
||||
|
||||
class Keyword
|
||||
{
|
||||
private:
|
||||
ehs::Str_8 identifier;
|
||||
Instruction instruction;
|
||||
};
|
35
include/arctyx/compiler/Language.h
Normal file
35
include/arctyx/compiler/Language.h
Normal 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;
|
||||
|
||||
};
|
36
include/arctyx/compiler/Token.h
Normal file
36
include/arctyx/compiler/Token.h
Normal 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;
|
||||
};
|
Reference in New Issue
Block a user