Class: SyntaxTree::Bf::ShiftLeft

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:) ⇒ ShiftLeft

Returns a new instance of ShiftLeft.



136
137
138
# File 'lib/syntax_tree/bf/nodes.rb', line 136

def initialize(location:)
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



134
135
136
# File 'lib/syntax_tree/bf/nodes.rb', line 134

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



140
141
142
# File 'lib/syntax_tree/bf/nodes.rb', line 140

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

#child_nodesObject Also known as: deconstruct



144
145
146
# File 'lib/syntax_tree/bf/nodes.rb', line 144

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



150
151
152
# File 'lib/syntax_tree/bf/nodes.rb', line 150

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