Struct brainfuck::program::Program [] [src]

pub struct Program {
    // some fields omitted
}

The logic desired to be run by the brainfuck interpreter.

A program consists of the Abstract Syntax List (ASL) of a given brainfuck source text. The main operations of a program is creating one with the parse function, and getting the instruction for a given program counter with the get function.

Methods

impl Program

fn parse(source: &str) -> Result<Program, Error>

Create a program from source text.

fn get(&self, iptr: usize) -> Option<Instruction>

Get the instruction at the given program counter.

fn from_file<P: AsRef<Path>>(path: P) -> Result<Program, Error>

Create a program from a file.

Trait Implementations

impl Display for Program

fn fmt(&self, f: &mut Formatter) -> Result

Derived Implementations

impl Debug for Program

fn fmt(&self, __arg_0: &mut Formatter) -> Result