Record Class CallableInfo

java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase5.callgraph.CallableInfo
Record Components:
fullyQualifiedName - Unique identifier for the callable (e.g., "module::Class._method")
symbol - The underlying EK9 symbol (function, method, etc.)
sourceToken - Source location for error reporting
moduleName - Module containing this callable
isPure - True if callable is marked as pure
isProgram - True if this is a program entry point
isTestEntry - True if this has @Test directive
containsAssertion - True if this callable directly contains assert/assertThrows/assertDoesNotThrow

public record CallableInfo(String fullyQualifiedName, ISymbol symbol, IToken sourceToken, String moduleName, boolean isPure, boolean isProgram, boolean isTestEntry, boolean containsAssertion) extends Record
Metadata about a callable entity (function, method, operator, constructor, program). Used by the call graph for reachability analysis and validation.

This record captures properties needed for various call graph analyses:

  • Entry point detection: isProgram, isTestEntry
  • Assertion reachability: containsAssertion
  • Purity analysis: isPure
  • Module boundaries: moduleName
  • Constructor Details

    • CallableInfo

      public CallableInfo(String fullyQualifiedName, ISymbol symbol, IToken sourceToken, String moduleName, boolean isPure, boolean isProgram, boolean isTestEntry, boolean containsAssertion)
      Create CallableInfo with validation.
  • Method Details

    • isEntryPoint

      public boolean isEntryPoint()
      Check if this callable is any kind of entry point (program or @Test).
    • getSourceFile

      public String getSourceFile()
      Get the source file name.
    • getLine

      public int getLine()
      Get the line number of the callable definition.
    • formatLocation

      public String formatLocation()
      Format the source location for error messages.
      Returns:
      Location string in format "filename:line"
    • builder

      public static CallableInfo.Builder builder()
      Create a builder for fluent construction of CallableInfo.
    • toString

      public 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • fullyQualifiedName

      public String fullyQualifiedName()
      Returns the value of the fullyQualifiedName record component.
      Returns:
      the value of the fullyQualifiedName record component
    • symbol

      public ISymbol symbol()
      Returns the value of the symbol record component.
      Returns:
      the value of the symbol record component
    • sourceToken

      public IToken sourceToken()
      Returns the value of the sourceToken record component.
      Returns:
      the value of the sourceToken record component
    • moduleName

      public String moduleName()
      Returns the value of the moduleName record component.
      Returns:
      the value of the moduleName record component
    • isPure

      public boolean isPure()
      Returns the value of the isPure record component.
      Returns:
      the value of the isPure record component
    • isProgram

      public boolean isProgram()
      Returns the value of the isProgram record component.
      Returns:
      the value of the isProgram record component
    • isTestEntry

      public boolean isTestEntry()
      Returns the value of the isTestEntry record component.
      Returns:
      the value of the isTestEntry record component
    • containsAssertion

      public boolean containsAssertion()
      Returns the value of the containsAssertion record component.
      Returns:
      the value of the containsAssertion record component