Previous | Table of Contents | Next |
A component declaration describes an interface for a component. The salient characteristics of a component declaration are
as follows:
• A component declaration specifies the name of the component.
• A component declaration may specify a list of interfaces that the component supports.
• Component declarations support single inheritance from other component definitions.
• Component declarations may include in its body any attribute declarations that are legal in normal interface declarations, together with declarations of facets and receptacles of the component, and the event sources and sinks that the component defines.
3.17.1.1 Syntax
The syntax for declaring a component is as follows:
(112) <component> ::= <component_dcl>
| <component_forward_dcl> (113)<component_forward_dcl>::= “component? <identifier>
(114) <component_dcl> ::= <component_header> “{? <component_body> “}?
<component_forward_dcl>
is described in Section 3.17.1.2, “Forward Declaration.
<component_header>
is described in Section 3.17.2, “Component Header.
<component_body>
is described in Section 3.17.3, “Component Body.
3.17.1.2 Forward Declaration
A forward declaration declares the name of a component without defining it. This permits the definition of components that
refer to each other. The syntax consists simply of the keyword component followed by an <identifier> that names the component.
The actual definition must follow later in the specification.
Multiple forward declarations of the same component name are legal.
It is illegal to inherit from a forward-declared component whose definition has not yet been seen.