Module: Brainfucktt

Defined in:
lib/brainfucktt.rb,
lib/brainfucktt/byte.rb,
lib/brainfucktt/data.rb,
lib/brainfucktt/node.rb,
lib/brainfucktt/repl.rb,
lib/brainfucktt/errors.rb,
lib/brainfucktt/parser.rb,
lib/brainfucktt/language.rb,
lib/brainfucktt/language/loop.rb,
lib/brainfucktt/language/tree.rb,
lib/brainfucktt/conversion_helpers.rb,
lib/brainfucktt/language/input_byte.rb,
lib/brainfucktt/language/output_byte.rb,
lib/brainfucktt/language/decrement_byte.rb,
lib/brainfucktt/language/increment_byte.rb,
lib/brainfucktt/language/decrement_pointer.rb,
lib/brainfucktt/language/increment_pointer.rb

Overview

A Brainfuck interpreter built in Ruby using Treetop.

Defined Under Namespace

Modules: ConversionHelpers, Language Classes: Byte, Data, Error, InvalidByteError, InvalidOffsetError, InvalidOptionsError, Node, Parser, ParserError, REPL

Class Method Summary collapse

Class Method Details

.parse(code) ⇒ Brainfucktt::Parser

Parse the given Brainfuck code.

Parameters:

  • code (String, #to_s)

Returns:

Raises:



17
18
19
# File 'lib/brainfucktt.rb', line 17

def parse(code)
  Parser.parse(code)
end

.run(code = nil, options = {}) ⇒ Object

Parse and run the given Brainfuck code.

Parameters:

  • code (String, #to_s) (defaults to: nil)
  • options (Hash, #to_hash, #to_h) (defaults to: {})


25
26
27
# File 'lib/brainfucktt.rb', line 25

def run(code=nil, options={})
  Parser.run(code, options)
end