Class TrackedValues
java.lang.Object
org.ek9lang.compiler.phase5.flow.TrackedValues
THE answer to "what value does this expression hold here?" for the phase-5 flow checks: a written literal
first, else what the
ValueTrackingAnalyzer tracks for the expression's symbol.
There are deliberately TWO flavours, and each call site names the one it means:
trackedValueOf(EK9Parser.ExpressionContext)- the tracked value exactly as it is, whatever it is; TOP when nothing is tracked. For conditions, case values, the obligation census and divisors: the value is only ever handed toAbstractValue.evaluateCondition(String, AbstractValue), which answers UNKNOWN for anything it cannot decide.knownValueOf(EK9Parser.ExpressionContext)- the tracked value only when it is known, else TOP. For copy propagation (x <- y,:^:), where a value that is not known must not be copied onward as if it were.
integerOf(EK9Parser.ExpressionContext) is the integer both flavours would give, or null. Never write the literal-then-symbol
idiom again in a checker - ask here (F29, 2026-10-20: it was seven private copies).
-
Constructor Summary
ConstructorsConstructorDescriptionTrackedValues(SymbolsAndScopes symbolsAndScopes, ValueTrackingAnalyzer valueTracker, LiteralExtractor literalExtractor) Reads values with the given literal extractor and value tracker. -
Method Summary
Modifier and TypeMethodDescriptionThe integer the expression is known to hold - a literal, else a tracked integer constant - or null.The value of the expression: its literal, else its symbol's tracked value but only if that is known, else TOP.knownValueOf(ISymbol symbol) The symbol's tracked value but only if that is known, else TOP - the symbol half ofknownValueOf(EK9Parser.ExpressionContext), for a name that is not an expression (abystep identifier).The value of the expression: its literal, else its symbol's tracked value as it is, else TOP.
-
Constructor Details
-
TrackedValues
public TrackedValues(SymbolsAndScopes symbolsAndScopes, ValueTrackingAnalyzer valueTracker, LiteralExtractor literalExtractor) Reads values with the given literal extractor and value tracker.
-
-
Method Details
-
trackedValueOf
The value of the expression: its literal, else its symbol's tracked value as it is, else TOP. -
knownValueOf
The value of the expression: its literal, else its symbol's tracked value but only if that is known, else TOP. -
knownValueOf
The symbol's tracked value but only if that is known, else TOP - the symbol half ofknownValueOf(EK9Parser.ExpressionContext), for a name that is not an expression (abystep identifier). -
integerOf
The integer the expression is known to hold - a literal, else a tracked integer constant - or null.
-