78 lines
1.5 KiB
C++
78 lines
1.5 KiB
C++
#pragma once
|
|
#include <exception>
|
|
#include <string>
|
|
#include <token/token.hpp>
|
|
|
|
namespace Interpret
|
|
{
|
|
struct TokenError : public std::exception
|
|
{
|
|
Token::Token errorToken;
|
|
std::string errorMsg;
|
|
TokenError(Token::Token const & token, std::string const & msg);
|
|
};
|
|
|
|
struct ExpectedArgument : public TokenError
|
|
{
|
|
ExpectedArgument(Token::Token const & token);
|
|
};
|
|
|
|
struct ExpectedLabel : public TokenError
|
|
{
|
|
ExpectedLabel(Token::Token const & token);
|
|
};
|
|
|
|
struct ExpectedValue : public TokenError
|
|
{
|
|
ExpectedValue(Token::Token const & token);
|
|
};
|
|
|
|
struct ExpectedImmediate : public TokenError
|
|
{
|
|
ExpectedImmediate(Token::Token const & token);
|
|
};
|
|
|
|
struct ExpectedImmediateOrMemory : public TokenError
|
|
{
|
|
ExpectedImmediateOrMemory(Token::Token const & token);
|
|
};
|
|
|
|
struct ExpectedRegister : public TokenError
|
|
{
|
|
ExpectedRegister(Token::Token const & token);
|
|
};
|
|
|
|
struct ExpectedRegisterOrMemory : public TokenError
|
|
{
|
|
ExpectedRegisterOrMemory(Token::Token const & token);
|
|
};
|
|
|
|
struct ExpectedOperand : public TokenError
|
|
{
|
|
ExpectedOperand(Token::Token const & token);
|
|
};
|
|
|
|
struct TooManyArguments : public TokenError
|
|
{
|
|
TooManyArguments(Token::Token const & token);
|
|
};
|
|
|
|
struct TooFewArguments : public TokenError
|
|
{
|
|
TooFewArguments(Token::Token const & token);
|
|
};
|
|
|
|
struct MissingEndOfStatment : public TokenError
|
|
{
|
|
MissingEndOfStatment(Token::Token const & token);
|
|
};
|
|
|
|
namespace Internal
|
|
{
|
|
struct BadTokenForValue : public TokenError
|
|
{
|
|
BadTokenForValue(Token::Token const & token);
|
|
};
|
|
}
|
|
}
|