class SyntaxTree::YARV::Assembler

Constants

CALLDATA_FLAGS
DEFINED_TYPES

Attributes

lines[R]

Public Class Methods

assemble(source) click to toggle source
# File lib/syntax_tree/yarv/assembler.rb, line 78
def self.assemble(source)
  new(source.lines(chomp: true)).assemble
end
assemble_file(filepath) click to toggle source
# File lib/syntax_tree/yarv/assembler.rb, line 82
def self.assemble_file(filepath)
  new(File.readlines(filepath, chomp: true)).assemble
end
new(lines) click to toggle source
# File lib/syntax_tree/yarv/assembler.rb, line 66
def initialize(lines)
  @lines = lines
end

Public Instance Methods

assemble() click to toggle source
# File lib/syntax_tree/yarv/assembler.rb, line 70
def assemble
  iseq = InstructionSequence.new("<main>", "<compiled>", 1, :top)
  assemble_iseq(iseq, lines)

  iseq.compile!
  iseq
end