3 #include "sapphirepch.h"
7 typedef std::vector<Token> TokenStream;
24 Lexer(
const std::string& fname);
26 std::string current_line_text;
27 std::string previous_line_text;
29 std::string current_lexed_text;
31 std::string recalculate_current_line(
const std::string& text);
33 Token create_string();
34 Token create_number();
35 Token create_identifier();
37 bool is_in_string(
const std::string&
string,
const char& character);
41 static const std::array<std::string, TYPE_COUNT> types;
46 TokenStream lex(
const std::string& text);
49 static std::unique_ptr<Lexer> make_lexer(
const std::string& fname);
52 static void assign_parent_location(std::unique_ptr<Lexer>& lexer,
const std::shared_ptr<Location>& loc);