next up previous contents index
Weiter: 2.7.2 Erweiterungsaggregate Hinauf: 2.7 Getaggte Typen Zurück: 2.7 Getaggte Typen

2.7.1 Typerweiterungen

  

Die Syntax von Typerweiterungen wird anhand einiger Beispiele illustriert:

type painted_point is new point with
record
paint: color := white;
end record;
origin: constant painted_point := (xy => 0.0, paint => black);

type literal is new expression with
record
value: real;
end record;

type expr_ptr is access all expression'CLASS;

type binary_operation is new expression with
record
left, right: expr_ptr;
end record;

type addition is new binary_operation with null record;
type subtraction is new binary_operation with null record;



Johann Blieberger
Wed Feb 11 09:58:52 MET 1998