BFC-Compiler
A C23 Brainfuck compiler
Loading...
Searching...
No Matches
bfc_token.c File Reference

Token construction and token-stream cleanup. More...

#include "bfc_token.h"
#include <stdlib.h>

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 from its kind and source coordinates.
void bfc_token_stream_destroy (bfc_token_stream_t **ptok_stream)
 Releases the owned token array and stream object, then nulls the caller pointer.

Detailed Description

Token construction and token-stream cleanup.

Implements value construction and ownership-aware destruction for lexical tokens.

Function Documentation

◆ bfc_make_token()

bfc_token_t bfc_make_token ( bfc_token_type_t const tok_type,
uint32_t const line,
uint32_t const col )
nodiscard

Constructs a token value from its kind and source coordinates.

Constructs a token value without allocating memory.

Constructs a token value from its kind and source coordinates.

◆ bfc_token_stream_destroy()

void bfc_token_stream_destroy ( bfc_token_stream_t ** ptok_stream)

Releases the owned token array and stream object, then nulls the caller pointer.

Releases a token stream and nulls the caller pointer.

Releases the owned token array and stream object, then nulls the caller pointer.