|
BFC-Compiler
A C23 Brainfuck compiler
|
Brainfuck token definitions and token-stream ownership. More...
#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | bfc_token_t |
| One Brainfuck token and its one-based source location. More... | |
| struct | bfc_token_stream_t |
| Owning token sequence produced by the lexer. More... | |
Macros | |
| #define | TOKEN_MAP |
| Single source of truth for Brainfuck characters and token kinds. | |
| #define | X(tok_type, ...) |
Enumerations | |
| enum | bfc_token_type_t { TOKEN_MAP } |
| Token kinds emitted by the lexer. | |
Functions | |
| bfc_token_t | bfc_make_token (bfc_token_type_t const tok_type, uint32_t const line, uint32_t const col) |
| Constructs a token value without allocating memory. | |
| void | bfc_token_stream_destroy (bfc_token_stream_t **ptok_stream) |
| Releases a token stream and nulls the caller pointer. | |
Brainfuck token definitions and token-stream ownership.
Defines token kinds, source locations, stream storage, construction, and destruction.
| #define TOKEN_MAP |
Single source of truth for Brainfuck characters and token kinds.
| #define X | ( | tok_type, | |
| ... ) |
|
nodiscard |
Constructs a token value without allocating memory.
Constructs a token value from its kind and source coordinates.
Constructs a token value without allocating memory.
| void bfc_token_stream_destroy | ( | bfc_token_stream_t ** | ptok_stream | ) |
Releases a token stream and nulls the caller pointer.
Releases the owned token array and stream object, then nulls the caller pointer.
Releases a token stream and nulls the caller pointer.