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

lexical analysis More...

#include <json.hpp>

Inheritance diagram for nlohmann::detail::lexer< BasicJsonType, InputAdapterType >:
[legend]
Collaboration diagram for nlohmann::detail::lexer< BasicJsonType, InputAdapterType >:
[legend]

Public Types

using token_type = typename lexer_base< BasicJsonType >::token_type
 

Public Member Functions

JSON_HEDLEY_RETURNS_NON_NULL constexpr const char * get_error_message () const noexcept
 return syntax error message
 
constexpr number_float_t get_number_float () const noexcept
 return floating-point value
 
constexpr number_integer_t get_number_integer () const noexcept
 return integer value
 
constexpr number_unsigned_t get_number_unsigned () const noexcept
 return unsigned integer value
 
constexpr position_t get_position () const noexcept
 return position of last read token
 
string_tget_string ()
 return current string value (implicitly resets the token; useful only once)
 
std::string get_token_string () const
 
 lexer (const lexer &)=delete
 
 lexer (InputAdapterType &&adapter, bool ignore_comments_=false) noexcept
 
 lexer (lexer &&)=default
 
lexeroperator= (lexer &&)=default
 
lexeroperator= (lexer &)=delete
 
token_type scan ()
 
bool skip_bom ()
 skip the UTF-8 byte order mark
 
void skip_whitespace ()
 
 ~lexer ()=default
 

Static Public Member Functions

JSON_HEDLEY_RETURNS_NON_NULL static JSON_HEDLEY_CONST const char * token_type_name (const token_type t) noexcept
 return name of values of type token_type (only used for errors)
 

Private Types

using char_int_type = typename std::char_traits< char_type >::int_type
 
using char_type = typename InputAdapterType::char_type
 
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
 

Private Member Functions

void add (char_int_type c)
 add a character to token_buffer
 
char_int_type get ()
 
int get_codepoint ()
 get codepoint from 4 hex characters following \u
 
bool next_byte_in_range (std::initializer_list< char_int_type > ranges)
 check if the next byte(s) are inside a given range
 
void reset () noexcept
 reset token_buffer; current character is beginning of token
 
bool scan_comment ()
 scan a comment
 
token_type scan_literal (const char_type *literal_text, const std::size_t length, token_type return_type)
 
token_type scan_number ()
 scan a number literal
 
token_type scan_string ()
 scan a string literal
 
void unget ()
 unget current character (read it again on next get)
 

Static Private Member Functions

static JSON_HEDLEY_PURE char get_decimal_point () noexcept
 return the locale-dependent decimal point
 
static void strtof (double &f, const char *str, char **endptr) noexcept
 
static void strtof (float &f, const char *str, char **endptr) noexcept
 
static void strtof (long double &f, const char *str, char **endptr) noexcept
 

Private Attributes

char_int_type current = std::char_traits<char_type>::eof()
 the current character
 
const char_int_type decimal_point_char = '.'
 the decimal point
 
const char * error_message = ""
 a description of occurred lexer errors
 
InputAdapterType ia
 input adapter
 
const bool ignore_comments = false
 whether comments should be ignored (true) or signaled as errors (false)
 
bool next_unget = false
 whether the next get() call should just return current
 
position_t position {}
 the start position of the current token
 
string_t token_buffer {}
 buffer for variable-length tokens (numbers, strings)
 
std::vector< char_typetoken_string {}
 raw input token string (for error messages)
 
number_float_t value_float = 0
 
number_integer_t value_integer = 0
 
number_unsigned_t value_unsigned = 0
 

Detailed Description

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

lexical analysis

This class organizes the lexical analysis during JSON deserialization.

Definition at line 6513 of file json.hpp.

Member Typedef Documentation

◆ char_int_type

template<typename BasicJsonType , typename InputAdapterType >
using nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::char_int_type = typename std::char_traits<char_type>::int_type
private

Definition at line 6520 of file json.hpp.

◆ char_type

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

Definition at line 6519 of file json.hpp.

◆ number_float_t

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

Definition at line 6517 of file json.hpp.

◆ number_integer_t

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

Definition at line 6515 of file json.hpp.

◆ number_unsigned_t

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

Definition at line 6516 of file json.hpp.

◆ string_t

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

Definition at line 6518 of file json.hpp.

◆ token_type

template<typename BasicJsonType , typename InputAdapterType >
using nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::token_type = typename lexer_base<BasicJsonType>::token_type

Definition at line 6523 of file json.hpp.

Constructor & Destructor Documentation

◆ lexer() [1/3]

template<typename BasicJsonType , typename InputAdapterType >
nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::lexer ( InputAdapterType &&  adapter,
bool  ignore_comments_ = false 
)
inlineexplicitnoexcept

