static int prefix##_##
id##_##init(
scan_t *extra,
void *scanner) \
{ \
return prefix##lex_init_extra(extra, (yyscan_t *)scanner); \
} \
static
int prefix##_##
id##_parse(
void *scanner,
scan_t *extra) \
{ \
return prefix##parse(scanner, (
scan_t *)extra); \
} \
static
void *prefix##_##
id##_scan(
const char *text,
size_t size,
void *scanner) \
{ \
CTASSERTF(
size <= INT_MAX, #prefix
"_scan (size = %zu > %d, name = %s)",
size, INT_MAX, \
return prefix##_scan_bytes(text, (
int)
size, scanner); \
} \
static void prefix##_##id##_destroy_buffer(void *buffer, void *scanner) \
{ \
prefix##_delete_buffer((YY_BUFFER_STATE)buffer, scanner); \
} \
static void prefix##_##id##_destroy(void *scanner) \
{ \
prefix##lex_destroy(scanner); \
} \
.
init = prefix##_##
id##_##init, \
.parse = prefix##_##id##_parse, \
.scan = prefix##_##id##_scan, \
.destroy_buffer = prefix##_##id##_destroy_buffer, \
.destroy = prefix##_##id##_destroy, \
}
CT_NODISCARD CT_PUREFN CT_SCAN_API const char * scan_path(const scan_t *scan)
get the path of a scanner
scanner function callbacks for flex and bison
int(* init)(scan_t *extra, void *scanner)
yylex_init_extra