LIDO - Reference Manual
A set of related computations can be associated with a
describing a certain computational role. It can be inherited
TREE symbols or by other
thus specifying that they play this role and reusing its computations.
A symbol can play several roles at the same time (multiple inheritance).
Inherited computations can be overridden
by other computations of attributes having the same name.
have the same notation and meaning as
Specification ::= SymbKind SymbName [ Inheritance ]
Computations 'END' ';'
Inheritance ::= 'INHERITS' SymbNames
CLASS SYMBOL RootSetLine COMPUTE
SYNT.GotLine = CONSTITUENTS KeySetLine.GotLine;
CLASS SYMBOL KeySetLine COMPUTE
SYNT.GotLine = ResetLine (THIS.Key,LINE);
CLASS SYMBOL KeyPrintLine COMPUTE
printf ("identifier in Line %d defined in line %d\n",
LINE, GetLine (THIS.Key,o))
<- INCLUDING RootSetLine.GotLine;
SYMBOL VarDefId INHERITS KeySetLine END;
SYMBOL ProcDefID INHERITS KeySetLine END;
SYMBOL UseIdent INHERITS KeyPrintLine END;
SYMBOL Program INHERITS RootSetLine END;
CLASS computations obey the same rules as symbol computation.
The sets of lower and upper class computations may be accumulated from
CLASS specifications for the same class.
CLASS computations may be inherited by
symbols or by other
CLASS or a
Target inherits the
computations from a
Source if there is a
Target INHERITS Source relation
specified. The complete inheritance relation is accumulated by all
A computation is inherited only once even if there are several paths to
it in the inheritance relation.
A computation for an attribute
a associated with a
overrides any computation for
a inherited from a
Note: Plain computations can not be overridden.
The computations inherited by a
CLASS symbol belong to
the computation sets of the
CLASS symbol and may be subject to further inheritance.
TREE symbols and
may not inherit from
The inheritance relation must not be cyclic.
C inherits from
C2, and if both
C2 have computations for an attribute
it is undefined which one is inherited by