Class SafeSymbolAccess
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase5.SafeSymbolAccess
- Direct Known Subclasses:
ContainerUnwrapObligations, ObjectAccessExpressionValidOrError, SafeAccessRepointOrError
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final SafeGenericAccessMarkerprotected final SafeGenericAccessPredicateFields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionSafeSymbolAccess(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisAccessUnSafe(ISymbol calledFromSymbol, String methodName, org.antlr.v4.runtime.tree.ParseTree accessSite) True when the access needs a check that neither the enclosing scope nor an earlierandconjunct of the expression ataccessSiteprovides (SafeAccessConjuncts.isProvenEarlier(ParseTree, ISymbol, CommonValues)).protected booleanrequiresSafeAccess(ISymbol calledFromSymbol, String methodName) WhethermethodNameoncalledFromSymbolis a container-unwrap that needs a preceding safety check (Optional.get,Result.ok/error,Iterator.nexton a symbol the marker has flagged) — i.e.Methods inherited from class TypedSymbolAccess
emitTypeNotResolvedError, getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Field Details
-
safeGenericAccessMarker
-
safeGenericAccessPredicate
-
-
Constructor Details
-
SafeSymbolAccess
SafeSymbolAccess(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
isAccessUnSafe
protected boolean isAccessUnSafe(ISymbol calledFromSymbol, String methodName, org.antlr.v4.runtime.tree.ParseTree accessSite) True when the access needs a check that neither the enclosing scope nor an earlierandconjunct of the expression ataccessSiteprovides (SafeAccessConjuncts.isProvenEarlier(ParseTree, ISymbol, CommonValues)). -
requiresSafeAccess
WhethermethodNameoncalledFromSymbolis a container-unwrap that needs a preceding safety check (Optional.get,Result.ok/error,Iterator.nexton a symbol the marker has flagged) — i.e. an unwrap obligation exists here, independent of whether it is discharged.isAccessUnSafe(ISymbol, String, ParseTree)then answers whether that obligation is undischarged (unguarded). Split out so the obligation census can count the obligation and read its discharge from the same source of truth theE08030checker uses.
-