Class ConstructSafeAccessMarkers
java.lang.Object
org.ek9lang.compiler.phase5.ConstructSafeAccessMarkers
THE maker of the E08030 construct markers (
ConstructSafeAccessMarker), one per construct that can prove an
Optional / Result / Iterator access safe: forIfBlock(), forSwitch(), forTry(),
forWhile(), forFor() and forTernary(). Each says where its construct keeps its pre-flow and its
control expression, in which scope a proof is safe, and THE last part of what the construct evaluates before its
body first runs (the end of its condition: a proof made from the condition is judged by looking ahead to there,
ConstructSafeAccessMarker.conditionEndOf). Were static factories on the marker (no-statics lane P2,
2026-10-29); the condition's end was a separate per-construct table until 2026-11-10 (D99 review).-
Constructor Summary
ConstructorsConstructorDescriptionConstructSafeAccessMarkers(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener, ContainerChangedBetween containerChangedBetween) -
Method Summary
Modifier and TypeMethodDescription(package private) ConstructSafeAccessMarker<EK9Parser.ForStatementExpressionContext> forFor()Aforloop or for range: its pre-flow, and the control expression of aforloop only; the condition is the whole loop header.(package private) ConstructSafeAccessMarker<EK9Parser.IfControlBlockContext> Anif/else ifblock: pre-flow and control, safe in the block; the condition is both.(package private) ConstructSafeAccessMarker<EK9Parser.SwitchStatementExpressionContext> Aswitch: only its pre-flow, safe in the whole switch; the condition is the pre-flow and control.(package private) ConstructSafeAccessMarker<EK9Parser.ExpressionContext> A ternary: its control may make the first part safe; the condition is the control.(package private) ConstructSafeAccessMarker<EK9Parser.TryStatementExpressionContext> forTry()Atry: only its pre-flow, safe in the whole try/catch/finally; the condition is the pre-flow.(package private) ConstructSafeAccessMarker<EK9Parser.WhileStatementExpressionContext> forWhile()Awhileordo/while: its pre-flow, and its control only on awhile- the body of ado/whileruns BEFORE its trailing condition.
-
Constructor Details
-
ConstructSafeAccessMarkers
ConstructSafeAccessMarkers(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener, ContainerChangedBetween containerChangedBetween)
-
-
Method Details
-
forIfBlock
ConstructSafeAccessMarker<EK9Parser.IfControlBlockContext> forIfBlock()Anif/else ifblock: pre-flow and control, safe in the block; the condition is both. -
forSwitch
Aswitch: only its pre-flow, safe in the whole switch; the condition is the pre-flow and control. -
forTry
Atry: only its pre-flow, safe in the whole try/catch/finally; the condition is the pre-flow. -
forWhile
Awhileordo/while: its pre-flow, and its control only on awhile- the body of ado/whileruns BEFORE its trailing condition. The discriminator isDO(), neverWHILE(): BOTH grammar alternatives contain a WHILE token (WHILE control ...andDO ... WHILE control), so ANTLR emits ONE scalar WHILE() accessor on the merged context andctx.WHILE() != nullis a TAUTOLOGY. It never excluded the do/while it says it excludes, so the trailing condition marked the symbol safe over a scope that encloses the body that had already run:do o.get() while o?compiled clean and threw at runtime. Only the do/while alternative carries DO. The condition before the body is the control of awhile(its guard comes before it) and only the guard of ado/while. -
forFor
Aforloop or for range: its pre-flow, and the control expression of aforloop only; the condition is the whole loop header. -
forTernary
ConstructSafeAccessMarker<EK9Parser.ExpressionContext> forTernary()A ternary: its control may make the first part safe; the condition is the control.
-