Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
nlohmann::detail::parser< BasicJsonType, InputAdapterType > Class Template Reference

syntax analysis More...

Public Member Functions

bool accept (const bool strict=true)
 public accept interface
 
void parse (const bool strict, BasicJsonType &result)
 public parser interface
 
 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
 
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)
 
token_type get_token ()
 get next token from lexer
 
template<typename SAX >
bool sax_parse_internal (SAX *sax)
 

Private Attributes

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

Detailed Description

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

syntax analysis

This class implements a recursive descent parser.

Definition at line 10759 of file json.hpp.

Member Typedef Documentation

◆ lexer_t

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

Definition at line 10765 of file json.hpp.

◆ number_float_t

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

Definition at line 10763 of file json.hpp.

◆ number_integer_t

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

Definition at line 10761 of file json.hpp.

◆ number_unsigned_t

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

Definition at line 10762 of file json.hpp.

◆ string_t

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

Definition at line 10764 of file json.hpp.

◆ token_type

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

Definition at line 10766 of file json.hpp.

Constructor & Destructor Documentation

◆ parser()

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

a parser reading from an input adapter

Definition at line 10770 of file json.hpp.

References nlohmann::detail::parser< BasicJsonType, InputAdapterType >::get_token().

Member Function Documentation

◆ accept()

template<typename BasicJsonType , typename InputAdapterType >
bool nlohmann::detail::parser< BasicJsonType, InputAdapterType >::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 10852 of file json.hpp.

References nlohmann::detail::parser< BasicJsonType, InputAdapterType >::sax_parse(), and nlohmann::detail::strict.

◆ exception_message()

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

◆ get_token()

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

◆ parse()

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

◆ sax_parse()

◆ sax_parse_internal()

Field Documentation

◆ allow_exceptions

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

whether to throw exceptions in case of errors

Definition at line 11202 of file json.hpp.

Referenced by nlohmann::detail::parser< BasicJsonType, InputAdapterType >::parse().

◆ callback

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

callback function

Definition at line 11196 of file json.hpp.

Referenced by nlohmann::detail::parser< BasicJsonType, InputAdapterType >::parse().

◆ last_token

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

◆ m_lexer


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