|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the Qt Mobility Components. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 // |
|
43 // W A R N I N G |
|
44 // ------------- |
|
45 // |
|
46 // This file is automatically generated. |
|
47 // Changes will be lost. |
|
48 // |
|
49 |
|
50 #include "AST.h" |
|
51 #include "MemoryPool.h" |
|
52 |
|
53 using namespace CPlusPlus; |
|
54 |
|
55 SimpleSpecifierAST *SimpleSpecifierAST::clone(MemoryPool *pool) const |
|
56 { |
|
57 SimpleSpecifierAST *ast = new (pool) SimpleSpecifierAST; |
|
58 ast->specifier_token = specifier_token; |
|
59 return ast; |
|
60 } |
|
61 |
|
62 AttributeSpecifierAST *AttributeSpecifierAST::clone(MemoryPool *pool) const |
|
63 { |
|
64 AttributeSpecifierAST *ast = new (pool) AttributeSpecifierAST; |
|
65 ast->attribute_token = attribute_token; |
|
66 ast->first_lparen_token = first_lparen_token; |
|
67 ast->second_lparen_token = second_lparen_token; |
|
68 for (AttributeListAST *iter = attribute_list, **ast_iter = &ast->attribute_list; |
|
69 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
70 *ast_iter = new (pool) AttributeListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
71 ast->first_rparen_token = first_rparen_token; |
|
72 ast->second_rparen_token = second_rparen_token; |
|
73 return ast; |
|
74 } |
|
75 |
|
76 AttributeAST *AttributeAST::clone(MemoryPool *pool) const |
|
77 { |
|
78 AttributeAST *ast = new (pool) AttributeAST; |
|
79 ast->identifier_token = identifier_token; |
|
80 ast->lparen_token = lparen_token; |
|
81 ast->tag_token = tag_token; |
|
82 for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list; |
|
83 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
84 *ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
85 ast->rparen_token = rparen_token; |
|
86 return ast; |
|
87 } |
|
88 |
|
89 TypeofSpecifierAST *TypeofSpecifierAST::clone(MemoryPool *pool) const |
|
90 { |
|
91 TypeofSpecifierAST *ast = new (pool) TypeofSpecifierAST; |
|
92 ast->typeof_token = typeof_token; |
|
93 ast->lparen_token = lparen_token; |
|
94 if (expression) |
|
95 ast->expression = expression->clone(pool); |
|
96 ast->rparen_token = rparen_token; |
|
97 return ast; |
|
98 } |
|
99 |
|
100 DeclaratorAST *DeclaratorAST::clone(MemoryPool *pool) const |
|
101 { |
|
102 DeclaratorAST *ast = new (pool) DeclaratorAST; |
|
103 for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list; |
|
104 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
105 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
106 for (PtrOperatorListAST *iter = ptr_operator_list, **ast_iter = &ast->ptr_operator_list; |
|
107 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
108 *ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
109 if (core_declarator) |
|
110 ast->core_declarator = core_declarator->clone(pool); |
|
111 for (PostfixDeclaratorListAST *iter = postfix_declarator_list, **ast_iter = &ast->postfix_declarator_list; |
|
112 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
113 *ast_iter = new (pool) PostfixDeclaratorListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
114 for (SpecifierListAST *iter = post_attribute_list, **ast_iter = &ast->post_attribute_list; |
|
115 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
116 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
117 ast->equals_token = equals_token; |
|
118 if (initializer) |
|
119 ast->initializer = initializer->clone(pool); |
|
120 return ast; |
|
121 } |
|
122 |
|
123 SimpleDeclarationAST *SimpleDeclarationAST::clone(MemoryPool *pool) const |
|
124 { |
|
125 SimpleDeclarationAST *ast = new (pool) SimpleDeclarationAST; |
|
126 ast->qt_invokable_token = qt_invokable_token; |
|
127 for (SpecifierListAST *iter = decl_specifier_list, **ast_iter = &ast->decl_specifier_list; |
|
128 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
129 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
130 for (DeclaratorListAST *iter = declarator_list, **ast_iter = &ast->declarator_list; |
|
131 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
132 *ast_iter = new (pool) DeclaratorListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
133 ast->semicolon_token = semicolon_token; |
|
134 return ast; |
|
135 } |
|
136 |
|
137 EmptyDeclarationAST *EmptyDeclarationAST::clone(MemoryPool *pool) const |
|
138 { |
|
139 EmptyDeclarationAST *ast = new (pool) EmptyDeclarationAST; |
|
140 ast->semicolon_token = semicolon_token; |
|
141 return ast; |
|
142 } |
|
143 |
|
144 AccessDeclarationAST *AccessDeclarationAST::clone(MemoryPool *pool) const |
|
145 { |
|
146 AccessDeclarationAST *ast = new (pool) AccessDeclarationAST; |
|
147 ast->access_specifier_token = access_specifier_token; |
|
148 ast->slots_token = slots_token; |
|
149 ast->colon_token = colon_token; |
|
150 return ast; |
|
151 } |
|
152 |
|
153 #ifdef ICHECK_BUILD |
|
154 QPropertyDeclarationAST *QPropertyDeclarationAST::clone(MemoryPool *pool) const |
|
155 { |
|
156 QPropertyDeclarationAST *ast = new (pool) QPropertyDeclarationAST; |
|
157 ast->property_specifier_token = property_specifier_token; |
|
158 ast->lparen_token = lparen_token; |
|
159 ast->type_token = type_token; |
|
160 ast->type_name_token = type_name_token; |
|
161 ast->read_token = read_token; |
|
162 ast->read_function_token = read_function_token; |
|
163 ast->write_token = write_token; |
|
164 ast->write_function_token = write_function_token; |
|
165 ast->reset_token = reset_token; |
|
166 ast->reset_function_token = reset_function_token; |
|
167 ast->notify_token = notify_token; |
|
168 ast->notify_function_token = notify_function_token; |
|
169 ast->rparen_token = rparen_token; |
|
170 return ast; |
|
171 } |
|
172 |
|
173 QEnumDeclarationAST *QEnumDeclarationAST::clone(MemoryPool *pool) const |
|
174 { |
|
175 QEnumDeclarationAST *ast = new (pool)QEnumDeclarationAST; |
|
176 ast->enum_specifier_token = enum_specifier_token; |
|
177 ast->lparen_token = lparen_token; |
|
178 ast->rparen_token = rparen_token; |
|
179 for (EnumeratorListAST *iter = enumerator_list, **ast_iter = &ast->enumerator_list; |
|
180 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
181 *ast_iter = new (pool) EnumeratorListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
182 |
|
183 return ast; |
|
184 } |
|
185 |
|
186 QFlagsDeclarationAST *QFlagsDeclarationAST::clone(MemoryPool *pool) const |
|
187 { |
|
188 QFlagsDeclarationAST *ast = new (pool) QFlagsDeclarationAST; |
|
189 ast->flags_specifier_token = flags_specifier_token; |
|
190 ast->lparen_token = lparen_token; |
|
191 ast->rparen_token = rparen_token; |
|
192 for (EnumeratorListAST *iter = enumerator_list, **ast_iter = &ast->enumerator_list; |
|
193 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
194 *ast_iter = new (pool) EnumeratorListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
195 |
|
196 return ast; |
|
197 } |
|
198 |
|
199 QDeclareFlagsDeclarationAST *QDeclareFlagsDeclarationAST::clone(MemoryPool *pool) const |
|
200 { |
|
201 QDeclareFlagsDeclarationAST *ast = new (pool) QDeclareFlagsDeclarationAST; |
|
202 ast->declareflags_specifier_token = declareflags_specifier_token; |
|
203 ast->lparen_token = lparen_token; |
|
204 ast->flag_token = flag_token; |
|
205 ast->enum_token = enum_token; |
|
206 ast->rparen_token = rparen_token; |
|
207 |
|
208 return ast; |
|
209 } |
|
210 #endif |
|
211 |
|
212 AsmDefinitionAST *AsmDefinitionAST::clone(MemoryPool *pool) const |
|
213 { |
|
214 AsmDefinitionAST *ast = new (pool) AsmDefinitionAST; |
|
215 ast->asm_token = asm_token; |
|
216 ast->volatile_token = volatile_token; |
|
217 ast->lparen_token = lparen_token; |
|
218 ast->rparen_token = rparen_token; |
|
219 ast->semicolon_token = semicolon_token; |
|
220 return ast; |
|
221 } |
|
222 |
|
223 BaseSpecifierAST *BaseSpecifierAST::clone(MemoryPool *pool) const |
|
224 { |
|
225 BaseSpecifierAST *ast = new (pool) BaseSpecifierAST; |
|
226 ast->virtual_token = virtual_token; |
|
227 ast->access_specifier_token = access_specifier_token; |
|
228 if (name) |
|
229 ast->name = name->clone(pool); |
|
230 return ast; |
|
231 } |
|
232 |
|
233 CompoundLiteralAST *CompoundLiteralAST::clone(MemoryPool *pool) const |
|
234 { |
|
235 CompoundLiteralAST *ast = new (pool) CompoundLiteralAST; |
|
236 ast->lparen_token = lparen_token; |
|
237 if (type_id) |
|
238 ast->type_id = type_id->clone(pool); |
|
239 ast->rparen_token = rparen_token; |
|
240 if (initializer) |
|
241 ast->initializer = initializer->clone(pool); |
|
242 return ast; |
|
243 } |
|
244 |
|
245 QtMethodAST *QtMethodAST::clone(MemoryPool *pool) const |
|
246 { |
|
247 QtMethodAST *ast = new (pool) QtMethodAST; |
|
248 ast->method_token = method_token; |
|
249 ast->lparen_token = lparen_token; |
|
250 if (declarator) |
|
251 ast->declarator = declarator->clone(pool); |
|
252 ast->rparen_token = rparen_token; |
|
253 return ast; |
|
254 } |
|
255 |
|
256 QtMemberDeclarationAST *QtMemberDeclarationAST::clone(MemoryPool *pool) const |
|
257 { |
|
258 QtMemberDeclarationAST *ast = new (pool) QtMemberDeclarationAST; |
|
259 ast->q_token = q_token; |
|
260 ast->lparen_token = lparen_token; |
|
261 if (type_id) |
|
262 ast->type_id = type_id->clone(pool); |
|
263 ast->rparen_token = rparen_token; |
|
264 return ast; |
|
265 } |
|
266 |
|
267 BinaryExpressionAST *BinaryExpressionAST::clone(MemoryPool *pool) const |
|
268 { |
|
269 BinaryExpressionAST *ast = new (pool) BinaryExpressionAST; |
|
270 if (left_expression) |
|
271 ast->left_expression = left_expression->clone(pool); |
|
272 ast->binary_op_token = binary_op_token; |
|
273 if (right_expression) |
|
274 ast->right_expression = right_expression->clone(pool); |
|
275 return ast; |
|
276 } |
|
277 |
|
278 CastExpressionAST *CastExpressionAST::clone(MemoryPool *pool) const |
|
279 { |
|
280 CastExpressionAST *ast = new (pool) CastExpressionAST; |
|
281 ast->lparen_token = lparen_token; |
|
282 if (type_id) |
|
283 ast->type_id = type_id->clone(pool); |
|
284 ast->rparen_token = rparen_token; |
|
285 if (expression) |
|
286 ast->expression = expression->clone(pool); |
|
287 return ast; |
|
288 } |
|
289 |
|
290 ClassSpecifierAST *ClassSpecifierAST::clone(MemoryPool *pool) const |
|
291 { |
|
292 ClassSpecifierAST *ast = new (pool) ClassSpecifierAST; |
|
293 ast->classkey_token = classkey_token; |
|
294 for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list; |
|
295 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
296 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
297 if (name) |
|
298 ast->name = name->clone(pool); |
|
299 ast->colon_token = colon_token; |
|
300 for (BaseSpecifierListAST *iter = base_clause_list, **ast_iter = &ast->base_clause_list; |
|
301 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
302 *ast_iter = new (pool) BaseSpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
303 ast->lbrace_token = lbrace_token; |
|
304 for (DeclarationListAST *iter = member_specifier_list, **ast_iter = &ast->member_specifier_list; |
|
305 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
306 *ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
307 ast->rbrace_token = rbrace_token; |
|
308 return ast; |
|
309 } |
|
310 |
|
311 CaseStatementAST *CaseStatementAST::clone(MemoryPool *pool) const |
|
312 { |
|
313 CaseStatementAST *ast = new (pool) CaseStatementAST; |
|
314 ast->case_token = case_token; |
|
315 if (expression) |
|
316 ast->expression = expression->clone(pool); |
|
317 ast->colon_token = colon_token; |
|
318 if (statement) |
|
319 ast->statement = statement->clone(pool); |
|
320 return ast; |
|
321 } |
|
322 |
|
323 CompoundStatementAST *CompoundStatementAST::clone(MemoryPool *pool) const |
|
324 { |
|
325 CompoundStatementAST *ast = new (pool) CompoundStatementAST; |
|
326 ast->lbrace_token = lbrace_token; |
|
327 for (StatementListAST *iter = statement_list, **ast_iter = &ast->statement_list; |
|
328 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
329 *ast_iter = new (pool) StatementListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
330 ast->rbrace_token = rbrace_token; |
|
331 return ast; |
|
332 } |
|
333 |
|
334 ConditionAST *ConditionAST::clone(MemoryPool *pool) const |
|
335 { |
|
336 ConditionAST *ast = new (pool) ConditionAST; |
|
337 for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list; |
|
338 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
339 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
340 if (declarator) |
|
341 ast->declarator = declarator->clone(pool); |
|
342 return ast; |
|
343 } |
|
344 |
|
345 ConditionalExpressionAST *ConditionalExpressionAST::clone(MemoryPool *pool) const |
|
346 { |
|
347 ConditionalExpressionAST *ast = new (pool) ConditionalExpressionAST; |
|
348 if (condition) |
|
349 ast->condition = condition->clone(pool); |
|
350 ast->question_token = question_token; |
|
351 if (left_expression) |
|
352 ast->left_expression = left_expression->clone(pool); |
|
353 ast->colon_token = colon_token; |
|
354 if (right_expression) |
|
355 ast->right_expression = right_expression->clone(pool); |
|
356 return ast; |
|
357 } |
|
358 |
|
359 CppCastExpressionAST *CppCastExpressionAST::clone(MemoryPool *pool) const |
|
360 { |
|
361 CppCastExpressionAST *ast = new (pool) CppCastExpressionAST; |
|
362 ast->cast_token = cast_token; |
|
363 ast->less_token = less_token; |
|
364 if (type_id) |
|
365 ast->type_id = type_id->clone(pool); |
|
366 ast->greater_token = greater_token; |
|
367 ast->lparen_token = lparen_token; |
|
368 if (expression) |
|
369 ast->expression = expression->clone(pool); |
|
370 ast->rparen_token = rparen_token; |
|
371 return ast; |
|
372 } |
|
373 |
|
374 CtorInitializerAST *CtorInitializerAST::clone(MemoryPool *pool) const |
|
375 { |
|
376 CtorInitializerAST *ast = new (pool) CtorInitializerAST; |
|
377 ast->colon_token = colon_token; |
|
378 for (MemInitializerListAST *iter = member_initializer_list, **ast_iter = &ast->member_initializer_list; |
|
379 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
380 *ast_iter = new (pool) MemInitializerListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
381 return ast; |
|
382 } |
|
383 |
|
384 DeclarationStatementAST *DeclarationStatementAST::clone(MemoryPool *pool) const |
|
385 { |
|
386 DeclarationStatementAST *ast = new (pool) DeclarationStatementAST; |
|
387 if (declaration) |
|
388 ast->declaration = declaration->clone(pool); |
|
389 return ast; |
|
390 } |
|
391 |
|
392 DeclaratorIdAST *DeclaratorIdAST::clone(MemoryPool *pool) const |
|
393 { |
|
394 DeclaratorIdAST *ast = new (pool) DeclaratorIdAST; |
|
395 if (name) |
|
396 ast->name = name->clone(pool); |
|
397 return ast; |
|
398 } |
|
399 |
|
400 NestedDeclaratorAST *NestedDeclaratorAST::clone(MemoryPool *pool) const |
|
401 { |
|
402 NestedDeclaratorAST *ast = new (pool) NestedDeclaratorAST; |
|
403 ast->lparen_token = lparen_token; |
|
404 if (declarator) |
|
405 ast->declarator = declarator->clone(pool); |
|
406 ast->rparen_token = rparen_token; |
|
407 return ast; |
|
408 } |
|
409 |
|
410 FunctionDeclaratorAST *FunctionDeclaratorAST::clone(MemoryPool *pool) const |
|
411 { |
|
412 FunctionDeclaratorAST *ast = new (pool) FunctionDeclaratorAST; |
|
413 ast->lparen_token = lparen_token; |
|
414 if (parameters) |
|
415 ast->parameters = parameters->clone(pool); |
|
416 ast->rparen_token = rparen_token; |
|
417 for (SpecifierListAST *iter = cv_qualifier_list, **ast_iter = &ast->cv_qualifier_list; |
|
418 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
419 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
420 if (exception_specification) |
|
421 ast->exception_specification = exception_specification->clone(pool); |
|
422 if (as_cpp_initializer) |
|
423 ast->as_cpp_initializer = as_cpp_initializer->clone(pool); |
|
424 return ast; |
|
425 } |
|
426 |
|
427 ArrayDeclaratorAST *ArrayDeclaratorAST::clone(MemoryPool *pool) const |
|
428 { |
|
429 ArrayDeclaratorAST *ast = new (pool) ArrayDeclaratorAST; |
|
430 ast->lbracket_token = lbracket_token; |
|
431 if (expression) |
|
432 ast->expression = expression->clone(pool); |
|
433 ast->rbracket_token = rbracket_token; |
|
434 return ast; |
|
435 } |
|
436 |
|
437 DeleteExpressionAST *DeleteExpressionAST::clone(MemoryPool *pool) const |
|
438 { |
|
439 DeleteExpressionAST *ast = new (pool) DeleteExpressionAST; |
|
440 ast->scope_token = scope_token; |
|
441 ast->delete_token = delete_token; |
|
442 ast->lbracket_token = lbracket_token; |
|
443 ast->rbracket_token = rbracket_token; |
|
444 if (expression) |
|
445 ast->expression = expression->clone(pool); |
|
446 return ast; |
|
447 } |
|
448 |
|
449 DoStatementAST *DoStatementAST::clone(MemoryPool *pool) const |
|
450 { |
|
451 DoStatementAST *ast = new (pool) DoStatementAST; |
|
452 ast->do_token = do_token; |
|
453 if (statement) |
|
454 ast->statement = statement->clone(pool); |
|
455 ast->while_token = while_token; |
|
456 ast->lparen_token = lparen_token; |
|
457 if (expression) |
|
458 ast->expression = expression->clone(pool); |
|
459 ast->rparen_token = rparen_token; |
|
460 ast->semicolon_token = semicolon_token; |
|
461 return ast; |
|
462 } |
|
463 |
|
464 NamedTypeSpecifierAST *NamedTypeSpecifierAST::clone(MemoryPool *pool) const |
|
465 { |
|
466 NamedTypeSpecifierAST *ast = new (pool) NamedTypeSpecifierAST; |
|
467 if (name) |
|
468 ast->name = name->clone(pool); |
|
469 return ast; |
|
470 } |
|
471 |
|
472 ElaboratedTypeSpecifierAST *ElaboratedTypeSpecifierAST::clone(MemoryPool *pool) const |
|
473 { |
|
474 ElaboratedTypeSpecifierAST *ast = new (pool) ElaboratedTypeSpecifierAST; |
|
475 ast->classkey_token = classkey_token; |
|
476 if (name) |
|
477 ast->name = name->clone(pool); |
|
478 return ast; |
|
479 } |
|
480 |
|
481 EnumSpecifierAST *EnumSpecifierAST::clone(MemoryPool *pool) const |
|
482 { |
|
483 EnumSpecifierAST *ast = new (pool) EnumSpecifierAST; |
|
484 ast->enum_token = enum_token; |
|
485 if (name) |
|
486 ast->name = name->clone(pool); |
|
487 ast->lbrace_token = lbrace_token; |
|
488 for (EnumeratorListAST *iter = enumerator_list, **ast_iter = &ast->enumerator_list; |
|
489 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
490 *ast_iter = new (pool) EnumeratorListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
491 ast->rbrace_token = rbrace_token; |
|
492 return ast; |
|
493 } |
|
494 |
|
495 EnumeratorAST *EnumeratorAST::clone(MemoryPool *pool) const |
|
496 { |
|
497 EnumeratorAST *ast = new (pool) EnumeratorAST; |
|
498 ast->identifier_token = identifier_token; |
|
499 ast->equal_token = equal_token; |
|
500 if (expression) |
|
501 ast->expression = expression->clone(pool); |
|
502 return ast; |
|
503 } |
|
504 |
|
505 ExceptionDeclarationAST *ExceptionDeclarationAST::clone(MemoryPool *pool) const |
|
506 { |
|
507 ExceptionDeclarationAST *ast = new (pool) ExceptionDeclarationAST; |
|
508 for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list; |
|
509 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
510 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
511 if (declarator) |
|
512 ast->declarator = declarator->clone(pool); |
|
513 ast->dot_dot_dot_token = dot_dot_dot_token; |
|
514 return ast; |
|
515 } |
|
516 |
|
517 ExceptionSpecificationAST *ExceptionSpecificationAST::clone(MemoryPool *pool) const |
|
518 { |
|
519 ExceptionSpecificationAST *ast = new (pool) ExceptionSpecificationAST; |
|
520 ast->throw_token = throw_token; |
|
521 ast->lparen_token = lparen_token; |
|
522 ast->dot_dot_dot_token = dot_dot_dot_token; |
|
523 for (ExpressionListAST *iter = type_id_list, **ast_iter = &ast->type_id_list; |
|
524 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
525 *ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
526 ast->rparen_token = rparen_token; |
|
527 return ast; |
|
528 } |
|
529 |
|
530 ExpressionOrDeclarationStatementAST *ExpressionOrDeclarationStatementAST::clone(MemoryPool *pool) const |
|
531 { |
|
532 ExpressionOrDeclarationStatementAST *ast = new (pool) ExpressionOrDeclarationStatementAST; |
|
533 if (expression) |
|
534 ast->expression = expression->clone(pool); |
|
535 if (declaration) |
|
536 ast->declaration = declaration->clone(pool); |
|
537 return ast; |
|
538 } |
|
539 |
|
540 ExpressionStatementAST *ExpressionStatementAST::clone(MemoryPool *pool) const |
|
541 { |
|
542 ExpressionStatementAST *ast = new (pool) ExpressionStatementAST; |
|
543 if (expression) |
|
544 ast->expression = expression->clone(pool); |
|
545 ast->semicolon_token = semicolon_token; |
|
546 return ast; |
|
547 } |
|
548 |
|
549 FunctionDefinitionAST *FunctionDefinitionAST::clone(MemoryPool *pool) const |
|
550 { |
|
551 FunctionDefinitionAST *ast = new (pool) FunctionDefinitionAST; |
|
552 ast->qt_invokable_token = qt_invokable_token; |
|
553 for (SpecifierListAST *iter = decl_specifier_list, **ast_iter = &ast->decl_specifier_list; |
|
554 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
555 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
556 if (declarator) |
|
557 ast->declarator = declarator->clone(pool); |
|
558 if (ctor_initializer) |
|
559 ast->ctor_initializer = ctor_initializer->clone(pool); |
|
560 if (function_body) |
|
561 ast->function_body = function_body->clone(pool); |
|
562 return ast; |
|
563 } |
|
564 |
|
565 ForeachStatementAST *ForeachStatementAST::clone(MemoryPool *pool) const |
|
566 { |
|
567 ForeachStatementAST *ast = new (pool) ForeachStatementAST; |
|
568 ast->foreach_token = foreach_token; |
|
569 ast->lparen_token = lparen_token; |
|
570 for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list; |
|
571 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
572 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
573 if (declarator) |
|
574 ast->declarator = declarator->clone(pool); |
|
575 if (initializer) |
|
576 ast->initializer = initializer->clone(pool); |
|
577 ast->comma_token = comma_token; |
|
578 if (expression) |
|
579 ast->expression = expression->clone(pool); |
|
580 ast->rparen_token = rparen_token; |
|
581 if (statement) |
|
582 ast->statement = statement->clone(pool); |
|
583 return ast; |
|
584 } |
|
585 |
|
586 ForStatementAST *ForStatementAST::clone(MemoryPool *pool) const |
|
587 { |
|
588 ForStatementAST *ast = new (pool) ForStatementAST; |
|
589 ast->for_token = for_token; |
|
590 ast->lparen_token = lparen_token; |
|
591 if (initializer) |
|
592 ast->initializer = initializer->clone(pool); |
|
593 if (condition) |
|
594 ast->condition = condition->clone(pool); |
|
595 ast->semicolon_token = semicolon_token; |
|
596 if (expression) |
|
597 ast->expression = expression->clone(pool); |
|
598 ast->rparen_token = rparen_token; |
|
599 if (statement) |
|
600 ast->statement = statement->clone(pool); |
|
601 return ast; |
|
602 } |
|
603 |
|
604 IfStatementAST *IfStatementAST::clone(MemoryPool *pool) const |
|
605 { |
|
606 IfStatementAST *ast = new (pool) IfStatementAST; |
|
607 ast->if_token = if_token; |
|
608 ast->lparen_token = lparen_token; |
|
609 if (condition) |
|
610 ast->condition = condition->clone(pool); |
|
611 ast->rparen_token = rparen_token; |
|
612 if (statement) |
|
613 ast->statement = statement->clone(pool); |
|
614 ast->else_token = else_token; |
|
615 if (else_statement) |
|
616 ast->else_statement = else_statement->clone(pool); |
|
617 return ast; |
|
618 } |
|
619 |
|
620 ArrayInitializerAST *ArrayInitializerAST::clone(MemoryPool *pool) const |
|
621 { |
|
622 ArrayInitializerAST *ast = new (pool) ArrayInitializerAST; |
|
623 ast->lbrace_token = lbrace_token; |
|
624 for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list; |
|
625 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
626 *ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
627 ast->rbrace_token = rbrace_token; |
|
628 return ast; |
|
629 } |
|
630 |
|
631 LabeledStatementAST *LabeledStatementAST::clone(MemoryPool *pool) const |
|
632 { |
|
633 LabeledStatementAST *ast = new (pool) LabeledStatementAST; |
|
634 ast->label_token = label_token; |
|
635 ast->colon_token = colon_token; |
|
636 if (statement) |
|
637 ast->statement = statement->clone(pool); |
|
638 return ast; |
|
639 } |
|
640 |
|
641 LinkageBodyAST *LinkageBodyAST::clone(MemoryPool *pool) const |
|
642 { |
|
643 LinkageBodyAST *ast = new (pool) LinkageBodyAST; |
|
644 ast->lbrace_token = lbrace_token; |
|
645 for (DeclarationListAST *iter = declaration_list, **ast_iter = &ast->declaration_list; |
|
646 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
647 *ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
648 ast->rbrace_token = rbrace_token; |
|
649 return ast; |
|
650 } |
|
651 |
|
652 LinkageSpecificationAST *LinkageSpecificationAST::clone(MemoryPool *pool) const |
|
653 { |
|
654 LinkageSpecificationAST *ast = new (pool) LinkageSpecificationAST; |
|
655 ast->extern_token = extern_token; |
|
656 ast->extern_type_token = extern_type_token; |
|
657 if (declaration) |
|
658 ast->declaration = declaration->clone(pool); |
|
659 return ast; |
|
660 } |
|
661 |
|
662 MemInitializerAST *MemInitializerAST::clone(MemoryPool *pool) const |
|
663 { |
|
664 MemInitializerAST *ast = new (pool) MemInitializerAST; |
|
665 if (name) |
|
666 ast->name = name->clone(pool); |
|
667 ast->lparen_token = lparen_token; |
|
668 for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list; |
|
669 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
670 *ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
671 ast->rparen_token = rparen_token; |
|
672 return ast; |
|
673 } |
|
674 |
|
675 NestedNameSpecifierAST *NestedNameSpecifierAST::clone(MemoryPool *pool) const |
|
676 { |
|
677 NestedNameSpecifierAST *ast = new (pool) NestedNameSpecifierAST; |
|
678 if (class_or_namespace_name) |
|
679 ast->class_or_namespace_name = class_or_namespace_name->clone(pool); |
|
680 ast->scope_token = scope_token; |
|
681 return ast; |
|
682 } |
|
683 |
|
684 QualifiedNameAST *QualifiedNameAST::clone(MemoryPool *pool) const |
|
685 { |
|
686 QualifiedNameAST *ast = new (pool) QualifiedNameAST; |
|
687 ast->global_scope_token = global_scope_token; |
|
688 for (NestedNameSpecifierListAST *iter = nested_name_specifier_list, **ast_iter = &ast->nested_name_specifier_list; |
|
689 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
690 *ast_iter = new (pool) NestedNameSpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
691 if (unqualified_name) |
|
692 ast->unqualified_name = unqualified_name->clone(pool); |
|
693 return ast; |
|
694 } |
|
695 |
|
696 OperatorFunctionIdAST *OperatorFunctionIdAST::clone(MemoryPool *pool) const |
|
697 { |
|
698 OperatorFunctionIdAST *ast = new (pool) OperatorFunctionIdAST; |
|
699 ast->operator_token = operator_token; |
|
700 if (op) |
|
701 ast->op = op->clone(pool); |
|
702 return ast; |
|
703 } |
|
704 |
|
705 ConversionFunctionIdAST *ConversionFunctionIdAST::clone(MemoryPool *pool) const |
|
706 { |
|
707 ConversionFunctionIdAST *ast = new (pool) ConversionFunctionIdAST; |
|
708 ast->operator_token = operator_token; |
|
709 for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list; |
|
710 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
711 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
712 for (PtrOperatorListAST *iter = ptr_operator_list, **ast_iter = &ast->ptr_operator_list; |
|
713 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
714 *ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
715 return ast; |
|
716 } |
|
717 |
|
718 SimpleNameAST *SimpleNameAST::clone(MemoryPool *pool) const |
|
719 { |
|
720 SimpleNameAST *ast = new (pool) SimpleNameAST; |
|
721 ast->identifier_token = identifier_token; |
|
722 return ast; |
|
723 } |
|
724 |
|
725 DestructorNameAST *DestructorNameAST::clone(MemoryPool *pool) const |
|
726 { |
|
727 DestructorNameAST *ast = new (pool) DestructorNameAST; |
|
728 ast->tilde_token = tilde_token; |
|
729 ast->identifier_token = identifier_token; |
|
730 return ast; |
|
731 } |
|
732 |
|
733 TemplateIdAST *TemplateIdAST::clone(MemoryPool *pool) const |
|
734 { |
|
735 TemplateIdAST *ast = new (pool) TemplateIdAST; |
|
736 ast->identifier_token = identifier_token; |
|
737 ast->less_token = less_token; |
|
738 for (TemplateArgumentListAST *iter = template_argument_list, **ast_iter = &ast->template_argument_list; |
|
739 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
740 *ast_iter = new (pool) TemplateArgumentListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
741 ast->greater_token = greater_token; |
|
742 return ast; |
|
743 } |
|
744 |
|
745 NamespaceAST *NamespaceAST::clone(MemoryPool *pool) const |
|
746 { |
|
747 NamespaceAST *ast = new (pool) NamespaceAST; |
|
748 ast->namespace_token = namespace_token; |
|
749 ast->identifier_token = identifier_token; |
|
750 for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list; |
|
751 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
752 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
753 if (linkage_body) |
|
754 ast->linkage_body = linkage_body->clone(pool); |
|
755 return ast; |
|
756 } |
|
757 |
|
758 NamespaceAliasDefinitionAST *NamespaceAliasDefinitionAST::clone(MemoryPool *pool) const |
|
759 { |
|
760 NamespaceAliasDefinitionAST *ast = new (pool) NamespaceAliasDefinitionAST; |
|
761 ast->namespace_token = namespace_token; |
|
762 ast->namespace_name_token = namespace_name_token; |
|
763 ast->equal_token = equal_token; |
|
764 if (name) |
|
765 ast->name = name->clone(pool); |
|
766 ast->semicolon_token = semicolon_token; |
|
767 return ast; |
|
768 } |
|
769 |
|
770 NewPlacementAST *NewPlacementAST::clone(MemoryPool *pool) const |
|
771 { |
|
772 NewPlacementAST *ast = new (pool) NewPlacementAST; |
|
773 ast->lparen_token = lparen_token; |
|
774 for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list; |
|
775 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
776 *ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
777 ast->rparen_token = rparen_token; |
|
778 return ast; |
|
779 } |
|
780 |
|
781 NewArrayDeclaratorAST *NewArrayDeclaratorAST::clone(MemoryPool *pool) const |
|
782 { |
|
783 NewArrayDeclaratorAST *ast = new (pool) NewArrayDeclaratorAST; |
|
784 ast->lbracket_token = lbracket_token; |
|
785 if (expression) |
|
786 ast->expression = expression->clone(pool); |
|
787 ast->rbracket_token = rbracket_token; |
|
788 return ast; |
|
789 } |
|
790 |
|
791 NewExpressionAST *NewExpressionAST::clone(MemoryPool *pool) const |
|
792 { |
|
793 NewExpressionAST *ast = new (pool) NewExpressionAST; |
|
794 ast->scope_token = scope_token; |
|
795 ast->new_token = new_token; |
|
796 if (new_placement) |
|
797 ast->new_placement = new_placement->clone(pool); |
|
798 ast->lparen_token = lparen_token; |
|
799 if (type_id) |
|
800 ast->type_id = type_id->clone(pool); |
|
801 ast->rparen_token = rparen_token; |
|
802 if (new_type_id) |
|
803 ast->new_type_id = new_type_id->clone(pool); |
|
804 if (new_initializer) |
|
805 ast->new_initializer = new_initializer->clone(pool); |
|
806 return ast; |
|
807 } |
|
808 |
|
809 NewInitializerAST *NewInitializerAST::clone(MemoryPool *pool) const |
|
810 { |
|
811 NewInitializerAST *ast = new (pool) NewInitializerAST; |
|
812 ast->lparen_token = lparen_token; |
|
813 if (expression) |
|
814 ast->expression = expression->clone(pool); |
|
815 ast->rparen_token = rparen_token; |
|
816 return ast; |
|
817 } |
|
818 |
|
819 NewTypeIdAST *NewTypeIdAST::clone(MemoryPool *pool) const |
|
820 { |
|
821 NewTypeIdAST *ast = new (pool) NewTypeIdAST; |
|
822 for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list; |
|
823 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
824 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
825 for (PtrOperatorListAST *iter = ptr_operator_list, **ast_iter = &ast->ptr_operator_list; |
|
826 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
827 *ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
828 for (NewArrayDeclaratorListAST *iter = new_array_declarator_list, **ast_iter = &ast->new_array_declarator_list; |
|
829 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
830 *ast_iter = new (pool) NewArrayDeclaratorListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
831 return ast; |
|
832 } |
|
833 |
|
834 OperatorAST *OperatorAST::clone(MemoryPool *pool) const |
|
835 { |
|
836 OperatorAST *ast = new (pool) OperatorAST; |
|
837 ast->op_token = op_token; |
|
838 ast->open_token = open_token; |
|
839 ast->close_token = close_token; |
|
840 return ast; |
|
841 } |
|
842 |
|
843 ParameterDeclarationAST *ParameterDeclarationAST::clone(MemoryPool *pool) const |
|
844 { |
|
845 ParameterDeclarationAST *ast = new (pool) ParameterDeclarationAST; |
|
846 for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list; |
|
847 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
848 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
849 if (declarator) |
|
850 ast->declarator = declarator->clone(pool); |
|
851 ast->equal_token = equal_token; |
|
852 if (expression) |
|
853 ast->expression = expression->clone(pool); |
|
854 return ast; |
|
855 } |
|
856 |
|
857 ParameterDeclarationClauseAST *ParameterDeclarationClauseAST::clone(MemoryPool *pool) const |
|
858 { |
|
859 ParameterDeclarationClauseAST *ast = new (pool) ParameterDeclarationClauseAST; |
|
860 for (DeclarationListAST *iter = parameter_declaration_list, **ast_iter = &ast->parameter_declaration_list; |
|
861 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
862 *ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
863 ast->dot_dot_dot_token = dot_dot_dot_token; |
|
864 return ast; |
|
865 } |
|
866 |
|
867 CallAST *CallAST::clone(MemoryPool *pool) const |
|
868 { |
|
869 CallAST *ast = new (pool) CallAST; |
|
870 ast->lparen_token = lparen_token; |
|
871 for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list; |
|
872 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
873 *ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
874 ast->rparen_token = rparen_token; |
|
875 return ast; |
|
876 } |
|
877 |
|
878 ArrayAccessAST *ArrayAccessAST::clone(MemoryPool *pool) const |
|
879 { |
|
880 ArrayAccessAST *ast = new (pool) ArrayAccessAST; |
|
881 ast->lbracket_token = lbracket_token; |
|
882 if (expression) |
|
883 ast->expression = expression->clone(pool); |
|
884 ast->rbracket_token = rbracket_token; |
|
885 return ast; |
|
886 } |
|
887 |
|
888 PostIncrDecrAST *PostIncrDecrAST::clone(MemoryPool *pool) const |
|
889 { |
|
890 PostIncrDecrAST *ast = new (pool) PostIncrDecrAST; |
|
891 ast->incr_decr_token = incr_decr_token; |
|
892 return ast; |
|
893 } |
|
894 |
|
895 MemberAccessAST *MemberAccessAST::clone(MemoryPool *pool) const |
|
896 { |
|
897 MemberAccessAST *ast = new (pool) MemberAccessAST; |
|
898 ast->access_token = access_token; |
|
899 ast->template_token = template_token; |
|
900 if (member_name) |
|
901 ast->member_name = member_name->clone(pool); |
|
902 return ast; |
|
903 } |
|
904 |
|
905 TypeidExpressionAST *TypeidExpressionAST::clone(MemoryPool *pool) const |
|
906 { |
|
907 TypeidExpressionAST *ast = new (pool) TypeidExpressionAST; |
|
908 ast->typeid_token = typeid_token; |
|
909 ast->lparen_token = lparen_token; |
|
910 if (expression) |
|
911 ast->expression = expression->clone(pool); |
|
912 ast->rparen_token = rparen_token; |
|
913 return ast; |
|
914 } |
|
915 |
|
916 TypenameCallExpressionAST *TypenameCallExpressionAST::clone(MemoryPool *pool) const |
|
917 { |
|
918 TypenameCallExpressionAST *ast = new (pool) TypenameCallExpressionAST; |
|
919 ast->typename_token = typename_token; |
|
920 if (name) |
|
921 ast->name = name->clone(pool); |
|
922 ast->lparen_token = lparen_token; |
|
923 for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list; |
|
924 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
925 *ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
926 ast->rparen_token = rparen_token; |
|
927 return ast; |
|
928 } |
|
929 |
|
930 TypeConstructorCallAST *TypeConstructorCallAST::clone(MemoryPool *pool) const |
|
931 { |
|
932 TypeConstructorCallAST *ast = new (pool) TypeConstructorCallAST; |
|
933 for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list; |
|
934 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
935 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
936 ast->lparen_token = lparen_token; |
|
937 for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list; |
|
938 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
939 *ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
940 ast->rparen_token = rparen_token; |
|
941 return ast; |
|
942 } |
|
943 |
|
944 PostfixExpressionAST *PostfixExpressionAST::clone(MemoryPool *pool) const |
|
945 { |
|
946 PostfixExpressionAST *ast = new (pool) PostfixExpressionAST; |
|
947 if (base_expression) |
|
948 ast->base_expression = base_expression->clone(pool); |
|
949 for (PostfixListAST *iter = postfix_expression_list, **ast_iter = &ast->postfix_expression_list; |
|
950 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
951 *ast_iter = new (pool) PostfixListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
952 return ast; |
|
953 } |
|
954 |
|
955 PointerToMemberAST *PointerToMemberAST::clone(MemoryPool *pool) const |
|
956 { |
|
957 PointerToMemberAST *ast = new (pool) PointerToMemberAST; |
|
958 ast->global_scope_token = global_scope_token; |
|
959 for (NestedNameSpecifierListAST *iter = nested_name_specifier_list, **ast_iter = &ast->nested_name_specifier_list; |
|
960 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
961 *ast_iter = new (pool) NestedNameSpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
962 ast->star_token = star_token; |
|
963 for (SpecifierListAST *iter = cv_qualifier_list, **ast_iter = &ast->cv_qualifier_list; |
|
964 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
965 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
966 return ast; |
|
967 } |
|
968 |
|
969 PointerAST *PointerAST::clone(MemoryPool *pool) const |
|
970 { |
|
971 PointerAST *ast = new (pool) PointerAST; |
|
972 ast->star_token = star_token; |
|
973 for (SpecifierListAST *iter = cv_qualifier_list, **ast_iter = &ast->cv_qualifier_list; |
|
974 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
975 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
976 return ast; |
|
977 } |
|
978 |
|
979 ReferenceAST *ReferenceAST::clone(MemoryPool *pool) const |
|
980 { |
|
981 ReferenceAST *ast = new (pool) ReferenceAST; |
|
982 ast->amp_token = amp_token; |
|
983 return ast; |
|
984 } |
|
985 |
|
986 BreakStatementAST *BreakStatementAST::clone(MemoryPool *pool) const |
|
987 { |
|
988 BreakStatementAST *ast = new (pool) BreakStatementAST; |
|
989 ast->break_token = break_token; |
|
990 ast->semicolon_token = semicolon_token; |
|
991 return ast; |
|
992 } |
|
993 |
|
994 ContinueStatementAST *ContinueStatementAST::clone(MemoryPool *pool) const |
|
995 { |
|
996 ContinueStatementAST *ast = new (pool) ContinueStatementAST; |
|
997 ast->continue_token = continue_token; |
|
998 ast->semicolon_token = semicolon_token; |
|
999 return ast; |
|
1000 } |
|
1001 |
|
1002 GotoStatementAST *GotoStatementAST::clone(MemoryPool *pool) const |
|
1003 { |
|
1004 GotoStatementAST *ast = new (pool) GotoStatementAST; |
|
1005 ast->goto_token = goto_token; |
|
1006 ast->identifier_token = identifier_token; |
|
1007 ast->semicolon_token = semicolon_token; |
|
1008 return ast; |
|
1009 } |
|
1010 |
|
1011 ReturnStatementAST *ReturnStatementAST::clone(MemoryPool *pool) const |
|
1012 { |
|
1013 ReturnStatementAST *ast = new (pool) ReturnStatementAST; |
|
1014 ast->return_token = return_token; |
|
1015 if (expression) |
|
1016 ast->expression = expression->clone(pool); |
|
1017 ast->semicolon_token = semicolon_token; |
|
1018 return ast; |
|
1019 } |
|
1020 |
|
1021 SizeofExpressionAST *SizeofExpressionAST::clone(MemoryPool *pool) const |
|
1022 { |
|
1023 SizeofExpressionAST *ast = new (pool) SizeofExpressionAST; |
|
1024 ast->sizeof_token = sizeof_token; |
|
1025 ast->lparen_token = lparen_token; |
|
1026 if (expression) |
|
1027 ast->expression = expression->clone(pool); |
|
1028 ast->rparen_token = rparen_token; |
|
1029 return ast; |
|
1030 } |
|
1031 |
|
1032 NumericLiteralAST *NumericLiteralAST::clone(MemoryPool *pool) const |
|
1033 { |
|
1034 NumericLiteralAST *ast = new (pool) NumericLiteralAST; |
|
1035 ast->literal_token = literal_token; |
|
1036 return ast; |
|
1037 } |
|
1038 |
|
1039 BoolLiteralAST *BoolLiteralAST::clone(MemoryPool *pool) const |
|
1040 { |
|
1041 BoolLiteralAST *ast = new (pool) BoolLiteralAST; |
|
1042 ast->literal_token = literal_token; |
|
1043 return ast; |
|
1044 } |
|
1045 |
|
1046 ThisExpressionAST *ThisExpressionAST::clone(MemoryPool *pool) const |
|
1047 { |
|
1048 ThisExpressionAST *ast = new (pool) ThisExpressionAST; |
|
1049 ast->this_token = this_token; |
|
1050 return ast; |
|
1051 } |
|
1052 |
|
1053 NestedExpressionAST *NestedExpressionAST::clone(MemoryPool *pool) const |
|
1054 { |
|
1055 NestedExpressionAST *ast = new (pool) NestedExpressionAST; |
|
1056 ast->lparen_token = lparen_token; |
|
1057 if (expression) |
|
1058 ast->expression = expression->clone(pool); |
|
1059 ast->rparen_token = rparen_token; |
|
1060 return ast; |
|
1061 } |
|
1062 |
|
1063 StringLiteralAST *StringLiteralAST::clone(MemoryPool *pool) const |
|
1064 { |
|
1065 StringLiteralAST *ast = new (pool) StringLiteralAST; |
|
1066 ast->literal_token = literal_token; |
|
1067 if (next) |
|
1068 ast->next = next->clone(pool); |
|
1069 return ast; |
|
1070 } |
|
1071 |
|
1072 SwitchStatementAST *SwitchStatementAST::clone(MemoryPool *pool) const |
|
1073 { |
|
1074 SwitchStatementAST *ast = new (pool) SwitchStatementAST; |
|
1075 ast->switch_token = switch_token; |
|
1076 ast->lparen_token = lparen_token; |
|
1077 if (condition) |
|
1078 ast->condition = condition->clone(pool); |
|
1079 ast->rparen_token = rparen_token; |
|
1080 if (statement) |
|
1081 ast->statement = statement->clone(pool); |
|
1082 return ast; |
|
1083 } |
|
1084 |
|
1085 TemplateDeclarationAST *TemplateDeclarationAST::clone(MemoryPool *pool) const |
|
1086 { |
|
1087 TemplateDeclarationAST *ast = new (pool) TemplateDeclarationAST; |
|
1088 ast->export_token = export_token; |
|
1089 ast->template_token = template_token; |
|
1090 ast->less_token = less_token; |
|
1091 for (DeclarationListAST *iter = template_parameter_list, **ast_iter = &ast->template_parameter_list; |
|
1092 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1093 *ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1094 ast->greater_token = greater_token; |
|
1095 if (declaration) |
|
1096 ast->declaration = declaration->clone(pool); |
|
1097 return ast; |
|
1098 } |
|
1099 |
|
1100 ThrowExpressionAST *ThrowExpressionAST::clone(MemoryPool *pool) const |
|
1101 { |
|
1102 ThrowExpressionAST *ast = new (pool) ThrowExpressionAST; |
|
1103 ast->throw_token = throw_token; |
|
1104 if (expression) |
|
1105 ast->expression = expression->clone(pool); |
|
1106 return ast; |
|
1107 } |
|
1108 |
|
1109 TranslationUnitAST *TranslationUnitAST::clone(MemoryPool *pool) const |
|
1110 { |
|
1111 TranslationUnitAST *ast = new (pool) TranslationUnitAST; |
|
1112 for (DeclarationListAST *iter = declaration_list, **ast_iter = &ast->declaration_list; |
|
1113 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1114 *ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1115 return ast; |
|
1116 } |
|
1117 |
|
1118 TryBlockStatementAST *TryBlockStatementAST::clone(MemoryPool *pool) const |
|
1119 { |
|
1120 TryBlockStatementAST *ast = new (pool) TryBlockStatementAST; |
|
1121 ast->try_token = try_token; |
|
1122 if (statement) |
|
1123 ast->statement = statement->clone(pool); |
|
1124 for (CatchClauseListAST *iter = catch_clause_list, **ast_iter = &ast->catch_clause_list; |
|
1125 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1126 *ast_iter = new (pool) CatchClauseListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1127 return ast; |
|
1128 } |
|
1129 |
|
1130 CatchClauseAST *CatchClauseAST::clone(MemoryPool *pool) const |
|
1131 { |
|
1132 CatchClauseAST *ast = new (pool) CatchClauseAST; |
|
1133 ast->catch_token = catch_token; |
|
1134 ast->lparen_token = lparen_token; |
|
1135 if (exception_declaration) |
|
1136 ast->exception_declaration = exception_declaration->clone(pool); |
|
1137 ast->rparen_token = rparen_token; |
|
1138 if (statement) |
|
1139 ast->statement = statement->clone(pool); |
|
1140 return ast; |
|
1141 } |
|
1142 |
|
1143 TypeIdAST *TypeIdAST::clone(MemoryPool *pool) const |
|
1144 { |
|
1145 TypeIdAST *ast = new (pool) TypeIdAST; |
|
1146 for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list; |
|
1147 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1148 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1149 if (declarator) |
|
1150 ast->declarator = declarator->clone(pool); |
|
1151 return ast; |
|
1152 } |
|
1153 |
|
1154 TypenameTypeParameterAST *TypenameTypeParameterAST::clone(MemoryPool *pool) const |
|
1155 { |
|
1156 TypenameTypeParameterAST *ast = new (pool) TypenameTypeParameterAST; |
|
1157 ast->classkey_token = classkey_token; |
|
1158 if (name) |
|
1159 ast->name = name->clone(pool); |
|
1160 ast->equal_token = equal_token; |
|
1161 if (type_id) |
|
1162 ast->type_id = type_id->clone(pool); |
|
1163 return ast; |
|
1164 } |
|
1165 |
|
1166 TemplateTypeParameterAST *TemplateTypeParameterAST::clone(MemoryPool *pool) const |
|
1167 { |
|
1168 TemplateTypeParameterAST *ast = new (pool) TemplateTypeParameterAST; |
|
1169 ast->template_token = template_token; |
|
1170 ast->less_token = less_token; |
|
1171 for (DeclarationListAST *iter = template_parameter_list, **ast_iter = &ast->template_parameter_list; |
|
1172 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1173 *ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1174 ast->greater_token = greater_token; |
|
1175 ast->class_token = class_token; |
|
1176 if (name) |
|
1177 ast->name = name->clone(pool); |
|
1178 ast->equal_token = equal_token; |
|
1179 if (type_id) |
|
1180 ast->type_id = type_id->clone(pool); |
|
1181 return ast; |
|
1182 } |
|
1183 |
|
1184 UnaryExpressionAST *UnaryExpressionAST::clone(MemoryPool *pool) const |
|
1185 { |
|
1186 UnaryExpressionAST *ast = new (pool) UnaryExpressionAST; |
|
1187 ast->unary_op_token = unary_op_token; |
|
1188 if (expression) |
|
1189 ast->expression = expression->clone(pool); |
|
1190 return ast; |
|
1191 } |
|
1192 |
|
1193 UsingAST *UsingAST::clone(MemoryPool *pool) const |
|
1194 { |
|
1195 UsingAST *ast = new (pool) UsingAST; |
|
1196 ast->using_token = using_token; |
|
1197 ast->typename_token = typename_token; |
|
1198 if (name) |
|
1199 ast->name = name->clone(pool); |
|
1200 ast->semicolon_token = semicolon_token; |
|
1201 return ast; |
|
1202 } |
|
1203 |
|
1204 UsingDirectiveAST *UsingDirectiveAST::clone(MemoryPool *pool) const |
|
1205 { |
|
1206 UsingDirectiveAST *ast = new (pool) UsingDirectiveAST; |
|
1207 ast->using_token = using_token; |
|
1208 ast->namespace_token = namespace_token; |
|
1209 if (name) |
|
1210 ast->name = name->clone(pool); |
|
1211 ast->semicolon_token = semicolon_token; |
|
1212 return ast; |
|
1213 } |
|
1214 |
|
1215 WhileStatementAST *WhileStatementAST::clone(MemoryPool *pool) const |
|
1216 { |
|
1217 WhileStatementAST *ast = new (pool) WhileStatementAST; |
|
1218 ast->while_token = while_token; |
|
1219 ast->lparen_token = lparen_token; |
|
1220 if (condition) |
|
1221 ast->condition = condition->clone(pool); |
|
1222 ast->rparen_token = rparen_token; |
|
1223 if (statement) |
|
1224 ast->statement = statement->clone(pool); |
|
1225 return ast; |
|
1226 } |
|
1227 |
|
1228 ObjCClassForwardDeclarationAST *ObjCClassForwardDeclarationAST::clone(MemoryPool *pool) const |
|
1229 { |
|
1230 ObjCClassForwardDeclarationAST *ast = new (pool) ObjCClassForwardDeclarationAST; |
|
1231 for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list; |
|
1232 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1233 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1234 ast->class_token = class_token; |
|
1235 for (ObjCIdentifierListAST *iter = identifier_list, **ast_iter = &ast->identifier_list; |
|
1236 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1237 *ast_iter = new (pool) ObjCIdentifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1238 ast->semicolon_token = semicolon_token; |
|
1239 return ast; |
|
1240 } |
|
1241 |
|
1242 ObjCClassDeclarationAST *ObjCClassDeclarationAST::clone(MemoryPool *pool) const |
|
1243 { |
|
1244 ObjCClassDeclarationAST *ast = new (pool) ObjCClassDeclarationAST; |
|
1245 for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list; |
|
1246 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1247 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1248 ast->interface_token = interface_token; |
|
1249 ast->implementation_token = implementation_token; |
|
1250 if (class_name) |
|
1251 ast->class_name = class_name->clone(pool); |
|
1252 ast->lparen_token = lparen_token; |
|
1253 if (category_name) |
|
1254 ast->category_name = category_name->clone(pool); |
|
1255 ast->rparen_token = rparen_token; |
|
1256 ast->colon_token = colon_token; |
|
1257 if (superclass) |
|
1258 ast->superclass = superclass->clone(pool); |
|
1259 if (protocol_refs) |
|
1260 ast->protocol_refs = protocol_refs->clone(pool); |
|
1261 if (inst_vars_decl) |
|
1262 ast->inst_vars_decl = inst_vars_decl->clone(pool); |
|
1263 for (DeclarationListAST *iter = member_declaration_list, **ast_iter = &ast->member_declaration_list; |
|
1264 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1265 *ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1266 ast->end_token = end_token; |
|
1267 return ast; |
|
1268 } |
|
1269 |
|
1270 ObjCProtocolForwardDeclarationAST *ObjCProtocolForwardDeclarationAST::clone(MemoryPool *pool) const |
|
1271 { |
|
1272 ObjCProtocolForwardDeclarationAST *ast = new (pool) ObjCProtocolForwardDeclarationAST; |
|
1273 for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list; |
|
1274 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1275 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1276 ast->protocol_token = protocol_token; |
|
1277 for (ObjCIdentifierListAST *iter = identifier_list, **ast_iter = &ast->identifier_list; |
|
1278 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1279 *ast_iter = new (pool) ObjCIdentifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1280 ast->semicolon_token = semicolon_token; |
|
1281 return ast; |
|
1282 } |
|
1283 |
|
1284 ObjCProtocolDeclarationAST *ObjCProtocolDeclarationAST::clone(MemoryPool *pool) const |
|
1285 { |
|
1286 ObjCProtocolDeclarationAST *ast = new (pool) ObjCProtocolDeclarationAST; |
|
1287 for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list; |
|
1288 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1289 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1290 ast->protocol_token = protocol_token; |
|
1291 if (name) |
|
1292 ast->name = name->clone(pool); |
|
1293 if (protocol_refs) |
|
1294 ast->protocol_refs = protocol_refs->clone(pool); |
|
1295 for (DeclarationListAST *iter = member_declaration_list, **ast_iter = &ast->member_declaration_list; |
|
1296 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1297 *ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1298 ast->end_token = end_token; |
|
1299 return ast; |
|
1300 } |
|
1301 |
|
1302 ObjCProtocolRefsAST *ObjCProtocolRefsAST::clone(MemoryPool *pool) const |
|
1303 { |
|
1304 ObjCProtocolRefsAST *ast = new (pool) ObjCProtocolRefsAST; |
|
1305 ast->less_token = less_token; |
|
1306 for (ObjCIdentifierListAST *iter = identifier_list, **ast_iter = &ast->identifier_list; |
|
1307 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1308 *ast_iter = new (pool) ObjCIdentifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1309 ast->greater_token = greater_token; |
|
1310 return ast; |
|
1311 } |
|
1312 |
|
1313 ObjCMessageArgumentAST *ObjCMessageArgumentAST::clone(MemoryPool *pool) const |
|
1314 { |
|
1315 ObjCMessageArgumentAST *ast = new (pool) ObjCMessageArgumentAST; |
|
1316 if (parameter_value_expression) |
|
1317 ast->parameter_value_expression = parameter_value_expression->clone(pool); |
|
1318 return ast; |
|
1319 } |
|
1320 |
|
1321 ObjCMessageExpressionAST *ObjCMessageExpressionAST::clone(MemoryPool *pool) const |
|
1322 { |
|
1323 ObjCMessageExpressionAST *ast = new (pool) ObjCMessageExpressionAST; |
|
1324 ast->lbracket_token = lbracket_token; |
|
1325 if (receiver_expression) |
|
1326 ast->receiver_expression = receiver_expression->clone(pool); |
|
1327 if (selector) |
|
1328 ast->selector = selector->clone(pool); |
|
1329 for (ObjCMessageArgumentListAST *iter = argument_list, **ast_iter = &ast->argument_list; |
|
1330 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1331 *ast_iter = new (pool) ObjCMessageArgumentListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1332 ast->rbracket_token = rbracket_token; |
|
1333 return ast; |
|
1334 } |
|
1335 |
|
1336 ObjCProtocolExpressionAST *ObjCProtocolExpressionAST::clone(MemoryPool *pool) const |
|
1337 { |
|
1338 ObjCProtocolExpressionAST *ast = new (pool) ObjCProtocolExpressionAST; |
|
1339 ast->protocol_token = protocol_token; |
|
1340 ast->lparen_token = lparen_token; |
|
1341 ast->identifier_token = identifier_token; |
|
1342 ast->rparen_token = rparen_token; |
|
1343 return ast; |
|
1344 } |
|
1345 |
|
1346 ObjCTypeNameAST *ObjCTypeNameAST::clone(MemoryPool *pool) const |
|
1347 { |
|
1348 ObjCTypeNameAST *ast = new (pool) ObjCTypeNameAST; |
|
1349 ast->lparen_token = lparen_token; |
|
1350 ast->type_qualifier_token = type_qualifier_token; |
|
1351 if (type_id) |
|
1352 ast->type_id = type_id->clone(pool); |
|
1353 ast->rparen_token = rparen_token; |
|
1354 return ast; |
|
1355 } |
|
1356 |
|
1357 ObjCEncodeExpressionAST *ObjCEncodeExpressionAST::clone(MemoryPool *pool) const |
|
1358 { |
|
1359 ObjCEncodeExpressionAST *ast = new (pool) ObjCEncodeExpressionAST; |
|
1360 ast->encode_token = encode_token; |
|
1361 if (type_name) |
|
1362 ast->type_name = type_name->clone(pool); |
|
1363 return ast; |
|
1364 } |
|
1365 |
|
1366 ObjCSelectorWithoutArgumentsAST *ObjCSelectorWithoutArgumentsAST::clone(MemoryPool *pool) const |
|
1367 { |
|
1368 ObjCSelectorWithoutArgumentsAST *ast = new (pool) ObjCSelectorWithoutArgumentsAST; |
|
1369 ast->name_token = name_token; |
|
1370 return ast; |
|
1371 } |
|
1372 |
|
1373 ObjCSelectorArgumentAST *ObjCSelectorArgumentAST::clone(MemoryPool *pool) const |
|
1374 { |
|
1375 ObjCSelectorArgumentAST *ast = new (pool) ObjCSelectorArgumentAST; |
|
1376 ast->name_token = name_token; |
|
1377 ast->colon_token = colon_token; |
|
1378 return ast; |
|
1379 } |
|
1380 |
|
1381 ObjCSelectorWithArgumentsAST *ObjCSelectorWithArgumentsAST::clone(MemoryPool *pool) const |
|
1382 { |
|
1383 ObjCSelectorWithArgumentsAST *ast = new (pool) ObjCSelectorWithArgumentsAST; |
|
1384 for (ObjCSelectorArgumentListAST *iter = selector_argument_list, **ast_iter = &ast->selector_argument_list; |
|
1385 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1386 *ast_iter = new (pool) ObjCSelectorArgumentListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1387 return ast; |
|
1388 } |
|
1389 |
|
1390 ObjCSelectorExpressionAST *ObjCSelectorExpressionAST::clone(MemoryPool *pool) const |
|
1391 { |
|
1392 ObjCSelectorExpressionAST *ast = new (pool) ObjCSelectorExpressionAST; |
|
1393 ast->selector_token = selector_token; |
|
1394 ast->lparen_token = lparen_token; |
|
1395 if (selector) |
|
1396 ast->selector = selector->clone(pool); |
|
1397 ast->rparen_token = rparen_token; |
|
1398 return ast; |
|
1399 } |
|
1400 |
|
1401 ObjCInstanceVariablesDeclarationAST *ObjCInstanceVariablesDeclarationAST::clone(MemoryPool *pool) const |
|
1402 { |
|
1403 ObjCInstanceVariablesDeclarationAST *ast = new (pool) ObjCInstanceVariablesDeclarationAST; |
|
1404 ast->lbrace_token = lbrace_token; |
|
1405 for (DeclarationListAST *iter = instance_variable_list, **ast_iter = &ast->instance_variable_list; |
|
1406 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1407 *ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1408 ast->rbrace_token = rbrace_token; |
|
1409 return ast; |
|
1410 } |
|
1411 |
|
1412 ObjCVisibilityDeclarationAST *ObjCVisibilityDeclarationAST::clone(MemoryPool *pool) const |
|
1413 { |
|
1414 ObjCVisibilityDeclarationAST *ast = new (pool) ObjCVisibilityDeclarationAST; |
|
1415 ast->visibility_token = visibility_token; |
|
1416 return ast; |
|
1417 } |
|
1418 |
|
1419 ObjCPropertyAttributeAST *ObjCPropertyAttributeAST::clone(MemoryPool *pool) const |
|
1420 { |
|
1421 ObjCPropertyAttributeAST *ast = new (pool) ObjCPropertyAttributeAST; |
|
1422 ast->attribute_identifier_token = attribute_identifier_token; |
|
1423 ast->equals_token = equals_token; |
|
1424 if (method_selector) |
|
1425 ast->method_selector = method_selector->clone(pool); |
|
1426 return ast; |
|
1427 } |
|
1428 |
|
1429 ObjCPropertyDeclarationAST *ObjCPropertyDeclarationAST::clone(MemoryPool *pool) const |
|
1430 { |
|
1431 ObjCPropertyDeclarationAST *ast = new (pool) ObjCPropertyDeclarationAST; |
|
1432 for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list; |
|
1433 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1434 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1435 ast->property_token = property_token; |
|
1436 ast->lparen_token = lparen_token; |
|
1437 for (ObjCPropertyAttributeListAST *iter = property_attribute_list, **ast_iter = &ast->property_attribute_list; |
|
1438 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1439 *ast_iter = new (pool) ObjCPropertyAttributeListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1440 ast->rparen_token = rparen_token; |
|
1441 if (simple_declaration) |
|
1442 ast->simple_declaration = simple_declaration->clone(pool); |
|
1443 return ast; |
|
1444 } |
|
1445 |
|
1446 ObjCMessageArgumentDeclarationAST *ObjCMessageArgumentDeclarationAST::clone(MemoryPool *pool) const |
|
1447 { |
|
1448 ObjCMessageArgumentDeclarationAST *ast = new (pool) ObjCMessageArgumentDeclarationAST; |
|
1449 if (type_name) |
|
1450 ast->type_name = type_name->clone(pool); |
|
1451 for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list; |
|
1452 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1453 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1454 ast->param_name_token = param_name_token; |
|
1455 return ast; |
|
1456 } |
|
1457 |
|
1458 ObjCMethodPrototypeAST *ObjCMethodPrototypeAST::clone(MemoryPool *pool) const |
|
1459 { |
|
1460 ObjCMethodPrototypeAST *ast = new (pool) ObjCMethodPrototypeAST; |
|
1461 ast->method_type_token = method_type_token; |
|
1462 if (type_name) |
|
1463 ast->type_name = type_name->clone(pool); |
|
1464 if (selector) |
|
1465 ast->selector = selector->clone(pool); |
|
1466 for (ObjCMessageArgumentDeclarationListAST *iter = argument_list, **ast_iter = &ast->argument_list; |
|
1467 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1468 *ast_iter = new (pool) ObjCMessageArgumentDeclarationListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1469 ast->dot_dot_dot_token = dot_dot_dot_token; |
|
1470 for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list; |
|
1471 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1472 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1473 return ast; |
|
1474 } |
|
1475 |
|
1476 ObjCMethodDeclarationAST *ObjCMethodDeclarationAST::clone(MemoryPool *pool) const |
|
1477 { |
|
1478 ObjCMethodDeclarationAST *ast = new (pool) ObjCMethodDeclarationAST; |
|
1479 if (method_prototype) |
|
1480 ast->method_prototype = method_prototype->clone(pool); |
|
1481 if (function_body) |
|
1482 ast->function_body = function_body->clone(pool); |
|
1483 ast->semicolon_token = semicolon_token; |
|
1484 return ast; |
|
1485 } |
|
1486 |
|
1487 ObjCSynthesizedPropertyAST *ObjCSynthesizedPropertyAST::clone(MemoryPool *pool) const |
|
1488 { |
|
1489 ObjCSynthesizedPropertyAST *ast = new (pool) ObjCSynthesizedPropertyAST; |
|
1490 ast->property_identifier_token = property_identifier_token; |
|
1491 ast->equals_token = equals_token; |
|
1492 ast->alias_identifier_token = alias_identifier_token; |
|
1493 return ast; |
|
1494 } |
|
1495 |
|
1496 ObjCSynthesizedPropertiesDeclarationAST *ObjCSynthesizedPropertiesDeclarationAST::clone(MemoryPool *pool) const |
|
1497 { |
|
1498 ObjCSynthesizedPropertiesDeclarationAST *ast = new (pool) ObjCSynthesizedPropertiesDeclarationAST; |
|
1499 ast->synthesized_token = synthesized_token; |
|
1500 for (ObjCSynthesizedPropertyListAST *iter = property_identifier_list, **ast_iter = &ast->property_identifier_list; |
|
1501 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1502 *ast_iter = new (pool) ObjCSynthesizedPropertyListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1503 ast->semicolon_token = semicolon_token; |
|
1504 return ast; |
|
1505 } |
|
1506 |
|
1507 ObjCDynamicPropertiesDeclarationAST *ObjCDynamicPropertiesDeclarationAST::clone(MemoryPool *pool) const |
|
1508 { |
|
1509 ObjCDynamicPropertiesDeclarationAST *ast = new (pool) ObjCDynamicPropertiesDeclarationAST; |
|
1510 ast->dynamic_token = dynamic_token; |
|
1511 for (ObjCIdentifierListAST *iter = property_identifier_list, **ast_iter = &ast->property_identifier_list; |
|
1512 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1513 *ast_iter = new (pool) ObjCIdentifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1514 ast->semicolon_token = semicolon_token; |
|
1515 return ast; |
|
1516 } |
|
1517 |
|
1518 ObjCFastEnumerationAST *ObjCFastEnumerationAST::clone(MemoryPool *pool) const |
|
1519 { |
|
1520 ObjCFastEnumerationAST *ast = new (pool) ObjCFastEnumerationAST; |
|
1521 ast->for_token = for_token; |
|
1522 ast->lparen_token = lparen_token; |
|
1523 for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list; |
|
1524 iter; iter = iter->next, ast_iter = &(*ast_iter)->next) |
|
1525 *ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0); |
|
1526 if (declarator) |
|
1527 ast->declarator = declarator->clone(pool); |
|
1528 if (initializer) |
|
1529 ast->initializer = initializer->clone(pool); |
|
1530 ast->in_token = in_token; |
|
1531 if (fast_enumeratable_expression) |
|
1532 ast->fast_enumeratable_expression = fast_enumeratable_expression->clone(pool); |
|
1533 ast->rparen_token = rparen_token; |
|
1534 if (statement) |
|
1535 ast->statement = statement->clone(pool); |
|
1536 return ast; |
|
1537 } |
|
1538 |
|
1539 ObjCSynchronizedStatementAST *ObjCSynchronizedStatementAST::clone(MemoryPool *pool) const |
|
1540 { |
|
1541 ObjCSynchronizedStatementAST *ast = new (pool) ObjCSynchronizedStatementAST; |
|
1542 ast->synchronized_token = synchronized_token; |
|
1543 ast->lparen_token = lparen_token; |
|
1544 if (synchronized_object) |
|
1545 ast->synchronized_object = synchronized_object->clone(pool); |
|
1546 ast->rparen_token = rparen_token; |
|
1547 if (statement) |
|
1548 ast->statement = statement->clone(pool); |
|
1549 return ast; |
|
1550 } |
|
1551 |