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

Access the cloned parser state within a fork. More...

Functions

void parse_fork_abandon (ParseFork *fork)
 Mark a fork as abandoned (pruned).
 
void parse_fork_complete (ParseFork *fork, void *result, void(*free_fn)(void *))
 Mark a fork as completed with the given semantic result.
 
void parse_fork_fail (ParseFork *fork)
 Mark a fork as failed.
 
void * parse_fork_get_parser (ParseFork *fork)
 Get a mutable pointer to the cloned yyParser inside a fork.
 
struct ParserSnapshotparse_fork_get_snapshot (const ParseFork *fork)
 Get the snapshot associated with a fork.
 

Detailed Description

Access the cloned parser state within a fork.

Function Documentation

◆ parse_fork_abandon()

void parse_fork_abandon ( ParseFork fork)

#include <include/parser_fork.h>

Mark a fork as abandoned (pruned).

Parameters
forkThe fork to abandon.

◆ parse_fork_complete()

void parse_fork_complete ( ParseFork fork,
void *  result,
void(*)(void *)  free_fn 
)

#include <include/parser_fork.h>

Mark a fork as completed with the given semantic result.

Sets status to FORK_COMPLETED and stores the result pointer.

Parameters
forkThe fork to complete.
resultSemantic action output.
free_fnDestructor for result (NULL to use free()).

◆ parse_fork_fail()

void parse_fork_fail ( ParseFork fork)

#include <include/parser_fork.h>

Mark a fork as failed.

Parameters
forkThe fork that failed.

◆ parse_fork_get_parser()

void * parse_fork_get_parser ( ParseFork fork)

#include <include/parser_fork.h>

Get a mutable pointer to the cloned yyParser inside a fork.

The returned pointer is valid until free_parse_fork() is called.

Parameters
forkThe fork to access.
Returns
Pointer to the cloned yyParser, or NULL if fork is NULL or has no cloned state.

◆ parse_fork_get_snapshot()

struct ParserSnapshot * parse_fork_get_snapshot ( const ParseFork fork)

#include <include/parser_fork.h>

Get the snapshot associated with a fork.

Parameters
forkThe fork to query.
Returns
Snapshot pointer, valid for the fork's lifetime.