GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::json::Parser< It, Allocator > Class Template Reference

Syntactic analyzer for parsing input in the JSON5 format obtained from a json::Lexer. More...

#include <GREM/core/formats/json.hpp>

Classes

class  ValueVisitor
 Polymorphic interface for visitation-based parsing of JSON values. More...
struct  ConcreteValueVisitor
 Implementation of ValueVisitor for freestanding classes that implement all or parts of its interface without directly inheriting from it. More...
class  PropertyVisitor
 Polymorphic interface for visitation-based parsing of JSON object properties. More...
struct  ConcretePropertyVisitor
 Implementation of PropertyVisitor for freestanding classes that implement all or parts of its interface without directly inheriting from it. More...
struct  SkipValueVisitor
 Implementation of ValueVisitor that skips over the parsed value and discards the result. More...
struct  SkipPropertyVisitor
 Implementation of PropertyVisitor that skips over the parsed property and discards the result. More...

Public Types

using allocator_type = Allocator<ValueBase<Allocator>>
 Allocator type used by the parser.
using Token = TokenBase<Allocator>
 Token type of the parser.

Public Member Functions

 Parser (Lexer< It, Allocator > lexer, const allocator_type &allocator=allocator_type())
 Construct a parser with an existing lexer as input.
 Parser (unicode::UTF8View codePoints, const SourceLocation &source={}, const allocator_type &allocator=allocator_type())
 Construct a parser with a contiguous UTF-8 view as input.
 Parser (UTF8StringView jsonString, const SourceLocation &source={}, const allocator_type &allocator=allocator_type())
 Construct a parser with a contiguous UTF-8 string as input.
 Parser (StringView jsonString, const SourceLocation &source={}, const allocator_type &allocator=allocator_type())
 Construct a parser with a contiguous string, interpreted as UTF-8, as input.
 Parser (std::istream &stream, const SourceLocation &source={}, const allocator_type &allocator=allocator_type())
 Construct a parser with an input stream as input.
 Parser (std::streambuf *streambuf, const SourceLocation &source={}, const allocator_type &allocator=allocator_type())
 Construct a parser with an input stream buffer as input.
 Parser (const Parser &other, const allocator_type &allocator)
 Copy constructor.
 Parser (Parser &&other, const allocator_type &allocator) noexcept
 Move constructor.
 ~Parser ()=default
 Destructor.
 Parser (const Parser &other)
 Copy constructor.
 Parser (Parser &&other) noexcept
 Move constructor.
Parser & operator= (const Parser &)=default
 Copy assignment.
Parser & operator= (Parser &&) noexcept=default
 Move assignment.
allocator_type get_allocator () const noexcept
 Get the allocator used by the parser.
void parseFile (ValueVisitor &visitor)
 Read a single JSON value from the input and visit it, then make sure the rest of the input only consists of whitespace.
void parseValue (ValueVisitor &visitor)
 Read a single JSON value from the input and visit it.
void parseObject (PropertyVisitor &visitor)
 Read a single JSON object from the input and visit each of its properties.
void parseArray (ValueVisitor &visitor)
 Read a single JSON array from the input and visit each of its values.
void parseFile (ValueVisitor &&visitor)
void parseValue (ValueVisitor &&visitor)
void parseObject (PropertyVisitor &&visitor)
void parseArray (ValueVisitor &&visitor)
template<typename Visitor>
void parseFile (Visitor visitor)
template<typename Visitor>
void parseValue (Visitor visitor)
template<typename Visitor>
void parseObject (Visitor visitor)
template<typename Visitor>
void parseArray (Visitor visitor)
void skipFile ()
 Parse a single JSON value from the input and discard the result, then make sure the rest of the input only consists of whitespace.
void skipValue ()
 Parse a single JSON value from the input and discard the result.
ValueBase< Allocator > parseFile ()
 Read a single JSON value from the input and make sure the rest of the input only consists of whitespace.
ValueBase< Allocator > parseValue ()
 Read a single JSON value from the input.
Null parseNull ()
 Read a single JSON value of type Null from the input.
bool peekIsNull () const
 Check if the next immediate input is a JSON value of type Null.
