comparison src/parser/Action.d @ 209:42e663451371

Renamed some of the actions. Declarations now have it's own action.
author Anders Johnsen <skabet@gmail.com>
date Tue, 12 Aug 2008 19:05:17 +0200
parents e0551773a005
children
comparison
equal deleted inserted replaced
208:41ccd50e7cbc 209:42e663451371
161 void addSelectiveImport(DeclT _import, ref Id target, Id* name) 161 void addSelectiveImport(DeclT _import, ref Id target, Id* name)
162 { 162 {
163 } 163 }
164 164
165 /** 165 /**
166 Either we should have one case that handles a lot of things, or we should 166 Called when an simple variable had been parsed.
167 have a lot of separate cases. 167 */
168 As an example, this method could handle the params in `int f(int, int)` 168 DeclT actOnVarDecl(ref Id type, ref Id name,
169 as well as handling `int x` at both top-level, in classes and in methods. 169 ExprT initializer, Attribute att)
170 170 {
171 The other solution is an addParamToFunc or similar. 171 return null;
172 */ 172 }
173 DeclT actOnDeclarator(ref Id type, ref Id name, ExprT init, Attribute att) 173
174 /**
175 Called when a struct has been parsed.
176
177 actOnStructMember will be called for all members
178 */
179 DeclT actOnStructDecl(ref Id name, Attribute att)
180 {
181 return null;
182 }
183
184 /**
185 Called when a class has been parsed.
186
187 actOnClassMember will be called for all members
188 actOnClassBaseClass will be called for all base classes
189 */
190 DeclT actOnClassDecl(ref Id name, Attribute att)
191 {
192 return null;
193 }
194
195 /**
196 Called when a interface has been parsed.
197
198 actOnInterfaceMember will be called for all members
199 actOnInterfaceBaseClass will be called for all base classes
200 */
201 DeclT actOnInterfaceDecl(ref Id name, Attribute att)
174 { 202 {
175 return null; 203 return null;
176 } 204 }
177 205
178 DeclT actOnAliasDecl(DeclT decl, Attribute att) 206 DeclT actOnAliasDecl(DeclT decl, Attribute att)
351 379
352 /** 380 /**
353 This is called when identifiers are used in expressions. 381 This is called when identifiers are used in expressions.
354 */ 382 */
355 ExprT actOnIdentifierExp(Id id) 383 ExprT actOnIdentifierExp(Id id)
356 {
357 return null;
358 }
359
360 /**
361 This is called when strings are used in expression
362 */
363 ExprT actOnStringExp(Token t)
364 { 384 {
365 return null; 385 return null;
366 } 386 }
367 387
368 /** 388 /**