|
Lime Parser Generator 0.1.0
Runtime-extensible LALR(1) parser with SIMD tokenization and LLVM JIT
|
Select and query the active parser plugin. More...
Functions | |
| LimePluginHandle | parser_manager_get_active (const ParserManager *mgr) |
| Get the handle of the currently active plugin. | |
| ParserSnapshot * | parser_manager_get_snapshot (ParserManager *mgr) |
| Get the current active snapshot. | |
| ParserManagerStatus | parser_manager_set_active (ParserManager *mgr, LimePluginHandle handle, const char *grammar_file) |
| Set the active parser plugin. | |
| ParserManagerStatus | parser_manager_set_snapshot (ParserManager *mgr, ParserSnapshot *snap) |
| Provide or replace the active snapshot directly. | |
Select and query the active parser plugin.
| LimePluginHandle parser_manager_get_active | ( | const ParserManager * | mgr | ) |
#include <include/parser_manager.h>
Get the handle of the currently active plugin.
| mgr | The parser manager. |
| ParserSnapshot * parser_manager_get_snapshot | ( | ParserManager * | mgr | ) |
#include <include/parser_manager.h>
Get the current active snapshot.
Returns a snapshot with an additional reference – the caller must call lemon_snapshot_release() when done.
| mgr | The parser manager. |
| ParserManagerStatus parser_manager_set_active | ( | ParserManager * | mgr, |
| LimePluginHandle | handle, | ||
| const char * | grammar_file | ||
| ) |
#include <include/parser_manager.h>
Set the active parser plugin.
The active plugin is the one whose snapshot is returned by parser_manager_get_snapshot(). Only one plugin can be active at a time.
| mgr | The parser manager. |
| handle | Handle of the plugin to activate. |
| grammar_file | If non-NULL, the manager calls create_snapshot() immediately. If NULL, a snapshot must have been previously set via parser_manager_set_snapshot(). |
| ParserManagerStatus parser_manager_set_snapshot | ( | ParserManager * | mgr, |
| ParserSnapshot * | snap | ||
| ) |
#include <include/parser_manager.h>
Provide or replace the active snapshot directly.
The manager acquires a reference to snap. The previous active snapshot (if any) is released.
This is useful for loading pre-built or deserialized snapshots without going through create_snapshot().
| mgr | The parser manager. |
| snap | Snapshot to set as active. |