2020-11-10 15:26:38 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <hex.hpp>
|
|
|
|
|
|
|
|
#include "token.hpp"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace hex::lang {
|
|
|
|
|
|
|
|
class Lexer {
|
|
|
|
public:
|
|
|
|
Lexer();
|
|
|
|
|
|
|
|
std::pair<Result, std::vector<Token>> lex(const std::string& code);
|
2020-11-27 21:20:23 +01:00
|
|
|
|
|
|
|
const std::pair<u32, std::string>& getError() { return this->m_error; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::pair<u32, std::string> m_error;
|
2020-11-10 15:26:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|