Compile to bytecode

This commit is contained in:
2020-09-03 19:03:32 +02:00
parent 473334c3db
commit 96345ad6ba
45 changed files with 1615 additions and 1231 deletions

View File

@@ -0,0 +1,28 @@
#pragma once
#include <string>
#include <token/token.hpp>
namespace Compile
{
class CompilationError
{
public:
Token::Token errorToken;
CompilationError(std::string const & message, Token::Token const & token);
static CompilationError CreateExpectedArgumentError(Token::Token const & token);
static CompilationError CreateExpectedLabelError(Token::Token const & token);
static CompilationError CreateExpectedImmediateError(Token::Token const & token);
static CompilationError CreateExpectedImmediateOrRegisterOrMemory(Token::Token const & token);
static CompilationError CreateExpectedRegisterError(Token::Token const & token);
static CompilationError CreateExpectedRegisterOrMemoryError(Token::Token const & token);
static CompilationError CreateExpectedOperandError(Token::Token const & token);
static CompilationError CreateTooManyArgumentsError(Token::Token const & token);
static CompilationError CreateTooFewArgumentsError(Token::Token const & token);
static CompilationError CreateExpectedEndOfStatementError(Token::Token const & token);
static CompilationError CreateDuplicateLabelError(Token::Token const & token);
static CompilationError CreateNonExistingLabelError(Token::Token const & token);
};
}