brain 0.1.2

Compiler for the brain programming language. Compiles brain into optimized brainfuck code. Also includes a brainfuck interpreter.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! **THE MOST IMPORTANT RULE:** ALL OPERATIONS MUST RETURN TO THE CELL WHERE THEY STARTED.
//! That means that if you move right by 10, you must move left by 10 at the end of your operation
//! The extra movement instructions will be optimized away as needed
//! This constraint exists because it makes writing code generation for brainfuck sane
//! You don't have to know where the pointer currently is because you can always trust this reference
//! This constraint does not need to hold *during* an operation. Only
//! enforce it before and after. We just need a consistent reference between operations.
//! That is all.

mod errors;
mod statements;
mod declarations;
mod input;
mod output;
mod while_loop;

pub use self::errors::*;
pub use self::statements::*;