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, and in which scope a proof is safe. Were static factories on the marker (no-statics lane P2,
2026-10-29).-
Constructor Summary
ConstructorsConstructorDescriptionConstructSafeAccessMarkers(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
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.(package private) ConstructSafeAccessMarker<EK9Parser.IfControlBlockContext> Anif/else ifblock: pre-flow and control, safe in the block.(package private) ConstructSafeAccessMarker<EK9Parser.SwitchStatementExpressionContext> Aswitch: only its pre-flow, safe in the whole switch.(package private) ConstructSafeAccessMarker<EK9Parser.ExpressionContext> A ternary: its control may make the first part safe.(package private) ConstructSafeAccessMarker<EK9Parser.TryStatementExpressionContext> forTry()Atry: only its pre-flow, safe in the whole try/catch/finally.(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)
-
-
Method Details
-
forIfBlock
ConstructSafeAccessMarker<EK9Parser.IfControlBlockContext> forIfBlock()Anif/else ifblock: pre-flow and control, safe in the block. -
forSwitch
Aswitch: only its pre-flow, safe in the whole switch. -
forTry
Atry: only its pre-flow, safe in the whole try/catch/finally. -
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. -
forFor
Aforloop or for range: its pre-flow, and the control expression of aforloop only. -
forTernary
ConstructSafeAccessMarker<EK9Parser.ExpressionContext> forTernary()A ternary: its control may make the first part safe.
-