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