Class: SyntaxTree::YARV::SeaOfNodes::InsnNode
- Inherits:
-
Object
- Object
- SyntaxTree::YARV::SeaOfNodes::InsnNode
- Defined in:
- lib/syntax_tree/yarv/sea_of_nodes.rb
Overview
This object represents a node in the graph that holds a YARV instruction.
Instance Attribute Summary collapse
-
#inputs ⇒ Object
readonly
Returns the value of attribute inputs.
-
#insn ⇒ Object
readonly
Returns the value of attribute insn.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#outputs ⇒ Object
readonly
Returns the value of attribute outputs.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(insn, offset) ⇒ InsnNode
constructor
A new instance of InsnNode.
- #label ⇒ Object
Constructor Details
#initialize(insn, offset) ⇒ InsnNode
Returns a new instance of InsnNode.
17 18 19 20 21 22 23 |
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 17 def initialize(insn, offset) @inputs = [] @outputs = [] @insn = insn @offset = offset end |
Instance Attribute Details
#inputs ⇒ Object (readonly)
Returns the value of attribute inputs.
15 16 17 |
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 15 def inputs @inputs end |
#insn ⇒ Object (readonly)
Returns the value of attribute insn.
15 16 17 |
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 15 def insn @insn end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
15 16 17 |
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 15 def offset @offset end |
#outputs ⇒ Object (readonly)
Returns the value of attribute outputs.
15 16 17 |
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 15 def outputs @outputs end |
Instance Method Details
#id ⇒ Object
25 26 27 |
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 25 def id offset end |
#label ⇒ Object
29 30 31 |
# File 'lib/syntax_tree/yarv/sea_of_nodes.rb', line 29 def label "%04d %s" % [offset, insn.disasm(Disassembler::Squished.new)] end |