Class: P2::ExtensionTagNode

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) ⇒ ExtensionTagNode

Returns a new instance of ExtensionTagNode.



169
170
171
172
173
174
# File 'lib/p2/compiler/nodes.rb', line 169

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.



167
168
169
# File 'lib/p2/compiler/nodes.rb', line 167

def block
  @block
end

#call_nodeObject (readonly)

Returns the value of attribute call_node.



167
168
169
# File 'lib/p2/compiler/nodes.rb', line 167

def call_node
  @call_node
end

#locationObject (readonly)

Returns the value of attribute location.



167
168
169
# File 'lib/p2/compiler/nodes.rb', line 167

def location
  @location
end

#tagObject (readonly)

Returns the value of attribute tag.



167
168
169
# File 'lib/p2/compiler/nodes.rb', line 167

def tag
  @tag
end

Instance Method Details

#accept(visitor) ⇒ Object



176
177
178
# File 'lib/p2/compiler/nodes.rb', line 176

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