Class: Logicality::Parser::Ast::ValueOperandNode

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

Overview

A value operand node is a node with no children but holds a value instead.

Instance Attribute Summary collapse

Attributes inherited from Node

#name, #token

Instance Method Summary collapse

Methods inherited from Node

#to_s

Constructor Details

#initialize(token) ⇒ ValueOperandNode

Returns a new instance of ValueOperandNode.



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

def initialize(token)
  super(token)

  @name  = 'value_operand_node'
  @value = token.value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end