# HG changeset patch # User Aziz K?ksal # Date 1197839564 -3600 # Node ID ee22dc0ba82c0dedc5651cea47bf30c3e2afba11 # Parent a3f66502ea646aca5b400f1d4f7ff569b65301f4 Added more Type classes to dil.TypeSystem. diff -r a3f66502ea64 -r ee22dc0ba82c trunk/src/dil/TypeSystem.d --- a/trunk/src/dil/TypeSystem.d Sun Dec 16 21:24:54 2007 +0100 +++ b/trunk/src/dil/TypeSystem.d Sun Dec 16 22:12:44 2007 +0100 @@ -7,6 +7,7 @@ import dil.Symbol; import dil.TypesEnum; import dil.CompilerInfo; +import dil.Identifier; abstract class Type : Symbol { @@ -37,17 +38,30 @@ class TypeDArray : Type { - + this(Type next) + { + super(next, TYP.DArray); + } } class TypeAArray : Type { - + Type keyType; + this(Type next, Type keyType) + { + super(next, TYP.AArray); + this.keyType = keyType; + } } class TypeSArray : Type { - + size_t dimension; + this(Type next, size_t dimension) + { + super(next, TYP.SArray); + this.dimension = dimension; + } } class TypePointer : Type @@ -60,7 +74,104 @@ class TypeReference : Type { + this(Type next) + { + super(next, TYP.Reference); + } +} +class EnumType : Type +{ + this(Type baseType) + { + super(baseType, TYP.Enum); + } + + Type baseType() + { + return next; + } +} + +class StructType : Type +{ + this() + { + super(null, TYP.Struct); + } +} + +class ClassType : Type +{ + this() + { + super(null, TYP.Class); + } +} + +class TypedefType : Type +{ + this(Type next) + { + super(next, TYP.Typedef); + } +} + +class FunctionType : Type +{ + this(Type next) + { + super(next, TYP.Function); + } +} + +class DelegateType : Type +{ + this(Type next) + { + super(next, TYP.Delegate); + } +} + +class IdentifierType : Type +{ + Identifier* ident; + this(Identifier* ident) + { + super(null, TYP.Identifier); + } +} + +class TInstanceType : Type +{ + this() + { + super(null, TYP.TInstance); + } +} + +class TupleType : Type +{ + this(Type next) + { + super(next, TYP.Tuple); + } +} + +class ConstType : Type +{ + this(Type next) + { + super(next, TYP.Const); + } +} + +class InvariantType : Type +{ + this(Type next) + { + super(next, TYP.Const); + } } struct TypeMetaInfo