annotate trunk/src/Types.d @ 94:0fe650a7a8d1

- Renamed Type enum to InfoType in module Information. - Changed 'TOK type' member of TypeDotIdExpression to 'Type type'. - Added module Types. - Implemented most of parseBasicType(). - Indented code of 'BasicType . Identifier' parser and creating Type instance.
author aziz
date Fri, 06 Jul 2007 15:23:04 +0000
parents
children 0eb4c8a5b32b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
94
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
1 /++
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
2 Author: Aziz Köksal
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
3 License: GPL2
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
4 +/
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
5 module Types;
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
6 import Token;
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
7 import Expressions;
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
8
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
9 class Type
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
10 {
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
11 TOK type;
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
12 this(TOK type)
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
13 {
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
14 this.type = type;
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
15 }
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
16 }
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
17
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
18 class IdentifierType : Type
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
19 {
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
20 string[] idents;
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
21
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
22 this(string[] idents)
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
23 {
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
24 super(TOK.Identifier);
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
25 this.idents = idents;
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
26 }
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
27
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
28 this(TOK type)
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
29 {
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
30 super(type);
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
31 }
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
32
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
33 void opCatAssign(string ident)
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
34 {
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
35 this.idents ~= ident;
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
36 }
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
37 }
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
38
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
39 class TypeofType : IdentifierType
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
40 {
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
41 Expression e;
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
42 this(Expression e)
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
43 {
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
44 super(TOK.Typeof);
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
45 this.e = e;
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
46 }
0fe650a7a8d1 - Renamed Type enum to InfoType in module Information.
aziz
parents:
diff changeset
47 }