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.
-
Field Summary
Fields inherited from class AbstractGenerator
debugInfoCreator, instructionBuilder, MAX_MESSAGE_LENGTH, stackContext, typeNameOrException -
Constructor Summary
ConstructorsConstructorDescriptionStreamStatementGenerator(IRGenerationContext stackContext, GeneratorSet generators) -
Method Summary
Methods inherited from class AbstractGenerator
addCoverageProbe, createTempVariable, createTempVariableFromContext, extractReturnType, getRecordedSymbolOrException, processBlockStatements, processBlockStatements, truncateMessage, truncateMessage, validateNoPreFlowStatement, validateStatementFormOnly
-
Constructor Details
-
StreamStatementGenerator
StreamStatementGenerator(IRGenerationContext stackContext, GeneratorSet generators)
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<EK9Parser.StreamStatementContext, List<IRInstr>>
-