Class: SyntaxTree::YARV::SeaOfNodes::PhiNode

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

Overview

Phi nodes are used to represent the merging of data flow from multiple incoming blocks.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ PhiNode

Returns a new instance of PhiNode.



39
40
41
42
43
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 39

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



37
38
39
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 37

def id
  @id
end

#inputsObject (readonly)

Returns the value of attribute inputs.



37
38
39
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 37

def inputs
  @inputs
end

#outputsObject (readonly)

Returns the value of attribute outputs.



37
38
39
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 37

def outputs
  @outputs
end

Instance Method Details

#labelObject



45
46
47
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 45

def label
  "#{id} φ"
end