#ifndef SCANNER_HH #define SCANNER_HH #include "token.hh" #include #include #include #include struct Scanner { Scanner(const std::string &code); std::vector scan_tokens(); bool is_at_end(); bool is_digit(char c); bool is_alpha(char c); bool is_alphanumeric(char c); void scan_token(); char advance(); bool match(char expected); char peek(); char peek_next(); void add_token(TokenType type); void add_token(TokenType type, Object literal); void string(); void number(); void identifier(); std::string code; std::vector tokens; std::size_t start, current, line; std::unordered_map keywords; }; #endif