collect_def Production

Definition

collect_def : declspec_list struct identifier { decl_list } ;
            | declspec_list union identifier { decl_list } ;
            | declspec_list exception identifier { decl_list } ;

Purpose

A collect_def defines a collection. This statement is slightly more complicated in the case of the exception definition, since exceptions cannot be declared (doing so creates an exception with no metadata)

Semantics

Exactly one struct or union collect_def may coexist with exactly one uninitialized collect_decl of the same name that declares the same class of collection. Exceptions may be declared with or without a body. Exceptions without a body are exceptions that have no metadata, and cannot coexist with another exception declaration of the same name.

The declarations inside a collection may only include functions, variables, and types (including other collections).