Class EnumerationIRHelper

java.lang.Object
org.ek9lang.compiler.phase7.helpers.AbstractIRHelper
org.ek9lang.compiler.phase7.helpers.EnumerationIRHelper

public class EnumerationIRHelper extends AbstractIRHelper
Handles IR generation for enumeration operators (16+ operators).

EK9 enumerations automatically receive extensive operator support including ordinal-based comparisons, string-enum hybrid operations, and utility operators. This demonstrates the complexity that requires stack-based context management.

Key capabilities:

  • 7 Comparison operators: <=> == <> < <= > >= (ordinal-based)
  • 7 String-hybrid operators: CardSuit.Hearts == "Hearts" (string conversion + compare)
  • 5+ Utility operators: ? $ #^ $$ #? #< #> (various functions)
  • Constructor Details

    • EnumerationIRHelper

      public EnumerationIRHelper(IRInstructionBuilder instructionBuilder)
      Create the enumeration IR helper.
  • Method Details

    • generateFor

      public void generateFor(ISymbol symbol)
      Generate IR for enumeration operators in the given symbol.