Files
json/include/lexer.hpp
2025-05-31 01:35:33 -05:00

28 lines
1.0 KiB
C++

#include <json.hpp>
#pragma once
/// @namespace json::lexers
/// @brief This namespace provides functions for lexical analysis (tokenizing)
///
/// Each function in this namespace is responsible for "lexing" a specific type of token,
/// from a raw JSON string,
namespace json::lexers {
int lex_whitespace(std::string raw_json, int index);
std::tuple<json::token, int, std::string> lex_syntax(std::string raw_json, int index);
std::tuple<json::token, int, std::string> lex_string(std::string raw_json, int original_index);
std::tuple<json::token, int, std::string> lex_number(std::string raw_json, int original_index);
std::tuple<json::token, int, std::string> lex_keyword(std::string raw_json, std::string keyword, json::token_type type, int original_index);
std::tuple<json::token, int, std::string> lex_null(std::string raw_json, int index);
std::tuple<json::token, int, std::string> lex_true(std::string raw_json, int index);
std::tuple<json::token, int, std::string> lex_false(std::string raw_json, int index);
}