Class LogicalTautologyOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase5.LogicalTautologyOrError
- All Implemented Interfaces:
Consumer<EK9Parser.ExpressionContext>
final class LogicalTautologyOrError
extends TypedSymbolAccess
implements Consumer<EK9Parser.ExpressionContext>
Detects logical tautologies and contradictions (E08085).
Expressions like a or not a are always true (tautology) and
a and not a are always false (contradiction). These indicate
logic errors or dead code.
Only the direct pattern X op not X (and reversed not X op X)
is detected. General propositional logic simplification is not attempted.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionLogicalTautologyOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Methods inherited from class TypedSymbolAccess
getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
LogicalTautologyOrError
LogicalTautologyOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<EK9Parser.ExpressionContext>
-