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

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

Issue 68233003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3
3 library engine.ast; 4 library engine.ast;
5
4 import 'dart:collection'; 6 import 'dart:collection';
5 import 'java_core.dart'; 7 import 'java_core.dart';
6 import 'java_engine.dart'; 8 import 'java_engine.dart';
7 import 'source.dart' show LineInfo; 9 import 'source.dart' show LineInfo;
8 import 'scanner.dart'; 10 import 'scanner.dart';
9 import 'engine.dart' show AnalysisEngine; 11 import 'engine.dart' show AnalysisEngine;
10 import 'utilities_dart.dart'; 12 import 'utilities_dart.dart';
11 import 'utilities_collection.dart' show TokenMap; 13 import 'utilities_collection.dart' show TokenMap;
12 import 'element.dart'; 14 import 'element.dart';
15
13 /** 16 /**
14 * The abstract class `ASTNode` defines the behavior common to all nodes in the AST structure 17 * The abstract class `ASTNode` defines the behavior common to all nodes in the AST structure
15 * for a Dart program. 18 * for a Dart program.
16 * 19 *
17 * @coverage dart.engine.ast 20 * @coverage dart.engine.ast
18 */ 21 */
19 abstract class ASTNode { 22 abstract class ASTNode {
20
21 /** 23 /**
22 * An empty array of ast nodes. 24 * An empty array of ast nodes.
23 */ 25 */
24 static List<ASTNode> EMPTY_ARRAY = new List<ASTNode>(0); 26 static List<ASTNode> EMPTY_ARRAY = new List<ASTNode>(0);
25 27
26 /** 28 /**
27 * The parent of the node, or `null` if the node is the root of an AST structu re. 29 * The parent of the node, or `null` if the node is the root of an AST structu re.
28 */ 30 */
29 ASTNode _parent; 31 ASTNode _parent;
30 32
(...skipping 24 matching lines...) Expand all
55 * there is no enclosing node of the given class. 57 * there is no enclosing node of the given class.
56 * 58 *
57 * @param nodeClass the class of the node to be returned 59 * @param nodeClass the class of the node to be returned
58 * @return the node of the given type that encloses this node 60 * @return the node of the given type that encloses this node
59 */ 61 */
60 ASTNode getAncestor(Type enclosingClass) { 62 ASTNode getAncestor(Type enclosingClass) {
61 ASTNode node = this; 63 ASTNode node = this;
62 while (node != null && !isInstanceOf(node, enclosingClass)) { 64 while (node != null && !isInstanceOf(node, enclosingClass)) {
63 node = node.parent; 65 node = node.parent;
64 } 66 }
65 ;
66 return node as ASTNode; 67 return node as ASTNode;
67 } 68 }
68 69
69 /** 70 /**
70 * Return the first token included in this node's source range. 71 * Return the first token included in this node's source range.
71 * 72 *
72 * @return the first token included in this node's source range 73 * @return the first token included in this node's source range
73 */ 74 */
74 Token get beginToken; 75 Token get beginToken;
75 76
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 * Return a textual description of this node in a form approximating valid sou rce. The returned 195 * Return a textual description of this node in a form approximating valid sou rce. The returned
195 * string will not be valid source primarily in the case where the node itself is not well-formed. 196 * string will not be valid source primarily in the case where the node itself is not well-formed.
196 * 197 *
197 * @return the source code equivalent of this node 198 * @return the source code equivalent of this node
198 */ 199 */
199 String toSource() { 200 String toSource() {
200 PrintStringWriter writer = new PrintStringWriter(); 201 PrintStringWriter writer = new PrintStringWriter();
201 accept(new ToSourceVisitor(writer)); 202 accept(new ToSourceVisitor(writer));
202 return writer.toString(); 203 return writer.toString();
203 } 204 }
205
204 String toString() => toSource(); 206 String toString() => toSource();
205 207
206 /** 208 /**
207 * Use the given visitor to visit all of the children of this node. The childr en will be visited 209 * Use the given visitor to visit all of the children of this node. The childr en will be visited
208 * in source order. 210 * in source order.
209 * 211 *
210 * @param visitor the visitor that will be used to visit the children of this node 212 * @param visitor the visitor that will be used to visit the children of this node
211 */ 213 */
212 void visitChildren(ASTVisitor visitor); 214 void visitChildren(ASTVisitor visitor);
213 215
(...skipping 24 matching lines...) Expand all
238 } 240 }
239 241
240 /** 242 /**
241 * Set the parent of this node to the given node. 243 * Set the parent of this node to the given node.
242 * 244 *
243 * @param newParent the node that is to be made the parent of this node 245 * @param newParent the node that is to be made the parent of this node
244 */ 246 */
245 void set parent(ASTNode newParent) { 247 void set parent(ASTNode newParent) {
246 _parent = newParent; 248 _parent = newParent;
247 } 249 }
250
248 static int _hashCodeGenerator = 0; 251 static int _hashCodeGenerator = 0;
252
249 final int hashCode = ++_hashCodeGenerator; 253 final int hashCode = ++_hashCodeGenerator;
250 } 254 }
255
251 /** 256 /**
252 * The interface `ASTVisitor` defines the behavior of objects that can be used t o visit an AST 257 * The interface `ASTVisitor` defines the behavior of objects that can be used t o visit an AST
253 * structure. 258 * structure.
254 * 259 *
255 * @coverage dart.engine.ast 260 * @coverage dart.engine.ast
256 */ 261 */
257 abstract class ASTVisitor<R> { 262 abstract class ASTVisitor<R> {
258 R visitAdjacentStrings(AdjacentStrings node); 263 R visitAdjacentStrings(AdjacentStrings node);
264
259 R visitAnnotation(Annotation node); 265 R visitAnnotation(Annotation node);
266
260 R visitArgumentDefinitionTest(ArgumentDefinitionTest node); 267 R visitArgumentDefinitionTest(ArgumentDefinitionTest node);
268
261 R visitArgumentList(ArgumentList node); 269 R visitArgumentList(ArgumentList node);
270
262 R visitAsExpression(AsExpression node); 271 R visitAsExpression(AsExpression node);
272
263 R visitAssertStatement(AssertStatement assertStatement); 273 R visitAssertStatement(AssertStatement assertStatement);
274
264 R visitAssignmentExpression(AssignmentExpression node); 275 R visitAssignmentExpression(AssignmentExpression node);
276
265 R visitBinaryExpression(BinaryExpression node); 277 R visitBinaryExpression(BinaryExpression node);
278
266 R visitBlock(Block node); 279 R visitBlock(Block node);
280
267 R visitBlockFunctionBody(BlockFunctionBody node); 281 R visitBlockFunctionBody(BlockFunctionBody node);
282
268 R visitBooleanLiteral(BooleanLiteral node); 283 R visitBooleanLiteral(BooleanLiteral node);
284
269 R visitBreakStatement(BreakStatement node); 285 R visitBreakStatement(BreakStatement node);
286
270 R visitCascadeExpression(CascadeExpression node); 287 R visitCascadeExpression(CascadeExpression node);
288
271 R visitCatchClause(CatchClause node); 289 R visitCatchClause(CatchClause node);
290
272 R visitClassDeclaration(ClassDeclaration node); 291 R visitClassDeclaration(ClassDeclaration node);
292
273 R visitClassTypeAlias(ClassTypeAlias node); 293 R visitClassTypeAlias(ClassTypeAlias node);
294
274 R visitComment(Comment node); 295 R visitComment(Comment node);
296
275 R visitCommentReference(CommentReference node); 297 R visitCommentReference(CommentReference node);
298
276 R visitCompilationUnit(CompilationUnit node); 299 R visitCompilationUnit(CompilationUnit node);
300
277 R visitConditionalExpression(ConditionalExpression node); 301 R visitConditionalExpression(ConditionalExpression node);
302
278 R visitConstructorDeclaration(ConstructorDeclaration node); 303 R visitConstructorDeclaration(ConstructorDeclaration node);
304
279 R visitConstructorFieldInitializer(ConstructorFieldInitializer node); 305 R visitConstructorFieldInitializer(ConstructorFieldInitializer node);
306
280 R visitConstructorName(ConstructorName node); 307 R visitConstructorName(ConstructorName node);
308
281 R visitContinueStatement(ContinueStatement node); 309 R visitContinueStatement(ContinueStatement node);
310
282 R visitDeclaredIdentifier(DeclaredIdentifier node); 311 R visitDeclaredIdentifier(DeclaredIdentifier node);
312
283 R visitDefaultFormalParameter(DefaultFormalParameter node); 313 R visitDefaultFormalParameter(DefaultFormalParameter node);
314
284 R visitDoStatement(DoStatement node); 315 R visitDoStatement(DoStatement node);
316
285 R visitDoubleLiteral(DoubleLiteral node); 317 R visitDoubleLiteral(DoubleLiteral node);
318
286 R visitEmptyFunctionBody(EmptyFunctionBody node); 319 R visitEmptyFunctionBody(EmptyFunctionBody node);
320
287 R visitEmptyStatement(EmptyStatement node); 321 R visitEmptyStatement(EmptyStatement node);
322
288 R visitExportDirective(ExportDirective node); 323 R visitExportDirective(ExportDirective node);
324
289 R visitExpressionFunctionBody(ExpressionFunctionBody node); 325 R visitExpressionFunctionBody(ExpressionFunctionBody node);
326
290 R visitExpressionStatement(ExpressionStatement node); 327 R visitExpressionStatement(ExpressionStatement node);
328
291 R visitExtendsClause(ExtendsClause node); 329 R visitExtendsClause(ExtendsClause node);
330
292 R visitFieldDeclaration(FieldDeclaration node); 331 R visitFieldDeclaration(FieldDeclaration node);
332
293 R visitFieldFormalParameter(FieldFormalParameter node); 333 R visitFieldFormalParameter(FieldFormalParameter node);
334
294 R visitForEachStatement(ForEachStatement node); 335 R visitForEachStatement(ForEachStatement node);
336
295 R visitFormalParameterList(FormalParameterList node); 337 R visitFormalParameterList(FormalParameterList node);
338
296 R visitForStatement(ForStatement node); 339 R visitForStatement(ForStatement node);
340
297 R visitFunctionDeclaration(FunctionDeclaration node); 341 R visitFunctionDeclaration(FunctionDeclaration node);
342
298 R visitFunctionDeclarationStatement(FunctionDeclarationStatement node); 343 R visitFunctionDeclarationStatement(FunctionDeclarationStatement node);
344
299 R visitFunctionExpression(FunctionExpression node); 345 R visitFunctionExpression(FunctionExpression node);
346
300 R visitFunctionExpressionInvocation(FunctionExpressionInvocation node); 347 R visitFunctionExpressionInvocation(FunctionExpressionInvocation node);
348
301 R visitFunctionTypeAlias(FunctionTypeAlias functionTypeAlias); 349 R visitFunctionTypeAlias(FunctionTypeAlias functionTypeAlias);
350
302 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node); 351 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node);
352
303 R visitHideCombinator(HideCombinator node); 353 R visitHideCombinator(HideCombinator node);
354
304 R visitIfStatement(IfStatement node); 355 R visitIfStatement(IfStatement node);
356
305 R visitImplementsClause(ImplementsClause node); 357 R visitImplementsClause(ImplementsClause node);
358
306 R visitImportDirective(ImportDirective node); 359 R visitImportDirective(ImportDirective node);
360
307 R visitIndexExpression(IndexExpression node); 361 R visitIndexExpression(IndexExpression node);
362
308 R visitInstanceCreationExpression(InstanceCreationExpression node); 363 R visitInstanceCreationExpression(InstanceCreationExpression node);
364
309 R visitIntegerLiteral(IntegerLiteral node); 365 R visitIntegerLiteral(IntegerLiteral node);
366
310 R visitInterpolationExpression(InterpolationExpression node); 367 R visitInterpolationExpression(InterpolationExpression node);
368
311 R visitInterpolationString(InterpolationString node); 369 R visitInterpolationString(InterpolationString node);
370
312 R visitIsExpression(IsExpression node); 371 R visitIsExpression(IsExpression node);
372
313 R visitLabel(Label node); 373 R visitLabel(Label node);
374
314 R visitLabeledStatement(LabeledStatement node); 375 R visitLabeledStatement(LabeledStatement node);
376
315 R visitLibraryDirective(LibraryDirective node); 377 R visitLibraryDirective(LibraryDirective node);
378
316 R visitLibraryIdentifier(LibraryIdentifier node); 379 R visitLibraryIdentifier(LibraryIdentifier node);
380
317 R visitListLiteral(ListLiteral node); 381 R visitListLiteral(ListLiteral node);
382
318 R visitMapLiteral(MapLiteral node); 383 R visitMapLiteral(MapLiteral node);
384
319 R visitMapLiteralEntry(MapLiteralEntry node); 385 R visitMapLiteralEntry(MapLiteralEntry node);
386
320 R visitMethodDeclaration(MethodDeclaration node); 387 R visitMethodDeclaration(MethodDeclaration node);
388
321 R visitMethodInvocation(MethodInvocation node); 389 R visitMethodInvocation(MethodInvocation node);
390
322 R visitNamedExpression(NamedExpression node); 391 R visitNamedExpression(NamedExpression node);
392
323 R visitNativeClause(NativeClause node); 393 R visitNativeClause(NativeClause node);
394
324 R visitNativeFunctionBody(NativeFunctionBody node); 395 R visitNativeFunctionBody(NativeFunctionBody node);
396
325 R visitNullLiteral(NullLiteral node); 397 R visitNullLiteral(NullLiteral node);
398
326 R visitParenthesizedExpression(ParenthesizedExpression node); 399 R visitParenthesizedExpression(ParenthesizedExpression node);
400
327 R visitPartDirective(PartDirective node); 401 R visitPartDirective(PartDirective node);
402
328 R visitPartOfDirective(PartOfDirective node); 403 R visitPartOfDirective(PartOfDirective node);
404
329 R visitPostfixExpression(PostfixExpression node); 405 R visitPostfixExpression(PostfixExpression node);
406
330 R visitPrefixedIdentifier(PrefixedIdentifier node); 407 R visitPrefixedIdentifier(PrefixedIdentifier node);
408
331 R visitPrefixExpression(PrefixExpression node); 409 R visitPrefixExpression(PrefixExpression node);
410
332 R visitPropertyAccess(PropertyAccess node); 411 R visitPropertyAccess(PropertyAccess node);
412
333 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) ; 413 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) ;
414
334 R visitRethrowExpression(RethrowExpression node); 415 R visitRethrowExpression(RethrowExpression node);
416
335 R visitReturnStatement(ReturnStatement node); 417 R visitReturnStatement(ReturnStatement node);
418
336 R visitScriptTag(ScriptTag node); 419 R visitScriptTag(ScriptTag node);
420
337 R visitShowCombinator(ShowCombinator node); 421 R visitShowCombinator(ShowCombinator node);
422
338 R visitSimpleFormalParameter(SimpleFormalParameter node); 423 R visitSimpleFormalParameter(SimpleFormalParameter node);
424
339 R visitSimpleIdentifier(SimpleIdentifier node); 425 R visitSimpleIdentifier(SimpleIdentifier node);
426
340 R visitSimpleStringLiteral(SimpleStringLiteral node); 427 R visitSimpleStringLiteral(SimpleStringLiteral node);
428
341 R visitStringInterpolation(StringInterpolation node); 429 R visitStringInterpolation(StringInterpolation node);
430
342 R visitSuperConstructorInvocation(SuperConstructorInvocation node); 431 R visitSuperConstructorInvocation(SuperConstructorInvocation node);
432
343 R visitSuperExpression(SuperExpression node); 433 R visitSuperExpression(SuperExpression node);
434
344 R visitSwitchCase(SwitchCase node); 435 R visitSwitchCase(SwitchCase node);
436
345 R visitSwitchDefault(SwitchDefault node); 437 R visitSwitchDefault(SwitchDefault node);
438
346 R visitSwitchStatement(SwitchStatement node); 439 R visitSwitchStatement(SwitchStatement node);
440
347 R visitSymbolLiteral(SymbolLiteral node); 441 R visitSymbolLiteral(SymbolLiteral node);
442
348 R visitThisExpression(ThisExpression node); 443 R visitThisExpression(ThisExpression node);
444
349 R visitThrowExpression(ThrowExpression node); 445 R visitThrowExpression(ThrowExpression node);
446
350 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node); 447 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node);
448
351 R visitTryStatement(TryStatement node); 449 R visitTryStatement(TryStatement node);
450
352 R visitTypeArgumentList(TypeArgumentList node); 451 R visitTypeArgumentList(TypeArgumentList node);
452
353 R visitTypeName(TypeName node); 453 R visitTypeName(TypeName node);
454
354 R visitTypeParameter(TypeParameter node); 455 R visitTypeParameter(TypeParameter node);
456
355 R visitTypeParameterList(TypeParameterList node); 457 R visitTypeParameterList(TypeParameterList node);
458
356 R visitVariableDeclaration(VariableDeclaration node); 459 R visitVariableDeclaration(VariableDeclaration node);
460
357 R visitVariableDeclarationList(VariableDeclarationList node); 461 R visitVariableDeclarationList(VariableDeclarationList node);
462
358 R visitVariableDeclarationStatement(VariableDeclarationStatement node); 463 R visitVariableDeclarationStatement(VariableDeclarationStatement node);
464
359 R visitWhileStatement(WhileStatement node); 465 R visitWhileStatement(WhileStatement node);
466
360 R visitWithClause(WithClause node); 467 R visitWithClause(WithClause node);
361 } 468 }
469
362 /** 470 /**
363 * Instances of the class `AdjacentStrings` represents two or more string litera ls that are 471 * Instances of the class `AdjacentStrings` represents two or more string litera ls that are
364 * implicitly concatenated because of being adjacent (separated only by whitespa ce). 472 * implicitly concatenated because of being adjacent (separated only by whitespa ce).
365 * 473 *
366 * While the grammar only allows adjacent strings when all of the strings are of the same kind 474 * While the grammar only allows adjacent strings when all of the strings are of the same kind
367 * (single line or multi-line), this class doesn't enforce that restriction. 475 * (single line or multi-line), this class doesn't enforce that restriction.
368 * 476 *
369 * <pre> 477 * <pre>
370 * adjacentStrings ::= 478 * adjacentStrings ::=
371 * [StringLiteral] [StringLiteral]+ 479 * [StringLiteral] [StringLiteral]+
372 * </pre> 480 * </pre>
373 * 481 *
374 * @coverage dart.engine.ast 482 * @coverage dart.engine.ast
375 */ 483 */
376 class AdjacentStrings extends StringLiteral { 484 class AdjacentStrings extends StringLiteral {
377
378 /** 485 /**
379 * The strings that are implicitly concatenated. 486 * The strings that are implicitly concatenated.
380 */ 487 */
381 NodeList<StringLiteral> strings; 488 NodeList<StringLiteral> strings;
382 489
383 /** 490 /**
384 * Initialize a newly created list of adjacent strings. 491 * Initialize a newly created list of adjacent strings.
385 * 492 *
386 * @param strings the strings that are implicitly concatenated 493 * @param strings the strings that are implicitly concatenated
387 */ 494 */
388 AdjacentStrings.full(List<StringLiteral> strings) { 495 AdjacentStrings.full(List<StringLiteral> strings) {
389 this.strings = new NodeList<StringLiteral>(this); 496 this.strings = new NodeList<StringLiteral>(this);
390 this.strings.addAll(strings); 497 this.strings.addAll(strings);
391 } 498 }
392 499
393 /** 500 /**
394 * Initialize a newly created list of adjacent strings. 501 * Initialize a newly created list of adjacent strings.
395 * 502 *
396 * @param strings the strings that are implicitly concatenated 503 * @param strings the strings that are implicitly concatenated
397 */ 504 */
398 AdjacentStrings({List<StringLiteral> strings}) : this.full(strings); 505 AdjacentStrings({List<StringLiteral> strings}) : this.full(strings);
506
399 accept(ASTVisitor visitor) => visitor.visitAdjacentStrings(this); 507 accept(ASTVisitor visitor) => visitor.visitAdjacentStrings(this);
508
400 Token get beginToken => strings.beginToken; 509 Token get beginToken => strings.beginToken;
510
401 Token get endToken => strings.endToken; 511 Token get endToken => strings.endToken;
512
402 void visitChildren(ASTVisitor visitor) { 513 void visitChildren(ASTVisitor visitor) {
403 strings.accept(visitor); 514 strings.accept(visitor);
404 } 515 }
516
405 void appendStringValue(JavaStringBuilder builder) { 517 void appendStringValue(JavaStringBuilder builder) {
406 for (StringLiteral stringLiteral in strings) { 518 for (StringLiteral stringLiteral in strings) {
407 stringLiteral.appendStringValue(builder); 519 stringLiteral.appendStringValue(builder);
408 } 520 }
409 } 521 }
410 } 522 }
523
411 /** 524 /**
412 * The abstract class `AnnotatedNode` defines the behavior of nodes that can be annotated with 525 * The abstract class `AnnotatedNode` defines the behavior of nodes that can be annotated with
413 * both a comment and metadata. 526 * both a comment and metadata.
414 * 527 *
415 * @coverage dart.engine.ast 528 * @coverage dart.engine.ast
416 */ 529 */
417 abstract class AnnotatedNode extends ASTNode { 530 abstract class AnnotatedNode extends ASTNode {
418
419 /** 531 /**
420 * The documentation comment associated with this node, or `null` if this node does not have 532 * The documentation comment associated with this node, or `null` if this node does not have
421 * a documentation comment associated with it. 533 * a documentation comment associated with it.
422 */ 534 */
423 Comment _comment; 535 Comment _comment;
424 536
425 /** 537 /**
426 * The annotations associated with this node. 538 * The annotations associated with this node.
427 */ 539 */
428 NodeList<Annotation> _metadata; 540 NodeList<Annotation> _metadata;
(...skipping 10 matching lines...) Expand all
439 this._metadata.addAll(metadata); 551 this._metadata.addAll(metadata);
440 } 552 }
441 553
442 /** 554 /**
443 * Initialize a newly created node. 555 * Initialize a newly created node.
444 * 556 *
445 * @param comment the documentation comment associated with this node 557 * @param comment the documentation comment associated with this node
446 * @param metadata the annotations associated with this node 558 * @param metadata the annotations associated with this node
447 */ 559 */
448 AnnotatedNode({Comment comment, List<Annotation> metadata}) : this.full(commen t, metadata); 560 AnnotatedNode({Comment comment, List<Annotation> metadata}) : this.full(commen t, metadata);
561
449 Token get beginToken { 562 Token get beginToken {
450 if (_comment == null) { 563 if (_comment == null) {
451 if (_metadata.isEmpty) { 564 if (_metadata.isEmpty) {
452 return firstTokenAfterCommentAndMetadata; 565 return firstTokenAfterCommentAndMetadata;
453 } else { 566 } else {
454 return _metadata.beginToken; 567 return _metadata.beginToken;
455 } 568 }
456 } else if (_metadata.isEmpty) { 569 } else if (_metadata.isEmpty) {
457 return _comment.beginToken; 570 return _comment.beginToken;
458 } 571 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 603
491 /** 604 /**
492 * Set the metadata associated with this node to the given metadata. 605 * Set the metadata associated with this node to the given metadata.
493 * 606 *
494 * @param metadata the metadata to be associated with this node 607 * @param metadata the metadata to be associated with this node
495 */ 608 */
496 void set metadata(List<Annotation> metadata) { 609 void set metadata(List<Annotation> metadata) {
497 this._metadata.clear(); 610 this._metadata.clear();
498 this._metadata.addAll(metadata); 611 this._metadata.addAll(metadata);
499 } 612 }
613
500 void visitChildren(ASTVisitor visitor) { 614 void visitChildren(ASTVisitor visitor) {
501 if (commentIsBeforeAnnotations()) { 615 if (commentIsBeforeAnnotations()) {
502 safelyVisitChild(_comment, visitor); 616 safelyVisitChild(_comment, visitor);
503 _metadata.accept(visitor); 617 _metadata.accept(visitor);
504 } else { 618 } else {
505 for (ASTNode child in sortedCommentAndAnnotations) { 619 for (ASTNode child in sortedCommentAndAnnotations) {
506 child.accept(visitor); 620 child.accept(visitor);
507 } 621 }
508 } 622 }
509 } 623 }
(...skipping 27 matching lines...) Expand all
537 */ 651 */
538 List<ASTNode> get sortedCommentAndAnnotations { 652 List<ASTNode> get sortedCommentAndAnnotations {
539 List<ASTNode> childList = new List<ASTNode>(); 653 List<ASTNode> childList = new List<ASTNode>();
540 childList.add(_comment); 654 childList.add(_comment);
541 childList.addAll(_metadata); 655 childList.addAll(_metadata);
542 List<ASTNode> children = new List.from(childList); 656 List<ASTNode> children = new List.from(childList);
543 children.sort(ASTNode.LEXICAL_ORDER); 657 children.sort(ASTNode.LEXICAL_ORDER);
544 return children; 658 return children;
545 } 659 }
546 } 660 }
661
547 /** 662 /**
548 * Instances of the class `Annotation` represent an annotation that can be assoc iated with an 663 * Instances of the class `Annotation` represent an annotation that can be assoc iated with an
549 * AST node. 664 * AST node.
550 * 665 *
551 * <pre> 666 * <pre>
552 * metadata ::= 667 * metadata ::=
553 * annotation* 668 * annotation*
554 * 669 *
555 * annotation ::= 670 * annotation ::=
556 * '@' [Identifier] ('.' [SimpleIdentifier])? [ArgumentList]? 671 * '@' [Identifier] ('.' [SimpleIdentifier])? [ArgumentList]?
557 * </pre> 672 * </pre>
558 * 673 *
559 * @coverage dart.engine.ast 674 * @coverage dart.engine.ast
560 */ 675 */
561 class Annotation extends ASTNode { 676 class Annotation extends ASTNode {
562
563 /** 677 /**
564 * The at sign that introduced the annotation. 678 * The at sign that introduced the annotation.
565 */ 679 */
566 Token atSign; 680 Token atSign;
567 681
568 /** 682 /**
569 * The name of the class defining the constructor that is being invoked or the name of the field 683 * The name of the class defining the constructor that is being invoked or the name of the field
570 * that is being referenced. 684 * that is being referenced.
571 */ 685 */
572 Identifier _name; 686 Identifier _name;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 * @param name the name of the class defining the constructor that is being in voked or the name of 737 * @param name the name of the class defining the constructor that is being in voked or the name of
624 * the field that is being referenced 738 * the field that is being referenced
625 * @param period the period before the constructor name, or `null` if this ann otation is not 739 * @param period the period before the constructor name, or `null` if this ann otation is not
626 * the invocation of a named constructor 740 * the invocation of a named constructor
627 * @param constructorName the name of the constructor being invoked, or `null` if this 741 * @param constructorName the name of the constructor being invoked, or `null` if this
628 * annotation is not the invocation of a named constructor 742 * annotation is not the invocation of a named constructor
629 * @param arguments the arguments to the constructor being invoked, or `null` if this 743 * @param arguments the arguments to the constructor being invoked, or `null` if this
630 * annotation is not the invocation of a constructor 744 * annotation is not the invocation of a constructor
631 */ 745 */
632 Annotation({Token atSign, Identifier name, Token period, SimpleIdentifier cons tructorName, ArgumentList arguments}) : this.full(atSign, name, period, construc torName, arguments); 746 Annotation({Token atSign, Identifier name, Token period, SimpleIdentifier cons tructorName, ArgumentList arguments}) : this.full(atSign, name, period, construc torName, arguments);
747
633 accept(ASTVisitor visitor) => visitor.visitAnnotation(this); 748 accept(ASTVisitor visitor) => visitor.visitAnnotation(this);
634 749
635 /** 750 /**
636 * Return the arguments to the constructor being invoked, or `null` if this an notation is 751 * Return the arguments to the constructor being invoked, or `null` if this an notation is
637 * not the invocation of a constructor. 752 * not the invocation of a constructor.
638 * 753 *
639 * @return the arguments to the constructor being invoked 754 * @return the arguments to the constructor being invoked
640 */ 755 */
641 ArgumentList get arguments => _arguments; 756 ArgumentList get arguments => _arguments;
757
642 Token get beginToken => atSign; 758 Token get beginToken => atSign;
643 759
644 /** 760 /**
645 * Return the name of the constructor being invoked, or `null` if this annotat ion is not the 761 * Return the name of the constructor being invoked, or `null` if this annotat ion is not the
646 * invocation of a named constructor. 762 * invocation of a named constructor.
647 * 763 *
648 * @return the name of the constructor being invoked 764 * @return the name of the constructor being invoked
649 */ 765 */
650 SimpleIdentifier get constructorName => _constructorName; 766 SimpleIdentifier get constructorName => _constructorName;
651 767
652 /** 768 /**
653 * Return the element associated with this annotation, or `null` if the AST st ructure has 769 * Return the element associated with this annotation, or `null` if the AST st ructure has
654 * not been resolved or if this annotation could not be resolved. 770 * not been resolved or if this annotation could not be resolved.
655 * 771 *
656 * @return the element associated with this annotation 772 * @return the element associated with this annotation
657 */ 773 */
658 Element get element { 774 Element get element {
659 if (_element != null) { 775 if (_element != null) {
660 return _element; 776 return _element;
661 } 777 }
662 if (_name != null) { 778 if (_name != null) {
663 return _name.staticElement; 779 return _name.staticElement;
664 } 780 }
665 return null; 781 return null;
666 } 782 }
783
667 Token get endToken { 784 Token get endToken {
668 if (_arguments != null) { 785 if (_arguments != null) {
669 return _arguments.endToken; 786 return _arguments.endToken;
670 } else if (_constructorName != null) { 787 } else if (_constructorName != null) {
671 return _constructorName.endToken; 788 return _constructorName.endToken;
672 } 789 }
673 return _name.endToken; 790 return _name.endToken;
674 } 791 }
675 792
676 /** 793 /**
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 827
711 /** 828 /**
712 * Set the name of the class defining the constructor that is being invoked or the name of the 829 * Set the name of the class defining the constructor that is being invoked or the name of the
713 * field that is being referenced to the given name. 830 * field that is being referenced to the given name.
714 * 831 *
715 * @param name the name of the constructor being invoked or the name of the fi eld being referenced 832 * @param name the name of the constructor being invoked or the name of the fi eld being referenced
716 */ 833 */
717 void set name(Identifier name) { 834 void set name(Identifier name) {
718 this._name = becomeParentOf(name); 835 this._name = becomeParentOf(name);
719 } 836 }
837
720 void visitChildren(ASTVisitor visitor) { 838 void visitChildren(ASTVisitor visitor) {
721 safelyVisitChild(_name, visitor); 839 safelyVisitChild(_name, visitor);
722 safelyVisitChild(_constructorName, visitor); 840 safelyVisitChild(_constructorName, visitor);
723 safelyVisitChild(_arguments, visitor); 841 safelyVisitChild(_arguments, visitor);
724 } 842 }
725 } 843 }
844
726 /** 845 /**
727 * Instances of the class `ArgumentDefinitionTest` represent an argument definit ion test. 846 * Instances of the class `ArgumentDefinitionTest` represent an argument definit ion test.
728 * 847 *
729 * <pre> 848 * <pre>
730 * argumentDefinitionTest ::= 849 * argumentDefinitionTest ::=
731 * '?' [SimpleIdentifier] 850 * '?' [SimpleIdentifier]
732 * </pre> 851 * </pre>
733 * 852 *
734 * @coverage dart.engine.ast 853 * @coverage dart.engine.ast
735 */ 854 */
736 class ArgumentDefinitionTest extends Expression { 855 class ArgumentDefinitionTest extends Expression {
737
738 /** 856 /**
739 * The token representing the question mark. 857 * The token representing the question mark.
740 */ 858 */
741 Token question; 859 Token question;
742 860
743 /** 861 /**
744 * The identifier representing the argument being tested. 862 * The identifier representing the argument being tested.
745 */ 863 */
746 SimpleIdentifier _identifier; 864 SimpleIdentifier _identifier;
747 865
748 /** 866 /**
749 * Initialize a newly created argument definition test. 867 * Initialize a newly created argument definition test.
750 * 868 *
751 * @param question the token representing the question mark 869 * @param question the token representing the question mark
752 * @param identifier the identifier representing the argument being tested 870 * @param identifier the identifier representing the argument being tested
753 */ 871 */
754 ArgumentDefinitionTest.full(Token question, SimpleIdentifier identifier) { 872 ArgumentDefinitionTest.full(Token question, SimpleIdentifier identifier) {
755 this.question = question; 873 this.question = question;
756 this._identifier = becomeParentOf(identifier); 874 this._identifier = becomeParentOf(identifier);
757 } 875 }
758 876
759 /** 877 /**
760 * Initialize a newly created argument definition test. 878 * Initialize a newly created argument definition test.
761 * 879 *
762 * @param question the token representing the question mark 880 * @param question the token representing the question mark
763 * @param identifier the identifier representing the argument being tested 881 * @param identifier the identifier representing the argument being tested
764 */ 882 */
765 ArgumentDefinitionTest({Token question, SimpleIdentifier identifier}) : this.f ull(question, identifier); 883 ArgumentDefinitionTest({Token question, SimpleIdentifier identifier}) : this.f ull(question, identifier);
884
766 accept(ASTVisitor visitor) => visitor.visitArgumentDefinitionTest(this); 885 accept(ASTVisitor visitor) => visitor.visitArgumentDefinitionTest(this);
886
767 Token get beginToken => question; 887 Token get beginToken => question;
888
768 Token get endToken => _identifier.endToken; 889 Token get endToken => _identifier.endToken;
769 890
770 /** 891 /**
771 * Return the identifier representing the argument being tested. 892 * Return the identifier representing the argument being tested.
772 * 893 *
773 * @return the identifier representing the argument being tested 894 * @return the identifier representing the argument being tested
774 */ 895 */
775 SimpleIdentifier get identifier => _identifier; 896 SimpleIdentifier get identifier => _identifier;
776 897
777 /** 898 /**
778 * Set the identifier representing the argument being tested to the given iden tifier. 899 * Set the identifier representing the argument being tested to the given iden tifier.
779 * 900 *
780 * @param identifier the identifier representing the argument being tested 901 * @param identifier the identifier representing the argument being tested
781 */ 902 */
782 void set identifier(SimpleIdentifier identifier) { 903 void set identifier(SimpleIdentifier identifier) {
783 this._identifier = becomeParentOf(identifier); 904 this._identifier = becomeParentOf(identifier);
784 } 905 }
906
785 void visitChildren(ASTVisitor visitor) { 907 void visitChildren(ASTVisitor visitor) {
786 safelyVisitChild(_identifier, visitor); 908 safelyVisitChild(_identifier, visitor);
787 } 909 }
788 } 910 }
911
789 /** 912 /**
790 * Instances of the class `ArgumentList` represent a list of arguments in the in vocation of a 913 * Instances of the class `ArgumentList` represent a list of arguments in the in vocation of a
791 * executable element: a function, method, or constructor. 914 * executable element: a function, method, or constructor.
792 * 915 *
793 * <pre> 916 * <pre>
794 * argumentList ::= 917 * argumentList ::=
795 * '(' arguments? ')' 918 * '(' arguments? ')'
796 * 919 *
797 * arguments ::= 920 * arguments ::=
798 * [NamedExpression] (',' [NamedExpression])* 921 * [NamedExpression] (',' [NamedExpression])*
799 * | [Expression] (',' [NamedExpression])* 922 * | [Expression] (',' [NamedExpression])*
800 * </pre> 923 * </pre>
801 * 924 *
802 * @coverage dart.engine.ast 925 * @coverage dart.engine.ast
803 */ 926 */
804 class ArgumentList extends ASTNode { 927 class ArgumentList extends ASTNode {
805
806 /** 928 /**
807 * The left parenthesis. 929 * The left parenthesis.
808 */ 930 */
809 Token _leftParenthesis; 931 Token _leftParenthesis;
810 932
811 /** 933 /**
812 * The expressions producing the values of the arguments. 934 * The expressions producing the values of the arguments.
813 */ 935 */
814 NodeList<Expression> arguments; 936 NodeList<Expression> arguments;
815 937
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 } 973 }
852 974
853 /** 975 /**
854 * Initialize a newly created list of arguments. 976 * Initialize a newly created list of arguments.
855 * 977 *
856 * @param leftParenthesis the left parenthesis 978 * @param leftParenthesis the left parenthesis
857 * @param arguments the expressions producing the values of the arguments 979 * @param arguments the expressions producing the values of the arguments
858 * @param rightParenthesis the right parenthesis 980 * @param rightParenthesis the right parenthesis
859 */ 981 */
860 ArgumentList({Token leftParenthesis, List<Expression> arguments, Token rightPa renthesis}) : this.full(leftParenthesis, arguments, rightParenthesis); 982 ArgumentList({Token leftParenthesis, List<Expression> arguments, Token rightPa renthesis}) : this.full(leftParenthesis, arguments, rightParenthesis);
983
861 accept(ASTVisitor visitor) => visitor.visitArgumentList(this); 984 accept(ASTVisitor visitor) => visitor.visitArgumentList(this);
985
862 Token get beginToken => _leftParenthesis; 986 Token get beginToken => _leftParenthesis;
987
863 Token get endToken => _rightParenthesis; 988 Token get endToken => _rightParenthesis;
864 989
865 /** 990 /**
866 * Return the left parenthesis. 991 * Return the left parenthesis.
867 * 992 *
868 * @return the left parenthesis 993 * @return the left parenthesis
869 */ 994 */
870 Token get leftParenthesis => _leftParenthesis; 995 Token get leftParenthesis => _leftParenthesis;
871 996
872 /** 997 /**
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 } 1041 }
917 1042
918 /** 1043 /**
919 * Set the right parenthesis to the given token. 1044 * Set the right parenthesis to the given token.
920 * 1045 *
921 * @param parenthesis the right parenthesis 1046 * @param parenthesis the right parenthesis
922 */ 1047 */
923 void set rightParenthesis(Token parenthesis) { 1048 void set rightParenthesis(Token parenthesis) {
924 _rightParenthesis = parenthesis; 1049 _rightParenthesis = parenthesis;
925 } 1050 }
1051
926 void visitChildren(ASTVisitor visitor) { 1052 void visitChildren(ASTVisitor visitor) {
927 arguments.accept(visitor); 1053 arguments.accept(visitor);
928 } 1054 }
929 1055
930 /** 1056 /**
931 * If the given expression is a child of this list, and the AST structure has been resolved, and 1057 * If the given expression is a child of this list, and the AST structure has been resolved, and
932 * the function being invoked is known based on propagated type information, a nd the expression 1058 * the function being invoked is known based on propagated type information, a nd the expression
933 * corresponds to one of the parameters of the function being invoked, then re turn the parameter 1059 * corresponds to one of the parameters of the function being invoked, then re turn the parameter
934 * element representing the parameter to which the value of the given expressi on will be bound. 1060 * element representing the parameter to which the value of the given expressi on will be bound.
935 * Otherwise, return `null`. 1061 * Otherwise, return `null`.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 if (_correspondingStaticParameters == null) { 1094 if (_correspondingStaticParameters == null) {
969 return null; 1095 return null;
970 } 1096 }
971 int index = arguments.indexOf(expression); 1097 int index = arguments.indexOf(expression);
972 if (index < 0) { 1098 if (index < 0) {
973 return null; 1099 return null;
974 } 1100 }
975 return _correspondingStaticParameters[index]; 1101 return _correspondingStaticParameters[index];
976 } 1102 }
977 } 1103 }
1104
978 /** 1105 /**
979 * Instances of the class `AsExpression` represent an 'as' expression. 1106 * Instances of the class `AsExpression` represent an 'as' expression.
980 * 1107 *
981 * <pre> 1108 * <pre>
982 * asExpression ::= 1109 * asExpression ::=
983 * [Expression] 'as' [TypeName] 1110 * [Expression] 'as' [TypeName]
984 * </pre> 1111 * </pre>
985 * 1112 *
986 * @coverage dart.engine.ast 1113 * @coverage dart.engine.ast
987 */ 1114 */
988 class AsExpression extends Expression { 1115 class AsExpression extends Expression {
989
990 /** 1116 /**
991 * The expression used to compute the value being cast. 1117 * The expression used to compute the value being cast.
992 */ 1118 */
993 Expression _expression; 1119 Expression _expression;
994 1120
995 /** 1121 /**
996 * The as operator. 1122 * The as operator.
997 */ 1123 */
998 Token asOperator; 1124 Token asOperator;
999 1125
(...skipping 16 matching lines...) Expand all
1016 } 1142 }
1017 1143
1018 /** 1144 /**
1019 * Initialize a newly created as expression. 1145 * Initialize a newly created as expression.
1020 * 1146 *
1021 * @param expression the expression used to compute the value being cast 1147 * @param expression the expression used to compute the value being cast
1022 * @param isOperator the is operator 1148 * @param isOperator the is operator
1023 * @param type the name of the type being cast to 1149 * @param type the name of the type being cast to
1024 */ 1150 */
1025 AsExpression({Expression expression, Token isOperator, TypeName type}) : this. full(expression, isOperator, type); 1151 AsExpression({Expression expression, Token isOperator, TypeName type}) : this. full(expression, isOperator, type);
1152
1026 accept(ASTVisitor visitor) => visitor.visitAsExpression(this); 1153 accept(ASTVisitor visitor) => visitor.visitAsExpression(this);
1154
1027 Token get beginToken => _expression.beginToken; 1155 Token get beginToken => _expression.beginToken;
1156
1028 Token get endToken => _type.endToken; 1157 Token get endToken => _type.endToken;
1029 1158
1030 /** 1159 /**
1031 * Return the expression used to compute the value being cast. 1160 * Return the expression used to compute the value being cast.
1032 * 1161 *
1033 * @return the expression used to compute the value being cast 1162 * @return the expression used to compute the value being cast
1034 */ 1163 */
1035 Expression get expression => _expression; 1164 Expression get expression => _expression;
1036 1165
1037 /** 1166 /**
(...skipping 13 matching lines...) Expand all
1051 } 1180 }
1052 1181
1053 /** 1182 /**
1054 * Set the name of the type being cast to to the given name. 1183 * Set the name of the type being cast to to the given name.
1055 * 1184 *
1056 * @param name the name of the type being cast to 1185 * @param name the name of the type being cast to
1057 */ 1186 */
1058 void set type(TypeName name) { 1187 void set type(TypeName name) {
1059 this._type = becomeParentOf(name); 1188 this._type = becomeParentOf(name);
1060 } 1189 }
1190
1061 void visitChildren(ASTVisitor visitor) { 1191 void visitChildren(ASTVisitor visitor) {
1062 safelyVisitChild(_expression, visitor); 1192 safelyVisitChild(_expression, visitor);
1063 safelyVisitChild(_type, visitor); 1193 safelyVisitChild(_type, visitor);
1064 } 1194 }
1065 } 1195 }
1196
1066 /** 1197 /**
1067 * Instances of the class `AssertStatement` represent an assert statement. 1198 * Instances of the class `AssertStatement` represent an assert statement.
1068 * 1199 *
1069 * <pre> 1200 * <pre>
1070 * assertStatement ::= 1201 * assertStatement ::=
1071 * 'assert' '(' [Expression] ')' ';' 1202 * 'assert' '(' [Expression] ')' ';'
1072 * </pre> 1203 * </pre>
1073 * 1204 *
1074 * @coverage dart.engine.ast 1205 * @coverage dart.engine.ast
1075 */ 1206 */
1076 class AssertStatement extends Statement { 1207 class AssertStatement extends Statement {
1077
1078 /** 1208 /**
1079 * The token representing the 'assert' keyword. 1209 * The token representing the 'assert' keyword.
1080 */ 1210 */
1081 Token keyword; 1211 Token keyword;
1082 1212
1083 /** 1213 /**
1084 * The left parenthesis. 1214 * The left parenthesis.
1085 */ 1215 */
1086 Token leftParenthesis; 1216 Token leftParenthesis;
1087 1217
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 /** 1250 /**
1121 * Initialize a newly created assert statement. 1251 * Initialize a newly created assert statement.
1122 * 1252 *
1123 * @param keyword the token representing the 'assert' keyword 1253 * @param keyword the token representing the 'assert' keyword
1124 * @param leftParenthesis the left parenthesis 1254 * @param leftParenthesis the left parenthesis
1125 * @param condition the condition that is being asserted to be `true` 1255 * @param condition the condition that is being asserted to be `true`
1126 * @param rightParenthesis the right parenthesis 1256 * @param rightParenthesis the right parenthesis
1127 * @param semicolon the semicolon terminating the statement 1257 * @param semicolon the semicolon terminating the statement
1128 */ 1258 */
1129 AssertStatement({Token keyword, Token leftParenthesis, Expression condition, T oken rightParenthesis, Token semicolon}) : this.full(keyword, leftParenthesis, c ondition, rightParenthesis, semicolon); 1259 AssertStatement({Token keyword, Token leftParenthesis, Expression condition, T oken rightParenthesis, Token semicolon}) : this.full(keyword, leftParenthesis, c ondition, rightParenthesis, semicolon);
1260
1130 accept(ASTVisitor visitor) => visitor.visitAssertStatement(this); 1261 accept(ASTVisitor visitor) => visitor.visitAssertStatement(this);
1262
1131 Token get beginToken => keyword; 1263 Token get beginToken => keyword;
1132 1264
1133 /** 1265 /**
1134 * Return the condition that is being asserted to be `true`. 1266 * Return the condition that is being asserted to be `true`.
1135 * 1267 *
1136 * @return the condition that is being asserted to be `true` 1268 * @return the condition that is being asserted to be `true`
1137 */ 1269 */
1138 Expression get condition => _condition; 1270 Expression get condition => _condition;
1271
1139 Token get endToken => semicolon; 1272 Token get endToken => semicolon;
1140 1273
1141 /** 1274 /**
1142 * Set the condition that is being asserted to be `true` to the given expressi on. 1275 * Set the condition that is being asserted to be `true` to the given expressi on.
1143 * 1276 *
1144 * @param the condition that is being asserted to be `true` 1277 * @param the condition that is being asserted to be `true`
1145 */ 1278 */
1146 void set condition(Expression condition) { 1279 void set condition(Expression condition) {
1147 this._condition = becomeParentOf(condition); 1280 this._condition = becomeParentOf(condition);
1148 } 1281 }
1282
1149 void visitChildren(ASTVisitor visitor) { 1283 void visitChildren(ASTVisitor visitor) {
1150 safelyVisitChild(_condition, visitor); 1284 safelyVisitChild(_condition, visitor);
1151 } 1285 }
1152 } 1286 }
1287
1153 /** 1288 /**
1154 * Instances of the class `AssignmentExpression` represent an assignment express ion. 1289 * Instances of the class `AssignmentExpression` represent an assignment express ion.
1155 * 1290 *
1156 * <pre> 1291 * <pre>
1157 * assignmentExpression ::= 1292 * assignmentExpression ::=
1158 * [Expression] [Token] [Expression] 1293 * [Expression] [Token] [Expression]
1159 * </pre> 1294 * </pre>
1160 * 1295 *
1161 * @coverage dart.engine.ast 1296 * @coverage dart.engine.ast
1162 */ 1297 */
1163 class AssignmentExpression extends Expression { 1298 class AssignmentExpression extends Expression {
1164
1165 /** 1299 /**
1166 * The expression used to compute the left hand side. 1300 * The expression used to compute the left hand side.
1167 */ 1301 */
1168 Expression _leftHandSide; 1302 Expression _leftHandSide;
1169 1303
1170 /** 1304 /**
1171 * The assignment operator being applied. 1305 * The assignment operator being applied.
1172 */ 1306 */
1173 Token operator; 1307 Token operator;
1174 1308
(...skipping 30 matching lines...) Expand all
1205 } 1339 }
1206 1340
1207 /** 1341 /**
1208 * Initialize a newly created assignment expression. 1342 * Initialize a newly created assignment expression.
1209 * 1343 *
1210 * @param leftHandSide the expression used to compute the left hand side 1344 * @param leftHandSide the expression used to compute the left hand side
1211 * @param operator the assignment operator being applied 1345 * @param operator the assignment operator being applied
1212 * @param rightHandSide the expression used to compute the right hand side 1346 * @param rightHandSide the expression used to compute the right hand side
1213 */ 1347 */
1214 AssignmentExpression({Expression leftHandSide, Token operator, Expression righ tHandSide}) : this.full(leftHandSide, operator, rightHandSide); 1348 AssignmentExpression({Expression leftHandSide, Token operator, Expression righ tHandSide}) : this.full(leftHandSide, operator, rightHandSide);
1349
1215 accept(ASTVisitor visitor) => visitor.visitAssignmentExpression(this); 1350 accept(ASTVisitor visitor) => visitor.visitAssignmentExpression(this);
1351
1216 Token get beginToken => _leftHandSide.beginToken; 1352 Token get beginToken => _leftHandSide.beginToken;
1217 1353
1218 /** 1354 /**
1219 * Return the best element available for this operator. If resolution was able to find a better 1355 * Return the best element available for this operator. If resolution was able to find a better
1220 * element based on type propagation, that element will be returned. Otherwise , the element found 1356 * element based on type propagation, that element will be returned. Otherwise , the element found
1221 * using the result of static analysis will be returned. If resolution has not been performed, 1357 * using the result of static analysis will be returned. If resolution has not been performed,
1222 * then `null` will be returned. 1358 * then `null` will be returned.
1223 * 1359 *
1224 * @return the best element available for this operator 1360 * @return the best element available for this operator
1225 */ 1361 */
1226 MethodElement get bestElement { 1362 MethodElement get bestElement {
1227 MethodElement element = propagatedElement; 1363 MethodElement element = propagatedElement;
1228 if (element == null) { 1364 if (element == null) {
1229 element = staticElement; 1365 element = staticElement;
1230 } 1366 }
1231 return element; 1367 return element;
1232 } 1368 }
1369
1233 Token get endToken => _rightHandSide.endToken; 1370 Token get endToken => _rightHandSide.endToken;
1234 1371
1235 /** 1372 /**
1236 * Set the expression used to compute the left hand side to the given expressi on. 1373 * Set the expression used to compute the left hand side to the given expressi on.
1237 * 1374 *
1238 * @return the expression used to compute the left hand side 1375 * @return the expression used to compute the left hand side
1239 */ 1376 */
1240 Expression get leftHandSide => _leftHandSide; 1377 Expression get leftHandSide => _leftHandSide;
1241 1378
1242 /** 1379 /**
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 1433
1297 /** 1434 /**
1298 * Set the element associated with the operator based on the static type of th e left-hand-side to 1435 * Set the element associated with the operator based on the static type of th e left-hand-side to
1299 * the given element. 1436 * the given element.
1300 * 1437 *
1301 * @param element the static element to be associated with the operator 1438 * @param element the static element to be associated with the operator
1302 */ 1439 */
1303 void set staticElement(MethodElement element) { 1440 void set staticElement(MethodElement element) {
1304 _staticElement = element; 1441 _staticElement = element;
1305 } 1442 }
1443
1306 void visitChildren(ASTVisitor visitor) { 1444 void visitChildren(ASTVisitor visitor) {
1307 safelyVisitChild(_leftHandSide, visitor); 1445 safelyVisitChild(_leftHandSide, visitor);
1308 safelyVisitChild(_rightHandSide, visitor); 1446 safelyVisitChild(_rightHandSide, visitor);
1309 } 1447 }
1310 1448
1311 /** 1449 /**
1312 * If the AST structure has been resolved, and the function being invoked is k nown based on 1450 * If the AST structure has been resolved, and the function being invoked is k nown based on
1313 * propagated type information, then return the parameter element representing the parameter to 1451 * propagated type information, then return the parameter element representing the parameter to
1314 * which the value of the right operand will be bound. Otherwise, return `null `. 1452 * which the value of the right operand will be bound. Otherwise, return `null `.
1315 * 1453 *
(...skipping 27 matching lines...) Expand all
1343 if (_staticElement == null) { 1481 if (_staticElement == null) {
1344 return null; 1482 return null;
1345 } 1483 }
1346 List<ParameterElement> parameters = _staticElement.parameters; 1484 List<ParameterElement> parameters = _staticElement.parameters;
1347 if (parameters.length < 1) { 1485 if (parameters.length < 1) {
1348 return null; 1486 return null;
1349 } 1487 }
1350 return parameters[0]; 1488 return parameters[0];
1351 } 1489 }
1352 } 1490 }
1491
1353 /** 1492 /**
1354 * Instances of the class `BinaryExpression` represent a binary (infix) expressi on. 1493 * Instances of the class `BinaryExpression` represent a binary (infix) expressi on.
1355 * 1494 *
1356 * <pre> 1495 * <pre>
1357 * binaryExpression ::= 1496 * binaryExpression ::=
1358 * [Expression] [Token] [Expression] 1497 * [Expression] [Token] [Expression]
1359 * </pre> 1498 * </pre>
1360 * 1499 *
1361 * @coverage dart.engine.ast 1500 * @coverage dart.engine.ast
1362 */ 1501 */
1363 class BinaryExpression extends Expression { 1502 class BinaryExpression extends Expression {
1364
1365 /** 1503 /**
1366 * The expression used to compute the left operand. 1504 * The expression used to compute the left operand.
1367 */ 1505 */
1368 Expression _leftOperand; 1506 Expression _leftOperand;
1369 1507
1370 /** 1508 /**
1371 * The binary operator being applied. 1509 * The binary operator being applied.
1372 */ 1510 */
1373 Token operator; 1511 Token operator;
1374 1512
(...skipping 30 matching lines...) Expand all
1405 } 1543 }
1406 1544
1407 /** 1545 /**
1408 * Initialize a newly created binary expression. 1546 * Initialize a newly created binary expression.
1409 * 1547 *
1410 * @param leftOperand the expression used to compute the left operand 1548 * @param leftOperand the expression used to compute the left operand
1411 * @param operator the binary operator being applied 1549 * @param operator the binary operator being applied
1412 * @param rightOperand the expression used to compute the right operand 1550 * @param rightOperand the expression used to compute the right operand
1413 */ 1551 */
1414 BinaryExpression({Expression leftOperand, Token operator, Expression rightOper and}) : this.full(leftOperand, operator, rightOperand); 1552 BinaryExpression({Expression leftOperand, Token operator, Expression rightOper and}) : this.full(leftOperand, operator, rightOperand);
1553
1415 accept(ASTVisitor visitor) => visitor.visitBinaryExpression(this); 1554 accept(ASTVisitor visitor) => visitor.visitBinaryExpression(this);
1555
1416 Token get beginToken => _leftOperand.beginToken; 1556 Token get beginToken => _leftOperand.beginToken;
1417 1557
1418 /** 1558 /**
1419 * Return the best element available for this operator. If resolution was able to find a better 1559 * Return the best element available for this operator. If resolution was able to find a better
1420 * element based on type propagation, that element will be returned. Otherwise , the element found 1560 * element based on type propagation, that element will be returned. Otherwise , the element found
1421 * using the result of static analysis will be returned. If resolution has not been performed, 1561 * using the result of static analysis will be returned. If resolution has not been performed,
1422 * then `null` will be returned. 1562 * then `null` will be returned.
1423 * 1563 *
1424 * @return the best element available for this operator 1564 * @return the best element available for this operator
1425 */ 1565 */
1426 MethodElement get bestElement { 1566 MethodElement get bestElement {
1427 MethodElement element = propagatedElement; 1567 MethodElement element = propagatedElement;
1428 if (element == null) { 1568 if (element == null) {
1429 element = staticElement; 1569 element = staticElement;
1430 } 1570 }
1431 return element; 1571 return element;
1432 } 1572 }
1573
1433 Token get endToken => _rightOperand.endToken; 1574 Token get endToken => _rightOperand.endToken;
1434 1575
1435 /** 1576 /**
1436 * Return the expression used to compute the left operand. 1577 * Return the expression used to compute the left operand.
1437 * 1578 *
1438 * @return the expression used to compute the left operand 1579 * @return the expression used to compute the left operand
1439 */ 1580 */
1440 Expression get leftOperand => _leftOperand; 1581 Expression get leftOperand => _leftOperand;
1441 1582
1442 /** 1583 /**
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 1637
1497 /** 1638 /**
1498 * Set the element associated with the operator based on the static type of th e left operand to 1639 * Set the element associated with the operator based on the static type of th e left operand to
1499 * the given element. 1640 * the given element.
1500 * 1641 *
1501 * @param element the static element to be associated with the operator 1642 * @param element the static element to be associated with the operator
1502 */ 1643 */
1503 void set staticElement(MethodElement element) { 1644 void set staticElement(MethodElement element) {
1504 _staticElement = element; 1645 _staticElement = element;
1505 } 1646 }
1647
1506 void visitChildren(ASTVisitor visitor) { 1648 void visitChildren(ASTVisitor visitor) {
1507 safelyVisitChild(_leftOperand, visitor); 1649 safelyVisitChild(_leftOperand, visitor);
1508 safelyVisitChild(_rightOperand, visitor); 1650 safelyVisitChild(_rightOperand, visitor);
1509 } 1651 }
1510 1652
1511 /** 1653 /**
1512 * If the AST structure has been resolved, and the function being invoked is k nown based on 1654 * If the AST structure has been resolved, and the function being invoked is k nown based on
1513 * propagated type information, then return the parameter element representing the parameter to 1655 * propagated type information, then return the parameter element representing the parameter to
1514 * which the value of the right operand will be bound. Otherwise, return `null `. 1656 * which the value of the right operand will be bound. Otherwise, return `null `.
1515 * 1657 *
(...skipping 27 matching lines...) Expand all
1543 if (_staticElement == null) { 1685 if (_staticElement == null) {
1544 return null; 1686 return null;
1545 } 1687 }
1546 List<ParameterElement> parameters = _staticElement.parameters; 1688 List<ParameterElement> parameters = _staticElement.parameters;
1547 if (parameters.length < 1) { 1689 if (parameters.length < 1) {
1548 return null; 1690 return null;
1549 } 1691 }
1550 return parameters[0]; 1692 return parameters[0];
1551 } 1693 }
1552 } 1694 }
1695
1553 /** 1696 /**
1554 * Instances of the class `Block` represent a sequence of statements. 1697 * Instances of the class `Block` represent a sequence of statements.
1555 * 1698 *
1556 * <pre> 1699 * <pre>
1557 * block ::= 1700 * block ::=
1558 * '{' statement* '}' 1701 * '{' statement* '}'
1559 * </pre> 1702 * </pre>
1560 * 1703 *
1561 * @coverage dart.engine.ast 1704 * @coverage dart.engine.ast
1562 */ 1705 */
1563 class Block extends Statement { 1706 class Block extends Statement {
1564
1565 /** 1707 /**
1566 * The left curly bracket. 1708 * The left curly bracket.
1567 */ 1709 */
1568 Token leftBracket; 1710 Token leftBracket;
1569 1711
1570 /** 1712 /**
1571 * The statements contained in the block. 1713 * The statements contained in the block.
1572 */ 1714 */
1573 NodeList<Statement> statements; 1715 NodeList<Statement> statements;
1574 1716
(...skipping 17 matching lines...) Expand all
1592 } 1734 }
1593 1735
1594 /** 1736 /**
1595 * Initialize a newly created block of code. 1737 * Initialize a newly created block of code.
1596 * 1738 *
1597 * @param leftBracket the left curly bracket 1739 * @param leftBracket the left curly bracket
1598 * @param statements the statements contained in the block 1740 * @param statements the statements contained in the block
1599 * @param rightBracket the right curly bracket 1741 * @param rightBracket the right curly bracket
1600 */ 1742 */
1601 Block({Token leftBracket, List<Statement> statements, Token rightBracket}) : t his.full(leftBracket, statements, rightBracket); 1743 Block({Token leftBracket, List<Statement> statements, Token rightBracket}) : t his.full(leftBracket, statements, rightBracket);
1744
1602 accept(ASTVisitor visitor) => visitor.visitBlock(this); 1745 accept(ASTVisitor visitor) => visitor.visitBlock(this);
1746
1603 Token get beginToken => leftBracket; 1747 Token get beginToken => leftBracket;
1748
1604 Token get endToken => rightBracket; 1749 Token get endToken => rightBracket;
1750
1605 void visitChildren(ASTVisitor visitor) { 1751 void visitChildren(ASTVisitor visitor) {
1606 statements.accept(visitor); 1752 statements.accept(visitor);
1607 } 1753 }
1608 } 1754 }
1755
1609 /** 1756 /**
1610 * Instances of the class `BlockFunctionBody` represent a function body that con sists of a 1757 * Instances of the class `BlockFunctionBody` represent a function body that con sists of a
1611 * block of statements. 1758 * block of statements.
1612 * 1759 *
1613 * <pre> 1760 * <pre>
1614 * blockFunctionBody ::= 1761 * blockFunctionBody ::=
1615 * [Block] 1762 * [Block]
1616 * </pre> 1763 * </pre>
1617 * 1764 *
1618 * @coverage dart.engine.ast 1765 * @coverage dart.engine.ast
1619 */ 1766 */
1620 class BlockFunctionBody extends FunctionBody { 1767 class BlockFunctionBody extends FunctionBody {
1621
1622 /** 1768 /**
1623 * The block representing the body of the function. 1769 * The block representing the body of the function.
1624 */ 1770 */
1625 Block _block; 1771 Block _block;
1626 1772
1627 /** 1773 /**
1628 * Initialize a newly created function body consisting of a block of statement s. 1774 * Initialize a newly created function body consisting of a block of statement s.
1629 * 1775 *
1630 * @param block the block representing the body of the function 1776 * @param block the block representing the body of the function
1631 */ 1777 */
1632 BlockFunctionBody.full(Block block) { 1778 BlockFunctionBody.full(Block block) {
1633 this._block = becomeParentOf(block); 1779 this._block = becomeParentOf(block);
1634 } 1780 }
1635 1781
1636 /** 1782 /**
1637 * Initialize a newly created function body consisting of a block of statement s. 1783 * Initialize a newly created function body consisting of a block of statement s.
1638 * 1784 *
1639 * @param block the block representing the body of the function 1785 * @param block the block representing the body of the function
1640 */ 1786 */
1641 BlockFunctionBody({Block block}) : this.full(block); 1787 BlockFunctionBody({Block block}) : this.full(block);
1788
1642 accept(ASTVisitor visitor) => visitor.visitBlockFunctionBody(this); 1789 accept(ASTVisitor visitor) => visitor.visitBlockFunctionBody(this);
1790
1643 Token get beginToken => _block.beginToken; 1791 Token get beginToken => _block.beginToken;
1644 1792
1645 /** 1793 /**
1646 * Return the block representing the body of the function. 1794 * Return the block representing the body of the function.
1647 * 1795 *
1648 * @return the block representing the body of the function 1796 * @return the block representing the body of the function
1649 */ 1797 */
1650 Block get block => _block; 1798 Block get block => _block;
1799
1651 Token get endToken => _block.endToken; 1800 Token get endToken => _block.endToken;
1652 1801
1653 /** 1802 /**
1654 * Set the block representing the body of the function to the given block. 1803 * Set the block representing the body of the function to the given block.
1655 * 1804 *
1656 * @param block the block representing the body of the function 1805 * @param block the block representing the body of the function
1657 */ 1806 */
1658 void set block(Block block) { 1807 void set block(Block block) {
1659 this._block = becomeParentOf(block); 1808 this._block = becomeParentOf(block);
1660 } 1809 }
1810
1661 void visitChildren(ASTVisitor visitor) { 1811 void visitChildren(ASTVisitor visitor) {
1662 safelyVisitChild(_block, visitor); 1812 safelyVisitChild(_block, visitor);
1663 } 1813 }
1664 } 1814 }
1815
1665 /** 1816 /**
1666 * Instances of the class `BooleanLiteral` represent a boolean literal expressio n. 1817 * Instances of the class `BooleanLiteral` represent a boolean literal expressio n.
1667 * 1818 *
1668 * <pre> 1819 * <pre>
1669 * booleanLiteral ::= 1820 * booleanLiteral ::=
1670 * 'false' | 'true' 1821 * 'false' | 'true'
1671 * </pre> 1822 * </pre>
1672 * 1823 *
1673 * @coverage dart.engine.ast 1824 * @coverage dart.engine.ast
1674 */ 1825 */
1675 class BooleanLiteral extends Literal { 1826 class BooleanLiteral extends Literal {
1676
1677 /** 1827 /**
1678 * The token representing the literal. 1828 * The token representing the literal.
1679 */ 1829 */
1680 Token literal; 1830 Token literal;
1681 1831
1682 /** 1832 /**
1683 * The value of the literal. 1833 * The value of the literal.
1684 */ 1834 */
1685 bool value = false; 1835 bool value = false;
1686 1836
1687 /** 1837 /**
1688 * Initialize a newly created boolean literal. 1838 * Initialize a newly created boolean literal.
1689 * 1839 *
1690 * @param literal the token representing the literal 1840 * @param literal the token representing the literal
1691 * @param value the value of the literal 1841 * @param value the value of the literal
1692 */ 1842 */
1693 BooleanLiteral.full(Token literal, bool value) { 1843 BooleanLiteral.full(Token literal, bool value) {
1694 this.literal = literal; 1844 this.literal = literal;
1695 this.value = value; 1845 this.value = value;
1696 } 1846 }
1697 1847
1698 /** 1848 /**
1699 * Initialize a newly created boolean literal. 1849 * Initialize a newly created boolean literal.
1700 * 1850 *
1701 * @param literal the token representing the literal 1851 * @param literal the token representing the literal
1702 * @param value the value of the literal 1852 * @param value the value of the literal
1703 */ 1853 */
1704 BooleanLiteral({Token literal, bool value}) : this.full(literal, value); 1854 BooleanLiteral({Token literal, bool value}) : this.full(literal, value);
1855
1705 accept(ASTVisitor visitor) => visitor.visitBooleanLiteral(this); 1856 accept(ASTVisitor visitor) => visitor.visitBooleanLiteral(this);
1857
1706 Token get beginToken => literal; 1858 Token get beginToken => literal;
1859
1707 Token get endToken => literal; 1860 Token get endToken => literal;
1861
1708 bool get isSynthetic => literal.isSynthetic; 1862 bool get isSynthetic => literal.isSynthetic;
1863
1709 void visitChildren(ASTVisitor visitor) { 1864 void visitChildren(ASTVisitor visitor) {
1710 } 1865 }
1711 } 1866 }
1867
1712 /** 1868 /**
1713 * Instances of the class `BreakStatement` represent a break statement. 1869 * Instances of the class `BreakStatement` represent a break statement.
1714 * 1870 *
1715 * <pre> 1871 * <pre>
1716 * breakStatement ::= 1872 * breakStatement ::=
1717 * 'break' [SimpleIdentifier]? ';' 1873 * 'break' [SimpleIdentifier]? ';'
1718 * </pre> 1874 * </pre>
1719 * 1875 *
1720 * @coverage dart.engine.ast 1876 * @coverage dart.engine.ast
1721 */ 1877 */
1722 class BreakStatement extends Statement { 1878 class BreakStatement extends Statement {
1723
1724 /** 1879 /**
1725 * The token representing the 'break' keyword. 1880 * The token representing the 'break' keyword.
1726 */ 1881 */
1727 Token keyword; 1882 Token keyword;
1728 1883
1729 /** 1884 /**
1730 * The label associated with the statement, or `null` if there is no label. 1885 * The label associated with the statement, or `null` if there is no label.
1731 */ 1886 */
1732 SimpleIdentifier _label; 1887 SimpleIdentifier _label;
1733 1888
(...skipping 16 matching lines...) Expand all
1750 } 1905 }
1751 1906
1752 /** 1907 /**
1753 * Initialize a newly created break statement. 1908 * Initialize a newly created break statement.
1754 * 1909 *
1755 * @param keyword the token representing the 'break' keyword 1910 * @param keyword the token representing the 'break' keyword
1756 * @param label the label associated with the statement 1911 * @param label the label associated with the statement
1757 * @param semicolon the semicolon terminating the statement 1912 * @param semicolon the semicolon terminating the statement
1758 */ 1913 */
1759 BreakStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : thi s.full(keyword, label, semicolon); 1914 BreakStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : thi s.full(keyword, label, semicolon);
1915
1760 accept(ASTVisitor visitor) => visitor.visitBreakStatement(this); 1916 accept(ASTVisitor visitor) => visitor.visitBreakStatement(this);
1917
1761 Token get beginToken => keyword; 1918 Token get beginToken => keyword;
1919
1762 Token get endToken => semicolon; 1920 Token get endToken => semicolon;
1763 1921
1764 /** 1922 /**
1765 * Return the label associated with the statement, or `null` if there is no la bel. 1923 * Return the label associated with the statement, or `null` if there is no la bel.
1766 * 1924 *
1767 * @return the label associated with the statement 1925 * @return the label associated with the statement
1768 */ 1926 */
1769 SimpleIdentifier get label => _label; 1927 SimpleIdentifier get label => _label;
1770 1928
1771 /** 1929 /**
1772 * Set the label associated with the statement to the given identifier. 1930 * Set the label associated with the statement to the given identifier.
1773 * 1931 *
1774 * @param identifier the label associated with the statement 1932 * @param identifier the label associated with the statement
1775 */ 1933 */
1776 void set label(SimpleIdentifier identifier) { 1934 void set label(SimpleIdentifier identifier) {
1777 _label = becomeParentOf(identifier); 1935 _label = becomeParentOf(identifier);
1778 } 1936 }
1937
1779 void visitChildren(ASTVisitor visitor) { 1938 void visitChildren(ASTVisitor visitor) {
1780 safelyVisitChild(_label, visitor); 1939 safelyVisitChild(_label, visitor);
1781 } 1940 }
1782 } 1941 }
1942
1783 /** 1943 /**
1784 * Instances of the class `CascadeExpression` represent a sequence of cascaded e xpressions: 1944 * Instances of the class `CascadeExpression` represent a sequence of cascaded e xpressions:
1785 * expressions that share a common target. There are three kinds of expressions that can be used in 1945 * expressions that share a common target. There are three kinds of expressions that can be used in
1786 * a cascade expression: [IndexExpression], [MethodInvocation] and 1946 * a cascade expression: [IndexExpression], [MethodInvocation] and
1787 * [PropertyAccess]. 1947 * [PropertyAccess].
1788 * 1948 *
1789 * <pre> 1949 * <pre>
1790 * cascadeExpression ::= 1950 * cascadeExpression ::=
1791 * [Expression] cascadeSection* 1951 * [Expression] cascadeSection*
1792 * 1952 *
1793 * cascadeSection ::= 1953 * cascadeSection ::=
1794 * '..' (cascadeSelector arguments*) (assignableSelector arguments*)* (assi gnmentOperator expressionWithoutCascade)? 1954 * '..' (cascadeSelector arguments*) (assignableSelector arguments*)* (assi gnmentOperator expressionWithoutCascade)?
1795 * 1955 *
1796 * cascadeSelector ::= 1956 * cascadeSelector ::=
1797 * '[ ' expression '] ' 1957 * '[ ' expression '] '
1798 * | identifier 1958 * | identifier
1799 * </pre> 1959 * </pre>
1800 * 1960 *
1801 * @coverage dart.engine.ast 1961 * @coverage dart.engine.ast
1802 */ 1962 */
1803 class CascadeExpression extends Expression { 1963 class CascadeExpression extends Expression {
1804
1805 /** 1964 /**
1806 * The target of the cascade sections. 1965 * The target of the cascade sections.
1807 */ 1966 */
1808 Expression _target; 1967 Expression _target;
1809 1968
1810 /** 1969 /**
1811 * The cascade sections sharing the common target. 1970 * The cascade sections sharing the common target.
1812 */ 1971 */
1813 NodeList<Expression> cascadeSections; 1972 NodeList<Expression> cascadeSections;
1814 1973
1815 /** 1974 /**
1816 * Initialize a newly created cascade expression. 1975 * Initialize a newly created cascade expression.
1817 * 1976 *
1818 * @param target the target of the cascade sections 1977 * @param target the target of the cascade sections
1819 * @param cascadeSections the cascade sections sharing the common target 1978 * @param cascadeSections the cascade sections sharing the common target
1820 */ 1979 */
1821 CascadeExpression.full(Expression target, List<Expression> cascadeSections) { 1980 CascadeExpression.full(Expression target, List<Expression> cascadeSections) {
1822 this.cascadeSections = new NodeList<Expression>(this); 1981 this.cascadeSections = new NodeList<Expression>(this);
1823 this._target = becomeParentOf(target); 1982 this._target = becomeParentOf(target);
1824 this.cascadeSections.addAll(cascadeSections); 1983 this.cascadeSections.addAll(cascadeSections);
1825 } 1984 }
1826 1985
1827 /** 1986 /**
1828 * Initialize a newly created cascade expression. 1987 * Initialize a newly created cascade expression.
1829 * 1988 *
1830 * @param target the target of the cascade sections 1989 * @param target the target of the cascade sections
1831 * @param cascadeSections the cascade sections sharing the common target 1990 * @param cascadeSections the cascade sections sharing the common target
1832 */ 1991 */
1833 CascadeExpression({Expression target, List<Expression> cascadeSections}) : thi s.full(target, cascadeSections); 1992 CascadeExpression({Expression target, List<Expression> cascadeSections}) : thi s.full(target, cascadeSections);
1993
1834 accept(ASTVisitor visitor) => visitor.visitCascadeExpression(this); 1994 accept(ASTVisitor visitor) => visitor.visitCascadeExpression(this);
1995
1835 Token get beginToken => _target.beginToken; 1996 Token get beginToken => _target.beginToken;
1997
1836 Token get endToken => cascadeSections.endToken; 1998 Token get endToken => cascadeSections.endToken;
1837 1999
1838 /** 2000 /**
1839 * Return the target of the cascade sections. 2001 * Return the target of the cascade sections.
1840 * 2002 *
1841 * @return the target of the cascade sections 2003 * @return the target of the cascade sections
1842 */ 2004 */
1843 Expression get target => _target; 2005 Expression get target => _target;
1844 2006
1845 /** 2007 /**
1846 * Set the target of the cascade sections to the given expression. 2008 * Set the target of the cascade sections to the given expression.
1847 * 2009 *
1848 * @param target the target of the cascade sections 2010 * @param target the target of the cascade sections
1849 */ 2011 */
1850 void set target(Expression target) { 2012 void set target(Expression target) {
1851 this._target = becomeParentOf(target); 2013 this._target = becomeParentOf(target);
1852 } 2014 }
2015
1853 void visitChildren(ASTVisitor visitor) { 2016 void visitChildren(ASTVisitor visitor) {
1854 safelyVisitChild(_target, visitor); 2017 safelyVisitChild(_target, visitor);
1855 cascadeSections.accept(visitor); 2018 cascadeSections.accept(visitor);
1856 } 2019 }
1857 } 2020 }
2021
1858 /** 2022 /**
1859 * Instances of the class `CatchClause` represent a catch clause within a try st atement. 2023 * Instances of the class `CatchClause` represent a catch clause within a try st atement.
1860 * 2024 *
1861 * <pre> 2025 * <pre>
1862 * onPart ::= 2026 * onPart ::=
1863 * catchPart [Block] 2027 * catchPart [Block]
1864 * | 'on' type catchPart? [Block] 2028 * | 'on' type catchPart? [Block]
1865 * 2029 *
1866 * catchPart ::= 2030 * catchPart ::=
1867 * 'catch' '(' [SimpleIdentifier] (',' [SimpleIdentifier])? ')' 2031 * 'catch' '(' [SimpleIdentifier] (',' [SimpleIdentifier])? ')'
1868 * </pre> 2032 * </pre>
1869 * 2033 *
1870 * @coverage dart.engine.ast 2034 * @coverage dart.engine.ast
1871 */ 2035 */
1872 class CatchClause extends ASTNode { 2036 class CatchClause extends ASTNode {
1873
1874 /** 2037 /**
1875 * The token representing the 'on' keyword, or `null` if there is no 'on' keyw ord. 2038 * The token representing the 'on' keyword, or `null` if there is no 'on' keyw ord.
1876 */ 2039 */
1877 Token onKeyword; 2040 Token onKeyword;
1878 2041
1879 /** 2042 /**
1880 * The type of exceptions caught by this catch clause, or `null` if this catch clause 2043 * The type of exceptions caught by this catch clause, or `null` if this catch clause
1881 * catches every type of exception. 2044 * catches every type of exception.
1882 */ 2045 */
1883 TypeName exceptionType; 2046 TypeName exceptionType;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 * @param exceptionType the type of exceptions caught by this catch clause 2114 * @param exceptionType the type of exceptions caught by this catch clause
1952 * @param leftParenthesis the left parenthesis 2115 * @param leftParenthesis the left parenthesis
1953 * @param exceptionParameter the parameter whose value will be the exception t hat was thrown 2116 * @param exceptionParameter the parameter whose value will be the exception t hat was thrown
1954 * @param comma the comma separating the exception parameter from the stack tr ace parameter 2117 * @param comma the comma separating the exception parameter from the stack tr ace parameter
1955 * @param stackTraceParameter the parameter whose value will be the stack trac e associated with 2118 * @param stackTraceParameter the parameter whose value will be the stack trac e associated with
1956 * the exception 2119 * the exception
1957 * @param rightParenthesis the right parenthesis 2120 * @param rightParenthesis the right parenthesis
1958 * @param body the body of the catch block 2121 * @param body the body of the catch block
1959 */ 2122 */
1960 CatchClause({Token onKeyword, TypeName exceptionType, Token catchKeyword, Toke n leftParenthesis, SimpleIdentifier exceptionParameter, Token comma, SimpleIdent ifier stackTraceParameter, Token rightParenthesis, Block body}) : this.full(onKe yword, exceptionType, catchKeyword, leftParenthesis, exceptionParameter, comma, stackTraceParameter, rightParenthesis, body); 2123 CatchClause({Token onKeyword, TypeName exceptionType, Token catchKeyword, Toke n leftParenthesis, SimpleIdentifier exceptionParameter, Token comma, SimpleIdent ifier stackTraceParameter, Token rightParenthesis, Block body}) : this.full(onKe yword, exceptionType, catchKeyword, leftParenthesis, exceptionParameter, comma, stackTraceParameter, rightParenthesis, body);
2124
1961 accept(ASTVisitor visitor) => visitor.visitCatchClause(this); 2125 accept(ASTVisitor visitor) => visitor.visitCatchClause(this);
2126
1962 Token get beginToken { 2127 Token get beginToken {
1963 if (onKeyword != null) { 2128 if (onKeyword != null) {
1964 return onKeyword; 2129 return onKeyword;
1965 } 2130 }
1966 return catchKeyword; 2131 return catchKeyword;
1967 } 2132 }
1968 2133
1969 /** 2134 /**
1970 * Return the body of the catch block. 2135 * Return the body of the catch block.
1971 * 2136 *
1972 * @return the body of the catch block 2137 * @return the body of the catch block
1973 */ 2138 */
1974 Block get body => _body; 2139 Block get body => _body;
2140
1975 Token get endToken => _body.endToken; 2141 Token get endToken => _body.endToken;
1976 2142
1977 /** 2143 /**
1978 * Return the parameter whose value will be the exception that was thrown. 2144 * Return the parameter whose value will be the exception that was thrown.
1979 * 2145 *
1980 * @return the parameter whose value will be the exception that was thrown 2146 * @return the parameter whose value will be the exception that was thrown
1981 */ 2147 */
1982 SimpleIdentifier get exceptionParameter => _exceptionParameter; 2148 SimpleIdentifier get exceptionParameter => _exceptionParameter;
1983 2149
1984 /** 2150 /**
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
2042 /** 2208 /**
2043 * Set the parameter whose value will be the stack trace associated with the e xception to the 2209 * Set the parameter whose value will be the stack trace associated with the e xception to the
2044 * given parameter. 2210 * given parameter.
2045 * 2211 *
2046 * @param parameter the parameter whose value will be the stack trace associat ed with the 2212 * @param parameter the parameter whose value will be the stack trace associat ed with the
2047 * exception 2213 * exception
2048 */ 2214 */
2049 void set stackTraceParameter(SimpleIdentifier parameter) { 2215 void set stackTraceParameter(SimpleIdentifier parameter) {
2050 _stackTraceParameter = becomeParentOf(parameter); 2216 _stackTraceParameter = becomeParentOf(parameter);
2051 } 2217 }
2218
2052 void visitChildren(ASTVisitor visitor) { 2219 void visitChildren(ASTVisitor visitor) {
2053 safelyVisitChild(exceptionType, visitor); 2220 safelyVisitChild(exceptionType, visitor);
2054 safelyVisitChild(_exceptionParameter, visitor); 2221 safelyVisitChild(_exceptionParameter, visitor);
2055 safelyVisitChild(_stackTraceParameter, visitor); 2222 safelyVisitChild(_stackTraceParameter, visitor);
2056 safelyVisitChild(_body, visitor); 2223 safelyVisitChild(_body, visitor);
2057 } 2224 }
2058 } 2225 }
2226
2059 /** 2227 /**
2060 * Instances of the class `ClassDeclaration` represent the declaration of a clas s. 2228 * Instances of the class `ClassDeclaration` represent the declaration of a clas s.
2061 * 2229 *
2062 * <pre> 2230 * <pre>
2063 * classDeclaration ::= 2231 * classDeclaration ::=
2064 * 'abstract'? 'class' [SimpleIdentifier] [TypeParameterList]? 2232 * 'abstract'? 'class' [SimpleIdentifier] [TypeParameterList]?
2065 * ([ExtendsClause] [WithClause]?)? 2233 * ([ExtendsClause] [WithClause]?)?
2066 * [ImplementsClause]? 2234 * [ImplementsClause]?
2067 * '{' [ClassMember]* '}' 2235 * '{' [ClassMember]* '}'
2068 * </pre> 2236 * </pre>
2069 * 2237 *
2070 * @coverage dart.engine.ast 2238 * @coverage dart.engine.ast
2071 */ 2239 */
2072 class ClassDeclaration extends CompilationUnitMember { 2240 class ClassDeclaration extends CompilationUnitMember {
2073
2074 /** 2241 /**
2075 * The 'abstract' keyword, or `null` if the keyword was absent. 2242 * The 'abstract' keyword, or `null` if the keyword was absent.
2076 */ 2243 */
2077 Token abstractKeyword; 2244 Token abstractKeyword;
2078 2245
2079 /** 2246 /**
2080 * The token representing the 'class' keyword. 2247 * The token representing the 'class' keyword.
2081 */ 2248 */
2082 Token classKeyword; 2249 Token classKeyword;
2083 2250
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
2168 * @param name the name of the class being declared 2335 * @param name the name of the class being declared
2169 * @param typeParameters the type parameters for the class 2336 * @param typeParameters the type parameters for the class
2170 * @param extendsClause the extends clause for the class 2337 * @param extendsClause the extends clause for the class
2171 * @param withClause the with clause for the class 2338 * @param withClause the with clause for the class
2172 * @param implementsClause the implements clause for the class 2339 * @param implementsClause the implements clause for the class
2173 * @param leftBracket the left curly bracket 2340 * @param leftBracket the left curly bracket
2174 * @param members the members defined by the class 2341 * @param members the members defined by the class
2175 * @param rightBracket the right curly bracket 2342 * @param rightBracket the right curly bracket
2176 */ 2343 */
2177 ClassDeclaration({Comment comment, List<Annotation> metadata, Token abstractKe yword, Token classKeyword, SimpleIdentifier name, TypeParameterList typeParamete rs, ExtendsClause extendsClause, WithClause withClause, ImplementsClause impleme ntsClause, Token leftBracket, List<ClassMember> members, Token rightBracket}) : this.full(comment, metadata, abstractKeyword, classKeyword, name, typeParameters , extendsClause, withClause, implementsClause, leftBracket, members, rightBracke t); 2344 ClassDeclaration({Comment comment, List<Annotation> metadata, Token abstractKe yword, Token classKeyword, SimpleIdentifier name, TypeParameterList typeParamete rs, ExtendsClause extendsClause, WithClause withClause, ImplementsClause impleme ntsClause, Token leftBracket, List<ClassMember> members, Token rightBracket}) : this.full(comment, metadata, abstractKeyword, classKeyword, name, typeParameters , extendsClause, withClause, implementsClause, leftBracket, members, rightBracke t);
2345
2178 accept(ASTVisitor visitor) => visitor.visitClassDeclaration(this); 2346 accept(ASTVisitor visitor) => visitor.visitClassDeclaration(this);
2347
2179 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme nt) : null; 2348 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme nt) : null;
2349
2180 Token get endToken => rightBracket; 2350 Token get endToken => rightBracket;
2181 2351
2182 /** 2352 /**
2183 * Return the extends clause for this class, or `null` if the class does not e xtend any 2353 * Return the extends clause for this class, or `null` if the class does not e xtend any
2184 * other class. 2354 * other class.
2185 * 2355 *
2186 * @return the extends clause for this class 2356 * @return the extends clause for this class
2187 */ 2357 */
2188 ExtendsClause get extendsClause => _extendsClause; 2358 ExtendsClause get extendsClause => _extendsClause;
2189 2359
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2237 } 2407 }
2238 2408
2239 /** 2409 /**
2240 * Set the with clause for the class to the given clause. 2410 * Set the with clause for the class to the given clause.
2241 * 2411 *
2242 * @param withClause the with clause for the class 2412 * @param withClause the with clause for the class
2243 */ 2413 */
2244 void set withClause(WithClause withClause) { 2414 void set withClause(WithClause withClause) {
2245 this._withClause = becomeParentOf(withClause); 2415 this._withClause = becomeParentOf(withClause);
2246 } 2416 }
2417
2247 void visitChildren(ASTVisitor visitor) { 2418 void visitChildren(ASTVisitor visitor) {
2248 super.visitChildren(visitor); 2419 super.visitChildren(visitor);
2249 safelyVisitChild(_name, visitor); 2420 safelyVisitChild(_name, visitor);
2250 safelyVisitChild(typeParameters, visitor); 2421 safelyVisitChild(typeParameters, visitor);
2251 safelyVisitChild(_extendsClause, visitor); 2422 safelyVisitChild(_extendsClause, visitor);
2252 safelyVisitChild(_withClause, visitor); 2423 safelyVisitChild(_withClause, visitor);
2253 safelyVisitChild(_implementsClause, visitor); 2424 safelyVisitChild(_implementsClause, visitor);
2254 safelyVisitChild(nativeClause, visitor); 2425 safelyVisitChild(nativeClause, visitor);
2255 members.accept(visitor); 2426 members.accept(visitor);
2256 } 2427 }
2428
2257 Token get firstTokenAfterCommentAndMetadata { 2429 Token get firstTokenAfterCommentAndMetadata {
2258 if (abstractKeyword != null) { 2430 if (abstractKeyword != null) {
2259 return abstractKeyword; 2431 return abstractKeyword;
2260 } 2432 }
2261 return classKeyword; 2433 return classKeyword;
2262 } 2434 }
2263 } 2435 }
2436
2264 /** 2437 /**
2265 * The abstract class `ClassMember` defines the behavior common to nodes that de clare a name 2438 * The abstract class `ClassMember` defines the behavior common to nodes that de clare a name
2266 * within the scope of a class. 2439 * within the scope of a class.
2267 * 2440 *
2268 * @coverage dart.engine.ast 2441 * @coverage dart.engine.ast
2269 */ 2442 */
2270 abstract class ClassMember extends Declaration { 2443 abstract class ClassMember extends Declaration {
2271
2272 /** 2444 /**
2273 * Initialize a newly created member of a class. 2445 * Initialize a newly created member of a class.
2274 * 2446 *
2275 * @param comment the documentation comment associated with this member 2447 * @param comment the documentation comment associated with this member
2276 * @param metadata the annotations associated with this member 2448 * @param metadata the annotations associated with this member
2277 */ 2449 */
2278 ClassMember.full(Comment comment, List<Annotation> metadata) : super.full(comm ent, metadata); 2450 ClassMember.full(Comment comment, List<Annotation> metadata) : super.full(comm ent, metadata);
2279 2451
2280 /** 2452 /**
2281 * Initialize a newly created member of a class. 2453 * Initialize a newly created member of a class.
2282 * 2454 *
2283 * @param comment the documentation comment associated with this member 2455 * @param comment the documentation comment associated with this member
2284 * @param metadata the annotations associated with this member 2456 * @param metadata the annotations associated with this member
2285 */ 2457 */
2286 ClassMember({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata); 2458 ClassMember({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata);
2287 } 2459 }
2460
2288 /** 2461 /**
2289 * Instances of the class `ClassTypeAlias` represent a class type alias. 2462 * Instances of the class `ClassTypeAlias` represent a class type alias.
2290 * 2463 *
2291 * <pre> 2464 * <pre>
2292 * classTypeAlias ::= 2465 * classTypeAlias ::=
2293 * [SimpleIdentifier] [TypeParameterList]? '=' 'abstract'? mixinApplication 2466 * [SimpleIdentifier] [TypeParameterList]? '=' 'abstract'? mixinApplication
2294 * 2467 *
2295 * mixinApplication ::= 2468 * mixinApplication ::=
2296 * [TypeName] [WithClause] [ImplementsClause]? ';' 2469 * [TypeName] [WithClause] [ImplementsClause]? ';'
2297 * </pre> 2470 * </pre>
2298 * 2471 *
2299 * @coverage dart.engine.ast 2472 * @coverage dart.engine.ast
2300 */ 2473 */
2301 class ClassTypeAlias extends TypeAlias { 2474 class ClassTypeAlias extends TypeAlias {
2302
2303 /** 2475 /**
2304 * The name of the class being declared. 2476 * The name of the class being declared.
2305 */ 2477 */
2306 SimpleIdentifier _name; 2478 SimpleIdentifier _name;
2307 2479
2308 /** 2480 /**
2309 * The type parameters for the class, or `null` if the class does not have any type 2481 * The type parameters for the class, or `null` if the class does not have any type
2310 * parameters. 2482 * parameters.
2311 */ 2483 */
2312 TypeParameterList _typeParameters; 2484 TypeParameterList _typeParameters;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
2371 * @param name the name of the class being declared 2543 * @param name the name of the class being declared
2372 * @param typeParameters the type parameters for the class 2544 * @param typeParameters the type parameters for the class
2373 * @param equals the token for the '=' separating the name from the definition 2545 * @param equals the token for the '=' separating the name from the definition
2374 * @param abstractKeyword the token for the 'abstract' keyword 2546 * @param abstractKeyword the token for the 'abstract' keyword
2375 * @param superclass the name of the superclass of the class being declared 2547 * @param superclass the name of the superclass of the class being declared
2376 * @param withClause the with clause for this class 2548 * @param withClause the with clause for this class
2377 * @param implementsClause the implements clause for this class 2549 * @param implementsClause the implements clause for this class
2378 * @param semicolon the semicolon terminating the declaration 2550 * @param semicolon the semicolon terminating the declaration
2379 */ 2551 */
2380 ClassTypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Sim pleIdentifier name, TypeParameterList typeParameters, Token equals, Token abstra ctKeyword, TypeName superclass, WithClause withClause, ImplementsClause implemen tsClause, Token semicolon}) : this.full(comment, metadata, keyword, name, typePa rameters, equals, abstractKeyword, superclass, withClause, implementsClause, sem icolon); 2552 ClassTypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Sim pleIdentifier name, TypeParameterList typeParameters, Token equals, Token abstra ctKeyword, TypeName superclass, WithClause withClause, ImplementsClause implemen tsClause, Token semicolon}) : this.full(comment, metadata, keyword, name, typePa rameters, equals, abstractKeyword, superclass, withClause, implementsClause, sem icolon);
2553
2381 accept(ASTVisitor visitor) => visitor.visitClassTypeAlias(this); 2554 accept(ASTVisitor visitor) => visitor.visitClassTypeAlias(this);
2555
2382 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme nt) : null; 2556 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme nt) : null;
2383 2557
2384 /** 2558 /**
2385 * Return the implements clause for this class, or `null` if there is no imple ments clause. 2559 * Return the implements clause for this class, or `null` if there is no imple ments clause.
2386 * 2560 *
2387 * @return the implements clause for this class 2561 * @return the implements clause for this class
2388 */ 2562 */
2389 ImplementsClause get implementsClause => _implementsClause; 2563 ImplementsClause get implementsClause => _implementsClause;
2390 2564
2391 /** 2565 /**
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
2454 } 2628 }
2455 2629
2456 /** 2630 /**
2457 * Set the with clause for this class to the given with clause. 2631 * Set the with clause for this class to the given with clause.
2458 * 2632 *
2459 * @param withClause the with clause for this class 2633 * @param withClause the with clause for this class
2460 */ 2634 */
2461 void set withClause(WithClause withClause) { 2635 void set withClause(WithClause withClause) {
2462 this._withClause = becomeParentOf(withClause); 2636 this._withClause = becomeParentOf(withClause);
2463 } 2637 }
2638
2464 void visitChildren(ASTVisitor visitor) { 2639 void visitChildren(ASTVisitor visitor) {
2465 super.visitChildren(visitor); 2640 super.visitChildren(visitor);
2466 safelyVisitChild(_name, visitor); 2641 safelyVisitChild(_name, visitor);
2467 safelyVisitChild(_typeParameters, visitor); 2642 safelyVisitChild(_typeParameters, visitor);
2468 safelyVisitChild(_superclass, visitor); 2643 safelyVisitChild(_superclass, visitor);
2469 safelyVisitChild(_withClause, visitor); 2644 safelyVisitChild(_withClause, visitor);
2470 safelyVisitChild(_implementsClause, visitor); 2645 safelyVisitChild(_implementsClause, visitor);
2471 } 2646 }
2472 } 2647 }
2648
2473 /** 2649 /**
2474 * Instances of the class `Combinator` represent the combinator associated with an import 2650 * Instances of the class `Combinator` represent the combinator associated with an import
2475 * directive. 2651 * directive.
2476 * 2652 *
2477 * <pre> 2653 * <pre>
2478 * combinator ::= 2654 * combinator ::=
2479 * [HideCombinator] 2655 * [HideCombinator]
2480 * | [ShowCombinator] 2656 * | [ShowCombinator]
2481 * </pre> 2657 * </pre>
2482 * 2658 *
2483 * @coverage dart.engine.ast 2659 * @coverage dart.engine.ast
2484 */ 2660 */
2485 abstract class Combinator extends ASTNode { 2661 abstract class Combinator extends ASTNode {
2486
2487 /** 2662 /**
2488 * The keyword specifying what kind of processing is to be done on the importe d names. 2663 * The keyword specifying what kind of processing is to be done on the importe d names.
2489 */ 2664 */
2490 Token keyword; 2665 Token keyword;
2491 2666
2492 /** 2667 /**
2493 * Initialize a newly created import combinator. 2668 * Initialize a newly created import combinator.
2494 * 2669 *
2495 * @param keyword the keyword specifying what kind of processing is to be done on the imported 2670 * @param keyword the keyword specifying what kind of processing is to be done on the imported
2496 * names 2671 * names
2497 */ 2672 */
2498 Combinator.full(Token keyword) { 2673 Combinator.full(Token keyword) {
2499 this.keyword = keyword; 2674 this.keyword = keyword;
2500 } 2675 }
2501 2676
2502 /** 2677 /**
2503 * Initialize a newly created import combinator. 2678 * Initialize a newly created import combinator.
2504 * 2679 *
2505 * @param keyword the keyword specifying what kind of processing is to be done on the imported 2680 * @param keyword the keyword specifying what kind of processing is to be done on the imported
2506 * names 2681 * names
2507 */ 2682 */
2508 Combinator({Token keyword}) : this.full(keyword); 2683 Combinator({Token keyword}) : this.full(keyword);
2684
2509 Token get beginToken => keyword; 2685 Token get beginToken => keyword;
2510 } 2686 }
2687
2511 /** 2688 /**
2512 * Instances of the class `Comment` represent a comment within the source code. 2689 * Instances of the class `Comment` represent a comment within the source code.
2513 * 2690 *
2514 * <pre> 2691 * <pre>
2515 * comment ::= 2692 * comment ::=
2516 * endOfLineComment 2693 * endOfLineComment
2517 * | blockComment 2694 * | blockComment
2518 * | documentationComment 2695 * | documentationComment
2519 * 2696 *
2520 * endOfLineComment ::= 2697 * endOfLineComment ::=
2521 * '//' (CHARACTER - EOL)* EOL 2698 * '//' (CHARACTER - EOL)* EOL
2522 * 2699 *
2523 * blockComment ::= 2700 * blockComment ::=
2524 * '/ *' CHARACTER* '&#42;/' 2701 * '/ *' CHARACTER* '&#42;/'
2525 * 2702 *
2526 * documentationComment ::= 2703 * documentationComment ::=
2527 * '/ **' (CHARACTER | [CommentReference])* '&#42;/' 2704 * '/ **' (CHARACTER | [CommentReference])* '&#42;/'
2528 * | ('///' (CHARACTER - EOL)* EOL)+ 2705 * | ('///' (CHARACTER - EOL)* EOL)+
2529 * </pre> 2706 * </pre>
2530 * 2707 *
2531 * @coverage dart.engine.ast 2708 * @coverage dart.engine.ast
2532 */ 2709 */
2533 class Comment extends ASTNode { 2710 class Comment extends ASTNode {
2534
2535 /** 2711 /**
2536 * Create a block comment. 2712 * Create a block comment.
2537 * 2713 *
2538 * @param tokens the tokens representing the comment 2714 * @param tokens the tokens representing the comment
2539 * @return the block comment that was created 2715 * @return the block comment that was created
2540 */ 2716 */
2541 static Comment createBlockComment(List<Token> tokens) => new Comment.full(toke ns, CommentType.BLOCK, null); 2717 static Comment createBlockComment(List<Token> tokens) => new Comment.full(toke ns, CommentType.BLOCK, null);
2542 2718
2543 /** 2719 /**
2544 * Create a documentation comment. 2720 * Create a documentation comment.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2596 } 2772 }
2597 2773
2598 /** 2774 /**
2599 * Initialize a newly created comment. 2775 * Initialize a newly created comment.
2600 * 2776 *
2601 * @param tokens the tokens representing the comment 2777 * @param tokens the tokens representing the comment
2602 * @param type the type of the comment 2778 * @param type the type of the comment
2603 * @param references the references embedded within the documentation comment 2779 * @param references the references embedded within the documentation comment
2604 */ 2780 */
2605 Comment({List<Token> tokens, CommentType type, List<CommentReference> referenc es}) : this.full(tokens, type, references); 2781 Comment({List<Token> tokens, CommentType type, List<CommentReference> referenc es}) : this.full(tokens, type, references);
2782
2606 accept(ASTVisitor visitor) => visitor.visitComment(this); 2783 accept(ASTVisitor visitor) => visitor.visitComment(this);
2784
2607 Token get beginToken => tokens[0]; 2785 Token get beginToken => tokens[0];
2786
2608 Token get endToken => tokens[tokens.length - 1]; 2787 Token get endToken => tokens[tokens.length - 1];
2609 2788
2610 /** 2789 /**
2611 * Return `true` if this is a block comment. 2790 * Return `true` if this is a block comment.
2612 * 2791 *
2613 * @return `true` if this is a block comment 2792 * @return `true` if this is a block comment
2614 */ 2793 */
2615 bool get isBlock => identical(_type, CommentType.BLOCK); 2794 bool get isBlock => identical(_type, CommentType.BLOCK);
2616 2795
2617 /** 2796 /**
2618 * Return `true` if this is a documentation comment. 2797 * Return `true` if this is a documentation comment.
2619 * 2798 *
2620 * @return `true` if this is a documentation comment 2799 * @return `true` if this is a documentation comment
2621 */ 2800 */
2622 bool get isDocumentation => identical(_type, CommentType.DOCUMENTATION); 2801 bool get isDocumentation => identical(_type, CommentType.DOCUMENTATION);
2623 2802
2624 /** 2803 /**
2625 * Return `true` if this is an end-of-line comment. 2804 * Return `true` if this is an end-of-line comment.
2626 * 2805 *
2627 * @return `true` if this is an end-of-line comment 2806 * @return `true` if this is an end-of-line comment
2628 */ 2807 */
2629 bool get isEndOfLine => identical(_type, CommentType.END_OF_LINE); 2808 bool get isEndOfLine => identical(_type, CommentType.END_OF_LINE);
2809
2630 void visitChildren(ASTVisitor visitor) { 2810 void visitChildren(ASTVisitor visitor) {
2631 references.accept(visitor); 2811 references.accept(visitor);
2632 } 2812 }
2633 } 2813 }
2814
2634 /** 2815 /**
2635 * The enumeration `CommentType` encodes all the different types of comments tha t are 2816 * The enumeration `CommentType` encodes all the different types of comments tha t are
2636 * recognized by the parser. 2817 * recognized by the parser.
2637 */ 2818 */
2638 class CommentType extends Enum<CommentType> { 2819 class CommentType extends Enum<CommentType> {
2639
2640 /** 2820 /**
2641 * An end-of-line comment. 2821 * An end-of-line comment.
2642 */ 2822 */
2643 static final CommentType END_OF_LINE = new CommentType('END_OF_LINE', 0); 2823 static final CommentType END_OF_LINE = new CommentType('END_OF_LINE', 0);
2644 2824
2645 /** 2825 /**
2646 * A block comment. 2826 * A block comment.
2647 */ 2827 */
2648 static final CommentType BLOCK = new CommentType('BLOCK', 1); 2828 static final CommentType BLOCK = new CommentType('BLOCK', 1);
2649 2829
2650 /** 2830 /**
2651 * A documentation comment. 2831 * A documentation comment.
2652 */ 2832 */
2653 static final CommentType DOCUMENTATION = new CommentType('DOCUMENTATION', 2); 2833 static final CommentType DOCUMENTATION = new CommentType('DOCUMENTATION', 2);
2834
2654 static final List<CommentType> values = [END_OF_LINE, BLOCK, DOCUMENTATION]; 2835 static final List<CommentType> values = [END_OF_LINE, BLOCK, DOCUMENTATION];
2836
2655 CommentType(String name, int ordinal) : super(name, ordinal); 2837 CommentType(String name, int ordinal) : super(name, ordinal);
2656 } 2838 }
2839
2657 /** 2840 /**
2658 * Instances of the class `CommentReference` represent a reference to a Dart ele ment that is 2841 * Instances of the class `CommentReference` represent a reference to a Dart ele ment that is
2659 * found within a documentation comment. 2842 * found within a documentation comment.
2660 * 2843 *
2661 * <pre> 2844 * <pre>
2662 * commentReference ::= 2845 * commentReference ::=
2663 * '[' 'new'? [Identifier] ']' 2846 * '[' 'new'? [Identifier] ']'
2664 * </pre> 2847 * </pre>
2665 * 2848 *
2666 * @coverage dart.engine.ast 2849 * @coverage dart.engine.ast
2667 */ 2850 */
2668 class CommentReference extends ASTNode { 2851 class CommentReference extends ASTNode {
2669
2670 /** 2852 /**
2671 * The token representing the 'new' keyword, or `null` if there was no 'new' k eyword. 2853 * The token representing the 'new' keyword, or `null` if there was no 'new' k eyword.
2672 */ 2854 */
2673 Token newKeyword; 2855 Token newKeyword;
2674 2856
2675 /** 2857 /**
2676 * The identifier being referenced. 2858 * The identifier being referenced.
2677 */ 2859 */
2678 Identifier _identifier; 2860 Identifier _identifier;
2679 2861
2680 /** 2862 /**
2681 * Initialize a newly created reference to a Dart element. 2863 * Initialize a newly created reference to a Dart element.
2682 * 2864 *
2683 * @param newKeyword the token representing the 'new' keyword 2865 * @param newKeyword the token representing the 'new' keyword
2684 * @param identifier the identifier being referenced 2866 * @param identifier the identifier being referenced
2685 */ 2867 */
2686 CommentReference.full(Token newKeyword, Identifier identifier) { 2868 CommentReference.full(Token newKeyword, Identifier identifier) {
2687 this.newKeyword = newKeyword; 2869 this.newKeyword = newKeyword;
2688 this._identifier = becomeParentOf(identifier); 2870 this._identifier = becomeParentOf(identifier);
2689 } 2871 }
2690 2872
2691 /** 2873 /**
2692 * Initialize a newly created reference to a Dart element. 2874 * Initialize a newly created reference to a Dart element.
2693 * 2875 *
2694 * @param newKeyword the token representing the 'new' keyword 2876 * @param newKeyword the token representing the 'new' keyword
2695 * @param identifier the identifier being referenced 2877 * @param identifier the identifier being referenced
2696 */ 2878 */
2697 CommentReference({Token newKeyword, Identifier identifier}) : this.full(newKey word, identifier); 2879 CommentReference({Token newKeyword, Identifier identifier}) : this.full(newKey word, identifier);
2880
2698 accept(ASTVisitor visitor) => visitor.visitCommentReference(this); 2881 accept(ASTVisitor visitor) => visitor.visitCommentReference(this);
2882
2699 Token get beginToken => _identifier.beginToken; 2883 Token get beginToken => _identifier.beginToken;
2884
2700 Token get endToken => _identifier.endToken; 2885 Token get endToken => _identifier.endToken;
2701 2886
2702 /** 2887 /**
2703 * Return the identifier being referenced. 2888 * Return the identifier being referenced.
2704 * 2889 *
2705 * @return the identifier being referenced 2890 * @return the identifier being referenced
2706 */ 2891 */
2707 Identifier get identifier => _identifier; 2892 Identifier get identifier => _identifier;
2708 2893
2709 /** 2894 /**
2710 * Set the identifier being referenced to the given identifier. 2895 * Set the identifier being referenced to the given identifier.
2711 * 2896 *
2712 * @param identifier the identifier being referenced 2897 * @param identifier the identifier being referenced
2713 */ 2898 */
2714 void set identifier(Identifier identifier) { 2899 void set identifier(Identifier identifier) {
2715 identifier = becomeParentOf(identifier); 2900 identifier = becomeParentOf(identifier);
2716 } 2901 }
2902
2717 void visitChildren(ASTVisitor visitor) { 2903 void visitChildren(ASTVisitor visitor) {
2718 safelyVisitChild(_identifier, visitor); 2904 safelyVisitChild(_identifier, visitor);
2719 } 2905 }
2720 } 2906 }
2907
2721 /** 2908 /**
2722 * Instances of the class `CompilationUnit` represent a compilation unit. 2909 * Instances of the class `CompilationUnit` represent a compilation unit.
2723 * 2910 *
2724 * While the grammar restricts the order of the directives and declarations with in a compilation 2911 * While the grammar restricts the order of the directives and declarations with in a compilation
2725 * unit, this class does not enforce those restrictions. In particular, the chil dren of a 2912 * unit, this class does not enforce those restrictions. In particular, the chil dren of a
2726 * compilation unit will be visited in lexical order even if lexical order does not conform to the 2913 * compilation unit will be visited in lexical order even if lexical order does not conform to the
2727 * restrictions of the grammar. 2914 * restrictions of the grammar.
2728 * 2915 *
2729 * <pre> 2916 * <pre>
2730 * compilationUnit ::= 2917 * compilationUnit ::=
2731 * directives declarations 2918 * directives declarations
2732 * 2919 *
2733 * directives ::= 2920 * directives ::=
2734 * [ScriptTag]? [LibraryDirective]? namespaceDirective* [PartDirective]* 2921 * [ScriptTag]? [LibraryDirective]? namespaceDirective* [PartDirective]*
2735 * | [PartOfDirective] 2922 * | [PartOfDirective]
2736 * 2923 *
2737 * namespaceDirective ::= 2924 * namespaceDirective ::=
2738 * [ImportDirective] 2925 * [ImportDirective]
2739 * | [ExportDirective] 2926 * | [ExportDirective]
2740 * 2927 *
2741 * declarations ::= 2928 * declarations ::=
2742 * [CompilationUnitMember]* 2929 * [CompilationUnitMember]*
2743 * </pre> 2930 * </pre>
2744 * 2931 *
2745 * @coverage dart.engine.ast 2932 * @coverage dart.engine.ast
2746 */ 2933 */
2747 class CompilationUnit extends ASTNode { 2934 class CompilationUnit extends ASTNode {
2748
2749 /** 2935 /**
2750 * The first token in the token stream that was parsed to form this compilatio n unit. 2936 * The first token in the token stream that was parsed to form this compilatio n unit.
2751 */ 2937 */
2752 Token _beginToken; 2938 Token _beginToken;
2753 2939
2754 /** 2940 /**
2755 * The script tag at the beginning of the compilation unit, or `null` if there is no script 2941 * The script tag at the beginning of the compilation unit, or `null` if there is no script
2756 * tag in this compilation unit. 2942 * tag in this compilation unit.
2757 */ 2943 */
2758 ScriptTag _scriptTag; 2944 ScriptTag _scriptTag;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2806 /** 2992 /**
2807 * Initialize a newly created compilation unit to have the given directives an d declarations. 2993 * Initialize a newly created compilation unit to have the given directives an d declarations.
2808 * 2994 *
2809 * @param beginToken the first token in the token stream 2995 * @param beginToken the first token in the token stream
2810 * @param scriptTag the script tag at the beginning of the compilation unit 2996 * @param scriptTag the script tag at the beginning of the compilation unit
2811 * @param directives the directives contained in this compilation unit 2997 * @param directives the directives contained in this compilation unit
2812 * @param declarations the declarations contained in this compilation unit 2998 * @param declarations the declarations contained in this compilation unit
2813 * @param endToken the last token in the token stream 2999 * @param endToken the last token in the token stream
2814 */ 3000 */
2815 CompilationUnit({Token beginToken, ScriptTag scriptTag, List<Directive> direct ives, List<CompilationUnitMember> declarations, Token endToken}) : this.full(beg inToken, scriptTag, directives, declarations, endToken); 3001 CompilationUnit({Token beginToken, ScriptTag scriptTag, List<Directive> direct ives, List<CompilationUnitMember> declarations, Token endToken}) : this.full(beg inToken, scriptTag, directives, declarations, endToken);
3002
2816 accept(ASTVisitor visitor) => visitor.visitCompilationUnit(this); 3003 accept(ASTVisitor visitor) => visitor.visitCompilationUnit(this);
3004
2817 Token get beginToken => _beginToken; 3005 Token get beginToken => _beginToken;
3006
2818 Token get endToken => _endToken; 3007 Token get endToken => _endToken;
3008
2819 int get length { 3009 int get length {
2820 Token endToken = this.endToken; 3010 Token endToken = this.endToken;
2821 if (endToken == null) { 3011 if (endToken == null) {
2822 return 0; 3012 return 0;
2823 } 3013 }
2824 return endToken.offset + endToken.length; 3014 return endToken.offset + endToken.length;
2825 } 3015 }
3016
2826 int get offset => 0; 3017 int get offset => 0;
2827 3018
2828 /** 3019 /**
2829 * Return the script tag at the beginning of the compilation unit, or `null` i f there is no 3020 * Return the script tag at the beginning of the compilation unit, or `null` i f there is no
2830 * script tag in this compilation unit. 3021 * script tag in this compilation unit.
2831 * 3022 *
2832 * @return the script tag at the beginning of the compilation unit 3023 * @return the script tag at the beginning of the compilation unit
2833 */ 3024 */
2834 ScriptTag get scriptTag => _scriptTag; 3025 ScriptTag get scriptTag => _scriptTag;
2835 3026
2836 /** 3027 /**
2837 * Set the script tag at the beginning of the compilation unit to the given sc ript tag. 3028 * Set the script tag at the beginning of the compilation unit to the given sc ript tag.
2838 * 3029 *
2839 * @param scriptTag the script tag at the beginning of the compilation unit 3030 * @param scriptTag the script tag at the beginning of the compilation unit
2840 */ 3031 */
2841 void set scriptTag(ScriptTag scriptTag) { 3032 void set scriptTag(ScriptTag scriptTag) {
2842 this._scriptTag = becomeParentOf(scriptTag); 3033 this._scriptTag = becomeParentOf(scriptTag);
2843 } 3034 }
3035
2844 void visitChildren(ASTVisitor visitor) { 3036 void visitChildren(ASTVisitor visitor) {
2845 safelyVisitChild(_scriptTag, visitor); 3037 safelyVisitChild(_scriptTag, visitor);
2846 if (directivesAreBeforeDeclarations()) { 3038 if (directivesAreBeforeDeclarations()) {
2847 directives.accept(visitor); 3039 directives.accept(visitor);
2848 declarations.accept(visitor); 3040 declarations.accept(visitor);
2849 } else { 3041 } else {
2850 for (ASTNode child in sortedDirectivesAndDeclarations) { 3042 for (ASTNode child in sortedDirectivesAndDeclarations) {
2851 child.accept(visitor); 3043 child.accept(visitor);
2852 } 3044 }
2853 } 3045 }
(...skipping 22 matching lines...) Expand all
2876 */ 3068 */
2877 List<ASTNode> get sortedDirectivesAndDeclarations { 3069 List<ASTNode> get sortedDirectivesAndDeclarations {
2878 List<ASTNode> childList = new List<ASTNode>(); 3070 List<ASTNode> childList = new List<ASTNode>();
2879 childList.addAll(directives); 3071 childList.addAll(directives);
2880 childList.addAll(declarations); 3072 childList.addAll(declarations);
2881 List<ASTNode> children = new List.from(childList); 3073 List<ASTNode> children = new List.from(childList);
2882 children.sort(ASTNode.LEXICAL_ORDER); 3074 children.sort(ASTNode.LEXICAL_ORDER);
2883 return children; 3075 return children;
2884 } 3076 }
2885 } 3077 }
3078
2886 /** 3079 /**
2887 * Instances of the class `CompilationUnitMember` defines the behavior common to nodes that 3080 * Instances of the class `CompilationUnitMember` defines the behavior common to nodes that
2888 * declare a name within the scope of a compilation unit. 3081 * declare a name within the scope of a compilation unit.
2889 * 3082 *
2890 * <pre> 3083 * <pre>
2891 * compilationUnitMember ::= 3084 * compilationUnitMember ::=
2892 * [ClassDeclaration] 3085 * [ClassDeclaration]
2893 * | [TypeAlias] 3086 * | [TypeAlias]
2894 * | [FunctionDeclaration] 3087 * | [FunctionDeclaration]
2895 * | [MethodDeclaration] 3088 * | [MethodDeclaration]
2896 * | [VariableDeclaration] 3089 * | [VariableDeclaration]
2897 * | [VariableDeclaration] 3090 * | [VariableDeclaration]
2898 * </pre> 3091 * </pre>
2899 * 3092 *
2900 * @coverage dart.engine.ast 3093 * @coverage dart.engine.ast
2901 */ 3094 */
2902 abstract class CompilationUnitMember extends Declaration { 3095 abstract class CompilationUnitMember extends Declaration {
2903
2904 /** 3096 /**
2905 * Initialize a newly created generic compilation unit member. 3097 * Initialize a newly created generic compilation unit member.
2906 * 3098 *
2907 * @param comment the documentation comment associated with this member 3099 * @param comment the documentation comment associated with this member
2908 * @param metadata the annotations associated with this member 3100 * @param metadata the annotations associated with this member
2909 */ 3101 */
2910 CompilationUnitMember.full(Comment comment, List<Annotation> metadata) : super .full(comment, metadata); 3102 CompilationUnitMember.full(Comment comment, List<Annotation> metadata) : super .full(comment, metadata);
2911 3103
2912 /** 3104 /**
2913 * Initialize a newly created generic compilation unit member. 3105 * Initialize a newly created generic compilation unit member.
2914 * 3106 *
2915 * @param comment the documentation comment associated with this member 3107 * @param comment the documentation comment associated with this member
2916 * @param metadata the annotations associated with this member 3108 * @param metadata the annotations associated with this member
2917 */ 3109 */
2918 CompilationUnitMember({Comment comment, List<Annotation> metadata}) : this.ful l(comment, metadata); 3110 CompilationUnitMember({Comment comment, List<Annotation> metadata}) : this.ful l(comment, metadata);
2919 } 3111 }
3112
2920 /** 3113 /**
2921 * Instances of the class `ConditionalExpression` represent a conditional expres sion. 3114 * Instances of the class `ConditionalExpression` represent a conditional expres sion.
2922 * 3115 *
2923 * <pre> 3116 * <pre>
2924 * conditionalExpression ::= 3117 * conditionalExpression ::=
2925 * [Expression] '?' [Expression] ':' [Expression] 3118 * [Expression] '?' [Expression] ':' [Expression]
2926 * </pre> 3119 * </pre>
2927 * 3120 *
2928 * @coverage dart.engine.ast 3121 * @coverage dart.engine.ast
2929 */ 3122 */
2930 class ConditionalExpression extends Expression { 3123 class ConditionalExpression extends Expression {
2931
2932 /** 3124 /**
2933 * The condition used to determine which of the expressions is executed next. 3125 * The condition used to determine which of the expressions is executed next.
2934 */ 3126 */
2935 Expression _condition; 3127 Expression _condition;
2936 3128
2937 /** 3129 /**
2938 * The token used to separate the condition from the then expression. 3130 * The token used to separate the condition from the then expression.
2939 */ 3131 */
2940 Token question; 3132 Token question;
2941 3133
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2978 * 3170 *
2979 * @param condition the condition used to determine which expression is execut ed next 3171 * @param condition the condition used to determine which expression is execut ed next
2980 * @param question the token used to separate the condition from the then expr ession 3172 * @param question the token used to separate the condition from the then expr ession
2981 * @param thenExpression the expression that is executed if the condition eval uates to 3173 * @param thenExpression the expression that is executed if the condition eval uates to
2982 * `true` 3174 * `true`
2983 * @param colon the token used to separate the then expression from the else e xpression 3175 * @param colon the token used to separate the then expression from the else e xpression
2984 * @param elseExpression the expression that is executed if the condition eval uates to 3176 * @param elseExpression the expression that is executed if the condition eval uates to
2985 * `false` 3177 * `false`
2986 */ 3178 */
2987 ConditionalExpression({Expression condition, Token question, Expression thenEx pression, Token colon, Expression elseExpression}) : this.full(condition, questi on, thenExpression, colon, elseExpression); 3179 ConditionalExpression({Expression condition, Token question, Expression thenEx pression, Token colon, Expression elseExpression}) : this.full(condition, questi on, thenExpression, colon, elseExpression);
3180
2988 accept(ASTVisitor visitor) => visitor.visitConditionalExpression(this); 3181 accept(ASTVisitor visitor) => visitor.visitConditionalExpression(this);
3182
2989 Token get beginToken => _condition.beginToken; 3183 Token get beginToken => _condition.beginToken;
2990 3184
2991 /** 3185 /**
2992 * Return the condition used to determine which of the expressions is executed next. 3186 * Return the condition used to determine which of the expressions is executed next.
2993 * 3187 *
2994 * @return the condition used to determine which expression is executed next 3188 * @return the condition used to determine which expression is executed next
2995 */ 3189 */
2996 Expression get condition => _condition; 3190 Expression get condition => _condition;
2997 3191
2998 /** 3192 /**
2999 * Return the expression that is executed if the condition evaluates to `false `. 3193 * Return the expression that is executed if the condition evaluates to `false `.
3000 * 3194 *
3001 * @return the expression that is executed if the condition evaluates to `fals e` 3195 * @return the expression that is executed if the condition evaluates to `fals e`
3002 */ 3196 */
3003 Expression get elseExpression => _elseExpression; 3197 Expression get elseExpression => _elseExpression;
3198
3004 Token get endToken => _elseExpression.endToken; 3199 Token get endToken => _elseExpression.endToken;
3005 3200
3006 /** 3201 /**
3007 * Return the expression that is executed if the condition evaluates to `true` . 3202 * Return the expression that is executed if the condition evaluates to `true` .
3008 * 3203 *
3009 * @return the expression that is executed if the condition evaluates to `true ` 3204 * @return the expression that is executed if the condition evaluates to `true `
3010 */ 3205 */
3011 Expression get thenExpression => _thenExpression; 3206 Expression get thenExpression => _thenExpression;
3012 3207
3013 /** 3208 /**
(...skipping 18 matching lines...) Expand all
3032 3227
3033 /** 3228 /**
3034 * Set the expression that is executed if the condition evaluates to `true` to the given 3229 * Set the expression that is executed if the condition evaluates to `true` to the given
3035 * expression. 3230 * expression.
3036 * 3231 *
3037 * @param expression the expression that is executed if the condition evaluate s to `true` 3232 * @param expression the expression that is executed if the condition evaluate s to `true`
3038 */ 3233 */
3039 void set thenExpression(Expression expression) { 3234 void set thenExpression(Expression expression) {
3040 _thenExpression = becomeParentOf(expression); 3235 _thenExpression = becomeParentOf(expression);
3041 } 3236 }
3237
3042 void visitChildren(ASTVisitor visitor) { 3238 void visitChildren(ASTVisitor visitor) {
3043 safelyVisitChild(_condition, visitor); 3239 safelyVisitChild(_condition, visitor);
3044 safelyVisitChild(_thenExpression, visitor); 3240 safelyVisitChild(_thenExpression, visitor);
3045 safelyVisitChild(_elseExpression, visitor); 3241 safelyVisitChild(_elseExpression, visitor);
3046 } 3242 }
3047 } 3243 }
3244
3048 /** 3245 /**
3049 * Instances of the class `ConstructorDeclaration` represent a constructor decla ration. 3246 * Instances of the class `ConstructorDeclaration` represent a constructor decla ration.
3050 * 3247 *
3051 * <pre> 3248 * <pre>
3052 * constructorDeclaration ::= 3249 * constructorDeclaration ::=
3053 * constructorSignature [FunctionBody]? 3250 * constructorSignature [FunctionBody]?
3054 * | constructorName formalParameterList ':' 'this' ('.' [SimpleIdentifier])? arguments 3251 * | constructorName formalParameterList ':' 'this' ('.' [SimpleIdentifier])? arguments
3055 * 3252 *
3056 * constructorSignature ::= 3253 * constructorSignature ::=
3057 * 'external'? constructorName formalParameterList initializerList? 3254 * 'external'? constructorName formalParameterList initializerList?
3058 * | 'external'? 'factory' factoryName formalParameterList initializerList? 3255 * | 'external'? 'factory' factoryName formalParameterList initializerList?
3059 * | 'external'? 'const' constructorName formalParameterList initializerList? 3256 * | 'external'? 'const' constructorName formalParameterList initializerList?
3060 * 3257 *
3061 * constructorName ::= 3258 * constructorName ::=
3062 * [SimpleIdentifier] ('.' [SimpleIdentifier])? 3259 * [SimpleIdentifier] ('.' [SimpleIdentifier])?
3063 * 3260 *
3064 * factoryName ::= 3261 * factoryName ::=
3065 * [Identifier] ('.' [SimpleIdentifier])? 3262 * [Identifier] ('.' [SimpleIdentifier])?
3066 * 3263 *
3067 * initializerList ::= 3264 * initializerList ::=
3068 * ':' [ConstructorInitializer] (',' [ConstructorInitializer])* 3265 * ':' [ConstructorInitializer] (',' [ConstructorInitializer])*
3069 * </pre> 3266 * </pre>
3070 * 3267 *
3071 * @coverage dart.engine.ast 3268 * @coverage dart.engine.ast
3072 */ 3269 */
3073 class ConstructorDeclaration extends ClassMember { 3270 class ConstructorDeclaration extends ClassMember {
3074
3075 /** 3271 /**
3076 * The token for the 'external' keyword, or `null` if the constructor is not e xternal. 3272 * The token for the 'external' keyword, or `null` if the constructor is not e xternal.
3077 */ 3273 */
3078 Token externalKeyword; 3274 Token externalKeyword;
3079 3275
3080 /** 3276 /**
3081 * The token for the 'const' keyword, or `null` if the constructor is not a co nst 3277 * The token for the 'const' keyword, or `null` if the constructor is not a co nst
3082 * constructor. 3278 * constructor.
3083 */ 3279 */
3084 Token constKeyword; 3280 Token constKeyword;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
3184 * @param period the token for the period before the constructor name 3380 * @param period the token for the period before the constructor name
3185 * @param name the name of the constructor 3381 * @param name the name of the constructor
3186 * @param parameters the parameters associated with the constructor 3382 * @param parameters the parameters associated with the constructor
3187 * @param separator the token for the colon or equals before the initializers 3383 * @param separator the token for the colon or equals before the initializers
3188 * @param initializers the initializers associated with the constructor 3384 * @param initializers the initializers associated with the constructor
3189 * @param redirectedConstructor the name of the constructor to which this cons tructor will be 3385 * @param redirectedConstructor the name of the constructor to which this cons tructor will be
3190 * redirected 3386 * redirected
3191 * @param body the body of the constructor 3387 * @param body the body of the constructor
3192 */ 3388 */
3193 ConstructorDeclaration({Comment comment, List<Annotation> metadata, Token exte rnalKeyword, Token constKeyword, Token factoryKeyword, Identifier returnType, To ken period, SimpleIdentifier name, FormalParameterList parameters, Token separat or, List<ConstructorInitializer> initializers, ConstructorName redirectedConstru ctor, FunctionBody body}) : this.full(comment, metadata, externalKeyword, constK eyword, factoryKeyword, returnType, period, name, parameters, separator, initial izers, redirectedConstructor, body); 3389 ConstructorDeclaration({Comment comment, List<Annotation> metadata, Token exte rnalKeyword, Token constKeyword, Token factoryKeyword, Identifier returnType, To ken period, SimpleIdentifier name, FormalParameterList parameters, Token separat or, List<ConstructorInitializer> initializers, ConstructorName redirectedConstru ctor, FunctionBody body}) : this.full(comment, metadata, externalKeyword, constK eyword, factoryKeyword, returnType, period, name, parameters, separator, initial izers, redirectedConstructor, body);
3390
3194 accept(ASTVisitor visitor) => visitor.visitConstructorDeclaration(this); 3391 accept(ASTVisitor visitor) => visitor.visitConstructorDeclaration(this);
3195 3392
3196 /** 3393 /**
3197 * Return the body of the constructor, or `null` if the constructor does not h ave a body. 3394 * Return the body of the constructor, or `null` if the constructor does not h ave a body.
3198 * 3395 *
3199 * @return the body of the constructor 3396 * @return the body of the constructor
3200 */ 3397 */
3201 FunctionBody get body => _body; 3398 FunctionBody get body => _body;
3399
3202 ConstructorElement get element => _element; 3400 ConstructorElement get element => _element;
3401
3203 Token get endToken { 3402 Token get endToken {
3204 if (_body != null) { 3403 if (_body != null) {
3205 return _body.endToken; 3404 return _body.endToken;
3206 } else if (!initializers.isEmpty) { 3405 } else if (!initializers.isEmpty) {
3207 return initializers.endToken; 3406 return initializers.endToken;
3208 } 3407 }
3209 return _parameters.endToken; 3408 return _parameters.endToken;
3210 } 3409 }
3211 3410
3212 /** 3411 /**
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
3289 } 3488 }
3290 3489
3291 /** 3490 /**
3292 * Set the type of object being created to the given type name. 3491 * Set the type of object being created to the given type name.
3293 * 3492 *
3294 * @param typeName the type of object being created 3493 * @param typeName the type of object being created
3295 */ 3494 */
3296 void set returnType(Identifier typeName) { 3495 void set returnType(Identifier typeName) {
3297 _returnType = becomeParentOf(typeName); 3496 _returnType = becomeParentOf(typeName);
3298 } 3497 }
3498
3299 void visitChildren(ASTVisitor visitor) { 3499 void visitChildren(ASTVisitor visitor) {
3300 super.visitChildren(visitor); 3500 super.visitChildren(visitor);
3301 safelyVisitChild(_returnType, visitor); 3501 safelyVisitChild(_returnType, visitor);
3302 safelyVisitChild(_name, visitor); 3502 safelyVisitChild(_name, visitor);
3303 safelyVisitChild(_parameters, visitor); 3503 safelyVisitChild(_parameters, visitor);
3304 initializers.accept(visitor); 3504 initializers.accept(visitor);
3305 safelyVisitChild(_redirectedConstructor, visitor); 3505 safelyVisitChild(_redirectedConstructor, visitor);
3306 safelyVisitChild(_body, visitor); 3506 safelyVisitChild(_body, visitor);
3307 } 3507 }
3508
3308 Token get firstTokenAfterCommentAndMetadata { 3509 Token get firstTokenAfterCommentAndMetadata {
3309 Token leftMost = this.leftMost([externalKeyword, constKeyword, factoryKeywor d]); 3510 Token leftMost = this.leftMost([externalKeyword, constKeyword, factoryKeywor d]);
3310 if (leftMost != null) { 3511 if (leftMost != null) {
3311 return leftMost; 3512 return leftMost;
3312 } 3513 }
3313 return _returnType.beginToken; 3514 return _returnType.beginToken;
3314 } 3515 }
3315 3516
3316 /** 3517 /**
3317 * Return the left-most of the given tokens, or `null` if there are no tokens given or if 3518 * Return the left-most of the given tokens, or `null` if there are no tokens given or if
3318 * all of the given tokens are `null`. 3519 * all of the given tokens are `null`.
3319 * 3520 *
3320 * @param tokens the tokens being compared to find the left-most token 3521 * @param tokens the tokens being compared to find the left-most token
3321 * @return the left-most of the given tokens 3522 * @return the left-most of the given tokens
3322 */ 3523 */
3323 Token leftMost(List<Token> tokens) { 3524 Token leftMost(List<Token> tokens) {
3324 Token leftMost = null; 3525 Token leftMost = null;
3325 int offset = 2147483647; 3526 int offset = 2147483647;
3326 for (Token token in tokens) { 3527 for (Token token in tokens) {
3327 if (token != null && token.offset < offset) { 3528 if (token != null && token.offset < offset) {
3328 leftMost = token; 3529 leftMost = token;
3329 } 3530 }
3330 } 3531 }
3331 return leftMost; 3532 return leftMost;
3332 } 3533 }
3333 } 3534 }
3535
3334 /** 3536 /**
3335 * Instances of the class `ConstructorFieldInitializer` represent the initializa tion of a 3537 * Instances of the class `ConstructorFieldInitializer` represent the initializa tion of a
3336 * field within a constructor's initialization list. 3538 * field within a constructor's initialization list.
3337 * 3539 *
3338 * <pre> 3540 * <pre>
3339 * fieldInitializer ::= 3541 * fieldInitializer ::=
3340 * ('this' '.')? [SimpleIdentifier] '=' [Expression] 3542 * ('this' '.')? [SimpleIdentifier] '=' [Expression]
3341 * </pre> 3543 * </pre>
3342 * 3544 *
3343 * @coverage dart.engine.ast 3545 * @coverage dart.engine.ast
3344 */ 3546 */
3345 class ConstructorFieldInitializer extends ConstructorInitializer { 3547 class ConstructorFieldInitializer extends ConstructorInitializer {
3346
3347 /** 3548 /**
3348 * The token for the 'this' keyword, or `null` if there is no 'this' keyword. 3549 * The token for the 'this' keyword, or `null` if there is no 'this' keyword.
3349 */ 3550 */
3350 Token keyword; 3551 Token keyword;
3351 3552
3352 /** 3553 /**
3353 * The token for the period after the 'this' keyword, or `null` if there is no 'this' 3554 * The token for the period after the 'this' keyword, or `null` if there is no 'this'
3354 * keyword. 3555 * keyword.
3355 */ 3556 */
3356 Token period; 3557 Token period;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3392 * Initialize a newly created field initializer to initialize the field with t he given name to the 3593 * Initialize a newly created field initializer to initialize the field with t he given name to the
3393 * value of the given expression. 3594 * value of the given expression.
3394 * 3595 *
3395 * @param keyword the token for the 'this' keyword 3596 * @param keyword the token for the 'this' keyword
3396 * @param period the token for the period after the 'this' keyword 3597 * @param period the token for the period after the 'this' keyword
3397 * @param fieldName the name of the field being initialized 3598 * @param fieldName the name of the field being initialized
3398 * @param equals the token for the equal sign between the field name and the e xpression 3599 * @param equals the token for the equal sign between the field name and the e xpression
3399 * @param expression the expression computing the value to which the field wil l be initialized 3600 * @param expression the expression computing the value to which the field wil l be initialized
3400 */ 3601 */
3401 ConstructorFieldInitializer({Token keyword, Token period, SimpleIdentifier fie ldName, Token equals, Expression expression}) : this.full(keyword, period, field Name, equals, expression); 3602 ConstructorFieldInitializer({Token keyword, Token period, SimpleIdentifier fie ldName, Token equals, Expression expression}) : this.full(keyword, period, field Name, equals, expression);
3603
3402 accept(ASTVisitor visitor) => visitor.visitConstructorFieldInitializer(this); 3604 accept(ASTVisitor visitor) => visitor.visitConstructorFieldInitializer(this);
3605
3403 Token get beginToken { 3606 Token get beginToken {
3404 if (keyword != null) { 3607 if (keyword != null) {
3405 return keyword; 3608 return keyword;
3406 } 3609 }
3407 return _fieldName.beginToken; 3610 return _fieldName.beginToken;
3408 } 3611 }
3612
3409 Token get endToken => _expression.endToken; 3613 Token get endToken => _expression.endToken;
3410 3614
3411 /** 3615 /**
3412 * Return the expression computing the value to which the field will be initia lized. 3616 * Return the expression computing the value to which the field will be initia lized.
3413 * 3617 *
3414 * @return the expression computing the value to which the field will be initi alized 3618 * @return the expression computing the value to which the field will be initi alized
3415 */ 3619 */
3416 Expression get expression => _expression; 3620 Expression get expression => _expression;
3417 3621
3418 /** 3622 /**
(...skipping 14 matching lines...) Expand all
3433 } 3637 }
3434 3638
3435 /** 3639 /**
3436 * Set the name of the field being initialized to the given identifier. 3640 * Set the name of the field being initialized to the given identifier.
3437 * 3641 *
3438 * @param identifier the name of the field being initialized 3642 * @param identifier the name of the field being initialized
3439 */ 3643 */
3440 void set fieldName(SimpleIdentifier identifier) { 3644 void set fieldName(SimpleIdentifier identifier) {
3441 _fieldName = becomeParentOf(identifier); 3645 _fieldName = becomeParentOf(identifier);
3442 } 3646 }
3647
3443 void visitChildren(ASTVisitor visitor) { 3648 void visitChildren(ASTVisitor visitor) {
3444 safelyVisitChild(_fieldName, visitor); 3649 safelyVisitChild(_fieldName, visitor);
3445 safelyVisitChild(_expression, visitor); 3650 safelyVisitChild(_expression, visitor);
3446 } 3651 }
3447 } 3652 }
3653
3448 /** 3654 /**
3449 * Instances of the class `ConstructorInitializer` defines the behavior of nodes that can 3655 * Instances of the class `ConstructorInitializer` defines the behavior of nodes that can
3450 * occur in the initializer list of a constructor declaration. 3656 * occur in the initializer list of a constructor declaration.
3451 * 3657 *
3452 * <pre> 3658 * <pre>
3453 * constructorInitializer ::= 3659 * constructorInitializer ::=
3454 * [SuperConstructorInvocation] 3660 * [SuperConstructorInvocation]
3455 * | [ConstructorFieldInitializer] 3661 * | [ConstructorFieldInitializer]
3456 * </pre> 3662 * </pre>
3457 * 3663 *
3458 * @coverage dart.engine.ast 3664 * @coverage dart.engine.ast
3459 */ 3665 */
3460 abstract class ConstructorInitializer extends ASTNode { 3666 abstract class ConstructorInitializer extends ASTNode {
3461 } 3667 }
3668
3462 /** 3669 /**
3463 * Instances of the class `ConstructorName` represent the name of the constructo r. 3670 * Instances of the class `ConstructorName` represent the name of the constructo r.
3464 * 3671 *
3465 * <pre> 3672 * <pre>
3466 * constructorName: 3673 * constructorName:
3467 * type ('.' identifier)? 3674 * type ('.' identifier)?
3468 * </pre> 3675 * </pre>
3469 * 3676 *
3470 * @coverage dart.engine.ast 3677 * @coverage dart.engine.ast
3471 */ 3678 */
3472 class ConstructorName extends ASTNode { 3679 class ConstructorName extends ASTNode {
3473
3474 /** 3680 /**
3475 * The name of the type defining the constructor. 3681 * The name of the type defining the constructor.
3476 */ 3682 */
3477 TypeName _type; 3683 TypeName _type;
3478 3684
3479 /** 3685 /**
3480 * The token for the period before the constructor name, or `null` if the spec ified 3686 * The token for the period before the constructor name, or `null` if the spec ified
3481 * constructor is the unnamed constructor. 3687 * constructor is the unnamed constructor.
3482 */ 3688 */
3483 Token period; 3689 Token period;
(...skipping 25 matching lines...) Expand all
3509 } 3715 }
3510 3716
3511 /** 3717 /**
3512 * Initialize a newly created constructor name. 3718 * Initialize a newly created constructor name.
3513 * 3719 *
3514 * @param type the name of the type defining the constructor 3720 * @param type the name of the type defining the constructor
3515 * @param period the token for the period before the constructor name 3721 * @param period the token for the period before the constructor name
3516 * @param name the name of the constructor 3722 * @param name the name of the constructor
3517 */ 3723 */
3518 ConstructorName({TypeName type, Token period, SimpleIdentifier name}) : this.f ull(type, period, name); 3724 ConstructorName({TypeName type, Token period, SimpleIdentifier name}) : this.f ull(type, period, name);
3725
3519 accept(ASTVisitor visitor) => visitor.visitConstructorName(this); 3726 accept(ASTVisitor visitor) => visitor.visitConstructorName(this);
3727
3520 Token get beginToken => _type.beginToken; 3728 Token get beginToken => _type.beginToken;
3729
3521 Token get endToken { 3730 Token get endToken {
3522 if (_name != null) { 3731 if (_name != null) {
3523 return _name.endToken; 3732 return _name.endToken;
3524 } 3733 }
3525 return _type.endToken; 3734 return _type.endToken;
3526 } 3735 }
3527 3736
3528 /** 3737 /**
3529 * Return the name of the constructor, or `null` if the specified constructor is the unnamed 3738 * Return the name of the constructor, or `null` if the specified constructor is the unnamed
3530 * constructor. 3739 * constructor.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
3569 } 3778 }
3570 3779
3571 /** 3780 /**
3572 * Set the name of the type defining the constructor to the given type name. 3781 * Set the name of the type defining the constructor to the given type name.
3573 * 3782 *
3574 * @param type the name of the type defining the constructor 3783 * @param type the name of the type defining the constructor
3575 */ 3784 */
3576 void set type(TypeName type) { 3785 void set type(TypeName type) {
3577 this._type = becomeParentOf(type); 3786 this._type = becomeParentOf(type);
3578 } 3787 }
3788
3579 void visitChildren(ASTVisitor visitor) { 3789 void visitChildren(ASTVisitor visitor) {
3580 safelyVisitChild(_type, visitor); 3790 safelyVisitChild(_type, visitor);
3581 safelyVisitChild(_name, visitor); 3791 safelyVisitChild(_name, visitor);
3582 } 3792 }
3583 } 3793 }
3794
3584 /** 3795 /**
3585 * Instances of the class `ContinueStatement` represent a continue statement. 3796 * Instances of the class `ContinueStatement` represent a continue statement.
3586 * 3797 *
3587 * <pre> 3798 * <pre>
3588 * continueStatement ::= 3799 * continueStatement ::=
3589 * 'continue' [SimpleIdentifier]? ';' 3800 * 'continue' [SimpleIdentifier]? ';'
3590 * </pre> 3801 * </pre>
3591 * 3802 *
3592 * @coverage dart.engine.ast 3803 * @coverage dart.engine.ast
3593 */ 3804 */
3594 class ContinueStatement extends Statement { 3805 class ContinueStatement extends Statement {
3595
3596 /** 3806 /**
3597 * The token representing the 'continue' keyword. 3807 * The token representing the 'continue' keyword.
3598 */ 3808 */
3599 Token keyword; 3809 Token keyword;
3600 3810
3601 /** 3811 /**
3602 * The label associated with the statement, or `null` if there is no label. 3812 * The label associated with the statement, or `null` if there is no label.
3603 */ 3813 */
3604 SimpleIdentifier _label; 3814 SimpleIdentifier _label;
3605 3815
(...skipping 16 matching lines...) Expand all
3622 } 3832 }
3623 3833
3624 /** 3834 /**
3625 * Initialize a newly created continue statement. 3835 * Initialize a newly created continue statement.
3626 * 3836 *
3627 * @param keyword the token representing the 'continue' keyword 3837 * @param keyword the token representing the 'continue' keyword
3628 * @param label the label associated with the statement 3838 * @param label the label associated with the statement
3629 * @param semicolon the semicolon terminating the statement 3839 * @param semicolon the semicolon terminating the statement
3630 */ 3840 */
3631 ContinueStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : this.full(keyword, label, semicolon); 3841 ContinueStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : this.full(keyword, label, semicolon);
3842
3632 accept(ASTVisitor visitor) => visitor.visitContinueStatement(this); 3843 accept(ASTVisitor visitor) => visitor.visitContinueStatement(this);
3844
3633 Token get beginToken => keyword; 3845 Token get beginToken => keyword;
3846
3634 Token get endToken => semicolon; 3847 Token get endToken => semicolon;
3635 3848
3636 /** 3849 /**
3637 * Return the label associated with the statement, or `null` if there is no la bel. 3850 * Return the label associated with the statement, or `null` if there is no la bel.
3638 * 3851 *
3639 * @return the label associated with the statement 3852 * @return the label associated with the statement
3640 */ 3853 */
3641 SimpleIdentifier get label => _label; 3854 SimpleIdentifier get label => _label;
3642 3855
3643 /** 3856 /**
3644 * Set the label associated with the statement to the given label. 3857 * Set the label associated with the statement to the given label.
3645 * 3858 *
3646 * @param identifier the label associated with the statement 3859 * @param identifier the label associated with the statement
3647 */ 3860 */
3648 void set label(SimpleIdentifier identifier) { 3861 void set label(SimpleIdentifier identifier) {
3649 _label = becomeParentOf(identifier); 3862 _label = becomeParentOf(identifier);
3650 } 3863 }
3864
3651 void visitChildren(ASTVisitor visitor) { 3865 void visitChildren(ASTVisitor visitor) {
3652 safelyVisitChild(_label, visitor); 3866 safelyVisitChild(_label, visitor);
3653 } 3867 }
3654 } 3868 }
3869
3655 /** 3870 /**
3656 * The abstract class `Declaration` defines the behavior common to nodes that re present the 3871 * The abstract class `Declaration` defines the behavior common to nodes that re present the
3657 * declaration of a name. Each declared name is visible within a name scope. 3872 * declaration of a name. Each declared name is visible within a name scope.
3658 * 3873 *
3659 * @coverage dart.engine.ast 3874 * @coverage dart.engine.ast
3660 */ 3875 */
3661 abstract class Declaration extends AnnotatedNode { 3876 abstract class Declaration extends AnnotatedNode {
3662
3663 /** 3877 /**
3664 * Initialize a newly created declaration. 3878 * Initialize a newly created declaration.
3665 * 3879 *
3666 * @param comment the documentation comment associated with this declaration 3880 * @param comment the documentation comment associated with this declaration
3667 * @param metadata the annotations associated with this declaration 3881 * @param metadata the annotations associated with this declaration
3668 */ 3882 */
3669 Declaration.full(Comment comment, List<Annotation> metadata) : super.full(comm ent, metadata); 3883 Declaration.full(Comment comment, List<Annotation> metadata) : super.full(comm ent, metadata);
3670 3884
3671 /** 3885 /**
3672 * Initialize a newly created declaration. 3886 * Initialize a newly created declaration.
3673 * 3887 *
3674 * @param comment the documentation comment associated with this declaration 3888 * @param comment the documentation comment associated with this declaration
3675 * @param metadata the annotations associated with this declaration 3889 * @param metadata the annotations associated with this declaration
3676 */ 3890 */
3677 Declaration({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata); 3891 Declaration({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata);
3678 3892
3679 /** 3893 /**
3680 * Return the element associated with this declaration, or `null` if either th is node 3894 * Return the element associated with this declaration, or `null` if either th is node
3681 * corresponds to a list of declarations or if the AST structure has not been resolved. 3895 * corresponds to a list of declarations or if the AST structure has not been resolved.
3682 * 3896 *
3683 * @return the element associated with this declaration 3897 * @return the element associated with this declaration
3684 */ 3898 */
3685 Element get element; 3899 Element get element;
3686 } 3900 }
3901
3687 /** 3902 /**
3688 * Instances of the class `DeclaredIdentifier` represent the declaration of a si ngle 3903 * Instances of the class `DeclaredIdentifier` represent the declaration of a si ngle
3689 * identifier. 3904 * identifier.
3690 * 3905 *
3691 * <pre> 3906 * <pre>
3692 * declaredIdentifier ::= 3907 * declaredIdentifier ::=
3693 * ([Annotation] finalConstVarOrType [SimpleIdentifier] 3908 * ([Annotation] finalConstVarOrType [SimpleIdentifier]
3694 * </pre> 3909 * </pre>
3695 * 3910 *
3696 * @coverage dart.engine.ast 3911 * @coverage dart.engine.ast
3697 */ 3912 */
3698 class DeclaredIdentifier extends Declaration { 3913 class DeclaredIdentifier extends Declaration {
3699
3700 /** 3914 /**
3701 * The token representing either the 'final', 'const' or 'var' keyword, or `nu ll` if no 3915 * The token representing either the 'final', 'const' or 'var' keyword, or `nu ll` if no
3702 * keyword was used. 3916 * keyword was used.
3703 */ 3917 */
3704 Token keyword; 3918 Token keyword;
3705 3919
3706 /** 3920 /**
3707 * The name of the declared type of the parameter, or `null` if the parameter does not have 3921 * The name of the declared type of the parameter, or `null` if the parameter does not have
3708 * a declared type. 3922 * a declared type.
3709 */ 3923 */
(...skipping 22 matching lines...) Expand all
3732 /** 3946 /**
3733 * Initialize a newly created formal parameter. 3947 * Initialize a newly created formal parameter.
3734 * 3948 *
3735 * @param comment the documentation comment associated with this parameter 3949 * @param comment the documentation comment associated with this parameter
3736 * @param metadata the annotations associated with this parameter 3950 * @param metadata the annotations associated with this parameter
3737 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 3951 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
3738 * @param type the name of the declared type of the parameter 3952 * @param type the name of the declared type of the parameter
3739 * @param identifier the name of the parameter being declared 3953 * @param identifier the name of the parameter being declared
3740 */ 3954 */
3741 DeclaredIdentifier({Comment comment, List<Annotation> metadata, Token keyword, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, key word, type, identifier); 3955 DeclaredIdentifier({Comment comment, List<Annotation> metadata, Token keyword, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, key word, type, identifier);
3956
3742 accept(ASTVisitor visitor) => visitor.visitDeclaredIdentifier(this); 3957 accept(ASTVisitor visitor) => visitor.visitDeclaredIdentifier(this);
3958
3743 LocalVariableElement get element { 3959 LocalVariableElement get element {
3744 SimpleIdentifier identifier = this.identifier; 3960 SimpleIdentifier identifier = this.identifier;
3745 if (identifier == null) { 3961 if (identifier == null) {
3746 return null; 3962 return null;
3747 } 3963 }
3748 return identifier.staticElement as LocalVariableElement; 3964 return identifier.staticElement as LocalVariableElement;
3749 } 3965 }
3966
3750 Token get endToken => identifier.endToken; 3967 Token get endToken => identifier.endToken;
3751 3968
3752 /** 3969 /**
3753 * Return the name of the declared type of the parameter, or `null` if the par ameter does 3970 * Return the name of the declared type of the parameter, or `null` if the par ameter does
3754 * not have a declared type. 3971 * not have a declared type.
3755 * 3972 *
3756 * @return the name of the declared type of the parameter 3973 * @return the name of the declared type of the parameter
3757 */ 3974 */
3758 TypeName get type => _type; 3975 TypeName get type => _type;
3759 3976
3760 /** 3977 /**
3761 * Return `true` if this variable was declared with the 'const' modifier. 3978 * Return `true` if this variable was declared with the 'const' modifier.
3762 * 3979 *
3763 * @return `true` if this variable was declared with the 'const' modifier 3980 * @return `true` if this variable was declared with the 'const' modifier
3764 */ 3981 */
3765 bool get isConst => (keyword is KeywordToken) && identical(((keyword as Keywor dToken)).keyword, Keyword.CONST); 3982 bool get isConst => (keyword is KeywordToken) && identical((keyword as Keyword Token).keyword, Keyword.CONST);
3766 3983
3767 /** 3984 /**
3768 * Return `true` if this variable was declared with the 'final' modifier. Vari ables that are 3985 * Return `true` if this variable was declared with the 'final' modifier. Vari ables that are
3769 * declared with the 'const' modifier will return `false` even though they are implicitly 3986 * declared with the 'const' modifier will return `false` even though they are implicitly
3770 * final. 3987 * final.
3771 * 3988 *
3772 * @return `true` if this variable was declared with the 'final' modifier 3989 * @return `true` if this variable was declared with the 'final' modifier
3773 */ 3990 */
3774 bool get isFinal => (keyword is KeywordToken) && identical(((keyword as Keywor dToken)).keyword, Keyword.FINAL); 3991 bool get isFinal => (keyword is KeywordToken) && identical((keyword as Keyword Token).keyword, Keyword.FINAL);
3775 3992
3776 /** 3993 /**
3777 * Set the name of the declared type of the parameter to the given type name. 3994 * Set the name of the declared type of the parameter to the given type name.
3778 * 3995 *
3779 * @param typeName the name of the declared type of the parameter 3996 * @param typeName the name of the declared type of the parameter
3780 */ 3997 */
3781 void set type(TypeName typeName) { 3998 void set type(TypeName typeName) {
3782 _type = becomeParentOf(typeName); 3999 _type = becomeParentOf(typeName);
3783 } 4000 }
4001
3784 void visitChildren(ASTVisitor visitor) { 4002 void visitChildren(ASTVisitor visitor) {
3785 super.visitChildren(visitor); 4003 super.visitChildren(visitor);
3786 safelyVisitChild(_type, visitor); 4004 safelyVisitChild(_type, visitor);
3787 safelyVisitChild(identifier, visitor); 4005 safelyVisitChild(identifier, visitor);
3788 } 4006 }
4007
3789 Token get firstTokenAfterCommentAndMetadata { 4008 Token get firstTokenAfterCommentAndMetadata {
3790 if (keyword != null) { 4009 if (keyword != null) {
3791 return keyword; 4010 return keyword;
3792 } else if (_type != null) { 4011 } else if (_type != null) {
3793 return _type.beginToken; 4012 return _type.beginToken;
3794 } 4013 }
3795 return identifier.beginToken; 4014 return identifier.beginToken;
3796 } 4015 }
3797 } 4016 }
4017
3798 /** 4018 /**
3799 * Instances of the class `DefaultFormalParameter` represent a formal parameter with a default 4019 * Instances of the class `DefaultFormalParameter` represent a formal parameter with a default
3800 * value. There are two kinds of parameters that are both represented by this cl ass: named formal 4020 * value. There are two kinds of parameters that are both represented by this cl ass: named formal
3801 * parameters and positional formal parameters. 4021 * parameters and positional formal parameters.
3802 * 4022 *
3803 * <pre> 4023 * <pre>
3804 * defaultFormalParameter ::= 4024 * defaultFormalParameter ::=
3805 * [NormalFormalParameter] ('=' [Expression])? 4025 * [NormalFormalParameter] ('=' [Expression])?
3806 * 4026 *
3807 * defaultNamedParameter ::= 4027 * defaultNamedParameter ::=
3808 * [NormalFormalParameter] (':' [Expression])? 4028 * [NormalFormalParameter] (':' [Expression])?
3809 * </pre> 4029 * </pre>
3810 * 4030 *
3811 * @coverage dart.engine.ast 4031 * @coverage dart.engine.ast
3812 */ 4032 */
3813 class DefaultFormalParameter extends FormalParameter { 4033 class DefaultFormalParameter extends FormalParameter {
3814
3815 /** 4034 /**
3816 * The formal parameter with which the default value is associated. 4035 * The formal parameter with which the default value is associated.
3817 */ 4036 */
3818 NormalFormalParameter _parameter; 4037 NormalFormalParameter _parameter;
3819 4038
3820 /** 4039 /**
3821 * The kind of this parameter. 4040 * The kind of this parameter.
3822 */ 4041 */
3823 ParameterKind _kind; 4042 ParameterKind _kind;
3824 4043
(...skipping 26 matching lines...) Expand all
3851 4070
3852 /** 4071 /**
3853 * Initialize a newly created default formal parameter. 4072 * Initialize a newly created default formal parameter.
3854 * 4073 *
3855 * @param parameter the formal parameter with which the default value is assoc iated 4074 * @param parameter the formal parameter with which the default value is assoc iated
3856 * @param kind the kind of this parameter 4075 * @param kind the kind of this parameter
3857 * @param separator the token separating the parameter from the default value 4076 * @param separator the token separating the parameter from the default value
3858 * @param defaultValue the expression computing the default value for the para meter 4077 * @param defaultValue the expression computing the default value for the para meter
3859 */ 4078 */
3860 DefaultFormalParameter({NormalFormalParameter parameter, ParameterKind kind, T oken separator, Expression defaultValue}) : this.full(parameter, kind, separator , defaultValue); 4079 DefaultFormalParameter({NormalFormalParameter parameter, ParameterKind kind, T oken separator, Expression defaultValue}) : this.full(parameter, kind, separator , defaultValue);
4080
3861 accept(ASTVisitor visitor) => visitor.visitDefaultFormalParameter(this); 4081 accept(ASTVisitor visitor) => visitor.visitDefaultFormalParameter(this);
4082
3862 Token get beginToken => _parameter.beginToken; 4083 Token get beginToken => _parameter.beginToken;
3863 4084
3864 /** 4085 /**
3865 * Return the expression computing the default value for the parameter, or `nu ll` if there 4086 * Return the expression computing the default value for the parameter, or `nu ll` if there
3866 * is no default value. 4087 * is no default value.
3867 * 4088 *
3868 * @return the expression computing the default value for the parameter 4089 * @return the expression computing the default value for the parameter
3869 */ 4090 */
3870 Expression get defaultValue => _defaultValue; 4091 Expression get defaultValue => _defaultValue;
4092
3871 Token get endToken { 4093 Token get endToken {
3872 if (_defaultValue != null) { 4094 if (_defaultValue != null) {
3873 return _defaultValue.endToken; 4095 return _defaultValue.endToken;
3874 } 4096 }
3875 return _parameter.endToken; 4097 return _parameter.endToken;
3876 } 4098 }
4099
3877 SimpleIdentifier get identifier => _parameter.identifier; 4100 SimpleIdentifier get identifier => _parameter.identifier;
4101
3878 ParameterKind get kind => _kind; 4102 ParameterKind get kind => _kind;
3879 4103
3880 /** 4104 /**
3881 * Return the formal parameter with which the default value is associated. 4105 * Return the formal parameter with which the default value is associated.
3882 * 4106 *
3883 * @return the formal parameter with which the default value is associated 4107 * @return the formal parameter with which the default value is associated
3884 */ 4108 */
3885 NormalFormalParameter get parameter => _parameter; 4109 NormalFormalParameter get parameter => _parameter;
4110
3886 bool get isConst => _parameter != null && _parameter.isConst; 4111 bool get isConst => _parameter != null && _parameter.isConst;
4112
3887 bool get isFinal => _parameter != null && _parameter.isFinal; 4113 bool get isFinal => _parameter != null && _parameter.isFinal;
3888 4114
3889 /** 4115 /**
3890 * Set the expression computing the default value for the parameter to the giv en expression. 4116 * Set the expression computing the default value for the parameter to the giv en expression.
3891 * 4117 *
3892 * @param expression the expression computing the default value for the parame ter 4118 * @param expression the expression computing the default value for the parame ter
3893 */ 4119 */
3894 void set defaultValue(Expression expression) { 4120 void set defaultValue(Expression expression) {
3895 _defaultValue = becomeParentOf(expression); 4121 _defaultValue = becomeParentOf(expression);
3896 } 4122 }
3897 4123
3898 /** 4124 /**
3899 * Set the kind of this parameter to the given kind. 4125 * Set the kind of this parameter to the given kind.
3900 * 4126 *
3901 * @param kind the kind of this parameter 4127 * @param kind the kind of this parameter
3902 */ 4128 */
3903 void set kind(ParameterKind kind) { 4129 void set kind(ParameterKind kind) {
3904 this._kind = kind; 4130 this._kind = kind;
3905 } 4131 }
3906 4132
3907 /** 4133 /**
3908 * Set the formal parameter with which the default value is associated to the given parameter. 4134 * Set the formal parameter with which the default value is associated to the given parameter.
3909 * 4135 *
3910 * @param formalParameter the formal parameter with which the default value is associated 4136 * @param formalParameter the formal parameter with which the default value is associated
3911 */ 4137 */
3912 void set parameter(NormalFormalParameter formalParameter) { 4138 void set parameter(NormalFormalParameter formalParameter) {
3913 _parameter = becomeParentOf(formalParameter); 4139 _parameter = becomeParentOf(formalParameter);
3914 } 4140 }
4141
3915 void visitChildren(ASTVisitor visitor) { 4142 void visitChildren(ASTVisitor visitor) {
3916 safelyVisitChild(_parameter, visitor); 4143 safelyVisitChild(_parameter, visitor);
3917 safelyVisitChild(_defaultValue, visitor); 4144 safelyVisitChild(_defaultValue, visitor);
3918 } 4145 }
3919 } 4146 }
4147
3920 /** 4148 /**
3921 * The abstract class `Directive` defines the behavior common to nodes that repr esent a 4149 * The abstract class `Directive` defines the behavior common to nodes that repr esent a
3922 * directive. 4150 * directive.
3923 * 4151 *
3924 * <pre> 4152 * <pre>
3925 * directive ::= 4153 * directive ::=
3926 * [ExportDirective] 4154 * [ExportDirective]
3927 * | [ImportDirective] 4155 * | [ImportDirective]
3928 * | [LibraryDirective] 4156 * | [LibraryDirective]
3929 * | [PartDirective] 4157 * | [PartDirective]
3930 * | [PartOfDirective] 4158 * | [PartOfDirective]
3931 * </pre> 4159 * </pre>
3932 * 4160 *
3933 * @coverage dart.engine.ast 4161 * @coverage dart.engine.ast
3934 */ 4162 */
3935 abstract class Directive extends AnnotatedNode { 4163 abstract class Directive extends AnnotatedNode {
3936
3937 /** 4164 /**
3938 * The element associated with this directive, or `null` if the AST structure has not been 4165 * The element associated with this directive, or `null` if the AST structure has not been
3939 * resolved or if this directive could not be resolved. 4166 * resolved or if this directive could not be resolved.
3940 */ 4167 */
3941 Element _element; 4168 Element _element;
3942 4169
3943 /** 4170 /**
3944 * Initialize a newly create directive. 4171 * Initialize a newly create directive.
3945 * 4172 *
3946 * @param comment the documentation comment associated with this directive 4173 * @param comment the documentation comment associated with this directive
(...skipping 28 matching lines...) Expand all
3975 4202
3976 /** 4203 /**
3977 * Set the element associated with this directive to the given element. 4204 * Set the element associated with this directive to the given element.
3978 * 4205 *
3979 * @param element the element associated with this directive 4206 * @param element the element associated with this directive
3980 */ 4207 */
3981 void set element(Element element) { 4208 void set element(Element element) {
3982 this._element = element; 4209 this._element = element;
3983 } 4210 }
3984 } 4211 }
4212
3985 /** 4213 /**
3986 * Instances of the class `DoStatement` represent a do statement. 4214 * Instances of the class `DoStatement` represent a do statement.
3987 * 4215 *
3988 * <pre> 4216 * <pre>
3989 * doStatement ::= 4217 * doStatement ::=
3990 * 'do' [Statement] 'while' '(' [Expression] ')' ';' 4218 * 'do' [Statement] 'while' '(' [Expression] ')' ';'
3991 * </pre> 4219 * </pre>
3992 * 4220 *
3993 * @coverage dart.engine.ast 4221 * @coverage dart.engine.ast
3994 */ 4222 */
3995 class DoStatement extends Statement { 4223 class DoStatement extends Statement {
3996
3997 /** 4224 /**
3998 * The token representing the 'do' keyword. 4225 * The token representing the 'do' keyword.
3999 */ 4226 */
4000 Token doKeyword; 4227 Token doKeyword;
4001 4228
4002 /** 4229 /**
4003 * The body of the loop. 4230 * The body of the loop.
4004 */ 4231 */
4005 Statement _body; 4232 Statement _body;
4006 4233
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
4055 * 4282 *
4056 * @param doKeyword the token representing the 'do' keyword 4283 * @param doKeyword the token representing the 'do' keyword
4057 * @param body the body of the loop 4284 * @param body the body of the loop
4058 * @param whileKeyword the token representing the 'while' keyword 4285 * @param whileKeyword the token representing the 'while' keyword
4059 * @param leftParenthesis the left parenthesis 4286 * @param leftParenthesis the left parenthesis
4060 * @param condition the condition that determines when the loop will terminate 4287 * @param condition the condition that determines when the loop will terminate
4061 * @param rightParenthesis the right parenthesis 4288 * @param rightParenthesis the right parenthesis
4062 * @param semicolon the semicolon terminating the statement 4289 * @param semicolon the semicolon terminating the statement
4063 */ 4290 */
4064 DoStatement({Token doKeyword, Statement body, Token whileKeyword, Token leftPa renthesis, Expression condition, Token rightParenthesis, Token semicolon}) : thi s.full(doKeyword, body, whileKeyword, leftParenthesis, condition, rightParenthes is, semicolon); 4291 DoStatement({Token doKeyword, Statement body, Token whileKeyword, Token leftPa renthesis, Expression condition, Token rightParenthesis, Token semicolon}) : thi s.full(doKeyword, body, whileKeyword, leftParenthesis, condition, rightParenthes is, semicolon);
4292
4065 accept(ASTVisitor visitor) => visitor.visitDoStatement(this); 4293 accept(ASTVisitor visitor) => visitor.visitDoStatement(this);
4294
4066 Token get beginToken => doKeyword; 4295 Token get beginToken => doKeyword;
4067 4296
4068 /** 4297 /**
4069 * Return the body of the loop. 4298 * Return the body of the loop.
4070 * 4299 *
4071 * @return the body of the loop 4300 * @return the body of the loop
4072 */ 4301 */
4073 Statement get body => _body; 4302 Statement get body => _body;
4074 4303
4075 /** 4304 /**
4076 * Return the condition that determines when the loop will terminate. 4305 * Return the condition that determines when the loop will terminate.
4077 * 4306 *
4078 * @return the condition that determines when the loop will terminate 4307 * @return the condition that determines when the loop will terminate
4079 */ 4308 */
4080 Expression get condition => _condition; 4309 Expression get condition => _condition;
4310
4081 Token get endToken => semicolon; 4311 Token get endToken => semicolon;
4082 4312
4083 /** 4313 /**
4084 * Return the left parenthesis. 4314 * Return the left parenthesis.
4085 * 4315 *
4086 * @return the left parenthesis 4316 * @return the left parenthesis
4087 */ 4317 */
4088 Token get leftParenthesis => _leftParenthesis; 4318 Token get leftParenthesis => _leftParenthesis;
4089 4319
4090 /** 4320 /**
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
4122 } 4352 }
4123 4353
4124 /** 4354 /**
4125 * Set the right parenthesis to the given token. 4355 * Set the right parenthesis to the given token.
4126 * 4356 *
4127 * @param parenthesis the right parenthesis 4357 * @param parenthesis the right parenthesis
4128 */ 4358 */
4129 void set rightParenthesis(Token parenthesis) { 4359 void set rightParenthesis(Token parenthesis) {
4130 _rightParenthesis = parenthesis; 4360 _rightParenthesis = parenthesis;
4131 } 4361 }
4362
4132 void visitChildren(ASTVisitor visitor) { 4363 void visitChildren(ASTVisitor visitor) {
4133 safelyVisitChild(_body, visitor); 4364 safelyVisitChild(_body, visitor);
4134 safelyVisitChild(_condition, visitor); 4365 safelyVisitChild(_condition, visitor);
4135 } 4366 }
4136 } 4367 }
4368
4137 /** 4369 /**
4138 * Instances of the class `DoubleLiteral` represent a floating point literal exp ression. 4370 * Instances of the class `DoubleLiteral` represent a floating point literal exp ression.
4139 * 4371 *
4140 * <pre> 4372 * <pre>
4141 * doubleLiteral ::= 4373 * doubleLiteral ::=
4142 * decimalDigit+ ('.' decimalDigit*)? exponent? 4374 * decimalDigit+ ('.' decimalDigit*)? exponent?
4143 * | '.' decimalDigit+ exponent? 4375 * | '.' decimalDigit+ exponent?
4144 * 4376 *
4145 * exponent ::= 4377 * exponent ::=
4146 * ('e' | 'E') ('+' | '-')? decimalDigit+ 4378 * ('e' | 'E') ('+' | '-')? decimalDigit+
4147 * </pre> 4379 * </pre>
4148 * 4380 *
4149 * @coverage dart.engine.ast 4381 * @coverage dart.engine.ast
4150 */ 4382 */
4151 class DoubleLiteral extends Literal { 4383 class DoubleLiteral extends Literal {
4152
4153 /** 4384 /**
4154 * The token representing the literal. 4385 * The token representing the literal.
4155 */ 4386 */
4156 Token literal; 4387 Token literal;
4157 4388
4158 /** 4389 /**
4159 * The value of the literal. 4390 * The value of the literal.
4160 */ 4391 */
4161 double value = 0.0; 4392 double value = 0.0;
4162 4393
4163 /** 4394 /**
4164 * Initialize a newly created floating point literal. 4395 * Initialize a newly created floating point literal.
4165 * 4396 *
4166 * @param literal the token representing the literal 4397 * @param literal the token representing the literal
4167 * @param value the value of the literal 4398 * @param value the value of the literal
4168 */ 4399 */
4169 DoubleLiteral.full(Token literal, double value) { 4400 DoubleLiteral.full(Token literal, double value) {
4170 this.literal = literal; 4401 this.literal = literal;
4171 this.value = value; 4402 this.value = value;
4172 } 4403 }
4173 4404
4174 /** 4405 /**
4175 * Initialize a newly created floating point literal. 4406 * Initialize a newly created floating point literal.
4176 * 4407 *
4177 * @param literal the token representing the literal 4408 * @param literal the token representing the literal
4178 * @param value the value of the literal 4409 * @param value the value of the literal
4179 */ 4410 */
4180 DoubleLiteral({Token literal, double value}) : this.full(literal, value); 4411 DoubleLiteral({Token literal, double value}) : this.full(literal, value);
4412
4181 accept(ASTVisitor visitor) => visitor.visitDoubleLiteral(this); 4413 accept(ASTVisitor visitor) => visitor.visitDoubleLiteral(this);
4414
4182 Token get beginToken => literal; 4415 Token get beginToken => literal;
4416
4183 Token get endToken => literal; 4417 Token get endToken => literal;
4418
4184 void visitChildren(ASTVisitor visitor) { 4419 void visitChildren(ASTVisitor visitor) {
4185 } 4420 }
4186 } 4421 }
4422
4187 /** 4423 /**
4188 * Instances of the class `EmptyFunctionBody` represent an empty function body, which can only 4424 * Instances of the class `EmptyFunctionBody` represent an empty function body, which can only
4189 * appear in constructors or abstract methods. 4425 * appear in constructors or abstract methods.
4190 * 4426 *
4191 * <pre> 4427 * <pre>
4192 * emptyFunctionBody ::= 4428 * emptyFunctionBody ::=
4193 * ';' 4429 * ';'
4194 * </pre> 4430 * </pre>
4195 * 4431 *
4196 * @coverage dart.engine.ast 4432 * @coverage dart.engine.ast
4197 */ 4433 */
4198 class EmptyFunctionBody extends FunctionBody { 4434 class EmptyFunctionBody extends FunctionBody {
4199
4200 /** 4435 /**
4201 * The token representing the semicolon that marks the end of the function bod y. 4436 * The token representing the semicolon that marks the end of the function bod y.
4202 */ 4437 */
4203 Token semicolon; 4438 Token semicolon;
4204 4439
4205 /** 4440 /**
4206 * Initialize a newly created function body. 4441 * Initialize a newly created function body.
4207 * 4442 *
4208 * @param semicolon the token representing the semicolon that marks the end of the function body 4443 * @param semicolon the token representing the semicolon that marks the end of the function body
4209 */ 4444 */
4210 EmptyFunctionBody.full(Token semicolon) { 4445 EmptyFunctionBody.full(Token semicolon) {
4211 this.semicolon = semicolon; 4446 this.semicolon = semicolon;
4212 } 4447 }
4213 4448
4214 /** 4449 /**
4215 * Initialize a newly created function body. 4450 * Initialize a newly created function body.
4216 * 4451 *
4217 * @param semicolon the token representing the semicolon that marks the end of the function body 4452 * @param semicolon the token representing the semicolon that marks the end of the function body
4218 */ 4453 */
4219 EmptyFunctionBody({Token semicolon}) : this.full(semicolon); 4454 EmptyFunctionBody({Token semicolon}) : this.full(semicolon);
4455
4220 accept(ASTVisitor visitor) => visitor.visitEmptyFunctionBody(this); 4456 accept(ASTVisitor visitor) => visitor.visitEmptyFunctionBody(this);
4457
4221 Token get beginToken => semicolon; 4458 Token get beginToken => semicolon;
4459
4222 Token get endToken => semicolon; 4460 Token get endToken => semicolon;
4461
4223 void visitChildren(ASTVisitor visitor) { 4462 void visitChildren(ASTVisitor visitor) {
4224 } 4463 }
4225 } 4464 }
4465
4226 /** 4466 /**
4227 * Instances of the class `EmptyStatement` represent an empty statement. 4467 * Instances of the class `EmptyStatement` represent an empty statement.
4228 * 4468 *
4229 * <pre> 4469 * <pre>
4230 * emptyStatement ::= 4470 * emptyStatement ::=
4231 * ';' 4471 * ';'
4232 * </pre> 4472 * </pre>
4233 * 4473 *
4234 * @coverage dart.engine.ast 4474 * @coverage dart.engine.ast
4235 */ 4475 */
4236 class EmptyStatement extends Statement { 4476 class EmptyStatement extends Statement {
4237
4238 /** 4477 /**
4239 * The semicolon terminating the statement. 4478 * The semicolon terminating the statement.
4240 */ 4479 */
4241 Token semicolon; 4480 Token semicolon;
4242 4481
4243 /** 4482 /**
4244 * Initialize a newly created empty statement. 4483 * Initialize a newly created empty statement.
4245 * 4484 *
4246 * @param semicolon the semicolon terminating the statement 4485 * @param semicolon the semicolon terminating the statement
4247 */ 4486 */
4248 EmptyStatement.full(Token semicolon) { 4487 EmptyStatement.full(Token semicolon) {
4249 this.semicolon = semicolon; 4488 this.semicolon = semicolon;
4250 } 4489 }
4251 4490
4252 /** 4491 /**
4253 * Initialize a newly created empty statement. 4492 * Initialize a newly created empty statement.
4254 * 4493 *
4255 * @param semicolon the semicolon terminating the statement 4494 * @param semicolon the semicolon terminating the statement
4256 */ 4495 */
4257 EmptyStatement({Token semicolon}) : this.full(semicolon); 4496 EmptyStatement({Token semicolon}) : this.full(semicolon);
4497
4258 accept(ASTVisitor visitor) => visitor.visitEmptyStatement(this); 4498 accept(ASTVisitor visitor) => visitor.visitEmptyStatement(this);
4499
4259 Token get beginToken => semicolon; 4500 Token get beginToken => semicolon;
4501
4260 Token get endToken => semicolon; 4502 Token get endToken => semicolon;
4503
4261 void visitChildren(ASTVisitor visitor) { 4504 void visitChildren(ASTVisitor visitor) {
4262 } 4505 }
4263 } 4506 }
4507
4264 /** 4508 /**
4265 * Ephemeral identifiers are created as needed to mimic the presence of an empty identifier. 4509 * Ephemeral identifiers are created as needed to mimic the presence of an empty identifier.
4266 * 4510 *
4267 * @coverage dart.engine.ast 4511 * @coverage dart.engine.ast
4268 */ 4512 */
4269 class EphemeralIdentifier extends SimpleIdentifier { 4513 class EphemeralIdentifier extends SimpleIdentifier {
4270 EphemeralIdentifier.full(ASTNode parent, int location) : super.full(new Token( TokenType.IDENTIFIER, location)) { 4514 EphemeralIdentifier.full(ASTNode parent, int location) : super.full(new Token( TokenType.IDENTIFIER, location)) {
4271 parent.becomeParentOf(this); 4515 parent.becomeParentOf(this);
4272 } 4516 }
4517
4273 EphemeralIdentifier({ASTNode parent, int location}) : this.full(parent, locati on); 4518 EphemeralIdentifier({ASTNode parent, int location}) : this.full(parent, locati on);
4274 } 4519 }
4520
4275 /** 4521 /**
4276 * Instances of the class `ExportDirective` represent an export directive. 4522 * Instances of the class `ExportDirective` represent an export directive.
4277 * 4523 *
4278 * <pre> 4524 * <pre>
4279 * exportDirective ::= 4525 * exportDirective ::=
4280 * [Annotation] 'export' [StringLiteral] [Combinator]* ';' 4526 * [Annotation] 'export' [StringLiteral] [Combinator]* ';'
4281 * </pre> 4527 * </pre>
4282 * 4528 *
4283 * @coverage dart.engine.ast 4529 * @coverage dart.engine.ast
4284 */ 4530 */
4285 class ExportDirective extends NamespaceDirective { 4531 class ExportDirective extends NamespaceDirective {
4286
4287 /** 4532 /**
4288 * Initialize a newly created export directive. 4533 * Initialize a newly created export directive.
4289 * 4534 *
4290 * @param comment the documentation comment associated with this directive 4535 * @param comment the documentation comment associated with this directive
4291 * @param metadata the annotations associated with the directive 4536 * @param metadata the annotations associated with the directive
4292 * @param keyword the token representing the 'export' keyword 4537 * @param keyword the token representing the 'export' keyword
4293 * @param libraryUri the URI of the library being exported 4538 * @param libraryUri the URI of the library being exported
4294 * @param combinators the combinators used to control which names are exported 4539 * @param combinators the combinators used to control which names are exported
4295 * @param semicolon the semicolon terminating the directive 4540 * @param semicolon the semicolon terminating the directive
4296 */ 4541 */
4297 ExportDirective.full(Comment comment, List<Annotation> metadata, Token keyword , StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) : sup er.full(comment, metadata, keyword, libraryUri, combinators, semicolon); 4542 ExportDirective.full(Comment comment, List<Annotation> metadata, Token keyword , StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) : sup er.full(comment, metadata, keyword, libraryUri, combinators, semicolon);
4298 4543
4299 /** 4544 /**
4300 * Initialize a newly created export directive. 4545 * Initialize a newly created export directive.
4301 * 4546 *
4302 * @param comment the documentation comment associated with this directive 4547 * @param comment the documentation comment associated with this directive
4303 * @param metadata the annotations associated with the directive 4548 * @param metadata the annotations associated with the directive
4304 * @param keyword the token representing the 'export' keyword 4549 * @param keyword the token representing the 'export' keyword
4305 * @param libraryUri the URI of the library being exported 4550 * @param libraryUri the URI of the library being exported
4306 * @param combinators the combinators used to control which names are exported 4551 * @param combinators the combinators used to control which names are exported
4307 * @param semicolon the semicolon terminating the directive 4552 * @param semicolon the semicolon terminating the directive
4308 */ 4553 */
4309 ExportDirective({Comment comment, List<Annotation> metadata, Token keyword, St ringLiteral libraryUri, List<Combinator> combinators, Token semicolon}) : this.f ull(comment, metadata, keyword, libraryUri, combinators, semicolon); 4554 ExportDirective({Comment comment, List<Annotation> metadata, Token keyword, St ringLiteral libraryUri, List<Combinator> combinators, Token semicolon}) : this.f ull(comment, metadata, keyword, libraryUri, combinators, semicolon);
4555
4310 accept(ASTVisitor visitor) => visitor.visitExportDirective(this); 4556 accept(ASTVisitor visitor) => visitor.visitExportDirective(this);
4557
4311 LibraryElement get uriElement { 4558 LibraryElement get uriElement {
4312 Element element = this.element; 4559 Element element = this.element;
4313 if (element is ExportElement) { 4560 if (element is ExportElement) {
4314 return ((element as ExportElement)).exportedLibrary; 4561 return (element as ExportElement).exportedLibrary;
4315 } 4562 }
4316 return null; 4563 return null;
4317 } 4564 }
4565
4318 void visitChildren(ASTVisitor visitor) { 4566 void visitChildren(ASTVisitor visitor) {
4319 super.visitChildren(visitor); 4567 super.visitChildren(visitor);
4320 combinators.accept(visitor); 4568 combinators.accept(visitor);
4321 } 4569 }
4322 } 4570 }
4571
4323 /** 4572 /**
4324 * Instances of the class `Expression` defines the behavior common to nodes that represent an 4573 * Instances of the class `Expression` defines the behavior common to nodes that represent an
4325 * expression. 4574 * expression.
4326 * 4575 *
4327 * <pre> 4576 * <pre>
4328 * expression ::= 4577 * expression ::=
4329 * [AssignmentExpression] 4578 * [AssignmentExpression]
4330 * | [ConditionalExpression] cascadeSection* 4579 * | [ConditionalExpression] cascadeSection*
4331 * | [ThrowExpression] 4580 * | [ThrowExpression]
4332 * </pre> 4581 * </pre>
4333 * 4582 *
4334 * @coverage dart.engine.ast 4583 * @coverage dart.engine.ast
4335 */ 4584 */
4336 abstract class Expression extends ASTNode { 4585 abstract class Expression extends ASTNode {
4337
4338 /** 4586 /**
4339 * The static type of this expression, or `null` if the AST structure has not been resolved. 4587 * The static type of this expression, or `null` if the AST structure has not been resolved.
4340 */ 4588 */
4341 Type2 staticType; 4589 Type2 staticType;
4342 4590
4343 /** 4591 /**
4344 * The propagated type of this expression, or `null` if type propagation has n ot been 4592 * The propagated type of this expression, or `null` if type propagation has n ot been
4345 * performed on the AST structure. 4593 * performed on the AST structure.
4346 */ 4594 */
4347 Type2 propagatedType; 4595 Type2 propagatedType;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
4385 * expression corresponds to one of the parameters of the function being invok ed, then return the 4633 * expression corresponds to one of the parameters of the function being invok ed, then return the
4386 * parameter element representing the parameter to which the value of this exp ression will be 4634 * parameter element representing the parameter to which the value of this exp ression will be
4387 * bound. Otherwise, return `null`. 4635 * bound. Otherwise, return `null`.
4388 * 4636 *
4389 * @return the parameter element representing the parameter to which the value of this expression 4637 * @return the parameter element representing the parameter to which the value of this expression
4390 * will be bound 4638 * will be bound
4391 */ 4639 */
4392 ParameterElement get propagatedParameterElement { 4640 ParameterElement get propagatedParameterElement {
4393 ASTNode parent = this.parent; 4641 ASTNode parent = this.parent;
4394 if (parent is ArgumentList) { 4642 if (parent is ArgumentList) {
4395 return ((parent as ArgumentList)).getPropagatedParameterElementFor(this); 4643 return (parent as ArgumentList).getPropagatedParameterElementFor(this);
4396 } else if (parent is IndexExpression) { 4644 } else if (parent is IndexExpression) {
4397 IndexExpression indexExpression = parent as IndexExpression; 4645 IndexExpression indexExpression = parent as IndexExpression;
4398 if (identical(indexExpression.index, this)) { 4646 if (identical(indexExpression.index, this)) {
4399 return indexExpression.propagatedParameterElementForIndex; 4647 return indexExpression.propagatedParameterElementForIndex;
4400 } 4648 }
4401 } else if (parent is BinaryExpression) { 4649 } else if (parent is BinaryExpression) {
4402 BinaryExpression binaryExpression = parent as BinaryExpression; 4650 BinaryExpression binaryExpression = parent as BinaryExpression;
4403 if (identical(binaryExpression.rightOperand, this)) { 4651 if (identical(binaryExpression.rightOperand, this)) {
4404 return binaryExpression.propagatedParameterElementForRightOperand; 4652 return binaryExpression.propagatedParameterElementForRightOperand;
4405 } 4653 }
4406 } else if (parent is AssignmentExpression) { 4654 } else if (parent is AssignmentExpression) {
4407 AssignmentExpression assignmentExpression = parent as AssignmentExpression ; 4655 AssignmentExpression assignmentExpression = parent as AssignmentExpression ;
4408 if (identical(assignmentExpression.rightHandSide, this)) { 4656 if (identical(assignmentExpression.rightHandSide, this)) {
4409 return assignmentExpression.propagatedParameterElementForRightHandSide; 4657 return assignmentExpression.propagatedParameterElementForRightHandSide;
4410 } 4658 }
4411 } else if (parent is PrefixExpression) { 4659 } else if (parent is PrefixExpression) {
4412 return ((parent as PrefixExpression)).propagatedParameterElementForOperand ; 4660 return (parent as PrefixExpression).propagatedParameterElementForOperand;
4413 } else if (parent is PostfixExpression) { 4661 } else if (parent is PostfixExpression) {
4414 return ((parent as PostfixExpression)).propagatedParameterElementForOperan d; 4662 return (parent as PostfixExpression).propagatedParameterElementForOperand;
4415 } 4663 }
4416 return null; 4664 return null;
4417 } 4665 }
4418 4666
4419 /** 4667 /**
4420 * If this expression is an argument to an invocation, and the AST structure h as been resolved, 4668 * If this expression is an argument to an invocation, and the AST structure h as been resolved,
4421 * and the function being invoked is known based on static type information, a nd this expression 4669 * and the function being invoked is known based on static type information, a nd this expression
4422 * corresponds to one of the parameters of the function being invoked, then re turn the parameter 4670 * corresponds to one of the parameters of the function being invoked, then re turn the parameter
4423 * element representing the parameter to which the value of this expression wi ll be bound. 4671 * element representing the parameter to which the value of this expression wi ll be bound.
4424 * Otherwise, return `null`. 4672 * Otherwise, return `null`.
4425 * 4673 *
4426 * @return the parameter element representing the parameter to which the value of this expression 4674 * @return the parameter element representing the parameter to which the value of this expression
4427 * will be bound 4675 * will be bound
4428 */ 4676 */
4429 ParameterElement get staticParameterElement { 4677 ParameterElement get staticParameterElement {
4430 ASTNode parent = this.parent; 4678 ASTNode parent = this.parent;
4431 if (parent is ArgumentList) { 4679 if (parent is ArgumentList) {
4432 return ((parent as ArgumentList)).getStaticParameterElementFor(this); 4680 return (parent as ArgumentList).getStaticParameterElementFor(this);
4433 } else if (parent is IndexExpression) { 4681 } else if (parent is IndexExpression) {
4434 IndexExpression indexExpression = parent as IndexExpression; 4682 IndexExpression indexExpression = parent as IndexExpression;
4435 if (identical(indexExpression.index, this)) { 4683 if (identical(indexExpression.index, this)) {
4436 return indexExpression.staticParameterElementForIndex; 4684 return indexExpression.staticParameterElementForIndex;
4437 } 4685 }
4438 } else if (parent is BinaryExpression) { 4686 } else if (parent is BinaryExpression) {
4439 BinaryExpression binaryExpression = parent as BinaryExpression; 4687 BinaryExpression binaryExpression = parent as BinaryExpression;
4440 if (identical(binaryExpression.rightOperand, this)) { 4688 if (identical(binaryExpression.rightOperand, this)) {
4441 return binaryExpression.staticParameterElementForRightOperand; 4689 return binaryExpression.staticParameterElementForRightOperand;
4442 } 4690 }
4443 } else if (parent is AssignmentExpression) { 4691 } else if (parent is AssignmentExpression) {
4444 AssignmentExpression assignmentExpression = parent as AssignmentExpression ; 4692 AssignmentExpression assignmentExpression = parent as AssignmentExpression ;
4445 if (identical(assignmentExpression.rightHandSide, this)) { 4693 if (identical(assignmentExpression.rightHandSide, this)) {
4446 return assignmentExpression.staticParameterElementForRightHandSide; 4694 return assignmentExpression.staticParameterElementForRightHandSide;
4447 } 4695 }
4448 } else if (parent is PrefixExpression) { 4696 } else if (parent is PrefixExpression) {
4449 return ((parent as PrefixExpression)).staticParameterElementForOperand; 4697 return (parent as PrefixExpression).staticParameterElementForOperand;
4450 } else if (parent is PostfixExpression) { 4698 } else if (parent is PostfixExpression) {
4451 return ((parent as PostfixExpression)).staticParameterElementForOperand; 4699 return (parent as PostfixExpression).staticParameterElementForOperand;
4452 } 4700 }
4453 return null; 4701 return null;
4454 } 4702 }
4455 4703
4456 /** 4704 /**
4457 * Return `true` if this expression is syntactically valid for the LHS of an 4705 * Return `true` if this expression is syntactically valid for the LHS of an
4458 * [AssignmentExpression]. 4706 * [AssignmentExpression].
4459 * 4707 *
4460 * @return `true` if this expression matches the `assignableExpression` produc tion 4708 * @return `true` if this expression matches the `assignableExpression` produc tion
4461 */ 4709 */
4462 bool get isAssignable => false; 4710 bool get isAssignable => false;
4463 } 4711 }
4712
4464 /** 4713 /**
4465 * Instances of the class `ExpressionFunctionBody` represent a function body con sisting of a 4714 * Instances of the class `ExpressionFunctionBody` represent a function body con sisting of a
4466 * single expression. 4715 * single expression.
4467 * 4716 *
4468 * <pre> 4717 * <pre>
4469 * expressionFunctionBody ::= 4718 * expressionFunctionBody ::=
4470 * '=>' [Expression] ';' 4719 * '=>' [Expression] ';'
4471 * </pre> 4720 * </pre>
4472 * 4721 *
4473 * @coverage dart.engine.ast 4722 * @coverage dart.engine.ast
4474 */ 4723 */
4475 class ExpressionFunctionBody extends FunctionBody { 4724 class ExpressionFunctionBody extends FunctionBody {
4476
4477 /** 4725 /**
4478 * The token introducing the expression that represents the body of the functi on. 4726 * The token introducing the expression that represents the body of the functi on.
4479 */ 4727 */
4480 Token functionDefinition; 4728 Token functionDefinition;
4481 4729
4482 /** 4730 /**
4483 * The expression representing the body of the function. 4731 * The expression representing the body of the function.
4484 */ 4732 */
4485 Expression _expression; 4733 Expression _expression;
4486 4734
(...skipping 18 matching lines...) Expand all
4505 4753
4506 /** 4754 /**
4507 * Initialize a newly created function body consisting of a block of statement s. 4755 * Initialize a newly created function body consisting of a block of statement s.
4508 * 4756 *
4509 * @param functionDefinition the token introducing the expression that represe nts the body of the 4757 * @param functionDefinition the token introducing the expression that represe nts the body of the
4510 * function 4758 * function
4511 * @param expression the expression representing the body of the function 4759 * @param expression the expression representing the body of the function
4512 * @param semicolon the semicolon terminating the statement 4760 * @param semicolon the semicolon terminating the statement
4513 */ 4761 */
4514 ExpressionFunctionBody({Token functionDefinition, Expression expression, Token semicolon}) : this.full(functionDefinition, expression, semicolon); 4762 ExpressionFunctionBody({Token functionDefinition, Expression expression, Token semicolon}) : this.full(functionDefinition, expression, semicolon);
4763
4515 accept(ASTVisitor visitor) => visitor.visitExpressionFunctionBody(this); 4764 accept(ASTVisitor visitor) => visitor.visitExpressionFunctionBody(this);
4765
4516 Token get beginToken => functionDefinition; 4766 Token get beginToken => functionDefinition;
4767
4517 Token get endToken { 4768 Token get endToken {
4518 if (semicolon != null) { 4769 if (semicolon != null) {
4519 return semicolon; 4770 return semicolon;
4520 } 4771 }
4521 return _expression.endToken; 4772 return _expression.endToken;
4522 } 4773 }
4523 4774
4524 /** 4775 /**
4525 * Return the expression representing the body of the function. 4776 * Return the expression representing the body of the function.
4526 * 4777 *
4527 * @return the expression representing the body of the function 4778 * @return the expression representing the body of the function
4528 */ 4779 */
4529 Expression get expression => _expression; 4780 Expression get expression => _expression;
4530 4781
4531 /** 4782 /**
4532 * Set the expression representing the body of the function to the given expre ssion. 4783 * Set the expression representing the body of the function to the given expre ssion.
4533 * 4784 *
4534 * @param expression the expression representing the body of the function 4785 * @param expression the expression representing the body of the function
4535 */ 4786 */
4536 void set expression(Expression expression) { 4787 void set expression(Expression expression) {
4537 this._expression = becomeParentOf(expression); 4788 this._expression = becomeParentOf(expression);
4538 } 4789 }
4790
4539 void visitChildren(ASTVisitor visitor) { 4791 void visitChildren(ASTVisitor visitor) {
4540 safelyVisitChild(_expression, visitor); 4792 safelyVisitChild(_expression, visitor);
4541 } 4793 }
4542 } 4794 }
4795
4543 /** 4796 /**
4544 * Instances of the class `ExpressionStatement` wrap an expression as a statemen t. 4797 * Instances of the class `ExpressionStatement` wrap an expression as a statemen t.
4545 * 4798 *
4546 * <pre> 4799 * <pre>
4547 * expressionStatement ::= 4800 * expressionStatement ::=
4548 * [Expression]? ';' 4801 * [Expression]? ';'
4549 * </pre> 4802 * </pre>
4550 * 4803 *
4551 * @coverage dart.engine.ast 4804 * @coverage dart.engine.ast
4552 */ 4805 */
4553 class ExpressionStatement extends Statement { 4806 class ExpressionStatement extends Statement {
4554
4555 /** 4807 /**
4556 * The expression that comprises the statement. 4808 * The expression that comprises the statement.
4557 */ 4809 */
4558 Expression _expression; 4810 Expression _expression;
4559 4811
4560 /** 4812 /**
4561 * The semicolon terminating the statement, or `null` if the expression is a f unction 4813 * The semicolon terminating the statement, or `null` if the expression is a f unction
4562 * expression and therefore isn't followed by a semicolon. 4814 * expression and therefore isn't followed by a semicolon.
4563 */ 4815 */
4564 Token semicolon; 4816 Token semicolon;
4565 4817
4566 /** 4818 /**
4567 * Initialize a newly created expression statement. 4819 * Initialize a newly created expression statement.
4568 * 4820 *
4569 * @param expression the expression that comprises the statement 4821 * @param expression the expression that comprises the statement
4570 * @param semicolon the semicolon terminating the statement 4822 * @param semicolon the semicolon terminating the statement
4571 */ 4823 */
4572 ExpressionStatement.full(Expression expression, Token semicolon) { 4824 ExpressionStatement.full(Expression expression, Token semicolon) {
4573 this._expression = becomeParentOf(expression); 4825 this._expression = becomeParentOf(expression);
4574 this.semicolon = semicolon; 4826 this.semicolon = semicolon;
4575 } 4827 }
4576 4828
4577 /** 4829 /**
4578 * Initialize a newly created expression statement. 4830 * Initialize a newly created expression statement.
4579 * 4831 *
4580 * @param expression the expression that comprises the statement 4832 * @param expression the expression that comprises the statement
4581 * @param semicolon the semicolon terminating the statement 4833 * @param semicolon the semicolon terminating the statement
4582 */ 4834 */
4583 ExpressionStatement({Expression expression, Token semicolon}) : this.full(expr ession, semicolon); 4835 ExpressionStatement({Expression expression, Token semicolon}) : this.full(expr ession, semicolon);
4836
4584 accept(ASTVisitor visitor) => visitor.visitExpressionStatement(this); 4837 accept(ASTVisitor visitor) => visitor.visitExpressionStatement(this);
4838
4585 Token get beginToken => _expression.beginToken; 4839 Token get beginToken => _expression.beginToken;
4840
4586 Token get endToken { 4841 Token get endToken {
4587 if (semicolon != null) { 4842 if (semicolon != null) {
4588 return semicolon; 4843 return semicolon;
4589 } 4844 }
4590 return _expression.endToken; 4845 return _expression.endToken;
4591 } 4846 }
4592 4847
4593 /** 4848 /**
4594 * Return the expression that comprises the statement. 4849 * Return the expression that comprises the statement.
4595 * 4850 *
4596 * @return the expression that comprises the statement 4851 * @return the expression that comprises the statement
4597 */ 4852 */
4598 Expression get expression => _expression; 4853 Expression get expression => _expression;
4854
4599 bool get isSynthetic => _expression.isSynthetic && semicolon.isSynthetic; 4855 bool get isSynthetic => _expression.isSynthetic && semicolon.isSynthetic;
4600 4856
4601 /** 4857 /**
4602 * Set the expression that comprises the statement to the given expression. 4858 * Set the expression that comprises the statement to the given expression.
4603 * 4859 *
4604 * @param expression the expression that comprises the statement 4860 * @param expression the expression that comprises the statement
4605 */ 4861 */
4606 void set expression(Expression expression) { 4862 void set expression(Expression expression) {
4607 this._expression = becomeParentOf(expression); 4863 this._expression = becomeParentOf(expression);
4608 } 4864 }
4865
4609 void visitChildren(ASTVisitor visitor) { 4866 void visitChildren(ASTVisitor visitor) {
4610 safelyVisitChild(_expression, visitor); 4867 safelyVisitChild(_expression, visitor);
4611 } 4868 }
4612 } 4869 }
4870
4613 /** 4871 /**
4614 * Instances of the class `ExtendsClause` represent the "extends" clause in a cl ass 4872 * Instances of the class `ExtendsClause` represent the "extends" clause in a cl ass
4615 * declaration. 4873 * declaration.
4616 * 4874 *
4617 * <pre> 4875 * <pre>
4618 * extendsClause ::= 4876 * extendsClause ::=
4619 * 'extends' [TypeName] 4877 * 'extends' [TypeName]
4620 * </pre> 4878 * </pre>
4621 * 4879 *
4622 * @coverage dart.engine.ast 4880 * @coverage dart.engine.ast
4623 */ 4881 */
4624 class ExtendsClause extends ASTNode { 4882 class ExtendsClause extends ASTNode {
4625
4626 /** 4883 /**
4627 * The token representing the 'extends' keyword. 4884 * The token representing the 'extends' keyword.
4628 */ 4885 */
4629 Token keyword; 4886 Token keyword;
4630 4887
4631 /** 4888 /**
4632 * The name of the class that is being extended. 4889 * The name of the class that is being extended.
4633 */ 4890 */
4634 TypeName _superclass; 4891 TypeName _superclass;
4635 4892
4636 /** 4893 /**
4637 * Initialize a newly created extends clause. 4894 * Initialize a newly created extends clause.
4638 * 4895 *
4639 * @param keyword the token representing the 'extends' keyword 4896 * @param keyword the token representing the 'extends' keyword
4640 * @param superclass the name of the class that is being extended 4897 * @param superclass the name of the class that is being extended
4641 */ 4898 */
4642 ExtendsClause.full(Token keyword, TypeName superclass) { 4899 ExtendsClause.full(Token keyword, TypeName superclass) {
4643 this.keyword = keyword; 4900 this.keyword = keyword;
4644 this._superclass = becomeParentOf(superclass); 4901 this._superclass = becomeParentOf(superclass);
4645 } 4902 }
4646 4903
4647 /** 4904 /**
4648 * Initialize a newly created extends clause. 4905 * Initialize a newly created extends clause.
4649 * 4906 *
4650 * @param keyword the token representing the 'extends' keyword 4907 * @param keyword the token representing the 'extends' keyword
4651 * @param superclass the name of the class that is being extended 4908 * @param superclass the name of the class that is being extended
4652 */ 4909 */
4653 ExtendsClause({Token keyword, TypeName superclass}) : this.full(keyword, super class); 4910 ExtendsClause({Token keyword, TypeName superclass}) : this.full(keyword, super class);
4911
4654 accept(ASTVisitor visitor) => visitor.visitExtendsClause(this); 4912 accept(ASTVisitor visitor) => visitor.visitExtendsClause(this);
4913
4655 Token get beginToken => keyword; 4914 Token get beginToken => keyword;
4915
4656 Token get endToken => _superclass.endToken; 4916 Token get endToken => _superclass.endToken;
4657 4917
4658 /** 4918 /**
4659 * Return the name of the class that is being extended. 4919 * Return the name of the class that is being extended.
4660 * 4920 *
4661 * @return the name of the class that is being extended 4921 * @return the name of the class that is being extended
4662 */ 4922 */
4663 TypeName get superclass => _superclass; 4923 TypeName get superclass => _superclass;
4664 4924
4665 /** 4925 /**
4666 * Set the name of the class that is being extended to the given name. 4926 * Set the name of the class that is being extended to the given name.
4667 * 4927 *
4668 * @param name the name of the class that is being extended 4928 * @param name the name of the class that is being extended
4669 */ 4929 */
4670 void set superclass(TypeName name) { 4930 void set superclass(TypeName name) {
4671 _superclass = becomeParentOf(name); 4931 _superclass = becomeParentOf(name);
4672 } 4932 }
4933
4673 void visitChildren(ASTVisitor visitor) { 4934 void visitChildren(ASTVisitor visitor) {
4674 safelyVisitChild(_superclass, visitor); 4935 safelyVisitChild(_superclass, visitor);
4675 } 4936 }
4676 } 4937 }
4938
4677 /** 4939 /**
4678 * Instances of the class `FieldDeclaration` represent the declaration of one or more fields 4940 * Instances of the class `FieldDeclaration` represent the declaration of one or more fields
4679 * of the same type. 4941 * of the same type.
4680 * 4942 *
4681 * <pre> 4943 * <pre>
4682 * fieldDeclaration ::= 4944 * fieldDeclaration ::=
4683 * 'static'? [VariableDeclarationList] ';' 4945 * 'static'? [VariableDeclarationList] ';'
4684 * </pre> 4946 * </pre>
4685 * 4947 *
4686 * @coverage dart.engine.ast 4948 * @coverage dart.engine.ast
4687 */ 4949 */
4688 class FieldDeclaration extends ClassMember { 4950 class FieldDeclaration extends ClassMember {
4689
4690 /** 4951 /**
4691 * The token representing the 'static' keyword, or `null` if the fields are no t static. 4952 * The token representing the 'static' keyword, or `null` if the fields are no t static.
4692 */ 4953 */
4693 Token staticKeyword; 4954 Token staticKeyword;
4694 4955
4695 /** 4956 /**
4696 * The fields being declared. 4957 * The fields being declared.
4697 */ 4958 */
4698 VariableDeclarationList _fieldList; 4959 VariableDeclarationList _fieldList;
4699 4960
(...skipping 20 matching lines...) Expand all
4720 /** 4981 /**
4721 * Initialize a newly created field declaration. 4982 * Initialize a newly created field declaration.
4722 * 4983 *
4723 * @param comment the documentation comment associated with this field 4984 * @param comment the documentation comment associated with this field
4724 * @param metadata the annotations associated with this field 4985 * @param metadata the annotations associated with this field
4725 * @param staticKeyword the token representing the 'static' keyword 4986 * @param staticKeyword the token representing the 'static' keyword
4726 * @param fieldList the fields being declared 4987 * @param fieldList the fields being declared
4727 * @param semicolon the semicolon terminating the declaration 4988 * @param semicolon the semicolon terminating the declaration
4728 */ 4989 */
4729 FieldDeclaration({Comment comment, List<Annotation> metadata, Token staticKeyw ord, VariableDeclarationList fieldList, Token semicolon}) : this.full(comment, m etadata, staticKeyword, fieldList, semicolon); 4990 FieldDeclaration({Comment comment, List<Annotation> metadata, Token staticKeyw ord, VariableDeclarationList fieldList, Token semicolon}) : this.full(comment, m etadata, staticKeyword, fieldList, semicolon);
4991
4730 accept(ASTVisitor visitor) => visitor.visitFieldDeclaration(this); 4992 accept(ASTVisitor visitor) => visitor.visitFieldDeclaration(this);
4993
4731 Element get element => null; 4994 Element get element => null;
4995
4732 Token get endToken => semicolon; 4996 Token get endToken => semicolon;
4733 4997
4734 /** 4998 /**
4735 * Return the fields being declared. 4999 * Return the fields being declared.
4736 * 5000 *
4737 * @return the fields being declared 5001 * @return the fields being declared
4738 */ 5002 */
4739 VariableDeclarationList get fields => _fieldList; 5003 VariableDeclarationList get fields => _fieldList;
4740 5004
4741 /** 5005 /**
4742 * Return `true` if the fields are static. 5006 * Return `true` if the fields are static.
4743 * 5007 *
4744 * @return `true` if the fields are declared to be static 5008 * @return `true` if the fields are declared to be static
4745 */ 5009 */
4746 bool get isStatic => staticKeyword != null; 5010 bool get isStatic => staticKeyword != null;
4747 5011
4748 /** 5012 /**
4749 * Set the fields being declared to the given list of variables. 5013 * Set the fields being declared to the given list of variables.
4750 * 5014 *
4751 * @param fieldList the fields being declared 5015 * @param fieldList the fields being declared
4752 */ 5016 */
4753 void set fields(VariableDeclarationList fieldList) { 5017 void set fields(VariableDeclarationList fieldList) {
4754 fieldList = becomeParentOf(fieldList); 5018 fieldList = becomeParentOf(fieldList);
4755 } 5019 }
5020
4756 void visitChildren(ASTVisitor visitor) { 5021 void visitChildren(ASTVisitor visitor) {
4757 super.visitChildren(visitor); 5022 super.visitChildren(visitor);
4758 safelyVisitChild(_fieldList, visitor); 5023 safelyVisitChild(_fieldList, visitor);
4759 } 5024 }
5025
4760 Token get firstTokenAfterCommentAndMetadata { 5026 Token get firstTokenAfterCommentAndMetadata {
4761 if (staticKeyword != null) { 5027 if (staticKeyword != null) {
4762 return staticKeyword; 5028 return staticKeyword;
4763 } 5029 }
4764 return _fieldList.beginToken; 5030 return _fieldList.beginToken;
4765 } 5031 }
4766 } 5032 }
5033
4767 /** 5034 /**
4768 * Instances of the class `FieldFormalParameter` represent a field formal parame ter. 5035 * Instances of the class `FieldFormalParameter` represent a field formal parame ter.
4769 * 5036 *
4770 * <pre> 5037 * <pre>
4771 * fieldFormalParameter ::= 5038 * fieldFormalParameter ::=
4772 * ('final' [TypeName] | 'const' [TypeName] | 'var' | [TypeName])? 'this' '. ' [SimpleIdentifier] [FormalParameterList]? 5039 * ('final' [TypeName] | 'const' [TypeName] | 'var' | [TypeName])? 'this' '. ' [SimpleIdentifier] [FormalParameterList]?
4773 * </pre> 5040 * </pre>
4774 * 5041 *
4775 * @coverage dart.engine.ast 5042 * @coverage dart.engine.ast
4776 */ 5043 */
4777 class FieldFormalParameter extends NormalFormalParameter { 5044 class FieldFormalParameter extends NormalFormalParameter {
4778
4779 /** 5045 /**
4780 * The token representing either the 'final', 'const' or 'var' keyword, or `nu ll` if no 5046 * The token representing either the 'final', 'const' or 'var' keyword, or `nu ll` if no
4781 * keyword was used. 5047 * keyword was used.
4782 */ 5048 */
4783 Token keyword; 5049 Token keyword;
4784 5050
4785 /** 5051 /**
4786 * The name of the declared type of the parameter, or `null` if the parameter does not have 5052 * The name of the declared type of the parameter, or `null` if the parameter does not have
4787 * a declared type. 5053 * a declared type.
4788 */ 5054 */
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
4832 * @param metadata the annotations associated with this parameter 5098 * @param metadata the annotations associated with this parameter
4833 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 5099 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
4834 * @param type the name of the declared type of the parameter 5100 * @param type the name of the declared type of the parameter
4835 * @param thisToken the token representing the 'this' keyword 5101 * @param thisToken the token representing the 'this' keyword
4836 * @param period the token representing the period 5102 * @param period the token representing the period
4837 * @param identifier the name of the parameter being declared 5103 * @param identifier the name of the parameter being declared
4838 * @param parameters the parameters of the function-typed parameter, or `null` if this is 5104 * @param parameters the parameters of the function-typed parameter, or `null` if this is
4839 * not a function-typed field formal parameter 5105 * not a function-typed field formal parameter
4840 */ 5106 */
4841 FieldFormalParameter({Comment comment, List<Annotation> metadata, Token keywor d, TypeName type, Token thisToken, Token period, SimpleIdentifier identifier, Fo rmalParameterList parameters}) : this.full(comment, metadata, keyword, type, thi sToken, period, identifier, parameters); 5107 FieldFormalParameter({Comment comment, List<Annotation> metadata, Token keywor d, TypeName type, Token thisToken, Token period, SimpleIdentifier identifier, Fo rmalParameterList parameters}) : this.full(comment, metadata, keyword, type, thi sToken, period, identifier, parameters);
5108
4842 accept(ASTVisitor visitor) => visitor.visitFieldFormalParameter(this); 5109 accept(ASTVisitor visitor) => visitor.visitFieldFormalParameter(this);
5110
4843 Token get beginToken { 5111 Token get beginToken {
4844 if (keyword != null) { 5112 if (keyword != null) {
4845 return keyword; 5113 return keyword;
4846 } else if (_type != null) { 5114 } else if (_type != null) {
4847 return _type.beginToken; 5115 return _type.beginToken;
4848 } 5116 }
4849 return thisToken; 5117 return thisToken;
4850 } 5118 }
5119
4851 Token get endToken => identifier.endToken; 5120 Token get endToken => identifier.endToken;
4852 5121
4853 /** 5122 /**
4854 * Return the parameters of the function-typed parameter, or `null` if this is not a 5123 * Return the parameters of the function-typed parameter, or `null` if this is not a
4855 * function-typed field formal parameter. 5124 * function-typed field formal parameter.
4856 * 5125 *
4857 * @return the parameters of the function-typed parameter 5126 * @return the parameters of the function-typed parameter
4858 */ 5127 */
4859 FormalParameterList get parameters => _parameters; 5128 FormalParameterList get parameters => _parameters;
4860 5129
4861 /** 5130 /**
4862 * Return the name of the declared type of the parameter, or `null` if the par ameter does 5131 * Return the name of the declared type of the parameter, or `null` if the par ameter does
4863 * not have a declared type. Note that if this is a function-typed field forma l parameter this is 5132 * not have a declared type. Note that if this is a function-typed field forma l parameter this is
4864 * the return type of the function. 5133 * the return type of the function.
4865 * 5134 *
4866 * @return the name of the declared type of the parameter 5135 * @return the name of the declared type of the parameter
4867 */ 5136 */
4868 TypeName get type => _type; 5137 TypeName get type => _type;
4869 bool get isConst => (keyword is KeywordToken) && identical(((keyword as Keywor dToken)).keyword, Keyword.CONST); 5138
4870 bool get isFinal => (keyword is KeywordToken) && identical(((keyword as Keywor dToken)).keyword, Keyword.FINAL); 5139 bool get isConst => (keyword is KeywordToken) && identical((keyword as Keyword Token).keyword, Keyword.CONST);
5140
5141 bool get isFinal => (keyword is KeywordToken) && identical((keyword as Keyword Token).keyword, Keyword.FINAL);
4871 5142
4872 /** 5143 /**
4873 * Set the parameters of the function-typed parameter to the given parameters. 5144 * Set the parameters of the function-typed parameter to the given parameters.
4874 * 5145 *
4875 * @param parameters the parameters of the function-typed parameter 5146 * @param parameters the parameters of the function-typed parameter
4876 */ 5147 */
4877 void set parameters(FormalParameterList parameters) { 5148 void set parameters(FormalParameterList parameters) {
4878 this._parameters = becomeParentOf(parameters); 5149 this._parameters = becomeParentOf(parameters);
4879 } 5150 }
4880 5151
4881 /** 5152 /**
4882 * Set the name of the declared type of the parameter to the given type name. 5153 * Set the name of the declared type of the parameter to the given type name.
4883 * 5154 *
4884 * @param typeName the name of the declared type of the parameter 5155 * @param typeName the name of the declared type of the parameter
4885 */ 5156 */
4886 void set type(TypeName typeName) { 5157 void set type(TypeName typeName) {
4887 _type = becomeParentOf(typeName); 5158 _type = becomeParentOf(typeName);
4888 } 5159 }
5160
4889 void visitChildren(ASTVisitor visitor) { 5161 void visitChildren(ASTVisitor visitor) {
4890 super.visitChildren(visitor); 5162 super.visitChildren(visitor);
4891 safelyVisitChild(_type, visitor); 5163 safelyVisitChild(_type, visitor);
4892 safelyVisitChild(identifier, visitor); 5164 safelyVisitChild(identifier, visitor);
4893 safelyVisitChild(_parameters, visitor); 5165 safelyVisitChild(_parameters, visitor);
4894 } 5166 }
4895 } 5167 }
5168
4896 /** 5169 /**
4897 * Instances of the class `ForEachStatement` represent a for-each statement. 5170 * Instances of the class `ForEachStatement` represent a for-each statement.
4898 * 5171 *
4899 * <pre> 5172 * <pre>
4900 * forEachStatement ::= 5173 * forEachStatement ::=
4901 * 'for' '(' [DeclaredIdentifier] 'in' [Expression] ')' [Block] 5174 * 'for' '(' [DeclaredIdentifier] 'in' [Expression] ')' [Block]
4902 * | 'for' '(' [SimpleIdentifier] 'in' [Expression] ')' [Block] 5175 * | 'for' '(' [SimpleIdentifier] 'in' [Expression] ')' [Block]
4903 * </pre> 5176 * </pre>
4904 * 5177 *
4905 * @coverage dart.engine.ast 5178 * @coverage dart.engine.ast
4906 */ 5179 */
4907 class ForEachStatement extends Statement { 5180 class ForEachStatement extends Statement {
4908
4909 /** 5181 /**
4910 * The token representing the 'for' keyword. 5182 * The token representing the 'for' keyword.
4911 */ 5183 */
4912 Token forKeyword; 5184 Token forKeyword;
4913 5185
4914 /** 5186 /**
4915 * The left parenthesis. 5187 * The left parenthesis.
4916 */ 5188 */
4917 Token leftParenthesis; 5189 Token leftParenthesis;
4918 5190
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
5003 * Initialize a newly created for-each statement. 5275 * Initialize a newly created for-each statement.
5004 * 5276 *
5005 * @param forKeyword the token representing the 'for' keyword 5277 * @param forKeyword the token representing the 'for' keyword
5006 * @param leftParenthesis the left parenthesis 5278 * @param leftParenthesis the left parenthesis
5007 * @param identifier the loop variable 5279 * @param identifier the loop variable
5008 * @param iterator the expression evaluated to produce the iterator 5280 * @param iterator the expression evaluated to produce the iterator
5009 * @param rightParenthesis the right parenthesis 5281 * @param rightParenthesis the right parenthesis
5010 * @param body the body of the loop 5282 * @param body the body of the loop
5011 */ 5283 */
5012 ForEachStatement.con2({Token forKeyword, Token leftParenthesis, SimpleIdentifi er identifier, Token inKeyword, Expression iterator, Token rightParenthesis, Sta tement body}) : this.con2_full(forKeyword, leftParenthesis, identifier, inKeywor d, iterator, rightParenthesis, body); 5284 ForEachStatement.con2({Token forKeyword, Token leftParenthesis, SimpleIdentifi er identifier, Token inKeyword, Expression iterator, Token rightParenthesis, Sta tement body}) : this.con2_full(forKeyword, leftParenthesis, identifier, inKeywor d, iterator, rightParenthesis, body);
5285
5013 accept(ASTVisitor visitor) => visitor.visitForEachStatement(this); 5286 accept(ASTVisitor visitor) => visitor.visitForEachStatement(this);
5287
5014 Token get beginToken => forKeyword; 5288 Token get beginToken => forKeyword;
5015 5289
5016 /** 5290 /**
5017 * Return the body of the loop. 5291 * Return the body of the loop.
5018 * 5292 *
5019 * @return the body of the loop 5293 * @return the body of the loop
5020 */ 5294 */
5021 Statement get body => _body; 5295 Statement get body => _body;
5296
5022 Token get endToken => _body.endToken; 5297 Token get endToken => _body.endToken;
5023 5298
5024 /** 5299 /**
5025 * Return the loop variable, or `null` if the loop variable is declared in the 'for'. 5300 * Return the loop variable, or `null` if the loop variable is declared in the 'for'.
5026 * 5301 *
5027 * @return the loop variable 5302 * @return the loop variable
5028 */ 5303 */
5029 SimpleIdentifier get identifier => _identifier; 5304 SimpleIdentifier get identifier => _identifier;
5030 5305
5031 /** 5306 /**
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
5071 } 5346 }
5072 5347
5073 /** 5348 /**
5074 * Set the declaration of the loop variable to the given variable. 5349 * Set the declaration of the loop variable to the given variable.
5075 * 5350 *
5076 * @param variable the declaration of the loop variable 5351 * @param variable the declaration of the loop variable
5077 */ 5352 */
5078 void set loopVariable(DeclaredIdentifier variable) { 5353 void set loopVariable(DeclaredIdentifier variable) {
5079 _loopVariable = becomeParentOf(variable); 5354 _loopVariable = becomeParentOf(variable);
5080 } 5355 }
5356
5081 void visitChildren(ASTVisitor visitor) { 5357 void visitChildren(ASTVisitor visitor) {
5082 safelyVisitChild(_loopVariable, visitor); 5358 safelyVisitChild(_loopVariable, visitor);
5083 safelyVisitChild(_identifier, visitor); 5359 safelyVisitChild(_identifier, visitor);
5084 safelyVisitChild(_iterator, visitor); 5360 safelyVisitChild(_iterator, visitor);
5085 safelyVisitChild(_body, visitor); 5361 safelyVisitChild(_body, visitor);
5086 } 5362 }
5087 } 5363 }
5364
5088 /** 5365 /**
5089 * Instances of the class `ForStatement` represent a for statement. 5366 * Instances of the class `ForStatement` represent a for statement.
5090 * 5367 *
5091 * <pre> 5368 * <pre>
5092 * forStatement ::= 5369 * forStatement ::=
5093 * 'for' '(' forLoopParts ')' [Statement] 5370 * 'for' '(' forLoopParts ')' [Statement]
5094 * 5371 *
5095 * forLoopParts ::= 5372 * forLoopParts ::=
5096 * forInitializerStatement ';' [Expression]? ';' [Expression]? 5373 * forInitializerStatement ';' [Expression]? ';' [Expression]?
5097 * 5374 *
5098 * forInitializerStatement ::= 5375 * forInitializerStatement ::=
5099 * [DefaultFormalParameter] 5376 * [DefaultFormalParameter]
5100 * | [Expression]? 5377 * | [Expression]?
5101 * </pre> 5378 * </pre>
5102 * 5379 *
5103 * @coverage dart.engine.ast 5380 * @coverage dart.engine.ast
5104 */ 5381 */
5105 class ForStatement extends Statement { 5382 class ForStatement extends Statement {
5106
5107 /** 5383 /**
5108 * The token representing the 'for' keyword. 5384 * The token representing the 'for' keyword.
5109 */ 5385 */
5110 Token forKeyword; 5386 Token forKeyword;
5111 5387
5112 /** 5388 /**
5113 * The left parenthesis. 5389 * The left parenthesis.
5114 */ 5390 */
5115 Token leftParenthesis; 5391 Token leftParenthesis;
5116 5392
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
5195 * @param variableList the declaration of the loop variables 5471 * @param variableList the declaration of the loop variables
5196 * @param initialization the initialization expression 5472 * @param initialization the initialization expression
5197 * @param leftSeparator the semicolon separating the initializer and the condi tion 5473 * @param leftSeparator the semicolon separating the initializer and the condi tion
5198 * @param condition the condition used to determine when to terminate the loop 5474 * @param condition the condition used to determine when to terminate the loop
5199 * @param rightSeparator the semicolon separating the condition and the update r 5475 * @param rightSeparator the semicolon separating the condition and the update r
5200 * @param updaters the list of expressions run after each execution of the loo p body 5476 * @param updaters the list of expressions run after each execution of the loo p body
5201 * @param rightParenthesis the right parenthesis 5477 * @param rightParenthesis the right parenthesis
5202 * @param body the body of the loop 5478 * @param body the body of the loop
5203 */ 5479 */
5204 ForStatement({Token forKeyword, Token leftParenthesis, VariableDeclarationList variableList, Expression initialization, Token leftSeparator, Expression condit ion, Token rightSeparator, List<Expression> updaters, Token rightParenthesis, St atement body}) : this.full(forKeyword, leftParenthesis, variableList, initializa tion, leftSeparator, condition, rightSeparator, updaters, rightParenthesis, body ); 5480 ForStatement({Token forKeyword, Token leftParenthesis, VariableDeclarationList variableList, Expression initialization, Token leftSeparator, Expression condit ion, Token rightSeparator, List<Expression> updaters, Token rightParenthesis, St atement body}) : this.full(forKeyword, leftParenthesis, variableList, initializa tion, leftSeparator, condition, rightSeparator, updaters, rightParenthesis, body );
5481
5205 accept(ASTVisitor visitor) => visitor.visitForStatement(this); 5482 accept(ASTVisitor visitor) => visitor.visitForStatement(this);
5483
5206 Token get beginToken => forKeyword; 5484 Token get beginToken => forKeyword;
5207 5485
5208 /** 5486 /**
5209 * Return the body of the loop. 5487 * Return the body of the loop.
5210 * 5488 *
5211 * @return the body of the loop 5489 * @return the body of the loop
5212 */ 5490 */
5213 Statement get body => _body; 5491 Statement get body => _body;
5214 5492
5215 /** 5493 /**
5216 * Return the condition used to determine when to terminate the loop, or `null ` if there is 5494 * Return the condition used to determine when to terminate the loop, or `null ` if there is
5217 * no condition. 5495 * no condition.
5218 * 5496 *
5219 * @return the condition used to determine when to terminate the loop 5497 * @return the condition used to determine when to terminate the loop
5220 */ 5498 */
5221 Expression get condition => _condition; 5499 Expression get condition => _condition;
5500
5222 Token get endToken => _body.endToken; 5501 Token get endToken => _body.endToken;
5223 5502
5224 /** 5503 /**
5225 * Return the initialization expression, or `null` if there is no initializati on expression. 5504 * Return the initialization expression, or `null` if there is no initializati on expression.
5226 * 5505 *
5227 * @return the initialization expression 5506 * @return the initialization expression
5228 */ 5507 */
5229 Expression get initialization => _initialization; 5508 Expression get initialization => _initialization;
5230 5509
5231 /** 5510 /**
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
5263 } 5542 }
5264 5543
5265 /** 5544 /**
5266 * Set the declaration of the loop variables to the given parameter. 5545 * Set the declaration of the loop variables to the given parameter.
5267 * 5546 *
5268 * @param variableList the declaration of the loop variables 5547 * @param variableList the declaration of the loop variables
5269 */ 5548 */
5270 void set variables(VariableDeclarationList variableList) { 5549 void set variables(VariableDeclarationList variableList) {
5271 variableList = becomeParentOf(variableList); 5550 variableList = becomeParentOf(variableList);
5272 } 5551 }
5552
5273 void visitChildren(ASTVisitor visitor) { 5553 void visitChildren(ASTVisitor visitor) {
5274 safelyVisitChild(_variableList, visitor); 5554 safelyVisitChild(_variableList, visitor);
5275 safelyVisitChild(_initialization, visitor); 5555 safelyVisitChild(_initialization, visitor);
5276 safelyVisitChild(_condition, visitor); 5556 safelyVisitChild(_condition, visitor);
5277 updaters.accept(visitor); 5557 updaters.accept(visitor);
5278 safelyVisitChild(_body, visitor); 5558 safelyVisitChild(_body, visitor);
5279 } 5559 }
5280 } 5560 }
5561
5281 /** 5562 /**
5282 * The abstract class `FormalParameter` defines the behavior of objects represen ting a 5563 * The abstract class `FormalParameter` defines the behavior of objects represen ting a
5283 * parameter to a function. 5564 * parameter to a function.
5284 * 5565 *
5285 * <pre> 5566 * <pre>
5286 * formalParameter ::= 5567 * formalParameter ::=
5287 * [NormalFormalParameter] 5568 * [NormalFormalParameter]
5288 * | [DefaultFormalParameter] 5569 * | [DefaultFormalParameter]
5289 * | [DefaultFormalParameter] 5570 * | [DefaultFormalParameter]
5290 * </pre> 5571 * </pre>
5291 * 5572 *
5292 * @coverage dart.engine.ast 5573 * @coverage dart.engine.ast
5293 */ 5574 */
5294 abstract class FormalParameter extends ASTNode { 5575 abstract class FormalParameter extends ASTNode {
5295
5296 /** 5576 /**
5297 * Return the element representing this parameter, or `null` if this parameter has not been 5577 * Return the element representing this parameter, or `null` if this parameter has not been
5298 * resolved. 5578 * resolved.
5299 * 5579 *
5300 * @return the element representing this parameter 5580 * @return the element representing this parameter
5301 */ 5581 */
5302 ParameterElement get element { 5582 ParameterElement get element {
5303 SimpleIdentifier identifier = this.identifier; 5583 SimpleIdentifier identifier = this.identifier;
5304 if (identifier == null) { 5584 if (identifier == null) {
5305 return null; 5585 return null;
(...skipping 24 matching lines...) Expand all
5330 5610
5331 /** 5611 /**
5332 * Return `true` if this parameter was declared with the 'final' modifier. Par ameters that 5612 * Return `true` if this parameter was declared with the 'final' modifier. Par ameters that
5333 * are declared with the 'const' modifier will return `false` even though they are 5613 * are declared with the 'const' modifier will return `false` even though they are
5334 * implicitly final. 5614 * implicitly final.
5335 * 5615 *
5336 * @return `true` if this parameter was declared with the 'final' modifier 5616 * @return `true` if this parameter was declared with the 'final' modifier
5337 */ 5617 */
5338 bool get isFinal; 5618 bool get isFinal;
5339 } 5619 }
5620
5340 /** 5621 /**
5341 * Instances of the class `FormalParameterList` represent the formal parameter l ist of a 5622 * Instances of the class `FormalParameterList` represent the formal parameter l ist of a
5342 * method declaration, function declaration, or function type alias. 5623 * method declaration, function declaration, or function type alias.
5343 * 5624 *
5344 * While the grammar requires all optional formal parameters to follow all of th e normal formal 5625 * While the grammar requires all optional formal parameters to follow all of th e normal formal
5345 * parameters and at most one grouping of optional formal parameters, this class does not enforce 5626 * parameters and at most one grouping of optional formal parameters, this class does not enforce
5346 * those constraints. All parameters are flattened into a single list, which can have any or all 5627 * those constraints. All parameters are flattened into a single list, which can have any or all
5347 * kinds of parameters (normal, named, and positional) in any order. 5628 * kinds of parameters (normal, named, and positional) in any order.
5348 * 5629 *
5349 * <pre> 5630 * <pre>
(...skipping 12 matching lines...) Expand all
5362 * optionalPositionalFormalParameters ::= 5643 * optionalPositionalFormalParameters ::=
5363 * '[' [DefaultFormalParameter] (',' [DefaultFormalParameter])* ']' 5644 * '[' [DefaultFormalParameter] (',' [DefaultFormalParameter])* ']'
5364 * 5645 *
5365 * namedFormalParameters ::= 5646 * namedFormalParameters ::=
5366 * '{' [DefaultFormalParameter] (',' [DefaultFormalParameter])* '}' 5647 * '{' [DefaultFormalParameter] (',' [DefaultFormalParameter])* '}'
5367 * </pre> 5648 * </pre>
5368 * 5649 *
5369 * @coverage dart.engine.ast 5650 * @coverage dart.engine.ast
5370 */ 5651 */
5371 class FormalParameterList extends ASTNode { 5652 class FormalParameterList extends ASTNode {
5372
5373 /** 5653 /**
5374 * The left parenthesis. 5654 * The left parenthesis.
5375 */ 5655 */
5376 Token _leftParenthesis; 5656 Token _leftParenthesis;
5377 5657
5378 /** 5658 /**
5379 * The parameters associated with the method. 5659 * The parameters associated with the method.
5380 */ 5660 */
5381 NodeList<FormalParameter> parameters; 5661 NodeList<FormalParameter> parameters;
5382 5662
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
5418 /** 5698 /**
5419 * Initialize a newly created parameter list. 5699 * Initialize a newly created parameter list.
5420 * 5700 *
5421 * @param leftParenthesis the left parenthesis 5701 * @param leftParenthesis the left parenthesis
5422 * @param parameters the parameters associated with the method 5702 * @param parameters the parameters associated with the method
5423 * @param leftDelimiter the left delimiter introducing the optional parameters 5703 * @param leftDelimiter the left delimiter introducing the optional parameters
5424 * @param rightDelimiter the right delimiter introducing the optional paramete rs 5704 * @param rightDelimiter the right delimiter introducing the optional paramete rs
5425 * @param rightParenthesis the right parenthesis 5705 * @param rightParenthesis the right parenthesis
5426 */ 5706 */
5427 FormalParameterList({Token leftParenthesis, List<FormalParameter> parameters, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis}) : this.full( leftParenthesis, parameters, leftDelimiter, rightDelimiter, rightParenthesis); 5707 FormalParameterList({Token leftParenthesis, List<FormalParameter> parameters, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis}) : this.full( leftParenthesis, parameters, leftDelimiter, rightDelimiter, rightParenthesis);
5708
5428 accept(ASTVisitor visitor) => visitor.visitFormalParameterList(this); 5709 accept(ASTVisitor visitor) => visitor.visitFormalParameterList(this);
5710
5429 Token get beginToken => _leftParenthesis; 5711 Token get beginToken => _leftParenthesis;
5712
5430 Token get endToken => _rightParenthesis; 5713 Token get endToken => _rightParenthesis;
5431 5714
5432 /** 5715 /**
5433 * Return the left square bracket ('[') or left curly brace ('{') introducing the optional 5716 * Return the left square bracket ('[') or left curly brace ('{') introducing the optional
5434 * parameters, or `null` if there are no optional parameters. 5717 * parameters, or `null` if there are no optional parameters.
5435 * 5718 *
5436 * @return the left square bracket ('[') or left curly brace ('{') introducing the optional 5719 * @return the left square bracket ('[') or left curly brace ('{') introducing the optional
5437 * parameters 5720 * parameters
5438 */ 5721 */
5439 Token get leftDelimiter => _leftDelimiter; 5722 Token get leftDelimiter => _leftDelimiter;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
5506 } 5789 }
5507 5790
5508 /** 5791 /**
5509 * Set the right parenthesis to the given token. 5792 * Set the right parenthesis to the given token.
5510 * 5793 *
5511 * @param parenthesis the right parenthesis 5794 * @param parenthesis the right parenthesis
5512 */ 5795 */
5513 void set rightParenthesis(Token parenthesis) { 5796 void set rightParenthesis(Token parenthesis) {
5514 _rightParenthesis = parenthesis; 5797 _rightParenthesis = parenthesis;
5515 } 5798 }
5799
5516 void visitChildren(ASTVisitor visitor) { 5800 void visitChildren(ASTVisitor visitor) {
5517 parameters.accept(visitor); 5801 parameters.accept(visitor);
5518 } 5802 }
5519 } 5803 }
5804
5520 /** 5805 /**
5521 * The abstract class `FunctionBody` defines the behavior common to objects repr esenting the 5806 * The abstract class `FunctionBody` defines the behavior common to objects repr esenting the
5522 * body of a function or method. 5807 * body of a function or method.
5523 * 5808 *
5524 * <pre> 5809 * <pre>
5525 * functionBody ::= 5810 * functionBody ::=
5526 * [BlockFunctionBody] 5811 * [BlockFunctionBody]
5527 * | [EmptyFunctionBody] 5812 * | [EmptyFunctionBody]
5528 * | [ExpressionFunctionBody] 5813 * | [ExpressionFunctionBody]
5529 * </pre> 5814 * </pre>
5530 * 5815 *
5531 * @coverage dart.engine.ast 5816 * @coverage dart.engine.ast
5532 */ 5817 */
5533 abstract class FunctionBody extends ASTNode { 5818 abstract class FunctionBody extends ASTNode {
5534 } 5819 }
5820
5535 /** 5821 /**
5536 * Instances of the class `FunctionDeclaration` wrap a [FunctionExpression] as a top-level declaration. 5822 * Instances of the class `FunctionDeclaration` wrap a [FunctionExpression] as a top-level declaration.
5537 * 5823 *
5538 * <pre> 5824 * <pre>
5539 * functionDeclaration ::= 5825 * functionDeclaration ::=
5540 * 'external' functionSignature 5826 * 'external' functionSignature
5541 * | functionSignature [FunctionBody] 5827 * | functionSignature [FunctionBody]
5542 * 5828 *
5543 * functionSignature ::= 5829 * functionSignature ::=
5544 * [Type]? ('get' | 'set')? [SimpleIdentifier] [FormalParameterList] 5830 * [Type]? ('get' | 'set')? [SimpleIdentifier] [FormalParameterList]
5545 * </pre> 5831 * </pre>
5546 * 5832 *
5547 * @coverage dart.engine.ast 5833 * @coverage dart.engine.ast
5548 */ 5834 */
5549 class FunctionDeclaration extends CompilationUnitMember { 5835 class FunctionDeclaration extends CompilationUnitMember {
5550
5551 /** 5836 /**
5552 * The token representing the 'external' keyword, or `null` if this is not an external 5837 * The token representing the 'external' keyword, or `null` if this is not an external
5553 * function. 5838 * function.
5554 */ 5839 */
5555 Token externalKeyword; 5840 Token externalKeyword;
5556 5841
5557 /** 5842 /**
5558 * The return type of the function, or `null` if no return type was declared. 5843 * The return type of the function, or `null` if no return type was declared.
5559 */ 5844 */
5560 TypeName _returnType; 5845 TypeName _returnType;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
5599 * 5884 *
5600 * @param comment the documentation comment associated with this function 5885 * @param comment the documentation comment associated with this function
5601 * @param metadata the annotations associated with this function 5886 * @param metadata the annotations associated with this function
5602 * @param externalKeyword the token representing the 'external' keyword 5887 * @param externalKeyword the token representing the 'external' keyword
5603 * @param returnType the return type of the function 5888 * @param returnType the return type of the function
5604 * @param propertyKeyword the token representing the 'get' or 'set' keyword 5889 * @param propertyKeyword the token representing the 'get' or 'set' keyword
5605 * @param name the name of the function 5890 * @param name the name of the function
5606 * @param functionExpression the function expression being wrapped 5891 * @param functionExpression the function expression being wrapped
5607 */ 5892 */
5608 FunctionDeclaration({Comment comment, List<Annotation> metadata, Token externa lKeyword, TypeName returnType, Token propertyKeyword, SimpleIdentifier name, Fun ctionExpression functionExpression}) : this.full(comment, metadata, externalKeyw ord, returnType, propertyKeyword, name, functionExpression); 5893 FunctionDeclaration({Comment comment, List<Annotation> metadata, Token externa lKeyword, TypeName returnType, Token propertyKeyword, SimpleIdentifier name, Fun ctionExpression functionExpression}) : this.full(comment, metadata, externalKeyw ord, returnType, propertyKeyword, name, functionExpression);
5894
5609 accept(ASTVisitor visitor) => visitor.visitFunctionDeclaration(this); 5895 accept(ASTVisitor visitor) => visitor.visitFunctionDeclaration(this);
5896
5610 ExecutableElement get element => _name != null ? (_name.staticElement as Execu tableElement) : null; 5897 ExecutableElement get element => _name != null ? (_name.staticElement as Execu tableElement) : null;
5898
5611 Token get endToken => _functionExpression.endToken; 5899 Token get endToken => _functionExpression.endToken;
5612 5900
5613 /** 5901 /**
5614 * Return the function expression being wrapped. 5902 * Return the function expression being wrapped.
5615 * 5903 *
5616 * @return the function expression being wrapped 5904 * @return the function expression being wrapped
5617 */ 5905 */
5618 FunctionExpression get functionExpression => _functionExpression; 5906 FunctionExpression get functionExpression => _functionExpression;
5619 5907
5620 /** 5908 /**
5621 * Return the name of the function, or `null` if the function is not named. 5909 * Return the name of the function, or `null` if the function is not named.
5622 * 5910 *
5623 * @return the name of the function 5911 * @return the name of the function
5624 */ 5912 */
5625 SimpleIdentifier get name => _name; 5913 SimpleIdentifier get name => _name;
5626 5914
5627 /** 5915 /**
5628 * Return the return type of the function, or `null` if no return type was dec lared. 5916 * Return the return type of the function, or `null` if no return type was dec lared.
5629 * 5917 *
5630 * @return the return type of the function 5918 * @return the return type of the function
5631 */ 5919 */
5632 TypeName get returnType => _returnType; 5920 TypeName get returnType => _returnType;
5633 5921
5634 /** 5922 /**
5635 * Return `true` if this function declares a getter. 5923 * Return `true` if this function declares a getter.
5636 * 5924 *
5637 * @return `true` if this function declares a getter 5925 * @return `true` if this function declares a getter
5638 */ 5926 */
5639 bool get isGetter => propertyKeyword != null && identical(((propertyKeyword as KeywordToken)).keyword, Keyword.GET); 5927 bool get isGetter => propertyKeyword != null && identical((propertyKeyword as KeywordToken).keyword, Keyword.GET);
5640 5928
5641 /** 5929 /**
5642 * Return `true` if this function declares a setter. 5930 * Return `true` if this function declares a setter.
5643 * 5931 *
5644 * @return `true` if this function declares a setter 5932 * @return `true` if this function declares a setter
5645 */ 5933 */
5646 bool get isSetter => propertyKeyword != null && identical(((propertyKeyword as KeywordToken)).keyword, Keyword.SET); 5934 bool get isSetter => propertyKeyword != null && identical((propertyKeyword as KeywordToken).keyword, Keyword.SET);
5647 5935
5648 /** 5936 /**
5649 * Set the function expression being wrapped to the given function expression. 5937 * Set the function expression being wrapped to the given function expression.
5650 * 5938 *
5651 * @param functionExpression the function expression being wrapped 5939 * @param functionExpression the function expression being wrapped
5652 */ 5940 */
5653 void set functionExpression(FunctionExpression functionExpression) { 5941 void set functionExpression(FunctionExpression functionExpression) {
5654 functionExpression = becomeParentOf(functionExpression); 5942 functionExpression = becomeParentOf(functionExpression);
5655 } 5943 }
5656 5944
5657 /** 5945 /**
5658 * Set the name of the function to the given identifier. 5946 * Set the name of the function to the given identifier.
5659 * 5947 *
5660 * @param identifier the name of the function 5948 * @param identifier the name of the function
5661 */ 5949 */
5662 void set name(SimpleIdentifier identifier) { 5950 void set name(SimpleIdentifier identifier) {
5663 _name = becomeParentOf(identifier); 5951 _name = becomeParentOf(identifier);
5664 } 5952 }
5665 5953
5666 /** 5954 /**
5667 * Set the return type of the function to the given name. 5955 * Set the return type of the function to the given name.
5668 * 5956 *
5669 * @param name the return type of the function 5957 * @param name the return type of the function
5670 */ 5958 */
5671 void set returnType(TypeName name) { 5959 void set returnType(TypeName name) {
5672 _returnType = becomeParentOf(name); 5960 _returnType = becomeParentOf(name);
5673 } 5961 }
5962
5674 void visitChildren(ASTVisitor visitor) { 5963 void visitChildren(ASTVisitor visitor) {
5675 super.visitChildren(visitor); 5964 super.visitChildren(visitor);
5676 safelyVisitChild(_returnType, visitor); 5965 safelyVisitChild(_returnType, visitor);
5677 safelyVisitChild(_name, visitor); 5966 safelyVisitChild(_name, visitor);
5678 safelyVisitChild(_functionExpression, visitor); 5967 safelyVisitChild(_functionExpression, visitor);
5679 } 5968 }
5969
5680 Token get firstTokenAfterCommentAndMetadata { 5970 Token get firstTokenAfterCommentAndMetadata {
5681 if (externalKeyword != null) { 5971 if (externalKeyword != null) {
5682 return externalKeyword; 5972 return externalKeyword;
5683 } 5973 }
5684 if (_returnType != null) { 5974 if (_returnType != null) {
5685 return _returnType.beginToken; 5975 return _returnType.beginToken;
5686 } else if (propertyKeyword != null) { 5976 } else if (propertyKeyword != null) {
5687 return propertyKeyword; 5977 return propertyKeyword;
5688 } else if (_name != null) { 5978 } else if (_name != null) {
5689 return _name.beginToken; 5979 return _name.beginToken;
5690 } 5980 }
5691 return _functionExpression.beginToken; 5981 return _functionExpression.beginToken;
5692 } 5982 }
5693 } 5983 }
5984
5694 /** 5985 /**
5695 * Instances of the class `FunctionDeclarationStatement` wrap a [FunctionDeclara tion 5986 * Instances of the class `FunctionDeclarationStatement` wrap a [FunctionDeclara tion
5696 ] as a statement. 5987 ] as a statement.
5697 * 5988 *
5698 * @coverage dart.engine.ast 5989 * @coverage dart.engine.ast
5699 */ 5990 */
5700 class FunctionDeclarationStatement extends Statement { 5991 class FunctionDeclarationStatement extends Statement {
5701
5702 /** 5992 /**
5703 * The function declaration being wrapped. 5993 * The function declaration being wrapped.
5704 */ 5994 */
5705 FunctionDeclaration functionDeclaration; 5995 FunctionDeclaration functionDeclaration;
5706 5996
5707 /** 5997 /**
5708 * Initialize a newly created function declaration statement. 5998 * Initialize a newly created function declaration statement.
5709 * 5999 *
5710 * @param functionDeclaration the the function declaration being wrapped 6000 * @param functionDeclaration the the function declaration being wrapped
5711 */ 6001 */
5712 FunctionDeclarationStatement.full(FunctionDeclaration functionDeclaration) { 6002 FunctionDeclarationStatement.full(FunctionDeclaration functionDeclaration) {
5713 this.functionDeclaration = becomeParentOf(functionDeclaration); 6003 this.functionDeclaration = becomeParentOf(functionDeclaration);
5714 } 6004 }
5715 6005
5716 /** 6006 /**
5717 * Initialize a newly created function declaration statement. 6007 * Initialize a newly created function declaration statement.
5718 * 6008 *
5719 * @param functionDeclaration the the function declaration being wrapped 6009 * @param functionDeclaration the the function declaration being wrapped
5720 */ 6010 */
5721 FunctionDeclarationStatement({FunctionDeclaration functionDeclaration}) : this .full(functionDeclaration); 6011 FunctionDeclarationStatement({FunctionDeclaration functionDeclaration}) : this .full(functionDeclaration);
6012
5722 accept(ASTVisitor visitor) => visitor.visitFunctionDeclarationStatement(this); 6013 accept(ASTVisitor visitor) => visitor.visitFunctionDeclarationStatement(this);
6014
5723 Token get beginToken => functionDeclaration.beginToken; 6015 Token get beginToken => functionDeclaration.beginToken;
6016
5724 Token get endToken => functionDeclaration.endToken; 6017 Token get endToken => functionDeclaration.endToken;
5725 6018
5726 /** 6019 /**
5727 * Set the function declaration being wrapped to the given function declaratio n. 6020 * Set the function declaration being wrapped to the given function declaratio n.
5728 * 6021 *
5729 * @param functionDeclaration the function declaration being wrapped 6022 * @param functionDeclaration the function declaration being wrapped
5730 */ 6023 */
5731 void set functionExpression(FunctionDeclaration functionDeclaration) { 6024 void set functionExpression(FunctionDeclaration functionDeclaration) {
5732 this.functionDeclaration = becomeParentOf(functionDeclaration); 6025 this.functionDeclaration = becomeParentOf(functionDeclaration);
5733 } 6026 }
6027
5734 void visitChildren(ASTVisitor visitor) { 6028 void visitChildren(ASTVisitor visitor) {
5735 safelyVisitChild(functionDeclaration, visitor); 6029 safelyVisitChild(functionDeclaration, visitor);
5736 } 6030 }
5737 } 6031 }
6032
5738 /** 6033 /**
5739 * Instances of the class `FunctionExpression` represent a function expression. 6034 * Instances of the class `FunctionExpression` represent a function expression.
5740 * 6035 *
5741 * <pre> 6036 * <pre>
5742 * functionExpression ::= 6037 * functionExpression ::=
5743 * [FormalParameterList] [FunctionBody] 6038 * [FormalParameterList] [FunctionBody]
5744 * </pre> 6039 * </pre>
5745 * 6040 *
5746 * @coverage dart.engine.ast 6041 * @coverage dart.engine.ast
5747 */ 6042 */
5748 class FunctionExpression extends Expression { 6043 class FunctionExpression extends Expression {
5749
5750 /** 6044 /**
5751 * The parameters associated with the function. 6045 * The parameters associated with the function.
5752 */ 6046 */
5753 FormalParameterList _parameters; 6047 FormalParameterList _parameters;
5754 6048
5755 /** 6049 /**
5756 * The body of the function, or `null` if this is an external function. 6050 * The body of the function, or `null` if this is an external function.
5757 */ 6051 */
5758 FunctionBody _body; 6052 FunctionBody _body;
5759 6053
(...skipping 14 matching lines...) Expand all
5774 this._body = becomeParentOf(body); 6068 this._body = becomeParentOf(body);
5775 } 6069 }
5776 6070
5777 /** 6071 /**
5778 * Initialize a newly created function declaration. 6072 * Initialize a newly created function declaration.
5779 * 6073 *
5780 * @param parameters the parameters associated with the function 6074 * @param parameters the parameters associated with the function
5781 * @param body the body of the function 6075 * @param body the body of the function
5782 */ 6076 */
5783 FunctionExpression({FormalParameterList parameters, FunctionBody body}) : this .full(parameters, body); 6077 FunctionExpression({FormalParameterList parameters, FunctionBody body}) : this .full(parameters, body);
6078
5784 accept(ASTVisitor visitor) => visitor.visitFunctionExpression(this); 6079 accept(ASTVisitor visitor) => visitor.visitFunctionExpression(this);
6080
5785 Token get beginToken { 6081 Token get beginToken {
5786 if (_parameters != null) { 6082 if (_parameters != null) {
5787 return _parameters.beginToken; 6083 return _parameters.beginToken;
5788 } else if (_body != null) { 6084 } else if (_body != null) {
5789 return _body.beginToken; 6085 return _body.beginToken;
5790 } 6086 }
5791 throw new IllegalStateException("Non-external functions must have a body"); 6087 throw new IllegalStateException("Non-external functions must have a body");
5792 } 6088 }
5793 6089
5794 /** 6090 /**
5795 * Return the body of the function, or `null` if this is an external function. 6091 * Return the body of the function, or `null` if this is an external function.
5796 * 6092 *
5797 * @return the body of the function 6093 * @return the body of the function
5798 */ 6094 */
5799 FunctionBody get body => _body; 6095 FunctionBody get body => _body;
6096
5800 Token get endToken { 6097 Token get endToken {
5801 if (_body != null) { 6098 if (_body != null) {
5802 return _body.endToken; 6099 return _body.endToken;
5803 } else if (_parameters != null) { 6100 } else if (_parameters != null) {
5804 return _parameters.endToken; 6101 return _parameters.endToken;
5805 } 6102 }
5806 throw new IllegalStateException("Non-external functions must have a body"); 6103 throw new IllegalStateException("Non-external functions must have a body");
5807 } 6104 }
5808 6105
5809 /** 6106 /**
(...skipping 13 matching lines...) Expand all
5823 } 6120 }
5824 6121
5825 /** 6122 /**
5826 * Set the parameters associated with the function to the given list of parame ters. 6123 * Set the parameters associated with the function to the given list of parame ters.
5827 * 6124 *
5828 * @param parameters the parameters associated with the function 6125 * @param parameters the parameters associated with the function
5829 */ 6126 */
5830 void set parameters(FormalParameterList parameters) { 6127 void set parameters(FormalParameterList parameters) {
5831 this._parameters = becomeParentOf(parameters); 6128 this._parameters = becomeParentOf(parameters);
5832 } 6129 }
6130
5833 void visitChildren(ASTVisitor visitor) { 6131 void visitChildren(ASTVisitor visitor) {
5834 safelyVisitChild(_parameters, visitor); 6132 safelyVisitChild(_parameters, visitor);
5835 safelyVisitChild(_body, visitor); 6133 safelyVisitChild(_body, visitor);
5836 } 6134 }
5837 } 6135 }
6136
5838 /** 6137 /**
5839 * Instances of the class `FunctionExpressionInvocation` represent the invocatio n of a 6138 * Instances of the class `FunctionExpressionInvocation` represent the invocatio n of a
5840 * function resulting from evaluating an expression. Invocations of methods and other forms of 6139 * function resulting from evaluating an expression. Invocations of methods and other forms of
5841 * functions are represented by [MethodInvocation] nodes. Invocations of 6140 * functions are represented by [MethodInvocation] nodes. Invocations of
5842 * getters and setters are represented by either [PrefixedIdentifier] or 6141 * getters and setters are represented by either [PrefixedIdentifier] or
5843 * [PropertyAccess] nodes. 6142 * [PropertyAccess] nodes.
5844 * 6143 *
5845 * <pre> 6144 * <pre>
5846 * functionExpressionInvoction ::= 6145 * functionExpressionInvoction ::=
5847 * [Expression] [ArgumentList] 6146 * [Expression] [ArgumentList]
5848 * </pre> 6147 * </pre>
5849 * 6148 *
5850 * @coverage dart.engine.ast 6149 * @coverage dart.engine.ast
5851 */ 6150 */
5852 class FunctionExpressionInvocation extends Expression { 6151 class FunctionExpressionInvocation extends Expression {
5853
5854 /** 6152 /**
5855 * The expression producing the function being invoked. 6153 * The expression producing the function being invoked.
5856 */ 6154 */
5857 Expression _function; 6155 Expression _function;
5858 6156
5859 /** 6157 /**
5860 * The list of arguments to the function. 6158 * The list of arguments to the function.
5861 */ 6159 */
5862 ArgumentList _argumentList; 6160 ArgumentList _argumentList;
5863 6161
(...skipping 20 matching lines...) Expand all
5884 this._argumentList = becomeParentOf(argumentList); 6182 this._argumentList = becomeParentOf(argumentList);
5885 } 6183 }
5886 6184
5887 /** 6185 /**
5888 * Initialize a newly created function expression invocation. 6186 * Initialize a newly created function expression invocation.
5889 * 6187 *
5890 * @param function the expression producing the function being invoked 6188 * @param function the expression producing the function being invoked
5891 * @param argumentList the list of arguments to the method 6189 * @param argumentList the list of arguments to the method
5892 */ 6190 */
5893 FunctionExpressionInvocation({Expression function, ArgumentList argumentList}) : this.full(function, argumentList); 6191 FunctionExpressionInvocation({Expression function, ArgumentList argumentList}) : this.full(function, argumentList);
6192
5894 accept(ASTVisitor visitor) => visitor.visitFunctionExpressionInvocation(this); 6193 accept(ASTVisitor visitor) => visitor.visitFunctionExpressionInvocation(this);
5895 6194
5896 /** 6195 /**
5897 * Return the list of arguments to the method. 6196 * Return the list of arguments to the method.
5898 * 6197 *
5899 * @return the list of arguments to the method 6198 * @return the list of arguments to the method
5900 */ 6199 */
5901 ArgumentList get argumentList => _argumentList; 6200 ArgumentList get argumentList => _argumentList;
6201
5902 Token get beginToken => _function.beginToken; 6202 Token get beginToken => _function.beginToken;
5903 6203
5904 /** 6204 /**
5905 * Return the best element available for the function being invoked. If resolu tion was able to 6205 * Return the best element available for the function being invoked. If resolu tion was able to
5906 * find a better element based on type propagation, that element will be retur ned. Otherwise, the 6206 * find a better element based on type propagation, that element will be retur ned. Otherwise, the
5907 * element found using the result of static analysis will be returned. If reso lution has not been 6207 * element found using the result of static analysis will be returned. If reso lution has not been
5908 * performed, then `null` will be returned. 6208 * performed, then `null` will be returned.
5909 * 6209 *
5910 * @return the best element available for this function 6210 * @return the best element available for this function
5911 */ 6211 */
5912 ExecutableElement get bestElement { 6212 ExecutableElement get bestElement {
5913 ExecutableElement element = propagatedElement; 6213 ExecutableElement element = propagatedElement;
5914 if (element == null) { 6214 if (element == null) {
5915 element = staticElement; 6215 element = staticElement;
5916 } 6216 }
5917 return element; 6217 return element;
5918 } 6218 }
6219
5919 Token get endToken => _argumentList.endToken; 6220 Token get endToken => _argumentList.endToken;
5920 6221
5921 /** 6222 /**
5922 * Return the expression producing the function being invoked. 6223 * Return the expression producing the function being invoked.
5923 * 6224 *
5924 * @return the expression producing the function being invoked 6225 * @return the expression producing the function being invoked
5925 */ 6226 */
5926 Expression get function => _function; 6227 Expression get function => _function;
5927 6228
5928 /** 6229 /**
(...skipping 26 matching lines...) Expand all
5955 6256
5956 /** 6257 /**
5957 * Set the element associated with the function being invoked based on propaga ted type information 6258 * Set the element associated with the function being invoked based on propaga ted type information
5958 * to the given element. 6259 * to the given element.
5959 * 6260 *
5960 * @param element the element to be associated with the function being invoked 6261 * @param element the element to be associated with the function being invoked
5961 */ 6262 */
5962 void set propagatedElement(ExecutableElement element) { 6263 void set propagatedElement(ExecutableElement element) {
5963 _propagatedElement = element; 6264 _propagatedElement = element;
5964 } 6265 }
6266
5965 void visitChildren(ASTVisitor visitor) { 6267 void visitChildren(ASTVisitor visitor) {
5966 safelyVisitChild(_function, visitor); 6268 safelyVisitChild(_function, visitor);
5967 safelyVisitChild(_argumentList, visitor); 6269 safelyVisitChild(_argumentList, visitor);
5968 } 6270 }
5969 } 6271 }
6272
5970 /** 6273 /**
5971 * Instances of the class `FunctionTypeAlias` represent a function type alias. 6274 * Instances of the class `FunctionTypeAlias` represent a function type alias.
5972 * 6275 *
5973 * <pre> 6276 * <pre>
5974 * functionTypeAlias ::= 6277 * functionTypeAlias ::=
5975 * functionPrefix [TypeParameterList]? [FormalParameterList] ';' 6278 * functionPrefix [TypeParameterList]? [FormalParameterList] ';'
5976 * 6279 *
5977 * functionPrefix ::= 6280 * functionPrefix ::=
5978 * [TypeName]? [SimpleIdentifier] 6281 * [TypeName]? [SimpleIdentifier]
5979 * </pre> 6282 * </pre>
5980 * 6283 *
5981 * @coverage dart.engine.ast 6284 * @coverage dart.engine.ast
5982 */ 6285 */
5983 class FunctionTypeAlias extends TypeAlias { 6286 class FunctionTypeAlias extends TypeAlias {
5984
5985 /** 6287 /**
5986 * The name of the return type of the function type being defined, or `null` i f no return 6288 * The name of the return type of the function type being defined, or `null` i f no return
5987 * type was given. 6289 * type was given.
5988 */ 6290 */
5989 TypeName _returnType; 6291 TypeName _returnType;
5990 6292
5991 /** 6293 /**
5992 * The name of the function type being declared. 6294 * The name of the function type being declared.
5993 */ 6295 */
5994 SimpleIdentifier _name; 6296 SimpleIdentifier _name;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
6029 * @param comment the documentation comment associated with this type alias 6331 * @param comment the documentation comment associated with this type alias
6030 * @param metadata the annotations associated with this type alias 6332 * @param metadata the annotations associated with this type alias
6031 * @param keyword the token representing the 'typedef' keyword 6333 * @param keyword the token representing the 'typedef' keyword
6032 * @param returnType the name of the return type of the function type being de fined 6334 * @param returnType the name of the return type of the function type being de fined
6033 * @param name the name of the type being declared 6335 * @param name the name of the type being declared
6034 * @param typeParameters the type parameters for the type 6336 * @param typeParameters the type parameters for the type
6035 * @param parameters the parameters associated with the function 6337 * @param parameters the parameters associated with the function
6036 * @param semicolon the semicolon terminating the declaration 6338 * @param semicolon the semicolon terminating the declaration
6037 */ 6339 */
6038 FunctionTypeAlias({Comment comment, List<Annotation> metadata, Token keyword, TypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters, Fo rmalParameterList parameters, Token semicolon}) : this.full(comment, metadata, k eyword, returnType, name, typeParameters, parameters, semicolon); 6340 FunctionTypeAlias({Comment comment, List<Annotation> metadata, Token keyword, TypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters, Fo rmalParameterList parameters, Token semicolon}) : this.full(comment, metadata, k eyword, returnType, name, typeParameters, parameters, semicolon);
6341
6039 accept(ASTVisitor visitor) => visitor.visitFunctionTypeAlias(this); 6342 accept(ASTVisitor visitor) => visitor.visitFunctionTypeAlias(this);
6343
6040 FunctionTypeAliasElement get element => _name != null ? (_name.staticElement a s FunctionTypeAliasElement) : null; 6344 FunctionTypeAliasElement get element => _name != null ? (_name.staticElement a s FunctionTypeAliasElement) : null;
6041 6345
6042 /** 6346 /**
6043 * Return the name of the function type being declared. 6347 * Return the name of the function type being declared.
6044 * 6348 *
6045 * @return the name of the function type being declared 6349 * @return the name of the function type being declared
6046 */ 6350 */
6047 SimpleIdentifier get name => _name; 6351 SimpleIdentifier get name => _name;
6048 6352
6049 /** 6353 /**
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
6097 } 6401 }
6098 6402
6099 /** 6403 /**
6100 * Set the type parameters for the function type to the given list of paramete rs. 6404 * Set the type parameters for the function type to the given list of paramete rs.
6101 * 6405 *
6102 * @param typeParameters the type parameters for the function type 6406 * @param typeParameters the type parameters for the function type
6103 */ 6407 */
6104 void set typeParameters(TypeParameterList typeParameters) { 6408 void set typeParameters(TypeParameterList typeParameters) {
6105 this._typeParameters = becomeParentOf(typeParameters); 6409 this._typeParameters = becomeParentOf(typeParameters);
6106 } 6410 }
6411
6107 void visitChildren(ASTVisitor visitor) { 6412 void visitChildren(ASTVisitor visitor) {
6108 super.visitChildren(visitor); 6413 super.visitChildren(visitor);
6109 safelyVisitChild(_returnType, visitor); 6414 safelyVisitChild(_returnType, visitor);
6110 safelyVisitChild(_name, visitor); 6415 safelyVisitChild(_name, visitor);
6111 safelyVisitChild(_typeParameters, visitor); 6416 safelyVisitChild(_typeParameters, visitor);
6112 safelyVisitChild(_parameters, visitor); 6417 safelyVisitChild(_parameters, visitor);
6113 } 6418 }
6114 } 6419 }
6420
6115 /** 6421 /**
6116 * Instances of the class `FunctionTypedFormalParameter` represent a function-ty ped formal 6422 * Instances of the class `FunctionTypedFormalParameter` represent a function-ty ped formal
6117 * parameter. 6423 * parameter.
6118 * 6424 *
6119 * <pre> 6425 * <pre>
6120 * functionSignature ::= 6426 * functionSignature ::=
6121 * [TypeName]? [SimpleIdentifier] [FormalParameterList] 6427 * [TypeName]? [SimpleIdentifier] [FormalParameterList]
6122 * </pre> 6428 * </pre>
6123 * 6429 *
6124 * @coverage dart.engine.ast 6430 * @coverage dart.engine.ast
6125 */ 6431 */
6126 class FunctionTypedFormalParameter extends NormalFormalParameter { 6432 class FunctionTypedFormalParameter extends NormalFormalParameter {
6127
6128 /** 6433 /**
6129 * The return type of the function, or `null` if the function does not have a return type. 6434 * The return type of the function, or `null` if the function does not have a return type.
6130 */ 6435 */
6131 TypeName _returnType; 6436 TypeName _returnType;
6132 6437
6133 /** 6438 /**
6134 * The parameters of the function-typed parameter. 6439 * The parameters of the function-typed parameter.
6135 */ 6440 */
6136 FormalParameterList _parameters; 6441 FormalParameterList _parameters;
6137 6442
(...skipping 16 matching lines...) Expand all
6154 * Initialize a newly created formal parameter. 6459 * Initialize a newly created formal parameter.
6155 * 6460 *
6156 * @param comment the documentation comment associated with this parameter 6461 * @param comment the documentation comment associated with this parameter
6157 * @param metadata the annotations associated with this parameter 6462 * @param metadata the annotations associated with this parameter
6158 * @param returnType the return type of the function, or `null` if the functio n does not 6463 * @param returnType the return type of the function, or `null` if the functio n does not
6159 * have a return type 6464 * have a return type
6160 * @param identifier the name of the function-typed parameter 6465 * @param identifier the name of the function-typed parameter
6161 * @param parameters the parameters of the function-typed parameter 6466 * @param parameters the parameters of the function-typed parameter
6162 */ 6467 */
6163 FunctionTypedFormalParameter({Comment comment, List<Annotation> metadata, Type Name returnType, SimpleIdentifier identifier, FormalParameterList parameters}) : this.full(comment, metadata, returnType, identifier, parameters); 6468 FunctionTypedFormalParameter({Comment comment, List<Annotation> metadata, Type Name returnType, SimpleIdentifier identifier, FormalParameterList parameters}) : this.full(comment, metadata, returnType, identifier, parameters);
6469
6164 accept(ASTVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this); 6470 accept(ASTVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this);
6471
6165 Token get beginToken { 6472 Token get beginToken {
6166 if (_returnType != null) { 6473 if (_returnType != null) {
6167 return _returnType.beginToken; 6474 return _returnType.beginToken;
6168 } 6475 }
6169 return identifier.beginToken; 6476 return identifier.beginToken;
6170 } 6477 }
6478
6171 Token get endToken => _parameters.endToken; 6479 Token get endToken => _parameters.endToken;
6172 6480
6173 /** 6481 /**
6174 * Return the parameters of the function-typed parameter. 6482 * Return the parameters of the function-typed parameter.
6175 * 6483 *
6176 * @return the parameters of the function-typed parameter 6484 * @return the parameters of the function-typed parameter
6177 */ 6485 */
6178 FormalParameterList get parameters => _parameters; 6486 FormalParameterList get parameters => _parameters;
6179 6487
6180 /** 6488 /**
6181 * Return the return type of the function, or `null` if the function does not have a return 6489 * Return the return type of the function, or `null` if the function does not have a return
6182 * type. 6490 * type.
6183 * 6491 *
6184 * @return the return type of the function 6492 * @return the return type of the function
6185 */ 6493 */
6186 TypeName get returnType => _returnType; 6494 TypeName get returnType => _returnType;
6495
6187 bool get isConst => false; 6496 bool get isConst => false;
6497
6188 bool get isFinal => false; 6498 bool get isFinal => false;
6189 6499
6190 /** 6500 /**
6191 * Set the parameters of the function-typed parameter to the given parameters. 6501 * Set the parameters of the function-typed parameter to the given parameters.
6192 * 6502 *
6193 * @param parameters the parameters of the function-typed parameter 6503 * @param parameters the parameters of the function-typed parameter
6194 */ 6504 */
6195 void set parameters(FormalParameterList parameters) { 6505 void set parameters(FormalParameterList parameters) {
6196 this._parameters = becomeParentOf(parameters); 6506 this._parameters = becomeParentOf(parameters);
6197 } 6507 }
6198 6508
6199 /** 6509 /**
6200 * Set the return type of the function to the given type. 6510 * Set the return type of the function to the given type.
6201 * 6511 *
6202 * @param returnType the return type of the function 6512 * @param returnType the return type of the function
6203 */ 6513 */
6204 void set returnType(TypeName returnType) { 6514 void set returnType(TypeName returnType) {
6205 this._returnType = becomeParentOf(returnType); 6515 this._returnType = becomeParentOf(returnType);
6206 } 6516 }
6517
6207 void visitChildren(ASTVisitor visitor) { 6518 void visitChildren(ASTVisitor visitor) {
6208 super.visitChildren(visitor); 6519 super.visitChildren(visitor);
6209 safelyVisitChild(_returnType, visitor); 6520 safelyVisitChild(_returnType, visitor);
6210 safelyVisitChild(identifier, visitor); 6521 safelyVisitChild(identifier, visitor);
6211 safelyVisitChild(_parameters, visitor); 6522 safelyVisitChild(_parameters, visitor);
6212 } 6523 }
6213 } 6524 }
6525
6214 /** 6526 /**
6215 * Instances of the class `HideCombinator` represent a combinator that restricts the names 6527 * Instances of the class `HideCombinator` represent a combinator that restricts the names
6216 * being imported to those that are not in a given list. 6528 * being imported to those that are not in a given list.
6217 * 6529 *
6218 * <pre> 6530 * <pre>
6219 * hideCombinator ::= 6531 * hideCombinator ::=
6220 * 'hide' [SimpleIdentifier] (',' [SimpleIdentifier])* 6532 * 'hide' [SimpleIdentifier] (',' [SimpleIdentifier])*
6221 * </pre> 6533 * </pre>
6222 * 6534 *
6223 * @coverage dart.engine.ast 6535 * @coverage dart.engine.ast
6224 */ 6536 */
6225 class HideCombinator extends Combinator { 6537 class HideCombinator extends Combinator {
6226
6227 /** 6538 /**
6228 * The list of names from the library that are hidden by this combinator. 6539 * The list of names from the library that are hidden by this combinator.
6229 */ 6540 */
6230 NodeList<SimpleIdentifier> hiddenNames; 6541 NodeList<SimpleIdentifier> hiddenNames;
6231 6542
6232 /** 6543 /**
6233 * Initialize a newly created import show combinator. 6544 * Initialize a newly created import show combinator.
6234 * 6545 *
6235 * @param keyword the comma introducing the combinator 6546 * @param keyword the comma introducing the combinator
6236 * @param hiddenNames the list of names from the library that are hidden by th is combinator 6547 * @param hiddenNames the list of names from the library that are hidden by th is combinator
6237 */ 6548 */
6238 HideCombinator.full(Token keyword, List<SimpleIdentifier> hiddenNames) : super .full(keyword) { 6549 HideCombinator.full(Token keyword, List<SimpleIdentifier> hiddenNames) : super .full(keyword) {
6239 this.hiddenNames = new NodeList<SimpleIdentifier>(this); 6550 this.hiddenNames = new NodeList<SimpleIdentifier>(this);
6240 this.hiddenNames.addAll(hiddenNames); 6551 this.hiddenNames.addAll(hiddenNames);
6241 } 6552 }
6242 6553
6243 /** 6554 /**
6244 * Initialize a newly created import show combinator. 6555 * Initialize a newly created import show combinator.
6245 * 6556 *
6246 * @param keyword the comma introducing the combinator 6557 * @param keyword the comma introducing the combinator
6247 * @param hiddenNames the list of names from the library that are hidden by th is combinator 6558 * @param hiddenNames the list of names from the library that are hidden by th is combinator
6248 */ 6559 */
6249 HideCombinator({Token keyword, List<SimpleIdentifier> hiddenNames}) : this.ful l(keyword, hiddenNames); 6560 HideCombinator({Token keyword, List<SimpleIdentifier> hiddenNames}) : this.ful l(keyword, hiddenNames);
6561
6250 accept(ASTVisitor visitor) => visitor.visitHideCombinator(this); 6562 accept(ASTVisitor visitor) => visitor.visitHideCombinator(this);
6563
6251 Token get endToken => hiddenNames.endToken; 6564 Token get endToken => hiddenNames.endToken;
6565
6252 void visitChildren(ASTVisitor visitor) { 6566 void visitChildren(ASTVisitor visitor) {
6253 hiddenNames.accept(visitor); 6567 hiddenNames.accept(visitor);
6254 } 6568 }
6255 } 6569 }
6570
6256 /** 6571 /**
6257 * The abstract class `Identifier` defines the behavior common to nodes that rep resent an 6572 * The abstract class `Identifier` defines the behavior common to nodes that rep resent an
6258 * identifier. 6573 * identifier.
6259 * 6574 *
6260 * <pre> 6575 * <pre>
6261 * identifier ::= 6576 * identifier ::=
6262 * [SimpleIdentifier] 6577 * [SimpleIdentifier]
6263 * | [PrefixedIdentifier] 6578 * | [PrefixedIdentifier]
6264 * </pre> 6579 * </pre>
6265 * 6580 *
6266 * @coverage dart.engine.ast 6581 * @coverage dart.engine.ast
6267 */ 6582 */
6268 abstract class Identifier extends Expression { 6583 abstract class Identifier extends Expression {
6269
6270 /** 6584 /**
6271 * Return `true` if the given name is visible only within the library in which it is 6585 * Return `true` if the given name is visible only within the library in which it is
6272 * declared. 6586 * declared.
6273 * 6587 *
6274 * @param name the name being tested 6588 * @param name the name being tested
6275 * @return `true` if the given name is private 6589 * @return `true` if the given name is private
6276 */ 6590 */
6277 static bool isPrivateName(String name) => name.startsWith("_"); 6591 static bool isPrivateName(String name) => name.startsWith("_");
6278 6592
6279 /** 6593 /**
(...skipping 25 matching lines...) Expand all
6305 6619
6306 /** 6620 /**
6307 * Return the element associated with this identifier based on static type inf ormation, or 6621 * Return the element associated with this identifier based on static type inf ormation, or
6308 * `null` if the AST structure has not been resolved or if this identifier cou ld not be 6622 * `null` if the AST structure has not been resolved or if this identifier cou ld not be
6309 * resolved. One example of the latter case is an identifier that is not defin ed within the scope 6623 * resolved. One example of the latter case is an identifier that is not defin ed within the scope
6310 * in which it appears 6624 * in which it appears
6311 * 6625 *
6312 * @return the element associated with the operator 6626 * @return the element associated with the operator
6313 */ 6627 */
6314 Element get staticElement; 6628 Element get staticElement;
6629
6315 bool get isAssignable => true; 6630 bool get isAssignable => true;
6316 } 6631 }
6632
6317 /** 6633 /**
6318 * Instances of the class `IfStatement` represent an if statement. 6634 * Instances of the class `IfStatement` represent an if statement.
6319 * 6635 *
6320 * <pre> 6636 * <pre>
6321 * ifStatement ::= 6637 * ifStatement ::=
6322 * 'if' '(' [Expression] ')' [Statement] ('else' [Statement])? 6638 * 'if' '(' [Expression] ')' [Statement] ('else' [Statement])?
6323 * </pre> 6639 * </pre>
6324 * 6640 *
6325 * @coverage dart.engine.ast 6641 * @coverage dart.engine.ast
6326 */ 6642 */
6327 class IfStatement extends Statement { 6643 class IfStatement extends Statement {
6328
6329 /** 6644 /**
6330 * The token representing the 'if' keyword. 6645 * The token representing the 'if' keyword.
6331 */ 6646 */
6332 Token ifKeyword; 6647 Token ifKeyword;
6333 6648
6334 /** 6649 /**
6335 * The left parenthesis. 6650 * The left parenthesis.
6336 */ 6651 */
6337 Token leftParenthesis; 6652 Token leftParenthesis;
6338 6653
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
6388 * 6703 *
6389 * @param ifKeyword the token representing the 'if' keyword 6704 * @param ifKeyword the token representing the 'if' keyword
6390 * @param leftParenthesis the left parenthesis 6705 * @param leftParenthesis the left parenthesis
6391 * @param condition the condition used to determine which of the statements is executed next 6706 * @param condition the condition used to determine which of the statements is executed next
6392 * @param rightParenthesis the right parenthesis 6707 * @param rightParenthesis the right parenthesis
6393 * @param thenStatement the statement that is executed if the condition evalua tes to `true` 6708 * @param thenStatement the statement that is executed if the condition evalua tes to `true`
6394 * @param elseKeyword the token representing the 'else' keyword 6709 * @param elseKeyword the token representing the 'else' keyword
6395 * @param elseStatement the statement that is executed if the condition evalua tes to `false` 6710 * @param elseStatement the statement that is executed if the condition evalua tes to `false`
6396 */ 6711 */
6397 IfStatement({Token ifKeyword, Token leftParenthesis, Expression condition, Tok en rightParenthesis, Statement thenStatement, Token elseKeyword, Statement elseS tatement}) : this.full(ifKeyword, leftParenthesis, condition, rightParenthesis, thenStatement, elseKeyword, elseStatement); 6712 IfStatement({Token ifKeyword, Token leftParenthesis, Expression condition, Tok en rightParenthesis, Statement thenStatement, Token elseKeyword, Statement elseS tatement}) : this.full(ifKeyword, leftParenthesis, condition, rightParenthesis, thenStatement, elseKeyword, elseStatement);
6713
6398 accept(ASTVisitor visitor) => visitor.visitIfStatement(this); 6714 accept(ASTVisitor visitor) => visitor.visitIfStatement(this);
6715
6399 Token get beginToken => ifKeyword; 6716 Token get beginToken => ifKeyword;
6400 6717
6401 /** 6718 /**
6402 * Return the condition used to determine which of the statements is executed next. 6719 * Return the condition used to determine which of the statements is executed next.
6403 * 6720 *
6404 * @return the condition used to determine which statement is executed next 6721 * @return the condition used to determine which statement is executed next
6405 */ 6722 */
6406 Expression get condition => _condition; 6723 Expression get condition => _condition;
6407 6724
6408 /** 6725 /**
6409 * Return the statement that is executed if the condition evaluates to `false` , or 6726 * Return the statement that is executed if the condition evaluates to `false` , or
6410 * `null` if there is no else statement. 6727 * `null` if there is no else statement.
6411 * 6728 *
6412 * @return the statement that is executed if the condition evaluates to `false ` 6729 * @return the statement that is executed if the condition evaluates to `false `
6413 */ 6730 */
6414 Statement get elseStatement => _elseStatement; 6731 Statement get elseStatement => _elseStatement;
6732
6415 Token get endToken { 6733 Token get endToken {
6416 if (_elseStatement != null) { 6734 if (_elseStatement != null) {
6417 return _elseStatement.endToken; 6735 return _elseStatement.endToken;
6418 } 6736 }
6419 return _thenStatement.endToken; 6737 return _thenStatement.endToken;
6420 } 6738 }
6421 6739
6422 /** 6740 /**
6423 * Return the statement that is executed if the condition evaluates to `true`. 6741 * Return the statement that is executed if the condition evaluates to `true`.
6424 * 6742 *
(...skipping 23 matching lines...) Expand all
6448 6766
6449 /** 6767 /**
6450 * Set the statement that is executed if the condition evaluates to `true` to the given 6768 * Set the statement that is executed if the condition evaluates to `true` to the given
6451 * statement. 6769 * statement.
6452 * 6770 *
6453 * @param statement the statement that is executed if the condition evaluates to `true` 6771 * @param statement the statement that is executed if the condition evaluates to `true`
6454 */ 6772 */
6455 void set thenStatement(Statement statement) { 6773 void set thenStatement(Statement statement) {
6456 _thenStatement = becomeParentOf(statement); 6774 _thenStatement = becomeParentOf(statement);
6457 } 6775 }
6776
6458 void visitChildren(ASTVisitor visitor) { 6777 void visitChildren(ASTVisitor visitor) {
6459 safelyVisitChild(_condition, visitor); 6778 safelyVisitChild(_condition, visitor);
6460 safelyVisitChild(_thenStatement, visitor); 6779 safelyVisitChild(_thenStatement, visitor);
6461 safelyVisitChild(_elseStatement, visitor); 6780 safelyVisitChild(_elseStatement, visitor);
6462 } 6781 }
6463 } 6782 }
6783
6464 /** 6784 /**
6465 * Instances of the class `ImplementsClause` represent the "implements" clause i n an class 6785 * Instances of the class `ImplementsClause` represent the "implements" clause i n an class
6466 * declaration. 6786 * declaration.
6467 * 6787 *
6468 * <pre> 6788 * <pre>
6469 * implementsClause ::= 6789 * implementsClause ::=
6470 * 'implements' [TypeName] (',' [TypeName])* 6790 * 'implements' [TypeName] (',' [TypeName])*
6471 * </pre> 6791 * </pre>
6472 * 6792 *
6473 * @coverage dart.engine.ast 6793 * @coverage dart.engine.ast
6474 */ 6794 */
6475 class ImplementsClause extends ASTNode { 6795 class ImplementsClause extends ASTNode {
6476
6477 /** 6796 /**
6478 * The token representing the 'implements' keyword. 6797 * The token representing the 'implements' keyword.
6479 */ 6798 */
6480 Token keyword; 6799 Token keyword;
6481 6800
6482 /** 6801 /**
6483 * The interfaces that are being implemented. 6802 * The interfaces that are being implemented.
6484 */ 6803 */
6485 NodeList<TypeName> interfaces; 6804 NodeList<TypeName> interfaces;
6486 6805
6487 /** 6806 /**
6488 * Initialize a newly created implements clause. 6807 * Initialize a newly created implements clause.
6489 * 6808 *
6490 * @param keyword the token representing the 'implements' keyword 6809 * @param keyword the token representing the 'implements' keyword
6491 * @param interfaces the interfaces that are being implemented 6810 * @param interfaces the interfaces that are being implemented
6492 */ 6811 */
6493 ImplementsClause.full(Token keyword, List<TypeName> interfaces) { 6812 ImplementsClause.full(Token keyword, List<TypeName> interfaces) {
6494 this.interfaces = new NodeList<TypeName>(this); 6813 this.interfaces = new NodeList<TypeName>(this);
6495 this.keyword = keyword; 6814 this.keyword = keyword;
6496 this.interfaces.addAll(interfaces); 6815 this.interfaces.addAll(interfaces);
6497 } 6816 }
6498 6817
6499 /** 6818 /**
6500 * Initialize a newly created implements clause. 6819 * Initialize a newly created implements clause.
6501 * 6820 *
6502 * @param keyword the token representing the 'implements' keyword 6821 * @param keyword the token representing the 'implements' keyword
6503 * @param interfaces the interfaces that are being implemented 6822 * @param interfaces the interfaces that are being implemented
6504 */ 6823 */
6505 ImplementsClause({Token keyword, List<TypeName> interfaces}) : this.full(keywo rd, interfaces); 6824 ImplementsClause({Token keyword, List<TypeName> interfaces}) : this.full(keywo rd, interfaces);
6825
6506 accept(ASTVisitor visitor) => visitor.visitImplementsClause(this); 6826 accept(ASTVisitor visitor) => visitor.visitImplementsClause(this);
6827
6507 Token get beginToken => keyword; 6828 Token get beginToken => keyword;
6829
6508 Token get endToken => interfaces.endToken; 6830 Token get endToken => interfaces.endToken;
6831
6509 void visitChildren(ASTVisitor visitor) { 6832 void visitChildren(ASTVisitor visitor) {
6510 interfaces.accept(visitor); 6833 interfaces.accept(visitor);
6511 } 6834 }
6512 } 6835 }
6836
6513 /** 6837 /**
6514 * Instances of the class `ImportDirective` represent an import directive. 6838 * Instances of the class `ImportDirective` represent an import directive.
6515 * 6839 *
6516 * <pre> 6840 * <pre>
6517 * importDirective ::= 6841 * importDirective ::=
6518 * [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* '; ' 6842 * [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* '; '
6519 * </pre> 6843 * </pre>
6520 * 6844 *
6521 * @coverage dart.engine.ast 6845 * @coverage dart.engine.ast
6522 */ 6846 */
(...skipping 29 matching lines...) Expand all
6552 if (compare != 0) { 6876 if (compare != 0) {
6553 return compare; 6877 return compare;
6554 } 6878 }
6555 } 6879 }
6556 } 6880 }
6557 NodeList<Combinator> combinators1 = import1.combinators; 6881 NodeList<Combinator> combinators1 = import1.combinators;
6558 List<String> allHides1 = new List<String>(); 6882 List<String> allHides1 = new List<String>();
6559 List<String> allShows1 = new List<String>(); 6883 List<String> allShows1 = new List<String>();
6560 for (Combinator combinator in combinators1) { 6884 for (Combinator combinator in combinators1) {
6561 if (combinator is HideCombinator) { 6885 if (combinator is HideCombinator) {
6562 NodeList<SimpleIdentifier> hides = ((combinator as HideCombinator)).hidd enNames; 6886 NodeList<SimpleIdentifier> hides = (combinator as HideCombinator).hidden Names;
6563 for (SimpleIdentifier simpleIdentifier in hides) { 6887 for (SimpleIdentifier simpleIdentifier in hides) {
6564 allHides1.add(simpleIdentifier.name); 6888 allHides1.add(simpleIdentifier.name);
6565 } 6889 }
6566 } else { 6890 } else {
6567 NodeList<SimpleIdentifier> shows = ((combinator as ShowCombinator)).show nNames; 6891 NodeList<SimpleIdentifier> shows = (combinator as ShowCombinator).shownN ames;
6568 for (SimpleIdentifier simpleIdentifier in shows) { 6892 for (SimpleIdentifier simpleIdentifier in shows) {
6569 allShows1.add(simpleIdentifier.name); 6893 allShows1.add(simpleIdentifier.name);
6570 } 6894 }
6571 } 6895 }
6572 } 6896 }
6573 NodeList<Combinator> combinators2 = import2.combinators; 6897 NodeList<Combinator> combinators2 = import2.combinators;
6574 List<String> allHides2 = new List<String>(); 6898 List<String> allHides2 = new List<String>();
6575 List<String> allShows2 = new List<String>(); 6899 List<String> allShows2 = new List<String>();
6576 for (Combinator combinator in combinators2) { 6900 for (Combinator combinator in combinators2) {
6577 if (combinator is HideCombinator) { 6901 if (combinator is HideCombinator) {
6578 NodeList<SimpleIdentifier> hides = ((combinator as HideCombinator)).hidd enNames; 6902 NodeList<SimpleIdentifier> hides = (combinator as HideCombinator).hidden Names;
6579 for (SimpleIdentifier simpleIdentifier in hides) { 6903 for (SimpleIdentifier simpleIdentifier in hides) {
6580 allHides2.add(simpleIdentifier.name); 6904 allHides2.add(simpleIdentifier.name);
6581 } 6905 }
6582 } else { 6906 } else {
6583 NodeList<SimpleIdentifier> shows = ((combinator as ShowCombinator)).show nNames; 6907 NodeList<SimpleIdentifier> shows = (combinator as ShowCombinator).shownN ames;
6584 for (SimpleIdentifier simpleIdentifier in shows) { 6908 for (SimpleIdentifier simpleIdentifier in shows) {
6585 allShows2.add(simpleIdentifier.name); 6909 allShows2.add(simpleIdentifier.name);
6586 } 6910 }
6587 } 6911 }
6588 } 6912 }
6589 if (allHides1.length != allHides2.length) { 6913 if (allHides1.length != allHides2.length) {
6590 return allHides1.length - allHides2.length; 6914 return allHides1.length - allHides2.length;
6591 } 6915 }
6592 if (allShows1.length != allShows2.length) { 6916 if (allShows1.length != allShows2.length) {
6593 return allShows1.length - allShows2.length; 6917 return allShows1.length - allShows2.length;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
6635 * @param comment the documentation comment associated with this directive 6959 * @param comment the documentation comment associated with this directive
6636 * @param metadata the annotations associated with the directive 6960 * @param metadata the annotations associated with the directive
6637 * @param keyword the token representing the 'import' keyword 6961 * @param keyword the token representing the 'import' keyword
6638 * @param libraryUri the URI of the library being imported 6962 * @param libraryUri the URI of the library being imported
6639 * @param asToken the token representing the 'as' token 6963 * @param asToken the token representing the 'as' token
6640 * @param prefix the prefix to be used with the imported names 6964 * @param prefix the prefix to be used with the imported names
6641 * @param combinators the combinators used to control how names are imported 6965 * @param combinators the combinators used to control how names are imported
6642 * @param semicolon the semicolon terminating the directive 6966 * @param semicolon the semicolon terminating the directive
6643 */ 6967 */
6644 ImportDirective({Comment comment, List<Annotation> metadata, Token keyword, St ringLiteral libraryUri, Token asToken, SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon}) : this.full(comment, metadata, keyword, libraryU ri, asToken, prefix, combinators, semicolon); 6968 ImportDirective({Comment comment, List<Annotation> metadata, Token keyword, St ringLiteral libraryUri, Token asToken, SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon}) : this.full(comment, metadata, keyword, libraryU ri, asToken, prefix, combinators, semicolon);
6969
6645 accept(ASTVisitor visitor) => visitor.visitImportDirective(this); 6970 accept(ASTVisitor visitor) => visitor.visitImportDirective(this);
6971
6646 ImportElement get element => super.element as ImportElement; 6972 ImportElement get element => super.element as ImportElement;
6647 6973
6648 /** 6974 /**
6649 * Return the prefix to be used with the imported names, or `null` if the impo rted names are 6975 * Return the prefix to be used with the imported names, or `null` if the impo rted names are
6650 * not prefixed. 6976 * not prefixed.
6651 * 6977 *
6652 * @return the prefix to be used with the imported names 6978 * @return the prefix to be used with the imported names
6653 */ 6979 */
6654 SimpleIdentifier get prefix => _prefix; 6980 SimpleIdentifier get prefix => _prefix;
6981
6655 LibraryElement get uriElement { 6982 LibraryElement get uriElement {
6656 ImportElement element = this.element; 6983 ImportElement element = this.element;
6657 if (element == null) { 6984 if (element == null) {
6658 return null; 6985 return null;
6659 } 6986 }
6660 return element.importedLibrary; 6987 return element.importedLibrary;
6661 } 6988 }
6662 6989
6663 /** 6990 /**
6664 * Set the prefix to be used with the imported names to the given identifier. 6991 * Set the prefix to be used with the imported names to the given identifier.
6665 * 6992 *
6666 * @param prefix the prefix to be used with the imported names 6993 * @param prefix the prefix to be used with the imported names
6667 */ 6994 */
6668 void set prefix(SimpleIdentifier prefix) { 6995 void set prefix(SimpleIdentifier prefix) {
6669 this._prefix = becomeParentOf(prefix); 6996 this._prefix = becomeParentOf(prefix);
6670 } 6997 }
6998
6671 void visitChildren(ASTVisitor visitor) { 6999 void visitChildren(ASTVisitor visitor) {
6672 super.visitChildren(visitor); 7000 super.visitChildren(visitor);
6673 safelyVisitChild(_prefix, visitor); 7001 safelyVisitChild(_prefix, visitor);
6674 combinators.accept(visitor); 7002 combinators.accept(visitor);
6675 } 7003 }
6676 } 7004 }
7005
6677 /** 7006 /**
6678 * Instances of the class `IndexExpression` represent an index expression. 7007 * Instances of the class `IndexExpression` represent an index expression.
6679 * 7008 *
6680 * <pre> 7009 * <pre>
6681 * indexExpression ::= 7010 * indexExpression ::=
6682 * [Expression] '[' [Expression] ']' 7011 * [Expression] '[' [Expression] ']'
6683 * </pre> 7012 * </pre>
6684 * 7013 *
6685 * @coverage dart.engine.ast 7014 * @coverage dart.engine.ast
6686 */ 7015 */
6687 class IndexExpression extends Expression { 7016 class IndexExpression extends Expression {
6688
6689 /** 7017 /**
6690 * The expression used to compute the object being indexed, or `null` if this index 7018 * The expression used to compute the object being indexed, or `null` if this index
6691 * expression is part of a cascade expression. 7019 * expression is part of a cascade expression.
6692 */ 7020 */
6693 Expression _target; 7021 Expression _target;
6694 7022
6695 /** 7023 /**
6696 * The period ("..") before a cascaded index expression, or `null` if this ind ex expression 7024 * The period ("..") before a cascaded index expression, or `null` if this ind ex expression
6697 * is not part of a cascade expression. 7025 * is not part of a cascade expression.
6698 */ 7026 */
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
6776 7104
6777 /** 7105 /**
6778 * Initialize a newly created index expression. 7106 * Initialize a newly created index expression.
6779 * 7107 *
6780 * @param period the period ("..") before a cascaded index expression 7108 * @param period the period ("..") before a cascaded index expression
6781 * @param leftBracket the left square bracket 7109 * @param leftBracket the left square bracket
6782 * @param index the expression used to compute the index 7110 * @param index the expression used to compute the index
6783 * @param rightBracket the right square bracket 7111 * @param rightBracket the right square bracket
6784 */ 7112 */
6785 IndexExpression.forCascade({Token period, Token leftBracket, Expression index, Token rightBracket}) : this.forCascade_full(period, leftBracket, index, rightBr acket); 7113 IndexExpression.forCascade({Token period, Token leftBracket, Expression index, Token rightBracket}) : this.forCascade_full(period, leftBracket, index, rightBr acket);
7114
6786 accept(ASTVisitor visitor) => visitor.visitIndexExpression(this); 7115 accept(ASTVisitor visitor) => visitor.visitIndexExpression(this);
7116
6787 Token get beginToken { 7117 Token get beginToken {
6788 if (_target != null) { 7118 if (_target != null) {
6789 return _target.beginToken; 7119 return _target.beginToken;
6790 } 7120 }
6791 return period; 7121 return period;
6792 } 7122 }
6793 7123
6794 /** 7124 /**
6795 * Return the best element available for this operator. If resolution was able to find a better 7125 * Return the best element available for this operator. If resolution was able to find a better
6796 * element based on type propagation, that element will be returned. Otherwise , the element found 7126 * element based on type propagation, that element will be returned. Otherwise , the element found
6797 * using the result of static analysis will be returned. If resolution has not been performed, 7127 * using the result of static analysis will be returned. If resolution has not been performed,
6798 * then `null` will be returned. 7128 * then `null` will be returned.
6799 * 7129 *
6800 * @return the best element available for this operator 7130 * @return the best element available for this operator
6801 */ 7131 */
6802 MethodElement get bestElement { 7132 MethodElement get bestElement {
6803 MethodElement element = propagatedElement; 7133 MethodElement element = propagatedElement;
6804 if (element == null) { 7134 if (element == null) {
6805 element = staticElement; 7135 element = staticElement;
6806 } 7136 }
6807 return element; 7137 return element;
6808 } 7138 }
7139
6809 Token get endToken => _rightBracket; 7140 Token get endToken => _rightBracket;
6810 7141
6811 /** 7142 /**
6812 * Return the expression used to compute the index. 7143 * Return the expression used to compute the index.
6813 * 7144 *
6814 * @return the expression used to compute the index 7145 * @return the expression used to compute the index
6815 */ 7146 */
6816 Expression get index => _index; 7147 Expression get index => _index;
6817 7148
6818 /** 7149 /**
(...skipping 24 matching lines...) Expand all
6843 */ 7174 */
6844 Expression get realTarget { 7175 Expression get realTarget {
6845 if (isCascaded) { 7176 if (isCascaded) {
6846 ASTNode ancestor = parent; 7177 ASTNode ancestor = parent;
6847 while (ancestor is! CascadeExpression) { 7178 while (ancestor is! CascadeExpression) {
6848 if (ancestor == null) { 7179 if (ancestor == null) {
6849 return _target; 7180 return _target;
6850 } 7181 }
6851 ancestor = ancestor.parent; 7182 ancestor = ancestor.parent;
6852 } 7183 }
6853 return ((ancestor as CascadeExpression)).target; 7184 return (ancestor as CascadeExpression).target;
6854 } 7185 }
6855 return _target; 7186 return _target;
6856 } 7187 }
6857 7188
6858 /** 7189 /**
6859 * Return the right square bracket. 7190 * Return the right square bracket.
6860 * 7191 *
6861 * @return the right square bracket 7192 * @return the right square bracket
6862 */ 7193 */
6863 Token get rightBracket => _rightBracket; 7194 Token get rightBracket => _rightBracket;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
6907 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar e 7238 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar e
6908 * they mutually exclusive. In other words, it is possible for both methods to return `true` 7239 * they mutually exclusive. In other words, it is possible for both methods to return `true`
6909 * when invoked on the same node. 7240 * when invoked on the same node.
6910 * 7241 *
6911 * @return `true` if this expression is in a context where the operator '[]=' will be 7242 * @return `true` if this expression is in a context where the operator '[]=' will be
6912 * invoked 7243 * invoked
6913 */ 7244 */
6914 bool inSetterContext() { 7245 bool inSetterContext() {
6915 ASTNode parent = this.parent; 7246 ASTNode parent = this.parent;
6916 if (parent is PrefixExpression) { 7247 if (parent is PrefixExpression) {
6917 return ((parent as PrefixExpression)).operator.type.isIncrementOperator; 7248 return (parent as PrefixExpression).operator.type.isIncrementOperator;
6918 } else if (parent is PostfixExpression) { 7249 } else if (parent is PostfixExpression) {
6919 return true; 7250 return true;
6920 } else if (parent is AssignmentExpression) { 7251 } else if (parent is AssignmentExpression) {
6921 return identical(((parent as AssignmentExpression)).leftHandSide, this); 7252 return identical((parent as AssignmentExpression).leftHandSide, this);
6922 } 7253 }
6923 return false; 7254 return false;
6924 } 7255 }
7256
6925 bool get isAssignable => true; 7257 bool get isAssignable => true;
6926 7258
6927 /** 7259 /**
6928 * Return `true` if this expression is cascaded. If it is, then the target of this 7260 * Return `true` if this expression is cascaded. If it is, then the target of this
6929 * expression is not stored locally but is stored in the nearest ancestor that is a 7261 * expression is not stored locally but is stored in the nearest ancestor that is a
6930 * [CascadeExpression]. 7262 * [CascadeExpression].
6931 * 7263 *
6932 * @return `true` if this expression is cascaded 7264 * @return `true` if this expression is cascaded
6933 */ 7265 */
6934 bool get isCascaded => period != null; 7266 bool get isCascaded => period != null;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
6981 } 7313 }
6982 7314
6983 /** 7315 /**
6984 * Set the expression used to compute the object being indexed to the given ex pression. 7316 * Set the expression used to compute the object being indexed to the given ex pression.
6985 * 7317 *
6986 * @param expression the expression used to compute the object being indexed 7318 * @param expression the expression used to compute the object being indexed
6987 */ 7319 */
6988 void set target(Expression expression) { 7320 void set target(Expression expression) {
6989 _target = becomeParentOf(expression); 7321 _target = becomeParentOf(expression);
6990 } 7322 }
7323
6991 void visitChildren(ASTVisitor visitor) { 7324 void visitChildren(ASTVisitor visitor) {
6992 safelyVisitChild(_target, visitor); 7325 safelyVisitChild(_target, visitor);
6993 safelyVisitChild(_index, visitor); 7326 safelyVisitChild(_index, visitor);
6994 } 7327 }
6995 7328
6996 /** 7329 /**
6997 * If the AST structure has been resolved, and the function being invoked is k nown based on 7330 * If the AST structure has been resolved, and the function being invoked is k nown based on
6998 * propagated type information, then return the parameter element representing the parameter to 7331 * propagated type information, then return the parameter element representing the parameter to
6999 * which the value of the index expression will be bound. Otherwise, return `n ull`. 7332 * which the value of the index expression will be bound. Otherwise, return `n ull`.
7000 * 7333 *
(...skipping 27 matching lines...) Expand all
7028 if (_staticElement == null) { 7361 if (_staticElement == null) {
7029 return null; 7362 return null;
7030 } 7363 }
7031 List<ParameterElement> parameters = _staticElement.parameters; 7364 List<ParameterElement> parameters = _staticElement.parameters;
7032 if (parameters.length < 1) { 7365 if (parameters.length < 1) {
7033 return null; 7366 return null;
7034 } 7367 }
7035 return parameters[0]; 7368 return parameters[0];
7036 } 7369 }
7037 } 7370 }
7371
7038 /** 7372 /**
7039 * Instances of the class `InstanceCreationExpression` represent an instance cre ation 7373 * Instances of the class `InstanceCreationExpression` represent an instance cre ation
7040 * expression. 7374 * expression.
7041 * 7375 *
7042 * <pre> 7376 * <pre>
7043 * newExpression ::= 7377 * newExpression ::=
7044 * ('new' | 'const') [TypeName] ('.' [SimpleIdentifier])? [ArgumentList] 7378 * ('new' | 'const') [TypeName] ('.' [SimpleIdentifier])? [ArgumentList]
7045 * </pre> 7379 * </pre>
7046 * 7380 *
7047 * @coverage dart.engine.ast 7381 * @coverage dart.engine.ast
7048 */ 7382 */
7049 class InstanceCreationExpression extends Expression { 7383 class InstanceCreationExpression extends Expression {
7050
7051 /** 7384 /**
7052 * The keyword used to indicate how an object should be created. 7385 * The keyword used to indicate how an object should be created.
7053 */ 7386 */
7054 Token keyword; 7387 Token keyword;
7055 7388
7056 /** 7389 /**
7057 * The name of the constructor to be invoked. 7390 * The name of the constructor to be invoked.
7058 */ 7391 */
7059 ConstructorName constructorName; 7392 ConstructorName constructorName;
7060 7393
(...skipping 22 matching lines...) Expand all
7083 } 7416 }
7084 7417
7085 /** 7418 /**
7086 * Initialize a newly created instance creation expression. 7419 * Initialize a newly created instance creation expression.
7087 * 7420 *
7088 * @param keyword the keyword used to indicate how an object should be created 7421 * @param keyword the keyword used to indicate how an object should be created
7089 * @param constructorName the name of the constructor to be invoked 7422 * @param constructorName the name of the constructor to be invoked
7090 * @param argumentList the list of arguments to the constructor 7423 * @param argumentList the list of arguments to the constructor
7091 */ 7424 */
7092 InstanceCreationExpression({Token keyword, ConstructorName constructorName, Ar gumentList argumentList}) : this.full(keyword, constructorName, argumentList); 7425 InstanceCreationExpression({Token keyword, ConstructorName constructorName, Ar gumentList argumentList}) : this.full(keyword, constructorName, argumentList);
7426
7093 accept(ASTVisitor visitor) => visitor.visitInstanceCreationExpression(this); 7427 accept(ASTVisitor visitor) => visitor.visitInstanceCreationExpression(this);
7094 7428
7095 /** 7429 /**
7096 * Return the list of arguments to the constructor. 7430 * Return the list of arguments to the constructor.
7097 * 7431 *
7098 * @return the list of arguments to the constructor 7432 * @return the list of arguments to the constructor
7099 */ 7433 */
7100 ArgumentList get argumentList => _argumentList; 7434 ArgumentList get argumentList => _argumentList;
7435
7101 Token get beginToken => keyword; 7436 Token get beginToken => keyword;
7437
7102 Token get endToken => _argumentList.endToken; 7438 Token get endToken => _argumentList.endToken;
7103 7439
7104 /** 7440 /**
7105 * Return `true` if this creation expression is used to invoke a constant cons tructor. 7441 * Return `true` if this creation expression is used to invoke a constant cons tructor.
7106 * 7442 *
7107 * @return `true` if this creation expression is used to invoke a constant con structor 7443 * @return `true` if this creation expression is used to invoke a constant con structor
7108 */ 7444 */
7109 bool get isConst => keyword is KeywordToken && identical(((keyword as KeywordT oken)).keyword, Keyword.CONST); 7445 bool get isConst => keyword is KeywordToken && identical((keyword as KeywordTo ken).keyword, Keyword.CONST);
7110 7446
7111 /** 7447 /**
7112 * Set the list of arguments to the constructor to the given list. 7448 * Set the list of arguments to the constructor to the given list.
7113 * 7449 *
7114 * @param argumentList the list of arguments to the constructor 7450 * @param argumentList the list of arguments to the constructor
7115 */ 7451 */
7116 void set argumentList(ArgumentList argumentList) { 7452 void set argumentList(ArgumentList argumentList) {
7117 this._argumentList = becomeParentOf(argumentList); 7453 this._argumentList = becomeParentOf(argumentList);
7118 } 7454 }
7455
7119 void visitChildren(ASTVisitor visitor) { 7456 void visitChildren(ASTVisitor visitor) {
7120 safelyVisitChild(constructorName, visitor); 7457 safelyVisitChild(constructorName, visitor);
7121 safelyVisitChild(_argumentList, visitor); 7458 safelyVisitChild(_argumentList, visitor);
7122 } 7459 }
7123 } 7460 }
7461
7124 /** 7462 /**
7125 * Instances of the class `IntegerLiteral` represent an integer literal expressi on. 7463 * Instances of the class `IntegerLiteral` represent an integer literal expressi on.
7126 * 7464 *
7127 * <pre> 7465 * <pre>
7128 * integerLiteral ::= 7466 * integerLiteral ::=
7129 * decimalIntegerLiteral 7467 * decimalIntegerLiteral
7130 * | hexidecimalIntegerLiteral 7468 * | hexidecimalIntegerLiteral
7131 * 7469 *
7132 * decimalIntegerLiteral ::= 7470 * decimalIntegerLiteral ::=
7133 * decimalDigit+ 7471 * decimalDigit+
7134 * 7472 *
7135 * hexidecimalIntegerLiteral ::= 7473 * hexidecimalIntegerLiteral ::=
7136 * '0x' hexidecimalDigit+ 7474 * '0x' hexidecimalDigit+
7137 * | '0X' hexidecimalDigit+ 7475 * | '0X' hexidecimalDigit+
7138 * </pre> 7476 * </pre>
7139 * 7477 *
7140 * @coverage dart.engine.ast 7478 * @coverage dart.engine.ast
7141 */ 7479 */
7142 class IntegerLiteral extends Literal { 7480 class IntegerLiteral extends Literal {
7143
7144 /** 7481 /**
7145 * The token representing the literal. 7482 * The token representing the literal.
7146 */ 7483 */
7147 Token literal; 7484 Token literal;
7148 7485
7149 /** 7486 /**
7150 * The value of the literal. 7487 * The value of the literal.
7151 */ 7488 */
7152 int value = 0; 7489 int value = 0;
7153 7490
7154 /** 7491 /**
7155 * Initialize a newly created integer literal. 7492 * Initialize a newly created integer literal.
7156 * 7493 *
7157 * @param literal the token representing the literal 7494 * @param literal the token representing the literal
7158 * @param value the value of the literal 7495 * @param value the value of the literal
7159 */ 7496 */
7160 IntegerLiteral.full(Token literal, int value) { 7497 IntegerLiteral.full(Token literal, int value) {
7161 this.literal = literal; 7498 this.literal = literal;
7162 this.value = value; 7499 this.value = value;
7163 } 7500 }
7164 7501
7165 /** 7502 /**
7166 * Initialize a newly created integer literal. 7503 * Initialize a newly created integer literal.
7167 * 7504 *
7168 * @param literal the token representing the literal 7505 * @param literal the token representing the literal
7169 * @param value the value of the literal 7506 * @param value the value of the literal
7170 */ 7507 */
7171 IntegerLiteral({Token literal, int value}) : this.full(literal, value); 7508 IntegerLiteral({Token literal, int value}) : this.full(literal, value);
7509
7172 accept(ASTVisitor visitor) => visitor.visitIntegerLiteral(this); 7510 accept(ASTVisitor visitor) => visitor.visitIntegerLiteral(this);
7511
7173 Token get beginToken => literal; 7512 Token get beginToken => literal;
7513
7174 Token get endToken => literal; 7514 Token get endToken => literal;
7515
7175 void visitChildren(ASTVisitor visitor) { 7516 void visitChildren(ASTVisitor visitor) {
7176 } 7517 }
7177 } 7518 }
7519
7178 /** 7520 /**
7179 * The abstract class `InterpolationElement` defines the behavior common to elem ents within a 7521 * The abstract class `InterpolationElement` defines the behavior common to elem ents within a
7180 * [StringInterpolation]. 7522 * [StringInterpolation].
7181 * 7523 *
7182 * <pre> 7524 * <pre>
7183 * interpolationElement ::= 7525 * interpolationElement ::=
7184 * [InterpolationExpression] 7526 * [InterpolationExpression]
7185 * | [InterpolationString] 7527 * | [InterpolationString]
7186 * </pre> 7528 * </pre>
7187 * 7529 *
7188 * @coverage dart.engine.ast 7530 * @coverage dart.engine.ast
7189 */ 7531 */
7190 abstract class InterpolationElement extends ASTNode { 7532 abstract class InterpolationElement extends ASTNode {
7191 } 7533 }
7534
7192 /** 7535 /**
7193 * Instances of the class `InterpolationExpression` represent an expression embe dded in a 7536 * Instances of the class `InterpolationExpression` represent an expression embe dded in a
7194 * string interpolation. 7537 * string interpolation.
7195 * 7538 *
7196 * <pre> 7539 * <pre>
7197 * interpolationExpression ::= 7540 * interpolationExpression ::=
7198 * '$' [SimpleIdentifier] 7541 * '$' [SimpleIdentifier]
7199 * | '$' '{' [Expression] '}' 7542 * | '$' '{' [Expression] '}'
7200 * </pre> 7543 * </pre>
7201 * 7544 *
7202 * @coverage dart.engine.ast 7545 * @coverage dart.engine.ast
7203 */ 7546 */
7204 class InterpolationExpression extends InterpolationElement { 7547 class InterpolationExpression extends InterpolationElement {
7205
7206 /** 7548 /**
7207 * The token used to introduce the interpolation expression; either '$' if the expression is a 7549 * The token used to introduce the interpolation expression; either '$' if the expression is a
7208 * simple identifier or '${' if the expression is a full expression. 7550 * simple identifier or '${' if the expression is a full expression.
7209 */ 7551 */
7210 Token leftBracket; 7552 Token leftBracket;
7211 7553
7212 /** 7554 /**
7213 * The expression to be evaluated for the value to be converted into a string. 7555 * The expression to be evaluated for the value to be converted into a string.
7214 */ 7556 */
7215 Expression _expression; 7557 Expression _expression;
(...skipping 17 matching lines...) Expand all
7233 } 7575 }
7234 7576
7235 /** 7577 /**
7236 * Initialize a newly created interpolation expression. 7578 * Initialize a newly created interpolation expression.
7237 * 7579 *
7238 * @param leftBracket the left curly bracket 7580 * @param leftBracket the left curly bracket
7239 * @param expression the expression to be evaluated for the value to be conver ted into a string 7581 * @param expression the expression to be evaluated for the value to be conver ted into a string
7240 * @param rightBracket the right curly bracket 7582 * @param rightBracket the right curly bracket
7241 */ 7583 */
7242 InterpolationExpression({Token leftBracket, Expression expression, Token right Bracket}) : this.full(leftBracket, expression, rightBracket); 7584 InterpolationExpression({Token leftBracket, Expression expression, Token right Bracket}) : this.full(leftBracket, expression, rightBracket);
7585
7243 accept(ASTVisitor visitor) => visitor.visitInterpolationExpression(this); 7586 accept(ASTVisitor visitor) => visitor.visitInterpolationExpression(this);
7587
7244 Token get beginToken => leftBracket; 7588 Token get beginToken => leftBracket;
7589
7245 Token get endToken { 7590 Token get endToken {
7246 if (rightBracket != null) { 7591 if (rightBracket != null) {
7247 return rightBracket; 7592 return rightBracket;
7248 } 7593 }
7249 return _expression.endToken; 7594 return _expression.endToken;
7250 } 7595 }
7251 7596
7252 /** 7597 /**
7253 * Return the expression to be evaluated for the value to be converted into a string. 7598 * Return the expression to be evaluated for the value to be converted into a string.
7254 * 7599 *
7255 * @return the expression to be evaluated for the value to be converted into a string 7600 * @return the expression to be evaluated for the value to be converted into a string
7256 */ 7601 */
7257 Expression get expression => _expression; 7602 Expression get expression => _expression;
7258 7603
7259 /** 7604 /**
7260 * Set the expression to be evaluated for the value to be converted into a str ing to the given 7605 * Set the expression to be evaluated for the value to be converted into a str ing to the given
7261 * expression. 7606 * expression.
7262 * 7607 *
7263 * @param expression the expression to be evaluated for the value to be conver ted into a string 7608 * @param expression the expression to be evaluated for the value to be conver ted into a string
7264 */ 7609 */
7265 void set expression(Expression expression) { 7610 void set expression(Expression expression) {
7266 this._expression = becomeParentOf(expression); 7611 this._expression = becomeParentOf(expression);
7267 } 7612 }
7613
7268 void visitChildren(ASTVisitor visitor) { 7614 void visitChildren(ASTVisitor visitor) {
7269 safelyVisitChild(_expression, visitor); 7615 safelyVisitChild(_expression, visitor);
7270 } 7616 }
7271 } 7617 }
7618
7272 /** 7619 /**
7273 * Instances of the class `InterpolationString` represent a non-empty substring of an 7620 * Instances of the class `InterpolationString` represent a non-empty substring of an
7274 * interpolated string. 7621 * interpolated string.
7275 * 7622 *
7276 * <pre> 7623 * <pre>
7277 * interpolationString ::= 7624 * interpolationString ::=
7278 * characters 7625 * characters
7279 * </pre> 7626 * </pre>
7280 * 7627 *
7281 * @coverage dart.engine.ast 7628 * @coverage dart.engine.ast
7282 */ 7629 */
7283 class InterpolationString extends InterpolationElement { 7630 class InterpolationString extends InterpolationElement {
7284
7285 /** 7631 /**
7286 * The characters that will be added to the string. 7632 * The characters that will be added to the string.
7287 */ 7633 */
7288 Token _contents; 7634 Token _contents;
7289 7635
7290 /** 7636 /**
7291 * The value of the literal. 7637 * The value of the literal.
7292 */ 7638 */
7293 String _value; 7639 String _value;
7294 7640
7295 /** 7641 /**
7296 * Initialize a newly created string of characters that are part of a string i nterpolation. 7642 * Initialize a newly created string of characters that are part of a string i nterpolation.
7297 * 7643 *
7298 * @param the characters that will be added to the string 7644 * @param the characters that will be added to the string
7299 * @param value the value of the literal 7645 * @param value the value of the literal
7300 */ 7646 */
7301 InterpolationString.full(Token contents, String value) { 7647 InterpolationString.full(Token contents, String value) {
7302 this._contents = contents; 7648 this._contents = contents;
7303 this._value = value; 7649 this._value = value;
7304 } 7650 }
7305 7651
7306 /** 7652 /**
7307 * Initialize a newly created string of characters that are part of a string i nterpolation. 7653 * Initialize a newly created string of characters that are part of a string i nterpolation.
7308 * 7654 *
7309 * @param the characters that will be added to the string 7655 * @param the characters that will be added to the string
7310 * @param value the value of the literal 7656 * @param value the value of the literal
7311 */ 7657 */
7312 InterpolationString({Token contents, String value}) : this.full(contents, valu e); 7658 InterpolationString({Token contents, String value}) : this.full(contents, valu e);
7659
7313 accept(ASTVisitor visitor) => visitor.visitInterpolationString(this); 7660 accept(ASTVisitor visitor) => visitor.visitInterpolationString(this);
7661
7314 Token get beginToken => _contents; 7662 Token get beginToken => _contents;
7315 7663
7316 /** 7664 /**
7317 * Return the characters that will be added to the string. 7665 * Return the characters that will be added to the string.
7318 * 7666 *
7319 * @return the characters that will be added to the string 7667 * @return the characters that will be added to the string
7320 */ 7668 */
7321 Token get contents => _contents; 7669 Token get contents => _contents;
7670
7322 Token get endToken => _contents; 7671 Token get endToken => _contents;
7323 7672
7324 /** 7673 /**
7325 * Return the value of the literal. 7674 * Return the value of the literal.
7326 * 7675 *
7327 * @return the value of the literal 7676 * @return the value of the literal
7328 */ 7677 */
7329 String get value => _value; 7678 String get value => _value;
7330 7679
7331 /** 7680 /**
7332 * Set the characters that will be added to the string to those in the given s tring. 7681 * Set the characters that will be added to the string to those in the given s tring.
7333 * 7682 *
7334 * @param string the characters that will be added to the string 7683 * @param string the characters that will be added to the string
7335 */ 7684 */
7336 void set contents(Token string) { 7685 void set contents(Token string) {
7337 _contents = string; 7686 _contents = string;
7338 } 7687 }
7339 7688
7340 /** 7689 /**
7341 * Set the value of the literal to the given string. 7690 * Set the value of the literal to the given string.
7342 * 7691 *
7343 * @param string the value of the literal 7692 * @param string the value of the literal
7344 */ 7693 */
7345 void set value(String string) { 7694 void set value(String string) {
7346 _value = string; 7695 _value = string;
7347 } 7696 }
7697
7348 void visitChildren(ASTVisitor visitor) { 7698 void visitChildren(ASTVisitor visitor) {
7349 } 7699 }
7350 } 7700 }
7701
7351 /** 7702 /**
7352 * Instances of the class `IsExpression` represent an is expression. 7703 * Instances of the class `IsExpression` represent an is expression.
7353 * 7704 *
7354 * <pre> 7705 * <pre>
7355 * isExpression ::= 7706 * isExpression ::=
7356 * [Expression] 'is' '!'? [TypeName] 7707 * [Expression] 'is' '!'? [TypeName]
7357 * </pre> 7708 * </pre>
7358 * 7709 *
7359 * @coverage dart.engine.ast 7710 * @coverage dart.engine.ast
7360 */ 7711 */
7361 class IsExpression extends Expression { 7712 class IsExpression extends Expression {
7362
7363 /** 7713 /**
7364 * The expression used to compute the value whose type is being tested. 7714 * The expression used to compute the value whose type is being tested.
7365 */ 7715 */
7366 Expression _expression; 7716 Expression _expression;
7367 7717
7368 /** 7718 /**
7369 * The is operator. 7719 * The is operator.
7370 */ 7720 */
7371 Token isOperator; 7721 Token isOperator;
7372 7722
(...skipping 24 matching lines...) Expand all
7397 7747
7398 /** 7748 /**
7399 * Initialize a newly created is expression. 7749 * Initialize a newly created is expression.
7400 * 7750 *
7401 * @param expression the expression used to compute the value whose type is be ing tested 7751 * @param expression the expression used to compute the value whose type is be ing tested
7402 * @param isOperator the is operator 7752 * @param isOperator the is operator
7403 * @param notOperator the not operator, or `null` if the sense of the test is not negated 7753 * @param notOperator the not operator, or `null` if the sense of the test is not negated
7404 * @param type the name of the type being tested for 7754 * @param type the name of the type being tested for
7405 */ 7755 */
7406 IsExpression({Expression expression, Token isOperator, Token notOperator, Type Name type}) : this.full(expression, isOperator, notOperator, type); 7756 IsExpression({Expression expression, Token isOperator, Token notOperator, Type Name type}) : this.full(expression, isOperator, notOperator, type);
7757
7407 accept(ASTVisitor visitor) => visitor.visitIsExpression(this); 7758 accept(ASTVisitor visitor) => visitor.visitIsExpression(this);
7759
7408 Token get beginToken => _expression.beginToken; 7760 Token get beginToken => _expression.beginToken;
7761
7409 Token get endToken => _type.endToken; 7762 Token get endToken => _type.endToken;
7410 7763
7411 /** 7764 /**
7412 * Return the expression used to compute the value whose type is being tested. 7765 * Return the expression used to compute the value whose type is being tested.
7413 * 7766 *
7414 * @return the expression used to compute the value whose type is being tested 7767 * @return the expression used to compute the value whose type is being tested
7415 */ 7768 */
7416 Expression get expression => _expression; 7769 Expression get expression => _expression;
7417 7770
7418 /** 7771 /**
(...skipping 14 matching lines...) Expand all
7433 } 7786 }
7434 7787
7435 /** 7788 /**
7436 * Set the name of the type being tested for to the given name. 7789 * Set the name of the type being tested for to the given name.
7437 * 7790 *
7438 * @param name the name of the type being tested for 7791 * @param name the name of the type being tested for
7439 */ 7792 */
7440 void set type(TypeName name) { 7793 void set type(TypeName name) {
7441 this._type = becomeParentOf(name); 7794 this._type = becomeParentOf(name);
7442 } 7795 }
7796
7443 void visitChildren(ASTVisitor visitor) { 7797 void visitChildren(ASTVisitor visitor) {
7444 safelyVisitChild(_expression, visitor); 7798 safelyVisitChild(_expression, visitor);
7445 safelyVisitChild(_type, visitor); 7799 safelyVisitChild(_type, visitor);
7446 } 7800 }
7447 } 7801 }
7802
7448 /** 7803 /**
7449 * Instances of the class `Label` represent a label. 7804 * Instances of the class `Label` represent a label.
7450 * 7805 *
7451 * <pre> 7806 * <pre>
7452 * label ::= 7807 * label ::=
7453 * [SimpleIdentifier] ':' 7808 * [SimpleIdentifier] ':'
7454 * </pre> 7809 * </pre>
7455 * 7810 *
7456 * @coverage dart.engine.ast 7811 * @coverage dart.engine.ast
7457 */ 7812 */
7458 class Label extends ASTNode { 7813 class Label extends ASTNode {
7459
7460 /** 7814 /**
7461 * The label being associated with the statement. 7815 * The label being associated with the statement.
7462 */ 7816 */
7463 SimpleIdentifier _label; 7817 SimpleIdentifier _label;
7464 7818
7465 /** 7819 /**
7466 * The colon that separates the label from the statement. 7820 * The colon that separates the label from the statement.
7467 */ 7821 */
7468 Token colon; 7822 Token colon;
7469 7823
7470 /** 7824 /**
7471 * Initialize a newly created label. 7825 * Initialize a newly created label.
7472 * 7826 *
7473 * @param label the label being applied 7827 * @param label the label being applied
7474 * @param colon the colon that separates the label from whatever follows 7828 * @param colon the colon that separates the label from whatever follows
7475 */ 7829 */
7476 Label.full(SimpleIdentifier label, Token colon) { 7830 Label.full(SimpleIdentifier label, Token colon) {
7477 this._label = becomeParentOf(label); 7831 this._label = becomeParentOf(label);
7478 this.colon = colon; 7832 this.colon = colon;
7479 } 7833 }
7480 7834
7481 /** 7835 /**
7482 * Initialize a newly created label. 7836 * Initialize a newly created label.
7483 * 7837 *
7484 * @param label the label being applied 7838 * @param label the label being applied
7485 * @param colon the colon that separates the label from whatever follows 7839 * @param colon the colon that separates the label from whatever follows
7486 */ 7840 */
7487 Label({SimpleIdentifier label, Token colon}) : this.full(label, colon); 7841 Label({SimpleIdentifier label, Token colon}) : this.full(label, colon);
7842
7488 accept(ASTVisitor visitor) => visitor.visitLabel(this); 7843 accept(ASTVisitor visitor) => visitor.visitLabel(this);
7844
7489 Token get beginToken => _label.beginToken; 7845 Token get beginToken => _label.beginToken;
7846
7490 Token get endToken => colon; 7847 Token get endToken => colon;
7491 7848
7492 /** 7849 /**
7493 * Return the label being associated with the statement. 7850 * Return the label being associated with the statement.
7494 * 7851 *
7495 * @return the label being associated with the statement 7852 * @return the label being associated with the statement
7496 */ 7853 */
7497 SimpleIdentifier get label => _label; 7854 SimpleIdentifier get label => _label;
7498 7855
7499 /** 7856 /**
7500 * Set the label being associated with the statement to the given label. 7857 * Set the label being associated with the statement to the given label.
7501 * 7858 *
7502 * @param label the label being associated with the statement 7859 * @param label the label being associated with the statement
7503 */ 7860 */
7504 void set label(SimpleIdentifier label) { 7861 void set label(SimpleIdentifier label) {
7505 this._label = becomeParentOf(label); 7862 this._label = becomeParentOf(label);
7506 } 7863 }
7864
7507 void visitChildren(ASTVisitor visitor) { 7865 void visitChildren(ASTVisitor visitor) {
7508 safelyVisitChild(_label, visitor); 7866 safelyVisitChild(_label, visitor);
7509 } 7867 }
7510 } 7868 }
7869
7511 /** 7870 /**
7512 * Instances of the class `LabeledStatement` represent a statement that has a la bel associated 7871 * Instances of the class `LabeledStatement` represent a statement that has a la bel associated
7513 * with them. 7872 * with them.
7514 * 7873 *
7515 * <pre> 7874 * <pre>
7516 * labeledStatement ::= 7875 * labeledStatement ::=
7517 * [Label]+ [Statement] 7876 * [Label]+ [Statement]
7518 * </pre> 7877 * </pre>
7519 * 7878 *
7520 * @coverage dart.engine.ast 7879 * @coverage dart.engine.ast
7521 */ 7880 */
7522 class LabeledStatement extends Statement { 7881 class LabeledStatement extends Statement {
7523
7524 /** 7882 /**
7525 * The labels being associated with the statement. 7883 * The labels being associated with the statement.
7526 */ 7884 */
7527 NodeList<Label> labels; 7885 NodeList<Label> labels;
7528 7886
7529 /** 7887 /**
7530 * The statement with which the labels are being associated. 7888 * The statement with which the labels are being associated.
7531 */ 7889 */
7532 Statement _statement; 7890 Statement _statement;
7533 7891
7534 /** 7892 /**
7535 * Initialize a newly created labeled statement. 7893 * Initialize a newly created labeled statement.
7536 * 7894 *
7537 * @param labels the labels being associated with the statement 7895 * @param labels the labels being associated with the statement
7538 * @param statement the statement with which the labels are being associated 7896 * @param statement the statement with which the labels are being associated
7539 */ 7897 */
7540 LabeledStatement.full(List<Label> labels, Statement statement) { 7898 LabeledStatement.full(List<Label> labels, Statement statement) {
7541 this.labels = new NodeList<Label>(this); 7899 this.labels = new NodeList<Label>(this);
7542 this.labels.addAll(labels); 7900 this.labels.addAll(labels);
7543 this._statement = becomeParentOf(statement); 7901 this._statement = becomeParentOf(statement);
7544 } 7902 }
7545 7903
7546 /** 7904 /**
7547 * Initialize a newly created labeled statement. 7905 * Initialize a newly created labeled statement.
7548 * 7906 *
7549 * @param labels the labels being associated with the statement 7907 * @param labels the labels being associated with the statement
7550 * @param statement the statement with which the labels are being associated 7908 * @param statement the statement with which the labels are being associated
7551 */ 7909 */
7552 LabeledStatement({List<Label> labels, Statement statement}) : this.full(labels , statement); 7910 LabeledStatement({List<Label> labels, Statement statement}) : this.full(labels , statement);
7911
7553 accept(ASTVisitor visitor) => visitor.visitLabeledStatement(this); 7912 accept(ASTVisitor visitor) => visitor.visitLabeledStatement(this);
7913
7554 Token get beginToken { 7914 Token get beginToken {
7555 if (!labels.isEmpty) { 7915 if (!labels.isEmpty) {
7556 return labels.beginToken; 7916 return labels.beginToken;
7557 } 7917 }
7558 return _statement.beginToken; 7918 return _statement.beginToken;
7559 } 7919 }
7920
7560 Token get endToken => _statement.endToken; 7921 Token get endToken => _statement.endToken;
7561 7922
7562 /** 7923 /**
7563 * Return the statement with which the labels are being associated. 7924 * Return the statement with which the labels are being associated.
7564 * 7925 *
7565 * @return the statement with which the labels are being associated 7926 * @return the statement with which the labels are being associated
7566 */ 7927 */
7567 Statement get statement => _statement; 7928 Statement get statement => _statement;
7568 7929
7569 /** 7930 /**
7570 * Set the statement with which the labels are being associated to the given s tatement. 7931 * Set the statement with which the labels are being associated to the given s tatement.
7571 * 7932 *
7572 * @param statement the statement with which the labels are being associated 7933 * @param statement the statement with which the labels are being associated
7573 */ 7934 */
7574 void set statement(Statement statement) { 7935 void set statement(Statement statement) {
7575 this._statement = becomeParentOf(statement); 7936 this._statement = becomeParentOf(statement);
7576 } 7937 }
7938
7577 void visitChildren(ASTVisitor visitor) { 7939 void visitChildren(ASTVisitor visitor) {
7578 labels.accept(visitor); 7940 labels.accept(visitor);
7579 safelyVisitChild(_statement, visitor); 7941 safelyVisitChild(_statement, visitor);
7580 } 7942 }
7581 } 7943 }
7944
7582 /** 7945 /**
7583 * Instances of the class `LibraryDirective` represent a library directive. 7946 * Instances of the class `LibraryDirective` represent a library directive.
7584 * 7947 *
7585 * <pre> 7948 * <pre>
7586 * libraryDirective ::= 7949 * libraryDirective ::=
7587 * [Annotation] 'library' [Identifier] ';' 7950 * [Annotation] 'library' [Identifier] ';'
7588 * </pre> 7951 * </pre>
7589 * 7952 *
7590 * @coverage dart.engine.ast 7953 * @coverage dart.engine.ast
7591 */ 7954 */
7592 class LibraryDirective extends Directive { 7955 class LibraryDirective extends Directive {
7593
7594 /** 7956 /**
7595 * The token representing the 'library' token. 7957 * The token representing the 'library' token.
7596 */ 7958 */
7597 Token libraryToken; 7959 Token libraryToken;
7598 7960
7599 /** 7961 /**
7600 * The name of the library being defined. 7962 * The name of the library being defined.
7601 */ 7963 */
7602 LibraryIdentifier _name; 7964 LibraryIdentifier _name;
7603 7965
(...skipping 20 matching lines...) Expand all
7624 /** 7986 /**
7625 * Initialize a newly created library directive. 7987 * Initialize a newly created library directive.
7626 * 7988 *
7627 * @param comment the documentation comment associated with this directive 7989 * @param comment the documentation comment associated with this directive
7628 * @param metadata the annotations associated with the directive 7990 * @param metadata the annotations associated with the directive
7629 * @param libraryToken the token representing the 'library' token 7991 * @param libraryToken the token representing the 'library' token
7630 * @param name the name of the library being defined 7992 * @param name the name of the library being defined
7631 * @param semicolon the semicolon terminating the directive 7993 * @param semicolon the semicolon terminating the directive
7632 */ 7994 */
7633 LibraryDirective({Comment comment, List<Annotation> metadata, Token libraryTok en, LibraryIdentifier name, Token semicolon}) : this.full(comment, metadata, lib raryToken, name, semicolon); 7995 LibraryDirective({Comment comment, List<Annotation> metadata, Token libraryTok en, LibraryIdentifier name, Token semicolon}) : this.full(comment, metadata, lib raryToken, name, semicolon);
7996
7634 accept(ASTVisitor visitor) => visitor.visitLibraryDirective(this); 7997 accept(ASTVisitor visitor) => visitor.visitLibraryDirective(this);
7998
7635 Token get endToken => semicolon; 7999 Token get endToken => semicolon;
8000
7636 Token get keyword => libraryToken; 8001 Token get keyword => libraryToken;
7637 8002
7638 /** 8003 /**
7639 * Return the name of the library being defined. 8004 * Return the name of the library being defined.
7640 * 8005 *
7641 * @return the name of the library being defined 8006 * @return the name of the library being defined
7642 */ 8007 */
7643 LibraryIdentifier get name => _name; 8008 LibraryIdentifier get name => _name;
7644 8009
7645 /** 8010 /**
7646 * Set the name of the library being defined to the given name. 8011 * Set the name of the library being defined to the given name.
7647 * 8012 *
7648 * @param name the name of the library being defined 8013 * @param name the name of the library being defined
7649 */ 8014 */
7650 void set name(LibraryIdentifier name) { 8015 void set name(LibraryIdentifier name) {
7651 this._name = becomeParentOf(name); 8016 this._name = becomeParentOf(name);
7652 } 8017 }
8018
7653 void visitChildren(ASTVisitor visitor) { 8019 void visitChildren(ASTVisitor visitor) {
7654 super.visitChildren(visitor); 8020 super.visitChildren(visitor);
7655 safelyVisitChild(_name, visitor); 8021 safelyVisitChild(_name, visitor);
7656 } 8022 }
8023
7657 Token get firstTokenAfterCommentAndMetadata => libraryToken; 8024 Token get firstTokenAfterCommentAndMetadata => libraryToken;
7658 } 8025 }
8026
7659 /** 8027 /**
7660 * Instances of the class `LibraryIdentifier` represent the identifier for a lib rary. 8028 * Instances of the class `LibraryIdentifier` represent the identifier for a lib rary.
7661 * 8029 *
7662 * <pre> 8030 * <pre>
7663 * libraryIdentifier ::= 8031 * libraryIdentifier ::=
7664 * [SimpleIdentifier] ('.' [SimpleIdentifier])* 8032 * [SimpleIdentifier] ('.' [SimpleIdentifier])*
7665 * </pre> 8033 * </pre>
7666 * 8034 *
7667 * @coverage dart.engine.ast 8035 * @coverage dart.engine.ast
7668 */ 8036 */
7669 class LibraryIdentifier extends Identifier { 8037 class LibraryIdentifier extends Identifier {
7670
7671 /** 8038 /**
7672 * The components of the identifier. 8039 * The components of the identifier.
7673 */ 8040 */
7674 NodeList<SimpleIdentifier> components; 8041 NodeList<SimpleIdentifier> components;
7675 8042
7676 /** 8043 /**
7677 * Initialize a newly created prefixed identifier. 8044 * Initialize a newly created prefixed identifier.
7678 * 8045 *
7679 * @param components the components of the identifier 8046 * @param components the components of the identifier
7680 */ 8047 */
7681 LibraryIdentifier.full(List<SimpleIdentifier> components) { 8048 LibraryIdentifier.full(List<SimpleIdentifier> components) {
7682 this.components = new NodeList<SimpleIdentifier>(this); 8049 this.components = new NodeList<SimpleIdentifier>(this);
7683 this.components.addAll(components); 8050 this.components.addAll(components);
7684 } 8051 }
7685 8052
7686 /** 8053 /**
7687 * Initialize a newly created prefixed identifier. 8054 * Initialize a newly created prefixed identifier.
7688 * 8055 *
7689 * @param components the components of the identifier 8056 * @param components the components of the identifier
7690 */ 8057 */
7691 LibraryIdentifier({List<SimpleIdentifier> components}) : this.full(components) ; 8058 LibraryIdentifier({List<SimpleIdentifier> components}) : this.full(components) ;
8059
7692 accept(ASTVisitor visitor) => visitor.visitLibraryIdentifier(this); 8060 accept(ASTVisitor visitor) => visitor.visitLibraryIdentifier(this);
8061
7693 Token get beginToken => components.beginToken; 8062 Token get beginToken => components.beginToken;
8063
7694 Element get bestElement => staticElement; 8064 Element get bestElement => staticElement;
8065
7695 Token get endToken => components.endToken; 8066 Token get endToken => components.endToken;
8067
7696 String get name { 8068 String get name {
7697 JavaStringBuilder builder = new JavaStringBuilder(); 8069 JavaStringBuilder builder = new JavaStringBuilder();
7698 bool needsPeriod = false; 8070 bool needsPeriod = false;
7699 for (SimpleIdentifier identifier in components) { 8071 for (SimpleIdentifier identifier in components) {
7700 if (needsPeriod) { 8072 if (needsPeriod) {
7701 builder.append("."); 8073 builder.append(".");
7702 } else { 8074 } else {
7703 needsPeriod = true; 8075 needsPeriod = true;
7704 } 8076 }
7705 builder.append(identifier.name); 8077 builder.append(identifier.name);
7706 } 8078 }
7707 return builder.toString(); 8079 return builder.toString();
7708 } 8080 }
8081
7709 Element get propagatedElement => null; 8082 Element get propagatedElement => null;
8083
7710 Element get staticElement => null; 8084 Element get staticElement => null;
8085
7711 void visitChildren(ASTVisitor visitor) { 8086 void visitChildren(ASTVisitor visitor) {
7712 components.accept(visitor); 8087 components.accept(visitor);
7713 } 8088 }
7714 } 8089 }
8090
7715 /** 8091 /**
7716 * Instances of the class `ListLiteral` represent a list literal. 8092 * Instances of the class `ListLiteral` represent a list literal.
7717 * 8093 *
7718 * <pre> 8094 * <pre>
7719 * listLiteral ::= 8095 * listLiteral ::=
7720 * 'const'? ('<' [TypeName] '>')? '[' ([Expression] ','?)? ']' 8096 * 'const'? ('<' [TypeName] '>')? '[' ([Expression] ','?)? ']'
7721 * </pre> 8097 * </pre>
7722 * 8098 *
7723 * @coverage dart.engine.ast 8099 * @coverage dart.engine.ast
7724 */ 8100 */
7725 class ListLiteral extends TypedLiteral { 8101 class ListLiteral extends TypedLiteral {
7726
7727 /** 8102 /**
7728 * The left square bracket. 8103 * The left square bracket.
7729 */ 8104 */
7730 Token _leftBracket; 8105 Token _leftBracket;
7731 8106
7732 /** 8107 /**
7733 * The expressions used to compute the elements of the list. 8108 * The expressions used to compute the elements of the list.
7734 */ 8109 */
7735 NodeList<Expression> elements; 8110 NodeList<Expression> elements;
7736 8111
(...skipping 23 matching lines...) Expand all
7760 * Initialize a newly created list literal. 8135 * Initialize a newly created list literal.
7761 * 8136 *
7762 * @param constKeyword the token representing the 'const' keyword 8137 * @param constKeyword the token representing the 'const' keyword
7763 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 8138 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
7764 * arguments were declared 8139 * arguments were declared
7765 * @param leftBracket the left square bracket 8140 * @param leftBracket the left square bracket
7766 * @param elements the expressions used to compute the elements of the list 8141 * @param elements the expressions used to compute the elements of the list
7767 * @param rightBracket the right square bracket 8142 * @param rightBracket the right square bracket
7768 */ 8143 */
7769 ListLiteral({Token constKeyword, TypeArgumentList typeArguments, Token leftBra cket, List<Expression> elements, Token rightBracket}) : this.full(constKeyword, typeArguments, leftBracket, elements, rightBracket); 8144 ListLiteral({Token constKeyword, TypeArgumentList typeArguments, Token leftBra cket, List<Expression> elements, Token rightBracket}) : this.full(constKeyword, typeArguments, leftBracket, elements, rightBracket);
8145
7770 accept(ASTVisitor visitor) => visitor.visitListLiteral(this); 8146 accept(ASTVisitor visitor) => visitor.visitListLiteral(this);
8147
7771 Token get beginToken { 8148 Token get beginToken {
7772 Token token = constKeyword; 8149 Token token = constKeyword;
7773 if (token != null) { 8150 if (token != null) {
7774 return token; 8151 return token;
7775 } 8152 }
7776 TypeArgumentList typeArguments = this.typeArguments; 8153 TypeArgumentList typeArguments = this.typeArguments;
7777 if (typeArguments != null) { 8154 if (typeArguments != null) {
7778 return typeArguments.beginToken; 8155 return typeArguments.beginToken;
7779 } 8156 }
7780 return _leftBracket; 8157 return _leftBracket;
7781 } 8158 }
8159
7782 Token get endToken => _rightBracket; 8160 Token get endToken => _rightBracket;
7783 8161
7784 /** 8162 /**
7785 * Return the left square bracket. 8163 * Return the left square bracket.
7786 * 8164 *
7787 * @return the left square bracket 8165 * @return the left square bracket
7788 */ 8166 */
7789 Token get leftBracket => _leftBracket; 8167 Token get leftBracket => _leftBracket;
7790 8168
7791 /** 8169 /**
(...skipping 13 matching lines...) Expand all
7805 } 8183 }
7806 8184
7807 /** 8185 /**
7808 * Set the right square bracket to the given token. 8186 * Set the right square bracket to the given token.
7809 * 8187 *
7810 * @param bracket the right square bracket 8188 * @param bracket the right square bracket
7811 */ 8189 */
7812 void set rightBracket(Token bracket) { 8190 void set rightBracket(Token bracket) {
7813 _rightBracket = bracket; 8191 _rightBracket = bracket;
7814 } 8192 }
8193
7815 void visitChildren(ASTVisitor visitor) { 8194 void visitChildren(ASTVisitor visitor) {
7816 super.visitChildren(visitor); 8195 super.visitChildren(visitor);
7817 elements.accept(visitor); 8196 elements.accept(visitor);
7818 } 8197 }
7819 } 8198 }
8199
7820 /** 8200 /**
7821 * The abstract class `Literal` defines the behavior common to nodes that repres ent a literal 8201 * The abstract class `Literal` defines the behavior common to nodes that repres ent a literal
7822 * expression. 8202 * expression.
7823 * 8203 *
7824 * <pre> 8204 * <pre>
7825 * literal ::= 8205 * literal ::=
7826 * [BooleanLiteral] 8206 * [BooleanLiteral]
7827 * | [DoubleLiteral] 8207 * | [DoubleLiteral]
7828 * | [IntegerLiteral] 8208 * | [IntegerLiteral]
7829 * | [ListLiteral] 8209 * | [ListLiteral]
7830 * | [MapLiteral] 8210 * | [MapLiteral]
7831 * | [NullLiteral] 8211 * | [NullLiteral]
7832 * | [StringLiteral] 8212 * | [StringLiteral]
7833 * </pre> 8213 * </pre>
7834 * 8214 *
7835 * @coverage dart.engine.ast 8215 * @coverage dart.engine.ast
7836 */ 8216 */
7837 abstract class Literal extends Expression { 8217 abstract class Literal extends Expression {
7838 } 8218 }
8219
7839 /** 8220 /**
7840 * Instances of the class `MapLiteral` represent a literal map. 8221 * Instances of the class `MapLiteral` represent a literal map.
7841 * 8222 *
7842 * <pre> 8223 * <pre>
7843 * mapLiteral ::= 8224 * mapLiteral ::=
7844 * 'const'? ('<' [TypeName] (',' [TypeName])* '>')? '{' ([MapLiteralEntry] ( ',' [MapLiteralEntry])* ','?)? '}' 8225 * 'const'? ('<' [TypeName] (',' [TypeName])* '>')? '{' ([MapLiteralEntry] ( ',' [MapLiteralEntry])* ','?)? '}'
7845 * </pre> 8226 * </pre>
7846 * 8227 *
7847 * @coverage dart.engine.ast 8228 * @coverage dart.engine.ast
7848 */ 8229 */
7849 class MapLiteral extends TypedLiteral { 8230 class MapLiteral extends TypedLiteral {
7850
7851 /** 8231 /**
7852 * The left curly bracket. 8232 * The left curly bracket.
7853 */ 8233 */
7854 Token _leftBracket; 8234 Token _leftBracket;
7855 8235
7856 /** 8236 /**
7857 * The entries in the map. 8237 * The entries in the map.
7858 */ 8238 */
7859 NodeList<MapLiteralEntry> entries; 8239 NodeList<MapLiteralEntry> entries;
7860 8240
(...skipping 23 matching lines...) Expand all
7884 * Initialize a newly created map literal. 8264 * Initialize a newly created map literal.
7885 * 8265 *
7886 * @param constKeyword the token representing the 'const' keyword 8266 * @param constKeyword the token representing the 'const' keyword
7887 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 8267 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
7888 * arguments were declared 8268 * arguments were declared
7889 * @param leftBracket the left curly bracket 8269 * @param leftBracket the left curly bracket
7890 * @param entries the entries in the map 8270 * @param entries the entries in the map
7891 * @param rightBracket the right curly bracket 8271 * @param rightBracket the right curly bracket
7892 */ 8272 */
7893 MapLiteral({Token constKeyword, TypeArgumentList typeArguments, Token leftBrac ket, List<MapLiteralEntry> entries, Token rightBracket}) : this.full(constKeywor d, typeArguments, leftBracket, entries, rightBracket); 8273 MapLiteral({Token constKeyword, TypeArgumentList typeArguments, Token leftBrac ket, List<MapLiteralEntry> entries, Token rightBracket}) : this.full(constKeywor d, typeArguments, leftBracket, entries, rightBracket);
8274
7894 accept(ASTVisitor visitor) => visitor.visitMapLiteral(this); 8275 accept(ASTVisitor visitor) => visitor.visitMapLiteral(this);
8276
7895 Token get beginToken { 8277 Token get beginToken {
7896 Token token = constKeyword; 8278 Token token = constKeyword;
7897 if (token != null) { 8279 if (token != null) {
7898 return token; 8280 return token;
7899 } 8281 }
7900 TypeArgumentList typeArguments = this.typeArguments; 8282 TypeArgumentList typeArguments = this.typeArguments;
7901 if (typeArguments != null) { 8283 if (typeArguments != null) {
7902 return typeArguments.beginToken; 8284 return typeArguments.beginToken;
7903 } 8285 }
7904 return _leftBracket; 8286 return _leftBracket;
7905 } 8287 }
8288
7906 Token get endToken => _rightBracket; 8289 Token get endToken => _rightBracket;
7907 8290
7908 /** 8291 /**
7909 * Return the left curly bracket. 8292 * Return the left curly bracket.
7910 * 8293 *
7911 * @return the left curly bracket 8294 * @return the left curly bracket
7912 */ 8295 */
7913 Token get leftBracket => _leftBracket; 8296 Token get leftBracket => _leftBracket;
7914 8297
7915 /** 8298 /**
(...skipping 13 matching lines...) Expand all
7929 } 8312 }
7930 8313
7931 /** 8314 /**
7932 * Set the right curly bracket to the given token. 8315 * Set the right curly bracket to the given token.
7933 * 8316 *
7934 * @param bracket the right curly bracket 8317 * @param bracket the right curly bracket
7935 */ 8318 */
7936 void set rightBracket(Token bracket) { 8319 void set rightBracket(Token bracket) {
7937 _rightBracket = bracket; 8320 _rightBracket = bracket;
7938 } 8321 }
8322
7939 void visitChildren(ASTVisitor visitor) { 8323 void visitChildren(ASTVisitor visitor) {
7940 super.visitChildren(visitor); 8324 super.visitChildren(visitor);
7941 entries.accept(visitor); 8325 entries.accept(visitor);
7942 } 8326 }
7943 } 8327 }
8328
7944 /** 8329 /**
7945 * Instances of the class `MapLiteralEntry` represent a single key/value pair in a map 8330 * Instances of the class `MapLiteralEntry` represent a single key/value pair in a map
7946 * literal. 8331 * literal.
7947 * 8332 *
7948 * <pre> 8333 * <pre>
7949 * mapLiteralEntry ::= 8334 * mapLiteralEntry ::=
7950 * [Expression] ':' [Expression] 8335 * [Expression] ':' [Expression]
7951 * </pre> 8336 * </pre>
7952 * 8337 *
7953 * @coverage dart.engine.ast 8338 * @coverage dart.engine.ast
7954 */ 8339 */
7955 class MapLiteralEntry extends ASTNode { 8340 class MapLiteralEntry extends ASTNode {
7956
7957 /** 8341 /**
7958 * The expression computing the key with which the value will be associated. 8342 * The expression computing the key with which the value will be associated.
7959 */ 8343 */
7960 Expression _key; 8344 Expression _key;
7961 8345
7962 /** 8346 /**
7963 * The colon that separates the key from the value. 8347 * The colon that separates the key from the value.
7964 */ 8348 */
7965 Token separator; 8349 Token separator;
7966 8350
(...skipping 16 matching lines...) Expand all
7983 } 8367 }
7984 8368
7985 /** 8369 /**
7986 * Initialize a newly created map literal entry. 8370 * Initialize a newly created map literal entry.
7987 * 8371 *
7988 * @param key the expression computing the key with which the value will be as sociated 8372 * @param key the expression computing the key with which the value will be as sociated
7989 * @param separator the colon that separates the key from the value 8373 * @param separator the colon that separates the key from the value
7990 * @param value the expression computing the value that will be associated wit h the key 8374 * @param value the expression computing the value that will be associated wit h the key
7991 */ 8375 */
7992 MapLiteralEntry({Expression key, Token separator, Expression value}) : this.fu ll(key, separator, value); 8376 MapLiteralEntry({Expression key, Token separator, Expression value}) : this.fu ll(key, separator, value);
8377
7993 accept(ASTVisitor visitor) => visitor.visitMapLiteralEntry(this); 8378 accept(ASTVisitor visitor) => visitor.visitMapLiteralEntry(this);
8379
7994 Token get beginToken => _key.beginToken; 8380 Token get beginToken => _key.beginToken;
8381
7995 Token get endToken => _value.endToken; 8382 Token get endToken => _value.endToken;
7996 8383
7997 /** 8384 /**
7998 * Return the expression computing the key with which the value will be associ ated. 8385 * Return the expression computing the key with which the value will be associ ated.
7999 * 8386 *
8000 * @return the expression computing the key with which the value will be assoc iated 8387 * @return the expression computing the key with which the value will be assoc iated
8001 */ 8388 */
8002 Expression get key => _key; 8389 Expression get key => _key;
8003 8390
8004 /** 8391 /**
(...skipping 15 matching lines...) Expand all
8020 8407
8021 /** 8408 /**
8022 * Set the expression computing the value that will be associated with the key to the given 8409 * Set the expression computing the value that will be associated with the key to the given
8023 * expression. 8410 * expression.
8024 * 8411 *
8025 * @param expression the expression computing the value that will be associate d with the key 8412 * @param expression the expression computing the value that will be associate d with the key
8026 */ 8413 */
8027 void set value(Expression expression) { 8414 void set value(Expression expression) {
8028 _value = becomeParentOf(expression); 8415 _value = becomeParentOf(expression);
8029 } 8416 }
8417
8030 void visitChildren(ASTVisitor visitor) { 8418 void visitChildren(ASTVisitor visitor) {
8031 safelyVisitChild(_key, visitor); 8419 safelyVisitChild(_key, visitor);
8032 safelyVisitChild(_value, visitor); 8420 safelyVisitChild(_value, visitor);
8033 } 8421 }
8034 } 8422 }
8423
8035 /** 8424 /**
8036 * Instances of the class `MethodDeclaration` represent a method declaration. 8425 * Instances of the class `MethodDeclaration` represent a method declaration.
8037 * 8426 *
8038 * <pre> 8427 * <pre>
8039 * methodDeclaration ::= 8428 * methodDeclaration ::=
8040 * methodSignature [FunctionBody] 8429 * methodSignature [FunctionBody]
8041 * 8430 *
8042 * methodSignature ::= 8431 * methodSignature ::=
8043 * 'external'? ('abstract' | 'static')? [Type]? ('get' | 'set')? methodName 8432 * 'external'? ('abstract' | 'static')? [Type]? ('get' | 'set')? methodName
8044 * [FormalParameterList] 8433 * [FormalParameterList]
8045 * 8434 *
8046 * methodName ::= 8435 * methodName ::=
8047 * [SimpleIdentifier] 8436 * [SimpleIdentifier]
8048 * | 'operator' [SimpleIdentifier] 8437 * | 'operator' [SimpleIdentifier]
8049 * </pre> 8438 * </pre>
8050 * 8439 *
8051 * @coverage dart.engine.ast 8440 * @coverage dart.engine.ast
8052 */ 8441 */
8053 class MethodDeclaration extends ClassMember { 8442 class MethodDeclaration extends ClassMember {
8054
8055 /** 8443 /**
8056 * The token for the 'external' keyword, or `null` if the constructor is not e xternal. 8444 * The token for the 'external' keyword, or `null` if the constructor is not e xternal.
8057 */ 8445 */
8058 Token externalKeyword; 8446 Token externalKeyword;
8059 8447
8060 /** 8448 /**
8061 * The token representing the 'abstract' or 'static' keyword, or `null` if nei ther modifier 8449 * The token representing the 'abstract' or 'static' keyword, or `null` if nei ther modifier
8062 * was specified. 8450 * was specified.
8063 */ 8451 */
8064 Token modifierKeyword; 8452 Token modifierKeyword;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
8130 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword 8518 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword
8131 * @param returnType the return type of the method 8519 * @param returnType the return type of the method
8132 * @param propertyKeyword the token representing the 'get' or 'set' keyword 8520 * @param propertyKeyword the token representing the 'get' or 'set' keyword
8133 * @param operatorKeyword the token representing the 'operator' keyword 8521 * @param operatorKeyword the token representing the 'operator' keyword
8134 * @param name the name of the method 8522 * @param name the name of the method
8135 * @param parameters the parameters associated with the method, or `null` if t his method 8523 * @param parameters the parameters associated with the method, or `null` if t his method
8136 * declares a getter 8524 * declares a getter
8137 * @param body the body of the method 8525 * @param body the body of the method
8138 */ 8526 */
8139 MethodDeclaration({Comment comment, List<Annotation> metadata, Token externalK eyword, Token modifierKeyword, TypeName returnType, Token propertyKeyword, Token operatorKeyword, SimpleIdentifier name, FormalParameterList parameters, Functio nBody body}) : this.full(comment, metadata, externalKeyword, modifierKeyword, re turnType, propertyKeyword, operatorKeyword, name, parameters, body); 8527 MethodDeclaration({Comment comment, List<Annotation> metadata, Token externalK eyword, Token modifierKeyword, TypeName returnType, Token propertyKeyword, Token operatorKeyword, SimpleIdentifier name, FormalParameterList parameters, Functio nBody body}) : this.full(comment, metadata, externalKeyword, modifierKeyword, re turnType, propertyKeyword, operatorKeyword, name, parameters, body);
8528
8140 accept(ASTVisitor visitor) => visitor.visitMethodDeclaration(this); 8529 accept(ASTVisitor visitor) => visitor.visitMethodDeclaration(this);
8141 8530
8142 /** 8531 /**
8143 * Return the body of the method. 8532 * Return the body of the method.
8144 * 8533 *
8145 * @return the body of the method 8534 * @return the body of the method
8146 */ 8535 */
8147 FunctionBody get body => _body; 8536 FunctionBody get body => _body;
8148 8537
8149 /** 8538 /**
8150 * Return the element associated with this method, or `null` if the AST struct ure has not 8539 * Return the element associated with this method, or `null` if the AST struct ure has not
8151 * been resolved. The element can either be a [MethodElement], if this represe nts the 8540 * been resolved. The element can either be a [MethodElement], if this represe nts the
8152 * declaration of a normal method, or a [PropertyAccessorElement] if this repr esents the 8541 * declaration of a normal method, or a [PropertyAccessorElement] if this repr esents the
8153 * declaration of either a getter or a setter. 8542 * declaration of either a getter or a setter.
8154 * 8543 *
8155 * @return the element associated with this method 8544 * @return the element associated with this method
8156 */ 8545 */
8157 ExecutableElement get element => _name != null ? (_name.staticElement as Execu tableElement) : null; 8546 ExecutableElement get element => _name != null ? (_name.staticElement as Execu tableElement) : null;
8547
8158 Token get endToken => _body.endToken; 8548 Token get endToken => _body.endToken;
8159 8549
8160 /** 8550 /**
8161 * Return the name of the method. 8551 * Return the name of the method.
8162 * 8552 *
8163 * @return the name of the method 8553 * @return the name of the method
8164 */ 8554 */
8165 SimpleIdentifier get name => _name; 8555 SimpleIdentifier get name => _name;
8166 8556
8167 /** 8557 /**
(...skipping 16 matching lines...) Expand all
8184 * 8574 *
8185 * @return `true` if this method is declared to be an abstract method 8575 * @return `true` if this method is declared to be an abstract method
8186 */ 8576 */
8187 bool get isAbstract => externalKeyword == null && (_body is EmptyFunctionBody) ; 8577 bool get isAbstract => externalKeyword == null && (_body is EmptyFunctionBody) ;
8188 8578
8189 /** 8579 /**
8190 * Return `true` if this method declares a getter. 8580 * Return `true` if this method declares a getter.
8191 * 8581 *
8192 * @return `true` if this method declares a getter 8582 * @return `true` if this method declares a getter
8193 */ 8583 */
8194 bool get isGetter => propertyKeyword != null && identical(((propertyKeyword as KeywordToken)).keyword, Keyword.GET); 8584 bool get isGetter => propertyKeyword != null && identical((propertyKeyword as KeywordToken).keyword, Keyword.GET);
8195 8585
8196 /** 8586 /**
8197 * Return `true` if this method declares an operator. 8587 * Return `true` if this method declares an operator.
8198 * 8588 *
8199 * @return `true` if this method declares an operator 8589 * @return `true` if this method declares an operator
8200 */ 8590 */
8201 bool get isOperator => operatorKeyword != null; 8591 bool get isOperator => operatorKeyword != null;
8202 8592
8203 /** 8593 /**
8204 * Return `true` if this method declares a setter. 8594 * Return `true` if this method declares a setter.
8205 * 8595 *
8206 * @return `true` if this method declares a setter 8596 * @return `true` if this method declares a setter
8207 */ 8597 */
8208 bool get isSetter => propertyKeyword != null && identical(((propertyKeyword as KeywordToken)).keyword, Keyword.SET); 8598 bool get isSetter => propertyKeyword != null && identical((propertyKeyword as KeywordToken).keyword, Keyword.SET);
8209 8599
8210 /** 8600 /**
8211 * Return `true` if this method is declared to be a static method. 8601 * Return `true` if this method is declared to be a static method.
8212 * 8602 *
8213 * @return `true` if this method is declared to be a static method 8603 * @return `true` if this method is declared to be a static method
8214 */ 8604 */
8215 bool get isStatic => modifierKeyword != null && identical(((modifierKeyword as KeywordToken)).keyword, Keyword.STATIC); 8605 bool get isStatic => modifierKeyword != null && identical((modifierKeyword as KeywordToken).keyword, Keyword.STATIC);
8216 8606
8217 /** 8607 /**
8218 * Set the body of the method to the given function body. 8608 * Set the body of the method to the given function body.
8219 * 8609 *
8220 * @param functionBody the body of the method 8610 * @param functionBody the body of the method
8221 */ 8611 */
8222 void set body(FunctionBody functionBody) { 8612 void set body(FunctionBody functionBody) {
8223 _body = becomeParentOf(functionBody); 8613 _body = becomeParentOf(functionBody);
8224 } 8614 }
8225 8615
(...skipping 16 matching lines...) Expand all
8242 } 8632 }
8243 8633
8244 /** 8634 /**
8245 * Set the return type of the method to the given type name. 8635 * Set the return type of the method to the given type name.
8246 * 8636 *
8247 * @param typeName the return type of the method 8637 * @param typeName the return type of the method
8248 */ 8638 */
8249 void set returnType(TypeName typeName) { 8639 void set returnType(TypeName typeName) {
8250 _returnType = becomeParentOf(typeName); 8640 _returnType = becomeParentOf(typeName);
8251 } 8641 }
8642
8252 void visitChildren(ASTVisitor visitor) { 8643 void visitChildren(ASTVisitor visitor) {
8253 super.visitChildren(visitor); 8644 super.visitChildren(visitor);
8254 safelyVisitChild(_returnType, visitor); 8645 safelyVisitChild(_returnType, visitor);
8255 safelyVisitChild(_name, visitor); 8646 safelyVisitChild(_name, visitor);
8256 safelyVisitChild(_parameters, visitor); 8647 safelyVisitChild(_parameters, visitor);
8257 safelyVisitChild(_body, visitor); 8648 safelyVisitChild(_body, visitor);
8258 } 8649 }
8650
8259 Token get firstTokenAfterCommentAndMetadata { 8651 Token get firstTokenAfterCommentAndMetadata {
8260 if (modifierKeyword != null) { 8652 if (modifierKeyword != null) {
8261 return modifierKeyword; 8653 return modifierKeyword;
8262 } else if (_returnType != null) { 8654 } else if (_returnType != null) {
8263 return _returnType.beginToken; 8655 return _returnType.beginToken;
8264 } else if (propertyKeyword != null) { 8656 } else if (propertyKeyword != null) {
8265 return propertyKeyword; 8657 return propertyKeyword;
8266 } else if (operatorKeyword != null) { 8658 } else if (operatorKeyword != null) {
8267 return operatorKeyword; 8659 return operatorKeyword;
8268 } 8660 }
8269 return _name.beginToken; 8661 return _name.beginToken;
8270 } 8662 }
8271 } 8663 }
8664
8272 /** 8665 /**
8273 * Instances of the class `MethodInvocation` represent the invocation of either a function or 8666 * Instances of the class `MethodInvocation` represent the invocation of either a function or
8274 * a method. Invocations of functions resulting from evaluating an expression ar e represented by 8667 * a method. Invocations of functions resulting from evaluating an expression ar e represented by
8275 * [FunctionExpressionInvocation] nodes. Invocations of getters 8668 * [FunctionExpressionInvocation] nodes. Invocations of getters
8276 * and setters are represented by either [PrefixedIdentifier] or 8669 * and setters are represented by either [PrefixedIdentifier] or
8277 * [PropertyAccess] nodes. 8670 * [PropertyAccess] nodes.
8278 * 8671 *
8279 * <pre> 8672 * <pre>
8280 * methodInvoction ::= 8673 * methodInvoction ::=
8281 * ([Expression] '.')? [SimpleIdentifier] [ArgumentList] 8674 * ([Expression] '.')? [SimpleIdentifier] [ArgumentList]
8282 * </pre> 8675 * </pre>
8283 * 8676 *
8284 * @coverage dart.engine.ast 8677 * @coverage dart.engine.ast
8285 */ 8678 */
8286 class MethodInvocation extends Expression { 8679 class MethodInvocation extends Expression {
8287
8288 /** 8680 /**
8289 * The expression producing the object on which the method is defined, or `nul l` if there is 8681 * The expression producing the object on which the method is defined, or `nul l` if there is
8290 * no target (that is, the target is implicitly `this`). 8682 * no target (that is, the target is implicitly `this`).
8291 */ 8683 */
8292 Expression _target; 8684 Expression _target;
8293 8685
8294 /** 8686 /**
8295 * The period that separates the target from the method name, or `null` if the re is no 8687 * The period that separates the target from the method name, or `null` if the re is no
8296 * target. 8688 * target.
8297 */ 8689 */
(...skipping 26 matching lines...) Expand all
8324 8716
8325 /** 8717 /**
8326 * Initialize a newly created method invocation. 8718 * Initialize a newly created method invocation.
8327 * 8719 *
8328 * @param target the expression producing the object on which the method is de fined 8720 * @param target the expression producing the object on which the method is de fined
8329 * @param period the period that separates the target from the method name 8721 * @param period the period that separates the target from the method name
8330 * @param methodName the name of the method being invoked 8722 * @param methodName the name of the method being invoked
8331 * @param argumentList the list of arguments to the method 8723 * @param argumentList the list of arguments to the method
8332 */ 8724 */
8333 MethodInvocation({Expression target, Token period, SimpleIdentifier methodName , ArgumentList argumentList}) : this.full(target, period, methodName, argumentLi st); 8725 MethodInvocation({Expression target, Token period, SimpleIdentifier methodName , ArgumentList argumentList}) : this.full(target, period, methodName, argumentLi st);
8726
8334 accept(ASTVisitor visitor) => visitor.visitMethodInvocation(this); 8727 accept(ASTVisitor visitor) => visitor.visitMethodInvocation(this);
8335 8728
8336 /** 8729 /**
8337 * Return the list of arguments to the method. 8730 * Return the list of arguments to the method.
8338 * 8731 *
8339 * @return the list of arguments to the method 8732 * @return the list of arguments to the method
8340 */ 8733 */
8341 ArgumentList get argumentList => _argumentList; 8734 ArgumentList get argumentList => _argumentList;
8735
8342 Token get beginToken { 8736 Token get beginToken {
8343 if (_target != null) { 8737 if (_target != null) {
8344 return _target.beginToken; 8738 return _target.beginToken;
8345 } else if (period != null) { 8739 } else if (period != null) {
8346 return period; 8740 return period;
8347 } 8741 }
8348 return _methodName.beginToken; 8742 return _methodName.beginToken;
8349 } 8743 }
8744
8350 Token get endToken => _argumentList.endToken; 8745 Token get endToken => _argumentList.endToken;
8351 8746
8352 /** 8747 /**
8353 * Return the name of the method being invoked. 8748 * Return the name of the method being invoked.
8354 * 8749 *
8355 * @return the name of the method being invoked 8750 * @return the name of the method being invoked
8356 */ 8751 */
8357 SimpleIdentifier get methodName => _methodName; 8752 SimpleIdentifier get methodName => _methodName;
8358 8753
8359 /** 8754 /**
8360 * Return the expression used to compute the receiver of the invocation. If th is invocation is not 8755 * Return the expression used to compute the receiver of the invocation. If th is invocation is not
8361 * part of a cascade expression, then this is the same as [getTarget]. If this invocation 8756 * part of a cascade expression, then this is the same as [getTarget]. If this invocation
8362 * is part of a cascade expression, then the target stored with the cascade ex pression is 8757 * is part of a cascade expression, then the target stored with the cascade ex pression is
8363 * returned. 8758 * returned.
8364 * 8759 *
8365 * @return the expression used to compute the receiver of the invocation 8760 * @return the expression used to compute the receiver of the invocation
8366 * @see #getTarget() 8761 * @see #getTarget()
8367 */ 8762 */
8368 Expression get realTarget { 8763 Expression get realTarget {
8369 if (isCascaded) { 8764 if (isCascaded) {
8370 ASTNode ancestor = parent; 8765 ASTNode ancestor = parent;
8371 while (ancestor is! CascadeExpression) { 8766 while (ancestor is! CascadeExpression) {
8372 if (ancestor == null) { 8767 if (ancestor == null) {
8373 return _target; 8768 return _target;
8374 } 8769 }
8375 ancestor = ancestor.parent; 8770 ancestor = ancestor.parent;
8376 } 8771 }
8377 return ((ancestor as CascadeExpression)).target; 8772 return (ancestor as CascadeExpression).target;
8378 } 8773 }
8379 return _target; 8774 return _target;
8380 } 8775 }
8381 8776
8382 /** 8777 /**
8383 * Return the expression producing the object on which the method is defined, or `null` if 8778 * Return the expression producing the object on which the method is defined, or `null` if
8384 * there is no target (that is, the target is implicitly `this`) or if this me thod 8779 * there is no target (that is, the target is implicitly `this`) or if this me thod
8385 * invocation is part of a cascade expression. 8780 * invocation is part of a cascade expression.
8386 * 8781 *
8387 * @return the expression producing the object on which the method is defined 8782 * @return the expression producing the object on which the method is defined
(...skipping 29 matching lines...) Expand all
8417 } 8812 }
8418 8813
8419 /** 8814 /**
8420 * Set the expression producing the object on which the method is defined to t he given expression. 8815 * Set the expression producing the object on which the method is defined to t he given expression.
8421 * 8816 *
8422 * @param expression the expression producing the object on which the method i s defined 8817 * @param expression the expression producing the object on which the method i s defined
8423 */ 8818 */
8424 void set target(Expression expression) { 8819 void set target(Expression expression) {
8425 _target = becomeParentOf(expression); 8820 _target = becomeParentOf(expression);
8426 } 8821 }
8822
8427 void visitChildren(ASTVisitor visitor) { 8823 void visitChildren(ASTVisitor visitor) {
8428 safelyVisitChild(_target, visitor); 8824 safelyVisitChild(_target, visitor);
8429 safelyVisitChild(_methodName, visitor); 8825 safelyVisitChild(_methodName, visitor);
8430 safelyVisitChild(_argumentList, visitor); 8826 safelyVisitChild(_argumentList, visitor);
8431 } 8827 }
8432 } 8828 }
8829
8433 /** 8830 /**
8434 * Instances of the class `NamedExpression` represent an expression that has a n ame associated 8831 * Instances of the class `NamedExpression` represent an expression that has a n ame associated
8435 * with it. They are used in method invocations when there are named parameters. 8832 * with it. They are used in method invocations when there are named parameters.
8436 * 8833 *
8437 * <pre> 8834 * <pre>
8438 * namedExpression ::= 8835 * namedExpression ::=
8439 * [Label] [Expression] 8836 * [Label] [Expression]
8440 * </pre> 8837 * </pre>
8441 * 8838 *
8442 * @coverage dart.engine.ast 8839 * @coverage dart.engine.ast
8443 */ 8840 */
8444 class NamedExpression extends Expression { 8841 class NamedExpression extends Expression {
8445
8446 /** 8842 /**
8447 * The name associated with the expression. 8843 * The name associated with the expression.
8448 */ 8844 */
8449 Label _name; 8845 Label _name;
8450 8846
8451 /** 8847 /**
8452 * The expression with which the name is associated. 8848 * The expression with which the name is associated.
8453 */ 8849 */
8454 Expression _expression; 8850 Expression _expression;
8455 8851
8456 /** 8852 /**
8457 * Initialize a newly created named expression. 8853 * Initialize a newly created named expression.
8458 * 8854 *
8459 * @param name the name associated with the expression 8855 * @param name the name associated with the expression
8460 * @param expression the expression with which the name is associated 8856 * @param expression the expression with which the name is associated
8461 */ 8857 */
8462 NamedExpression.full(Label name, Expression expression) { 8858 NamedExpression.full(Label name, Expression expression) {
8463 this._name = becomeParentOf(name); 8859 this._name = becomeParentOf(name);
8464 this._expression = becomeParentOf(expression); 8860 this._expression = becomeParentOf(expression);
8465 } 8861 }
8466 8862
8467 /** 8863 /**
8468 * Initialize a newly created named expression. 8864 * Initialize a newly created named expression.
8469 * 8865 *
8470 * @param name the name associated with the expression 8866 * @param name the name associated with the expression
8471 * @param expression the expression with which the name is associated 8867 * @param expression the expression with which the name is associated
8472 */ 8868 */
8473 NamedExpression({Label name, Expression expression}) : this.full(name, express ion); 8869 NamedExpression({Label name, Expression expression}) : this.full(name, express ion);
8870
8474 accept(ASTVisitor visitor) => visitor.visitNamedExpression(this); 8871 accept(ASTVisitor visitor) => visitor.visitNamedExpression(this);
8872
8475 Token get beginToken => _name.beginToken; 8873 Token get beginToken => _name.beginToken;
8476 8874
8477 /** 8875 /**
8478 * Return the element representing the parameter being named by this expressio n, or `null` 8876 * Return the element representing the parameter being named by this expressio n, or `null`
8479 * if the AST structure has not been resolved or if there is no parameter with the same name as 8877 * if the AST structure has not been resolved or if there is no parameter with the same name as
8480 * this expression. 8878 * this expression.
8481 * 8879 *
8482 * @return the element representing the parameter being named by this expressi on 8880 * @return the element representing the parameter being named by this expressi on
8483 */ 8881 */
8484 ParameterElement get element { 8882 ParameterElement get element {
8485 Element element = _name.label.staticElement; 8883 Element element = _name.label.staticElement;
8486 if (element is ParameterElement) { 8884 if (element is ParameterElement) {
8487 return element as ParameterElement; 8885 return element as ParameterElement;
8488 } 8886 }
8489 return null; 8887 return null;
8490 } 8888 }
8889
8491 Token get endToken => _expression.endToken; 8890 Token get endToken => _expression.endToken;
8492 8891
8493 /** 8892 /**
8494 * Return the expression with which the name is associated. 8893 * Return the expression with which the name is associated.
8495 * 8894 *
8496 * @return the expression with which the name is associated 8895 * @return the expression with which the name is associated
8497 */ 8896 */
8498 Expression get expression => _expression; 8897 Expression get expression => _expression;
8499 8898
8500 /** 8899 /**
(...skipping 13 matching lines...) Expand all
8514 } 8913 }
8515 8914
8516 /** 8915 /**
8517 * Set the name associated with the expression to the given identifier. 8916 * Set the name associated with the expression to the given identifier.
8518 * 8917 *
8519 * @param identifier the name associated with the expression 8918 * @param identifier the name associated with the expression
8520 */ 8919 */
8521 void set name(Label identifier) { 8920 void set name(Label identifier) {
8522 _name = becomeParentOf(identifier); 8921 _name = becomeParentOf(identifier);
8523 } 8922 }
8923
8524 void visitChildren(ASTVisitor visitor) { 8924 void visitChildren(ASTVisitor visitor) {
8525 safelyVisitChild(_name, visitor); 8925 safelyVisitChild(_name, visitor);
8526 safelyVisitChild(_expression, visitor); 8926 safelyVisitChild(_expression, visitor);
8527 } 8927 }
8528 } 8928 }
8929
8529 /** 8930 /**
8530 * The abstract class `NamespaceDirective` defines the behavior common to nodes that represent 8931 * The abstract class `NamespaceDirective` defines the behavior common to nodes that represent
8531 * a directive that impacts the namespace of a library. 8932 * a directive that impacts the namespace of a library.
8532 * 8933 *
8533 * <pre> 8934 * <pre>
8534 * directive ::= 8935 * directive ::=
8535 * [ExportDirective] 8936 * [ExportDirective]
8536 * | [ImportDirective] 8937 * | [ImportDirective]
8537 * </pre> 8938 * </pre>
8538 * 8939 *
8539 * @coverage dart.engine.ast 8940 * @coverage dart.engine.ast
8540 */ 8941 */
8541 abstract class NamespaceDirective extends UriBasedDirective { 8942 abstract class NamespaceDirective extends UriBasedDirective {
8542
8543 /** 8943 /**
8544 * The token representing the 'import' or 'export' keyword. 8944 * The token representing the 'import' or 'export' keyword.
8545 */ 8945 */
8546 Token _keyword; 8946 Token _keyword;
8547 8947
8548 /** 8948 /**
8549 * The combinators used to control which names are imported or exported. 8949 * The combinators used to control which names are imported or exported.
8550 */ 8950 */
8551 NodeList<Combinator> combinators; 8951 NodeList<Combinator> combinators;
8552 8952
(...skipping 23 matching lines...) Expand all
8576 * Initialize a newly created namespace directive. 8976 * Initialize a newly created namespace directive.
8577 * 8977 *
8578 * @param comment the documentation comment associated with this directive 8978 * @param comment the documentation comment associated with this directive
8579 * @param metadata the annotations associated with the directive 8979 * @param metadata the annotations associated with the directive
8580 * @param keyword the token representing the 'import' or 'export' keyword 8980 * @param keyword the token representing the 'import' or 'export' keyword
8581 * @param libraryUri the URI of the library being imported or exported 8981 * @param libraryUri the URI of the library being imported or exported
8582 * @param combinators the combinators used to control which names are imported or exported 8982 * @param combinators the combinators used to control which names are imported or exported
8583 * @param semicolon the semicolon terminating the directive 8983 * @param semicolon the semicolon terminating the directive
8584 */ 8984 */
8585 NamespaceDirective({Comment comment, List<Annotation> metadata, Token keyword, StringLiteral libraryUri, List<Combinator> combinators, Token semicolon}) : thi s.full(comment, metadata, keyword, libraryUri, combinators, semicolon); 8985 NamespaceDirective({Comment comment, List<Annotation> metadata, Token keyword, StringLiteral libraryUri, List<Combinator> combinators, Token semicolon}) : thi s.full(comment, metadata, keyword, libraryUri, combinators, semicolon);
8986
8586 Token get endToken => semicolon; 8987 Token get endToken => semicolon;
8988
8587 Token get keyword => _keyword; 8989 Token get keyword => _keyword;
8990
8588 LibraryElement get uriElement; 8991 LibraryElement get uriElement;
8589 8992
8590 /** 8993 /**
8591 * Set the token representing the 'import' or 'export' keyword to the given to ken. 8994 * Set the token representing the 'import' or 'export' keyword to the given to ken.
8592 * 8995 *
8593 * @param exportToken the token representing the 'import' or 'export' keyword 8996 * @param exportToken the token representing the 'import' or 'export' keyword
8594 */ 8997 */
8595 void set keyword(Token exportToken) { 8998 void set keyword(Token exportToken) {
8596 this._keyword = exportToken; 8999 this._keyword = exportToken;
8597 } 9000 }
9001
8598 Token get firstTokenAfterCommentAndMetadata => _keyword; 9002 Token get firstTokenAfterCommentAndMetadata => _keyword;
8599 } 9003 }
9004
8600 /** 9005 /**
8601 * Instances of the class `NativeClause` represent the "native" clause in an cla ss 9006 * Instances of the class `NativeClause` represent the "native" clause in an cla ss
8602 * declaration. 9007 * declaration.
8603 * 9008 *
8604 * <pre> 9009 * <pre>
8605 * nativeClause ::= 9010 * nativeClause ::=
8606 * 'native' [StringLiteral] 9011 * 'native' [StringLiteral]
8607 * </pre> 9012 * </pre>
8608 * 9013 *
8609 * @coverage dart.engine.ast 9014 * @coverage dart.engine.ast
8610 */ 9015 */
8611 class NativeClause extends ASTNode { 9016 class NativeClause extends ASTNode {
8612
8613 /** 9017 /**
8614 * The token representing the 'native' keyword. 9018 * The token representing the 'native' keyword.
8615 */ 9019 */
8616 Token keyword; 9020 Token keyword;
8617 9021
8618 /** 9022 /**
8619 * The name of the native object that implements the class. 9023 * The name of the native object that implements the class.
8620 */ 9024 */
8621 StringLiteral name; 9025 StringLiteral name;
8622 9026
8623 /** 9027 /**
8624 * Initialize a newly created native clause. 9028 * Initialize a newly created native clause.
8625 * 9029 *
8626 * @param keyword the token representing the 'native' keyword 9030 * @param keyword the token representing the 'native' keyword
8627 * @param name the name of the native object that implements the class. 9031 * @param name the name of the native object that implements the class.
8628 */ 9032 */
8629 NativeClause.full(Token keyword, StringLiteral name) { 9033 NativeClause.full(Token keyword, StringLiteral name) {
8630 this.keyword = keyword; 9034 this.keyword = keyword;
8631 this.name = name; 9035 this.name = name;
8632 } 9036 }
8633 9037
8634 /** 9038 /**
8635 * Initialize a newly created native clause. 9039 * Initialize a newly created native clause.
8636 * 9040 *
8637 * @param keyword the token representing the 'native' keyword 9041 * @param keyword the token representing the 'native' keyword
8638 * @param name the name of the native object that implements the class. 9042 * @param name the name of the native object that implements the class.
8639 */ 9043 */
8640 NativeClause({Token keyword, StringLiteral name}) : this.full(keyword, name); 9044 NativeClause({Token keyword, StringLiteral name}) : this.full(keyword, name);
9045
8641 accept(ASTVisitor visitor) => visitor.visitNativeClause(this); 9046 accept(ASTVisitor visitor) => visitor.visitNativeClause(this);
9047
8642 Token get beginToken => keyword; 9048 Token get beginToken => keyword;
9049
8643 Token get endToken => name.endToken; 9050 Token get endToken => name.endToken;
9051
8644 void visitChildren(ASTVisitor visitor) { 9052 void visitChildren(ASTVisitor visitor) {
8645 safelyVisitChild(name, visitor); 9053 safelyVisitChild(name, visitor);
8646 } 9054 }
8647 } 9055 }
9056
8648 /** 9057 /**
8649 * Instances of the class `NativeFunctionBody` represent a function body that co nsists of a 9058 * Instances of the class `NativeFunctionBody` represent a function body that co nsists of a
8650 * native keyword followed by a string literal. 9059 * native keyword followed by a string literal.
8651 * 9060 *
8652 * <pre> 9061 * <pre>
8653 * nativeFunctionBody ::= 9062 * nativeFunctionBody ::=
8654 * 'native' [SimpleStringLiteral] ';' 9063 * 'native' [SimpleStringLiteral] ';'
8655 * </pre> 9064 * </pre>
8656 * 9065 *
8657 * @coverage dart.engine.ast 9066 * @coverage dart.engine.ast
8658 */ 9067 */
8659 class NativeFunctionBody extends FunctionBody { 9068 class NativeFunctionBody extends FunctionBody {
8660
8661 /** 9069 /**
8662 * The token representing 'native' that marks the start of the function body. 9070 * The token representing 'native' that marks the start of the function body.
8663 */ 9071 */
8664 Token nativeToken; 9072 Token nativeToken;
8665 9073
8666 /** 9074 /**
8667 * The string literal, after the 'native' token. 9075 * The string literal, after the 'native' token.
8668 */ 9076 */
8669 StringLiteral stringLiteral; 9077 StringLiteral stringLiteral;
8670 9078
(...skipping 18 matching lines...) Expand all
8689 9097
8690 /** 9098 /**
8691 * Initialize a newly created function body consisting of the 'native' token, a string literal, 9099 * Initialize a newly created function body consisting of the 'native' token, a string literal,
8692 * and a semicolon. 9100 * and a semicolon.
8693 * 9101 *
8694 * @param nativeToken the token representing 'native' that marks the start of the function body 9102 * @param nativeToken the token representing 'native' that marks the start of the function body
8695 * @param stringLiteral the string literal 9103 * @param stringLiteral the string literal
8696 * @param semicolon the token representing the semicolon that marks the end of the function body 9104 * @param semicolon the token representing the semicolon that marks the end of the function body
8697 */ 9105 */
8698 NativeFunctionBody({Token nativeToken, StringLiteral stringLiteral, Token semi colon}) : this.full(nativeToken, stringLiteral, semicolon); 9106 NativeFunctionBody({Token nativeToken, StringLiteral stringLiteral, Token semi colon}) : this.full(nativeToken, stringLiteral, semicolon);
9107
8699 accept(ASTVisitor visitor) => visitor.visitNativeFunctionBody(this); 9108 accept(ASTVisitor visitor) => visitor.visitNativeFunctionBody(this);
9109
8700 Token get beginToken => nativeToken; 9110 Token get beginToken => nativeToken;
9111
8701 Token get endToken => semicolon; 9112 Token get endToken => semicolon;
9113
8702 void visitChildren(ASTVisitor visitor) { 9114 void visitChildren(ASTVisitor visitor) {
8703 safelyVisitChild(stringLiteral, visitor); 9115 safelyVisitChild(stringLiteral, visitor);
8704 } 9116 }
8705 } 9117 }
9118
8706 /** 9119 /**
8707 * The abstract class `NormalFormalParameter` defines the behavior common to for mal parameters 9120 * The abstract class `NormalFormalParameter` defines the behavior common to for mal parameters
8708 * that are required (are not optional). 9121 * that are required (are not optional).
8709 * 9122 *
8710 * <pre> 9123 * <pre>
8711 * normalFormalParameter ::= 9124 * normalFormalParameter ::=
8712 * [FunctionTypedFormalParameter] 9125 * [FunctionTypedFormalParameter]
8713 * | [FieldFormalParameter] 9126 * | [FieldFormalParameter]
8714 * | [SimpleFormalParameter] 9127 * | [SimpleFormalParameter]
8715 * </pre> 9128 * </pre>
8716 * 9129 *
8717 * @coverage dart.engine.ast 9130 * @coverage dart.engine.ast
8718 */ 9131 */
8719 abstract class NormalFormalParameter extends FormalParameter { 9132 abstract class NormalFormalParameter extends FormalParameter {
8720
8721 /** 9133 /**
8722 * The documentation comment associated with this parameter, or `null` if this parameter 9134 * The documentation comment associated with this parameter, or `null` if this parameter
8723 * does not have a documentation comment associated with it. 9135 * does not have a documentation comment associated with it.
8724 */ 9136 */
8725 Comment _comment; 9137 Comment _comment;
8726 9138
8727 /** 9139 /**
8728 * The annotations associated with this parameter. 9140 * The annotations associated with this parameter.
8729 */ 9141 */
8730 NodeList<Annotation> metadata; 9142 NodeList<Annotation> metadata;
(...skipping 26 matching lines...) Expand all
8757 */ 9169 */
8758 NormalFormalParameter({Comment comment, List<Annotation> metadata, SimpleIdent ifier identifier}) : this.full(comment, metadata, identifier); 9170 NormalFormalParameter({Comment comment, List<Annotation> metadata, SimpleIdent ifier identifier}) : this.full(comment, metadata, identifier);
8759 9171
8760 /** 9172 /**
8761 * Return the documentation comment associated with this parameter, or `null` if this 9173 * Return the documentation comment associated with this parameter, or `null` if this
8762 * parameter does not have a documentation comment associated with it. 9174 * parameter does not have a documentation comment associated with it.
8763 * 9175 *
8764 * @return the documentation comment associated with this parameter 9176 * @return the documentation comment associated with this parameter
8765 */ 9177 */
8766 Comment get documentationComment => _comment; 9178 Comment get documentationComment => _comment;
9179
8767 SimpleIdentifier get identifier => _identifier; 9180 SimpleIdentifier get identifier => _identifier;
9181
8768 ParameterKind get kind { 9182 ParameterKind get kind {
8769 ASTNode parent = this.parent; 9183 ASTNode parent = this.parent;
8770 if (parent is DefaultFormalParameter) { 9184 if (parent is DefaultFormalParameter) {
8771 return ((parent as DefaultFormalParameter)).kind; 9185 return (parent as DefaultFormalParameter).kind;
8772 } 9186 }
8773 return ParameterKind.REQUIRED; 9187 return ParameterKind.REQUIRED;
8774 } 9188 }
8775 9189
8776 /** 9190 /**
8777 * Set the documentation comment associated with this parameter to the given c omment 9191 * Set the documentation comment associated with this parameter to the given c omment
8778 * 9192 *
8779 * @param comment the documentation comment to be associated with this paramet er 9193 * @param comment the documentation comment to be associated with this paramet er
8780 */ 9194 */
8781 void set documentationComment(Comment comment) { 9195 void set documentationComment(Comment comment) {
8782 this._comment = becomeParentOf(comment); 9196 this._comment = becomeParentOf(comment);
8783 } 9197 }
8784 9198
8785 /** 9199 /**
8786 * Set the name of the parameter being declared to the given identifier. 9200 * Set the name of the parameter being declared to the given identifier.
8787 * 9201 *
8788 * @param identifier the name of the parameter being declared 9202 * @param identifier the name of the parameter being declared
8789 */ 9203 */
8790 void set identifier(SimpleIdentifier identifier) { 9204 void set identifier(SimpleIdentifier identifier) {
8791 this._identifier = becomeParentOf(identifier); 9205 this._identifier = becomeParentOf(identifier);
8792 } 9206 }
9207
8793 void visitChildren(ASTVisitor visitor) { 9208 void visitChildren(ASTVisitor visitor) {
8794 if (commentIsBeforeAnnotations()) { 9209 if (commentIsBeforeAnnotations()) {
8795 safelyVisitChild(_comment, visitor); 9210 safelyVisitChild(_comment, visitor);
8796 metadata.accept(visitor); 9211 metadata.accept(visitor);
8797 } else { 9212 } else {
8798 for (ASTNode child in sortedCommentAndAnnotations) { 9213 for (ASTNode child in sortedCommentAndAnnotations) {
8799 child.accept(visitor); 9214 child.accept(visitor);
8800 } 9215 }
8801 } 9216 }
8802 } 9217 }
(...skipping 20 matching lines...) Expand all
8823 */ 9238 */
8824 List<ASTNode> get sortedCommentAndAnnotations { 9239 List<ASTNode> get sortedCommentAndAnnotations {
8825 List<ASTNode> childList = new List<ASTNode>(); 9240 List<ASTNode> childList = new List<ASTNode>();
8826 childList.add(_comment); 9241 childList.add(_comment);
8827 childList.addAll(metadata); 9242 childList.addAll(metadata);
8828 List<ASTNode> children = new List.from(childList); 9243 List<ASTNode> children = new List.from(childList);
8829 children.sort(ASTNode.LEXICAL_ORDER); 9244 children.sort(ASTNode.LEXICAL_ORDER);
8830 return children; 9245 return children;
8831 } 9246 }
8832 } 9247 }
9248
8833 /** 9249 /**
8834 * Instances of the class `NullLiteral` represent a null literal expression. 9250 * Instances of the class `NullLiteral` represent a null literal expression.
8835 * 9251 *
8836 * <pre> 9252 * <pre>
8837 * nullLiteral ::= 9253 * nullLiteral ::=
8838 * 'null' 9254 * 'null'
8839 * </pre> 9255 * </pre>
8840 * 9256 *
8841 * @coverage dart.engine.ast 9257 * @coverage dart.engine.ast
8842 */ 9258 */
8843 class NullLiteral extends Literal { 9259 class NullLiteral extends Literal {
8844
8845 /** 9260 /**
8846 * The token representing the literal. 9261 * The token representing the literal.
8847 */ 9262 */
8848 Token literal; 9263 Token literal;
8849 9264
8850 /** 9265 /**
8851 * Initialize a newly created null literal. 9266 * Initialize a newly created null literal.
8852 * 9267 *
8853 * @param token the token representing the literal 9268 * @param token the token representing the literal
8854 */ 9269 */
8855 NullLiteral.full(Token token) { 9270 NullLiteral.full(Token token) {
8856 this.literal = token; 9271 this.literal = token;
8857 } 9272 }
8858 9273
8859 /** 9274 /**
8860 * Initialize a newly created null literal. 9275 * Initialize a newly created null literal.
8861 * 9276 *
8862 * @param token the token representing the literal 9277 * @param token the token representing the literal
8863 */ 9278 */
8864 NullLiteral({Token token}) : this.full(token); 9279 NullLiteral({Token token}) : this.full(token);
9280
8865 accept(ASTVisitor visitor) => visitor.visitNullLiteral(this); 9281 accept(ASTVisitor visitor) => visitor.visitNullLiteral(this);
9282
8866 Token get beginToken => literal; 9283 Token get beginToken => literal;
9284
8867 Token get endToken => literal; 9285 Token get endToken => literal;
9286
8868 void visitChildren(ASTVisitor visitor) { 9287 void visitChildren(ASTVisitor visitor) {
8869 } 9288 }
8870 } 9289 }
9290
8871 /** 9291 /**
8872 * Instances of the class `ParenthesizedExpression` represent a parenthesized ex pression. 9292 * Instances of the class `ParenthesizedExpression` represent a parenthesized ex pression.
8873 * 9293 *
8874 * <pre> 9294 * <pre>
8875 * parenthesizedExpression ::= 9295 * parenthesizedExpression ::=
8876 * '(' [Expression] ')' 9296 * '(' [Expression] ')'
8877 * </pre> 9297 * </pre>
8878 * 9298 *
8879 * @coverage dart.engine.ast 9299 * @coverage dart.engine.ast
8880 */ 9300 */
8881 class ParenthesizedExpression extends Expression { 9301 class ParenthesizedExpression extends Expression {
8882
8883 /** 9302 /**
8884 * The left parenthesis. 9303 * The left parenthesis.
8885 */ 9304 */
8886 Token _leftParenthesis; 9305 Token _leftParenthesis;
8887 9306
8888 /** 9307 /**
8889 * The expression within the parentheses. 9308 * The expression within the parentheses.
8890 */ 9309 */
8891 Expression _expression; 9310 Expression _expression;
8892 9311
(...skipping 16 matching lines...) Expand all
8909 } 9328 }
8910 9329
8911 /** 9330 /**
8912 * Initialize a newly created parenthesized expression. 9331 * Initialize a newly created parenthesized expression.
8913 * 9332 *
8914 * @param leftParenthesis the left parenthesis 9333 * @param leftParenthesis the left parenthesis
8915 * @param expression the expression within the parentheses 9334 * @param expression the expression within the parentheses
8916 * @param rightParenthesis the right parenthesis 9335 * @param rightParenthesis the right parenthesis
8917 */ 9336 */
8918 ParenthesizedExpression({Token leftParenthesis, Expression expression, Token r ightParenthesis}) : this.full(leftParenthesis, expression, rightParenthesis); 9337 ParenthesizedExpression({Token leftParenthesis, Expression expression, Token r ightParenthesis}) : this.full(leftParenthesis, expression, rightParenthesis);
9338
8919 accept(ASTVisitor visitor) => visitor.visitParenthesizedExpression(this); 9339 accept(ASTVisitor visitor) => visitor.visitParenthesizedExpression(this);
9340
8920 Token get beginToken => _leftParenthesis; 9341 Token get beginToken => _leftParenthesis;
9342
8921 Token get endToken => _rightParenthesis; 9343 Token get endToken => _rightParenthesis;
8922 9344
8923 /** 9345 /**
8924 * Return the expression within the parentheses. 9346 * Return the expression within the parentheses.
8925 * 9347 *
8926 * @return the expression within the parentheses 9348 * @return the expression within the parentheses
8927 */ 9349 */
8928 Expression get expression => _expression; 9350 Expression get expression => _expression;
8929 9351
8930 /** 9352 /**
(...skipping 29 matching lines...) Expand all
8960 } 9382 }
8961 9383
8962 /** 9384 /**
8963 * Set the right parenthesis to the given token. 9385 * Set the right parenthesis to the given token.
8964 * 9386 *
8965 * @param parenthesis the right parenthesis 9387 * @param parenthesis the right parenthesis
8966 */ 9388 */
8967 void set rightParenthesis(Token parenthesis) { 9389 void set rightParenthesis(Token parenthesis) {
8968 _rightParenthesis = parenthesis; 9390 _rightParenthesis = parenthesis;
8969 } 9391 }
9392
8970 void visitChildren(ASTVisitor visitor) { 9393 void visitChildren(ASTVisitor visitor) {
8971 safelyVisitChild(_expression, visitor); 9394 safelyVisitChild(_expression, visitor);
8972 } 9395 }
8973 } 9396 }
9397
8974 /** 9398 /**
8975 * Instances of the class `PartDirective` represent a part directive. 9399 * Instances of the class `PartDirective` represent a part directive.
8976 * 9400 *
8977 * <pre> 9401 * <pre>
8978 * partDirective ::= 9402 * partDirective ::=
8979 * [Annotation] 'part' [StringLiteral] ';' 9403 * [Annotation] 'part' [StringLiteral] ';'
8980 * </pre> 9404 * </pre>
8981 * 9405 *
8982 * @coverage dart.engine.ast 9406 * @coverage dart.engine.ast
8983 */ 9407 */
8984 class PartDirective extends UriBasedDirective { 9408 class PartDirective extends UriBasedDirective {
8985
8986 /** 9409 /**
8987 * The token representing the 'part' token. 9410 * The token representing the 'part' token.
8988 */ 9411 */
8989 Token partToken; 9412 Token partToken;
8990 9413
8991 /** 9414 /**
8992 * The semicolon terminating the directive. 9415 * The semicolon terminating the directive.
8993 */ 9416 */
8994 Token semicolon; 9417 Token semicolon;
8995 9418
(...skipping 14 matching lines...) Expand all
9010 /** 9433 /**
9011 * Initialize a newly created part directive. 9434 * Initialize a newly created part directive.
9012 * 9435 *
9013 * @param comment the documentation comment associated with this directive 9436 * @param comment the documentation comment associated with this directive
9014 * @param metadata the annotations associated with the directive 9437 * @param metadata the annotations associated with the directive
9015 * @param partToken the token representing the 'part' token 9438 * @param partToken the token representing the 'part' token
9016 * @param partUri the URI of the part being included 9439 * @param partUri the URI of the part being included
9017 * @param semicolon the semicolon terminating the directive 9440 * @param semicolon the semicolon terminating the directive
9018 */ 9441 */
9019 PartDirective({Comment comment, List<Annotation> metadata, Token partToken, St ringLiteral partUri, Token semicolon}) : this.full(comment, metadata, partToken, partUri, semicolon); 9442 PartDirective({Comment comment, List<Annotation> metadata, Token partToken, St ringLiteral partUri, Token semicolon}) : this.full(comment, metadata, partToken, partUri, semicolon);
9443
9020 accept(ASTVisitor visitor) => visitor.visitPartDirective(this); 9444 accept(ASTVisitor visitor) => visitor.visitPartDirective(this);
9445
9021 Token get endToken => semicolon; 9446 Token get endToken => semicolon;
9447
9022 Token get keyword => partToken; 9448 Token get keyword => partToken;
9449
9023 CompilationUnitElement get uriElement => element as CompilationUnitElement; 9450 CompilationUnitElement get uriElement => element as CompilationUnitElement;
9451
9024 Token get firstTokenAfterCommentAndMetadata => partToken; 9452 Token get firstTokenAfterCommentAndMetadata => partToken;
9025 } 9453 }
9454
9026 /** 9455 /**
9027 * Instances of the class `PartOfDirective` represent a part-of directive. 9456 * Instances of the class `PartOfDirective` represent a part-of directive.
9028 * 9457 *
9029 * <pre> 9458 * <pre>
9030 * partOfDirective ::= 9459 * partOfDirective ::=
9031 * [Annotation] 'part' 'of' [Identifier] ';' 9460 * [Annotation] 'part' 'of' [Identifier] ';'
9032 * </pre> 9461 * </pre>
9033 * 9462 *
9034 * @coverage dart.engine.ast 9463 * @coverage dart.engine.ast
9035 */ 9464 */
9036 class PartOfDirective extends Directive { 9465 class PartOfDirective extends Directive {
9037
9038 /** 9466 /**
9039 * The token representing the 'part' token. 9467 * The token representing the 'part' token.
9040 */ 9468 */
9041 Token partToken; 9469 Token partToken;
9042 9470
9043 /** 9471 /**
9044 * The token representing the 'of' token. 9472 * The token representing the 'of' token.
9045 */ 9473 */
9046 Token ofToken; 9474 Token ofToken;
9047 9475
(...skipping 28 matching lines...) Expand all
9076 * Initialize a newly created part-of directive. 9504 * Initialize a newly created part-of directive.
9077 * 9505 *
9078 * @param comment the documentation comment associated with this directive 9506 * @param comment the documentation comment associated with this directive
9079 * @param metadata the annotations associated with the directive 9507 * @param metadata the annotations associated with the directive
9080 * @param partToken the token representing the 'part' token 9508 * @param partToken the token representing the 'part' token
9081 * @param ofToken the token representing the 'of' token 9509 * @param ofToken the token representing the 'of' token
9082 * @param libraryName the name of the library that the containing compilation unit is part of 9510 * @param libraryName the name of the library that the containing compilation unit is part of
9083 * @param semicolon the semicolon terminating the directive 9511 * @param semicolon the semicolon terminating the directive
9084 */ 9512 */
9085 PartOfDirective({Comment comment, List<Annotation> metadata, Token partToken, Token ofToken, LibraryIdentifier libraryName, Token semicolon}) : this.full(comm ent, metadata, partToken, ofToken, libraryName, semicolon); 9513 PartOfDirective({Comment comment, List<Annotation> metadata, Token partToken, Token ofToken, LibraryIdentifier libraryName, Token semicolon}) : this.full(comm ent, metadata, partToken, ofToken, libraryName, semicolon);
9514
9086 accept(ASTVisitor visitor) => visitor.visitPartOfDirective(this); 9515 accept(ASTVisitor visitor) => visitor.visitPartOfDirective(this);
9516
9087 Token get endToken => semicolon; 9517 Token get endToken => semicolon;
9518
9088 Token get keyword => partToken; 9519 Token get keyword => partToken;
9089 9520
9090 /** 9521 /**
9091 * Return the name of the library that the containing compilation unit is part of. 9522 * Return the name of the library that the containing compilation unit is part of.
9092 * 9523 *
9093 * @return the name of the library that the containing compilation unit is par t of 9524 * @return the name of the library that the containing compilation unit is par t of
9094 */ 9525 */
9095 LibraryIdentifier get libraryName => _libraryName; 9526 LibraryIdentifier get libraryName => _libraryName;
9096 9527
9097 /** 9528 /**
9098 * Set the name of the library that the containing compilation unit is part of to the given name. 9529 * Set the name of the library that the containing compilation unit is part of to the given name.
9099 * 9530 *
9100 * @param libraryName the name of the library that the containing compilation unit is part of 9531 * @param libraryName the name of the library that the containing compilation unit is part of
9101 */ 9532 */
9102 void set libraryName(LibraryIdentifier libraryName) { 9533 void set libraryName(LibraryIdentifier libraryName) {
9103 this._libraryName = becomeParentOf(libraryName); 9534 this._libraryName = becomeParentOf(libraryName);
9104 } 9535 }
9536
9105 void visitChildren(ASTVisitor visitor) { 9537 void visitChildren(ASTVisitor visitor) {
9106 super.visitChildren(visitor); 9538 super.visitChildren(visitor);
9107 safelyVisitChild(_libraryName, visitor); 9539 safelyVisitChild(_libraryName, visitor);
9108 } 9540 }
9541
9109 Token get firstTokenAfterCommentAndMetadata => partToken; 9542 Token get firstTokenAfterCommentAndMetadata => partToken;
9110 } 9543 }
9544
9111 /** 9545 /**
9112 * Instances of the class `PostfixExpression` represent a postfix unary expressi on. 9546 * Instances of the class `PostfixExpression` represent a postfix unary expressi on.
9113 * 9547 *
9114 * <pre> 9548 * <pre>
9115 * postfixExpression ::= 9549 * postfixExpression ::=
9116 * [Expression] [Token] 9550 * [Expression] [Token]
9117 * </pre> 9551 * </pre>
9118 * 9552 *
9119 * @coverage dart.engine.ast 9553 * @coverage dart.engine.ast
9120 */ 9554 */
9121 class PostfixExpression extends Expression { 9555 class PostfixExpression extends Expression {
9122
9123 /** 9556 /**
9124 * The expression computing the operand for the operator. 9557 * The expression computing the operand for the operator.
9125 */ 9558 */
9126 Expression _operand; 9559 Expression _operand;
9127 9560
9128 /** 9561 /**
9129 * The postfix operator being applied to the operand. 9562 * The postfix operator being applied to the operand.
9130 */ 9563 */
9131 Token operator; 9564 Token operator;
9132 9565
(...skipping 22 matching lines...) Expand all
9155 this.operator = operator; 9588 this.operator = operator;
9156 } 9589 }
9157 9590
9158 /** 9591 /**
9159 * Initialize a newly created postfix expression. 9592 * Initialize a newly created postfix expression.
9160 * 9593 *
9161 * @param operand the expression computing the operand for the operator 9594 * @param operand the expression computing the operand for the operator
9162 * @param operator the postfix operator being applied to the operand 9595 * @param operator the postfix operator being applied to the operand
9163 */ 9596 */
9164 PostfixExpression({Expression operand, Token operator}) : this.full(operand, o perator); 9597 PostfixExpression({Expression operand, Token operator}) : this.full(operand, o perator);
9598
9165 accept(ASTVisitor visitor) => visitor.visitPostfixExpression(this); 9599 accept(ASTVisitor visitor) => visitor.visitPostfixExpression(this);
9600
9166 Token get beginToken => _operand.beginToken; 9601 Token get beginToken => _operand.beginToken;
9167 9602
9168 /** 9603 /**
9169 * Return the best element available for this operator. If resolution was able to find a better 9604 * Return the best element available for this operator. If resolution was able to find a better
9170 * element based on type propagation, that element will be returned. Otherwise , the element found 9605 * element based on type propagation, that element will be returned. Otherwise , the element found
9171 * using the result of static analysis will be returned. If resolution has not been performed, 9606 * using the result of static analysis will be returned. If resolution has not been performed,
9172 * then `null` will be returned. 9607 * then `null` will be returned.
9173 * 9608 *
9174 * @return the best element available for this operator 9609 * @return the best element available for this operator
9175 */ 9610 */
9176 MethodElement get bestElement { 9611 MethodElement get bestElement {
9177 MethodElement element = propagatedElement; 9612 MethodElement element = propagatedElement;
9178 if (element == null) { 9613 if (element == null) {
9179 element = staticElement; 9614 element = staticElement;
9180 } 9615 }
9181 return element; 9616 return element;
9182 } 9617 }
9618
9183 Token get endToken => operator; 9619 Token get endToken => operator;
9184 9620
9185 /** 9621 /**
9186 * Return the expression computing the operand for the operator. 9622 * Return the expression computing the operand for the operator.
9187 * 9623 *
9188 * @return the expression computing the operand for the operator 9624 * @return the expression computing the operand for the operator
9189 */ 9625 */
9190 Expression get operand => _operand; 9626 Expression get operand => _operand;
9191 9627
9192 /** 9628 /**
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
9230 9666
9231 /** 9667 /**
9232 * Set the element associated with the operator based on the static type of th e operand to the 9668 * Set the element associated with the operator based on the static type of th e operand to the
9233 * given element. 9669 * given element.
9234 * 9670 *
9235 * @param element the element to be associated with the operator 9671 * @param element the element to be associated with the operator
9236 */ 9672 */
9237 void set staticElement(MethodElement element) { 9673 void set staticElement(MethodElement element) {
9238 _staticElement = element; 9674 _staticElement = element;
9239 } 9675 }
9676
9240 void visitChildren(ASTVisitor visitor) { 9677 void visitChildren(ASTVisitor visitor) {
9241 safelyVisitChild(_operand, visitor); 9678 safelyVisitChild(_operand, visitor);
9242 } 9679 }
9243 9680
9244 /** 9681 /**
9245 * If the AST structure has been resolved, and the function being invoked is k nown based on 9682 * If the AST structure has been resolved, and the function being invoked is k nown based on
9246 * propagated type information, then return the parameter element representing the parameter to 9683 * propagated type information, then return the parameter element representing the parameter to
9247 * which the value of the operand will be bound. Otherwise, return `null`. 9684 * which the value of the operand will be bound. Otherwise, return `null`.
9248 * 9685 *
9249 * This method is only intended to be used by [Expression#getPropagatedParamet erElement]. 9686 * This method is only intended to be used by [Expression#getPropagatedParamet erElement].
(...skipping 26 matching lines...) Expand all
9276 if (_staticElement == null) { 9713 if (_staticElement == null) {
9277 return null; 9714 return null;
9278 } 9715 }
9279 List<ParameterElement> parameters = _staticElement.parameters; 9716 List<ParameterElement> parameters = _staticElement.parameters;
9280 if (parameters.length < 1) { 9717 if (parameters.length < 1) {
9281 return null; 9718 return null;
9282 } 9719 }
9283 return parameters[0]; 9720 return parameters[0];
9284 } 9721 }
9285 } 9722 }
9723
9286 /** 9724 /**
9287 * Instances of the class `PrefixExpression` represent a prefix unary expression . 9725 * Instances of the class `PrefixExpression` represent a prefix unary expression .
9288 * 9726 *
9289 * <pre> 9727 * <pre>
9290 * prefixExpression ::= 9728 * prefixExpression ::=
9291 * [Token] [Expression] 9729 * [Token] [Expression]
9292 * </pre> 9730 * </pre>
9293 * 9731 *
9294 * @coverage dart.engine.ast 9732 * @coverage dart.engine.ast
9295 */ 9733 */
9296 class PrefixExpression extends Expression { 9734 class PrefixExpression extends Expression {
9297
9298 /** 9735 /**
9299 * The prefix operator being applied to the operand. 9736 * The prefix operator being applied to the operand.
9300 */ 9737 */
9301 Token operator; 9738 Token operator;
9302 9739
9303 /** 9740 /**
9304 * The expression computing the operand for the operator. 9741 * The expression computing the operand for the operator.
9305 */ 9742 */
9306 Expression _operand; 9743 Expression _operand;
9307 9744
(...skipping 22 matching lines...) Expand all
9330 this._operand = becomeParentOf(operand); 9767 this._operand = becomeParentOf(operand);
9331 } 9768 }
9332 9769
9333 /** 9770 /**
9334 * Initialize a newly created prefix expression. 9771 * Initialize a newly created prefix expression.
9335 * 9772 *
9336 * @param operator the prefix operator being applied to the operand 9773 * @param operator the prefix operator being applied to the operand
9337 * @param operand the expression computing the operand for the operator 9774 * @param operand the expression computing the operand for the operator
9338 */ 9775 */
9339 PrefixExpression({Token operator, Expression operand}) : this.full(operator, o perand); 9776 PrefixExpression({Token operator, Expression operand}) : this.full(operator, o perand);
9777
9340 accept(ASTVisitor visitor) => visitor.visitPrefixExpression(this); 9778 accept(ASTVisitor visitor) => visitor.visitPrefixExpression(this);
9779
9341 Token get beginToken => operator; 9780 Token get beginToken => operator;
9342 9781
9343 /** 9782 /**
9344 * Return the best element available for this operator. If resolution was able to find a better 9783 * Return the best element available for this operator. If resolution was able to find a better
9345 * element based on type propagation, that element will be returned. Otherwise , the element found 9784 * element based on type propagation, that element will be returned. Otherwise , the element found
9346 * using the result of static analysis will be returned. If resolution has not been performed, 9785 * using the result of static analysis will be returned. If resolution has not been performed,
9347 * then `null` will be returned. 9786 * then `null` will be returned.
9348 * 9787 *
9349 * @return the best element available for this operator 9788 * @return the best element available for this operator
9350 */ 9789 */
9351 MethodElement get bestElement { 9790 MethodElement get bestElement {
9352 MethodElement element = propagatedElement; 9791 MethodElement element = propagatedElement;
9353 if (element == null) { 9792 if (element == null) {
9354 element = staticElement; 9793 element = staticElement;
9355 } 9794 }
9356 return element; 9795 return element;
9357 } 9796 }
9797
9358 Token get endToken => _operand.endToken; 9798 Token get endToken => _operand.endToken;
9359 9799
9360 /** 9800 /**
9361 * Return the expression computing the operand for the operator. 9801 * Return the expression computing the operand for the operator.
9362 * 9802 *
9363 * @return the expression computing the operand for the operator 9803 * @return the expression computing the operand for the operator
9364 */ 9804 */
9365 Expression get operand => _operand; 9805 Expression get operand => _operand;
9366 9806
9367 /** 9807 /**
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
9405 9845
9406 /** 9846 /**
9407 * Set the element associated with the operator based on the static type of th e operand to the 9847 * Set the element associated with the operator based on the static type of th e operand to the
9408 * given element. 9848 * given element.
9409 * 9849 *
9410 * @param element the static element to be associated with the operator 9850 * @param element the static element to be associated with the operator
9411 */ 9851 */
9412 void set staticElement(MethodElement element) { 9852 void set staticElement(MethodElement element) {
9413 _staticElement = element; 9853 _staticElement = element;
9414 } 9854 }
9855
9415 void visitChildren(ASTVisitor visitor) { 9856 void visitChildren(ASTVisitor visitor) {
9416 safelyVisitChild(_operand, visitor); 9857 safelyVisitChild(_operand, visitor);
9417 } 9858 }
9418 9859
9419 /** 9860 /**
9420 * If the AST structure has been resolved, and the function being invoked is k nown based on 9861 * If the AST structure has been resolved, and the function being invoked is k nown based on
9421 * propagated type information, then return the parameter element representing the parameter to 9862 * propagated type information, then return the parameter element representing the parameter to
9422 * which the value of the operand will be bound. Otherwise, return `null`. 9863 * which the value of the operand will be bound. Otherwise, return `null`.
9423 * 9864 *
9424 * This method is only intended to be used by [Expression#getPropagatedParamet erElement]. 9865 * This method is only intended to be used by [Expression#getPropagatedParamet erElement].
(...skipping 26 matching lines...) Expand all
9451 if (_staticElement == null) { 9892 if (_staticElement == null) {
9452 return null; 9893 return null;
9453 } 9894 }
9454 List<ParameterElement> parameters = _staticElement.parameters; 9895 List<ParameterElement> parameters = _staticElement.parameters;
9455 if (parameters.length < 1) { 9896 if (parameters.length < 1) {
9456 return null; 9897 return null;
9457 } 9898 }
9458 return parameters[0]; 9899 return parameters[0];
9459 } 9900 }
9460 } 9901 }
9902
9461 /** 9903 /**
9462 * Instances of the class `PrefixedIdentifier` represent either an identifier th at is prefixed 9904 * Instances of the class `PrefixedIdentifier` represent either an identifier th at is prefixed
9463 * or an access to an object property where the target of the property access is a simple 9905 * or an access to an object property where the target of the property access is a simple
9464 * identifier. 9906 * identifier.
9465 * 9907 *
9466 * <pre> 9908 * <pre>
9467 * prefixedIdentifier ::= 9909 * prefixedIdentifier ::=
9468 * [SimpleIdentifier] '.' [SimpleIdentifier] 9910 * [SimpleIdentifier] '.' [SimpleIdentifier]
9469 * </pre> 9911 * </pre>
9470 * 9912 *
9471 * @coverage dart.engine.ast 9913 * @coverage dart.engine.ast
9472 */ 9914 */
9473 class PrefixedIdentifier extends Identifier { 9915 class PrefixedIdentifier extends Identifier {
9474
9475 /** 9916 /**
9476 * The prefix associated with the library in which the identifier is defined. 9917 * The prefix associated with the library in which the identifier is defined.
9477 */ 9918 */
9478 SimpleIdentifier _prefix; 9919 SimpleIdentifier _prefix;
9479 9920
9480 /** 9921 /**
9481 * The period used to separate the prefix from the identifier. 9922 * The period used to separate the prefix from the identifier.
9482 */ 9923 */
9483 Token period; 9924 Token period;
9484 9925
(...skipping 16 matching lines...) Expand all
9501 } 9942 }
9502 9943
9503 /** 9944 /**
9504 * Initialize a newly created prefixed identifier. 9945 * Initialize a newly created prefixed identifier.
9505 * 9946 *
9506 * @param prefix the identifier being prefixed 9947 * @param prefix the identifier being prefixed
9507 * @param period the period used to separate the prefix from the identifier 9948 * @param period the period used to separate the prefix from the identifier
9508 * @param identifier the prefix associated with the library in which the ident ifier is defined 9949 * @param identifier the prefix associated with the library in which the ident ifier is defined
9509 */ 9950 */
9510 PrefixedIdentifier({SimpleIdentifier prefix, Token period, SimpleIdentifier id entifier}) : this.full(prefix, period, identifier); 9951 PrefixedIdentifier({SimpleIdentifier prefix, Token period, SimpleIdentifier id entifier}) : this.full(prefix, period, identifier);
9952
9511 accept(ASTVisitor visitor) => visitor.visitPrefixedIdentifier(this); 9953 accept(ASTVisitor visitor) => visitor.visitPrefixedIdentifier(this);
9954
9512 Token get beginToken => _prefix.beginToken; 9955 Token get beginToken => _prefix.beginToken;
9956
9513 Element get bestElement { 9957 Element get bestElement {
9514 if (_identifier == null) { 9958 if (_identifier == null) {
9515 return null; 9959 return null;
9516 } 9960 }
9517 return _identifier.bestElement; 9961 return _identifier.bestElement;
9518 } 9962 }
9963
9519 Token get endToken => _identifier.endToken; 9964 Token get endToken => _identifier.endToken;
9520 9965
9521 /** 9966 /**
9522 * Return the identifier being prefixed. 9967 * Return the identifier being prefixed.
9523 * 9968 *
9524 * @return the identifier being prefixed 9969 * @return the identifier being prefixed
9525 */ 9970 */
9526 SimpleIdentifier get identifier => _identifier; 9971 SimpleIdentifier get identifier => _identifier;
9972
9527 String get name => "${_prefix.name}.${_identifier.name}"; 9973 String get name => "${_prefix.name}.${_identifier.name}";
9528 9974
9529 /** 9975 /**
9530 * Return the prefix associated with the library in which the identifier is de fined. 9976 * Return the prefix associated with the library in which the identifier is de fined.
9531 * 9977 *
9532 * @return the prefix associated with the library in which the identifier is d efined 9978 * @return the prefix associated with the library in which the identifier is d efined
9533 */ 9979 */
9534 SimpleIdentifier get prefix => _prefix; 9980 SimpleIdentifier get prefix => _prefix;
9981
9535 Element get propagatedElement { 9982 Element get propagatedElement {
9536 if (_identifier == null) { 9983 if (_identifier == null) {
9537 return null; 9984 return null;
9538 } 9985 }
9539 return _identifier.propagatedElement; 9986 return _identifier.propagatedElement;
9540 } 9987 }
9988
9541 Element get staticElement { 9989 Element get staticElement {
9542 if (_identifier == null) { 9990 if (_identifier == null) {
9543 return null; 9991 return null;
9544 } 9992 }
9545 return _identifier.staticElement; 9993 return _identifier.staticElement;
9546 } 9994 }
9547 9995
9548 /** 9996 /**
9549 * Set the identifier being prefixed to the given identifier. 9997 * Set the identifier being prefixed to the given identifier.
9550 * 9998 *
9551 * @param identifier the identifier being prefixed 9999 * @param identifier the identifier being prefixed
9552 */ 10000 */
9553 void set identifier(SimpleIdentifier identifier) { 10001 void set identifier(SimpleIdentifier identifier) {
9554 this._identifier = becomeParentOf(identifier); 10002 this._identifier = becomeParentOf(identifier);
9555 } 10003 }
9556 10004
9557 /** 10005 /**
9558 * Set the prefix associated with the library in which the identifier is defin ed to the given 10006 * Set the prefix associated with the library in which the identifier is defin ed to the given
9559 * identifier. 10007 * identifier.
9560 * 10008 *
9561 * @param identifier the prefix associated with the library in which the ident ifier is defined 10009 * @param identifier the prefix associated with the library in which the ident ifier is defined
9562 */ 10010 */
9563 void set prefix(SimpleIdentifier identifier) { 10011 void set prefix(SimpleIdentifier identifier) {
9564 _prefix = becomeParentOf(identifier); 10012 _prefix = becomeParentOf(identifier);
9565 } 10013 }
10014
9566 void visitChildren(ASTVisitor visitor) { 10015 void visitChildren(ASTVisitor visitor) {
9567 safelyVisitChild(_prefix, visitor); 10016 safelyVisitChild(_prefix, visitor);
9568 safelyVisitChild(_identifier, visitor); 10017 safelyVisitChild(_identifier, visitor);
9569 } 10018 }
9570 } 10019 }
10020
9571 /** 10021 /**
9572 * Instances of the class `PropertyAccess` represent the access of a property of an object. 10022 * Instances of the class `PropertyAccess` represent the access of a property of an object.
9573 * 10023 *
9574 * Note, however, that accesses to properties of objects can also be represented as 10024 * Note, however, that accesses to properties of objects can also be represented as
9575 * [PrefixedIdentifier] nodes in cases where the target is also a simple 10025 * [PrefixedIdentifier] nodes in cases where the target is also a simple
9576 * identifier. 10026 * identifier.
9577 * 10027 *
9578 * <pre> 10028 * <pre>
9579 * propertyAccess ::= 10029 * propertyAccess ::=
9580 * [Expression] '.' [SimpleIdentifier] 10030 * [Expression] '.' [SimpleIdentifier]
9581 * </pre> 10031 * </pre>
9582 * 10032 *
9583 * @coverage dart.engine.ast 10033 * @coverage dart.engine.ast
9584 */ 10034 */
9585 class PropertyAccess extends Expression { 10035 class PropertyAccess extends Expression {
9586
9587 /** 10036 /**
9588 * The expression computing the object defining the property being accessed. 10037 * The expression computing the object defining the property being accessed.
9589 */ 10038 */
9590 Expression _target; 10039 Expression _target;
9591 10040
9592 /** 10041 /**
9593 * The property access operator. 10042 * The property access operator.
9594 */ 10043 */
9595 Token operator; 10044 Token operator;
9596 10045
(...skipping 16 matching lines...) Expand all
9613 } 10062 }
9614 10063
9615 /** 10064 /**
9616 * Initialize a newly created property access expression. 10065 * Initialize a newly created property access expression.
9617 * 10066 *
9618 * @param target the expression computing the object defining the property bei ng accessed 10067 * @param target the expression computing the object defining the property bei ng accessed
9619 * @param operator the property access operator 10068 * @param operator the property access operator
9620 * @param propertyName the name of the property being accessed 10069 * @param propertyName the name of the property being accessed
9621 */ 10070 */
9622 PropertyAccess({Expression target, Token operator, SimpleIdentifier propertyNa me}) : this.full(target, operator, propertyName); 10071 PropertyAccess({Expression target, Token operator, SimpleIdentifier propertyNa me}) : this.full(target, operator, propertyName);
10072
9623 accept(ASTVisitor visitor) => visitor.visitPropertyAccess(this); 10073 accept(ASTVisitor visitor) => visitor.visitPropertyAccess(this);
10074
9624 Token get beginToken { 10075 Token get beginToken {
9625 if (_target != null) { 10076 if (_target != null) {
9626 return _target.beginToken; 10077 return _target.beginToken;
9627 } 10078 }
9628 return operator; 10079 return operator;
9629 } 10080 }
10081
9630 Token get endToken => _propertyName.endToken; 10082 Token get endToken => _propertyName.endToken;
9631 10083
9632 /** 10084 /**
9633 * Return the name of the property being accessed. 10085 * Return the name of the property being accessed.
9634 * 10086 *
9635 * @return the name of the property being accessed 10087 * @return the name of the property being accessed
9636 */ 10088 */
9637 SimpleIdentifier get propertyName => _propertyName; 10089 SimpleIdentifier get propertyName => _propertyName;
9638 10090
9639 /** 10091 /**
9640 * Return the expression used to compute the receiver of the invocation. If th is invocation is not 10092 * Return the expression used to compute the receiver of the invocation. If th is invocation is not
9641 * part of a cascade expression, then this is the same as [getTarget]. If this invocation 10093 * part of a cascade expression, then this is the same as [getTarget]. If this invocation
9642 * is part of a cascade expression, then the target stored with the cascade ex pression is 10094 * is part of a cascade expression, then the target stored with the cascade ex pression is
9643 * returned. 10095 * returned.
9644 * 10096 *
9645 * @return the expression used to compute the receiver of the invocation 10097 * @return the expression used to compute the receiver of the invocation
9646 * @see #getTarget() 10098 * @see #getTarget()
9647 */ 10099 */
9648 Expression get realTarget { 10100 Expression get realTarget {
9649 if (isCascaded) { 10101 if (isCascaded) {
9650 ASTNode ancestor = parent; 10102 ASTNode ancestor = parent;
9651 while (ancestor is! CascadeExpression) { 10103 while (ancestor is! CascadeExpression) {
9652 if (ancestor == null) { 10104 if (ancestor == null) {
9653 return _target; 10105 return _target;
9654 } 10106 }
9655 ancestor = ancestor.parent; 10107 ancestor = ancestor.parent;
9656 } 10108 }
9657 return ((ancestor as CascadeExpression)).target; 10109 return (ancestor as CascadeExpression).target;
9658 } 10110 }
9659 return _target; 10111 return _target;
9660 } 10112 }
9661 10113
9662 /** 10114 /**
9663 * Return the expression computing the object defining the property being acce ssed, or 10115 * Return the expression computing the object defining the property being acce ssed, or
9664 * `null` if this property access is part of a cascade expression. 10116 * `null` if this property access is part of a cascade expression.
9665 * 10117 *
9666 * @return the expression computing the object defining the property being acc essed 10118 * @return the expression computing the object defining the property being acc essed
9667 * @see #getRealTarget() 10119 * @see #getRealTarget()
9668 */ 10120 */
9669 Expression get target => _target; 10121 Expression get target => _target;
10122
9670 bool get isAssignable => true; 10123 bool get isAssignable => true;
9671 10124
9672 /** 10125 /**
9673 * Return `true` if this expression is cascaded. If it is, then the target of this 10126 * Return `true` if this expression is cascaded. If it is, then the target of this
9674 * expression is not stored locally but is stored in the nearest ancestor that is a 10127 * expression is not stored locally but is stored in the nearest ancestor that is a
9675 * [CascadeExpression]. 10128 * [CascadeExpression].
9676 * 10129 *
9677 * @return `true` if this expression is cascaded 10130 * @return `true` if this expression is cascaded
9678 */ 10131 */
9679 bool get isCascaded => operator != null && identical(operator.type, TokenType. PERIOD_PERIOD); 10132 bool get isCascaded => operator != null && identical(operator.type, TokenType. PERIOD_PERIOD);
9680 10133
9681 /** 10134 /**
9682 * Set the name of the property being accessed to the given identifier. 10135 * Set the name of the property being accessed to the given identifier.
9683 * 10136 *
9684 * @param identifier the name of the property being accessed 10137 * @param identifier the name of the property being accessed
9685 */ 10138 */
9686 void set propertyName(SimpleIdentifier identifier) { 10139 void set propertyName(SimpleIdentifier identifier) {
9687 _propertyName = becomeParentOf(identifier); 10140 _propertyName = becomeParentOf(identifier);
9688 } 10141 }
9689 10142
9690 /** 10143 /**
9691 * Set the expression computing the object defining the property being accesse d to the given 10144 * Set the expression computing the object defining the property being accesse d to the given
9692 * expression. 10145 * expression.
9693 * 10146 *
9694 * @param expression the expression computing the object defining the property being accessed 10147 * @param expression the expression computing the object defining the property being accessed
9695 */ 10148 */
9696 void set target(Expression expression) { 10149 void set target(Expression expression) {
9697 _target = becomeParentOf(expression); 10150 _target = becomeParentOf(expression);
9698 } 10151 }
10152
9699 void visitChildren(ASTVisitor visitor) { 10153 void visitChildren(ASTVisitor visitor) {
9700 safelyVisitChild(_target, visitor); 10154 safelyVisitChild(_target, visitor);
9701 safelyVisitChild(_propertyName, visitor); 10155 safelyVisitChild(_propertyName, visitor);
9702 } 10156 }
9703 } 10157 }
10158
9704 /** 10159 /**
9705 * Instances of the class `RedirectingConstructorInvocation` represent the invoc ation of a 10160 * Instances of the class `RedirectingConstructorInvocation` represent the invoc ation of a
9706 * another constructor in the same class from within a constructor's initializat ion list. 10161 * another constructor in the same class from within a constructor's initializat ion list.
9707 * 10162 *
9708 * <pre> 10163 * <pre>
9709 * redirectingConstructorInvocation ::= 10164 * redirectingConstructorInvocation ::=
9710 * 'this' ('.' identifier)? arguments 10165 * 'this' ('.' identifier)? arguments
9711 * </pre> 10166 * </pre>
9712 * 10167 *
9713 * @coverage dart.engine.ast 10168 * @coverage dart.engine.ast
9714 */ 10169 */
9715 class RedirectingConstructorInvocation extends ConstructorInitializer { 10170 class RedirectingConstructorInvocation extends ConstructorInitializer {
9716
9717 /** 10171 /**
9718 * The token for the 'this' keyword. 10172 * The token for the 'this' keyword.
9719 */ 10173 */
9720 Token keyword; 10174 Token keyword;
9721 10175
9722 /** 10176 /**
9723 * The token for the period before the name of the constructor that is being i nvoked, or 10177 * The token for the period before the name of the constructor that is being i nvoked, or
9724 * `null` if the unnamed constructor is being invoked. 10178 * `null` if the unnamed constructor is being invoked.
9725 */ 10179 */
9726 Token period; 10180 Token period;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
9761 /** 10215 /**
9762 * Initialize a newly created redirecting invocation to invoke the constructor with the given name 10216 * Initialize a newly created redirecting invocation to invoke the constructor with the given name
9763 * with the given arguments. 10217 * with the given arguments.
9764 * 10218 *
9765 * @param keyword the token for the 'this' keyword 10219 * @param keyword the token for the 'this' keyword
9766 * @param period the token for the period before the name of the constructor t hat is being invoked 10220 * @param period the token for the period before the name of the constructor t hat is being invoked
9767 * @param constructorName the name of the constructor that is being invoked 10221 * @param constructorName the name of the constructor that is being invoked
9768 * @param argumentList the list of arguments to the constructor 10222 * @param argumentList the list of arguments to the constructor
9769 */ 10223 */
9770 RedirectingConstructorInvocation({Token keyword, Token period, SimpleIdentifie r constructorName, ArgumentList argumentList}) : this.full(keyword, period, cons tructorName, argumentList); 10224 RedirectingConstructorInvocation({Token keyword, Token period, SimpleIdentifie r constructorName, ArgumentList argumentList}) : this.full(keyword, period, cons tructorName, argumentList);
10225
9771 accept(ASTVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th is); 10226 accept(ASTVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th is);
9772 10227
9773 /** 10228 /**
9774 * Return the list of arguments to the constructor. 10229 * Return the list of arguments to the constructor.
9775 * 10230 *
9776 * @return the list of arguments to the constructor 10231 * @return the list of arguments to the constructor
9777 */ 10232 */
9778 ArgumentList get argumentList => _argumentList; 10233 ArgumentList get argumentList => _argumentList;
10234
9779 Token get beginToken => keyword; 10235 Token get beginToken => keyword;
9780 10236
9781 /** 10237 /**
9782 * Return the name of the constructor that is being invoked, or `null` if the unnamed 10238 * Return the name of the constructor that is being invoked, or `null` if the unnamed
9783 * constructor is being invoked. 10239 * constructor is being invoked.
9784 * 10240 *
9785 * @return the name of the constructor that is being invoked 10241 * @return the name of the constructor that is being invoked
9786 */ 10242 */
9787 SimpleIdentifier get constructorName => _constructorName; 10243 SimpleIdentifier get constructorName => _constructorName;
10244
9788 Token get endToken => _argumentList.endToken; 10245 Token get endToken => _argumentList.endToken;
9789 10246
9790 /** 10247 /**
9791 * Set the list of arguments to the constructor to the given list. 10248 * Set the list of arguments to the constructor to the given list.
9792 * 10249 *
9793 * @param argumentList the list of arguments to the constructor 10250 * @param argumentList the list of arguments to the constructor
9794 */ 10251 */
9795 void set argumentList(ArgumentList argumentList) { 10252 void set argumentList(ArgumentList argumentList) {
9796 this._argumentList = becomeParentOf(argumentList); 10253 this._argumentList = becomeParentOf(argumentList);
9797 } 10254 }
9798 10255
9799 /** 10256 /**
9800 * Set the name of the constructor that is being invoked to the given identifi er. 10257 * Set the name of the constructor that is being invoked to the given identifi er.
9801 * 10258 *
9802 * @param identifier the name of the constructor that is being invoked 10259 * @param identifier the name of the constructor that is being invoked
9803 */ 10260 */
9804 void set constructorName(SimpleIdentifier identifier) { 10261 void set constructorName(SimpleIdentifier identifier) {
9805 _constructorName = becomeParentOf(identifier); 10262 _constructorName = becomeParentOf(identifier);
9806 } 10263 }
10264
9807 void visitChildren(ASTVisitor visitor) { 10265 void visitChildren(ASTVisitor visitor) {
9808 safelyVisitChild(_constructorName, visitor); 10266 safelyVisitChild(_constructorName, visitor);
9809 safelyVisitChild(_argumentList, visitor); 10267 safelyVisitChild(_argumentList, visitor);
9810 } 10268 }
9811 } 10269 }
10270
9812 /** 10271 /**
9813 * Instances of the class `RethrowExpression` represent a rethrow expression. 10272 * Instances of the class `RethrowExpression` represent a rethrow expression.
9814 * 10273 *
9815 * <pre> 10274 * <pre>
9816 * rethrowExpression ::= 10275 * rethrowExpression ::=
9817 * 'rethrow' 10276 * 'rethrow'
9818 * </pre> 10277 * </pre>
9819 * 10278 *
9820 * @coverage dart.engine.ast 10279 * @coverage dart.engine.ast
9821 */ 10280 */
9822 class RethrowExpression extends Expression { 10281 class RethrowExpression extends Expression {
9823
9824 /** 10282 /**
9825 * The token representing the 'rethrow' keyword. 10283 * The token representing the 'rethrow' keyword.
9826 */ 10284 */
9827 Token keyword; 10285 Token keyword;
9828 10286
9829 /** 10287 /**
9830 * Initialize a newly created rethrow expression. 10288 * Initialize a newly created rethrow expression.
9831 * 10289 *
9832 * @param keyword the token representing the 'rethrow' keyword 10290 * @param keyword the token representing the 'rethrow' keyword
9833 */ 10291 */
9834 RethrowExpression.full(Token keyword) { 10292 RethrowExpression.full(Token keyword) {
9835 this.keyword = keyword; 10293 this.keyword = keyword;
9836 } 10294 }
9837 10295
9838 /** 10296 /**
9839 * Initialize a newly created rethrow expression. 10297 * Initialize a newly created rethrow expression.
9840 * 10298 *
9841 * @param keyword the token representing the 'rethrow' keyword 10299 * @param keyword the token representing the 'rethrow' keyword
9842 */ 10300 */
9843 RethrowExpression({Token keyword}) : this.full(keyword); 10301 RethrowExpression({Token keyword}) : this.full(keyword);
10302
9844 accept(ASTVisitor visitor) => visitor.visitRethrowExpression(this); 10303 accept(ASTVisitor visitor) => visitor.visitRethrowExpression(this);
10304
9845 Token get beginToken => keyword; 10305 Token get beginToken => keyword;
10306
9846 Token get endToken => keyword; 10307 Token get endToken => keyword;
10308
9847 void visitChildren(ASTVisitor visitor) { 10309 void visitChildren(ASTVisitor visitor) {
9848 } 10310 }
9849 } 10311 }
10312
9850 /** 10313 /**
9851 * Instances of the class `ReturnStatement` represent a return statement. 10314 * Instances of the class `ReturnStatement` represent a return statement.
9852 * 10315 *
9853 * <pre> 10316 * <pre>
9854 * returnStatement ::= 10317 * returnStatement ::=
9855 * 'return' [Expression]? ';' 10318 * 'return' [Expression]? ';'
9856 * </pre> 10319 * </pre>
9857 * 10320 *
9858 * @coverage dart.engine.ast 10321 * @coverage dart.engine.ast
9859 */ 10322 */
9860 class ReturnStatement extends Statement { 10323 class ReturnStatement extends Statement {
9861
9862 /** 10324 /**
9863 * The token representing the 'return' keyword. 10325 * The token representing the 'return' keyword.
9864 */ 10326 */
9865 Token keyword; 10327 Token keyword;
9866 10328
9867 /** 10329 /**
9868 * The expression computing the value to be returned, or `null` if no explicit value was 10330 * The expression computing the value to be returned, or `null` if no explicit value was
9869 * provided. 10331 * provided.
9870 */ 10332 */
9871 Expression _expression; 10333 Expression _expression;
(...skipping 17 matching lines...) Expand all
9889 } 10351 }
9890 10352
9891 /** 10353 /**
9892 * Initialize a newly created return statement. 10354 * Initialize a newly created return statement.
9893 * 10355 *
9894 * @param keyword the token representing the 'return' keyword 10356 * @param keyword the token representing the 'return' keyword
9895 * @param expression the expression computing the value to be returned 10357 * @param expression the expression computing the value to be returned
9896 * @param semicolon the semicolon terminating the statement 10358 * @param semicolon the semicolon terminating the statement
9897 */ 10359 */
9898 ReturnStatement({Token keyword, Expression expression, Token semicolon}) : thi s.full(keyword, expression, semicolon); 10360 ReturnStatement({Token keyword, Expression expression, Token semicolon}) : thi s.full(keyword, expression, semicolon);
10361
9899 accept(ASTVisitor visitor) => visitor.visitReturnStatement(this); 10362 accept(ASTVisitor visitor) => visitor.visitReturnStatement(this);
10363
9900 Token get beginToken => keyword; 10364 Token get beginToken => keyword;
10365
9901 Token get endToken => semicolon; 10366 Token get endToken => semicolon;
9902 10367
9903 /** 10368 /**
9904 * Return the expression computing the value to be returned, or `null` if no e xplicit value 10369 * Return the expression computing the value to be returned, or `null` if no e xplicit value
9905 * was provided. 10370 * was provided.
9906 * 10371 *
9907 * @return the expression computing the value to be returned 10372 * @return the expression computing the value to be returned
9908 */ 10373 */
9909 Expression get expression => _expression; 10374 Expression get expression => _expression;
9910 10375
9911 /** 10376 /**
9912 * Set the expression computing the value to be returned to the given expressi on. 10377 * Set the expression computing the value to be returned to the given expressi on.
9913 * 10378 *
9914 * @param expression the expression computing the value to be returned 10379 * @param expression the expression computing the value to be returned
9915 */ 10380 */
9916 void set expression(Expression expression) { 10381 void set expression(Expression expression) {
9917 this._expression = becomeParentOf(expression); 10382 this._expression = becomeParentOf(expression);
9918 } 10383 }
10384
9919 void visitChildren(ASTVisitor visitor) { 10385 void visitChildren(ASTVisitor visitor) {
9920 safelyVisitChild(_expression, visitor); 10386 safelyVisitChild(_expression, visitor);
9921 } 10387 }
9922 } 10388 }
10389
9923 /** 10390 /**
9924 * Instances of the class `ScriptTag` represent the script tag that can optional ly occur at 10391 * Instances of the class `ScriptTag` represent the script tag that can optional ly occur at
9925 * the beginning of a compilation unit. 10392 * the beginning of a compilation unit.
9926 * 10393 *
9927 * <pre> 10394 * <pre>
9928 * scriptTag ::= 10395 * scriptTag ::=
9929 * '#!' (~NEWLINE)* NEWLINE 10396 * '#!' (~NEWLINE)* NEWLINE
9930 * </pre> 10397 * </pre>
9931 * 10398 *
9932 * @coverage dart.engine.ast 10399 * @coverage dart.engine.ast
9933 */ 10400 */
9934 class ScriptTag extends ASTNode { 10401 class ScriptTag extends ASTNode {
9935
9936 /** 10402 /**
9937 * The token representing this script tag. 10403 * The token representing this script tag.
9938 */ 10404 */
9939 Token scriptTag; 10405 Token scriptTag;
9940 10406
9941 /** 10407 /**
9942 * Initialize a newly created script tag. 10408 * Initialize a newly created script tag.
9943 * 10409 *
9944 * @param scriptTag the token representing this script tag 10410 * @param scriptTag the token representing this script tag
9945 */ 10411 */
9946 ScriptTag.full(Token scriptTag) { 10412 ScriptTag.full(Token scriptTag) {
9947 this.scriptTag = scriptTag; 10413 this.scriptTag = scriptTag;
9948 } 10414 }
9949 10415
9950 /** 10416 /**
9951 * Initialize a newly created script tag. 10417 * Initialize a newly created script tag.
9952 * 10418 *
9953 * @param scriptTag the token representing this script tag 10419 * @param scriptTag the token representing this script tag
9954 */ 10420 */
9955 ScriptTag({Token scriptTag}) : this.full(scriptTag); 10421 ScriptTag({Token scriptTag}) : this.full(scriptTag);
10422
9956 accept(ASTVisitor visitor) => visitor.visitScriptTag(this); 10423 accept(ASTVisitor visitor) => visitor.visitScriptTag(this);
10424
9957 Token get beginToken => scriptTag; 10425 Token get beginToken => scriptTag;
10426
9958 Token get endToken => scriptTag; 10427 Token get endToken => scriptTag;
10428
9959 void visitChildren(ASTVisitor visitor) { 10429 void visitChildren(ASTVisitor visitor) {
9960 } 10430 }
9961 } 10431 }
10432
9962 /** 10433 /**
9963 * Instances of the class `ShowCombinator` represent a combinator that restricts the names 10434 * Instances of the class `ShowCombinator` represent a combinator that restricts the names
9964 * being imported to those in a given list. 10435 * being imported to those in a given list.
9965 * 10436 *
9966 * <pre> 10437 * <pre>
9967 * showCombinator ::= 10438 * showCombinator ::=
9968 * 'show' [SimpleIdentifier] (',' [SimpleIdentifier])* 10439 * 'show' [SimpleIdentifier] (',' [SimpleIdentifier])*
9969 * </pre> 10440 * </pre>
9970 * 10441 *
9971 * @coverage dart.engine.ast 10442 * @coverage dart.engine.ast
9972 */ 10443 */
9973 class ShowCombinator extends Combinator { 10444 class ShowCombinator extends Combinator {
9974
9975 /** 10445 /**
9976 * The list of names from the library that are made visible by this combinator . 10446 * The list of names from the library that are made visible by this combinator .
9977 */ 10447 */
9978 NodeList<SimpleIdentifier> shownNames; 10448 NodeList<SimpleIdentifier> shownNames;
9979 10449
9980 /** 10450 /**
9981 * Initialize a newly created import show combinator. 10451 * Initialize a newly created import show combinator.
9982 * 10452 *
9983 * @param keyword the comma introducing the combinator 10453 * @param keyword the comma introducing the combinator
9984 * @param shownNames the list of names from the library that are made visible by this combinator 10454 * @param shownNames the list of names from the library that are made visible by this combinator
9985 */ 10455 */
9986 ShowCombinator.full(Token keyword, List<SimpleIdentifier> shownNames) : super. full(keyword) { 10456 ShowCombinator.full(Token keyword, List<SimpleIdentifier> shownNames) : super. full(keyword) {
9987 this.shownNames = new NodeList<SimpleIdentifier>(this); 10457 this.shownNames = new NodeList<SimpleIdentifier>(this);
9988 this.shownNames.addAll(shownNames); 10458 this.shownNames.addAll(shownNames);
9989 } 10459 }
9990 10460
9991 /** 10461 /**
9992 * Initialize a newly created import show combinator. 10462 * Initialize a newly created import show combinator.
9993 * 10463 *
9994 * @param keyword the comma introducing the combinator 10464 * @param keyword the comma introducing the combinator
9995 * @param shownNames the list of names from the library that are made visible by this combinator 10465 * @param shownNames the list of names from the library that are made visible by this combinator
9996 */ 10466 */
9997 ShowCombinator({Token keyword, List<SimpleIdentifier> shownNames}) : this.full (keyword, shownNames); 10467 ShowCombinator({Token keyword, List<SimpleIdentifier> shownNames}) : this.full (keyword, shownNames);
10468
9998 accept(ASTVisitor visitor) => visitor.visitShowCombinator(this); 10469 accept(ASTVisitor visitor) => visitor.visitShowCombinator(this);
10470
9999 Token get endToken => shownNames.endToken; 10471 Token get endToken => shownNames.endToken;
10472
10000 void visitChildren(ASTVisitor visitor) { 10473 void visitChildren(ASTVisitor visitor) {
10001 shownNames.accept(visitor); 10474 shownNames.accept(visitor);
10002 } 10475 }
10003 } 10476 }
10477
10004 /** 10478 /**
10005 * Instances of the class `SimpleFormalParameter` represent a simple formal para meter. 10479 * Instances of the class `SimpleFormalParameter` represent a simple formal para meter.
10006 * 10480 *
10007 * <pre> 10481 * <pre>
10008 * simpleFormalParameter ::= 10482 * simpleFormalParameter ::=
10009 * ('final' [TypeName] | 'var' | [TypeName])? [SimpleIdentifier] 10483 * ('final' [TypeName] | 'var' | [TypeName])? [SimpleIdentifier]
10010 * </pre> 10484 * </pre>
10011 * 10485 *
10012 * @coverage dart.engine.ast 10486 * @coverage dart.engine.ast
10013 */ 10487 */
10014 class SimpleFormalParameter extends NormalFormalParameter { 10488 class SimpleFormalParameter extends NormalFormalParameter {
10015
10016 /** 10489 /**
10017 * The token representing either the 'final', 'const' or 'var' keyword, or `nu ll` if no 10490 * The token representing either the 'final', 'const' or 'var' keyword, or `nu ll` if no
10018 * keyword was used. 10491 * keyword was used.
10019 */ 10492 */
10020 Token keyword; 10493 Token keyword;
10021 10494
10022 /** 10495 /**
10023 * The name of the declared type of the parameter, or `null` if the parameter does not have 10496 * The name of the declared type of the parameter, or `null` if the parameter does not have
10024 * a declared type. 10497 * a declared type.
10025 */ 10498 */
(...skipping 16 matching lines...) Expand all
10042 /** 10515 /**
10043 * Initialize a newly created formal parameter. 10516 * Initialize a newly created formal parameter.
10044 * 10517 *
10045 * @param comment the documentation comment associated with this parameter 10518 * @param comment the documentation comment associated with this parameter
10046 * @param metadata the annotations associated with this parameter 10519 * @param metadata the annotations associated with this parameter
10047 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 10520 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
10048 * @param type the name of the declared type of the parameter 10521 * @param type the name of the declared type of the parameter
10049 * @param identifier the name of the parameter being declared 10522 * @param identifier the name of the parameter being declared
10050 */ 10523 */
10051 SimpleFormalParameter({Comment comment, List<Annotation> metadata, Token keywo rd, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, keyword, type, identifier); 10524 SimpleFormalParameter({Comment comment, List<Annotation> metadata, Token keywo rd, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, keyword, type, identifier);
10525
10052 accept(ASTVisitor visitor) => visitor.visitSimpleFormalParameter(this); 10526 accept(ASTVisitor visitor) => visitor.visitSimpleFormalParameter(this);
10527
10053 Token get beginToken { 10528 Token get beginToken {
10054 if (keyword != null) { 10529 if (keyword != null) {
10055 return keyword; 10530 return keyword;
10056 } else if (_type != null) { 10531 } else if (_type != null) {
10057 return _type.beginToken; 10532 return _type.beginToken;
10058 } 10533 }
10059 return identifier.beginToken; 10534 return identifier.beginToken;
10060 } 10535 }
10536
10061 Token get endToken => identifier.endToken; 10537 Token get endToken => identifier.endToken;
10062 10538
10063 /** 10539 /**
10064 * Return the name of the declared type of the parameter, or `null` if the par ameter does 10540 * Return the name of the declared type of the parameter, or `null` if the par ameter does
10065 * not have a declared type. 10541 * not have a declared type.
10066 * 10542 *
10067 * @return the name of the declared type of the parameter 10543 * @return the name of the declared type of the parameter
10068 */ 10544 */
10069 TypeName get type => _type; 10545 TypeName get type => _type;
10070 bool get isConst => (keyword is KeywordToken) && identical(((keyword as Keywor dToken)).keyword, Keyword.CONST); 10546
10071 bool get isFinal => (keyword is KeywordToken) && identical(((keyword as Keywor dToken)).keyword, Keyword.FINAL); 10547 bool get isConst => (keyword is KeywordToken) && identical((keyword as Keyword Token).keyword, Keyword.CONST);
10548
10549 bool get isFinal => (keyword is KeywordToken) && identical((keyword as Keyword Token).keyword, Keyword.FINAL);
10072 10550
10073 /** 10551 /**
10074 * Set the name of the declared type of the parameter to the given type name. 10552 * Set the name of the declared type of the parameter to the given type name.
10075 * 10553 *
10076 * @param typeName the name of the declared type of the parameter 10554 * @param typeName the name of the declared type of the parameter
10077 */ 10555 */
10078 void set type(TypeName typeName) { 10556 void set type(TypeName typeName) {
10079 _type = becomeParentOf(typeName); 10557 _type = becomeParentOf(typeName);
10080 } 10558 }
10559
10081 void visitChildren(ASTVisitor visitor) { 10560 void visitChildren(ASTVisitor visitor) {
10082 super.visitChildren(visitor); 10561 super.visitChildren(visitor);
10083 safelyVisitChild(_type, visitor); 10562 safelyVisitChild(_type, visitor);
10084 safelyVisitChild(identifier, visitor); 10563 safelyVisitChild(identifier, visitor);
10085 } 10564 }
10086 } 10565 }
10566
10087 /** 10567 /**
10088 * Instances of the class `SimpleIdentifier` represent a simple identifier. 10568 * Instances of the class `SimpleIdentifier` represent a simple identifier.
10089 * 10569 *
10090 * <pre> 10570 * <pre>
10091 * simpleIdentifier ::= 10571 * simpleIdentifier ::=
10092 * initialCharacter internalCharacter* 10572 * initialCharacter internalCharacter*
10093 * 10573 *
10094 * initialCharacter ::= '_' | '$' | letter 10574 * initialCharacter ::= '_' | '$' | letter
10095 * 10575 *
10096 * internalCharacter ::= '_' | '$' | letter | digit 10576 * internalCharacter ::= '_' | '$' | letter | digit
10097 * </pre> 10577 * </pre>
10098 * 10578 *
10099 * @coverage dart.engine.ast 10579 * @coverage dart.engine.ast
10100 */ 10580 */
10101 class SimpleIdentifier extends Identifier { 10581 class SimpleIdentifier extends Identifier {
10102
10103 /** 10582 /**
10104 * The token representing the identifier. 10583 * The token representing the identifier.
10105 */ 10584 */
10106 Token token; 10585 Token token;
10107 10586
10108 /** 10587 /**
10109 * The element associated with this identifier based on static type informatio n, or `null` 10588 * The element associated with this identifier based on static type informatio n, or `null`
10110 * if the AST structure has not been resolved or if this identifier could not be resolved. 10589 * if the AST structure has not been resolved or if this identifier could not be resolved.
10111 */ 10590 */
10112 Element _staticElement; 10591 Element _staticElement;
(...skipping 20 matching lines...) Expand all
10133 SimpleIdentifier.full(Token token) { 10612 SimpleIdentifier.full(Token token) {
10134 this.token = token; 10613 this.token = token;
10135 } 10614 }
10136 10615
10137 /** 10616 /**
10138 * Initialize a newly created identifier. 10617 * Initialize a newly created identifier.
10139 * 10618 *
10140 * @param token the token representing the identifier 10619 * @param token the token representing the identifier
10141 */ 10620 */
10142 SimpleIdentifier({Token token}) : this.full(token); 10621 SimpleIdentifier({Token token}) : this.full(token);
10622
10143 accept(ASTVisitor visitor) => visitor.visitSimpleIdentifier(this); 10623 accept(ASTVisitor visitor) => visitor.visitSimpleIdentifier(this);
10624
10144 Token get beginToken => token; 10625 Token get beginToken => token;
10626
10145 Element get bestElement { 10627 Element get bestElement {
10146 if (_propagatedElement == null) { 10628 if (_propagatedElement == null) {
10147 return _staticElement; 10629 return _staticElement;
10148 } 10630 }
10149 return _propagatedElement; 10631 return _propagatedElement;
10150 } 10632 }
10633
10151 Token get endToken => token; 10634 Token get endToken => token;
10635
10152 String get name => token.lexeme; 10636 String get name => token.lexeme;
10637
10153 Element get propagatedElement => _propagatedElement; 10638 Element get propagatedElement => _propagatedElement;
10639
10154 Element get staticElement => _staticElement; 10640 Element get staticElement => _staticElement;
10155 10641
10156 /** 10642 /**
10157 * Return `true` if this identifier is the name being declared in a declaratio n. 10643 * Return `true` if this identifier is the name being declared in a declaratio n.
10158 * 10644 *
10159 * @return `true` if this identifier is the name being declared in a declarati on 10645 * @return `true` if this identifier is the name being declared in a declarati on
10160 */ 10646 */
10161 bool inDeclarationContext() { 10647 bool inDeclarationContext() {
10162 ASTNode parent = this.parent; 10648 ASTNode parent = this.parent;
10163 if (parent is CatchClause) { 10649 if (parent is CatchClause) {
10164 CatchClause clause = parent as CatchClause; 10650 CatchClause clause = parent as CatchClause;
10165 return identical(this, clause.exceptionParameter) || identical(this, claus e.stackTraceParameter); 10651 return identical(this, clause.exceptionParameter) || identical(this, claus e.stackTraceParameter);
10166 } else if (parent is ClassDeclaration) { 10652 } else if (parent is ClassDeclaration) {
10167 return identical(this, ((parent as ClassDeclaration)).name); 10653 return identical(this, (parent as ClassDeclaration).name);
10168 } else if (parent is ClassTypeAlias) { 10654 } else if (parent is ClassTypeAlias) {
10169 return identical(this, ((parent as ClassTypeAlias)).name); 10655 return identical(this, (parent as ClassTypeAlias).name);
10170 } else if (parent is ConstructorDeclaration) { 10656 } else if (parent is ConstructorDeclaration) {
10171 return identical(this, ((parent as ConstructorDeclaration)).name); 10657 return identical(this, (parent as ConstructorDeclaration).name);
10172 } else if (parent is DeclaredIdentifier) { 10658 } else if (parent is DeclaredIdentifier) {
10173 return identical(this, ((parent as DeclaredIdentifier)).identifier); 10659 return identical(this, (parent as DeclaredIdentifier).identifier);
10174 } else if (parent is FunctionDeclaration) { 10660 } else if (parent is FunctionDeclaration) {
10175 return identical(this, ((parent as FunctionDeclaration)).name); 10661 return identical(this, (parent as FunctionDeclaration).name);
10176 } else if (parent is FunctionTypeAlias) { 10662 } else if (parent is FunctionTypeAlias) {
10177 return identical(this, ((parent as FunctionTypeAlias)).name); 10663 return identical(this, (parent as FunctionTypeAlias).name);
10178 } else if (parent is Label) { 10664 } else if (parent is Label) {
10179 return identical(this, ((parent as Label)).label) && (parent.parent is Lab eledStatement); 10665 return identical(this, (parent as Label).label) && (parent.parent is Label edStatement);
10180 } else if (parent is MethodDeclaration) { 10666 } else if (parent is MethodDeclaration) {
10181 return identical(this, ((parent as MethodDeclaration)).name); 10667 return identical(this, (parent as MethodDeclaration).name);
10182 } else if (parent is FunctionTypedFormalParameter || parent is SimpleFormalP arameter) { 10668 } else if (parent is FunctionTypedFormalParameter || parent is SimpleFormalP arameter) {
10183 return identical(this, ((parent as NormalFormalParameter)).identifier); 10669 return identical(this, (parent as NormalFormalParameter).identifier);
10184 } else if (parent is TypeParameter) { 10670 } else if (parent is TypeParameter) {
10185 return identical(this, ((parent as TypeParameter)).name); 10671 return identical(this, (parent as TypeParameter).name);
10186 } else if (parent is VariableDeclaration) { 10672 } else if (parent is VariableDeclaration) {
10187 return identical(this, ((parent as VariableDeclaration)).name); 10673 return identical(this, (parent as VariableDeclaration).name);
10188 } 10674 }
10189 return false; 10675 return false;
10190 } 10676 }
10191 10677
10192 /** 10678 /**
10193 * Return `true` if this expression is computing a right-hand value. 10679 * Return `true` if this expression is computing a right-hand value.
10194 * 10680 *
10195 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar e 10681 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar e
10196 * they mutually exclusive. In other words, it is possible for both methods to return `true` 10682 * they mutually exclusive. In other words, it is possible for both methods to return `true`
10197 * when invoked on the same node. 10683 * when invoked on the same node.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
10249 target = prefixed; 10735 target = prefixed;
10250 } else if (parent is PropertyAccess) { 10736 } else if (parent is PropertyAccess) {
10251 PropertyAccess access = parent as PropertyAccess; 10737 PropertyAccess access = parent as PropertyAccess;
10252 if (identical(access.target, this)) { 10738 if (identical(access.target, this)) {
10253 return false; 10739 return false;
10254 } 10740 }
10255 parent = access.parent; 10741 parent = access.parent;
10256 target = access; 10742 target = access;
10257 } 10743 }
10258 if (parent is PrefixExpression) { 10744 if (parent is PrefixExpression) {
10259 return ((parent as PrefixExpression)).operator.type.isIncrementOperator; 10745 return (parent as PrefixExpression).operator.type.isIncrementOperator;
10260 } else if (parent is PostfixExpression) { 10746 } else if (parent is PostfixExpression) {
10261 return true; 10747 return true;
10262 } else if (parent is AssignmentExpression) { 10748 } else if (parent is AssignmentExpression) {
10263 return identical(((parent as AssignmentExpression)).leftHandSide, target); 10749 return identical((parent as AssignmentExpression).leftHandSide, target);
10264 } 10750 }
10265 return false; 10751 return false;
10266 } 10752 }
10753
10267 bool get isSynthetic => token.isSynthetic; 10754 bool get isSynthetic => token.isSynthetic;
10268 10755
10269 /** 10756 /**
10270 * Set the element associated with this identifier based on propagated type in formation to the 10757 * Set the element associated with this identifier based on propagated type in formation to the
10271 * given element. 10758 * given element.
10272 * 10759 *
10273 * @param element the element to be associated with this identifier 10760 * @param element the element to be associated with this identifier
10274 */ 10761 */
10275 void set propagatedElement(Element element) { 10762 void set propagatedElement(Element element) {
10276 _propagatedElement = validateElement2(element); 10763 _propagatedElement = validateElement2(element);
10277 } 10764 }
10278 10765
10279 /** 10766 /**
10280 * Set the element associated with this identifier based on static type inform ation to the given 10767 * Set the element associated with this identifier based on static type inform ation to the given
10281 * element. 10768 * element.
10282 * 10769 *
10283 * @param element the element to be associated with this identifier 10770 * @param element the element to be associated with this identifier
10284 */ 10771 */
10285 void set staticElement(Element element) { 10772 void set staticElement(Element element) {
10286 _staticElement = validateElement2(element); 10773 _staticElement = validateElement2(element);
10287 } 10774 }
10775
10288 void visitChildren(ASTVisitor visitor) { 10776 void visitChildren(ASTVisitor visitor) {
10289 } 10777 }
10290 10778
10291 /** 10779 /**
10292 * Return the given element if it is an appropriate element based on the paren t of this 10780 * Return the given element if it is an appropriate element based on the paren t of this
10293 * identifier, or `null` if it is not appropriate. 10781 * identifier, or `null` if it is not appropriate.
10294 * 10782 *
10295 * @param element the element to be associated with this identifier 10783 * @param element the element to be associated with this identifier
10296 * @return the element to be associated with this identifier 10784 * @return the element to be associated with this identifier
10297 */ 10785 */
(...skipping 10 matching lines...) Expand all
10308 * identifier, or `null` if it is not appropriate. 10796 * identifier, or `null` if it is not appropriate.
10309 * 10797 *
10310 * @param element the element to be associated with this identifier 10798 * @param element the element to be associated with this identifier
10311 * @return the element to be associated with this identifier 10799 * @return the element to be associated with this identifier
10312 */ 10800 */
10313 Element validateElement2(Element element) { 10801 Element validateElement2(Element element) {
10314 if (element == null) { 10802 if (element == null) {
10315 return null; 10803 return null;
10316 } 10804 }
10317 ASTNode parent = this.parent; 10805 ASTNode parent = this.parent;
10318 if (parent is ClassDeclaration && identical(((parent as ClassDeclaration)).n ame, this)) { 10806 if (parent is ClassDeclaration && identical((parent as ClassDeclaration).nam e, this)) {
10319 return validateElement(parent, ClassElement, element); 10807 return validateElement(parent, ClassElement, element);
10320 } else if (parent is ClassTypeAlias && identical(((parent as ClassTypeAlias) ).name, this)) { 10808 } else if (parent is ClassTypeAlias && identical((parent as ClassTypeAlias). name, this)) {
10321 return validateElement(parent, ClassElement, element); 10809 return validateElement(parent, ClassElement, element);
10322 } else if (parent is DeclaredIdentifier && identical(((parent as DeclaredIde ntifier)).identifier, this)) { 10810 } else if (parent is DeclaredIdentifier && identical((parent as DeclaredIden tifier).identifier, this)) {
10323 return validateElement(parent, LocalVariableElement, element); 10811 return validateElement(parent, LocalVariableElement, element);
10324 } else if (parent is FormalParameter && identical(((parent as FormalParamete r)).identifier, this)) { 10812 } else if (parent is FormalParameter && identical((parent as FormalParameter ).identifier, this)) {
10325 return validateElement(parent, ParameterElement, element); 10813 return validateElement(parent, ParameterElement, element);
10326 } else if (parent is FunctionDeclaration && identical(((parent as FunctionDe claration)).name, this)) { 10814 } else if (parent is FunctionDeclaration && identical((parent as FunctionDec laration).name, this)) {
10327 return validateElement(parent, ExecutableElement, element); 10815 return validateElement(parent, ExecutableElement, element);
10328 } else if (parent is FunctionTypeAlias && identical(((parent as FunctionType Alias)).name, this)) { 10816 } else if (parent is FunctionTypeAlias && identical((parent as FunctionTypeA lias).name, this)) {
10329 return validateElement(parent, FunctionTypeAliasElement, element); 10817 return validateElement(parent, FunctionTypeAliasElement, element);
10330 } else if (parent is MethodDeclaration && identical(((parent as MethodDeclar ation)).name, this)) { 10818 } else if (parent is MethodDeclaration && identical((parent as MethodDeclara tion).name, this)) {
10331 return validateElement(parent, ExecutableElement, element); 10819 return validateElement(parent, ExecutableElement, element);
10332 } else if (parent is TypeParameter && identical(((parent as TypeParameter)). name, this)) { 10820 } else if (parent is TypeParameter && identical((parent as TypeParameter).na me, this)) {
10333 return validateElement(parent, TypeParameterElement, element); 10821 return validateElement(parent, TypeParameterElement, element);
10334 } else if (parent is VariableDeclaration && identical(((parent as VariableDe claration)).name, this)) { 10822 } else if (parent is VariableDeclaration && identical((parent as VariableDec laration).name, this)) {
10335 return validateElement(parent, VariableElement, element); 10823 return validateElement(parent, VariableElement, element);
10336 } 10824 }
10337 return element; 10825 return element;
10338 } 10826 }
10339 } 10827 }
10828
10340 /** 10829 /**
10341 * Instances of the class `SimpleStringLiteral` represent a string literal expre ssion that 10830 * Instances of the class `SimpleStringLiteral` represent a string literal expre ssion that
10342 * does not contain any interpolations. 10831 * does not contain any interpolations.
10343 * 10832 *
10344 * <pre> 10833 * <pre>
10345 * simpleStringLiteral ::= 10834 * simpleStringLiteral ::=
10346 * rawStringLiteral 10835 * rawStringLiteral
10347 * | basicStringLiteral 10836 * | basicStringLiteral
10348 * 10837 *
10349 * rawStringLiteral ::= 10838 * rawStringLiteral ::=
10350 * '@' basicStringLiteral 10839 * '@' basicStringLiteral
10351 * 10840 *
10352 * simpleStringLiteral ::= 10841 * simpleStringLiteral ::=
10353 * multiLineStringLiteral 10842 * multiLineStringLiteral
10354 * | singleLineStringLiteral 10843 * | singleLineStringLiteral
10355 * 10844 *
10356 * multiLineStringLiteral ::= 10845 * multiLineStringLiteral ::=
10357 * "'''" characters "'''" 10846 * "'''" characters "'''"
10358 * | '"""' characters '"""' 10847 * | '"""' characters '"""'
10359 * 10848 *
10360 * singleLineStringLiteral ::= 10849 * singleLineStringLiteral ::=
10361 * "'" characters "'" 10850 * "'" characters "'"
10362 * '"' characters '"' 10851 * '"' characters '"'
10363 * </pre> 10852 * </pre>
10364 * 10853 *
10365 * @coverage dart.engine.ast 10854 * @coverage dart.engine.ast
10366 */ 10855 */
10367 class SimpleStringLiteral extends StringLiteral { 10856 class SimpleStringLiteral extends StringLiteral {
10368
10369 /** 10857 /**
10370 * The token representing the literal. 10858 * The token representing the literal.
10371 */ 10859 */
10372 Token literal; 10860 Token literal;
10373 10861
10374 /** 10862 /**
10375 * The value of the literal. 10863 * The value of the literal.
10376 */ 10864 */
10377 String _value; 10865 String _value;
10378 10866
10379 /** 10867 /**
10380 * Initialize a newly created simple string literal. 10868 * Initialize a newly created simple string literal.
10381 * 10869 *
10382 * @param literal the token representing the literal 10870 * @param literal the token representing the literal
10383 * @param value the value of the literal 10871 * @param value the value of the literal
10384 */ 10872 */
10385 SimpleStringLiteral.full(Token literal, String value) { 10873 SimpleStringLiteral.full(Token literal, String value) {
10386 this.literal = literal; 10874 this.literal = literal;
10387 this._value = StringUtilities.intern(value); 10875 this._value = StringUtilities.intern(value);
10388 } 10876 }
10389 10877
10390 /** 10878 /**
10391 * Initialize a newly created simple string literal. 10879 * Initialize a newly created simple string literal.
10392 * 10880 *
10393 * @param literal the token representing the literal 10881 * @param literal the token representing the literal
10394 * @param value the value of the literal 10882 * @param value the value of the literal
10395 */ 10883 */
10396 SimpleStringLiteral({Token literal, String value}) : this.full(literal, value) ; 10884 SimpleStringLiteral({Token literal, String value}) : this.full(literal, value) ;
10885
10397 accept(ASTVisitor visitor) => visitor.visitSimpleStringLiteral(this); 10886 accept(ASTVisitor visitor) => visitor.visitSimpleStringLiteral(this);
10887
10398 Token get beginToken => literal; 10888 Token get beginToken => literal;
10889
10399 Token get endToken => literal; 10890 Token get endToken => literal;
10400 10891
10401 /** 10892 /**
10402 * Return the value of the literal. 10893 * Return the value of the literal.
10403 * 10894 *
10404 * @return the value of the literal 10895 * @return the value of the literal
10405 */ 10896 */
10406 String get value => _value; 10897 String get value => _value;
10407 10898
10408 /** 10899 /**
10409 * Return `true` if this string literal is a multi-line string. 10900 * Return `true` if this string literal is a multi-line string.
10410 * 10901 *
10411 * @return `true` if this string literal is a multi-line string 10902 * @return `true` if this string literal is a multi-line string
10412 */ 10903 */
10413 bool get isMultiline { 10904 bool get isMultiline {
10414 if (_value.length < 6) { 10905 if (_value.length < 6) {
10415 return false; 10906 return false;
10416 } 10907 }
10417 return _value.endsWith("\"\"\"") || _value.endsWith("'''"); 10908 return _value.endsWith("\"\"\"") || _value.endsWith("'''");
10418 } 10909 }
10419 10910
10420 /** 10911 /**
10421 * Return `true` if this string literal is a raw string. 10912 * Return `true` if this string literal is a raw string.
10422 * 10913 *
10423 * @return `true` if this string literal is a raw string 10914 * @return `true` if this string literal is a raw string
10424 */ 10915 */
10425 bool get isRaw => _value.codeUnitAt(0) == 0x40; 10916 bool get isRaw => _value.codeUnitAt(0) == 0x40;
10917
10426 bool get isSynthetic => literal.isSynthetic; 10918 bool get isSynthetic => literal.isSynthetic;
10427 10919
10428 /** 10920 /**
10429 * Set the value of the literal to the given string. 10921 * Set the value of the literal to the given string.
10430 * 10922 *
10431 * @param string the value of the literal 10923 * @param string the value of the literal
10432 */ 10924 */
10433 void set value(String string) { 10925 void set value(String string) {
10434 _value = StringUtilities.intern(_value); 10926 _value = StringUtilities.intern(_value);
10435 } 10927 }
10928
10436 void visitChildren(ASTVisitor visitor) { 10929 void visitChildren(ASTVisitor visitor) {
10437 } 10930 }
10931
10438 void appendStringValue(JavaStringBuilder builder) { 10932 void appendStringValue(JavaStringBuilder builder) {
10439 builder.append(value); 10933 builder.append(value);
10440 } 10934 }
10441 } 10935 }
10936
10442 /** 10937 /**
10443 * Instances of the class `Statement` defines the behavior common to nodes that represent a 10938 * Instances of the class `Statement` defines the behavior common to nodes that represent a
10444 * statement. 10939 * statement.
10445 * 10940 *
10446 * <pre> 10941 * <pre>
10447 * statement ::= 10942 * statement ::=
10448 * [Block] 10943 * [Block]
10449 * | [VariableDeclarationStatement] 10944 * | [VariableDeclarationStatement]
10450 * | [ForStatement] 10945 * | [ForStatement]
10451 * | [ForEachStatement] 10946 * | [ForEachStatement]
10452 * | [WhileStatement] 10947 * | [WhileStatement]
10453 * | [DoStatement] 10948 * | [DoStatement]
10454 * | [SwitchStatement] 10949 * | [SwitchStatement]
10455 * | [IfStatement] 10950 * | [IfStatement]
10456 * | [TryStatement] 10951 * | [TryStatement]
10457 * | [BreakStatement] 10952 * | [BreakStatement]
10458 * | [ContinueStatement] 10953 * | [ContinueStatement]
10459 * | [ReturnStatement] 10954 * | [ReturnStatement]
10460 * | [ExpressionStatement] 10955 * | [ExpressionStatement]
10461 * | [FunctionDeclarationStatement] 10956 * | [FunctionDeclarationStatement]
10462 * </pre> 10957 * </pre>
10463 * 10958 *
10464 * @coverage dart.engine.ast 10959 * @coverage dart.engine.ast
10465 */ 10960 */
10466 abstract class Statement extends ASTNode { 10961 abstract class Statement extends ASTNode {
10467 } 10962 }
10963
10468 /** 10964 /**
10469 * Instances of the class `StringInterpolation` represent a string interpolation literal. 10965 * Instances of the class `StringInterpolation` represent a string interpolation literal.
10470 * 10966 *
10471 * <pre> 10967 * <pre>
10472 * stringInterpolation ::= 10968 * stringInterpolation ::=
10473 * ''' [InterpolationElement]* ''' 10969 * ''' [InterpolationElement]* '''
10474 * | '"' [InterpolationElement]* '"' 10970 * | '"' [InterpolationElement]* '"'
10475 * </pre> 10971 * </pre>
10476 * 10972 *
10477 * @coverage dart.engine.ast 10973 * @coverage dart.engine.ast
10478 */ 10974 */
10479 class StringInterpolation extends StringLiteral { 10975 class StringInterpolation extends StringLiteral {
10480
10481 /** 10976 /**
10482 * The elements that will be composed to produce the resulting string. 10977 * The elements that will be composed to produce the resulting string.
10483 */ 10978 */
10484 NodeList<InterpolationElement> elements; 10979 NodeList<InterpolationElement> elements;
10485 10980
10486 /** 10981 /**
10487 * Initialize a newly created string interpolation expression. 10982 * Initialize a newly created string interpolation expression.
10488 * 10983 *
10489 * @param elements the elements that will be composed to produce the resulting string 10984 * @param elements the elements that will be composed to produce the resulting string
10490 */ 10985 */
10491 StringInterpolation.full(List<InterpolationElement> elements) { 10986 StringInterpolation.full(List<InterpolationElement> elements) {
10492 this.elements = new NodeList<InterpolationElement>(this); 10987 this.elements = new NodeList<InterpolationElement>(this);
10493 this.elements.addAll(elements); 10988 this.elements.addAll(elements);
10494 } 10989 }
10495 10990
10496 /** 10991 /**
10497 * Initialize a newly created string interpolation expression. 10992 * Initialize a newly created string interpolation expression.
10498 * 10993 *
10499 * @param elements the elements that will be composed to produce the resulting string 10994 * @param elements the elements that will be composed to produce the resulting string
10500 */ 10995 */
10501 StringInterpolation({List<InterpolationElement> elements}) : this.full(element s); 10996 StringInterpolation({List<InterpolationElement> elements}) : this.full(element s);
10997
10502 accept(ASTVisitor visitor) => visitor.visitStringInterpolation(this); 10998 accept(ASTVisitor visitor) => visitor.visitStringInterpolation(this);
10999
10503 Token get beginToken => elements.beginToken; 11000 Token get beginToken => elements.beginToken;
11001
10504 Token get endToken => elements.endToken; 11002 Token get endToken => elements.endToken;
11003
10505 void visitChildren(ASTVisitor visitor) { 11004 void visitChildren(ASTVisitor visitor) {
10506 elements.accept(visitor); 11005 elements.accept(visitor);
10507 } 11006 }
11007
10508 void appendStringValue(JavaStringBuilder builder) { 11008 void appendStringValue(JavaStringBuilder builder) {
10509 throw new IllegalArgumentException(); 11009 throw new IllegalArgumentException();
10510 } 11010 }
10511 } 11011 }
11012
10512 /** 11013 /**
10513 * Instances of the class `StringLiteral` represent a string literal expression. 11014 * Instances of the class `StringLiteral` represent a string literal expression.
10514 * 11015 *
10515 * <pre> 11016 * <pre>
10516 * stringLiteral ::= 11017 * stringLiteral ::=
10517 * [SimpleStringLiteral] 11018 * [SimpleStringLiteral]
10518 * | [AdjacentStrings] 11019 * | [AdjacentStrings]
10519 * | [StringInterpolation] 11020 * | [StringInterpolation]
10520 * </pre> 11021 * </pre>
10521 * 11022 *
10522 * @coverage dart.engine.ast 11023 * @coverage dart.engine.ast
10523 */ 11024 */
10524 abstract class StringLiteral extends Literal { 11025 abstract class StringLiteral extends Literal {
10525
10526 /** 11026 /**
10527 * Return the value of the string literal, or `null` if the string is not a co nstant string 11027 * Return the value of the string literal, or `null` if the string is not a co nstant string
10528 * without any string interpolation. 11028 * without any string interpolation.
10529 * 11029 *
10530 * @return the value of the string literal 11030 * @return the value of the string literal
10531 */ 11031 */
10532 String get stringValue { 11032 String get stringValue {
10533 JavaStringBuilder builder = new JavaStringBuilder(); 11033 JavaStringBuilder builder = new JavaStringBuilder();
10534 try { 11034 try {
10535 appendStringValue(builder); 11035 appendStringValue(builder);
10536 } on IllegalArgumentException catch (exception) { 11036 } on IllegalArgumentException catch (exception) {
10537 return null; 11037 return null;
10538 } 11038 }
10539 return builder.toString(); 11039 return builder.toString();
10540 } 11040 }
10541 11041
10542 /** 11042 /**
10543 * Append the value of the given string literal to the given string builder. 11043 * Append the value of the given string literal to the given string builder.
10544 * 11044 *
10545 * @param builder the builder to which the string's value is to be appended 11045 * @param builder the builder to which the string's value is to be appended
10546 * @throws IllegalArgumentException if the string is not a constant string wit hout any string 11046 * @throws IllegalArgumentException if the string is not a constant string wit hout any string
10547 * interpolation 11047 * interpolation
10548 */ 11048 */
10549 void appendStringValue(JavaStringBuilder builder); 11049 void appendStringValue(JavaStringBuilder builder);
10550 } 11050 }
11051
10551 /** 11052 /**
10552 * Instances of the class `SuperConstructorInvocation` represent the invocation of a 11053 * Instances of the class `SuperConstructorInvocation` represent the invocation of a
10553 * superclass' constructor from within a constructor's initialization list. 11054 * superclass' constructor from within a constructor's initialization list.
10554 * 11055 *
10555 * <pre> 11056 * <pre>
10556 * superInvocation ::= 11057 * superInvocation ::=
10557 * 'super' ('.' [SimpleIdentifier])? [ArgumentList] 11058 * 'super' ('.' [SimpleIdentifier])? [ArgumentList]
10558 * </pre> 11059 * </pre>
10559 * 11060 *
10560 * @coverage dart.engine.ast 11061 * @coverage dart.engine.ast
10561 */ 11062 */
10562 class SuperConstructorInvocation extends ConstructorInitializer { 11063 class SuperConstructorInvocation extends ConstructorInitializer {
10563
10564 /** 11064 /**
10565 * The token for the 'super' keyword. 11065 * The token for the 'super' keyword.
10566 */ 11066 */
10567 Token keyword; 11067 Token keyword;
10568 11068
10569 /** 11069 /**
10570 * The token for the period before the name of the constructor that is being i nvoked, or 11070 * The token for the period before the name of the constructor that is being i nvoked, or
10571 * `null` if the unnamed constructor is being invoked. 11071 * `null` if the unnamed constructor is being invoked.
10572 */ 11072 */
10573 Token period; 11073 Token period;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
10608 /** 11108 /**
10609 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given 11109 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given
10610 * name with the given arguments. 11110 * name with the given arguments.
10611 * 11111 *
10612 * @param keyword the token for the 'super' keyword 11112 * @param keyword the token for the 'super' keyword
10613 * @param period the token for the period before the name of the constructor t hat is being invoked 11113 * @param period the token for the period before the name of the constructor t hat is being invoked
10614 * @param constructorName the name of the constructor that is being invoked 11114 * @param constructorName the name of the constructor that is being invoked
10615 * @param argumentList the list of arguments to the constructor 11115 * @param argumentList the list of arguments to the constructor
10616 */ 11116 */
10617 SuperConstructorInvocation({Token keyword, Token period, SimpleIdentifier cons tructorName, ArgumentList argumentList}) : this.full(keyword, period, constructo rName, argumentList); 11117 SuperConstructorInvocation({Token keyword, Token period, SimpleIdentifier cons tructorName, ArgumentList argumentList}) : this.full(keyword, period, constructo rName, argumentList);
11118
10618 accept(ASTVisitor visitor) => visitor.visitSuperConstructorInvocation(this); 11119 accept(ASTVisitor visitor) => visitor.visitSuperConstructorInvocation(this);
10619 11120
10620 /** 11121 /**
10621 * Return the list of arguments to the constructor. 11122 * Return the list of arguments to the constructor.
10622 * 11123 *
10623 * @return the list of arguments to the constructor 11124 * @return the list of arguments to the constructor
10624 */ 11125 */
10625 ArgumentList get argumentList => _argumentList; 11126 ArgumentList get argumentList => _argumentList;
11127
10626 Token get beginToken => keyword; 11128 Token get beginToken => keyword;
10627 11129
10628 /** 11130 /**
10629 * Return the name of the constructor that is being invoked, or `null` if the unnamed 11131 * Return the name of the constructor that is being invoked, or `null` if the unnamed
10630 * constructor is being invoked. 11132 * constructor is being invoked.
10631 * 11133 *
10632 * @return the name of the constructor that is being invoked 11134 * @return the name of the constructor that is being invoked
10633 */ 11135 */
10634 SimpleIdentifier get constructorName => _constructorName; 11136 SimpleIdentifier get constructorName => _constructorName;
11137
10635 Token get endToken => _argumentList.endToken; 11138 Token get endToken => _argumentList.endToken;
10636 11139
10637 /** 11140 /**
10638 * Set the list of arguments to the constructor to the given list. 11141 * Set the list of arguments to the constructor to the given list.
10639 * 11142 *
10640 * @param argumentList the list of arguments to the constructor 11143 * @param argumentList the list of arguments to the constructor
10641 */ 11144 */
10642 void set argumentList(ArgumentList argumentList) { 11145 void set argumentList(ArgumentList argumentList) {
10643 this._argumentList = becomeParentOf(argumentList); 11146 this._argumentList = becomeParentOf(argumentList);
10644 } 11147 }
10645 11148
10646 /** 11149 /**
10647 * Set the name of the constructor that is being invoked to the given identifi er. 11150 * Set the name of the constructor that is being invoked to the given identifi er.
10648 * 11151 *
10649 * @param identifier the name of the constructor that is being invoked 11152 * @param identifier the name of the constructor that is being invoked
10650 */ 11153 */
10651 void set constructorName(SimpleIdentifier identifier) { 11154 void set constructorName(SimpleIdentifier identifier) {
10652 _constructorName = becomeParentOf(identifier); 11155 _constructorName = becomeParentOf(identifier);
10653 } 11156 }
11157
10654 void visitChildren(ASTVisitor visitor) { 11158 void visitChildren(ASTVisitor visitor) {
10655 safelyVisitChild(_constructorName, visitor); 11159 safelyVisitChild(_constructorName, visitor);
10656 safelyVisitChild(_argumentList, visitor); 11160 safelyVisitChild(_argumentList, visitor);
10657 } 11161 }
10658 } 11162 }
11163
10659 /** 11164 /**
10660 * Instances of the class `SuperExpression` represent a super expression. 11165 * Instances of the class `SuperExpression` represent a super expression.
10661 * 11166 *
10662 * <pre> 11167 * <pre>
10663 * superExpression ::= 11168 * superExpression ::=
10664 * 'super' 11169 * 'super'
10665 * </pre> 11170 * </pre>
10666 * 11171 *
10667 * @coverage dart.engine.ast 11172 * @coverage dart.engine.ast
10668 */ 11173 */
10669 class SuperExpression extends Expression { 11174 class SuperExpression extends Expression {
10670
10671 /** 11175 /**
10672 * The token representing the keyword. 11176 * The token representing the keyword.
10673 */ 11177 */
10674 Token keyword; 11178 Token keyword;
10675 11179
10676 /** 11180 /**
10677 * Initialize a newly created super expression. 11181 * Initialize a newly created super expression.
10678 * 11182 *
10679 * @param keyword the token representing the keyword 11183 * @param keyword the token representing the keyword
10680 */ 11184 */
10681 SuperExpression.full(Token keyword) { 11185 SuperExpression.full(Token keyword) {
10682 this.keyword = keyword; 11186 this.keyword = keyword;
10683 } 11187 }
10684 11188
10685 /** 11189 /**
10686 * Initialize a newly created super expression. 11190 * Initialize a newly created super expression.
10687 * 11191 *
10688 * @param keyword the token representing the keyword 11192 * @param keyword the token representing the keyword
10689 */ 11193 */
10690 SuperExpression({Token keyword}) : this.full(keyword); 11194 SuperExpression({Token keyword}) : this.full(keyword);
11195
10691 accept(ASTVisitor visitor) => visitor.visitSuperExpression(this); 11196 accept(ASTVisitor visitor) => visitor.visitSuperExpression(this);
11197
10692 Token get beginToken => keyword; 11198 Token get beginToken => keyword;
11199
10693 Token get endToken => keyword; 11200 Token get endToken => keyword;
11201
10694 void visitChildren(ASTVisitor visitor) { 11202 void visitChildren(ASTVisitor visitor) {
10695 } 11203 }
10696 } 11204 }
11205
10697 /** 11206 /**
10698 * Instances of the class `SwitchCase` represent the case in a switch statement. 11207 * Instances of the class `SwitchCase` represent the case in a switch statement.
10699 * 11208 *
10700 * <pre> 11209 * <pre>
10701 * switchCase ::= 11210 * switchCase ::=
10702 * [SimpleIdentifier]* 'case' [Expression] ':' [Statement]* 11211 * [SimpleIdentifier]* 'case' [Expression] ':' [Statement]*
10703 * </pre> 11212 * </pre>
10704 * 11213 *
10705 * @coverage dart.engine.ast 11214 * @coverage dart.engine.ast
10706 */ 11215 */
10707 class SwitchCase extends SwitchMember { 11216 class SwitchCase extends SwitchMember {
10708
10709 /** 11217 /**
10710 * The expression controlling whether the statements will be executed. 11218 * The expression controlling whether the statements will be executed.
10711 */ 11219 */
10712 Expression _expression; 11220 Expression _expression;
10713 11221
10714 /** 11222 /**
10715 * Initialize a newly created switch case. 11223 * Initialize a newly created switch case.
10716 * 11224 *
10717 * @param labels the labels associated with the switch member 11225 * @param labels the labels associated with the switch member
10718 * @param keyword the token representing the 'case' or 'default' keyword 11226 * @param keyword the token representing the 'case' or 'default' keyword
10719 * @param expression the expression controlling whether the statements will be executed 11227 * @param expression the expression controlling whether the statements will be executed
10720 * @param colon the colon separating the keyword or the expression from the st atements 11228 * @param colon the colon separating the keyword or the expression from the st atements
10721 * @param statements the statements that will be executed if this switch membe r is selected 11229 * @param statements the statements that will be executed if this switch membe r is selected
10722 */ 11230 */
10723 SwitchCase.full(List<Label> labels, Token keyword, Expression expression, Toke n colon, List<Statement> statements) : super.full(labels, keyword, colon, statem ents) { 11231 SwitchCase.full(List<Label> labels, Token keyword, Expression expression, Toke n colon, List<Statement> statements) : super.full(labels, keyword, colon, statem ents) {
10724 this._expression = becomeParentOf(expression); 11232 this._expression = becomeParentOf(expression);
10725 } 11233 }
10726 11234
10727 /** 11235 /**
10728 * Initialize a newly created switch case. 11236 * Initialize a newly created switch case.
10729 * 11237 *
10730 * @param labels the labels associated with the switch member 11238 * @param labels the labels associated with the switch member
10731 * @param keyword the token representing the 'case' or 'default' keyword 11239 * @param keyword the token representing the 'case' or 'default' keyword
10732 * @param expression the expression controlling whether the statements will be executed 11240 * @param expression the expression controlling whether the statements will be executed
10733 * @param colon the colon separating the keyword or the expression from the st atements 11241 * @param colon the colon separating the keyword or the expression from the st atements
10734 * @param statements the statements that will be executed if this switch membe r is selected 11242 * @param statements the statements that will be executed if this switch membe r is selected
10735 */ 11243 */
10736 SwitchCase({List<Label> labels, Token keyword, Expression expression, Token co lon, List<Statement> statements}) : this.full(labels, keyword, expression, colon , statements); 11244 SwitchCase({List<Label> labels, Token keyword, Expression expression, Token co lon, List<Statement> statements}) : this.full(labels, keyword, expression, colon , statements);
11245
10737 accept(ASTVisitor visitor) => visitor.visitSwitchCase(this); 11246 accept(ASTVisitor visitor) => visitor.visitSwitchCase(this);
10738 11247
10739 /** 11248 /**
10740 * Return the expression controlling whether the statements will be executed. 11249 * Return the expression controlling whether the statements will be executed.
10741 * 11250 *
10742 * @return the expression controlling whether the statements will be executed 11251 * @return the expression controlling whether the statements will be executed
10743 */ 11252 */
10744 Expression get expression => _expression; 11253 Expression get expression => _expression;
10745 11254
10746 /** 11255 /**
10747 * Set the expression controlling whether the statements will be executed to t he given expression. 11256 * Set the expression controlling whether the statements will be executed to t he given expression.
10748 * 11257 *
10749 * @param expression the expression controlling whether the statements will be executed 11258 * @param expression the expression controlling whether the statements will be executed
10750 */ 11259 */
10751 void set expression(Expression expression) { 11260 void set expression(Expression expression) {
10752 this._expression = becomeParentOf(expression); 11261 this._expression = becomeParentOf(expression);
10753 } 11262 }
11263
10754 void visitChildren(ASTVisitor visitor) { 11264 void visitChildren(ASTVisitor visitor) {
10755 labels.accept(visitor); 11265 labels.accept(visitor);
10756 safelyVisitChild(_expression, visitor); 11266 safelyVisitChild(_expression, visitor);
10757 statements.accept(visitor); 11267 statements.accept(visitor);
10758 } 11268 }
10759 } 11269 }
11270
10760 /** 11271 /**
10761 * Instances of the class `SwitchDefault` represent the default case in a switch statement. 11272 * Instances of the class `SwitchDefault` represent the default case in a switch statement.
10762 * 11273 *
10763 * <pre> 11274 * <pre>
10764 * switchDefault ::= 11275 * switchDefault ::=
10765 * [SimpleIdentifier]* 'default' ':' [Statement]* 11276 * [SimpleIdentifier]* 'default' ':' [Statement]*
10766 * </pre> 11277 * </pre>
10767 * 11278 *
10768 * @coverage dart.engine.ast 11279 * @coverage dart.engine.ast
10769 */ 11280 */
10770 class SwitchDefault extends SwitchMember { 11281 class SwitchDefault extends SwitchMember {
10771
10772 /** 11282 /**
10773 * Initialize a newly created switch default. 11283 * Initialize a newly created switch default.
10774 * 11284 *
10775 * @param labels the labels associated with the switch member 11285 * @param labels the labels associated with the switch member
10776 * @param keyword the token representing the 'case' or 'default' keyword 11286 * @param keyword the token representing the 'case' or 'default' keyword
10777 * @param colon the colon separating the keyword or the expression from the st atements 11287 * @param colon the colon separating the keyword or the expression from the st atements
10778 * @param statements the statements that will be executed if this switch membe r is selected 11288 * @param statements the statements that will be executed if this switch membe r is selected
10779 */ 11289 */
10780 SwitchDefault.full(List<Label> labels, Token keyword, Token colon, List<Statem ent> statements) : super.full(labels, keyword, colon, statements); 11290 SwitchDefault.full(List<Label> labels, Token keyword, Token colon, List<Statem ent> statements) : super.full(labels, keyword, colon, statements);
10781 11291
10782 /** 11292 /**
10783 * Initialize a newly created switch default. 11293 * Initialize a newly created switch default.
10784 * 11294 *
10785 * @param labels the labels associated with the switch member 11295 * @param labels the labels associated with the switch member
10786 * @param keyword the token representing the 'case' or 'default' keyword 11296 * @param keyword the token representing the 'case' or 'default' keyword
10787 * @param colon the colon separating the keyword or the expression from the st atements 11297 * @param colon the colon separating the keyword or the expression from the st atements
10788 * @param statements the statements that will be executed if this switch membe r is selected 11298 * @param statements the statements that will be executed if this switch membe r is selected
10789 */ 11299 */
10790 SwitchDefault({List<Label> labels, Token keyword, Token colon, List<Statement> statements}) : this.full(labels, keyword, colon, statements); 11300 SwitchDefault({List<Label> labels, Token keyword, Token colon, List<Statement> statements}) : this.full(labels, keyword, colon, statements);
11301
10791 accept(ASTVisitor visitor) => visitor.visitSwitchDefault(this); 11302 accept(ASTVisitor visitor) => visitor.visitSwitchDefault(this);
11303
10792 void visitChildren(ASTVisitor visitor) { 11304 void visitChildren(ASTVisitor visitor) {
10793 labels.accept(visitor); 11305 labels.accept(visitor);
10794 statements.accept(visitor); 11306 statements.accept(visitor);
10795 } 11307 }
10796 } 11308 }
11309
10797 /** 11310 /**
10798 * The abstract class `SwitchMember` defines the behavior common to objects repr esenting 11311 * The abstract class `SwitchMember` defines the behavior common to objects repr esenting
10799 * elements within a switch statement. 11312 * elements within a switch statement.
10800 * 11313 *
10801 * <pre> 11314 * <pre>
10802 * switchMember ::= 11315 * switchMember ::=
10803 * switchCase 11316 * switchCase
10804 * | switchDefault 11317 * | switchDefault
10805 * </pre> 11318 * </pre>
10806 * 11319 *
10807 * @coverage dart.engine.ast 11320 * @coverage dart.engine.ast
10808 */ 11321 */
10809 abstract class SwitchMember extends ASTNode { 11322 abstract class SwitchMember extends ASTNode {
10810
10811 /** 11323 /**
10812 * The labels associated with the switch member. 11324 * The labels associated with the switch member.
10813 */ 11325 */
10814 NodeList<Label> labels; 11326 NodeList<Label> labels;
10815 11327
10816 /** 11328 /**
10817 * The token representing the 'case' or 'default' keyword. 11329 * The token representing the 'case' or 'default' keyword.
10818 */ 11330 */
10819 Token keyword; 11331 Token keyword;
10820 11332
(...skipping 26 matching lines...) Expand all
10847 11359
10848 /** 11360 /**
10849 * Initialize a newly created switch member. 11361 * Initialize a newly created switch member.
10850 * 11362 *
10851 * @param labels the labels associated with the switch member 11363 * @param labels the labels associated with the switch member
10852 * @param keyword the token representing the 'case' or 'default' keyword 11364 * @param keyword the token representing the 'case' or 'default' keyword
10853 * @param colon the colon separating the keyword or the expression from the st atements 11365 * @param colon the colon separating the keyword or the expression from the st atements
10854 * @param statements the statements that will be executed if this switch membe r is selected 11366 * @param statements the statements that will be executed if this switch membe r is selected
10855 */ 11367 */
10856 SwitchMember({List<Label> labels, Token keyword, Token colon, List<Statement> statements}) : this.full(labels, keyword, colon, statements); 11368 SwitchMember({List<Label> labels, Token keyword, Token colon, List<Statement> statements}) : this.full(labels, keyword, colon, statements);
11369
10857 Token get beginToken { 11370 Token get beginToken {
10858 if (!labels.isEmpty) { 11371 if (!labels.isEmpty) {
10859 return labels.beginToken; 11372 return labels.beginToken;
10860 } 11373 }
10861 return keyword; 11374 return keyword;
10862 } 11375 }
11376
10863 Token get endToken { 11377 Token get endToken {
10864 if (!statements.isEmpty) { 11378 if (!statements.isEmpty) {
10865 return statements.endToken; 11379 return statements.endToken;
10866 } 11380 }
10867 return colon; 11381 return colon;
10868 } 11382 }
10869 } 11383 }
11384
10870 /** 11385 /**
10871 * Instances of the class `SwitchStatement` represent a switch statement. 11386 * Instances of the class `SwitchStatement` represent a switch statement.
10872 * 11387 *
10873 * <pre> 11388 * <pre>
10874 * switchStatement ::= 11389 * switchStatement ::=
10875 * 'switch' '(' [Expression] ')' '{' [SwitchCase]* [SwitchDefault]? '}' 11390 * 'switch' '(' [Expression] ')' '{' [SwitchCase]* [SwitchDefault]? '}'
10876 * </pre> 11391 * </pre>
10877 * 11392 *
10878 * @coverage dart.engine.ast 11393 * @coverage dart.engine.ast
10879 */ 11394 */
10880 class SwitchStatement extends Statement { 11395 class SwitchStatement extends Statement {
10881
10882 /** 11396 /**
10883 * The token representing the 'switch' keyword. 11397 * The token representing the 'switch' keyword.
10884 */ 11398 */
10885 Token keyword; 11399 Token keyword;
10886 11400
10887 /** 11401 /**
10888 * The left parenthesis. 11402 * The left parenthesis.
10889 */ 11403 */
10890 Token leftParenthesis; 11404 Token leftParenthesis;
10891 11405
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
10941 * 11455 *
10942 * @param keyword the token representing the 'switch' keyword 11456 * @param keyword the token representing the 'switch' keyword
10943 * @param leftParenthesis the left parenthesis 11457 * @param leftParenthesis the left parenthesis
10944 * @param expression the expression used to determine which of the switch memb ers will be selected 11458 * @param expression the expression used to determine which of the switch memb ers will be selected
10945 * @param rightParenthesis the right parenthesis 11459 * @param rightParenthesis the right parenthesis
10946 * @param leftBracket the left curly bracket 11460 * @param leftBracket the left curly bracket
10947 * @param members the switch members that can be selected by the expression 11461 * @param members the switch members that can be selected by the expression
10948 * @param rightBracket the right curly bracket 11462 * @param rightBracket the right curly bracket
10949 */ 11463 */
10950 SwitchStatement({Token keyword, Token leftParenthesis, Expression expression, Token rightParenthesis, Token leftBracket, List<SwitchMember> members, Token rig htBracket}) : this.full(keyword, leftParenthesis, expression, rightParenthesis, leftBracket, members, rightBracket); 11464 SwitchStatement({Token keyword, Token leftParenthesis, Expression expression, Token rightParenthesis, Token leftBracket, List<SwitchMember> members, Token rig htBracket}) : this.full(keyword, leftParenthesis, expression, rightParenthesis, leftBracket, members, rightBracket);
11465
10951 accept(ASTVisitor visitor) => visitor.visitSwitchStatement(this); 11466 accept(ASTVisitor visitor) => visitor.visitSwitchStatement(this);
11467
10952 Token get beginToken => keyword; 11468 Token get beginToken => keyword;
11469
10953 Token get endToken => rightBracket; 11470 Token get endToken => rightBracket;
10954 11471
10955 /** 11472 /**
10956 * Return the expression used to determine which of the switch members will be selected. 11473 * Return the expression used to determine which of the switch members will be selected.
10957 * 11474 *
10958 * @return the expression used to determine which of the switch members will b e selected 11475 * @return the expression used to determine which of the switch members will b e selected
10959 */ 11476 */
10960 Expression get expression => _expression; 11477 Expression get expression => _expression;
10961 11478
10962 /** 11479 /**
10963 * Set the expression used to determine which of the switch members will be se lected to the given 11480 * Set the expression used to determine which of the switch members will be se lected to the given
10964 * expression. 11481 * expression.
10965 * 11482 *
10966 * @param expression the expression used to determine which of the switch memb ers will be selected 11483 * @param expression the expression used to determine which of the switch memb ers will be selected
10967 */ 11484 */
10968 void set expression(Expression expression) { 11485 void set expression(Expression expression) {
10969 this._expression = becomeParentOf(expression); 11486 this._expression = becomeParentOf(expression);
10970 } 11487 }
11488
10971 void visitChildren(ASTVisitor visitor) { 11489 void visitChildren(ASTVisitor visitor) {
10972 safelyVisitChild(_expression, visitor); 11490 safelyVisitChild(_expression, visitor);
10973 members.accept(visitor); 11491 members.accept(visitor);
10974 } 11492 }
10975 } 11493 }
11494
10976 /** 11495 /**
10977 * Instances of the class `SymbolLiteral` represent a symbol literal expression. 11496 * Instances of the class `SymbolLiteral` represent a symbol literal expression.
10978 * 11497 *
10979 * <pre> 11498 * <pre>
10980 * symbolLiteral ::= 11499 * symbolLiteral ::=
10981 * '#' (operator | (identifier ('.' identifier)*)) 11500 * '#' (operator | (identifier ('.' identifier)*))
10982 * </pre> 11501 * </pre>
10983 * 11502 *
10984 * @coverage dart.engine.ast 11503 * @coverage dart.engine.ast
10985 */ 11504 */
10986 class SymbolLiteral extends Literal { 11505 class SymbolLiteral extends Literal {
10987
10988 /** 11506 /**
10989 * The token introducing the literal. 11507 * The token introducing the literal.
10990 */ 11508 */
10991 Token poundSign; 11509 Token poundSign;
10992 11510
10993 /** 11511 /**
10994 * The components of the literal. 11512 * The components of the literal.
10995 */ 11513 */
10996 List<Token> components; 11514 List<Token> components;
10997 11515
10998 /** 11516 /**
10999 * Initialize a newly created symbol literal. 11517 * Initialize a newly created symbol literal.
11000 * 11518 *
11001 * @param poundSign the token introducing the literal 11519 * @param poundSign the token introducing the literal
11002 * @param components the components of the literal 11520 * @param components the components of the literal
11003 */ 11521 */
11004 SymbolLiteral.full(Token poundSign, List<Token> components) { 11522 SymbolLiteral.full(Token poundSign, List<Token> components) {
11005 this.poundSign = poundSign; 11523 this.poundSign = poundSign;
11006 this.components = components; 11524 this.components = components;
11007 } 11525 }
11008 11526
11009 /** 11527 /**
11010 * Initialize a newly created symbol literal. 11528 * Initialize a newly created symbol literal.
11011 * 11529 *
11012 * @param poundSign the token introducing the literal 11530 * @param poundSign the token introducing the literal
11013 * @param components the components of the literal 11531 * @param components the components of the literal
11014 */ 11532 */
11015 SymbolLiteral({Token poundSign, List<Token> components}) : this.full(poundSign , components); 11533 SymbolLiteral({Token poundSign, List<Token> components}) : this.full(poundSign , components);
11534
11016 accept(ASTVisitor visitor) => visitor.visitSymbolLiteral(this); 11535 accept(ASTVisitor visitor) => visitor.visitSymbolLiteral(this);
11536
11017 Token get beginToken => poundSign; 11537 Token get beginToken => poundSign;
11538
11018 Token get endToken => components[components.length - 1]; 11539 Token get endToken => components[components.length - 1];
11540
11019 void visitChildren(ASTVisitor visitor) { 11541 void visitChildren(ASTVisitor visitor) {
11020 } 11542 }
11021 } 11543 }
11544
11022 /** 11545 /**
11023 * Instances of the class `ThisExpression` represent a this expression. 11546 * Instances of the class `ThisExpression` represent a this expression.
11024 * 11547 *
11025 * <pre> 11548 * <pre>
11026 * thisExpression ::= 11549 * thisExpression ::=
11027 * 'this' 11550 * 'this'
11028 * </pre> 11551 * </pre>
11029 * 11552 *
11030 * @coverage dart.engine.ast 11553 * @coverage dart.engine.ast
11031 */ 11554 */
11032 class ThisExpression extends Expression { 11555 class ThisExpression extends Expression {
11033
11034 /** 11556 /**
11035 * The token representing the keyword. 11557 * The token representing the keyword.
11036 */ 11558 */
11037 Token keyword; 11559 Token keyword;
11038 11560
11039 /** 11561 /**
11040 * Initialize a newly created this expression. 11562 * Initialize a newly created this expression.
11041 * 11563 *
11042 * @param keyword the token representing the keyword 11564 * @param keyword the token representing the keyword
11043 */ 11565 */
11044 ThisExpression.full(Token keyword) { 11566 ThisExpression.full(Token keyword) {
11045 this.keyword = keyword; 11567 this.keyword = keyword;
11046 } 11568 }
11047 11569
11048 /** 11570 /**
11049 * Initialize a newly created this expression. 11571 * Initialize a newly created this expression.
11050 * 11572 *
11051 * @param keyword the token representing the keyword 11573 * @param keyword the token representing the keyword
11052 */ 11574 */
11053 ThisExpression({Token keyword}) : this.full(keyword); 11575 ThisExpression({Token keyword}) : this.full(keyword);
11576
11054 accept(ASTVisitor visitor) => visitor.visitThisExpression(this); 11577 accept(ASTVisitor visitor) => visitor.visitThisExpression(this);
11578
11055 Token get beginToken => keyword; 11579 Token get beginToken => keyword;
11580
11056 Token get endToken => keyword; 11581 Token get endToken => keyword;
11582
11057 void visitChildren(ASTVisitor visitor) { 11583 void visitChildren(ASTVisitor visitor) {
11058 } 11584 }
11059 } 11585 }
11586
11060 /** 11587 /**
11061 * Instances of the class `ThrowExpression` represent a throw expression. 11588 * Instances of the class `ThrowExpression` represent a throw expression.
11062 * 11589 *
11063 * <pre> 11590 * <pre>
11064 * throwExpression ::= 11591 * throwExpression ::=
11065 * 'throw' [Expression] 11592 * 'throw' [Expression]
11066 * </pre> 11593 * </pre>
11067 * 11594 *
11068 * @coverage dart.engine.ast 11595 * @coverage dart.engine.ast
11069 */ 11596 */
11070 class ThrowExpression extends Expression { 11597 class ThrowExpression extends Expression {
11071
11072 /** 11598 /**
11073 * The token representing the 'throw' keyword. 11599 * The token representing the 'throw' keyword.
11074 */ 11600 */
11075 Token keyword; 11601 Token keyword;
11076 11602
11077 /** 11603 /**
11078 * The expression computing the exception to be thrown. 11604 * The expression computing the exception to be thrown.
11079 */ 11605 */
11080 Expression _expression; 11606 Expression _expression;
11081 11607
11082 /** 11608 /**
11083 * Initialize a newly created throw expression. 11609 * Initialize a newly created throw expression.
11084 * 11610 *
11085 * @param keyword the token representing the 'throw' keyword 11611 * @param keyword the token representing the 'throw' keyword
11086 * @param expression the expression computing the exception to be thrown 11612 * @param expression the expression computing the exception to be thrown
11087 */ 11613 */
11088 ThrowExpression.full(Token keyword, Expression expression) { 11614 ThrowExpression.full(Token keyword, Expression expression) {
11089 this.keyword = keyword; 11615 this.keyword = keyword;
11090 this._expression = becomeParentOf(expression); 11616 this._expression = becomeParentOf(expression);
11091 } 11617 }
11092 11618
11093 /** 11619 /**
11094 * Initialize a newly created throw expression. 11620 * Initialize a newly created throw expression.
11095 * 11621 *
11096 * @param keyword the token representing the 'throw' keyword 11622 * @param keyword the token representing the 'throw' keyword
11097 * @param expression the expression computing the exception to be thrown 11623 * @param expression the expression computing the exception to be thrown
11098 */ 11624 */
11099 ThrowExpression({Token keyword, Expression expression}) : this.full(keyword, e xpression); 11625 ThrowExpression({Token keyword, Expression expression}) : this.full(keyword, e xpression);
11626
11100 accept(ASTVisitor visitor) => visitor.visitThrowExpression(this); 11627 accept(ASTVisitor visitor) => visitor.visitThrowExpression(this);
11628
11101 Token get beginToken => keyword; 11629 Token get beginToken => keyword;
11630
11102 Token get endToken { 11631 Token get endToken {
11103 if (_expression != null) { 11632 if (_expression != null) {
11104 return _expression.endToken; 11633 return _expression.endToken;
11105 } 11634 }
11106 return keyword; 11635 return keyword;
11107 } 11636 }
11108 11637
11109 /** 11638 /**
11110 * Return the expression computing the exception to be thrown. 11639 * Return the expression computing the exception to be thrown.
11111 * 11640 *
11112 * @return the expression computing the exception to be thrown 11641 * @return the expression computing the exception to be thrown
11113 */ 11642 */
11114 Expression get expression => _expression; 11643 Expression get expression => _expression;
11115 11644
11116 /** 11645 /**
11117 * Set the expression computing the exception to be thrown to the given expres sion. 11646 * Set the expression computing the exception to be thrown to the given expres sion.
11118 * 11647 *
11119 * @param expression the expression computing the exception to be thrown 11648 * @param expression the expression computing the exception to be thrown
11120 */ 11649 */
11121 void set expression(Expression expression) { 11650 void set expression(Expression expression) {
11122 this._expression = becomeParentOf(expression); 11651 this._expression = becomeParentOf(expression);
11123 } 11652 }
11653
11124 void visitChildren(ASTVisitor visitor) { 11654 void visitChildren(ASTVisitor visitor) {
11125 safelyVisitChild(_expression, visitor); 11655 safelyVisitChild(_expression, visitor);
11126 } 11656 }
11127 } 11657 }
11658
11128 /** 11659 /**
11129 * Instances of the class `TopLevelVariableDeclaration` represent the declaratio n of one or 11660 * Instances of the class `TopLevelVariableDeclaration` represent the declaratio n of one or
11130 * more top-level variables of the same type. 11661 * more top-level variables of the same type.
11131 * 11662 *
11132 * <pre> 11663 * <pre>
11133 * topLevelVariableDeclaration ::= 11664 * topLevelVariableDeclaration ::=
11134 * ('final' | 'const') type? staticFinalDeclarationList ';' 11665 * ('final' | 'const') type? staticFinalDeclarationList ';'
11135 * | variableDeclaration ';' 11666 * | variableDeclaration ';'
11136 * </pre> 11667 * </pre>
11137 * 11668 *
11138 * @coverage dart.engine.ast 11669 * @coverage dart.engine.ast
11139 */ 11670 */
11140 class TopLevelVariableDeclaration extends CompilationUnitMember { 11671 class TopLevelVariableDeclaration extends CompilationUnitMember {
11141
11142 /** 11672 /**
11143 * The top-level variables being declared. 11673 * The top-level variables being declared.
11144 */ 11674 */
11145 VariableDeclarationList _variableList; 11675 VariableDeclarationList _variableList;
11146 11676
11147 /** 11677 /**
11148 * The semicolon terminating the declaration. 11678 * The semicolon terminating the declaration.
11149 */ 11679 */
11150 Token semicolon; 11680 Token semicolon;
11151 11681
(...skipping 12 matching lines...) Expand all
11164 11694
11165 /** 11695 /**
11166 * Initialize a newly created top-level variable declaration. 11696 * Initialize a newly created top-level variable declaration.
11167 * 11697 *
11168 * @param comment the documentation comment associated with this variable 11698 * @param comment the documentation comment associated with this variable
11169 * @param metadata the annotations associated with this variable 11699 * @param metadata the annotations associated with this variable
11170 * @param variableList the top-level variables being declared 11700 * @param variableList the top-level variables being declared
11171 * @param semicolon the semicolon terminating the declaration 11701 * @param semicolon the semicolon terminating the declaration
11172 */ 11702 */
11173 TopLevelVariableDeclaration({Comment comment, List<Annotation> metadata, Varia bleDeclarationList variableList, Token semicolon}) : this.full(comment, metadata , variableList, semicolon); 11703 TopLevelVariableDeclaration({Comment comment, List<Annotation> metadata, Varia bleDeclarationList variableList, Token semicolon}) : this.full(comment, metadata , variableList, semicolon);
11704
11174 accept(ASTVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this); 11705 accept(ASTVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this);
11706
11175 Element get element => null; 11707 Element get element => null;
11708
11176 Token get endToken => semicolon; 11709 Token get endToken => semicolon;
11177 11710
11178 /** 11711 /**
11179 * Return the top-level variables being declared. 11712 * Return the top-level variables being declared.
11180 * 11713 *
11181 * @return the top-level variables being declared 11714 * @return the top-level variables being declared
11182 */ 11715 */
11183 VariableDeclarationList get variables => _variableList; 11716 VariableDeclarationList get variables => _variableList;
11184 11717
11185 /** 11718 /**
11186 * Set the top-level variables being declared to the given list of variables. 11719 * Set the top-level variables being declared to the given list of variables.
11187 * 11720 *
11188 * @param variableList the top-level variables being declared 11721 * @param variableList the top-level variables being declared
11189 */ 11722 */
11190 void set variables(VariableDeclarationList variableList) { 11723 void set variables(VariableDeclarationList variableList) {
11191 variableList = becomeParentOf(variableList); 11724 variableList = becomeParentOf(variableList);
11192 } 11725 }
11726
11193 void visitChildren(ASTVisitor visitor) { 11727 void visitChildren(ASTVisitor visitor) {
11194 super.visitChildren(visitor); 11728 super.visitChildren(visitor);
11195 safelyVisitChild(_variableList, visitor); 11729 safelyVisitChild(_variableList, visitor);
11196 } 11730 }
11731
11197 Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken; 11732 Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken;
11198 } 11733 }
11734
11199 /** 11735 /**
11200 * Instances of the class `TryStatement` represent a try statement. 11736 * Instances of the class `TryStatement` represent a try statement.
11201 * 11737 *
11202 * <pre> 11738 * <pre>
11203 * tryStatement ::= 11739 * tryStatement ::=
11204 * 'try' [Block] ([CatchClause]+ finallyClause? | finallyClause) 11740 * 'try' [Block] ([CatchClause]+ finallyClause? | finallyClause)
11205 * 11741 *
11206 * finallyClause ::= 11742 * finallyClause ::=
11207 * 'finally' [Block] 11743 * 'finally' [Block]
11208 * </pre> 11744 * </pre>
11209 * 11745 *
11210 * @coverage dart.engine.ast 11746 * @coverage dart.engine.ast
11211 */ 11747 */
11212 class TryStatement extends Statement { 11748 class TryStatement extends Statement {
11213
11214 /** 11749 /**
11215 * The token representing the 'try' keyword. 11750 * The token representing the 'try' keyword.
11216 */ 11751 */
11217 Token tryKeyword; 11752 Token tryKeyword;
11218 11753
11219 /** 11754 /**
11220 * The body of the statement. 11755 * The body of the statement.
11221 */ 11756 */
11222 Block _body; 11757 Block _body;
11223 11758
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
11259 /** 11794 /**
11260 * Initialize a newly created try statement. 11795 * Initialize a newly created try statement.
11261 * 11796 *
11262 * @param tryKeyword the token representing the 'try' keyword 11797 * @param tryKeyword the token representing the 'try' keyword
11263 * @param body the body of the statement 11798 * @param body the body of the statement
11264 * @param catchClauses the catch clauses contained in the try statement 11799 * @param catchClauses the catch clauses contained in the try statement
11265 * @param finallyKeyword the token representing the 'finally' keyword 11800 * @param finallyKeyword the token representing the 'finally' keyword
11266 * @param finallyBlock the finally block contained in the try statement 11801 * @param finallyBlock the finally block contained in the try statement
11267 */ 11802 */
11268 TryStatement({Token tryKeyword, Block body, List<CatchClause> catchClauses, To ken finallyKeyword, Block finallyBlock}) : this.full(tryKeyword, body, catchClau ses, finallyKeyword, finallyBlock); 11803 TryStatement({Token tryKeyword, Block body, List<CatchClause> catchClauses, To ken finallyKeyword, Block finallyBlock}) : this.full(tryKeyword, body, catchClau ses, finallyKeyword, finallyBlock);
11804
11269 accept(ASTVisitor visitor) => visitor.visitTryStatement(this); 11805 accept(ASTVisitor visitor) => visitor.visitTryStatement(this);
11806
11270 Token get beginToken => tryKeyword; 11807 Token get beginToken => tryKeyword;
11271 11808
11272 /** 11809 /**
11273 * Return the body of the statement. 11810 * Return the body of the statement.
11274 * 11811 *
11275 * @return the body of the statement 11812 * @return the body of the statement
11276 */ 11813 */
11277 Block get body => _body; 11814 Block get body => _body;
11815
11278 Token get endToken { 11816 Token get endToken {
11279 if (_finallyBlock != null) { 11817 if (_finallyBlock != null) {
11280 return _finallyBlock.endToken; 11818 return _finallyBlock.endToken;
11281 } else if (finallyKeyword != null) { 11819 } else if (finallyKeyword != null) {
11282 return finallyKeyword; 11820 return finallyKeyword;
11283 } else if (!catchClauses.isEmpty) { 11821 } else if (!catchClauses.isEmpty) {
11284 return catchClauses.endToken; 11822 return catchClauses.endToken;
11285 } 11823 }
11286 return _body.endToken; 11824 return _body.endToken;
11287 } 11825 }
(...skipping 16 matching lines...) Expand all
11304 } 11842 }
11305 11843
11306 /** 11844 /**
11307 * Set the finally block contained in the try statement to the given block. 11845 * Set the finally block contained in the try statement to the given block.
11308 * 11846 *
11309 * @param block the finally block contained in the try statement 11847 * @param block the finally block contained in the try statement
11310 */ 11848 */
11311 void set finallyBlock(Block block) { 11849 void set finallyBlock(Block block) {
11312 _finallyBlock = becomeParentOf(block); 11850 _finallyBlock = becomeParentOf(block);
11313 } 11851 }
11852
11314 void visitChildren(ASTVisitor visitor) { 11853 void visitChildren(ASTVisitor visitor) {
11315 safelyVisitChild(_body, visitor); 11854 safelyVisitChild(_body, visitor);
11316 catchClauses.accept(visitor); 11855 catchClauses.accept(visitor);
11317 safelyVisitChild(_finallyBlock, visitor); 11856 safelyVisitChild(_finallyBlock, visitor);
11318 } 11857 }
11319 } 11858 }
11859
11320 /** 11860 /**
11321 * The abstract class `TypeAlias` defines the behavior common to declarations of type aliases. 11861 * The abstract class `TypeAlias` defines the behavior common to declarations of type aliases.
11322 * 11862 *
11323 * <pre> 11863 * <pre>
11324 * typeAlias ::= 11864 * typeAlias ::=
11325 * 'typedef' typeAliasBody 11865 * 'typedef' typeAliasBody
11326 * 11866 *
11327 * typeAliasBody ::= 11867 * typeAliasBody ::=
11328 * classTypeAlias 11868 * classTypeAlias
11329 * | functionTypeAlias 11869 * | functionTypeAlias
11330 * </pre> 11870 * </pre>
11331 * 11871 *
11332 * @coverage dart.engine.ast 11872 * @coverage dart.engine.ast
11333 */ 11873 */
11334 abstract class TypeAlias extends CompilationUnitMember { 11874 abstract class TypeAlias extends CompilationUnitMember {
11335
11336 /** 11875 /**
11337 * The token representing the 'typedef' keyword. 11876 * The token representing the 'typedef' keyword.
11338 */ 11877 */
11339 Token keyword; 11878 Token keyword;
11340 11879
11341 /** 11880 /**
11342 * The semicolon terminating the declaration. 11881 * The semicolon terminating the declaration.
11343 */ 11882 */
11344 Token semicolon; 11883 Token semicolon;
11345 11884
(...skipping 12 matching lines...) Expand all
11358 11897
11359 /** 11898 /**
11360 * Initialize a newly created type alias. 11899 * Initialize a newly created type alias.
11361 * 11900 *
11362 * @param comment the documentation comment associated with this type alias 11901 * @param comment the documentation comment associated with this type alias
11363 * @param metadata the annotations associated with this type alias 11902 * @param metadata the annotations associated with this type alias
11364 * @param keyword the token representing the 'typedef' keyword 11903 * @param keyword the token representing the 'typedef' keyword
11365 * @param semicolon the semicolon terminating the declaration 11904 * @param semicolon the semicolon terminating the declaration
11366 */ 11905 */
11367 TypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Token se micolon}) : this.full(comment, metadata, keyword, semicolon); 11906 TypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Token se micolon}) : this.full(comment, metadata, keyword, semicolon);
11907
11368 Token get endToken => semicolon; 11908 Token get endToken => semicolon;
11909
11369 Token get firstTokenAfterCommentAndMetadata => keyword; 11910 Token get firstTokenAfterCommentAndMetadata => keyword;
11370 } 11911 }
11912
11371 /** 11913 /**
11372 * Instances of the class `TypeArgumentList` represent a list of type arguments. 11914 * Instances of the class `TypeArgumentList` represent a list of type arguments.
11373 * 11915 *
11374 * <pre> 11916 * <pre>
11375 * typeArguments ::= 11917 * typeArguments ::=
11376 * '<' typeName (',' typeName)* '>' 11918 * '<' typeName (',' typeName)* '>'
11377 * </pre> 11919 * </pre>
11378 * 11920 *
11379 * @coverage dart.engine.ast 11921 * @coverage dart.engine.ast
11380 */ 11922 */
11381 class TypeArgumentList extends ASTNode { 11923 class TypeArgumentList extends ASTNode {
11382
11383 /** 11924 /**
11384 * The left bracket. 11925 * The left bracket.
11385 */ 11926 */
11386 Token leftBracket; 11927 Token leftBracket;
11387 11928
11388 /** 11929 /**
11389 * The type arguments associated with the type. 11930 * The type arguments associated with the type.
11390 */ 11931 */
11391 NodeList<TypeName> arguments; 11932 NodeList<TypeName> arguments;
11392 11933
(...skipping 17 matching lines...) Expand all
11410 } 11951 }
11411 11952
11412 /** 11953 /**
11413 * Initialize a newly created list of type arguments. 11954 * Initialize a newly created list of type arguments.
11414 * 11955 *
11415 * @param leftBracket the left bracket 11956 * @param leftBracket the left bracket
11416 * @param arguments the type arguments associated with the type 11957 * @param arguments the type arguments associated with the type
11417 * @param rightBracket the right bracket 11958 * @param rightBracket the right bracket
11418 */ 11959 */
11419 TypeArgumentList({Token leftBracket, List<TypeName> arguments, Token rightBrac ket}) : this.full(leftBracket, arguments, rightBracket); 11960 TypeArgumentList({Token leftBracket, List<TypeName> arguments, Token rightBrac ket}) : this.full(leftBracket, arguments, rightBracket);
11961
11420 accept(ASTVisitor visitor) => visitor.visitTypeArgumentList(this); 11962 accept(ASTVisitor visitor) => visitor.visitTypeArgumentList(this);
11963
11421 Token get beginToken => leftBracket; 11964 Token get beginToken => leftBracket;
11965
11422 Token get endToken => rightBracket; 11966 Token get endToken => rightBracket;
11967
11423 void visitChildren(ASTVisitor visitor) { 11968 void visitChildren(ASTVisitor visitor) {
11424 arguments.accept(visitor); 11969 arguments.accept(visitor);
11425 } 11970 }
11426 } 11971 }
11972
11427 /** 11973 /**
11428 * Instances of the class `TypeName` represent the name of a type, which can opt ionally 11974 * Instances of the class `TypeName` represent the name of a type, which can opt ionally
11429 * include type arguments. 11975 * include type arguments.
11430 * 11976 *
11431 * <pre> 11977 * <pre>
11432 * typeName ::= 11978 * typeName ::=
11433 * [Identifier] typeArguments? 11979 * [Identifier] typeArguments?
11434 * </pre> 11980 * </pre>
11435 * 11981 *
11436 * @coverage dart.engine.ast 11982 * @coverage dart.engine.ast
11437 */ 11983 */
11438 class TypeName extends ASTNode { 11984 class TypeName extends ASTNode {
11439
11440 /** 11985 /**
11441 * The name of the type. 11986 * The name of the type.
11442 */ 11987 */
11443 Identifier _name; 11988 Identifier _name;
11444 11989
11445 /** 11990 /**
11446 * The type arguments associated with the type, or `null` if there are no type arguments. 11991 * The type arguments associated with the type, or `null` if there are no type arguments.
11447 */ 11992 */
11448 TypeArgumentList _typeArguments; 11993 TypeArgumentList _typeArguments;
11449 11994
(...skipping 15 matching lines...) Expand all
11465 } 12010 }
11466 12011
11467 /** 12012 /**
11468 * Initialize a newly created type name. 12013 * Initialize a newly created type name.
11469 * 12014 *
11470 * @param name the name of the type 12015 * @param name the name of the type
11471 * @param typeArguments the type arguments associated with the type, or `null` if there are 12016 * @param typeArguments the type arguments associated with the type, or `null` if there are
11472 * no type arguments 12017 * no type arguments
11473 */ 12018 */
11474 TypeName({Identifier name, TypeArgumentList typeArguments}) : this.full(name, typeArguments); 12019 TypeName({Identifier name, TypeArgumentList typeArguments}) : this.full(name, typeArguments);
12020
11475 accept(ASTVisitor visitor) => visitor.visitTypeName(this); 12021 accept(ASTVisitor visitor) => visitor.visitTypeName(this);
12022
11476 Token get beginToken => _name.beginToken; 12023 Token get beginToken => _name.beginToken;
12024
11477 Token get endToken { 12025 Token get endToken {
11478 if (_typeArguments != null) { 12026 if (_typeArguments != null) {
11479 return _typeArguments.endToken; 12027 return _typeArguments.endToken;
11480 } 12028 }
11481 return _name.endToken; 12029 return _name.endToken;
11482 } 12030 }
11483 12031
11484 /** 12032 /**
11485 * Return the name of the type. 12033 * Return the name of the type.
11486 * 12034 *
11487 * @return the name of the type 12035 * @return the name of the type
11488 */ 12036 */
11489 Identifier get name => _name; 12037 Identifier get name => _name;
11490 12038
11491 /** 12039 /**
11492 * Return the type arguments associated with the type, or `null` if there are no type 12040 * Return the type arguments associated with the type, or `null` if there are no type
11493 * arguments. 12041 * arguments.
11494 * 12042 *
11495 * @return the type arguments associated with the type 12043 * @return the type arguments associated with the type
11496 */ 12044 */
11497 TypeArgumentList get typeArguments => _typeArguments; 12045 TypeArgumentList get typeArguments => _typeArguments;
12046
11498 bool get isSynthetic => _name.isSynthetic && _typeArguments == null; 12047 bool get isSynthetic => _name.isSynthetic && _typeArguments == null;
11499 12048
11500 /** 12049 /**
11501 * Set the name of the type to the given identifier. 12050 * Set the name of the type to the given identifier.
11502 * 12051 *
11503 * @param identifier the name of the type 12052 * @param identifier the name of the type
11504 */ 12053 */
11505 void set name(Identifier identifier) { 12054 void set name(Identifier identifier) {
11506 _name = becomeParentOf(identifier); 12055 _name = becomeParentOf(identifier);
11507 } 12056 }
11508 12057
11509 /** 12058 /**
11510 * Set the type arguments associated with the type to the given type arguments . 12059 * Set the type arguments associated with the type to the given type arguments .
11511 * 12060 *
11512 * @param typeArguments the type arguments associated with the type 12061 * @param typeArguments the type arguments associated with the type
11513 */ 12062 */
11514 void set typeArguments(TypeArgumentList typeArguments) { 12063 void set typeArguments(TypeArgumentList typeArguments) {
11515 this._typeArguments = becomeParentOf(typeArguments); 12064 this._typeArguments = becomeParentOf(typeArguments);
11516 } 12065 }
12066
11517 void visitChildren(ASTVisitor visitor) { 12067 void visitChildren(ASTVisitor visitor) {
11518 safelyVisitChild(_name, visitor); 12068 safelyVisitChild(_name, visitor);
11519 safelyVisitChild(_typeArguments, visitor); 12069 safelyVisitChild(_typeArguments, visitor);
11520 } 12070 }
11521 } 12071 }
12072
11522 /** 12073 /**
11523 * Instances of the class `TypeParameter` represent a type parameter. 12074 * Instances of the class `TypeParameter` represent a type parameter.
11524 * 12075 *
11525 * <pre> 12076 * <pre>
11526 * typeParameter ::= 12077 * typeParameter ::=
11527 * [SimpleIdentifier] ('extends' [TypeName])? 12078 * [SimpleIdentifier] ('extends' [TypeName])?
11528 * </pre> 12079 * </pre>
11529 * 12080 *
11530 * @coverage dart.engine.ast 12081 * @coverage dart.engine.ast
11531 */ 12082 */
11532 class TypeParameter extends Declaration { 12083 class TypeParameter extends Declaration {
11533
11534 /** 12084 /**
11535 * The name of the type parameter. 12085 * The name of the type parameter.
11536 */ 12086 */
11537 SimpleIdentifier _name; 12087 SimpleIdentifier _name;
11538 12088
11539 /** 12089 /**
11540 * The token representing the 'extends' keyword, or `null` if there was no exp licit upper 12090 * The token representing the 'extends' keyword, or `null` if there was no exp licit upper
11541 * bound. 12091 * bound.
11542 */ 12092 */
11543 Token keyword; 12093 Token keyword;
(...skipping 22 matching lines...) Expand all
11566 /** 12116 /**
11567 * Initialize a newly created type parameter. 12117 * Initialize a newly created type parameter.
11568 * 12118 *
11569 * @param comment the documentation comment associated with the type parameter 12119 * @param comment the documentation comment associated with the type parameter
11570 * @param metadata the annotations associated with the type parameter 12120 * @param metadata the annotations associated with the type parameter
11571 * @param name the name of the type parameter 12121 * @param name the name of the type parameter
11572 * @param keyword the token representing the 'extends' keyword 12122 * @param keyword the token representing the 'extends' keyword
11573 * @param bound the name of the upper bound for legal arguments 12123 * @param bound the name of the upper bound for legal arguments
11574 */ 12124 */
11575 TypeParameter({Comment comment, List<Annotation> metadata, SimpleIdentifier na me, Token keyword, TypeName bound}) : this.full(comment, metadata, name, keyword , bound); 12125 TypeParameter({Comment comment, List<Annotation> metadata, SimpleIdentifier na me, Token keyword, TypeName bound}) : this.full(comment, metadata, name, keyword , bound);
12126
11576 accept(ASTVisitor visitor) => visitor.visitTypeParameter(this); 12127 accept(ASTVisitor visitor) => visitor.visitTypeParameter(this);
11577 12128
11578 /** 12129 /**
11579 * Return the name of the upper bound for legal arguments, or `null` if there was no 12130 * Return the name of the upper bound for legal arguments, or `null` if there was no
11580 * explicit upper bound. 12131 * explicit upper bound.
11581 * 12132 *
11582 * @return the name of the upper bound for legal arguments 12133 * @return the name of the upper bound for legal arguments
11583 */ 12134 */
11584 TypeName get bound => _bound; 12135 TypeName get bound => _bound;
12136
11585 TypeParameterElement get element => _name != null ? (_name.staticElement as Ty peParameterElement) : null; 12137 TypeParameterElement get element => _name != null ? (_name.staticElement as Ty peParameterElement) : null;
12138
11586 Token get endToken { 12139 Token get endToken {
11587 if (_bound == null) { 12140 if (_bound == null) {
11588 return _name.endToken; 12141 return _name.endToken;
11589 } 12142 }
11590 return _bound.endToken; 12143 return _bound.endToken;
11591 } 12144 }
11592 12145
11593 /** 12146 /**
11594 * Return the name of the type parameter. 12147 * Return the name of the type parameter.
11595 * 12148 *
(...skipping 11 matching lines...) Expand all
11607 } 12160 }
11608 12161
11609 /** 12162 /**
11610 * Set the name of the type parameter to the given identifier. 12163 * Set the name of the type parameter to the given identifier.
11611 * 12164 *
11612 * @param identifier the name of the type parameter 12165 * @param identifier the name of the type parameter
11613 */ 12166 */
11614 void set name(SimpleIdentifier identifier) { 12167 void set name(SimpleIdentifier identifier) {
11615 _name = becomeParentOf(identifier); 12168 _name = becomeParentOf(identifier);
11616 } 12169 }
12170
11617 void visitChildren(ASTVisitor visitor) { 12171 void visitChildren(ASTVisitor visitor) {
11618 super.visitChildren(visitor); 12172 super.visitChildren(visitor);
11619 safelyVisitChild(_name, visitor); 12173 safelyVisitChild(_name, visitor);
11620 safelyVisitChild(_bound, visitor); 12174 safelyVisitChild(_bound, visitor);
11621 } 12175 }
12176
11622 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; 12177 Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
11623 } 12178 }
12179
11624 /** 12180 /**
11625 * Instances of the class `TypeParameterList` represent type parameters within a declaration. 12181 * Instances of the class `TypeParameterList` represent type parameters within a declaration.
11626 * 12182 *
11627 * <pre> 12183 * <pre>
11628 * typeParameterList ::= 12184 * typeParameterList ::=
11629 * '<' [TypeParameter] (',' [TypeParameter])* '>' 12185 * '<' [TypeParameter] (',' [TypeParameter])* '>'
11630 * </pre> 12186 * </pre>
11631 * 12187 *
11632 * @coverage dart.engine.ast 12188 * @coverage dart.engine.ast
11633 */ 12189 */
11634 class TypeParameterList extends ASTNode { 12190 class TypeParameterList extends ASTNode {
11635
11636 /** 12191 /**
11637 * The left angle bracket. 12192 * The left angle bracket.
11638 */ 12193 */
11639 Token leftBracket; 12194 Token leftBracket;
11640 12195
11641 /** 12196 /**
11642 * The type parameters in the list. 12197 * The type parameters in the list.
11643 */ 12198 */
11644 NodeList<TypeParameter> typeParameters; 12199 NodeList<TypeParameter> typeParameters;
11645 12200
(...skipping 17 matching lines...) Expand all
11663 } 12218 }
11664 12219
11665 /** 12220 /**
11666 * Initialize a newly created list of type parameters. 12221 * Initialize a newly created list of type parameters.
11667 * 12222 *
11668 * @param leftBracket the left angle bracket 12223 * @param leftBracket the left angle bracket
11669 * @param typeParameters the type parameters in the list 12224 * @param typeParameters the type parameters in the list
11670 * @param rightBracket the right angle bracket 12225 * @param rightBracket the right angle bracket
11671 */ 12226 */
11672 TypeParameterList({Token leftBracket, List<TypeParameter> typeParameters, Toke n rightBracket}) : this.full(leftBracket, typeParameters, rightBracket); 12227 TypeParameterList({Token leftBracket, List<TypeParameter> typeParameters, Toke n rightBracket}) : this.full(leftBracket, typeParameters, rightBracket);
12228
11673 accept(ASTVisitor visitor) => visitor.visitTypeParameterList(this); 12229 accept(ASTVisitor visitor) => visitor.visitTypeParameterList(this);
12230
11674 Token get beginToken => leftBracket; 12231 Token get beginToken => leftBracket;
12232
11675 Token get endToken => rightBracket; 12233 Token get endToken => rightBracket;
12234
11676 void visitChildren(ASTVisitor visitor) { 12235 void visitChildren(ASTVisitor visitor) {
11677 typeParameters.accept(visitor); 12236 typeParameters.accept(visitor);
11678 } 12237 }
11679 } 12238 }
12239
11680 /** 12240 /**
11681 * The abstract class `TypedLiteral` defines the behavior common to literals tha t have a type 12241 * The abstract class `TypedLiteral` defines the behavior common to literals tha t have a type
11682 * associated with them. 12242 * associated with them.
11683 * 12243 *
11684 * <pre> 12244 * <pre>
11685 * listLiteral ::= 12245 * listLiteral ::=
11686 * [ListLiteral] 12246 * [ListLiteral]
11687 * | [MapLiteral] 12247 * | [MapLiteral]
11688 * </pre> 12248 * </pre>
11689 * 12249 *
11690 * @coverage dart.engine.ast 12250 * @coverage dart.engine.ast
11691 */ 12251 */
11692 abstract class TypedLiteral extends Literal { 12252 abstract class TypedLiteral extends Literal {
11693
11694 /** 12253 /**
11695 * The token representing the 'const' keyword, or `null` if the literal is not a constant. 12254 * The token representing the 'const' keyword, or `null` if the literal is not a constant.
11696 */ 12255 */
11697 Token constKeyword; 12256 Token constKeyword;
11698 12257
11699 /** 12258 /**
11700 * The type argument associated with this literal, or `null` if no type argume nts were 12259 * The type argument associated with this literal, or `null` if no type argume nts were
11701 * declared. 12260 * declared.
11702 */ 12261 */
11703 TypeArgumentList typeArguments; 12262 TypeArgumentList typeArguments;
(...skipping 11 matching lines...) Expand all
11715 } 12274 }
11716 12275
11717 /** 12276 /**
11718 * Initialize a newly created typed literal. 12277 * Initialize a newly created typed literal.
11719 * 12278 *
11720 * @param constKeyword the token representing the 'const' keyword 12279 * @param constKeyword the token representing the 'const' keyword
11721 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 12280 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
11722 * arguments were declared 12281 * arguments were declared
11723 */ 12282 */
11724 TypedLiteral({Token constKeyword, TypeArgumentList typeArguments}) : this.full (constKeyword, typeArguments); 12283 TypedLiteral({Token constKeyword, TypeArgumentList typeArguments}) : this.full (constKeyword, typeArguments);
12284
11725 void visitChildren(ASTVisitor visitor) { 12285 void visitChildren(ASTVisitor visitor) {
11726 safelyVisitChild(typeArguments, visitor); 12286 safelyVisitChild(typeArguments, visitor);
11727 } 12287 }
11728 } 12288 }
12289
11729 /** 12290 /**
11730 * The abstract class `UriBasedDirective` defines the behavior common to nodes t hat represent 12291 * The abstract class `UriBasedDirective` defines the behavior common to nodes t hat represent
11731 * a directive that references a URI. 12292 * a directive that references a URI.
11732 * 12293 *
11733 * <pre> 12294 * <pre>
11734 * uriBasedDirective ::= 12295 * uriBasedDirective ::=
11735 * [ExportDirective] 12296 * [ExportDirective]
11736 * | [ImportDirective] 12297 * | [ImportDirective]
11737 * | [PartDirective] 12298 * | [PartDirective]
11738 * </pre> 12299 * </pre>
11739 * 12300 *
11740 * @coverage dart.engine.ast 12301 * @coverage dart.engine.ast
11741 */ 12302 */
11742 abstract class UriBasedDirective extends Directive { 12303 abstract class UriBasedDirective extends Directive {
11743
11744 /** 12304 /**
11745 * The URI referenced by this directive. 12305 * The URI referenced by this directive.
11746 */ 12306 */
11747 StringLiteral _uri; 12307 StringLiteral _uri;
11748 12308
11749 /** 12309 /**
11750 * Initialize a newly create URI-based directive. 12310 * Initialize a newly create URI-based directive.
11751 * 12311 *
11752 * @param comment the documentation comment associated with this directive 12312 * @param comment the documentation comment associated with this directive
11753 * @param metadata the annotations associated with the directive 12313 * @param metadata the annotations associated with the directive
(...skipping 29 matching lines...) Expand all
11783 Element get uriElement; 12343 Element get uriElement;
11784 12344
11785 /** 12345 /**
11786 * Set the URI referenced by this directive to the given URI. 12346 * Set the URI referenced by this directive to the given URI.
11787 * 12347 *
11788 * @param uri the URI referenced by this directive 12348 * @param uri the URI referenced by this directive
11789 */ 12349 */
11790 void set uri(StringLiteral uri) { 12350 void set uri(StringLiteral uri) {
11791 this._uri = becomeParentOf(uri); 12351 this._uri = becomeParentOf(uri);
11792 } 12352 }
12353
11793 void visitChildren(ASTVisitor visitor) { 12354 void visitChildren(ASTVisitor visitor) {
11794 super.visitChildren(visitor); 12355 super.visitChildren(visitor);
11795 safelyVisitChild(_uri, visitor); 12356 safelyVisitChild(_uri, visitor);
11796 } 12357 }
11797 } 12358 }
12359
11798 /** 12360 /**
11799 * Instances of the class `VariableDeclaration` represent an identifier that has an initial 12361 * Instances of the class `VariableDeclaration` represent an identifier that has an initial
11800 * value associated with it. Instances of this class are always children of the class 12362 * value associated with it. Instances of this class are always children of the class
11801 * [VariableDeclarationList]. 12363 * [VariableDeclarationList].
11802 * 12364 *
11803 * <pre> 12365 * <pre>
11804 * variableDeclaration ::= 12366 * variableDeclaration ::=
11805 * [SimpleIdentifier] ('=' [Expression])? 12367 * [SimpleIdentifier] ('=' [Expression])?
11806 * </pre> 12368 * </pre>
11807 * 12369 *
11808 * @coverage dart.engine.ast 12370 * @coverage dart.engine.ast
11809 */ 12371 */
11810 class VariableDeclaration extends Declaration { 12372 class VariableDeclaration extends Declaration {
11811
11812 /** 12373 /**
11813 * The name of the variable being declared. 12374 * The name of the variable being declared.
11814 */ 12375 */
11815 SimpleIdentifier _name; 12376 SimpleIdentifier _name;
11816 12377
11817 /** 12378 /**
11818 * The equal sign separating the variable name from the initial value, or `nul l` if the 12379 * The equal sign separating the variable name from the initial value, or `nul l` if the
11819 * initial value was not specified. 12380 * initial value was not specified.
11820 */ 12381 */
11821 Token equals; 12382 Token equals;
(...skipping 22 matching lines...) Expand all
11844 /** 12405 /**
11845 * Initialize a newly created variable declaration. 12406 * Initialize a newly created variable declaration.
11846 * 12407 *
11847 * @param comment the documentation comment associated with this declaration 12408 * @param comment the documentation comment associated with this declaration
11848 * @param metadata the annotations associated with this member 12409 * @param metadata the annotations associated with this member
11849 * @param name the name of the variable being declared 12410 * @param name the name of the variable being declared
11850 * @param equals the equal sign separating the variable name from the initial value 12411 * @param equals the equal sign separating the variable name from the initial value
11851 * @param initializer the expression used to compute the initial value for the variable 12412 * @param initializer the expression used to compute the initial value for the variable
11852 */ 12413 */
11853 VariableDeclaration({Comment comment, List<Annotation> metadata, SimpleIdentif ier name, Token equals, Expression initializer}) : this.full(comment, metadata, name, equals, initializer); 12414 VariableDeclaration({Comment comment, List<Annotation> metadata, SimpleIdentif ier name, Token equals, Expression initializer}) : this.full(comment, metadata, name, equals, initializer);
12415
11854 accept(ASTVisitor visitor) => visitor.visitVariableDeclaration(this); 12416 accept(ASTVisitor visitor) => visitor.visitVariableDeclaration(this);
11855 12417
11856 /** 12418 /**
11857 * This overridden implementation of getDocumentationComment() looks in the gr andparent node for 12419 * This overridden implementation of getDocumentationComment() looks in the gr andparent node for
11858 * dartdoc comments if no documentation is specifically available on the node. 12420 * dartdoc comments if no documentation is specifically available on the node.
11859 */ 12421 */
11860 Comment get documentationComment { 12422 Comment get documentationComment {
11861 Comment comment = super.documentationComment; 12423 Comment comment = super.documentationComment;
11862 if (comment == null) { 12424 if (comment == null) {
11863 if (parent != null && parent.parent != null) { 12425 if (parent != null && parent.parent != null) {
11864 ASTNode node = parent.parent; 12426 ASTNode node = parent.parent;
11865 if (node is AnnotatedNode) { 12427 if (node is AnnotatedNode) {
11866 return ((node as AnnotatedNode)).documentationComment; 12428 return (node as AnnotatedNode).documentationComment;
11867 } 12429 }
11868 } 12430 }
11869 } 12431 }
11870 return comment; 12432 return comment;
11871 } 12433 }
12434
11872 VariableElement get element => _name != null ? (_name.staticElement as Variabl eElement) : null; 12435 VariableElement get element => _name != null ? (_name.staticElement as Variabl eElement) : null;
12436
11873 Token get endToken { 12437 Token get endToken {
11874 if (_initializer != null) { 12438 if (_initializer != null) {
11875 return _initializer.endToken; 12439 return _initializer.endToken;
11876 } 12440 }
11877 return _name.endToken; 12441 return _name.endToken;
11878 } 12442 }
11879 12443
11880 /** 12444 /**
11881 * Return the expression used to compute the initial value for the variable, o r `null` if 12445 * Return the expression used to compute the initial value for the variable, o r `null` if
11882 * the initial value was not specified. 12446 * the initial value was not specified.
11883 * 12447 *
11884 * @return the expression used to compute the initial value for the variable 12448 * @return the expression used to compute the initial value for the variable
11885 */ 12449 */
11886 Expression get initializer => _initializer; 12450 Expression get initializer => _initializer;
11887 12451
11888 /** 12452 /**
11889 * Return the name of the variable being declared. 12453 * Return the name of the variable being declared.
11890 * 12454 *
11891 * @return the name of the variable being declared 12455 * @return the name of the variable being declared
11892 */ 12456 */
11893 SimpleIdentifier get name => _name; 12457 SimpleIdentifier get name => _name;
11894 12458
11895 /** 12459 /**
11896 * Return `true` if this variable was declared with the 'const' modifier. 12460 * Return `true` if this variable was declared with the 'const' modifier.
11897 * 12461 *
11898 * @return `true` if this variable was declared with the 'const' modifier 12462 * @return `true` if this variable was declared with the 'const' modifier
11899 */ 12463 */
11900 bool get isConst { 12464 bool get isConst {
11901 ASTNode parent = this.parent; 12465 ASTNode parent = this.parent;
11902 return parent is VariableDeclarationList && ((parent as VariableDeclarationL ist)).isConst; 12466 return parent is VariableDeclarationList && (parent as VariableDeclarationLi st).isConst;
11903 } 12467 }
11904 12468
11905 /** 12469 /**
11906 * Return `true` if this variable was declared with the 'final' modifier. Vari ables that are 12470 * Return `true` if this variable was declared with the 'final' modifier. Vari ables that are
11907 * declared with the 'const' modifier will return `false` even though they are implicitly 12471 * declared with the 'const' modifier will return `false` even though they are implicitly
11908 * final. 12472 * final.
11909 * 12473 *
11910 * @return `true` if this variable was declared with the 'final' modifier 12474 * @return `true` if this variable was declared with the 'final' modifier
11911 */ 12475 */
11912 bool get isFinal { 12476 bool get isFinal {
11913 ASTNode parent = this.parent; 12477 ASTNode parent = this.parent;
11914 return parent is VariableDeclarationList && ((parent as VariableDeclarationL ist)).isFinal; 12478 return parent is VariableDeclarationList && (parent as VariableDeclarationLi st).isFinal;
11915 } 12479 }
11916 12480
11917 /** 12481 /**
11918 * Set the expression used to compute the initial value for the variable to th e given expression. 12482 * Set the expression used to compute the initial value for the variable to th e given expression.
11919 * 12483 *
11920 * @param initializer the expression used to compute the initial value for the variable 12484 * @param initializer the expression used to compute the initial value for the variable
11921 */ 12485 */
11922 void set initializer(Expression initializer) { 12486 void set initializer(Expression initializer) {
11923 this._initializer = becomeParentOf(initializer); 12487 this._initializer = becomeParentOf(initializer);
11924 } 12488 }
11925 12489
11926 /** 12490 /**
11927 * Set the name of the variable being declared to the given identifier. 12491 * Set the name of the variable being declared to the given identifier.
11928 * 12492 *
11929 * @param name the name of the variable being declared 12493 * @param name the name of the variable being declared
11930 */ 12494 */
11931 void set name(SimpleIdentifier name) { 12495 void set name(SimpleIdentifier name) {
11932 this._name = becomeParentOf(name); 12496 this._name = becomeParentOf(name);
11933 } 12497 }
12498
11934 void visitChildren(ASTVisitor visitor) { 12499 void visitChildren(ASTVisitor visitor) {
11935 super.visitChildren(visitor); 12500 super.visitChildren(visitor);
11936 safelyVisitChild(_name, visitor); 12501 safelyVisitChild(_name, visitor);
11937 safelyVisitChild(_initializer, visitor); 12502 safelyVisitChild(_initializer, visitor);
11938 } 12503 }
12504
11939 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; 12505 Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
11940 } 12506 }
12507
11941 /** 12508 /**
11942 * Instances of the class `VariableDeclarationList` represent the declaration of one or more 12509 * Instances of the class `VariableDeclarationList` represent the declaration of one or more
11943 * variables of the same type. 12510 * variables of the same type.
11944 * 12511 *
11945 * <pre> 12512 * <pre>
11946 * variableDeclarationList ::= 12513 * variableDeclarationList ::=
11947 * finalConstVarOrType [VariableDeclaration] (',' [VariableDeclaration])* 12514 * finalConstVarOrType [VariableDeclaration] (',' [VariableDeclaration])*
11948 * 12515 *
11949 * finalConstVarOrType ::= 12516 * finalConstVarOrType ::=
11950 * | 'final' [TypeName]? 12517 * | 'final' [TypeName]?
11951 * | 'const' [TypeName]? 12518 * | 'const' [TypeName]?
11952 * | 'var' 12519 * | 'var'
11953 * | [TypeName] 12520 * | [TypeName]
11954 * </pre> 12521 * </pre>
11955 * 12522 *
11956 * @coverage dart.engine.ast 12523 * @coverage dart.engine.ast
11957 */ 12524 */
11958 class VariableDeclarationList extends AnnotatedNode { 12525 class VariableDeclarationList extends AnnotatedNode {
11959
11960 /** 12526 /**
11961 * The token representing the 'final', 'const' or 'var' keyword, or `null` if no keyword was 12527 * The token representing the 'final', 'const' or 'var' keyword, or `null` if no keyword was
11962 * included. 12528 * included.
11963 */ 12529 */
11964 Token keyword; 12530 Token keyword;
11965 12531
11966 /** 12532 /**
11967 * The type of the variables being declared, or `null` if no type was provided . 12533 * The type of the variables being declared, or `null` if no type was provided .
11968 */ 12534 */
11969 TypeName _type; 12535 TypeName _type;
(...skipping 22 matching lines...) Expand all
11992 /** 12558 /**
11993 * Initialize a newly created variable declaration list. 12559 * Initialize a newly created variable declaration list.
11994 * 12560 *
11995 * @param comment the documentation comment associated with this declaration l ist 12561 * @param comment the documentation comment associated with this declaration l ist
11996 * @param metadata the annotations associated with this declaration list 12562 * @param metadata the annotations associated with this declaration list
11997 * @param keyword the token representing the 'final', 'const' or 'var' keyword 12563 * @param keyword the token representing the 'final', 'const' or 'var' keyword
11998 * @param type the type of the variables being declared 12564 * @param type the type of the variables being declared
11999 * @param variables a list containing the individual variables being declared 12565 * @param variables a list containing the individual variables being declared
12000 */ 12566 */
12001 VariableDeclarationList({Comment comment, List<Annotation> metadata, Token key word, TypeName type, List<VariableDeclaration> variables}) : this.full(comment, metadata, keyword, type, variables); 12567 VariableDeclarationList({Comment comment, List<Annotation> metadata, Token key word, TypeName type, List<VariableDeclaration> variables}) : this.full(comment, metadata, keyword, type, variables);
12568
12002 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this); 12569 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this);
12570
12003 Token get endToken => variables.endToken; 12571 Token get endToken => variables.endToken;
12004 12572
12005 /** 12573 /**
12006 * Return the type of the variables being declared, or `null` if no type was p rovided. 12574 * Return the type of the variables being declared, or `null` if no type was p rovided.
12007 * 12575 *
12008 * @return the type of the variables being declared 12576 * @return the type of the variables being declared
12009 */ 12577 */
12010 TypeName get type => _type; 12578 TypeName get type => _type;
12011 12579
12012 /** 12580 /**
12013 * Return `true` if the variables in this list were declared with the 'const' modifier. 12581 * Return `true` if the variables in this list were declared with the 'const' modifier.
12014 * 12582 *
12015 * @return `true` if the variables in this list were declared with the 'const' modifier 12583 * @return `true` if the variables in this list were declared with the 'const' modifier
12016 */ 12584 */
12017 bool get isConst => keyword is KeywordToken && identical(((keyword as KeywordT oken)).keyword, Keyword.CONST); 12585 bool get isConst => keyword is KeywordToken && identical((keyword as KeywordTo ken).keyword, Keyword.CONST);
12018 12586
12019 /** 12587 /**
12020 * Return `true` if the variables in this list were declared with the 'final' modifier. 12588 * Return `true` if the variables in this list were declared with the 'final' modifier.
12021 * Variables that are declared with the 'const' modifier will return `false` e ven though 12589 * Variables that are declared with the 'const' modifier will return `false` e ven though
12022 * they are implicitly final. 12590 * they are implicitly final.
12023 * 12591 *
12024 * @return `true` if the variables in this list were declared with the 'final' modifier 12592 * @return `true` if the variables in this list were declared with the 'final' modifier
12025 */ 12593 */
12026 bool get isFinal => keyword is KeywordToken && identical(((keyword as KeywordT oken)).keyword, Keyword.FINAL); 12594 bool get isFinal => keyword is KeywordToken && identical((keyword as KeywordTo ken).keyword, Keyword.FINAL);
12027 12595
12028 /** 12596 /**
12029 * Set the type of the variables being declared to the given type name. 12597 * Set the type of the variables being declared to the given type name.
12030 * 12598 *
12031 * @param typeName the type of the variables being declared 12599 * @param typeName the type of the variables being declared
12032 */ 12600 */
12033 void set type(TypeName typeName) { 12601 void set type(TypeName typeName) {
12034 _type = becomeParentOf(typeName); 12602 _type = becomeParentOf(typeName);
12035 } 12603 }
12604
12036 void visitChildren(ASTVisitor visitor) { 12605 void visitChildren(ASTVisitor visitor) {
12037 safelyVisitChild(_type, visitor); 12606 safelyVisitChild(_type, visitor);
12038 variables.accept(visitor); 12607 variables.accept(visitor);
12039 } 12608 }
12609
12040 Token get firstTokenAfterCommentAndMetadata { 12610 Token get firstTokenAfterCommentAndMetadata {
12041 if (keyword != null) { 12611 if (keyword != null) {
12042 return keyword; 12612 return keyword;
12043 } else if (_type != null) { 12613 } else if (_type != null) {
12044 return _type.beginToken; 12614 return _type.beginToken;
12045 } 12615 }
12046 return variables.beginToken; 12616 return variables.beginToken;
12047 } 12617 }
12048 } 12618 }
12619
12049 /** 12620 /**
12050 * Instances of the class `VariableDeclarationStatement` represent a list of var iables that 12621 * Instances of the class `VariableDeclarationStatement` represent a list of var iables that
12051 * are being declared in a context where a statement is required. 12622 * are being declared in a context where a statement is required.
12052 * 12623 *
12053 * <pre> 12624 * <pre>
12054 * variableDeclarationStatement ::= 12625 * variableDeclarationStatement ::=
12055 * [VariableDeclarationList] ';' 12626 * [VariableDeclarationList] ';'
12056 * </pre> 12627 * </pre>
12057 * 12628 *
12058 * @coverage dart.engine.ast 12629 * @coverage dart.engine.ast
12059 */ 12630 */
12060 class VariableDeclarationStatement extends Statement { 12631 class VariableDeclarationStatement extends Statement {
12061
12062 /** 12632 /**
12063 * The variables being declared. 12633 * The variables being declared.
12064 */ 12634 */
12065 VariableDeclarationList _variableList; 12635 VariableDeclarationList _variableList;
12066 12636
12067 /** 12637 /**
12068 * The semicolon terminating the statement. 12638 * The semicolon terminating the statement.
12069 */ 12639 */
12070 Token semicolon; 12640 Token semicolon;
12071 12641
12072 /** 12642 /**
12073 * Initialize a newly created variable declaration statement. 12643 * Initialize a newly created variable declaration statement.
12074 * 12644 *
12075 * @param variableList the fields being declared 12645 * @param variableList the fields being declared
12076 * @param semicolon the semicolon terminating the statement 12646 * @param semicolon the semicolon terminating the statement
12077 */ 12647 */
12078 VariableDeclarationStatement.full(VariableDeclarationList variableList, Token semicolon) { 12648 VariableDeclarationStatement.full(VariableDeclarationList variableList, Token semicolon) {
12079 this._variableList = becomeParentOf(variableList); 12649 this._variableList = becomeParentOf(variableList);
12080 this.semicolon = semicolon; 12650 this.semicolon = semicolon;
12081 } 12651 }
12082 12652
12083 /** 12653 /**
12084 * Initialize a newly created variable declaration statement. 12654 * Initialize a newly created variable declaration statement.
12085 * 12655 *
12086 * @param variableList the fields being declared 12656 * @param variableList the fields being declared
12087 * @param semicolon the semicolon terminating the statement 12657 * @param semicolon the semicolon terminating the statement
12088 */ 12658 */
12089 VariableDeclarationStatement({VariableDeclarationList variableList, Token semi colon}) : this.full(variableList, semicolon); 12659 VariableDeclarationStatement({VariableDeclarationList variableList, Token semi colon}) : this.full(variableList, semicolon);
12660
12090 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationStatement(this); 12661 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationStatement(this);
12662
12091 Token get beginToken => _variableList.beginToken; 12663 Token get beginToken => _variableList.beginToken;
12664
12092 Token get endToken => semicolon; 12665 Token get endToken => semicolon;
12093 12666
12094 /** 12667 /**
12095 * Return the variables being declared. 12668 * Return the variables being declared.
12096 * 12669 *
12097 * @return the variables being declared 12670 * @return the variables being declared
12098 */ 12671 */
12099 VariableDeclarationList get variables => _variableList; 12672 VariableDeclarationList get variables => _variableList;
12100 12673
12101 /** 12674 /**
12102 * Set the variables being declared to the given list of variables. 12675 * Set the variables being declared to the given list of variables.
12103 * 12676 *
12104 * @param variableList the variables being declared 12677 * @param variableList the variables being declared
12105 */ 12678 */
12106 void set variables(VariableDeclarationList variableList) { 12679 void set variables(VariableDeclarationList variableList) {
12107 this._variableList = becomeParentOf(variableList); 12680 this._variableList = becomeParentOf(variableList);
12108 } 12681 }
12682
12109 void visitChildren(ASTVisitor visitor) { 12683 void visitChildren(ASTVisitor visitor) {
12110 safelyVisitChild(_variableList, visitor); 12684 safelyVisitChild(_variableList, visitor);
12111 } 12685 }
12112 } 12686 }
12687
12113 /** 12688 /**
12114 * Instances of the class `WhileStatement` represent a while statement. 12689 * Instances of the class `WhileStatement` represent a while statement.
12115 * 12690 *
12116 * <pre> 12691 * <pre>
12117 * whileStatement ::= 12692 * whileStatement ::=
12118 * 'while' '(' [Expression] ')' [Statement] 12693 * 'while' '(' [Expression] ')' [Statement]
12119 * </pre> 12694 * </pre>
12120 * 12695 *
12121 * @coverage dart.engine.ast 12696 * @coverage dart.engine.ast
12122 */ 12697 */
12123 class WhileStatement extends Statement { 12698 class WhileStatement extends Statement {
12124
12125 /** 12699 /**
12126 * The token representing the 'while' keyword. 12700 * The token representing the 'while' keyword.
12127 */ 12701 */
12128 Token keyword; 12702 Token keyword;
12129 12703
12130 /** 12704 /**
12131 * The left parenthesis. 12705 * The left parenthesis.
12132 */ 12706 */
12133 Token leftParenthesis; 12707 Token leftParenthesis;
12134 12708
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
12167 /** 12741 /**
12168 * Initialize a newly created while statement. 12742 * Initialize a newly created while statement.
12169 * 12743 *
12170 * @param keyword the token representing the 'while' keyword 12744 * @param keyword the token representing the 'while' keyword
12171 * @param leftParenthesis the left parenthesis 12745 * @param leftParenthesis the left parenthesis
12172 * @param condition the expression used to determine whether to execute the bo dy of the loop 12746 * @param condition the expression used to determine whether to execute the bo dy of the loop
12173 * @param rightParenthesis the right parenthesis 12747 * @param rightParenthesis the right parenthesis
12174 * @param body the body of the loop 12748 * @param body the body of the loop
12175 */ 12749 */
12176 WhileStatement({Token keyword, Token leftParenthesis, Expression condition, To ken rightParenthesis, Statement body}) : this.full(keyword, leftParenthesis, con dition, rightParenthesis, body); 12750 WhileStatement({Token keyword, Token leftParenthesis, Expression condition, To ken rightParenthesis, Statement body}) : this.full(keyword, leftParenthesis, con dition, rightParenthesis, body);
12751
12177 accept(ASTVisitor visitor) => visitor.visitWhileStatement(this); 12752 accept(ASTVisitor visitor) => visitor.visitWhileStatement(this);
12753
12178 Token get beginToken => keyword; 12754 Token get beginToken => keyword;
12179 12755
12180 /** 12756 /**
12181 * Return the body of the loop. 12757 * Return the body of the loop.
12182 * 12758 *
12183 * @return the body of the loop 12759 * @return the body of the loop
12184 */ 12760 */
12185 Statement get body => _body; 12761 Statement get body => _body;
12186 12762
12187 /** 12763 /**
12188 * Return the expression used to determine whether to execute the body of the loop. 12764 * Return the expression used to determine whether to execute the body of the loop.
12189 * 12765 *
12190 * @return the expression used to determine whether to execute the body of the loop 12766 * @return the expression used to determine whether to execute the body of the loop
12191 */ 12767 */
12192 Expression get condition => _condition; 12768 Expression get condition => _condition;
12769
12193 Token get endToken => _body.endToken; 12770 Token get endToken => _body.endToken;
12194 12771
12195 /** 12772 /**
12196 * Set the body of the loop to the given statement. 12773 * Set the body of the loop to the given statement.
12197 * 12774 *
12198 * @param statement the body of the loop 12775 * @param statement the body of the loop
12199 */ 12776 */
12200 void set body(Statement statement) { 12777 void set body(Statement statement) {
12201 _body = becomeParentOf(statement); 12778 _body = becomeParentOf(statement);
12202 } 12779 }
12203 12780
12204 /** 12781 /**
12205 * Set the expression used to determine whether to execute the body of the loo p to the given 12782 * Set the expression used to determine whether to execute the body of the loo p to the given
12206 * expression. 12783 * expression.
12207 * 12784 *
12208 * @param expression the expression used to determine whether to execute the b ody of the loop 12785 * @param expression the expression used to determine whether to execute the b ody of the loop
12209 */ 12786 */
12210 void set condition(Expression expression) { 12787 void set condition(Expression expression) {
12211 _condition = becomeParentOf(expression); 12788 _condition = becomeParentOf(expression);
12212 } 12789 }
12790
12213 void visitChildren(ASTVisitor visitor) { 12791 void visitChildren(ASTVisitor visitor) {
12214 safelyVisitChild(_condition, visitor); 12792 safelyVisitChild(_condition, visitor);
12215 safelyVisitChild(_body, visitor); 12793 safelyVisitChild(_body, visitor);
12216 } 12794 }
12217 } 12795 }
12796
12218 /** 12797 /**
12219 * Instances of the class `WithClause` represent the with clause in a class decl aration. 12798 * Instances of the class `WithClause` represent the with clause in a class decl aration.
12220 * 12799 *
12221 * <pre> 12800 * <pre>
12222 * withClause ::= 12801 * withClause ::=
12223 * 'with' [TypeName] (',' [TypeName])* 12802 * 'with' [TypeName] (',' [TypeName])*
12224 * </pre> 12803 * </pre>
12225 * 12804 *
12226 * @coverage dart.engine.ast 12805 * @coverage dart.engine.ast
12227 */ 12806 */
12228 class WithClause extends ASTNode { 12807 class WithClause extends ASTNode {
12229
12230 /** 12808 /**
12231 * The token representing the 'with' keyword. 12809 * The token representing the 'with' keyword.
12232 */ 12810 */
12233 Token withKeyword; 12811 Token withKeyword;
12234 12812
12235 /** 12813 /**
12236 * The names of the mixins that were specified. 12814 * The names of the mixins that were specified.
12237 */ 12815 */
12238 NodeList<TypeName> mixinTypes; 12816 NodeList<TypeName> mixinTypes;
12239 12817
12240 /** 12818 /**
12241 * Initialize a newly created with clause. 12819 * Initialize a newly created with clause.
12242 * 12820 *
12243 * @param withKeyword the token representing the 'with' keyword 12821 * @param withKeyword the token representing the 'with' keyword
12244 * @param mixinTypes the names of the mixins that were specified 12822 * @param mixinTypes the names of the mixins that were specified
12245 */ 12823 */
12246 WithClause.full(Token withKeyword, List<TypeName> mixinTypes) { 12824 WithClause.full(Token withKeyword, List<TypeName> mixinTypes) {
12247 this.mixinTypes = new NodeList<TypeName>(this); 12825 this.mixinTypes = new NodeList<TypeName>(this);
12248 this.withKeyword = withKeyword; 12826 this.withKeyword = withKeyword;
12249 this.mixinTypes.addAll(mixinTypes); 12827 this.mixinTypes.addAll(mixinTypes);
12250 } 12828 }
12251 12829
12252 /** 12830 /**
12253 * Initialize a newly created with clause. 12831 * Initialize a newly created with clause.
12254 * 12832 *
12255 * @param withKeyword the token representing the 'with' keyword 12833 * @param withKeyword the token representing the 'with' keyword
12256 * @param mixinTypes the names of the mixins that were specified 12834 * @param mixinTypes the names of the mixins that were specified
12257 */ 12835 */
12258 WithClause({Token withKeyword, List<TypeName> mixinTypes}) : this.full(withKey word, mixinTypes); 12836 WithClause({Token withKeyword, List<TypeName> mixinTypes}) : this.full(withKey word, mixinTypes);
12837
12259 accept(ASTVisitor visitor) => visitor.visitWithClause(this); 12838 accept(ASTVisitor visitor) => visitor.visitWithClause(this);
12839
12260 Token get beginToken => withKeyword; 12840 Token get beginToken => withKeyword;
12841
12261 Token get endToken => mixinTypes.endToken; 12842 Token get endToken => mixinTypes.endToken;
12262 12843
12263 /** 12844 /**
12264 * Set the token representing the 'with' keyword to the given token. 12845 * Set the token representing the 'with' keyword to the given token.
12265 * 12846 *
12266 * @param withKeyword the token representing the 'with' keyword 12847 * @param withKeyword the token representing the 'with' keyword
12267 */ 12848 */
12268 void set mixinKeyword(Token withKeyword) { 12849 void set mixinKeyword(Token withKeyword) {
12269 this.withKeyword = withKeyword; 12850 this.withKeyword = withKeyword;
12270 } 12851 }
12852
12271 void visitChildren(ASTVisitor visitor) { 12853 void visitChildren(ASTVisitor visitor) {
12272 mixinTypes.accept(visitor); 12854 mixinTypes.accept(visitor);
12273 } 12855 }
12274 } 12856 }
12857
12275 /** 12858 /**
12276 * Instances of the class `BreadthFirstVisitor` implement an AST visitor that wi ll recursively 12859 * Instances of the class `BreadthFirstVisitor` implement an AST visitor that wi ll recursively
12277 * visit all of the nodes in an AST structure, similar to [GeneralizingASTVisito r]. This 12860 * visit all of the nodes in an AST structure, similar to [GeneralizingASTVisito r]. This
12278 * visitor uses a breadth-first ordering rather than the depth-first ordering of 12861 * visitor uses a breadth-first ordering rather than the depth-first ordering of
12279 * [GeneralizingASTVisitor]. 12862 * [GeneralizingASTVisitor].
12280 * 12863 *
12281 * Subclasses that override a visit method must either invoke the overridden vis it method or 12864 * Subclasses that override a visit method must either invoke the overridden vis it method or
12282 * explicitly invoke the more general visit method. Failure to do so will cause the visit methods 12865 * explicitly invoke the more general visit method. Failure to do so will cause the visit methods
12283 * for superclasses of the node to not be invoked and will cause the children of the visited node to 12866 * for superclasses of the node to not be invoked and will cause the children of the visited node to
12284 * not be visited. 12867 * not be visited.
12285 * 12868 *
12286 * In addition, subclasses should <b>not</b> explicitly visit the children of a node, but should 12869 * In addition, subclasses should <b>not</b> explicitly visit the children of a node, but should
12287 * ensure that the method [visitNode] is used to visit the children (either dire ctly 12870 * ensure that the method [visitNode] is used to visit the children (either dire ctly
12288 * or indirectly). Failure to do will break the order in which nodes are visited . 12871 * or indirectly). Failure to do will break the order in which nodes are visited .
12289 * 12872 *
12290 * @coverage dart.engine.ast 12873 * @coverage dart.engine.ast
12291 */ 12874 */
12292 class BreadthFirstVisitor<R> extends GeneralizingASTVisitor<R> { 12875 class BreadthFirstVisitor<R> extends GeneralizingASTVisitor<R> {
12293
12294 /** 12876 /**
12295 * A queue holding the nodes that have not yet been visited in the order in wh ich they ought to be 12877 * A queue holding the nodes that have not yet been visited in the order in wh ich they ought to be
12296 * visited. 12878 * visited.
12297 */ 12879 */
12298 Queue<ASTNode> _queue = new Queue<ASTNode>(); 12880 Queue<ASTNode> _queue = new Queue<ASTNode>();
12299 12881
12300 /** 12882 /**
12301 * A visitor, used to visit the children of the current node, that will add th e nodes it visits to 12883 * A visitor, used to visit the children of the current node, that will add th e nodes it visits to
12302 * the [queue]. 12884 * the [queue].
12303 */ 12885 */
12304 GeneralizingASTVisitor<Object> _childVisitor; 12886 GeneralizingASTVisitor<Object> _childVisitor;
12305 12887
12306 /** 12888 /**
12307 * Visit all nodes in the tree starting at the given `root` node, in breadth-f irst order. 12889 * Visit all nodes in the tree starting at the given `root` node, in breadth-f irst order.
12308 * 12890 *
12309 * @param root the root of the AST structure to be visited 12891 * @param root the root of the AST structure to be visited
12310 */ 12892 */
12311 void visitAllNodes(ASTNode root) { 12893 void visitAllNodes(ASTNode root) {
12312 _queue.add(root); 12894 _queue.add(root);
12313 while (!_queue.isEmpty) { 12895 while (!_queue.isEmpty) {
12314 ASTNode next = _queue.removeFirst(); 12896 ASTNode next = _queue.removeFirst();
12315 next.accept(this); 12897 next.accept(this);
12316 } 12898 }
12317 } 12899 }
12900
12318 R visitNode(ASTNode node) { 12901 R visitNode(ASTNode node) {
12319 node.visitChildren(_childVisitor); 12902 node.visitChildren(_childVisitor);
12320 return null; 12903 return null;
12321 } 12904 }
12905
12322 BreadthFirstVisitor() { 12906 BreadthFirstVisitor() {
12323 this._childVisitor = new GeneralizingASTVisitor_2(this); 12907 this._childVisitor = new GeneralizingASTVisitor_2(this);
12324 } 12908 }
12325 } 12909 }
12910
12326 class GeneralizingASTVisitor_2 extends GeneralizingASTVisitor<Object> { 12911 class GeneralizingASTVisitor_2 extends GeneralizingASTVisitor<Object> {
12327 final BreadthFirstVisitor BreadthFirstVisitor_this; 12912 final BreadthFirstVisitor BreadthFirstVisitor_this;
12913
12328 GeneralizingASTVisitor_2(this.BreadthFirstVisitor_this) : super(); 12914 GeneralizingASTVisitor_2(this.BreadthFirstVisitor_this) : super();
12915
12329 Object visitNode(ASTNode node) { 12916 Object visitNode(ASTNode node) {
12330 BreadthFirstVisitor_this._queue.add(node); 12917 BreadthFirstVisitor_this._queue.add(node);
12331 return null; 12918 return null;
12332 } 12919 }
12333 } 12920 }
12921
12334 /** 12922 /**
12335 * Instances of the class `ConstantEvaluator` evaluate constant expressions to p roduce their 12923 * Instances of the class `ConstantEvaluator` evaluate constant expressions to p roduce their
12336 * compile-time value. According to the Dart Language Specification: <blockquote > A constant 12924 * compile-time value. According to the Dart Language Specification: <blockquote > A constant
12337 * expression is one of the following: 12925 * expression is one of the following:
12338 * 12926 *
12339 * * A literal number. 12927 * * A literal number.
12340 * * A literal boolean. 12928 * * A literal boolean.
12341 * * A literal string where any interpolated expression is a compile-time consta nt that evaluates 12929 * * A literal string where any interpolated expression is a compile-time consta nt that evaluates
12342 * to a numeric, string or boolean value or to `null`. 12930 * to a numeric, string or boolean value or to `null`.
12343 * * `null`. 12931 * * `null`.
(...skipping 22 matching lines...) Expand all
12366 * instances of the classes `Boolean`, `BigInteger`, `Double`, `String`, and 12954 * instances of the classes `Boolean`, `BigInteger`, `Double`, `String`, and
12367 * `DartObject`. 12955 * `DartObject`.
12368 * 12956 *
12369 * In addition, this class defines several values that can be returned to indica te various 12957 * In addition, this class defines several values that can be returned to indica te various
12370 * conditions encountered during evaluation. These are documented with the stati c field that define 12958 * conditions encountered during evaluation. These are documented with the stati c field that define
12371 * those values. 12959 * those values.
12372 * 12960 *
12373 * @coverage dart.engine.ast 12961 * @coverage dart.engine.ast
12374 */ 12962 */
12375 class ConstantEvaluator extends GeneralizingASTVisitor<Object> { 12963 class ConstantEvaluator extends GeneralizingASTVisitor<Object> {
12376
12377 /** 12964 /**
12378 * The value returned for expressions (or non-expression nodes) that are not c ompile-time constant 12965 * The value returned for expressions (or non-expression nodes) that are not c ompile-time constant
12379 * expressions. 12966 * expressions.
12380 */ 12967 */
12381 static Object NOT_A_CONSTANT = new Object(); 12968 static Object NOT_A_CONSTANT = new Object();
12969
12382 Object visitAdjacentStrings(AdjacentStrings node) { 12970 Object visitAdjacentStrings(AdjacentStrings node) {
12383 JavaStringBuilder builder = new JavaStringBuilder(); 12971 JavaStringBuilder builder = new JavaStringBuilder();
12384 for (StringLiteral string in node.strings) { 12972 for (StringLiteral string in node.strings) {
12385 Object value = string.accept(this); 12973 Object value = string.accept(this);
12386 if (identical(value, NOT_A_CONSTANT)) { 12974 if (identical(value, NOT_A_CONSTANT)) {
12387 return value; 12975 return value;
12388 } 12976 }
12389 builder.append(value); 12977 builder.append(value);
12390 } 12978 }
12391 return builder.toString(); 12979 return builder.toString();
12392 } 12980 }
12981
12393 Object visitBinaryExpression(BinaryExpression node) { 12982 Object visitBinaryExpression(BinaryExpression node) {
12394 Object leftOperand = node.leftOperand.accept(this); 12983 Object leftOperand = node.leftOperand.accept(this);
12395 if (identical(leftOperand, NOT_A_CONSTANT)) { 12984 if (identical(leftOperand, NOT_A_CONSTANT)) {
12396 return leftOperand; 12985 return leftOperand;
12397 } 12986 }
12398 Object rightOperand = node.rightOperand.accept(this); 12987 Object rightOperand = node.rightOperand.accept(this);
12399 if (identical(rightOperand, NOT_A_CONSTANT)) { 12988 if (identical(rightOperand, NOT_A_CONSTANT)) {
12400 return rightOperand; 12989 return rightOperand;
12401 } 12990 }
12402 while (true) { 12991 while (true) {
12403 if (node.operator.type == TokenType.AMPERSAND) { 12992 if (node.operator.type == TokenType.AMPERSAND) {
12404 if (leftOperand is int && rightOperand is int) { 12993 if (leftOperand is int && rightOperand is int) {
12405 return ((leftOperand as int)) & (rightOperand as int); 12994 return (leftOperand as int) & (rightOperand as int);
12406 } 12995 }
12407 } else if (node.operator.type == TokenType.AMPERSAND_AMPERSAND) { 12996 } else if (node.operator.type == TokenType.AMPERSAND_AMPERSAND) {
12408 if (leftOperand is bool && rightOperand is bool) { 12997 if (leftOperand is bool && rightOperand is bool) {
12409 return ((leftOperand as bool)) && ((rightOperand as bool)); 12998 return (leftOperand as bool) && (rightOperand as bool);
12410 } 12999 }
12411 } else if (node.operator.type == TokenType.BANG_EQ) { 13000 } else if (node.operator.type == TokenType.BANG_EQ) {
12412 if (leftOperand is bool && rightOperand is bool) { 13001 if (leftOperand is bool && rightOperand is bool) {
12413 return ((leftOperand as bool)) != ((rightOperand as bool)); 13002 return (leftOperand as bool) != (rightOperand as bool);
12414 } else if (leftOperand is int && rightOperand is int) { 13003 } else if (leftOperand is int && rightOperand is int) {
12415 return ((leftOperand as int)) != rightOperand; 13004 return (leftOperand as int) != rightOperand;
12416 } else if (leftOperand is double && rightOperand is double) { 13005 } else if (leftOperand is double && rightOperand is double) {
12417 return ((leftOperand as double)) != rightOperand; 13006 return (leftOperand as double) != rightOperand;
12418 } else if (leftOperand is String && rightOperand is String) { 13007 } else if (leftOperand is String && rightOperand is String) {
12419 return ((leftOperand as String)) != rightOperand; 13008 return (leftOperand as String) != rightOperand;
12420 } 13009 }
12421 } else if (node.operator.type == TokenType.BAR) { 13010 } else if (node.operator.type == TokenType.BAR) {
12422 if (leftOperand is int && rightOperand is int) { 13011 if (leftOperand is int && rightOperand is int) {
12423 return ((leftOperand as int)) | (rightOperand as int); 13012 return (leftOperand as int) | (rightOperand as int);
12424 } 13013 }
12425 } else if (node.operator.type == TokenType.BAR_BAR) { 13014 } else if (node.operator.type == TokenType.BAR_BAR) {
12426 if (leftOperand is bool && rightOperand is bool) { 13015 if (leftOperand is bool && rightOperand is bool) {
12427 return ((leftOperand as bool)) || ((rightOperand as bool)); 13016 return (leftOperand as bool) || (rightOperand as bool);
12428 } 13017 }
12429 } else if (node.operator.type == TokenType.CARET) { 13018 } else if (node.operator.type == TokenType.CARET) {
12430 if (leftOperand is int && rightOperand is int) { 13019 if (leftOperand is int && rightOperand is int) {
12431 return ((leftOperand as int)) ^ (rightOperand as int); 13020 return (leftOperand as int) ^ (rightOperand as int);
12432 } 13021 }
12433 } else if (node.operator.type == TokenType.EQ_EQ) { 13022 } else if (node.operator.type == TokenType.EQ_EQ) {
12434 if (leftOperand is bool && rightOperand is bool) { 13023 if (leftOperand is bool && rightOperand is bool) {
12435 return identical(leftOperand as bool, rightOperand as bool); 13024 return identical(leftOperand as bool, rightOperand as bool);
12436 } else if (leftOperand is int && rightOperand is int) { 13025 } else if (leftOperand is int && rightOperand is int) {
12437 return ((leftOperand as int)) == rightOperand; 13026 return (leftOperand as int) == rightOperand;
12438 } else if (leftOperand is double && rightOperand is double) { 13027 } else if (leftOperand is double && rightOperand is double) {
12439 return ((leftOperand as double)) == rightOperand; 13028 return (leftOperand as double) == rightOperand;
12440 } else if (leftOperand is String && rightOperand is String) { 13029 } else if (leftOperand is String && rightOperand is String) {
12441 return ((leftOperand as String)) == rightOperand; 13030 return (leftOperand as String) == rightOperand;
12442 } 13031 }
12443 } else if (node.operator.type == TokenType.GT) { 13032 } else if (node.operator.type == TokenType.GT) {
12444 if (leftOperand is int && rightOperand is int) { 13033 if (leftOperand is int && rightOperand is int) {
12445 return ((leftOperand as int)).compareTo(rightOperand as int) > 0; 13034 return (leftOperand as int).compareTo(rightOperand as int) > 0;
12446 } else if (leftOperand is double && rightOperand is double) { 13035 } else if (leftOperand is double && rightOperand is double) {
12447 return ((leftOperand as double)).compareTo(rightOperand as double) > 0 ; 13036 return (leftOperand as double).compareTo(rightOperand as double) > 0;
12448 } 13037 }
12449 } else if (node.operator.type == TokenType.GT_EQ) { 13038 } else if (node.operator.type == TokenType.GT_EQ) {
12450 if (leftOperand is int && rightOperand is int) { 13039 if (leftOperand is int && rightOperand is int) {
12451 return ((leftOperand as int)).compareTo(rightOperand as int) >= 0; 13040 return (leftOperand as int).compareTo(rightOperand as int) >= 0;
12452 } else if (leftOperand is double && rightOperand is double) { 13041 } else if (leftOperand is double && rightOperand is double) {
12453 return ((leftOperand as double)).compareTo(rightOperand as double) >= 0; 13042 return (leftOperand as double).compareTo(rightOperand as double) >= 0;
12454 } 13043 }
12455 } else if (node.operator.type == TokenType.GT_GT) { 13044 } else if (node.operator.type == TokenType.GT_GT) {
12456 if (leftOperand is int && rightOperand is int) { 13045 if (leftOperand is int && rightOperand is int) {
12457 return ((leftOperand as int)) >> ((rightOperand as int)); 13046 return (leftOperand as int) >> (rightOperand as int);
12458 } 13047 }
12459 } else if (node.operator.type == TokenType.LT) { 13048 } else if (node.operator.type == TokenType.LT) {
12460 if (leftOperand is int && rightOperand is int) { 13049 if (leftOperand is int && rightOperand is int) {
12461 return ((leftOperand as int)).compareTo(rightOperand as int) < 0; 13050 return (leftOperand as int).compareTo(rightOperand as int) < 0;
12462 } else if (leftOperand is double && rightOperand is double) { 13051 } else if (leftOperand is double && rightOperand is double) {
12463 return ((leftOperand as double)).compareTo(rightOperand as double) < 0 ; 13052 return (leftOperand as double).compareTo(rightOperand as double) < 0;
12464 } 13053 }
12465 } else if (node.operator.type == TokenType.LT_EQ) { 13054 } else if (node.operator.type == TokenType.LT_EQ) {
12466 if (leftOperand is int && rightOperand is int) { 13055 if (leftOperand is int && rightOperand is int) {
12467 return ((leftOperand as int)).compareTo(rightOperand as int) <= 0; 13056 return (leftOperand as int).compareTo(rightOperand as int) <= 0;
12468 } else if (leftOperand is double && rightOperand is double) { 13057 } else if (leftOperand is double && rightOperand is double) {
12469 return ((leftOperand as double)).compareTo(rightOperand as double) <= 0; 13058 return (leftOperand as double).compareTo(rightOperand as double) <= 0;
12470 } 13059 }
12471 } else if (node.operator.type == TokenType.LT_LT) { 13060 } else if (node.operator.type == TokenType.LT_LT) {
12472 if (leftOperand is int && rightOperand is int) { 13061 if (leftOperand is int && rightOperand is int) {
12473 return ((leftOperand as int)) << ((rightOperand as int)); 13062 return (leftOperand as int) << (rightOperand as int);
12474 } 13063 }
12475 } else if (node.operator.type == TokenType.MINUS) { 13064 } else if (node.operator.type == TokenType.MINUS) {
12476 if (leftOperand is int && rightOperand is int) { 13065 if (leftOperand is int && rightOperand is int) {
12477 return ((leftOperand as int)) - (rightOperand as int); 13066 return (leftOperand as int) - (rightOperand as int);
12478 } else if (leftOperand is double && rightOperand is double) { 13067 } else if (leftOperand is double && rightOperand is double) {
12479 return ((leftOperand as double)) - ((rightOperand as double)); 13068 return (leftOperand as double) - (rightOperand as double);
12480 } 13069 }
12481 } else if (node.operator.type == TokenType.PERCENT) { 13070 } else if (node.operator.type == TokenType.PERCENT) {
12482 if (leftOperand is int && rightOperand is int) { 13071 if (leftOperand is int && rightOperand is int) {
12483 return ((leftOperand as int)).remainder(rightOperand as int); 13072 return (leftOperand as int).remainder(rightOperand as int);
12484 } else if (leftOperand is double && rightOperand is double) { 13073 } else if (leftOperand is double && rightOperand is double) {
12485 return ((leftOperand as double)) % ((rightOperand as double)); 13074 return (leftOperand as double) % (rightOperand as double);
12486 } 13075 }
12487 } else if (node.operator.type == TokenType.PLUS) { 13076 } else if (node.operator.type == TokenType.PLUS) {
12488 if (leftOperand is int && rightOperand is int) { 13077 if (leftOperand is int && rightOperand is int) {
12489 return ((leftOperand as int)) + (rightOperand as int); 13078 return (leftOperand as int) + (rightOperand as int);
12490 } else if (leftOperand is double && rightOperand is double) { 13079 } else if (leftOperand is double && rightOperand is double) {
12491 return ((leftOperand as double)) + ((rightOperand as double)); 13080 return (leftOperand as double) + (rightOperand as double);
12492 } 13081 }
12493 } else if (node.operator.type == TokenType.STAR) { 13082 } else if (node.operator.type == TokenType.STAR) {
12494 if (leftOperand is int && rightOperand is int) { 13083 if (leftOperand is int && rightOperand is int) {
12495 return ((leftOperand as int)) * (rightOperand as int); 13084 return (leftOperand as int) * (rightOperand as int);
12496 } else if (leftOperand is double && rightOperand is double) { 13085 } else if (leftOperand is double && rightOperand is double) {
12497 return ((leftOperand as double)) * ((rightOperand as double)); 13086 return (leftOperand as double) * (rightOperand as double);
12498 } 13087 }
12499 } else if (node.operator.type == TokenType.SLASH) { 13088 } else if (node.operator.type == TokenType.SLASH) {
12500 if (leftOperand is int && rightOperand is int) { 13089 if (leftOperand is int && rightOperand is int) {
12501 if (rightOperand != 0) { 13090 if (rightOperand != 0) {
12502 return ((leftOperand as int)) ~/ (rightOperand as int); 13091 return (leftOperand as int) ~/ (rightOperand as int);
12503 } else { 13092 } else {
12504 return ((leftOperand as int)).toDouble() / ((rightOperand as int)).t oDouble(); 13093 return (leftOperand as int).toDouble() / (rightOperand as int).toDou ble();
12505 } 13094 }
12506 } else if (leftOperand is double && rightOperand is double) { 13095 } else if (leftOperand is double && rightOperand is double) {
12507 return ((leftOperand as double)) / ((rightOperand as double)); 13096 return (leftOperand as double) / (rightOperand as double);
12508 } 13097 }
12509 } else if (node.operator.type == TokenType.TILDE_SLASH) { 13098 } else if (node.operator.type == TokenType.TILDE_SLASH) {
12510 if (leftOperand is int && rightOperand is int) { 13099 if (leftOperand is int && rightOperand is int) {
12511 if (rightOperand != 0) { 13100 if (rightOperand != 0) {
12512 return ((leftOperand as int)) ~/ (rightOperand as int); 13101 return (leftOperand as int) ~/ (rightOperand as int);
12513 } else { 13102 } else {
12514 return 0; 13103 return 0;
12515 } 13104 }
12516 } else if (leftOperand is double && rightOperand is double) { 13105 } else if (leftOperand is double && rightOperand is double) {
12517 return ((leftOperand as double)) ~/ ((rightOperand as double)); 13106 return (leftOperand as double) ~/ (rightOperand as double);
12518 } 13107 }
12519 } 13108 }
12520 break; 13109 break;
12521 } 13110 }
12522 return visitExpression(node); 13111 return visitExpression(node);
12523 } 13112 }
13113
12524 Object visitBooleanLiteral(BooleanLiteral node) => node.value ? true : false; 13114 Object visitBooleanLiteral(BooleanLiteral node) => node.value ? true : false;
13115
12525 Object visitDoubleLiteral(DoubleLiteral node) => node.value; 13116 Object visitDoubleLiteral(DoubleLiteral node) => node.value;
13117
12526 Object visitIntegerLiteral(IntegerLiteral node) => node.value; 13118 Object visitIntegerLiteral(IntegerLiteral node) => node.value;
13119
12527 Object visitInterpolationExpression(InterpolationExpression node) { 13120 Object visitInterpolationExpression(InterpolationExpression node) {
12528 Object value = node.expression.accept(this); 13121 Object value = node.expression.accept(this);
12529 if (value == null || value is bool || value is String || value is int || val ue is double) { 13122 if (value == null || value is bool || value is String || value is int || val ue is double) {
12530 return value; 13123 return value;
12531 } 13124 }
12532 return NOT_A_CONSTANT; 13125 return NOT_A_CONSTANT;
12533 } 13126 }
13127
12534 Object visitInterpolationString(InterpolationString node) => node.value; 13128 Object visitInterpolationString(InterpolationString node) => node.value;
13129
12535 Object visitListLiteral(ListLiteral node) { 13130 Object visitListLiteral(ListLiteral node) {
12536 List<Object> list = new List<Object>(); 13131 List<Object> list = new List<Object>();
12537 for (Expression element in node.elements) { 13132 for (Expression element in node.elements) {
12538 Object value = element.accept(this); 13133 Object value = element.accept(this);
12539 if (identical(value, NOT_A_CONSTANT)) { 13134 if (identical(value, NOT_A_CONSTANT)) {
12540 return value; 13135 return value;
12541 } 13136 }
12542 list.add(value); 13137 list.add(value);
12543 } 13138 }
12544 return list; 13139 return list;
12545 } 13140 }
13141
12546 Object visitMapLiteral(MapLiteral node) { 13142 Object visitMapLiteral(MapLiteral node) {
12547 Map<String, Object> map = new Map<String, Object>(); 13143 Map<String, Object> map = new Map<String, Object>();
12548 for (MapLiteralEntry entry in node.entries) { 13144 for (MapLiteralEntry entry in node.entries) {
12549 Object key = entry.key.accept(this); 13145 Object key = entry.key.accept(this);
12550 Object value = entry.value.accept(this); 13146 Object value = entry.value.accept(this);
12551 if (key is! String || identical(value, NOT_A_CONSTANT)) { 13147 if (key is! String || identical(value, NOT_A_CONSTANT)) {
12552 return NOT_A_CONSTANT; 13148 return NOT_A_CONSTANT;
12553 } 13149 }
12554 map[(key as String)] = value; 13150 map[(key as String)] = value;
12555 } 13151 }
12556 return map; 13152 return map;
12557 } 13153 }
13154
12558 Object visitMethodInvocation(MethodInvocation node) => visitNode(node); 13155 Object visitMethodInvocation(MethodInvocation node) => visitNode(node);
13156
12559 Object visitNode(ASTNode node) => NOT_A_CONSTANT; 13157 Object visitNode(ASTNode node) => NOT_A_CONSTANT;
13158
12560 Object visitNullLiteral(NullLiteral node) => null; 13159 Object visitNullLiteral(NullLiteral node) => null;
13160
12561 Object visitParenthesizedExpression(ParenthesizedExpression node) => node.expr ession.accept(this); 13161 Object visitParenthesizedExpression(ParenthesizedExpression node) => node.expr ession.accept(this);
13162
12562 Object visitPrefixedIdentifier(PrefixedIdentifier node) => getConstantValue(nu ll); 13163 Object visitPrefixedIdentifier(PrefixedIdentifier node) => getConstantValue(nu ll);
13164
12563 Object visitPrefixExpression(PrefixExpression node) { 13165 Object visitPrefixExpression(PrefixExpression node) {
12564 Object operand = node.operand.accept(this); 13166 Object operand = node.operand.accept(this);
12565 if (identical(operand, NOT_A_CONSTANT)) { 13167 if (identical(operand, NOT_A_CONSTANT)) {
12566 return operand; 13168 return operand;
12567 } 13169 }
12568 while (true) { 13170 while (true) {
12569 if (node.operator.type == TokenType.BANG) { 13171 if (node.operator.type == TokenType.BANG) {
12570 if (identical(operand, true)) { 13172 if (identical(operand, true)) {
12571 return false; 13173 return false;
12572 } else if (identical(operand, false)) { 13174 } else if (identical(operand, false)) {
12573 return true; 13175 return true;
12574 } 13176 }
12575 } else if (node.operator.type == TokenType.TILDE) { 13177 } else if (node.operator.type == TokenType.TILDE) {
12576 if (operand is int) { 13178 if (operand is int) {
12577 return ~((operand as int)); 13179 return ~(operand as int);
12578 } 13180 }
12579 } else if (node.operator.type == TokenType.MINUS) { 13181 } else if (node.operator.type == TokenType.MINUS) {
12580 if (operand == null) { 13182 if (operand == null) {
12581 return null; 13183 return null;
12582 } else if (operand is int) { 13184 } else if (operand is int) {
12583 return -((operand as int)); 13185 return -(operand as int);
12584 } else if (operand is double) { 13186 } else if (operand is double) {
12585 return -((operand as double)); 13187 return -(operand as double);
12586 } 13188 }
12587 } 13189 }
12588 break; 13190 break;
12589 } 13191 }
12590 return NOT_A_CONSTANT; 13192 return NOT_A_CONSTANT;
12591 } 13193 }
13194
12592 Object visitPropertyAccess(PropertyAccess node) => getConstantValue(null); 13195 Object visitPropertyAccess(PropertyAccess node) => getConstantValue(null);
13196
12593 Object visitSimpleIdentifier(SimpleIdentifier node) => getConstantValue(null); 13197 Object visitSimpleIdentifier(SimpleIdentifier node) => getConstantValue(null);
13198
12594 Object visitSimpleStringLiteral(SimpleStringLiteral node) => node.value; 13199 Object visitSimpleStringLiteral(SimpleStringLiteral node) => node.value;
13200
12595 Object visitStringInterpolation(StringInterpolation node) { 13201 Object visitStringInterpolation(StringInterpolation node) {
12596 JavaStringBuilder builder = new JavaStringBuilder(); 13202 JavaStringBuilder builder = new JavaStringBuilder();
12597 for (InterpolationElement element in node.elements) { 13203 for (InterpolationElement element in node.elements) {
12598 Object value = element.accept(this); 13204 Object value = element.accept(this);
12599 if (identical(value, NOT_A_CONSTANT)) { 13205 if (identical(value, NOT_A_CONSTANT)) {
12600 return value; 13206 return value;
12601 } 13207 }
12602 builder.append(value); 13208 builder.append(value);
12603 } 13209 }
12604 return builder.toString(); 13210 return builder.toString();
12605 } 13211 }
13212
12606 Object visitSymbolLiteral(SymbolLiteral node) { 13213 Object visitSymbolLiteral(SymbolLiteral node) {
12607 JavaStringBuilder builder = new JavaStringBuilder(); 13214 JavaStringBuilder builder = new JavaStringBuilder();
12608 for (Token component in node.components) { 13215 for (Token component in node.components) {
12609 if (builder.length > 0) { 13216 if (builder.length > 0) {
12610 builder.appendChar(0x2E); 13217 builder.appendChar(0x2E);
12611 } 13218 }
12612 builder.append(component.lexeme); 13219 builder.append(component.lexeme);
12613 } 13220 }
12614 return builder.toString(); 13221 return builder.toString();
12615 } 13222 }
12616 13223
12617 /** 13224 /**
12618 * Return the constant value of the static constant represented by the given e lement. 13225 * Return the constant value of the static constant represented by the given e lement.
12619 * 13226 *
12620 * @param element the element whose value is to be returned 13227 * @param element the element whose value is to be returned
12621 * @return the constant value of the static constant 13228 * @return the constant value of the static constant
12622 */ 13229 */
12623 Object getConstantValue(Element element) { 13230 Object getConstantValue(Element element) {
12624 if (element is FieldElement) { 13231 if (element is FieldElement) {
12625 FieldElement field = element as FieldElement; 13232 FieldElement field = element as FieldElement;
12626 if (field.isStatic && field.isConst) { 13233 if (field.isStatic && field.isConst) {
12627 } 13234 }
12628 } 13235 }
12629 return NOT_A_CONSTANT; 13236 return NOT_A_CONSTANT;
12630 } 13237 }
12631 } 13238 }
13239
12632 /** 13240 /**
12633 * Instances of the class `ElementLocator` locate the [Element] 13241 * Instances of the class `ElementLocator` locate the [Element]
12634 * associated with a given [ASTNode]. 13242 * associated with a given [ASTNode].
12635 * 13243 *
12636 * @coverage dart.engine.ast 13244 * @coverage dart.engine.ast
12637 */ 13245 */
12638 class ElementLocator { 13246 class ElementLocator {
12639
12640 /** 13247 /**
12641 * Locate the [Element] associated with the given [ASTNode]. 13248 * Locate the [Element] associated with the given [ASTNode].
12642 * 13249 *
12643 * @param node the node (not `null`) 13250 * @param node the node (not `null`)
12644 * @return the associated element, or `null` if none is found 13251 * @return the associated element, or `null` if none is found
12645 */ 13252 */
12646 static Element locate(ASTNode node) { 13253 static Element locate(ASTNode node) {
12647 ElementLocator_ElementMapper mapper = new ElementLocator_ElementMapper(); 13254 ElementLocator_ElementMapper mapper = new ElementLocator_ElementMapper();
12648 return node.accept(mapper); 13255 return node.accept(mapper);
12649 } 13256 }
12650 } 13257 }
13258
12651 /** 13259 /**
12652 * Visitor that maps nodes to elements. 13260 * Visitor that maps nodes to elements.
12653 */ 13261 */
12654 class ElementLocator_ElementMapper extends GeneralizingASTVisitor<Element> { 13262 class ElementLocator_ElementMapper extends GeneralizingASTVisitor<Element> {
12655 Element visitAssignmentExpression(AssignmentExpression node) => node.bestEleme nt; 13263 Element visitAssignmentExpression(AssignmentExpression node) => node.bestEleme nt;
13264
12656 Element visitBinaryExpression(BinaryExpression node) => node.bestElement; 13265 Element visitBinaryExpression(BinaryExpression node) => node.bestElement;
13266
12657 Element visitClassDeclaration(ClassDeclaration node) => node.element; 13267 Element visitClassDeclaration(ClassDeclaration node) => node.element;
13268
12658 Element visitCompilationUnit(CompilationUnit node) => node.element; 13269 Element visitCompilationUnit(CompilationUnit node) => node.element;
13270
12659 Element visitConstructorDeclaration(ConstructorDeclaration node) => node.eleme nt; 13271 Element visitConstructorDeclaration(ConstructorDeclaration node) => node.eleme nt;
13272
12660 Element visitFunctionDeclaration(FunctionDeclaration node) => node.element; 13273 Element visitFunctionDeclaration(FunctionDeclaration node) => node.element;
13274
12661 Element visitIdentifier(Identifier node) { 13275 Element visitIdentifier(Identifier node) {
12662 ASTNode parent = node.parent; 13276 ASTNode parent = node.parent;
12663 if (parent is ConstructorDeclaration) { 13277 if (parent is ConstructorDeclaration) {
12664 ConstructorDeclaration decl = parent as ConstructorDeclaration; 13278 ConstructorDeclaration decl = parent as ConstructorDeclaration;
12665 Identifier returnType = decl.returnType; 13279 Identifier returnType = decl.returnType;
12666 if (identical(returnType, node)) { 13280 if (identical(returnType, node)) {
12667 SimpleIdentifier name = decl.name; 13281 SimpleIdentifier name = decl.name;
12668 if (name != null) { 13282 if (name != null) {
12669 return name.bestElement; 13283 return name.bestElement;
12670 } 13284 }
12671 Element element = node.bestElement; 13285 Element element = node.bestElement;
12672 if (element is ClassElement) { 13286 if (element is ClassElement) {
12673 return ((element as ClassElement)).unnamedConstructor; 13287 return (element as ClassElement).unnamedConstructor;
12674 } 13288 }
12675 } 13289 }
12676 } 13290 }
12677 if (parent is LibraryIdentifier) { 13291 if (parent is LibraryIdentifier) {
12678 ASTNode grandParent = ((parent as LibraryIdentifier)).parent; 13292 ASTNode grandParent = (parent as LibraryIdentifier).parent;
12679 if (grandParent is PartOfDirective) { 13293 if (grandParent is PartOfDirective) {
12680 Element element = ((grandParent as PartOfDirective)).element; 13294 Element element = (grandParent as PartOfDirective).element;
12681 if (element is LibraryElement) { 13295 if (element is LibraryElement) {
12682 return ((element as LibraryElement)).definingCompilationUnit; 13296 return (element as LibraryElement).definingCompilationUnit;
12683 } 13297 }
12684 } 13298 }
12685 } 13299 }
12686 Element element = node.bestElement; 13300 Element element = node.bestElement;
12687 if (element == null) { 13301 if (element == null) {
12688 element = node.staticElement; 13302 element = node.staticElement;
12689 } 13303 }
12690 return element; 13304 return element;
12691 } 13305 }
13306
12692 Element visitImportDirective(ImportDirective node) => node.element; 13307 Element visitImportDirective(ImportDirective node) => node.element;
13308
12693 Element visitIndexExpression(IndexExpression node) => node.bestElement; 13309 Element visitIndexExpression(IndexExpression node) => node.bestElement;
13310
12694 Element visitInstanceCreationExpression(InstanceCreationExpression node) => no de.staticElement; 13311 Element visitInstanceCreationExpression(InstanceCreationExpression node) => no de.staticElement;
13312
12695 Element visitLibraryDirective(LibraryDirective node) => node.element; 13313 Element visitLibraryDirective(LibraryDirective node) => node.element;
13314
12696 Element visitMethodDeclaration(MethodDeclaration node) => node.element; 13315 Element visitMethodDeclaration(MethodDeclaration node) => node.element;
13316
12697 Element visitMethodInvocation(MethodInvocation node) => node.methodName.bestEl ement; 13317 Element visitMethodInvocation(MethodInvocation node) => node.methodName.bestEl ement;
13318
12698 Element visitPostfixExpression(PostfixExpression node) => node.bestElement; 13319 Element visitPostfixExpression(PostfixExpression node) => node.bestElement;
13320
12699 Element visitPrefixedIdentifier(PrefixedIdentifier node) => node.bestElement; 13321 Element visitPrefixedIdentifier(PrefixedIdentifier node) => node.bestElement;
13322
12700 Element visitPrefixExpression(PrefixExpression node) => node.bestElement; 13323 Element visitPrefixExpression(PrefixExpression node) => node.bestElement;
13324
12701 Element visitStringLiteral(StringLiteral node) { 13325 Element visitStringLiteral(StringLiteral node) {
12702 ASTNode parent = node.parent; 13326 ASTNode parent = node.parent;
12703 if (parent is UriBasedDirective) { 13327 if (parent is UriBasedDirective) {
12704 return ((parent as UriBasedDirective)).uriElement; 13328 return (parent as UriBasedDirective).uriElement;
12705 } 13329 }
12706 return null; 13330 return null;
12707 } 13331 }
13332
12708 Element visitVariableDeclaration(VariableDeclaration node) => node.element; 13333 Element visitVariableDeclaration(VariableDeclaration node) => node.element;
12709 } 13334 }
13335
12710 /** 13336 /**
12711 * Instances of the class `GeneralizingASTVisitor` implement an AST visitor that will 13337 * Instances of the class `GeneralizingASTVisitor` implement an AST visitor that will
12712 * recursively visit all of the nodes in an AST structure (like instances of the class 13338 * recursively visit all of the nodes in an AST structure (like instances of the class
12713 * [RecursiveASTVisitor]). In addition, when a node of a specific type is visite d not only 13339 * [RecursiveASTVisitor]). In addition, when a node of a specific type is visite d not only
12714 * will the visit method for that specific type of node be invoked, but addition al methods for the 13340 * will the visit method for that specific type of node be invoked, but addition al methods for the
12715 * superclasses of that node will also be invoked. For example, using an instanc e of this class to 13341 * superclasses of that node will also be invoked. For example, using an instanc e of this class to
12716 * visit a [Block] will cause the method [visitBlock] to be invoked but will 13342 * visit a [Block] will cause the method [visitBlock] to be invoked but will
12717 * also cause the methods [visitStatement] and [visitNode] to be 13343 * also cause the methods [visitStatement] and [visitNode] to be
12718 * subsequently invoked. This allows visitors to be written that visit all state ments without 13344 * subsequently invoked. This allows visitors to be written that visit all state ments without
12719 * needing to override the visit method for each of the specific subclasses of [ Statement]. 13345 * needing to override the visit method for each of the specific subclasses of [ Statement].
12720 * 13346 *
12721 * Subclasses that override a visit method must either invoke the overridden vis it method or 13347 * Subclasses that override a visit method must either invoke the overridden vis it method or
12722 * explicitly invoke the more general visit method. Failure to do so will cause the visit methods 13348 * explicitly invoke the more general visit method. Failure to do so will cause the visit methods
12723 * for superclasses of the node to not be invoked and will cause the children of the visited node to 13349 * for superclasses of the node to not be invoked and will cause the children of the visited node to
12724 * not be visited. 13350 * not be visited.
12725 * 13351 *
12726 * @coverage dart.engine.ast 13352 * @coverage dart.engine.ast
12727 */ 13353 */
12728 class GeneralizingASTVisitor<R> implements ASTVisitor<R> { 13354 class GeneralizingASTVisitor<R> implements ASTVisitor<R> {
12729 R visitAdjacentStrings(AdjacentStrings node) => visitStringLiteral(node); 13355 R visitAdjacentStrings(AdjacentStrings node) => visitStringLiteral(node);
13356
12730 R visitAnnotatedNode(AnnotatedNode node) => visitNode(node); 13357 R visitAnnotatedNode(AnnotatedNode node) => visitNode(node);
13358
12731 R visitAnnotation(Annotation node) => visitNode(node); 13359 R visitAnnotation(Annotation node) => visitNode(node);
13360
12732 R visitArgumentDefinitionTest(ArgumentDefinitionTest node) => visitExpression( node); 13361 R visitArgumentDefinitionTest(ArgumentDefinitionTest node) => visitExpression( node);
13362
12733 R visitArgumentList(ArgumentList node) => visitNode(node); 13363 R visitArgumentList(ArgumentList node) => visitNode(node);
13364
12734 R visitAsExpression(AsExpression node) => visitExpression(node); 13365 R visitAsExpression(AsExpression node) => visitExpression(node);
13366
12735 R visitAssertStatement(AssertStatement node) => visitStatement(node); 13367 R visitAssertStatement(AssertStatement node) => visitStatement(node);
13368
12736 R visitAssignmentExpression(AssignmentExpression node) => visitExpression(node ); 13369 R visitAssignmentExpression(AssignmentExpression node) => visitExpression(node );
13370
12737 R visitBinaryExpression(BinaryExpression node) => visitExpression(node); 13371 R visitBinaryExpression(BinaryExpression node) => visitExpression(node);
13372
12738 R visitBlock(Block node) => visitStatement(node); 13373 R visitBlock(Block node) => visitStatement(node);
13374
12739 R visitBlockFunctionBody(BlockFunctionBody node) => visitFunctionBody(node); 13375 R visitBlockFunctionBody(BlockFunctionBody node) => visitFunctionBody(node);
13376
12740 R visitBooleanLiteral(BooleanLiteral node) => visitLiteral(node); 13377 R visitBooleanLiteral(BooleanLiteral node) => visitLiteral(node);
13378
12741 R visitBreakStatement(BreakStatement node) => visitStatement(node); 13379 R visitBreakStatement(BreakStatement node) => visitStatement(node);
13380
12742 R visitCascadeExpression(CascadeExpression node) => visitExpression(node); 13381 R visitCascadeExpression(CascadeExpression node) => visitExpression(node);
13382
12743 R visitCatchClause(CatchClause node) => visitNode(node); 13383 R visitCatchClause(CatchClause node) => visitNode(node);
13384
12744 R visitClassDeclaration(ClassDeclaration node) => visitCompilationUnitMember(n ode); 13385 R visitClassDeclaration(ClassDeclaration node) => visitCompilationUnitMember(n ode);
13386
12745 R visitClassMember(ClassMember node) => visitDeclaration(node); 13387 R visitClassMember(ClassMember node) => visitDeclaration(node);
13388
12746 R visitClassTypeAlias(ClassTypeAlias node) => visitTypeAlias(node); 13389 R visitClassTypeAlias(ClassTypeAlias node) => visitTypeAlias(node);
13390
12747 R visitCombinator(Combinator node) => visitNode(node); 13391 R visitCombinator(Combinator node) => visitNode(node);
13392
12748 R visitComment(Comment node) => visitNode(node); 13393 R visitComment(Comment node) => visitNode(node);
13394
12749 R visitCommentReference(CommentReference node) => visitNode(node); 13395 R visitCommentReference(CommentReference node) => visitNode(node);
13396
12750 R visitCompilationUnit(CompilationUnit node) => visitNode(node); 13397 R visitCompilationUnit(CompilationUnit node) => visitNode(node);
13398
12751 R visitCompilationUnitMember(CompilationUnitMember node) => visitDeclaration(n ode); 13399 R visitCompilationUnitMember(CompilationUnitMember node) => visitDeclaration(n ode);
13400
12752 R visitConditionalExpression(ConditionalExpression node) => visitExpression(no de); 13401 R visitConditionalExpression(ConditionalExpression node) => visitExpression(no de);
13402
12753 R visitConstructorDeclaration(ConstructorDeclaration node) => visitClassMember (node); 13403 R visitConstructorDeclaration(ConstructorDeclaration node) => visitClassMember (node);
13404
12754 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => visitC onstructorInitializer(node); 13405 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => visitC onstructorInitializer(node);
13406
12755 R visitConstructorInitializer(ConstructorInitializer node) => visitNode(node); 13407 R visitConstructorInitializer(ConstructorInitializer node) => visitNode(node);
13408
12756 R visitConstructorName(ConstructorName node) => visitNode(node); 13409 R visitConstructorName(ConstructorName node) => visitNode(node);
13410
12757 R visitContinueStatement(ContinueStatement node) => visitStatement(node); 13411 R visitContinueStatement(ContinueStatement node) => visitStatement(node);
13412
12758 R visitDeclaration(Declaration node) => visitAnnotatedNode(node); 13413 R visitDeclaration(Declaration node) => visitAnnotatedNode(node);
13414
12759 R visitDeclaredIdentifier(DeclaredIdentifier node) => visitDeclaration(node); 13415 R visitDeclaredIdentifier(DeclaredIdentifier node) => visitDeclaration(node);
13416
12760 R visitDefaultFormalParameter(DefaultFormalParameter node) => visitFormalParam eter(node); 13417 R visitDefaultFormalParameter(DefaultFormalParameter node) => visitFormalParam eter(node);
13418
12761 R visitDirective(Directive node) => visitAnnotatedNode(node); 13419 R visitDirective(Directive node) => visitAnnotatedNode(node);
13420
12762 R visitDoStatement(DoStatement node) => visitStatement(node); 13421 R visitDoStatement(DoStatement node) => visitStatement(node);
13422
12763 R visitDoubleLiteral(DoubleLiteral node) => visitLiteral(node); 13423 R visitDoubleLiteral(DoubleLiteral node) => visitLiteral(node);
13424
12764 R visitEmptyFunctionBody(EmptyFunctionBody node) => visitFunctionBody(node); 13425 R visitEmptyFunctionBody(EmptyFunctionBody node) => visitFunctionBody(node);
13426
12765 R visitEmptyStatement(EmptyStatement node) => visitStatement(node); 13427 R visitEmptyStatement(EmptyStatement node) => visitStatement(node);
13428
12766 R visitExportDirective(ExportDirective node) => visitNamespaceDirective(node); 13429 R visitExportDirective(ExportDirective node) => visitNamespaceDirective(node);
13430
12767 R visitExpression(Expression node) => visitNode(node); 13431 R visitExpression(Expression node) => visitNode(node);
13432
12768 R visitExpressionFunctionBody(ExpressionFunctionBody node) => visitFunctionBod y(node); 13433 R visitExpressionFunctionBody(ExpressionFunctionBody node) => visitFunctionBod y(node);
13434
12769 R visitExpressionStatement(ExpressionStatement node) => visitStatement(node); 13435 R visitExpressionStatement(ExpressionStatement node) => visitStatement(node);
13436
12770 R visitExtendsClause(ExtendsClause node) => visitNode(node); 13437 R visitExtendsClause(ExtendsClause node) => visitNode(node);
13438
12771 R visitFieldDeclaration(FieldDeclaration node) => visitClassMember(node); 13439 R visitFieldDeclaration(FieldDeclaration node) => visitClassMember(node);
13440
12772 R visitFieldFormalParameter(FieldFormalParameter node) => visitNormalFormalPar ameter(node); 13441 R visitFieldFormalParameter(FieldFormalParameter node) => visitNormalFormalPar ameter(node);
13442
12773 R visitForEachStatement(ForEachStatement node) => visitStatement(node); 13443 R visitForEachStatement(ForEachStatement node) => visitStatement(node);
13444
12774 R visitFormalParameter(FormalParameter node) => visitNode(node); 13445 R visitFormalParameter(FormalParameter node) => visitNode(node);
13446
12775 R visitFormalParameterList(FormalParameterList node) => visitNode(node); 13447 R visitFormalParameterList(FormalParameterList node) => visitNode(node);
13448
12776 R visitForStatement(ForStatement node) => visitStatement(node); 13449 R visitForStatement(ForStatement node) => visitStatement(node);
13450
12777 R visitFunctionBody(FunctionBody node) => visitNode(node); 13451 R visitFunctionBody(FunctionBody node) => visitNode(node);
13452
12778 R visitFunctionDeclaration(FunctionDeclaration node) => visitCompilationUnitMe mber(node); 13453 R visitFunctionDeclaration(FunctionDeclaration node) => visitCompilationUnitMe mber(node);
13454
12779 R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => visi tStatement(node); 13455 R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => visi tStatement(node);
13456
12780 R visitFunctionExpression(FunctionExpression node) => visitExpression(node); 13457 R visitFunctionExpression(FunctionExpression node) => visitExpression(node);
13458
12781 R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => visi tExpression(node); 13459 R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => visi tExpression(node);
13460
12782 R visitFunctionTypeAlias(FunctionTypeAlias node) => visitTypeAlias(node); 13461 R visitFunctionTypeAlias(FunctionTypeAlias node) => visitTypeAlias(node);
13462
12783 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => visi tNormalFormalParameter(node); 13463 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => visi tNormalFormalParameter(node);
13464
12784 R visitHideCombinator(HideCombinator node) => visitCombinator(node); 13465 R visitHideCombinator(HideCombinator node) => visitCombinator(node);
13466
12785 R visitIdentifier(Identifier node) => visitExpression(node); 13467 R visitIdentifier(Identifier node) => visitExpression(node);
13468
12786 R visitIfStatement(IfStatement node) => visitStatement(node); 13469 R visitIfStatement(IfStatement node) => visitStatement(node);
13470
12787 R visitImplementsClause(ImplementsClause node) => visitNode(node); 13471 R visitImplementsClause(ImplementsClause node) => visitNode(node);
13472
12788 R visitImportDirective(ImportDirective node) => visitNamespaceDirective(node); 13473 R visitImportDirective(ImportDirective node) => visitNamespaceDirective(node);
13474
12789 R visitIndexExpression(IndexExpression node) => visitExpression(node); 13475 R visitIndexExpression(IndexExpression node) => visitExpression(node);
13476
12790 R visitInstanceCreationExpression(InstanceCreationExpression node) => visitExp ression(node); 13477 R visitInstanceCreationExpression(InstanceCreationExpression node) => visitExp ression(node);
13478
12791 R visitIntegerLiteral(IntegerLiteral node) => visitLiteral(node); 13479 R visitIntegerLiteral(IntegerLiteral node) => visitLiteral(node);
13480
12792 R visitInterpolationElement(InterpolationElement node) => visitNode(node); 13481 R visitInterpolationElement(InterpolationElement node) => visitNode(node);
13482
12793 R visitInterpolationExpression(InterpolationExpression node) => visitInterpola tionElement(node); 13483 R visitInterpolationExpression(InterpolationExpression node) => visitInterpola tionElement(node);
13484
12794 R visitInterpolationString(InterpolationString node) => visitInterpolationElem ent(node); 13485 R visitInterpolationString(InterpolationString node) => visitInterpolationElem ent(node);
13486
12795 R visitIsExpression(IsExpression node) => visitExpression(node); 13487 R visitIsExpression(IsExpression node) => visitExpression(node);
13488
12796 R visitLabel(Label node) => visitNode(node); 13489 R visitLabel(Label node) => visitNode(node);
13490
12797 R visitLabeledStatement(LabeledStatement node) => visitStatement(node); 13491 R visitLabeledStatement(LabeledStatement node) => visitStatement(node);
13492
12798 R visitLibraryDirective(LibraryDirective node) => visitDirective(node); 13493 R visitLibraryDirective(LibraryDirective node) => visitDirective(node);
13494
12799 R visitLibraryIdentifier(LibraryIdentifier node) => visitIdentifier(node); 13495 R visitLibraryIdentifier(LibraryIdentifier node) => visitIdentifier(node);
13496
12800 R visitListLiteral(ListLiteral node) => visitTypedLiteral(node); 13497 R visitListLiteral(ListLiteral node) => visitTypedLiteral(node);
13498
12801 R visitLiteral(Literal node) => visitExpression(node); 13499 R visitLiteral(Literal node) => visitExpression(node);
13500
12802 R visitMapLiteral(MapLiteral node) => visitTypedLiteral(node); 13501 R visitMapLiteral(MapLiteral node) => visitTypedLiteral(node);
13502
12803 R visitMapLiteralEntry(MapLiteralEntry node) => visitNode(node); 13503 R visitMapLiteralEntry(MapLiteralEntry node) => visitNode(node);
13504
12804 R visitMethodDeclaration(MethodDeclaration node) => visitClassMember(node); 13505 R visitMethodDeclaration(MethodDeclaration node) => visitClassMember(node);
13506
12805 R visitMethodInvocation(MethodInvocation node) => visitExpression(node); 13507 R visitMethodInvocation(MethodInvocation node) => visitExpression(node);
13508
12806 R visitNamedExpression(NamedExpression node) => visitExpression(node); 13509 R visitNamedExpression(NamedExpression node) => visitExpression(node);
13510
12807 R visitNamespaceDirective(NamespaceDirective node) => visitUriBasedDirective(n ode); 13511 R visitNamespaceDirective(NamespaceDirective node) => visitUriBasedDirective(n ode);
13512
12808 R visitNativeClause(NativeClause node) => visitNode(node); 13513 R visitNativeClause(NativeClause node) => visitNode(node);
13514
12809 R visitNativeFunctionBody(NativeFunctionBody node) => visitFunctionBody(node); 13515 R visitNativeFunctionBody(NativeFunctionBody node) => visitFunctionBody(node);
13516
12810 R visitNode(ASTNode node) { 13517 R visitNode(ASTNode node) {
12811 node.visitChildren(this); 13518 node.visitChildren(this);
12812 return null; 13519 return null;
12813 } 13520 }
13521
12814 R visitNormalFormalParameter(NormalFormalParameter node) => visitFormalParamet er(node); 13522 R visitNormalFormalParameter(NormalFormalParameter node) => visitFormalParamet er(node);
13523
12815 R visitNullLiteral(NullLiteral node) => visitLiteral(node); 13524 R visitNullLiteral(NullLiteral node) => visitLiteral(node);
13525
12816 R visitParenthesizedExpression(ParenthesizedExpression node) => visitExpressio n(node); 13526 R visitParenthesizedExpression(ParenthesizedExpression node) => visitExpressio n(node);
13527
12817 R visitPartDirective(PartDirective node) => visitUriBasedDirective(node); 13528 R visitPartDirective(PartDirective node) => visitUriBasedDirective(node);
13529
12818 R visitPartOfDirective(PartOfDirective node) => visitDirective(node); 13530 R visitPartOfDirective(PartOfDirective node) => visitDirective(node);
13531
12819 R visitPostfixExpression(PostfixExpression node) => visitExpression(node); 13532 R visitPostfixExpression(PostfixExpression node) => visitExpression(node);
13533
12820 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitIdentifier(node); 13534 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitIdentifier(node);
13535
12821 R visitPrefixExpression(PrefixExpression node) => visitExpression(node); 13536 R visitPrefixExpression(PrefixExpression node) => visitExpression(node);
13537
12822 R visitPropertyAccess(PropertyAccess node) => visitExpression(node); 13538 R visitPropertyAccess(PropertyAccess node) => visitExpression(node);
13539
12823 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => visitConstructorInitializer(node); 13540 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => visitConstructorInitializer(node);
13541
12824 R visitRethrowExpression(RethrowExpression node) => visitExpression(node); 13542 R visitRethrowExpression(RethrowExpression node) => visitExpression(node);
13543
12825 R visitReturnStatement(ReturnStatement node) => visitStatement(node); 13544 R visitReturnStatement(ReturnStatement node) => visitStatement(node);
13545
12826 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag); 13546 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag);
13547
12827 R visitShowCombinator(ShowCombinator node) => visitCombinator(node); 13548 R visitShowCombinator(ShowCombinator node) => visitCombinator(node);
13549
12828 R visitSimpleFormalParameter(SimpleFormalParameter node) => visitNormalFormalP arameter(node); 13550 R visitSimpleFormalParameter(SimpleFormalParameter node) => visitNormalFormalP arameter(node);
13551
12829 R visitSimpleIdentifier(SimpleIdentifier node) => visitIdentifier(node); 13552 R visitSimpleIdentifier(SimpleIdentifier node) => visitIdentifier(node);
13553
12830 R visitSimpleStringLiteral(SimpleStringLiteral node) => visitStringLiteral(nod e); 13554 R visitSimpleStringLiteral(SimpleStringLiteral node) => visitStringLiteral(nod e);
13555
12831 R visitStatement(Statement node) => visitNode(node); 13556 R visitStatement(Statement node) => visitNode(node);
13557
12832 R visitStringInterpolation(StringInterpolation node) => visitStringLiteral(nod e); 13558 R visitStringInterpolation(StringInterpolation node) => visitStringLiteral(nod e);
13559
12833 R visitStringLiteral(StringLiteral node) => visitLiteral(node); 13560 R visitStringLiteral(StringLiteral node) => visitLiteral(node);
13561
12834 R visitSuperConstructorInvocation(SuperConstructorInvocation node) => visitCon structorInitializer(node); 13562 R visitSuperConstructorInvocation(SuperConstructorInvocation node) => visitCon structorInitializer(node);
13563
12835 R visitSuperExpression(SuperExpression node) => visitExpression(node); 13564 R visitSuperExpression(SuperExpression node) => visitExpression(node);
13565
12836 R visitSwitchCase(SwitchCase node) => visitSwitchMember(node); 13566 R visitSwitchCase(SwitchCase node) => visitSwitchMember(node);
13567
12837 R visitSwitchDefault(SwitchDefault node) => visitSwitchMember(node); 13568 R visitSwitchDefault(SwitchDefault node) => visitSwitchMember(node);
13569
12838 R visitSwitchMember(SwitchMember node) => visitNode(node); 13570 R visitSwitchMember(SwitchMember node) => visitNode(node);
13571
12839 R visitSwitchStatement(SwitchStatement node) => visitStatement(node); 13572 R visitSwitchStatement(SwitchStatement node) => visitStatement(node);
13573
12840 R visitSymbolLiteral(SymbolLiteral node) => visitLiteral(node); 13574 R visitSymbolLiteral(SymbolLiteral node) => visitLiteral(node);
13575
12841 R visitThisExpression(ThisExpression node) => visitExpression(node); 13576 R visitThisExpression(ThisExpression node) => visitExpression(node);
13577
12842 R visitThrowExpression(ThrowExpression node) => visitExpression(node); 13578 R visitThrowExpression(ThrowExpression node) => visitExpression(node);
13579
12843 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => visitC ompilationUnitMember(node); 13580 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => visitC ompilationUnitMember(node);
13581
12844 R visitTryStatement(TryStatement node) => visitStatement(node); 13582 R visitTryStatement(TryStatement node) => visitStatement(node);
13583
12845 R visitTypeAlias(TypeAlias node) => visitCompilationUnitMember(node); 13584 R visitTypeAlias(TypeAlias node) => visitCompilationUnitMember(node);
13585
12846 R visitTypeArgumentList(TypeArgumentList node) => visitNode(node); 13586 R visitTypeArgumentList(TypeArgumentList node) => visitNode(node);
13587
12847 R visitTypedLiteral(TypedLiteral node) => visitLiteral(node); 13588 R visitTypedLiteral(TypedLiteral node) => visitLiteral(node);
13589
12848 R visitTypeName(TypeName node) => visitNode(node); 13590 R visitTypeName(TypeName node) => visitNode(node);
13591
12849 R visitTypeParameter(TypeParameter node) => visitNode(node); 13592 R visitTypeParameter(TypeParameter node) => visitNode(node);
13593
12850 R visitTypeParameterList(TypeParameterList node) => visitNode(node); 13594 R visitTypeParameterList(TypeParameterList node) => visitNode(node);
13595
12851 R visitUriBasedDirective(UriBasedDirective node) => visitDirective(node); 13596 R visitUriBasedDirective(UriBasedDirective node) => visitDirective(node);
13597
12852 R visitVariableDeclaration(VariableDeclaration node) => visitDeclaration(node) ; 13598 R visitVariableDeclaration(VariableDeclaration node) => visitDeclaration(node) ;
13599
12853 R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node ); 13600 R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node );
13601
12854 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visi tStatement(node); 13602 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visi tStatement(node);
13603
12855 R visitWhileStatement(WhileStatement node) => visitStatement(node); 13604 R visitWhileStatement(WhileStatement node) => visitStatement(node);
13605
12856 R visitWithClause(WithClause node) => visitNode(node); 13606 R visitWithClause(WithClause node) => visitNode(node);
12857 } 13607 }
13608
12858 /** 13609 /**
12859 * Instances of the class `NodeLocator` locate the [ASTNode] associated with a 13610 * Instances of the class `NodeLocator` locate the [ASTNode] associated with a
12860 * source range, given the AST structure built from the source. More specificall y, they will return 13611 * source range, given the AST structure built from the source. More specificall y, they will return
12861 * the [ASTNode] with the shortest length whose source range completely encompas ses 13612 * the [ASTNode] with the shortest length whose source range completely encompas ses
12862 * the specified range. 13613 * the specified range.
12863 * 13614 *
12864 * @coverage dart.engine.ast 13615 * @coverage dart.engine.ast
12865 */ 13616 */
12866 class NodeLocator extends UnifyingASTVisitor<Object> { 13617 class NodeLocator extends UnifyingASTVisitor<Object> {
12867
12868 /** 13618 /**
12869 * The start offset of the range used to identify the node. 13619 * The start offset of the range used to identify the node.
12870 */ 13620 */
12871 int _startOffset = 0; 13621 int _startOffset = 0;
12872 13622
12873 /** 13623 /**
12874 * The end offset of the range used to identify the node. 13624 * The end offset of the range used to identify the node.
12875 */ 13625 */
12876 int _endOffset = 0; 13626 int _endOffset = 0;
12877 13627
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
12915 } 13665 }
12916 try { 13666 try {
12917 node.accept(this); 13667 node.accept(this);
12918 } on NodeLocator_NodeFoundException catch (exception) { 13668 } on NodeLocator_NodeFoundException catch (exception) {
12919 } on JavaException catch (exception) { 13669 } on JavaException catch (exception) {
12920 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a t offset (${_startOffset} - ${_endOffset})", exception); 13670 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a t offset (${_startOffset} - ${_endOffset})", exception);
12921 return null; 13671 return null;
12922 } 13672 }
12923 return foundNode; 13673 return foundNode;
12924 } 13674 }
13675
12925 Object visitNode(ASTNode node) { 13676 Object visitNode(ASTNode node) {
12926 int start = node.offset; 13677 int start = node.offset;
12927 int end = start + node.length; 13678 int end = start + node.length;
12928 if (end < _startOffset) { 13679 if (end < _startOffset) {
12929 return null; 13680 return null;
12930 } 13681 }
12931 if (start > _endOffset) { 13682 if (start > _endOffset) {
12932 return null; 13683 return null;
12933 } 13684 }
12934 try { 13685 try {
12935 node.visitChildren(this); 13686 node.visitChildren(this);
12936 } on NodeLocator_NodeFoundException catch (exception) { 13687 } on NodeLocator_NodeFoundException catch (exception) {
12937 throw exception; 13688 throw exception;
12938 } on JavaException catch (exception) { 13689 } on JavaException catch (exception) {
12939 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra versing an AST structure.", exception); 13690 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra versing an AST structure.", exception);
12940 } 13691 }
12941 if (start <= _startOffset && _endOffset <= end) { 13692 if (start <= _startOffset && _endOffset <= end) {
12942 foundNode = node; 13693 foundNode = node;
12943 throw new NodeLocator_NodeFoundException(); 13694 throw new NodeLocator_NodeFoundException();
12944 } 13695 }
12945 return null; 13696 return null;
12946 } 13697 }
12947 } 13698 }
13699
12948 /** 13700 /**
12949 * Instances of the class `NodeFoundException` are used to cancel visiting after a node has 13701 * Instances of the class `NodeFoundException` are used to cancel visiting after a node has
12950 * been found. 13702 * been found.
12951 */ 13703 */
12952 class NodeLocator_NodeFoundException extends RuntimeException { 13704 class NodeLocator_NodeFoundException extends RuntimeException {
12953 static int _serialVersionUID = 1; 13705 static int _serialVersionUID = 1;
12954 } 13706 }
13707
12955 /** 13708 /**
12956 * Instances of the class `RecursiveASTVisitor` implement an AST visitor that wi ll recursively 13709 * Instances of the class `RecursiveASTVisitor` implement an AST visitor that wi ll recursively
12957 * visit all of the nodes in an AST structure. For example, using an instance of this class to visit 13710 * visit all of the nodes in an AST structure. For example, using an instance of this class to visit
12958 * a [Block] will also cause all of the statements in the block to be visited. 13711 * a [Block] will also cause all of the statements in the block to be visited.
12959 * 13712 *
12960 * Subclasses that override a visit method must either invoke the overridden vis it method or must 13713 * Subclasses that override a visit method must either invoke the overridden vis it method or must
12961 * explicitly ask the visited node to visit its children. Failure to do so will cause the children 13714 * explicitly ask the visited node to visit its children. Failure to do so will cause the children
12962 * of the visited node to not be visited. 13715 * of the visited node to not be visited.
12963 * 13716 *
12964 * @coverage dart.engine.ast 13717 * @coverage dart.engine.ast
12965 */ 13718 */
12966 class RecursiveASTVisitor<R> implements ASTVisitor<R> { 13719 class RecursiveASTVisitor<R> implements ASTVisitor<R> {
12967 R visitAdjacentStrings(AdjacentStrings node) { 13720 R visitAdjacentStrings(AdjacentStrings node) {
12968 node.visitChildren(this); 13721 node.visitChildren(this);
12969 return null; 13722 return null;
12970 } 13723 }
13724
12971 R visitAnnotation(Annotation node) { 13725 R visitAnnotation(Annotation node) {
12972 node.visitChildren(this); 13726 node.visitChildren(this);
12973 return null; 13727 return null;
12974 } 13728 }
13729
12975 R visitArgumentDefinitionTest(ArgumentDefinitionTest node) { 13730 R visitArgumentDefinitionTest(ArgumentDefinitionTest node) {
12976 node.visitChildren(this); 13731 node.visitChildren(this);
12977 return null; 13732 return null;
12978 } 13733 }
13734
12979 R visitArgumentList(ArgumentList node) { 13735 R visitArgumentList(ArgumentList node) {
12980 node.visitChildren(this); 13736 node.visitChildren(this);
12981 return null; 13737 return null;
12982 } 13738 }
13739
12983 R visitAsExpression(AsExpression node) { 13740 R visitAsExpression(AsExpression node) {
12984 node.visitChildren(this); 13741 node.visitChildren(this);
12985 return null; 13742 return null;
12986 } 13743 }
13744
12987 R visitAssertStatement(AssertStatement node) { 13745 R visitAssertStatement(AssertStatement node) {
12988 node.visitChildren(this); 13746 node.visitChildren(this);
12989 return null; 13747 return null;
12990 } 13748 }
13749
12991 R visitAssignmentExpression(AssignmentExpression node) { 13750 R visitAssignmentExpression(AssignmentExpression node) {
12992 node.visitChildren(this); 13751 node.visitChildren(this);
12993 return null; 13752 return null;
12994 } 13753 }
13754
12995 R visitBinaryExpression(BinaryExpression node) { 13755 R visitBinaryExpression(BinaryExpression node) {
12996 node.visitChildren(this); 13756 node.visitChildren(this);
12997 return null; 13757 return null;
12998 } 13758 }
13759
12999 R visitBlock(Block node) { 13760 R visitBlock(Block node) {
13000 node.visitChildren(this); 13761 node.visitChildren(this);
13001 return null; 13762 return null;
13002 } 13763 }
13764
13003 R visitBlockFunctionBody(BlockFunctionBody node) { 13765 R visitBlockFunctionBody(BlockFunctionBody node) {
13004 node.visitChildren(this); 13766 node.visitChildren(this);
13005 return null; 13767 return null;
13006 } 13768 }
13769
13007 R visitBooleanLiteral(BooleanLiteral node) { 13770 R visitBooleanLiteral(BooleanLiteral node) {
13008 node.visitChildren(this); 13771 node.visitChildren(this);
13009 return null; 13772 return null;
13010 } 13773 }
13774
13011 R visitBreakStatement(BreakStatement node) { 13775 R visitBreakStatement(BreakStatement node) {
13012 node.visitChildren(this); 13776 node.visitChildren(this);
13013 return null; 13777 return null;
13014 } 13778 }
13779
13015 R visitCascadeExpression(CascadeExpression node) { 13780 R visitCascadeExpression(CascadeExpression node) {
13016 node.visitChildren(this); 13781 node.visitChildren(this);
13017 return null; 13782 return null;
13018 } 13783 }
13784
13019 R visitCatchClause(CatchClause node) { 13785 R visitCatchClause(CatchClause node) {
13020 node.visitChildren(this); 13786 node.visitChildren(this);
13021 return null; 13787 return null;
13022 } 13788 }
13789
13023 R visitClassDeclaration(ClassDeclaration node) { 13790 R visitClassDeclaration(ClassDeclaration node) {
13024 node.visitChildren(this); 13791 node.visitChildren(this);
13025 return null; 13792 return null;
13026 } 13793 }
13794
13027 R visitClassTypeAlias(ClassTypeAlias node) { 13795 R visitClassTypeAlias(ClassTypeAlias node) {
13028 node.visitChildren(this); 13796 node.visitChildren(this);
13029 return null; 13797 return null;
13030 } 13798 }
13799
13031 R visitComment(Comment node) { 13800 R visitComment(Comment node) {
13032 node.visitChildren(this); 13801 node.visitChildren(this);
13033 return null; 13802 return null;
13034 } 13803 }
13804
13035 R visitCommentReference(CommentReference node) { 13805 R visitCommentReference(CommentReference node) {
13036 node.visitChildren(this); 13806 node.visitChildren(this);
13037 return null; 13807 return null;
13038 } 13808 }
13809
13039 R visitCompilationUnit(CompilationUnit node) { 13810 R visitCompilationUnit(CompilationUnit node) {
13040 node.visitChildren(this); 13811 node.visitChildren(this);
13041 return null; 13812 return null;
13042 } 13813 }
13814
13043 R visitConditionalExpression(ConditionalExpression node) { 13815 R visitConditionalExpression(ConditionalExpression node) {
13044 node.visitChildren(this); 13816 node.visitChildren(this);
13045 return null; 13817 return null;
13046 } 13818 }
13819
13047 R visitConstructorDeclaration(ConstructorDeclaration node) { 13820 R visitConstructorDeclaration(ConstructorDeclaration node) {
13048 node.visitChildren(this); 13821 node.visitChildren(this);
13049 return null; 13822 return null;
13050 } 13823 }
13824
13051 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) { 13825 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
13052 node.visitChildren(this); 13826 node.visitChildren(this);
13053 return null; 13827 return null;
13054 } 13828 }
13829
13055 R visitConstructorName(ConstructorName node) { 13830 R visitConstructorName(ConstructorName node) {
13056 node.visitChildren(this); 13831 node.visitChildren(this);
13057 return null; 13832 return null;
13058 } 13833 }
13834
13059 R visitContinueStatement(ContinueStatement node) { 13835 R visitContinueStatement(ContinueStatement node) {
13060 node.visitChildren(this); 13836 node.visitChildren(this);
13061 return null; 13837 return null;
13062 } 13838 }
13839
13063 R visitDeclaredIdentifier(DeclaredIdentifier node) { 13840 R visitDeclaredIdentifier(DeclaredIdentifier node) {
13064 node.visitChildren(this); 13841 node.visitChildren(this);
13065 return null; 13842 return null;
13066 } 13843 }
13844
13067 R visitDefaultFormalParameter(DefaultFormalParameter node) { 13845 R visitDefaultFormalParameter(DefaultFormalParameter node) {
13068 node.visitChildren(this); 13846 node.visitChildren(this);
13069 return null; 13847 return null;
13070 } 13848 }
13849
13071 R visitDoStatement(DoStatement node) { 13850 R visitDoStatement(DoStatement node) {
13072 node.visitChildren(this); 13851 node.visitChildren(this);
13073 return null; 13852 return null;
13074 } 13853 }
13854
13075 R visitDoubleLiteral(DoubleLiteral node) { 13855 R visitDoubleLiteral(DoubleLiteral node) {
13076 node.visitChildren(this); 13856 node.visitChildren(this);
13077 return null; 13857 return null;
13078 } 13858 }
13859
13079 R visitEmptyFunctionBody(EmptyFunctionBody node) { 13860 R visitEmptyFunctionBody(EmptyFunctionBody node) {
13080 node.visitChildren(this); 13861 node.visitChildren(this);
13081 return null; 13862 return null;
13082 } 13863 }
13864
13083 R visitEmptyStatement(EmptyStatement node) { 13865 R visitEmptyStatement(EmptyStatement node) {
13084 node.visitChildren(this); 13866 node.visitChildren(this);
13085 return null; 13867 return null;
13086 } 13868 }
13869
13087 R visitExportDirective(ExportDirective node) { 13870 R visitExportDirective(ExportDirective node) {
13088 node.visitChildren(this); 13871 node.visitChildren(this);
13089 return null; 13872 return null;
13090 } 13873 }
13874
13091 R visitExpressionFunctionBody(ExpressionFunctionBody node) { 13875 R visitExpressionFunctionBody(ExpressionFunctionBody node) {
13092 node.visitChildren(this); 13876 node.visitChildren(this);
13093 return null; 13877 return null;
13094 } 13878 }
13879
13095 R visitExpressionStatement(ExpressionStatement node) { 13880 R visitExpressionStatement(ExpressionStatement node) {
13096 node.visitChildren(this); 13881 node.visitChildren(this);
13097 return null; 13882 return null;
13098 } 13883 }
13884
13099 R visitExtendsClause(ExtendsClause node) { 13885 R visitExtendsClause(ExtendsClause node) {
13100 node.visitChildren(this); 13886 node.visitChildren(this);
13101 return null; 13887 return null;
13102 } 13888 }
13889
13103 R visitFieldDeclaration(FieldDeclaration node) { 13890 R visitFieldDeclaration(FieldDeclaration node) {
13104 node.visitChildren(this); 13891 node.visitChildren(this);
13105 return null; 13892 return null;
13106 } 13893 }
13894
13107 R visitFieldFormalParameter(FieldFormalParameter node) { 13895 R visitFieldFormalParameter(FieldFormalParameter node) {
13108 node.visitChildren(this); 13896 node.visitChildren(this);
13109 return null; 13897 return null;
13110 } 13898 }
13899
13111 R visitForEachStatement(ForEachStatement node) { 13900 R visitForEachStatement(ForEachStatement node) {
13112 node.visitChildren(this); 13901 node.visitChildren(this);
13113 return null; 13902 return null;
13114 } 13903 }
13904
13115 R visitFormalParameterList(FormalParameterList node) { 13905 R visitFormalParameterList(FormalParameterList node) {
13116 node.visitChildren(this); 13906 node.visitChildren(this);
13117 return null; 13907 return null;
13118 } 13908 }
13909
13119 R visitForStatement(ForStatement node) { 13910 R visitForStatement(ForStatement node) {
13120 node.visitChildren(this); 13911 node.visitChildren(this);
13121 return null; 13912 return null;
13122 } 13913 }
13914
13123 R visitFunctionDeclaration(FunctionDeclaration node) { 13915 R visitFunctionDeclaration(FunctionDeclaration node) {
13124 node.visitChildren(this); 13916 node.visitChildren(this);
13125 return null; 13917 return null;
13126 } 13918 }
13919
13127 R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { 13920 R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
13128 node.visitChildren(this); 13921 node.visitChildren(this);
13129 return null; 13922 return null;
13130 } 13923 }
13924
13131 R visitFunctionExpression(FunctionExpression node) { 13925 R visitFunctionExpression(FunctionExpression node) {
13132 node.visitChildren(this); 13926 node.visitChildren(this);
13133 return null; 13927 return null;
13134 } 13928 }
13929
13135 R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { 13930 R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
13136 node.visitChildren(this); 13931 node.visitChildren(this);
13137 return null; 13932 return null;
13138 } 13933 }
13934
13139 R visitFunctionTypeAlias(FunctionTypeAlias node) { 13935 R visitFunctionTypeAlias(FunctionTypeAlias node) {
13140 node.visitChildren(this); 13936 node.visitChildren(this);
13141 return null; 13937 return null;
13142 } 13938 }
13939
13143 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { 13940 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
13144 node.visitChildren(this); 13941 node.visitChildren(this);
13145 return null; 13942 return null;
13146 } 13943 }
13944
13147 R visitHideCombinator(HideCombinator node) { 13945 R visitHideCombinator(HideCombinator node) {
13148 node.visitChildren(this); 13946 node.visitChildren(this);
13149 return null; 13947 return null;
13150 } 13948 }
13949
13151 R visitIfStatement(IfStatement node) { 13950 R visitIfStatement(IfStatement node) {
13152 node.visitChildren(this); 13951 node.visitChildren(this);
13153 return null; 13952 return null;
13154 } 13953 }
13954
13155 R visitImplementsClause(ImplementsClause node) { 13955 R visitImplementsClause(ImplementsClause node) {
13156 node.visitChildren(this); 13956 node.visitChildren(this);
13157 return null; 13957 return null;
13158 } 13958 }
13959
13159 R visitImportDirective(ImportDirective node) { 13960 R visitImportDirective(ImportDirective node) {
13160 node.visitChildren(this); 13961 node.visitChildren(this);
13161 return null; 13962 return null;
13162 } 13963 }
13964
13163 R visitIndexExpression(IndexExpression node) { 13965 R visitIndexExpression(IndexExpression node) {
13164 node.visitChildren(this); 13966 node.visitChildren(this);
13165 return null; 13967 return null;
13166 } 13968 }
13969
13167 R visitInstanceCreationExpression(InstanceCreationExpression node) { 13970 R visitInstanceCreationExpression(InstanceCreationExpression node) {
13168 node.visitChildren(this); 13971 node.visitChildren(this);
13169 return null; 13972 return null;
13170 } 13973 }
13974
13171 R visitIntegerLiteral(IntegerLiteral node) { 13975 R visitIntegerLiteral(IntegerLiteral node) {
13172 node.visitChildren(this); 13976 node.visitChildren(this);
13173 return null; 13977 return null;
13174 } 13978 }
13979
13175 R visitInterpolationExpression(InterpolationExpression node) { 13980 R visitInterpolationExpression(InterpolationExpression node) {
13176 node.visitChildren(this); 13981 node.visitChildren(this);
13177 return null; 13982 return null;
13178 } 13983 }
13984
13179 R visitInterpolationString(InterpolationString node) { 13985 R visitInterpolationString(InterpolationString node) {
13180 node.visitChildren(this); 13986 node.visitChildren(this);
13181 return null; 13987 return null;
13182 } 13988 }
13989
13183 R visitIsExpression(IsExpression node) { 13990 R visitIsExpression(IsExpression node) {
13184 node.visitChildren(this); 13991 node.visitChildren(this);
13185 return null; 13992 return null;
13186 } 13993 }
13994
13187 R visitLabel(Label node) { 13995 R visitLabel(Label node) {
13188 node.visitChildren(this); 13996 node.visitChildren(this);
13189 return null; 13997 return null;
13190 } 13998 }
13999
13191 R visitLabeledStatement(LabeledStatement node) { 14000 R visitLabeledStatement(LabeledStatement node) {
13192 node.visitChildren(this); 14001 node.visitChildren(this);
13193 return null; 14002 return null;
13194 } 14003 }
14004
13195 R visitLibraryDirective(LibraryDirective node) { 14005 R visitLibraryDirective(LibraryDirective node) {
13196 node.visitChildren(this); 14006 node.visitChildren(this);
13197 return null; 14007 return null;
13198 } 14008 }
14009
13199 R visitLibraryIdentifier(LibraryIdentifier node) { 14010 R visitLibraryIdentifier(LibraryIdentifier node) {
13200 node.visitChildren(this); 14011 node.visitChildren(this);
13201 return null; 14012 return null;
13202 } 14013 }
14014
13203 R visitListLiteral(ListLiteral node) { 14015 R visitListLiteral(ListLiteral node) {
13204 node.visitChildren(this); 14016 node.visitChildren(this);
13205 return null; 14017 return null;
13206 } 14018 }
14019
13207 R visitMapLiteral(MapLiteral node) { 14020 R visitMapLiteral(MapLiteral node) {
13208 node.visitChildren(this); 14021 node.visitChildren(this);
13209 return null; 14022 return null;
13210 } 14023 }
14024
13211 R visitMapLiteralEntry(MapLiteralEntry node) { 14025 R visitMapLiteralEntry(MapLiteralEntry node) {
13212 node.visitChildren(this); 14026 node.visitChildren(this);
13213 return null; 14027 return null;
13214 } 14028 }
14029
13215 R visitMethodDeclaration(MethodDeclaration node) { 14030 R visitMethodDeclaration(MethodDeclaration node) {
13216 node.visitChildren(this); 14031 node.visitChildren(this);
13217 return null; 14032 return null;
13218 } 14033 }
14034
13219 R visitMethodInvocation(MethodInvocation node) { 14035 R visitMethodInvocation(MethodInvocation node) {
13220 node.visitChildren(this); 14036 node.visitChildren(this);
13221 return null; 14037 return null;
13222 } 14038 }
14039
13223 R visitNamedExpression(NamedExpression node) { 14040 R visitNamedExpression(NamedExpression node) {
13224 node.visitChildren(this); 14041 node.visitChildren(this);
13225 return null; 14042 return null;
13226 } 14043 }
14044
13227 R visitNativeClause(NativeClause node) { 14045 R visitNativeClause(NativeClause node) {
13228 node.visitChildren(this); 14046 node.visitChildren(this);
13229 return null; 14047 return null;
13230 } 14048 }
14049
13231 R visitNativeFunctionBody(NativeFunctionBody node) { 14050 R visitNativeFunctionBody(NativeFunctionBody node) {
13232 node.visitChildren(this); 14051 node.visitChildren(this);
13233 return null; 14052 return null;
13234 } 14053 }
14054
13235 R visitNullLiteral(NullLiteral node) { 14055 R visitNullLiteral(NullLiteral node) {
13236 node.visitChildren(this); 14056 node.visitChildren(this);
13237 return null; 14057 return null;
13238 } 14058 }
14059
13239 R visitParenthesizedExpression(ParenthesizedExpression node) { 14060 R visitParenthesizedExpression(ParenthesizedExpression node) {
13240 node.visitChildren(this); 14061 node.visitChildren(this);
13241 return null; 14062 return null;
13242 } 14063 }
14064
13243 R visitPartDirective(PartDirective node) { 14065 R visitPartDirective(PartDirective node) {
13244 node.visitChildren(this); 14066 node.visitChildren(this);
13245 return null; 14067 return null;
13246 } 14068 }
14069
13247 R visitPartOfDirective(PartOfDirective node) { 14070 R visitPartOfDirective(PartOfDirective node) {
13248 node.visitChildren(this); 14071 node.visitChildren(this);
13249 return null; 14072 return null;
13250 } 14073 }
14074
13251 R visitPostfixExpression(PostfixExpression node) { 14075 R visitPostfixExpression(PostfixExpression node) {
13252 node.visitChildren(this); 14076 node.visitChildren(this);
13253 return null; 14077 return null;
13254 } 14078 }
14079
13255 R visitPrefixedIdentifier(PrefixedIdentifier node) { 14080 R visitPrefixedIdentifier(PrefixedIdentifier node) {
13256 node.visitChildren(this); 14081 node.visitChildren(this);
13257 return null; 14082 return null;
13258 } 14083 }
14084
13259 R visitPrefixExpression(PrefixExpression node) { 14085 R visitPrefixExpression(PrefixExpression node) {
13260 node.visitChildren(this); 14086 node.visitChildren(this);
13261 return null; 14087 return null;
13262 } 14088 }
14089
13263 R visitPropertyAccess(PropertyAccess node) { 14090 R visitPropertyAccess(PropertyAccess node) {
13264 node.visitChildren(this); 14091 node.visitChildren(this);
13265 return null; 14092 return null;
13266 } 14093 }
14094
13267 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) { 14095 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
13268 node.visitChildren(this); 14096 node.visitChildren(this);
13269 return null; 14097 return null;
13270 } 14098 }
14099
13271 R visitRethrowExpression(RethrowExpression node) { 14100 R visitRethrowExpression(RethrowExpression node) {
13272 node.visitChildren(this); 14101 node.visitChildren(this);
13273 return null; 14102 return null;
13274 } 14103 }
14104
13275 R visitReturnStatement(ReturnStatement node) { 14105 R visitReturnStatement(ReturnStatement node) {
13276 node.visitChildren(this); 14106 node.visitChildren(this);
13277 return null; 14107 return null;
13278 } 14108 }
14109
13279 R visitScriptTag(ScriptTag node) { 14110 R visitScriptTag(ScriptTag node) {
13280 node.visitChildren(this); 14111 node.visitChildren(this);
13281 return null; 14112 return null;
13282 } 14113 }
14114
13283 R visitShowCombinator(ShowCombinator node) { 14115 R visitShowCombinator(ShowCombinator node) {
13284 node.visitChildren(this); 14116 node.visitChildren(this);
13285 return null; 14117 return null;
13286 } 14118 }
14119
13287 R visitSimpleFormalParameter(SimpleFormalParameter node) { 14120 R visitSimpleFormalParameter(SimpleFormalParameter node) {
13288 node.visitChildren(this); 14121 node.visitChildren(this);
13289 return null; 14122 return null;
13290 } 14123 }
14124
13291 R visitSimpleIdentifier(SimpleIdentifier node) { 14125 R visitSimpleIdentifier(SimpleIdentifier node) {
13292 node.visitChildren(this); 14126 node.visitChildren(this);
13293 return null; 14127 return null;
13294 } 14128 }
14129
13295 R visitSimpleStringLiteral(SimpleStringLiteral node) { 14130 R visitSimpleStringLiteral(SimpleStringLiteral node) {
13296 node.visitChildren(this); 14131 node.visitChildren(this);
13297 return null; 14132 return null;
13298 } 14133 }
14134
13299 R visitStringInterpolation(StringInterpolation node) { 14135 R visitStringInterpolation(StringInterpolation node) {
13300 node.visitChildren(this); 14136 node.visitChildren(this);
13301 return null; 14137 return null;
13302 } 14138 }
14139
13303 R visitSuperConstructorInvocation(SuperConstructorInvocation node) { 14140 R visitSuperConstructorInvocation(SuperConstructorInvocation node) {
13304 node.visitChildren(this); 14141 node.visitChildren(this);
13305 return null; 14142 return null;
13306 } 14143 }
14144
13307 R visitSuperExpression(SuperExpression node) { 14145 R visitSuperExpression(SuperExpression node) {
13308 node.visitChildren(this); 14146 node.visitChildren(this);
13309 return null; 14147 return null;
13310 } 14148 }
14149
13311 R visitSwitchCase(SwitchCase node) { 14150 R visitSwitchCase(SwitchCase node) {
13312 node.visitChildren(this); 14151 node.visitChildren(this);
13313 return null; 14152 return null;
13314 } 14153 }
14154
13315 R visitSwitchDefault(SwitchDefault node) { 14155 R visitSwitchDefault(SwitchDefault node) {
13316 node.visitChildren(this); 14156 node.visitChildren(this);
13317 return null; 14157 return null;
13318 } 14158 }
14159
13319 R visitSwitchStatement(SwitchStatement node) { 14160 R visitSwitchStatement(SwitchStatement node) {
13320 node.visitChildren(this); 14161 node.visitChildren(this);
13321 return null; 14162 return null;
13322 } 14163 }
14164
13323 R visitSymbolLiteral(SymbolLiteral node) { 14165 R visitSymbolLiteral(SymbolLiteral node) {
13324 node.visitChildren(this); 14166 node.visitChildren(this);
13325 return null; 14167 return null;
13326 } 14168 }
14169
13327 R visitThisExpression(ThisExpression node) { 14170 R visitThisExpression(ThisExpression node) {
13328 node.visitChildren(this); 14171 node.visitChildren(this);
13329 return null; 14172 return null;
13330 } 14173 }
14174
13331 R visitThrowExpression(ThrowExpression node) { 14175 R visitThrowExpression(ThrowExpression node) {
13332 node.visitChildren(this); 14176 node.visitChildren(this);
13333 return null; 14177 return null;
13334 } 14178 }
14179
13335 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { 14180 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
13336 node.visitChildren(this); 14181 node.visitChildren(this);
13337 return null; 14182 return null;
13338 } 14183 }
14184
13339 R visitTryStatement(TryStatement node) { 14185 R visitTryStatement(TryStatement node) {
13340 node.visitChildren(this); 14186 node.visitChildren(this);
13341 return null; 14187 return null;
13342 } 14188 }
14189
13343 R visitTypeArgumentList(TypeArgumentList node) { 14190 R visitTypeArgumentList(TypeArgumentList node) {
13344 node.visitChildren(this); 14191 node.visitChildren(this);
13345 return null; 14192 return null;
13346 } 14193 }
14194
13347 R visitTypeName(TypeName node) { 14195 R visitTypeName(TypeName node) {
13348 node.visitChildren(this); 14196 node.visitChildren(this);
13349 return null; 14197 return null;
13350 } 14198 }
14199
13351 R visitTypeParameter(TypeParameter node) { 14200 R visitTypeParameter(TypeParameter node) {
13352 node.visitChildren(this); 14201 node.visitChildren(this);
13353 return null; 14202 return null;
13354 } 14203 }
14204
13355 R visitTypeParameterList(TypeParameterList node) { 14205 R visitTypeParameterList(TypeParameterList node) {
13356 node.visitChildren(this); 14206 node.visitChildren(this);
13357 return null; 14207 return null;
13358 } 14208 }
14209
13359 R visitVariableDeclaration(VariableDeclaration node) { 14210 R visitVariableDeclaration(VariableDeclaration node) {
13360 node.visitChildren(this); 14211 node.visitChildren(this);
13361 return null; 14212 return null;
13362 } 14213 }
14214
13363 R visitVariableDeclarationList(VariableDeclarationList node) { 14215 R visitVariableDeclarationList(VariableDeclarationList node) {
13364 node.visitChildren(this); 14216 node.visitChildren(this);
13365 return null; 14217 return null;
13366 } 14218 }
14219
13367 R visitVariableDeclarationStatement(VariableDeclarationStatement node) { 14220 R visitVariableDeclarationStatement(VariableDeclarationStatement node) {
13368 node.visitChildren(this); 14221 node.visitChildren(this);
13369 return null; 14222 return null;
13370 } 14223 }
14224
13371 R visitWhileStatement(WhileStatement node) { 14225 R visitWhileStatement(WhileStatement node) {
13372 node.visitChildren(this); 14226 node.visitChildren(this);
13373 return null; 14227 return null;
13374 } 14228 }
14229
13375 R visitWithClause(WithClause node) { 14230 R visitWithClause(WithClause node) {
13376 node.visitChildren(this); 14231 node.visitChildren(this);
13377 return null; 14232 return null;
13378 } 14233 }
13379 } 14234 }
14235
13380 /** 14236 /**
13381 * Instances of the class `SimpleASTVisitor` implement an AST visitor that will do nothing 14237 * Instances of the class `SimpleASTVisitor` implement an AST visitor that will do nothing
13382 * when visiting an AST node. It is intended to be a superclass for classes that use the visitor 14238 * when visiting an AST node. It is intended to be a superclass for classes that use the visitor
13383 * pattern primarily as a dispatch mechanism (and hence don't need to recursivel y visit a whole 14239 * pattern primarily as a dispatch mechanism (and hence don't need to recursivel y visit a whole
13384 * structure) and that only need to visit a small number of node types. 14240 * structure) and that only need to visit a small number of node types.
13385 * 14241 *
13386 * @coverage dart.engine.ast 14242 * @coverage dart.engine.ast
13387 */ 14243 */
13388 class SimpleASTVisitor<R> implements ASTVisitor<R> { 14244 class SimpleASTVisitor<R> implements ASTVisitor<R> {
13389 R visitAdjacentStrings(AdjacentStrings node) => null; 14245 R visitAdjacentStrings(AdjacentStrings node) => null;
14246
13390 R visitAnnotation(Annotation node) => null; 14247 R visitAnnotation(Annotation node) => null;
14248
13391 R visitArgumentDefinitionTest(ArgumentDefinitionTest node) => null; 14249 R visitArgumentDefinitionTest(ArgumentDefinitionTest node) => null;
14250
13392 R visitArgumentList(ArgumentList node) => null; 14251 R visitArgumentList(ArgumentList node) => null;
14252
13393 R visitAsExpression(AsExpression node) => null; 14253 R visitAsExpression(AsExpression node) => null;
14254
13394 R visitAssertStatement(AssertStatement node) => null; 14255 R visitAssertStatement(AssertStatement node) => null;
14256
13395 R visitAssignmentExpression(AssignmentExpression node) => null; 14257 R visitAssignmentExpression(AssignmentExpression node) => null;
14258
13396 R visitBinaryExpression(BinaryExpression node) => null; 14259 R visitBinaryExpression(BinaryExpression node) => null;
14260
13397 R visitBlock(Block node) => null; 14261 R visitBlock(Block node) => null;
14262
13398 R visitBlockFunctionBody(BlockFunctionBody node) => null; 14263 R visitBlockFunctionBody(BlockFunctionBody node) => null;
14264
13399 R visitBooleanLiteral(BooleanLiteral node) => null; 14265 R visitBooleanLiteral(BooleanLiteral node) => null;
14266
13400 R visitBreakStatement(BreakStatement node) => null; 14267 R visitBreakStatement(BreakStatement node) => null;
14268
13401 R visitCascadeExpression(CascadeExpression node) => null; 14269 R visitCascadeExpression(CascadeExpression node) => null;
14270
13402 R visitCatchClause(CatchClause node) => null; 14271 R visitCatchClause(CatchClause node) => null;
14272
13403 R visitClassDeclaration(ClassDeclaration node) => null; 14273 R visitClassDeclaration(ClassDeclaration node) => null;
14274
13404 R visitClassTypeAlias(ClassTypeAlias node) => null; 14275 R visitClassTypeAlias(ClassTypeAlias node) => null;
14276
13405 R visitComment(Comment node) => null; 14277 R visitComment(Comment node) => null;
14278
13406 R visitCommentReference(CommentReference node) => null; 14279 R visitCommentReference(CommentReference node) => null;
14280
13407 R visitCompilationUnit(CompilationUnit node) => null; 14281 R visitCompilationUnit(CompilationUnit node) => null;
14282
13408 R visitConditionalExpression(ConditionalExpression node) => null; 14283 R visitConditionalExpression(ConditionalExpression node) => null;
14284
13409 R visitConstructorDeclaration(ConstructorDeclaration node) => null; 14285 R visitConstructorDeclaration(ConstructorDeclaration node) => null;
14286
13410 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => null; 14287 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => null;
14288
13411 R visitConstructorName(ConstructorName node) => null; 14289 R visitConstructorName(ConstructorName node) => null;
14290
13412 R visitContinueStatement(ContinueStatement node) => null; 14291 R visitContinueStatement(ContinueStatement node) => null;
14292
13413 R visitDeclaredIdentifier(DeclaredIdentifier node) => null; 14293 R visitDeclaredIdentifier(DeclaredIdentifier node) => null;
14294
13414 R visitDefaultFormalParameter(DefaultFormalParameter node) => null; 14295 R visitDefaultFormalParameter(DefaultFormalParameter node) => null;
14296
13415 R visitDoStatement(DoStatement node) => null; 14297 R visitDoStatement(DoStatement node) => null;
14298
13416 R visitDoubleLiteral(DoubleLiteral node) => null; 14299 R visitDoubleLiteral(DoubleLiteral node) => null;
14300
13417 R visitEmptyFunctionBody(EmptyFunctionBody node) => null; 14301 R visitEmptyFunctionBody(EmptyFunctionBody node) => null;
14302
13418 R visitEmptyStatement(EmptyStatement node) => null; 14303 R visitEmptyStatement(EmptyStatement node) => null;
14304
13419 R visitExportDirective(ExportDirective node) => null; 14305 R visitExportDirective(ExportDirective node) => null;
14306
13420 R visitExpressionFunctionBody(ExpressionFunctionBody node) => null; 14307 R visitExpressionFunctionBody(ExpressionFunctionBody node) => null;
14308
13421 R visitExpressionStatement(ExpressionStatement node) => null; 14309 R visitExpressionStatement(ExpressionStatement node) => null;
14310
13422 R visitExtendsClause(ExtendsClause node) => null; 14311 R visitExtendsClause(ExtendsClause node) => null;
14312
13423 R visitFieldDeclaration(FieldDeclaration node) => null; 14313 R visitFieldDeclaration(FieldDeclaration node) => null;
14314
13424 R visitFieldFormalParameter(FieldFormalParameter node) => null; 14315 R visitFieldFormalParameter(FieldFormalParameter node) => null;
14316
13425 R visitForEachStatement(ForEachStatement node) => null; 14317 R visitForEachStatement(ForEachStatement node) => null;
14318
13426 R visitFormalParameterList(FormalParameterList node) => null; 14319 R visitFormalParameterList(FormalParameterList node) => null;
14320
13427 R visitForStatement(ForStatement node) => null; 14321 R visitForStatement(ForStatement node) => null;
14322
13428 R visitFunctionDeclaration(FunctionDeclaration node) => null; 14323 R visitFunctionDeclaration(FunctionDeclaration node) => null;
14324
13429 R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => null ; 14325 R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => null ;
14326
13430 R visitFunctionExpression(FunctionExpression node) => null; 14327 R visitFunctionExpression(FunctionExpression node) => null;
14328
13431 R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => null ; 14329 R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => null ;
14330
13432 R visitFunctionTypeAlias(FunctionTypeAlias node) => null; 14331 R visitFunctionTypeAlias(FunctionTypeAlias node) => null;
14332
13433 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => null ; 14333 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => null ;
14334
13434 R visitHideCombinator(HideCombinator node) => null; 14335 R visitHideCombinator(HideCombinator node) => null;
14336
13435 R visitIfStatement(IfStatement node) => null; 14337 R visitIfStatement(IfStatement node) => null;
14338
13436 R visitImplementsClause(ImplementsClause node) => null; 14339 R visitImplementsClause(ImplementsClause node) => null;
14340
13437 R visitImportDirective(ImportDirective node) => null; 14341 R visitImportDirective(ImportDirective node) => null;
14342
13438 R visitIndexExpression(IndexExpression node) => null; 14343 R visitIndexExpression(IndexExpression node) => null;
14344
13439 R visitInstanceCreationExpression(InstanceCreationExpression node) => null; 14345 R visitInstanceCreationExpression(InstanceCreationExpression node) => null;
14346
13440 R visitIntegerLiteral(IntegerLiteral node) => null; 14347 R visitIntegerLiteral(IntegerLiteral node) => null;
14348
13441 R visitInterpolationExpression(InterpolationExpression node) => null; 14349 R visitInterpolationExpression(InterpolationExpression node) => null;
14350
13442 R visitInterpolationString(InterpolationString node) => null; 14351 R visitInterpolationString(InterpolationString node) => null;
14352
13443 R visitIsExpression(IsExpression node) => null; 14353 R visitIsExpression(IsExpression node) => null;
14354
13444 R visitLabel(Label node) => null; 14355 R visitLabel(Label node) => null;
14356
13445 R visitLabeledStatement(LabeledStatement node) => null; 14357 R visitLabeledStatement(LabeledStatement node) => null;
14358
13446 R visitLibraryDirective(LibraryDirective node) => null; 14359 R visitLibraryDirective(LibraryDirective node) => null;
14360
13447 R visitLibraryIdentifier(LibraryIdentifier node) => null; 14361 R visitLibraryIdentifier(LibraryIdentifier node) => null;
14362
13448 R visitListLiteral(ListLiteral node) => null; 14363 R visitListLiteral(ListLiteral node) => null;
14364
13449 R visitMapLiteral(MapLiteral node) => null; 14365 R visitMapLiteral(MapLiteral node) => null;
14366
13450 R visitMapLiteralEntry(MapLiteralEntry node) => null; 14367 R visitMapLiteralEntry(MapLiteralEntry node) => null;
14368
13451 R visitMethodDeclaration(MethodDeclaration node) => null; 14369 R visitMethodDeclaration(MethodDeclaration node) => null;
14370
13452 R visitMethodInvocation(MethodInvocation node) => null; 14371 R visitMethodInvocation(MethodInvocation node) => null;
14372
13453 R visitNamedExpression(NamedExpression node) => null; 14373 R visitNamedExpression(NamedExpression node) => null;
14374
13454 R visitNativeClause(NativeClause node) => null; 14375 R visitNativeClause(NativeClause node) => null;
14376
13455 R visitNativeFunctionBody(NativeFunctionBody node) => null; 14377 R visitNativeFunctionBody(NativeFunctionBody node) => null;
14378
13456 R visitNullLiteral(NullLiteral node) => null; 14379 R visitNullLiteral(NullLiteral node) => null;
14380
13457 R visitParenthesizedExpression(ParenthesizedExpression node) => null; 14381 R visitParenthesizedExpression(ParenthesizedExpression node) => null;
14382
13458 R visitPartDirective(PartDirective node) => null; 14383 R visitPartDirective(PartDirective node) => null;
14384
13459 R visitPartOfDirective(PartOfDirective node) => null; 14385 R visitPartOfDirective(PartOfDirective node) => null;
14386
13460 R visitPostfixExpression(PostfixExpression node) => null; 14387 R visitPostfixExpression(PostfixExpression node) => null;
14388
13461 R visitPrefixedIdentifier(PrefixedIdentifier node) => null; 14389 R visitPrefixedIdentifier(PrefixedIdentifier node) => null;
14390
13462 R visitPrefixExpression(PrefixExpression node) => null; 14391 R visitPrefixExpression(PrefixExpression node) => null;
14392
13463 R visitPropertyAccess(PropertyAccess node) => null; 14393 R visitPropertyAccess(PropertyAccess node) => null;
14394
13464 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => null; 14395 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => null;
14396
13465 R visitRethrowExpression(RethrowExpression node) => null; 14397 R visitRethrowExpression(RethrowExpression node) => null;
14398
13466 R visitReturnStatement(ReturnStatement node) => null; 14399 R visitReturnStatement(ReturnStatement node) => null;
14400
13467 R visitScriptTag(ScriptTag node) => null; 14401 R visitScriptTag(ScriptTag node) => null;
14402
13468 R visitShowCombinator(ShowCombinator node) => null; 14403 R visitShowCombinator(ShowCombinator node) => null;
14404
13469 R visitSimpleFormalParameter(SimpleFormalParameter node) => null; 14405 R visitSimpleFormalParameter(SimpleFormalParameter node) => null;
14406
13470 R visitSimpleIdentifier(SimpleIdentifier node) => null; 14407 R visitSimpleIdentifier(SimpleIdentifier node) => null;
14408
13471 R visitSimpleStringLiteral(SimpleStringLiteral node) => null; 14409 R visitSimpleStringLiteral(SimpleStringLiteral node) => null;
14410
13472 R visitStringInterpolation(StringInterpolation node) => null; 14411 R visitStringInterpolation(StringInterpolation node) => null;
14412
13473 R visitSuperConstructorInvocation(SuperConstructorInvocation node) => null; 14413 R visitSuperConstructorInvocation(SuperConstructorInvocation node) => null;
14414
13474 R visitSuperExpression(SuperExpression node) => null; 14415 R visitSuperExpression(SuperExpression node) => null;
14416
13475 R visitSwitchCase(SwitchCase node) => null; 14417 R visitSwitchCase(SwitchCase node) => null;
14418
13476 R visitSwitchDefault(SwitchDefault node) => null; 14419 R visitSwitchDefault(SwitchDefault node) => null;
14420
13477 R visitSwitchStatement(SwitchStatement node) => null; 14421 R visitSwitchStatement(SwitchStatement node) => null;
14422
13478 R visitSymbolLiteral(SymbolLiteral node) => null; 14423 R visitSymbolLiteral(SymbolLiteral node) => null;
14424
13479 R visitThisExpression(ThisExpression node) => null; 14425 R visitThisExpression(ThisExpression node) => null;
14426
13480 R visitThrowExpression(ThrowExpression node) => null; 14427 R visitThrowExpression(ThrowExpression node) => null;
14428
13481 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => null; 14429 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => null;
14430
13482 R visitTryStatement(TryStatement node) => null; 14431 R visitTryStatement(TryStatement node) => null;
14432
13483 R visitTypeArgumentList(TypeArgumentList node) => null; 14433 R visitTypeArgumentList(TypeArgumentList node) => null;
14434
13484 R visitTypeName(TypeName node) => null; 14435 R visitTypeName(TypeName node) => null;
14436
13485 R visitTypeParameter(TypeParameter node) => null; 14437 R visitTypeParameter(TypeParameter node) => null;
14438
13486 R visitTypeParameterList(TypeParameterList node) => null; 14439 R visitTypeParameterList(TypeParameterList node) => null;
14440
13487 R visitVariableDeclaration(VariableDeclaration node) => null; 14441 R visitVariableDeclaration(VariableDeclaration node) => null;
14442
13488 R visitVariableDeclarationList(VariableDeclarationList node) => null; 14443 R visitVariableDeclarationList(VariableDeclarationList node) => null;
14444
13489 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => null ; 14445 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => null ;
14446
13490 R visitWhileStatement(WhileStatement node) => null; 14447 R visitWhileStatement(WhileStatement node) => null;
14448
13491 R visitWithClause(WithClause node) => null; 14449 R visitWithClause(WithClause node) => null;
13492 } 14450 }
14451
13493 /** 14452 /**
13494 * Instances of the class `ToSourceVisitor` write a source representation of a v isited AST 14453 * Instances of the class `ToSourceVisitor` write a source representation of a v isited AST
13495 * node (and all of it's children) to a writer. 14454 * node (and all of it's children) to a writer.
13496 * 14455 *
13497 * @coverage dart.engine.ast 14456 * @coverage dart.engine.ast
13498 */ 14457 */
13499 class ToSourceVisitor implements ASTVisitor<Object> { 14458 class ToSourceVisitor implements ASTVisitor<Object> {
13500
13501 /** 14459 /**
13502 * The writer to which the source is to be written. 14460 * The writer to which the source is to be written.
13503 */ 14461 */
13504 PrintWriter _writer; 14462 PrintWriter _writer;
13505 14463
13506 /** 14464 /**
13507 * Initialize a newly created visitor to write source code representing the vi sited nodes to the 14465 * Initialize a newly created visitor to write source code representing the vi sited nodes to the
13508 * given writer. 14466 * given writer.
13509 * 14467 *
13510 * @param writer the writer to which the source is to be written 14468 * @param writer the writer to which the source is to be written
13511 */ 14469 */
13512 ToSourceVisitor(PrintWriter writer) { 14470 ToSourceVisitor(PrintWriter writer) {
13513 this._writer = writer; 14471 this._writer = writer;
13514 } 14472 }
14473
13515 Object visitAdjacentStrings(AdjacentStrings node) { 14474 Object visitAdjacentStrings(AdjacentStrings node) {
13516 visitList2(node.strings, " "); 14475 visitList2(node.strings, " ");
13517 return null; 14476 return null;
13518 } 14477 }
14478
13519 Object visitAnnotation(Annotation node) { 14479 Object visitAnnotation(Annotation node) {
13520 _writer.print('@'); 14480 _writer.print('@');
13521 visit(node.name); 14481 visit(node.name);
13522 visit3(".", node.constructorName); 14482 visit3(".", node.constructorName);
13523 visit(node.arguments); 14483 visit(node.arguments);
13524 return null; 14484 return null;
13525 } 14485 }
14486
13526 Object visitArgumentDefinitionTest(ArgumentDefinitionTest node) { 14487 Object visitArgumentDefinitionTest(ArgumentDefinitionTest node) {
13527 _writer.print('?'); 14488 _writer.print('?');
13528 visit(node.identifier); 14489 visit(node.identifier);
13529 return null; 14490 return null;
13530 } 14491 }
14492
13531 Object visitArgumentList(ArgumentList node) { 14493 Object visitArgumentList(ArgumentList node) {
13532 _writer.print('('); 14494 _writer.print('(');
13533 visitList2(node.arguments, ", "); 14495 visitList2(node.arguments, ", ");
13534 _writer.print(')'); 14496 _writer.print(')');
13535 return null; 14497 return null;
13536 } 14498 }
14499
13537 Object visitAsExpression(AsExpression node) { 14500 Object visitAsExpression(AsExpression node) {
13538 visit(node.expression); 14501 visit(node.expression);
13539 _writer.print(" as "); 14502 _writer.print(" as ");
13540 visit(node.type); 14503 visit(node.type);
13541 return null; 14504 return null;
13542 } 14505 }
14506
13543 Object visitAssertStatement(AssertStatement node) { 14507 Object visitAssertStatement(AssertStatement node) {
13544 _writer.print("assert ("); 14508 _writer.print("assert (");
13545 visit(node.condition); 14509 visit(node.condition);
13546 _writer.print(");"); 14510 _writer.print(");");
13547 return null; 14511 return null;
13548 } 14512 }
14513
13549 Object visitAssignmentExpression(AssignmentExpression node) { 14514 Object visitAssignmentExpression(AssignmentExpression node) {
13550 visit(node.leftHandSide); 14515 visit(node.leftHandSide);
13551 _writer.print(' '); 14516 _writer.print(' ');
13552 _writer.print(node.operator.lexeme); 14517 _writer.print(node.operator.lexeme);
13553 _writer.print(' '); 14518 _writer.print(' ');
13554 visit(node.rightHandSide); 14519 visit(node.rightHandSide);
13555 return null; 14520 return null;
13556 } 14521 }
14522
13557 Object visitBinaryExpression(BinaryExpression node) { 14523 Object visitBinaryExpression(BinaryExpression node) {
13558 visit(node.leftOperand); 14524 visit(node.leftOperand);
13559 _writer.print(' '); 14525 _writer.print(' ');
13560 _writer.print(node.operator.lexeme); 14526 _writer.print(node.operator.lexeme);
13561 _writer.print(' '); 14527 _writer.print(' ');
13562 visit(node.rightOperand); 14528 visit(node.rightOperand);
13563 return null; 14529 return null;
13564 } 14530 }
14531
13565 Object visitBlock(Block node) { 14532 Object visitBlock(Block node) {
13566 _writer.print('{'); 14533 _writer.print('{');
13567 visitList2(node.statements, " "); 14534 visitList2(node.statements, " ");
13568 _writer.print('}'); 14535 _writer.print('}');
13569 return null; 14536 return null;
13570 } 14537 }
14538
13571 Object visitBlockFunctionBody(BlockFunctionBody node) { 14539 Object visitBlockFunctionBody(BlockFunctionBody node) {
13572 visit(node.block); 14540 visit(node.block);
13573 return null; 14541 return null;
13574 } 14542 }
14543
13575 Object visitBooleanLiteral(BooleanLiteral node) { 14544 Object visitBooleanLiteral(BooleanLiteral node) {
13576 _writer.print(node.literal.lexeme); 14545 _writer.print(node.literal.lexeme);
13577 return null; 14546 return null;
13578 } 14547 }
14548
13579 Object visitBreakStatement(BreakStatement node) { 14549 Object visitBreakStatement(BreakStatement node) {
13580 _writer.print("break"); 14550 _writer.print("break");
13581 visit3(" ", node.label); 14551 visit3(" ", node.label);
13582 _writer.print(";"); 14552 _writer.print(";");
13583 return null; 14553 return null;
13584 } 14554 }
14555
13585 Object visitCascadeExpression(CascadeExpression node) { 14556 Object visitCascadeExpression(CascadeExpression node) {
13586 visit(node.target); 14557 visit(node.target);
13587 visitList(node.cascadeSections); 14558 visitList(node.cascadeSections);
13588 return null; 14559 return null;
13589 } 14560 }
14561
13590 Object visitCatchClause(CatchClause node) { 14562 Object visitCatchClause(CatchClause node) {
13591 visit3("on ", node.exceptionType); 14563 visit3("on ", node.exceptionType);
13592 if (node.catchKeyword != null) { 14564 if (node.catchKeyword != null) {
13593 if (node.exceptionType != null) { 14565 if (node.exceptionType != null) {
13594 _writer.print(' '); 14566 _writer.print(' ');
13595 } 14567 }
13596 _writer.print("catch ("); 14568 _writer.print("catch (");
13597 visit(node.exceptionParameter); 14569 visit(node.exceptionParameter);
13598 visit3(", ", node.stackTraceParameter); 14570 visit3(", ", node.stackTraceParameter);
13599 _writer.print(") "); 14571 _writer.print(") ");
13600 } else { 14572 } else {
13601 _writer.print(" "); 14573 _writer.print(" ");
13602 } 14574 }
13603 visit(node.body); 14575 visit(node.body);
13604 return null; 14576 return null;
13605 } 14577 }
14578
13606 Object visitClassDeclaration(ClassDeclaration node) { 14579 Object visitClassDeclaration(ClassDeclaration node) {
13607 visit5(node.abstractKeyword, " "); 14580 visit5(node.abstractKeyword, " ");
13608 _writer.print("class "); 14581 _writer.print("class ");
13609 visit(node.name); 14582 visit(node.name);
13610 visit(node.typeParameters); 14583 visit(node.typeParameters);
13611 visit3(" ", node.extendsClause); 14584 visit3(" ", node.extendsClause);
13612 visit3(" ", node.withClause); 14585 visit3(" ", node.withClause);
13613 visit3(" ", node.implementsClause); 14586 visit3(" ", node.implementsClause);
13614 _writer.print(" {"); 14587 _writer.print(" {");
13615 visitList2(node.members, " "); 14588 visitList2(node.members, " ");
13616 _writer.print("}"); 14589 _writer.print("}");
13617 return null; 14590 return null;
13618 } 14591 }
14592
13619 Object visitClassTypeAlias(ClassTypeAlias node) { 14593 Object visitClassTypeAlias(ClassTypeAlias node) {
13620 _writer.print("class "); 14594 _writer.print("class ");
13621 visit(node.name); 14595 visit(node.name);
13622 visit(node.typeParameters); 14596 visit(node.typeParameters);
13623 _writer.print(" = "); 14597 _writer.print(" = ");
13624 if (node.abstractKeyword != null) { 14598 if (node.abstractKeyword != null) {
13625 _writer.print("abstract "); 14599 _writer.print("abstract ");
13626 } 14600 }
13627 visit(node.superclass); 14601 visit(node.superclass);
13628 visit3(" ", node.withClause); 14602 visit3(" ", node.withClause);
13629 visit3(" ", node.implementsClause); 14603 visit3(" ", node.implementsClause);
13630 _writer.print(";"); 14604 _writer.print(";");
13631 return null; 14605 return null;
13632 } 14606 }
14607
13633 Object visitComment(Comment node) => null; 14608 Object visitComment(Comment node) => null;
14609
13634 Object visitCommentReference(CommentReference node) => null; 14610 Object visitCommentReference(CommentReference node) => null;
14611
13635 Object visitCompilationUnit(CompilationUnit node) { 14612 Object visitCompilationUnit(CompilationUnit node) {
13636 ScriptTag scriptTag = node.scriptTag; 14613 ScriptTag scriptTag = node.scriptTag;
13637 NodeList<Directive> directives = node.directives; 14614 NodeList<Directive> directives = node.directives;
13638 visit(scriptTag); 14615 visit(scriptTag);
13639 String prefix = scriptTag == null ? "" : " "; 14616 String prefix = scriptTag == null ? "" : " ";
13640 visitList4(prefix, directives, " "); 14617 visitList4(prefix, directives, " ");
13641 prefix = scriptTag == null && directives.isEmpty ? "" : " "; 14618 prefix = scriptTag == null && directives.isEmpty ? "" : " ";
13642 visitList4(prefix, node.declarations, " "); 14619 visitList4(prefix, node.declarations, " ");
13643 return null; 14620 return null;
13644 } 14621 }
14622
13645 Object visitConditionalExpression(ConditionalExpression node) { 14623 Object visitConditionalExpression(ConditionalExpression node) {
13646 visit(node.condition); 14624 visit(node.condition);
13647 _writer.print(" ? "); 14625 _writer.print(" ? ");
13648 visit(node.thenExpression); 14626 visit(node.thenExpression);
13649 _writer.print(" : "); 14627 _writer.print(" : ");
13650 visit(node.elseExpression); 14628 visit(node.elseExpression);
13651 return null; 14629 return null;
13652 } 14630 }
14631
13653 Object visitConstructorDeclaration(ConstructorDeclaration node) { 14632 Object visitConstructorDeclaration(ConstructorDeclaration node) {
13654 visit5(node.externalKeyword, " "); 14633 visit5(node.externalKeyword, " ");
13655 visit5(node.constKeyword, " "); 14634 visit5(node.constKeyword, " ");
13656 visit5(node.factoryKeyword, " "); 14635 visit5(node.factoryKeyword, " ");
13657 visit(node.returnType); 14636 visit(node.returnType);
13658 visit3(".", node.name); 14637 visit3(".", node.name);
13659 visit(node.parameters); 14638 visit(node.parameters);
13660 visitList4(" : ", node.initializers, ", "); 14639 visitList4(" : ", node.initializers, ", ");
13661 visit3(" = ", node.redirectedConstructor); 14640 visit3(" = ", node.redirectedConstructor);
13662 visit4(" ", node.body); 14641 visit4(" ", node.body);
13663 return null; 14642 return null;
13664 } 14643 }
14644
13665 Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) { 14645 Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
13666 visit5(node.keyword, "."); 14646 visit5(node.keyword, ".");
13667 visit(node.fieldName); 14647 visit(node.fieldName);
13668 _writer.print(" = "); 14648 _writer.print(" = ");
13669 visit(node.expression); 14649 visit(node.expression);
13670 return null; 14650 return null;
13671 } 14651 }
14652
13672 Object visitConstructorName(ConstructorName node) { 14653 Object visitConstructorName(ConstructorName node) {
13673 visit(node.type); 14654 visit(node.type);
13674 visit3(".", node.name); 14655 visit3(".", node.name);
13675 return null; 14656 return null;
13676 } 14657 }
14658
13677 Object visitContinueStatement(ContinueStatement node) { 14659 Object visitContinueStatement(ContinueStatement node) {
13678 _writer.print("continue"); 14660 _writer.print("continue");
13679 visit3(" ", node.label); 14661 visit3(" ", node.label);
13680 _writer.print(";"); 14662 _writer.print(";");
13681 return null; 14663 return null;
13682 } 14664 }
14665
13683 Object visitDeclaredIdentifier(DeclaredIdentifier node) { 14666 Object visitDeclaredIdentifier(DeclaredIdentifier node) {
13684 visit5(node.keyword, " "); 14667 visit5(node.keyword, " ");
13685 visit2(node.type, " "); 14668 visit2(node.type, " ");
13686 visit(node.identifier); 14669 visit(node.identifier);
13687 return null; 14670 return null;
13688 } 14671 }
14672
13689 Object visitDefaultFormalParameter(DefaultFormalParameter node) { 14673 Object visitDefaultFormalParameter(DefaultFormalParameter node) {
13690 visit(node.parameter); 14674 visit(node.parameter);
13691 if (node.separator != null) { 14675 if (node.separator != null) {
13692 _writer.print(" "); 14676 _writer.print(" ");
13693 _writer.print(node.separator.lexeme); 14677 _writer.print(node.separator.lexeme);
13694 visit3(" ", node.defaultValue); 14678 visit3(" ", node.defaultValue);
13695 } 14679 }
13696 return null; 14680 return null;
13697 } 14681 }
14682
13698 Object visitDoStatement(DoStatement node) { 14683 Object visitDoStatement(DoStatement node) {
13699 _writer.print("do "); 14684 _writer.print("do ");
13700 visit(node.body); 14685 visit(node.body);
13701 _writer.print(" while ("); 14686 _writer.print(" while (");
13702 visit(node.condition); 14687 visit(node.condition);
13703 _writer.print(");"); 14688 _writer.print(");");
13704 return null; 14689 return null;
13705 } 14690 }
14691
13706 Object visitDoubleLiteral(DoubleLiteral node) { 14692 Object visitDoubleLiteral(DoubleLiteral node) {
13707 _writer.print(node.literal.lexeme); 14693 _writer.print(node.literal.lexeme);
13708 return null; 14694 return null;
13709 } 14695 }
14696
13710 Object visitEmptyFunctionBody(EmptyFunctionBody node) { 14697 Object visitEmptyFunctionBody(EmptyFunctionBody node) {
13711 _writer.print(';'); 14698 _writer.print(';');
13712 return null; 14699 return null;
13713 } 14700 }
14701
13714 Object visitEmptyStatement(EmptyStatement node) { 14702 Object visitEmptyStatement(EmptyStatement node) {
13715 _writer.print(';'); 14703 _writer.print(';');
13716 return null; 14704 return null;
13717 } 14705 }
14706
13718 Object visitExportDirective(ExportDirective node) { 14707 Object visitExportDirective(ExportDirective node) {
13719 _writer.print("export "); 14708 _writer.print("export ");
13720 visit(node.uri); 14709 visit(node.uri);
13721 visitList4(" ", node.combinators, " "); 14710 visitList4(" ", node.combinators, " ");
13722 _writer.print(';'); 14711 _writer.print(';');
13723 return null; 14712 return null;
13724 } 14713 }
14714
13725 Object visitExpressionFunctionBody(ExpressionFunctionBody node) { 14715 Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
13726 _writer.print("=> "); 14716 _writer.print("=> ");
13727 visit(node.expression); 14717 visit(node.expression);
13728 if (node.semicolon != null) { 14718 if (node.semicolon != null) {
13729 _writer.print(';'); 14719 _writer.print(';');
13730 } 14720 }
13731 return null; 14721 return null;
13732 } 14722 }
14723
13733 Object visitExpressionStatement(ExpressionStatement node) { 14724 Object visitExpressionStatement(ExpressionStatement node) {
13734 visit(node.expression); 14725 visit(node.expression);
13735 _writer.print(';'); 14726 _writer.print(';');
13736 return null; 14727 return null;
13737 } 14728 }
14729
13738 Object visitExtendsClause(ExtendsClause node) { 14730 Object visitExtendsClause(ExtendsClause node) {
13739 _writer.print("extends "); 14731 _writer.print("extends ");
13740 visit(node.superclass); 14732 visit(node.superclass);
13741 return null; 14733 return null;
13742 } 14734 }
14735
13743 Object visitFieldDeclaration(FieldDeclaration node) { 14736 Object visitFieldDeclaration(FieldDeclaration node) {
13744 visit5(node.staticKeyword, " "); 14737 visit5(node.staticKeyword, " ");
13745 visit(node.fields); 14738 visit(node.fields);
13746 _writer.print(";"); 14739 _writer.print(";");
13747 return null; 14740 return null;
13748 } 14741 }
14742
13749 Object visitFieldFormalParameter(FieldFormalParameter node) { 14743 Object visitFieldFormalParameter(FieldFormalParameter node) {
13750 visit5(node.keyword, " "); 14744 visit5(node.keyword, " ");
13751 visit2(node.type, " "); 14745 visit2(node.type, " ");
13752 _writer.print("this."); 14746 _writer.print("this.");
13753 visit(node.identifier); 14747 visit(node.identifier);
13754 visit(node.parameters); 14748 visit(node.parameters);
13755 return null; 14749 return null;
13756 } 14750 }
14751
13757 Object visitForEachStatement(ForEachStatement node) { 14752 Object visitForEachStatement(ForEachStatement node) {
13758 DeclaredIdentifier loopVariable = node.loopVariable; 14753 DeclaredIdentifier loopVariable = node.loopVariable;
13759 _writer.print("for ("); 14754 _writer.print("for (");
13760 if (loopVariable == null) { 14755 if (loopVariable == null) {
13761 visit(node.identifier); 14756 visit(node.identifier);
13762 } else { 14757 } else {
13763 visit(loopVariable); 14758 visit(loopVariable);
13764 } 14759 }
13765 _writer.print(" in "); 14760 _writer.print(" in ");
13766 visit(node.iterator); 14761 visit(node.iterator);
13767 _writer.print(") "); 14762 _writer.print(") ");
13768 visit(node.body); 14763 visit(node.body);
13769 return null; 14764 return null;
13770 } 14765 }
14766
13771 Object visitFormalParameterList(FormalParameterList node) { 14767 Object visitFormalParameterList(FormalParameterList node) {
13772 String groupEnd = null; 14768 String groupEnd = null;
13773 _writer.print('('); 14769 _writer.print('(');
13774 NodeList<FormalParameter> parameters = node.parameters; 14770 NodeList<FormalParameter> parameters = node.parameters;
13775 int size = parameters.length; 14771 int size = parameters.length;
13776 for (int i = 0; i < size; i++) { 14772 for (int i = 0; i < size; i++) {
13777 FormalParameter parameter = parameters[i]; 14773 FormalParameter parameter = parameters[i];
13778 if (i > 0) { 14774 if (i > 0) {
13779 _writer.print(", "); 14775 _writer.print(", ");
13780 } 14776 }
13781 if (groupEnd == null && parameter is DefaultFormalParameter) { 14777 if (groupEnd == null && parameter is DefaultFormalParameter) {
13782 if (identical(parameter.kind, ParameterKind.NAMED)) { 14778 if (identical(parameter.kind, ParameterKind.NAMED)) {
13783 groupEnd = "}"; 14779 groupEnd = "}";
13784 _writer.print('{'); 14780 _writer.print('{');
13785 } else { 14781 } else {
13786 groupEnd = "]"; 14782 groupEnd = "]";
13787 _writer.print('['); 14783 _writer.print('[');
13788 } 14784 }
13789 } 14785 }
13790 parameter.accept(this); 14786 parameter.accept(this);
13791 } 14787 }
13792 if (groupEnd != null) { 14788 if (groupEnd != null) {
13793 _writer.print(groupEnd); 14789 _writer.print(groupEnd);
13794 } 14790 }
13795 _writer.print(')'); 14791 _writer.print(')');
13796 return null; 14792 return null;
13797 } 14793 }
14794
13798 Object visitForStatement(ForStatement node) { 14795 Object visitForStatement(ForStatement node) {
13799 Expression initialization = node.initialization; 14796 Expression initialization = node.initialization;
13800 _writer.print("for ("); 14797 _writer.print("for (");
13801 if (initialization != null) { 14798 if (initialization != null) {
13802 visit(initialization); 14799 visit(initialization);
13803 } else { 14800 } else {
13804 visit(node.variables); 14801 visit(node.variables);
13805 } 14802 }
13806 _writer.print(";"); 14803 _writer.print(";");
13807 visit3(" ", node.condition); 14804 visit3(" ", node.condition);
13808 _writer.print(";"); 14805 _writer.print(";");
13809 visitList4(" ", node.updaters, ", "); 14806 visitList4(" ", node.updaters, ", ");
13810 _writer.print(") "); 14807 _writer.print(") ");
13811 visit(node.body); 14808 visit(node.body);
13812 return null; 14809 return null;
13813 } 14810 }
14811
13814 Object visitFunctionDeclaration(FunctionDeclaration node) { 14812 Object visitFunctionDeclaration(FunctionDeclaration node) {
13815 visit2(node.returnType, " "); 14813 visit2(node.returnType, " ");
13816 visit5(node.propertyKeyword, " "); 14814 visit5(node.propertyKeyword, " ");
13817 visit(node.name); 14815 visit(node.name);
13818 visit(node.functionExpression); 14816 visit(node.functionExpression);
13819 return null; 14817 return null;
13820 } 14818 }
14819
13821 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { 14820 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
13822 visit(node.functionDeclaration); 14821 visit(node.functionDeclaration);
13823 _writer.print(';'); 14822 _writer.print(';');
13824 return null; 14823 return null;
13825 } 14824 }
14825
13826 Object visitFunctionExpression(FunctionExpression node) { 14826 Object visitFunctionExpression(FunctionExpression node) {
13827 visit(node.parameters); 14827 visit(node.parameters);
13828 _writer.print(' '); 14828 _writer.print(' ');
13829 visit(node.body); 14829 visit(node.body);
13830 return null; 14830 return null;
13831 } 14831 }
14832
13832 Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { 14833 Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
13833 visit(node.function); 14834 visit(node.function);
13834 visit(node.argumentList); 14835 visit(node.argumentList);
13835 return null; 14836 return null;
13836 } 14837 }
14838
13837 Object visitFunctionTypeAlias(FunctionTypeAlias node) { 14839 Object visitFunctionTypeAlias(FunctionTypeAlias node) {
13838 _writer.print("typedef "); 14840 _writer.print("typedef ");
13839 visit2(node.returnType, " "); 14841 visit2(node.returnType, " ");
13840 visit(node.name); 14842 visit(node.name);
13841 visit(node.typeParameters); 14843 visit(node.typeParameters);
13842 visit(node.parameters); 14844 visit(node.parameters);
13843 _writer.print(";"); 14845 _writer.print(";");
13844 return null; 14846 return null;
13845 } 14847 }
14848
13846 Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { 14849 Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
13847 visit2(node.returnType, " "); 14850 visit2(node.returnType, " ");
13848 visit(node.identifier); 14851 visit(node.identifier);
13849 visit(node.parameters); 14852 visit(node.parameters);
13850 return null; 14853 return null;
13851 } 14854 }
14855
13852 Object visitHideCombinator(HideCombinator node) { 14856 Object visitHideCombinator(HideCombinator node) {
13853 _writer.print("hide "); 14857 _writer.print("hide ");
13854 visitList2(node.hiddenNames, ", "); 14858 visitList2(node.hiddenNames, ", ");
13855 return null; 14859 return null;
13856 } 14860 }
14861
13857 Object visitIfStatement(IfStatement node) { 14862 Object visitIfStatement(IfStatement node) {
13858 _writer.print("if ("); 14863 _writer.print("if (");
13859 visit(node.condition); 14864 visit(node.condition);
13860 _writer.print(") "); 14865 _writer.print(") ");
13861 visit(node.thenStatement); 14866 visit(node.thenStatement);
13862 visit3(" else ", node.elseStatement); 14867 visit3(" else ", node.elseStatement);
13863 return null; 14868 return null;
13864 } 14869 }
14870
13865 Object visitImplementsClause(ImplementsClause node) { 14871 Object visitImplementsClause(ImplementsClause node) {
13866 _writer.print("implements "); 14872 _writer.print("implements ");
13867 visitList2(node.interfaces, ", "); 14873 visitList2(node.interfaces, ", ");
13868 return null; 14874 return null;
13869 } 14875 }
14876
13870 Object visitImportDirective(ImportDirective node) { 14877 Object visitImportDirective(ImportDirective node) {
13871 _writer.print("import "); 14878 _writer.print("import ");
13872 visit(node.uri); 14879 visit(node.uri);
13873 visit3(" as ", node.prefix); 14880 visit3(" as ", node.prefix);
13874 visitList4(" ", node.combinators, " "); 14881 visitList4(" ", node.combinators, " ");
13875 _writer.print(';'); 14882 _writer.print(';');
13876 return null; 14883 return null;
13877 } 14884 }
14885
13878 Object visitIndexExpression(IndexExpression node) { 14886 Object visitIndexExpression(IndexExpression node) {
13879 if (node.isCascaded) { 14887 if (node.isCascaded) {
13880 _writer.print(".."); 14888 _writer.print("..");
13881 } else { 14889 } else {
13882 visit(node.target); 14890 visit(node.target);
13883 } 14891 }
13884 _writer.print('['); 14892 _writer.print('[');
13885 visit(node.index); 14893 visit(node.index);
13886 _writer.print(']'); 14894 _writer.print(']');
13887 return null; 14895 return null;
13888 } 14896 }
14897
13889 Object visitInstanceCreationExpression(InstanceCreationExpression node) { 14898 Object visitInstanceCreationExpression(InstanceCreationExpression node) {
13890 visit5(node.keyword, " "); 14899 visit5(node.keyword, " ");
13891 visit(node.constructorName); 14900 visit(node.constructorName);
13892 visit(node.argumentList); 14901 visit(node.argumentList);
13893 return null; 14902 return null;
13894 } 14903 }
14904
13895 Object visitIntegerLiteral(IntegerLiteral node) { 14905 Object visitIntegerLiteral(IntegerLiteral node) {
13896 _writer.print(node.literal.lexeme); 14906 _writer.print(node.literal.lexeme);
13897 return null; 14907 return null;
13898 } 14908 }
14909
13899 Object visitInterpolationExpression(InterpolationExpression node) { 14910 Object visitInterpolationExpression(InterpolationExpression node) {
13900 if (node.rightBracket != null) { 14911 if (node.rightBracket != null) {
13901 _writer.print("\${"); 14912 _writer.print("\${");
13902 visit(node.expression); 14913 visit(node.expression);
13903 _writer.print("}"); 14914 _writer.print("}");
13904 } else { 14915 } else {
13905 _writer.print("\$"); 14916 _writer.print("\$");
13906 visit(node.expression); 14917 visit(node.expression);
13907 } 14918 }
13908 return null; 14919 return null;
13909 } 14920 }
14921
13910 Object visitInterpolationString(InterpolationString node) { 14922 Object visitInterpolationString(InterpolationString node) {
13911 _writer.print(node.contents.lexeme); 14923 _writer.print(node.contents.lexeme);
13912 return null; 14924 return null;
13913 } 14925 }
14926
13914 Object visitIsExpression(IsExpression node) { 14927 Object visitIsExpression(IsExpression node) {
13915 visit(node.expression); 14928 visit(node.expression);
13916 if (node.notOperator == null) { 14929 if (node.notOperator == null) {
13917 _writer.print(" is "); 14930 _writer.print(" is ");
13918 } else { 14931 } else {
13919 _writer.print(" is! "); 14932 _writer.print(" is! ");
13920 } 14933 }
13921 visit(node.type); 14934 visit(node.type);
13922 return null; 14935 return null;
13923 } 14936 }
14937
13924 Object visitLabel(Label node) { 14938 Object visitLabel(Label node) {
13925 visit(node.label); 14939 visit(node.label);
13926 _writer.print(":"); 14940 _writer.print(":");
13927 return null; 14941 return null;
13928 } 14942 }
14943
13929 Object visitLabeledStatement(LabeledStatement node) { 14944 Object visitLabeledStatement(LabeledStatement node) {
13930 visitList3(node.labels, " ", " "); 14945 visitList3(node.labels, " ", " ");
13931 visit(node.statement); 14946 visit(node.statement);
13932 return null; 14947 return null;
13933 } 14948 }
14949
13934 Object visitLibraryDirective(LibraryDirective node) { 14950 Object visitLibraryDirective(LibraryDirective node) {
13935 _writer.print("library "); 14951 _writer.print("library ");
13936 visit(node.name); 14952 visit(node.name);
13937 _writer.print(';'); 14953 _writer.print(';');
13938 return null; 14954 return null;
13939 } 14955 }
14956
13940 Object visitLibraryIdentifier(LibraryIdentifier node) { 14957 Object visitLibraryIdentifier(LibraryIdentifier node) {
13941 _writer.print(node.name); 14958 _writer.print(node.name);
13942 return null; 14959 return null;
13943 } 14960 }
14961
13944 Object visitListLiteral(ListLiteral node) { 14962 Object visitListLiteral(ListLiteral node) {
13945 if (node.constKeyword != null) { 14963 if (node.constKeyword != null) {
13946 _writer.print(node.constKeyword.lexeme); 14964 _writer.print(node.constKeyword.lexeme);
13947 _writer.print(' '); 14965 _writer.print(' ');
13948 } 14966 }
13949 visit2(node.typeArguments, " "); 14967 visit2(node.typeArguments, " ");
13950 _writer.print("["); 14968 _writer.print("[");
13951 visitList2(node.elements, ", "); 14969 visitList2(node.elements, ", ");
13952 _writer.print("]"); 14970 _writer.print("]");
13953 return null; 14971 return null;
13954 } 14972 }
14973
13955 Object visitMapLiteral(MapLiteral node) { 14974 Object visitMapLiteral(MapLiteral node) {
13956 if (node.constKeyword != null) { 14975 if (node.constKeyword != null) {
13957 _writer.print(node.constKeyword.lexeme); 14976 _writer.print(node.constKeyword.lexeme);
13958 _writer.print(' '); 14977 _writer.print(' ');
13959 } 14978 }
13960 visit2(node.typeArguments, " "); 14979 visit2(node.typeArguments, " ");
13961 _writer.print("{"); 14980 _writer.print("{");
13962 visitList2(node.entries, ", "); 14981 visitList2(node.entries, ", ");
13963 _writer.print("}"); 14982 _writer.print("}");
13964 return null; 14983 return null;
13965 } 14984 }
14985
13966 Object visitMapLiteralEntry(MapLiteralEntry node) { 14986 Object visitMapLiteralEntry(MapLiteralEntry node) {
13967 visit(node.key); 14987 visit(node.key);
13968 _writer.print(" : "); 14988 _writer.print(" : ");
13969 visit(node.value); 14989 visit(node.value);
13970 return null; 14990 return null;
13971 } 14991 }
14992
13972 Object visitMethodDeclaration(MethodDeclaration node) { 14993 Object visitMethodDeclaration(MethodDeclaration node) {
13973 visit5(node.externalKeyword, " "); 14994 visit5(node.externalKeyword, " ");
13974 visit5(node.modifierKeyword, " "); 14995 visit5(node.modifierKeyword, " ");
13975 visit2(node.returnType, " "); 14996 visit2(node.returnType, " ");
13976 visit5(node.propertyKeyword, " "); 14997 visit5(node.propertyKeyword, " ");
13977 visit5(node.operatorKeyword, " "); 14998 visit5(node.operatorKeyword, " ");
13978 visit(node.name); 14999 visit(node.name);
13979 if (!node.isGetter) { 15000 if (!node.isGetter) {
13980 visit(node.parameters); 15001 visit(node.parameters);
13981 } 15002 }
13982 visit4(" ", node.body); 15003 visit4(" ", node.body);
13983 return null; 15004 return null;
13984 } 15005 }
15006
13985 Object visitMethodInvocation(MethodInvocation node) { 15007 Object visitMethodInvocation(MethodInvocation node) {
13986 if (node.isCascaded) { 15008 if (node.isCascaded) {
13987 _writer.print(".."); 15009 _writer.print("..");
13988 } else { 15010 } else {
13989 visit2(node.target, "."); 15011 visit2(node.target, ".");
13990 } 15012 }
13991 visit(node.methodName); 15013 visit(node.methodName);
13992 visit(node.argumentList); 15014 visit(node.argumentList);
13993 return null; 15015 return null;
13994 } 15016 }
15017
13995 Object visitNamedExpression(NamedExpression node) { 15018 Object visitNamedExpression(NamedExpression node) {
13996 visit(node.name); 15019 visit(node.name);
13997 visit3(" ", node.expression); 15020 visit3(" ", node.expression);
13998 return null; 15021 return null;
13999 } 15022 }
15023
14000 Object visitNativeClause(NativeClause node) { 15024 Object visitNativeClause(NativeClause node) {
14001 _writer.print("native "); 15025 _writer.print("native ");
14002 visit(node.name); 15026 visit(node.name);
14003 return null; 15027 return null;
14004 } 15028 }
15029
14005 Object visitNativeFunctionBody(NativeFunctionBody node) { 15030 Object visitNativeFunctionBody(NativeFunctionBody node) {
14006 _writer.print("native "); 15031 _writer.print("native ");
14007 visit(node.stringLiteral); 15032 visit(node.stringLiteral);
14008 _writer.print(';'); 15033 _writer.print(';');
14009 return null; 15034 return null;
14010 } 15035 }
15036
14011 Object visitNullLiteral(NullLiteral node) { 15037 Object visitNullLiteral(NullLiteral node) {
14012 _writer.print("null"); 15038 _writer.print("null");
14013 return null; 15039 return null;
14014 } 15040 }
15041
14015 Object visitParenthesizedExpression(ParenthesizedExpression node) { 15042 Object visitParenthesizedExpression(ParenthesizedExpression node) {
14016 _writer.print('('); 15043 _writer.print('(');
14017 visit(node.expression); 15044 visit(node.expression);
14018 _writer.print(')'); 15045 _writer.print(')');
14019 return null; 15046 return null;
14020 } 15047 }
15048
14021 Object visitPartDirective(PartDirective node) { 15049 Object visitPartDirective(PartDirective node) {
14022 _writer.print("part "); 15050 _writer.print("part ");
14023 visit(node.uri); 15051 visit(node.uri);
14024 _writer.print(';'); 15052 _writer.print(';');
14025 return null; 15053 return null;
14026 } 15054 }
15055
14027 Object visitPartOfDirective(PartOfDirective node) { 15056 Object visitPartOfDirective(PartOfDirective node) {
14028 _writer.print("part of "); 15057 _writer.print("part of ");
14029 visit(node.libraryName); 15058 visit(node.libraryName);
14030 _writer.print(';'); 15059 _writer.print(';');
14031 return null; 15060 return null;
14032 } 15061 }
15062
14033 Object visitPostfixExpression(PostfixExpression node) { 15063 Object visitPostfixExpression(PostfixExpression node) {
14034 visit(node.operand); 15064 visit(node.operand);
14035 _writer.print(node.operator.lexeme); 15065 _writer.print(node.operator.lexeme);
14036 return null; 15066 return null;
14037 } 15067 }
15068
14038 Object visitPrefixedIdentifier(PrefixedIdentifier node) { 15069 Object visitPrefixedIdentifier(PrefixedIdentifier node) {
14039 visit(node.prefix); 15070 visit(node.prefix);
14040 _writer.print('.'); 15071 _writer.print('.');
14041 visit(node.identifier); 15072 visit(node.identifier);
14042 return null; 15073 return null;
14043 } 15074 }
15075
14044 Object visitPrefixExpression(PrefixExpression node) { 15076 Object visitPrefixExpression(PrefixExpression node) {
14045 _writer.print(node.operator.lexeme); 15077 _writer.print(node.operator.lexeme);
14046 visit(node.operand); 15078 visit(node.operand);
14047 return null; 15079 return null;
14048 } 15080 }
15081
14049 Object visitPropertyAccess(PropertyAccess node) { 15082 Object visitPropertyAccess(PropertyAccess node) {
14050 if (node.isCascaded) { 15083 if (node.isCascaded) {
14051 _writer.print(".."); 15084 _writer.print("..");
14052 } else { 15085 } else {
14053 visit(node.target); 15086 visit(node.target);
14054 _writer.print('.'); 15087 _writer.print('.');
14055 } 15088 }
14056 visit(node.propertyName); 15089 visit(node.propertyName);
14057 return null; 15090 return null;
14058 } 15091 }
15092
14059 Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) { 15093 Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
14060 _writer.print("this"); 15094 _writer.print("this");
14061 visit3(".", node.constructorName); 15095 visit3(".", node.constructorName);
14062 visit(node.argumentList); 15096 visit(node.argumentList);
14063 return null; 15097 return null;
14064 } 15098 }
15099
14065 Object visitRethrowExpression(RethrowExpression node) { 15100 Object visitRethrowExpression(RethrowExpression node) {
14066 _writer.print("rethrow"); 15101 _writer.print("rethrow");
14067 return null; 15102 return null;
14068 } 15103 }
15104
14069 Object visitReturnStatement(ReturnStatement node) { 15105 Object visitReturnStatement(ReturnStatement node) {
14070 Expression expression = node.expression; 15106 Expression expression = node.expression;
14071 if (expression == null) { 15107 if (expression == null) {
14072 _writer.print("return;"); 15108 _writer.print("return;");
14073 } else { 15109 } else {
14074 _writer.print("return "); 15110 _writer.print("return ");
14075 expression.accept(this); 15111 expression.accept(this);
14076 _writer.print(";"); 15112 _writer.print(";");
14077 } 15113 }
14078 return null; 15114 return null;
14079 } 15115 }
15116
14080 Object visitScriptTag(ScriptTag node) { 15117 Object visitScriptTag(ScriptTag node) {
14081 _writer.print(node.scriptTag.lexeme); 15118 _writer.print(node.scriptTag.lexeme);
14082 return null; 15119 return null;
14083 } 15120 }
15121
14084 Object visitShowCombinator(ShowCombinator node) { 15122 Object visitShowCombinator(ShowCombinator node) {
14085 _writer.print("show "); 15123 _writer.print("show ");
14086 visitList2(node.shownNames, ", "); 15124 visitList2(node.shownNames, ", ");
14087 return null; 15125 return null;
14088 } 15126 }
15127
14089 Object visitSimpleFormalParameter(SimpleFormalParameter node) { 15128 Object visitSimpleFormalParameter(SimpleFormalParameter node) {
14090 visit5(node.keyword, " "); 15129 visit5(node.keyword, " ");
14091 visit2(node.type, " "); 15130 visit2(node.type, " ");
14092 visit(node.identifier); 15131 visit(node.identifier);
14093 return null; 15132 return null;
14094 } 15133 }
15134
14095 Object visitSimpleIdentifier(SimpleIdentifier node) { 15135 Object visitSimpleIdentifier(SimpleIdentifier node) {
14096 _writer.print(node.token.lexeme); 15136 _writer.print(node.token.lexeme);
14097 return null; 15137 return null;
14098 } 15138 }
15139
14099 Object visitSimpleStringLiteral(SimpleStringLiteral node) { 15140 Object visitSimpleStringLiteral(SimpleStringLiteral node) {
14100 _writer.print(node.literal.lexeme); 15141 _writer.print(node.literal.lexeme);
14101 return null; 15142 return null;
14102 } 15143 }
15144
14103 Object visitStringInterpolation(StringInterpolation node) { 15145 Object visitStringInterpolation(StringInterpolation node) {
14104 visitList(node.elements); 15146 visitList(node.elements);
14105 return null; 15147 return null;
14106 } 15148 }
15149
14107 Object visitSuperConstructorInvocation(SuperConstructorInvocation node) { 15150 Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
14108 _writer.print("super"); 15151 _writer.print("super");
14109 visit3(".", node.constructorName); 15152 visit3(".", node.constructorName);
14110 visit(node.argumentList); 15153 visit(node.argumentList);
14111 return null; 15154 return null;
14112 } 15155 }
15156
14113 Object visitSuperExpression(SuperExpression node) { 15157 Object visitSuperExpression(SuperExpression node) {
14114 _writer.print("super"); 15158 _writer.print("super");
14115 return null; 15159 return null;
14116 } 15160 }
15161
14117 Object visitSwitchCase(SwitchCase node) { 15162 Object visitSwitchCase(SwitchCase node) {
14118 visitList3(node.labels, " ", " "); 15163 visitList3(node.labels, " ", " ");
14119 _writer.print("case "); 15164 _writer.print("case ");
14120 visit(node.expression); 15165 visit(node.expression);
14121 _writer.print(": "); 15166 _writer.print(": ");
14122 visitList2(node.statements, " "); 15167 visitList2(node.statements, " ");
14123 return null; 15168 return null;
14124 } 15169 }
15170
14125 Object visitSwitchDefault(SwitchDefault node) { 15171 Object visitSwitchDefault(SwitchDefault node) {
14126 visitList3(node.labels, " ", " "); 15172 visitList3(node.labels, " ", " ");
14127 _writer.print("default: "); 15173 _writer.print("default: ");
14128 visitList2(node.statements, " "); 15174 visitList2(node.statements, " ");
14129 return null; 15175 return null;
14130 } 15176 }
15177
14131 Object visitSwitchStatement(SwitchStatement node) { 15178 Object visitSwitchStatement(SwitchStatement node) {
14132 _writer.print("switch ("); 15179 _writer.print("switch (");
14133 visit(node.expression); 15180 visit(node.expression);
14134 _writer.print(") {"); 15181 _writer.print(") {");
14135 visitList2(node.members, " "); 15182 visitList2(node.members, " ");
14136 _writer.print("}"); 15183 _writer.print("}");
14137 return null; 15184 return null;
14138 } 15185 }
15186
14139 Object visitSymbolLiteral(SymbolLiteral node) { 15187 Object visitSymbolLiteral(SymbolLiteral node) {
14140 _writer.print("#"); 15188 _writer.print("#");
14141 List<Token> components = node.components; 15189 List<Token> components = node.components;
14142 for (int i = 0; i < components.length; i++) { 15190 for (int i = 0; i < components.length; i++) {
14143 if (i > 0) { 15191 if (i > 0) {
14144 _writer.print("."); 15192 _writer.print(".");
14145 } 15193 }
14146 _writer.print(components[i].lexeme); 15194 _writer.print(components[i].lexeme);
14147 } 15195 }
14148 return null; 15196 return null;
14149 } 15197 }
15198
14150 Object visitThisExpression(ThisExpression node) { 15199 Object visitThisExpression(ThisExpression node) {
14151 _writer.print("this"); 15200 _writer.print("this");
14152 return null; 15201 return null;
14153 } 15202 }
15203
14154 Object visitThrowExpression(ThrowExpression node) { 15204 Object visitThrowExpression(ThrowExpression node) {
14155 _writer.print("throw "); 15205 _writer.print("throw ");
14156 visit(node.expression); 15206 visit(node.expression);
14157 return null; 15207 return null;
14158 } 15208 }
15209
14159 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { 15210 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
14160 visit2(node.variables, ";"); 15211 visit2(node.variables, ";");
14161 return null; 15212 return null;
14162 } 15213 }
15214
14163 Object visitTryStatement(TryStatement node) { 15215 Object visitTryStatement(TryStatement node) {
14164 _writer.print("try "); 15216 _writer.print("try ");
14165 visit(node.body); 15217 visit(node.body);
14166 visitList4(" ", node.catchClauses, " "); 15218 visitList4(" ", node.catchClauses, " ");
14167 visit3(" finally ", node.finallyBlock); 15219 visit3(" finally ", node.finallyBlock);
14168 return null; 15220 return null;
14169 } 15221 }
15222
14170 Object visitTypeArgumentList(TypeArgumentList node) { 15223 Object visitTypeArgumentList(TypeArgumentList node) {
14171 _writer.print('<'); 15224 _writer.print('<');
14172 visitList2(node.arguments, ", "); 15225 visitList2(node.arguments, ", ");
14173 _writer.print('>'); 15226 _writer.print('>');
14174 return null; 15227 return null;
14175 } 15228 }
15229
14176 Object visitTypeName(TypeName node) { 15230 Object visitTypeName(TypeName node) {
14177 visit(node.name); 15231 visit(node.name);
14178 visit(node.typeArguments); 15232 visit(node.typeArguments);
14179 return null; 15233 return null;
14180 } 15234 }
15235
14181 Object visitTypeParameter(TypeParameter node) { 15236 Object visitTypeParameter(TypeParameter node) {
14182 visit(node.name); 15237 visit(node.name);
14183 visit3(" extends ", node.bound); 15238 visit3(" extends ", node.bound);
14184 return null; 15239 return null;
14185 } 15240 }
15241
14186 Object visitTypeParameterList(TypeParameterList node) { 15242 Object visitTypeParameterList(TypeParameterList node) {
14187 _writer.print('<'); 15243 _writer.print('<');
14188 visitList2(node.typeParameters, ", "); 15244 visitList2(node.typeParameters, ", ");
14189 _writer.print('>'); 15245 _writer.print('>');
14190 return null; 15246 return null;
14191 } 15247 }
15248
14192 Object visitVariableDeclaration(VariableDeclaration node) { 15249 Object visitVariableDeclaration(VariableDeclaration node) {
14193 visit(node.name); 15250 visit(node.name);
14194 visit3(" = ", node.initializer); 15251 visit3(" = ", node.initializer);
14195 return null; 15252 return null;
14196 } 15253 }
15254
14197 Object visitVariableDeclarationList(VariableDeclarationList node) { 15255 Object visitVariableDeclarationList(VariableDeclarationList node) {
14198 visit5(node.keyword, " "); 15256 visit5(node.keyword, " ");
14199 visit2(node.type, " "); 15257 visit2(node.type, " ");
14200 visitList2(node.variables, ", "); 15258 visitList2(node.variables, ", ");
14201 return null; 15259 return null;
14202 } 15260 }
15261
14203 Object visitVariableDeclarationStatement(VariableDeclarationStatement node) { 15262 Object visitVariableDeclarationStatement(VariableDeclarationStatement node) {
14204 visit(node.variables); 15263 visit(node.variables);
14205 _writer.print(";"); 15264 _writer.print(";");
14206 return null; 15265 return null;
14207 } 15266 }
15267
14208 Object visitWhileStatement(WhileStatement node) { 15268 Object visitWhileStatement(WhileStatement node) {
14209 _writer.print("while ("); 15269 _writer.print("while (");
14210 visit(node.condition); 15270 visit(node.condition);
14211 _writer.print(") "); 15271 _writer.print(") ");
14212 visit(node.body); 15272 visit(node.body);
14213 return null; 15273 return null;
14214 } 15274 }
15275
14215 Object visitWithClause(WithClause node) { 15276 Object visitWithClause(WithClause node) {
14216 _writer.print("with "); 15277 _writer.print("with ");
14217 visitList2(node.mixinTypes, ", "); 15278 visitList2(node.mixinTypes, ", ");
14218 return null; 15279 return null;
14219 } 15280 }
14220 15281
14221 /** 15282 /**
14222 * Safely visit the given node. 15283 * Safely visit the given node.
14223 * 15284 *
14224 * @param node the node to be visited 15285 * @param node the node to be visited
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
14346 for (int i = 0; i < size; i++) { 15407 for (int i = 0; i < size; i++) {
14347 if (i > 0) { 15408 if (i > 0) {
14348 _writer.print(separator); 15409 _writer.print(separator);
14349 } 15410 }
14350 nodes[i].accept(this); 15411 nodes[i].accept(this);
14351 } 15412 }
14352 } 15413 }
14353 } 15414 }
14354 } 15415 }
14355 } 15416 }
15417
14356 /** 15418 /**
14357 * Instances of the class `UnifyingASTVisitor` implement an AST visitor that wil l recursively 15419 * Instances of the class `UnifyingASTVisitor` implement an AST visitor that wil l recursively
14358 * visit all of the nodes in an AST structure (like instances of the class 15420 * visit all of the nodes in an AST structure (like instances of the class
14359 * [RecursiveASTVisitor]). In addition, every node will also be visited by using a single 15421 * [RecursiveASTVisitor]). In addition, every node will also be visited by using a single
14360 * unified [visitNode] method. 15422 * unified [visitNode] method.
14361 * 15423 *
14362 * Subclasses that override a visit method must either invoke the overridden vis it method or 15424 * Subclasses that override a visit method must either invoke the overridden vis it method or
14363 * explicitly invoke the more general [visitNode] method. Failure to do so will 15425 * explicitly invoke the more general [visitNode] method. Failure to do so will
14364 * cause the children of the visited node to not be visited. 15426 * cause the children of the visited node to not be visited.
14365 * 15427 *
14366 * @coverage dart.engine.ast 15428 * @coverage dart.engine.ast
14367 */ 15429 */
14368 class UnifyingASTVisitor<R> implements ASTVisitor<R> { 15430 class UnifyingASTVisitor<R> implements ASTVisitor<R> {
14369 R visitAdjacentStrings(AdjacentStrings node) => visitNode(node); 15431 R visitAdjacentStrings(AdjacentStrings node) => visitNode(node);
15432
14370 R visitAnnotation(Annotation node) => visitNode(node); 15433 R visitAnnotation(Annotation node) => visitNode(node);
15434
14371 R visitArgumentDefinitionTest(ArgumentDefinitionTest node) => visitNode(node); 15435 R visitArgumentDefinitionTest(ArgumentDefinitionTest node) => visitNode(node);
15436
14372 R visitArgumentList(ArgumentList node) => visitNode(node); 15437 R visitArgumentList(ArgumentList node) => visitNode(node);
15438
14373 R visitAsExpression(AsExpression node) => visitNode(node); 15439 R visitAsExpression(AsExpression node) => visitNode(node);
15440
14374 R visitAssertStatement(AssertStatement node) => visitNode(node); 15441 R visitAssertStatement(AssertStatement node) => visitNode(node);
15442
14375 R visitAssignmentExpression(AssignmentExpression node) => visitNode(node); 15443 R visitAssignmentExpression(AssignmentExpression node) => visitNode(node);
15444
14376 R visitBinaryExpression(BinaryExpression node) => visitNode(node); 15445 R visitBinaryExpression(BinaryExpression node) => visitNode(node);
15446
14377 R visitBlock(Block node) => visitNode(node); 15447 R visitBlock(Block node) => visitNode(node);
15448
14378 R visitBlockFunctionBody(BlockFunctionBody node) => visitNode(node); 15449 R visitBlockFunctionBody(BlockFunctionBody node) => visitNode(node);
15450
14379 R visitBooleanLiteral(BooleanLiteral node) => visitNode(node); 15451 R visitBooleanLiteral(BooleanLiteral node) => visitNode(node);
15452
14380 R visitBreakStatement(BreakStatement node) => visitNode(node); 15453 R visitBreakStatement(BreakStatement node) => visitNode(node);
15454
14381 R visitCascadeExpression(CascadeExpression node) => visitNode(node); 15455 R visitCascadeExpression(CascadeExpression node) => visitNode(node);
15456
14382 R visitCatchClause(CatchClause node) => visitNode(node); 15457 R visitCatchClause(CatchClause node) => visitNode(node);
15458
14383 R visitClassDeclaration(ClassDeclaration node) => visitNode(node); 15459 R visitClassDeclaration(ClassDeclaration node) => visitNode(node);
15460
14384 R visitClassTypeAlias(ClassTypeAlias node) => visitNode(node); 15461 R visitClassTypeAlias(ClassTypeAlias node) => visitNode(node);
15462
14385 R visitComment(Comment node) => visitNode(node); 15463 R visitComment(Comment node) => visitNode(node);
15464
14386 R visitCommentReference(CommentReference node) => visitNode(node); 15465 R visitCommentReference(CommentReference node) => visitNode(node);
15466
14387 R visitCompilationUnit(CompilationUnit node) => visitNode(node); 15467 R visitCompilationUnit(CompilationUnit node) => visitNode(node);
15468
14388 R visitConditionalExpression(ConditionalExpression node) => visitNode(node); 15469 R visitConditionalExpression(ConditionalExpression node) => visitNode(node);
15470
14389 R visitConstructorDeclaration(ConstructorDeclaration node) => visitNode(node); 15471 R visitConstructorDeclaration(ConstructorDeclaration node) => visitNode(node);
15472
14390 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => visitN ode(node); 15473 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => visitN ode(node);
15474
14391 R visitConstructorName(ConstructorName node) => visitNode(node); 15475 R visitConstructorName(ConstructorName node) => visitNode(node);
15476
14392 R visitContinueStatement(ContinueStatement node) => visitNode(node); 15477 R visitContinueStatement(ContinueStatement node) => visitNode(node);
15478
14393 R visitDeclaredIdentifier(DeclaredIdentifier node) => visitNode(node); 15479 R visitDeclaredIdentifier(DeclaredIdentifier node) => visitNode(node);
15480
14394 R visitDefaultFormalParameter(DefaultFormalParameter node) => visitNode(node); 15481 R visitDefaultFormalParameter(DefaultFormalParameter node) => visitNode(node);
15482
14395 R visitDoStatement(DoStatement node) => visitNode(node); 15483 R visitDoStatement(DoStatement node) => visitNode(node);
15484
14396 R visitDoubleLiteral(DoubleLiteral node) => visitNode(node); 15485 R visitDoubleLiteral(DoubleLiteral node) => visitNode(node);
15486
14397 R visitEmptyFunctionBody(EmptyFunctionBody node) => visitNode(node); 15487 R visitEmptyFunctionBody(EmptyFunctionBody node) => visitNode(node);
15488
14398 R visitEmptyStatement(EmptyStatement node) => visitNode(node); 15489 R visitEmptyStatement(EmptyStatement node) => visitNode(node);
15490
14399 R visitExportDirective(ExportDirective node) => visitNode(node); 15491 R visitExportDirective(ExportDirective node) => visitNode(node);
15492
14400 R visitExpressionFunctionBody(ExpressionFunctionBody node) => visitNode(node); 15493 R visitExpressionFunctionBody(ExpressionFunctionBody node) => visitNode(node);
15494
14401 R visitExpressionStatement(ExpressionStatement node) => visitNode(node); 15495 R visitExpressionStatement(ExpressionStatement node) => visitNode(node);
15496
14402 R visitExtendsClause(ExtendsClause node) => visitNode(node); 15497 R visitExtendsClause(ExtendsClause node) => visitNode(node);
15498
14403 R visitFieldDeclaration(FieldDeclaration node) => visitNode(node); 15499 R visitFieldDeclaration(FieldDeclaration node) => visitNode(node);
15500
14404 R visitFieldFormalParameter(FieldFormalParameter node) => visitNode(node); 15501 R visitFieldFormalParameter(FieldFormalParameter node) => visitNode(node);
15502
14405 R visitForEachStatement(ForEachStatement node) => visitNode(node); 15503 R visitForEachStatement(ForEachStatement node) => visitNode(node);
15504
14406 R visitFormalParameterList(FormalParameterList node) => visitNode(node); 15505 R visitFormalParameterList(FormalParameterList node) => visitNode(node);
15506
14407 R visitForStatement(ForStatement node) => visitNode(node); 15507 R visitForStatement(ForStatement node) => visitNode(node);
15508
14408 R visitFunctionDeclaration(FunctionDeclaration node) => visitNode(node); 15509 R visitFunctionDeclaration(FunctionDeclaration node) => visitNode(node);
15510
14409 R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => visi tNode(node); 15511 R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => visi tNode(node);
15512
14410 R visitFunctionExpression(FunctionExpression node) => visitNode(node); 15513 R visitFunctionExpression(FunctionExpression node) => visitNode(node);
15514
14411 R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => visi tNode(node); 15515 R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => visi tNode(node);
15516
14412 R visitFunctionTypeAlias(FunctionTypeAlias node) => visitNode(node); 15517 R visitFunctionTypeAlias(FunctionTypeAlias node) => visitNode(node);
15518
14413 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => visi tNode(node); 15519 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => visi tNode(node);
15520
14414 R visitHideCombinator(HideCombinator node) => visitNode(node); 15521 R visitHideCombinator(HideCombinator node) => visitNode(node);
15522
14415 R visitIfStatement(IfStatement node) => visitNode(node); 15523 R visitIfStatement(IfStatement node) => visitNode(node);
15524
14416 R visitImplementsClause(ImplementsClause node) => visitNode(node); 15525 R visitImplementsClause(ImplementsClause node) => visitNode(node);
15526
14417 R visitImportDirective(ImportDirective node) => visitNode(node); 15527 R visitImportDirective(ImportDirective node) => visitNode(node);
15528
14418 R visitIndexExpression(IndexExpression node) => visitNode(node); 15529 R visitIndexExpression(IndexExpression node) => visitNode(node);
15530
14419 R visitInstanceCreationExpression(InstanceCreationExpression node) => visitNod e(node); 15531 R visitInstanceCreationExpression(InstanceCreationExpression node) => visitNod e(node);
15532
14420 R visitIntegerLiteral(IntegerLiteral node) => visitNode(node); 15533 R visitIntegerLiteral(IntegerLiteral node) => visitNode(node);
15534
14421 R visitInterpolationExpression(InterpolationExpression node) => visitNode(node ); 15535 R visitInterpolationExpression(InterpolationExpression node) => visitNode(node );
15536
14422 R visitInterpolationString(InterpolationString node) => visitNode(node); 15537 R visitInterpolationString(InterpolationString node) => visitNode(node);
15538
14423 R visitIsExpression(IsExpression node) => visitNode(node); 15539 R visitIsExpression(IsExpression node) => visitNode(node);
15540
14424 R visitLabel(Label node) => visitNode(node); 15541 R visitLabel(Label node) => visitNode(node);
15542
14425 R visitLabeledStatement(LabeledStatement node) => visitNode(node); 15543 R visitLabeledStatement(LabeledStatement node) => visitNode(node);
15544
14426 R visitLibraryDirective(LibraryDirective node) => visitNode(node); 15545 R visitLibraryDirective(LibraryDirective node) => visitNode(node);
15546
14427 R visitLibraryIdentifier(LibraryIdentifier node) => visitNode(node); 15547 R visitLibraryIdentifier(LibraryIdentifier node) => visitNode(node);
15548
14428 R visitListLiteral(ListLiteral node) => visitNode(node); 15549 R visitListLiteral(ListLiteral node) => visitNode(node);
15550
14429 R visitMapLiteral(MapLiteral node) => visitNode(node); 15551 R visitMapLiteral(MapLiteral node) => visitNode(node);
15552
14430 R visitMapLiteralEntry(MapLiteralEntry node) => visitNode(node); 15553 R visitMapLiteralEntry(MapLiteralEntry node) => visitNode(node);
15554
14431 R visitMethodDeclaration(MethodDeclaration node) => visitNode(node); 15555 R visitMethodDeclaration(MethodDeclaration node) => visitNode(node);
15556
14432 R visitMethodInvocation(MethodInvocation node) => visitNode(node); 15557 R visitMethodInvocation(MethodInvocation node) => visitNode(node);
15558
14433 R visitNamedExpression(NamedExpression node) => visitNode(node); 15559 R visitNamedExpression(NamedExpression node) => visitNode(node);
15560
14434 R visitNativeClause(NativeClause node) => visitNode(node); 15561 R visitNativeClause(NativeClause node) => visitNode(node);
15562
14435 R visitNativeFunctionBody(NativeFunctionBody node) => visitNode(node); 15563 R visitNativeFunctionBody(NativeFunctionBody node) => visitNode(node);
15564
14436 R visitNode(ASTNode node) { 15565 R visitNode(ASTNode node) {
14437 node.visitChildren(this); 15566 node.visitChildren(this);
14438 return null; 15567 return null;
14439 } 15568 }
15569
14440 R visitNullLiteral(NullLiteral node) => visitNode(node); 15570 R visitNullLiteral(NullLiteral node) => visitNode(node);
15571
14441 R visitParenthesizedExpression(ParenthesizedExpression node) => visitNode(node ); 15572 R visitParenthesizedExpression(ParenthesizedExpression node) => visitNode(node );
15573
14442 R visitPartDirective(PartDirective node) => visitNode(node); 15574 R visitPartDirective(PartDirective node) => visitNode(node);
15575
14443 R visitPartOfDirective(PartOfDirective node) => visitNode(node); 15576 R visitPartOfDirective(PartOfDirective node) => visitNode(node);
15577
14444 R visitPostfixExpression(PostfixExpression node) => visitNode(node); 15578 R visitPostfixExpression(PostfixExpression node) => visitNode(node);
15579
14445 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitNode(node); 15580 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitNode(node);
15581
14446 R visitPrefixExpression(PrefixExpression node) => visitNode(node); 15582 R visitPrefixExpression(PrefixExpression node) => visitNode(node);
15583
14447 R visitPropertyAccess(PropertyAccess node) => visitNode(node); 15584 R visitPropertyAccess(PropertyAccess node) => visitNode(node);
15585
14448 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => visitNode(node); 15586 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => visitNode(node);
15587
14449 R visitRethrowExpression(RethrowExpression node) => visitNode(node); 15588 R visitRethrowExpression(RethrowExpression node) => visitNode(node);
15589
14450 R visitReturnStatement(ReturnStatement node) => visitNode(node); 15590 R visitReturnStatement(ReturnStatement node) => visitNode(node);
15591
14451 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag); 15592 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag);
15593
14452 R visitShowCombinator(ShowCombinator node) => visitNode(node); 15594 R visitShowCombinator(ShowCombinator node) => visitNode(node);
15595
14453 R visitSimpleFormalParameter(SimpleFormalParameter node) => visitNode(node); 15596 R visitSimpleFormalParameter(SimpleFormalParameter node) => visitNode(node);
15597
14454 R visitSimpleIdentifier(SimpleIdentifier node) => visitNode(node); 15598 R visitSimpleIdentifier(SimpleIdentifier node) => visitNode(node);
15599
14455 R visitSimpleStringLiteral(SimpleStringLiteral node) => visitNode(node); 15600 R visitSimpleStringLiteral(SimpleStringLiteral node) => visitNode(node);
15601
14456 R visitStringInterpolation(StringInterpolation node) => visitNode(node); 15602 R visitStringInterpolation(StringInterpolation node) => visitNode(node);
15603
14457 R visitSuperConstructorInvocation(SuperConstructorInvocation node) => visitNod e(node); 15604 R visitSuperConstructorInvocation(SuperConstructorInvocation node) => visitNod e(node);
15605
14458 R visitSuperExpression(SuperExpression node) => visitNode(node); 15606 R visitSuperExpression(SuperExpression node) => visitNode(node);
15607
14459 R visitSwitchCase(SwitchCase node) => visitNode(node); 15608 R visitSwitchCase(SwitchCase node) => visitNode(node);
15609
14460 R visitSwitchDefault(SwitchDefault node) => visitNode(node); 15610 R visitSwitchDefault(SwitchDefault node) => visitNode(node);
15611
14461 R visitSwitchStatement(SwitchStatement node) => visitNode(node); 15612 R visitSwitchStatement(SwitchStatement node) => visitNode(node);
15613
14462 R visitSymbolLiteral(SymbolLiteral node) => visitNode(node); 15614 R visitSymbolLiteral(SymbolLiteral node) => visitNode(node);
15615
14463 R visitThisExpression(ThisExpression node) => visitNode(node); 15616 R visitThisExpression(ThisExpression node) => visitNode(node);
15617
14464 R visitThrowExpression(ThrowExpression node) => visitNode(node); 15618 R visitThrowExpression(ThrowExpression node) => visitNode(node);
15619
14465 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => visitN ode(node); 15620 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => visitN ode(node);
15621
14466 R visitTryStatement(TryStatement node) => visitNode(node); 15622 R visitTryStatement(TryStatement node) => visitNode(node);
15623
14467 R visitTypeArgumentList(TypeArgumentList node) => visitNode(node); 15624 R visitTypeArgumentList(TypeArgumentList node) => visitNode(node);
15625
14468 R visitTypeName(TypeName node) => visitNode(node); 15626 R visitTypeName(TypeName node) => visitNode(node);
15627
14469 R visitTypeParameter(TypeParameter node) => visitNode(node); 15628 R visitTypeParameter(TypeParameter node) => visitNode(node);
15629
14470 R visitTypeParameterList(TypeParameterList node) => visitNode(node); 15630 R visitTypeParameterList(TypeParameterList node) => visitNode(node);
15631
14471 R visitVariableDeclaration(VariableDeclaration node) => visitNode(node); 15632 R visitVariableDeclaration(VariableDeclaration node) => visitNode(node);
15633
14472 R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node ); 15634 R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node );
15635
14473 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visi tNode(node); 15636 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visi tNode(node);
15637
14474 R visitWhileStatement(WhileStatement node) => visitNode(node); 15638 R visitWhileStatement(WhileStatement node) => visitNode(node);
15639
14475 R visitWithClause(WithClause node) => visitNode(node); 15640 R visitWithClause(WithClause node) => visitNode(node);
14476 } 15641 }
15642
14477 /** 15643 /**
14478 * Instances of the class `ASTCloner` implement an object that will clone any AS T structure 15644 * Instances of the class `ASTCloner` implement an object that will clone any AS T structure
14479 * that it visits. The cloner will only clone the structure, it will not preserv e any resolution 15645 * that it visits. The cloner will only clone the structure, it will not preserv e any resolution
14480 * results or properties associated with the nodes. 15646 * results or properties associated with the nodes.
14481 */ 15647 */
14482 class ASTCloner implements ASTVisitor<ASTNode> { 15648 class ASTCloner implements ASTVisitor<ASTNode> {
14483 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs.full(clone3(node.strings)); 15649 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs.full(clone3(node.strings));
15650
14484 Annotation visitAnnotation(Annotation node) => new Annotation.full(node.atSign , clone2(node.name), node.period, clone2(node.constructorName), clone2(node.argu ments)); 15651 Annotation visitAnnotation(Annotation node) => new Annotation.full(node.atSign , clone2(node.name), node.period, clone2(node.constructorName), clone2(node.argu ments));
15652
14485 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) => new ArgumentDefinitionTest.full(node.question, clone2(node.identifier)); 15653 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) => new ArgumentDefinitionTest.full(node.question, clone2(node.identifier));
15654
14486 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList.full(nod e.leftParenthesis, clone3(node.arguments), node.rightParenthesis); 15655 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList.full(nod e.leftParenthesis, clone3(node.arguments), node.rightParenthesis);
15656
14487 AsExpression visitAsExpression(AsExpression node) => new AsExpression.full(clo ne2(node.expression), node.asOperator, clone2(node.type)); 15657 AsExpression visitAsExpression(AsExpression node) => new AsExpression.full(clo ne2(node.expression), node.asOperator, clone2(node.type));
15658
14488 ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement.full (node.keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthes is, node.semicolon); 15659 ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement.full (node.keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthes is, node.semicolon);
15660
14489 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => n ew AssignmentExpression.full(clone2(node.leftHandSide), node.operator, clone2(no de.rightHandSide)); 15661 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => n ew AssignmentExpression.full(clone2(node.leftHandSide), node.operator, clone2(no de.rightHandSide));
15662
14490 BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExp ression.full(clone2(node.leftOperand), node.operator, clone2(node.rightOperand)) ; 15663 BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExp ression.full(clone2(node.leftOperand), node.operator, clone2(node.rightOperand)) ;
15664
14491 Block visitBlock(Block node) => new Block.full(node.leftBracket, clone3(node.s tatements), node.rightBracket); 15665 Block visitBlock(Block node) => new Block.full(node.leftBracket, clone3(node.s tatements), node.rightBracket);
15666
14492 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody.full(clone2(node.block)); 15667 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody.full(clone2(node.block));
15668
14493 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral. full(node.literal, node.value); 15669 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral. full(node.literal, node.value);
15670
14494 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement. full(node.keyword, clone2(node.label), node.semicolon); 15671 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement. full(node.keyword, clone2(node.label), node.semicolon);
15672
14495 CascadeExpression visitCascadeExpression(CascadeExpression node) => new Cascad eExpression.full(clone2(node.target), clone3(node.cascadeSections)); 15673 CascadeExpression visitCascadeExpression(CascadeExpression node) => new Cascad eExpression.full(clone2(node.target), clone3(node.cascadeSections));
15674
14496 CatchClause visitCatchClause(CatchClause node) => new CatchClause.full(node.on Keyword, clone2(node.exceptionType), node.catchKeyword, node.leftParenthesis, cl one2(node.exceptionParameter), node.comma, clone2(node.stackTraceParameter), nod e.rightParenthesis, clone2(node.body)); 15675 CatchClause visitCatchClause(CatchClause node) => new CatchClause.full(node.on Keyword, clone2(node.exceptionType), node.catchKeyword, node.leftParenthesis, cl one2(node.exceptionParameter), node.comma, clone2(node.stackTraceParameter), nod e.rightParenthesis, clone2(node.body));
15676
14497 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { 15677 ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
14498 ClassDeclaration copy = new ClassDeclaration.full(clone2(node.documentationC omment), clone3(node.metadata), node.abstractKeyword, node.classKeyword, clone2( node.name), clone2(node.typeParameters), clone2(node.extendsClause), clone2(node .withClause), clone2(node.implementsClause), node.leftBracket, clone3(node.membe rs), node.rightBracket); 15678 ClassDeclaration copy = new ClassDeclaration.full(clone2(node.documentationC omment), clone3(node.metadata), node.abstractKeyword, node.classKeyword, clone2( node.name), clone2(node.typeParameters), clone2(node.extendsClause), clone2(node .withClause), clone2(node.implementsClause), node.leftBracket, clone3(node.membe rs), node.rightBracket);
14499 copy.nativeClause = clone2(node.nativeClause); 15679 copy.nativeClause = clone2(node.nativeClause);
14500 return copy; 15680 return copy;
14501 } 15681 }
15682
14502 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias. full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clo ne2(node.name), clone2(node.typeParameters), node.equals, node.abstractKeyword, clone2(node.superclass), clone2(node.withClause), clone2(node.implementsClause), node.semicolon); 15683 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias. full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clo ne2(node.name), clone2(node.typeParameters), node.equals, node.abstractKeyword, clone2(node.superclass), clone2(node.withClause), clone2(node.implementsClause), node.semicolon);
15684
14503 Comment visitComment(Comment node) { 15685 Comment visitComment(Comment node) {
14504 if (node.isDocumentation) { 15686 if (node.isDocumentation) {
14505 return Comment.createDocumentationComment2(node.tokens, clone3(node.refere nces)); 15687 return Comment.createDocumentationComment2(node.tokens, clone3(node.refere nces));
14506 } else if (node.isBlock) { 15688 } else if (node.isBlock) {
14507 return Comment.createBlockComment(node.tokens); 15689 return Comment.createBlockComment(node.tokens);
14508 } 15690 }
14509 return Comment.createEndOfLineComment(node.tokens); 15691 return Comment.createEndOfLineComment(node.tokens);
14510 } 15692 }
15693
14511 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference.full(node.newKeyword, clone2(node.identifier)); 15694 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference.full(node.newKeyword, clone2(node.identifier));
15695
14512 CompilationUnit visitCompilationUnit(CompilationUnit node) { 15696 CompilationUnit visitCompilationUnit(CompilationUnit node) {
14513 CompilationUnit clone = new CompilationUnit.full(node.beginToken, clone2(nod e.scriptTag), clone3(node.directives), clone3(node.declarations), node.endToken) ; 15697 CompilationUnit clone = new CompilationUnit.full(node.beginToken, clone2(nod e.scriptTag), clone3(node.directives), clone3(node.declarations), node.endToken) ;
14514 clone.lineInfo = node.lineInfo; 15698 clone.lineInfo = node.lineInfo;
14515 return clone; 15699 return clone;
14516 } 15700 }
15701
14517 ConditionalExpression visitConditionalExpression(ConditionalExpression node) = > new ConditionalExpression.full(clone2(node.condition), node.question, clone2(n ode.thenExpression), node.colon, clone2(node.elseExpression)); 15702 ConditionalExpression visitConditionalExpression(ConditionalExpression node) = > new ConditionalExpression.full(clone2(node.condition), node.question, clone2(n ode.thenExpression), node.colon, clone2(node.elseExpression));
15703
14518 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node ) => new ConstructorDeclaration.full(clone2(node.documentationComment), clone3(n ode.metadata), node.externalKeyword, node.constKeyword, node.factoryKeyword, clo ne2(node.returnType), node.period, clone2(node.name), clone2(node.parameters), n ode.separator, clone3(node.initializers), clone2(node.redirectedConstructor), cl one2(node.body)); 15704 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node ) => new ConstructorDeclaration.full(clone2(node.documentationComment), clone3(n ode.metadata), node.externalKeyword, node.constKeyword, node.factoryKeyword, clo ne2(node.returnType), node.period, clone2(node.name), clone2(node.parameters), n ode.separator, clone3(node.initializers), clone2(node.redirectedConstructor), cl one2(node.body));
15705
14519 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI nitializer node) => new ConstructorFieldInitializer.full(node.keyword, node.peri od, clone2(node.fieldName), node.equals, clone2(node.expression)); 15706 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI nitializer node) => new ConstructorFieldInitializer.full(node.keyword, node.peri od, clone2(node.fieldName), node.equals, clone2(node.expression));
15707
14520 ConstructorName visitConstructorName(ConstructorName node) => new ConstructorN ame.full(clone2(node.type), node.period, clone2(node.name)); 15708 ConstructorName visitConstructorName(ConstructorName node) => new ConstructorN ame.full(clone2(node.type), node.period, clone2(node.name));
15709
14521 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin ueStatement.full(node.keyword, clone2(node.label), node.semicolon); 15710 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin ueStatement.full(node.keyword, clone2(node.label), node.semicolon);
15711
14522 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec laredIdentifier.full(clone2(node.documentationComment), clone3(node.metadata), n ode.keyword, clone2(node.type), clone2(node.identifier)); 15712 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec laredIdentifier.full(clone2(node.documentationComment), clone3(node.metadata), n ode.keyword, clone2(node.type), clone2(node.identifier));
15713
14523 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node ) => new DefaultFormalParameter.full(clone2(node.parameter), node.kind, node.sep arator, clone2(node.defaultValue)); 15714 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node ) => new DefaultFormalParameter.full(clone2(node.parameter), node.kind, node.sep arator, clone2(node.defaultValue));
15715
14524 DoStatement visitDoStatement(DoStatement node) => new DoStatement.full(node.do Keyword, clone2(node.body), node.whileKeyword, node.leftParenthesis, clone2(node .condition), node.rightParenthesis, node.semicolon); 15716 DoStatement visitDoStatement(DoStatement node) => new DoStatement.full(node.do Keyword, clone2(node.body), node.whileKeyword, node.leftParenthesis, clone2(node .condition), node.rightParenthesis, node.semicolon);
15717
14525 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => new DoubleLiteral.full (node.literal, node.value); 15718 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => new DoubleLiteral.full (node.literal, node.value);
15719
14526 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF unctionBody.full(node.semicolon); 15720 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF unctionBody.full(node.semicolon);
15721
14527 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement. full(node.semicolon); 15722 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement. full(node.semicolon);
15723
14528 ExportDirective visitExportDirective(ExportDirective node) => new ExportDirect ive.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.uri), clone3(node.combinators), node.semicolon); 15724 ExportDirective visitExportDirective(ExportDirective node) => new ExportDirect ive.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.uri), clone3(node.combinators), node.semicolon);
15725
14529 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody.full(node.functionDefinition, clone2(node.expres sion), node.semicolon); 15726 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody.full(node.functionDefinition, clone2(node.expres sion), node.semicolon);
15727
14530 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement.full(clone2(node.expression), node.semicolon); 15728 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement.full(clone2(node.expression), node.semicolon);
15729
14531 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause.full (node.keyword, clone2(node.superclass)); 15730 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause.full (node.keyword, clone2(node.superclass));
15731
14532 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration.full(clone2(node.documentationComment), clone3(node.metadata), node.stat icKeyword, clone2(node.fields), node.semicolon); 15732 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration.full(clone2(node.documentationComment), clone3(node.metadata), node.stat icKeyword, clone2(node.fields), node.semicolon);
15733
14533 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter.full(clone2(node.documentationComment), clone3(node.meta data), node.keyword, clone2(node.type), node.thisToken, node.period, clone2(node .identifier), clone2(node.parameters)); 15734 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter.full(clone2(node.documentationComment), clone3(node.meta data), node.keyword, clone2(node.type), node.thisToken, node.period, clone2(node .identifier), clone2(node.parameters));
15735
14534 ForEachStatement visitForEachStatement(ForEachStatement node) { 15736 ForEachStatement visitForEachStatement(ForEachStatement node) {
14535 DeclaredIdentifier loopVariable = node.loopVariable; 15737 DeclaredIdentifier loopVariable = node.loopVariable;
14536 if (loopVariable == null) { 15738 if (loopVariable == null) {
14537 return new ForEachStatement.con2_full(node.forKeyword, node.leftParenthesi s, clone2(node.identifier), node.inKeyword, clone2(node.iterator), node.rightPar enthesis, clone2(node.body)); 15739 return new ForEachStatement.con2_full(node.forKeyword, node.leftParenthesi s, clone2(node.identifier), node.inKeyword, clone2(node.iterator), node.rightPar enthesis, clone2(node.body));
14538 } 15740 }
14539 return new ForEachStatement.con1_full(node.forKeyword, node.leftParenthesis, clone2(loopVariable), node.inKeyword, clone2(node.iterator), node.rightParenthe sis, clone2(node.body)); 15741 return new ForEachStatement.con1_full(node.forKeyword, node.leftParenthesis, clone2(loopVariable), node.inKeyword, clone2(node.iterator), node.rightParenthe sis, clone2(node.body));
14540 } 15742 }
15743
14541 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList.full(node.leftParenthesis, clone3(node.parameters), node.lef tDelimiter, node.rightDelimiter, node.rightParenthesis); 15744 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList.full(node.leftParenthesis, clone3(node.parameters), node.lef tDelimiter, node.rightDelimiter, node.rightParenthesis);
15745
14542 ForStatement visitForStatement(ForStatement node) => new ForStatement.full(nod e.forKeyword, node.leftParenthesis, clone2(node.variables), clone2(node.initiali zation), node.leftSeparator, clone2(node.condition), node.rightSeparator, clone3 (node.updaters), node.rightParenthesis, clone2(node.body)); 15746 ForStatement visitForStatement(ForStatement node) => new ForStatement.full(nod e.forKeyword, node.leftParenthesis, clone2(node.variables), clone2(node.initiali zation), node.leftSeparator, clone2(node.condition), node.rightSeparator, clone3 (node.updaters), node.rightParenthesis, clone2(node.body));
15747
14543 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration.full(clone2(node.documentationComment), clone3(node.metadata ), node.externalKeyword, clone2(node.returnType), node.propertyKeyword, clone2(n ode.name), clone2(node.functionExpression)); 15748 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration.full(clone2(node.documentationComment), clone3(node.metadata ), node.externalKeyword, clone2(node.returnType), node.propertyKeyword, clone2(n ode.name), clone2(node.functionExpression));
15749
14544 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara tionStatement node) => new FunctionDeclarationStatement.full(clone2(node.functio nDeclaration)); 15750 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara tionStatement node) => new FunctionDeclarationStatement.full(clone2(node.functio nDeclaration));
15751
14545 FunctionExpression visitFunctionExpression(FunctionExpression node) => new Fun ctionExpression.full(clone2(node.parameters), clone2(node.body)); 15752 FunctionExpression visitFunctionExpression(FunctionExpression node) => new Fun ctionExpression.full(clone2(node.parameters), clone2(node.body));
15753
14546 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress ionInvocation node) => new FunctionExpressionInvocation.full(clone2(node.functio n), clone2(node.argumentList)); 15754 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress ionInvocation node) => new FunctionExpressionInvocation.full(clone2(node.functio n), clone2(node.argumentList));
15755
14547 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi onTypeAlias.full(clone2(node.documentationComment), clone3(node.metadata), node. keyword, clone2(node.returnType), clone2(node.name), clone2(node.typeParameters) , clone2(node.parameters), node.semicolon); 15756 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi onTypeAlias.full(clone2(node.documentationComment), clone3(node.metadata), node. keyword, clone2(node.returnType), clone2(node.name), clone2(node.typeParameters) , clone2(node.parameters), node.semicolon);
15757
14548 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo rmalParameter node) => new FunctionTypedFormalParameter.full(clone2(node.documen tationComment), clone3(node.metadata), clone2(node.returnType), clone2(node.iden tifier), clone2(node.parameters)); 15758 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo rmalParameter node) => new FunctionTypedFormalParameter.full(clone2(node.documen tationComment), clone3(node.metadata), clone2(node.returnType), clone2(node.iden tifier), clone2(node.parameters));
15759
14549 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator. full(node.keyword, clone3(node.hiddenNames)); 15760 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator. full(node.keyword, clone3(node.hiddenNames));
15761
14550 IfStatement visitIfStatement(IfStatement node) => new IfStatement.full(node.if Keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthesis, cl one2(node.thenStatement), node.elseKeyword, clone2(node.elseStatement)); 15762 IfStatement visitIfStatement(IfStatement node) => new IfStatement.full(node.if Keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthesis, cl one2(node.thenStatement), node.elseKeyword, clone2(node.elseStatement));
15763
14551 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement sClause.full(node.keyword, clone3(node.interfaces)); 15764 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement sClause.full(node.keyword, clone3(node.interfaces));
15765
14552 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect ive.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.uri), node.asToken, clone2(node.prefix), clone3(node.combinators), node.semicolon); 15766 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect ive.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.uri), node.asToken, clone2(node.prefix), clone3(node.combinators), node.semicolon);
15767
14553 IndexExpression visitIndexExpression(IndexExpression node) { 15768 IndexExpression visitIndexExpression(IndexExpression node) {
14554 Token period = node.period; 15769 Token period = node.period;
14555 if (period == null) { 15770 if (period == null) {
14556 return new IndexExpression.forTarget_full(clone2(node.target), node.leftBr acket, clone2(node.index), node.rightBracket); 15771 return new IndexExpression.forTarget_full(clone2(node.target), node.leftBr acket, clone2(node.index), node.rightBracket);
14557 } else { 15772 } else {
14558 return new IndexExpression.forCascade_full(period, node.leftBracket, clone 2(node.index), node.rightBracket); 15773 return new IndexExpression.forCascade_full(period, node.leftBracket, clone 2(node.index), node.rightBracket);
14559 } 15774 }
14560 } 15775 }
15776
14561 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp ression node) => new InstanceCreationExpression.full(node.keyword, clone2(node.c onstructorName), clone2(node.argumentList)); 15777 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp ression node) => new InstanceCreationExpression.full(node.keyword, clone2(node.c onstructorName), clone2(node.argumentList));
15778
14562 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => new IntegerLiteral. full(node.literal, node.value); 15779 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => new IntegerLiteral. full(node.literal, node.value);
15780
14563 InterpolationExpression visitInterpolationExpression(InterpolationExpression n ode) => new InterpolationExpression.full(node.leftBracket, clone2(node.expressio n), node.rightBracket); 15781 InterpolationExpression visitInterpolationExpression(InterpolationExpression n ode) => new InterpolationExpression.full(node.leftBracket, clone2(node.expressio n), node.rightBracket);
15782
14564 InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString.full(node.contents, node.value); 15783 InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString.full(node.contents, node.value);
15784
14565 IsExpression visitIsExpression(IsExpression node) => new IsExpression.full(clo ne2(node.expression), node.isOperator, node.notOperator, clone2(node.type)); 15785 IsExpression visitIsExpression(IsExpression node) => new IsExpression.full(clo ne2(node.expression), node.isOperator, node.notOperator, clone2(node.type));
15786
14566 Label visitLabel(Label node) => new Label.full(clone2(node.label), node.colon) ; 15787 Label visitLabel(Label node) => new Label.full(clone2(node.label), node.colon) ;
15788
14567 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt atement.full(clone3(node.labels), clone2(node.statement)); 15789 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt atement.full(clone3(node.labels), clone2(node.statement));
15790
14568 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi rective.full(clone2(node.documentationComment), clone3(node.metadata), node.libr aryToken, clone2(node.name), node.semicolon); 15791 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi rective.full(clone2(node.documentationComment), clone3(node.metadata), node.libr aryToken, clone2(node.name), node.semicolon);
15792
14569 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => new Librar yIdentifier.full(clone3(node.components)); 15793 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => new Librar yIdentifier.full(clone3(node.components));
15794
14570 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral.full(node.co nstKeyword, clone2(node.typeArguments), node.leftBracket, clone3(node.elements), node.rightBracket); 15795 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral.full(node.co nstKeyword, clone2(node.typeArguments), node.leftBracket, clone3(node.elements), node.rightBracket);
15796
14571 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral.full(node.constK eyword, clone2(node.typeArguments), node.leftBracket, clone3(node.entries), node .rightBracket); 15797 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral.full(node.constK eyword, clone2(node.typeArguments), node.leftBracket, clone3(node.entries), node .rightBracket);
15798
14572 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn try.full(clone2(node.key), node.separator, clone2(node.value)); 15799 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn try.full(clone2(node.key), node.separator, clone2(node.value));
15800
14573 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method Declaration.full(clone2(node.documentationComment), clone3(node.metadata), node. externalKeyword, node.modifierKeyword, clone2(node.returnType), node.propertyKey word, node.operatorKeyword, clone2(node.name), clone2(node.parameters), clone2(n ode.body)); 15801 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method Declaration.full(clone2(node.documentationComment), clone3(node.metadata), node. externalKeyword, node.modifierKeyword, clone2(node.returnType), node.propertyKey word, node.operatorKeyword, clone2(node.name), clone2(node.parameters), clone2(n ode.body));
15802
14574 MethodInvocation visitMethodInvocation(MethodInvocation node) => new MethodInv ocation.full(clone2(node.target), node.period, clone2(node.methodName), clone2(n ode.argumentList)); 15803 MethodInvocation visitMethodInvocation(MethodInvocation node) => new MethodInv ocation.full(clone2(node.target), node.period, clone2(node.methodName), clone2(n ode.argumentList));
15804
14575 NamedExpression visitNamedExpression(NamedExpression node) => new NamedExpress ion.full(clone2(node.name), clone2(node.expression)); 15805 NamedExpression visitNamedExpression(NamedExpression node) => new NamedExpress ion.full(clone2(node.name), clone2(node.expression));
15806
14576 ASTNode visitNativeClause(NativeClause node) => new NativeClause.full(node.key word, clone2(node.name)); 15807 ASTNode visitNativeClause(NativeClause node) => new NativeClause.full(node.key word, clone2(node.name));
15808
14577 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat iveFunctionBody.full(node.nativeToken, clone2(node.stringLiteral), node.semicolo n); 15809 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat iveFunctionBody.full(node.nativeToken, clone2(node.stringLiteral), node.semicolo n);
15810
14578 NullLiteral visitNullLiteral(NullLiteral node) => new NullLiteral.full(node.li teral); 15811 NullLiteral visitNullLiteral(NullLiteral node) => new NullLiteral.full(node.li teral);
15812
14579 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n ode) => new ParenthesizedExpression.full(node.leftParenthesis, clone2(node.expre ssion), node.rightParenthesis); 15813 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n ode) => new ParenthesizedExpression.full(node.leftParenthesis, clone2(node.expre ssion), node.rightParenthesis);
15814
14580 PartDirective visitPartDirective(PartDirective node) => new PartDirective.full (clone2(node.documentationComment), clone3(node.metadata), node.partToken, clone 2(node.uri), node.semicolon); 15815 PartDirective visitPartDirective(PartDirective node) => new PartDirective.full (clone2(node.documentationComment), clone3(node.metadata), node.partToken, clone 2(node.uri), node.semicolon);
15816
14581 PartOfDirective visitPartOfDirective(PartOfDirective node) => new PartOfDirect ive.full(clone2(node.documentationComment), clone3(node.metadata), node.partToke n, node.ofToken, clone2(node.libraryName), node.semicolon); 15817 PartOfDirective visitPartOfDirective(PartOfDirective node) => new PartOfDirect ive.full(clone2(node.documentationComment), clone3(node.metadata), node.partToke n, node.ofToken, clone2(node.libraryName), node.semicolon);
15818
14582 PostfixExpression visitPostfixExpression(PostfixExpression node) => new Postfi xExpression.full(clone2(node.operand), node.operator); 15819 PostfixExpression visitPostfixExpression(PostfixExpression node) => new Postfi xExpression.full(clone2(node.operand), node.operator);
15820
14583 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => new Pre fixedIdentifier.full(clone2(node.prefix), node.period, clone2(node.identifier)); 15821 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => new Pre fixedIdentifier.full(clone2(node.prefix), node.period, clone2(node.identifier));
15822
14584 PrefixExpression visitPrefixExpression(PrefixExpression node) => new PrefixExp ression.full(node.operator, clone2(node.operand)); 15823 PrefixExpression visitPrefixExpression(PrefixExpression node) => new PrefixExp ression.full(node.operator, clone2(node.operand));
15824
14585 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess. full(clone2(node.target), node.operator, clone2(node.propertyName)); 15825 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess. full(clone2(node.target), node.operator, clone2(node.propertyName));
15826
14586 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec tingConstructorInvocation node) => new RedirectingConstructorInvocation.full(nod e.keyword, node.period, clone2(node.constructorName), clone2(node.argumentList)) ; 15827 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec tingConstructorInvocation node) => new RedirectingConstructorInvocation.full(nod e.keyword, node.period, clone2(node.constructorName), clone2(node.argumentList)) ;
15828
14587 RethrowExpression visitRethrowExpression(RethrowExpression node) => new Rethro wExpression.full(node.keyword); 15829 RethrowExpression visitRethrowExpression(RethrowExpression node) => new Rethro wExpression.full(node.keyword);
15830
14588 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent.full(node.keyword, clone2(node.expression), node.semicolon); 15831 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent.full(node.keyword, clone2(node.expression), node.semicolon);
15832
14589 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag.full(node.scriptTag) ; 15833 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag.full(node.scriptTag) ;
15834
14590 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator. full(node.keyword, clone3(node.shownNames)); 15835 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator. full(node.keyword, clone3(node.shownNames));
15836
14591 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter.full(clone2(node.documentationComment), clone3(node. metadata), node.keyword, clone2(node.type), clone2(node.identifier)); 15837 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter.full(clone2(node.documentationComment), clone3(node. metadata), node.keyword, clone2(node.type), clone2(node.identifier));
15838
14592 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => new SimpleIde ntifier.full(node.token); 15839 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => new SimpleIde ntifier.full(node.token);
15840
14593 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => new SimpleStringLiteral.full(node.literal, node.value); 15841 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => new SimpleStringLiteral.full(node.literal, node.value);
15842
14594 StringInterpolation visitStringInterpolation(StringInterpolation node) => new StringInterpolation.full(clone3(node.elements)); 15843 StringInterpolation visitStringInterpolation(StringInterpolation node) => new StringInterpolation.full(clone3(node.elements));
15844
14595 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv ocation node) => new SuperConstructorInvocation.full(node.keyword, node.period, clone2(node.constructorName), clone2(node.argumentList)); 15845 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv ocation node) => new SuperConstructorInvocation.full(node.keyword, node.period, clone2(node.constructorName), clone2(node.argumentList));
15846
14596 SuperExpression visitSuperExpression(SuperExpression node) => new SuperExpress ion.full(node.keyword); 15847 SuperExpression visitSuperExpression(SuperExpression node) => new SuperExpress ion.full(node.keyword);
15848
14597 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase.full(clone3(node .labels), node.keyword, clone2(node.expression), node.colon, clone3(node.stateme nts)); 15849 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase.full(clone3(node .labels), node.keyword, clone2(node.expression), node.colon, clone3(node.stateme nts));
15850
14598 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault.full (clone3(node.labels), node.keyword, node.colon, clone3(node.statements)); 15851 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault.full (clone3(node.labels), node.keyword, node.colon, clone3(node.statements));
15852
14599 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem ent.full(node.keyword, node.leftParenthesis, clone2(node.expression), node.right Parenthesis, node.leftBracket, clone3(node.members), node.rightBracket); 15853 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem ent.full(node.keyword, node.leftParenthesis, clone2(node.expression), node.right Parenthesis, node.leftBracket, clone3(node.members), node.rightBracket);
15854
14600 ASTNode visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral.full(node. poundSign, node.components); 15855 ASTNode visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral.full(node. poundSign, node.components);
15856
14601 ThisExpression visitThisExpression(ThisExpression node) => new ThisExpression. full(node.keyword); 15857 ThisExpression visitThisExpression(ThisExpression node) => new ThisExpression. full(node.keyword);
15858
14602 ThrowExpression visitThrowExpression(ThrowExpression node) => new ThrowExpress ion.full(node.keyword, clone2(node.expression)); 15859 ThrowExpression visitThrowExpression(ThrowExpression node) => new ThrowExpress ion.full(node.keyword, clone2(node.expression));
15860
14603 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD eclaration node) => new TopLevelVariableDeclaration.full(clone2(node.documentati onComment), clone3(node.metadata), clone2(node.variables), node.semicolon); 15861 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD eclaration node) => new TopLevelVariableDeclaration.full(clone2(node.documentati onComment), clone3(node.metadata), clone2(node.variables), node.semicolon);
15862
14604 TryStatement visitTryStatement(TryStatement node) => new TryStatement.full(nod e.tryKeyword, clone2(node.body), clone3(node.catchClauses), node.finallyKeyword, clone2(node.finallyBlock)); 15863 TryStatement visitTryStatement(TryStatement node) => new TryStatement.full(nod e.tryKeyword, clone2(node.body), clone3(node.catchClauses), node.finallyKeyword, clone2(node.finallyBlock));
15864
14605 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum entList.full(node.leftBracket, clone3(node.arguments), node.rightBracket); 15865 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum entList.full(node.leftBracket, clone3(node.arguments), node.rightBracket);
15866
14606 TypeName visitTypeName(TypeName node) => new TypeName.full(clone2(node.name), clone2(node.typeArguments)); 15867 TypeName visitTypeName(TypeName node) => new TypeName.full(clone2(node.name), clone2(node.typeArguments));
15868
14607 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter.full (clone2(node.documentationComment), clone3(node.metadata), clone2(node.name), no de.keyword, clone2(node.bound)); 15869 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter.full (clone2(node.documentationComment), clone3(node.metadata), clone2(node.name), no de.keyword, clone2(node.bound));
15870
14608 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa rameterList.full(node.leftBracket, clone3(node.typeParameters), node.rightBracke t); 15871 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa rameterList.full(node.leftBracket, clone3(node.typeParameters), node.rightBracke t);
15872
14609 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration.full(null, clone3(node.metadata), clone2(node.name), node.eq uals, clone2(node.initializer)); 15873 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration.full(null, clone3(node.metadata), clone2(node.name), node.eq uals, clone2(node.initializer));
15874
14610 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n ode) => new VariableDeclarationList.full(null, clone3(node.metadata), node.keywo rd, clone2(node.type), clone3(node.variables)); 15875 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n ode) => new VariableDeclarationList.full(null, clone3(node.metadata), node.keywo rd, clone2(node.type), clone3(node.variables));
15876
14611 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement.full(clone2(node.variabl es), node.semicolon); 15877 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement.full(clone2(node.variabl es), node.semicolon);
15878
14612 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement. full(node.keyword, node.leftParenthesis, clone2(node.condition), node.rightParen thesis, clone2(node.body)); 15879 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement. full(node.keyword, node.leftParenthesis, clone2(node.condition), node.rightParen thesis, clone2(node.body));
15880
14613 WithClause visitWithClause(WithClause node) => new WithClause.full(node.withKe yword, clone3(node.mixinTypes)); 15881 WithClause visitWithClause(WithClause node) => new WithClause.full(node.withKe yword, clone3(node.mixinTypes));
15882
14614 ASTNode clone2(ASTNode node) { 15883 ASTNode clone2(ASTNode node) {
14615 if (node == null) { 15884 if (node == null) {
14616 return null; 15885 return null;
14617 } 15886 }
14618 return node.accept(this) as ASTNode; 15887 return node.accept(this) as ASTNode;
14619 } 15888 }
15889
14620 List clone3(NodeList nodes) { 15890 List clone3(NodeList nodes) {
14621 List clonedNodes = new List(); 15891 List clonedNodes = new List();
14622 for (ASTNode node in nodes) { 15892 for (ASTNode node in nodes) {
14623 clonedNodes.add(node.accept(this) as ASTNode); 15893 clonedNodes.add(node.accept(this) as ASTNode);
14624 } 15894 }
14625 return clonedNodes; 15895 return clonedNodes;
14626 } 15896 }
14627 } 15897 }
15898
14628 /** 15899 /**
14629 * Instances of the class `ASTComparator` compare the structure of two ASTNodes to see whether 15900 * Instances of the class `ASTComparator` compare the structure of two ASTNodes to see whether
14630 * they are equal. 15901 * they are equal.
14631 */ 15902 */
14632 class ASTComparator implements ASTVisitor<bool> { 15903 class ASTComparator implements ASTVisitor<bool> {
14633
14634 /** 15904 /**
14635 * Return `true` if the two AST nodes are equal. 15905 * Return `true` if the two AST nodes are equal.
14636 * 15906 *
14637 * @param first the first node being compared 15907 * @param first the first node being compared
14638 * @param second the second node being compared 15908 * @param second the second node being compared
14639 * @return `true` if the two AST nodes are equal 15909 * @return `true` if the two AST nodes are equal
14640 */ 15910 */
14641 static bool equals3(CompilationUnit first, CompilationUnit second) { 15911 static bool equals3(CompilationUnit first, CompilationUnit second) {
14642 ASTComparator comparator = new ASTComparator(); 15912 ASTComparator comparator = new ASTComparator();
14643 return comparator.isEqual(first, second); 15913 return comparator.isEqual(first, second);
14644 } 15914 }
14645 15915
14646 /** 15916 /**
14647 * The AST node with which the node being visited is to be compared. This is o nly valid at the 15917 * The AST node with which the node being visited is to be compared. This is o nly valid at the
14648 * beginning of each visit method (until [isEqual] is invoked). 15918 * beginning of each visit method (until [isEqual] is invoked).
14649 */ 15919 */
14650 ASTNode _other; 15920 ASTNode _other;
15921
14651 bool visitAdjacentStrings(AdjacentStrings node) { 15922 bool visitAdjacentStrings(AdjacentStrings node) {
14652 AdjacentStrings other = this._other as AdjacentStrings; 15923 AdjacentStrings other = this._other as AdjacentStrings;
14653 return isEqual5(node.strings, other.strings); 15924 return isEqual5(node.strings, other.strings);
14654 } 15925 }
15926
14655 bool visitAnnotation(Annotation node) { 15927 bool visitAnnotation(Annotation node) {
14656 Annotation other = this._other as Annotation; 15928 Annotation other = this._other as Annotation;
14657 return isEqual6(node.atSign, other.atSign) && isEqual(node.name, other.name) && isEqual6(node.period, other.period) && isEqual(node.constructorName, other.c onstructorName) && isEqual(node.arguments, other.arguments); 15929 return isEqual6(node.atSign, other.atSign) && isEqual(node.name, other.name) && isEqual6(node.period, other.period) && isEqual(node.constructorName, other.c onstructorName) && isEqual(node.arguments, other.arguments);
14658 } 15930 }
15931
14659 bool visitArgumentDefinitionTest(ArgumentDefinitionTest node) { 15932 bool visitArgumentDefinitionTest(ArgumentDefinitionTest node) {
14660 ArgumentDefinitionTest other = this._other as ArgumentDefinitionTest; 15933 ArgumentDefinitionTest other = this._other as ArgumentDefinitionTest;
14661 return isEqual6(node.question, other.question) && isEqual(node.identifier, o ther.identifier); 15934 return isEqual6(node.question, other.question) && isEqual(node.identifier, o ther.identifier);
14662 } 15935 }
15936
14663 bool visitArgumentList(ArgumentList node) { 15937 bool visitArgumentList(ArgumentList node) {
14664 ArgumentList other = this._other as ArgumentList; 15938 ArgumentList other = this._other as ArgumentList;
14665 return isEqual6(node.leftParenthesis, other.leftParenthesis) && isEqual5(nod e.arguments, other.arguments) && isEqual6(node.rightParenthesis, other.rightPare nthesis); 15939 return isEqual6(node.leftParenthesis, other.leftParenthesis) && isEqual5(nod e.arguments, other.arguments) && isEqual6(node.rightParenthesis, other.rightPare nthesis);
14666 } 15940 }
15941
14667 bool visitAsExpression(AsExpression node) { 15942 bool visitAsExpression(AsExpression node) {
14668 AsExpression other = this._other as AsExpression; 15943 AsExpression other = this._other as AsExpression;
14669 return isEqual(node.expression, other.expression) && isEqual6(node.asOperato r, other.asOperator) && isEqual(node.type, other.type); 15944 return isEqual(node.expression, other.expression) && isEqual6(node.asOperato r, other.asOperator) && isEqual(node.type, other.type);
14670 } 15945 }
15946
14671 bool visitAssertStatement(AssertStatement node) { 15947 bool visitAssertStatement(AssertStatement node) {
14672 AssertStatement other = this._other as AssertStatement; 15948 AssertStatement other = this._other as AssertStatement;
14673 return isEqual6(node.keyword, other.keyword) && isEqual6(node.leftParenthesi s, other.leftParenthesis) && isEqual(node.condition, other.condition) && isEqual 6(node.rightParenthesis, other.rightParenthesis) && isEqual6(node.semicolon, oth er.semicolon); 15949 return isEqual6(node.keyword, other.keyword) && isEqual6(node.leftParenthesi s, other.leftParenthesis) && isEqual(node.condition, other.condition) && isEqual 6(node.rightParenthesis, other.rightParenthesis) && isEqual6(node.semicolon, oth er.semicolon);
14674 } 15950 }
15951
14675 bool visitAssignmentExpression(AssignmentExpression node) { 15952 bool visitAssignmentExpression(AssignmentExpression node) {
14676 AssignmentExpression other = this._other as AssignmentExpression; 15953 AssignmentExpression other = this._other as AssignmentExpression;
14677 return isEqual(node.leftHandSide, other.leftHandSide) && isEqual6(node.opera tor, other.operator) && isEqual(node.rightHandSide, other.rightHandSide); 15954 return isEqual(node.leftHandSide, other.leftHandSide) && isEqual6(node.opera tor, other.operator) && isEqual(node.rightHandSide, other.rightHandSide);
14678 } 15955 }
15956
14679 bool visitBinaryExpression(BinaryExpression node) { 15957 bool visitBinaryExpression(BinaryExpression node) {
14680 BinaryExpression other = this._other as BinaryExpression; 15958 BinaryExpression other = this._other as BinaryExpression;
14681 return isEqual(node.leftOperand, other.leftOperand) && isEqual6(node.operato r, other.operator) && isEqual(node.rightOperand, other.rightOperand); 15959 return isEqual(node.leftOperand, other.leftOperand) && isEqual6(node.operato r, other.operator) && isEqual(node.rightOperand, other.rightOperand);
14682 } 15960 }
15961
14683 bool visitBlock(Block node) { 15962 bool visitBlock(Block node) {
14684 Block other = this._other as Block; 15963 Block other = this._other as Block;
14685 return isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.statem ents, other.statements) && isEqual6(node.rightBracket, other.rightBracket); 15964 return isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.statem ents, other.statements) && isEqual6(node.rightBracket, other.rightBracket);
14686 } 15965 }
15966
14687 bool visitBlockFunctionBody(BlockFunctionBody node) { 15967 bool visitBlockFunctionBody(BlockFunctionBody node) {
14688 BlockFunctionBody other = this._other as BlockFunctionBody; 15968 BlockFunctionBody other = this._other as BlockFunctionBody;
14689 return isEqual(node.block, other.block); 15969 return isEqual(node.block, other.block);
14690 } 15970 }
15971
14691 bool visitBooleanLiteral(BooleanLiteral node) { 15972 bool visitBooleanLiteral(BooleanLiteral node) {
14692 BooleanLiteral other = this._other as BooleanLiteral; 15973 BooleanLiteral other = this._other as BooleanLiteral;
14693 return isEqual6(node.literal, other.literal) && identical(node.value, other. value); 15974 return isEqual6(node.literal, other.literal) && identical(node.value, other. value);
14694 } 15975 }
15976
14695 bool visitBreakStatement(BreakStatement node) { 15977 bool visitBreakStatement(BreakStatement node) {
14696 BreakStatement other = this._other as BreakStatement; 15978 BreakStatement other = this._other as BreakStatement;
14697 return isEqual6(node.keyword, other.keyword) && isEqual(node.label, other.la bel) && isEqual6(node.semicolon, other.semicolon); 15979 return isEqual6(node.keyword, other.keyword) && isEqual(node.label, other.la bel) && isEqual6(node.semicolon, other.semicolon);
14698 } 15980 }
15981
14699 bool visitCascadeExpression(CascadeExpression node) { 15982 bool visitCascadeExpression(CascadeExpression node) {
14700 CascadeExpression other = this._other as CascadeExpression; 15983 CascadeExpression other = this._other as CascadeExpression;
14701 return isEqual(node.target, other.target) && isEqual5(node.cascadeSections, other.cascadeSections); 15984 return isEqual(node.target, other.target) && isEqual5(node.cascadeSections, other.cascadeSections);
14702 } 15985 }
15986
14703 bool visitCatchClause(CatchClause node) { 15987 bool visitCatchClause(CatchClause node) {
14704 CatchClause other = this._other as CatchClause; 15988 CatchClause other = this._other as CatchClause;
14705 return isEqual6(node.onKeyword, other.onKeyword) && isEqual(node.exceptionTy pe, other.exceptionType) && isEqual6(node.catchKeyword, other.catchKeyword) && i sEqual6(node.leftParenthesis, other.leftParenthesis) && isEqual(node.exceptionPa rameter, other.exceptionParameter) && isEqual6(node.comma, other.comma) && isEqu al(node.stackTraceParameter, other.stackTraceParameter) && isEqual6(node.rightPa renthesis, other.rightParenthesis) && isEqual(node.body, other.body); 15989 return isEqual6(node.onKeyword, other.onKeyword) && isEqual(node.exceptionTy pe, other.exceptionType) && isEqual6(node.catchKeyword, other.catchKeyword) && i sEqual6(node.leftParenthesis, other.leftParenthesis) && isEqual(node.exceptionPa rameter, other.exceptionParameter) && isEqual6(node.comma, other.comma) && isEqu al(node.stackTraceParameter, other.stackTraceParameter) && isEqual6(node.rightPa renthesis, other.rightParenthesis) && isEqual(node.body, other.body);
14706 } 15990 }
15991
14707 bool visitClassDeclaration(ClassDeclaration node) { 15992 bool visitClassDeclaration(ClassDeclaration node) {
14708 ClassDeclaration other = this._other as ClassDeclaration; 15993 ClassDeclaration other = this._other as ClassDeclaration;
14709 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.abstractKeyword, other.abs tractKeyword) && isEqual6(node.classKeyword, other.classKeyword) && isEqual(node .name, other.name) && isEqual(node.typeParameters, other.typeParameters) && isEq ual(node.extendsClause, other.extendsClause) && isEqual(node.withClause, other.w ithClause) && isEqual(node.implementsClause, other.implementsClause) && isEqual6 (node.leftBracket, other.leftBracket) && isEqual5(node.members, other.members) & & isEqual6(node.rightBracket, other.rightBracket); 15994 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.abstractKeyword, other.abs tractKeyword) && isEqual6(node.classKeyword, other.classKeyword) && isEqual(node .name, other.name) && isEqual(node.typeParameters, other.typeParameters) && isEq ual(node.extendsClause, other.extendsClause) && isEqual(node.withClause, other.w ithClause) && isEqual(node.implementsClause, other.implementsClause) && isEqual6 (node.leftBracket, other.leftBracket) && isEqual5(node.members, other.members) & & isEqual6(node.rightBracket, other.rightBracket);
14710 } 15995 }
15996
14711 bool visitClassTypeAlias(ClassTypeAlias node) { 15997 bool visitClassTypeAlias(ClassTypeAlias node) {
14712 ClassTypeAlias other = this._other as ClassTypeAlias; 15998 ClassTypeAlias other = this._other as ClassTypeAlias;
14713 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.name, other.name) && isEqual(node.typeParameters, other.typeParame ters) && isEqual6(node.equals, other.equals) && isEqual6(node.abstractKeyword, o ther.abstractKeyword) && isEqual(node.superclass, other.superclass) && isEqual(n ode.withClause, other.withClause) && isEqual(node.implementsClause, other.implem entsClause) && isEqual6(node.semicolon, other.semicolon); 15999 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.name, other.name) && isEqual(node.typeParameters, other.typeParame ters) && isEqual6(node.equals, other.equals) && isEqual6(node.abstractKeyword, o ther.abstractKeyword) && isEqual(node.superclass, other.superclass) && isEqual(n ode.withClause, other.withClause) && isEqual(node.implementsClause, other.implem entsClause) && isEqual6(node.semicolon, other.semicolon);
14714 } 16000 }
16001
14715 bool visitComment(Comment node) { 16002 bool visitComment(Comment node) {
14716 Comment other = this._other as Comment; 16003 Comment other = this._other as Comment;
14717 return isEqual5(node.references, other.references); 16004 return isEqual5(node.references, other.references);
14718 } 16005 }
16006
14719 bool visitCommentReference(CommentReference node) { 16007 bool visitCommentReference(CommentReference node) {
14720 CommentReference other = this._other as CommentReference; 16008 CommentReference other = this._other as CommentReference;
14721 return isEqual6(node.newKeyword, other.newKeyword) && isEqual(node.identifie r, other.identifier); 16009 return isEqual6(node.newKeyword, other.newKeyword) && isEqual(node.identifie r, other.identifier);
14722 } 16010 }
16011
14723 bool visitCompilationUnit(CompilationUnit node) { 16012 bool visitCompilationUnit(CompilationUnit node) {
14724 CompilationUnit other = this._other as CompilationUnit; 16013 CompilationUnit other = this._other as CompilationUnit;
14725 return isEqual6(node.beginToken, other.beginToken) && isEqual(node.scriptTag , other.scriptTag) && isEqual5(node.directives, other.directives) && isEqual5(no de.declarations, other.declarations) && isEqual6(node.endToken, other.endToken); 16014 return isEqual6(node.beginToken, other.beginToken) && isEqual(node.scriptTag , other.scriptTag) && isEqual5(node.directives, other.directives) && isEqual5(no de.declarations, other.declarations) && isEqual6(node.endToken, other.endToken);
14726 } 16015 }
16016
14727 bool visitConditionalExpression(ConditionalExpression node) { 16017 bool visitConditionalExpression(ConditionalExpression node) {
14728 ConditionalExpression other = this._other as ConditionalExpression; 16018 ConditionalExpression other = this._other as ConditionalExpression;
14729 return isEqual(node.condition, other.condition) && isEqual6(node.question, o ther.question) && isEqual(node.thenExpression, other.thenExpression) && isEqual6 (node.colon, other.colon) && isEqual(node.elseExpression, other.elseExpression); 16019 return isEqual(node.condition, other.condition) && isEqual6(node.question, o ther.question) && isEqual(node.thenExpression, other.thenExpression) && isEqual6 (node.colon, other.colon) && isEqual(node.elseExpression, other.elseExpression);
14730 } 16020 }
16021
14731 bool visitConstructorDeclaration(ConstructorDeclaration node) { 16022 bool visitConstructorDeclaration(ConstructorDeclaration node) {
14732 ConstructorDeclaration other = this._other as ConstructorDeclaration; 16023 ConstructorDeclaration other = this._other as ConstructorDeclaration;
14733 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.externalKeyword, other.ext ernalKeyword) && isEqual6(node.constKeyword, other.constKeyword) && isEqual6(nod e.factoryKeyword, other.factoryKeyword) && isEqual(node.returnType, other.return Type) && isEqual6(node.period, other.period) && isEqual(node.name, other.name) & & isEqual(node.parameters, other.parameters) && isEqual6(node.separator, other.s eparator) && isEqual5(node.initializers, other.initializers) && isEqual(node.red irectedConstructor, other.redirectedConstructor) && isEqual(node.body, other.bod y); 16024 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.externalKeyword, other.ext ernalKeyword) && isEqual6(node.constKeyword, other.constKeyword) && isEqual6(nod e.factoryKeyword, other.factoryKeyword) && isEqual(node.returnType, other.return Type) && isEqual6(node.period, other.period) && isEqual(node.name, other.name) & & isEqual(node.parameters, other.parameters) && isEqual6(node.separator, other.s eparator) && isEqual5(node.initializers, other.initializers) && isEqual(node.red irectedConstructor, other.redirectedConstructor) && isEqual(node.body, other.bod y);
14734 } 16025 }
16026
14735 bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) { 16027 bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
14736 ConstructorFieldInitializer other = this._other as ConstructorFieldInitializ er; 16028 ConstructorFieldInitializer other = this._other as ConstructorFieldInitializ er;
14737 return isEqual6(node.keyword, other.keyword) && isEqual6(node.period, other. period) && isEqual(node.fieldName, other.fieldName) && isEqual6(node.equals, oth er.equals) && isEqual(node.expression, other.expression); 16029 return isEqual6(node.keyword, other.keyword) && isEqual6(node.period, other. period) && isEqual(node.fieldName, other.fieldName) && isEqual6(node.equals, oth er.equals) && isEqual(node.expression, other.expression);
14738 } 16030 }
16031
14739 bool visitConstructorName(ConstructorName node) { 16032 bool visitConstructorName(ConstructorName node) {
14740 ConstructorName other = this._other as ConstructorName; 16033 ConstructorName other = this._other as ConstructorName;
14741 return isEqual(node.type, other.type) && isEqual6(node.period, other.period) && isEqual(node.name, other.name); 16034 return isEqual(node.type, other.type) && isEqual6(node.period, other.period) && isEqual(node.name, other.name);
14742 } 16035 }
16036
14743 bool visitContinueStatement(ContinueStatement node) { 16037 bool visitContinueStatement(ContinueStatement node) {
14744 ContinueStatement other = this._other as ContinueStatement; 16038 ContinueStatement other = this._other as ContinueStatement;
14745 return isEqual6(node.keyword, other.keyword) && isEqual(node.label, other.la bel) && isEqual6(node.semicolon, other.semicolon); 16039 return isEqual6(node.keyword, other.keyword) && isEqual(node.label, other.la bel) && isEqual6(node.semicolon, other.semicolon);
14746 } 16040 }
16041
14747 bool visitDeclaredIdentifier(DeclaredIdentifier node) { 16042 bool visitDeclaredIdentifier(DeclaredIdentifier node) {
14748 DeclaredIdentifier other = this._other as DeclaredIdentifier; 16043 DeclaredIdentifier other = this._other as DeclaredIdentifier;
14749 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual(node.identifier, other.identifier); 16044 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual(node.identifier, other.identifier);
14750 } 16045 }
16046
14751 bool visitDefaultFormalParameter(DefaultFormalParameter node) { 16047 bool visitDefaultFormalParameter(DefaultFormalParameter node) {
14752 DefaultFormalParameter other = this._other as DefaultFormalParameter; 16048 DefaultFormalParameter other = this._other as DefaultFormalParameter;
14753 return isEqual(node.parameter, other.parameter) && identical(node.kind, othe r.kind) && isEqual6(node.separator, other.separator) && isEqual(node.defaultValu e, other.defaultValue); 16049 return isEqual(node.parameter, other.parameter) && identical(node.kind, othe r.kind) && isEqual6(node.separator, other.separator) && isEqual(node.defaultValu e, other.defaultValue);
14754 } 16050 }
16051
14755 bool visitDoStatement(DoStatement node) { 16052 bool visitDoStatement(DoStatement node) {
14756 DoStatement other = this._other as DoStatement; 16053 DoStatement other = this._other as DoStatement;
14757 return isEqual6(node.doKeyword, other.doKeyword) && isEqual(node.body, other .body) && isEqual6(node.whileKeyword, other.whileKeyword) && isEqual6(node.leftP arenthesis, other.leftParenthesis) && isEqual(node.condition, other.condition) & & isEqual6(node.rightParenthesis, other.rightParenthesis) && isEqual6(node.semic olon, other.semicolon); 16054 return isEqual6(node.doKeyword, other.doKeyword) && isEqual(node.body, other .body) && isEqual6(node.whileKeyword, other.whileKeyword) && isEqual6(node.leftP arenthesis, other.leftParenthesis) && isEqual(node.condition, other.condition) & & isEqual6(node.rightParenthesis, other.rightParenthesis) && isEqual6(node.semic olon, other.semicolon);
14758 } 16055 }
16056
14759 bool visitDoubleLiteral(DoubleLiteral node) { 16057 bool visitDoubleLiteral(DoubleLiteral node) {
14760 DoubleLiteral other = this._other as DoubleLiteral; 16058 DoubleLiteral other = this._other as DoubleLiteral;
14761 return isEqual6(node.literal, other.literal) && node.value == other.value; 16059 return isEqual6(node.literal, other.literal) && node.value == other.value;
14762 } 16060 }
16061
14763 bool visitEmptyFunctionBody(EmptyFunctionBody node) { 16062 bool visitEmptyFunctionBody(EmptyFunctionBody node) {
14764 EmptyFunctionBody other = this._other as EmptyFunctionBody; 16063 EmptyFunctionBody other = this._other as EmptyFunctionBody;
14765 return isEqual6(node.semicolon, other.semicolon); 16064 return isEqual6(node.semicolon, other.semicolon);
14766 } 16065 }
16066
14767 bool visitEmptyStatement(EmptyStatement node) { 16067 bool visitEmptyStatement(EmptyStatement node) {
14768 EmptyStatement other = this._other as EmptyStatement; 16068 EmptyStatement other = this._other as EmptyStatement;
14769 return isEqual6(node.semicolon, other.semicolon); 16069 return isEqual6(node.semicolon, other.semicolon);
14770 } 16070 }
16071
14771 bool visitExportDirective(ExportDirective node) { 16072 bool visitExportDirective(ExportDirective node) {
14772 ExportDirective other = this._other as ExportDirective; 16073 ExportDirective other = this._other as ExportDirective;
14773 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.uri, other.uri) && isEqual5(node.combinators, other.combinators) & & isEqual6(node.semicolon, other.semicolon); 16074 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.uri, other.uri) && isEqual5(node.combinators, other.combinators) & & isEqual6(node.semicolon, other.semicolon);
14774 } 16075 }
16076
14775 bool visitExpressionFunctionBody(ExpressionFunctionBody node) { 16077 bool visitExpressionFunctionBody(ExpressionFunctionBody node) {
14776 ExpressionFunctionBody other = this._other as ExpressionFunctionBody; 16078 ExpressionFunctionBody other = this._other as ExpressionFunctionBody;
14777 return isEqual6(node.functionDefinition, other.functionDefinition) && isEqua l(node.expression, other.expression) && isEqual6(node.semicolon, other.semicolon ); 16079 return isEqual6(node.functionDefinition, other.functionDefinition) && isEqua l(node.expression, other.expression) && isEqual6(node.semicolon, other.semicolon );
14778 } 16080 }
16081
14779 bool visitExpressionStatement(ExpressionStatement node) { 16082 bool visitExpressionStatement(ExpressionStatement node) {
14780 ExpressionStatement other = this._other as ExpressionStatement; 16083 ExpressionStatement other = this._other as ExpressionStatement;
14781 return isEqual(node.expression, other.expression) && isEqual6(node.semicolon , other.semicolon); 16084 return isEqual(node.expression, other.expression) && isEqual6(node.semicolon , other.semicolon);
14782 } 16085 }
16086
14783 bool visitExtendsClause(ExtendsClause node) { 16087 bool visitExtendsClause(ExtendsClause node) {
14784 ExtendsClause other = this._other as ExtendsClause; 16088 ExtendsClause other = this._other as ExtendsClause;
14785 return isEqual6(node.keyword, other.keyword) && isEqual(node.superclass, oth er.superclass); 16089 return isEqual6(node.keyword, other.keyword) && isEqual(node.superclass, oth er.superclass);
14786 } 16090 }
16091
14787 bool visitFieldDeclaration(FieldDeclaration node) { 16092 bool visitFieldDeclaration(FieldDeclaration node) {
14788 FieldDeclaration other = this._other as FieldDeclaration; 16093 FieldDeclaration other = this._other as FieldDeclaration;
14789 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.staticKeyword, other.stati cKeyword) && isEqual(node.fields, other.fields) && isEqual6(node.semicolon, othe r.semicolon); 16094 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.staticKeyword, other.stati cKeyword) && isEqual(node.fields, other.fields) && isEqual6(node.semicolon, othe r.semicolon);
14790 } 16095 }
16096
14791 bool visitFieldFormalParameter(FieldFormalParameter node) { 16097 bool visitFieldFormalParameter(FieldFormalParameter node) {
14792 FieldFormalParameter other = this._other as FieldFormalParameter; 16098 FieldFormalParameter other = this._other as FieldFormalParameter;
14793 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual6(node.thisToken, other.thisToken) && isEqual6(node.period, other.period) && isEqual(node.identifier, other.identifier ); 16099 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual6(node.thisToken, other.thisToken) && isEqual6(node.period, other.period) && isEqual(node.identifier, other.identifier );
14794 } 16100 }
16101
14795 bool visitForEachStatement(ForEachStatement node) { 16102 bool visitForEachStatement(ForEachStatement node) {
14796 ForEachStatement other = this._other as ForEachStatement; 16103 ForEachStatement other = this._other as ForEachStatement;
14797 return isEqual6(node.forKeyword, other.forKeyword) && isEqual6(node.leftPare nthesis, other.leftParenthesis) && isEqual(node.loopVariable, other.loopVariable ) && isEqual6(node.inKeyword, other.inKeyword) && isEqual(node.iterator, other.i terator) && isEqual6(node.rightParenthesis, other.rightParenthesis) && isEqual(n ode.body, other.body); 16104 return isEqual6(node.forKeyword, other.forKeyword) && isEqual6(node.leftPare nthesis, other.leftParenthesis) && isEqual(node.loopVariable, other.loopVariable ) && isEqual6(node.inKeyword, other.inKeyword) && isEqual(node.iterator, other.i terator) && isEqual6(node.rightParenthesis, other.rightParenthesis) && isEqual(n ode.body, other.body);
14798 } 16105 }
16106
14799 bool visitFormalParameterList(FormalParameterList node) { 16107 bool visitFormalParameterList(FormalParameterList node) {
14800 FormalParameterList other = this._other as FormalParameterList; 16108 FormalParameterList other = this._other as FormalParameterList;
14801 return isEqual6(node.leftParenthesis, other.leftParenthesis) && isEqual5(nod e.parameters, other.parameters) && isEqual6(node.leftDelimiter, other.leftDelimi ter) && isEqual6(node.rightDelimiter, other.rightDelimiter) && isEqual6(node.rig htParenthesis, other.rightParenthesis); 16109 return isEqual6(node.leftParenthesis, other.leftParenthesis) && isEqual5(nod e.parameters, other.parameters) && isEqual6(node.leftDelimiter, other.leftDelimi ter) && isEqual6(node.rightDelimiter, other.rightDelimiter) && isEqual6(node.rig htParenthesis, other.rightParenthesis);
14802 } 16110 }
16111
14803 bool visitForStatement(ForStatement node) { 16112 bool visitForStatement(ForStatement node) {
14804 ForStatement other = this._other as ForStatement; 16113 ForStatement other = this._other as ForStatement;
14805 return isEqual6(node.forKeyword, other.forKeyword) && isEqual6(node.leftPare nthesis, other.leftParenthesis) && isEqual(node.variables, other.variables) && i sEqual(node.initialization, other.initialization) && isEqual6(node.leftSeparator , other.leftSeparator) && isEqual(node.condition, other.condition) && isEqual6(n ode.rightSeparator, other.rightSeparator) && isEqual5(node.updaters, other.updat ers) && isEqual6(node.rightParenthesis, other.rightParenthesis) && isEqual(node. body, other.body); 16114 return isEqual6(node.forKeyword, other.forKeyword) && isEqual6(node.leftPare nthesis, other.leftParenthesis) && isEqual(node.variables, other.variables) && i sEqual(node.initialization, other.initialization) && isEqual6(node.leftSeparator , other.leftSeparator) && isEqual(node.condition, other.condition) && isEqual6(n ode.rightSeparator, other.rightSeparator) && isEqual5(node.updaters, other.updat ers) && isEqual6(node.rightParenthesis, other.rightParenthesis) && isEqual(node. body, other.body);
14806 } 16115 }
16116
14807 bool visitFunctionDeclaration(FunctionDeclaration node) { 16117 bool visitFunctionDeclaration(FunctionDeclaration node) {
14808 FunctionDeclaration other = this._other as FunctionDeclaration; 16118 FunctionDeclaration other = this._other as FunctionDeclaration;
14809 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.externalKeyword, other.ext ernalKeyword) && isEqual(node.returnType, other.returnType) && isEqual6(node.pro pertyKeyword, other.propertyKeyword) && isEqual(node.name, other.name) && isEqua l(node.functionExpression, other.functionExpression); 16119 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.externalKeyword, other.ext ernalKeyword) && isEqual(node.returnType, other.returnType) && isEqual6(node.pro pertyKeyword, other.propertyKeyword) && isEqual(node.name, other.name) && isEqua l(node.functionExpression, other.functionExpression);
14810 } 16120 }
16121
14811 bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { 16122 bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
14812 FunctionDeclarationStatement other = this._other as FunctionDeclarationState ment; 16123 FunctionDeclarationStatement other = this._other as FunctionDeclarationState ment;
14813 return isEqual(node.functionDeclaration, other.functionDeclaration); 16124 return isEqual(node.functionDeclaration, other.functionDeclaration);
14814 } 16125 }
16126
14815 bool visitFunctionExpression(FunctionExpression node) { 16127 bool visitFunctionExpression(FunctionExpression node) {
14816 FunctionExpression other = this._other as FunctionExpression; 16128 FunctionExpression other = this._other as FunctionExpression;
14817 return isEqual(node.parameters, other.parameters) && isEqual(node.body, othe r.body); 16129 return isEqual(node.parameters, other.parameters) && isEqual(node.body, othe r.body);
14818 } 16130 }
16131
14819 bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { 16132 bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
14820 FunctionExpressionInvocation other = this._other as FunctionExpressionInvoca tion; 16133 FunctionExpressionInvocation other = this._other as FunctionExpressionInvoca tion;
14821 return isEqual(node.function, other.function) && isEqual(node.argumentList, other.argumentList); 16134 return isEqual(node.function, other.function) && isEqual(node.argumentList, other.argumentList);
14822 } 16135 }
16136
14823 bool visitFunctionTypeAlias(FunctionTypeAlias node) { 16137 bool visitFunctionTypeAlias(FunctionTypeAlias node) {
14824 FunctionTypeAlias other = this._other as FunctionTypeAlias; 16138 FunctionTypeAlias other = this._other as FunctionTypeAlias;
14825 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.returnType, other.returnType) && isEqual(node.name, other.name) && isEqual(node.typeParameters, other.typeParameters) && isEqual(node.parameters, other.parameters) && isEqual6(node.semicolon, other.semicolon); 16139 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.returnType, other.returnType) && isEqual(node.name, other.name) && isEqual(node.typeParameters, other.typeParameters) && isEqual(node.parameters, other.parameters) && isEqual6(node.semicolon, other.semicolon);
14826 } 16140 }
16141
14827 bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { 16142 bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
14828 FunctionTypedFormalParameter other = this._other as FunctionTypedFormalParam eter; 16143 FunctionTypedFormalParameter other = this._other as FunctionTypedFormalParam eter;
14829 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual(node.returnType, other.returnTyp e) && isEqual(node.identifier, other.identifier) && isEqual(node.parameters, oth er.parameters); 16144 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual(node.returnType, other.returnTyp e) && isEqual(node.identifier, other.identifier) && isEqual(node.parameters, oth er.parameters);
14830 } 16145 }
16146
14831 bool visitHideCombinator(HideCombinator node) { 16147 bool visitHideCombinator(HideCombinator node) {
14832 HideCombinator other = this._other as HideCombinator; 16148 HideCombinator other = this._other as HideCombinator;
14833 return isEqual6(node.keyword, other.keyword) && isEqual5(node.hiddenNames, o ther.hiddenNames); 16149 return isEqual6(node.keyword, other.keyword) && isEqual5(node.hiddenNames, o ther.hiddenNames);
14834 } 16150 }
16151
14835 bool visitIfStatement(IfStatement node) { 16152 bool visitIfStatement(IfStatement node) {
14836 IfStatement other = this._other as IfStatement; 16153 IfStatement other = this._other as IfStatement;
14837 return isEqual6(node.ifKeyword, other.ifKeyword) && isEqual6(node.leftParent hesis, other.leftParenthesis) && isEqual(node.condition, other.condition) && isE qual6(node.rightParenthesis, other.rightParenthesis) && isEqual(node.thenStateme nt, other.thenStatement) && isEqual6(node.elseKeyword, other.elseKeyword) && isE qual(node.elseStatement, other.elseStatement); 16154 return isEqual6(node.ifKeyword, other.ifKeyword) && isEqual6(node.leftParent hesis, other.leftParenthesis) && isEqual(node.condition, other.condition) && isE qual6(node.rightParenthesis, other.rightParenthesis) && isEqual(node.thenStateme nt, other.thenStatement) && isEqual6(node.elseKeyword, other.elseKeyword) && isE qual(node.elseStatement, other.elseStatement);
14838 } 16155 }
16156
14839 bool visitImplementsClause(ImplementsClause node) { 16157 bool visitImplementsClause(ImplementsClause node) {
14840 ImplementsClause other = this._other as ImplementsClause; 16158 ImplementsClause other = this._other as ImplementsClause;
14841 return isEqual6(node.keyword, other.keyword) && isEqual5(node.interfaces, ot her.interfaces); 16159 return isEqual6(node.keyword, other.keyword) && isEqual5(node.interfaces, ot her.interfaces);
14842 } 16160 }
16161
14843 bool visitImportDirective(ImportDirective node) { 16162 bool visitImportDirective(ImportDirective node) {
14844 ImportDirective other = this._other as ImportDirective; 16163 ImportDirective other = this._other as ImportDirective;
14845 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.uri, other.uri) && isEqual6(node.asToken, other.asToken) && isEqua l(node.prefix, other.prefix) && isEqual5(node.combinators, other.combinators) && isEqual6(node.semicolon, other.semicolon); 16164 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.uri, other.uri) && isEqual6(node.asToken, other.asToken) && isEqua l(node.prefix, other.prefix) && isEqual5(node.combinators, other.combinators) && isEqual6(node.semicolon, other.semicolon);
14846 } 16165 }
16166
14847 bool visitIndexExpression(IndexExpression node) { 16167 bool visitIndexExpression(IndexExpression node) {
14848 IndexExpression other = this._other as IndexExpression; 16168 IndexExpression other = this._other as IndexExpression;
14849 return isEqual(node.target, other.target) && isEqual6(node.leftBracket, othe r.leftBracket) && isEqual(node.index, other.index) && isEqual6(node.rightBracket , other.rightBracket); 16169 return isEqual(node.target, other.target) && isEqual6(node.leftBracket, othe r.leftBracket) && isEqual(node.index, other.index) && isEqual6(node.rightBracket , other.rightBracket);
14850 } 16170 }
16171
14851 bool visitInstanceCreationExpression(InstanceCreationExpression node) { 16172 bool visitInstanceCreationExpression(InstanceCreationExpression node) {
14852 InstanceCreationExpression other = this._other as InstanceCreationExpression ; 16173 InstanceCreationExpression other = this._other as InstanceCreationExpression ;
14853 return isEqual6(node.keyword, other.keyword) && isEqual(node.constructorName , other.constructorName) && isEqual(node.argumentList, other.argumentList); 16174 return isEqual6(node.keyword, other.keyword) && isEqual(node.constructorName , other.constructorName) && isEqual(node.argumentList, other.argumentList);
14854 } 16175 }
16176
14855 bool visitIntegerLiteral(IntegerLiteral node) { 16177 bool visitIntegerLiteral(IntegerLiteral node) {
14856 IntegerLiteral other = this._other as IntegerLiteral; 16178 IntegerLiteral other = this._other as IntegerLiteral;
14857 return isEqual6(node.literal, other.literal) && identical(node.value, other. value); 16179 return isEqual6(node.literal, other.literal) && identical(node.value, other. value);
14858 } 16180 }
16181
14859 bool visitInterpolationExpression(InterpolationExpression node) { 16182 bool visitInterpolationExpression(InterpolationExpression node) {
14860 InterpolationExpression other = this._other as InterpolationExpression; 16183 InterpolationExpression other = this._other as InterpolationExpression;
14861 return isEqual6(node.leftBracket, other.leftBracket) && isEqual(node.express ion, other.expression) && isEqual6(node.rightBracket, other.rightBracket); 16184 return isEqual6(node.leftBracket, other.leftBracket) && isEqual(node.express ion, other.expression) && isEqual6(node.rightBracket, other.rightBracket);
14862 } 16185 }
16186
14863 bool visitInterpolationString(InterpolationString node) { 16187 bool visitInterpolationString(InterpolationString node) {
14864 InterpolationString other = this._other as InterpolationString; 16188 InterpolationString other = this._other as InterpolationString;
14865 return isEqual6(node.contents, other.contents) && node.value == other.value; 16189 return isEqual6(node.contents, other.contents) && node.value == other.value;
14866 } 16190 }
16191
14867 bool visitIsExpression(IsExpression node) { 16192 bool visitIsExpression(IsExpression node) {
14868 IsExpression other = this._other as IsExpression; 16193 IsExpression other = this._other as IsExpression;
14869 return isEqual(node.expression, other.expression) && isEqual6(node.isOperato r, other.isOperator) && isEqual6(node.notOperator, other.notOperator) && isEqual (node.type, other.type); 16194 return isEqual(node.expression, other.expression) && isEqual6(node.isOperato r, other.isOperator) && isEqual6(node.notOperator, other.notOperator) && isEqual (node.type, other.type);
14870 } 16195 }
16196
14871 bool visitLabel(Label node) { 16197 bool visitLabel(Label node) {
14872 Label other = this._other as Label; 16198 Label other = this._other as Label;
14873 return isEqual(node.label, other.label) && isEqual6(node.colon, other.colon) ; 16199 return isEqual(node.label, other.label) && isEqual6(node.colon, other.colon) ;
14874 } 16200 }
16201
14875 bool visitLabeledStatement(LabeledStatement node) { 16202 bool visitLabeledStatement(LabeledStatement node) {
14876 LabeledStatement other = this._other as LabeledStatement; 16203 LabeledStatement other = this._other as LabeledStatement;
14877 return isEqual5(node.labels, other.labels) && isEqual(node.statement, other. statement); 16204 return isEqual5(node.labels, other.labels) && isEqual(node.statement, other. statement);
14878 } 16205 }
16206
14879 bool visitLibraryDirective(LibraryDirective node) { 16207 bool visitLibraryDirective(LibraryDirective node) {
14880 LibraryDirective other = this._other as LibraryDirective; 16208 LibraryDirective other = this._other as LibraryDirective;
14881 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.libraryToken, other.librar yToken) && isEqual(node.name, other.name) && isEqual6(node.semicolon, other.semi colon); 16209 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.libraryToken, other.librar yToken) && isEqual(node.name, other.name) && isEqual6(node.semicolon, other.semi colon);
14882 } 16210 }
16211
14883 bool visitLibraryIdentifier(LibraryIdentifier node) { 16212 bool visitLibraryIdentifier(LibraryIdentifier node) {
14884 LibraryIdentifier other = this._other as LibraryIdentifier; 16213 LibraryIdentifier other = this._other as LibraryIdentifier;
14885 return isEqual5(node.components, other.components); 16214 return isEqual5(node.components, other.components);
14886 } 16215 }
16216
14887 bool visitListLiteral(ListLiteral node) { 16217 bool visitListLiteral(ListLiteral node) {
14888 ListLiteral other = this._other as ListLiteral; 16218 ListLiteral other = this._other as ListLiteral;
14889 return isEqual6(node.constKeyword, other.constKeyword) && isEqual(node.typeA rguments, other.typeArguments) && isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.elements, other.elements) && isEqual6(node.rightBracket, other. rightBracket); 16219 return isEqual6(node.constKeyword, other.constKeyword) && isEqual(node.typeA rguments, other.typeArguments) && isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.elements, other.elements) && isEqual6(node.rightBracket, other. rightBracket);
14890 } 16220 }
16221
14891 bool visitMapLiteral(MapLiteral node) { 16222 bool visitMapLiteral(MapLiteral node) {
14892 MapLiteral other = this._other as MapLiteral; 16223 MapLiteral other = this._other as MapLiteral;
14893 return isEqual6(node.constKeyword, other.constKeyword) && isEqual(node.typeA rguments, other.typeArguments) && isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.entries, other.entries) && isEqual6(node.rightBracket, other.ri ghtBracket); 16224 return isEqual6(node.constKeyword, other.constKeyword) && isEqual(node.typeA rguments, other.typeArguments) && isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.entries, other.entries) && isEqual6(node.rightBracket, other.ri ghtBracket);
14894 } 16225 }
16226
14895 bool visitMapLiteralEntry(MapLiteralEntry node) { 16227 bool visitMapLiteralEntry(MapLiteralEntry node) {
14896 MapLiteralEntry other = this._other as MapLiteralEntry; 16228 MapLiteralEntry other = this._other as MapLiteralEntry;
14897 return isEqual(node.key, other.key) && isEqual6(node.separator, other.separa tor) && isEqual(node.value, other.value); 16229 return isEqual(node.key, other.key) && isEqual6(node.separator, other.separa tor) && isEqual(node.value, other.value);
14898 } 16230 }
16231
14899 bool visitMethodDeclaration(MethodDeclaration node) { 16232 bool visitMethodDeclaration(MethodDeclaration node) {
14900 MethodDeclaration other = this._other as MethodDeclaration; 16233 MethodDeclaration other = this._other as MethodDeclaration;
14901 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.externalKeyword, other.ext ernalKeyword) && isEqual6(node.modifierKeyword, other.modifierKeyword) && isEqua l(node.returnType, other.returnType) && isEqual6(node.propertyKeyword, other.pro pertyKeyword) && isEqual6(node.propertyKeyword, other.propertyKeyword) && isEqua l(node.name, other.name) && isEqual(node.parameters, other.parameters) && isEqua l(node.body, other.body); 16234 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.externalKeyword, other.ext ernalKeyword) && isEqual6(node.modifierKeyword, other.modifierKeyword) && isEqua l(node.returnType, other.returnType) && isEqual6(node.propertyKeyword, other.pro pertyKeyword) && isEqual6(node.propertyKeyword, other.propertyKeyword) && isEqua l(node.name, other.name) && isEqual(node.parameters, other.parameters) && isEqua l(node.body, other.body);
14902 } 16235 }
16236
14903 bool visitMethodInvocation(MethodInvocation node) { 16237 bool visitMethodInvocation(MethodInvocation node) {
14904 MethodInvocation other = this._other as MethodInvocation; 16238 MethodInvocation other = this._other as MethodInvocation;
14905 return isEqual(node.target, other.target) && isEqual6(node.period, other.per iod) && isEqual(node.methodName, other.methodName) && isEqual(node.argumentList, other.argumentList); 16239 return isEqual(node.target, other.target) && isEqual6(node.period, other.per iod) && isEqual(node.methodName, other.methodName) && isEqual(node.argumentList, other.argumentList);
14906 } 16240 }
16241
14907 bool visitNamedExpression(NamedExpression node) { 16242 bool visitNamedExpression(NamedExpression node) {
14908 NamedExpression other = this._other as NamedExpression; 16243 NamedExpression other = this._other as NamedExpression;
14909 return isEqual(node.name, other.name) && isEqual(node.expression, other.expr ession); 16244 return isEqual(node.name, other.name) && isEqual(node.expression, other.expr ession);
14910 } 16245 }
16246
14911 bool visitNativeClause(NativeClause node) { 16247 bool visitNativeClause(NativeClause node) {
14912 NativeClause other = this._other as NativeClause; 16248 NativeClause other = this._other as NativeClause;
14913 return isEqual6(node.keyword, other.keyword) && isEqual(node.name, other.nam e); 16249 return isEqual6(node.keyword, other.keyword) && isEqual(node.name, other.nam e);
14914 } 16250 }
16251
14915 bool visitNativeFunctionBody(NativeFunctionBody node) { 16252 bool visitNativeFunctionBody(NativeFunctionBody node) {
14916 NativeFunctionBody other = this._other as NativeFunctionBody; 16253 NativeFunctionBody other = this._other as NativeFunctionBody;
14917 return isEqual6(node.nativeToken, other.nativeToken) && isEqual(node.stringL iteral, other.stringLiteral) && isEqual6(node.semicolon, other.semicolon); 16254 return isEqual6(node.nativeToken, other.nativeToken) && isEqual(node.stringL iteral, other.stringLiteral) && isEqual6(node.semicolon, other.semicolon);
14918 } 16255 }
16256
14919 bool visitNullLiteral(NullLiteral node) { 16257 bool visitNullLiteral(NullLiteral node) {
14920 NullLiteral other = this._other as NullLiteral; 16258 NullLiteral other = this._other as NullLiteral;
14921 return isEqual6(node.literal, other.literal); 16259 return isEqual6(node.literal, other.literal);
14922 } 16260 }
16261
14923 bool visitParenthesizedExpression(ParenthesizedExpression node) { 16262 bool visitParenthesizedExpression(ParenthesizedExpression node) {
14924 ParenthesizedExpression other = this._other as ParenthesizedExpression; 16263 ParenthesizedExpression other = this._other as ParenthesizedExpression;
14925 return isEqual6(node.leftParenthesis, other.leftParenthesis) && isEqual(node .expression, other.expression) && isEqual6(node.rightParenthesis, other.rightPar enthesis); 16264 return isEqual6(node.leftParenthesis, other.leftParenthesis) && isEqual(node .expression, other.expression) && isEqual6(node.rightParenthesis, other.rightPar enthesis);
14926 } 16265 }
16266
14927 bool visitPartDirective(PartDirective node) { 16267 bool visitPartDirective(PartDirective node) {
14928 PartDirective other = this._other as PartDirective; 16268 PartDirective other = this._other as PartDirective;
14929 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.partToken, other.partToken ) && isEqual(node.uri, other.uri) && isEqual6(node.semicolon, other.semicolon); 16269 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.partToken, other.partToken ) && isEqual(node.uri, other.uri) && isEqual6(node.semicolon, other.semicolon);
14930 } 16270 }
16271
14931 bool visitPartOfDirective(PartOfDirective node) { 16272 bool visitPartOfDirective(PartOfDirective node) {
14932 PartOfDirective other = this._other as PartOfDirective; 16273 PartOfDirective other = this._other as PartOfDirective;
14933 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.partToken, other.partToken ) && isEqual6(node.ofToken, other.ofToken) && isEqual(node.libraryName, other.li braryName) && isEqual6(node.semicolon, other.semicolon); 16274 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.partToken, other.partToken ) && isEqual6(node.ofToken, other.ofToken) && isEqual(node.libraryName, other.li braryName) && isEqual6(node.semicolon, other.semicolon);
14934 } 16275 }
16276
14935 bool visitPostfixExpression(PostfixExpression node) { 16277 bool visitPostfixExpression(PostfixExpression node) {
14936 PostfixExpression other = this._other as PostfixExpression; 16278 PostfixExpression other = this._other as PostfixExpression;
14937 return isEqual(node.operand, other.operand) && isEqual6(node.operator, other .operator); 16279 return isEqual(node.operand, other.operand) && isEqual6(node.operator, other .operator);
14938 } 16280 }
16281
14939 bool visitPrefixedIdentifier(PrefixedIdentifier node) { 16282 bool visitPrefixedIdentifier(PrefixedIdentifier node) {
14940 PrefixedIdentifier other = this._other as PrefixedIdentifier; 16283 PrefixedIdentifier other = this._other as PrefixedIdentifier;
14941 return isEqual(node.prefix, other.prefix) && isEqual6(node.period, other.per iod) && isEqual(node.identifier, other.identifier); 16284 return isEqual(node.prefix, other.prefix) && isEqual6(node.period, other.per iod) && isEqual(node.identifier, other.identifier);
14942 } 16285 }
16286
14943 bool visitPrefixExpression(PrefixExpression node) { 16287 bool visitPrefixExpression(PrefixExpression node) {
14944 PrefixExpression other = this._other as PrefixExpression; 16288 PrefixExpression other = this._other as PrefixExpression;
14945 return isEqual6(node.operator, other.operator) && isEqual(node.operand, othe r.operand); 16289 return isEqual6(node.operator, other.operator) && isEqual(node.operand, othe r.operand);
14946 } 16290 }
16291
14947 bool visitPropertyAccess(PropertyAccess node) { 16292 bool visitPropertyAccess(PropertyAccess node) {
14948 PropertyAccess other = this._other as PropertyAccess; 16293 PropertyAccess other = this._other as PropertyAccess;
14949 return isEqual(node.target, other.target) && isEqual6(node.operator, other.o perator) && isEqual(node.propertyName, other.propertyName); 16294 return isEqual(node.target, other.target) && isEqual6(node.operator, other.o perator) && isEqual(node.propertyName, other.propertyName);
14950 } 16295 }
16296
14951 bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation no de) { 16297 bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation no de) {
14952 RedirectingConstructorInvocation other = this._other as RedirectingConstruct orInvocation; 16298 RedirectingConstructorInvocation other = this._other as RedirectingConstruct orInvocation;
14953 return isEqual6(node.keyword, other.keyword) && isEqual6(node.period, other. period) && isEqual(node.constructorName, other.constructorName) && isEqual(node. argumentList, other.argumentList); 16299 return isEqual6(node.keyword, other.keyword) && isEqual6(node.period, other. period) && isEqual(node.constructorName, other.constructorName) && isEqual(node. argumentList, other.argumentList);
14954 } 16300 }
16301
14955 bool visitRethrowExpression(RethrowExpression node) { 16302 bool visitRethrowExpression(RethrowExpression node) {
14956 RethrowExpression other = this._other as RethrowExpression; 16303 RethrowExpression other = this._other as RethrowExpression;
14957 return isEqual6(node.keyword, other.keyword); 16304 return isEqual6(node.keyword, other.keyword);
14958 } 16305 }
16306
14959 bool visitReturnStatement(ReturnStatement node) { 16307 bool visitReturnStatement(ReturnStatement node) {
14960 ReturnStatement other = this._other as ReturnStatement; 16308 ReturnStatement other = this._other as ReturnStatement;
14961 return isEqual6(node.keyword, other.keyword) && isEqual(node.expression, oth er.expression) && isEqual6(node.semicolon, other.semicolon); 16309 return isEqual6(node.keyword, other.keyword) && isEqual(node.expression, oth er.expression) && isEqual6(node.semicolon, other.semicolon);
14962 } 16310 }
16311
14963 bool visitScriptTag(ScriptTag node) { 16312 bool visitScriptTag(ScriptTag node) {
14964 ScriptTag other = this._other as ScriptTag; 16313 ScriptTag other = this._other as ScriptTag;
14965 return isEqual6(node.scriptTag, other.scriptTag); 16314 return isEqual6(node.scriptTag, other.scriptTag);
14966 } 16315 }
16316
14967 bool visitShowCombinator(ShowCombinator node) { 16317 bool visitShowCombinator(ShowCombinator node) {
14968 ShowCombinator other = this._other as ShowCombinator; 16318 ShowCombinator other = this._other as ShowCombinator;
14969 return isEqual6(node.keyword, other.keyword) && isEqual5(node.shownNames, ot her.shownNames); 16319 return isEqual6(node.keyword, other.keyword) && isEqual5(node.shownNames, ot her.shownNames);
14970 } 16320 }
16321
14971 bool visitSimpleFormalParameter(SimpleFormalParameter node) { 16322 bool visitSimpleFormalParameter(SimpleFormalParameter node) {
14972 SimpleFormalParameter other = this._other as SimpleFormalParameter; 16323 SimpleFormalParameter other = this._other as SimpleFormalParameter;
14973 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual(node.identifier, other.identifier); 16324 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual(node.identifier, other.identifier);
14974 } 16325 }
16326
14975 bool visitSimpleIdentifier(SimpleIdentifier node) { 16327 bool visitSimpleIdentifier(SimpleIdentifier node) {
14976 SimpleIdentifier other = this._other as SimpleIdentifier; 16328 SimpleIdentifier other = this._other as SimpleIdentifier;
14977 return isEqual6(node.token, other.token); 16329 return isEqual6(node.token, other.token);
14978 } 16330 }
16331
14979 bool visitSimpleStringLiteral(SimpleStringLiteral node) { 16332 bool visitSimpleStringLiteral(SimpleStringLiteral node) {
14980 SimpleStringLiteral other = this._other as SimpleStringLiteral; 16333 SimpleStringLiteral other = this._other as SimpleStringLiteral;
14981 return isEqual6(node.literal, other.literal) && identical(node.value, other. value); 16334 return isEqual6(node.literal, other.literal) && identical(node.value, other. value);
14982 } 16335 }
16336
14983 bool visitStringInterpolation(StringInterpolation node) { 16337 bool visitStringInterpolation(StringInterpolation node) {
14984 StringInterpolation other = this._other as StringInterpolation; 16338 StringInterpolation other = this._other as StringInterpolation;
14985 return isEqual5(node.elements, other.elements); 16339 return isEqual5(node.elements, other.elements);
14986 } 16340 }
16341
14987 bool visitSuperConstructorInvocation(SuperConstructorInvocation node) { 16342 bool visitSuperConstructorInvocation(SuperConstructorInvocation node) {
14988 SuperConstructorInvocation other = this._other as SuperConstructorInvocation ; 16343 SuperConstructorInvocation other = this._other as SuperConstructorInvocation ;
14989 return isEqual6(node.keyword, other.keyword) && isEqual6(node.period, other. period) && isEqual(node.constructorName, other.constructorName) && isEqual(node. argumentList, other.argumentList); 16344 return isEqual6(node.keyword, other.keyword) && isEqual6(node.period, other. period) && isEqual(node.constructorName, other.constructorName) && isEqual(node. argumentList, other.argumentList);
14990 } 16345 }
16346
14991 bool visitSuperExpression(SuperExpression node) { 16347 bool visitSuperExpression(SuperExpression node) {
14992 SuperExpression other = this._other as SuperExpression; 16348 SuperExpression other = this._other as SuperExpression;
14993 return isEqual6(node.keyword, other.keyword); 16349 return isEqual6(node.keyword, other.keyword);
14994 } 16350 }
16351
14995 bool visitSwitchCase(SwitchCase node) { 16352 bool visitSwitchCase(SwitchCase node) {
14996 SwitchCase other = this._other as SwitchCase; 16353 SwitchCase other = this._other as SwitchCase;
14997 return isEqual5(node.labels, other.labels) && isEqual6(node.keyword, other.k eyword) && isEqual(node.expression, other.expression) && isEqual6(node.colon, ot her.colon) && isEqual5(node.statements, other.statements); 16354 return isEqual5(node.labels, other.labels) && isEqual6(node.keyword, other.k eyword) && isEqual(node.expression, other.expression) && isEqual6(node.colon, ot her.colon) && isEqual5(node.statements, other.statements);
14998 } 16355 }
16356
14999 bool visitSwitchDefault(SwitchDefault node) { 16357 bool visitSwitchDefault(SwitchDefault node) {
15000 SwitchDefault other = this._other as SwitchDefault; 16358 SwitchDefault other = this._other as SwitchDefault;
15001 return isEqual5(node.labels, other.labels) && isEqual6(node.keyword, other.k eyword) && isEqual6(node.colon, other.colon) && isEqual5(node.statements, other. statements); 16359 return isEqual5(node.labels, other.labels) && isEqual6(node.keyword, other.k eyword) && isEqual6(node.colon, other.colon) && isEqual5(node.statements, other. statements);
15002 } 16360 }
16361
15003 bool visitSwitchStatement(SwitchStatement node) { 16362 bool visitSwitchStatement(SwitchStatement node) {
15004 SwitchStatement other = this._other as SwitchStatement; 16363 SwitchStatement other = this._other as SwitchStatement;
15005 return isEqual6(node.keyword, other.keyword) && isEqual6(node.leftParenthesi s, other.leftParenthesis) && isEqual(node.expression, other.expression) && isEqu al6(node.rightParenthesis, other.rightParenthesis) && isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.members, other.members) && isEqual6(node.ri ghtBracket, other.rightBracket); 16364 return isEqual6(node.keyword, other.keyword) && isEqual6(node.leftParenthesi s, other.leftParenthesis) && isEqual(node.expression, other.expression) && isEqu al6(node.rightParenthesis, other.rightParenthesis) && isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.members, other.members) && isEqual6(node.ri ghtBracket, other.rightBracket);
15006 } 16365 }
16366
15007 bool visitSymbolLiteral(SymbolLiteral node) { 16367 bool visitSymbolLiteral(SymbolLiteral node) {
15008 SymbolLiteral other = this._other as SymbolLiteral; 16368 SymbolLiteral other = this._other as SymbolLiteral;
15009 return isEqual6(node.poundSign, other.poundSign) && isEqual7(node.components , other.components); 16369 return isEqual6(node.poundSign, other.poundSign) && isEqual7(node.components , other.components);
15010 } 16370 }
16371
15011 bool visitThisExpression(ThisExpression node) { 16372 bool visitThisExpression(ThisExpression node) {
15012 ThisExpression other = this._other as ThisExpression; 16373 ThisExpression other = this._other as ThisExpression;
15013 return isEqual6(node.keyword, other.keyword); 16374 return isEqual6(node.keyword, other.keyword);
15014 } 16375 }
16376
15015 bool visitThrowExpression(ThrowExpression node) { 16377 bool visitThrowExpression(ThrowExpression node) {
15016 ThrowExpression other = this._other as ThrowExpression; 16378 ThrowExpression other = this._other as ThrowExpression;
15017 return isEqual6(node.keyword, other.keyword) && isEqual(node.expression, oth er.expression); 16379 return isEqual6(node.keyword, other.keyword) && isEqual(node.expression, oth er.expression);
15018 } 16380 }
16381
15019 bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { 16382 bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
15020 TopLevelVariableDeclaration other = this._other as TopLevelVariableDeclarati on; 16383 TopLevelVariableDeclaration other = this._other as TopLevelVariableDeclarati on;
15021 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual(node.variables, other.variables) && isEqual6(node.semicolon, other.semicolon); 16384 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual(node.variables, other.variables) && isEqual6(node.semicolon, other.semicolon);
15022 } 16385 }
16386
15023 bool visitTryStatement(TryStatement node) { 16387 bool visitTryStatement(TryStatement node) {
15024 TryStatement other = this._other as TryStatement; 16388 TryStatement other = this._other as TryStatement;
15025 return isEqual6(node.tryKeyword, other.tryKeyword) && isEqual(node.body, oth er.body) && isEqual5(node.catchClauses, other.catchClauses) && isEqual6(node.fin allyKeyword, other.finallyKeyword) && isEqual(node.finallyBlock, other.finallyBl ock); 16389 return isEqual6(node.tryKeyword, other.tryKeyword) && isEqual(node.body, oth er.body) && isEqual5(node.catchClauses, other.catchClauses) && isEqual6(node.fin allyKeyword, other.finallyKeyword) && isEqual(node.finallyBlock, other.finallyBl ock);
15026 } 16390 }
16391
15027 bool visitTypeArgumentList(TypeArgumentList node) { 16392 bool visitTypeArgumentList(TypeArgumentList node) {
15028 TypeArgumentList other = this._other as TypeArgumentList; 16393 TypeArgumentList other = this._other as TypeArgumentList;
15029 return isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.argume nts, other.arguments) && isEqual6(node.rightBracket, other.rightBracket); 16394 return isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.argume nts, other.arguments) && isEqual6(node.rightBracket, other.rightBracket);
15030 } 16395 }
16396
15031 bool visitTypeName(TypeName node) { 16397 bool visitTypeName(TypeName node) {
15032 TypeName other = this._other as TypeName; 16398 TypeName other = this._other as TypeName;
15033 return isEqual(node.name, other.name) && isEqual(node.typeArguments, other.t ypeArguments); 16399 return isEqual(node.name, other.name) && isEqual(node.typeArguments, other.t ypeArguments);
15034 } 16400 }
16401
15035 bool visitTypeParameter(TypeParameter node) { 16402 bool visitTypeParameter(TypeParameter node) {
15036 TypeParameter other = this._other as TypeParameter; 16403 TypeParameter other = this._other as TypeParameter;
15037 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual(node.name, other.name) && isEqua l6(node.keyword, other.keyword) && isEqual(node.bound, other.bound); 16404 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual(node.name, other.name) && isEqua l6(node.keyword, other.keyword) && isEqual(node.bound, other.bound);
15038 } 16405 }
16406
15039 bool visitTypeParameterList(TypeParameterList node) { 16407 bool visitTypeParameterList(TypeParameterList node) {
15040 TypeParameterList other = this._other as TypeParameterList; 16408 TypeParameterList other = this._other as TypeParameterList;
15041 return isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.typePa rameters, other.typeParameters) && isEqual6(node.rightBracket, other.rightBracke t); 16409 return isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.typePa rameters, other.typeParameters) && isEqual6(node.rightBracket, other.rightBracke t);
15042 } 16410 }
16411
15043 bool visitVariableDeclaration(VariableDeclaration node) { 16412 bool visitVariableDeclaration(VariableDeclaration node) {
15044 VariableDeclaration other = this._other as VariableDeclaration; 16413 VariableDeclaration other = this._other as VariableDeclaration;
15045 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual(node.name, other.name) && isEqua l6(node.equals, other.equals) && isEqual(node.initializer, other.initializer); 16414 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual(node.name, other.name) && isEqua l6(node.equals, other.equals) && isEqual(node.initializer, other.initializer);
15046 } 16415 }
16416
15047 bool visitVariableDeclarationList(VariableDeclarationList node) { 16417 bool visitVariableDeclarationList(VariableDeclarationList node) {
15048 VariableDeclarationList other = this._other as VariableDeclarationList; 16418 VariableDeclarationList other = this._other as VariableDeclarationList;
15049 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual5(node.variables, other.variables); 16419 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual5(node.variables, other.variables);
15050 } 16420 }
16421
15051 bool visitVariableDeclarationStatement(VariableDeclarationStatement node) { 16422 bool visitVariableDeclarationStatement(VariableDeclarationStatement node) {
15052 VariableDeclarationStatement other = this._other as VariableDeclarationState ment; 16423 VariableDeclarationStatement other = this._other as VariableDeclarationState ment;
15053 return isEqual(node.variables, other.variables) && isEqual6(node.semicolon, other.semicolon); 16424 return isEqual(node.variables, other.variables) && isEqual6(node.semicolon, other.semicolon);
15054 } 16425 }
16426
15055 bool visitWhileStatement(WhileStatement node) { 16427 bool visitWhileStatement(WhileStatement node) {
15056 WhileStatement other = this._other as WhileStatement; 16428 WhileStatement other = this._other as WhileStatement;
15057 return isEqual6(node.keyword, other.keyword) && isEqual6(node.leftParenthesi s, other.leftParenthesis) && isEqual(node.condition, other.condition) && isEqual 6(node.rightParenthesis, other.rightParenthesis) && isEqual(node.body, other.bod y); 16429 return isEqual6(node.keyword, other.keyword) && isEqual6(node.leftParenthesi s, other.leftParenthesis) && isEqual(node.condition, other.condition) && isEqual 6(node.rightParenthesis, other.rightParenthesis) && isEqual(node.body, other.bod y);
15058 } 16430 }
16431
15059 bool visitWithClause(WithClause node) { 16432 bool visitWithClause(WithClause node) {
15060 WithClause other = this._other as WithClause; 16433 WithClause other = this._other as WithClause;
15061 return isEqual6(node.withKeyword, other.withKeyword) && isEqual5(node.mixinT ypes, other.mixinTypes); 16434 return isEqual6(node.withKeyword, other.withKeyword) && isEqual5(node.mixinT ypes, other.mixinTypes);
15062 } 16435 }
15063 16436
15064 /** 16437 /**
15065 * Return `true` if the given AST nodes have the same structure. 16438 * Return `true` if the given AST nodes have the same structure.
15066 * 16439 *
15067 * @param first the first node being compared 16440 * @param first the first node being compared
15068 * @param second the second node being compared 16441 * @param second the second node being compared
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
15138 return false; 16511 return false;
15139 } 16512 }
15140 for (int i = 0; i < length; i++) { 16513 for (int i = 0; i < length; i++) {
15141 if (isEqual6(first[i], second[i])) { 16514 if (isEqual6(first[i], second[i])) {
15142 return false; 16515 return false;
15143 } 16516 }
15144 } 16517 }
15145 return true; 16518 return true;
15146 } 16519 }
15147 } 16520 }
16521
15148 /** 16522 /**
15149 * Instances of the class `IncrementalASTCloner` implement an object that will c lone any AST 16523 * Instances of the class `IncrementalASTCloner` implement an object that will c lone any AST
15150 * structure that it visits. The cloner will clone the structure, replacing the specified ASTNode 16524 * structure that it visits. The cloner will clone the structure, replacing the specified ASTNode
15151 * with a new ASTNode, mapping the old token stream to a new token stream, and p reserving resolution 16525 * with a new ASTNode, mapping the old token stream to a new token stream, and p reserving resolution
15152 * results. 16526 * results.
15153 */ 16527 */
15154 class IncrementalASTCloner implements ASTVisitor<ASTNode> { 16528 class IncrementalASTCloner implements ASTVisitor<ASTNode> {
15155
15156 /** 16529 /**
15157 * The node to be replaced during the cloning process. 16530 * The node to be replaced during the cloning process.
15158 */ 16531 */
15159 ASTNode _oldNode; 16532 ASTNode _oldNode;
15160 16533
15161 /** 16534 /**
15162 * The replacement node used during the cloning process. 16535 * The replacement node used during the cloning process.
15163 */ 16536 */
15164 ASTNode _newNode; 16537 ASTNode _newNode;
15165 16538
15166 /** 16539 /**
15167 * A mapping of old tokens to new tokens used during the cloning process. 16540 * A mapping of old tokens to new tokens used during the cloning process.
15168 */ 16541 */
15169 TokenMap _tokenMap; 16542 TokenMap _tokenMap;
15170 16543
15171 /** 16544 /**
15172 * Construct a new instance that will replace `oldNode` with `newNode` in the process 16545 * Construct a new instance that will replace `oldNode` with `newNode` in the process
15173 * of cloning an existing AST structure. 16546 * of cloning an existing AST structure.
15174 * 16547 *
15175 * @param oldNode the node to be replaced 16548 * @param oldNode the node to be replaced
15176 * @param newNode the replacement node 16549 * @param newNode the replacement node
15177 * @param tokenMap a mapping of old tokens to new tokens (not `null`) 16550 * @param tokenMap a mapping of old tokens to new tokens (not `null`)
15178 */ 16551 */
15179 IncrementalASTCloner(ASTNode oldNode, ASTNode newNode, TokenMap tokenMap) { 16552 IncrementalASTCloner(ASTNode oldNode, ASTNode newNode, TokenMap tokenMap) {
15180 this._oldNode = oldNode; 16553 this._oldNode = oldNode;
15181 this._newNode = newNode; 16554 this._newNode = newNode;
15182 this._tokenMap = tokenMap; 16555 this._tokenMap = tokenMap;
15183 } 16556 }
16557
15184 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs.full(clone5(node.strings)); 16558 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs.full(clone5(node.strings));
16559
15185 Annotation visitAnnotation(Annotation node) { 16560 Annotation visitAnnotation(Annotation node) {
15186 Annotation copy = new Annotation.full(map(node.atSign), clone4(node.name), m ap(node.period), clone4(node.constructorName), clone4(node.arguments)); 16561 Annotation copy = new Annotation.full(map(node.atSign), clone4(node.name), m ap(node.period), clone4(node.constructorName), clone4(node.arguments));
15187 copy.element = node.element; 16562 copy.element = node.element;
15188 return copy; 16563 return copy;
15189 } 16564 }
16565
15190 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) { 16566 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) {
15191 ArgumentDefinitionTest copy = new ArgumentDefinitionTest.full(map(node.quest ion), clone4(node.identifier)); 16567 ArgumentDefinitionTest copy = new ArgumentDefinitionTest.full(map(node.quest ion), clone4(node.identifier));
15192 copy.propagatedType = node.propagatedType; 16568 copy.propagatedType = node.propagatedType;
15193 copy.staticType = node.staticType; 16569 copy.staticType = node.staticType;
15194 return copy; 16570 return copy;
15195 } 16571 }
16572
15196 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList.full(map (node.leftParenthesis), clone5(node.arguments), map(node.rightParenthesis)); 16573 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList.full(map (node.leftParenthesis), clone5(node.arguments), map(node.rightParenthesis));
16574
15197 AsExpression visitAsExpression(AsExpression node) { 16575 AsExpression visitAsExpression(AsExpression node) {
15198 AsExpression copy = new AsExpression.full(clone4(node.expression), map(node. asOperator), clone4(node.type)); 16576 AsExpression copy = new AsExpression.full(clone4(node.expression), map(node. asOperator), clone4(node.type));
15199 copy.propagatedType = node.propagatedType; 16577 copy.propagatedType = node.propagatedType;
15200 copy.staticType = node.staticType; 16578 copy.staticType = node.staticType;
15201 return copy; 16579 return copy;
15202 } 16580 }
16581
15203 ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement.full (map(node.keyword), map(node.leftParenthesis), clone4(node.condition), map(node. rightParenthesis), map(node.semicolon)); 16582 ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement.full (map(node.keyword), map(node.leftParenthesis), clone4(node.condition), map(node. rightParenthesis), map(node.semicolon));
16583
15204 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) { 16584 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) {
15205 AssignmentExpression copy = new AssignmentExpression.full(clone4(node.leftHa ndSide), map(node.operator), clone4(node.rightHandSide)); 16585 AssignmentExpression copy = new AssignmentExpression.full(clone4(node.leftHa ndSide), map(node.operator), clone4(node.rightHandSide));
15206 copy.propagatedElement = node.propagatedElement; 16586 copy.propagatedElement = node.propagatedElement;
15207 copy.propagatedType = node.propagatedType; 16587 copy.propagatedType = node.propagatedType;
15208 copy.staticElement = node.staticElement; 16588 copy.staticElement = node.staticElement;
15209 copy.staticType = node.staticType; 16589 copy.staticType = node.staticType;
15210 return copy; 16590 return copy;
15211 } 16591 }
16592
15212 BinaryExpression visitBinaryExpression(BinaryExpression node) { 16593 BinaryExpression visitBinaryExpression(BinaryExpression node) {
15213 BinaryExpression copy = new BinaryExpression.full(clone4(node.leftOperand), map(node.operator), clone4(node.rightOperand)); 16594 BinaryExpression copy = new BinaryExpression.full(clone4(node.leftOperand), map(node.operator), clone4(node.rightOperand));
15214 copy.propagatedElement = node.propagatedElement; 16595 copy.propagatedElement = node.propagatedElement;
15215 copy.propagatedType = node.propagatedType; 16596 copy.propagatedType = node.propagatedType;
15216 copy.staticElement = node.staticElement; 16597 copy.staticElement = node.staticElement;
15217 copy.staticType = node.staticType; 16598 copy.staticType = node.staticType;
15218 return copy; 16599 return copy;
15219 } 16600 }
16601
15220 Block visitBlock(Block node) => new Block.full(map(node.leftBracket), clone5(n ode.statements), map(node.rightBracket)); 16602 Block visitBlock(Block node) => new Block.full(map(node.leftBracket), clone5(n ode.statements), map(node.rightBracket));
16603
15221 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody.full(clone4(node.block)); 16604 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody.full(clone4(node.block));
16605
15222 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) { 16606 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) {
15223 BooleanLiteral copy = new BooleanLiteral.full(map(node.literal), node.value) ; 16607 BooleanLiteral copy = new BooleanLiteral.full(map(node.literal), node.value) ;
15224 copy.propagatedType = node.propagatedType; 16608 copy.propagatedType = node.propagatedType;
15225 copy.staticType = node.staticType; 16609 copy.staticType = node.staticType;
15226 return copy; 16610 return copy;
15227 } 16611 }
16612
15228 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement. full(map(node.keyword), clone4(node.label), map(node.semicolon)); 16613 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement. full(map(node.keyword), clone4(node.label), map(node.semicolon));
16614
15229 CascadeExpression visitCascadeExpression(CascadeExpression node) { 16615 CascadeExpression visitCascadeExpression(CascadeExpression node) {
15230 CascadeExpression copy = new CascadeExpression.full(clone4(node.target), clo ne5(node.cascadeSections)); 16616 CascadeExpression copy = new CascadeExpression.full(clone4(node.target), clo ne5(node.cascadeSections));
15231 copy.propagatedType = node.propagatedType; 16617 copy.propagatedType = node.propagatedType;
15232 copy.staticType = node.staticType; 16618 copy.staticType = node.staticType;
15233 return copy; 16619 return copy;
15234 } 16620 }
16621
15235 CatchClause visitCatchClause(CatchClause node) => new CatchClause.full(map(nod e.onKeyword), clone4(node.exceptionType), map(node.catchKeyword), map(node.leftP arenthesis), clone4(node.exceptionParameter), map(node.comma), clone4(node.stack TraceParameter), map(node.rightParenthesis), clone4(node.body)); 16622 CatchClause visitCatchClause(CatchClause node) => new CatchClause.full(map(nod e.onKeyword), clone4(node.exceptionType), map(node.catchKeyword), map(node.leftP arenthesis), clone4(node.exceptionParameter), map(node.comma), clone4(node.stack TraceParameter), map(node.rightParenthesis), clone4(node.body));
16623
15236 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { 16624 ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
15237 ClassDeclaration copy = new ClassDeclaration.full(clone4(node.documentationC omment), clone5(node.metadata), map(node.abstractKeyword), map(node.classKeyword ), clone4(node.name), clone4(node.typeParameters), clone4(node.extendsClause), c lone4(node.withClause), clone4(node.implementsClause), map(node.leftBracket), cl one5(node.members), map(node.rightBracket)); 16625 ClassDeclaration copy = new ClassDeclaration.full(clone4(node.documentationC omment), clone5(node.metadata), map(node.abstractKeyword), map(node.classKeyword ), clone4(node.name), clone4(node.typeParameters), clone4(node.extendsClause), c lone4(node.withClause), clone4(node.implementsClause), map(node.leftBracket), cl one5(node.members), map(node.rightBracket));
15238 copy.nativeClause = clone4(node.nativeClause); 16626 copy.nativeClause = clone4(node.nativeClause);
15239 return copy; 16627 return copy;
15240 } 16628 }
16629
15241 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias. full(clone4(node.documentationComment), clone5(node.metadata), map(node.keyword) , clone4(node.name), clone4(node.typeParameters), map(node.equals), map(node.abs tractKeyword), clone4(node.superclass), clone4(node.withClause), clone4(node.imp lementsClause), map(node.semicolon)); 16630 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias. full(clone4(node.documentationComment), clone5(node.metadata), map(node.keyword) , clone4(node.name), clone4(node.typeParameters), map(node.equals), map(node.abs tractKeyword), clone4(node.superclass), clone4(node.withClause), clone4(node.imp lementsClause), map(node.semicolon));
16631
15242 Comment visitComment(Comment node) { 16632 Comment visitComment(Comment node) {
15243 if (node.isDocumentation) { 16633 if (node.isDocumentation) {
15244 return Comment.createDocumentationComment2(map2(node.tokens), clone5(node. references)); 16634 return Comment.createDocumentationComment2(map2(node.tokens), clone5(node. references));
15245 } else if (node.isBlock) { 16635 } else if (node.isBlock) {
15246 return Comment.createBlockComment(map2(node.tokens)); 16636 return Comment.createBlockComment(map2(node.tokens));
15247 } 16637 }
15248 return Comment.createEndOfLineComment(map2(node.tokens)); 16638 return Comment.createEndOfLineComment(map2(node.tokens));
15249 } 16639 }
16640
15250 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference.full(map(node.newKeyword), clone4(node.identifier)); 16641 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference.full(map(node.newKeyword), clone4(node.identifier));
16642
15251 CompilationUnit visitCompilationUnit(CompilationUnit node) { 16643 CompilationUnit visitCompilationUnit(CompilationUnit node) {
15252 CompilationUnit copy = new CompilationUnit.full(map(node.beginToken), clone4 (node.scriptTag), clone5(node.directives), clone5(node.declarations), map(node.e ndToken)); 16644 CompilationUnit copy = new CompilationUnit.full(map(node.beginToken), clone4 (node.scriptTag), clone5(node.directives), clone5(node.declarations), map(node.e ndToken));
15253 copy.lineInfo = node.lineInfo; 16645 copy.lineInfo = node.lineInfo;
15254 copy.element = node.element; 16646 copy.element = node.element;
15255 return copy; 16647 return copy;
15256 } 16648 }
16649
15257 ConditionalExpression visitConditionalExpression(ConditionalExpression node) { 16650 ConditionalExpression visitConditionalExpression(ConditionalExpression node) {
15258 ConditionalExpression copy = new ConditionalExpression.full(clone4(node.cond ition), map(node.question), clone4(node.thenExpression), map(node.colon), clone4 (node.elseExpression)); 16651 ConditionalExpression copy = new ConditionalExpression.full(clone4(node.cond ition), map(node.question), clone4(node.thenExpression), map(node.colon), clone4 (node.elseExpression));
15259 copy.propagatedType = node.propagatedType; 16652 copy.propagatedType = node.propagatedType;
15260 copy.staticType = node.staticType; 16653 copy.staticType = node.staticType;
15261 return copy; 16654 return copy;
15262 } 16655 }
16656
15263 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node ) { 16657 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node ) {
15264 ConstructorDeclaration copy = new ConstructorDeclaration.full(clone4(node.do cumentationComment), clone5(node.metadata), map(node.externalKeyword), map(node. constKeyword), map(node.factoryKeyword), clone4(node.returnType), map(node.perio d), clone4(node.name), clone4(node.parameters), map(node.separator), clone5(node .initializers), clone4(node.redirectedConstructor), clone4(node.body)); 16658 ConstructorDeclaration copy = new ConstructorDeclaration.full(clone4(node.do cumentationComment), clone5(node.metadata), map(node.externalKeyword), map(node. constKeyword), map(node.factoryKeyword), clone4(node.returnType), map(node.perio d), clone4(node.name), clone4(node.parameters), map(node.separator), clone5(node .initializers), clone4(node.redirectedConstructor), clone4(node.body));
15265 copy.element = node.element; 16659 copy.element = node.element;
15266 return copy; 16660 return copy;
15267 } 16661 }
16662
15268 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI nitializer node) => new ConstructorFieldInitializer.full(map(node.keyword), map( node.period), clone4(node.fieldName), map(node.equals), clone4(node.expression)) ; 16663 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI nitializer node) => new ConstructorFieldInitializer.full(map(node.keyword), map( node.period), clone4(node.fieldName), map(node.equals), clone4(node.expression)) ;
16664
15269 ConstructorName visitConstructorName(ConstructorName node) { 16665 ConstructorName visitConstructorName(ConstructorName node) {
15270 ConstructorName copy = new ConstructorName.full(clone4(node.type), map(node. period), clone4(node.name)); 16666 ConstructorName copy = new ConstructorName.full(clone4(node.type), map(node. period), clone4(node.name));
15271 copy.staticElement = node.staticElement; 16667 copy.staticElement = node.staticElement;
15272 return copy; 16668 return copy;
15273 } 16669 }
16670
15274 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin ueStatement.full(map(node.keyword), clone4(node.label), map(node.semicolon)); 16671 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin ueStatement.full(map(node.keyword), clone4(node.label), map(node.semicolon));
16672
15275 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec laredIdentifier.full(clone4(node.documentationComment), clone5(node.metadata), m ap(node.keyword), clone4(node.type), clone4(node.identifier)); 16673 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec laredIdentifier.full(clone4(node.documentationComment), clone5(node.metadata), m ap(node.keyword), clone4(node.type), clone4(node.identifier));
16674
15276 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node ) => new DefaultFormalParameter.full(clone4(node.parameter), node.kind, map(node .separator), clone4(node.defaultValue)); 16675 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node ) => new DefaultFormalParameter.full(clone4(node.parameter), node.kind, map(node .separator), clone4(node.defaultValue));
16676
15277 DoStatement visitDoStatement(DoStatement node) => new DoStatement.full(map(nod e.doKeyword), clone4(node.body), map(node.whileKeyword), map(node.leftParenthesi s), clone4(node.condition), map(node.rightParenthesis), map(node.semicolon)); 16677 DoStatement visitDoStatement(DoStatement node) => new DoStatement.full(map(nod e.doKeyword), clone4(node.body), map(node.whileKeyword), map(node.leftParenthesi s), clone4(node.condition), map(node.rightParenthesis), map(node.semicolon));
16678
15278 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) { 16679 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) {
15279 DoubleLiteral copy = new DoubleLiteral.full(map(node.literal), node.value); 16680 DoubleLiteral copy = new DoubleLiteral.full(map(node.literal), node.value);
15280 copy.propagatedType = node.propagatedType; 16681 copy.propagatedType = node.propagatedType;
15281 copy.staticType = node.staticType; 16682 copy.staticType = node.staticType;
15282 return copy; 16683 return copy;
15283 } 16684 }
16685
15284 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF unctionBody.full(map(node.semicolon)); 16686 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF unctionBody.full(map(node.semicolon));
16687
15285 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement. full(map(node.semicolon)); 16688 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement. full(map(node.semicolon));
16689
15286 ExportDirective visitExportDirective(ExportDirective node) { 16690 ExportDirective visitExportDirective(ExportDirective node) {
15287 ExportDirective copy = new ExportDirective.full(clone4(node.documentationCom ment), clone5(node.metadata), map(node.keyword), clone4(node.uri), clone5(node.c ombinators), map(node.semicolon)); 16691 ExportDirective copy = new ExportDirective.full(clone4(node.documentationCom ment), clone5(node.metadata), map(node.keyword), clone4(node.uri), clone5(node.c ombinators), map(node.semicolon));
15288 copy.element = node.element; 16692 copy.element = node.element;
15289 return copy; 16693 return copy;
15290 } 16694 }
16695
15291 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody.full(map(node.functionDefinition), clone4(node.e xpression), map(node.semicolon)); 16696 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody.full(map(node.functionDefinition), clone4(node.e xpression), map(node.semicolon));
16697
15292 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement.full(clone4(node.expression), map(node.semicolon)); 16698 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement.full(clone4(node.expression), map(node.semicolon));
16699
15293 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause.full (map(node.keyword), clone4(node.superclass)); 16700 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause.full (map(node.keyword), clone4(node.superclass));
16701
15294 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration.full(clone4(node.documentationComment), clone5(node.metadata), map(node. staticKeyword), clone4(node.fields), map(node.semicolon)); 16702 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration.full(clone4(node.documentationComment), clone5(node.metadata), map(node. staticKeyword), clone4(node.fields), map(node.semicolon));
16703
15295 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter.full(clone4(node.documentationComment), clone5(node.meta data), map(node.keyword), clone4(node.type), map(node.thisToken), map(node.perio d), clone4(node.identifier), clone4(node.parameters)); 16704 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter.full(clone4(node.documentationComment), clone5(node.meta data), map(node.keyword), clone4(node.type), map(node.thisToken), map(node.perio d), clone4(node.identifier), clone4(node.parameters));
16705
15296 ForEachStatement visitForEachStatement(ForEachStatement node) { 16706 ForEachStatement visitForEachStatement(ForEachStatement node) {
15297 DeclaredIdentifier loopVariable = node.loopVariable; 16707 DeclaredIdentifier loopVariable = node.loopVariable;
15298 if (loopVariable == null) { 16708 if (loopVariable == null) {
15299 return new ForEachStatement.con2_full(map(node.forKeyword), map(node.leftP arenthesis), clone4(node.identifier), map(node.inKeyword), clone4(node.iterator) , map(node.rightParenthesis), clone4(node.body)); 16709 return new ForEachStatement.con2_full(map(node.forKeyword), map(node.leftP arenthesis), clone4(node.identifier), map(node.inKeyword), clone4(node.iterator) , map(node.rightParenthesis), clone4(node.body));
15300 } 16710 }
15301 return new ForEachStatement.con1_full(map(node.forKeyword), map(node.leftPar enthesis), clone4(loopVariable), map(node.inKeyword), clone4(node.iterator), map (node.rightParenthesis), clone4(node.body)); 16711 return new ForEachStatement.con1_full(map(node.forKeyword), map(node.leftPar enthesis), clone4(loopVariable), map(node.inKeyword), clone4(node.iterator), map (node.rightParenthesis), clone4(node.body));
15302 } 16712 }
16713
15303 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList.full(map(node.leftParenthesis), clone5(node.parameters), map (node.leftDelimiter), map(node.rightDelimiter), map(node.rightParenthesis)); 16714 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList.full(map(node.leftParenthesis), clone5(node.parameters), map (node.leftDelimiter), map(node.rightDelimiter), map(node.rightParenthesis));
16715
15304 ForStatement visitForStatement(ForStatement node) => new ForStatement.full(map (node.forKeyword), map(node.leftParenthesis), clone4(node.variables), clone4(nod e.initialization), map(node.leftSeparator), clone4(node.condition), map(node.rig htSeparator), clone5(node.updaters), map(node.rightParenthesis), clone4(node.bod y)); 16716 ForStatement visitForStatement(ForStatement node) => new ForStatement.full(map (node.forKeyword), map(node.leftParenthesis), clone4(node.variables), clone4(nod e.initialization), map(node.leftSeparator), clone4(node.condition), map(node.rig htSeparator), clone5(node.updaters), map(node.rightParenthesis), clone4(node.bod y));
16717
15305 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration.full(clone4(node.documentationComment), clone5(node.metadata ), map(node.externalKeyword), clone4(node.returnType), map(node.propertyKeyword) , clone4(node.name), clone4(node.functionExpression)); 16718 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration.full(clone4(node.documentationComment), clone5(node.metadata ), map(node.externalKeyword), clone4(node.returnType), map(node.propertyKeyword) , clone4(node.name), clone4(node.functionExpression));
16719
15306 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara tionStatement node) => new FunctionDeclarationStatement.full(clone4(node.functio nDeclaration)); 16720 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara tionStatement node) => new FunctionDeclarationStatement.full(clone4(node.functio nDeclaration));
16721
15307 FunctionExpression visitFunctionExpression(FunctionExpression node) { 16722 FunctionExpression visitFunctionExpression(FunctionExpression node) {
15308 FunctionExpression copy = new FunctionExpression.full(clone4(node.parameters ), clone4(node.body)); 16723 FunctionExpression copy = new FunctionExpression.full(clone4(node.parameters ), clone4(node.body));
15309 copy.element = node.element; 16724 copy.element = node.element;
15310 copy.propagatedType = node.propagatedType; 16725 copy.propagatedType = node.propagatedType;
15311 copy.staticType = node.staticType; 16726 copy.staticType = node.staticType;
15312 return copy; 16727 return copy;
15313 } 16728 }
16729
15314 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress ionInvocation node) { 16730 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress ionInvocation node) {
15315 FunctionExpressionInvocation copy = new FunctionExpressionInvocation.full(cl one4(node.function), clone4(node.argumentList)); 16731 FunctionExpressionInvocation copy = new FunctionExpressionInvocation.full(cl one4(node.function), clone4(node.argumentList));
15316 copy.propagatedElement = node.propagatedElement; 16732 copy.propagatedElement = node.propagatedElement;
15317 copy.propagatedType = node.propagatedType; 16733 copy.propagatedType = node.propagatedType;
15318 copy.staticElement = node.staticElement; 16734 copy.staticElement = node.staticElement;
15319 copy.staticType = node.staticType; 16735 copy.staticType = node.staticType;
15320 return copy; 16736 return copy;
15321 } 16737 }
16738
15322 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi onTypeAlias.full(clone4(node.documentationComment), clone5(node.metadata), map(n ode.keyword), clone4(node.returnType), clone4(node.name), clone4(node.typeParame ters), clone4(node.parameters), map(node.semicolon)); 16739 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi onTypeAlias.full(clone4(node.documentationComment), clone5(node.metadata), map(n ode.keyword), clone4(node.returnType), clone4(node.name), clone4(node.typeParame ters), clone4(node.parameters), map(node.semicolon));
16740
15323 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo rmalParameter node) => new FunctionTypedFormalParameter.full(clone4(node.documen tationComment), clone5(node.metadata), clone4(node.returnType), clone4(node.iden tifier), clone4(node.parameters)); 16741 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo rmalParameter node) => new FunctionTypedFormalParameter.full(clone4(node.documen tationComment), clone5(node.metadata), clone4(node.returnType), clone4(node.iden tifier), clone4(node.parameters));
16742
15324 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator. full(map(node.keyword), clone5(node.hiddenNames)); 16743 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator. full(map(node.keyword), clone5(node.hiddenNames));
16744
15325 IfStatement visitIfStatement(IfStatement node) => new IfStatement.full(map(nod e.ifKeyword), map(node.leftParenthesis), clone4(node.condition), map(node.rightP arenthesis), clone4(node.thenStatement), map(node.elseKeyword), clone4(node.else Statement)); 16745 IfStatement visitIfStatement(IfStatement node) => new IfStatement.full(map(nod e.ifKeyword), map(node.leftParenthesis), clone4(node.condition), map(node.rightP arenthesis), clone4(node.thenStatement), map(node.elseKeyword), clone4(node.else Statement));
16746
15326 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement sClause.full(map(node.keyword), clone5(node.interfaces)); 16747 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement sClause.full(map(node.keyword), clone5(node.interfaces));
16748
15327 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect ive.full(clone4(node.documentationComment), clone5(node.metadata), map(node.keyw ord), clone4(node.uri), map(node.asToken), clone4(node.prefix), clone5(node.comb inators), map(node.semicolon)); 16749 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect ive.full(clone4(node.documentationComment), clone5(node.metadata), map(node.keyw ord), clone4(node.uri), map(node.asToken), clone4(node.prefix), clone5(node.comb inators), map(node.semicolon));
16750
15328 IndexExpression visitIndexExpression(IndexExpression node) { 16751 IndexExpression visitIndexExpression(IndexExpression node) {
15329 Token period = map(node.period); 16752 Token period = map(node.period);
15330 IndexExpression copy; 16753 IndexExpression copy;
15331 if (period == null) { 16754 if (period == null) {
15332 copy = new IndexExpression.forTarget_full(clone4(node.target), map(node.le ftBracket), clone4(node.index), map(node.rightBracket)); 16755 copy = new IndexExpression.forTarget_full(clone4(node.target), map(node.le ftBracket), clone4(node.index), map(node.rightBracket));
15333 } else { 16756 } else {
15334 copy = new IndexExpression.forCascade_full(period, map(node.leftBracket), clone4(node.index), map(node.rightBracket)); 16757 copy = new IndexExpression.forCascade_full(period, map(node.leftBracket), clone4(node.index), map(node.rightBracket));
15335 } 16758 }
15336 copy.auxiliaryElements = node.auxiliaryElements; 16759 copy.auxiliaryElements = node.auxiliaryElements;
15337 copy.propagatedElement = node.propagatedElement; 16760 copy.propagatedElement = node.propagatedElement;
15338 copy.propagatedType = node.propagatedType; 16761 copy.propagatedType = node.propagatedType;
15339 copy.staticElement = node.staticElement; 16762 copy.staticElement = node.staticElement;
15340 copy.staticType = node.staticType; 16763 copy.staticType = node.staticType;
15341 return copy; 16764 return copy;
15342 } 16765 }
16766
15343 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp ression node) { 16767 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp ression node) {
15344 InstanceCreationExpression copy = new InstanceCreationExpression.full(map(no de.keyword), clone4(node.constructorName), clone4(node.argumentList)); 16768 InstanceCreationExpression copy = new InstanceCreationExpression.full(map(no de.keyword), clone4(node.constructorName), clone4(node.argumentList));
15345 copy.propagatedType = node.propagatedType; 16769 copy.propagatedType = node.propagatedType;
15346 copy.staticElement = node.staticElement; 16770 copy.staticElement = node.staticElement;
15347 copy.staticType = node.staticType; 16771 copy.staticType = node.staticType;
15348 return copy; 16772 return copy;
15349 } 16773 }
16774
15350 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) { 16775 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) {
15351 IntegerLiteral copy = new IntegerLiteral.full(map(node.literal), node.value) ; 16776 IntegerLiteral copy = new IntegerLiteral.full(map(node.literal), node.value) ;
15352 copy.propagatedType = node.propagatedType; 16777 copy.propagatedType = node.propagatedType;
15353 copy.staticType = node.staticType; 16778 copy.staticType = node.staticType;
15354 return copy; 16779 return copy;
15355 } 16780 }
16781
15356 InterpolationExpression visitInterpolationExpression(InterpolationExpression n ode) => new InterpolationExpression.full(map(node.leftBracket), clone4(node.expr ession), map(node.rightBracket)); 16782 InterpolationExpression visitInterpolationExpression(InterpolationExpression n ode) => new InterpolationExpression.full(map(node.leftBracket), clone4(node.expr ession), map(node.rightBracket));
16783
15357 InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString.full(map(node.contents), node.value); 16784 InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString.full(map(node.contents), node.value);
16785
15358 IsExpression visitIsExpression(IsExpression node) { 16786 IsExpression visitIsExpression(IsExpression node) {
15359 IsExpression copy = new IsExpression.full(clone4(node.expression), map(node. isOperator), map(node.notOperator), clone4(node.type)); 16787 IsExpression copy = new IsExpression.full(clone4(node.expression), map(node. isOperator), map(node.notOperator), clone4(node.type));
15360 copy.propagatedType = node.propagatedType; 16788 copy.propagatedType = node.propagatedType;
15361 copy.staticType = node.staticType; 16789 copy.staticType = node.staticType;
15362 return copy; 16790 return copy;
15363 } 16791 }
16792
15364 Label visitLabel(Label node) => new Label.full(clone4(node.label), map(node.co lon)); 16793 Label visitLabel(Label node) => new Label.full(clone4(node.label), map(node.co lon));
16794
15365 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt atement.full(clone5(node.labels), clone4(node.statement)); 16795 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt atement.full(clone5(node.labels), clone4(node.statement));
16796
15366 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi rective.full(clone4(node.documentationComment), clone5(node.metadata), map(node. libraryToken), clone4(node.name), map(node.semicolon)); 16797 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi rective.full(clone4(node.documentationComment), clone5(node.metadata), map(node. libraryToken), clone4(node.name), map(node.semicolon));
16798
15367 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) { 16799 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) {
15368 LibraryIdentifier copy = new LibraryIdentifier.full(clone5(node.components)) ; 16800 LibraryIdentifier copy = new LibraryIdentifier.full(clone5(node.components)) ;
15369 copy.propagatedType = node.propagatedType; 16801 copy.propagatedType = node.propagatedType;
15370 copy.staticType = node.staticType; 16802 copy.staticType = node.staticType;
15371 return copy; 16803 return copy;
15372 } 16804 }
16805
15373 ListLiteral visitListLiteral(ListLiteral node) { 16806 ListLiteral visitListLiteral(ListLiteral node) {
15374 ListLiteral copy = new ListLiteral.full(map(node.constKeyword), clone4(node. typeArguments), map(node.leftBracket), clone5(node.elements), map(node.rightBrac ket)); 16807 ListLiteral copy = new ListLiteral.full(map(node.constKeyword), clone4(node. typeArguments), map(node.leftBracket), clone5(node.elements), map(node.rightBrac ket));
15375 copy.propagatedType = node.propagatedType; 16808 copy.propagatedType = node.propagatedType;
15376 copy.staticType = node.staticType; 16809 copy.staticType = node.staticType;
15377 return copy; 16810 return copy;
15378 } 16811 }
16812
15379 MapLiteral visitMapLiteral(MapLiteral node) { 16813 MapLiteral visitMapLiteral(MapLiteral node) {
15380 MapLiteral copy = new MapLiteral.full(map(node.constKeyword), clone4(node.ty peArguments), map(node.leftBracket), clone5(node.entries), map(node.rightBracket )); 16814 MapLiteral copy = new MapLiteral.full(map(node.constKeyword), clone4(node.ty peArguments), map(node.leftBracket), clone5(node.entries), map(node.rightBracket ));
15381 copy.propagatedType = node.propagatedType; 16815 copy.propagatedType = node.propagatedType;
15382 copy.staticType = node.staticType; 16816 copy.staticType = node.staticType;
15383 return copy; 16817 return copy;
15384 } 16818 }
16819
15385 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn try.full(clone4(node.key), map(node.separator), clone4(node.value)); 16820 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn try.full(clone4(node.key), map(node.separator), clone4(node.value));
16821
15386 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method Declaration.full(clone4(node.documentationComment), clone5(node.metadata), map(n ode.externalKeyword), map(node.modifierKeyword), clone4(node.returnType), map(no de.propertyKeyword), map(node.operatorKeyword), clone4(node.name), clone4(node.p arameters), clone4(node.body)); 16822 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method Declaration.full(clone4(node.documentationComment), clone5(node.metadata), map(n ode.externalKeyword), map(node.modifierKeyword), clone4(node.returnType), map(no de.propertyKeyword), map(node.operatorKeyword), clone4(node.name), clone4(node.p arameters), clone4(node.body));
16823
15387 MethodInvocation visitMethodInvocation(MethodInvocation node) { 16824 MethodInvocation visitMethodInvocation(MethodInvocation node) {
15388 MethodInvocation copy = new MethodInvocation.full(clone4(node.target), map(n ode.period), clone4(node.methodName), clone4(node.argumentList)); 16825 MethodInvocation copy = new MethodInvocation.full(clone4(node.target), map(n ode.period), clone4(node.methodName), clone4(node.argumentList));
15389 copy.propagatedType = node.propagatedType; 16826 copy.propagatedType = node.propagatedType;
15390 copy.staticType = node.staticType; 16827 copy.staticType = node.staticType;
15391 return copy; 16828 return copy;
15392 } 16829 }
16830
15393 NamedExpression visitNamedExpression(NamedExpression node) { 16831 NamedExpression visitNamedExpression(NamedExpression node) {
15394 NamedExpression copy = new NamedExpression.full(clone4(node.name), clone4(no de.expression)); 16832 NamedExpression copy = new NamedExpression.full(clone4(node.name), clone4(no de.expression));
15395 copy.propagatedType = node.propagatedType; 16833 copy.propagatedType = node.propagatedType;
15396 copy.staticType = node.staticType; 16834 copy.staticType = node.staticType;
15397 return copy; 16835 return copy;
15398 } 16836 }
16837
15399 ASTNode visitNativeClause(NativeClause node) => new NativeClause.full(map(node .keyword), clone4(node.name)); 16838 ASTNode visitNativeClause(NativeClause node) => new NativeClause.full(map(node .keyword), clone4(node.name));
16839
15400 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat iveFunctionBody.full(map(node.nativeToken), clone4(node.stringLiteral), map(node .semicolon)); 16840 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat iveFunctionBody.full(map(node.nativeToken), clone4(node.stringLiteral), map(node .semicolon));
16841
15401 NullLiteral visitNullLiteral(NullLiteral node) { 16842 NullLiteral visitNullLiteral(NullLiteral node) {
15402 NullLiteral copy = new NullLiteral.full(map(node.literal)); 16843 NullLiteral copy = new NullLiteral.full(map(node.literal));
15403 copy.propagatedType = node.propagatedType; 16844 copy.propagatedType = node.propagatedType;
15404 copy.staticType = node.staticType; 16845 copy.staticType = node.staticType;
15405 return copy; 16846 return copy;
15406 } 16847 }
16848
15407 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n ode) { 16849 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n ode) {
15408 ParenthesizedExpression copy = new ParenthesizedExpression.full(map(node.lef tParenthesis), clone4(node.expression), map(node.rightParenthesis)); 16850 ParenthesizedExpression copy = new ParenthesizedExpression.full(map(node.lef tParenthesis), clone4(node.expression), map(node.rightParenthesis));
15409 copy.propagatedType = node.propagatedType; 16851 copy.propagatedType = node.propagatedType;
15410 copy.staticType = node.staticType; 16852 copy.staticType = node.staticType;
15411 return copy; 16853 return copy;
15412 } 16854 }
16855
15413 PartDirective visitPartDirective(PartDirective node) { 16856 PartDirective visitPartDirective(PartDirective node) {
15414 PartDirective copy = new PartDirective.full(clone4(node.documentationComment ), clone5(node.metadata), map(node.partToken), clone4(node.uri), map(node.semico lon)); 16857 PartDirective copy = new PartDirective.full(clone4(node.documentationComment ), clone5(node.metadata), map(node.partToken), clone4(node.uri), map(node.semico lon));
15415 copy.element = node.element; 16858 copy.element = node.element;
15416 return copy; 16859 return copy;
15417 } 16860 }
16861
15418 PartOfDirective visitPartOfDirective(PartOfDirective node) { 16862 PartOfDirective visitPartOfDirective(PartOfDirective node) {
15419 PartOfDirective copy = new PartOfDirective.full(clone4(node.documentationCom ment), clone5(node.metadata), map(node.partToken), map(node.ofToken), clone4(nod e.libraryName), map(node.semicolon)); 16863 PartOfDirective copy = new PartOfDirective.full(clone4(node.documentationCom ment), clone5(node.metadata), map(node.partToken), map(node.ofToken), clone4(nod e.libraryName), map(node.semicolon));
15420 copy.element = node.element; 16864 copy.element = node.element;
15421 return copy; 16865 return copy;
15422 } 16866 }
16867
15423 PostfixExpression visitPostfixExpression(PostfixExpression node) { 16868 PostfixExpression visitPostfixExpression(PostfixExpression node) {
15424 PostfixExpression copy = new PostfixExpression.full(clone4(node.operand), ma p(node.operator)); 16869 PostfixExpression copy = new PostfixExpression.full(clone4(node.operand), ma p(node.operator));
15425 copy.propagatedElement = node.propagatedElement; 16870 copy.propagatedElement = node.propagatedElement;
15426 copy.propagatedType = node.propagatedType; 16871 copy.propagatedType = node.propagatedType;
15427 copy.staticElement = node.staticElement; 16872 copy.staticElement = node.staticElement;
15428 copy.staticType = node.staticType; 16873 copy.staticType = node.staticType;
15429 return copy; 16874 return copy;
15430 } 16875 }
16876
15431 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) { 16877 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) {
15432 PrefixedIdentifier copy = new PrefixedIdentifier.full(clone4(node.prefix), m ap(node.period), clone4(node.identifier)); 16878 PrefixedIdentifier copy = new PrefixedIdentifier.full(clone4(node.prefix), m ap(node.period), clone4(node.identifier));
15433 copy.propagatedType = node.propagatedType; 16879 copy.propagatedType = node.propagatedType;
15434 copy.staticType = node.staticType; 16880 copy.staticType = node.staticType;
15435 return copy; 16881 return copy;
15436 } 16882 }
16883
15437 PrefixExpression visitPrefixExpression(PrefixExpression node) { 16884 PrefixExpression visitPrefixExpression(PrefixExpression node) {
15438 PrefixExpression copy = new PrefixExpression.full(map(node.operator), clone4 (node.operand)); 16885 PrefixExpression copy = new PrefixExpression.full(map(node.operator), clone4 (node.operand));
15439 copy.propagatedElement = node.propagatedElement; 16886 copy.propagatedElement = node.propagatedElement;
15440 copy.propagatedType = node.propagatedType; 16887 copy.propagatedType = node.propagatedType;
15441 copy.staticElement = node.staticElement; 16888 copy.staticElement = node.staticElement;
15442 copy.staticType = node.staticType; 16889 copy.staticType = node.staticType;
15443 return copy; 16890 return copy;
15444 } 16891 }
16892
15445 PropertyAccess visitPropertyAccess(PropertyAccess node) { 16893 PropertyAccess visitPropertyAccess(PropertyAccess node) {
15446 PropertyAccess copy = new PropertyAccess.full(clone4(node.target), map(node. operator), clone4(node.propertyName)); 16894 PropertyAccess copy = new PropertyAccess.full(clone4(node.target), map(node. operator), clone4(node.propertyName));
15447 copy.propagatedType = node.propagatedType; 16895 copy.propagatedType = node.propagatedType;
15448 copy.staticType = node.staticType; 16896 copy.staticType = node.staticType;
15449 return copy; 16897 return copy;
15450 } 16898 }
16899
15451 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec tingConstructorInvocation node) { 16900 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec tingConstructorInvocation node) {
15452 RedirectingConstructorInvocation copy = new RedirectingConstructorInvocation .full(map(node.keyword), map(node.period), clone4(node.constructorName), clone4( node.argumentList)); 16901 RedirectingConstructorInvocation copy = new RedirectingConstructorInvocation .full(map(node.keyword), map(node.period), clone4(node.constructorName), clone4( node.argumentList));
15453 copy.staticElement = node.staticElement; 16902 copy.staticElement = node.staticElement;
15454 return copy; 16903 return copy;
15455 } 16904 }
16905
15456 RethrowExpression visitRethrowExpression(RethrowExpression node) { 16906 RethrowExpression visitRethrowExpression(RethrowExpression node) {
15457 RethrowExpression copy = new RethrowExpression.full(map(node.keyword)); 16907 RethrowExpression copy = new RethrowExpression.full(map(node.keyword));
15458 copy.propagatedType = node.propagatedType; 16908 copy.propagatedType = node.propagatedType;
15459 copy.staticType = node.staticType; 16909 copy.staticType = node.staticType;
15460 return copy; 16910 return copy;
15461 } 16911 }
16912
15462 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent.full(map(node.keyword), clone4(node.expression), map(node.semicolon)); 16913 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent.full(map(node.keyword), clone4(node.expression), map(node.semicolon));
16914
15463 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag.full(map(node.script Tag)); 16915 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag.full(map(node.script Tag));
16916
15464 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator. full(map(node.keyword), clone5(node.shownNames)); 16917 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator. full(map(node.keyword), clone5(node.shownNames));
16918
15465 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter.full(clone4(node.documentationComment), clone5(node. metadata), map(node.keyword), clone4(node.type), clone4(node.identifier)); 16919 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter.full(clone4(node.documentationComment), clone5(node. metadata), map(node.keyword), clone4(node.type), clone4(node.identifier));
16920
15466 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) { 16921 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
15467 SimpleIdentifier copy = new SimpleIdentifier.full(map(node.token)); 16922 SimpleIdentifier copy = new SimpleIdentifier.full(map(node.token));
15468 copy.auxiliaryElements = node.auxiliaryElements; 16923 copy.auxiliaryElements = node.auxiliaryElements;
15469 copy.propagatedElement = node.propagatedElement; 16924 copy.propagatedElement = node.propagatedElement;
15470 copy.propagatedType = node.propagatedType; 16925 copy.propagatedType = node.propagatedType;
15471 copy.staticElement = node.staticElement; 16926 copy.staticElement = node.staticElement;
15472 copy.staticType = node.staticType; 16927 copy.staticType = node.staticType;
15473 return copy; 16928 return copy;
15474 } 16929 }
16930
15475 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) { 16931 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) {
15476 SimpleStringLiteral copy = new SimpleStringLiteral.full(map(node.literal), n ode.value); 16932 SimpleStringLiteral copy = new SimpleStringLiteral.full(map(node.literal), n ode.value);
15477 copy.propagatedType = node.propagatedType; 16933 copy.propagatedType = node.propagatedType;
15478 copy.staticType = node.staticType; 16934 copy.staticType = node.staticType;
15479 return copy; 16935 return copy;
15480 } 16936 }
16937
15481 StringInterpolation visitStringInterpolation(StringInterpolation node) { 16938 StringInterpolation visitStringInterpolation(StringInterpolation node) {
15482 StringInterpolation copy = new StringInterpolation.full(clone5(node.elements )); 16939 StringInterpolation copy = new StringInterpolation.full(clone5(node.elements ));
15483 copy.propagatedType = node.propagatedType; 16940 copy.propagatedType = node.propagatedType;
15484 copy.staticType = node.staticType; 16941 copy.staticType = node.staticType;
15485 return copy; 16942 return copy;
15486 } 16943 }
16944
15487 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv ocation node) { 16945 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv ocation node) {
15488 SuperConstructorInvocation copy = new SuperConstructorInvocation.full(map(no de.keyword), map(node.period), clone4(node.constructorName), clone4(node.argumen tList)); 16946 SuperConstructorInvocation copy = new SuperConstructorInvocation.full(map(no de.keyword), map(node.period), clone4(node.constructorName), clone4(node.argumen tList));
15489 copy.staticElement = node.staticElement; 16947 copy.staticElement = node.staticElement;
15490 return copy; 16948 return copy;
15491 } 16949 }
16950
15492 SuperExpression visitSuperExpression(SuperExpression node) { 16951 SuperExpression visitSuperExpression(SuperExpression node) {
15493 SuperExpression copy = new SuperExpression.full(map(node.keyword)); 16952 SuperExpression copy = new SuperExpression.full(map(node.keyword));
15494 copy.propagatedType = node.propagatedType; 16953 copy.propagatedType = node.propagatedType;
15495 copy.staticType = node.staticType; 16954 copy.staticType = node.staticType;
15496 return copy; 16955 return copy;
15497 } 16956 }
16957
15498 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase.full(clone5(node .labels), map(node.keyword), clone4(node.expression), map(node.colon), clone5(no de.statements)); 16958 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase.full(clone5(node .labels), map(node.keyword), clone4(node.expression), map(node.colon), clone5(no de.statements));
16959
15499 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault.full (clone5(node.labels), map(node.keyword), map(node.colon), clone5(node.statements )); 16960 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault.full (clone5(node.labels), map(node.keyword), map(node.colon), clone5(node.statements ));
16961
15500 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem ent.full(map(node.keyword), map(node.leftParenthesis), clone4(node.expression), map(node.rightParenthesis), map(node.leftBracket), clone5(node.members), map(nod e.rightBracket)); 16962 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem ent.full(map(node.keyword), map(node.leftParenthesis), clone4(node.expression), map(node.rightParenthesis), map(node.leftBracket), clone5(node.members), map(nod e.rightBracket));
16963
15501 ASTNode visitSymbolLiteral(SymbolLiteral node) { 16964 ASTNode visitSymbolLiteral(SymbolLiteral node) {
15502 SymbolLiteral copy = new SymbolLiteral.full(map(node.poundSign), map2(node.c omponents)); 16965 SymbolLiteral copy = new SymbolLiteral.full(map(node.poundSign), map2(node.c omponents));
15503 copy.propagatedType = node.propagatedType; 16966 copy.propagatedType = node.propagatedType;
15504 copy.staticType = node.staticType; 16967 copy.staticType = node.staticType;
15505 return copy; 16968 return copy;
15506 } 16969 }
16970
15507 ThisExpression visitThisExpression(ThisExpression node) { 16971 ThisExpression visitThisExpression(ThisExpression node) {
15508 ThisExpression copy = new ThisExpression.full(map(node.keyword)); 16972 ThisExpression copy = new ThisExpression.full(map(node.keyword));
15509 copy.propagatedType = node.propagatedType; 16973 copy.propagatedType = node.propagatedType;
15510 copy.staticType = node.staticType; 16974 copy.staticType = node.staticType;
15511 return copy; 16975 return copy;
15512 } 16976 }
16977
15513 ThrowExpression visitThrowExpression(ThrowExpression node) { 16978 ThrowExpression visitThrowExpression(ThrowExpression node) {
15514 ThrowExpression copy = new ThrowExpression.full(map(node.keyword), clone4(no de.expression)); 16979 ThrowExpression copy = new ThrowExpression.full(map(node.keyword), clone4(no de.expression));
15515 copy.propagatedType = node.propagatedType; 16980 copy.propagatedType = node.propagatedType;
15516 copy.staticType = node.staticType; 16981 copy.staticType = node.staticType;
15517 return copy; 16982 return copy;
15518 } 16983 }
16984
15519 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD eclaration node) => new TopLevelVariableDeclaration.full(clone4(node.documentati onComment), clone5(node.metadata), clone4(node.variables), map(node.semicolon)); 16985 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD eclaration node) => new TopLevelVariableDeclaration.full(clone4(node.documentati onComment), clone5(node.metadata), clone4(node.variables), map(node.semicolon));
16986
15520 TryStatement visitTryStatement(TryStatement node) => new TryStatement.full(map (node.tryKeyword), clone4(node.body), clone5(node.catchClauses), map(node.finall yKeyword), clone4(node.finallyBlock)); 16987 TryStatement visitTryStatement(TryStatement node) => new TryStatement.full(map (node.tryKeyword), clone4(node.body), clone5(node.catchClauses), map(node.finall yKeyword), clone4(node.finallyBlock));
16988
15521 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum entList.full(map(node.leftBracket), clone5(node.arguments), map(node.rightBracke t)); 16989 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum entList.full(map(node.leftBracket), clone5(node.arguments), map(node.rightBracke t));
16990
15522 TypeName visitTypeName(TypeName node) { 16991 TypeName visitTypeName(TypeName node) {
15523 TypeName copy = new TypeName.full(clone4(node.name), clone4(node.typeArgumen ts)); 16992 TypeName copy = new TypeName.full(clone4(node.name), clone4(node.typeArgumen ts));
15524 copy.type = node.type; 16993 copy.type = node.type;
15525 return copy; 16994 return copy;
15526 } 16995 }
16996
15527 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter.full (clone4(node.documentationComment), clone5(node.metadata), clone4(node.name), ma p(node.keyword), clone4(node.bound)); 16997 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter.full (clone4(node.documentationComment), clone5(node.metadata), clone4(node.name), ma p(node.keyword), clone4(node.bound));
16998
15528 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa rameterList.full(map(node.leftBracket), clone5(node.typeParameters), map(node.ri ghtBracket)); 16999 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa rameterList.full(map(node.leftBracket), clone5(node.typeParameters), map(node.ri ghtBracket));
17000
15529 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration.full(null, clone5(node.metadata), clone4(node.name), map(nod e.equals), clone4(node.initializer)); 17001 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration.full(null, clone5(node.metadata), clone4(node.name), map(nod e.equals), clone4(node.initializer));
17002
15530 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n ode) => new VariableDeclarationList.full(null, clone5(node.metadata), map(node.k eyword), clone4(node.type), clone5(node.variables)); 17003 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n ode) => new VariableDeclarationList.full(null, clone5(node.metadata), map(node.k eyword), clone4(node.type), clone5(node.variables));
17004
15531 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement.full(clone4(node.variabl es), map(node.semicolon)); 17005 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement.full(clone4(node.variabl es), map(node.semicolon));
17006
15532 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement. full(map(node.keyword), map(node.leftParenthesis), clone4(node.condition), map(n ode.rightParenthesis), clone4(node.body)); 17007 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement. full(map(node.keyword), map(node.leftParenthesis), clone4(node.condition), map(n ode.rightParenthesis), clone4(node.body));
17008
15533 WithClause visitWithClause(WithClause node) => new WithClause.full(map(node.wi thKeyword), clone5(node.mixinTypes)); 17009 WithClause visitWithClause(WithClause node) => new WithClause.full(map(node.wi thKeyword), clone5(node.mixinTypes));
17010
15534 ASTNode clone4(ASTNode node) { 17011 ASTNode clone4(ASTNode node) {
15535 if (node == null) { 17012 if (node == null) {
15536 return null; 17013 return null;
15537 } 17014 }
15538 if (identical(node, _oldNode)) { 17015 if (identical(node, _oldNode)) {
15539 return _newNode as ASTNode; 17016 return _newNode as ASTNode;
15540 } 17017 }
15541 return node.accept(this) as ASTNode; 17018 return node.accept(this) as ASTNode;
15542 } 17019 }
17020
15543 List clone5(NodeList nodes) { 17021 List clone5(NodeList nodes) {
15544 List clonedNodes = new List(); 17022 List clonedNodes = new List();
15545 for (ASTNode node in nodes) { 17023 for (ASTNode node in nodes) {
15546 clonedNodes.add(clone4(node)); 17024 clonedNodes.add(clone4(node));
15547 } 17025 }
15548 return clonedNodes; 17026 return clonedNodes;
15549 } 17027 }
17028
15550 Token map(Token oldToken) { 17029 Token map(Token oldToken) {
15551 if (oldToken == null) { 17030 if (oldToken == null) {
15552 return null; 17031 return null;
15553 } 17032 }
15554 return _tokenMap.get(oldToken); 17033 return _tokenMap.get(oldToken);
15555 } 17034 }
17035
15556 List<Token> map2(List<Token> oldTokens) { 17036 List<Token> map2(List<Token> oldTokens) {
15557 List<Token> newTokens = new List<Token>(oldTokens.length); 17037 List<Token> newTokens = new List<Token>(oldTokens.length);
15558 for (int index = 0; index < newTokens.length; index++) { 17038 for (int index = 0; index < newTokens.length; index++) {
15559 newTokens[index] = map(oldTokens[index]); 17039 newTokens[index] = map(oldTokens[index]);
15560 } 17040 }
15561 return newTokens; 17041 return newTokens;
15562 } 17042 }
15563 } 17043 }
17044
15564 /** 17045 /**
15565 * Traverse the AST from initial child node to successive parents, building a co llection of local 17046 * Traverse the AST from initial child node to successive parents, building a co llection of local
15566 * variable and parameter names visible to the initial child node. In case of na me shadowing, the 17047 * variable and parameter names visible to the initial child node. In case of na me shadowing, the
15567 * first name seen is the most specific one so names are not redefined. 17048 * first name seen is the most specific one so names are not redefined.
15568 * 17049 *
15569 * Completion test code coverage is 95%. The two basic blocks that are not execu ted cannot be 17050 * Completion test code coverage is 95%. The two basic blocks that are not execu ted cannot be
15570 * executed. They are included for future reference. 17051 * executed. They are included for future reference.
15571 * 17052 *
15572 * @coverage com.google.dart.engine.services.completion 17053 * @coverage com.google.dart.engine.services.completion
15573 */ 17054 */
15574 class ScopedNameFinder extends GeneralizingASTVisitor<Object> { 17055 class ScopedNameFinder extends GeneralizingASTVisitor<Object> {
15575 Declaration declaration; 17056 Declaration declaration;
17057
15576 ASTNode _immediateChild; 17058 ASTNode _immediateChild;
17059
15577 final Map<String, SimpleIdentifier> locals = new Map<String, SimpleIdentifier> (); 17060 final Map<String, SimpleIdentifier> locals = new Map<String, SimpleIdentifier> ();
17061
15578 int _position = 0; 17062 int _position = 0;
17063
15579 bool _referenceIsWithinLocalFunction = false; 17064 bool _referenceIsWithinLocalFunction = false;
17065
15580 ScopedNameFinder(int position) { 17066 ScopedNameFinder(int position) {
15581 this._position = position; 17067 this._position = position;
15582 } 17068 }
17069
15583 Object visitBlock(Block node) { 17070 Object visitBlock(Block node) {
15584 checkStatements(node.statements); 17071 checkStatements(node.statements);
15585 return super.visitBlock(node); 17072 return super.visitBlock(node);
15586 } 17073 }
17074
15587 Object visitCatchClause(CatchClause node) { 17075 Object visitCatchClause(CatchClause node) {
15588 addToScope(node.exceptionParameter); 17076 addToScope(node.exceptionParameter);
15589 addToScope(node.stackTraceParameter); 17077 addToScope(node.stackTraceParameter);
15590 return super.visitCatchClause(node); 17078 return super.visitCatchClause(node);
15591 } 17079 }
17080
15592 Object visitConstructorDeclaration(ConstructorDeclaration node) { 17081 Object visitConstructorDeclaration(ConstructorDeclaration node) {
15593 if (_immediateChild != node.parameters) { 17082 if (_immediateChild != node.parameters) {
15594 addParameters(node.parameters.parameters); 17083 addParameters(node.parameters.parameters);
15595 } 17084 }
15596 declaration = node; 17085 declaration = node;
15597 return null; 17086 return null;
15598 } 17087 }
17088
15599 Object visitFieldDeclaration(FieldDeclaration node) { 17089 Object visitFieldDeclaration(FieldDeclaration node) {
15600 declaration = node; 17090 declaration = node;
15601 return null; 17091 return null;
15602 } 17092 }
17093
15603 Object visitForEachStatement(ForEachStatement node) { 17094 Object visitForEachStatement(ForEachStatement node) {
15604 DeclaredIdentifier loopVariable = node.loopVariable; 17095 DeclaredIdentifier loopVariable = node.loopVariable;
15605 if (loopVariable != null) { 17096 if (loopVariable != null) {
15606 addToScope(loopVariable.identifier); 17097 addToScope(loopVariable.identifier);
15607 } 17098 }
15608 return super.visitForEachStatement(node); 17099 return super.visitForEachStatement(node);
15609 } 17100 }
17101
15610 Object visitForStatement(ForStatement node) { 17102 Object visitForStatement(ForStatement node) {
15611 if (_immediateChild != node.variables && node.variables != null) { 17103 if (_immediateChild != node.variables && node.variables != null) {
15612 addVariables(node.variables.variables); 17104 addVariables(node.variables.variables);
15613 } 17105 }
15614 return super.visitForStatement(node); 17106 return super.visitForStatement(node);
15615 } 17107 }
17108
15616 Object visitFunctionDeclaration(FunctionDeclaration node) { 17109 Object visitFunctionDeclaration(FunctionDeclaration node) {
15617 if (node.parent is! FunctionDeclarationStatement) { 17110 if (node.parent is! FunctionDeclarationStatement) {
15618 declaration = node; 17111 declaration = node;
15619 return null; 17112 return null;
15620 } 17113 }
15621 return super.visitFunctionDeclaration(node); 17114 return super.visitFunctionDeclaration(node);
15622 } 17115 }
17116
15623 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { 17117 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
15624 _referenceIsWithinLocalFunction = true; 17118 _referenceIsWithinLocalFunction = true;
15625 return super.visitFunctionDeclarationStatement(node); 17119 return super.visitFunctionDeclarationStatement(node);
15626 } 17120 }
17121
15627 Object visitFunctionExpression(FunctionExpression node) { 17122 Object visitFunctionExpression(FunctionExpression node) {
15628 if (node.parameters != null && _immediateChild != node.parameters) { 17123 if (node.parameters != null && _immediateChild != node.parameters) {
15629 addParameters(node.parameters.parameters); 17124 addParameters(node.parameters.parameters);
15630 } 17125 }
15631 return super.visitFunctionExpression(node); 17126 return super.visitFunctionExpression(node);
15632 } 17127 }
17128
15633 Object visitMethodDeclaration(MethodDeclaration node) { 17129 Object visitMethodDeclaration(MethodDeclaration node) {
15634 declaration = node; 17130 declaration = node;
15635 if (node.parameters == null) { 17131 if (node.parameters == null) {
15636 return null; 17132 return null;
15637 } 17133 }
15638 if (_immediateChild != node.parameters) { 17134 if (_immediateChild != node.parameters) {
15639 addParameters(node.parameters.parameters); 17135 addParameters(node.parameters.parameters);
15640 } 17136 }
15641 return null; 17137 return null;
15642 } 17138 }
17139
15643 Object visitNode(ASTNode node) { 17140 Object visitNode(ASTNode node) {
15644 _immediateChild = node; 17141 _immediateChild = node;
15645 ASTNode parent = node.parent; 17142 ASTNode parent = node.parent;
15646 if (parent != null) { 17143 if (parent != null) {
15647 parent.accept(this); 17144 parent.accept(this);
15648 } 17145 }
15649 return null; 17146 return null;
15650 } 17147 }
17148
15651 Object visitSwitchMember(SwitchMember node) { 17149 Object visitSwitchMember(SwitchMember node) {
15652 checkStatements(node.statements); 17150 checkStatements(node.statements);
15653 return super.visitSwitchMember(node); 17151 return super.visitSwitchMember(node);
15654 } 17152 }
17153
15655 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { 17154 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
15656 declaration = node; 17155 declaration = node;
15657 return null; 17156 return null;
15658 } 17157 }
17158
15659 Object visitTypeAlias(TypeAlias node) { 17159 Object visitTypeAlias(TypeAlias node) {
15660 declaration = node; 17160 declaration = node;
15661 return null; 17161 return null;
15662 } 17162 }
17163
15663 void addParameters(NodeList<FormalParameter> vars) { 17164 void addParameters(NodeList<FormalParameter> vars) {
15664 for (FormalParameter var2 in vars) { 17165 for (FormalParameter var2 in vars) {
15665 addToScope(var2.identifier); 17166 addToScope(var2.identifier);
15666 } 17167 }
15667 } 17168 }
17169
15668 void addToScope(SimpleIdentifier identifier) { 17170 void addToScope(SimpleIdentifier identifier) {
15669 if (identifier != null && isInRange(identifier)) { 17171 if (identifier != null && isInRange(identifier)) {
15670 String name = identifier.name; 17172 String name = identifier.name;
15671 if (!locals.containsKey(name)) { 17173 if (!locals.containsKey(name)) {
15672 locals[name] = identifier; 17174 locals[name] = identifier;
15673 } 17175 }
15674 } 17176 }
15675 } 17177 }
17178
15676 void addVariables(NodeList<VariableDeclaration> vars) { 17179 void addVariables(NodeList<VariableDeclaration> vars) {
15677 for (VariableDeclaration var2 in vars) { 17180 for (VariableDeclaration var2 in vars) {
15678 addToScope(var2.name); 17181 addToScope(var2.name);
15679 } 17182 }
15680 } 17183 }
15681 17184
15682 /** 17185 /**
15683 * Some statements define names that are visible downstream. There aren't many of these. 17186 * Some statements define names that are visible downstream. There aren't many of these.
15684 * 17187 *
15685 * @param statements the list of statements to check for name definitions 17188 * @param statements the list of statements to check for name definitions
15686 */ 17189 */
15687 void checkStatements(List<Statement> statements) { 17190 void checkStatements(List<Statement> statements) {
15688 for (Statement stmt in statements) { 17191 for (Statement stmt in statements) {
15689 if (identical(stmt, _immediateChild)) { 17192 if (identical(stmt, _immediateChild)) {
15690 return; 17193 return;
15691 } 17194 }
15692 if (stmt is VariableDeclarationStatement) { 17195 if (stmt is VariableDeclarationStatement) {
15693 addVariables(((stmt as VariableDeclarationStatement)).variables.variable s); 17196 addVariables((stmt as VariableDeclarationStatement).variables.variables) ;
15694 } else if (stmt is FunctionDeclarationStatement && !_referenceIsWithinLoca lFunction) { 17197 } else if (stmt is FunctionDeclarationStatement && !_referenceIsWithinLoca lFunction) {
15695 addToScope(((stmt as FunctionDeclarationStatement)).functionDeclaration. name); 17198 addToScope((stmt as FunctionDeclarationStatement).functionDeclaration.na me);
15696 } 17199 }
15697 } 17200 }
15698 } 17201 }
17202
15699 bool isInRange(ASTNode node) { 17203 bool isInRange(ASTNode node) {
15700 if (_position < 0) { 17204 if (_position < 0) {
15701 return true; 17205 return true;
15702 } 17206 }
15703 return node.end < _position; 17207 return node.end < _position;
15704 } 17208 }
15705 } 17209 }
15706 /** 17210 /**
15707 * Instances of the class {@code NodeList} represent a list of AST nodes that ha ve a common parent. 17211 * Instances of the class {@code NodeList} represent a list of AST nodes that ha ve a common parent.
15708 */ 17212 */
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
15828 void operator[]=(int index, E node) { 17332 void operator[]=(int index, E node) {
15829 if (index < 0 || index >= _elements.length) { 17333 if (index < 0 || index >= _elements.length) {
15830 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); 17334 throw new RangeError("Index: ${index}, Size: ${_elements.length}");
15831 } 17335 }
15832 _elements[index] as E; 17336 _elements[index] as E;
15833 owner.becomeParentOf(node); 17337 owner.becomeParentOf(node);
15834 _elements[index] = node; 17338 _elements[index] = node;
15835 } 17339 }
15836 int get length => _elements.length; 17340 int get length => _elements.length;
15837 } 17341 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698