|
BFC-Compiler
A C23 Brainfuck compiler
|
Brainfuck lexer implementation. More...
#include "bfc_lexer.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <stdlib.h>#include "bfc_memory.h"Macros | |
| #define | EMIT_TOKEN(toktype) |
| #define | X(tok_type, tok_char) |
Functions | |
| bfc_error_t | bfc_lex (bfc_token_stream_t **token_stream, bfc_program_t const *const program, bfc_args_t const cmd_args) |
| Scans the source buffer and builds a compact, location-aware token stream. | |
Brainfuck lexer implementation.
Scans source bytes, tracks one-based positions, applies the optional semicolon-comment extension, and emits tokens.
| #define EMIT_TOKEN | ( | toktype | ) |
| #define X | ( | tok_type, | |
| tok_char ) |
| bfc_error_t bfc_lex | ( | bfc_token_stream_t ** | token_stream, |
| bfc_program_t const *const | program, | ||
| bfc_args_t const | cmd_args ) |
Scans the source buffer and builds a compact, location-aware token stream.
Tokenizes a loaded Brainfuck source program.
Scans the source buffer and builds a compact, location-aware token stream.
| [out] | token_stream | Receives the allocated token stream. |
| [in] | program | Loaded source program. |
| [in] | cmd_args | Lexer-affecting command-line options. |