28 lines
1.0 KiB
C++
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);
|
|
}
|