1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 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 QtDeclarative module of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
14 | ** a written agreement between you and Nokia.
|
---|
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 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you have questions regarding the use of this file, please contact
|
---|
37 | ** Nokia at qt-info@nokia.com.
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | #include "private/qdeclarativejsast_p.h"
|
---|
43 |
|
---|
44 | #include "private/qdeclarativejsastvisitor_p.h"
|
---|
45 |
|
---|
46 | QT_QML_BEGIN_NAMESPACE
|
---|
47 |
|
---|
48 | namespace QDeclarativeJS { namespace AST {
|
---|
49 |
|
---|
50 | void Node::accept(Visitor *visitor)
|
---|
51 | {
|
---|
52 | if (visitor->preVisit(this)) {
|
---|
53 | accept0(visitor);
|
---|
54 | }
|
---|
55 | visitor->postVisit(this);
|
---|
56 | }
|
---|
57 |
|
---|
58 | void Node::accept(Node *node, Visitor *visitor)
|
---|
59 | {
|
---|
60 | if (node)
|
---|
61 | node->accept(visitor);
|
---|
62 | }
|
---|
63 |
|
---|
64 | ExpressionNode *Node::expressionCast()
|
---|
65 | {
|
---|
66 | return 0;
|
---|
67 | }
|
---|
68 |
|
---|
69 | BinaryExpression *Node::binaryExpressionCast()
|
---|
70 | {
|
---|
71 | return 0;
|
---|
72 | }
|
---|
73 |
|
---|
74 | Statement *Node::statementCast()
|
---|
75 | {
|
---|
76 | return 0;
|
---|
77 | }
|
---|
78 |
|
---|
79 | UiObjectMember *Node::uiObjectMemberCast()
|
---|
80 | {
|
---|
81 | return 0;
|
---|
82 | }
|
---|
83 |
|
---|
84 | ExpressionNode *ExpressionNode::expressionCast()
|
---|
85 | {
|
---|
86 | return this;
|
---|
87 | }
|
---|
88 |
|
---|
89 | BinaryExpression *BinaryExpression::binaryExpressionCast()
|
---|
90 | {
|
---|
91 | return this;
|
---|
92 | }
|
---|
93 |
|
---|
94 | Statement *Statement::statementCast()
|
---|
95 | {
|
---|
96 | return this;
|
---|
97 | }
|
---|
98 |
|
---|
99 | UiObjectMember *UiObjectMember::uiObjectMemberCast()
|
---|
100 | {
|
---|
101 | return this;
|
---|
102 | }
|
---|
103 |
|
---|
104 | void NestedExpression::accept0(Visitor *visitor)
|
---|
105 | {
|
---|
106 | if (visitor->visit(this)) {
|
---|
107 | accept(expression, visitor);
|
---|
108 | }
|
---|
109 | visitor->endVisit(this);
|
---|
110 | }
|
---|
111 |
|
---|
112 | void ThisExpression::accept0(Visitor *visitor)
|
---|
113 | {
|
---|
114 | if (visitor->visit(this)) {
|
---|
115 | }
|
---|
116 |
|
---|
117 | visitor->endVisit(this);
|
---|
118 | }
|
---|
119 |
|
---|
120 | void IdentifierExpression::accept0(Visitor *visitor)
|
---|
121 | {
|
---|
122 | if (visitor->visit(this)) {
|
---|
123 | }
|
---|
124 |
|
---|
125 | visitor->endVisit(this);
|
---|
126 | }
|
---|
127 |
|
---|
128 | void NullExpression::accept0(Visitor *visitor)
|
---|
129 | {
|
---|
130 | if (visitor->visit(this)) {
|
---|
131 | }
|
---|
132 |
|
---|
133 | visitor->endVisit(this);
|
---|
134 | }
|
---|
135 |
|
---|
136 | void TrueLiteral::accept0(Visitor *visitor)
|
---|
137 | {
|
---|
138 | if (visitor->visit(this)) {
|
---|
139 | }
|
---|
140 |
|
---|
141 | visitor->endVisit(this);
|
---|
142 | }
|
---|
143 |
|
---|
144 | void FalseLiteral::accept0(Visitor *visitor)
|
---|
145 | {
|
---|
146 | if (visitor->visit(this)) {
|
---|
147 | }
|
---|
148 |
|
---|
149 | visitor->endVisit(this);
|
---|
150 | }
|
---|
151 |
|
---|
152 | void StringLiteral::accept0(Visitor *visitor)
|
---|
153 | {
|
---|
154 | if (visitor->visit(this)) {
|
---|
155 | }
|
---|
156 |
|
---|
157 | visitor->endVisit(this);
|
---|
158 | }
|
---|
159 |
|
---|
160 | void NumericLiteral::accept0(Visitor *visitor)
|
---|
161 | {
|
---|
162 | if (visitor->visit(this)) {
|
---|
163 | }
|
---|
164 |
|
---|
165 | visitor->endVisit(this);
|
---|
166 | }
|
---|
167 |
|
---|
168 | void RegExpLiteral::accept0(Visitor *visitor)
|
---|
169 | {
|
---|
170 | if (visitor->visit(this)) {
|
---|
171 | }
|
---|
172 |
|
---|
173 | visitor->endVisit(this);
|
---|
174 | }
|
---|
175 |
|
---|
176 | void ArrayLiteral::accept0(Visitor *visitor)
|
---|
177 | {
|
---|
178 | if (visitor->visit(this)) {
|
---|
179 | accept(elements, visitor);
|
---|
180 | accept(elision, visitor);
|
---|
181 | }
|
---|
182 |
|
---|
183 | visitor->endVisit(this);
|
---|
184 | }
|
---|
185 |
|
---|
186 | void ObjectLiteral::accept0(Visitor *visitor)
|
---|
187 | {
|
---|
188 | if (visitor->visit(this)) {
|
---|
189 | accept(properties, visitor);
|
---|
190 | }
|
---|
191 |
|
---|
192 | visitor->endVisit(this);
|
---|
193 | }
|
---|
194 |
|
---|
195 | void ElementList::accept0(Visitor *visitor)
|
---|
196 | {
|
---|
197 | if (visitor->visit(this)) {
|
---|
198 | for (ElementList *it = this; it; it = it->next) {
|
---|
199 | accept(it->elision, visitor);
|
---|
200 | accept(it->expression, visitor);
|
---|
201 | }
|
---|
202 | }
|
---|
203 |
|
---|
204 | visitor->endVisit(this);
|
---|
205 | }
|
---|
206 |
|
---|
207 | void Elision::accept0(Visitor *visitor)
|
---|
208 | {
|
---|
209 | if (visitor->visit(this)) {
|
---|
210 | // ###
|
---|
211 | }
|
---|
212 |
|
---|
213 | visitor->endVisit(this);
|
---|
214 | }
|
---|
215 |
|
---|
216 | void PropertyNameAndValueList::accept0(Visitor *visitor)
|
---|
217 | {
|
---|
218 | if (visitor->visit(this)) {
|
---|
219 | for (PropertyNameAndValueList *it = this; it; it = it->next) {
|
---|
220 | accept(it->name, visitor);
|
---|
221 | accept(it->value, visitor);
|
---|
222 | }
|
---|
223 | }
|
---|
224 |
|
---|
225 | visitor->endVisit(this);
|
---|
226 | }
|
---|
227 |
|
---|
228 | void IdentifierPropertyName::accept0(Visitor *visitor)
|
---|
229 | {
|
---|
230 | if (visitor->visit(this)) {
|
---|
231 | }
|
---|
232 |
|
---|
233 | visitor->endVisit(this);
|
---|
234 | }
|
---|
235 |
|
---|
236 | void StringLiteralPropertyName::accept0(Visitor *visitor)
|
---|
237 | {
|
---|
238 | if (visitor->visit(this)) {
|
---|
239 | }
|
---|
240 |
|
---|
241 | visitor->endVisit(this);
|
---|
242 | }
|
---|
243 |
|
---|
244 | void NumericLiteralPropertyName::accept0(Visitor *visitor)
|
---|
245 | {
|
---|
246 | if (visitor->visit(this)) {
|
---|
247 | }
|
---|
248 |
|
---|
249 | visitor->endVisit(this);
|
---|
250 | }
|
---|
251 |
|
---|
252 | void ArrayMemberExpression::accept0(Visitor *visitor)
|
---|
253 | {
|
---|
254 | if (visitor->visit(this)) {
|
---|
255 | accept(base, visitor);
|
---|
256 | accept(expression, visitor);
|
---|
257 | }
|
---|
258 |
|
---|
259 | visitor->endVisit(this);
|
---|
260 | }
|
---|
261 |
|
---|
262 | void FieldMemberExpression::accept0(Visitor *visitor)
|
---|
263 | {
|
---|
264 | if (visitor->visit(this)) {
|
---|
265 | accept(base, visitor);
|
---|
266 | }
|
---|
267 |
|
---|
268 | visitor->endVisit(this);
|
---|
269 | }
|
---|
270 |
|
---|
271 | void NewMemberExpression::accept0(Visitor *visitor)
|
---|
272 | {
|
---|
273 | if (visitor->visit(this)) {
|
---|
274 | accept(base, visitor);
|
---|
275 | accept(arguments, visitor);
|
---|
276 | }
|
---|
277 |
|
---|
278 | visitor->endVisit(this);
|
---|
279 | }
|
---|
280 |
|
---|
281 | void NewExpression::accept0(Visitor *visitor)
|
---|
282 | {
|
---|
283 | if (visitor->visit(this)) {
|
---|
284 | accept(expression, visitor);
|
---|
285 | }
|
---|
286 |
|
---|
287 | visitor->endVisit(this);
|
---|
288 | }
|
---|
289 |
|
---|
290 | void CallExpression::accept0(Visitor *visitor)
|
---|
291 | {
|
---|
292 | if (visitor->visit(this)) {
|
---|
293 | accept(base, visitor);
|
---|
294 | accept(arguments, visitor);
|
---|
295 | }
|
---|
296 |
|
---|
297 | visitor->endVisit(this);
|
---|
298 | }
|
---|
299 |
|
---|
300 | void ArgumentList::accept0(Visitor *visitor)
|
---|
301 | {
|
---|
302 | if (visitor->visit(this)) {
|
---|
303 | for (ArgumentList *it = this; it; it = it->next) {
|
---|
304 | accept(it->expression, visitor);
|
---|
305 | }
|
---|
306 | }
|
---|
307 |
|
---|
308 | visitor->endVisit(this);
|
---|
309 | }
|
---|
310 |
|
---|
311 | void PostIncrementExpression::accept0(Visitor *visitor)
|
---|
312 | {
|
---|
313 | if (visitor->visit(this)) {
|
---|
314 | accept(base, visitor);
|
---|
315 | }
|
---|
316 |
|
---|
317 | visitor->endVisit(this);
|
---|
318 | }
|
---|
319 |
|
---|
320 | void PostDecrementExpression::accept0(Visitor *visitor)
|
---|
321 | {
|
---|
322 | if (visitor->visit(this)) {
|
---|
323 | accept(base, visitor);
|
---|
324 | }
|
---|
325 |
|
---|
326 | visitor->endVisit(this);
|
---|
327 | }
|
---|
328 |
|
---|
329 | void DeleteExpression::accept0(Visitor *visitor)
|
---|
330 | {
|
---|
331 | if (visitor->visit(this)) {
|
---|
332 | accept(expression, visitor);
|
---|
333 | }
|
---|
334 |
|
---|
335 | visitor->endVisit(this);
|
---|
336 | }
|
---|
337 |
|
---|
338 | void VoidExpression::accept0(Visitor *visitor)
|
---|
339 | {
|
---|
340 | if (visitor->visit(this)) {
|
---|
341 | accept(expression, visitor);
|
---|
342 | }
|
---|
343 |
|
---|
344 | visitor->endVisit(this);
|
---|
345 | }
|
---|
346 |
|
---|
347 | void TypeOfExpression::accept0(Visitor *visitor)
|
---|
348 | {
|
---|
349 | if (visitor->visit(this)) {
|
---|
350 | accept(expression, visitor);
|
---|
351 | }
|
---|
352 |
|
---|
353 | visitor->endVisit(this);
|
---|
354 | }
|
---|
355 |
|
---|
356 | void PreIncrementExpression::accept0(Visitor *visitor)
|
---|
357 | {
|
---|
358 | if (visitor->visit(this)) {
|
---|
359 | accept(expression, visitor);
|
---|
360 | }
|
---|
361 |
|
---|
362 | visitor->endVisit(this);
|
---|
363 | }
|
---|
364 |
|
---|
365 | void PreDecrementExpression::accept0(Visitor *visitor)
|
---|
366 | {
|
---|
367 | if (visitor->visit(this)) {
|
---|
368 | accept(expression, visitor);
|
---|
369 | }
|
---|
370 |
|
---|
371 | visitor->endVisit(this);
|
---|
372 | }
|
---|
373 |
|
---|
374 | void UnaryPlusExpression::accept0(Visitor *visitor)
|
---|
375 | {
|
---|
376 | if (visitor->visit(this)) {
|
---|
377 | accept(expression, visitor);
|
---|
378 | }
|
---|
379 |
|
---|
380 | visitor->endVisit(this);
|
---|
381 | }
|
---|
382 |
|
---|
383 | void UnaryMinusExpression::accept0(Visitor *visitor)
|
---|
384 | {
|
---|
385 | if (visitor->visit(this)) {
|
---|
386 | accept(expression, visitor);
|
---|
387 | }
|
---|
388 |
|
---|
389 | visitor->endVisit(this);
|
---|
390 | }
|
---|
391 |
|
---|
392 | void TildeExpression::accept0(Visitor *visitor)
|
---|
393 | {
|
---|
394 | if (visitor->visit(this)) {
|
---|
395 | accept(expression, visitor);
|
---|
396 | }
|
---|
397 |
|
---|
398 | visitor->endVisit(this);
|
---|
399 | }
|
---|
400 |
|
---|
401 | void NotExpression::accept0(Visitor *visitor)
|
---|
402 | {
|
---|
403 | if (visitor->visit(this)) {
|
---|
404 | accept(expression, visitor);
|
---|
405 | }
|
---|
406 |
|
---|
407 | visitor->endVisit(this);
|
---|
408 | }
|
---|
409 |
|
---|
410 | void BinaryExpression::accept0(Visitor *visitor)
|
---|
411 | {
|
---|
412 | if (visitor->visit(this)) {
|
---|
413 | accept(left, visitor);
|
---|
414 | accept(right, visitor);
|
---|
415 | }
|
---|
416 |
|
---|
417 | visitor->endVisit(this);
|
---|
418 | }
|
---|
419 |
|
---|
420 | void ConditionalExpression::accept0(Visitor *visitor)
|
---|
421 | {
|
---|
422 | if (visitor->visit(this)) {
|
---|
423 | accept(expression, visitor);
|
---|
424 | accept(ok, visitor);
|
---|
425 | accept(ko, visitor);
|
---|
426 | }
|
---|
427 |
|
---|
428 | visitor->endVisit(this);
|
---|
429 | }
|
---|
430 |
|
---|
431 | void Expression::accept0(Visitor *visitor)
|
---|
432 | {
|
---|
433 | if (visitor->visit(this)) {
|
---|
434 | accept(left, visitor);
|
---|
435 | accept(right, visitor);
|
---|
436 | }
|
---|
437 |
|
---|
438 | visitor->endVisit(this);
|
---|
439 | }
|
---|
440 |
|
---|
441 | void Block::accept0(Visitor *visitor)
|
---|
442 | {
|
---|
443 | if (visitor->visit(this)) {
|
---|
444 | accept(statements, visitor);
|
---|
445 | }
|
---|
446 |
|
---|
447 | visitor->endVisit(this);
|
---|
448 | }
|
---|
449 |
|
---|
450 | void StatementList::accept0(Visitor *visitor)
|
---|
451 | {
|
---|
452 | if (visitor->visit(this)) {
|
---|
453 | for (StatementList *it = this; it; it = it->next) {
|
---|
454 | accept(it->statement, visitor);
|
---|
455 | }
|
---|
456 | }
|
---|
457 |
|
---|
458 | visitor->endVisit(this);
|
---|
459 | }
|
---|
460 |
|
---|
461 | void VariableStatement::accept0(Visitor *visitor)
|
---|
462 | {
|
---|
463 | if (visitor->visit(this)) {
|
---|
464 | accept(declarations, visitor);
|
---|
465 | }
|
---|
466 |
|
---|
467 | visitor->endVisit(this);
|
---|
468 | }
|
---|
469 |
|
---|
470 | void VariableDeclarationList::accept0(Visitor *visitor)
|
---|
471 | {
|
---|
472 | if (visitor->visit(this)) {
|
---|
473 | for (VariableDeclarationList *it = this; it; it = it->next) {
|
---|
474 | accept(it->declaration, visitor);
|
---|
475 | }
|
---|
476 | }
|
---|
477 |
|
---|
478 | visitor->endVisit(this);
|
---|
479 | }
|
---|
480 |
|
---|
481 | void VariableDeclaration::accept0(Visitor *visitor)
|
---|
482 | {
|
---|
483 | if (visitor->visit(this)) {
|
---|
484 | accept(expression, visitor);
|
---|
485 | }
|
---|
486 |
|
---|
487 | visitor->endVisit(this);
|
---|
488 | }
|
---|
489 |
|
---|
490 | void EmptyStatement::accept0(Visitor *visitor)
|
---|
491 | {
|
---|
492 | if (visitor->visit(this)) {
|
---|
493 | }
|
---|
494 |
|
---|
495 | visitor->endVisit(this);
|
---|
496 | }
|
---|
497 |
|
---|
498 | void ExpressionStatement::accept0(Visitor *visitor)
|
---|
499 | {
|
---|
500 | if (visitor->visit(this)) {
|
---|
501 | accept(expression, visitor);
|
---|
502 | }
|
---|
503 |
|
---|
504 | visitor->endVisit(this);
|
---|
505 | }
|
---|
506 |
|
---|
507 | void IfStatement::accept0(Visitor *visitor)
|
---|
508 | {
|
---|
509 | if (visitor->visit(this)) {
|
---|
510 | accept(expression, visitor);
|
---|
511 | accept(ok, visitor);
|
---|
512 | accept(ko, visitor);
|
---|
513 | }
|
---|
514 |
|
---|
515 | visitor->endVisit(this);
|
---|
516 | }
|
---|
517 |
|
---|
518 | void DoWhileStatement::accept0(Visitor *visitor)
|
---|
519 | {
|
---|
520 | if (visitor->visit(this)) {
|
---|
521 | accept(statement, visitor);
|
---|
522 | accept(expression, visitor);
|
---|
523 | }
|
---|
524 |
|
---|
525 | visitor->endVisit(this);
|
---|
526 | }
|
---|
527 |
|
---|
528 | void WhileStatement::accept0(Visitor *visitor)
|
---|
529 | {
|
---|
530 | if (visitor->visit(this)) {
|
---|
531 | accept(expression, visitor);
|
---|
532 | accept(statement, visitor);
|
---|
533 | }
|
---|
534 |
|
---|
535 | visitor->endVisit(this);
|
---|
536 | }
|
---|
537 |
|
---|
538 | void ForStatement::accept0(Visitor *visitor)
|
---|
539 | {
|
---|
540 | if (visitor->visit(this)) {
|
---|
541 | accept(initialiser, visitor);
|
---|
542 | accept(condition, visitor);
|
---|
543 | accept(expression, visitor);
|
---|
544 | accept(statement, visitor);
|
---|
545 | }
|
---|
546 |
|
---|
547 | visitor->endVisit(this);
|
---|
548 | }
|
---|
549 |
|
---|
550 | void LocalForStatement::accept0(Visitor *visitor)
|
---|
551 | {
|
---|
552 | if (visitor->visit(this)) {
|
---|
553 | accept(declarations, visitor);
|
---|
554 | accept(condition, visitor);
|
---|
555 | accept(expression, visitor);
|
---|
556 | accept(statement, visitor);
|
---|
557 | }
|
---|
558 |
|
---|
559 | visitor->endVisit(this);
|
---|
560 | }
|
---|
561 |
|
---|
562 | void ForEachStatement::accept0(Visitor *visitor)
|
---|
563 | {
|
---|
564 | if (visitor->visit(this)) {
|
---|
565 | accept(initialiser, visitor);
|
---|
566 | accept(expression, visitor);
|
---|
567 | accept(statement, visitor);
|
---|
568 | }
|
---|
569 |
|
---|
570 | visitor->endVisit(this);
|
---|
571 | }
|
---|
572 |
|
---|
573 | void LocalForEachStatement::accept0(Visitor *visitor)
|
---|
574 | {
|
---|
575 | if (visitor->visit(this)) {
|
---|
576 | accept(declaration, visitor);
|
---|
577 | accept(expression, visitor);
|
---|
578 | accept(statement, visitor);
|
---|
579 | }
|
---|
580 |
|
---|
581 | visitor->endVisit(this);
|
---|
582 | }
|
---|
583 |
|
---|
584 | void ContinueStatement::accept0(Visitor *visitor)
|
---|
585 | {
|
---|
586 | if (visitor->visit(this)) {
|
---|
587 | }
|
---|
588 |
|
---|
589 | visitor->endVisit(this);
|
---|
590 | }
|
---|
591 |
|
---|
592 | void BreakStatement::accept0(Visitor *visitor)
|
---|
593 | {
|
---|
594 | if (visitor->visit(this)) {
|
---|
595 | }
|
---|
596 |
|
---|
597 | visitor->endVisit(this);
|
---|
598 | }
|
---|
599 |
|
---|
600 | void ReturnStatement::accept0(Visitor *visitor)
|
---|
601 | {
|
---|
602 | if (visitor->visit(this)) {
|
---|
603 | accept(expression, visitor);
|
---|
604 | }
|
---|
605 |
|
---|
606 | visitor->endVisit(this);
|
---|
607 | }
|
---|
608 |
|
---|
609 | void WithStatement::accept0(Visitor *visitor)
|
---|
610 | {
|
---|
611 | if (visitor->visit(this)) {
|
---|
612 | accept(expression, visitor);
|
---|
613 | accept(statement, visitor);
|
---|
614 | }
|
---|
615 |
|
---|
616 | visitor->endVisit(this);
|
---|
617 | }
|
---|
618 |
|
---|
619 | void SwitchStatement::accept0(Visitor *visitor)
|
---|
620 | {
|
---|
621 | if (visitor->visit(this)) {
|
---|
622 | accept(expression, visitor);
|
---|
623 | accept(block, visitor);
|
---|
624 | }
|
---|
625 |
|
---|
626 | visitor->endVisit(this);
|
---|
627 | }
|
---|
628 |
|
---|
629 | void CaseBlock::accept0(Visitor *visitor)
|
---|
630 | {
|
---|
631 | if (visitor->visit(this)) {
|
---|
632 | accept(clauses, visitor);
|
---|
633 | accept(defaultClause, visitor);
|
---|
634 | accept(moreClauses, visitor);
|
---|
635 | }
|
---|
636 |
|
---|
637 | visitor->endVisit(this);
|
---|
638 | }
|
---|
639 |
|
---|
640 | void CaseClauses::accept0(Visitor *visitor)
|
---|
641 | {
|
---|
642 | if (visitor->visit(this)) {
|
---|
643 | for (CaseClauses *it = this; it; it = it->next) {
|
---|
644 | accept(it->clause, visitor);
|
---|
645 | }
|
---|
646 | }
|
---|
647 |
|
---|
648 | visitor->endVisit(this);
|
---|
649 | }
|
---|
650 |
|
---|
651 | void CaseClause::accept0(Visitor *visitor)
|
---|
652 | {
|
---|
653 | if (visitor->visit(this)) {
|
---|
654 | accept(expression, visitor);
|
---|
655 | accept(statements, visitor);
|
---|
656 | }
|
---|
657 |
|
---|
658 | visitor->endVisit(this);
|
---|
659 | }
|
---|
660 |
|
---|
661 | void DefaultClause::accept0(Visitor *visitor)
|
---|
662 | {
|
---|
663 | if (visitor->visit(this)) {
|
---|
664 | accept(statements, visitor);
|
---|
665 | }
|
---|
666 |
|
---|
667 | visitor->endVisit(this);
|
---|
668 | }
|
---|
669 |
|
---|
670 | void LabelledStatement::accept0(Visitor *visitor)
|
---|
671 | {
|
---|
672 | if (visitor->visit(this)) {
|
---|
673 | accept(statement, visitor);
|
---|
674 | }
|
---|
675 |
|
---|
676 | visitor->endVisit(this);
|
---|
677 | }
|
---|
678 |
|
---|
679 | void ThrowStatement::accept0(Visitor *visitor)
|
---|
680 | {
|
---|
681 | if (visitor->visit(this)) {
|
---|
682 | accept(expression, visitor);
|
---|
683 | }
|
---|
684 |
|
---|
685 | visitor->endVisit(this);
|
---|
686 | }
|
---|
687 |
|
---|
688 | void TryStatement::accept0(Visitor *visitor)
|
---|
689 | {
|
---|
690 | if (visitor->visit(this)) {
|
---|
691 | accept(statement, visitor);
|
---|
692 | accept(catchExpression, visitor);
|
---|
693 | accept(finallyExpression, visitor);
|
---|
694 | }
|
---|
695 |
|
---|
696 | visitor->endVisit(this);
|
---|
697 | }
|
---|
698 |
|
---|
699 | void Catch::accept0(Visitor *visitor)
|
---|
700 | {
|
---|
701 | if (visitor->visit(this)) {
|
---|
702 | accept(statement, visitor);
|
---|
703 | }
|
---|
704 |
|
---|
705 | visitor->endVisit(this);
|
---|
706 | }
|
---|
707 |
|
---|
708 | void Finally::accept0(Visitor *visitor)
|
---|
709 | {
|
---|
710 | if (visitor->visit(this)) {
|
---|
711 | accept(statement, visitor);
|
---|
712 | }
|
---|
713 |
|
---|
714 | visitor->endVisit(this);
|
---|
715 | }
|
---|
716 |
|
---|
717 | void FunctionDeclaration::accept0(Visitor *visitor)
|
---|
718 | {
|
---|
719 | if (visitor->visit(this)) {
|
---|
720 | accept(formals, visitor);
|
---|
721 | accept(body, visitor);
|
---|
722 | }
|
---|
723 |
|
---|
724 | visitor->endVisit(this);
|
---|
725 | }
|
---|
726 |
|
---|
727 | void FunctionExpression::accept0(Visitor *visitor)
|
---|
728 | {
|
---|
729 | if (visitor->visit(this)) {
|
---|
730 | accept(formals, visitor);
|
---|
731 | accept(body, visitor);
|
---|
732 | }
|
---|
733 |
|
---|
734 | visitor->endVisit(this);
|
---|
735 | }
|
---|
736 |
|
---|
737 | void FormalParameterList::accept0(Visitor *visitor)
|
---|
738 | {
|
---|
739 | if (visitor->visit(this)) {
|
---|
740 | // ###
|
---|
741 | }
|
---|
742 |
|
---|
743 | visitor->endVisit(this);
|
---|
744 | }
|
---|
745 |
|
---|
746 | void FunctionBody::accept0(Visitor *visitor)
|
---|
747 | {
|
---|
748 | if (visitor->visit(this)) {
|
---|
749 | accept(elements, visitor);
|
---|
750 | }
|
---|
751 |
|
---|
752 | visitor->endVisit(this);
|
---|
753 | }
|
---|
754 |
|
---|
755 | void Program::accept0(Visitor *visitor)
|
---|
756 | {
|
---|
757 | if (visitor->visit(this)) {
|
---|
758 | accept(elements, visitor);
|
---|
759 | }
|
---|
760 |
|
---|
761 | visitor->endVisit(this);
|
---|
762 | }
|
---|
763 |
|
---|
764 | void SourceElements::accept0(Visitor *visitor)
|
---|
765 | {
|
---|
766 | if (visitor->visit(this)) {
|
---|
767 | for (SourceElements *it = this; it; it = it->next) {
|
---|
768 | accept(it->element, visitor);
|
---|
769 | }
|
---|
770 | }
|
---|
771 |
|
---|
772 | visitor->endVisit(this);
|
---|
773 | }
|
---|
774 |
|
---|
775 | void FunctionSourceElement::accept0(Visitor *visitor)
|
---|
776 | {
|
---|
777 | if (visitor->visit(this)) {
|
---|
778 | accept(declaration, visitor);
|
---|
779 | }
|
---|
780 |
|
---|
781 | visitor->endVisit(this);
|
---|
782 | }
|
---|
783 |
|
---|
784 | void StatementSourceElement::accept0(Visitor *visitor)
|
---|
785 | {
|
---|
786 | if (visitor->visit(this)) {
|
---|
787 | accept(statement, visitor);
|
---|
788 | }
|
---|
789 |
|
---|
790 | visitor->endVisit(this);
|
---|
791 | }
|
---|
792 |
|
---|
793 | void DebuggerStatement::accept0(Visitor *visitor)
|
---|
794 | {
|
---|
795 | if (visitor->visit(this)) {
|
---|
796 | }
|
---|
797 |
|
---|
798 | visitor->endVisit(this);
|
---|
799 | }
|
---|
800 |
|
---|
801 | void UiProgram::accept0(Visitor *visitor)
|
---|
802 | {
|
---|
803 | if (visitor->visit(this)) {
|
---|
804 | accept(imports, visitor);
|
---|
805 | accept(members, visitor);
|
---|
806 | }
|
---|
807 |
|
---|
808 | visitor->endVisit(this);
|
---|
809 | }
|
---|
810 |
|
---|
811 | void UiSignature::accept0(Visitor *visitor)
|
---|
812 | {
|
---|
813 | if (visitor->visit(this)) {
|
---|
814 | accept(formals, visitor);
|
---|
815 | }
|
---|
816 | visitor->endVisit(this);
|
---|
817 | }
|
---|
818 |
|
---|
819 | void UiFormalList::accept0(Visitor *visitor)
|
---|
820 | {
|
---|
821 | if (visitor->visit(this)) {
|
---|
822 | for (UiFormalList *it = this; it; it = it->next) {
|
---|
823 | accept(it->formal, visitor);
|
---|
824 | }
|
---|
825 | }
|
---|
826 | visitor->endVisit(this);
|
---|
827 | }
|
---|
828 |
|
---|
829 | void UiFormal::accept0(Visitor *visitor)
|
---|
830 | {
|
---|
831 | if (visitor->visit(this)) {
|
---|
832 | }
|
---|
833 | visitor->endVisit(this);
|
---|
834 | }
|
---|
835 |
|
---|
836 | void UiPublicMember::accept0(Visitor *visitor)
|
---|
837 | {
|
---|
838 | if (visitor->visit(this)) {
|
---|
839 | accept(expression, visitor);
|
---|
840 | accept(binding, visitor);
|
---|
841 | }
|
---|
842 |
|
---|
843 | visitor->endVisit(this);
|
---|
844 | }
|
---|
845 |
|
---|
846 | void UiObjectDefinition::accept0(Visitor *visitor)
|
---|
847 | {
|
---|
848 | if (visitor->visit(this)) {
|
---|
849 | accept(qualifiedTypeNameId, visitor);
|
---|
850 | accept(initializer, visitor);
|
---|
851 | }
|
---|
852 |
|
---|
853 | visitor->endVisit(this);
|
---|
854 | }
|
---|
855 |
|
---|
856 | void UiObjectInitializer::accept0(Visitor *visitor)
|
---|
857 | {
|
---|
858 | if (visitor->visit(this)) {
|
---|
859 | accept(members, visitor);
|
---|
860 | }
|
---|
861 |
|
---|
862 | visitor->endVisit(this);
|
---|
863 | }
|
---|
864 |
|
---|
865 | void UiObjectBinding::accept0(Visitor *visitor)
|
---|
866 | {
|
---|
867 | if (visitor->visit(this)) {
|
---|
868 | accept(qualifiedId, visitor);
|
---|
869 | accept(qualifiedTypeNameId, visitor);
|
---|
870 | accept(initializer, visitor);
|
---|
871 | }
|
---|
872 |
|
---|
873 | visitor->endVisit(this);
|
---|
874 | }
|
---|
875 |
|
---|
876 | void UiScriptBinding::accept0(Visitor *visitor)
|
---|
877 | {
|
---|
878 | if (visitor->visit(this)) {
|
---|
879 | accept(qualifiedId, visitor);
|
---|
880 | accept(statement, visitor);
|
---|
881 | }
|
---|
882 |
|
---|
883 | visitor->endVisit(this);
|
---|
884 | }
|
---|
885 |
|
---|
886 | void UiArrayBinding::accept0(Visitor *visitor)
|
---|
887 | {
|
---|
888 | if (visitor->visit(this)) {
|
---|
889 | accept(qualifiedId, visitor);
|
---|
890 | accept(members, visitor);
|
---|
891 | }
|
---|
892 |
|
---|
893 | visitor->endVisit(this);
|
---|
894 | }
|
---|
895 |
|
---|
896 | void UiObjectMemberList::accept0(Visitor *visitor)
|
---|
897 | {
|
---|
898 | if (visitor->visit(this)) {
|
---|
899 | for (UiObjectMemberList *it = this; it; it = it->next)
|
---|
900 | accept(it->member, visitor);
|
---|
901 | }
|
---|
902 |
|
---|
903 | visitor->endVisit(this);
|
---|
904 | }
|
---|
905 |
|
---|
906 | void UiArrayMemberList::accept0(Visitor *visitor)
|
---|
907 | {
|
---|
908 | if (visitor->visit(this)) {
|
---|
909 | for (UiArrayMemberList *it = this; it; it = it->next)
|
---|
910 | accept(it->member, visitor);
|
---|
911 | }
|
---|
912 |
|
---|
913 | visitor->endVisit(this);
|
---|
914 | }
|
---|
915 |
|
---|
916 | void UiQualifiedId::accept0(Visitor *visitor)
|
---|
917 | {
|
---|
918 | if (visitor->visit(this)) {
|
---|
919 | }
|
---|
920 |
|
---|
921 | visitor->endVisit(this);
|
---|
922 | }
|
---|
923 |
|
---|
924 | void UiImport::accept0(Visitor *visitor)
|
---|
925 | {
|
---|
926 | if (visitor->visit(this)) {
|
---|
927 | accept(importUri, visitor);
|
---|
928 | }
|
---|
929 |
|
---|
930 | visitor->endVisit(this);
|
---|
931 | }
|
---|
932 |
|
---|
933 | void UiImportList::accept0(Visitor *visitor)
|
---|
934 | {
|
---|
935 | if (visitor->visit(this)) {
|
---|
936 | accept(import, visitor);
|
---|
937 | accept(next, visitor);
|
---|
938 | }
|
---|
939 |
|
---|
940 | visitor->endVisit(this);
|
---|
941 | }
|
---|
942 |
|
---|
943 | void UiSourceElement::accept0(Visitor *visitor)
|
---|
944 | {
|
---|
945 | if (visitor->visit(this)) {
|
---|
946 | accept(sourceElement, visitor);
|
---|
947 | }
|
---|
948 |
|
---|
949 | visitor->endVisit(this);
|
---|
950 | }
|
---|
951 |
|
---|
952 | } } // namespace QDeclarativeJS::AST
|
---|
953 |
|
---|
954 | QT_QML_END_NAMESPACE
|
---|
955 |
|
---|
956 |
|
---|