Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: pkg/analyzer/lib/dart/ast/visitor.dart

Issue 1843473002: Sort analyzer sources (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Remove generated file and fix misplaced comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Defines AST visitors that support useful patterns for visiting the nodes in 6 * Defines AST visitors that support useful patterns for visiting the nodes in
7 * an [AST structure](ast.dart). 7 * an [AST structure](ast.dart).
8 * 8 *
9 * Dart is an evolving language, and the AST structure must evolved with it. 9 * Dart is an evolving language, and the AST structure must evolved with it.
10 * When the AST structure changes, the visitor interface will sometimes change 10 * When the AST structure changes, the visitor interface will sometimes change
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 888
889 @override 889 @override
890 T visitYieldStatement(YieldStatement node) { 890 T visitYieldStatement(YieldStatement node) {
891 _delegates.forEach((delegate) => delegate.visitYieldStatement(node)); 891 _delegates.forEach((delegate) => delegate.visitYieldStatement(node));
892 node.visitChildren(this); 892 node.visitChildren(this);
893 return null; 893 return null;
894 } 894 }
895 } 895 }
896 896
897 /** 897 /**
898 * An AST Visitor that captures visit call timings.
899 */
900 class TimedAstVisitor<T> implements AstVisitor<T> {
901 /**
902 * The base visitor whose visit methods will be timed.
903 */
904 final AstVisitor<T> _baseVisitor;
905
906 /**
907 * Collects elapsed time for visit calls.
908 */
909 final Stopwatch stopwatch;
910
911 /**
912 * Initialize a newly created visitor to time calls to the given base
913 * visitor's visits.
914 */
915 TimedAstVisitor(this._baseVisitor, [Stopwatch watch])
916 : stopwatch = watch ?? new Stopwatch();
917
918 @override
919 T visitAdjacentStrings(AdjacentStrings node) {
920 stopwatch.start();
921 T result = _baseVisitor.visitAdjacentStrings(node);
922 stopwatch.stop();
923 return result;
924 }
925
926 @override
927 T visitAnnotation(Annotation node) {
928 stopwatch.start();
929 T result = _baseVisitor.visitAnnotation(node);
930 stopwatch.stop();
931 return result;
932 }
933
934 @override
935 T visitArgumentList(ArgumentList node) {
936 stopwatch.start();
937 T result = _baseVisitor.visitArgumentList(node);
938 stopwatch.stop();
939 return result;
940 }
941
942 @override
943 T visitAsExpression(AsExpression node) {
944 stopwatch.start();
945 T result = _baseVisitor.visitAsExpression(node);
946 stopwatch.stop();
947 return result;
948 }
949
950 @override
951 T visitAssertStatement(AssertStatement node) {
952 stopwatch.start();
953 T result = _baseVisitor.visitAssertStatement(node);
954 stopwatch.stop();
955 return result;
956 }
957
958 @override
959 T visitAssignmentExpression(AssignmentExpression node) {
960 stopwatch.start();
961 T result = _baseVisitor.visitAssignmentExpression(node);
962 stopwatch.stop();
963 return result;
964 }
965
966 @override
967 T visitAwaitExpression(AwaitExpression node) {
968 stopwatch.start();
969 T result = _baseVisitor.visitAwaitExpression(node);
970 stopwatch.stop();
971 return result;
972 }
973
974 @override
975 T visitBinaryExpression(BinaryExpression node) {
976 stopwatch.start();
977 T result = _baseVisitor.visitBinaryExpression(node);
978 stopwatch.stop();
979 return result;
980 }
981
982 @override
983 T visitBlock(Block node) {
984 stopwatch.start();
985 T result = _baseVisitor.visitBlock(node);
986 stopwatch.stop();
987 return result;
988 }
989
990 @override
991 T visitBlockFunctionBody(BlockFunctionBody node) {
992 stopwatch.start();
993 T result = _baseVisitor.visitBlockFunctionBody(node);
994 stopwatch.stop();
995 return result;
996 }
997
998 @override
999 T visitBooleanLiteral(BooleanLiteral node) {
1000 stopwatch.start();
1001 T result = _baseVisitor.visitBooleanLiteral(node);
1002 stopwatch.stop();
1003 return result;
1004 }
1005
1006 @override
1007 T visitBreakStatement(BreakStatement node) {
1008 stopwatch.start();
1009 T result = _baseVisitor.visitBreakStatement(node);
1010 stopwatch.stop();
1011 return result;
1012 }
1013
1014 @override
1015 T visitCascadeExpression(CascadeExpression node) {
1016 stopwatch.start();
1017 T result = _baseVisitor.visitCascadeExpression(node);
1018 stopwatch.stop();
1019 return result;
1020 }
1021
1022 @override
1023 T visitCatchClause(CatchClause node) {
1024 stopwatch.start();
1025 T result = _baseVisitor.visitCatchClause(node);
1026 stopwatch.stop();
1027 return result;
1028 }
1029
1030 @override
1031 T visitClassDeclaration(ClassDeclaration node) {
1032 stopwatch.start();
1033 T result = _baseVisitor.visitClassDeclaration(node);
1034 stopwatch.stop();
1035 return result;
1036 }
1037
1038 @override
1039 T visitClassTypeAlias(ClassTypeAlias node) {
1040 stopwatch.start();
1041 T result = _baseVisitor.visitClassTypeAlias(node);
1042 stopwatch.stop();
1043 return result;
1044 }
1045
1046 @override
1047 T visitComment(Comment node) {
1048 stopwatch.start();
1049 T result = _baseVisitor.visitComment(node);
1050 stopwatch.stop();
1051 return result;
1052 }
1053
1054 @override
1055 T visitCommentReference(CommentReference node) {
1056 stopwatch.start();
1057 T result = _baseVisitor.visitCommentReference(node);
1058 stopwatch.stop();
1059 return result;
1060 }
1061
1062 @override
1063 T visitCompilationUnit(CompilationUnit node) {
1064 stopwatch.start();
1065 T result = _baseVisitor.visitCompilationUnit(node);
1066 stopwatch.stop();
1067 return result;
1068 }
1069
1070 @override
1071 T visitConditionalExpression(ConditionalExpression node) {
1072 stopwatch.start();
1073 T result = _baseVisitor.visitConditionalExpression(node);
1074 stopwatch.stop();
1075 return result;
1076 }
1077
1078 @override
1079 T visitConfiguration(Configuration node) {
1080 stopwatch.start();
1081 T result = _baseVisitor.visitConfiguration(node);
1082 stopwatch.stop();
1083 return result;
1084 }
1085
1086 @override
1087 T visitConstructorDeclaration(ConstructorDeclaration node) {
1088 stopwatch.start();
1089 T result = _baseVisitor.visitConstructorDeclaration(node);
1090 stopwatch.stop();
1091 return result;
1092 }
1093
1094 @override
1095 T visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
1096 stopwatch.start();
1097 T result = _baseVisitor.visitConstructorFieldInitializer(node);
1098 stopwatch.stop();
1099 return result;
1100 }
1101
1102 @override
1103 T visitConstructorName(ConstructorName node) {
1104 stopwatch.start();
1105 T result = _baseVisitor.visitConstructorName(node);
1106 stopwatch.stop();
1107 return result;
1108 }
1109
1110 @override
1111 T visitContinueStatement(ContinueStatement node) {
1112 stopwatch.start();
1113 T result = _baseVisitor.visitContinueStatement(node);
1114 stopwatch.stop();
1115 return result;
1116 }
1117
1118 @override
1119 T visitDeclaredIdentifier(DeclaredIdentifier node) {
1120 stopwatch.start();
1121 T result = _baseVisitor.visitDeclaredIdentifier(node);
1122 stopwatch.stop();
1123 return result;
1124 }
1125
1126 @override
1127 T visitDefaultFormalParameter(DefaultFormalParameter node) {
1128 stopwatch.start();
1129 T result = _baseVisitor.visitDefaultFormalParameter(node);
1130 stopwatch.stop();
1131 return result;
1132 }
1133
1134 @override
1135 T visitDoStatement(DoStatement node) {
1136 stopwatch.start();
1137 T result = _baseVisitor.visitDoStatement(node);
1138 stopwatch.stop();
1139 return result;
1140 }
1141
1142 @override
1143 T visitDottedName(DottedName node) {
1144 stopwatch.start();
1145 T result = _baseVisitor.visitDottedName(node);
1146 stopwatch.stop();
1147 return result;
1148 }
1149
1150 @override
1151 T visitDoubleLiteral(DoubleLiteral node) {
1152 stopwatch.start();
1153 T result = _baseVisitor.visitDoubleLiteral(node);
1154 stopwatch.stop();
1155 return result;
1156 }
1157
1158 @override
1159 T visitEmptyFunctionBody(EmptyFunctionBody node) {
1160 stopwatch.start();
1161 T result = _baseVisitor.visitEmptyFunctionBody(node);
1162 stopwatch.stop();
1163 return result;
1164 }
1165
1166 @override
1167 T visitEmptyStatement(EmptyStatement node) {
1168 stopwatch.start();
1169 T result = _baseVisitor.visitEmptyStatement(node);
1170 stopwatch.stop();
1171 return result;
1172 }
1173
1174 @override
1175 T visitEnumConstantDeclaration(EnumConstantDeclaration node) {
1176 stopwatch.start();
1177 T result = _baseVisitor.visitEnumConstantDeclaration(node);
1178 stopwatch.stop();
1179 return result;
1180 }
1181
1182 @override
1183 T visitEnumDeclaration(EnumDeclaration node) {
1184 stopwatch.start();
1185 T result = _baseVisitor.visitEnumDeclaration(node);
1186 stopwatch.stop();
1187 return result;
1188 }
1189
1190 @override
1191 T visitExportDirective(ExportDirective node) {
1192 stopwatch.start();
1193 T result = _baseVisitor.visitExportDirective(node);
1194 stopwatch.stop();
1195 return result;
1196 }
1197
1198 @override
1199 T visitExpressionFunctionBody(ExpressionFunctionBody node) {
1200 stopwatch.start();
1201 T result = _baseVisitor.visitExpressionFunctionBody(node);
1202 stopwatch.stop();
1203 return result;
1204 }
1205
1206 @override
1207 T visitExpressionStatement(ExpressionStatement node) {
1208 stopwatch.start();
1209 T result = _baseVisitor.visitExpressionStatement(node);
1210 stopwatch.stop();
1211 return result;
1212 }
1213
1214 @override
1215 T visitExtendsClause(ExtendsClause node) {
1216 stopwatch.start();
1217 T result = _baseVisitor.visitExtendsClause(node);
1218 stopwatch.stop();
1219 return result;
1220 }
1221
1222 @override
1223 T visitFieldDeclaration(FieldDeclaration node) {
1224 stopwatch.start();
1225 T result = _baseVisitor.visitFieldDeclaration(node);
1226 stopwatch.stop();
1227 return result;
1228 }
1229
1230 @override
1231 T visitFieldFormalParameter(FieldFormalParameter node) {
1232 stopwatch.start();
1233 T result = _baseVisitor.visitFieldFormalParameter(node);
1234 stopwatch.stop();
1235 return result;
1236 }
1237
1238 @override
1239 T visitForEachStatement(ForEachStatement node) {
1240 stopwatch.start();
1241 T result = _baseVisitor.visitForEachStatement(node);
1242 stopwatch.stop();
1243 return result;
1244 }
1245
1246 @override
1247 T visitFormalParameterList(FormalParameterList node) {
1248 stopwatch.start();
1249 T result = _baseVisitor.visitFormalParameterList(node);
1250 stopwatch.stop();
1251 return result;
1252 }
1253
1254 @override
1255 T visitForStatement(ForStatement node) {
1256 stopwatch.start();
1257 T result = _baseVisitor.visitForStatement(node);
1258 stopwatch.stop();
1259 return result;
1260 }
1261
1262 @override
1263 T visitFunctionDeclaration(FunctionDeclaration node) {
1264 stopwatch.start();
1265 T result = _baseVisitor.visitFunctionDeclaration(node);
1266 stopwatch.stop();
1267 return result;
1268 }
1269
1270 @override
1271 T visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
1272 stopwatch.start();
1273 T result = _baseVisitor.visitFunctionDeclarationStatement(node);
1274 stopwatch.stop();
1275 return result;
1276 }
1277
1278 @override
1279 T visitFunctionExpression(FunctionExpression node) {
1280 stopwatch.start();
1281 T result = _baseVisitor.visitFunctionExpression(node);
1282 stopwatch.stop();
1283 return result;
1284 }
1285
1286 @override
1287 T visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
1288 stopwatch.start();
1289 T result = _baseVisitor.visitFunctionExpressionInvocation(node);
1290 stopwatch.stop();
1291 return result;
1292 }
1293
1294 @override
1295 T visitFunctionTypeAlias(FunctionTypeAlias node) {
1296 stopwatch.start();
1297 T result = _baseVisitor.visitFunctionTypeAlias(node);
1298 stopwatch.stop();
1299 return result;
1300 }
1301
1302 @override
1303 T visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
1304 stopwatch.start();
1305 T result = _baseVisitor.visitFunctionTypedFormalParameter(node);
1306 stopwatch.stop();
1307 return result;
1308 }
1309
1310 @override
1311 T visitHideCombinator(HideCombinator node) {
1312 stopwatch.start();
1313 T result = _baseVisitor.visitHideCombinator(node);
1314 stopwatch.stop();
1315 return result;
1316 }
1317
1318 @override
1319 T visitIfStatement(IfStatement node) {
1320 stopwatch.start();
1321 T result = _baseVisitor.visitIfStatement(node);
1322 stopwatch.stop();
1323 return result;
1324 }
1325
1326 @override
1327 T visitImplementsClause(ImplementsClause node) {
1328 stopwatch.start();
1329 T result = _baseVisitor.visitImplementsClause(node);
1330 stopwatch.stop();
1331 return result;
1332 }
1333
1334 @override
1335 T visitImportDirective(ImportDirective node) {
1336 stopwatch.start();
1337 T result = _baseVisitor.visitImportDirective(node);
1338 stopwatch.stop();
1339 return result;
1340 }
1341
1342 @override
1343 T visitIndexExpression(IndexExpression node) {
1344 stopwatch.start();
1345 T result = _baseVisitor.visitIndexExpression(node);
1346 stopwatch.stop();
1347 return result;
1348 }
1349
1350 @override
1351 T visitInstanceCreationExpression(InstanceCreationExpression node) {
1352 stopwatch.start();
1353 T result = _baseVisitor.visitInstanceCreationExpression(node);
1354 stopwatch.stop();
1355 return result;
1356 }
1357
1358 @override
1359 T visitIntegerLiteral(IntegerLiteral node) {
1360 stopwatch.start();
1361 T result = _baseVisitor.visitIntegerLiteral(node);
1362 stopwatch.stop();
1363 return result;
1364 }
1365
1366 @override
1367 T visitInterpolationExpression(InterpolationExpression node) {
1368 stopwatch.start();
1369 T result = _baseVisitor.visitInterpolationExpression(node);
1370 stopwatch.stop();
1371 return result;
1372 }
1373
1374 @override
1375 T visitInterpolationString(InterpolationString node) {
1376 stopwatch.start();
1377 T result = _baseVisitor.visitInterpolationString(node);
1378 stopwatch.stop();
1379 return result;
1380 }
1381
1382 @override
1383 T visitIsExpression(IsExpression node) {
1384 stopwatch.start();
1385 T result = _baseVisitor.visitIsExpression(node);
1386 stopwatch.stop();
1387 return result;
1388 }
1389
1390 @override
1391 T visitLabel(Label node) {
1392 stopwatch.start();
1393 T result = _baseVisitor.visitLabel(node);
1394 stopwatch.stop();
1395 return result;
1396 }
1397
1398 @override
1399 T visitLabeledStatement(LabeledStatement node) {
1400 stopwatch.start();
1401 T result = _baseVisitor.visitLabeledStatement(node);
1402 stopwatch.stop();
1403 return result;
1404 }
1405
1406 @override
1407 T visitLibraryDirective(LibraryDirective node) {
1408 stopwatch.start();
1409 T result = _baseVisitor.visitLibraryDirective(node);
1410 stopwatch.stop();
1411 return result;
1412 }
1413
1414 @override
1415 T visitLibraryIdentifier(LibraryIdentifier node) {
1416 stopwatch.start();
1417 T result = _baseVisitor.visitLibraryIdentifier(node);
1418 stopwatch.stop();
1419 return result;
1420 }
1421
1422 @override
1423 T visitListLiteral(ListLiteral node) {
1424 stopwatch.start();
1425 T result = _baseVisitor.visitListLiteral(node);
1426 stopwatch.stop();
1427 return result;
1428 }
1429
1430 @override
1431 T visitMapLiteral(MapLiteral node) {
1432 stopwatch.start();
1433 T result = _baseVisitor.visitMapLiteral(node);
1434 stopwatch.stop();
1435 return result;
1436 }
1437
1438 @override
1439 T visitMapLiteralEntry(MapLiteralEntry node) {
1440 stopwatch.start();
1441 T result = _baseVisitor.visitMapLiteralEntry(node);
1442 stopwatch.stop();
1443 return result;
1444 }
1445
1446 @override
1447 T visitMethodDeclaration(MethodDeclaration node) {
1448 stopwatch.start();
1449 T result = _baseVisitor.visitMethodDeclaration(node);
1450 stopwatch.stop();
1451 return result;
1452 }
1453
1454 @override
1455 T visitMethodInvocation(MethodInvocation node) {
1456 stopwatch.start();
1457 T result = _baseVisitor.visitMethodInvocation(node);
1458 stopwatch.stop();
1459 return result;
1460 }
1461
1462 @override
1463 T visitNamedExpression(NamedExpression node) {
1464 stopwatch.start();
1465 T result = _baseVisitor.visitNamedExpression(node);
1466 stopwatch.stop();
1467 return result;
1468 }
1469
1470 @override
1471 T visitNativeClause(NativeClause node) {
1472 stopwatch.start();
1473 T result = _baseVisitor.visitNativeClause(node);
1474 stopwatch.stop();
1475 return result;
1476 }
1477
1478 @override
1479 T visitNativeFunctionBody(NativeFunctionBody node) {
1480 stopwatch.start();
1481 T result = _baseVisitor.visitNativeFunctionBody(node);
1482 stopwatch.stop();
1483 return result;
1484 }
1485
1486 @override
1487 T visitNullLiteral(NullLiteral node) {
1488 stopwatch.start();
1489 T result = _baseVisitor.visitNullLiteral(node);
1490 stopwatch.stop();
1491 return result;
1492 }
1493
1494 @override
1495 T visitParenthesizedExpression(ParenthesizedExpression node) {
1496 stopwatch.start();
1497 T result = _baseVisitor.visitParenthesizedExpression(node);
1498 stopwatch.stop();
1499 return result;
1500 }
1501
1502 @override
1503 T visitPartDirective(PartDirective node) {
1504 stopwatch.start();
1505 T result = _baseVisitor.visitPartDirective(node);
1506 stopwatch.stop();
1507 return result;
1508 }
1509
1510 @override
1511 T visitPartOfDirective(PartOfDirective node) {
1512 stopwatch.start();
1513 T result = _baseVisitor.visitPartOfDirective(node);
1514 stopwatch.stop();
1515 return result;
1516 }
1517
1518 @override
1519 T visitPostfixExpression(PostfixExpression node) {
1520 stopwatch.start();
1521 T result = _baseVisitor.visitPostfixExpression(node);
1522 stopwatch.stop();
1523 return result;
1524 }
1525
1526 @override
1527 T visitPrefixedIdentifier(PrefixedIdentifier node) {
1528 stopwatch.start();
1529 T result = _baseVisitor.visitPrefixedIdentifier(node);
1530 stopwatch.stop();
1531 return result;
1532 }
1533
1534 @override
1535 T visitPrefixExpression(PrefixExpression node) {
1536 stopwatch.start();
1537 T result = _baseVisitor.visitPrefixExpression(node);
1538 stopwatch.stop();
1539 return result;
1540 }
1541
1542 @override
1543 T visitPropertyAccess(PropertyAccess node) {
1544 stopwatch.start();
1545 T result = _baseVisitor.visitPropertyAccess(node);
1546 stopwatch.stop();
1547 return result;
1548 }
1549
1550 @override
1551 T visitRedirectingConstructorInvocation(
1552 RedirectingConstructorInvocation node) {
1553 stopwatch.start();
1554 T result = _baseVisitor.visitRedirectingConstructorInvocation(node);
1555 stopwatch.stop();
1556 return result;
1557 }
1558
1559 @override
1560 T visitRethrowExpression(RethrowExpression node) {
1561 stopwatch.start();
1562 T result = _baseVisitor.visitRethrowExpression(node);
1563 stopwatch.stop();
1564 return result;
1565 }
1566
1567 @override
1568 T visitReturnStatement(ReturnStatement node) {
1569 stopwatch.start();
1570 T result = _baseVisitor.visitReturnStatement(node);
1571 stopwatch.stop();
1572 return result;
1573 }
1574
1575 @override
1576 T visitScriptTag(ScriptTag node) {
1577 stopwatch.start();
1578 T result = _baseVisitor.visitScriptTag(node);
1579 stopwatch.stop();
1580 return result;
1581 }
1582
1583 @override
1584 T visitShowCombinator(ShowCombinator node) {
1585 stopwatch.start();
1586 T result = _baseVisitor.visitShowCombinator(node);
1587 stopwatch.stop();
1588 return result;
1589 }
1590
1591 @override
1592 T visitSimpleFormalParameter(SimpleFormalParameter node) {
1593 stopwatch.start();
1594 T result = _baseVisitor.visitSimpleFormalParameter(node);
1595 stopwatch.stop();
1596 return result;
1597 }
1598
1599 @override
1600 T visitSimpleIdentifier(SimpleIdentifier node) {
1601 stopwatch.start();
1602 T result = _baseVisitor.visitSimpleIdentifier(node);
1603 stopwatch.stop();
1604 return result;
1605 }
1606
1607 @override
1608 T visitSimpleStringLiteral(SimpleStringLiteral node) {
1609 stopwatch.start();
1610 T result = _baseVisitor.visitSimpleStringLiteral(node);
1611 stopwatch.stop();
1612 return result;
1613 }
1614
1615 @override
1616 T visitStringInterpolation(StringInterpolation node) {
1617 stopwatch.start();
1618 T result = _baseVisitor.visitStringInterpolation(node);
1619 stopwatch.stop();
1620 return result;
1621 }
1622
1623 @override
1624 T visitSuperConstructorInvocation(SuperConstructorInvocation node) {
1625 stopwatch.start();
1626 T result = _baseVisitor.visitSuperConstructorInvocation(node);
1627 stopwatch.stop();
1628 return result;
1629 }
1630
1631 @override
1632 T visitSuperExpression(SuperExpression node) {
1633 stopwatch.start();
1634 T result = _baseVisitor.visitSuperExpression(node);
1635 stopwatch.stop();
1636 return result;
1637 }
1638
1639 @override
1640 T visitSwitchCase(SwitchCase node) {
1641 stopwatch.start();
1642 T result = _baseVisitor.visitSwitchCase(node);
1643 stopwatch.stop();
1644 return result;
1645 }
1646
1647 @override
1648 T visitSwitchDefault(SwitchDefault node) {
1649 stopwatch.start();
1650 T result = _baseVisitor.visitSwitchDefault(node);
1651 stopwatch.stop();
1652 return result;
1653 }
1654
1655 @override
1656 T visitSwitchStatement(SwitchStatement node) {
1657 stopwatch.start();
1658 T result = _baseVisitor.visitSwitchStatement(node);
1659 stopwatch.stop();
1660 return result;
1661 }
1662
1663 @override
1664 T visitSymbolLiteral(SymbolLiteral node) {
1665 stopwatch.start();
1666 T result = _baseVisitor.visitSymbolLiteral(node);
1667 stopwatch.stop();
1668 return result;
1669 }
1670
1671 @override
1672 T visitThisExpression(ThisExpression node) {
1673 stopwatch.start();
1674 T result = _baseVisitor.visitThisExpression(node);
1675 stopwatch.stop();
1676 return result;
1677 }
1678
1679 @override
1680 T visitThrowExpression(ThrowExpression node) {
1681 stopwatch.start();
1682 T result = _baseVisitor.visitThrowExpression(node);
1683 stopwatch.stop();
1684 return result;
1685 }
1686
1687 @override
1688 T visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
1689 stopwatch.start();
1690 T result = _baseVisitor.visitTopLevelVariableDeclaration(node);
1691 stopwatch.stop();
1692 return result;
1693 }
1694
1695 @override
1696 T visitTryStatement(TryStatement node) {
1697 stopwatch.start();
1698 T result = _baseVisitor.visitTryStatement(node);
1699 stopwatch.stop();
1700 return result;
1701 }
1702
1703 @override
1704 T visitTypeArgumentList(TypeArgumentList node) {
1705 stopwatch.start();
1706 T result = _baseVisitor.visitTypeArgumentList(node);
1707 stopwatch.stop();
1708 return result;
1709 }
1710
1711 @override
1712 T visitTypeName(TypeName node) {
1713 stopwatch.start();
1714 T result = _baseVisitor.visitTypeName(node);
1715 stopwatch.stop();
1716 return result;
1717 }
1718
1719 @override
1720 T visitTypeParameter(TypeParameter node) {
1721 stopwatch.start();
1722 T result = _baseVisitor.visitTypeParameter(node);
1723 stopwatch.stop();
1724 return result;
1725 }
1726
1727 @override
1728 T visitTypeParameterList(TypeParameterList node) {
1729 stopwatch.start();
1730 T result = _baseVisitor.visitTypeParameterList(node);
1731 stopwatch.stop();
1732 return result;
1733 }
1734
1735 @override
1736 T visitVariableDeclaration(VariableDeclaration node) {
1737 stopwatch.start();
1738 T result = _baseVisitor.visitVariableDeclaration(node);
1739 stopwatch.stop();
1740 return result;
1741 }
1742
1743 @override
1744 T visitVariableDeclarationList(VariableDeclarationList node) {
1745 stopwatch.start();
1746 T result = _baseVisitor.visitVariableDeclarationList(node);
1747 stopwatch.stop();
1748 return result;
1749 }
1750
1751 @override
1752 T visitVariableDeclarationStatement(VariableDeclarationStatement node) {
1753 stopwatch.start();
1754 T result = _baseVisitor.visitVariableDeclarationStatement(node);
1755 stopwatch.stop();
1756 return result;
1757 }
1758
1759 @override
1760 T visitWhileStatement(WhileStatement node) {
1761 stopwatch.start();
1762 T result = _baseVisitor.visitWhileStatement(node);
1763 stopwatch.stop();
1764 return result;
1765 }
1766
1767 @override
1768 T visitWithClause(WithClause node) {
1769 stopwatch.start();
1770 T result = _baseVisitor.visitWithClause(node);
1771 stopwatch.stop();
1772 return result;
1773 }
1774
1775 @override
1776 T visitYieldStatement(YieldStatement node) {
1777 stopwatch.start();
1778 T result = _baseVisitor.visitYieldStatement(node);
1779 stopwatch.stop();
1780 return result;
1781 }
1782 }
1783
1784 /**
1785 * An AST visitor that will recursively visit all of the nodes in an AST 898 * An AST visitor that will recursively visit all of the nodes in an AST
1786 * structure (like instances of the class [RecursiveAstVisitor]). In addition, 899 * structure (like instances of the class [RecursiveAstVisitor]). In addition,
1787 * when a node of a specific type is visited not only will the visit method for 900 * when a node of a specific type is visited not only will the visit method for
1788 * that specific type of node be invoked, but additional methods for the 901 * that specific type of node be invoked, but additional methods for the
1789 * superclasses of that node will also be invoked. For example, using an 902 * superclasses of that node will also be invoked. For example, using an
1790 * instance of this class to visit a [Block] will cause the method [visitBlock] 903 * instance of this class to visit a [Block] will cause the method [visitBlock]
1791 * to be invoked but will also cause the methods [visitStatement] and 904 * to be invoked but will also cause the methods [visitStatement] and
1792 * [visitNode] to be subsequently invoked. This allows visitors to be written 905 * [visitNode] to be subsequently invoked. This allows visitors to be written
1793 * that visit all statements without needing to override the visit method for 906 * that visit all statements without needing to override the visit method for
1794 * each of the specific subclasses of [Statement]. 907 * each of the specific subclasses of [Statement].
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after
3207 R visitWhileStatement(WhileStatement node) => null; 2320 R visitWhileStatement(WhileStatement node) => null;
3208 2321
3209 @override 2322 @override
3210 R visitWithClause(WithClause node) => null; 2323 R visitWithClause(WithClause node) => null;
3211 2324
3212 @override 2325 @override
3213 R visitYieldStatement(YieldStatement node) => null; 2326 R visitYieldStatement(YieldStatement node) => null;
3214 } 2327 }
3215 2328
3216 /** 2329 /**
2330 * An AST Visitor that captures visit call timings.
2331 */
2332 class TimedAstVisitor<T> implements AstVisitor<T> {
2333 /**
2334 * The base visitor whose visit methods will be timed.
2335 */
2336 final AstVisitor<T> _baseVisitor;
2337
2338 /**
2339 * Collects elapsed time for visit calls.
2340 */
2341 final Stopwatch stopwatch;
2342
2343 /**
2344 * Initialize a newly created visitor to time calls to the given base
2345 * visitor's visits.
2346 */
2347 TimedAstVisitor(this._baseVisitor, [Stopwatch watch])
2348 : stopwatch = watch ?? new Stopwatch();
2349
2350 @override
2351 T visitAdjacentStrings(AdjacentStrings node) {
2352 stopwatch.start();
2353 T result = _baseVisitor.visitAdjacentStrings(node);
2354 stopwatch.stop();
2355 return result;
2356 }
2357
2358 @override
2359 T visitAnnotation(Annotation node) {
2360 stopwatch.start();
2361 T result = _baseVisitor.visitAnnotation(node);
2362 stopwatch.stop();
2363 return result;
2364 }
2365
2366 @override
2367 T visitArgumentList(ArgumentList node) {
2368 stopwatch.start();
2369 T result = _baseVisitor.visitArgumentList(node);
2370 stopwatch.stop();
2371 return result;
2372 }
2373
2374 @override
2375 T visitAsExpression(AsExpression node) {
2376 stopwatch.start();
2377 T result = _baseVisitor.visitAsExpression(node);
2378 stopwatch.stop();
2379 return result;
2380 }
2381
2382 @override
2383 T visitAssertStatement(AssertStatement node) {
2384 stopwatch.start();
2385 T result = _baseVisitor.visitAssertStatement(node);
2386 stopwatch.stop();
2387 return result;
2388 }
2389
2390 @override
2391 T visitAssignmentExpression(AssignmentExpression node) {
2392 stopwatch.start();
2393 T result = _baseVisitor.visitAssignmentExpression(node);
2394 stopwatch.stop();
2395 return result;
2396 }
2397
2398 @override
2399 T visitAwaitExpression(AwaitExpression node) {
2400 stopwatch.start();
2401 T result = _baseVisitor.visitAwaitExpression(node);
2402 stopwatch.stop();
2403 return result;
2404 }
2405
2406 @override
2407 T visitBinaryExpression(BinaryExpression node) {
2408 stopwatch.start();
2409 T result = _baseVisitor.visitBinaryExpression(node);
2410 stopwatch.stop();
2411 return result;
2412 }
2413
2414 @override
2415 T visitBlock(Block node) {
2416 stopwatch.start();
2417 T result = _baseVisitor.visitBlock(node);
2418 stopwatch.stop();
2419 return result;
2420 }
2421
2422 @override
2423 T visitBlockFunctionBody(BlockFunctionBody node) {
2424 stopwatch.start();
2425 T result = _baseVisitor.visitBlockFunctionBody(node);
2426 stopwatch.stop();
2427 return result;
2428 }
2429
2430 @override
2431 T visitBooleanLiteral(BooleanLiteral node) {
2432 stopwatch.start();
2433 T result = _baseVisitor.visitBooleanLiteral(node);
2434 stopwatch.stop();
2435 return result;
2436 }
2437
2438 @override
2439 T visitBreakStatement(BreakStatement node) {
2440 stopwatch.start();
2441 T result = _baseVisitor.visitBreakStatement(node);
2442 stopwatch.stop();
2443 return result;
2444 }
2445
2446 @override
2447 T visitCascadeExpression(CascadeExpression node) {
2448 stopwatch.start();
2449 T result = _baseVisitor.visitCascadeExpression(node);
2450 stopwatch.stop();
2451 return result;
2452 }
2453
2454 @override
2455 T visitCatchClause(CatchClause node) {
2456 stopwatch.start();
2457 T result = _baseVisitor.visitCatchClause(node);
2458 stopwatch.stop();
2459 return result;
2460 }
2461
2462 @override
2463 T visitClassDeclaration(ClassDeclaration node) {
2464 stopwatch.start();
2465 T result = _baseVisitor.visitClassDeclaration(node);
2466 stopwatch.stop();
2467 return result;
2468 }
2469
2470 @override
2471 T visitClassTypeAlias(ClassTypeAlias node) {
2472 stopwatch.start();
2473 T result = _baseVisitor.visitClassTypeAlias(node);
2474 stopwatch.stop();
2475 return result;
2476 }
2477
2478 @override
2479 T visitComment(Comment node) {
2480 stopwatch.start();
2481 T result = _baseVisitor.visitComment(node);
2482 stopwatch.stop();
2483 return result;
2484 }
2485
2486 @override
2487 T visitCommentReference(CommentReference node) {
2488 stopwatch.start();
2489 T result = _baseVisitor.visitCommentReference(node);
2490 stopwatch.stop();
2491 return result;
2492 }
2493
2494 @override
2495 T visitCompilationUnit(CompilationUnit node) {
2496 stopwatch.start();
2497 T result = _baseVisitor.visitCompilationUnit(node);
2498 stopwatch.stop();
2499 return result;
2500 }
2501
2502 @override
2503 T visitConditionalExpression(ConditionalExpression node) {
2504 stopwatch.start();
2505 T result = _baseVisitor.visitConditionalExpression(node);
2506 stopwatch.stop();
2507 return result;
2508 }
2509
2510 @override
2511 T visitConfiguration(Configuration node) {
2512 stopwatch.start();
2513 T result = _baseVisitor.visitConfiguration(node);
2514 stopwatch.stop();
2515 return result;
2516 }
2517
2518 @override
2519 T visitConstructorDeclaration(ConstructorDeclaration node) {
2520 stopwatch.start();
2521 T result = _baseVisitor.visitConstructorDeclaration(node);
2522 stopwatch.stop();
2523 return result;
2524 }
2525
2526 @override
2527 T visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
2528 stopwatch.start();
2529 T result = _baseVisitor.visitConstructorFieldInitializer(node);
2530 stopwatch.stop();
2531 return result;
2532 }
2533
2534 @override
2535 T visitConstructorName(ConstructorName node) {
2536 stopwatch.start();
2537 T result = _baseVisitor.visitConstructorName(node);
2538 stopwatch.stop();
2539 return result;
2540 }
2541
2542 @override
2543 T visitContinueStatement(ContinueStatement node) {
2544 stopwatch.start();
2545 T result = _baseVisitor.visitContinueStatement(node);
2546 stopwatch.stop();
2547 return result;
2548 }
2549
2550 @override
2551 T visitDeclaredIdentifier(DeclaredIdentifier node) {
2552 stopwatch.start();
2553 T result = _baseVisitor.visitDeclaredIdentifier(node);
2554 stopwatch.stop();
2555 return result;
2556 }
2557
2558 @override
2559 T visitDefaultFormalParameter(DefaultFormalParameter node) {
2560 stopwatch.start();
2561 T result = _baseVisitor.visitDefaultFormalParameter(node);
2562 stopwatch.stop();
2563 return result;
2564 }
2565
2566 @override
2567 T visitDoStatement(DoStatement node) {
2568 stopwatch.start();
2569 T result = _baseVisitor.visitDoStatement(node);
2570 stopwatch.stop();
2571 return result;
2572 }
2573
2574 @override
2575 T visitDottedName(DottedName node) {
2576 stopwatch.start();
2577 T result = _baseVisitor.visitDottedName(node);
2578 stopwatch.stop();
2579 return result;
2580 }
2581
2582 @override
2583 T visitDoubleLiteral(DoubleLiteral node) {
2584 stopwatch.start();
2585 T result = _baseVisitor.visitDoubleLiteral(node);
2586 stopwatch.stop();
2587 return result;
2588 }
2589
2590 @override
2591 T visitEmptyFunctionBody(EmptyFunctionBody node) {
2592 stopwatch.start();
2593 T result = _baseVisitor.visitEmptyFunctionBody(node);
2594 stopwatch.stop();
2595 return result;
2596 }
2597
2598 @override
2599 T visitEmptyStatement(EmptyStatement node) {
2600 stopwatch.start();
2601 T result = _baseVisitor.visitEmptyStatement(node);
2602 stopwatch.stop();
2603 return result;
2604 }
2605
2606 @override
2607 T visitEnumConstantDeclaration(EnumConstantDeclaration node) {
2608 stopwatch.start();
2609 T result = _baseVisitor.visitEnumConstantDeclaration(node);
2610 stopwatch.stop();
2611 return result;
2612 }
2613
2614 @override
2615 T visitEnumDeclaration(EnumDeclaration node) {
2616 stopwatch.start();
2617 T result = _baseVisitor.visitEnumDeclaration(node);
2618 stopwatch.stop();
2619 return result;
2620 }
2621
2622 @override
2623 T visitExportDirective(ExportDirective node) {
2624 stopwatch.start();
2625 T result = _baseVisitor.visitExportDirective(node);
2626 stopwatch.stop();
2627 return result;
2628 }
2629
2630 @override
2631 T visitExpressionFunctionBody(ExpressionFunctionBody node) {
2632 stopwatch.start();
2633 T result = _baseVisitor.visitExpressionFunctionBody(node);
2634 stopwatch.stop();
2635 return result;
2636 }
2637
2638 @override
2639 T visitExpressionStatement(ExpressionStatement node) {
2640 stopwatch.start();
2641 T result = _baseVisitor.visitExpressionStatement(node);
2642 stopwatch.stop();
2643 return result;
2644 }
2645
2646 @override
2647 T visitExtendsClause(ExtendsClause node) {
2648 stopwatch.start();
2649 T result = _baseVisitor.visitExtendsClause(node);
2650 stopwatch.stop();
2651 return result;
2652 }
2653
2654 @override
2655 T visitFieldDeclaration(FieldDeclaration node) {
2656 stopwatch.start();
2657 T result = _baseVisitor.visitFieldDeclaration(node);
2658 stopwatch.stop();
2659 return result;
2660 }
2661
2662 @override
2663 T visitFieldFormalParameter(FieldFormalParameter node) {
2664 stopwatch.start();
2665 T result = _baseVisitor.visitFieldFormalParameter(node);
2666 stopwatch.stop();
2667 return result;
2668 }
2669
2670 @override
2671 T visitForEachStatement(ForEachStatement node) {
2672 stopwatch.start();
2673 T result = _baseVisitor.visitForEachStatement(node);
2674 stopwatch.stop();
2675 return result;
2676 }
2677
2678 @override
2679 T visitFormalParameterList(FormalParameterList node) {
2680 stopwatch.start();
2681 T result = _baseVisitor.visitFormalParameterList(node);
2682 stopwatch.stop();
2683 return result;
2684 }
2685
2686 @override
2687 T visitForStatement(ForStatement node) {
2688 stopwatch.start();
2689 T result = _baseVisitor.visitForStatement(node);
2690 stopwatch.stop();
2691 return result;
2692 }
2693
2694 @override
2695 T visitFunctionDeclaration(FunctionDeclaration node) {
2696 stopwatch.start();
2697 T result = _baseVisitor.visitFunctionDeclaration(node);
2698 stopwatch.stop();
2699 return result;
2700 }
2701
2702 @override
2703 T visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
2704 stopwatch.start();
2705 T result = _baseVisitor.visitFunctionDeclarationStatement(node);
2706 stopwatch.stop();
2707 return result;
2708 }
2709
2710 @override
2711 T visitFunctionExpression(FunctionExpression node) {
2712 stopwatch.start();
2713 T result = _baseVisitor.visitFunctionExpression(node);
2714 stopwatch.stop();
2715 return result;
2716 }
2717
2718 @override
2719 T visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
2720 stopwatch.start();
2721 T result = _baseVisitor.visitFunctionExpressionInvocation(node);
2722 stopwatch.stop();
2723 return result;
2724 }
2725
2726 @override
2727 T visitFunctionTypeAlias(FunctionTypeAlias node) {
2728 stopwatch.start();
2729 T result = _baseVisitor.visitFunctionTypeAlias(node);
2730 stopwatch.stop();
2731 return result;
2732 }
2733
2734 @override
2735 T visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
2736 stopwatch.start();
2737 T result = _baseVisitor.visitFunctionTypedFormalParameter(node);
2738 stopwatch.stop();
2739 return result;
2740 }
2741
2742 @override
2743 T visitHideCombinator(HideCombinator node) {
2744 stopwatch.start();
2745 T result = _baseVisitor.visitHideCombinator(node);
2746 stopwatch.stop();
2747 return result;
2748 }
2749
2750 @override
2751 T visitIfStatement(IfStatement node) {
2752 stopwatch.start();
2753 T result = _baseVisitor.visitIfStatement(node);
2754 stopwatch.stop();
2755 return result;
2756 }
2757
2758 @override
2759 T visitImplementsClause(ImplementsClause node) {
2760 stopwatch.start();
2761 T result = _baseVisitor.visitImplementsClause(node);
2762 stopwatch.stop();
2763 return result;
2764 }
2765
2766 @override
2767 T visitImportDirective(ImportDirective node) {
2768 stopwatch.start();
2769 T result = _baseVisitor.visitImportDirective(node);
2770 stopwatch.stop();
2771 return result;
2772 }
2773
2774 @override
2775 T visitIndexExpression(IndexExpression node) {
2776 stopwatch.start();
2777 T result = _baseVisitor.visitIndexExpression(node);
2778 stopwatch.stop();
2779 return result;
2780 }
2781
2782 @override
2783 T visitInstanceCreationExpression(InstanceCreationExpression node) {
2784 stopwatch.start();
2785 T result = _baseVisitor.visitInstanceCreationExpression(node);
2786 stopwatch.stop();
2787 return result;
2788 }
2789
2790 @override
2791 T visitIntegerLiteral(IntegerLiteral node) {
2792 stopwatch.start();
2793 T result = _baseVisitor.visitIntegerLiteral(node);
2794 stopwatch.stop();
2795 return result;
2796 }
2797
2798 @override
2799 T visitInterpolationExpression(InterpolationExpression node) {
2800 stopwatch.start();
2801 T result = _baseVisitor.visitInterpolationExpression(node);
2802 stopwatch.stop();
2803 return result;
2804 }
2805
2806 @override
2807 T visitInterpolationString(InterpolationString node) {
2808 stopwatch.start();
2809 T result = _baseVisitor.visitInterpolationString(node);
2810 stopwatch.stop();
2811 return result;
2812 }
2813
2814 @override
2815 T visitIsExpression(IsExpression node) {
2816 stopwatch.start();
2817 T result = _baseVisitor.visitIsExpression(node);
2818 stopwatch.stop();
2819 return result;
2820 }
2821
2822 @override
2823 T visitLabel(Label node) {
2824 stopwatch.start();
2825 T result = _baseVisitor.visitLabel(node);
2826 stopwatch.stop();
2827 return result;
2828 }
2829
2830 @override
2831 T visitLabeledStatement(LabeledStatement node) {
2832 stopwatch.start();
2833 T result = _baseVisitor.visitLabeledStatement(node);
2834 stopwatch.stop();
2835 return result;
2836 }
2837
2838 @override
2839 T visitLibraryDirective(LibraryDirective node) {
2840 stopwatch.start();
2841 T result = _baseVisitor.visitLibraryDirective(node);
2842 stopwatch.stop();
2843 return result;
2844 }
2845
2846 @override
2847 T visitLibraryIdentifier(LibraryIdentifier node) {
2848 stopwatch.start();
2849 T result = _baseVisitor.visitLibraryIdentifier(node);
2850 stopwatch.stop();
2851 return result;
2852 }
2853
2854 @override
2855 T visitListLiteral(ListLiteral node) {
2856 stopwatch.start();
2857 T result = _baseVisitor.visitListLiteral(node);
2858 stopwatch.stop();
2859 return result;
2860 }
2861
2862 @override
2863 T visitMapLiteral(MapLiteral node) {
2864 stopwatch.start();
2865 T result = _baseVisitor.visitMapLiteral(node);
2866 stopwatch.stop();
2867 return result;
2868 }
2869
2870 @override
2871 T visitMapLiteralEntry(MapLiteralEntry node) {
2872 stopwatch.start();
2873 T result = _baseVisitor.visitMapLiteralEntry(node);
2874 stopwatch.stop();
2875 return result;
2876 }
2877
2878 @override
2879 T visitMethodDeclaration(MethodDeclaration node) {
2880 stopwatch.start();
2881 T result = _baseVisitor.visitMethodDeclaration(node);
2882 stopwatch.stop();
2883 return result;
2884 }
2885
2886 @override
2887 T visitMethodInvocation(MethodInvocation node) {
2888 stopwatch.start();
2889 T result = _baseVisitor.visitMethodInvocation(node);
2890 stopwatch.stop();
2891 return result;
2892 }
2893
2894 @override
2895 T visitNamedExpression(NamedExpression node) {
2896 stopwatch.start();
2897 T result = _baseVisitor.visitNamedExpression(node);
2898 stopwatch.stop();
2899 return result;
2900 }
2901
2902 @override
2903 T visitNativeClause(NativeClause node) {
2904 stopwatch.start();
2905 T result = _baseVisitor.visitNativeClause(node);
2906 stopwatch.stop();
2907 return result;
2908 }
2909
2910 @override
2911 T visitNativeFunctionBody(NativeFunctionBody node) {
2912 stopwatch.start();
2913 T result = _baseVisitor.visitNativeFunctionBody(node);
2914 stopwatch.stop();
2915 return result;
2916 }
2917
2918 @override
2919 T visitNullLiteral(NullLiteral node) {
2920 stopwatch.start();
2921 T result = _baseVisitor.visitNullLiteral(node);
2922 stopwatch.stop();
2923 return result;
2924 }
2925
2926 @override
2927 T visitParenthesizedExpression(ParenthesizedExpression node) {
2928 stopwatch.start();
2929 T result = _baseVisitor.visitParenthesizedExpression(node);
2930 stopwatch.stop();
2931 return result;
2932 }
2933
2934 @override
2935 T visitPartDirective(PartDirective node) {
2936 stopwatch.start();
2937 T result = _baseVisitor.visitPartDirective(node);
2938 stopwatch.stop();
2939 return result;
2940 }
2941
2942 @override
2943 T visitPartOfDirective(PartOfDirective node) {
2944 stopwatch.start();
2945 T result = _baseVisitor.visitPartOfDirective(node);
2946 stopwatch.stop();
2947 return result;
2948 }
2949
2950 @override
2951 T visitPostfixExpression(PostfixExpression node) {
2952 stopwatch.start();
2953 T result = _baseVisitor.visitPostfixExpression(node);
2954 stopwatch.stop();
2955 return result;
2956 }
2957
2958 @override
2959 T visitPrefixedIdentifier(PrefixedIdentifier node) {
2960 stopwatch.start();
2961 T result = _baseVisitor.visitPrefixedIdentifier(node);
2962 stopwatch.stop();
2963 return result;
2964 }
2965
2966 @override
2967 T visitPrefixExpression(PrefixExpression node) {
2968 stopwatch.start();
2969 T result = _baseVisitor.visitPrefixExpression(node);
2970 stopwatch.stop();
2971 return result;
2972 }
2973
2974 @override
2975 T visitPropertyAccess(PropertyAccess node) {
2976 stopwatch.start();
2977 T result = _baseVisitor.visitPropertyAccess(node);
2978 stopwatch.stop();
2979 return result;
2980 }
2981
2982 @override
2983 T visitRedirectingConstructorInvocation(
2984 RedirectingConstructorInvocation node) {
2985 stopwatch.start();
2986 T result = _baseVisitor.visitRedirectingConstructorInvocation(node);
2987 stopwatch.stop();
2988 return result;
2989 }
2990
2991 @override
2992 T visitRethrowExpression(RethrowExpression node) {
2993 stopwatch.start();
2994 T result = _baseVisitor.visitRethrowExpression(node);
2995 stopwatch.stop();
2996 return result;
2997 }
2998
2999 @override
3000 T visitReturnStatement(ReturnStatement node) {
3001 stopwatch.start();
3002 T result = _baseVisitor.visitReturnStatement(node);
3003 stopwatch.stop();
3004 return result;
3005 }
3006
3007 @override
3008 T visitScriptTag(ScriptTag node) {
3009 stopwatch.start();
3010 T result = _baseVisitor.visitScriptTag(node);
3011 stopwatch.stop();
3012 return result;
3013 }
3014
3015 @override
3016 T visitShowCombinator(ShowCombinator node) {
3017 stopwatch.start();
3018 T result = _baseVisitor.visitShowCombinator(node);
3019 stopwatch.stop();
3020 return result;
3021 }
3022
3023 @override
3024 T visitSimpleFormalParameter(SimpleFormalParameter node) {
3025 stopwatch.start();
3026 T result = _baseVisitor.visitSimpleFormalParameter(node);
3027 stopwatch.stop();
3028 return result;
3029 }
3030
3031 @override
3032 T visitSimpleIdentifier(SimpleIdentifier node) {
3033 stopwatch.start();
3034 T result = _baseVisitor.visitSimpleIdentifier(node);
3035 stopwatch.stop();
3036 return result;
3037 }
3038
3039 @override
3040 T visitSimpleStringLiteral(SimpleStringLiteral node) {
3041 stopwatch.start();
3042 T result = _baseVisitor.visitSimpleStringLiteral(node);
3043 stopwatch.stop();
3044 return result;
3045 }
3046
3047 @override
3048 T visitStringInterpolation(StringInterpolation node) {
3049 stopwatch.start();
3050 T result = _baseVisitor.visitStringInterpolation(node);
3051 stopwatch.stop();
3052 return result;
3053 }
3054
3055 @override
3056 T visitSuperConstructorInvocation(SuperConstructorInvocation node) {
3057 stopwatch.start();
3058 T result = _baseVisitor.visitSuperConstructorInvocation(node);
3059 stopwatch.stop();
3060 return result;
3061 }
3062
3063 @override
3064 T visitSuperExpression(SuperExpression node) {
3065 stopwatch.start();
3066 T result = _baseVisitor.visitSuperExpression(node);
3067 stopwatch.stop();
3068 return result;
3069 }
3070
3071 @override
3072 T visitSwitchCase(SwitchCase node) {
3073 stopwatch.start();
3074 T result = _baseVisitor.visitSwitchCase(node);
3075 stopwatch.stop();
3076 return result;
3077 }
3078
3079 @override
3080 T visitSwitchDefault(SwitchDefault node) {
3081 stopwatch.start();
3082 T result = _baseVisitor.visitSwitchDefault(node);
3083 stopwatch.stop();
3084 return result;
3085 }
3086
3087 @override
3088 T visitSwitchStatement(SwitchStatement node) {
3089 stopwatch.start();
3090 T result = _baseVisitor.visitSwitchStatement(node);
3091 stopwatch.stop();
3092 return result;
3093 }
3094
3095 @override
3096 T visitSymbolLiteral(SymbolLiteral node) {
3097 stopwatch.start();
3098 T result = _baseVisitor.visitSymbolLiteral(node);
3099 stopwatch.stop();
3100 return result;
3101 }
3102
3103 @override
3104 T visitThisExpression(ThisExpression node) {
3105 stopwatch.start();
3106 T result = _baseVisitor.visitThisExpression(node);
3107 stopwatch.stop();
3108 return result;
3109 }
3110
3111 @override
3112 T visitThrowExpression(ThrowExpression node) {
3113 stopwatch.start();
3114 T result = _baseVisitor.visitThrowExpression(node);
3115 stopwatch.stop();
3116 return result;
3117 }
3118
3119 @override
3120 T visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
3121 stopwatch.start();
3122 T result = _baseVisitor.visitTopLevelVariableDeclaration(node);
3123 stopwatch.stop();
3124 return result;
3125 }
3126
3127 @override
3128 T visitTryStatement(TryStatement node) {
3129 stopwatch.start();
3130 T result = _baseVisitor.visitTryStatement(node);
3131 stopwatch.stop();
3132 return result;
3133 }
3134
3135 @override
3136 T visitTypeArgumentList(TypeArgumentList node) {
3137 stopwatch.start();
3138 T result = _baseVisitor.visitTypeArgumentList(node);
3139 stopwatch.stop();
3140 return result;
3141 }
3142
3143 @override
3144 T visitTypeName(TypeName node) {
3145 stopwatch.start();
3146 T result = _baseVisitor.visitTypeName(node);
3147 stopwatch.stop();
3148 return result;
3149 }
3150
3151 @override
3152 T visitTypeParameter(TypeParameter node) {
3153 stopwatch.start();
3154 T result = _baseVisitor.visitTypeParameter(node);
3155 stopwatch.stop();
3156 return result;
3157 }
3158
3159 @override
3160 T visitTypeParameterList(TypeParameterList node) {
3161 stopwatch.start();
3162 T result = _baseVisitor.visitTypeParameterList(node);
3163 stopwatch.stop();
3164 return result;
3165 }
3166
3167 @override
3168 T visitVariableDeclaration(VariableDeclaration node) {
3169 stopwatch.start();
3170 T result = _baseVisitor.visitVariableDeclaration(node);
3171 stopwatch.stop();
3172 return result;
3173 }
3174
3175 @override
3176 T visitVariableDeclarationList(VariableDeclarationList node) {
3177 stopwatch.start();
3178 T result = _baseVisitor.visitVariableDeclarationList(node);
3179 stopwatch.stop();
3180 return result;
3181 }
3182
3183 @override
3184 T visitVariableDeclarationStatement(VariableDeclarationStatement node) {
3185 stopwatch.start();
3186 T result = _baseVisitor.visitVariableDeclarationStatement(node);
3187 stopwatch.stop();
3188 return result;
3189 }
3190
3191 @override
3192 T visitWhileStatement(WhileStatement node) {
3193 stopwatch.start();
3194 T result = _baseVisitor.visitWhileStatement(node);
3195 stopwatch.stop();
3196 return result;
3197 }
3198
3199 @override
3200 T visitWithClause(WithClause node) {
3201 stopwatch.start();
3202 T result = _baseVisitor.visitWithClause(node);
3203 stopwatch.stop();
3204 return result;
3205 }
3206
3207 @override
3208 T visitYieldStatement(YieldStatement node) {
3209 stopwatch.start();
3210 T result = _baseVisitor.visitYieldStatement(node);
3211 stopwatch.stop();
3212 return result;
3213 }
3214 }
3215
3216 /**
3217 * An AST visitor that will recursively visit all of the nodes in an AST 3217 * An AST visitor that will recursively visit all of the nodes in an AST
3218 * structure (like instances of the class [RecursiveAstVisitor]). In addition, 3218 * structure (like instances of the class [RecursiveAstVisitor]). In addition,
3219 * every node will also be visited by using a single unified [visitNode] method. 3219 * every node will also be visited by using a single unified [visitNode] method.
3220 * 3220 *
3221 * Subclasses that override a visit method must either invoke the overridden 3221 * Subclasses that override a visit method must either invoke the overridden
3222 * visit method or explicitly invoke the more general [visitNode] method. 3222 * visit method or explicitly invoke the more general [visitNode] method.
3223 * Failure to do so will cause the children of the visited node to not be 3223 * Failure to do so will cause the children of the visited node to not be
3224 * visited. 3224 * visited.
3225 * 3225 *
3226 * Clients may extend or implement this class. 3226 * Clients may extend or implement this class.
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
3584 * Initialize a newly created visitor to help the [outerVisitor]. 3584 * Initialize a newly created visitor to help the [outerVisitor].
3585 */ 3585 */
3586 _BreadthFirstChildVisitor(this.outerVisitor); 3586 _BreadthFirstChildVisitor(this.outerVisitor);
3587 3587
3588 @override 3588 @override
3589 Object visitNode(AstNode node) { 3589 Object visitNode(AstNode node) {
3590 outerVisitor._queue.add(node); 3590 outerVisitor._queue.add(node);
3591 return null; 3591 return null;
3592 } 3592 }
3593 } 3593 }
OLDNEW
« no previous file with comments | « pkg/analyzer/benchmark/errors_in_all_libraries.dart ('k') | pkg/analyzer/lib/file_system/physical_file_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698