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

Brainfuck lexical analysis interface. More...

#include "bfc_cli.h"
#include "bfc_error.h"
#include "bfc_io.h"
#include "bfc_token.h"

Go to the source code of this file.

Functions

bfc_error_t bfc_lex (bfc_token_stream_t **token_stream, bfc_program_t const *const program, bfc_args_t const cmd_args)
 Tokenizes a loaded Brainfuck source program.

Detailed Description

Brainfuck lexical analysis interface.

Transforms a loaded source program into a location-aware token stream.

Function Documentation

◆ bfc_lex()

bfc_error_t bfc_lex ( bfc_token_stream_t ** token_stream,
bfc_program_t const *const program,
bfc_args_t const cmd_args )

Tokenizes a loaded Brainfuck source program.

Scans the source buffer and builds a compact, location-aware token stream.

Parameters
[out]token_streamReceives the allocated token stream.
[in]programLoaded source program.
[in]cmd_argsLexer-affecting command-line options.
Returns
BFC_ERR_OK on success; otherwise an allocation error.
Note
Release the result with bfc_token_stream_destroy().

Tokenizes a loaded Brainfuck source program.