![]() |
Eclipse SUMO - Simulation of Urban MObility
|
syntax analysis More...
#include <json.hpp>
Public Member Functions | |
| bool | accept (const bool strict=true) |
| public accept interface | |
| void | parse (const bool strict, BasicJsonType &result) |
| public parser interface | |
| *a parser reading from an input adapter | parser (InputAdapterType &&adapter, const parser_callback_t< BasicJsonType > cb=nullptr, const bool allow_exceptions_=true, const bool skip_comments=false) |
| template<typename SAX> | |
| bool | sax_parse (SAX *sax, const bool strict=true) |
Private Types | |
| using | lexer_t = lexer<BasicJsonType, InputAdapterType> |
| using | number_float_t = typename BasicJsonType::number_float_t |
| using | number_integer_t = typename BasicJsonType::number_integer_t |
| using | number_unsigned_t = typename BasicJsonType::number_unsigned_t |
| using | string_t = typename BasicJsonType::string_t |
| using | token_type = typename lexer_t::token_type |
Private Member Functions | |
| std::string | exception_message (const token_type expected, const std::string &context) |
| *get next token from lexer token_type | get_token () |
| template<typename SAX> | |
| bool | sax_parse_internal (SAX *sax) |
Private Attributes | |
| *whether to throw exceptions in case of errors const bool | allow_exceptions = true |
| *callback function const parser_callback_t< BasicJsonType > | callback = nullptr |
| *the type of the last read token token_type | last_token = token_type::uninitialized |
| *the lexer lexer_t | m_lexer |
syntax analysis
This class implements a recursive descent parser.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
inlineexplicit |
Definition at line 10770 of file json.hpp.
References allow_exceptions, callback, get_token(), and m_lexer.
|
inline |
public accept interface
| [in] | strict | whether to expect the last token to be EOF |
Definition at line 10852 of file json.hpp.
References sax_parse(), and nlohmann::detail::strict.
|
inlineprivate |
Definition at line 11165 of file json.hpp.
References last_token, m_lexer, and nlohmann::detail::lexer_base< BasicJsonType >::token_type_name().
Referenced by parse(), sax_parse(), and sax_parse_internal().
|
inlineprivate |
Definition at line 11160 of file json.hpp.
References last_token, and m_lexer.
Referenced by parse(), parser(), sax_parse(), and sax_parse_internal().
|
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 10792 of file json.hpp.
References allow_exceptions, nlohmann::BasicJsonType(), callback, nlohmann::detail::parse_error::create(), nlohmann::detail::discarded, exception_message(), get_token(), nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >::is_errored(), nlohmann::detail::json_sax_dom_parser< BasicJsonType >::is_errored(), m_lexer, nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >::parse_error(), nlohmann::detail::json_sax_dom_parser< BasicJsonType >::parse_error(), nlohmann::result, sax_parse_internal(), and nlohmann::detail::strict.
|
inline |
Definition at line 10860 of file json.hpp.
References nlohmann::BasicJsonType(), nlohmann::detail::parse_error::create(), exception_message(), get_token(), m_lexer, nlohmann::result, sax_parse(), sax_parse_internal(), and nlohmann::detail::strict.
Referenced by accept(), and sax_parse().
|
inlineprivate |
Definition at line 10879 of file json.hpp.
References nlohmann::BasicJsonType(), nlohmann::detail::out_of_range::create(), nlohmann::detail::parse_error::create(), exception_message(), get_token(), JSON_ASSERT, JSON_HEDLEY_LIKELY, JSON_HEDLEY_UNLIKELY, last_token, m_lexer, nlohmann::res, and sax_parse_internal().
Referenced by parse(), sax_parse(), and sax_parse_internal().
|
private |
|
private |
|
private |
Definition at line 11198 of file json.hpp.
Referenced by exception_message(), get_token(), and sax_parse_internal().
|
private |
Definition at line 11200 of file json.hpp.
Referenced by exception_message(), get_token(), parse(), parser(), sax_parse(), and sax_parse_internal().