Association of properties to definitions
Objects in an input text are often classified to belong to one
of several kinds, e.g. variables, procedures or labels in programming
languages. They may occur in different contexts which determine their kind,
require that they belong to a certain kind, or select different computations
depending on their kind.
Such a classification is often the part of the type analysis task.
This module can be used for any unique classification of objects
which is encoded by integral values.
If Objects may belong to more than one kind, or occurrences allow
for objects of several kinds the module
(see Associate Sets of Kinds to Objects) should be used instead of this one.
The module is instantiated by
$/Prop/Kind.gnrc+instance=NAME +referto=KEY :inst
This module associates a property named
NAMEKind of type
to objects. Two computational roles
In a context
property of the object is set to the value of the attribute
NAMESetKind.NAMEKind, which has to be provided by a user's computation.
In case that different
Kind values are stated for one object
NAMESetKind contexts the property value 0 named
IntMultiple is associated.
In a context
NAMEGetKind the property is accessed and supplied by
It can be used to check if it is the required kind, or
if the kind is ambigously set (
if the kind is not set at all (value -1 named (
NAMEGetKind may be associated
to the same grammar symbol. That is necessary if kinds are determined
by applications of objects rather than by definitions, or if a
language does not distinguish between defining and applied occurrences.
NAMERangeKind is automatically associated to the
grammar root (see Common Aspects of Property Modules).
NAMEKind property is accessed in other user's computations,
those have to state
NAMERangeKind.GotNAMEKind as precondition.
IntNone are defined in a file
KindBad.h. If their encoding is inconvenient for a particular
implementation, that file may be overridden by a user supplied file
having the name