annotate trunk/src/dil/semantic/Pass1.d @ 690:eaf6444b6284

Adding pragma(msg,...) declarations to deferred list.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Tue, 22 Jan 2008 15:40:27 +0100
parents e8c09d13f2a5
children d33895f679eb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
635
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
1 /++
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
2 Author: Aziz Köksal
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
3 License: GPL3
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
4 +/
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
5 module dil.semantic.Pass1;
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
6
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
7 import dil.ast.Visitor;
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
8 import dil.ast.Node,
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
9 dil.ast.Declarations,
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
10 dil.ast.Expressions,
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
11 dil.ast.Statements,
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
12 dil.ast.Types,
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
13 dil.ast.Parameters;
690
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
14 import dil.lexer.IdTable;
635
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
15 import dil.semantic.Symbol,
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
16 dil.semantic.Symbols,
645
89ee7802c978 Moved semantic() methods of expressions to class SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 644
diff changeset
17 dil.semantic.Types,
644
a0643a4d4501 Added some methods to SemanticPass1 class.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 641
diff changeset
18 dil.semantic.Scope,
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
19 dil.semantic.Module,
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
20 dil.semantic.Analysis;
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
21 import dil.Location;
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
22 import dil.Information;
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
23 import dil.Messages;
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
24 import dil.Enums;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
25 import dil.CompilerInfo;
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
26 import common;
635
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
27
686
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
28 /++
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
29 The fist pass is the declaration pass.
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
30 The basic task of this class is to traverse the parse tree,
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
31 find all kinds of declarations and add them
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
32 to the symbol tables of their respective scopes.
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
33 +/
635
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
34 class SemanticPass1 : Visitor
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
35 {
649
3ebe76ad680e Using SemanticPass1 in main.d do start semantic analysis.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 648
diff changeset
36 Scope scop; /// The current scope.
3ebe76ad680e Using SemanticPass1 in main.d do start semantic analysis.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 648
diff changeset
37 Module modul; /// The module to be semantically checked.
644
a0643a4d4501 Added some methods to SemanticPass1 class.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 641
diff changeset
38
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
39 // Attributes:
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
40 LinkageType linkageType;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
41 Protection protection;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
42 StorageClass storageClass;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
43 uint alignSize = DEFAULT_ALIGN_SIZE;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
44
686
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
45 /++
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
46 Construct a SemanticPass1 object.
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
47 Params:
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
48 modul = the module to be processed.
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
49 +/
644
a0643a4d4501 Added some methods to SemanticPass1 class.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 641
diff changeset
50 this(Module modul)
a0643a4d4501 Added some methods to SemanticPass1 class.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 641
diff changeset
51 {
a0643a4d4501 Added some methods to SemanticPass1 class.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 641
diff changeset
52 this.modul = modul;
a0643a4d4501 Added some methods to SemanticPass1 class.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 641
diff changeset
53 }
a0643a4d4501 Added some methods to SemanticPass1 class.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 641
diff changeset
54
a0643a4d4501 Added some methods to SemanticPass1 class.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 641
diff changeset
55 /// Start semantic analysis.
a0643a4d4501 Added some methods to SemanticPass1 class.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 641
diff changeset
56 void start()
a0643a4d4501 Added some methods to SemanticPass1 class.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 641
diff changeset
57 {
a0643a4d4501 Added some methods to SemanticPass1 class.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 641
diff changeset
58 assert(modul.root !is null);
649
3ebe76ad680e Using SemanticPass1 in main.d do start semantic analysis.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 648
diff changeset
59 // Create module scope.
3ebe76ad680e Using SemanticPass1 in main.d do start semantic analysis.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 648
diff changeset
60 scop = new Scope();
3ebe76ad680e Using SemanticPass1 in main.d do start semantic analysis.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 648
diff changeset
61 scop.symbol = modul; // Set this module as the scope's symbol.
3ebe76ad680e Using SemanticPass1 in main.d do start semantic analysis.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 648
diff changeset
62 scop.infoMan = modul.infoMan;
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
63 visit(modul.root);
644
a0643a4d4501 Added some methods to SemanticPass1 class.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 641
diff changeset
64 }
635
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
65
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
66 void enterScope(ScopeSymbol s)
635
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
67 {
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
68 scop = scop.enter(s);
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
69 }
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
70
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
71 void exitScope()
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
72 {
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
73 scop = scop.exit();
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
74 }
635
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
75
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
76 /// Insert a symbol into the current scope.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
77 void insert(Symbol sym, Identifier* ident)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
78 {
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
79 auto sym2 = scop.symbol.lookup(ident);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
80 if (sym2)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
81 reportSymbolConflict(sym, sym2, ident);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
82 else
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
83 scop.symbol.insert(sym, ident);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
84 // Set the current scope symbol as the parent.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
85 sym.parent = scop.symbol;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
86 }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
87
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
88 /// Insert a symbol, overloading on the name, into the current scope.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
89 void insertOverload(Symbol sym, Identifier* ident)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
90 {
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
91 auto sym2 = scop.symbol.lookup(ident);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
92 if (sym2)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
93 {
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
94 if (sym2.isOverloadSet)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
95 (cast(OverloadSet)cast(void*)sym2).add(sym);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
96 else
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
97 reportSymbolConflict(sym, sym2, ident);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
98 }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
99 else
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
100 // Create a new overload set.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
101 scop.symbol.insert(new OverloadSet(ident, sym.node), ident);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
102 // Set the current scope symbol as the parent.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
103 sym.parent = scop.symbol;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
104 }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
105
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
106 /// Report error: new symbol s1 conflicts with existing symbol s2.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
107 void reportSymbolConflict(Symbol s1, Symbol s2, Identifier* ident)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
108 {
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
109 auto loc = s2.node.begin.getErrorLocation();
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
110 auto locString = Format("{}({},{})", loc.filePath, loc.lineNum, loc.colNum);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
111 error(s1.node.begin, MSG.DeclConflictsWithDecl, ident.str, locString);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
112 }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
113
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
114 void error(Token* token, char[] formatMsg, ...)
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
115 {
686
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
116 if (!modul.infoMan)
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
117 return;
675
e7811328e6c7 Made Token.getLocation() a template function and added two aliases.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 673
diff changeset
118 auto location = token.getErrorLocation();
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
119 auto msg = Format(_arguments, _argptr, formatMsg);
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
120 modul.infoMan ~= new SemanticError(location, msg);
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
121 }
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
122
686
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
123
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
124 static class Deferred
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
125 {
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
126 Node node;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
127 ScopeSymbol symbol;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
128 // Saved attributes.
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
129 LinkageType linkageType;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
130 Protection protection;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
131 StorageClass storageClass;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
132 uint alignSize;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
133 }
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
134
690
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
135 // List of mixin, static if and pragma(msg,...) declarations.
686
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
136 // Their analysis must be deferred because they entail
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
137 // evaluation of expressions.
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
138 Deferred[] deferred;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
139
690
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
140 void addDeferred(Node node)
686
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
141 {
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
142 auto d = new Deferred;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
143 d.node = node;
690
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
144 d.symbol = scop.symbol;
686
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
145 d.linkageType = linkageType;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
146 d.protection = protection;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
147 d.storageClass = storageClass;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
148 d.alignSize = alignSize;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
149 deferred ~= d;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
150 }
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
151
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
152 private alias Declaration D;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
153
635
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
154 override
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
155 {
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
156 D visit(CompoundDeclaration d)
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
157 {
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
158 foreach (node; d.children)
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
159 {
670
d8c32113afde Added command 'translate'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 667
diff changeset
160 assert(node.category == NodeCategory.Declaration, Format("{}", node));
686
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
161 visitN(node);
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
162 }
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
163 return d;
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
164 }
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
165
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
166 D visit(IllegalDeclaration)
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
167 { assert(0, "semantic pass on invalid AST"); return null; }
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
168
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
169 D visit(EmptyDeclaration ed)
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
170 { return ed; }
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
171
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
172 D visit(ModuleDeclaration)
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
173 { return null; }
686
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
174
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
175 D visit(ImportDeclaration d)
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
176 {
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
177 return d;
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
178 }
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
179
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
180 D visit(AliasDeclaration ad)
649
3ebe76ad680e Using SemanticPass1 in main.d do start semantic analysis.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 648
diff changeset
181 {
3ebe76ad680e Using SemanticPass1 in main.d do start semantic analysis.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 648
diff changeset
182 return ad;
3ebe76ad680e Using SemanticPass1 in main.d do start semantic analysis.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 648
diff changeset
183 }
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
184
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
185 D visit(TypedefDeclaration td)
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
186 {
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
187 return td;
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
188 }
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
189
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
190 D visit(EnumDeclaration d)
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
191 {
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
192 // Create the symbol.
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
193 d.symbol = new Enum(d.name, d);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
194 if (d.name)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
195 { // Declare named enum.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
196 insert(d.symbol, d.name);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
197 enterScope(d.symbol);
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
198 }
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
199 // Declare members.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
200 foreach (member; d.members)
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
201 {
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
202 auto variable = new Variable(member.name, protection, storageClass, linkageType, member);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
203 insert(variable, variable.name);
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
204 }
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
205 if (d.name)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
206 exitScope();
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
207 return d;
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
208 }
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
209
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
210 D visit(EnumMemberDeclaration)
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
211 { return null; }
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
212
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
213 D visit(ClassDeclaration d)
635
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
214 {
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
215 if (d.symbol)
641
3569c2fc6124 Fixed some return statements.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 636
diff changeset
216 return d;
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
217 d.symbol = new Class(d.name, d);
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
218 // Insert into current scope.
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
219 if (d.tparams)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
220 insertOverload(d.symbol, d.name);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
221 else
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
222 insert(d.symbol, d.name);
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
223 enterScope(d.symbol);
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
224 // Continue semantic analysis.
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
225 d.decls && visitD(d.decls);
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
226 exitScope();
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
227 return d;
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
228 }
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
229
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
230 D visit(InterfaceDeclaration d)
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
231 {
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
232 if (d.symbol)
641
3569c2fc6124 Fixed some return statements.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 636
diff changeset
233 return d;
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
234 d.symbol = new dil.semantic.Symbols.Interface(d.name, d);
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
235 // Insert into current scope.
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
236 if (d.tparams)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
237 insertOverload(d.symbol, d.name);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
238 else
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
239 insert(d.symbol, d.name);
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
240 enterScope(d.symbol);
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
241 // Continue semantic analysis.
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
242 d.decls && visitD(d.decls);
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
243 exitScope();
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
244 return d;
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
245 }
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
246
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
247 D visit(StructDeclaration d)
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
248 {
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
249 if (d.symbol)
641
3569c2fc6124 Fixed some return statements.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 636
diff changeset
250 return d;
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
251 d.symbol = new Struct(d.name, d);
635
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
252 // Insert into current scope.
667
1ac758cd952a Fixed a few things in DefaultVisitor.d and Pass1.d
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 655
diff changeset
253 if (d.name)
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
254 {
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
255 if (d.tparams)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
256 insertOverload(d.symbol, d.name);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
257 else
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
258 insert(d.symbol, d.name);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
259 }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
260 enterScope(d.symbol);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
261 // Continue semantic analysis.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
262 d.decls && visitD(d.decls);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
263 exitScope();
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
264 return d;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
265 }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
266
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
267 D visit(UnionDeclaration d)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
268 {
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
269 if (d.symbol)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
270 return d;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
271 d.symbol = new Union(d.name, d);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
272 // Insert into current scope.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
273 if (d.name)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
274 {
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
275 if (d.tparams)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
276 insertOverload(d.symbol, d.name);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
277 else
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
278 insert(d.symbol, d.name);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
279 }
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
280 enterScope(d.symbol);
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
281 // Continue semantic analysis.
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
282 d.decls && visitD(d.decls);
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
283 exitScope();
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
284 return d;
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
285 }
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
286
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
287 D visit(ConstructorDeclaration)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
288 { return null; }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
289 D visit(StaticConstructorDeclaration)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
290 { return null; }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
291 D visit(DestructorDeclaration)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
292 { return null; }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
293 D visit(StaticDestructorDeclaration)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
294 { return null; }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
295 D visit(FunctionDeclaration)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
296 { return null; }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
297
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
298 D visit(VariablesDeclaration vd)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
299 {
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
300 // Error if we are in an interface.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
301 if (scop.isInterface)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
302 return error(vd.begin, MSG.InterfaceCantHaveVariables), vd;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
303
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
304 // Insert variable symbols in this declaration into the symbol table.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
305 foreach (name; vd.names)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
306 {
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
307 auto variable = new Variable(name, protection, storageClass, linkageType, vd);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
308 vd.variables ~= variable;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
309 insert(variable, name);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
310 }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
311 return vd;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
312 }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
313
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
314 D visit(InvariantDeclaration)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
315 { return null; }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
316 D visit(UnittestDeclaration)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
317 { return null; }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
318 D visit(DebugDeclaration)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
319 { return null; }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
320 D visit(VersionDeclaration)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
321 { return null; }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
322
686
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
323 D visit(StaticAssertDeclaration)
e8c09d13f2a5 Added class Deferred to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 683
diff changeset
324 { return null; }
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
325
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
326 D visit(TemplateDeclaration d)
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
327 {
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
328 if (d.symbol)
641
3569c2fc6124 Fixed some return statements.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 636
diff changeset
329 return d;
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
330 d.symbol = new Template(d.name, d);
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
331 // Insert into current scope.
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
332 insertOverload(d.symbol, d.name);
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
333 enterScope(d.symbol);
635
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
334 // Continue semantic analysis.
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
335 visitD(d.decls);
636
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
336 exitScope();
15a0f37caabe Added more visit() methods to dil.semantic.SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 635
diff changeset
337 return d;
635
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
338 }
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
339
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
340 D visit(NewDeclaration)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
341 { /*add id to env*/return null; }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
342 D visit(DeleteDeclaration)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
343 { /*add id to env*/return null; }
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
344
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
345 D visit(ProtectionDeclaration d)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
346 {
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
347 auto saved = protection; // Save.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
348 protection = d.prot; // Set.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
349 visitD(d.decls);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
350 protection = saved; // Restore.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
351 return d;
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
352 }
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
353
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
354 D visit(StorageClassDeclaration d)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
355 {
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
356 auto saved = storageClass; // Save.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
357 storageClass = d.storageClass; // Set.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
358 visitD(d.decls);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
359 storageClass = saved; // Restore.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
360 return d;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
361 }
649
3ebe76ad680e Using SemanticPass1 in main.d do start semantic analysis.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 648
diff changeset
362
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
363 D visit(LinkageDeclaration d)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
364 {
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
365 auto saved = linkageType; // Save.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
366 linkageType = d.linkageType; // Set.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
367 visitD(d.decls);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
368 linkageType = saved; // Restore.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
369 return d;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
370 }
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
371
683
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
372 D visit(AlignDeclaration d)
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
373 {
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
374 auto saved = alignSize; // Save.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
375 alignSize = d.size; // Set.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
376 visitD(d.decls);
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
377 alignSize = saved; // Restore.
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
378 return d;
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
379 }
1ae72234db26 Implemented some methods in SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 680
diff changeset
380
690
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
381 D visit(StaticIfDeclaration d)
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
382 {
690
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
383 addDeferred(d);
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
384 return d;
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
385 }
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
386
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
387 D visit(MixinDeclaration d)
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
388 {
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
389 addDeferred(d);
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
390 return d;
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
391 }
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
392
690
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
393 D visit(PragmaDeclaration d)
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
394 {
690
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
395 if (d.ident is Ident.msg)
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
396 addDeferred(d);
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
397 else
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
398 {
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
399 pragmaSemantic(scop, d.begin, d.ident, d.args);
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
400 visitD(d.decls);
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
401 }
eaf6444b6284 Adding pragma(msg,...) declarations to deferred list.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 686
diff changeset
402 return d;
648
4ae7b13aaac8 Moved some semantic() methods to SemanticPass1.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 646
diff changeset
403 }
635
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
404 } // override
b2fc028d8b55 Added class Visitor.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
405 }