Module: YABFI
- Defined in:
- lib/yabfi.rb,
lib/yabfi/lexer.rb,
lib/yabfi/parser.rb,
lib/yabfi/unroll.rb,
lib/yabfi/encoder.rb,
lib/yabfi/version.rb,
lib/yabfi/consumer.rb
Overview
YABFI is the top level module for the gem.
Defined Under Namespace
Modules: Encoder, Parser, Unroll Classes: Consumer, Lexer, VM
Constant Summary collapse
- BaseError =
This is the base error for the gem from which the rest of the errors subclass.
Class.new(StandardError)
- VERSION =
Gem (semantic) version.
'0.1.2'
Class Method Summary collapse
-
.eval!(commands, input: $stdin, output: $stdout, eof: 0) ⇒ Object
Evaluate an IO of commands.
Class Method Details
.eval!(commands, input: $stdin, output: $stdout, eof: 0) ⇒ Object
Evaluate an IO of commands
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/yabfi.rb', line 18 def eval!(commands, input: $stdin, output: $stdout, eof: 0) io = commands.is_a?(String) ? StringIO.new(commands) : commands tokens = Parser.parse(io) lexed = Lexer.run!(tokens.to_a) commands = Unroll.unroll(lexed) encoded = Encoder.encode(commands) vm = VM.new(input, output, eof) vm.load!(encoded) vm.execute! end |