Class: P2::BlockInvocationNode

Inherits:
Object
  • Object
show all
Defined in:
lib/p2/compiler/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(call_node, translator) ⇒ BlockInvocationNode

Returns a new instance of BlockInvocationNode.



184
185
186
187
188
189
# File 'lib/p2/compiler/nodes.rb', line 184

def initialize(call_node, translator)
  @call_node = call_node
  @tag = call_node.name
  @location = call_node.location
  @block = call_node.block && translator.visit(call_node.block)
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



182
183
184
# File 'lib/p2/compiler/nodes.rb', line 182

def block
  @block
end

#call_nodeObject (readonly)

Returns the value of attribute call_node.



182
183
184
# File 'lib/p2/compiler/nodes.rb', line 182

def call_node
  @call_node
end

#locationObject (readonly)

Returns the value of attribute location.



182
183
184
# File 'lib/p2/compiler/nodes.rb', line 182

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



191
192
193
# File 'lib/p2/compiler/nodes.rb', line 191

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