Definition at line 6525 of file json.hpp.

◆ lexer() [2/3]

template<typename BasicJsonType , typename InputAdapterType >
nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::lexer ( const lexer< BasicJsonType, InputAdapterType > &  )
delete

◆ lexer() [3/3]

template<typename BasicJsonType , typename InputAdapterType >
nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::lexer ( lexer< BasicJsonType, InputAdapterType > &&  )
default

◆ ~lexer()

template<typename BasicJsonType , typename InputAdapterType >
nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::~lexer ( )
default

Member Function Documentation

◆ add()

template<typename BasicJsonType , typename InputAdapterType >
void nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::add ( char_int_type  c)
inlineprivate

add a character to token_buffer

Definition at line 7803 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::token_buffer.

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::next_byte_in_range(), nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_number(), and nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_string().

Here is the caller graph for this function:

◆ get()

template<typename BasicJsonType , typename InputAdapterType >
char_int_type nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get ( )
inlineprivate

◆ get_codepoint()

template<typename BasicJsonType , typename InputAdapterType >
int nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get_codepoint ( )
inlineprivate

get codepoint from 4 hex characters following \u

For input "\u c1 c2 c3 c4" the codepoint is: (c1 * 0x1000) + (c2 * 0x0100) + (c3 * 0x0010) + c4 = (c1 << 12) + (c2 << 8) + (c3 << 4) + (c4 << 0)

Furthermore, the possible characters '0'..'9', 'A'..'F', and 'a'..'f' must be converted to the integers 0x0..0x9, 0xA..0xF, 0xA..0xF, resp. The conversion is done by subtracting the offset (0x30, 0x37, and 0x57) between the ASCII value of the character and the desired integer value.

Returns
codepoint (0x0000..0xFFFF) or -1 in case of an error (e.g. EOF or non-hex character)

Definition at line 6571 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::current, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get(), and JSON_ASSERT.

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_string().

Here is the caller graph for this function:

◆ get_decimal_point()

template<typename BasicJsonType , typename InputAdapterType >
static JSON_HEDLEY_PURE char nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get_decimal_point ( )
inlinestaticprivatenoexcept

return the locale-dependent decimal point

Definition at line 6545 of file json.hpp.

References JSON_ASSERT.

◆ get_error_message()

template<typename BasicJsonType , typename InputAdapterType >
JSON_HEDLEY_RETURNS_NON_NULL constexpr const char * nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get_error_message ( ) const
inlineconstexprnoexcept

return syntax error message

Definition at line 7875 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::error_message.

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

Here is the caller graph for this function:

◆ get_number_float()

template<typename BasicJsonType , typename InputAdapterType >
constexpr number_float_t nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get_number_float ( ) const
inlineconstexprnoexcept

return floating-point value

Definition at line 7826 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::value_float.

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

Here is the caller graph for this function:

◆ get_number_integer()

template<typename BasicJsonType , typename InputAdapterType >
constexpr number_integer_t nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get_number_integer ( ) const
inlineconstexprnoexcept

return integer value

Definition at line 7814 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::value_integer.

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

Here is the caller graph for this function:

◆ get_number_unsigned()

template<typename BasicJsonType , typename InputAdapterType >
constexpr number_unsigned_t nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get_number_unsigned ( ) const
inlineconstexprnoexcept

return unsigned integer value

Definition at line 7820 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::value_unsigned.

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

Here is the caller graph for this function:

◆ get_position()

template<typename BasicJsonType , typename InputAdapterType >
constexpr position_t nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get_position ( ) const
inlineconstexprnoexcept

return position of last read token

Definition at line 7842 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::position.

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

Here is the caller graph for this function:

◆ get_string()

template<typename BasicJsonType , typename InputAdapterType >
string_t & nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get_string ( )
inline

return current string value (implicitly resets the token; useful only once)

Definition at line 7832 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::token_buffer.

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

Here is the caller graph for this function:

◆ get_token_string()

template<typename BasicJsonType , typename InputAdapterType >
std::string nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get_token_string ( ) const
inline

return the last read token (for errors only). Will never contain EOF (an arbitrary value that is not a valid char value, often -1), because 255 may legitimately occur. May contain NUL, which should be escaped.

Definition at line 7850 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::token_string.

Referenced by nlohmann::detail::parser< BasicJsonType, InputAdapterType >::exception_message(), nlohmann::detail::parser< BasicJsonType, InputAdapterType >::parse(), nlohmann::detail::parser< BasicJsonType, InputAdapterType >::sax_parse(), and nlohmann::detail::parser< BasicJsonType, InputAdapterType >::sax_parse_internal().

