Enum bf::common::Instruction[][src]

pub enum Instruction {
    Left(Count),
    Right(Count),
    Add(u8),
    In,
    Out,
    JumpZero(Count),
    JumpNotZero(Count),
    SetZero,
    OffsetAddRight(Count),
    OffsetAddLeft(Count),
    FindZeroRight(Count),
    FindZeroLeft(Count),
}

Instructions as output by the bytecode flattener.

These include the result of peephole optimizations that turn sequences of Brainfuck commands into non-Brainfuck instructions that are understood by the appropriate interpreters and the JIT compiler.

Unlike in the earlier passes, the loop instructions do not include a boxed slice of instructions as a subtree. Note that this type is Copy.

Variants

Decrease the pointer by the specified offset.

Increase the pointer by the specified offset.

Increase the current byte value by the specified offset.

Read a byte of input.

Write a byte of output.

Begin a loop, jumping to the end if the current byte value is 0.

The Count is the address of the matching JumpNotZero instruction.

End a loop if the current byte value is 0; otherwise repeat the loop.

The Count is the address of the matching JumpZero instruction.

Set the current byte value to 0.

Equivalent to the concrete Braincode loop [-].

Add the byte at the pointer to the byte at the specified offset and zero the byte at the pointer.

OffsetAddRight(5) is equivalent to the concrete Brainfuck loop [->>>>>+<<<<<].

Add the byte at the pointer to the byte at the specified offset and zero the byte at the pointer.

OffsetAddRight(5) is equivalent to the concrete Brainfuck loop [-<<<<<+>>>>>].

Finds the nearest zero to the left that appears offset by a multiple of the given Count.

FindZeroRight(3) is equivalent to the concrete Brainfuck loop [>>>].

Finds the nearest zero to the right that appears offset by a multiple of the given Count.

FindZeroLeft(3) is equivalent to the concrete Brainfuck loop [<<<].

Trait Implementations

impl Copy for Instruction
[src]

impl Clone for Instruction
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Instruction
[src]

Formats the value using the given formatter. Read more

impl Eq for Instruction
[src]

impl PartialEq for Instruction
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

impl Send for Instruction

impl Sync for Instruction