Class: SyntaxTree::Bf::Input

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

Returns a new instance of Input.



159
160
161
# File 'lib/syntax_tree/bf/nodes.rb', line 159

def initialize(location:)
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



157
158
159
# File 'lib/syntax_tree/bf/nodes.rb', line 157

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



163
164
165
# File 'lib/syntax_tree/bf/nodes.rb', line 163

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

#child_nodesObject Also known as: deconstruct



167
168
169
# File 'lib/syntax_tree/bf/nodes.rb', line 167

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



173
174
175
# File 'lib/syntax_tree/bf/nodes.rb', line 173

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