h_put_value and h_get_value done.
This commit is contained in:
parent
5679939a2c
commit
eb6c74cf89
6 changed files with 145 additions and 2 deletions
24
src/hammer.h
24
src/hammer.h
|
|
@ -621,6 +621,30 @@ HAMMER_FN_DECL(void, h_bind_indirect, HParser* indirect, const HParser* inner);
|
|||
*/
|
||||
HAMMER_FN_DECL(HParser*, h_with_endianness, char endianness, const HParser* p);
|
||||
|
||||
/**
|
||||
* The 'h_put_value' combinator stashes the result of the parser
|
||||
* it wraps in a symbol table in the parse state, so that non-
|
||||
* local actions and predicates can access this value.
|
||||
*
|
||||
* Try not to use this combinator if you can avoid it.
|
||||
*
|
||||
* Result token type: p's token type if name was not already in
|
||||
* the symbol table. It is an error, and thus a NULL result (and
|
||||
* parse failure), to attempt to rename a symbol.
|
||||
*/
|
||||
HAMMER_FN_DECL(HParser*, h_put_value, const HParser *p, const char* name);
|
||||
|
||||
/**
|
||||
* The 'h_get_value' combinator retrieves a named HParseResult that
|
||||
* was previously stashed in the parse state.
|
||||
*
|
||||
* Try not to use this combinator if you can avoid it.
|
||||
*
|
||||
* Result token type: whatever the stashed HParseResult is, if
|
||||
* present. If absent, NULL (and thus parse failure).
|
||||
*/
|
||||
HAMMER_FN_DECL(HParser*, h_get_value, const char* name);
|
||||
|
||||
/**
|
||||
* Free the memory allocated to an HParseResult when it is no longer needed.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue