MUQ  0.4.3
nlohmann::detail::parser< BasicJsonType, InputAdapterType > Class Template Reference

syntax analysis More...

#include <json.h>

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 10163 of file json.h.

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...
 

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 10169 of file json.h.

◆ 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 10167 of file json.h.

◆ 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 10165 of file json.h.

◆ 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 10166 of file json.h.

◆ string_t

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

Definition at line 10168 of file json.h.

◆ token_type

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

Definition at line 10170 of file json.h.

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 10174 of file json.h.

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 10257 of file json.h.

References nlohmann::detail::parser< BasicJsonType, InputAdapterType >::strict.

◆ JSON_HEDLEY_NON_NULL()

template<typename BasicJsonType , typename InputAdapterType >
template<typename SAX >
nlohmann::detail::parser< BasicJsonType, InputAdapterType >::JSON_HEDLEY_NON_NULL ( )

◆ parse()

Member Data Documentation

◆ allow_exceptions

template<typename BasicJsonType , typename InputAdapterType >
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().

◆ last_token

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

the type of the last read token

Definition at line 10605 of file json.h.

◆ m_lexer

template<typename BasicJsonType , typename InputAdapterType >
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().

◆ strict

template<typename BasicJsonType , typename InputAdapterType >
const bool nlohmann::detail::parser< BasicJsonType, InputAdapterType >::strict

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