Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/keruspe/brainfuck.rs

Brainfuck parser written in rust using nom
https://github.com/keruspe/brainfuck.rs

brainfuck brainfuck-parser interpreter nom parser rust

Last synced: 4 months ago
JSON representation

Brainfuck parser written in rust using nom

Awesome Lists containing this project

README

        

# brainfuck.rs

[![Build Status](https://travis-ci.org/Keruspe/brainfuck.rs.svg?branch=master)](https://travis-ci.org/Keruspe/brainfuck.rs)
[![Coverage Status](https://coveralls.io/repos/github/Keruspe/brainfuck.rs/badge.svg?branch=master)](https://coveralls.io/github/Keruspe/brainfuck.rs?branch=master)

Implementation of a brainfuck parser and interpreter written in rust using nom

## Interpreter example

```
cargo run --bin bf examples/bottles.bf
```

## Parser example

```rust
extern crate brainfuck;

use brainfuck::context::Context;
use brainfuck::parser;

fn main() {
let hello_world = include_bytes!("hello_world.bf");
let mut ctx = Context::new();
let block = parser::parse(hello_world).expect("Failed parsing input file");
ctx.run(&block);
}
```

You can run `cargo run --example hello_world` to try this