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 {
19 
21 
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);
27 CT_LOCAL json_t json_ast_object(scan_t *scan, where_t where, const typevec_t *members);
#define CT_LOCAL
Definition: compiler.h:166
CT_LOCAL json_t json_ast_float(where_t where, float real)
Definition: ast.c:56
CT_LOCAL json_t json_ast_array(where_t where, typevec_t array)
Definition: ast.c:70
CT_LOCAL json_t json_ast_empty_object(where_t where)
Definition: ast.c:105
CT_LOCAL json_t json_ast_object(scan_t *scan, where_t where, const typevec_t *members)
Definition: ast.c:77
CT_LOCAL json_member_t json_member(text_view_t key, json_t value)
Definition: ast.c:32
CT_LOCAL json_t json_ast_boolean(where_t where, bool boolean)
Definition: ast.c:63
CT_LOCAL json_t json_ast_integer(where_t where, mpz_t integer)
Definition: ast.c:49
CT_LOCAL json_t json_ast_string(where_t where, text_view_t string)
Definition: ast.c:42
CT_LOCAL json_t json_ast_null(where_t where)
Definition: ast.c:112
text_view_t key
Definition: json_ast.h:16
json_t value
Definition: json_ast.h:17
a json value
Definition: json.h:43
a source file scanner
Definition: scan.h:24
a non-owning view of text
Definition: text.h:24
A vector with a fixed type size.
Definition: vector.h:24
a location inside a scanner locations are inclusive and 0-based
Definition: where.h:23