Package org.ek9lang.compiler.phase5
Class ObjectAccessExpressionValidOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase5.ObjectAccessExpressionValidOrError
- All Implemented Interfaces:
Consumer<EK9Parser.ObjectAccessExpressionContext>
final class ObjectAccessExpressionValidOrError
extends TypedSymbolAccess
implements Consumer<EK9Parser.ObjectAccessExpressionContext>
In the case of specific variables of type like 'Result' and 'Optional' it is important to check
if the method being called needs a previous call to isOk or isError or just '?' before accessing
specific methods.
This is a bit gnarly - because the method chaining calls are recursive by nature and also this
needs to check that any returning type might be a Result or Optional and then also test if the methods
that are being called are ones that need safe access calls before being called.
i.e. Result.ok(), Result.error(), Optional.get(). Other methods can just be called but those require a
safety check call of isOk()/'?', isError() or '?' (for Optional).
-
Field Summary
Fields inherited from class org.ek9lang.compiler.common.RuleSupport
errorListener, symbolsAndScopes
-
Constructor Summary
ConstructorDescriptionObjectAccessExpressionValidOrError
(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) Constructor to provided typed access. -
Method Summary
Methods inherited from class org.ek9lang.compiler.common.TypedSymbolAccess
getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
ObjectAccessExpressionValidOrError
ObjectAccessExpressionValidOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) Constructor to provided typed access.
-
-
Method Details
-
accept
- Specified by:
accept
in interfaceConsumer<EK9Parser.ObjectAccessExpressionContext>
-