Enums

Details

class Cattle.EndOfInputAction(value)

Bases: GObject.GEnum

Possible actions to be performed by a Cattle.Interpreter when the end of input is reached.

STORE_ZERO = 0

Store a zero in the current cell. This is the default behaviour

STORE_EOF = 1

Store %CATTLE_EOF in the current cell

DO_NOTHING = 2

Do nothing.

class Cattle.Error(value)

Bases: GObject.GEnum

Errors detected either on code loading or at runtime.

classmethod quark()[source]
Return type:int
IO = 0

Generic I/O error

UNBALANCED_BRACKETS = 1

The number of open and closed brackets don’t match

INPUT_OUT_OF_RANGE = 2

The input cannot be stored in a tape cell

class Cattle.InstructionValue(value)

Bases: GObject.GEnum

Brainfuck instructions supported by Cattle, as #gunichar s.

Cattle.InstructionValue.DEBUG is not part of the Brainfuck language, but it’s often used for debugging and implemented in many interpreters, so it’s included in Cattle as well.

NONE = 120

Do nothing

DEBUG = 35

Show debugging information. This usually means dumping the contents of the tape.

INCREASE = 43

Increase the current value

READ = 44

Get one character from the input and save its value at the current position

DECREASE = 45

Decrease the current value

PRINT = 46

Send the current value to the output.

MOVE_LEFT = 60

Move the tape to the left

MOVE_RIGHT = 62

Move the tape to the right

LOOP_BEGIN = 91

Execute the loop until the current value is zero, then proceed to the next instruction

LOOP_END = 93

Exit from the currently-executing loop