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