Mercurial > projects > dil
annotate trunk/src/dil/semantic/Symbols.d @ 688:839c0c61af2b
Renamed some semantic types.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Tue, 22 Jan 2008 14:37:46 +0100 |
parents | 1ae72234db26 |
children | efa5fcb9aa14 |
rev | line source |
---|---|
517 | 1 /++ |
2 Author: Aziz Köksal | |
3 License: GPL3 | |
4 +/ | |
590
641041912670
Moved dil.Symbols to dil.semantic.Symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
589
diff
changeset
|
5 module dil.semantic.Symbols; |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
6 |
589
de365ddcfbd4
Moved dil.Symbol to dil.semantic.Symbol.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
584
diff
changeset
|
7 import dil.semantic.Symbol; |
591
26addda6365b
Moved dil.SymbolTable to dil.semantic.SymbolTable.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
590
diff
changeset
|
8 import dil.semantic.SymbolTable; |
600
041eae272362
Moved dil.Identifier to dil.lexer.Identifier.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
591
diff
changeset
|
9 import dil.semantic.Types; |
580
fa6d3c52757d
Moved SyntaxTree.d to new package 'ast'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
573
diff
changeset
|
10 import dil.ast.Node; |
600
041eae272362
Moved dil.Identifier to dil.lexer.Identifier.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
591
diff
changeset
|
11 import dil.lexer.Identifier; |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
12 import dil.Enums; |
517 | 13 import common; |
14 | |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
15 /// A symbol that has its own scope with a symbol table. |
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
16 class ScopeSymbol : Symbol |
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
17 { |
614 | 18 SymbolTable symbolTable; /// The symbol table. |
19 Symbol[] members; /// The member symbols (in lexical order.) | |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
20 |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
21 this(SYM sid, Identifier* name, Node node) |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
22 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
23 super(sid, name, node); |
562
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
24 } |
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
25 |
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
26 /// Look up ident in the table. |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
27 Symbol lookup(Identifier* name) |
562
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
28 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
29 return symbolTable.lookup(name); |
562
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
30 } |
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
31 |
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
32 /// Insert a symbol into the table. |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
33 void insert(Symbol s, Identifier* name) |
562
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
34 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
35 symbolTable.insert(s, name); |
614 | 36 members ~= s; |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
37 } |
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
38 } |
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
39 |
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
40 /// Aggregates have function and field members. |
615
a05457530ac2
Added member ident to class Symbol.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
614
diff
changeset
|
41 abstract class Aggregate : ScopeSymbol |
517 | 42 { |
43 Function[] funcs; | |
44 Variable[] fields; | |
562
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
45 |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
46 this(SYM sid, Identifier* name, Node node) |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
47 { |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
48 super(sid, name, node); |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
49 } |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
50 |
562
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
51 override void insert(Symbol s, Identifier* ident) |
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
52 { |
567
ab9f5020cd02
Added 'is-methods' to class Symbol.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
565
diff
changeset
|
53 if (s.isVariable) |
562
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
54 // Append variable to fields. |
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
55 fields ~= cast(Variable)cast(void*)s; |
567
ab9f5020cd02
Added 'is-methods' to class Symbol.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
565
diff
changeset
|
56 else if (s.isFunction) |
562
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
57 // Append function to funcs. |
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
58 funcs ~= cast(Function)cast(void*)s; |
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
59 super.insert(s, ident); |
b0533550d64c
Added semantic() to VariableDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
561
diff
changeset
|
60 } |
517 | 61 } |
62 | |
63 class Class : Aggregate | |
64 { | |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
65 this(Identifier* name, Node classNode) |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
66 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
67 super(SYM.Class, name, classNode); |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
68 } |
517 | 69 } |
70 | |
561
302e50e71ec2
Added Interface symbol.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
560
diff
changeset
|
71 class Interface : Aggregate |
302e50e71ec2
Added Interface symbol.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
560
diff
changeset
|
72 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
73 this(Identifier* name, Node interfaceNode) |
561
302e50e71ec2
Added Interface symbol.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
560
diff
changeset
|
74 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
75 super(SYM.Interface, name, interfaceNode); |
561
302e50e71ec2
Added Interface symbol.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
560
diff
changeset
|
76 } |
302e50e71ec2
Added Interface symbol.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
560
diff
changeset
|
77 } |
302e50e71ec2
Added Interface symbol.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
560
diff
changeset
|
78 |
517 | 79 class Union : Aggregate |
80 { | |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
81 this(Identifier* name, Node unionNode) |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
82 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
83 super(SYM.Union, name, unionNode); |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
84 } |
517 | 85 } |
86 | |
87 class Struct : Aggregate | |
88 { | |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
89 this(Identifier* name, Node structNode) |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
90 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
91 super(SYM.Struct, name, structNode); |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
92 } |
517 | 93 } |
94 | |
614 | 95 class Enum : ScopeSymbol |
96 { | |
688
839c0c61af2b
Renamed some semantic types.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
683
diff
changeset
|
97 TypeEnum type; |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
98 this(Identifier* name, Node enumNode) |
614 | 99 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
100 super(SYM.Enum, name, enumNode); |
614 | 101 } |
617
0749f30ef2d0
Added member 'EnumType type' to class Enum.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
615
diff
changeset
|
102 |
688
839c0c61af2b
Renamed some semantic types.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
683
diff
changeset
|
103 void setType(TypeEnum type) |
617
0749f30ef2d0
Added member 'EnumType type' to class Enum.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
615
diff
changeset
|
104 { |
0749f30ef2d0
Added member 'EnumType type' to class Enum.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
615
diff
changeset
|
105 this.type = type; |
0749f30ef2d0
Added member 'EnumType type' to class Enum.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
615
diff
changeset
|
106 } |
614 | 107 } |
108 | |
623
e2cd28cfc6ae
Added dil.semantic.Template.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
617
diff
changeset
|
109 class Template : ScopeSymbol |
e2cd28cfc6ae
Added dil.semantic.Template.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
617
diff
changeset
|
110 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
111 this(Identifier* name, Node templateNode) |
623
e2cd28cfc6ae
Added dil.semantic.Template.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
617
diff
changeset
|
112 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
113 super(SYM.Template, name, templateNode); |
623
e2cd28cfc6ae
Added dil.semantic.Template.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
617
diff
changeset
|
114 } |
e2cd28cfc6ae
Added dil.semantic.Template.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
617
diff
changeset
|
115 } |
e2cd28cfc6ae
Added dil.semantic.Template.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
617
diff
changeset
|
116 |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
117 class Function : ScopeSymbol |
517 | 118 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
119 Protection prot; /// The protection. |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
120 StorageClass stc; /// The storage classes. |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
121 LinkageType linkType; /// The linkage type. |
517 | 122 |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
123 Type returnType; |
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
124 Variable[] params; |
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
125 |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
126 this(Identifier* name, Node functionNode) |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
127 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
128 super(SYM.Function, name, functionNode); |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
129 } |
517 | 130 } |
131 | |
132 class Variable : Symbol | |
133 { | |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
134 Protection prot; /// The protection. |
615
a05457530ac2
Added member ident to class Symbol.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
614
diff
changeset
|
135 StorageClass stc; /// The storage classes. |
a05457530ac2
Added member ident to class Symbol.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
614
diff
changeset
|
136 LinkageType linkType; /// The linkage type. |
517 | 137 |
615
a05457530ac2
Added member ident to class Symbol.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
614
diff
changeset
|
138 Type type; /// The type of this variable. |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
139 |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
140 this(Identifier* name, |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
141 Protection prot, StorageClass stc, LinkageType linkType, |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
142 Node variableNode) |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
143 { |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
144 super(SYM.Variable, name, variableNode); |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
145 |
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
146 this.stc = stc; |
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
147 this.linkType = linkType; |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
148 } |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
149 } |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
150 |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
151 class Alias : Symbol |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
152 { |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
153 this(Identifier* name, Node aliasNode) |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
154 { |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
155 super(SYM.Alias, name, aliasNode); |
560
709e223a8eb9
Added code related to symbols.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
517
diff
changeset
|
156 } |
517 | 157 } |
683
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
158 |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
159 /++ |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
160 A list of symbols that share the same identifier. |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
161 These can be functions, templates and aggregates with template parameter lists. |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
162 +/ |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
163 class OverloadSet : Symbol |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
164 { |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
165 Symbol[] symbols; |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
166 |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
167 this(Identifier* name, Node node) |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
168 { |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
169 super(SYM.OverloadSet, name, node); |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
170 } |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
171 |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
172 void add(Symbol s) |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
173 { |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
174 symbols ~= s; |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
175 } |
1ae72234db26
Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
623
diff
changeset
|
176 } |