Class: SyntaxTree::YARV::AdjustStack
- Inherits:
-
Object
- Object
- SyntaxTree::YARV::AdjustStack
- Defined in:
- lib/syntax_tree/yarv/instructions.rb
Overview
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
- #call(vm) ⇒ Object
- #canonical ⇒ Object
- #disasm(fmt) ⇒ Object
-
#initialize(number) ⇒ AdjustStack
constructor
A new instance of AdjustStack.
- #length ⇒ Object
- #pops ⇒ Object
- #pushes ⇒ Object
- #to_a(_iseq) ⇒ Object
Constructor Details
#initialize(number) ⇒ AdjustStack
Returns a new instance of AdjustStack.
82 83 84 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 82 def initialize(number) @number = number end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
80 81 82 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 80 def number @number end |
Instance Method Details
#call(vm) ⇒ Object
110 111 112 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 110 def call(vm) vm.pop(number) end |
#canonical ⇒ Object
106 107 108 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 106 def canonical self end |
#disasm(fmt) ⇒ Object
86 87 88 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 86 def disasm(fmt) fmt.instruction("adjuststack", [fmt.object(number)]) end |
#length ⇒ Object
94 95 96 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 94 def length 2 end |
#pops ⇒ Object
98 99 100 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 98 def pops number end |
#pushes ⇒ Object
102 103 104 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 102 def pushes 0 end |
#to_a(_iseq) ⇒ Object
90 91 92 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 90 def to_a(_iseq) [:adjuststack, number] end |