Class: Rley::SPPF::LeafNode

Inherits:
SPPFNode show all
Defined in:
lib/rley/sppf/leaf_node.rb

Overview

Abstract class. The generalization for SPPF nodes that don't have child node.

Direct Known Subclasses

EpsilonNode, TokenNode

Instance Attribute Summary

Attributes inherited from SPPFNode

#range

Instance Method Summary collapse

Methods inherited from SPPFNode

#initialize, #origin

Constructor Details

This class inherits a constructor from Rley::SPPF::SPPFNode

Instance Method Details

#inspectString

Returns a text representation of the node.

Returns:

  • (String)

    a text representation of the node.



11
12
13
# File 'lib/rley/sppf/leaf_node.rb', line 11

def inspect
  key
end

#keyString

Returns:

  • (String)


16
17
18
# File 'lib/rley/sppf/leaf_node.rb', line 16

def key
  @key ||= to_string(0)
end