Class: SyntaxTree::Bf::ShiftRight

Inherits:
Node
  • Object
show all
Defined in:
lib/syntax_tree/bf/nodes.rb

Overview

>

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(location:) ⇒ ShiftRight

Returns a new instance of ShiftRight.



113
114
115
# File 'lib/syntax_tree/bf/nodes.rb', line 113

def initialize(location:)
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



111
112
113
# File 'lib/syntax_tree/bf/nodes.rb', line 111

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



117
118
119
# File 'lib/syntax_tree/bf/nodes.rb', line 117

def accept(visitor)
  visitor.visit_shift_right(self)
end

#child_nodesObject Also known as: deconstruct



121
122
123
# File 'lib/syntax_tree/bf/nodes.rb', line 121

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



127
128
129
# File 'lib/syntax_tree/bf/nodes.rb', line 127

def deconstruct_keys(keys)
  { value: ">", location: location }
end