Boolean parseBoolean ()
 Read a single JSON value of type Boolean from the input.
bool peekIsBoolean () const
 Check if the next immediate input is a JSON value of type Boolean.
StringBase< Allocator > parseString ()
 Read a single JSON value of type String from the input.
bool peekIsString () const
 Check if the next immediate input is a JSON value of type String.
Number parseNumber ()
 Read a single JSON value of type Number from the input.
bool peekIsNumber () const
 Check if the next immediate input is a JSON value of type Number.
ObjectBase< Allocator > parseObject ()
 Read a single JSON value of type Object from the input.
bool peekIsObject () const
 Check if the next immediate input is a JSON value of type Object.
ArrayBase< Allocator > parseArray ()
 Read a single JSON value of type Array from the input.
bool peekIsArray () const
 Check if the next immediate input is a JSON value of type Array.
void advance ()
 Advance the internal state of the underlying lexer by one token.
const Token & peek () const
 Peek the next token without advancing the internal state of the underlying lexer.
Token eat ()
 Scan and consume the next token from the input.

Detailed Description

template<typename It, template< typename > typename Allocator = std::allocator>
class grem::json::Parser< It, Allocator >

Syntactic analyzer for parsing input in the JSON5 format obtained from a json::Lexer.

Template Parameters
Ititerator type of the underlying input source. Must be an input iterator.
Allocatorallocator type template to use.

Member Typedef Documentation

◆ allocator_type

template<typename It, template< typename > typename Allocator = std::allocator>
using grem::json::Parser< It, Allocator >::allocator_type = Allocator<ValueBase<Allocator>>

Allocator type used by the parser.

◆ Token

template<typename It, template< typename > typename Allocator = std::allocator>
using grem::json::Parser< It, Allocator >::Token = TokenBase<Allocator>

Token type of the parser.

Constructor & Destructor Documentation

◆ Parser() [1/10]

template<typename It, template< typename > typename Allocator = std::allocator>
grem::json::Parser< It, Allocator >::Parser ( Lexer< It, Allocator > lexer,
const allocator_type & allocator = allocator_type() )
inlineexplicit

Construct a parser with an existing lexer as input.

Parameters
lexerlexer to scan JSON tokens from.
allocatorallocator to use.

◆ Parser() [2/10]

template<typename It, template< typename > typename Allocator = std::allocator>
grem::json::Parser< It, Allocator >::Parser ( unicode::UTF8View codePoints,
const SourceLocation & source = {},
const allocator_type & allocator = allocator_type() )
inlineexplicit

Construct a parser with a contiguous UTF-8 view as input.

Parameters
codePointsnon-owning read-only view over the UTF-8 string to parse JSON tokens from.
sourcesource location corresponding to the start of the given JSON string.
allocatorallocator to use.

◆ Parser() [3/10]

template<typename It, template< typename > typename Allocator = std::allocator>
grem::json::Parser< It, Allocator >::Parser ( UTF8StringView jsonString,
const SourceLocation & source = {},
const allocator_type & allocator = allocator_type() )
inlineexplicit

Construct a parser with a contiguous UTF-8 string as input.

Parameters
jsonStringnon-owning read-only view over the UTF-8 string to parse JSON tokens from.
sourcesource location corresponding to the start of the given JSON string.
allocatorallocator to use.

◆ Parser() [4/10]

template<typename It, template< typename > typename Allocator = std::allocator>
grem::json::Parser< It, Allocator >::Parser ( StringView jsonString,
const SourceLocation & source = {},
const allocator_type & allocator = allocator_type() )
inlineexplicit

Construct a parser with a contiguous string, interpreted as UTF-8, as input.

Parameters
jsonStringnon-owning read-only view over the string to parse JSON tokens from.
sourcesource location corresponding to the start of the given JSON string.
allocatorallocator to use.

◆ Parser() [5/10]

template<typename It, template< typename > typename Allocator = std::allocator>
grem::json::Parser< It, Allocator >::Parser ( std::istream & stream,
const SourceLocation & source = {},
const allocator_type & allocator = allocator_type() )
inlineexplicit

