Cthulhu  0.2.10
Cthulhu compiler collection
actions.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: LGPL-3.0-only
2 #pragma once
3 
4 #include <ctu_interop_api.h>
5 
6 #include "core/analyze.h"
7 
9 
10 typedef struct where_t where_t;
11 typedef struct scan_t scan_t;
12 
16 
22 CT_INTEROP_API void flex_action(INOUT_NOTNULL where_t *where, IN_STRING const char *text);
23 
31 CT_INTEROP_API int flex_input(INOUT_NOTNULL scan_t *scan, STA_WRITES(size) char *out, int size);
32 
36 CT_INTEROP_API void flex_init(OUT_NOTNULL where_t *where);
37 
43 CT_INTEROP_API void flex_update(INOUT_NOTNULL where_t *where, STA_READS(steps) const where_t *offsets, int steps);
44 
46 
CT_NODISCARD STA_WRITES(size) void *dst
CT_NODISCARD size_t size
Definition: scan.h:128
#define STA_READS(size)
annotate a parameter as reading expr elements
#define INOUT_NOTNULL
Definition: analyze.h:101
#define IN_STRING
annotate a parameter as being a null terminated string
#define OUT_NOTNULL
Definition: analyze.h:99
#define CT_BEGIN_API
Definition: compiler.h:129
#define CT_END_API
Definition: compiler.h:130
CT_INTEROP_API int flex_input(INOUT_NOTNULL scan_t *scan, STA_WRITES(size) char *out, int size)
retrevies more input for flex
CT_INTEROP_API void flex_action(INOUT_NOTNULL where_t *where, const char *text)
tracks the current source position
CT_INTEROP_API void flex_init(OUT_NOTNULL where_t *where)
initialize source location tracking
CT_INTEROP_API void flex_update(INOUT_NOTNULL where_t *where, STA_READS(steps) const where_t *offsets, int steps)
update the source location
a source file scanner
Definition: scan.h:24
a location inside a scanner locations are inclusive and 0-based
Definition: where.h:23