Mercurial > projects > dil
annotate trunk/src/dil/ast/Type.d @ 737:f88b5285b86b
Implemented DDocEmitter.
Fixed quite a few bugs.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sat, 09 Feb 2008 02:00:20 +0100 |
parents | 65ad2f96df1f |
children | 5e3ef1b2011c |
rev | line source |
---|---|
701
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
1 /++ |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
2 Author: Aziz Köksal |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
3 License: GPL3 |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
4 +/ |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
5 module dil.ast.Type; |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
6 |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
7 import dil.ast.Node; |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
8 import dil.semantic.Types; |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
9 |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
10 /// The base class of all type nodes. |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
11 abstract class TypeNode : Node |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
12 { |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
13 TypeNode next; |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
14 Type type; /// The semantic type of this type node. |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
15 |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
16 this() |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
17 { |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
18 this(null); |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
19 } |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
20 |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
21 this(TypeNode next) |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
22 { |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
23 super(NodeCategory.Type); |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
24 addOptChild(next); |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
25 this.next = next; |
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
26 } |
737
f88b5285b86b
Implemented DDocEmitter.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
701
diff
changeset
|
27 |
f88b5285b86b
Implemented DDocEmitter.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
701
diff
changeset
|
28 TypeNode baseType() |
f88b5285b86b
Implemented DDocEmitter.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
701
diff
changeset
|
29 { |
f88b5285b86b
Implemented DDocEmitter.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
701
diff
changeset
|
30 auto type = this; |
f88b5285b86b
Implemented DDocEmitter.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
701
diff
changeset
|
31 while (type.next) |
f88b5285b86b
Implemented DDocEmitter.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
701
diff
changeset
|
32 type = type.next; |
f88b5285b86b
Implemented DDocEmitter.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
701
diff
changeset
|
33 return type; |
f88b5285b86b
Implemented DDocEmitter.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
701
diff
changeset
|
34 } |
701
65ad2f96df1f
Moved TypeNode to new module dil.ast.Type.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
35 } |