Record Class IRStackFrame
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase7.generation.IRStackFrame
- Record Components:
scopeId- The unique identifier for this scopedebugInfo- Debug information for this scope (could be null if debug disabled)frameType- The type of frame (method, function, block, etc.)contextData- Additional context data specific to this frame type
public record IRStackFrame(String scopeId, DebugInfo debugInfo, IRFrameType frameType, Object contextData)
extends Record
Represents a single frame on the IR generation stack.
Each frame captures the essential context information needed for IR generation at a specific scope level (method, function, block, expression, etc.).
This eliminates the need for parameter threading by providing all contextual information through the stack frame.
-
Constructor Summary
ConstructorsConstructorDescriptionIRStackFrame(String scopeId, DebugInfo debugInfo, IRFrameType frameType, Object contextData) Creates an instance of aIRStackFramerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic IRStackFramebasic(String scopeId, DebugInfo debugInfo, IRFrameType frameType) Create a basic frame with just scope and debug info.Returns the value of thecontextDatarecord component.Returns the value of thedebugInforecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theframeTyperecord component.<T> TgetContextData(Class<T> expectedType) Get typed context data if available and of expected type.final inthashCode()Returns a hash code value for this object.scopeId()Returns the value of thescopeIdrecord component.final StringtoString()Returns a string representation of this record class.static IRStackFramewithContext(String scopeId, DebugInfo debugInfo, IRFrameType frameType, Object contextData) Create a frame with additional context data.
-
Constructor Details
-
IRStackFrame
Creates an instance of aIRStackFramerecord class.- Parameters:
scopeId- the value for thescopeIdrecord componentdebugInfo- the value for thedebugInforecord componentframeType- the value for theframeTyperecord componentcontextData- the value for thecontextDatarecord component
-
-
Method Details
-
basic
Create a basic frame with just scope and debug info. -
withContext
public static IRStackFrame withContext(String scopeId, DebugInfo debugInfo, IRFrameType frameType, Object contextData) Create a frame with additional context data. -
getContextData
Get typed context data if available and of expected type. -
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
scopeId
-
debugInfo
-
frameType
-
contextData
Returns the value of thecontextDatarecord component.- Returns:
- the value of the
contextDatarecord component
-