Class: Brainfuck::Stage::BfCode
- Inherits:
-
Rubinius::Compiler::Stage
- Object
- Rubinius::Compiler::Stage
- Brainfuck::Stage::BfCode
- Defined in:
- lib/brainfuck/stages.rb
Overview
This stage takes python code and produces a ruby array containing representation of the python source. We are currently using python’s own parser, so we just read the sexp as its printed by bin/astpretty.py
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#print ⇒ Object
Returns the value of attribute print.
Instance Method Summary collapse
-
#initialize(compiler, last) ⇒ BfCode
constructor
A new instance of BfCode.
- #input(code, filename = "eval", line = 1) ⇒ Object
- #run ⇒ Object
Constructor Details
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
118 119 120 |
# File 'lib/brainfuck/stages.rb', line 118 def filename @filename end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
118 119 120 |
# File 'lib/brainfuck/stages.rb', line 118 def line @line end |
#print ⇒ Object
Returns the value of attribute print.
119 120 121 |
# File 'lib/brainfuck/stages.rb', line 119 def print @print end |
Instance Method Details
#input(code, filename = "eval", line = 1) ⇒ Object
127 128 129 130 131 |
# File 'lib/brainfuck/stages.rb', line 127 def input(code, filename = "eval", line = 1) @code = code @filename = filename @line = line end |