syntax analysis More...
#include <json.h>
syntax analysis
This class implements a recursive descent parser.
Public Member Functions | |
parser (InputAdapterType &&adapter, const parser_callback_t< BasicJsonType > cb=nullptr, const bool allow_exceptions_=true, const bool skip_comments=false) | |
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 > | |
JSON_HEDLEY_NON_NULL (2) bool sax_parse(SAX *sax | |
Public Attributes | |
const bool | strict |
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... | |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
inlineexplicit |
|
inline |
public accept interface
[in] | strict | whether to expect the last token to be EOF |
Definition at line 10257 of file json.h.
References nlohmann::detail::parser< BasicJsonType, InputAdapterType >::strict.
nlohmann::detail::parser< BasicJsonType, InputAdapterType >::JSON_HEDLEY_NON_NULL | ( | 2 | ) |
|
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 10196 of file json.h.
References nlohmann::detail::parser< BasicJsonType, InputAdapterType >::allow_exceptions, nlohmann::detail::parse_error::create(), nlohmann::detail::discarded, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get_position(), nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get_token_string(), nlohmann::detail::json_sax_dom_parser< BasicJsonType >::is_errored(), nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >::is_errored(), nlohmann::detail::parser< BasicJsonType, InputAdapterType >::m_lexer, nlohmann::detail::json_sax_dom_parser< BasicJsonType >::parse_error(), nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >::parse_error(), and nlohmann::detail::parser< BasicJsonType, InputAdapterType >::strict.
const bool nlohmann::detail::parser< BasicJsonType, InputAdapterType >::allow_exceptions = true |
whether to throw exceptions in case of errors
Definition at line 10609 of file json.h.
Referenced by nlohmann::detail::parser< BasicJsonType, InputAdapterType >::parse().
token_type nlohmann::detail::parser< BasicJsonType, InputAdapterType >::last_token = token_type::uninitialized |
lexer_t nlohmann::detail::parser< BasicJsonType, InputAdapterType >::m_lexer |
the lexer
Definition at line 10607 of file json.h.
Referenced by nlohmann::detail::parser< BasicJsonType, InputAdapterType >::parse().
const bool nlohmann::detail::parser< BasicJsonType, InputAdapterType >::strict |
Definition at line 10265 of file json.h.
Referenced by nlohmann::detail::parser< BasicJsonType, InputAdapterType >::accept(), and nlohmann::detail::parser< BasicJsonType, InputAdapterType >::parse().