Class: SyntaxTree::YARV::SeaOfNodes::MergeNode

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree/yarv/sea_of_nodes.rb

Overview

Merge nodes are present in any block that has multiple incoming blocks. It provides a place for Phi nodes to attach their results.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ MergeNode

Returns a new instance of MergeNode.



55
56
57
58
59
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 55

def initialize(id)
  @inputs = []
  @outputs = []
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



53
54
55
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 53

def id
  @id
end

#inputsObject (readonly)

Returns the value of attribute inputs.



53
54
55
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 53

def inputs
  @inputs
end

#outputsObject (readonly)

Returns the value of attribute outputs.



53
54
55
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 53

def outputs
  @outputs
end

Instance Method Details

#labelObject



61
62
63
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 61

def label
  "#{id} ψ"
end