Record Class TryBlockDetails

java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.data.TryBlockDetails

public record TryBlockDetails(String tryScopeId, List<IRInstr> tryBodyEvaluation, String tryBodyResult) extends Record
Record representing the try block within a TRY_CATCH_FINALLY control flow chain.

Contains the try block scope and body evaluation instructions. Resources (if any) are managed through the guard variable mechanism in ControlFlowChainDetails.

The try block represents the primary execution path that may throw exceptions. If an exception is thrown, control transfers to the appropriate catch handler (if any), followed by the finally block (if present).

  • Constructor Details

    • TryBlockDetails

      public TryBlockDetails(String tryScopeId, List<IRInstr> tryBodyEvaluation, String tryBodyResult)
      Creates an instance of a TryBlockDetails record class.
      Parameters:
      tryScopeId - the value for the tryScopeId record component
      tryBodyEvaluation - the value for the tryBodyEvaluation record component
      tryBodyResult - the value for the tryBodyResult record component
  • Method Details

    • toString

      @Nonnull public String toString()
      IR-optimized toString following EK9's bracket-only, no-indentation format.
      Specified by:
      toString in class Record
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • tryScopeId

      public String tryScopeId()
      Returns the value of the tryScopeId record component.
      Returns:
      the value of the tryScopeId record component
    • tryBodyEvaluation

      public List<IRInstr> tryBodyEvaluation()
      Returns the value of the tryBodyEvaluation record component.
      Returns:
      the value of the tryBodyEvaluation record component
    • tryBodyResult

      public String tryBodyResult()
      Returns the value of the tryBodyResult record component.
      Returns:
      the value of the tryBodyResult record component