|
Lime Parser Generator 0.1.0
Runtime-extensible LALR(1) parser with SIMD tokenization and LLVM JIT
|
Create, share, and release parser snapshots. More...
Functions | |
| ParserSnapshot * | lemon_snapshot_acquire (ParserSnapshot *snap) |
| Acquire a reference to a snapshot. | |
| ParserSnapshot * | lemon_snapshot_create (const char *grammar_file, char **error) |
| Create a base snapshot by parsing a grammar file. | |
| void | lemon_snapshot_release (ParserSnapshot *snap) |
| Release a snapshot reference. | |
Create, share, and release parser snapshots.
| ParserSnapshot * lemon_snapshot_acquire | ( | ParserSnapshot * | snap | ) |
#include <include/parser.h>
Acquire a reference to a snapshot.
The caller must eventually call lemon_snapshot_release() to avoid leaking memory.
| snap | Snapshot to acquire. Passing NULL is safe and returns NULL. |
snap, for convenience.| ParserSnapshot * lemon_snapshot_create | ( | const char * | grammar_file, |
| char ** | error | ||
| ) |
#include <include/parser.h>
Create a base snapshot by parsing a grammar file.
Runs the Lime parser generator on grammar_file and produces a snapshot containing the compiled action tables.
| grammar_file | Path to the grammar file. | |
| [out] | error | On failure, set to a malloc'd message the caller must free. Set to NULL on success. |
| void lemon_snapshot_release | ( | ParserSnapshot * | snap | ) |
#include <include/parser.h>
Release a snapshot reference.
When the last reference is released the snapshot and all memory it owns are freed.
| snap | Snapshot to release. Passing NULL is safe. |