class Type {} class NamedType : Type { string Name = name; } class Field { string Name = name; Type FieldType = type; } // Class to describe concrete structs specified by a standard. class Struct : NamedType { list Fields; } class EnumNameValue { string Name = name; string Value = value; } class Enum enumerations> : NamedType { list Enumerations = enumerations; } class PtrType : Type { Type PointeeType = type; } class ConstType : Type { Type UnqualifiedType = type; } class RestrictedPtrType : Type { Type PointeeType = type; } // Builtin types. def VarArgType : Type {} def VoidType : NamedType<"void">; def IntType : NamedType<"int">; def FloatType : NamedType<"float">; def DoubleType : NamedType<"double">; def LongDoubleType : NamedType<"long double">; def CharType : NamedType<"char">; // Common types def VoidPtr : PtrType; def ConstVoidPtr : ConstType; def SizeTType : NamedType<"size_t">; def LongDoublePtr : PtrType; // _Noreturn is really not a type, but it is convenient to treat it as a type. def NoReturn : NamedType<"_Noreturn void">; //types moved from stdc.td def VoidRestrictedPtr : RestrictedPtrType; def ConstVoidRestrictedPtr : ConstType; def CharPtr : PtrType; def ConstCharPtr : ConstType; def CharRestrictedPtr : RestrictedPtrType; def ConstCharRestrictedPtr : ConstType; def OnceFlagType : NamedType<"once_flag">; def OnceFlagTypePtr : PtrType; // TODO(sivachandra): Remove this non-standard type when a formal // way to describe callable types is available. def CallOnceFuncType : NamedType<"__call_once_func_t">; def MtxTType : NamedType<"mtx_t">; def MtxTTypePtr : PtrType; def ThrdStartTType : NamedType<"thrd_start_t">; def ThrdTType : NamedType<"thrd_t">; def ThrdTTypePtr : PtrType; def IntPtr : PtrType; def FloatPtr : PtrType; def DoublePtr : PtrType; def SigHandlerT : NamedType<"__sighandler_t">; def TimeTType : NamedType<"time_t">; //added because __assert_fail needs it. def UnsignedType : NamedType<"unsigned">; class Macro { string Name = name; } class EnumeratedNameValue { string Name = name; string Value = value; } class Annotation {} class RetValSpec annotations = []> { Type ReturnType = type; list Annotations = annotations; } class ArgSpec annotations = [], string name = ""> { Type ArgType = type; list Annotations = annotations; string Name = name; } class FunctionSpec args> { string Name = name; RetValSpec Return = return; list Args = args; } class HeaderSpec macros = [], list types = [], list enumerations = [], list functions = []> { string Name = name; list Functions = functions; list Types = types; list Macros = macros; list Enumerations = enumerations; } class StandardSpec { string Name = name; list Headers; }