Esempio n. 1
0
 public EnumValue(uint value, string name, LanguageDocumentation documentation, DeprecatedInfo deprecatedInfo)
 {
     DeclaringType = null !;
     Value         = value;
     RawName       = name;
     if (deprecatedInfo.IsDeprecated && deprecatedInfo.NewName is null && !documentation.HasDefaultComment)
     {
         Documentation = new("Don't use it!");
     }
Esempio n. 2
0
 public EnumType(string name, TypeId typeId, LanguageDocumentation documentation, EnumValue[] values, EnumTypeFlags flags)
 {
     toEnumValue   = new Dictionary <string, EnumValue>(values.Length, StringComparer.Ordinal);
     IsPublic      = (flags & EnumTypeFlags.Public) != 0;
     IsFlags       = (flags & EnumTypeFlags.Flags) != 0;
     TypeId        = typeId;
     RawName       = name;
     Documentation = documentation;
     this.values   = values;
     initialized   = (flags & EnumTypeFlags.NoInitialize) == 0;
     Initialize(values);
 }
Esempio n. 3
0
 public Constant(ConstantKind kind, string name, ulong value, ConstantsTypeFlags flags, LanguageDocumentation documentation, DeprecatedInfo deprecatedInfo)
 {
     DeclaringType  = null !;
     Kind           = kind;
     RawName        = name;
     Documentation  = documentation;
     DeprecatedInfo = deprecatedInfo;
     ValueUInt64    = value;
     RefValue       = null;
     IsPublic       = (flags & ConstantsTypeFlags.Public) != 0;
     UseHex         = (flags & ConstantsTypeFlags.Hex) != 0;
 }
Esempio n. 4
0
        public ConstantsType(string name, TypeId typeId, ConstantsTypeFlags flags, LanguageDocumentation documentation, Constant[] constants)
        {
            toConstant    = new Dictionary <string, Constant>(StringComparer.Ordinal);
            TypeId        = typeId;
            RawName       = name;
            Documentation = documentation;
            IsPublic      = (flags & ConstantsTypeFlags.Public) != 0;
            Constants     = constants;

            foreach (var constant in constants)
            {
                constant.DeclaringType = this;
                toConstant.Add(constant.RawName, constant);
            }
        }
Esempio n. 5
0
 public Constant(ConstantKind kind, string name, object value, ConstantsTypeFlags flags, LanguageDocumentation documentation, DeprecatedInfo deprecatedInfo)
 {
     if (value is not null && value.GetType().IsValueType)
     {
         throw new ArgumentException();
     }
     DeclaringType  = null !;
     Kind           = kind;
     RawName        = name;
     Documentation  = documentation;
     DeprecatedInfo = deprecatedInfo;
     ValueUInt64    = 0;
     RefValue       = value;
     IsPublic       = (flags & ConstantsTypeFlags.Public) != 0;
     UseHex         = (flags & ConstantsTypeFlags.Hex) != 0;
 }
Esempio n. 6
0
 public EnumType(TypeId typeId, LanguageDocumentation documentation, EnumValue[] values, EnumTypeFlags flags)
     : this(typeId.ToString(), typeId, documentation, values, flags)
 {
 }
Esempio n. 7
0
 public EnumValue(uint value, string name, LanguageDocumentation documentation)
     : this(value, name, documentation, default)
 {
 }
Esempio n. 8
0
 public ConstantsType(TypeId typeId, ConstantsTypeFlags flags, LanguageDocumentation documentation, Constant[] constants)
     : this(typeId.ToString(), typeId, flags, documentation, constants)
 {
 }