|
Lime Parser Generator 0.1.0
Runtime-extensible LALR(1) parser with SIMD tokenization and LLVM JIT
|
The plugin interface struct – the contract between the manager and a parser implementation. More...
#include <parser_manager.h>
Data Fields | |
| void * | _reserved [8] |
| Reserved for ABI-compatible future additions. | |
| ParserSnapshot *(* | create_snapshot )(const char *grammar_file, char **error) |
| Create a snapshot from a grammar file path. | |
| ParserSnapshot *(* | deserialize_snapshot )(const uint8_t *buf, size_t len, char **error) |
| Deserialize a snapshot from a byte buffer. | |
| void(* | destroy )(void) |
| Teardown callback. | |
| uint16_t(* | get_abi_major )(void) |
| Return the ABI major version this plugin was compiled against. | |
| uint16_t(* | get_abi_minor )(void) |
| Return the ABI minor version this plugin was compiled against. | |
| uint32_t(* | get_capabilities )(void) |
| Return a bitmask of LimePluginCaps describing this plugin. | |
| const char *(* | get_name )(void) |
| Return the plugin's human-readable name. | |
| LimePluginVersion(* | get_version )(void) |
| Return the plugin's semantic version. | |
| bool(* | init )(void *user_data) |
| One-time initialization. | |
| bool(* | serialize_snapshot )(const ParserSnapshot *snap, uint8_t **buf_out, size_t *len_out) |
| Serialize a snapshot to a byte buffer. | |
| bool(* | validate_snapshot )(const ParserSnapshot *snap, char **error) |
| Validate that a snapshot is internally consistent. | |
The plugin interface struct – the contract between the manager and a parser implementation.
Every plugin, whether loaded from a shared library or linked statically, must provide one of these.
Definition at line 192 of file parser_manager.h.
| void* LimeParserPlugin::_reserved[8] |
Reserved for ABI-compatible future additions.
Definition at line 327 of file parser_manager.h.
| ParserSnapshot *(* LimeParserPlugin::create_snapshot) (const char *grammar_file, char **error) |
Create a snapshot from a grammar file path.
| grammar_file | Path to the grammar file. | |
| [out] | error | On failure, set to a malloc'd error message the caller must free. Set to NULL on success. |
Definition at line 277 of file parser_manager.h.
| ParserSnapshot *(* LimeParserPlugin::deserialize_snapshot) (const uint8_t *buf, size_t len, char **error) |
Deserialize a snapshot from a byte buffer.
| buf | Buffer previously produced by serialize_snapshot(). | |
| len | Length of the buffer in bytes. | |
| [out] | error | On failure, set to a malloc'd error message. |
Definition at line 319 of file parser_manager.h.
| void(* LimeParserPlugin::destroy) (void) |
Teardown callback.
Called when the plugin is unloaded from the manager. Must release all resources owned by the plugin. After this call the plugin struct and any pointers it returned are invalid.
Definition at line 260 of file parser_manager.h.
| uint16_t(* LimeParserPlugin::get_abi_major) (void) |
Return the ABI major version this plugin was compiled against.
The manager rejects plugins whose ABI major version does not match LIME_PLUGIN_ABI_VERSION_MAJOR.
Definition at line 217 of file parser_manager.h.
| uint16_t(* LimeParserPlugin::get_abi_minor) (void) |
Return the ABI minor version this plugin was compiled against.
Definition at line 223 of file parser_manager.h.
| uint32_t(* LimeParserPlugin::get_capabilities) (void) |
Return a bitmask of LimePluginCaps describing this plugin.
Definition at line 229 of file parser_manager.h.
| const char *(* LimeParserPlugin::get_name) (void) |
Return the plugin's human-readable name.
Definition at line 202 of file parser_manager.h.
| LimePluginVersion(* LimeParserPlugin::get_version) (void) |
Return the plugin's semantic version.
Definition at line 208 of file parser_manager.h.
| bool(* LimeParserPlugin::init) (void *user_data) |
One-time initialization.
Called after the plugin is loaded but before any other callbacks. Receives the user_data pointer passed to parser_manager_load() or parser_manager_register().
| user_data | Opaque pointer from the load/register call. |
| true | Initialization succeeded. |
| false | Initialization failed; plugin is not registered. |
Definition at line 248 of file parser_manager.h.
| bool(* LimeParserPlugin::serialize_snapshot) (const ParserSnapshot *snap, uint8_t **buf_out, size_t *len_out) |
Serialize a snapshot to a byte buffer.
| snap | Snapshot to serialize. | |
| [out] | buf_out | On success, points to a malloc'd buffer the caller must free. |
| [out] | len_out | On success, receives the buffer length in bytes. |
| true | Serialization succeeded. |
| false | Serialization failed. |
Definition at line 306 of file parser_manager.h.
| bool(* LimeParserPlugin::validate_snapshot) (const ParserSnapshot *snap, char **error) |
Validate that a snapshot is internally consistent.
| snap | Snapshot to validate. | |
| [out] | error | On failure, set to a malloc'd diagnostic message. |
| true | Snapshot is well-formed. |
| false | Snapshot is invalid. |
Definition at line 290 of file parser_manager.h.