Class: Strling::Core::IROp

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

Overview

Base class for all IR operations.

All IR nodes extend this base class and must implement the to_dict() method for serialization to a hash representation.

Instance Method Summary collapse

Instance Method Details

#to_dictHash

Serialize the IR node to a hash representation.

Returns:

  • (Hash)

    The hash representation of this IR node.

Raises:

  • (NotImplementedError)

    If not implemented by subclass.



30
31
32
# File 'lib/strling/core/ir.rb', line 30

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