vector_t * ctx_vector_of(size_t size, const scan_t *scan)
void ctx_error(const where_t *where, const void *state, const scan_t *scan, const char *msg)
void ctx_unknown_symbol(const scan_t *scan, const where_t *where, const char *msg)
arena_t * ctx_get_arena(const scan_t *scan)
void * ctx_get_user(const scan_t *scan)
vector_t * ctx_vector_init(void *init, const scan_t *scan)
arena_t * ctx_get_string_arena(const scan_t *scan)
logger_t * ctx_get_logger(const scan_t *scan)
vector_t * ctx_vector_new(size_t size, const scan_t *scan)
arena_t * ctx_get_ast_arena(const scan_t *scan)
CT_NODISCARD CT_PUREFN CT_SCAN_API void * scan_get_context(const scan_t *scan)
get the context of a scanner
CT_EVENTS_API void evt_scan_unknown(logger_t *logger, const node_t *node, const char *msg)
signal that a scanner has encountered an unknown token
CT_EVENTS_API void evt_scan_error(logger_t *logger, const node_t *node, const char *msg)
signal that a scan error has occurred
CT_NODISCARD CT_SCAN_API node_t * node_new(const scan_t *scan, where_t where)
create a new node on the heap
#define CT_UNUSED(x)
mark a variable as unused
CT_NODISCARD CT_STD_API vector_t * vector_new(size_t size, arena_t *arena)
create a new vector with an initial capacity
CT_NODISCARD CT_STD_API vector_t * vector_of(size_t len, arena_t *arena)
create a new vector with a specified length
CT_NODISCARD CT_STD_API vector_t * vector_init(void *value, arena_t *arena)
create a new vector with a single initial value
a position in a source file
a generic vector of pointers
a location inside a scanner locations are inclusive and 0-based