94
|
1 /++
|
|
2 Author: Aziz Köksal
|
|
3 License: GPL2
|
|
4 +/
|
|
5 module Types;
|
|
6 import Token;
|
|
7 import Expressions;
|
|
8
|
|
9 class Type
|
|
10 {
|
|
11 TOK type;
|
|
12 this(TOK type)
|
|
13 {
|
|
14 this.type = type;
|
|
15 }
|
|
16 }
|
|
17
|
|
18 class IdentifierType : Type
|
|
19 {
|
|
20 string[] idents;
|
|
21
|
|
22 this(string[] idents)
|
|
23 {
|
|
24 super(TOK.Identifier);
|
|
25 this.idents = idents;
|
|
26 }
|
|
27
|
|
28 this(TOK type)
|
|
29 {
|
|
30 super(type);
|
|
31 }
|
|
32
|
|
33 void opCatAssign(string ident)
|
|
34 {
|
|
35 this.idents ~= ident;
|
|
36 }
|
|
37 }
|
|
38
|
|
39 class TypeofType : IdentifierType
|
|
40 {
|
|
41 Expression e;
|
|
42 this(Expression e)
|
|
43 {
|
|
44 super(TOK.Typeof);
|
|
45 this.e = e;
|
|
46 }
|
|
47 }
|