Simple Brainfuck to C transpiler
Project description
🧠 Brainfuck to C transpiler
from bftc import code_generator, tokenizer
with open("code.bf") as bf_source:
tokens = [tokenizer.tokenize(char) for char in bf_source.read()]
with open("code.c", "w") as c_source:
c_source.write(code_generator.generate(tokens))
Modules
tokens
— contain all tokenstokenizer
— containtokenize
function
def tokenize(char: str) -> Token: ...
transpiler
— containtranspile
function
def transpile(token: Token) -> str: ...
code_generator
— containgenerate
function that generate valid C code from given tokens
def generate(list[Token]) -> str: ...
Install
pip install bftc
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bftc-1.0.1.tar.gz
(10.7 kB
view hashes)