Record Class LeafField

java.lang.Object
java.lang.Record
org.ek9lang.compiler.support.inputvariety.LeafField
Record Components:
ownerTypeFullyQualifiedName - the record type declaring the field (the value on the stack)
fieldName - the field to read
fieldTypeFullyQualifiedName - the field's declared type (the value left on the stack)

public record LeafField(String ownerTypeFullyQualifiedName, String fieldName, String fieldTypeFullyQualifiedName) extends Record
One field step in a LeafPath โ€” everything a backend needs to load that field from the value on the stack, with no further symbol lookup.

A record is transparent (ยง4.5), so the input-variation numerator reads a record parameter's fields rather than treating the record as one opaque value. The step carries exactly what a LOAD_FIELD instruction needs โ€” owner, field, field type โ€” because the decomposition is emitted as ordinary LOAD_FIELD IR rather than anything probe-specific. That keeps record support entirely in the shared IR: every backend already implements field loads, so none of them needs to learn about records for this feature.

  • Constructor Details

    • LeafField

      public LeafField(String ownerTypeFullyQualifiedName, String fieldName, String fieldTypeFullyQualifiedName)
      Creates an instance of a LeafField record class.
      Parameters:
      ownerTypeFullyQualifiedName - the value for the ownerTypeFullyQualifiedName record component
      fieldName - the value for the fieldName record component
      fieldTypeFullyQualifiedName - the value for the fieldTypeFullyQualifiedName record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
    • ownerTypeFullyQualifiedName

      public String ownerTypeFullyQualifiedName()
      Returns the value of the ownerTypeFullyQualifiedName record component.
      Returns:
      the value of the ownerTypeFullyQualifiedName record component
    • fieldName

      public String fieldName()
      Returns the value of the fieldName record component.
      Returns:
      the value of the fieldName record component
    • fieldTypeFullyQualifiedName

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