Cthulhu
0.2.10
Cthulhu compiler collection
json_ast.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: LGPL-3.0-only
2
3
#pragma once
4
5
#include <ctu_json_api.h>
6
7
#include "
json/json.h
"
8
9
#include "
core/where.h
"
10
11
typedef
struct
scan_t
scan_t
;
12
typedef
struct
typevec_t
typevec_t
;
13
14
typedef
struct
json_member_t
15
{
16
text_view_t
key
;
17
json_t
value
;
18
}
json_member_t
;
19
20
CT_LOCAL
json_member_t
json_member
(
text_view_t
key,
json_t
value);
21
22
CT_LOCAL
json_t
json_ast_string
(
where_t
where,
text_view_t
string
);
23
CT_LOCAL
json_t
json_ast_integer
(
where_t
where, mpz_t integer);
24
CT_LOCAL
json_t
json_ast_float
(
where_t
where,
float
real);
25
CT_LOCAL
json_t
json_ast_boolean
(
where_t
where,
bool
boolean
);
26
CT_LOCAL
json_t
json_ast_array
(
where_t
where,
typevec_t
array);
27
CT_LOCAL
json_t
json_ast_object
(
scan_t
*scan,
where_t
where,
const
typevec_t
*members);
28
CT_LOCAL
json_t
json_ast_empty_object
(
where_t
where);
29
CT_LOCAL
json_t
json_ast_null
(
where_t
where);
CT_LOCAL
#define CT_LOCAL
Definition:
compiler.h:166
json.h
json_ast_float
CT_LOCAL json_t json_ast_float(where_t where, float real)
Definition:
ast.c:56
json_ast_array
CT_LOCAL json_t json_ast_array(where_t where, typevec_t array)
Definition:
ast.c:70
json_ast_empty_object
CT_LOCAL json_t json_ast_empty_object(where_t where)
Definition:
ast.c:105
json_ast_object
CT_LOCAL json_t json_ast_object(scan_t *scan, where_t where, const typevec_t *members)
Definition:
ast.c:77
json_member
CT_LOCAL json_member_t json_member(text_view_t key, json_t value)
Definition:
ast.c:32
json_ast_boolean
CT_LOCAL json_t json_ast_boolean(where_t where, bool boolean)
Definition:
ast.c:63
json_ast_integer
CT_LOCAL json_t json_ast_integer(where_t where, mpz_t integer)
Definition:
ast.c:49
json_ast_string
CT_LOCAL json_t json_ast_string(where_t where, text_view_t string)
Definition:
ast.c:42
json_ast_null
CT_LOCAL json_t json_ast_null(where_t where)
Definition:
ast.c:112
json_member_t
Definition:
json_ast.h:15
json_member_t::key
text_view_t key
Definition:
json_ast.h:16
json_member_t::value
json_t value
Definition:
json_ast.h:17
json_t
a json value
Definition:
json.h:43
scan_t
a source file scanner
Definition:
scan.h:24
text_view_t
a non-owning view of text
Definition:
text.h:24
typevec_t
A vector with a fixed type size.
Definition:
vector.h:24
where_t
a location inside a scanner locations are inclusive and 0-based
Definition:
where.h:23
where.h
support
json
src
json_ast.h
Generated by
1.9.1