Class: Logicality::Parser::Ast::UnaryOperatorNode

Inherits:
Node
  • Object
show all
Defined in:
lib/logicality/parser/ast/unary_operator_node.rb

Overview

A unary operator node has just one child node.

Instance Attribute Summary collapse

Attributes inherited from Node

#name, #token

Instance Method Summary collapse

Methods inherited from Node

#to_s

Constructor Details

#initialize(child, token) ⇒ UnaryOperatorNode

Returns a new instance of UnaryOperatorNode.



17
18
19
20
21
22
# File 'lib/logicality/parser/ast/unary_operator_node.rb', line 17

def initialize(child, token)
  super(token)

  @name   = 'unary_operator_node'
  @child  = child
end

Instance Attribute Details

#childObject (readonly)

Returns the value of attribute child.



15
16
17
# File 'lib/logicality/parser/ast/unary_operator_node.rb', line 15

def child
  @child
end