Construct a parser with an input stream as input.

Parameters
streaminput stream to parse JSON tokens from.
sourcesource location corresponding to the start of the given stream.
allocatorallocator to use.

◆ Parser() [6/10]

template<typename It, template< typename > typename Allocator = std::allocator>
grem::json::Parser< It, Allocator >::Parser ( std::streambuf * streambuf,
const SourceLocation & source = {},
const allocator_type & allocator = allocator_type() )
inlineexplicit

Construct a parser with an input stream buffer as input.

Parameters
streambufinput stream buffer to parse JSON tokens from.
sourcesource location corresponding to the start of the given JSON string.
allocatorallocator to use.

◆ Parser() [7/10]

template<typename It, template< typename > typename Allocator = std::allocator>
grem::json::Parser< It, Allocator >::Parser ( const Parser< It, Allocator > & other,
const allocator_type & allocator )
inline

Copy constructor.

◆ Parser() [8/10]

template<typename It, template< typename > typename Allocator = std::allocator>
grem::json::Parser< It, Allocator >::Parser ( Parser< It, Allocator > && other,
const allocator_type & allocator )
inlinenoexcept

Move constructor.

◆ ~Parser()

template<typename It, template< typename > typename Allocator = std::allocator>
grem::json::Parser< It, Allocator >::~Parser ( )
default

Destructor.

◆ Parser() [9/10]

template<typename It, template< typename > typename Allocator = std::allocator>
grem::json::Parser< It, Allocator >::Parser ( const Parser< It, Allocator > & other)
inline

Copy constructor.

◆ Parser() [10/10]

template<typename It, template< typename > typename Allocator = std::allocator>
grem::json::Parser< It, Allocator >::Parser ( Parser< It, Allocator > && other)
inlinenoexcept

Move constructor.

Member Function Documentation

◆ operator=() [1/2]

template<typename It, template< typename > typename Allocator = std::allocator>
Parser & grem::json::Parser< It, Allocator >::operator= ( const Parser< It, Allocator > & )
default

Copy assignment.

◆ operator=() [2/2]

template<typename It, template< typename > typename Allocator = std::allocator>
Parser & grem::json::Parser< It, Allocator >::operator= ( Parser< It, Allocator > && )
defaultnoexcept

Move assignment.

◆ get_allocator()

template<typename It, template< typename > typename Allocator = std::allocator>
allocator_type grem::json::Parser< It, Allocator >::get_allocator ( ) const
inlinenodiscardnoexcept

Get the allocator used by the parser.

Returns
a copy of the parser's allocator.

◆ parseFile() [1/4]

template<typename It, template< typename > typename Allocator = std::allocator>
void grem::json::Parser< It, Allocator >::parseFile ( ValueVisitor & visitor)
inline

Read a single JSON value from the input and visit it, then make sure the rest of the input only consists of whitespace.

Parameters
visitorvisitor to give the parsed value to.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
anyexception thrown by the visitor.
See also
json::onNull()
json::onBoolean()
json::onString()
json::onNumber()
json::onObject()
json::onArray()
parseFile()
parseValue(ValueVisitor&)

◆ parseValue() [1/4]

template<typename It, template< typename > typename Allocator = std::allocator>
void grem::json::Parser< It, Allocator >::parseValue ( ValueVisitor & visitor)
inline

Read a single JSON value from the input and visit it.

Parameters
visitorvisitor to give the parsed value to.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
anyexception thrown by the visitor.
See also
json::onNull()
json::onBoolean()
json::onString()
json::onNumber()
json::onObject()
json::onArray()
parseValue()
parseFile(ValueVisitor&)

◆ parseObject() [1/4]

template<typename It, template< typename > typename Allocator = std::allocator>
void grem::json::Parser< It, Allocator >::parseObject ( PropertyVisitor & visitor)
inline

Read a single JSON object from the input and visit each of its properties.

Parameters
visitorvisitor to give each parsed property of the object to.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
anyexception thrown by the visitor.
See also
json::onProperty()
parseObject()

◆ parseArray() [1/4]

