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.)hasLeftHandSide- Whether this scope has a left-hand side for result variablescontextData- Additional context data specific to this frame type
public record IRStackFrame(String scopeId, DebugInfo debugInfo, IRFrameType frameType, boolean hasLeftHandSide, 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, boolean hasLeftHandSide, 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.static IRStackFramefull(String scopeId, DebugInfo debugInfo, IRFrameType frameType, boolean hasLeftHandSide, Object contextData) Create a full frame with all parameters.<T> TgetContextData(Class<T> expectedType) Get typed context data if available and of expected type.booleanhasContextData(Class<?> expectedType) Check if this frame has context data of the specified type.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasLeftHandSiderecord component.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.static IRStackFramewithLeftHandSide(String scopeId, DebugInfo debugInfo, IRFrameType frameType, boolean hasLeftHandSide) Create a frame with left-hand side indication.
-
Constructor Details
-
IRStackFrame
public IRStackFrame(String scopeId, DebugInfo debugInfo, IRFrameType frameType, boolean hasLeftHandSide, Object contextData) Creates an instance of aIRStackFramerecord class.- Parameters:
scopeId- the value for thescopeIdrecord componentdebugInfo- the value for thedebugInforecord componentframeType- the value for theframeTyperecord componenthasLeftHandSide- the value for thehasLeftHandSiderecord componentcontextData- the value for thecontextDatarecord component
-
-
Method Details
-
basic
Create a basic frame with just scope and debug info. -
withLeftHandSide
public static IRStackFrame withLeftHandSide(String scopeId, DebugInfo debugInfo, IRFrameType frameType, boolean hasLeftHandSide) Create a frame with left-hand side indication. -
withContext
public static IRStackFrame withContext(String scopeId, DebugInfo debugInfo, IRFrameType frameType, Object contextData) Create a frame with additional context data. -
full
public static IRStackFrame full(String scopeId, DebugInfo debugInfo, IRFrameType frameType, boolean hasLeftHandSide, Object contextData) Create a full frame with all parameters. -
getContextData
Get typed context data if available and of expected type. -
hasContextData
Check if this frame has context data of the specified 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
scopeId
-
debugInfo
-
frameType
-
hasLeftHandSide
public boolean hasLeftHandSide()Returns the value of thehasLeftHandSiderecord component.- Returns:
- the value of the
hasLeftHandSiderecord component
-
contextData
Returns the value of thecontextDatarecord component.- Returns:
- the value of the
contextDatarecord component
-