Class StreamStatementGenerator

java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.StreamStatementGenerator
All Implemented Interfaces:
Function<EK9Parser.StreamStatementContext, List<IRInstr>>

public final class StreamStatementGenerator extends AbstractGenerator implements Function<EK9Parser.StreamStatementContext, List<IRInstr>>
Generates IR for stream statement pipelines: source | stages | > terminal.

Handles the statement form of stream pipelines where items flow from a source (cat or for) through zero or more pipeline stages to a terminal sink.

For cat sources, follows the same 4-scope structure as ForInGenerator:

  • Outer scope (source evaluation + iterator + terminal setup)
  • Pipeline scope (pipeline item variable)
  • Condition scope (hasNext check, per-iteration)
  • Body scope (next + stages + terminal pipe, per-iteration)

For for sources, uses RangeIterationHelper to generate ForRangePolymorphicInstr where the body is _pipe(loopVar) to the terminal, reusing the same polymorphic range iteration as for-range loops.