Added direct memory access
This commit is contained in:
@@ -6,22 +6,43 @@
|
||||
|
||||
namespace Token
|
||||
{
|
||||
enum class TokenValueType
|
||||
{
|
||||
None = 0,
|
||||
Integer,
|
||||
Operand,
|
||||
Register,
|
||||
String
|
||||
};
|
||||
|
||||
struct Token
|
||||
{
|
||||
private:
|
||||
Token(TokenType type, bool validness, int const lineNumber, int const lineColumn);
|
||||
Token(TokenType type, std::string const & string, bool validness, int const lineNumber, int const lineColumn);
|
||||
Token(TokenType type, int value, bool validness, int const lineNumber, int const lineColumn);
|
||||
Token(TokenType type, RegisterType const registerType, bool validness, int const lineNumber, int const lineColumn);
|
||||
Token(TokenType type, OperandType const OperandType, bool validness, int const lineNumber, int const lineColumn);
|
||||
|
||||
public:
|
||||
int const lineNumber;
|
||||
int const lineColumn;
|
||||
TokenType type;
|
||||
TokenValueType const valueType;
|
||||
bool isValid;
|
||||
std::variant<OperandType, RegisterType, int, std::string> data;
|
||||
|
||||
Token(int const lineNumber, int const lineColumn);
|
||||
Token(int const lineNumber, int const lineColumn, OperandType operatorType, bool validness);
|
||||
Token(int const lineNumber, int const lineColumn, RegisterType registerType, bool validness);
|
||||
Token(int const lineNumber, int const lineColumn, int value, bool validness);
|
||||
Token(int const lineNumber, int const lineColumn, std::string const & value, bool validness);
|
||||
|
||||
Token(Token const & other);
|
||||
|
||||
static Token CreateUnknownToken(int const lineNumber, int const lineColumn);
|
||||
static Token CreateStatementEndToken(int const lineNumber, int const lineColumn);
|
||||
static Token CreateLabelToken(std::string const & string, bool isValid, int const lineNumber, int const lineColumn);
|
||||
static Token CreateImmediateValueToken(int const value, bool isValid, int const lineNumber, int const lineColumn);
|
||||
static Token CreateRegisterToken(RegisterType const registerType, int const lineNumber, int const lineColumn);
|
||||
static Token CreateOperandToken(OperandType const operandType, int const lineNumber, int const lineColumn);
|
||||
static Token CreateMemoryToken(RegisterType const registerType, int const lineNumber, int const lineColumn);
|
||||
static Token CreateMemoryToken(int const value, bool isValid, int const lineNumber, int const lineColumn);
|
||||
|
||||
void DebugPrint() const;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user