Class GetGuardVariable
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase5.GetGuardVariable
- All Implemented Interfaces:
Function<EK9Parser.PreFlowStatementContext, List<ISymbol>>
final class GetGuardVariable
extends TypedSymbolAccess
implements Function<EK9Parser.PreFlowStatementContext, List<ISymbol>>
Extracts the EXISTING variable a pre-flow assigns: the target of a blind assignment (
v := e()) or an
assign-if-unset (v :=? e()). A pre-flow runs exactly once, before the body, whether or not the body is
then skipped - so a variable it initialises is initialised after the construct too. A declaration
(v <- e()) is not returned: its variable belongs to the construct.
:=? always initialises its target where it runs - it stores its right-hand side when the target is
unset or absent, and a target it keeps is already initialised - so a target that starts uninitialised is
initialised after the construct (Steve, 2026-10-07, Q5).
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionGetGuardVariable(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Methods inherited from class TypedSymbolAccess
emitTypeNotResolvedError, getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
GetGuardVariable
GetGuardVariable(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<EK9Parser.PreFlowStatementContext, List<ISymbol>>
-