|
Lime Parser Generator 0.1.0
Runtime-extensible LALR(1) parser with SIMD tokenization and LLVM JIT
|
Extension Registry – manages grammar extensions with rich metadata. More...
#include <stdbool.h>#include <stdint.h>#include <stddef.h>Go to the source code of this file.
Data Structures | |
| struct | ExtensionOrder |
| Result of dependency resolution: a sorted array of extension names in load order (dependencies before dependents). More... | |
| struct | GrammarExtensionMetadata |
| Metadata describing a grammar extension participant in the execution pipeline. More... | |
| struct | OracleContext |
| Context passed to an oracle callback when the system needs a disambiguation decision. More... | |
Typedefs | |
| typedef struct ExtensionRegistry | ExtensionRegistry |
| Opaque extension registry handle. | |
| typedef bool(* | ExtensionVisitorFn) (const GrammarExtensionMetadata *meta, void *user_data) |
| Visitor callback for extension iteration. | |
| typedef int(* | OracleCallback) (const OracleContext *ctx) |
| Oracle callback type. | |
Enumerations | |
| enum | DisambiguationStrategy { DISAMBIG_PRIORITY = 0 , DISAMBIG_FORK_RESOLVE , DISAMBIG_ORACLE , DISAMBIG_CONTEXT , DISAMBIG_NONE } |
| How an extension prefers to resolve ambiguities introduced by its grammar modifications. More... | |
| enum | ExecutionPolicy { EXEC_SEQUENTIAL = 0 , EXEC_PARALLEL , EXEC_PIPELINE , EXEC_LAZY } |
| Controls how an extension's modifications are applied relative to other extensions. More... | |
Functions | |
| void | extension_order_destroy (ExtensionOrder *order) |
| Free an ExtensionOrder and all owned strings. | |
| bool | extension_registry_check_dependencies (ExtensionRegistry *reg, char **error_out) |
| Validate all dependency and conflict declarations. | |
| uint32_t | extension_registry_count (const ExtensionRegistry *reg) |
| Return the number of registered extensions. | |
| ExtensionRegistry * | extension_registry_create (void) |
| Create an empty extension registry. | |
| void | extension_registry_destroy (ExtensionRegistry *reg) |
| Destroy the registry and free all owned memory. | |
| const GrammarExtensionMetadata * | extension_registry_find (ExtensionRegistry *reg, const char *name) |
| Look up an extension by name. | |
| void | extension_registry_foreach (const ExtensionRegistry *reg, ExtensionVisitorFn visitor, void *user_data) |
| Iterate over all registered extensions. | |
| bool | extension_registry_get_order (ExtensionRegistry *reg, ExtensionOrder *order_out, char **error_out) |
| Produce a topological ordering of all registered extensions. | |
| bool | extension_registry_register (ExtensionRegistry *reg, const GrammarExtensionMetadata *metadata) |
| Register an extension with its metadata. | |
| bool | extension_registry_unregister (ExtensionRegistry *reg, const char *name) |
| Unregister an extension by name. | |
Extension Registry – manages grammar extensions with rich metadata.
The extension registry manages grammar extensions with metadata including disambiguation strategies, execution policies, dependency tracking, and conflict declarations. It builds on the existing extension system (src/extension.h) by adding:
Definition in file extension_registry.h.