Cthulhu  0.2.10
Cthulhu compiler collection
json_scan.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: LGPL-3.0-only
2 
3 #pragma once
4 
5 #include "scan/node.h" // IWYU pragma: export
6 #include "core/where.h"
7 
8 #include <gmp.h>
9 
10 #ifndef JSONLTYPE
11 # define JSONLTYPE json_where_t
12 #endif
13 
14 typedef struct logger_t logger_t;
15 typedef struct set_t set_t;
16 
17 typedef struct json_where_t
18 {
19  size_t offset;
21 } json_where_t;
22 
23 typedef struct json_scan_t
24 {
26 } json_scan_t;
27 
29 
30 CT_LOCAL void json_parse_integer(mpz_t integer, scan_t *scan, where_t where, const char *text, int base);
31 CT_LOCAL void json_parse_float(float *real, scan_t *scan, where_t where, const char *text);
32 CT_LOCAL void json_parse_string(text_view_t *string, scan_t *scan, json_where_t where, const char *text, size_t length);
#define CT_LOCAL
Definition: compiler.h:166
CT_LOCAL json_scan_t * json_scan_context(scan_t *scan)
Definition: scan.c:15
CT_LOCAL void json_parse_float(float *real, scan_t *scan, where_t where, const char *text)
Definition: scan.c:30
CT_LOCAL void json_parse_string(text_view_t *string, scan_t *scan, json_where_t where, const char *text, size_t length)
Definition: scan.c:42
CT_LOCAL void json_parse_integer(mpz_t integer, scan_t *scan, where_t where, const char *text, int base)
Definition: scan.c:20
logger_t * reports
Definition: json_scan.h:25
size_t offset
Definition: json_scan.h:19
where_t where
Definition: json_scan.h:20
a logging sink
Definition: notify.c:14
a source file scanner
Definition: scan.h:24
an unordered hash set
Definition: set.c:19
a non-owning view of text
Definition: text.h:24
a location inside a scanner locations are inclusive and 0-based
Definition: where.h:23