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 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 SizeTType : NamedType<"size_t">; class Macro { string Name = name; } 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 functions> { string Name = name; list Functions = functions; list Types = types; list Macros = macros; } class StandardSpec { string Name = name; list Headers; }