18#define INVALID_INDEX 0xFFFFFFFF
56TokenTable *create_token_table(uint32_t initial_capacity);
68int lookup_token(
TokenTable *table,
const char *str,
size_t len);
74bool add_token(
TokenTable *table,
const char *lexeme,
int token_code,
uint32_t ExtensionID
Opaque ID identifying a registered extension.
A single token definition in the table.
const char * lexeme
Token string (e.g., "SELECT")
size_t lexeme_len
Length of lexeme.
ExtensionID extension_id
Which extension added it (0 = base)
int token_code
Token ID (e.g., TK_SELECT)
uint32_t next_in_chain
Hash collision chain link.
Thread-safe token lookup table.
pthread_rwlock_t lock
Reader/writer lock guarding the table.
uint32_t capacity
Allocated slots in tokens.
uint32_t hash_capacity
Length of hash_table.
TokenDefinition * tokens
Dense array of tokens.
atomic_uint_fast32_t version
RCU-style version counter.
uint32_t ntokens
Number of tokens in tokens.
uint32_t * hash_table
Hash bucket table mapping to indices.