Qt 4.8
qscriptast_p.h
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 #ifndef QSCRIPTAST_P_H
25 #define QSCRIPTAST_P_H
26 
27 //
28 // W A R N I N G
29 // -------------
30 //
31 // This file is not part of the Qt API. It exists purely as an
32 // implementation detail. This header file may change from version to
33 // version without notice, or even be removed.
34 //
35 // We mean it.
36 //
37 
38 #include <QtCore/QString>
39 
40 #include "qscriptastvisitor_p.h"
41 
43 
44 class QScriptNameIdImpl;
45 
46 namespace QSOperator // ### rename
47 {
48 
49 enum Op {
50  Add,
51  And,
52  InplaceAnd,
53  Assign,
54  BitAnd,
55  BitOr,
56  BitXor,
57  InplaceSub,
58  Div,
59  InplaceDiv,
60  Equal,
61  Ge,
62  Gt,
63  In,
64  InplaceAdd,
65  InstanceOf,
66  Le,
67  LShift,
69  Lt,
70  Mod,
71  InplaceMod,
72  Mul,
73  InplaceMul,
74  NotEqual,
75  Or,
76  InplaceOr,
77  RShift,
81  Sub,
82  URShift,
85 };
86 
87 } // namespace QSOperator
88 
89 namespace QScript { namespace AST {
90 
91 class Node
92 {
93 public:
94  enum Kind {
172  Kind_DebuggerStatement
173  };
174 
175  inline Node():
176  startLine(0), startColumn(0),
177  endLine(0), endColumn(0), kind(Kind_Node) {}
178 
179  virtual ~Node() {}
180 
181  virtual ExpressionNode *expressionCast();
182  virtual BinaryExpression *binaryExpressionCast();
183  virtual Statement *statementCast();
184 
185  inline void accept(Visitor *visitor)
186  {
187  if (visitor->preVisit(this)) {
188  accept0(visitor);
189  visitor->postVisit(this);
190  }
191  }
192 
193  static void acceptChild(Node *node, Visitor *visitor)
194  {
195  if (node)
196  node->accept(visitor);
197  }
198 
199  virtual void accept0(Visitor *visitor) = 0;
200 
203  int endLine;
206 };
207 
208 class ExpressionNode: public Node
209 {
210 public:
211  ExpressionNode() { kind = Kind_ExpressionNode; }
212  virtual ~ExpressionNode() {}
213 
214  virtual ExpressionNode *expressionCast();
215 };
216 
217 class Statement: public Node
218 {
219 public:
220  Statement() { kind = Kind_Statement; }
221  virtual ~Statement() {}
222 
223  virtual Statement *statementCast();
224 };
225 
227 {
228 public:
229  ThisExpression() { kind = Kind_ThisExpression; }
230  virtual ~ThisExpression() {}
231 
232  virtual void accept0(Visitor *visitor);
233 };
234 
236 {
237 public:
238  IdentifierExpression(QScriptNameIdImpl *n):
239  name (n) { kind = Kind_IdentifierExpression; }
240 
242 
243  virtual void accept0(Visitor *visitor);
244 
245 // attributes
246  QScriptNameIdImpl *name;
247 };
248 
250 {
251 public:
252  NullExpression() { kind = Kind_NullExpression; }
253  virtual ~NullExpression() {}
254 
255  virtual void accept0(Visitor *visitor);
256 };
257 
259 {
260 public:
261  TrueLiteral() { kind = Kind_TrueLiteral; }
262  virtual ~TrueLiteral() {}
263 
264  virtual void accept0(Visitor *visitor);
265 };
266 
268 {
269 public:
270  FalseLiteral() { kind = Kind_FalseLiteral; }
271  virtual ~FalseLiteral() {}
272 
273  virtual void accept0(Visitor *visitor);
274 };
275 
277 {
278 public:
279  NumericLiteral(double v):
280  value (v) { kind = Kind_NumericLiteral; }
281  virtual ~NumericLiteral() {}
282 
283  virtual void accept0(Visitor *visitor);
284 
285 // attributes:
286  double value;
287 };
288 
290 {
291 public:
292  StringLiteral(QScriptNameIdImpl *v):
293  value (v) { kind = Kind_StringLiteral; }
294 
295  virtual ~StringLiteral() {}
296 
297  virtual void accept0(Visitor *visitor);
298 
299 // attributes:
300  QScriptNameIdImpl *value;
301 };
302 
304 {
305 public:
306  RegExpLiteral(QScriptNameIdImpl *p, int f):
307  pattern (p), flags (f) { kind = Kind_RegExpLiteral; }
308 
309  virtual ~RegExpLiteral() {}
310 
311  virtual void accept0(Visitor *visitor);
312 
313 // attributes:
314  QScriptNameIdImpl *pattern;
315  int flags;
316 };
317 
319 {
320 public:
322  elements (0), elision (e)
323  { kind = Kind_ArrayLiteral; }
324 
326  elements (elts), elision (0)
327  { kind = Kind_ArrayLiteral; }
328 
330  elements (elts), elision (e)
331  { kind = Kind_ArrayLiteral; }
332 
333  virtual ~ArrayLiteral() {}
334 
335  virtual void accept0(Visitor *visitor);
336 
337 // attributes
340 };
341 
343 {
344 public:
346  properties (0) { kind = Kind_ObjectLiteral; }
347 
349  properties (plist) { kind = Kind_ObjectLiteral; }
350 
351  virtual ~ObjectLiteral() {}
352 
353  virtual void accept0(Visitor *visitor);
354 
355 // attributes
357 };
358 
359 class ElementList: public Node
360 {
361 public:
363  elision (e), expression (expr), next (this)
364  { kind = Kind_ElementList; }
365 
367  elision (e), expression (expr)
368  {
369  kind = Kind_ElementList;
370  next = previous->next;
371  previous->next = this;
372  }
373 
374  virtual ~ElementList() {}
375 
376  inline ElementList *finish ()
377  {
378  ElementList *front = next;
379  next = 0;
380  return front;
381  }
382 
383  virtual void accept0(Visitor *visitor);
384 
385 // attributes
389 };
390 
391 class Elision: public Node
392 {
393 public:
395  next (this) { kind = Kind_Elision; }
396 
397  Elision(Elision *previous)
398  {
399  kind = Kind_Elision;
400  next = previous->next;
401  previous->next = this;
402  }
403 
404  virtual ~Elision() {}
405 
406  virtual void accept0(Visitor *visitor);
407 
408  inline Elision *finish ()
409  {
410  Elision *front = next;
411  next = 0;
412  return front;
413  }
414 
415 // attributes
417 };
418 
420 {
421 public:
423  name (n), value (v), next (this)
424  { kind = Kind_PropertyNameAndValueList; }
425 
427  name (n), value (v)
428  {
429  kind = Kind_PropertyNameAndValueList;
430  next = previous->next;
431  previous->next = this;
432  }
433 
435 
436  virtual void accept0(Visitor *visitor);
437 
439  {
440  PropertyNameAndValueList *front = next;
441  next = 0;
442  return front;
443  }
444 
445 // attributes
449 };
450 
451 class PropertyName: public Node
452 {
453 public:
454  PropertyName() { kind = Kind_PropertyName; }
455  virtual ~PropertyName() {}
456 };
457 
459 {
460 public:
461  IdentifierPropertyName(QScriptNameIdImpl *n):
462  id (n) { kind = Kind_IdentifierPropertyName; }
463 
465 
466  virtual void accept0(Visitor *visitor);
467 
468 // attributes
469  QScriptNameIdImpl *id;
470 };
471 
473 {
474 public:
475  StringLiteralPropertyName(QScriptNameIdImpl *n):
476  id (n) { kind = Kind_StringLiteralPropertyName; }
478 
479  virtual void accept0(Visitor *visitor);
480 
481 // attributes
482  QScriptNameIdImpl *id;
483 };
484 
486 {
487 public:
489  id (n) { kind = Kind_NumericLiteralPropertyName; }
491 
492  virtual void accept0(Visitor *visitor);
493 
494 // attributes
495  double id;
496 };
497 
499 {
500 public:
502  base (b), expression (e)
503  { kind = Kind_ArrayMemberExpression; }
504 
506 
507  virtual void accept0(Visitor *visitor);
508 
509 // attributes
512 };
513 
515 {
516 public:
517  FieldMemberExpression(ExpressionNode *b, QScriptNameIdImpl *n):
518  base (b), name (n)
519  { kind = Kind_FieldMemberExpression; }
520 
522 
523  virtual void accept0(Visitor *visitor);
524 
525 // attributes
527  QScriptNameIdImpl *name;
528 };
529 
531 {
532 public:
534  base (b), arguments (a)
535  { kind = Kind_NewMemberExpression; }
536 
537  virtual ~NewMemberExpression() {}
538 
539  virtual void accept0(Visitor *visitor);
540 
541 // attributes
544 };
545 
547 {
548 public:
550  expression (e) { kind = Kind_NewExpression; }
551 
552  virtual ~NewExpression() {}
553 
554  virtual void accept0(Visitor *visitor);
555 
556 // attributes
558 };
559 
561 {
562 public:
564  base (b), arguments (a)
565  { kind = Kind_CallExpression; }
566 
567  virtual ~CallExpression() {}
568 
569  virtual void accept0(Visitor *visitor);
570 
571 // attributes
574 };
575 
576 class ArgumentList: public Node
577 {
578 public:
580  expression (e), next (this)
581  { kind = Kind_ArgumentList; }
582 
584  expression (e)
585  {
586  kind = Kind_ArgumentList;
587  next = previous->next;
588  previous->next = this;
589  }
590 
591  virtual ~ArgumentList() {}
592 
593  virtual void accept0(Visitor *visitor);
594 
595  inline ArgumentList *finish ()
596  {
597  ArgumentList *front = next;
598  next = 0;
599  return front;
600  }
601 
602 // attributes
605 };
606 
608 {
609 public:
611  base (b) { kind = Kind_PostIncrementExpression; }
612 
614 
615  virtual void accept0(Visitor *visitor);
616 
617 // attributes
619 };
620 
622 {
623 public:
625  base (b) { kind = Kind_PostDecrementExpression; }
626 
628 
629  virtual void accept0(Visitor *visitor);
630 
631 // attributes
633 };
634 
636 {
637 public:
639  expression (e) { kind = Kind_DeleteExpression; }
640  virtual ~DeleteExpression() {}
641 
642  virtual void accept0(Visitor *visitor);
643 
644 // attributes
646 };
647 
649 {
650 public:
652  expression (e) { kind = Kind_VoidExpression; }
653 
654  virtual ~VoidExpression() {}
655 
656  virtual void accept0(Visitor *visitor);
657 
658 // attributes
660 };
661 
663 {
664 public:
666  expression (e) { kind = Kind_TypeOfExpression; }
667 
668  virtual ~TypeOfExpression() {}
669 
670  virtual void accept0(Visitor *visitor);
671 
672 // attributes
674 };
675 
677 {
678 public:
680  expression (e) { kind = Kind_PreIncrementExpression; }
681 
683 
684  virtual void accept0(Visitor *visitor);
685 
686 // attributes
688 };
689 
691 {
692 public:
694  expression (e) { kind = Kind_PreDecrementExpression; }
695 
697 
698  virtual void accept0(Visitor *visitor);
699 
700 // attributes
702 };
703 
705 {
706 public:
708  expression (e) { kind = Kind_UnaryPlusExpression; }
709 
710  virtual ~UnaryPlusExpression() {}
711 
712  virtual void accept0(Visitor *visitor);
713 
714 // attributes
716 };
717 
719 {
720 public:
722  expression (e) { kind = Kind_UnaryMinusExpression; }
723 
725 
726  virtual void accept0(Visitor *visitor);
727 
728 // attributes
730 };
731 
733 {
734 public:
736  expression (e) { kind = Kind_TildeExpression; }
737 
738  virtual ~TildeExpression() {}
739 
740  virtual void accept0(Visitor *visitor);
741 
742 // attributes
744 };
745 
747 {
748 public:
750  expression (e) { kind = Kind_NotExpression; }
751 
752  virtual ~NotExpression() {}
753 
754  virtual void accept0(Visitor *visitor);
755 
756 // attributes
758 };
759 
761 {
762 public:
764  left (l), op (o), right (r)
765  { kind = Kind_BinaryExpression; }
766 
767  virtual ~BinaryExpression() {}
768 
769  virtual BinaryExpression *binaryExpressionCast();
770 
771  virtual void accept0(Visitor *visitor);
772 
773 // attributes
775  int op;
777 };
778 
780 {
781 public:
783  expression (e), ok (t), ko (f)
784  { kind = Kind_ConditionalExpression; }
785 
787 
788  virtual void accept0(Visitor *visitor);
789 
790 // attributes
794 };
795 
796 class Expression: public ExpressionNode // ### rename
797 {
798 public:
800  left (l), right (r) { kind = Kind_Expression; }
801 
802  virtual ~Expression() {}
803 
804  virtual void accept0(Visitor *visitor);
805 
806 // attributes
809 };
810 
811 class Block: public Statement
812 {
813 public:
815  statements (slist) { kind = Kind_Block; }
816 
817  virtual ~Block() {}
818 
819  virtual void accept0(Visitor *visitor);
820 
821 // attributes
823 };
824 
825 class StatementList: public Node
826 {
827 public:
829  statement (stmt), next (this)
830  { kind = Kind_StatementList; }
831 
833  statement (stmt)
834  {
835  kind = Kind_StatementList;
836  next = previous->next;
837  previous->next = this;
838  }
839 
840  virtual ~StatementList() {}
841 
842  virtual void accept0(Visitor *visitor);
843 
845  {
846  StatementList *front = next;
847  next = 0;
848  return front;
849  }
850 
851 // attributes
854 };
855 
857 {
858 public:
860  declarations (vlist)
861  { kind = Kind_VariableStatement; }
862 
863  virtual ~VariableStatement() {}
864 
865  virtual void accept0(Visitor *visitor);
866 
867 // attributes
869 };
870 
872 {
873 public:
874  VariableDeclaration(QScriptNameIdImpl *n, ExpressionNode *e):
875  name (n), expression (e), readOnly(false)
876  { kind = Kind_VariableDeclaration; }
877 
878  virtual ~VariableDeclaration() {}
879 
880  virtual void accept0(Visitor *visitor);
881 
882 // attributes
883  QScriptNameIdImpl *name;
885  bool readOnly;
886 };
887 
889 {
890 public:
892  declaration (decl), next (this)
893  { kind = Kind_VariableDeclarationList; }
894 
896  declaration (decl)
897  {
898  kind = Kind_VariableDeclarationList;
899  next = previous->next;
900  previous->next = this;
901  }
902 
904 
905  virtual void accept0(Visitor *visitor);
906 
907  inline VariableDeclarationList *finish (bool readOnly)
908  {
909  VariableDeclarationList *front = next;
910  next = 0;
911  if (readOnly) {
913  for (vdl = front; vdl != 0; vdl = vdl->next)
914  vdl->declaration->readOnly = true;
915  }
916  return front;
917  }
918 
919 // attributes
922 };
923 
925 {
926 public:
927  EmptyStatement() { kind = Kind_EmptyStatement; }
928  virtual ~EmptyStatement() {}
929 
930  virtual void accept0(Visitor *visitor);
931 };
932 
934 {
935 public:
937  expression (e) { kind = Kind_ExpressionStatement; }
938 
939  virtual ~ExpressionStatement() {}
940 
941  virtual void accept0(Visitor *visitor);
942 
943 // attributes
945 };
946 
947 class IfStatement: public Statement
948 {
949 public:
951  expression (e), ok (t), ko (f)
952  { kind = Kind_IfStatement; }
953 
954  virtual ~IfStatement() {}
955 
956  virtual void accept0(Visitor *visitor);
957 
958 // attributes
962 };
963 
965 {
966 public:
968  statement (stmt), expression (e)
969  { kind = Kind_DoWhileStatement; }
970 
971  virtual ~DoWhileStatement() {}
972 
973  virtual void accept0(Visitor *visitor);
974 
975 // attributes
978 };
979 
981 {
982 public:
984  expression (e), statement (stmt)
985  { kind = Kind_WhileStatement; }
986 
987  virtual ~WhileStatement() {}
988 
989  virtual void accept0(Visitor *visitor);
990 
991 // attributes
994 };
995 
996 class ForStatement: public Statement
997 {
998 public:
1000  initialiser (i), condition (c), expression (e), statement (stmt)
1001  { kind = Kind_ForStatement; }
1002 
1003  virtual ~ForStatement() {}
1004 
1005  virtual void accept0(Visitor *visitor);
1006 
1007 // attributes
1012 };
1013 
1015 {
1016 public:
1018  declarations (vlist), condition (c), expression (e), statement (stmt)
1019  { kind = Kind_LocalForStatement; }
1020 
1021  virtual ~LocalForStatement() {}
1022 
1023  virtual void accept0(Visitor *visitor);
1024 
1025 // attributes
1030 };
1031 
1033 {
1034 public:
1036  initialiser (i), expression (e), statement (stmt)
1037  { kind = Kind_ForEachStatement; }
1038 
1039  virtual ~ForEachStatement() {}
1040 
1041  virtual void accept0(Visitor *visitor);
1042 
1043 // attributes
1047 };
1048 
1050 {
1051 public:
1053  declaration (v), expression (e), statement (stmt)
1054  { kind = Kind_LocalForEachStatement; }
1055 
1057 
1058  virtual void accept0(Visitor *visitor);
1059 
1060 // attributes
1064 };
1065 
1067 {
1068 public:
1069  ContinueStatement(QScriptNameIdImpl *l = 0):
1070  label (l) { kind = Kind_ContinueStatement; }
1071 
1072  virtual ~ContinueStatement() {}
1073 
1074  virtual void accept0(Visitor *visitor);
1075 
1076 // attributes
1077  QScriptNameIdImpl *label;
1078 };
1079 
1081 {
1082 public:
1083  BreakStatement(QScriptNameIdImpl *l = 0):
1084  label (l) { kind = Kind_BreakStatement; }
1085 
1086  virtual ~BreakStatement() {}
1087 
1088  virtual void accept0(Visitor *visitor);
1089 
1090 // attributes
1091  QScriptNameIdImpl *label;
1092 };
1093 
1095 {
1096 public:
1098  expression (e) { kind = Kind_ReturnStatement; }
1099 
1100  virtual ~ReturnStatement() {}
1101 
1102  virtual void accept0(Visitor *visitor);
1103 
1104 // attributes
1106 };
1107 
1109 {
1110 public:
1112  expression (e), statement (stmt)
1113  { kind = Kind_WithStatement; }
1114 
1115  virtual ~WithStatement() {}
1116 
1117  virtual void accept0(Visitor *visitor);
1118 
1119 // attributes
1122 };
1123 
1125 {
1126 public:
1128  expression (e), block (b)
1129  { kind = Kind_SwitchStatement; }
1130 
1131  virtual ~SwitchStatement() {}
1132 
1133  virtual void accept0(Visitor *visitor);
1134 
1135 // attributes
1138 };
1139 
1140 class CaseBlock: public Node
1141 {
1142 public:
1144  clauses (c), defaultClause (d), moreClauses (r)
1145  { kind = Kind_CaseBlock; }
1146 
1147  virtual ~CaseBlock() {}
1148 
1149  virtual void accept0(Visitor *visitor);
1150 
1151 // attributes
1155 };
1156 
1157 class CaseClauses: public Node
1158 {
1159 public:
1161  clause (c), next (this)
1162  { kind = Kind_CaseClauses; }
1163 
1165  clause (c)
1166  {
1167  kind = Kind_CaseClauses;
1168  next = previous->next;
1169  previous->next = this;
1170  }
1171 
1172  virtual ~CaseClauses() {}
1173 
1174  virtual void accept0(Visitor *visitor);
1175 
1176  inline CaseClauses *finish ()
1177  {
1178  CaseClauses *front = next;
1179  next = 0;
1180  return front;
1181  }
1182 
1183 //attributes
1186 };
1187 
1188 class CaseClause: public Node
1189 {
1190 public:
1192  expression (e), statements (slist)
1193  { kind = Kind_CaseClause; }
1194 
1195  virtual ~CaseClause() {}
1196 
1197  virtual void accept0(Visitor *visitor);
1198 
1199 // attributes
1202 };
1203 
1204 class DefaultClause: public Node
1205 {
1206 public:
1208  statements (slist)
1209  { kind = Kind_DefaultClause; }
1210 
1211  virtual ~DefaultClause() {}
1212 
1213  virtual void accept0(Visitor *visitor);
1214 
1215 // attributes
1217 };
1218 
1220 {
1221 public:
1222  LabelledStatement(QScriptNameIdImpl *l, Statement *stmt):
1223  label (l), statement (stmt)
1224  { kind = Kind_LabelledStatement; }
1225 
1226  virtual ~LabelledStatement() {}
1227 
1228  virtual void accept0(Visitor *visitor);
1229 
1230 // attributes
1231  QScriptNameIdImpl *label;
1233 };
1234 
1236 {
1237 public:
1239  expression (e) { kind = Kind_ThrowStatement; }
1240 
1241  virtual ~ThrowStatement() {}
1242 
1243  virtual void accept0(Visitor *visitor);
1244 
1245 // attributes
1247 };
1248 
1250 {
1251 public:
1253  statement (stmt), catchExpression (c), finallyExpression (f)
1254  { kind = Kind_TryStatement; }
1255 
1257  statement (stmt), catchExpression (0), finallyExpression (f)
1258  { kind = Kind_TryStatement; }
1259 
1261  statement (stmt), catchExpression (c), finallyExpression (0)
1262  { kind = Kind_TryStatement; }
1263 
1264  virtual ~TryStatement() {}
1265 
1266  virtual void accept0(Visitor *visitor);
1267 
1268 // attributes
1272 };
1273 
1274 class Catch: public Node
1275 {
1276 public:
1277  Catch(QScriptNameIdImpl *n, Statement *stmt):
1278  name (n), statement (stmt)
1279  { kind = Kind_Catch; }
1280 
1281  virtual ~Catch() {}
1282 
1283  virtual void accept0(Visitor *visitor);
1284 
1285 // attributes
1286  QScriptNameIdImpl *name;
1288 };
1289 
1290 class Finally: public Node
1291 {
1292 public:
1294  statement (stmt)
1295  { kind = Kind_Finally; }
1296 
1297  virtual ~Finally() {}
1298 
1299  virtual void accept0(Visitor *visitor);
1300 
1301 // attributes
1303 };
1304 
1306 {
1307 public:
1308  FunctionExpression(QScriptNameIdImpl *n, FormalParameterList *f, FunctionBody *b):
1309  name (n), formals (f), body (b)
1310  { kind = Kind_FunctionExpression; }
1311 
1312  virtual ~FunctionExpression() {}
1313 
1314  virtual void accept0(Visitor *visitor);
1315 
1316 // attributes
1317  QScriptNameIdImpl *name;
1320 };
1321 
1323 {
1324 public:
1326  FunctionExpression(n, f, b)
1327  { kind = Kind_FunctionDeclaration; }
1328 
1330 
1331  virtual void accept0(Visitor *visitor);
1332 };
1333 
1335 {
1336 public:
1337  FormalParameterList(QScriptNameIdImpl *n):
1338  name (n), next (this)
1339  { kind = Kind_FormalParameterList; }
1340 
1341  FormalParameterList(FormalParameterList *previous, QScriptNameIdImpl *n):
1342  name (n)
1343  {
1344  kind = Kind_FormalParameterList;
1345  next = previous->next;
1346  previous->next = this;
1347  }
1348 
1350 
1351  virtual void accept0(Visitor *visitor);
1352 
1354  {
1355  FormalParameterList *front = next;
1356  next = 0;
1357  return front;
1358  }
1359 
1360 // attributes
1361  QScriptNameIdImpl *name;
1363 };
1364 
1365 class FunctionBody: public Node
1366 {
1367 public:
1369  elements (elts)
1370  { kind = Kind_FunctionBody; }
1371 
1372  virtual ~FunctionBody() {}
1373 
1374  virtual void accept0(Visitor *visitor);
1375 
1376 // attributes
1378 };
1379 
1380 class Program: public Node
1381 {
1382 public:
1384  elements (elts)
1385  { kind = Kind_Program; }
1386 
1387  virtual ~Program() {}
1388 
1389  virtual void accept0(Visitor *visitor);
1390 
1391 // attributes
1393 };
1394 
1395 class SourceElements: public Node
1396 {
1397 public:
1399  element (elt), next (this)
1400  { kind = Kind_SourceElements; }
1401 
1403  element (elt)
1404  {
1405  kind = Kind_SourceElements;
1406  next = previous->next;
1407  previous->next = this;
1408  }
1409 
1410  virtual ~SourceElements() {}
1411 
1412  virtual void accept0(Visitor *visitor);
1413 
1415  {
1416  SourceElements *front = next;
1417  next = 0;
1418  return front;
1419  }
1420 
1421 // attributes
1424 };
1425 
1426 class SourceElement: public Node
1427 {
1428 public:
1429  inline SourceElement()
1430  { kind = Kind_SourceElement; }
1431 
1432  virtual ~SourceElement() {}
1433 };
1434 
1436 {
1437 public:
1439  declaration (f)
1440  { kind = Kind_FunctionSourceElement; }
1441 
1443 
1444  virtual void accept0(Visitor *visitor);
1445 
1446 // attributes
1448 };
1449 
1451 {
1452 public:
1454  statement (stmt)
1455  { kind = Kind_StatementSourceElement; }
1456 
1458 
1459  virtual void accept0(Visitor *visitor);
1460 
1461 // attributes
1463 };
1464 
1466 {
1467 public:
1469  { kind = Kind_DebuggerStatement; }
1470 
1471  virtual ~DebuggerStatement() {}
1472 
1473  virtual void accept0(Visitor *visitor);
1474 };
1475 
1476 } } // namespace AST
1477 
1479 
1480 #endif
IfStatement(ExpressionNode *e, Statement *t, Statement *f=0)
Definition: qscriptast_p.h:950
WhileStatement(ExpressionNode *e, Statement *stmt)
Definition: qscriptast_p.h:983
double d
Definition: qnumeric_p.h:62
FieldMemberExpression(ExpressionNode *b, QScriptNameIdImpl *n)
Definition: qscriptast_p.h:517
ForEachStatement(ExpressionNode *i, ExpressionNode *e, Statement *stmt)
FunctionDeclaration(QScriptNameIdImpl *n, FormalParameterList *f, FunctionBody *b)
StatementList * statements
Definition: qscriptast_p.h:822
ObjectLiteral(PropertyNameAndValueList *plist)
Definition: qscriptast_p.h:348
StringLiteralPropertyName(QScriptNameIdImpl *n)
Definition: qscriptast_p.h:475
NewExpression(ExpressionNode *e)
Definition: qscriptast_p.h:549
unsigned char c[8]
Definition: qnumeric_p.h:62
ExpressionNode * expression
Definition: qscriptast_p.h:603
ArrayLiteral(ElementList *elts)
Definition: qscriptast_p.h:325
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
ExpressionNode * left
Definition: qscriptast_p.h:807
DefaultClause * defaultClause
CaseClauses * moreClauses
CaseClause(ExpressionNode *e, StatementList *slist)
ConditionalExpression(ExpressionNode *e, ExpressionNode *t, ExpressionNode *f)
Definition: qscriptast_p.h:782
Catch(QScriptNameIdImpl *n, Statement *stmt)
DeleteExpression(ExpressionNode *e)
Definition: qscriptast_p.h:638
VariableDeclaration * declaration
PostIncrementExpression(ExpressionNode *b)
Definition: qscriptast_p.h:610
NewMemberExpression(ExpressionNode *b, ArgumentList *a)
Definition: qscriptast_p.h:533
ExpressionNode * expression
Finally(Statement *stmt)
ForStatement(ExpressionNode *i, ExpressionNode *c, ExpressionNode *e, Statement *stmt)
Definition: qscriptast_p.h:999
FormalParameterList * finish()
BreakStatement(QScriptNameIdImpl *l=0)
PropertyNameAndValueList(PropertyNameAndValueList *previous, PropertyName *n, ExpressionNode *v)
Definition: qscriptast_p.h:426
void accept(Visitor *visitor)
Definition: qscriptast_p.h:185
VariableDeclarationList * finish(bool readOnly)
Definition: qscriptast_p.h:907
PreIncrementExpression(ExpressionNode *e)
Definition: qscriptast_p.h:679
CaseClauses(CaseClauses *previous, CaseClause *c)
ExpressionStatement(ExpressionNode *e)
Definition: qscriptast_p.h:936
FormalParameterList(QScriptNameIdImpl *n)
CallExpression(ExpressionNode *b, ArgumentList *a)
Definition: qscriptast_p.h:563
IdentifierExpression(QScriptNameIdImpl *n)
Definition: qscriptast_p.h:238
ExpressionNode * expression
FunctionExpression(QScriptNameIdImpl *n, FormalParameterList *f, FunctionBody *b)
long ASN1_INTEGER_get ASN1_INTEGER * a
SourceElements * elements
DefaultClause(StatementList *slist)
LocalForStatement(VariableDeclarationList *vlist, ExpressionNode *c, ExpressionNode *e, Statement *stmt)
StatementList * statements
PropertyNameAndValueList(PropertyName *n, ExpressionNode *v)
Definition: qscriptast_p.h:422
PropertyNameAndValueList * properties
Definition: qscriptast_p.h:356
PropertyNameAndValueList * next
Definition: qscriptast_p.h:448
VariableDeclaration(QScriptNameIdImpl *n, ExpressionNode *e)
Definition: qscriptast_p.h:874
ExpressionNode * expression
Definition: qscriptast_p.h:557
static const uint base
Definition: qurl.cpp:268
FormalParameterList(FormalParameterList *previous, QScriptNameIdImpl *n)
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
Statement * statement
ReturnStatement(ExpressionNode *e)
VariableDeclarationList * next
Definition: qscriptast_p.h:921
ExpressionNode * expression
Definition: qscriptast_p.h:387
ExpressionNode * expression
Definition: qscriptast_p.h:659
ArgumentList(ArgumentList *previous, ExpressionNode *e)
Definition: qscriptast_p.h:583
Expression(ExpressionNode *l, ExpressionNode *r)
Definition: qscriptast_p.h:799
UnaryPlusExpression(ExpressionNode *e)
Definition: qscriptast_p.h:707
static void acceptChild(Node *node, Visitor *visitor)
Definition: qscriptast_p.h:193
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
ExpressionNode * expression
Definition: qscriptast_p.h:757
VariableDeclarationList(VariableDeclarationList *previous, VariableDeclaration *decl)
Definition: qscriptast_p.h:895
FormalParameterList * formals
FunctionDeclaration * declaration
ExpressionNode * expression
CaseClauses(CaseClause *c)
StatementList(StatementList *previous, Statement *stmt)
Definition: qscriptast_p.h:832
LabelledStatement(QScriptNameIdImpl *l, Statement *stmt)
ThrowStatement(ExpressionNode *e)
FunctionBody(SourceElements *elts)
const char * name
WithStatement(ExpressionNode *e, Statement *stmt)
IdentifierPropertyName(QScriptNameIdImpl *n)
Definition: qscriptast_p.h:461
static QVector< Declaration > declarations(const QVector< StyleRule > &styleRules, const QString &part, quint64 pseudoClass=PseudoClass_Unspecified)
ExpressionNode * expression
Definition: qscriptast_p.h:992
RegExpLiteral(QScriptNameIdImpl *p, int f)
Definition: qscriptast_p.h:306
DoWhileStatement(Statement *stmt, ExpressionNode *e)
Definition: qscriptast_p.h:967
Elision(Elision *previous)
Definition: qscriptast_p.h:397
FunctionSourceElement(FunctionDeclaration *f)
SwitchStatement(ExpressionNode *e, CaseBlock *b)
StringLiteral(QScriptNameIdImpl *v)
Definition: qscriptast_p.h:292
Program(SourceElements *elts)
SourceElements(SourceElements *previous, SourceElement *elt)
UnaryMinusExpression(ExpressionNode *e)
Definition: qscriptast_p.h:721
ElementList(Elision *e, ExpressionNode *expr)
Definition: qscriptast_p.h:362
VariableDeclarationList * declarations
StatementList(Statement *stmt)
Definition: qscriptast_p.h:828
ArgumentList * finish()
Definition: qscriptast_p.h:595
PostDecrementExpression(ExpressionNode *b)
Definition: qscriptast_p.h:624
ExpressionNode * expression
Definition: qscriptast_p.h:959
PreDecrementExpression(ExpressionNode *e)
Definition: qscriptast_p.h:693
virtual bool preVisit(Node *)
TypeOfExpression(ExpressionNode *e)
Definition: qscriptast_p.h:665
PropertyNameAndValueList * finish()
Definition: qscriptast_p.h:438
TildeExpression(ExpressionNode *e)
Definition: qscriptast_p.h:735
TryStatement(Statement *stmt, Catch *c)
VariableStatement(VariableDeclarationList *vlist)
Definition: qscriptast_p.h:859
ContinueStatement(QScriptNameIdImpl *l=0)
BinaryExpression(ExpressionNode *l, int o, ExpressionNode *r)
Definition: qscriptast_p.h:763
ExpressionNode * condition
ArrayMemberExpression(ExpressionNode *b, ExpressionNode *e)
Definition: qscriptast_p.h:501
Block(StatementList *slist)
Definition: qscriptast_p.h:814
QFactoryLoader * l
ArgumentList(ExpressionNode *e)
Definition: qscriptast_p.h:579
ExpressionNode * right
Definition: qscriptast_p.h:808
static const QCssKnownValue properties[NumProperties - 1]
Definition: qcssparser.cpp:67
ExpressionNode * initialiser
static const QTextHtmlElement elements[Html_NumElements]
virtual void postVisit(Node *)
VoidExpression(ExpressionNode *e)
Definition: qscriptast_p.h:651
TryStatement(Statement *stmt, Catch *c, Finally *f)
VariableDeclarationList * declarations
Definition: qscriptast_p.h:868
QScriptNameIdImpl * label
NotExpression(ExpressionNode *e)
Definition: qscriptast_p.h:749
CaseBlock(CaseClauses *c, DefaultClause *d=0, CaseClauses *r=0)
QScriptNameIdImpl * value
Definition: qscriptast_p.h:300
SourceElements * finish()
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
LocalForEachStatement(VariableDeclaration *v, ExpressionNode *e, Statement *stmt)
QScriptNameIdImpl * pattern
Definition: qscriptast_p.h:314
ArrayLiteral(ElementList *elts, Elision *e)
Definition: qscriptast_p.h:329
SourceElements(SourceElement *elt)
TryStatement(Statement *stmt, Finally *f)
SourceElements * elements
ElementList(ElementList *previous, Elision *e, ExpressionNode *expr)
Definition: qscriptast_p.h:366
VariableDeclarationList(VariableDeclaration *decl)
Definition: qscriptast_p.h:891
QScriptNameIdImpl * name
ElementList * finish()
Definition: qscriptast_p.h:376
StatementList * finish()
Definition: qscriptast_p.h:844