Module bf::ast[][src]

Parsing and interpretation for unoptimized Brainfuck abstract syntax trees.

In bfi by default, this pass runs before run-length encoding and peephole optimization. To run the unoptimized AST directly and skip all optimization, pass --ast flag.

In this module, BF programs are represented by the Program type, which is an array of Instructions. Instructions correspond directly to Brainfuck commands, except that loops are represented as subtrees rather than with begin and end markers.

Enums

Statement

An unoptimized BF statement.

Functions

parse_program

Parses Brainfuck concrete syntax into an abstract syntax tree.

Type Definitions

Program

A BF program is represented as a slice of statements. The slice will typically be boxed.