Record Class StoreSite
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase5.StoreSite
- Record Components:
target- the variable, property or returning variable stored into.value- the expression whose value is stored.location- where a rule about this store is reported (the declared name, or the assignment operator).
record StoreSite(ISymbol target, EK9Parser.AssignmentExpressionContext value, IToken location)
extends Record
THE phase-5 reading of a STORE: a statement that makes a variable, property or returning variable refer to the
value an expression evaluates to. Use it wherever a rule must judge the VALUE stored rather than the slot's
DECLARED type - a store into a broader declared type (
x as IO: HTTP(), s as Server: HTTP())
erases the value's type from the slot, so a rule keyed on the slot is escaped by it.
A store is a declaration with an initialiser (<-, :=, =, :; never :~:,
which merges into a new object) or a pointer assignment (:=, =, :, :=?, as
ReferenceAssignment.repointsTarget(EK9Parser.AssignmentStatementContext) reads it) to a name or through an object access. An in-place operator
hands the value to the target's operator and stores no reference. An ARGUMENT is not a store.
Shared by R7, closeability cannot be erased by a store (E81059, CloseableErasedByStoreOrError), and the
program HTTP linkage rule (E12020-E12023, ProgramHttpWiringOrError), which had the same erasure hole.
Unlike ReferenceAssignment (locals only, for alias-following checks) a store to a property counts.
-
Constructor Summary
ConstructorsConstructorDescriptionStoreSite(ISymbol target, EK9Parser.AssignmentExpressionContext value, IToken location) Creates an instance of aStoreSiterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.location()Returns the value of thelocationrecord component.of(EK9Parser.AssignmentStatementContext ctx, SymbolsAndScopes symbolsAndScopes) The store a pointer assignment to an existing variable or property makes, if it makes one.of(EK9Parser.VariableDeclarationContext ctx, SymbolsAndScopes symbolsAndScopes) The store a declaration with an initialiser makes, if it makes one.(package private) booleanTrue when the value is just another name for an existing object (b <- a): the store copies a reference and creates nothing.target()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.valueType(SymbolsAndScopes symbolsAndScopes) The resolved type of the value stored - not the slot's declared type.
-
Constructor Details
-
StoreSite
StoreSite(ISymbol target, EK9Parser.AssignmentExpressionContext value, IToken location) Creates an instance of aStoreSiterecord class.
-
-
Method Details
-
of
static Optional<StoreSite> of(EK9Parser.VariableDeclarationContext ctx, SymbolsAndScopes symbolsAndScopes) The store a declaration with an initialiser makes, if it makes one. -
of
static Optional<StoreSite> of(EK9Parser.AssignmentStatementContext ctx, SymbolsAndScopes symbolsAndScopes) The store a pointer assignment to an existing variable or property makes, if it makes one. -
valueType
The resolved type of the value stored - not the slot's declared type. -
storesExistingReference
boolean storesExistingReference()True when the value is just another name for an existing object (b <- a): the store copies a reference and creates nothing. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
target
-
value
-
location
-