|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
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. | |
Syntactic analyzer for parsing input in the JSON5 format obtained from a json::Lexer.
| It | iterator type of the underlying input source. Must be an input iterator. |
| Allocator | allocator type template to use. |
| using grem::json::Parser< It, Allocator >::allocator_type = Allocator<ValueBase<Allocator>> |
Allocator type used by the parser.
| using grem::json::Parser< It, Allocator >::Token = TokenBase<Allocator> |
Token type of the parser.
|
inlineexplicit |
Construct a parser with an existing lexer as input.
| lexer | lexer to scan JSON tokens from. |
| allocator | allocator to use. |
|
inlineexplicit |
Construct a parser with a contiguous UTF-8 view as input.
| codePoints | non-owning read-only view over the UTF-8 string to parse JSON tokens from. |
| source | source location corresponding to the start of the given JSON string. |
| allocator | allocator to use. |
|
inlineexplicit |
Construct a parser with a contiguous UTF-8 string as input.
| jsonString | non-owning read-only view over the UTF-8 string to parse JSON tokens from. |
| source | source location corresponding to the start of the given JSON string. |
| allocator | allocator to use. |
|
inlineexplicit |
Construct a parser with a contiguous string, interpreted as UTF-8, as input.
| jsonString | non-owning read-only view over the string to parse JSON tokens from. |
| source | source location corresponding to the start of the given JSON string. |
| allocator | allocator to use. |
|
inlineexplicit |
Construct a parser with an input stream as input.
| stream | input stream to parse JSON tokens from. |
| source | source location corresponding to the start of the given stream. |
| allocator | allocator to use. |
|
inlineexplicit |
Construct a parser with an input stream buffer as input.
| streambuf | input stream buffer to parse JSON tokens from. |
| source | source location corresponding to the start of the given JSON string. |
| allocator | allocator to use. |
|
inline |
Copy constructor.
|
inlinenoexcept |
Move constructor.
|
default |
Destructor.
|
inline |
Copy constructor.
|
inlinenoexcept |
Move constructor.
|
default |
Copy assignment.
|
defaultnoexcept |
Move assignment.
|
inlinenodiscardnoexcept |
Get the allocator used by the parser.
|
inline |
Read a single JSON value from the input and visit it, then make sure the rest of the input only consists of whitespace.
| visitor | visitor to give the parsed value to. |
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
| any | exception thrown by the visitor. |
|
inline |
Read a single JSON value from the input and visit it.
| visitor | visitor to give the parsed value to. |
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
| any | exception thrown by the visitor. |
|
inline |
Read a single JSON object from the input and visit each of its properties.
| visitor | visitor to give each parsed property of the object to. |
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
| any | exception thrown by the visitor. |
|
inline |
Read a single JSON array from the input and visit each of its values.
| visitor | visitor to give each parsed value of the array to. |
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
| any | exception thrown by the visitor. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
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.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Parse a single JSON value from the input and discard the result.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value from the input and make sure the rest of the input only consists of whitespace.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value from the input.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value of type Null from the input.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inlinenodiscard |
Check if the next immediate input is a JSON value of type Null.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value of type Boolean from the input.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inlinenodiscard |
Check if the next immediate input is a JSON value of type Boolean.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value of type String from the input.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inlinenodiscard |
Check if the next immediate input is a JSON value of type String.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value of type Number from the input.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inlinenodiscard |
Check if the next immediate input is a JSON value of type Number.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value of type Object from the input.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inlinenodiscard |
Check if the next immediate input is a JSON value of type Object.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value of type Array from the input.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inlinenodiscard |
Check if the next immediate input is a JSON value of type Array.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Advance the internal state of the underlying lexer by one token.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inlinenodiscard |
Peek the next token without advancing the internal state of the underlying lexer.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inlinenodiscard |
Scan and consume the next token from the input.
This advances the internal state of the underlying lexer.
| json::Error | on invalid input. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |