Class LiteralInstr

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

public final class LiteralInstr extends IRInstr
IR instruction for loading literal/constant values. Handles string literals, numeric literals, boolean literals, etc. Uses symbol-driven approach to get correct type information.
  • Method Details

    • literal

      public static LiteralInstr literal(String result, String literalValue, String literalType, DebugInfo debugInfo)
      Create instruction to load any literal value.
      Parameters:
      result - Variable to store the literal value
      literalValue - The literal value as string
      literalType - The resolved type name (could be decorated)
      debugInfo - Debug information for source mapping (can be null)
      Returns:
      LiteralInstruction for loading the literal
    • literal

      public static LiteralInstr literal(String result, String literalValue, String literalType)
    • getLiteralValue

      public String getLiteralValue()
      Get the literal value.
    • getLiteralType

      public String getLiteralType()
      Get the literal type (could be decorated for generic contexts).