slot 0.0.1
A real time UI render framework
载入中...
搜索中...
未找到
Public 成员函数 | Private 类型 | Private 成员函数 | Private 属性 | 所有成员列表
detail::parser< BasicJsonType, InputAdapterType > 模板类 参考

syntax analysis 更多...

#include <json.hpp>

Public 成员函数

 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
 
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 类型

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, InputAdapterType>
 
using token_type = typename lexer_t::token_type
 

Private 成员函数

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 属性

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
 
const bool allow_exceptions = true
 whether to throw exceptions in case of errors
 

详细描述

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

syntax analysis

This class implements a recursive descent parser.

成员类型定义说明

◆ lexer_t

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

◆ number_float_t

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

◆ number_integer_t

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

◆ number_unsigned_t

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

◆ string_t

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

◆ token_type

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

构造及析构函数说明

◆ parser()

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

成员函数说明

◆ accept()

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

public accept interface

参数
[in]strictwhether to expect the last token to be EOF
返回
whether the input is a proper JSON text

◆ exception_message()

template<typename BasicJsonType , typename InputAdapterType >
std::string detail::parser< BasicJsonType, InputAdapterType >::exception_message ( const token_type expected,
const std::string & context )
inlineprivate
函数调用图:

◆ get_token()

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

get next token from lexer

◆ parse()

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

public parser interface

参数
[in]strictwhether to expect the last token to be EOF
[in,out]resultparsed JSON value
异常
parse_error.101in case of an unexpected token
parse_error.102if to_unicode fails or surrogate error
parse_error.103if to_unicode fails
函数调用图:

◆ sax_parse()

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

◆ sax_parse_internal()

template<typename BasicJsonType , typename InputAdapterType >
template<typename SAX >
bool detail::parser< BasicJsonType, InputAdapterType >::sax_parse_internal ( SAX * sax)
inlineprivate
函数调用图:

类成员变量说明

◆ allow_exceptions

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

whether to throw exceptions in case of errors

◆ callback

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

callback function

◆ last_token

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

the type of the last read token

◆ m_lexer

template<typename BasicJsonType , typename InputAdapterType >
lexer_t detail::parser< BasicJsonType, InputAdapterType >::m_lexer
private

the lexer


该类的文档由以下文件生成: