Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6- 90
89 Enumeration Clause
constant-name
is the name of a constant in the open DDL dictionary. The constant value must
be a valid
display-string
value.
LN clause
specifies the locale associated with a value.
DDL ignores the AS clause when generating host-language source code.
Enumeration Clause Guidelines
The following points are guidelines for using the enumeration clause:
•
A single-field definition that has one or more level 89 clauses must also have
BEGIN before the first period and END after the last clause.
•
One or more level 89 clauses can follow the definition attribute clauses in a field
definition or description. Level 89 clauses cannot directly follow a group definition
or description.
•
For C, the level 89 enumeration clauses for a field of type ENUM are translated
into literals included in a C enumeration type. If the type of a single-field definition
is ENUM, DDL generates a
typedef
enum
. If the type of a field in a group
definition is ENUM, DDL generates an
enum
embedded in a
typedef
:
enum
{
value-name1 = enumeration-value1,
value-name2 = enumeration-value2,
...
};
typedef short def-name_def;
If the type of a field in a group definition is ENUM, DDL generates a separate
enumeration outside a
typedef
struct
:
enum
{
value-name1 = enumeration-value1,
value-name2 = enumeration-value2,
...
};
typedef struct __group-name
{
char first-element;
short enumeration-element
} group-name_def;
Because the C compiler is case sensitive, DDL generates all lowercase letters for
C source code.