Class: Strling::Core::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/strling/core/nodes.rb

Overview

Base class for all AST nodes.

Direct Known Subclasses

Alt, Anchor, Backref, CharClass, Dot, Esc, Group, Lit, Look, Quant, Seq

Instance Method Summary collapse

Instance Method Details

#to_dictHash

Serialize the node to hash representation.

Returns:

  • (Hash)

    Hash representation of the node

Raises:

  • (NotImplementedError)

    Must be implemented by subclasses



97
98
99
# File 'lib/strling/core/nodes.rb', line 97

def to_dict
  raise NotImplementedError, 'Subclasses must implement to_dict'
end