Here is the caller graph for this function:

◆ next_byte_in_range()

template<typename BasicJsonType , typename InputAdapterType >
bool nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::next_byte_in_range ( std::initializer_list< char_int_type ranges)
inlineprivate

check if the next byte(s) are inside a given range

Adds the current byte and, for each passed range, reads a new byte and checks if it is inside the range. If a violation was detected, set up an error message and return false. Otherwise, return true.

Parameters
[in]rangeslist of integers; interpreted as list of pairs of inclusive lower and upper bound, respectively
Precondition
The passed list ranges must have 2, 4, or 6 elements; that is, 1, 2, or 3 pairs. This precondition is enforced by an assertion.
Returns
true if and only if no range violation was detected

Definition at line 6619 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::add(), nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::current, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::error_message, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get(), JSON_ASSERT, and JSON_HEDLEY_LIKELY.

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_string().

Here is the caller graph for this function:

◆ operator=() [1/2]

template<typename BasicJsonType , typename InputAdapterType >
lexer & nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::operator= ( lexer< BasicJsonType, InputAdapterType > &&  )
default

◆ operator=() [2/2]

template<typename BasicJsonType , typename InputAdapterType >
lexer & nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::operator= ( lexer< BasicJsonType, InputAdapterType > &  )
delete

◆ reset()

template<typename BasicJsonType , typename InputAdapterType >
void nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::reset ( )
inlineprivatenoexcept

reset token_buffer; current character is beginning of token

Definition at line 7722 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::current, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::token_buffer, and nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::token_string.

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_number(), and nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_string().

Here is the caller graph for this function:

◆ scan()

◆ scan_comment()

template<typename BasicJsonType , typename InputAdapterType >
bool nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_comment ( )
inlineprivate

scan a comment

Returns
whether comment could be scanned successfully

Definition at line 7246 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::error_message, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get(), and nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::unget().

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan().

Here is the caller graph for this function:

◆ scan_literal()

template<typename BasicJsonType , typename InputAdapterType >
token_type nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_literal ( const char_type literal_text,
const std::size_t  length,
token_type  return_type 
)
inlineprivate
Parameters
[in]literal_textthe literal text to expect
[in]lengththe length of the passed literal text
[in]return_typethe token type to return on success

Definition at line 7702 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::current, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::error_message, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get(), JSON_ASSERT, and JSON_HEDLEY_UNLIKELY.

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan().

Here is the caller graph for this function:

◆ scan_number()

template<typename BasicJsonType , typename InputAdapterType >
token_type nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_number ( )
inlineprivate

scan a number literal

This function scans a string according to Sect. 6 of RFC 8259.

The function is realized with a deterministic finite state machine derived from the grammar described in RFC 8259. Starting in state "init", the input is read and used to determined the next state. Only state "done" accepts the number. State "error" is a trap state to model errors. In the table below, "anything" means any character but the ones listed before.

state 0 1-9 e E + - . anything
init zero any1 [error] [error] minus [error] [error]
minus zero any1 [error] [error] [error] [error] [error]
zero done done exponent done done decimal1 done
any1 any1 any1 exponent done done decimal1 done
decimal1 decimal2 decimal2 [error] [error] [error] [error] [error]
decimal2 decimal2 decimal2 exponent done done done done
exponent any2 any2 [error] sign sign [error] [error]
sign any2 any2 [error] [error] [error] [error] [error]
any2 any2 any2 done done done done done

The state machine is realized with one label per state (prefixed with "scan_number_") and goto statements between them. The state machine contains cycles, but any cycle can be left when EOF is read. Therefore, the function is guaranteed to terminate.

During scanning, the read bytes are stored in token_buffer. This string is then converted to a signed integer, an unsigned integer, or a floating-point number.

Returns
token_type::value_unsigned, token_type::value_integer, or token_type::value_float if number could be successfully scanned, token_type::parse_error otherwise
Note
The scanner is independent of the current locale. Internally, the locale's decimal point is used instead of . to work with the locale-dependent converters.

Definition at line 7371 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::add(), nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::current, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::decimal_point_char, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::error_message, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get(), JSON_ASSERT, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::reset(), nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::strtof(), nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::token_buffer, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::unget(), nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::value_float, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::value_integer, and nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::value_unsigned.

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan().

Here is the caller graph for this function:

◆ scan_string()

template<typename BasicJsonType , typename InputAdapterType >
token_type nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_string ( )
inlineprivate

scan a string literal

This function scans a string according to Sect. 7 of RFC 8259. While scanning, bytes are escaped and copied into buffer token_buffer. Then the function returns successfully, token_buffer is not null-terminated (as it may contain \0 bytes), and token_buffer.size() is the number of bytes in the string.

