Mercurial > projects > qtd
annotate generator/parser/default_visitor.cpp @ 402:e67ce7c21758
gdc & 64 bit changes
author | Eldar Insafutdinov |
---|---|
date | Thu, 17 Mar 2011 19:45:42 +0000 |
parents | 09a0f1d048f2 |
children |
rev | line source |
---|---|
1 | 1 /**************************************************************************** |
2 ** | |
52
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
3 ** Copyright (C) 1992-2009 Nokia. All rights reserved. |
1 | 4 ** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org> |
5 ** | |
6 ** This file is part of Qt Jambi. | |
7 ** | |
52
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
8 ** Commercial Usage |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
9 Licensees holding valid Qt Commercial licenses may use this file in |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
10 accordance with the Qt Commercial License Agreement provided with the |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
11 Software or, alternatively, in accordance with the terms contained in |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
12 a written agreement between you and Nokia. |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
13 |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
14 GNU Lesser General Public License Usage |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
15 Alternatively, this file may be used under the terms of the GNU Lesser |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
16 General Public License version 2.1 as published by the Free Software |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
17 Foundation and appearing in the file LICENSE.LGPL included in the |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
18 packaging of this file. Please review the following information to |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
19 ensure the GNU Lesser General Public License version 2.1 requirements |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
20 will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
21 |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
22 In addition, as a special exception, Nokia gives you certain |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
23 additional rights. These rights are described in the Nokia Qt LGPL |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
24 Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
25 package. |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
26 |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
27 GNU General Public License Usage |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
28 Alternatively, this file may be used under the terms of the GNU |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
29 General Public License version 3.0 as published by the Free Software |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
30 Foundation and appearing in the file LICENSE.GPL included in the |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
31 packaging of this file. Please review the following information to |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
32 ensure the GNU General Public License version 3.0 requirements will be |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
33 met: http://www.gnu.org/copyleft/gpl.html. |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
34 |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
35 If you are unsure which license is appropriate for your use, please |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
36 contact the sales department at qt-sales@nokia.com. |
1 | 37 |
38 ** | |
39 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | |
40 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
41 ** | |
42 ****************************************************************************/ | |
43 | |
44 | |
45 #include "default_visitor.h" | |
46 | |
47 void DefaultVisitor::visitAccessSpecifier(AccessSpecifierAST *) | |
48 { | |
49 // nothing to do | |
50 } | |
51 | |
52 void DefaultVisitor::visitAsmDefinition(AsmDefinitionAST *) | |
53 { | |
54 // nothing to do | |
55 } | |
56 | |
57 void DefaultVisitor::visitBaseClause(BaseClauseAST *node) | |
58 { | |
59 visitNodes(this, node->base_specifiers); | |
60 } | |
61 | |
62 void DefaultVisitor::visitBaseSpecifier(BaseSpecifierAST *node) | |
63 { | |
64 visit(node->name); | |
65 } | |
66 | |
67 void DefaultVisitor::visitBinaryExpression(BinaryExpressionAST *node) | |
68 { | |
69 visit(node->left_expression); | |
70 visit(node->right_expression); | |
71 } | |
72 | |
73 void DefaultVisitor::visitCastExpression(CastExpressionAST *node) | |
74 { | |
75 visit(node->type_id); | |
76 visit(node->expression); | |
77 } | |
78 | |
79 void DefaultVisitor::visitClassMemberAccess(ClassMemberAccessAST *node) | |
80 { | |
81 visit(node->name); | |
82 } | |
83 | |
84 void DefaultVisitor::visitClassSpecifier(ClassSpecifierAST *node) | |
85 { | |
86 visit(node->win_decl_specifiers); | |
87 visit(node->name); | |
88 visit(node->base_clause); | |
89 visitNodes(this, node->member_specs); | |
90 } | |
91 | |
92 void DefaultVisitor::visitCompoundStatement(CompoundStatementAST *node) | |
93 { | |
94 visitNodes(this, node->statements); | |
95 } | |
96 | |
97 void DefaultVisitor::visitCondition(ConditionAST *node) | |
98 { | |
99 visit(node->type_specifier); | |
100 visit(node->declarator); | |
101 visit(node->expression); | |
102 } | |
103 | |
104 void DefaultVisitor::visitConditionalExpression(ConditionalExpressionAST *node) | |
105 { | |
106 visit(node->condition); | |
107 visit(node->left_expression); | |
108 visit(node->right_expression); | |
109 } | |
110 | |
111 void DefaultVisitor::visitCppCastExpression(CppCastExpressionAST *node) | |
112 { | |
113 visit(node->type_id); | |
114 visit(node->expression); | |
115 visitNodes(this, node->sub_expressions); | |
116 } | |
117 | |
118 void DefaultVisitor::visitCtorInitializer(CtorInitializerAST *node) | |
119 { | |
120 visitNodes(this, node->member_initializers); | |
121 } | |
122 | |
123 void DefaultVisitor::visitDeclarationStatement(DeclarationStatementAST *node) | |
124 { | |
125 visit(node->declaration); | |
126 } | |
127 | |
128 void DefaultVisitor::visitDeclarator(DeclaratorAST *node) | |
129 { | |
130 visit(node->sub_declarator); | |
131 visitNodes(this, node->ptr_ops); | |
132 visit(node->id); | |
133 visit(node->bit_expression); | |
134 visitNodes(this, node->array_dimensions); | |
135 visit(node->parameter_declaration_clause); | |
136 visit(node->exception_spec); | |
137 } | |
138 | |
139 void DefaultVisitor::visitDeleteExpression(DeleteExpressionAST *node) | |
140 { | |
141 visit(node->expression); | |
142 } | |
143 | |
144 void DefaultVisitor::visitDoStatement(DoStatementAST *node) | |
145 { | |
146 visit(node->statement); | |
147 visit(node->expression); | |
148 } | |
149 | |
150 void DefaultVisitor::visitElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST *node) | |
151 { | |
152 visit(node->name); | |
153 } | |
154 | |
155 void DefaultVisitor::visitEnumSpecifier(EnumSpecifierAST *node) | |
156 { | |
157 visit(node->name); | |
158 visitNodes(this, node->enumerators); | |
159 } | |
160 | |
161 void DefaultVisitor::visitEnumerator(EnumeratorAST *node) | |
162 { | |
163 visit(node->expression); | |
164 } | |
165 | |
166 void DefaultVisitor::visitExceptionSpecification(ExceptionSpecificationAST *node) | |
167 { | |
168 visitNodes(this, node->type_ids); | |
169 } | |
170 | |
171 void DefaultVisitor::visitExpressionOrDeclarationStatement(ExpressionOrDeclarationStatementAST *node) | |
172 { | |
173 visit(node->expression); | |
174 visit(node->declaration); | |
175 } | |
176 | |
177 void DefaultVisitor::visitExpressionStatement(ExpressionStatementAST *node) | |
178 { | |
179 visit(node->expression); | |
180 } | |
181 | |
182 void DefaultVisitor::visitForStatement(ForStatementAST *node) | |
183 { | |
184 visit(node->init_statement); | |
185 visit(node->condition); | |
186 visit(node->expression); | |
187 visit(node->statement); | |
188 } | |
189 | |
190 void DefaultVisitor::visitFunctionCall(FunctionCallAST *node) | |
191 { | |
192 visit(node->arguments); | |
193 } | |
194 | |
195 void DefaultVisitor::visitFunctionDefinition(FunctionDefinitionAST *node) | |
196 { | |
197 visit(node->type_specifier); | |
198 visit(node->init_declarator); | |
199 visit(node->function_body); | |
200 visit(node->win_decl_specifiers); | |
201 } | |
202 | |
203 void DefaultVisitor::visitIfStatement(IfStatementAST *node) | |
204 { | |
205 visit(node->condition); | |
206 visit(node->statement); | |
207 visit(node->else_statement); | |
208 } | |
209 | |
210 void DefaultVisitor::visitIncrDecrExpression(IncrDecrExpressionAST *) | |
211 { | |
212 // nothing to do | |
213 } | |
214 | |
215 void DefaultVisitor::visitInitDeclarator(InitDeclaratorAST *node) | |
216 { | |
217 visit(node->declarator); | |
218 visit(node->initializer); | |
219 } | |
220 | |
221 void DefaultVisitor::visitInitializer(InitializerAST *node) | |
222 { | |
223 visit(node->initializer_clause); | |
224 visit(node->expression); | |
225 } | |
226 | |
227 void DefaultVisitor::visitInitializerClause(InitializerClauseAST *node) | |
228 { | |
229 visit(node->expression); | |
230 } | |
231 | |
232 void DefaultVisitor::visitLabeledStatement(LabeledStatementAST *) | |
233 { | |
234 // nothing to do | |
235 } | |
236 | |
237 void DefaultVisitor::visitLinkageBody(LinkageBodyAST *node) | |
238 { | |
239 visitNodes(this, node->declarations); | |
240 } | |
241 | |
242 void DefaultVisitor::visitLinkageSpecification(LinkageSpecificationAST *node) | |
243 { | |
244 visit(node->linkage_body); | |
245 visit(node->declaration); | |
246 } | |
247 | |
248 void DefaultVisitor::visitMemInitializer(MemInitializerAST *node) | |
249 { | |
250 visit(node->initializer_id); | |
251 visit(node->expression); | |
252 } | |
253 | |
254 void DefaultVisitor::visitName(NameAST *node) | |
255 { | |
256 visitNodes(this, node->qualified_names); | |
257 visit(node->unqualified_name); | |
258 } | |
259 | |
260 void DefaultVisitor::visitNamespace(NamespaceAST *node) | |
261 { | |
262 visit(node->linkage_body); | |
263 } | |
264 | |
265 void DefaultVisitor::visitNamespaceAliasDefinition(NamespaceAliasDefinitionAST *node) | |
266 { | |
267 visit(node->alias_name); | |
268 } | |
269 | |
270 void DefaultVisitor::visitNewDeclarator(NewDeclaratorAST *node) | |
271 { | |
272 visit(node->ptr_op); | |
273 visit(node->sub_declarator); | |
274 visitNodes(this, node->expressions); | |
275 } | |
276 | |
277 void DefaultVisitor::visitNewExpression(NewExpressionAST *node) | |
278 { | |
279 visit(node->expression); | |
280 visit(node->type_id); | |
281 visit(node->new_type_id); | |
282 visit(node->new_initializer); | |
283 } | |
284 | |
285 void DefaultVisitor::visitNewInitializer(NewInitializerAST *node) | |
286 { | |
287 visit(node->expression); | |
288 } | |
289 | |
290 void DefaultVisitor::visitNewTypeId(NewTypeIdAST *node) | |
291 { | |
292 visit(node->type_specifier); | |
293 visit(node->new_initializer); | |
294 visit(node->new_declarator); | |
295 } | |
296 | |
297 void DefaultVisitor::visitOperator(OperatorAST *) | |
298 { | |
299 // nothing to do | |
300 } | |
301 | |
302 void DefaultVisitor::visitOperatorFunctionId(OperatorFunctionIdAST *node) | |
303 { | |
304 visit(node->op); | |
305 visit(node->type_specifier); | |
306 visitNodes(this, node->ptr_ops); | |
307 } | |
308 | |
309 void DefaultVisitor::visitParameterDeclaration(ParameterDeclarationAST *node) | |
310 { | |
311 visit(node->type_specifier); | |
312 visit(node->declarator); | |
313 visit(node->expression); | |
314 } | |
315 | |
316 void DefaultVisitor::visitParameterDeclarationClause(ParameterDeclarationClauseAST *node) | |
317 { | |
318 visitNodes(this, node->parameter_declarations); | |
319 } | |
320 | |
321 void DefaultVisitor::visitPostfixExpression(PostfixExpressionAST *node) | |
322 { | |
323 visit(node->type_specifier); | |
324 visit(node->expression); | |
325 visitNodes(this, node->sub_expressions); | |
326 } | |
327 | |
328 void DefaultVisitor::visitPrimaryExpression(PrimaryExpressionAST *node) | |
329 { | |
330 visit(node->literal); | |
331 visit(node->expression_statement); | |
332 visit(node->sub_expression); | |
333 visit(node->name); | |
334 } | |
335 | |
336 void DefaultVisitor::visitPtrOperator(PtrOperatorAST *node) | |
337 { | |
338 visit(node->mem_ptr); | |
339 } | |
340 | |
341 void DefaultVisitor::visitPtrToMember(PtrToMemberAST *) | |
342 { | |
343 // nothing to do | |
344 } | |
345 | |
346 void DefaultVisitor::visitReturnStatement(ReturnStatementAST *node) | |
347 { | |
348 visit(node->expression); | |
349 } | |
350 | |
351 void DefaultVisitor::visitSimpleDeclaration(SimpleDeclarationAST *node) | |
352 { | |
353 visit(node->type_specifier); | |
354 visitNodes(this, node->init_declarators); | |
355 visit(node->win_decl_specifiers); | |
356 } | |
357 | |
358 void DefaultVisitor::visitSimpleTypeSpecifier(SimpleTypeSpecifierAST *node) | |
359 { | |
360 visit(node->name); | |
361 visit(node->type_id); | |
362 visit(node->expression); | |
363 } | |
364 | |
365 void DefaultVisitor::visitSizeofExpression(SizeofExpressionAST *node) | |
366 { | |
367 visit(node->type_id); | |
368 visit(node->expression); | |
369 } | |
370 | |
371 void DefaultVisitor::visitStringLiteral(StringLiteralAST *) | |
372 { | |
373 // nothing to do | |
374 } | |
375 | |
376 void DefaultVisitor::visitSubscriptExpression(SubscriptExpressionAST *node) | |
377 { | |
378 visit(node->subscript); | |
379 } | |
380 | |
381 void DefaultVisitor::visitSwitchStatement(SwitchStatementAST *node) | |
382 { | |
383 visit(node->condition); | |
384 visit(node->statement); | |
385 } | |
386 | |
387 void DefaultVisitor::visitTemplateArgument(TemplateArgumentAST *node) | |
388 { | |
389 visit(node->type_id); | |
390 visit(node->expression); | |
391 } | |
392 | |
393 void DefaultVisitor::visitTemplateDeclaration(TemplateDeclarationAST *node) | |
394 { | |
395 visitNodes(this, node->template_parameters); | |
396 visit(node->declaration); | |
397 } | |
398 | |
399 void DefaultVisitor::visitTemplateParameter(TemplateParameterAST *node) | |
400 { | |
401 visit(node->type_parameter); | |
402 visit(node->parameter_declaration); | |
403 } | |
404 | |
405 void DefaultVisitor::visitThrowExpression(ThrowExpressionAST *node) | |
406 { | |
407 visit(node->expression); | |
408 } | |
409 | |
410 void DefaultVisitor::visitTranslationUnit(TranslationUnitAST *node) | |
411 { | |
412 visitNodes(this, node->declarations); | |
413 } | |
414 | |
415 void DefaultVisitor::visitTryBlockStatement(TryBlockStatementAST *) | |
416 { | |
417 // nothing to do | |
418 } | |
419 | |
420 void DefaultVisitor::visitTypeId(TypeIdAST *node) | |
421 { | |
422 visit(node->type_specifier); | |
423 visit(node->declarator); | |
424 } | |
425 | |
426 void DefaultVisitor::visitTypeIdentification(TypeIdentificationAST *node) | |
427 { | |
428 visit(node->name); | |
429 visit(node->expression); | |
430 } | |
431 | |
432 void DefaultVisitor::visitTypeParameter(TypeParameterAST *node) | |
433 { | |
434 visit(node->name); | |
435 visit(node->type_id); | |
436 visitNodes(this, node->template_parameters); | |
437 visit(node->template_name); | |
438 } | |
439 | |
440 void DefaultVisitor::visitTypedef(TypedefAST *node) | |
441 { | |
442 visit(node->type_specifier); | |
443 visitNodes(this, node->init_declarators); | |
444 } | |
445 | |
446 void DefaultVisitor::visitUnaryExpression(UnaryExpressionAST *node) | |
447 { | |
448 visit(node->expression); | |
449 } | |
450 | |
451 void DefaultVisitor::visitUnqualifiedName(UnqualifiedNameAST *node) | |
452 { | |
453 visit(node->operator_id); | |
454 visitNodes(this, node->template_arguments); | |
455 } | |
456 | |
457 void DefaultVisitor::visitUsing(UsingAST *node) | |
458 { | |
459 visit(node->name); | |
460 } | |
461 | |
462 void DefaultVisitor::visitUsingDirective(UsingDirectiveAST *node) | |
463 { | |
464 visit(node->name); | |
465 } | |
466 | |
467 void DefaultVisitor::visitWhileStatement(WhileStatementAST *node) | |
468 { | |
469 visit(node->condition); | |
470 visit(node->statement); | |
471 } | |
472 | |
473 void DefaultVisitor::visitWinDeclSpec(WinDeclSpecAST *) | |
474 { | |
475 // nothing to do | |
476 } | |
477 | |
478 // kate: space-indent on; indent-width 2; replace-tabs on; |