JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
ast.hpp File Reference

Utilities for directly dealing with a JSON AST. More...

#include <jsonv/config.hpp>
#include <jsonv/kind.hpp>
#include <jsonv/optional.hpp>
#include <jsonv/string_view.hpp>
#include <cstdint>
#include <iosfwd>
#include <utility>
#include <variant>
+ Include dependency graph for ast.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  jsonv::ast_node
 Represents an entry in a JSON AST. More...
 
class  jsonv::ast_node::base< TSelf, KIndexToken >
 
class  jsonv::ast_node::basic_fixed_size_token< TSelf, KIndexToken, KTokenSize >
 
class  jsonv::ast_node::basic_dynamic_size_token< TSelf, KIndexToken >
 
class  jsonv::ast_node::document_start
 The start of a document. More...
 
class  jsonv::ast_node::document_end
 The end of a document. More...
 
class  jsonv::ast_node::object_begin
 The beginning of an kind::object ({). More...
 
class  jsonv::ast_node::object_end
 The end of an kind::object (}). More...
 
class  jsonv::ast_node::array_begin
 The beginning of an kind::array ([). More...
 
class  jsonv::ast_node::array_end
 The end of an kind::array (]). More...
 
class  jsonv::ast_node::basic_string_token< TSelf, KIndexToken, KEscaped >
 
class  jsonv::ast_node::string_canonical
 
class  jsonv::ast_node::string_escaped
 
class  jsonv::ast_node::key_canonical
 
class  jsonv::ast_node::key_escaped
 
class  jsonv::ast_node::literal_true
 
class  jsonv::ast_node::literal_false
 
class  jsonv::ast_node::literal_null
 
class  jsonv::ast_node::integer
 
class  jsonv::ast_node::decimal
 
class  jsonv::ast_node::error
 

Enumerations

enum class  jsonv::ast_error : std::uint64_t {
  none = 0 , expected_document , expected_string , expected_key_delimiter ,
  unexpected_token , unexpected_comma , unexpected_eof , expected_eof ,
  depth_exceeded , extra_close , mismatched_close , close_after_comma ,
  invalid_literal , invalid_number , invalid_string , invalid_comment ,
  internal
}
 Error code encountered while building the AST. More...
 

Functions

JSONV_PUBLIC std::ostream & jsonv::operator<< (std::ostream &, const ast_error &code)
 
JSONV_PUBLIC std::string jsonv::to_string (const ast_error &code)
 
enum class  jsonv::ast_node_type : std::uint8_t {
  document_end = 0 , document_start = 1 , object_begin = 2 , object_end = 3 ,
  array_begin = 4 , array_end = 5 , string_canonical = 6 , string_escaped = 7 ,
  key_canonical = 8 , key_escaped = 9 , literal_true = 10 , literal_false = 11 ,
  literal_null = 12 , integer = 13 , decimal = 14 , error = 15
}
 Marker type for an encountered token type. More...
 
JSONV_PUBLIC std::ostream & jsonv::operator<< (std::ostream &, const ast_node_type &type)
 
JSONV_PUBLIC std::string jsonv::to_string (const ast_node_type &type)
 

Detailed Description

Utilities for directly dealing with a JSON AST.

For most cases, it is more convenient to use jsonv::value.

Copyright (c) 2020 by Travis Gockel. All rights reserved.

This program is free software: you can redistribute it and/or modify it under the terms of the Apache License as published by the Apache Software Foundation, either version 2 of the License, or (at your option) any later version.

Author
Travis Gockel (travi.nosp@m.s@go.nosp@m.ckelh.nosp@m.ut.c.nosp@m.om)

Definition in file ast.hpp.

Enumeration Type Documentation

◆ ast_error

enum class jsonv::ast_error : std::uint64_t
strong

Error code encountered while building the AST.

Definition at line 129 of file ast.hpp.

Function Documentation

◆ operator<<()

JSONV_PUBLIC std::ostream & jsonv::operator<< ( std::ostream &  ,
const ast_error code 
)

Get a description of the error code.