template<typename It, template< typename > typename Allocator = std::allocator>
void grem::json::Parser< It, Allocator >::parseArray ( ValueVisitor & visitor)
inline

Read a single JSON array from the input and visit each of its values.

Parameters
visitorvisitor to give each parsed value of the array to.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
anyexception thrown by the visitor.
See also
json::onNull()
json::onBoolean()
json::onString()
json::onNumber()
json::onObject()
json::onArray()
parseArray()

◆ parseFile() [2/4]

template<typename It, template< typename > typename Allocator = std::allocator>
void grem::json::Parser< It, Allocator >::parseFile ( ValueVisitor && visitor)
inline

◆ parseValue() [2/4]

template<typename It, template< typename > typename Allocator = std::allocator>
void grem::json::Parser< It, Allocator >::parseValue ( ValueVisitor && visitor)
inline

◆ parseObject() [2/4]

template<typename It, template< typename > typename Allocator = std::allocator>
void grem::json::Parser< It, Allocator >::parseObject ( PropertyVisitor && visitor)
inline

◆ parseArray() [2/4]

template<typename It, template< typename > typename Allocator = std::allocator>
void grem::json::Parser< It, Allocator >::parseArray ( ValueVisitor && visitor)
inline

◆ parseFile() [3/4]

template<typename It, template< typename > typename Allocator = std::allocator>
template<typename Visitor>
void grem::json::Parser< It, Allocator >::parseFile ( Visitor visitor)
inline

◆ parseValue() [3/4]

template<typename It, template< typename > typename Allocator = std::allocator>
template<typename Visitor>
void grem::json::Parser< It, Allocator >::parseValue ( Visitor visitor)
inline

◆ parseObject() [3/4]

template<typename It, template< typename > typename Allocator = std::allocator>
template<typename Visitor>
void grem::json::Parser< It, Allocator >::parseObject ( Visitor visitor)
inline

◆ parseArray() [3/4]

template<typename It, template< typename > typename Allocator = std::allocator>
template<typename Visitor>
void grem::json::Parser< It, Allocator >::parseArray ( Visitor visitor)
inline

◆ skipFile()

template<typename It, template< typename > typename Allocator = std::allocator>
void grem::json::Parser< It, Allocator >::skipFile ( )
inline

Parse a single JSON value from the input and discard the result, then make sure the rest of the input only consists of whitespace.

Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseFile()
skipValue()

◆ skipValue()

template<typename It, template< typename > typename Allocator = std::allocator>
void grem::json::Parser< It, Allocator >::skipValue ( )
inline

Parse a single JSON value from the input and discard the result.

Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseValue()
skipFile()

◆ parseFile() [4/4]

template<typename It, template< typename > typename Allocator = std::allocator>
ValueBase< Allocator > grem::json::Parser< It, Allocator >::parseFile ( )
inline

Read a single JSON value from the input and make sure the rest of the input only consists of whitespace.

Returns
the parsed value.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseFile(ValueVisitor&)
parseValue()
skipFile()

◆ parseValue() [4/4]

template<typename It, template< typename > typename Allocator = std::allocator>
ValueBase< Allocator > grem::json::Parser< It, Allocator >::parseValue ( )
inline

Read a single JSON value from the input.

Returns
the parsed value.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseValue(ValueVisitor&)
parseFile()
parseNull()
parseBoolean()
parseString()
parseNumber()
parseObject()
parseArray()
skipValue()

◆ parseNull()

template<typename It, template< typename > typename Allocator = std::allocator>
Null grem::json::Parser< It, Allocator >::parseNull ( )
inline

Read a single JSON value of type Null from the input.

Returns
the parsed value.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseValue()
peekIsNull()

◆ peekIsNull()

template<typename It, template< typename > typename Allocator = std::allocator>
bool grem::json::Parser< It, Allocator >::peekIsNull ( ) const
inlinenodiscard

Check if the next immediate input is a JSON value of type Null.

Returns
true if the parser is at a value of type Null, false otherwise.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseNull()

◆ parseBoolean()

template<typename It, template< typename > typename Allocator = std::allocator>
Boolean grem::json::Parser< It, Allocator >::parseBoolean ( )
inline

Read a single JSON value of type Boolean from the input.

Returns
the parsed value.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseValue()
peekIsBoolean()

◆ peekIsBoolean()

template<typename It, template< typename > typename Allocator = std::allocator>
bool grem::json::Parser< It, Allocator >::peekIsBoolean ( ) const
inlinenodiscard

Check if the next immediate input is a JSON value of type Boolean.

Returns
true if the parser is at a value of type Boolean, false otherwise.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseBoolean()

◆ parseString()

template<typename It, template< typename > typename Allocator = std::allocator>
StringBase< Allocator > grem::json::Parser< It, Allocator >::parseString ( )
inline

Read a single JSON value of type String from the input.

Returns
the parsed value.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseValue()
peekIsString()

◆ peekIsString()

template<typename It, template< typename > typename Allocator = std::allocator>
bool grem::json::Parser< It, Allocator >::peekIsString ( ) const
inlinenodiscard

Check if the next immediate input is a JSON value of type String.

Returns
true if the parser is at a value of type String, false otherwise.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseString()

◆ parseNumber()

template<typename It, template< typename > typename Allocator = std::allocator>
Number grem::json::Parser< It, Allocator >::parseNumber ( )
inline

Read a single JSON value of type Number from the input.

Returns
the parsed value.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseValue()
peekIsNumber()

◆ peekIsNumber()

template<typename It, template< typename > typename Allocator = std::allocator>
bool grem::json::Parser< It, Allocator >::peekIsNumber ( ) const
inlinenodiscard

Check if the next immediate input is a JSON value of type Number.

Returns
true if the parser is at a value of type Number, false otherwise.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseNumber()

◆ parseObject() [4/4]

template<typename It, template< typename > typename Allocator = std::allocator>
ObjectBase< Allocator > grem::json::Parser< It, Allocator >::parseObject ( )
inline

Read a single JSON value of type Object from the input.

Returns
the parsed value.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseObject(PropertyVisitor&)
parseValue()
peekIsObject()

◆ peekIsObject()

template<typename It, template< typename > typename Allocator = std::allocator>
bool grem::json::Parser< It, Allocator >::peekIsObject ( ) const
inlinenodiscard

Check if the next immediate input is a JSON value of type Object.

Returns
true if the parser is at a value of type Object, false otherwise.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseObject()

◆ parseArray() [4/4]

template<typename It, template< typename > typename Allocator = std::allocator>
ArrayBase< Allocator > grem::json::Parser< It, Allocator >::parseArray ( )
inline

Read a single JSON value of type Array from the input.

Returns
the parsed value.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseArray(ValueVisitor&)
parseValue()
peekIsArray()

◆ peekIsArray()

template<typename It, template< typename > typename Allocator = std::allocator>
bool grem::json::Parser< It, Allocator >::peekIsArray ( ) const
inlinenodiscard

Check if the next immediate input is a JSON value of type Array.

Returns
true if the parser is at a value of type Array, false otherwise.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
See also
parseArray()

◆ advance()

template<typename It, template< typename > typename Allocator = std::allocator>
void grem::json::Parser< It, Allocator >::advance ( )
inline

Advance the internal state of the underlying lexer by one token.

Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.

◆ peek()

template<typename It, template< typename > typename Allocator = std::allocator>
const Token & grem::json::Parser< It, Allocator >::peek ( ) const
inlinenodiscard

Peek the next token without advancing the internal state of the underlying lexer.

Returns
a read-only reference to the next token to be read that is valid until the next call to advance() or eat(), or until the parser is moved from or destroyed, whichever happens first.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.
Warning
Although it is semantically const, this function is not thread-safe since it mutates an internal lookahead buffer. Exclusive access is therefore required for safety.

◆ eat()

template<typename It, template< typename > typename Allocator = std::allocator>
Token grem::json::Parser< It, Allocator >::eat ( )
inlinenodiscard

Scan and consume the next token from the input.

This advances the internal state of the underlying lexer.

Returns
the scanned token.
Exceptions
json::Erroron invalid input.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
anyexception thrown by the underlying input iterator.

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