Basic arithmetic and jump labels
This commit is contained in:
62
include/interpret/errors.hpp
Normal file
62
include/interpret/errors.hpp
Normal file
@@ -0,0 +1,62 @@
|
||||
#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 ExpectedImmediate : public TokenError
|
||||
{
|
||||
ExpectedImmediate(Token::Token const & token);
|
||||
};
|
||||
|
||||
struct ExpectedRegister : public TokenError
|
||||
{
|
||||
ExpectedRegister(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);
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user