Class: P2::BuiltinNode
- Inherits:
-
Object
- Object
- P2::BuiltinNode
- Defined in:
- lib/p2/compiler/nodes.rb
Overview
Represents a builtin call
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#call_node ⇒ Object
readonly
Returns the value of attribute call_node.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(call_node, translator) ⇒ BuiltinNode
constructor
A new instance of BuiltinNode.
Constructor Details
#initialize(call_node, translator) ⇒ BuiltinNode
Returns a new instance of BuiltinNode.
154 155 156 157 158 159 |
# File 'lib/p2/compiler/nodes.rb', line 154 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
#block ⇒ Object (readonly)
Returns the value of attribute block.
152 153 154 |
# File 'lib/p2/compiler/nodes.rb', line 152 def block @block end |
#call_node ⇒ Object (readonly)
Returns the value of attribute call_node.
152 153 154 |
# File 'lib/p2/compiler/nodes.rb', line 152 def call_node @call_node end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
152 153 154 |
# File 'lib/p2/compiler/nodes.rb', line 152 def location @location end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
152 153 154 |
# File 'lib/p2/compiler/nodes.rb', line 152 def tag @tag end |
Instance Method Details
#accept(visitor) ⇒ Object
161 162 163 |
# File 'lib/p2/compiler/nodes.rb', line 161 def accept(visitor) visitor.visit_builtin_node(self) end |