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

Side by Side Diff: pkg/analyzer/lib/src/generated/ast.dart

Issue 382953002: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.ast; 8 library engine.ast;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
11 import 'java_core.dart'; 11 import 'java_core.dart';
12 import 'java_engine.dart'; 12 import 'java_engine.dart';
13 import 'source.dart' show LineInfo, Source; 13 import 'source.dart' show LineInfo, Source;
14 import 'scanner.dart'; 14 import 'scanner.dart';
15 import 'engine.dart' show AnalysisEngine; 15 import 'engine.dart' show AnalysisEngine;
16 import 'utilities_dart.dart'; 16 import 'utilities_dart.dart';
17 import 'utilities_collection.dart' show TokenMap; 17 import 'utilities_collection.dart' show TokenMap;
18 import 'element.dart'; 18 import 'element.dart';
19 import 'constant.dart'; 19 import 'constant.dart';
20 import 'parser.dart';
20 21
21 /** 22 /**
22 * Instances of the class `AdjacentStrings` represents two or more string litera ls that are 23 * Instances of the class `AdjacentStrings` represents two or more string litera ls that are
23 * implicitly concatenated because of being adjacent (separated only by whitespa ce). 24 * implicitly concatenated because of being adjacent (separated only by whitespa ce).
24 * 25 *
25 * While the grammar only allows adjacent strings when all of the strings are of the same kind 26 * While the grammar only allows adjacent strings when all of the strings are of the same kind
26 * (single line or multi-line), this class doesn't enforce that restriction. 27 * (single line or multi-line), this class doesn't enforce that restriction.
27 * 28 *
28 * <pre> 29 * <pre>
29 * adjacentStrings ::= 30 * adjacentStrings ::=
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 @override 985 @override
985 AsExpression visitAsExpression(AsExpression node) => new AsExpression(cloneNod e(node.expression), node.asOperator, cloneNode(node.type)); 986 AsExpression visitAsExpression(AsExpression node) => new AsExpression(cloneNod e(node.expression), node.asOperator, cloneNode(node.type));
986 987
987 @override 988 @override
988 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(node .keyword, node.leftParenthesis, cloneNode(node.condition), node.rightParenthesis , node.semicolon); 989 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(node .keyword, node.leftParenthesis, cloneNode(node.condition), node.rightParenthesis , node.semicolon);
989 990
990 @override 991 @override
991 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => n ew AssignmentExpression(cloneNode(node.leftHandSide), node.operator, cloneNode(n ode.rightHandSide)); 992 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => n ew AssignmentExpression(cloneNode(node.leftHandSide), node.operator, cloneNode(n ode.rightHandSide));
992 993
993 @override 994 @override
995 AwaitExpression visitAwaitExpression(AwaitExpression node) => new AwaitExpress ion(node.awaitKeyword, node.expression, node.semicolon);
996
997 @override
994 BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExp ression(cloneNode(node.leftOperand), node.operator, cloneNode(node.rightOperand) ); 998 BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExp ression(cloneNode(node.leftOperand), node.operator, cloneNode(node.rightOperand) );
995 999
996 @override 1000 @override
997 Block visitBlock(Block node) => new Block(node.leftBracket, cloneNodeList(node .statements), node.rightBracket); 1001 Block visitBlock(Block node) => new Block(node.leftBracket, cloneNodeList(node .statements), node.rightBracket);
998 1002
999 @override 1003 @override
1000 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody(cloneNode(node.block)); 1004 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody(node.keyword, node.star, cloneNode(node.block));
1001 1005
1002 @override 1006 @override
1003 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral( node.literal, node.value); 1007 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral( node.literal, node.value);
1004 1008
1005 @override 1009 @override
1006 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( node.keyword, cloneNode(node.label), node.semicolon); 1010 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( node.keyword, cloneNode(node.label), node.semicolon);
1007 1011
1008 @override 1012 @override
1009 CascadeExpression visitCascadeExpression(CascadeExpression node) => new Cascad eExpression(cloneNode(node.target), cloneNodeList(node.cascadeSections)); 1013 CascadeExpression visitCascadeExpression(CascadeExpression node) => new Cascad eExpression(cloneNode(node.target), cloneNodeList(node.cascadeSections));
1010 1014
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 1080
1077 @override 1081 @override
1078 ExportDirective visitExportDirective(ExportDirective node) { 1082 ExportDirective visitExportDirective(ExportDirective node) {
1079 ExportDirective directive = new ExportDirective(cloneNode(node.documentation Comment), cloneNodeList(node.metadata), node.keyword, cloneNode(node.uri), clone NodeList(node.combinators), node.semicolon); 1083 ExportDirective directive = new ExportDirective(cloneNode(node.documentation Comment), cloneNodeList(node.metadata), node.keyword, cloneNode(node.uri), clone NodeList(node.combinators), node.semicolon);
1080 directive.source = node.source; 1084 directive.source = node.source;
1081 directive.uriContent = node.uriContent; 1085 directive.uriContent = node.uriContent;
1082 return directive; 1086 return directive;
1083 } 1087 }
1084 1088
1085 @override 1089 @override
1086 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody(node.functionDefinition, cloneNode(node.expressi on), node.semicolon); 1090 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody(node.keyword, node.functionDefinition, cloneNode (node.expression), node.semicolon);
1087 1091
1088 @override 1092 @override
1089 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement(cloneNode(node.expression), node.semicolon); 1093 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement(cloneNode(node.expression), node.semicolon);
1090 1094
1091 @override 1095 @override
1092 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(node .keyword, cloneNode(node.superclass)); 1096 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(node .keyword, cloneNode(node.superclass));
1093 1097
1094 @override 1098 @override
1095 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration(cloneNode(node.documentationComment), cloneNodeList(node.metadata), node .staticKeyword, cloneNode(node.fields), node.semicolon); 1099 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration(cloneNode(node.documentationComment), cloneNodeList(node.metadata), node .staticKeyword, cloneNode(node.fields), node.semicolon);
1096 1100
1097 @override 1101 @override
1098 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter(cloneNode(node.documentationComment), cloneNodeList(node .metadata), node.keyword, cloneNode(node.type), node.thisToken, node.period, clo neNode(node.identifier), cloneNode(node.parameters)); 1102 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter(cloneNode(node.documentationComment), cloneNodeList(node .metadata), node.keyword, cloneNode(node.type), node.thisToken, node.period, clo neNode(node.identifier), cloneNode(node.parameters));
1099 1103
1100 @override 1104 @override
1101 ForEachStatement visitForEachStatement(ForEachStatement node) { 1105 ForEachStatement visitForEachStatement(ForEachStatement node) {
1102 DeclaredIdentifier loopVariable = node.loopVariable; 1106 DeclaredIdentifier loopVariable = node.loopVariable;
1103 if (loopVariable == null) { 1107 if (loopVariable == null) {
1104 return new ForEachStatement.con2(node.forKeyword, node.leftParenthesis, cl oneNode(node.identifier), node.inKeyword, cloneNode(node.iterator), node.rightPa renthesis, cloneNode(node.body)); 1108 return new ForEachStatement.con2(node.awaitKeyword, node.forKeyword, node. leftParenthesis, cloneNode(node.identifier), node.inKeyword, cloneNode(node.iter ator), node.rightParenthesis, cloneNode(node.body));
1105 } 1109 }
1106 return new ForEachStatement.con1(node.forKeyword, node.leftParenthesis, clon eNode(loopVariable), node.inKeyword, cloneNode(node.iterator), node.rightParenth esis, cloneNode(node.body)); 1110 return new ForEachStatement.con1(node.awaitKeyword, node.forKeyword, node.le ftParenthesis, cloneNode(loopVariable), node.inKeyword, cloneNode(node.iterator) , node.rightParenthesis, cloneNode(node.body));
1107 } 1111 }
1108 1112
1109 @override 1113 @override
1110 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList(node.leftParenthesis, cloneNodeList(node.parameters), node.l eftDelimiter, node.rightDelimiter, node.rightParenthesis); 1114 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList(node.leftParenthesis, cloneNodeList(node.parameters), node.l eftDelimiter, node.rightDelimiter, node.rightParenthesis);
1111 1115
1112 @override 1116 @override
1113 ForStatement visitForStatement(ForStatement node) => new ForStatement(node.for Keyword, node.leftParenthesis, cloneNode(node.variables), cloneNode(node.initial ization), node.leftSeparator, cloneNode(node.condition), node.rightSeparator, cl oneNodeList(node.updaters), node.rightParenthesis, cloneNode(node.body)); 1117 ForStatement visitForStatement(ForStatement node) => new ForStatement(node.for Keyword, node.leftParenthesis, cloneNode(node.variables), cloneNode(node.initial ization), node.leftSeparator, cloneNode(node.condition), node.rightSeparator, cl oneNodeList(node.updaters), node.rightParenthesis, cloneNode(node.body));
1114 1118
1115 @override 1119 @override
1116 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration(cloneNode(node.documentationComment), cloneNodeList(node.met adata), node.externalKeyword, cloneNode(node.returnType), node.propertyKeyword, cloneNode(node.name), cloneNode(node.functionExpression)); 1120 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration(cloneNode(node.documentationComment), cloneNodeList(node.met adata), node.externalKeyword, cloneNode(node.returnType), node.propertyKeyword, cloneNode(node.name), cloneNode(node.functionExpression));
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 1318
1315 @override 1319 @override
1316 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement(cloneNode(node.variables ), node.semicolon); 1320 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement(cloneNode(node.variables ), node.semicolon);
1317 1321
1318 @override 1322 @override
1319 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( node.keyword, node.leftParenthesis, cloneNode(node.condition), node.rightParenth esis, cloneNode(node.body)); 1323 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( node.keyword, node.leftParenthesis, cloneNode(node.condition), node.rightParenth esis, cloneNode(node.body));
1320 1324
1321 @override 1325 @override
1322 WithClause visitWithClause(WithClause node) => new WithClause(node.withKeyword , cloneNodeList(node.mixinTypes)); 1326 WithClause visitWithClause(WithClause node) => new WithClause(node.withKeyword , cloneNodeList(node.mixinTypes));
1323 1327
1328 @override
1329 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement( node.yieldKeyword, node.star, node.expression, node.semicolon);
1330
1324 AstNode cloneNode(AstNode node) { 1331 AstNode cloneNode(AstNode node) {
1325 if (node == null) { 1332 if (node == null) {
1326 return null; 1333 return null;
1327 } 1334 }
1328 return node.accept(this) as AstNode; 1335 return node.accept(this) as AstNode;
1329 } 1336 }
1330 } 1337 }
1331 1338
1332 /** 1339 /**
1333 * Instances of the class `AstComparator` compare the structure of two ASTNodes to see whether 1340 * Instances of the class `AstComparator` compare the structure of two ASTNodes to see whether
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 return _isEqualTokens(node.keyword, other.keyword) && _isEqualTokens(node.le ftParenthesis, other.leftParenthesis) && _isEqualNodes(node.condition, other.con dition) && _isEqualTokens(node.rightParenthesis, other.rightParenthesis) && _isE qualTokens(node.semicolon, other.semicolon); 1389 return _isEqualTokens(node.keyword, other.keyword) && _isEqualTokens(node.le ftParenthesis, other.leftParenthesis) && _isEqualNodes(node.condition, other.con dition) && _isEqualTokens(node.rightParenthesis, other.rightParenthesis) && _isE qualTokens(node.semicolon, other.semicolon);
1383 } 1390 }
1384 1391
1385 @override 1392 @override
1386 bool visitAssignmentExpression(AssignmentExpression node) { 1393 bool visitAssignmentExpression(AssignmentExpression node) {
1387 AssignmentExpression other = this._other as AssignmentExpression; 1394 AssignmentExpression other = this._other as AssignmentExpression;
1388 return _isEqualNodes(node.leftHandSide, other.leftHandSide) && _isEqualToken s(node.operator, other.operator) && _isEqualNodes(node.rightHandSide, other.righ tHandSide); 1395 return _isEqualNodes(node.leftHandSide, other.leftHandSide) && _isEqualToken s(node.operator, other.operator) && _isEqualNodes(node.rightHandSide, other.righ tHandSide);
1389 } 1396 }
1390 1397
1391 @override 1398 @override
1399 bool visitAwaitExpression(AwaitExpression node) {
1400 AwaitExpression other = this._other as AwaitExpression;
1401 return _isEqualTokens(node.awaitKeyword, other.awaitKeyword) && _isEqualNode s(node.expression, other.expression) && _isEqualTokens(node.semicolon, other.sem icolon);
1402 }
1403
1404 @override
1392 bool visitBinaryExpression(BinaryExpression node) { 1405 bool visitBinaryExpression(BinaryExpression node) {
1393 BinaryExpression other = this._other as BinaryExpression; 1406 BinaryExpression other = this._other as BinaryExpression;
1394 return _isEqualNodes(node.leftOperand, other.leftOperand) && _isEqualTokens( node.operator, other.operator) && _isEqualNodes(node.rightOperand, other.rightOp erand); 1407 return _isEqualNodes(node.leftOperand, other.leftOperand) && _isEqualTokens( node.operator, other.operator) && _isEqualNodes(node.rightOperand, other.rightOp erand);
1395 } 1408 }
1396 1409
1397 @override 1410 @override
1398 bool visitBlock(Block node) { 1411 bool visitBlock(Block node) {
1399 Block other = this._other as Block; 1412 Block other = this._other as Block;
1400 return _isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLi sts(node.statements, other.statements) && _isEqualTokens(node.rightBracket, othe r.rightBracket); 1413 return _isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLi sts(node.statements, other.statements) && _isEqualTokens(node.rightBracket, othe r.rightBracket);
1401 } 1414 }
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
1957 WhileStatement other = this._other as WhileStatement; 1970 WhileStatement other = this._other as WhileStatement;
1958 return _isEqualTokens(node.keyword, other.keyword) && _isEqualTokens(node.le ftParenthesis, other.leftParenthesis) && _isEqualNodes(node.condition, other.con dition) && _isEqualTokens(node.rightParenthesis, other.rightParenthesis) && _isE qualNodes(node.body, other.body); 1971 return _isEqualTokens(node.keyword, other.keyword) && _isEqualTokens(node.le ftParenthesis, other.leftParenthesis) && _isEqualNodes(node.condition, other.con dition) && _isEqualTokens(node.rightParenthesis, other.rightParenthesis) && _isE qualNodes(node.body, other.body);
1959 } 1972 }
1960 1973
1961 @override 1974 @override
1962 bool visitWithClause(WithClause node) { 1975 bool visitWithClause(WithClause node) {
1963 WithClause other = this._other as WithClause; 1976 WithClause other = this._other as WithClause;
1964 return _isEqualTokens(node.withKeyword, other.withKeyword) && _isEqualNodeLi sts(node.mixinTypes, other.mixinTypes); 1977 return _isEqualTokens(node.withKeyword, other.withKeyword) && _isEqualNodeLi sts(node.mixinTypes, other.mixinTypes);
1965 } 1978 }
1966 1979
1980 @override
1981 bool visitYieldStatement(YieldStatement node) {
1982 YieldStatement other = this._other as YieldStatement;
1983 return _isEqualTokens(node.yieldKeyword, other.yieldKeyword) && _isEqualNode s(node.expression, other.expression) && _isEqualTokens(node.semicolon, other.sem icolon);
1984 }
1985
1967 /** 1986 /**
1968 * Return `true` if the given lists of AST nodes have the same size and corres ponding 1987 * Return `true` if the given lists of AST nodes have the same size and corres ponding
1969 * elements are equal. 1988 * elements are equal.
1970 * 1989 *
1971 * @param first the first node being compared 1990 * @param first the first node being compared
1972 * @param second the second node being compared 1991 * @param second the second node being compared
1973 * @return `true` if the given AST nodes have the same size and corresponding elements are 1992 * @return `true` if the given AST nodes have the same size and corresponding elements are
1974 * equal 1993 * equal
1975 */ 1994 */
1976 bool _isEqualNodeLists(NodeList first, NodeList second) { 1995 bool _isEqualNodeLists(NodeList first, NodeList second) {
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
2296 R visitAnnotation(Annotation node); 2315 R visitAnnotation(Annotation node);
2297 2316
2298 R visitArgumentList(ArgumentList node); 2317 R visitArgumentList(ArgumentList node);
2299 2318
2300 R visitAsExpression(AsExpression node); 2319 R visitAsExpression(AsExpression node);
2301 2320
2302 R visitAssertStatement(AssertStatement assertStatement); 2321 R visitAssertStatement(AssertStatement assertStatement);
2303 2322
2304 R visitAssignmentExpression(AssignmentExpression node); 2323 R visitAssignmentExpression(AssignmentExpression node);
2305 2324
2325 R visitAwaitExpression(AwaitExpression node);
2326
2306 R visitBinaryExpression(BinaryExpression node); 2327 R visitBinaryExpression(BinaryExpression node);
2307 2328
2308 R visitBlock(Block node); 2329 R visitBlock(Block node);
2309 2330
2310 R visitBlockFunctionBody(BlockFunctionBody node); 2331 R visitBlockFunctionBody(BlockFunctionBody node);
2311 2332
2312 R visitBooleanLiteral(BooleanLiteral node); 2333 R visitBooleanLiteral(BooleanLiteral node);
2313 2334
2314 R visitBreakStatement(BreakStatement node); 2335 R visitBreakStatement(BreakStatement node);
2315 2336
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
2487 2508
2488 R visitVariableDeclaration(VariableDeclaration node); 2509 R visitVariableDeclaration(VariableDeclaration node);
2489 2510
2490 R visitVariableDeclarationList(VariableDeclarationList node); 2511 R visitVariableDeclarationList(VariableDeclarationList node);
2491 2512
2492 R visitVariableDeclarationStatement(VariableDeclarationStatement node); 2513 R visitVariableDeclarationStatement(VariableDeclarationStatement node);
2493 2514
2494 R visitWhileStatement(WhileStatement node); 2515 R visitWhileStatement(WhileStatement node);
2495 2516
2496 R visitWithClause(WithClause node); 2517 R visitWithClause(WithClause node);
2518
2519 R visitYieldStatement(YieldStatement node);
2497 } 2520 }
2498 2521
2499 /** 2522 /**
2523 * Instances of the class `AwaitExpression` implement an await expression.
2524 */
2525 class AwaitExpression extends Expression {
2526 /**
2527 * The 'await' keyword.
2528 */
2529 Token awaitKeyword;
2530
2531 /**
2532 * The expression whose value is being waited on.
2533 */
2534 Expression _expression;
2535
2536 /**
2537 * The semicolon following the expression.
2538 */
2539 Token semicolon;
2540
2541 /**
2542 * Initialize a newly created await expression.
2543 *
2544 * @param awaitKeyword the 'await' keyword
2545 * @param expression the expression whose value is being waited on
2546 * @param semicolon the semicolon following the expression
2547 */
2548 AwaitExpression(this.awaitKeyword, Expression expression, this.semicolon) {
2549 this._expression = becomeParentOf(expression);
2550 }
2551
2552 @override
2553 accept(AstVisitor visitor) => visitor.visitAwaitExpression(this);
2554
2555 @override
2556 Token get beginToken {
2557 if (awaitKeyword != null) {
2558 return awaitKeyword;
2559 }
2560 return _expression.beginToken;
2561 }
2562
2563 @override
2564 Token get endToken {
2565 if (semicolon != null) {
2566 return semicolon;
2567 }
2568 return _expression.endToken;
2569 }
2570
2571 /**
2572 * Return the expression whose value is being waited on.
2573 *
2574 * @return the expression whose value is being waited on
2575 */
2576 Expression get expression => _expression;
2577
2578 @override
2579 int get precedence => 0;
2580
2581 /**
2582 * Set the expression whose value is being waited on to the given expression.
2583 *
2584 * @param expression the expression whose value is being waited on
2585 */
2586 void set expression(Expression expression) {
2587 this._expression = becomeParentOf(expression);
2588 }
2589
2590 @override
2591 void visitChildren(AstVisitor visitor) {
2592 safelyVisitChild(_expression, visitor);
2593 }
2594 }
2595
2596 /**
2500 * Instances of the class `BinaryExpression` represent a binary (infix) expressi on. 2597 * Instances of the class `BinaryExpression` represent a binary (infix) expressi on.
2501 * 2598 *
2502 * <pre> 2599 * <pre>
2503 * binaryExpression ::= 2600 * binaryExpression ::=
2504 * [Expression] [Token] [Expression] 2601 * [Expression] [Token] [Expression]
2505 * </pre> 2602 * </pre>
2506 */ 2603 */
2507 class BinaryExpression extends Expression { 2604 class BinaryExpression extends Expression {
2508 /** 2605 /**
2509 * The expression used to compute the left operand. 2606 * The expression used to compute the left operand.
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
2752 _statements.accept(visitor); 2849 _statements.accept(visitor);
2753 } 2850 }
2754 } 2851 }
2755 2852
2756 /** 2853 /**
2757 * Instances of the class `BlockFunctionBody` represent a function body that con sists of a 2854 * Instances of the class `BlockFunctionBody` represent a function body that con sists of a
2758 * block of statements. 2855 * block of statements.
2759 * 2856 *
2760 * <pre> 2857 * <pre>
2761 * blockFunctionBody ::= 2858 * blockFunctionBody ::=
2762 * [Block] 2859 * ('async' | 'async' '*' | 'sync' '*')? [Block]
2763 * </pre> 2860 * </pre>
2764 */ 2861 */
2765 class BlockFunctionBody extends FunctionBody { 2862 class BlockFunctionBody extends FunctionBody {
2766 /** 2863 /**
2864 * The token representing the 'async' or 'sync' keyword, or `null` if there is no such
2865 * keyword.
2866 */
2867 Token keyword;
2868
2869 /**
2870 * The star optionally following the 'async' or following the 'sync' keyword.
2871 */
2872 Token star;
2873
2874 /**
2767 * The block representing the body of the function. 2875 * The block representing the body of the function.
2768 */ 2876 */
2769 Block _block; 2877 Block _block;
2770 2878
2771 /** 2879 /**
2772 * Initialize a newly created function body consisting of a block of statement s. 2880 * Initialize a newly created function body consisting of a block of statement s.
2773 * 2881 *
2882 * @param keyword the token representing the 'async' or 'sync' keyword
2883 * @param star the star following the 'async' or 'sync' keyword
2774 * @param block the block representing the body of the function 2884 * @param block the block representing the body of the function
2775 */ 2885 */
2776 BlockFunctionBody(Block block) { 2886 BlockFunctionBody(this.keyword, this.star, Block block) {
2777 this._block = becomeParentOf(block); 2887 this._block = becomeParentOf(block);
2778 } 2888 }
2779 2889
2780 @override 2890 @override
2781 accept(AstVisitor visitor) => visitor.visitBlockFunctionBody(this); 2891 accept(AstVisitor visitor) => visitor.visitBlockFunctionBody(this);
2782 2892
2783 @override 2893 @override
2784 Token get beginToken => _block.beginToken; 2894 Token get beginToken => _block.beginToken;
2785 2895
2786 /** 2896 /**
2787 * Return the block representing the body of the function. 2897 * Return the block representing the body of the function.
2788 * 2898 *
2789 * @return the block representing the body of the function 2899 * @return the block representing the body of the function
2790 */ 2900 */
2791 Block get block => _block; 2901 Block get block => _block;
2792 2902
2793 @override 2903 @override
2794 Token get endToken => _block.endToken; 2904 Token get endToken => _block.endToken;
2795 2905
2906 @override
2907 bool get isAsynchronous {
2908 if (keyword == null) {
2909 return false;
2910 }
2911 String keywordValue = keyword.lexeme;
2912 return keywordValue == Parser.ASYNC;
2913 }
2914
2915 @override
2916 bool get isGenerator => star != null;
2917
2918 @override
2919 bool get isSynchronous => keyword == null || keyword.lexeme != Parser.ASYNC;
2920
2796 /** 2921 /**
2797 * Set the block representing the body of the function to the given block. 2922 * Set the block representing the body of the function to the given block.
2798 * 2923 *
2799 * @param block the block representing the body of the function 2924 * @param block the block representing the body of the function
2800 */ 2925 */
2801 void set block(Block block) { 2926 void set block(Block block) {
2802 this._block = becomeParentOf(block); 2927 this._block = becomeParentOf(block);
2803 } 2928 }
2804 2929
2805 @override 2930 @override
(...skipping 3408 matching lines...) Expand 10 before | Expand all | Expand 10 after
6214 */ 6339 */
6215 bool get isAssignable => false; 6340 bool get isAssignable => false;
6216 } 6341 }
6217 6342
6218 /** 6343 /**
6219 * Instances of the class `ExpressionFunctionBody` represent a function body con sisting of a 6344 * Instances of the class `ExpressionFunctionBody` represent a function body con sisting of a
6220 * single expression. 6345 * single expression.
6221 * 6346 *
6222 * <pre> 6347 * <pre>
6223 * expressionFunctionBody ::= 6348 * expressionFunctionBody ::=
6224 * '=>' [Expression] ';' 6349 * 'async'? '=>' [Expression] ';'
6225 * </pre> 6350 * </pre>
6226 */ 6351 */
6227 class ExpressionFunctionBody extends FunctionBody { 6352 class ExpressionFunctionBody extends FunctionBody {
6228 /** 6353 /**
6354 * The token representing the 'async' keyword, or `null` if there is no such k eyword.
6355 */
6356 Token keyword;
6357
6358 /**
6229 * The token introducing the expression that represents the body of the functi on. 6359 * The token introducing the expression that represents the body of the functi on.
6230 */ 6360 */
6231 Token functionDefinition; 6361 Token functionDefinition;
6232 6362
6233 /** 6363 /**
6234 * The expression representing the body of the function. 6364 * The expression representing the body of the function.
6235 */ 6365 */
6236 Expression _expression; 6366 Expression _expression;
6237 6367
6238 /** 6368 /**
6239 * The semicolon terminating the statement. 6369 * The semicolon terminating the statement.
6240 */ 6370 */
6241 Token semicolon; 6371 Token semicolon;
6242 6372
6243 /** 6373 /**
6244 * Initialize a newly created function body consisting of a block of statement s. 6374 * Initialize a newly created function body consisting of a block of statement s.
6245 * 6375 *
6376 * @param keyword the token representing the 'async' keyword
6246 * @param functionDefinition the token introducing the expression that represe nts the body of the 6377 * @param functionDefinition the token introducing the expression that represe nts the body of the
6247 * function 6378 * function
6248 * @param expression the expression representing the body of the function 6379 * @param expression the expression representing the body of the function
6249 * @param semicolon the semicolon terminating the statement 6380 * @param semicolon the semicolon terminating the statement
6250 */ 6381 */
6251 ExpressionFunctionBody(this.functionDefinition, Expression expression, this.se micolon) { 6382 ExpressionFunctionBody(this.keyword, this.functionDefinition, Expression expre ssion, this.semicolon) {
6252 this._expression = becomeParentOf(expression); 6383 this._expression = becomeParentOf(expression);
6253 } 6384 }
6254 6385
6255 @override 6386 @override
6256 accept(AstVisitor visitor) => visitor.visitExpressionFunctionBody(this); 6387 accept(AstVisitor visitor) => visitor.visitExpressionFunctionBody(this);
6257 6388
6258 @override 6389 @override
6259 Token get beginToken => functionDefinition; 6390 Token get beginToken => functionDefinition;
6260 6391
6261 @override 6392 @override
6262 Token get endToken { 6393 Token get endToken {
6263 if (semicolon != null) { 6394 if (semicolon != null) {
6264 return semicolon; 6395 return semicolon;
6265 } 6396 }
6266 return _expression.endToken; 6397 return _expression.endToken;
6267 } 6398 }
6268 6399
6269 /** 6400 /**
6270 * Return the expression representing the body of the function. 6401 * Return the expression representing the body of the function.
6271 * 6402 *
6272 * @return the expression representing the body of the function 6403 * @return the expression representing the body of the function
6273 */ 6404 */
6274 Expression get expression => _expression; 6405 Expression get expression => _expression;
6275 6406
6407 @override
6408 bool get isAsynchronous => keyword != null;
6409
6410 @override
6411 bool get isSynchronous => keyword == null;
6412
6276 /** 6413 /**
6277 * Set the expression representing the body of the function to the given expre ssion. 6414 * Set the expression representing the body of the function to the given expre ssion.
6278 * 6415 *
6279 * @param expression the expression representing the body of the function 6416 * @param expression the expression representing the body of the function
6280 */ 6417 */
6281 void set expression(Expression expression) { 6418 void set expression(Expression expression) {
6282 this._expression = becomeParentOf(expression); 6419 this._expression = becomeParentOf(expression);
6283 } 6420 }
6284 6421
6285 @override 6422 @override
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
6622 safelyVisitChild(identifier, visitor); 6759 safelyVisitChild(identifier, visitor);
6623 safelyVisitChild(_parameters, visitor); 6760 safelyVisitChild(_parameters, visitor);
6624 } 6761 }
6625 } 6762 }
6626 6763
6627 /** 6764 /**
6628 * Instances of the class `ForEachStatement` represent a for-each statement. 6765 * Instances of the class `ForEachStatement` represent a for-each statement.
6629 * 6766 *
6630 * <pre> 6767 * <pre>
6631 * forEachStatement ::= 6768 * forEachStatement ::=
6632 * 'for' '(' [DeclaredIdentifier] 'in' [Expression] ')' [Block] 6769 * 'await'? 'for' '(' [DeclaredIdentifier] 'in' [Expression] ')' [Block]
6633 * | 'for' '(' [SimpleIdentifier] 'in' [Expression] ')' [Block] 6770 * | 'await'? 'for' '(' [SimpleIdentifier] 'in' [Expression] ')' [Block]
6634 * </pre> 6771 * </pre>
6635 */ 6772 */
6636 class ForEachStatement extends Statement { 6773 class ForEachStatement extends Statement {
6637 /** 6774 /**
6775 * The token representing the 'await' keyword, or `null` if there is no 'await ' keyword.
6776 */
6777 Token awaitKeyword;
6778
6779 /**
6638 * The token representing the 'for' keyword. 6780 * The token representing the 'for' keyword.
6639 */ 6781 */
6640 Token forKeyword; 6782 Token forKeyword;
6641 6783
6642 /** 6784 /**
6643 * The left parenthesis. 6785 * The left parenthesis.
6644 */ 6786 */
6645 Token leftParenthesis; 6787 Token leftParenthesis;
6646 6788
6647 /** 6789 /**
(...skipping 23 matching lines...) Expand all
6671 Token rightParenthesis; 6813 Token rightParenthesis;
6672 6814
6673 /** 6815 /**
6674 * The body of the loop. 6816 * The body of the loop.
6675 */ 6817 */
6676 Statement _body; 6818 Statement _body;
6677 6819
6678 /** 6820 /**
6679 * Initialize a newly created for-each statement. 6821 * Initialize a newly created for-each statement.
6680 * 6822 *
6823 * @param awaitKeyword the token representing the 'await' keyword
6681 * @param forKeyword the token representing the 'for' keyword 6824 * @param forKeyword the token representing the 'for' keyword
6682 * @param leftParenthesis the left parenthesis 6825 * @param leftParenthesis the left parenthesis
6683 * @param loopVariable the declaration of the loop variable 6826 * @param loopVariable the declaration of the loop variable
6684 * @param iterator the expression evaluated to produce the iterator 6827 * @param iterator the expression evaluated to produce the iterator
6685 * @param rightParenthesis the right parenthesis 6828 * @param rightParenthesis the right parenthesis
6686 * @param body the body of the loop 6829 * @param body the body of the loop
6687 */ 6830 */
6688 ForEachStatement.con1(this.forKeyword, this.leftParenthesis, DeclaredIdentifie r loopVariable, this.inKeyword, Expression iterator, this.rightParenthesis, Stat ement body) { 6831 ForEachStatement.con1(this.awaitKeyword, this.forKeyword, this.leftParenthesis , DeclaredIdentifier loopVariable, this.inKeyword, Expression iterator, this.rig htParenthesis, Statement body) {
6689 this._loopVariable = becomeParentOf(loopVariable); 6832 this._loopVariable = becomeParentOf(loopVariable);
6690 this._iterator = becomeParentOf(iterator); 6833 this._iterator = becomeParentOf(iterator);
6691 this._body = becomeParentOf(body); 6834 this._body = becomeParentOf(body);
6692 } 6835 }
6693 6836
6694 /** 6837 /**
6695 * Initialize a newly created for-each statement. 6838 * Initialize a newly created for-each statement.
6696 * 6839 *
6840 * @param awaitKeyword the token representing the 'await' keyword
6697 * @param forKeyword the token representing the 'for' keyword 6841 * @param forKeyword the token representing the 'for' keyword
6698 * @param leftParenthesis the left parenthesis 6842 * @param leftParenthesis the left parenthesis
6699 * @param identifier the loop variable 6843 * @param identifier the loop variable
6700 * @param iterator the expression evaluated to produce the iterator 6844 * @param iterator the expression evaluated to produce the iterator
6701 * @param rightParenthesis the right parenthesis 6845 * @param rightParenthesis the right parenthesis
6702 * @param body the body of the loop 6846 * @param body the body of the loop
6703 */ 6847 */
6704 ForEachStatement.con2(this.forKeyword, this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword, Expression iterator, this.rightParenthesis, Statemen t body) { 6848 ForEachStatement.con2(this.awaitKeyword, this.forKeyword, this.leftParenthesis , SimpleIdentifier identifier, this.inKeyword, Expression iterator, this.rightPa renthesis, Statement body) {
6705 this._identifier = becomeParentOf(identifier); 6849 this._identifier = becomeParentOf(identifier);
6706 this._iterator = becomeParentOf(iterator); 6850 this._iterator = becomeParentOf(iterator);
6707 this._body = becomeParentOf(body); 6851 this._body = becomeParentOf(body);
6708 } 6852 }
6709 6853
6710 @override 6854 @override
6711 accept(AstVisitor visitor) => visitor.visitForEachStatement(this); 6855 accept(AstVisitor visitor) => visitor.visitForEachStatement(this);
6712 6856
6713 @override 6857 @override
6714 Token get beginToken => forKeyword; 6858 Token get beginToken => forKeyword;
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
7219 * body of a function or method. 7363 * body of a function or method.
7220 * 7364 *
7221 * <pre> 7365 * <pre>
7222 * functionBody ::= 7366 * functionBody ::=
7223 * [BlockFunctionBody] 7367 * [BlockFunctionBody]
7224 * | [EmptyFunctionBody] 7368 * | [EmptyFunctionBody]
7225 * | [ExpressionFunctionBody] 7369 * | [ExpressionFunctionBody]
7226 * </pre> 7370 * </pre>
7227 */ 7371 */
7228 abstract class FunctionBody extends AstNode { 7372 abstract class FunctionBody extends AstNode {
7373 /**
7374 * Return `true` if this function body is asynchronous.
7375 *
7376 * @return `true` if this function body is asynchronous
7377 */
7378 bool get isAsynchronous => false;
7379
7380 /**
7381 * Return `true` if this function body is a generator.
7382 *
7383 * @return `true` if this function body is a generator
7384 */
7385 bool get isGenerator => false;
7386
7387 /**
7388 * Return `true` if this function body is synchronous.
7389 *
7390 * @return `true` if this function body is synchronous
7391 */
7392 bool get isSynchronous => true;
7229 } 7393 }
7230 7394
7231 /** 7395 /**
7232 * Instances of the class `FunctionDeclaration` wrap a [FunctionExpression] as a top-level declaration. 7396 * Instances of the class `FunctionDeclaration` wrap a [FunctionExpression] as a top-level declaration.
7233 * 7397 *
7234 * <pre> 7398 * <pre>
7235 * functionDeclaration ::= 7399 * functionDeclaration ::=
7236 * 'external' functionSignature 7400 * 'external' functionSignature
7237 * | functionSignature [FunctionBody] 7401 * | functionSignature [FunctionBody]
7238 * 7402 *
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
7931 @override 8095 @override
7932 R visitAsExpression(AsExpression node) => visitExpression(node); 8096 R visitAsExpression(AsExpression node) => visitExpression(node);
7933 8097
7934 @override 8098 @override
7935 R visitAssertStatement(AssertStatement node) => visitStatement(node); 8099 R visitAssertStatement(AssertStatement node) => visitStatement(node);
7936 8100
7937 @override 8101 @override
7938 R visitAssignmentExpression(AssignmentExpression node) => visitExpression(node ); 8102 R visitAssignmentExpression(AssignmentExpression node) => visitExpression(node );
7939 8103
7940 @override 8104 @override
8105 R visitAwaitExpression(AwaitExpression node) => visitExpression(node);
8106
8107 @override
7941 R visitBinaryExpression(BinaryExpression node) => visitExpression(node); 8108 R visitBinaryExpression(BinaryExpression node) => visitExpression(node);
7942 8109
7943 @override 8110 @override
7944 R visitBlock(Block node) => visitStatement(node); 8111 R visitBlock(Block node) => visitStatement(node);
7945 8112
7946 @override 8113 @override
7947 R visitBlockFunctionBody(BlockFunctionBody node) => visitFunctionBody(node); 8114 R visitBlockFunctionBody(BlockFunctionBody node) => visitFunctionBody(node);
7948 8115
7949 @override 8116 @override
7950 R visitBooleanLiteral(BooleanLiteral node) => visitLiteral(node); 8117 R visitBooleanLiteral(BooleanLiteral node) => visitLiteral(node);
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
8262 R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node ); 8429 R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node );
8263 8430
8264 @override 8431 @override
8265 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visi tStatement(node); 8432 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visi tStatement(node);
8266 8433
8267 @override 8434 @override
8268 R visitWhileStatement(WhileStatement node) => visitStatement(node); 8435 R visitWhileStatement(WhileStatement node) => visitStatement(node);
8269 8436
8270 @override 8437 @override
8271 R visitWithClause(WithClause node) => visitNode(node); 8438 R visitWithClause(WithClause node) => visitNode(node);
8439
8440 @override
8441 R visitYieldStatement(YieldStatement node) => visitStatement(node);
8272 } 8442 }
8273 8443
8274 class GeneralizingAstVisitor_BreadthFirstVisitor extends GeneralizingAstVisitor< Object> { 8444 class GeneralizingAstVisitor_BreadthFirstVisitor extends GeneralizingAstVisitor< Object> {
8275 final BreadthFirstVisitor BreadthFirstVisitor_this; 8445 final BreadthFirstVisitor BreadthFirstVisitor_this;
8276 8446
8277 GeneralizingAstVisitor_BreadthFirstVisitor(this.BreadthFirstVisitor_this) : su per(); 8447 GeneralizingAstVisitor_BreadthFirstVisitor(this.BreadthFirstVisitor_this) : su per();
8278 8448
8279 @override 8449 @override
8280 Object visitNode(AstNode node) { 8450 Object visitNode(AstNode node) {
8281 BreadthFirstVisitor_this._queue.add(node); 8451 BreadthFirstVisitor_this._queue.add(node);
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
8812 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) { 8982 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) {
8813 AssignmentExpression copy = new AssignmentExpression(_cloneNode(node.leftHan dSide), _mapToken(node.operator), _cloneNode(node.rightHandSide)); 8983 AssignmentExpression copy = new AssignmentExpression(_cloneNode(node.leftHan dSide), _mapToken(node.operator), _cloneNode(node.rightHandSide));
8814 copy.propagatedElement = node.propagatedElement; 8984 copy.propagatedElement = node.propagatedElement;
8815 copy.propagatedType = node.propagatedType; 8985 copy.propagatedType = node.propagatedType;
8816 copy.staticElement = node.staticElement; 8986 copy.staticElement = node.staticElement;
8817 copy.staticType = node.staticType; 8987 copy.staticType = node.staticType;
8818 return copy; 8988 return copy;
8819 } 8989 }
8820 8990
8821 @override 8991 @override
8992 AwaitExpression visitAwaitExpression(AwaitExpression node) => new AwaitExpress ion(_mapToken(node.awaitKeyword), _cloneNode(node.expression), _mapToken(node.se micolon));
8993
8994 @override
8822 BinaryExpression visitBinaryExpression(BinaryExpression node) { 8995 BinaryExpression visitBinaryExpression(BinaryExpression node) {
8823 BinaryExpression copy = new BinaryExpression(_cloneNode(node.leftOperand), _ mapToken(node.operator), _cloneNode(node.rightOperand)); 8996 BinaryExpression copy = new BinaryExpression(_cloneNode(node.leftOperand), _ mapToken(node.operator), _cloneNode(node.rightOperand));
8824 copy.propagatedElement = node.propagatedElement; 8997 copy.propagatedElement = node.propagatedElement;
8825 copy.propagatedType = node.propagatedType; 8998 copy.propagatedType = node.propagatedType;
8826 copy.staticElement = node.staticElement; 8999 copy.staticElement = node.staticElement;
8827 copy.staticType = node.staticType; 9000 copy.staticType = node.staticType;
8828 return copy; 9001 return copy;
8829 } 9002 }
8830 9003
8831 @override 9004 @override
8832 Block visitBlock(Block node) => new Block(_mapToken(node.leftBracket), _cloneN odeList(node.statements), _mapToken(node.rightBracket)); 9005 Block visitBlock(Block node) => new Block(_mapToken(node.leftBracket), _cloneN odeList(node.statements), _mapToken(node.rightBracket));
8833 9006
8834 @override 9007 @override
8835 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody(_cloneNode(node.block)); 9008 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody(_mapToken(node.keyword), _mapToken(node.star), _cloneNode(node.block ));
8836 9009
8837 @override 9010 @override
8838 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) { 9011 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) {
8839 BooleanLiteral copy = new BooleanLiteral(_mapToken(node.literal), node.value ); 9012 BooleanLiteral copy = new BooleanLiteral(_mapToken(node.literal), node.value );
8840 copy.propagatedType = node.propagatedType; 9013 copy.propagatedType = node.propagatedType;
8841 copy.staticType = node.staticType; 9014 copy.staticType = node.staticType;
8842 return copy; 9015 return copy;
8843 } 9016 }
8844 9017
8845 @override 9018 @override
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
8939 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement( _mapToken(node.semicolon)); 9112 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement( _mapToken(node.semicolon));
8940 9113
8941 @override 9114 @override
8942 ExportDirective visitExportDirective(ExportDirective node) { 9115 ExportDirective visitExportDirective(ExportDirective node) {
8943 ExportDirective copy = new ExportDirective(_cloneNode(node.documentationComm ent), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.ur i), _cloneNodeList(node.combinators), _mapToken(node.semicolon)); 9116 ExportDirective copy = new ExportDirective(_cloneNode(node.documentationComm ent), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.ur i), _cloneNodeList(node.combinators), _mapToken(node.semicolon));
8944 copy.element = node.element; 9117 copy.element = node.element;
8945 return copy; 9118 return copy;
8946 } 9119 }
8947 9120
8948 @override 9121 @override
8949 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody(_mapToken(node.functionDefinition), _cloneNode(n ode.expression), _mapToken(node.semicolon)); 9122 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody(_mapToken(node.keyword), _mapToken(node.function Definition), _cloneNode(node.expression), _mapToken(node.semicolon));
8950 9123
8951 @override 9124 @override
8952 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement(_cloneNode(node.expression), _mapToken(node.semicolon)); 9125 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement(_cloneNode(node.expression), _mapToken(node.semicolon));
8953 9126
8954 @override 9127 @override
8955 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(_map Token(node.keyword), _cloneNode(node.superclass)); 9128 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(_map Token(node.keyword), _cloneNode(node.superclass));
8956 9129
8957 @override 9130 @override
8958 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _m apToken(node.staticKeyword), _cloneNode(node.fields), _mapToken(node.semicolon)) ; 9131 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _m apToken(node.staticKeyword), _cloneNode(node.fields), _mapToken(node.semicolon)) ;
8959 9132
8960 @override 9133 @override
8961 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter(_cloneNode(node.documentationComment), _cloneNodeList(no de.metadata), _mapToken(node.keyword), _cloneNode(node.type), _mapToken(node.thi sToken), _mapToken(node.period), _cloneNode(node.identifier), _cloneNode(node.pa rameters)); 9134 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter(_cloneNode(node.documentationComment), _cloneNodeList(no de.metadata), _mapToken(node.keyword), _cloneNode(node.type), _mapToken(node.thi sToken), _mapToken(node.period), _cloneNode(node.identifier), _cloneNode(node.pa rameters));
8962 9135
8963 @override 9136 @override
8964 ForEachStatement visitForEachStatement(ForEachStatement node) { 9137 ForEachStatement visitForEachStatement(ForEachStatement node) {
8965 DeclaredIdentifier loopVariable = node.loopVariable; 9138 DeclaredIdentifier loopVariable = node.loopVariable;
8966 if (loopVariable == null) { 9139 if (loopVariable == null) {
8967 return new ForEachStatement.con2(_mapToken(node.forKeyword), _mapToken(nod e.leftParenthesis), _cloneNode(node.identifier), _mapToken(node.inKeyword), _clo neNode(node.iterator), _mapToken(node.rightParenthesis), _cloneNode(node.body)); 9140 return new ForEachStatement.con2(_mapToken(node.awaitKeyword), _mapToken(n ode.forKeyword), _mapToken(node.leftParenthesis), _cloneNode(node.identifier), _ mapToken(node.inKeyword), _cloneNode(node.iterator), _mapToken(node.rightParenth esis), _cloneNode(node.body));
8968 } 9141 }
8969 return new ForEachStatement.con1(_mapToken(node.forKeyword), _mapToken(node. leftParenthesis), _cloneNode(loopVariable), _mapToken(node.inKeyword), _cloneNod e(node.iterator), _mapToken(node.rightParenthesis), _cloneNode(node.body)); 9142 return new ForEachStatement.con1(_mapToken(node.awaitKeyword), _mapToken(nod e.forKeyword), _mapToken(node.leftParenthesis), _cloneNode(loopVariable), _mapTo ken(node.inKeyword), _cloneNode(node.iterator), _mapToken(node.rightParenthesis) , _cloneNode(node.body));
8970 } 9143 }
8971 9144
8972 @override 9145 @override
8973 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList(_mapToken(node.leftParenthesis), _cloneNodeList(node.paramet ers), _mapToken(node.leftDelimiter), _mapToken(node.rightDelimiter), _mapToken(n ode.rightParenthesis)); 9146 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList(_mapToken(node.leftParenthesis), _cloneNodeList(node.paramet ers), _mapToken(node.leftDelimiter), _mapToken(node.rightDelimiter), _mapToken(n ode.rightParenthesis));
8974 9147
8975 @override 9148 @override
8976 ForStatement visitForStatement(ForStatement node) => new ForStatement(_mapToke n(node.forKeyword), _mapToken(node.leftParenthesis), _cloneNode(node.variables), _cloneNode(node.initialization), _mapToken(node.leftSeparator), _cloneNode(node .condition), _mapToken(node.rightSeparator), _cloneNodeList(node.updaters), _map Token(node.rightParenthesis), _cloneNode(node.body)); 9149 ForStatement visitForStatement(ForStatement node) => new ForStatement(_mapToke n(node.forKeyword), _mapToken(node.leftParenthesis), _cloneNode(node.variables), _cloneNode(node.initialization), _mapToken(node.leftSeparator), _cloneNode(node .condition), _mapToken(node.rightSeparator), _cloneNodeList(node.updaters), _map Token(node.rightParenthesis), _cloneNode(node.body));
8977 9150
8978 @override 9151 @override
8979 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.m etadata), _mapToken(node.externalKeyword), _cloneNode(node.returnType), _mapToke n(node.propertyKeyword), _cloneNode(node.name), _cloneNode(node.functionExpressi on)); 9152 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.m etadata), _mapToken(node.externalKeyword), _cloneNode(node.returnType), _mapToke n(node.propertyKeyword), _cloneNode(node.name), _cloneNode(node.functionExpressi on));
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
9333 9506
9334 @override 9507 @override
9335 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement(_cloneNode(node.variable s), _mapToken(node.semicolon)); 9508 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement(_cloneNode(node.variable s), _mapToken(node.semicolon));
9336 9509
9337 @override 9510 @override
9338 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( _mapToken(node.keyword), _mapToken(node.leftParenthesis), _cloneNode(node.condit ion), _mapToken(node.rightParenthesis), _cloneNode(node.body)); 9511 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( _mapToken(node.keyword), _mapToken(node.leftParenthesis), _cloneNode(node.condit ion), _mapToken(node.rightParenthesis), _cloneNode(node.body));
9339 9512
9340 @override 9513 @override
9341 WithClause visitWithClause(WithClause node) => new WithClause(_mapToken(node.w ithKeyword), _cloneNodeList(node.mixinTypes)); 9514 WithClause visitWithClause(WithClause node) => new WithClause(_mapToken(node.w ithKeyword), _cloneNodeList(node.mixinTypes));
9342 9515
9516 @override
9517 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement( _mapToken(node.yieldKeyword), _mapToken(node.star), _cloneNode(node.expression), _mapToken(node.semicolon));
9518
9343 AstNode _cloneNode(AstNode node) { 9519 AstNode _cloneNode(AstNode node) {
9344 if (node == null) { 9520 if (node == null) {
9345 return null; 9521 return null;
9346 } 9522 }
9347 if (identical(node, _oldNode)) { 9523 if (identical(node, _oldNode)) {
9348 return _newNode; 9524 return _newNode;
9349 } 9525 }
9350 return node.accept(this) as AstNode; 9526 return node.accept(this) as AstNode;
9351 } 9527 }
9352 9528
(...skipping 2280 matching lines...) Expand 10 before | Expand all | Expand 10 after
11633 node.leftHandSide = _newNode as Expression; 11809 node.leftHandSide = _newNode as Expression;
11634 return true; 11810 return true;
11635 } else if (identical(node.rightHandSide, _oldNode)) { 11811 } else if (identical(node.rightHandSide, _oldNode)) {
11636 node.rightHandSide = _newNode as Expression; 11812 node.rightHandSide = _newNode as Expression;
11637 return true; 11813 return true;
11638 } 11814 }
11639 return visitNode(node); 11815 return visitNode(node);
11640 } 11816 }
11641 11817
11642 @override 11818 @override
11819 bool visitAwaitExpression(AwaitExpression node) {
11820 if (identical(node.expression, _oldNode)) {
11821 node.expression = _newNode as Expression;
11822 }
11823 return visitNode(node);
11824 }
11825
11826 @override
11643 bool visitBinaryExpression(BinaryExpression node) { 11827 bool visitBinaryExpression(BinaryExpression node) {
11644 if (identical(node.leftOperand, _oldNode)) { 11828 if (identical(node.leftOperand, _oldNode)) {
11645 node.leftOperand = _newNode as Expression; 11829 node.leftOperand = _newNode as Expression;
11646 return true; 11830 return true;
11647 } else if (identical(node.rightOperand, _oldNode)) { 11831 } else if (identical(node.rightOperand, _oldNode)) {
11648 node.rightOperand = _newNode as Expression; 11832 node.rightOperand = _newNode as Expression;
11649 return true; 11833 return true;
11650 } 11834 }
11651 return visitNode(node); 11835 return visitNode(node);
11652 } 11836 }
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
12627 } 12811 }
12628 12812
12629 @override 12813 @override
12630 bool visitWithClause(WithClause node) { 12814 bool visitWithClause(WithClause node) {
12631 if (_replaceInList(node.mixinTypes)) { 12815 if (_replaceInList(node.mixinTypes)) {
12632 return true; 12816 return true;
12633 } 12817 }
12634 return visitNode(node); 12818 return visitNode(node);
12635 } 12819 }
12636 12820
12821 @override
12822 bool visitYieldStatement(YieldStatement node) {
12823 if (identical(node.expression, _oldNode)) {
12824 node.expression = _newNode as Expression;
12825 }
12826 return visitNode(node);
12827 }
12828
12637 bool _replaceInList(NodeList list) { 12829 bool _replaceInList(NodeList list) {
12638 int count = list.length; 12830 int count = list.length;
12639 for (int i = 0; i < count; i++) { 12831 for (int i = 0; i < count; i++) {
12640 if (identical(_oldNode, list[i])) { 12832 if (identical(_oldNode, list[i])) {
12641 javaListSet(list, i, _newNode); 12833 javaListSet(list, i, _newNode);
12642 return true; 12834 return true;
12643 } 12835 }
12644 } 12836 }
12645 return false; 12837 return false;
12646 } 12838 }
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
13715 return null; 13907 return null;
13716 } 13908 }
13717 13909
13718 @override 13910 @override
13719 R visitAssignmentExpression(AssignmentExpression node) { 13911 R visitAssignmentExpression(AssignmentExpression node) {
13720 node.visitChildren(this); 13912 node.visitChildren(this);
13721 return null; 13913 return null;
13722 } 13914 }
13723 13915
13724 @override 13916 @override
13917 R visitAwaitExpression(AwaitExpression node) {
13918 node.visitChildren(this);
13919 return null;
13920 }
13921
13922 @override
13725 R visitBinaryExpression(BinaryExpression node) { 13923 R visitBinaryExpression(BinaryExpression node) {
13726 node.visitChildren(this); 13924 node.visitChildren(this);
13727 return null; 13925 return null;
13728 } 13926 }
13729 13927
13730 @override 13928 @override
13731 R visitBlock(Block node) { 13929 R visitBlock(Block node) {
13732 node.visitChildren(this); 13930 node.visitChildren(this);
13733 return null; 13931 return null;
13734 } 13932 }
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
14289 R visitWhileStatement(WhileStatement node) { 14487 R visitWhileStatement(WhileStatement node) {
14290 node.visitChildren(this); 14488 node.visitChildren(this);
14291 return null; 14489 return null;
14292 } 14490 }
14293 14491
14294 @override 14492 @override
14295 R visitWithClause(WithClause node) { 14493 R visitWithClause(WithClause node) {
14296 node.visitChildren(this); 14494 node.visitChildren(this);
14297 return null; 14495 return null;
14298 } 14496 }
14497
14498 @override
14499 R visitYieldStatement(YieldStatement node) {
14500 node.visitChildren(this);
14501 return null;
14502 }
14299 } 14503 }
14300 14504
14301 /** 14505 /**
14302 * Instances of the class `RedirectingConstructorInvocation` represent the invoc ation of a 14506 * Instances of the class `RedirectingConstructorInvocation` represent the invoc ation of a
14303 * another constructor in the same class from within a constructor's initializat ion list. 14507 * another constructor in the same class from within a constructor's initializat ion list.
14304 * 14508 *
14305 * <pre> 14509 * <pre>
14306 * redirectingConstructorInvocation ::= 14510 * redirectingConstructorInvocation ::=
14307 * 'this' ('.' identifier)? arguments 14511 * 'this' ('.' identifier)? arguments
14308 * </pre> 14512 * </pre>
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
14786 @override 14990 @override
14787 R visitAsExpression(AsExpression node) => null; 14991 R visitAsExpression(AsExpression node) => null;
14788 14992
14789 @override 14993 @override
14790 R visitAssertStatement(AssertStatement node) => null; 14994 R visitAssertStatement(AssertStatement node) => null;
14791 14995
14792 @override 14996 @override
14793 R visitAssignmentExpression(AssignmentExpression node) => null; 14997 R visitAssignmentExpression(AssignmentExpression node) => null;
14794 14998
14795 @override 14999 @override
15000 R visitAwaitExpression(AwaitExpression node) => null;
15001
15002 @override
14796 R visitBinaryExpression(BinaryExpression node) => null; 15003 R visitBinaryExpression(BinaryExpression node) => null;
14797 15004
14798 @override 15005 @override
14799 R visitBlock(Block node) => null; 15006 R visitBlock(Block node) => null;
14800 15007
14801 @override 15008 @override
14802 R visitBlockFunctionBody(BlockFunctionBody node) => null; 15009 R visitBlockFunctionBody(BlockFunctionBody node) => null;
14803 15010
14804 @override 15011 @override
14805 R visitBooleanLiteral(BooleanLiteral node) => null; 15012 R visitBooleanLiteral(BooleanLiteral node) => null;
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
15072 R visitVariableDeclarationList(VariableDeclarationList node) => null; 15279 R visitVariableDeclarationList(VariableDeclarationList node) => null;
15073 15280
15074 @override 15281 @override
15075 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => null ; 15282 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => null ;
15076 15283
15077 @override 15284 @override
15078 R visitWhileStatement(WhileStatement node) => null; 15285 R visitWhileStatement(WhileStatement node) => null;
15079 15286
15080 @override 15287 @override
15081 R visitWithClause(WithClause node) => null; 15288 R visitWithClause(WithClause node) => null;
15289
15290 @override
15291 R visitYieldStatement(YieldStatement node) => null;
15082 } 15292 }
15083 15293
15084 /** 15294 /**
15085 * Instances of the class `SimpleFormalParameter` represent a simple formal para meter. 15295 * Instances of the class `SimpleFormalParameter` represent a simple formal para meter.
15086 * 15296 *
15087 * <pre> 15297 * <pre>
15088 * simpleFormalParameter ::= 15298 * simpleFormalParameter ::=
15089 * ('final' [TypeName] | 'var' | [TypeName])? [SimpleIdentifier] 15299 * ('final' [TypeName] | 'var' | [TypeName])? [SimpleIdentifier]
15090 * </pre> 15300 * </pre>
15091 */ 15301 */
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
16323 Object visitAssignmentExpression(AssignmentExpression node) { 16533 Object visitAssignmentExpression(AssignmentExpression node) {
16324 _visitNode(node.leftHandSide); 16534 _visitNode(node.leftHandSide);
16325 _writer.print(' '); 16535 _writer.print(' ');
16326 _writer.print(node.operator.lexeme); 16536 _writer.print(node.operator.lexeme);
16327 _writer.print(' '); 16537 _writer.print(' ');
16328 _visitNode(node.rightHandSide); 16538 _visitNode(node.rightHandSide);
16329 return null; 16539 return null;
16330 } 16540 }
16331 16541
16332 @override 16542 @override
16543 Object visitAwaitExpression(AwaitExpression node) {
16544 _writer.print("await ");
16545 _visitNode(node.expression);
16546 _writer.print(";");
16547 return null;
16548 }
16549
16550 @override
16333 Object visitBinaryExpression(BinaryExpression node) { 16551 Object visitBinaryExpression(BinaryExpression node) {
16334 _visitNode(node.leftOperand); 16552 _visitNode(node.leftOperand);
16335 _writer.print(' '); 16553 _writer.print(' ');
16336 _writer.print(node.operator.lexeme); 16554 _writer.print(node.operator.lexeme);
16337 _writer.print(' '); 16555 _writer.print(' ');
16338 _visitNode(node.rightOperand); 16556 _visitNode(node.rightOperand);
16339 return null; 16557 return null;
16340 } 16558 }
16341 16559
16342 @override 16560 @override
16343 Object visitBlock(Block node) { 16561 Object visitBlock(Block node) {
16344 _writer.print('{'); 16562 _writer.print('{');
16345 _visitNodeListWithSeparator(node.statements, " "); 16563 _visitNodeListWithSeparator(node.statements, " ");
16346 _writer.print('}'); 16564 _writer.print('}');
16347 return null; 16565 return null;
16348 } 16566 }
16349 16567
16350 @override 16568 @override
16351 Object visitBlockFunctionBody(BlockFunctionBody node) { 16569 Object visitBlockFunctionBody(BlockFunctionBody node) {
16570 Token keyword = node.keyword;
16571 if (keyword != null) {
16572 _writer.print(keyword.lexeme);
16573 if (node.star != null) {
16574 _writer.print('*');
16575 }
16576 _writer.print(' ');
16577 }
16352 _visitNode(node.block); 16578 _visitNode(node.block);
16353 return null; 16579 return null;
16354 } 16580 }
16355 16581
16356 @override 16582 @override
16357 Object visitBooleanLiteral(BooleanLiteral node) { 16583 Object visitBooleanLiteral(BooleanLiteral node) {
16358 _writer.print(node.literal.lexeme); 16584 _writer.print(node.literal.lexeme);
16359 return null; 16585 return null;
16360 } 16586 }
16361 16587
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
16545 _visitNodeListWithSeparatorAndSuffix(node.metadata, " ", " "); 16771 _visitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
16546 _writer.print("export "); 16772 _writer.print("export ");
16547 _visitNode(node.uri); 16773 _visitNode(node.uri);
16548 _visitNodeListWithSeparatorAndPrefix(" ", node.combinators, " "); 16774 _visitNodeListWithSeparatorAndPrefix(" ", node.combinators, " ");
16549 _writer.print(';'); 16775 _writer.print(';');
16550 return null; 16776 return null;
16551 } 16777 }
16552 16778
16553 @override 16779 @override
16554 Object visitExpressionFunctionBody(ExpressionFunctionBody node) { 16780 Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
16781 Token keyword = node.keyword;
16782 if (keyword != null) {
16783 _writer.print(keyword.lexeme);
16784 _writer.print(' ');
16785 }
16555 _writer.print("=> "); 16786 _writer.print("=> ");
16556 _visitNode(node.expression); 16787 _visitNode(node.expression);
16557 if (node.semicolon != null) { 16788 if (node.semicolon != null) {
16558 _writer.print(';'); 16789 _writer.print(';');
16559 } 16790 }
16560 return null; 16791 return null;
16561 } 16792 }
16562 16793
16563 @override 16794 @override
16564 Object visitExpressionStatement(ExpressionStatement node) { 16795 Object visitExpressionStatement(ExpressionStatement node) {
(...skipping 24 matching lines...) Expand all
16589 _visitNodeWithSuffix(node.type, " "); 16820 _visitNodeWithSuffix(node.type, " ");
16590 _writer.print("this."); 16821 _writer.print("this.");
16591 _visitNode(node.identifier); 16822 _visitNode(node.identifier);
16592 _visitNode(node.parameters); 16823 _visitNode(node.parameters);
16593 return null; 16824 return null;
16594 } 16825 }
16595 16826
16596 @override 16827 @override
16597 Object visitForEachStatement(ForEachStatement node) { 16828 Object visitForEachStatement(ForEachStatement node) {
16598 DeclaredIdentifier loopVariable = node.loopVariable; 16829 DeclaredIdentifier loopVariable = node.loopVariable;
16830 if (node.awaitKeyword != null) {
16831 _writer.print("await ");
16832 }
16599 _writer.print("for ("); 16833 _writer.print("for (");
16600 if (loopVariable == null) { 16834 if (loopVariable == null) {
16601 _visitNode(node.identifier); 16835 _visitNode(node.identifier);
16602 } else { 16836 } else {
16603 _visitNode(loopVariable); 16837 _visitNode(loopVariable);
16604 } 16838 }
16605 _writer.print(" in "); 16839 _writer.print(" in ");
16606 _visitNode(node.iterator); 16840 _visitNode(node.iterator);
16607 _writer.print(") "); 16841 _writer.print(") ");
16608 _visitNode(node.body); 16842 _visitNode(node.body);
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
17196 return null; 17430 return null;
17197 } 17431 }
17198 17432
17199 @override 17433 @override
17200 Object visitWithClause(WithClause node) { 17434 Object visitWithClause(WithClause node) {
17201 _writer.print("with "); 17435 _writer.print("with ");
17202 _visitNodeListWithSeparator(node.mixinTypes, ", "); 17436 _visitNodeListWithSeparator(node.mixinTypes, ", ");
17203 return null; 17437 return null;
17204 } 17438 }
17205 17439
17440 @override
17441 Object visitYieldStatement(YieldStatement node) {
17442 if (node.star != null) {
17443 _writer.print("yield* ");
17444 } else {
17445 _writer.print("yield ");
17446 }
17447 _visitNode(node.expression);
17448 _writer.print(";");
17449 return null;
17450 }
17451
17206 /** 17452 /**
17207 * Visit the given function body, printing the prefix before if given body is not empty. 17453 * Visit the given function body, printing the prefix before if given body is not empty.
17208 * 17454 *
17209 * @param prefix the prefix to be printed if there is a node to visit 17455 * @param prefix the prefix to be printed if there is a node to visit
17210 * @param body the function body to be visited 17456 * @param body the function body to be visited
17211 */ 17457 */
17212 void _visitFunctionWithPrefix(String prefix, FunctionBody body) { 17458 void _visitFunctionWithPrefix(String prefix, FunctionBody body) {
17213 if (body is! EmptyFunctionBody) { 17459 if (body is! EmptyFunctionBody) {
17214 _writer.print(prefix); 17460 _writer.print(prefix);
17215 } 17461 }
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
17971 @override 18217 @override
17972 R visitAsExpression(AsExpression node) => visitNode(node); 18218 R visitAsExpression(AsExpression node) => visitNode(node);
17973 18219
17974 @override 18220 @override
17975 R visitAssertStatement(AssertStatement node) => visitNode(node); 18221 R visitAssertStatement(AssertStatement node) => visitNode(node);
17976 18222
17977 @override 18223 @override
17978 R visitAssignmentExpression(AssignmentExpression node) => visitNode(node); 18224 R visitAssignmentExpression(AssignmentExpression node) => visitNode(node);
17979 18225
17980 @override 18226 @override
18227 R visitAwaitExpression(AwaitExpression node) => visitNode(node);
18228
18229 @override
17981 R visitBinaryExpression(BinaryExpression node) => visitNode(node); 18230 R visitBinaryExpression(BinaryExpression node) => visitNode(node);
17982 18231
17983 @override 18232 @override
17984 R visitBlock(Block node) => visitNode(node); 18233 R visitBlock(Block node) => visitNode(node);
17985 18234
17986 @override 18235 @override
17987 R visitBlockFunctionBody(BlockFunctionBody node) => visitNode(node); 18236 R visitBlockFunctionBody(BlockFunctionBody node) => visitNode(node);
17988 18237
17989 @override 18238 @override
17990 R visitBooleanLiteral(BooleanLiteral node) => visitNode(node); 18239 R visitBooleanLiteral(BooleanLiteral node) => visitNode(node);
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
18262 R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node ); 18511 R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node );
18263 18512
18264 @override 18513 @override
18265 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visi tNode(node); 18514 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visi tNode(node);
18266 18515
18267 @override 18516 @override
18268 R visitWhileStatement(WhileStatement node) => visitNode(node); 18517 R visitWhileStatement(WhileStatement node) => visitNode(node);
18269 18518
18270 @override 18519 @override
18271 R visitWithClause(WithClause node) => visitNode(node); 18520 R visitWithClause(WithClause node) => visitNode(node);
18521
18522 @override
18523 R visitYieldStatement(YieldStatement node) => visitNode(node);
18272 } 18524 }
18273 18525
18274 /** 18526 /**
18275 * The abstract class `UriBasedDirective` defines the behavior common to nodes t hat represent 18527 * The abstract class `UriBasedDirective` defines the behavior common to nodes t hat represent
18276 * a directive that references a URI. 18528 * a directive that references a URI.
18277 * 18529 *
18278 * <pre> 18530 * <pre>
18279 * uriBasedDirective ::= 18531 * uriBasedDirective ::=
18280 * [ExportDirective] 18532 * [ExportDirective]
18281 * | [ImportDirective] 18533 * | [ImportDirective]
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
18858 */ 19110 */
18859 void set mixinKeyword(Token withKeyword) { 19111 void set mixinKeyword(Token withKeyword) {
18860 this._withKeyword = withKeyword; 19112 this._withKeyword = withKeyword;
18861 } 19113 }
18862 19114
18863 @override 19115 @override
18864 void visitChildren(AstVisitor visitor) { 19116 void visitChildren(AstVisitor visitor) {
18865 _mixinTypes.accept(visitor); 19117 _mixinTypes.accept(visitor);
18866 } 19118 }
18867 } 19119 }
19120
19121 /**
19122 * Instances of the class `YieldStatement` implement a yield statement.
19123 */
19124 class YieldStatement extends Statement {
19125 /**
19126 * The 'yield' keyword.
19127 */
19128 Token yieldKeyword;
19129
19130 /**
19131 * The star optionally following the 'yield' keyword.
19132 */
19133 Token star;
19134
19135 /**
19136 * The expression whose value will be yielded.
19137 */
19138 Expression _expression;
19139
19140 /**
19141 * The semicolon following the expression.
19142 */
19143 Token semicolon;
19144
19145 /**
19146 * Initialize a newly created yield expression.
19147 *
19148 * @param yieldKeyword the 'yield' keyword
19149 * @param star the star following the 'yield' keyword
19150 * @param expression the expression whose value will be yielded
19151 * @param semicolon the semicolon following the expression
19152 */
19153 YieldStatement(this.yieldKeyword, this.star, Expression expression, this.semic olon) {
19154 this._expression = becomeParentOf(expression);
19155 }
19156
19157 @override
19158 accept(AstVisitor visitor) => visitor.visitYieldStatement(this);
19159
19160 @override
19161 Token get beginToken {
19162 if (yieldKeyword != null) {
19163 return yieldKeyword;
19164 }
19165 return _expression.beginToken;
19166 }
19167
19168 @override
19169 Token get endToken {
19170 if (semicolon != null) {
19171 return semicolon;
19172 }
19173 return _expression.endToken;
19174 }
19175
19176 /**
19177 * Return the expression whose value will be yielded.
19178 *
19179 * @return the expression whose value will be yielded
19180 */
19181 Expression get expression => _expression;
19182
19183 /**
19184 * Set the expression whose value will be yielded to the given expression.
19185 *
19186 * @param expression the expression whose value will be yielded
19187 */
19188 void set expression(Expression expression) {
19189 this._expression = becomeParentOf(expression);
19190 }
19191
19192 @override
19193 void visitChildren(AstVisitor visitor) {
19194 safelyVisitChild(_expression, visitor);
19195 }
19196 }
18868 /** 19197 /**
18869 * Instances of the class {@code NodeList} represent a list of AST nodes that ha ve a common parent. 19198 * Instances of the class {@code NodeList} represent a list of AST nodes that ha ve a common parent.
18870 */ 19199 */
18871 class NodeList<E extends AstNode> extends Object with ListMixin<E> { 19200 class NodeList<E extends AstNode> extends Object with ListMixin<E> {
18872 /** 19201 /**
18873 * Create an empty list with the given owner. This is a convenience method tha t allows the 19202 * Create an empty list with the given owner. This is a convenience method tha t allows the
18874 * compiler to determine the correct value of the type argument [E] without ne eding to 19203 * compiler to determine the correct value of the type argument [E] without ne eding to
18875 * explicitly specify it. 19204 * explicitly specify it.
18876 * 19205 *
18877 * @param owner the node that is the parent of each of the elements in the lis t 19206 * @param owner the node that is the parent of each of the elements in the lis t
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
18983 _elements[index] = node; 19312 _elements[index] = node;
18984 } 19313 }
18985 void clear() { 19314 void clear() {
18986 _elements = <E> []; 19315 _elements = <E> [];
18987 } 19316 }
18988 int get length => _elements.length; 19317 int get length => _elements.length;
18989 void set length(int value) { 19318 void set length(int value) {
18990 throw new UnsupportedError("Cannot resize NodeList."); 19319 throw new UnsupportedError("Cannot resize NodeList.");
18991 } 19320 }
18992 } 19321 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698