An enumeration is typically used in programming languages to specify a limited range of states and deal with them by names instead of hard-coded values. For language interoperability purposes -- especially to support this concept on languages with no native support -- we've had to create specific rules for the integer values associated with enumerated types.
users_guide/basics/code/enum_example.sidl
Above is a sample of enumerations taken directly from our regression tests. It defines a package enumSample that contains three enumerations. C/C++ developers will find the syntax very familiar. When defining an enumeration, the actual integer values assigned can be undefined, completely defined, or partially defined.
SIDL defines the following rules for adding integer values to enumerated states that don't have a value explicitly defined.
To verify the application of these rules, the enumSample.number enumeration will have the following values assigned to its states: NotZero=2, NotOne=3, zero=0; one=1, negOne=-1, notNeg=4.