Class Field

java.lang.Object
org.ek9lang.compiler.ir.Field
All Implemented Interfaces:
INode

public final class Field extends Object implements INode
Represents a field/property declaration in an EK9 construct (class, record, component, etc.). Note that this also include 'capture' variables in dynamic classes and dynamic functions.

Fields are structural declarations that define the data members of a construct, separate from the behavioral operations (methods). They map directly to: - JVM: Field declarations in .class files - LLVM: Member declarations in struct types

Unlike REFERENCE instructions which declare runtime variable storage, Field IR represents compile-time structural metadata about the construct's layout.

  • Constructor Details

    • Field

      public Field(ISymbol symbol, String name, String typeName, DebugInfo debugInfo)
      Create a new Field IR node.
      Parameters:
      symbol - The VariableSymbol representing this property field
      name - The field name (e.g., "aField")
      typeName - The fully qualified type name (e.g., "org.ek9.lang::String")
      debugInfo - Source location information
  • Method Details

    • getSymbol

      public ISymbol getSymbol()
      Get the symbol representing this field.
      Returns:
      The underlying VariableSymbol
    • getName

      public String getName()
      Get the field name.
      Returns:
      The field name (e.g., "aField")
    • getTypeName

      public String getTypeName()
      Get the fully qualified type name.
      Returns:
      The type name (e.g., "org.ek9.lang::String")
    • getDebugInfo

      public DebugInfo getDebugInfo()
      Get debug information for this field.
      Returns:
      Debug info containing source location, or null if not available
    • accept

      public void accept(INodeVisitor visitor)
      Specified by:
      accept in interface INode
    • toString

      public String toString()
      Overrides:
      toString in class Object