Class QuestionOperatorAsmGenerator


final class QuestionOperatorAsmGenerator extends AbstractControlFlowAsmGenerator
Specialized generator for EK9 question operator (?). Handles CONTROL_FLOW_CHAIN with chain_type: "QUESTION_OPERATOR".

EK9 Question Operator Pattern: operand?

  • If operand is null → returns Boolean(false)
  • If operand is not null → returns operand._isSet()

Stack Frame Invariant: All paths arrive at 'end' label with empty stack. Result is stored in local variable (overall_result).

  • Constructor Details

    • QuestionOperatorAsmGenerator

      QuestionOperatorAsmGenerator(ConstructTargetTuple constructTargetTuple, OutputVisitor outputVisitor, org.objectweb.asm.ClassWriter classWriter)
  • Method Details

    • generate

      public void generate(ControlFlowChainInstr instr)
      Generate bytecode for question operator.

      Stack Frame Invariant: Pre-condition: stack is empty Post-condition: stack is empty (result in local variable)

      Parameters:
      instr - CONTROL_FLOW_CHAIN instruction with QUESTION_OPERATOR type