2005/5/9

     
 

CfgScript Enum Type

artefaktur

| Any Type | Basic Types | Object Types | Array Types | Enum Type | Props Type |

An enum is a collection of integer types.



Enumeration
: 'enum' TypeName '{' (EnumValues)+ '}'
;

EnumValues
: EnumVal [ ',' EnumValues ]
;

EnumVal
: Identifier [ '='  Expression ]
;

Sample:

enum MyEnumValues
{
  FirstValue, // == 0
  SecondValue, // == 1
  ThirdValue = 10,
  NextValue, // == 11
  LastValue = NextValue + ThirdValue 
}