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

Create, populate, and destroy conflict points. More...

Functions

bool conflict_point_add_context (ConflictPoint *cp, const LimeContext *ctx)
 Add a grammar context to a conflict point.
 
void conflict_point_destroy (ConflictPoint *cp)
 Free resources owned by a ConflictPoint.
 
void conflict_point_init (ConflictPoint *cp, uint16_t token, int state, ConflictLevel level)
 Initialize a ConflictPoint.
 

Detailed Description

Create, populate, and destroy conflict points.

Function Documentation

◆ conflict_point_add_context()

bool conflict_point_add_context ( ConflictPoint cp,
const LimeContext ctx 
)

#include <include/conflict.h>

Add a grammar context to a conflict point.

Parameters
cpConflictPoint to add to.
ctxContext describing one possible interpretation.
Return values
trueContext was added.
falseAllocation failure.

◆ conflict_point_destroy()

void conflict_point_destroy ( ConflictPoint cp)

#include <include/conflict.h>

Free resources owned by a ConflictPoint.

Frees the contexts array and description. Does not free the ConflictPoint struct itself.

Parameters
cpConflictPoint to clean up.

◆ conflict_point_init()

void conflict_point_init ( ConflictPoint cp,
uint16_t  token,
int  state,
ConflictLevel  level 
)

#include <include/conflict.h>

Initialize a ConflictPoint.

The caller owns the struct (typically stack- or array-allocated).

Parameters
cpConflictPoint to initialize.
tokenToken code.
stateParser state (-1 for token-level conflicts).
levelAmbiguity level.