Lime Parser Generator 0.1.0
Runtime-extensible LALR(1) parser with SIMD tokenization and LLVM JIT
Loading...
Searching...
No Matches
TokenTable Struct Reference

Thread-safe token lookup table. More...

#include <token_table.h>

Data Fields

uint32_t capacity
 Allocated slots in tokens.
 
uint32_t hash_capacity
 Length of hash_table.
 
uint32_t * hash_table
 Hash bucket table mapping to indices.
 
pthread_rwlock_t lock
 Reader/writer lock guarding the table.
 
uint32_t ntokens
 Number of tokens in tokens.
 
TokenDefinitiontokens
 Dense array of tokens.
 
atomic_uint_fast32_t version
 RCU-style version counter.
 

Detailed Description

Thread-safe token lookup table.

Multiple readers can look up tokens simultaneously; writers acquire exclusive access for modifications. A version counter is maintained for external change detection.

Definition at line 40 of file token_table.h.

Field Documentation

◆ capacity

uint32_t TokenTable::capacity

Allocated slots in tokens.

Definition at line 43 of file token_table.h.

◆ hash_capacity

uint32_t TokenTable::hash_capacity

Length of hash_table.

Definition at line 46 of file token_table.h.

◆ hash_table

uint32_t* TokenTable::hash_table

Hash bucket table mapping to indices.

Definition at line 45 of file token_table.h.

◆ lock

pthread_rwlock_t TokenTable::lock

Reader/writer lock guarding the table.

Definition at line 49 of file token_table.h.

◆ ntokens

uint32_t TokenTable::ntokens

Number of tokens in tokens.

Definition at line 42 of file token_table.h.

◆ tokens

TokenDefinition* TokenTable::tokens

Dense array of tokens.

Definition at line 41 of file token_table.h.

◆ version

atomic_uint_fast32_t TokenTable::version

RCU-style version counter.

Definition at line 48 of file token_table.h.


The documentation for this struct was generated from the following file: