BFC-Compiler
A C23 Brainfuck compiler
Loading...
Searching...
No Matches
bfc_jumptable.h File Reference

Bracket validation and matching table interface. More...

#include <stdint.h>
#include "bfc_error.h"
#include "bfc_token.h"

Go to the source code of this file.

Functions

bfc_error_t bfc_parse_jump_table (int64_t **jump_table, bfc_token_stream_t const *const tok_stream)
 Validates loop delimiters and builds matching bracket indices.
void bfc_jump_table_destroy (int64_t **pjump_table)
 Releases a jump table and nulls the caller pointer.

Detailed Description

Bracket validation and matching table interface.

Validates loop delimiters and records matching bracket token indices.

Function Documentation

◆ bfc_jump_table_destroy()

void bfc_jump_table_destroy ( int64_t ** pjump_table)

Releases a jump table and nulls the caller pointer.

Releases the matching-index table and nulls the caller pointer.

Releases a jump table and nulls the caller pointer.

◆ bfc_parse_jump_table()

bfc_error_t bfc_parse_jump_table ( int64_t ** jump_table,
bfc_token_stream_t const *const tok_stream )

Validates loop delimiters and builds matching bracket indices.

Validates nested brackets and fills a bidirectional matching-index table.

Parameters
[out]jump_tableReceives an allocated table indexed by token position.
[in]tok_streamToken stream to validate.
Returns
BFC_ERR_OK on success; otherwise an allocation or bracket error.
Note
Non-bracket entries contain -1.

Validates loop delimiters and builds matching bracket indices.