public EnumerationDefinition MakeEnumerationDefinition(Enumeration enumeration, string name)
        {
            name = string.IsNullOrEmpty(enumeration.Name) ? name : enumeration.Name;
            var result = new EnumerationDefinition {
                Name = name
            };

            if (_context.IsKnownUnitName(name))
            {
                return(result);
            }
            _context.AddUnit(result);

            result.TypeName = TypeHelper.GetTypeName(enumeration.Type);
            result.Content  = enumeration.Comment?.BriefText;
            result.Items    = enumeration.Items
                              .Select(x =>
                                      new EnumerationItem
            {
                Name    = x.Name,
                Value   = ConvertValue(x.Value, enumeration.BuiltinType.Type).ToString(),
                Content = x.Comment?.BriefText
            })
                              .ToArray();
            return(result);
        }
        private TypeDefinition GetFieldTypeForFixedArray(ArrayType arrayType)
        {
            var fixedSize = (int)arrayType.Size;

            var elementType           = arrayType.Type;
            var elementTypeDefinition = GetTypeDefinition(elementType);

            var name = elementTypeDefinition.Name + "_array" + fixedSize;

            if (elementType.IsPointer())
            {
                name = TypeHelper.GetTypeName(elementType.GetPointee()) + "_ptrArray" + fixedSize;
            }
            if (elementType is ArrayType)
            {
                name = TypeHelper.GetTypeName(((ArrayType)elementType).Type) + "_arrayOfArray" + fixedSize;
            }

            if (!_context.IsKnownUnitName(name))
            {
                var fixedArray = new FixedArrayDefinition
                {
                    Name        = name,
                    Size        = fixedSize,
                    ElementType = elementTypeDefinition,
                    IsPrimitive = elementType.IsPrimitiveType()
                };
                _context.AddUnit(fixedArray);
            }

            return(new TypeDefinition {
                Name = name, ByReference = !arrayType.QualifiedType.Qualifiers.IsConst
            });
        }