28 lines
800 B
C++
28 lines
800 B
C++
#pragma once
|
|
#include <token/operandtype.hpp>
|
|
#include <token/registertype.hpp>
|
|
#include <token/tokentype.hpp>
|
|
#include <variant>
|
|
|
|
namespace Token
|
|
{
|
|
struct Token
|
|
{
|
|
int const lineNumber;
|
|
int const lineColumn;
|
|
TokenType type;
|
|
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);
|
|
|
|
void DebugPrint() const;
|
|
};
|
|
}
|