|
Lime Parser Generator 0.1.0
Runtime-extensible LALR(1) parser with SIMD tokenization and LLVM JIT
|
Create, use, and destroy disambiguation contexts. More...
Functions | |
| DisambiguationContext * | disambiguation_create (LimeStrategy strategy, struct ExtensionRegistry *reg) |
| Create a disambiguation context using a built-in strategy. | |
| DisambiguationContext * | disambiguation_create_custom (const DisambiguationStrategyVTable *vtable, struct ExtensionRegistry *reg) |
| Create a disambiguation context using a user-supplied vtable. | |
| void | disambiguation_destroy (DisambiguationContext *ctx) |
| Destroy a disambiguation context and free all resources. | |
| LimeStrategy | disambiguation_get_strategy (const DisambiguationContext *ctx) |
| Get the strategy type used by this context. | |
| StrategyResult | disambiguation_resolve (DisambiguationContext *ctx, const ConflictPoint *conflict, struct ParseContext *parse_ctx) |
| Resolve a conflict using the configured strategy. | |
| const char * | disambiguation_strategy_name (LimeStrategy strategy) |
| Get the name of a strategy as a string. | |
| void | disambiguation_update (DisambiguationContext *ctx, bool success) |
| Provide feedback after a parse. | |
Create, use, and destroy disambiguation contexts.
| DisambiguationContext * disambiguation_create | ( | LimeStrategy | strategy, |
| struct ExtensionRegistry * | reg | ||
| ) |
#include <include/disambiguation.h>
Create a disambiguation context using a built-in strategy.
| strategy | Which strategy to use (STRAT_PRIORITY, etc.). |
| reg | The extension registry. Must remain valid for the lifetime of the context. |
| DisambiguationContext * disambiguation_create_custom | ( | const DisambiguationStrategyVTable * | vtable, |
| struct ExtensionRegistry * | reg | ||
| ) |
#include <include/disambiguation.h>
Create a disambiguation context using a user-supplied vtable.
| vtable | Strategy function pointers (copied internally). |
| reg | The extension registry. |
| void disambiguation_destroy | ( | DisambiguationContext * | ctx | ) |
#include <include/disambiguation.h>
Destroy a disambiguation context and free all resources.
| ctx | Context to destroy. Passing NULL is safe. |
| LimeStrategy disambiguation_get_strategy | ( | const DisambiguationContext * | ctx | ) |
#include <include/disambiguation.h>
Get the strategy type used by this context.
| ctx | The disambiguation context. |
| StrategyResult disambiguation_resolve | ( | DisambiguationContext * | ctx, |
| const ConflictPoint * | conflict, | ||
| struct ParseContext * | parse_ctx | ||
| ) |
#include <include/disambiguation.h>
Resolve a conflict using the configured strategy.
| ctx | The disambiguation context. |
| conflict | Description of the conflict to resolve. |
| parse_ctx | Current parse context (may be NULL). |
| const char * disambiguation_strategy_name | ( | LimeStrategy | strategy | ) |
#include <include/disambiguation.h>
Get the name of a strategy as a string.
| strategy | Strategy to name. |
| void disambiguation_update | ( | DisambiguationContext * | ctx, |
| bool | success | ||
| ) |
#include <include/disambiguation.h>
Provide feedback after a parse.
Notifies the strategy so learning-based strategies can update their models.
| ctx | The disambiguation context. |
| success | True if the parse succeeded. |