This commit is contained in:
2025-04-27 10:34:53 -07:00
parent 70d35cf0e3
commit ba08245e02
25 changed files with 551 additions and 77 deletions

View File

@@ -3,22 +3,28 @@
#include <ehs/Array.h>
#include <ehs/Str.h>
#include <ehs/Types.h>
#include <ehs/Version.h>
#include "Combination.h"
#include "Interpretation.h"
class Language
class EHS_LIB_IO Language
{
private:
friend class Arctyx;
ehs::UInt_64 id;
ehs::Str_8 name;
ehs::Array<ehs::Str_8> keywords;
ehs::Version version;
ehs::Char_8 eol;
ehs::Array<ehs::Char_8> separators;
ehs::Array<Combination> interpretations;
ehs::Array<Interpretation> interpretations;
static ehs::Array<const Language *> languages;
public:
Language();
Language(ehs::Str_8 name);
Language(ehs::Str_8 name, const ehs::Version &version);
Language(Language &&lang) noexcept;
@@ -32,4 +38,34 @@ public:
ehs::Str_8 GetName() const;
ehs::Version GetVersion() const;
void SetEOL(const ehs::Char_8 &newEOL);
ehs::Char_8 GetEOL() const;
ehs::Array<ehs::Char_8> GetSeparators() const;
bool HasSeparator(const ehs::Char_8 &separator) const;
bool AddSeparator(const ehs::Char_8 &separator);
ehs::Array<Interpretation> GetInterpretations() const;
bool HasInterpretation(const TokenT &type, const ehs::Str_8 &name) const;
const Interpretation *GetInterpretation(const TokenT &type, const ehs::Str_8 &name) const;
bool AddInterpretation(Interpretation interpretation);
static bool Has(const ehs::UInt_64 &id);
static bool Has(const ehs::Str_8 &name);
static const Language *Get(const ehs::UInt_64 &id);
static const Language *Get(const ehs::Str_8 &name);
static bool Add(Language lang);
};