bfx
An interpreter, compiler, and REPL for brainfuck-like languages
Loading...
Searching...
No Matches
pbrain.c File Reference
#include "pbrain.h"
#include "bfx.h"
#include "brainfuck.h"
#include "util.h"

Functions

BFX_Error bfx_pbrain_init (BFX *bfx)
 Initialize the P-Brain interpreter.
 
BFX_Error bfx_pbrain_run (BFX *bfx)
 Run the P-Brain interpreter.
 
BFX_Error bfx_op_pbrain_start_procedure (BFX *bfx, BFX_FileIndex *idx)
 Begin procedure definition (pbrain).
 
BFX_Error bfx_op_pbrain_call (BFX *bfx, BFX_FileIndex *index)
 Call a procedure by its identifier (pbrain).
 
BFX_Error bfx_op_pbrain_ret (BFX *bfx, BFX_FileIndex *index)
 Return from a procedure (pbrain).
 

Detailed Description

This file contains the implementation of the P-Brain interpreter.

Function Documentation

◆ bfx_op_pbrain_call()

BFX_Error bfx_op_pbrain_call ( BFX bfx,
BFX_FileIndex index 
)

Call a procedure by its identifier (pbrain).

◆ bfx_op_pbrain_ret()

BFX_Error bfx_op_pbrain_ret ( BFX bfx,
BFX_FileIndex index 
)

Return from a procedure (pbrain).

◆ bfx_op_pbrain_start_procedure()

BFX_Error bfx_op_pbrain_start_procedure ( BFX bfx,
BFX_FileIndex idx 
)

Begin procedure definition (pbrain).

Parameters
bfPointer to the interpreter struct
idxPointer to the file index struct

◆ bfx_pbrain_init()

BFX_Error bfx_pbrain_init ( BFX bfx)

Initialize the P-Brain interpreter.

Parameters
bfxPointer to the already-allocated interpreter struct

◆ bfx_pbrain_run()

BFX_Error bfx_pbrain_run ( BFX bfx)

Run the P-Brain interpreter.

This function initializes and runs the P-Brain interpreter. It frees all language-specific data.

Parameters
bfxPointer to the interpreter struct