1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** Contact: Qt Software Information ([email protected])
|
---|
5 | **
|
---|
6 | ** This file is part of the QtScript module of the Qt Toolkit.
|
---|
7 | **
|
---|
8 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
9 | ** Commercial Usage
|
---|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
11 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
12 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
13 | ** a written agreement between you and Nokia.
|
---|
14 | **
|
---|
15 | ** GNU Lesser General Public License Usage
|
---|
16 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
17 | ** General Public License version 2.1 as published by the Free Software
|
---|
18 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
19 | ** packaging of this file. Please review the following information to
|
---|
20 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
22 | **
|
---|
23 | ** In addition, as a special exception, Nokia gives you certain
|
---|
24 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
---|
25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
---|
26 | ** 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 are unsure which license is appropriate for your use, please
|
---|
37 | ** contact the sales department at [email protected].
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | #include "qscriptast_p.h"
|
---|
43 |
|
---|
44 | #ifndef QT_NO_SCRIPT
|
---|
45 |
|
---|
46 | #include "qscriptastvisitor_p.h"
|
---|
47 |
|
---|
48 | QT_BEGIN_NAMESPACE
|
---|
49 |
|
---|
50 | namespace QScript { namespace AST {
|
---|
51 |
|
---|
52 | ExpressionNode *Node::expressionCast()
|
---|
53 | {
|
---|
54 | return 0;
|
---|
55 | }
|
---|
56 |
|
---|
57 | BinaryExpression *Node::binaryExpressionCast()
|
---|
58 | {
|
---|
59 | return 0;
|
---|
60 | }
|
---|
61 |
|
---|
62 | Statement *Node::statementCast()
|
---|
63 | {
|
---|
64 | return 0;
|
---|
65 | }
|
---|
66 |
|
---|
67 | ExpressionNode *ExpressionNode::expressionCast()
|
---|
68 | {
|
---|
69 | return this;
|
---|
70 | }
|
---|
71 |
|
---|
72 | BinaryExpression *BinaryExpression::binaryExpressionCast()
|
---|
73 | {
|
---|
74 | return this;
|
---|
75 | }
|
---|
76 |
|
---|
77 | Statement *Statement::statementCast()
|
---|
78 | {
|
---|
79 | return this;
|
---|
80 | }
|
---|
81 |
|
---|
82 | void ThisExpression::accept0(Visitor *visitor)
|
---|
83 | {
|
---|
84 | if (visitor->visit(this)) {
|
---|
85 | }
|
---|
86 |
|
---|
87 | visitor->endVisit(this);
|
---|
88 | }
|
---|
89 |
|
---|
90 | void IdentifierExpression::accept0(Visitor *visitor)
|
---|
91 | {
|
---|
92 | if (visitor->visit(this)) {
|
---|
93 | }
|
---|
94 |
|
---|
95 | visitor->endVisit(this);
|
---|
96 | }
|
---|
97 |
|
---|
98 | void NullExpression::accept0(Visitor *visitor)
|
---|
99 | {
|
---|
100 | if (visitor->visit(this)) {
|
---|
101 | }
|
---|
102 |
|
---|
103 | visitor->endVisit(this);
|
---|
104 | }
|
---|
105 |
|
---|
106 | void TrueLiteral::accept0(Visitor *visitor)
|
---|
107 | {
|
---|
108 | if (visitor->visit(this)) {
|
---|
109 | }
|
---|
110 |
|
---|
111 | visitor->endVisit(this);
|
---|
112 | }
|
---|
113 |
|
---|
114 | void FalseLiteral::accept0(Visitor *visitor)
|
---|
115 | {
|
---|
116 | if (visitor->visit(this)) {
|
---|
117 | }
|
---|
118 |
|
---|
119 | visitor->endVisit(this);
|
---|
120 | }
|
---|
121 |
|
---|
122 | void StringLiteral::accept0(Visitor *visitor)
|
---|
123 | {
|
---|
124 | if (visitor->visit(this)) {
|
---|
125 | }
|
---|
126 |
|
---|
127 | visitor->endVisit(this);
|
---|
128 | }
|
---|
129 |
|
---|
130 | void NumericLiteral::accept0(Visitor *visitor)
|
---|
131 | {
|
---|
132 | if (visitor->visit(this)) {
|
---|
133 | }
|
---|
134 |
|
---|
135 | visitor->endVisit(this);
|
---|
136 | }
|
---|
137 |
|
---|
138 | void RegExpLiteral::accept0(Visitor *visitor)
|
---|
139 | {
|
---|
140 | if (visitor->visit(this)) {
|
---|
141 | }
|
---|
142 |
|
---|
143 | visitor->endVisit(this);
|
---|
144 | }
|
---|
145 |
|
---|
146 | void ArrayLiteral::accept0(Visitor *visitor)
|
---|
147 | {
|
---|
148 | if (visitor->visit(this)) {
|
---|
149 | acceptChild(elements, visitor);
|
---|
150 | acceptChild(elision, visitor);
|
---|
151 | }
|
---|
152 |
|
---|
153 | visitor->endVisit(this);
|
---|
154 | }
|
---|
155 |
|
---|
156 | void ObjectLiteral::accept0(Visitor *visitor)
|
---|
157 | {
|
---|
158 | if (visitor->visit(this)) {
|
---|
159 | acceptChild(properties, visitor);
|
---|
160 | }
|
---|
161 |
|
---|
162 | visitor->endVisit(this);
|
---|
163 | }
|
---|
164 |
|
---|
165 | void ElementList::accept0(Visitor *visitor)
|
---|
166 | {
|
---|
167 | if (visitor->visit(this)) {
|
---|
168 | ElementList *it = this;
|
---|
169 | do {
|
---|
170 | acceptChild(it->elision, visitor);
|
---|
171 | acceptChild(it->expression, visitor);
|
---|
172 | it = it->next;
|
---|
173 | } while (it);
|
---|
174 | }
|
---|
175 |
|
---|
176 | visitor->endVisit(this);
|
---|
177 | }
|
---|
178 |
|
---|
179 | void Elision::accept0(Visitor *visitor)
|
---|
180 | {
|
---|
181 | if (visitor->visit(this)) {
|
---|
182 | // ###
|
---|
183 | }
|
---|
184 |
|
---|
185 | visitor->endVisit(this);
|
---|
186 | }
|
---|
187 |
|
---|
188 | void PropertyNameAndValueList::accept0(Visitor *visitor)
|
---|
189 | {
|
---|
190 | if (visitor->visit(this)) {
|
---|
191 | PropertyNameAndValueList *it = this;
|
---|
192 | do {
|
---|
193 | acceptChild(it->name, visitor);
|
---|
194 | acceptChild(it->value, visitor);
|
---|
195 | it = it->next;
|
---|
196 | } while (it);
|
---|
197 | }
|
---|
198 |
|
---|
199 | visitor->endVisit(this);
|
---|
200 | }
|
---|
201 |
|
---|
202 | void IdentifierPropertyName::accept0(Visitor *visitor)
|
---|
203 | {
|
---|
204 | if (visitor->visit(this)) {
|
---|
205 | }
|
---|
206 |
|
---|
207 | visitor->endVisit(this);
|
---|
208 | }
|
---|
209 |
|
---|
210 | void StringLiteralPropertyName::accept0(Visitor *visitor)
|
---|
211 | {
|
---|
212 | if (visitor->visit(this)) {
|
---|
213 | }
|
---|
214 |
|
---|
215 | visitor->endVisit(this);
|
---|
216 | }
|
---|
217 |
|
---|
218 | void NumericLiteralPropertyName::accept0(Visitor *visitor)
|
---|
219 | {
|
---|
220 | if (visitor->visit(this)) {
|
---|
221 | }
|
---|
222 |
|
---|
223 | visitor->endVisit(this);
|
---|
224 | }
|
---|
225 |
|
---|
226 | void ArrayMemberExpression::accept0(Visitor *visitor)
|
---|
227 | {
|
---|
228 | if (visitor->visit(this)) {
|
---|
229 | acceptChild(base, visitor);
|
---|
230 | acceptChild(expression, visitor);
|
---|
231 | }
|
---|
232 |
|
---|
233 | visitor->endVisit(this);
|
---|
234 | }
|
---|
235 |
|
---|
236 | void FieldMemberExpression::accept0(Visitor *visitor)
|
---|
237 | {
|
---|
238 | if (visitor->visit(this)) {
|
---|
239 | acceptChild(base, visitor);
|
---|
240 | }
|
---|
241 |
|
---|
242 | visitor->endVisit(this);
|
---|
243 | }
|
---|
244 |
|
---|
245 | void NewMemberExpression::accept0(Visitor *visitor)
|
---|
246 | {
|
---|
247 | if (visitor->visit(this)) {
|
---|
248 | acceptChild(base, visitor);
|
---|
249 | acceptChild(arguments, visitor);
|
---|
250 | }
|
---|
251 |
|
---|
252 | visitor->endVisit(this);
|
---|
253 | }
|
---|
254 |
|
---|
255 | void NewExpression::accept0(Visitor *visitor)
|
---|
256 | {
|
---|
257 | if (visitor->visit(this)) {
|
---|
258 | acceptChild(expression, visitor);
|
---|
259 | }
|
---|
260 |
|
---|
261 | visitor->endVisit(this);
|
---|
262 | }
|
---|
263 |
|
---|
264 | void CallExpression::accept0(Visitor *visitor)
|
---|
265 | {
|
---|
266 | if (visitor->visit(this)) {
|
---|
267 | acceptChild(base, visitor);
|
---|
268 | acceptChild(arguments, visitor);
|
---|
269 | }
|
---|
270 |
|
---|
271 | visitor->endVisit(this);
|
---|
272 | }
|
---|
273 |
|
---|
274 | void ArgumentList::accept0(Visitor *visitor)
|
---|
275 | {
|
---|
276 | if (visitor->visit(this)) {
|
---|
277 | ArgumentList *it = this;
|
---|
278 | do {
|
---|
279 | acceptChild(it->expression, visitor);
|
---|
280 | it = it->next;
|
---|
281 | } while (it);
|
---|
282 | }
|
---|
283 |
|
---|
284 | visitor->endVisit(this);
|
---|
285 | }
|
---|
286 |
|
---|
287 | void PostIncrementExpression::accept0(Visitor *visitor)
|
---|
288 | {
|
---|
289 | if (visitor->visit(this)) {
|
---|
290 | acceptChild(base, visitor);
|
---|
291 | }
|
---|
292 |
|
---|
293 | visitor->endVisit(this);
|
---|
294 | }
|
---|
295 |
|
---|
296 | void PostDecrementExpression::accept0(Visitor *visitor)
|
---|
297 | {
|
---|
298 | if (visitor->visit(this)) {
|
---|
299 | acceptChild(base, visitor);
|
---|
300 | }
|
---|
301 |
|
---|
302 | visitor->endVisit(this);
|
---|
303 | }
|
---|
304 |
|
---|
305 | void DeleteExpression::accept0(Visitor *visitor)
|
---|
306 | {
|
---|
307 | if (visitor->visit(this)) {
|
---|
308 | acceptChild(expression, visitor);
|
---|
309 | }
|
---|
310 |
|
---|
311 | visitor->endVisit(this);
|
---|
312 | }
|
---|
313 |
|
---|
314 | void VoidExpression::accept0(Visitor *visitor)
|
---|
315 | {
|
---|
316 | if (visitor->visit(this)) {
|
---|
317 | acceptChild(expression, visitor);
|
---|
318 | }
|
---|
319 |
|
---|
320 | visitor->endVisit(this);
|
---|
321 | }
|
---|
322 |
|
---|
323 | void TypeOfExpression::accept0(Visitor *visitor)
|
---|
324 | {
|
---|
325 | if (visitor->visit(this)) {
|
---|
326 | acceptChild(expression, visitor);
|
---|
327 | }
|
---|
328 |
|
---|
329 | visitor->endVisit(this);
|
---|
330 | }
|
---|
331 |
|
---|
332 | void PreIncrementExpression::accept0(Visitor *visitor)
|
---|
333 | {
|
---|
334 | if (visitor->visit(this)) {
|
---|
335 | acceptChild(expression, visitor);
|
---|
336 | }
|
---|
337 |
|
---|
338 | visitor->endVisit(this);
|
---|
339 | }
|
---|
340 |
|
---|
341 | void PreDecrementExpression::accept0(Visitor *visitor)
|
---|
342 | {
|
---|
343 | if (visitor->visit(this)) {
|
---|
344 | acceptChild(expression, visitor);
|
---|
345 | }
|
---|
346 |
|
---|
347 | visitor->endVisit(this);
|
---|
348 | }
|
---|
349 |
|
---|
350 | void UnaryPlusExpression::accept0(Visitor *visitor)
|
---|
351 | {
|
---|
352 | if (visitor->visit(this)) {
|
---|
353 | acceptChild(expression, visitor);
|
---|
354 | }
|
---|
355 |
|
---|
356 | visitor->endVisit(this);
|
---|
357 | }
|
---|
358 |
|
---|
359 | void UnaryMinusExpression::accept0(Visitor *visitor)
|
---|
360 | {
|
---|
361 | if (visitor->visit(this)) {
|
---|
362 | acceptChild(expression, visitor);
|
---|
363 | }
|
---|
364 |
|
---|
365 | visitor->endVisit(this);
|
---|
366 | }
|
---|
367 |
|
---|
368 | void TildeExpression::accept0(Visitor *visitor)
|
---|
369 | {
|
---|
370 | if (visitor->visit(this)) {
|
---|
371 | acceptChild(expression, visitor);
|
---|
372 | }
|
---|
373 |
|
---|
374 | visitor->endVisit(this);
|
---|
375 | }
|
---|
376 |
|
---|
377 | void NotExpression::accept0(Visitor *visitor)
|
---|
378 | {
|
---|
379 | if (visitor->visit(this)) {
|
---|
380 | acceptChild(expression, visitor);
|
---|
381 | }
|
---|
382 |
|
---|
383 | visitor->endVisit(this);
|
---|
384 | }
|
---|
385 |
|
---|
386 | void BinaryExpression::accept0(Visitor *visitor)
|
---|
387 | {
|
---|
388 | if (visitor->visit(this)) {
|
---|
389 | acceptChild(left, visitor);
|
---|
390 | acceptChild(right, visitor);
|
---|
391 | }
|
---|
392 |
|
---|
393 | visitor->endVisit(this);
|
---|
394 | }
|
---|
395 |
|
---|
396 | void ConditionalExpression::accept0(Visitor *visitor)
|
---|
397 | {
|
---|
398 | if (visitor->visit(this)) {
|
---|
399 | acceptChild(expression, visitor);
|
---|
400 | acceptChild(ok, visitor);
|
---|
401 | acceptChild(ko, visitor);
|
---|
402 | }
|
---|
403 |
|
---|
404 | visitor->endVisit(this);
|
---|
405 | }
|
---|
406 |
|
---|
407 | void Expression::accept0(Visitor *visitor)
|
---|
408 | {
|
---|
409 | if (visitor->visit(this)) {
|
---|
410 | acceptChild(left, visitor);
|
---|
411 | acceptChild(right, visitor);
|
---|
412 | }
|
---|
413 |
|
---|
414 | visitor->endVisit(this);
|
---|
415 | }
|
---|
416 |
|
---|
417 | void Block::accept0(Visitor *visitor)
|
---|
418 | {
|
---|
419 | if (visitor->visit(this)) {
|
---|
420 | acceptChild(statements, visitor);
|
---|
421 | }
|
---|
422 |
|
---|
423 | visitor->endVisit(this);
|
---|
424 | }
|
---|
425 |
|
---|
426 | void StatementList::accept0(Visitor *visitor)
|
---|
427 | {
|
---|
428 | if (visitor->visit(this)) {
|
---|
429 | StatementList *it = this;
|
---|
430 | do {
|
---|
431 | acceptChild(it->statement, visitor);
|
---|
432 | it = it->next;
|
---|
433 | } while (it);
|
---|
434 | }
|
---|
435 |
|
---|
436 | visitor->endVisit(this);
|
---|
437 | }
|
---|
438 |
|
---|
439 | void VariableStatement::accept0(Visitor *visitor)
|
---|
440 | {
|
---|
441 | if (visitor->visit(this)) {
|
---|
442 | acceptChild(declarations, visitor);
|
---|
443 | }
|
---|
444 |
|
---|
445 | visitor->endVisit(this);
|
---|
446 | }
|
---|
447 |
|
---|
448 | void VariableDeclarationList::accept0(Visitor *visitor)
|
---|
449 | {
|
---|
450 | if (visitor->visit(this)) {
|
---|
451 | VariableDeclarationList *it = this;
|
---|
452 | do {
|
---|
453 | acceptChild(it->declaration, visitor);
|
---|
454 | it = it->next;
|
---|
455 | } while (it);
|
---|
456 | }
|
---|
457 |
|
---|
458 | visitor->endVisit(this);
|
---|
459 | }
|
---|
460 |
|
---|
461 | void VariableDeclaration::accept0(Visitor *visitor)
|
---|
462 | {
|
---|
463 | if (visitor->visit(this)) {
|
---|
464 | acceptChild(expression, visitor);
|
---|
465 | }
|
---|
466 |
|
---|
467 | visitor->endVisit(this);
|
---|
468 | }
|
---|
469 |
|
---|
470 | void EmptyStatement::accept0(Visitor *visitor)
|
---|
471 | {
|
---|
472 | if (visitor->visit(this)) {
|
---|
473 | }
|
---|
474 |
|
---|
475 | visitor->endVisit(this);
|
---|
476 | }
|
---|
477 |
|
---|
478 | void ExpressionStatement::accept0(Visitor *visitor)
|
---|
479 | {
|
---|
480 | if (visitor->visit(this)) {
|
---|
481 | acceptChild(expression, visitor);
|
---|
482 | }
|
---|
483 |
|
---|
484 | visitor->endVisit(this);
|
---|
485 | }
|
---|
486 |
|
---|
487 | void IfStatement::accept0(Visitor *visitor)
|
---|
488 | {
|
---|
489 | if (visitor->visit(this)) {
|
---|
490 | acceptChild(expression, visitor);
|
---|
491 | acceptChild(ok, visitor);
|
---|
492 | acceptChild(ko, visitor);
|
---|
493 | }
|
---|
494 |
|
---|
495 | visitor->endVisit(this);
|
---|
496 | }
|
---|
497 |
|
---|
498 | void DoWhileStatement::accept0(Visitor *visitor)
|
---|
499 | {
|
---|
500 | if (visitor->visit(this)) {
|
---|
501 | acceptChild(statement, visitor);
|
---|
502 | acceptChild(expression, visitor);
|
---|
503 | }
|
---|
504 |
|
---|
505 | visitor->endVisit(this);
|
---|
506 | }
|
---|
507 |
|
---|
508 | void WhileStatement::accept0(Visitor *visitor)
|
---|
509 | {
|
---|
510 | if (visitor->visit(this)) {
|
---|
511 | acceptChild(expression, visitor);
|
---|
512 | acceptChild(statement, visitor);
|
---|
513 | }
|
---|
514 |
|
---|
515 | visitor->endVisit(this);
|
---|
516 | }
|
---|
517 |
|
---|
518 | void ForStatement::accept0(Visitor *visitor)
|
---|
519 | {
|
---|
520 | if (visitor->visit(this)) {
|
---|
521 | acceptChild(initialiser, visitor);
|
---|
522 | acceptChild(condition, visitor);
|
---|
523 | acceptChild(expression, visitor);
|
---|
524 | acceptChild(statement, visitor);
|
---|
525 | }
|
---|
526 |
|
---|
527 | visitor->endVisit(this);
|
---|
528 | }
|
---|
529 |
|
---|
530 | void LocalForStatement::accept0(Visitor *visitor)
|
---|
531 | {
|
---|
532 | if (visitor->visit(this)) {
|
---|
533 | acceptChild(declarations, visitor);
|
---|
534 | acceptChild(condition, visitor);
|
---|
535 | acceptChild(expression, visitor);
|
---|
536 | acceptChild(statement, visitor);
|
---|
537 | }
|
---|
538 |
|
---|
539 | visitor->endVisit(this);
|
---|
540 | }
|
---|
541 |
|
---|
542 | void ForEachStatement::accept0(Visitor *visitor)
|
---|
543 | {
|
---|
544 | if (visitor->visit(this)) {
|
---|
545 | acceptChild(initialiser, visitor);
|
---|
546 | acceptChild(expression, visitor);
|
---|
547 | acceptChild(statement, visitor);
|
---|
548 | }
|
---|
549 |
|
---|
550 | visitor->endVisit(this);
|
---|
551 | }
|
---|
552 |
|
---|
553 | void LocalForEachStatement::accept0(Visitor *visitor)
|
---|
554 | {
|
---|
555 | if (visitor->visit(this)) {
|
---|
556 | acceptChild(declaration, visitor);
|
---|
557 | acceptChild(expression, visitor);
|
---|
558 | acceptChild(statement, visitor);
|
---|
559 | }
|
---|
560 |
|
---|
561 | visitor->endVisit(this);
|
---|
562 | }
|
---|
563 |
|
---|
564 | void ContinueStatement::accept0(Visitor *visitor)
|
---|
565 | {
|
---|
566 | if (visitor->visit(this)) {
|
---|
567 | }
|
---|
568 |
|
---|
569 | visitor->endVisit(this);
|
---|
570 | }
|
---|
571 |
|
---|
572 | void BreakStatement::accept0(Visitor *visitor)
|
---|
573 | {
|
---|
574 | if (visitor->visit(this)) {
|
---|
575 | }
|
---|
576 |
|
---|
577 | visitor->endVisit(this);
|
---|
578 | }
|
---|
579 |
|
---|
580 | void ReturnStatement::accept0(Visitor *visitor)
|
---|
581 | {
|
---|
582 | if (visitor->visit(this)) {
|
---|
583 | acceptChild(expression, visitor);
|
---|
584 | }
|
---|
585 |
|
---|
586 | visitor->endVisit(this);
|
---|
587 | }
|
---|
588 |
|
---|
589 | void WithStatement::accept0(Visitor *visitor)
|
---|
590 | {
|
---|
591 | if (visitor->visit(this)) {
|
---|
592 | acceptChild(expression, visitor);
|
---|
593 | acceptChild(statement, visitor);
|
---|
594 | }
|
---|
595 |
|
---|
596 | visitor->endVisit(this);
|
---|
597 | }
|
---|
598 |
|
---|
599 | void SwitchStatement::accept0(Visitor *visitor)
|
---|
600 | {
|
---|
601 | if (visitor->visit(this)) {
|
---|
602 | acceptChild(expression, visitor);
|
---|
603 | acceptChild(block, visitor);
|
---|
604 | }
|
---|
605 |
|
---|
606 | visitor->endVisit(this);
|
---|
607 | }
|
---|
608 |
|
---|
609 | void CaseBlock::accept0(Visitor *visitor)
|
---|
610 | {
|
---|
611 | if (visitor->visit(this)) {
|
---|
612 | acceptChild(clauses, visitor);
|
---|
613 | acceptChild(defaultClause, visitor);
|
---|
614 | acceptChild(moreClauses, visitor);
|
---|
615 | }
|
---|
616 |
|
---|
617 | visitor->endVisit(this);
|
---|
618 | }
|
---|
619 |
|
---|
620 | void CaseClauses::accept0(Visitor *visitor)
|
---|
621 | {
|
---|
622 | if (visitor->visit(this)) {
|
---|
623 | CaseClauses *it = this;
|
---|
624 | do {
|
---|
625 | acceptChild(it->clause, visitor);
|
---|
626 | it = it->next;
|
---|
627 | } while (it);
|
---|
628 | }
|
---|
629 |
|
---|
630 | visitor->endVisit(this);
|
---|
631 | }
|
---|
632 |
|
---|
633 | void CaseClause::accept0(Visitor *visitor)
|
---|
634 | {
|
---|
635 | if (visitor->visit(this)) {
|
---|
636 | acceptChild(expression, visitor);
|
---|
637 | acceptChild(statements, visitor);
|
---|
638 | }
|
---|
639 |
|
---|
640 | visitor->endVisit(this);
|
---|
641 | }
|
---|
642 |
|
---|
643 | void DefaultClause::accept0(Visitor *visitor)
|
---|
644 | {
|
---|
645 | if (visitor->visit(this)) {
|
---|
646 | acceptChild(statements, visitor);
|
---|
647 | }
|
---|
648 |
|
---|
649 | visitor->endVisit(this);
|
---|
650 | }
|
---|
651 |
|
---|
652 | void LabelledStatement::accept0(Visitor *visitor)
|
---|
653 | {
|
---|
654 | if (visitor->visit(this)) {
|
---|
655 | acceptChild(statement, visitor);
|
---|
656 | }
|
---|
657 |
|
---|
658 | visitor->endVisit(this);
|
---|
659 | }
|
---|
660 |
|
---|
661 | void ThrowStatement::accept0(Visitor *visitor)
|
---|
662 | {
|
---|
663 | if (visitor->visit(this)) {
|
---|
664 | acceptChild(expression, visitor);
|
---|
665 | }
|
---|
666 |
|
---|
667 | visitor->endVisit(this);
|
---|
668 | }
|
---|
669 |
|
---|
670 | void TryStatement::accept0(Visitor *visitor)
|
---|
671 | {
|
---|
672 | if (visitor->visit(this)) {
|
---|
673 | acceptChild(statement, visitor);
|
---|
674 | acceptChild(catchExpression, visitor);
|
---|
675 | acceptChild(finallyExpression, visitor);
|
---|
676 | }
|
---|
677 |
|
---|
678 | visitor->endVisit(this);
|
---|
679 | }
|
---|
680 |
|
---|
681 | void Catch::accept0(Visitor *visitor)
|
---|
682 | {
|
---|
683 | if (visitor->visit(this)) {
|
---|
684 | acceptChild(statement, visitor);
|
---|
685 | }
|
---|
686 |
|
---|
687 | visitor->endVisit(this);
|
---|
688 | }
|
---|
689 |
|
---|
690 | void Finally::accept0(Visitor *visitor)
|
---|
691 | {
|
---|
692 | if (visitor->visit(this)) {
|
---|
693 | acceptChild(statement, visitor);
|
---|
694 | }
|
---|
695 |
|
---|
696 | visitor->endVisit(this);
|
---|
697 | }
|
---|
698 |
|
---|
699 | void FunctionDeclaration::accept0(Visitor *visitor)
|
---|
700 | {
|
---|
701 | if (visitor->visit(this)) {
|
---|
702 | acceptChild(formals, visitor);
|
---|
703 | acceptChild(body, visitor);
|
---|
704 | }
|
---|
705 |
|
---|
706 | visitor->endVisit(this);
|
---|
707 | }
|
---|
708 |
|
---|
709 | void FunctionExpression::accept0(Visitor *visitor)
|
---|
710 | {
|
---|
711 | if (visitor->visit(this)) {
|
---|
712 | acceptChild(formals, visitor);
|
---|
713 | acceptChild(body, visitor);
|
---|
714 | }
|
---|
715 |
|
---|
716 | visitor->endVisit(this);
|
---|
717 | }
|
---|
718 |
|
---|
719 | void FormalParameterList::accept0(Visitor *visitor)
|
---|
720 | {
|
---|
721 | if (visitor->visit(this)) {
|
---|
722 | // ###
|
---|
723 | }
|
---|
724 |
|
---|
725 | visitor->endVisit(this);
|
---|
726 | }
|
---|
727 |
|
---|
728 | void FunctionBody::accept0(Visitor *visitor)
|
---|
729 | {
|
---|
730 | if (visitor->visit(this)) {
|
---|
731 | acceptChild(elements, visitor);
|
---|
732 | }
|
---|
733 |
|
---|
734 | visitor->endVisit(this);
|
---|
735 | }
|
---|
736 |
|
---|
737 | void Program::accept0(Visitor *visitor)
|
---|
738 | {
|
---|
739 | if (visitor->visit(this)) {
|
---|
740 | acceptChild(elements, visitor);
|
---|
741 | }
|
---|
742 |
|
---|
743 | visitor->endVisit(this);
|
---|
744 | }
|
---|
745 |
|
---|
746 | void SourceElements::accept0(Visitor *visitor)
|
---|
747 | {
|
---|
748 | if (visitor->visit(this)) {
|
---|
749 | SourceElements *it = this;
|
---|
750 | do {
|
---|
751 | acceptChild(it->element, visitor);
|
---|
752 | it = it->next;
|
---|
753 | } while (it);
|
---|
754 | }
|
---|
755 |
|
---|
756 | visitor->endVisit(this);
|
---|
757 | }
|
---|
758 |
|
---|
759 | void FunctionSourceElement::accept0(Visitor *visitor)
|
---|
760 | {
|
---|
761 | if (visitor->visit(this)) {
|
---|
762 | acceptChild(declaration, visitor);
|
---|
763 | }
|
---|
764 |
|
---|
765 | visitor->endVisit(this);
|
---|
766 | }
|
---|
767 |
|
---|
768 | void StatementSourceElement::accept0(Visitor *visitor)
|
---|
769 | {
|
---|
770 | if (visitor->visit(this)) {
|
---|
771 | acceptChild(statement, visitor);
|
---|
772 | }
|
---|
773 |
|
---|
774 | visitor->endVisit(this);
|
---|
775 | }
|
---|
776 |
|
---|
777 | void DebuggerStatement::accept0(Visitor *visitor)
|
---|
778 | {
|
---|
779 | if (visitor->visit(this)) {
|
---|
780 | }
|
---|
781 |
|
---|
782 | visitor->endVisit(this);
|
---|
783 | }
|
---|
784 |
|
---|
785 | } } // namespace QScript::AST
|
---|
786 |
|
---|
787 | QT_END_NAMESPACE
|
---|
788 |
|
---|
789 | #endif // QT_NO_SCRIPT
|
---|