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

Collection of detected conflicts. More...

Data Structures

struct  ConflictSet
 Collection of detected conflicts. More...
 

Functions

bool conflict_set_add (ConflictSet *cs, ConflictType type, uint32_t mod_index_a, uint32_t mod_index_b, ExtensionID ext_id_a, ExtensionID ext_id_b, const char *description)
 Add a conflict to the set.
 
ConflictSetconflict_set_create (void)
 Create an empty conflict set.
 
void conflict_set_destroy (ConflictSet *cs)
 Destroy a conflict set and free all owned memory.
 
uint32_t conflict_set_unresolved_count (const ConflictSet *cs)
 Return the number of unresolved conflicts in the set.
 

Detailed Description

Collection of detected conflicts.

Function Documentation

◆ conflict_set_add()

bool conflict_set_add ( ConflictSet cs,
ConflictType  type,
uint32_t  mod_index_a,
uint32_t  mod_index_b,
ExtensionID  ext_id_a,
ExtensionID  ext_id_b,
const char *  description 
)

#include <include/conflict.h>

Add a conflict to the set.

Parameters
csConflict set to add to.
typeType of conflict.
mod_index_aIndex of the first conflicting modification.
mod_index_bIndex of the second conflicting modification.
ext_id_aExtension ID owning modification A.
ext_id_bExtension ID owning modification B.
descriptionHuman-readable description (copied internally).
Return values
trueConflict was added.
falseAllocation failure.

◆ conflict_set_create()

ConflictSet * conflict_set_create ( void  )

#include <include/conflict.h>

Create an empty conflict set.

Returns
New conflict set, or NULL on allocation failure.
See also
conflict_set_destroy()

◆ conflict_set_destroy()

void conflict_set_destroy ( ConflictSet cs)

#include <include/conflict.h>

Destroy a conflict set and free all owned memory.

Parameters
csConflict set to destroy. Passing NULL is safe.

◆ conflict_set_unresolved_count()

uint32_t conflict_set_unresolved_count ( const ConflictSet cs)

#include <include/conflict.h>

Return the number of unresolved conflicts in the set.

Parameters
csConflict set to query.
Returns
Count of conflicts where resolved == false.