Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/keruspe/brainfuck.rs
- Owner: Keruspe
- Created: 2016-12-01T20:54:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-06-24T04:18:50.000Z (over 3 years ago)
- Last Synced: 2024-10-14T11:22:41.454Z (4 months ago)
- Topics: brainfuck, brainfuck-parser, interpreter, nom, parser, rust
- Language: Rust
- Size: 68.4 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
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