|
Lime Parser Generator 0.1.0
Runtime-extensible LALR(1) parser with SIMD tokenization and LLVM JIT
|
Execute semantic actions according to a configured policy. More...
Functions | |
| ExecutionResult * | execute_first_only (ParserExecuteFn execute_fn, const struct StrategyResult *disambiguation, LimeParserHandle **parsers, GrammarExtensionMetadata **extensions, int *nresults_out) |
| Convenience: execute with EXEC_FIRST_ONLY policy. | |
| ExecutionResult * | execute_semantic_actions (const ExecutionPolicyConfig *config, const struct StrategyResult *disambiguation, LimeParserHandle **parsers, GrammarExtensionMetadata **extensions, int *nresults_out) |
| Execute semantic actions according to the configured policy. | |
| void | execution_policy_config_init (ExecutionPolicyConfig *config) |
| Initialize default execution policy configuration. | |
| const char * | execution_policy_name (LimeExecMode policy) |
| Return a human-readable name for an execution policy. | |
| void | execution_results_free (ExecutionResult *results, int nresults) |
| Free an array of execution results. | |
Execute semantic actions according to a configured policy.
| ExecutionResult * execute_first_only | ( | ParserExecuteFn | execute_fn, |
| const struct StrategyResult * | disambiguation, | ||
| LimeParserHandle ** | parsers, | ||
| GrammarExtensionMetadata ** | extensions, | ||
| int * | nresults_out | ||
| ) |
#include <include/execution_policy.h>
Convenience: execute with EXEC_FIRST_ONLY policy.
| execute_fn | Callback to run the parser. | |
| disambiguation | Result from disambiguation strategy. | |
| parsers | Array of parser handles. | |
| extensions | Array of extension metadata. | |
| [out] | nresults_out | Receives 1 on success, 0 on failure. |
| ExecutionResult * execute_semantic_actions | ( | const ExecutionPolicyConfig * | config, |
| const struct StrategyResult * | disambiguation, | ||
| LimeParserHandle ** | parsers, | ||
| GrammarExtensionMetadata ** | extensions, | ||
| int * | nresults_out | ||
| ) |
#include <include/execution_policy.h>
Execute semantic actions according to the configured policy.
The StrategyResult (from disambiguation.h) provides the list of winning contexts. The parsers and extensions arrays are parallel to the winning_contexts array.
| config | Execution policy configuration. | |
| disambiguation | Result from disambiguation strategy. | |
| parsers | Array of parser handles, one per winner. | |
| extensions | Array of extension metadata, one per winner. | |
| [out] | nresults_out | Receives the number of results. |
| void execution_policy_config_init | ( | ExecutionPolicyConfig * | config | ) |
#include <include/execution_policy.h>
Initialize default execution policy configuration.
Sets policy to EXEC_FIRST_ONLY with stop_on_error=true.
| config | Configuration struct to initialize. |
| const char * execution_policy_name | ( | LimeExecMode | policy | ) |
#include <include/execution_policy.h>
Return a human-readable name for an execution policy.
| policy | Policy to name. |
| void execution_results_free | ( | ExecutionResult * | results, |
| int | nresults | ||
| ) |
#include <include/execution_policy.h>
Free an array of execution results.
Frees each result's error string and the array itself.
| results | Array returned by execute_semantic_actions(). Passing NULL is safe. |
| nresults | Number of entries in the array. |