Returns
token_type::value_string if string could be successfully scanned, token_type::parse_error otherwise
Note
In case of errors, variable error_message contains a textual description.

Definition at line 6656 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::add(), nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::current, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::error_message, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get(), nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get_codepoint(), JSON_ASSERT, JSON_HEDLEY_LIKELY, JSON_HEDLEY_UNLIKELY, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::next_byte_in_range(), and nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::reset().

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan().

Here is the caller graph for this function:

◆ skip_bom()

template<typename BasicJsonType , typename InputAdapterType >
bool nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::skip_bom ( )
inline

skip the UTF-8 byte order mark

Returns
true iff there is no BOM or the correct BOM has been skipped

Definition at line 7888 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get(), and nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::unget().

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan().

Here is the caller graph for this function:

◆ skip_whitespace()

template<typename BasicJsonType , typename InputAdapterType >
void nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::skip_whitespace ( )
inline

Definition at line 7902 of file json.hpp.

References nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::current, and nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get().

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan().

Here is the caller graph for this function:

◆ strtof() [1/3]

template<typename BasicJsonType , typename InputAdapterType >
static void nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::strtof ( double &  f,
const char *  str,
char **  endptr 
)
inlinestaticprivatenoexcept

Definition at line 7320 of file json.hpp.

◆ strtof() [2/3]

template<typename BasicJsonType , typename InputAdapterType >
static void nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::strtof ( float &  f,
const char *  str,
char **  endptr 
)
inlinestaticprivatenoexcept

Definition at line 7314 of file json.hpp.

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_number().

Here is the caller graph for this function:

◆ strtof() [3/3]

template<typename BasicJsonType , typename InputAdapterType >
static void nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::strtof ( long double &  f,
const char *  str,
char **  endptr 
)
inlinestaticprivatenoexcept

Definition at line 7326 of file json.hpp.

◆ token_type_name()

template<typename BasicJsonType >
JSON_HEDLEY_RETURNS_NON_NULL static JSON_HEDLEY_CONST const char * nlohmann::detail::lexer_base< BasicJsonType >::token_type_name ( const token_type  t)
inlinestaticnoexceptinherited

◆ unget()

template<typename BasicJsonType , typename InputAdapterType >
void nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::unget ( )
inlineprivate

unget current character (read it again on next get)

We implement unget by setting variable next_unget to true. The input is not changed - we just simulate ungetting by modifying chars_read_total, chars_read_current_line, and token_string. The next call to get() will behave as if the unget character is read again.

Definition at line 7776 of file json.hpp.

References nlohmann::detail::position_t::chars_read_current_line, nlohmann::detail::position_t::chars_read_total, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::current, JSON_ASSERT, JSON_HEDLEY_LIKELY, nlohmann::detail::position_t::lines_read, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::next_unget, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::position, and nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::token_string.

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_comment(), nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_number(), and nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::skip_bom().

Here is the caller graph for this function:

Field Documentation

◆ current

◆ decimal_point_char

template<typename BasicJsonType , typename InputAdapterType >
const char_int_type nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::decimal_point_char = '.'
private

the decimal point

Definition at line 8030 of file json.hpp.

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan_number().

◆ error_message

◆ ia

template<typename BasicJsonType , typename InputAdapterType >
InputAdapterType nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::ia
private

input adapter

Definition at line 8001 of file json.hpp.

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get().

◆ ignore_comments

template<typename BasicJsonType , typename InputAdapterType >
const bool nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::ignore_comments = false
private

whether comments should be ignored (true) or signaled as errors (false)

Definition at line 8004 of file json.hpp.

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::scan().

◆ next_unget

template<typename BasicJsonType , typename InputAdapterType >
bool nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::next_unget = false
private

whether the next get() call should just return current

Definition at line 8010 of file json.hpp.

Referenced by nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::get(), and nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::unget().

◆ position

template<typename BasicJsonType , typename InputAdapterType >
position_t nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::position {}
private

◆ token_buffer

template<typename BasicJsonType , typename InputAdapterType >
string_t nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::token_buffer {}
private

◆ token_string

template<typename BasicJsonType , typename InputAdapterType >
std::vector<char_type> nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::token_string {}
private

◆ value_float

template<typename BasicJsonType , typename InputAdapterType >
number_float_t nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::value_float = 0
private

◆ value_integer

template<typename BasicJsonType , typename InputAdapterType >
number_integer_t nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::value_integer = 0
private

◆ value_unsigned

template<typename BasicJsonType , typename InputAdapterType >
number_unsigned_t nlohmann::detail::lexer< BasicJsonType, InputAdapterType >::value_unsigned = 0
private

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