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— contains all tokenstokenizer— containstokenizefunction
def tokenize(char: str) -> Token: ...
transpiler— containstranspilefunction
def transpile(token: Token) -> str: ...
code_generator— containsgeneratefunction that generate valid C code from given tokens
def generate(tokens: 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-2.0.0.tar.gz
(11.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bftc-2.0.0.tar.gz.
File metadata
- Download URL: bftc-2.0.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
845468a808fc0b279800531328cc4b45956c728c73c0adf26ebe0f86bbde3005
|
|
| MD5 |
8b4c4679b463d0976de03350e65fbce6
|
|
| BLAKE2b-256 |
50ec49a0cec976c5a66849ce946501e39ac5f6b63c6eeae7dab7ea61db09189b
|
File details
Details for the file bftc-2.0.0-py2.py3-none-any.whl.
File metadata
- Download URL: bftc-2.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b9900ea4a7e2bd3c3d580741f63a1dcb89336362b968195b92092999848d212
|
|
| MD5 |
3757949e2249746c6eaff07a1434db75
|
|
| BLAKE2b-256 |
321790369814ea0e859742fc1e0f4ec3e72adfc60b476cc37e8888f2b605a9e6
|