Class IsSetGenerator

java.lang.Object
org.ek9lang.compiler.phase7.synthesis.AbstractSyntheticGenerator
org.ek9lang.compiler.phase7.synthesis.IsSetGenerator

final class IsSetGenerator extends AbstractSyntheticGenerator
Generates synthetic IR for the _isSet (?) operator.

The generated code follows this pattern:

Boolean _isSet():
  // For each field in properties:
  //   result = this.field._isSet()
  //   if !result._true() -> return false

  return true  // All fields are set

Key semantic requirements:

  • Returns true only if ALL fields are set
  • Returns false if ANY field is unset (short-circuit)
  • No parameter checking needed (no "other" parameter)
  • Super's _isSet is not called - each class handles its own fields
  • Constructor Details

  • Method Details

    • generate

      List<IRInstr> generate(MethodSymbol methodSymbol, AggregateSymbol aggregateSymbol)
      Generate the _isSet operator IR for the given aggregate.
      Parameters:
      methodSymbol - The _isSet method symbol
      aggregateSymbol - The aggregate containing the method
      Returns:
      List of IR instructions implementing the method