Class FlowConditionOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase5.FlowConditionOrError
- All Implemented Interfaces:
Consumer<EK9Parser.ExpressionContext>
final class FlowConditionOrError
extends TypedSymbolAccess
implements Consumer<EK9Parser.ExpressionContext>
Detects conditions that are always true or always false based on data flow analysis (E08086/E08087).
Unlike the AST-level checkers (E08082-E08085) which detect structural patterns like
literal-vs-literal comparisons, this checker uses the ValueTrackingAnalyzer to
track variable values through assignments and detect tautological conditions that arise
from data flow.
Examples detected:
x <- 5; if x == 5— always true, x is known to be 5x <- 5; if x == 10— always false, x is known to be 5flag <- true; if flag— always true, flag is known to be true
Exemptions: conditions inside require, assert, and constrain
statements are not flagged (same policy as E08082).
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionFlowConditionOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener, ValueTrackingAnalyzer valueTracker) -
Method Summary
Methods inherited from class TypedSymbolAccess
getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
FlowConditionOrError
FlowConditionOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener, ValueTrackingAnalyzer valueTracker)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<EK9Parser.ExpressionContext>
-