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

Notification callback for grammar context transitions. More...

Typedefs

typedef bool(* ContextSwitchCallback) (GrammarMode prev_mode, GrammarMode new_mode, void *user_data)
 Called when a context switch occurs.
 

Detailed Description

Notification callback for grammar context transitions.

Typedef Documentation

◆ ContextSwitchCallback

typedef bool(* ContextSwitchCallback) (GrammarMode prev_mode, GrammarMode new_mode, void *user_data)

#include <include/grammar_context.h>

Called when a context switch occurs.

Allows the application to save/restore parser state across grammar boundaries.

Parameters
prev_modeMode being left.
new_modeMode being entered.
user_dataPointer registered with grammar_context_set_switch_callback().
Return values
trueAllow the switch.
falseVeto the switch (context remains unchanged).

Definition at line 172 of file grammar_context.h.