brainfuckm

Crates.iobrainfuckm
lib.rsbrainfuckm
version0.1.0
sourcesrc
created_at2022-01-25 19:40:24.799405
updated_at2022-01-25 19:40:24.799405
descriptionlibrary to parse brainfuck source code
homepage
repositoryhttps://github.com/mztikk/brainfuck
max_upload_size
id521038
size8,822
Nils Feierabend (mztikk)

documentation

README

BRAINFUCK

Rust library built on top of poetic to parse brainfuck.

Tests

There are tests for the parser which you can run with:

cargo test

Usage

It will first parse the string source input and parse it to only contain brainfuck opcodes.

let buf = fs::read_to_string("input.bf").unwrap();
let intermediate = Parser::parse_string(&buf);

These opcodes can then be turned into instructions

let mut instructions = Parser::parse_instructions(&intermediate);

which can then be optimized and interpreted by poetic see https://github.com/mztikk/poetic#usage

Commit count: 10

cargo fmt