1 unstable release

0.1.0 Jan 25, 2022

#2385 in Parser implementations

MIT license

4KB

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

Dependencies

~375KB