class Rubyfuu::Compiler

Constants

OPERATORS

Public Class Methods

new(readable, writable) click to toggle source
# File lib/rubyfuu/compiler.rb, line 14
def initialize(readable, writable)
  @readable = readable
  @writable = writable
end

Public Instance Methods

build(outfile) click to toggle source
# File lib/rubyfuu/compiler.rb, line 23
def build(outfile)
  link(compile, outfile)
end
compile() click to toggle source
# File lib/rubyfuu/compiler.rb, line 27
def compile
  header
  while c = @readable.getc
    c = c.chr
    if OPERATORS.has_key?(c)
      parse(c)
    end
  end
  footer
  @writable.close
  @writable.path
end
method_name(char) click to toggle source
# File lib/rubyfuu/compiler.rb, line 44
def method_name(char)
  OPERATORS[char] || char
end
parse(char) click to toggle source
# File lib/rubyfuu/compiler.rb, line 40
def parse(char)
  send method_name(char)
end
write(*params) click to toggle source
# File lib/rubyfuu/compiler.rb, line 19
def write(*params)
  @writable.write(*params)
end