19#define LIME_SNAPSHOT_MAGIC 0x4C494D45U
20#define LIME_SNAPSHOT_ABI_VERSION 2
36typedef std::atomic<std::uint_fast32_t> atomic_uint_fast32_t;
80typedef int (*LimeHostReduceFn)(
void *user,
int ruleno,
81 const void *rhs_values,
const int *rhs_locs,
82 int nrhs,
void *lhs_out,
int *lhs_loc_out);
105typedef enum VersionOp {
263 uint16_t abi_version;
297 uint32_t grammar_source_len;
298 uint32_t reserved_pad3;
330 LimeHostReduceFn host_reduce;
331 void *host_reduce_user;
342 uint32_t token_names_count;
384ParserSnapshot *create_base_snapshot(
const char *grammar_file,
char **error);
395bool semver_parse(
const char *str,
SemVer *out);
413void semver_destroy(
SemVer *v);
A dependency declaration from one module to another.
bool optional
If true, unsatisfied is not an error.
char * module_name
Target module name (owned)
uint32_t nconstraints
Number of entries in constraints.
VersionConstraint * constraints
Array of version constraints.
uint8_t merkle_root[32]
Expected content hash (zero = any)
A parser module: a named, versioned unit of grammar with explicit dependency, export,...
char ** exports
Symbol names exported by this module.
char * name
Unique module name (owned)
char ** imports
Symbol names imported from other modules.
ParserDependency * dependencies
Array of dependencies (owned)
SemVer version
Module version.
uint32_t nimports
Length of imports.
uint32_t nexports
Length of exports.
uint32_t ndependencies
Length of Dependencies.
uint32_t lookahead_count
Number of entries in yy_lookahead.
uint16_t yy_no_action
Marker for unused slot.
struct symbol ** symbols
Array of pointers to symbol structs.
uint16_t yy_max_shiftreduce
Shift-reduce range maximum.
int32_t * yy_shift_ofst
Per-state offset into yy_action for shifts.
uint16_t * yy_default
Default action for each state.
uint16_t * yy_fallback
Optional fallback table (length = nfallback, may be NULL).
uint16_t yy_accept_action
Marker for parser accept.
char * grammar_source
Optional original grammar source text.
uint16_t yy_first_token
first_token directive value: subtracted from external token codes to get the internal action-table in...
void * jit_find_shift_fn
Cached pointer to the JIT'd jit_find_shift_action function, or NULL if no JIT is attached.
uint64_t version
Monotonically increasing version number.
uint32_t nfallback
Length of yy_fallback.
uint32_t reserved_pad2
Padding to 8-byte boundary.
void * jit_ctx
JIT compilation context.
atomic_uint_fast32_t refcount
Atomic reference count.
int32_t * yy_reduce_ofst
Per-state offset into yy_action for reduces.
uint16_t yy_min_shiftreduce
Shift-reduce range minimum.
uint16_t yy_max_shift
0..YY_MAX_SHIFT = shift to that state
uint32_t nterminal
Number of terminal symbols.
uint32_t nsymbol
Total number of symbols.
uint16_t yy_ntoken
Highest terminal code + 1.
int16_t * yy_rule_info_lhs
LHS symbol code per rule.
uint16_t reserved16
Padding – next field is 8-byte aligned.
int8_t * yy_rule_info_nrhs
Negative number of RHS symbols per rule.
uint32_t nrule
Total number of rules.
uint16_t yy_error_action
Marker for syntax error.
uint8_t merkle_root[32]
Content hash of grammar data.
struct state ** states
Array of pointers to state structs.
uint16_t yy_min_reduce
Reduce range minimum (max = nstate+nrule)
uint32_t reserved_pad
Padding – atomics on next line.
uint32_t action_count
Number of entries in yy_action.
uint32_t magic
Magic 'LIME' + ABI version stamped by snapshot_build_from_tables at construction time.
uint32_t nstate
Total number of parser states.
struct rule * rules
Linked list of production rules.
uint16_t * yy_lookahead
Lookahead values parallel to yy_action.
ParserModule *uint64_t create_time_ns
< Owning module metadata, or NULL
uint16_t * yy_action
Combined shift+reduce action array.
A parsed semantic version: major.minor.patch with optional prerelease label (e.g.
uint32_t major
Major version component.
uint32_t minor
Minor version component.
uint32_t patch
Patch version component.
char * prerelease
Prerelease label (malloc'd; NULL if absent)
A single version constraint on a dependency, e.g.
SemVer version
Reference version for the operator.
VersionOp op
Constraint operator.