EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nlohmann::detail::parser< BasicJsonType > Class Template Reference

syntax analysis More...

#include <acts/blob/sPHENIX/thirdparty/nlohmann_json/single_include/nlohmann/json.hpp>

Public Types

enum  parse_event_t : uint8_t
 
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
 
void parse (const bool strict, BasicJsonType &result)
 public parser interface
 
bool accept (const bool strict=true)
 public accept interface
 
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
 
std::string exception_message (const token_type expected, const std::string &context)
 

Private Attributes

const parser_callback_t callback = nullptr
 callback function
 
token_type last_token = token_type::uninitialized
 the type of the last read token
 
lexer_t m_lexer
 the lexer
 
const bool allow_exceptions = true
 whether to throw exceptions in case of errors
 

Detailed Description

template<typename BasicJsonType>
class nlohmann::detail::parser< BasicJsonType >

syntax analysis

This class implements a recursive descent parser.

Definition at line 9013 of file json.hpp.

View newest version in sPHENIX GitHub at line 9013 of file json.hpp

Member Typedef Documentation

template<typename BasicJsonType >
using nlohmann::detail::parser< BasicJsonType >::lexer_t = lexer<BasicJsonType>
private

Definition at line 9019 of file json.hpp.

View newest version in sPHENIX GitHub at line 9019 of file json.hpp

template<typename BasicJsonType >
using nlohmann::detail::parser< BasicJsonType >::number_float_t = typename BasicJsonType::number_float_t
private

Definition at line 9017 of file json.hpp.

View newest version in sPHENIX GitHub at line 9017 of file json.hpp

template<typename BasicJsonType >
using nlohmann::detail::parser< BasicJsonType >::number_integer_t = typename BasicJsonType::number_integer_t
private

Definition at line 9015 of file json.hpp.

View newest version in sPHENIX GitHub at line 9015 of file json.hpp

template<typename BasicJsonType >
using nlohmann::detail::parser< BasicJsonType >::number_unsigned_t = typename BasicJsonType::number_unsigned_t
private

Definition at line 9016 of file json.hpp.

View newest version in sPHENIX GitHub at line 9016 of file json.hpp

template<typename BasicJsonType >
using nlohmann::detail::parser< BasicJsonType >::parser_callback_t = std::function<bool(int depth, parse_event_t event, BasicJsonType& parsed)>

Definition at line 9040 of file json.hpp.

View newest version in sPHENIX GitHub at line 9040 of file json.hpp

template<typename BasicJsonType >
using nlohmann::detail::parser< BasicJsonType >::string_t = typename BasicJsonType::string_t
private

Definition at line 9018 of file json.hpp.

View newest version in sPHENIX GitHub at line 9018 of file json.hpp

template<typename BasicJsonType >
using nlohmann::detail::parser< BasicJsonType >::token_type = typename lexer_t::token_type
private

Definition at line 9020 of file json.hpp.

View newest version in sPHENIX GitHub at line 9020 of file json.hpp

Member Enumeration Documentation

template<typename BasicJsonType >
enum nlohmann::detail::parser::parse_event_t : uint8_t

Definition at line 9023 of file json.hpp.

View newest version in sPHENIX GitHub at line 9023 of file json.hpp

Constructor & Destructor Documentation

template<typename BasicJsonType >
nlohmann::detail::parser< BasicJsonType >::parser ( detail::input_adapter_t &&  adapter,
const parser_callback_t  cb = nullptr,
const bool  allow_exceptions_ = true 
)
inlineexplicit

a parser reading from an input adapter

Definition at line 9043 of file json.hpp.

View newest version in sPHENIX GitHub at line 9043 of file json.hpp

Member Function Documentation

template<typename BasicJsonType >
bool nlohmann::detail::parser< BasicJsonType >::accept ( const bool  strict = true)
inline

public accept interface

Parameters
[in]strictwhether to expect the last token to be EOF
Returns
whether the input is a proper JSON text

Definition at line 9123 of file json.hpp.

View newest version in sPHENIX GitHub at line 9123 of file json.hpp

template<typename BasicJsonType >
std::string nlohmann::detail::parser< BasicJsonType >::exception_message ( const token_type  expected,
const std::string &  context 
)
inlineprivate

Definition at line 9438 of file json.hpp.

View newest version in sPHENIX GitHub at line 9438 of file json.hpp

template<typename BasicJsonType >
token_type nlohmann::detail::parser< BasicJsonType >::get_token ( )
inlineprivate

get next token from lexer

Definition at line 9433 of file json.hpp.

View newest version in sPHENIX GitHub at line 9433 of file json.hpp

template<typename BasicJsonType >
void nlohmann::detail::parser< BasicJsonType >::parse ( const bool  strict,
BasicJsonType &  result 
)
inline

public parser interface

Parameters
[in]strictwhether to expect the last token to be EOF
[in,out]resultparsed JSON value
Exceptions
parse_error.101in case of an unexpected token
parse_error.102if to_unicode fails or surrogate error
parse_error.103if to_unicode fails

Definition at line 9062 of file json.hpp.

View newest version in sPHENIX GitHub at line 9062 of file json.hpp

References 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().

+ Here is the call graph for this function:

template<typename BasicJsonType >
template<typename SAX >
bool nlohmann::detail::parser< BasicJsonType >::sax_parse ( SAX *  sax,
const bool  strict = true 
)
inline

Definition at line 9131 of file json.hpp.

View newest version in sPHENIX GitHub at line 9131 of file json.hpp

References nlohmann::detail::void().

+ Here is the call graph for this function:

template<typename BasicJsonType >
template<typename SAX >
bool nlohmann::detail::parser< BasicJsonType >::sax_parse_internal ( SAX *  sax)
inlineprivate

Definition at line 9151 of file json.hpp.

View newest version in sPHENIX GitHub at line 9151 of file json.hpp

References JSON_HEDLEY_LIKELY, and JSON_HEDLEY_UNLIKELY.

Member Data Documentation

template<typename BasicJsonType >
const bool nlohmann::detail::parser< BasicJsonType >::allow_exceptions = true
private

whether to throw exceptions in case of errors

Definition at line 9475 of file json.hpp.

View newest version in sPHENIX GitHub at line 9475 of file json.hpp

template<typename BasicJsonType >
const parser_callback_t nlohmann::detail::parser< BasicJsonType >::callback = nullptr
private

callback function

Definition at line 9469 of file json.hpp.

View newest version in sPHENIX GitHub at line 9469 of file json.hpp

template<typename BasicJsonType >
token_type nlohmann::detail::parser< BasicJsonType >::last_token = token_type::uninitialized
private

the type of the last read token

Definition at line 9471 of file json.hpp.

View newest version in sPHENIX GitHub at line 9471 of file json.hpp

template<typename BasicJsonType >
lexer_t nlohmann::detail::parser< BasicJsonType >::m_lexer
private

the lexer

Definition at line 9473 of file json.hpp.

View newest version in sPHENIX GitHub at line 9473 of file json.hpp


The documentation for this class was generated from the following file: