librdesc
Loading...
Searching...
No Matches
Functions
stack.h File Reference

Token stack interface contract. More...

#include "rdesc.h"
#include <stddef.h>

Go to the source code of this file.

Functions

void rdesc_stack_init (struct rdesc_stack **s)
 Initializes the token stack.
 
void rdesc_stack_destroy (struct rdesc_stack *s)
 Frees memory allocated by the token stack.
 
void rdesc_stack_push (struct rdesc_stack **s, struct rdesc_token tk)
 Pushes a token onto the stack.
 
struct rdesc_token rdesc_stack_pop (struct rdesc_stack **s)
 Removes and returns the top token from the stack.
 
struct rdesc_tokenrdesc_stack_as_ref (struct rdesc_stack *s)
 Returns a reference to underlying dynamic buffer.
 
size_t rdesc_stack_len (const struct rdesc_stack *s)
 Returns the underlying dynamic buffer.
 

Detailed Description

Token stack interface contract.

This header defines the function signatures required to manipulate the parser's backtracking stack.

Note
For custom implementations: If you have defined a custom struct rdesc_stack, you must provide implementations for all the functions declared in this file. The parser engine (librdesc) relies on these exact signatures to perform backtracking.