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 FloatPtr : PtrType; def LongDoublePtr : PtrType; // _Noreturn is really not a type, but it is convenient to treat it as a type. def NoReturn : NamedType<"_Noreturn void">; 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; }