Class IfStatementOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase3.IfStatementOrError
- All Implemented Interfaces:
Consumer<EK9Parser.IfStatementContext>
final class IfStatementOrError
extends TypedSymbolAccess
implements Consumer<EK9Parser.IfStatementContext>
Checks the IfStatement is valid or emits errors.
Every 'if'/'else if' needs a condition: a control, or a guard pre-flow ('<-', ':=?') whose isSet
check is the condition (PreFlowCanSkipBody, THE rule for what a guard is). A blind assignment
(':=', '=', ':', '+=', ...) or a typed declaration checks nothing, so without 'with <condition>' there
is nothing to decide on - the same E07340 a 'switch' gives when its pre-flow cannot be its subject.
It once reached IR generation and crashed the compiler.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionIfStatementOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Methods inherited from class TypedSymbolAccess
emitTypeNotResolvedError, getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
IfStatementOrError
IfStatementOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<EK9Parser.IfStatementContext>
-