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

Describes a grammar mode that can be entered during parsing. More...

#include <grammar_context.h>

Data Fields

int exit_token
 Exit trigger: token code that terminates this mode.
 
GrammarMode mode
 Which mode this describes.
 
const char * name
 Human-readable name.
 
ParserSnapshotsnapshot
 Snapshot to use (reference acquired)
 
const char * trigger_lexeme
 Entry trigger: lexeme prefix that initiates this mode.
 
int trigger_token
 Entry trigger: token code that initiates this mode.
 

Detailed Description

Describes a grammar mode that can be entered during parsing.

Registered with grammar_context_register_mode().

Definition at line 112 of file grammar_context.h.

Field Documentation

◆ exit_token

int GrammarModeInfo::exit_token

Exit trigger: token code that terminates this mode.

-1 means the mode ends when bracket/paren depth returns to 0.

Definition at line 136 of file grammar_context.h.

◆ mode

GrammarMode GrammarModeInfo::mode

Which mode this describes.

Definition at line 113 of file grammar_context.h.

◆ name

const char* GrammarModeInfo::name

Human-readable name.

Definition at line 114 of file grammar_context.h.

◆ snapshot

ParserSnapshot* GrammarModeInfo::snapshot

Snapshot to use (reference acquired)

Definition at line 115 of file grammar_context.h.

◆ trigger_lexeme

const char* GrammarModeInfo::trigger_lexeme

Entry trigger: lexeme prefix that initiates this mode.

If NULL, only trigger_token is checked.

Definition at line 129 of file grammar_context.h.

◆ trigger_token

int GrammarModeInfo::trigger_token

Entry trigger: token code that initiates this mode.

If -1, the mode is only entered explicitly via grammar_context_push().

Definition at line 122 of file grammar_context.h.


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