Struct brainfuck::Interpreter [] [src]

pub struct Interpreter<'a, T: Tape + Default> { /* fields omitted */ }

A brainfuck interpreter, with the needed state for execution.

For more information about the brainfuck language in general see the top level documentation for this crate. This implmentation of a brainfuck interpreter allows for optional programs, readers, and writers. Each of which can be set dynamically with the load, read_from, and write_to methods. The interpreter is also in charge of managing the program counter, which is 0 by default.

Each interpreter stores a tape for the execution of the program. The current tape uses a dynamically allocated array of TAPE_LENGTH elements.

Other fields used for instrumentation may also be stored in the interpreter.

Methods

impl<'a, T: Tape + Default> Interpreter<'a, T>
[src]

Create a new interpreter with the given program, optional reader, and writer.

Load a program for the interpreter to run.

Use the given reader for the Input instruction.

Use the given writer for the Output instruction.

Run the interpreter.

Run the interpreter with a callback hook.

Trait Implementations

impl<'a, T: Default + Tape + Default> Default for Interpreter<'a, T>
[src]

Returns the "default value" for a type. Read more