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 : NamedType<"...">; def VoidType : NamedType<"void">; def IntType : NamedType<"int">; def UnsignedIntType : NamedType<"unsigned int">; def LongType : NamedType<"long">; def UnsignedLongType : NamedType<"unsigned long">; def LongLongType : NamedType<"long long">; def UnsignedLongLongType : NamedType<"unsigned long long">; def FloatType : NamedType<"float">; def DoubleType : NamedType<"double">; def LongDoubleType : NamedType<"long double">; def CharType : NamedType<"char">; // Common types def VoidPtr : PtrType; def VoidPtrPtr : PtrType; def RestrictedVoidPtrPtr : RestrictedPtrType; def ConstVoidPtr : ConstType; def SizeTType : NamedType<"size_t">; def SizeTPtr : PtrType; def RestrictedSizeTPtr : RestrictedPtrType; def WCharType : NamedType<"wchar_t">; def WIntType : NamedType<"wint_t">; def LongDoublePtr : PtrType; def IntMaxTType : NamedType<"intmax_t">; def UIntMaxTType : NamedType<"uintmax_t">; def UInt16Type : NamedType<"uint16_t">; def UInt32Type : NamedType<"uint32_t">; def OffTType : NamedType<"off_t">; def OffTPtr : PtrType; def SSizeTType : NamedType<"ssize_t">; // _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 CharRestrictedPtrPtr : RestrictedPtrType; def ConstCharRestrictedPtr : ConstType; def ConstCharRestrictedPtrPtr : PtrType; 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 CndTType : NamedType<"cnd_t">; def CndTTypePtr : PtrType; def ThrdStartTType : NamedType<"thrd_start_t">; def ThrdTType : NamedType<"thrd_t">; def ThrdTTypePtr : PtrType; def IntPtr : PtrType; def RestrictedIntPtr : RestrictedPtrType; def FloatPtr : PtrType; def DoublePtr : PtrType; def SigHandlerT : NamedType<"__sighandler_t">; def TimeTType : NamedType<"time_t">; def BSearchCompareT : NamedType<"__bsearchcompare_t">; def QSortCompareT : NamedType<"__qsortcompare_t">; def AtexitHandlerT : NamedType<"__atexithandler_t">; def FILE : NamedType<"FILE">; def FILEPtr : PtrType; def FILERestrictedPtr : RestrictedPtrType; def PThreadTType : NamedType<"pthread_t">; def PidT : NamedType<"pid_t">; def RestrictedPidTPtr : RestrictedPtrType; def StructRUsage : NamedType<"struct rusage">; def StructRUsagePtr : PtrType; def StructTimevalType : NamedType<"struct timeval">; def StructTimevalPtr : PtrType; def RestrictedStructTimevalPtr : RestrictedPtrType; def SuSecondsT : NamedType<"suseconds_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 ObjectSpec { string Name = name; string Type = type; } class HeaderSpec macros = [], list types = [], list enumerations = [], list functions = [], list objects = []> { string Name = name; list Functions = functions; list Types = types; list Macros = macros; list Enumerations = enumerations; list Objects = objects; } class StandardSpec { string Name = name; list Headers; }