Class: WAG::Instruction::BrTable

Inherits:
Object
  • Object
show all
Includes:
WAG::Instructable
Defined in:
lib/wag/instructions/br_table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WAG::Instructable

#f32, #f64, #i32, #i64, #local, #memory

Constructor Details

#initialize(*labels) ⇒ BrTable

Returns a new instance of BrTable.



9
10
11
12
# File 'lib/wag/instructions/br_table.rb', line 9

def initialize(*labels)
  @labels = labels.map { |label| WAG::Label.from(label) }
  super()
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



7
8
9
# File 'lib/wag/instructions/br_table.rb', line 7

def label
  @label
end

Instance Method Details

#to_sexprObject



14
15
16
# File 'lib/wag/instructions/br_table.rb', line 14

def to_sexpr
  [name].concat(@labels.map(&:to_sexpr))
end