Mercurial > projects > dil
comparison trunk/src/dil/semantic/Types.d @ 796:f7688996bf08
Added member symbol to class Type.
Fixed html_map.d to IE6.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Fri, 29 Feb 2008 19:25:21 +0100 |
parents | 8e252b7c1459 |
children | c24be8d4f6ab |
comparison
equal
deleted
inserted
replaced
795:069317bb84cf | 796:f7688996bf08 |
---|---|
9 import dil.lexer.Identifier; | 9 import dil.lexer.Identifier; |
10 import dil.CompilerInfo; | 10 import dil.CompilerInfo; |
11 | 11 |
12 abstract class Type/* : Symbol*/ | 12 abstract class Type/* : Symbol*/ |
13 { | 13 { |
14 Type next; | 14 Type next; /// The next type in the type structure. |
15 TYP tid; /// The ID of the type. | 15 TYP tid; /// The ID of the type. |
16 Symbol symbol; /// Not null if this type has a symbol. | |
16 | 17 |
17 this(){} | 18 this(){} |
18 | 19 |
19 this(Type next, TYP tid) | 20 this(Type next, TYP tid) |
20 { | 21 { |
38 /// Size is not in MITable. Find out via virtual method. | 39 /// Size is not in MITable. Find out via virtual method. |
39 size_t sizeOf_() | 40 size_t sizeOf_() |
40 { | 41 { |
41 return sizeOf(); | 42 return sizeOf(); |
42 } | 43 } |
44 | |
45 bool hasSymbol() | |
46 { | |
47 return symbol !is null; | |
48 } | |
43 } | 49 } |
44 | 50 |
45 class TypeBasic : Type | 51 class TypeBasic : Type |
46 { | 52 { |
47 this(TYP typ) | 53 this(TYP typ) |
97 } | 103 } |
98 } | 104 } |
99 | 105 |
100 class TypeEnum : Type | 106 class TypeEnum : Type |
101 { | 107 { |
102 Symbol enumSymbol; | 108 this(Symbol symbol, Type baseType) |
103 this(Symbol enumSymbol, Type baseType) | |
104 { | 109 { |
105 super(baseType, TYP.Enum); | 110 super(baseType, TYP.Enum); |
106 this.enumSymbol = enumSymbol; | 111 this.symbol = symbol; |
107 } | 112 } |
108 | 113 |
109 Type baseType() | 114 Type baseType() |
110 { | 115 { |
111 return next; | 116 return next; |
112 } | 117 } |
113 } | 118 } |
114 | 119 |
115 class TypeStruct : Type | 120 class TypeStruct : Type |
116 { | 121 { |
117 this() | 122 this(Symbol symbol) |
118 { | 123 { |
119 super(null, TYP.Struct); | 124 super(null, TYP.Struct); |
125 this.symbol = symbol; | |
120 } | 126 } |
121 } | 127 } |
122 | 128 |
123 class TypeClass : Type | 129 class TypeClass : Type |
124 { | 130 { |
125 this() | 131 this(Symbol symbol) |
126 { | 132 { |
127 super(null, TYP.Class); | 133 super(null, TYP.Class); |
134 this.symbol = symbol; | |
128 } | 135 } |
129 } | 136 } |
130 | 137 |
131 class TypeTypedef : Type | 138 class TypeTypedef : Type |
132 { | 139 { |