class Type:
def __init__(self,n,s=1,sg=0):
self.name,self.size,self.signed=n,s,sg
def __repr__(self):
return f"{['','signed '][self.signed]}{self.name}"
def P(t):return Type("".join(t.__repr__().split()[::-1])+"*",8)
c,s,i,l,f,d,v,e=Type("char"),Type("short",2),Type("int",4),Type("long",4),Type("float",4),Type("double",8),Type("void",0),Type("enum",4)
C,S,I,L,F,D=Type("char",1,1),Type("short",2,1),Type("int",4,1),Type("long",4,1),Type("float",4,1),Type("double",8,1)
def A(t,n):return Type(f"{t.__repr__()}[{n}]",t.size*n)
def F(r,*a):return Type(f"{r.__repr__()} (*)({','.join(t.__repr__() for t in a)})",8)
def K(t,n):return Type(f"struct {n}",t)
def U(t,n):return Type(f"union {n}",t)
This representation covers the essential types in the C90 language, including basic types, pointers, arrays, functions, structs, and unions. The type sizes are based on typical values, but they may vary depending on the platform.
Note that this is a simplified representation and doesn't include all the nuances and details of the C90 type system, such as qualifiers (const, volatile), bitfields, and type aliases. However, it provides a compact overview of the main types in the language.