Name Analysis Reference Manual
Defining occurrences in a range are used to populate the @math{Bind(n)}
functions for the scope graph node(s) @math{n} corresponding to that range.
In the default case there is only one such node; to deal with multiple
nodes, see
Isomorphic Scope Graphs.
Only one computational role, *IdDefScope , is provided by the module
for defining occurrences.
(For a situation in which an identifier occurrence is both applied and
defining, see
Worklist search.)
The *IdDefScope role should be inherited by any defining occurrence
(see Fundamentals of Name Analysis).
It provides four attributes:
Sym
- is an integer-valued attribute specifying the identifier.
This synthesized attribute is set by a module computation to the value
derived from the identifier
(see Tree Grammar Preconditions).
*Env
- is a
NodeTuplePtr -valued attribute representing the range in which the
identifier should be bound.
This inherited attribute is set by a module computation to the value of
INCLUDING *AnyScope.*Env .
*Key
- is a
DefTableKey -valued attribute representing the entity to which the
identifier has been bound.
This attribute is set by a module computation.
A module computation sets the following properties of the value of the
*Key attribute:
Sym
- is an integer-valued property holding the value of the
Sym
attribute.
Coord
- is a
CoordPtr -valued property holding the source text coordinate
of the definition
(see Source Text Coordinates and Error Reporting of The Eli Library).
Env
- is a
NodeTuplePtr -valued property holding the value of the
*Env attribute.
GraphIndex
- is an integer-valued property holding the kind derived from the context of
the defining occurrence
(see Isomorphic Scope Graphs).
Other *Key properties can be set by developer computations.
- *GotDefKeyProp
is a void attribute representing the state that all properties of the
*Key that are needed during a search have been set.
*GotDefKeyProp should be stated as the postcondition of any
developer computations that set properties of *Key needed
by the search process (see Information access).
Accumulating computations must be used for this purpose
(see Accumulating Computations of LIDO -- Reference Manual).
|