|
Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
|
syntax analysis More...
#include <json.hpp>
Public Types | |
| enum | parse_event_t : uint8_t { parse_event_t::object_start, parse_event_t::object_end, parse_event_t::array_start, parse_event_t::array_end, parse_event_t::key, parse_event_t::value } |
| using | parser_callback_t = std::function< bool(int depth, parse_event_t event, BasicJsonType &parsed)> |
Public Member Functions | |
| parser (detail::input_adapter_t &&adapter, const parser_callback_t cb=nullptr, const bool allow_exceptions_=true) | |
| a parser reading from an input adapter More... | |
| void | parse (const bool strict, BasicJsonType &result) |
| public parser interface More... | |
| bool | accept (const bool strict=true) |
| public accept interface More... | |
| template<typename SAX > | |
| bool | sax_parse (SAX *sax, const bool strict=true) |
Private Types | |
| using | number_integer_t = typename BasicJsonType::number_integer_t |
| using | number_unsigned_t = typename BasicJsonType::number_unsigned_t |
| using | number_float_t = typename BasicJsonType::number_float_t |
| using | string_t = typename BasicJsonType::string_t |
| using | lexer_t = lexer< BasicJsonType > |
| using | token_type = typename lexer_t::token_type |
Private Member Functions | |
| template<typename SAX > | |
| bool | sax_parse_internal (SAX *sax) |
| token_type | get_token () |
| get next token from lexer More... | |
| std::string | exception_message (const token_type expected, const std::string &context) |
Private Attributes | |
| const parser_callback_t | callback = nullptr |
| callback function More... | |
| token_type | last_token = token_type::uninitialized |
| the type of the last read token More... | |
| lexer_t | m_lexer |
| the lexer More... | |
| const bool | allow_exceptions = true |
| whether to throw exceptions in case of errors More... | |
syntax analysis
This class implements a recursive decent parser.
|
private |
|
private |
|
private |
|
private |
| using nlohmann::detail::parser< BasicJsonType >::parser_callback_t = std::function<bool(int depth, parse_event_t event, BasicJsonType& parsed)> |
|
private |
|
private |
|
strong |
Definition at line 4849 of file json.hpp.
|
inlineexplicit |
a parser reading from an input adapter
Definition at line 4869 of file json.hpp.
|
inline |
public accept interface
| [in] | strict | whether to expect the last token to be EOF |
Definition at line 4949 of file json.hpp.
References nlohmann::detail::strict.
|
inlineprivate |
Definition at line 5271 of file json.hpp.
References nlohmann::detail::string.
|
inlineprivate |
get next token from lexer
Definition at line 5266 of file json.hpp.
|
inline |
public parser interface
| [in] | strict | whether to expect the last token to be EOF |
| [in,out] | result | parsed JSON value |
| parse_error.101 | in case of an unexpected token |
| parse_error.102 | if to_unicode fails or surrogate error |
| parse_error.103 | if to_unicode fails |
Definition at line 4888 of file json.hpp.
References nlohmann::detail::parse_error::create(), nlohmann::detail::discarded, nlohmann::detail::json_sax_dom_parser< BasicJsonType >::is_errored(), nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >::is_errored(), nlohmann::detail::json_sax_dom_parser< BasicJsonType >::parse_error(), and nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >::parse_error().
|
inline |
Definition at line 4956 of file json.hpp.
References nlohmann::detail::parse_error::create(), nlohmann::detail::strict, and nlohmann::detail::void().
|
inlineprivate |
Definition at line 4975 of file json.hpp.
References nlohmann::detail::parse_error::create(), nlohmann::detail::out_of_range::create(), JSON_LIKELY, and JSON_UNLIKELY.
|
private |
|
private |
|
private |
|
private |