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

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

Issue 730533003: Code clean-up and minor bug fix (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.ast; 8 library engine.ast;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 25 matching lines...) Expand all
36 * The strings that are implicitly concatenated. 36 * The strings that are implicitly concatenated.
37 */ 37 */
38 NodeList<StringLiteral> _strings; 38 NodeList<StringLiteral> _strings;
39 39
40 /** 40 /**
41 * Initialize a newly created list of adjacent strings. 41 * Initialize a newly created list of adjacent strings.
42 * 42 *
43 * @param strings the strings that are implicitly concatenated 43 * @param strings the strings that are implicitly concatenated
44 */ 44 */
45 AdjacentStrings(List<StringLiteral> strings) { 45 AdjacentStrings(List<StringLiteral> strings) {
46 this._strings = new NodeList<StringLiteral>(this); 46 _strings = new NodeList<StringLiteral>(this, strings);
47 this._strings.addAll(strings);
48 } 47 }
49 48
50 @override 49 @override
51 accept(AstVisitor visitor) => visitor.visitAdjacentStrings(this); 50 accept(AstVisitor visitor) => visitor.visitAdjacentStrings(this);
52 51
53 @override 52 @override
54 Token get beginToken => _strings.beginToken; 53 Token get beginToken => _strings.beginToken;
55 54
56 @override 55 @override
57 Token get endToken => _strings.endToken; 56 Token get endToken => _strings.endToken;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 */ 91 */
93 NodeList<Annotation> _metadata; 92 NodeList<Annotation> _metadata;
94 93
95 /** 94 /**
96 * Initialize a newly created node. 95 * Initialize a newly created node.
97 * 96 *
98 * @param comment the documentation comment associated with this node 97 * @param comment the documentation comment associated with this node
99 * @param metadata the annotations associated with this node 98 * @param metadata the annotations associated with this node
100 */ 99 */
101 AnnotatedNode(Comment comment, List<Annotation> metadata) { 100 AnnotatedNode(Comment comment, List<Annotation> metadata) {
102 this._metadata = new NodeList<Annotation>(this); 101 _comment = becomeParentOf(comment);
103 this._comment = becomeParentOf(comment); 102 _metadata = new NodeList<Annotation>(this, metadata);
104 this._metadata.addAll(metadata);
105 } 103 }
106 104
107 @override 105 @override
108 Token get beginToken { 106 Token get beginToken {
109 if (_comment == null) { 107 if (_comment == null) {
110 if (_metadata.isEmpty) { 108 if (_metadata.isEmpty) {
111 return firstTokenAfterCommentAndMetadata; 109 return firstTokenAfterCommentAndMetadata;
112 } else {
113 return _metadata.beginToken;
114 } 110 }
111 return _metadata.beginToken;
115 } else if (_metadata.isEmpty) { 112 } else if (_metadata.isEmpty) {
116 return _comment.beginToken; 113 return _comment.beginToken;
117 } 114 }
118 Token commentToken = _comment.beginToken; 115 Token commentToken = _comment.beginToken;
119 Token metadataToken = _metadata.beginToken; 116 Token metadataToken = _metadata.beginToken;
120 if (commentToken.offset < metadataToken.offset) { 117 if (commentToken.offset < metadataToken.offset) {
121 return commentToken; 118 return commentToken;
122 } 119 }
123 return metadataToken; 120 return metadataToken;
124 } 121 }
(...skipping 12 matching lines...) Expand all
137 * @return the annotations associated with this node 134 * @return the annotations associated with this node
138 */ 135 */
139 NodeList<Annotation> get metadata => _metadata; 136 NodeList<Annotation> get metadata => _metadata;
140 137
141 /** 138 /**
142 * Set the documentation comment associated with this node to the given commen t. 139 * Set the documentation comment associated with this node to the given commen t.
143 * 140 *
144 * @param comment the documentation comment to be associated with this node 141 * @param comment the documentation comment to be associated with this node
145 */ 142 */
146 void set documentationComment(Comment comment) { 143 void set documentationComment(Comment comment) {
147 this._comment = becomeParentOf(comment); 144 _comment = becomeParentOf(comment);
148 } 145 }
149 146
150 /** 147 /**
151 * Set the metadata associated with this node to the given metadata. 148 * Set the metadata associated with this node to the given metadata.
152 * 149 *
153 * @param metadata the metadata to be associated with this node 150 * @param metadata the metadata to be associated with this node
154 */ 151 */
155 void set metadata(List<Annotation> metadata) { 152 void set metadata(List<Annotation> metadata) {
156 this._metadata.clear(); 153 _metadata.clear();
157 this._metadata.addAll(metadata); 154 _metadata.addAll(metadata);
158 } 155 }
159 156
160 @override 157 @override
161 void visitChildren(AstVisitor visitor) { 158 void visitChildren(AstVisitor visitor) {
162 if (_commentIsBeforeAnnotations()) { 159 if (_commentIsBeforeAnnotations()) {
163 safelyVisitChild(_comment, visitor); 160 safelyVisitChild(_comment, visitor);
164 _metadata.accept(visitor); 161 _metadata.accept(visitor);
165 } else { 162 } else {
166 for (AstNode child in sortedCommentAndAnnotations) { 163 for (AstNode child in sortedCommentAndAnnotations) {
167 child.accept(visitor); 164 child.accept(visitor);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 * @param name the name of the class defining the constructor that is being in voked or the name of 261 * @param name the name of the class defining the constructor that is being in voked or the name of
265 * the field that is being referenced 262 * the field that is being referenced
266 * @param period the period before the constructor name, or `null` if this ann otation is not 263 * @param period the period before the constructor name, or `null` if this ann otation is not
267 * the invocation of a named constructor 264 * the invocation of a named constructor
268 * @param constructorName the name of the constructor being invoked, or `null` if this 265 * @param constructorName the name of the constructor being invoked, or `null` if this
269 * annotation is not the invocation of a named constructor 266 * annotation is not the invocation of a named constructor
270 * @param arguments the arguments to the constructor being invoked, or `null` if this 267 * @param arguments the arguments to the constructor being invoked, or `null` if this
271 * annotation is not the invocation of a constructor 268 * annotation is not the invocation of a constructor
272 */ 269 */
273 Annotation(this.atSign, Identifier name, this.period, SimpleIdentifier constru ctorName, ArgumentList arguments) { 270 Annotation(this.atSign, Identifier name, this.period, SimpleIdentifier constru ctorName, ArgumentList arguments) {
274 this._name = becomeParentOf(name); 271 _name = becomeParentOf(name);
275 this._constructorName = becomeParentOf(constructorName); 272 _constructorName = becomeParentOf(constructorName);
276 this._arguments = becomeParentOf(arguments); 273 _arguments = becomeParentOf(arguments);
277 } 274 }
278 275
279 @override 276 @override
280 accept(AstVisitor visitor) => visitor.visitAnnotation(this); 277 accept(AstVisitor visitor) => visitor.visitAnnotation(this);
281 278
282 /** 279 /**
283 * Return the arguments to the constructor being invoked, or `null` if this an notation is 280 * Return the arguments to the constructor being invoked, or `null` if this an notation is
284 * not the invocation of a constructor. 281 * not the invocation of a constructor.
285 * 282 *
286 * @return the arguments to the constructor being invoked 283 * @return the arguments to the constructor being invoked
(...skipping 13 matching lines...) Expand all
300 297
301 /** 298 /**
302 * Return the element associated with this annotation, or `null` if the AST st ructure has 299 * Return the element associated with this annotation, or `null` if the AST st ructure has
303 * not been resolved or if this annotation could not be resolved. 300 * not been resolved or if this annotation could not be resolved.
304 * 301 *
305 * @return the element associated with this annotation 302 * @return the element associated with this annotation
306 */ 303 */
307 Element get element { 304 Element get element {
308 if (_element != null) { 305 if (_element != null) {
309 return _element; 306 return _element;
310 } 307 } else if (_name != null) {
311 if (_name != null) {
312 return _name.staticElement; 308 return _name.staticElement;
313 } 309 }
314 return null; 310 return null;
315 } 311 }
316 312
317 @override 313 @override
318 Token get endToken { 314 Token get endToken {
319 if (_arguments != null) { 315 if (_arguments != null) {
320 return _arguments.endToken; 316 return _arguments.endToken;
321 } else if (_constructorName != null) { 317 } else if (_constructorName != null) {
322 return _constructorName.endToken; 318 return _constructorName.endToken;
323 } 319 }
324 return _name.endToken; 320 return _name.endToken;
325 } 321 }
326 322
327 /** 323 /**
328 * Return the name of the class defining the constructor that is being invoked or the name of the 324 * Return the name of the class defining the constructor that is being invoked or the name of the
329 * field that is being referenced. 325 * field that is being referenced.
330 * 326 *
331 * @return the name of the constructor being invoked or the name of the field being referenced 327 * @return the name of the constructor being invoked or the name of the field being referenced
332 */ 328 */
333 Identifier get name => _name; 329 Identifier get name => _name;
334 330
335 /** 331 /**
336 * Set the arguments to the constructor being invoked to the given arguments. 332 * Set the arguments to the constructor being invoked to the given arguments.
337 * 333 *
338 * @param arguments the arguments to the constructor being invoked 334 * @param arguments the arguments to the constructor being invoked
339 */ 335 */
340 void set arguments(ArgumentList arguments) { 336 void set arguments(ArgumentList arguments) {
341 this._arguments = becomeParentOf(arguments); 337 _arguments = becomeParentOf(arguments);
342 } 338 }
343 339
344 /** 340 /**
345 * Set the name of the constructor being invoked to the given name. 341 * Set the name of the constructor being invoked to the given name.
346 * 342 *
347 * @param constructorName the name of the constructor being invoked 343 * @param constructorName the name of the constructor being invoked
348 */ 344 */
349 void set constructorName(SimpleIdentifier constructorName) { 345 void set constructorName(SimpleIdentifier constructorName) {
350 this._constructorName = becomeParentOf(constructorName); 346 _constructorName = becomeParentOf(constructorName);
351 } 347 }
352 348
353 /** 349 /**
354 * Set the element associated with this annotation based. 350 * Set the element associated with this annotation based.
355 * 351 *
356 * @param element the element to be associated with this identifier 352 * @param element the element to be associated with this identifier
357 */ 353 */
358 void set element(Element element) { 354 void set element(Element element) {
359 this._element = element; 355 _element = element;
360 } 356 }
361 357
362 /** 358 /**
363 * Set the name of the class defining the constructor that is being invoked or the name of the 359 * Set the name of the class defining the constructor that is being invoked or the name of the
364 * field that is being referenced to the given name. 360 * field that is being referenced to the given name.
365 * 361 *
366 * @param name the name of the constructor being invoked or the name of the fi eld being referenced 362 * @param name the name of the constructor being invoked or the name of the fi eld being referenced
367 */ 363 */
368 void set name(Identifier name) { 364 void set name(Identifier name) {
369 this._name = becomeParentOf(name); 365 _name = becomeParentOf(name);
370 } 366 }
371 367
372 @override 368 @override
373 void visitChildren(AstVisitor visitor) { 369 void visitChildren(AstVisitor visitor) {
374 safelyVisitChild(_name, visitor); 370 safelyVisitChild(_name, visitor);
375 safelyVisitChild(_constructorName, visitor); 371 safelyVisitChild(_constructorName, visitor);
376 safelyVisitChild(_arguments, visitor); 372 safelyVisitChild(_arguments, visitor);
377 } 373 }
378 } 374 }
379 375
380 /** 376 /**
381 * Instances of the class `ArgumentList` represent a list of arguments in the in vocation of a 377 * Instances of the class `ArgumentList` represent a list of arguments in the in vocation of a
382 * executable element: a function, method, or constructor. 378 * executable element: a function, method, or constructor.
383 * 379 *
384 * <pre> 380 * <pre>
385 * argumentList ::= 381 * argumentList ::=
386 * '(' arguments? ')' 382 * '(' arguments? ')'
387 * 383 *
388 * arguments ::= 384 * arguments ::=
389 * [NamedExpression] (',' [NamedExpression])* 385 * [NamedExpression] (',' [NamedExpression])*
390 * | [Expression] (',' [NamedExpression])* 386 * | [Expression] (',' [NamedExpression])*
391 * </pre> 387 * </pre>
392 */ 388 */
393 class ArgumentList extends AstNode { 389 class ArgumentList extends AstNode {
394 /** 390 /**
395 * The left parenthesis. 391 * The left parenthesis.
396 */ 392 */
397 Token _leftParenthesis; 393 Token leftParenthesis;
398 394
399 /** 395 /**
400 * The expressions producing the values of the arguments. 396 * The expressions producing the values of the arguments.
401 */ 397 */
402 NodeList<Expression> _arguments; 398 NodeList<Expression> _arguments;
403 399
404 /** 400 /**
405 * The right parenthesis. 401 * The right parenthesis.
406 */ 402 */
407 Token _rightParenthesis; 403 Token rightParenthesis;
408 404
409 /** 405 /**
410 * An array containing the elements representing the parameters corresponding to each of the 406 * An array containing the elements representing the parameters corresponding to each of the
411 * arguments in this list, or `null` if the AST has not been resolved or if th e function or 407 * arguments in this list, or `null` if the AST has not been resolved or if th e function or
412 * method being invoked could not be determined based on static type informati on. The array must 408 * method being invoked could not be determined based on static type informati on. The array must
413 * be the same length as the number of arguments, but can contain `null` entri es if a given 409 * be the same length as the number of arguments, but can contain `null` entri es if a given
414 * argument does not correspond to a formal parameter. 410 * argument does not correspond to a formal parameter.
415 */ 411 */
416 List<ParameterElement> _correspondingStaticParameters; 412 List<ParameterElement> _correspondingStaticParameters;
417 413
418 /** 414 /**
419 * An array containing the elements representing the parameters corresponding to each of the 415 * An array containing the elements representing the parameters corresponding to each of the
420 * arguments in this list, or `null` if the AST has not been resolved or if th e function or 416 * arguments in this list, or `null` if the AST has not been resolved or if th e function or
421 * method being invoked could not be determined based on propagated type infor mation. The array 417 * method being invoked could not be determined based on propagated type infor mation. The array
422 * must be the same length as the number of arguments, but can contain `null` entries if a 418 * must be the same length as the number of arguments, but can contain `null` entries if a
423 * given argument does not correspond to a formal parameter. 419 * given argument does not correspond to a formal parameter.
424 */ 420 */
425 List<ParameterElement> _correspondingPropagatedParameters; 421 List<ParameterElement> _correspondingPropagatedParameters;
426 422
427 /** 423 /**
428 * Initialize a newly created list of arguments. 424 * Initialize a newly created list of arguments.
429 * 425 *
430 * @param leftParenthesis the left parenthesis 426 * @param leftParenthesis the left parenthesis
431 * @param arguments the expressions producing the values of the arguments 427 * @param arguments the expressions producing the values of the arguments
432 * @param rightParenthesis the right parenthesis 428 * @param rightParenthesis the right parenthesis
433 */ 429 */
434 ArgumentList(Token leftParenthesis, List<Expression> arguments, Token rightPar enthesis) { 430 ArgumentList(this.leftParenthesis, List<Expression> arguments, this.rightParen thesis) {
435 this._arguments = new NodeList<Expression>(this); 431 _arguments = new NodeList<Expression>(this, arguments);
436 this._leftParenthesis = leftParenthesis;
437 this._arguments.addAll(arguments);
438 this._rightParenthesis = rightParenthesis;
439 } 432 }
440 433
441 @override 434 @override
442 accept(AstVisitor visitor) => visitor.visitArgumentList(this); 435 accept(AstVisitor visitor) => visitor.visitArgumentList(this);
443 436
444 /** 437 /**
445 * Return the expressions producing the values of the arguments. Although the language requires 438 * Return the expressions producing the values of the arguments. Although the language requires
446 * that positional arguments appear before named arguments, this class allows them to be 439 * that positional arguments appear before named arguments, this class allows them to be
447 * intermixed. 440 * intermixed.
448 * 441 *
449 * @return the expressions producing the values of the arguments 442 * @return the expressions producing the values of the arguments
450 */ 443 */
451 NodeList<Expression> get arguments => _arguments; 444 NodeList<Expression> get arguments => _arguments;
452 445
453 @override 446 @override
454 Token get beginToken => _leftParenthesis; 447 Token get beginToken => leftParenthesis;
455 448
456 @override 449 @override
457 Token get endToken => _rightParenthesis; 450 Token get endToken => rightParenthesis;
458
459 /**
460 * Return the left parenthesis.
461 *
462 * @return the left parenthesis
463 */
464 Token get leftParenthesis => _leftParenthesis;
465
466 /**
467 * Return the right parenthesis.
468 *
469 * @return the right parenthesis
470 */
471 Token get rightParenthesis => _rightParenthesis;
472 451
473 /** 452 /**
474 * Set the parameter elements corresponding to each of the arguments in this l ist to the given 453 * Set the parameter elements corresponding to each of the arguments in this l ist to the given
475 * array of parameters. The array of parameters must be the same length as the number of 454 * array of parameters. The array of parameters must be the same length as the number of
476 * arguments, but can contain `null` entries if a given argument does not corr espond to a 455 * arguments, but can contain `null` entries if a given argument does not corr espond to a
477 * formal parameter. 456 * formal parameter.
478 * 457 *
479 * @param parameters the parameter elements corresponding to the arguments 458 * @param parameters the parameter elements corresponding to the arguments
480 */ 459 */
481 void set correspondingPropagatedParameters(List<ParameterElement> parameters) { 460 void set correspondingPropagatedParameters(List<ParameterElement> parameters) {
(...skipping 11 matching lines...) Expand all
493 * 472 *
494 * @param parameters the parameter elements corresponding to the arguments 473 * @param parameters the parameter elements corresponding to the arguments
495 */ 474 */
496 void set correspondingStaticParameters(List<ParameterElement> parameters) { 475 void set correspondingStaticParameters(List<ParameterElement> parameters) {
497 if (parameters.length != _arguments.length) { 476 if (parameters.length != _arguments.length) {
498 throw new IllegalArgumentException("Expected ${_arguments.length} paramete rs, not ${parameters.length}"); 477 throw new IllegalArgumentException("Expected ${_arguments.length} paramete rs, not ${parameters.length}");
499 } 478 }
500 _correspondingStaticParameters = parameters; 479 _correspondingStaticParameters = parameters;
501 } 480 }
502 481
503 /**
504 * Set the left parenthesis to the given token.
505 *
506 * @param parenthesis the left parenthesis
507 */
508 void set leftParenthesis(Token parenthesis) {
509 _leftParenthesis = parenthesis;
510 }
511
512 /**
513 * Set the right parenthesis to the given token.
514 *
515 * @param parenthesis the right parenthesis
516 */
517 void set rightParenthesis(Token parenthesis) {
518 _rightParenthesis = parenthesis;
519 }
520
521 @override 482 @override
522 void visitChildren(AstVisitor visitor) { 483 void visitChildren(AstVisitor visitor) {
523 _arguments.accept(visitor); 484 _arguments.accept(visitor);
524 } 485 }
525 486
526 /** 487 /**
527 * If the given expression is a child of this list, and the AST structure has been resolved, and 488 * If the given expression is a child of this list, and the AST structure has been resolved, and
528 * the function being invoked is known based on propagated type information, a nd the expression 489 * the function being invoked is known based on propagated type information, a nd the expression
529 * corresponds to one of the parameters of the function being invoked, then re turn the parameter 490 * corresponds to one of the parameters of the function being invoked, then re turn the parameter
530 * element representing the parameter to which the value of the given expressi on will be bound. 491 * element representing the parameter to which the value of the given expressi on will be bound.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 560
600 /** 561 /**
601 * The name of the type being cast to. 562 * The name of the type being cast to.
602 */ 563 */
603 TypeName _type; 564 TypeName _type;
604 565
605 /** 566 /**
606 * Initialize a newly created as expression. 567 * Initialize a newly created as expression.
607 * 568 *
608 * @param expression the expression used to compute the value being cast 569 * @param expression the expression used to compute the value being cast
609 * @param isOperator the is operator 570 * @param asOperator the as operator
610 * @param type the name of the type being cast to 571 * @param type the name of the type being cast to
611 */ 572 */
612 AsExpression(Expression expression, Token isOperator, TypeName type) { 573 AsExpression(Expression expression, this.asOperator, TypeName type) {
613 this._expression = becomeParentOf(expression); 574 _expression = becomeParentOf(expression);
614 this.asOperator = isOperator; 575 _type = becomeParentOf(type);
615 this._type = becomeParentOf(type);
616 } 576 }
617 577
618 @override 578 @override
619 accept(AstVisitor visitor) => visitor.visitAsExpression(this); 579 accept(AstVisitor visitor) => visitor.visitAsExpression(this);
620 580
621 @override 581 @override
622 Token get beginToken => _expression.beginToken; 582 Token get beginToken => _expression.beginToken;
623 583
624 @override 584 @override
625 Token get endToken => _type.endToken; 585 Token get endToken => _type.endToken;
(...skipping 14 matching lines...) Expand all
640 * @return the name of the type being cast to 600 * @return the name of the type being cast to
641 */ 601 */
642 TypeName get type => _type; 602 TypeName get type => _type;
643 603
644 /** 604 /**
645 * Set the expression used to compute the value being cast to the given expres sion. 605 * Set the expression used to compute the value being cast to the given expres sion.
646 * 606 *
647 * @param expression the expression used to compute the value being cast 607 * @param expression the expression used to compute the value being cast
648 */ 608 */
649 void set expression(Expression expression) { 609 void set expression(Expression expression) {
650 this._expression = becomeParentOf(expression); 610 _expression = becomeParentOf(expression);
651 } 611 }
652 612
653 /** 613 /**
654 * Set the name of the type being cast to to the given name. 614 * Set the name of the type being cast to to the given name.
655 * 615 *
656 * @param name the name of the type being cast to 616 * @param name the name of the type being cast to
657 */ 617 */
658 void set type(TypeName name) { 618 void set type(TypeName name) {
659 this._type = becomeParentOf(name); 619 _type = becomeParentOf(name);
660 } 620 }
661 621
662 @override 622 @override
663 void visitChildren(AstVisitor visitor) { 623 void visitChildren(AstVisitor visitor) {
664 safelyVisitChild(_expression, visitor); 624 safelyVisitChild(_expression, visitor);
665 safelyVisitChild(_type, visitor); 625 safelyVisitChild(_type, visitor);
666 } 626 }
667 } 627 }
668 628
669 /** 629 /**
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 /** 663 /**
704 * Initialize a newly created assert statement. 664 * Initialize a newly created assert statement.
705 * 665 *
706 * @param keyword the token representing the 'assert' keyword 666 * @param keyword the token representing the 'assert' keyword
707 * @param leftParenthesis the left parenthesis 667 * @param leftParenthesis the left parenthesis
708 * @param condition the condition that is being asserted to be `true` 668 * @param condition the condition that is being asserted to be `true`
709 * @param rightParenthesis the right parenthesis 669 * @param rightParenthesis the right parenthesis
710 * @param semicolon the semicolon terminating the statement 670 * @param semicolon the semicolon terminating the statement
711 */ 671 */
712 AssertStatement(this.keyword, this.leftParenthesis, Expression condition, this .rightParenthesis, this.semicolon) { 672 AssertStatement(this.keyword, this.leftParenthesis, Expression condition, this .rightParenthesis, this.semicolon) {
713 this._condition = becomeParentOf(condition); 673 _condition = becomeParentOf(condition);
714 } 674 }
715 675
716 @override 676 @override
717 accept(AstVisitor visitor) => visitor.visitAssertStatement(this); 677 accept(AstVisitor visitor) => visitor.visitAssertStatement(this);
718 678
719 @override 679 @override
720 Token get beginToken => keyword; 680 Token get beginToken => keyword;
721 681
722 /** 682 /**
723 * Return the condition that is being asserted to be `true`. 683 * Return the condition that is being asserted to be `true`.
724 * 684 *
725 * @return the condition that is being asserted to be `true` 685 * @return the condition that is being asserted to be `true`
726 */ 686 */
727 Expression get condition => _condition; 687 Expression get condition => _condition;
728 688
729 @override 689 @override
730 Token get endToken => semicolon; 690 Token get endToken => semicolon;
731 691
732 /** 692 /**
733 * Set the condition that is being asserted to be `true` to the given expressi on. 693 * Set the condition that is being asserted to be `true` to the given expressi on.
734 * 694 *
735 * @param the condition that is being asserted to be `true` 695 * @param the condition that is being asserted to be `true`
736 */ 696 */
737 void set condition(Expression condition) { 697 void set condition(Expression condition) {
738 this._condition = becomeParentOf(condition); 698 _condition = becomeParentOf(condition);
739 } 699 }
740 700
741 @override 701 @override
742 void visitChildren(AstVisitor visitor) { 702 void visitChildren(AstVisitor visitor) {
743 safelyVisitChild(_condition, visitor); 703 safelyVisitChild(_condition, visitor);
744 } 704 }
745 } 705 }
746 706
747 /** 707 /**
748 * Instances of the class `AssignmentExpression` represent an assignment express ion. 708 * Instances of the class `AssignmentExpression` represent an assignment express ion.
(...skipping 17 matching lines...) Expand all
766 /** 726 /**
767 * The expression used to compute the right hand side. 727 * The expression used to compute the right hand side.
768 */ 728 */
769 Expression _rightHandSide; 729 Expression _rightHandSide;
770 730
771 /** 731 /**
772 * The element associated with the operator based on the static type of the le ft-hand-side, or 732 * The element associated with the operator based on the static type of the le ft-hand-side, or
773 * `null` if the AST structure has not been resolved, if the operator is not a compound 733 * `null` if the AST structure has not been resolved, if the operator is not a compound
774 * operator, or if the operator could not be resolved. 734 * operator, or if the operator could not be resolved.
775 */ 735 */
776 MethodElement _staticElement; 736 MethodElement staticElement;
777 737
778 /** 738 /**
779 * The element associated with the operator based on the propagated type of th e left-hand-side, or 739 * The element associated with the operator based on the propagated type of th e left-hand-side, or
780 * `null` if the AST structure has not been resolved, if the operator is not a compound 740 * `null` if the AST structure has not been resolved, if the operator is not a compound
781 * operator, or if the operator could not be resolved. 741 * operator, or if the operator could not be resolved.
782 */ 742 */
783 MethodElement _propagatedElement; 743 MethodElement propagatedElement;
784 744
785 /** 745 /**
786 * Initialize a newly created assignment expression. 746 * Initialize a newly created assignment expression.
787 * 747 *
788 * @param leftHandSide the expression used to compute the left hand side 748 * @param leftHandSide the expression used to compute the left hand side
789 * @param operator the assignment operator being applied 749 * @param operator the assignment operator being applied
790 * @param rightHandSide the expression used to compute the right hand side 750 * @param rightHandSide the expression used to compute the right hand side
791 */ 751 */
792 AssignmentExpression(Expression leftHandSide, this.operator, Expression rightH andSide) { 752 AssignmentExpression(Expression leftHandSide, this.operator, Expression rightH andSide) {
793 if (leftHandSide == null || rightHandSide == null) { 753 if (leftHandSide == null || rightHandSide == null) {
794 String message; 754 String message;
795 if (leftHandSide == null) { 755 if (leftHandSide == null) {
796 if (rightHandSide == null) { 756 if (rightHandSide == null) {
797 message = "Both the left-hand and right-hand sides are null"; 757 message = "Both the left-hand and right-hand sides are null";
798 } else { 758 } else {
799 message = "The left-hand size is null"; 759 message = "The left-hand size is null";
800 } 760 }
801 } else { 761 } else {
802 message = "The right-hand size is null"; 762 message = "The right-hand size is null";
803 } 763 }
804 AnalysisEngine.instance.logger.logError( 764 AnalysisEngine.instance.logger.logError(
805 message, 765 message,
806 new CaughtException(new AnalysisException(message), null)); 766 new CaughtException(new AnalysisException(message), null));
807 } 767 }
808 this._leftHandSide = becomeParentOf(leftHandSide); 768 _leftHandSide = becomeParentOf(leftHandSide);
809 this._rightHandSide = becomeParentOf(rightHandSide); 769 _rightHandSide = becomeParentOf(rightHandSide);
810 } 770 }
811 771
812 @override 772 @override
813 accept(AstVisitor visitor) => visitor.visitAssignmentExpression(this); 773 accept(AstVisitor visitor) => visitor.visitAssignmentExpression(this);
814 774
815 @override 775 @override
816 Token get beginToken => _leftHandSide.beginToken; 776 Token get beginToken => _leftHandSide.beginToken;
817 777
818 /** 778 /**
819 * Return the best element available for this operator. If resolution was able to find a better 779 * Return the best element available for this operator. If resolution was able to find a better
(...skipping 18 matching lines...) Expand all
838 * Set the expression used to compute the left hand side to the given expressi on. 798 * Set the expression used to compute the left hand side to the given expressi on.
839 * 799 *
840 * @return the expression used to compute the left hand side 800 * @return the expression used to compute the left hand side
841 */ 801 */
842 Expression get leftHandSide => _leftHandSide; 802 Expression get leftHandSide => _leftHandSide;
843 803
844 @override 804 @override
845 int get precedence => 1; 805 int get precedence => 1;
846 806
847 /** 807 /**
848 * Return the element associated with the operator based on the propagated typ e of the
849 * left-hand-side, or `null` if the AST structure has not been resolved, if th e operator is
850 * not a compound operator, or if the operator could not be resolved. One exam ple of the latter
851 * case is an operator that is not defined for the type of the left-hand opera nd.
852 *
853 * @return the element associated with the operator
854 */
855 MethodElement get propagatedElement => _propagatedElement;
856
857 /**
858 * Return the expression used to compute the right hand side. 808 * Return the expression used to compute the right hand side.
859 * 809 *
860 * @return the expression used to compute the right hand side 810 * @return the expression used to compute the right hand side
861 */ 811 */
862 Expression get rightHandSide => _rightHandSide; 812 Expression get rightHandSide => _rightHandSide;
863 813
864 /** 814 /**
865 * Return the element associated with the operator based on the static type of the left-hand-side,
866 * or `null` if the AST structure has not been resolved, if the operator is no t a compound
867 * operator, or if the operator could not be resolved. One example of the latt er case is an
868 * operator that is not defined for the type of the left-hand operand.
869 *
870 * @return the element associated with the operator
871 */
872 MethodElement get staticElement => _staticElement;
873
874 /**
875 * Return the expression used to compute the left hand side. 815 * Return the expression used to compute the left hand side.
876 * 816 *
877 * @param expression the expression used to compute the left hand side 817 * @param expression the expression used to compute the left hand side
878 */ 818 */
879 void set leftHandSide(Expression expression) { 819 void set leftHandSide(Expression expression) {
880 _leftHandSide = becomeParentOf(expression); 820 _leftHandSide = becomeParentOf(expression);
881 } 821 }
882 822
883 /** 823 /**
884 * Set the element associated with the operator based on the propagated type o f the left-hand-side
885 * to the given element.
886 *
887 * @param element the element to be associated with the operator
888 */
889 void set propagatedElement(MethodElement element) {
890 _propagatedElement = element;
891 }
892
893 /**
894 * Set the expression used to compute the left hand side to the given expressi on. 824 * Set the expression used to compute the left hand side to the given expressi on.
895 * 825 *
896 * @param expression the expression used to compute the left hand side 826 * @param expression the expression used to compute the left hand side
897 */ 827 */
898 void set rightHandSide(Expression expression) { 828 void set rightHandSide(Expression expression) {
899 _rightHandSide = becomeParentOf(expression); 829 _rightHandSide = becomeParentOf(expression);
900 } 830 }
901 831
902 /**
903 * Set the element associated with the operator based on the static type of th e left-hand-side to
904 * the given element.
905 *
906 * @param element the static element to be associated with the operator
907 */
908 void set staticElement(MethodElement element) {
909 _staticElement = element;
910 }
911
912 @override 832 @override
913 void visitChildren(AstVisitor visitor) { 833 void visitChildren(AstVisitor visitor) {
914 safelyVisitChild(_leftHandSide, visitor); 834 safelyVisitChild(_leftHandSide, visitor);
915 safelyVisitChild(_rightHandSide, visitor); 835 safelyVisitChild(_rightHandSide, visitor);
916 } 836 }
917 837
918 /** 838 /**
919 * If the AST structure has been resolved, and the function being invoked is k nown based on 839 * If the AST structure has been resolved, and the function being invoked is k nown based on
920 * propagated type information, then return the parameter element representing the parameter to 840 * propagated type information, then return the parameter element representing the parameter to
921 * which the value of the right operand will be bound. Otherwise, return `null `. 841 * which the value of the right operand will be bound. Otherwise, return `null `.
922 * 842 *
923 * This method is only intended to be used by [Expression.propagatedParameterE lement]. 843 * This method is only intended to be used by [Expression.propagatedParameterE lement].
924 * 844 *
925 * @return the parameter element representing the parameter to which the value of the right 845 * @return the parameter element representing the parameter to which the value of the right
926 * operand will be bound 846 * operand will be bound
927 */ 847 */
928 ParameterElement get propagatedParameterElementForRightHandSide { 848 ParameterElement get propagatedParameterElementForRightHandSide {
929 ExecutableElement executableElement = null; 849 ExecutableElement executableElement = null;
930 if (_propagatedElement != null) { 850 if (propagatedElement != null) {
931 executableElement = _propagatedElement; 851 executableElement = propagatedElement;
932 } else { 852 } else {
933 if (_leftHandSide is Identifier) { 853 if (_leftHandSide is Identifier) {
934 Identifier identifier = _leftHandSide as Identifier; 854 Identifier identifier = _leftHandSide as Identifier;
935 Element leftElement = identifier.propagatedElement; 855 Element leftElement = identifier.propagatedElement;
936 if (leftElement is ExecutableElement) { 856 if (leftElement is ExecutableElement) {
937 executableElement = leftElement; 857 executableElement = leftElement;
938 } 858 }
939 } 859 }
940 if (_leftHandSide is PropertyAccess) { 860 if (_leftHandSide is PropertyAccess) {
941 SimpleIdentifier identifier = (_leftHandSide as PropertyAccess).property Name; 861 SimpleIdentifier identifier = (_leftHandSide as PropertyAccess).property Name;
(...skipping 18 matching lines...) Expand all
960 * type information, then return the parameter element representing the parame ter to which the 880 * type information, then return the parameter element representing the parame ter to which the
961 * value of the right operand will be bound. Otherwise, return `null`. 881 * value of the right operand will be bound. Otherwise, return `null`.
962 * 882 *
963 * This method is only intended to be used by [Expression.staticParameterEleme nt]. 883 * This method is only intended to be used by [Expression.staticParameterEleme nt].
964 * 884 *
965 * @return the parameter element representing the parameter to which the value of the right 885 * @return the parameter element representing the parameter to which the value of the right
966 * operand will be bound 886 * operand will be bound
967 */ 887 */
968 ParameterElement get staticParameterElementForRightHandSide { 888 ParameterElement get staticParameterElementForRightHandSide {
969 ExecutableElement executableElement = null; 889 ExecutableElement executableElement = null;
970 if (_staticElement != null) { 890 if (staticElement != null) {
971 executableElement = _staticElement; 891 executableElement = staticElement;
972 } else { 892 } else {
973 if (_leftHandSide is Identifier) { 893 if (_leftHandSide is Identifier) {
974 Element leftElement = (_leftHandSide as Identifier).staticElement; 894 Element leftElement = (_leftHandSide as Identifier).staticElement;
975 if (leftElement is ExecutableElement) { 895 if (leftElement is ExecutableElement) {
976 executableElement = leftElement; 896 executableElement = leftElement;
977 } 897 }
978 } 898 }
979 if (_leftHandSide is PropertyAccess) { 899 if (_leftHandSide is PropertyAccess) {
980 Element leftElement = (_leftHandSide as PropertyAccess).propertyName.sta ticElement; 900 Element leftElement = (_leftHandSide as PropertyAccess).propertyName.sta ticElement;
981 if (leftElement is ExecutableElement) { 901 if (leftElement is ExecutableElement) {
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 } 1843 }
1924 1844
1925 /** 1845 /**
1926 * The AST node with which the node being visited is to be compared. This is o nly valid at the 1846 * The AST node with which the node being visited is to be compared. This is o nly valid at the
1927 * beginning of each visit method (until [isEqualNodes] is invoked). 1847 * beginning of each visit method (until [isEqualNodes] is invoked).
1928 */ 1848 */
1929 AstNode _other; 1849 AstNode _other;
1930 1850
1931 @override 1851 @override
1932 bool visitAdjacentStrings(AdjacentStrings node) { 1852 bool visitAdjacentStrings(AdjacentStrings node) {
1933 AdjacentStrings other = this._other as AdjacentStrings; 1853 AdjacentStrings other = _other as AdjacentStrings;
1934 return _isEqualNodeLists(node.strings, other.strings); 1854 return _isEqualNodeLists(node.strings, other.strings);
1935 } 1855 }
1936 1856
1937 @override 1857 @override
1938 bool visitAnnotation(Annotation node) { 1858 bool visitAnnotation(Annotation node) {
1939 Annotation other = this._other as Annotation; 1859 Annotation other = _other as Annotation;
1940 return isEqualTokens(node.atSign, other.atSign) && isEqualNodes(node.name, o ther.name) && isEqualTokens(node.period, other.period) && isEqualNodes(node.cons tructorName, other.constructorName) && isEqualNodes(node.arguments, other.argume nts); 1860 return isEqualTokens(node.atSign, other.atSign) && isEqualNodes(node.name, o ther.name) && isEqualTokens(node.period, other.period) && isEqualNodes(node.cons tructorName, other.constructorName) && isEqualNodes(node.arguments, other.argume nts);
1941 } 1861 }
1942 1862
1943 @override 1863 @override
1944 bool visitArgumentList(ArgumentList node) { 1864 bool visitArgumentList(ArgumentList node) {
1945 ArgumentList other = this._other as ArgumentList; 1865 ArgumentList other = _other as ArgumentList;
1946 return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && _isEqua lNodeLists(node.arguments, other.arguments) && isEqualTokens(node.rightParenthes is, other.rightParenthesis); 1866 return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && _isEqua lNodeLists(node.arguments, other.arguments) && isEqualTokens(node.rightParenthes is, other.rightParenthesis);
1947 } 1867 }
1948 1868
1949 @override 1869 @override
1950 bool visitAsExpression(AsExpression node) { 1870 bool visitAsExpression(AsExpression node) {
1951 AsExpression other = this._other as AsExpression; 1871 AsExpression other = _other as AsExpression;
1952 return isEqualNodes(node.expression, other.expression) && isEqualTokens(node .asOperator, other.asOperator) && isEqualNodes(node.type, other.type); 1872 return isEqualNodes(node.expression, other.expression) && isEqualTokens(node .asOperator, other.asOperator) && isEqualNodes(node.type, other.type);
1953 } 1873 }
1954 1874
1955 @override 1875 @override
1956 bool visitAssertStatement(AssertStatement node) { 1876 bool visitAssertStatement(AssertStatement node) {
1957 AssertStatement other = this._other as AssertStatement; 1877 AssertStatement other = _other as AssertStatement;
1958 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.left Parenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condit ion) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualT okens(node.semicolon, other.semicolon); 1878 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.left Parenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condit ion) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualT okens(node.semicolon, other.semicolon);
1959 } 1879 }
1960 1880
1961 @override 1881 @override
1962 bool visitAssignmentExpression(AssignmentExpression node) { 1882 bool visitAssignmentExpression(AssignmentExpression node) {
1963 AssignmentExpression other = this._other as AssignmentExpression; 1883 AssignmentExpression other = _other as AssignmentExpression;
1964 return isEqualNodes(node.leftHandSide, other.leftHandSide) && isEqualTokens( node.operator, other.operator) && isEqualNodes(node.rightHandSide, other.rightHa ndSide); 1884 return isEqualNodes(node.leftHandSide, other.leftHandSide) && isEqualTokens( node.operator, other.operator) && isEqualNodes(node.rightHandSide, other.rightHa ndSide);
1965 } 1885 }
1966 1886
1967 @override 1887 @override
1968 bool visitAwaitExpression(AwaitExpression node) { 1888 bool visitAwaitExpression(AwaitExpression node) {
1969 AwaitExpression other = this._other as AwaitExpression; 1889 AwaitExpression other = _other as AwaitExpression;
1970 return isEqualTokens(node.awaitKeyword, other.awaitKeyword) && isEqualNodes( node.expression, other.expression); 1890 return isEqualTokens(node.awaitKeyword, other.awaitKeyword) && isEqualNodes( node.expression, other.expression);
1971 } 1891 }
1972 1892
1973 @override 1893 @override
1974 bool visitBinaryExpression(BinaryExpression node) { 1894 bool visitBinaryExpression(BinaryExpression node) {
1975 BinaryExpression other = this._other as BinaryExpression; 1895 BinaryExpression other = _other as BinaryExpression;
1976 return isEqualNodes(node.leftOperand, other.leftOperand) && isEqualTokens(no de.operator, other.operator) && isEqualNodes(node.rightOperand, other.rightOpera nd); 1896 return isEqualNodes(node.leftOperand, other.leftOperand) && isEqualTokens(no de.operator, other.operator) && isEqualNodes(node.rightOperand, other.rightOpera nd);
1977 } 1897 }
1978 1898
1979 @override 1899 @override
1980 bool visitBlock(Block node) { 1900 bool visitBlock(Block node) {
1981 Block other = this._other as Block; 1901 Block other = _other as Block;
1982 return isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLis ts(node.statements, other.statements) && isEqualTokens(node.rightBracket, other. rightBracket); 1902 return isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLis ts(node.statements, other.statements) && isEqualTokens(node.rightBracket, other. rightBracket);
1983 } 1903 }
1984 1904
1985 @override 1905 @override
1986 bool visitBlockFunctionBody(BlockFunctionBody node) { 1906 bool visitBlockFunctionBody(BlockFunctionBody node) {
1987 BlockFunctionBody other = this._other as BlockFunctionBody; 1907 BlockFunctionBody other = _other as BlockFunctionBody;
1988 return isEqualNodes(node.block, other.block); 1908 return isEqualNodes(node.block, other.block);
1989 } 1909 }
1990 1910
1991 @override 1911 @override
1992 bool visitBooleanLiteral(BooleanLiteral node) { 1912 bool visitBooleanLiteral(BooleanLiteral node) {
1993 BooleanLiteral other = this._other as BooleanLiteral; 1913 BooleanLiteral other = _other as BooleanLiteral;
1994 return isEqualTokens(node.literal, other.literal) && node.value == other.val ue; 1914 return isEqualTokens(node.literal, other.literal) && node.value == other.val ue;
1995 } 1915 }
1996 1916
1997 @override 1917 @override
1998 bool visitBreakStatement(BreakStatement node) { 1918 bool visitBreakStatement(BreakStatement node) {
1999 BreakStatement other = this._other as BreakStatement; 1919 BreakStatement other = _other as BreakStatement;
2000 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.label , other.label) && isEqualTokens(node.semicolon, other.semicolon); 1920 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.label , other.label) && isEqualTokens(node.semicolon, other.semicolon);
2001 } 1921 }
2002 1922
2003 @override 1923 @override
2004 bool visitCascadeExpression(CascadeExpression node) { 1924 bool visitCascadeExpression(CascadeExpression node) {
2005 CascadeExpression other = this._other as CascadeExpression; 1925 CascadeExpression other = _other as CascadeExpression;
2006 return isEqualNodes(node.target, other.target) && _isEqualNodeLists(node.cas cadeSections, other.cascadeSections); 1926 return isEqualNodes(node.target, other.target) && _isEqualNodeLists(node.cas cadeSections, other.cascadeSections);
2007 } 1927 }
2008 1928
2009 @override 1929 @override
2010 bool visitCatchClause(CatchClause node) { 1930 bool visitCatchClause(CatchClause node) {
2011 CatchClause other = this._other as CatchClause; 1931 CatchClause other = _other as CatchClause;
2012 return isEqualTokens(node.onKeyword, other.onKeyword) && isEqualNodes(node.e xceptionType, other.exceptionType) && isEqualTokens(node.catchKeyword, other.cat chKeyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEq ualNodes(node.exceptionParameter, other.exceptionParameter) && isEqualTokens(nod e.comma, other.comma) && isEqualNodes(node.stackTraceParameter, other.stackTrace Parameter) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && is EqualNodes(node.body, other.body); 1932 return isEqualTokens(node.onKeyword, other.onKeyword) && isEqualNodes(node.e xceptionType, other.exceptionType) && isEqualTokens(node.catchKeyword, other.cat chKeyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEq ualNodes(node.exceptionParameter, other.exceptionParameter) && isEqualTokens(nod e.comma, other.comma) && isEqualNodes(node.stackTraceParameter, other.stackTrace Parameter) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && is EqualNodes(node.body, other.body);
2013 } 1933 }
2014 1934
2015 @override 1935 @override
2016 bool visitClassDeclaration(ClassDeclaration node) { 1936 bool visitClassDeclaration(ClassDeclaration node) {
2017 ClassDeclaration other = this._other as ClassDeclaration; 1937 ClassDeclaration other = _other as ClassDeclaration;
2018 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.abstrac tKeyword, other.abstractKeyword) && isEqualTokens(node.classKeyword, other.class Keyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.typeParamet ers, other.typeParameters) && isEqualNodes(node.extendsClause, other.extendsClau se) && isEqualNodes(node.withClause, other.withClause) && isEqualNodes(node.impl ementsClause, other.implementsClause) && isEqualTokens(node.leftBracket, other.l eftBracket) && _isEqualNodeLists(node.members, other.members) && isEqualTokens(n ode.rightBracket, other.rightBracket); 1938 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.abstrac tKeyword, other.abstractKeyword) && isEqualTokens(node.classKeyword, other.class Keyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.typeParamet ers, other.typeParameters) && isEqualNodes(node.extendsClause, other.extendsClau se) && isEqualNodes(node.withClause, other.withClause) && isEqualNodes(node.impl ementsClause, other.implementsClause) && isEqualTokens(node.leftBracket, other.l eftBracket) && _isEqualNodeLists(node.members, other.members) && isEqualTokens(n ode.rightBracket, other.rightBracket);
2019 } 1939 }
2020 1940
2021 @override 1941 @override
2022 bool visitClassTypeAlias(ClassTypeAlias node) { 1942 bool visitClassTypeAlias(ClassTypeAlias node) {
2023 ClassTypeAlias other = this._other as ClassTypeAlias; 1943 ClassTypeAlias other = _other as ClassTypeAlias;
2024 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.typ eParameters, other.typeParameters) && isEqualTokens(node.equals, other.equals) & & isEqualTokens(node.abstractKeyword, other.abstractKeyword) && isEqualNodes(nod e.superclass, other.superclass) && isEqualNodes(node.withClause, other.withClaus e) && isEqualNodes(node.implementsClause, other.implementsClause) && isEqualToke ns(node.semicolon, other.semicolon); 1944 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.typ eParameters, other.typeParameters) && isEqualTokens(node.equals, other.equals) & & isEqualTokens(node.abstractKeyword, other.abstractKeyword) && isEqualNodes(nod e.superclass, other.superclass) && isEqualNodes(node.withClause, other.withClaus e) && isEqualNodes(node.implementsClause, other.implementsClause) && isEqualToke ns(node.semicolon, other.semicolon);
2025 } 1945 }
2026 1946
2027 @override 1947 @override
2028 bool visitComment(Comment node) { 1948 bool visitComment(Comment node) {
2029 Comment other = this._other as Comment; 1949 Comment other = _other as Comment;
2030 return _isEqualNodeLists(node.references, other.references); 1950 return _isEqualNodeLists(node.references, other.references);
2031 } 1951 }
2032 1952
2033 @override 1953 @override
2034 bool visitCommentReference(CommentReference node) { 1954 bool visitCommentReference(CommentReference node) {
2035 CommentReference other = this._other as CommentReference; 1955 CommentReference other = _other as CommentReference;
2036 return isEqualTokens(node.newKeyword, other.newKeyword) && isEqualNodes(node .identifier, other.identifier); 1956 return isEqualTokens(node.newKeyword, other.newKeyword) && isEqualNodes(node .identifier, other.identifier);
2037 } 1957 }
2038 1958
2039 @override 1959 @override
2040 bool visitCompilationUnit(CompilationUnit node) { 1960 bool visitCompilationUnit(CompilationUnit node) {
2041 CompilationUnit other = this._other as CompilationUnit; 1961 CompilationUnit other = _other as CompilationUnit;
2042 return isEqualTokens(node.beginToken, other.beginToken) && isEqualNodes(node .scriptTag, other.scriptTag) && _isEqualNodeLists(node.directives, other.directi ves) && _isEqualNodeLists(node.declarations, other.declarations) && isEqualToken s(node.endToken, other.endToken); 1962 return isEqualTokens(node.beginToken, other.beginToken) && isEqualNodes(node .scriptTag, other.scriptTag) && _isEqualNodeLists(node.directives, other.directi ves) && _isEqualNodeLists(node.declarations, other.declarations) && isEqualToken s(node.endToken, other.endToken);
2043 } 1963 }
2044 1964
2045 @override 1965 @override
2046 bool visitConditionalExpression(ConditionalExpression node) { 1966 bool visitConditionalExpression(ConditionalExpression node) {
2047 ConditionalExpression other = this._other as ConditionalExpression; 1967 ConditionalExpression other = _other as ConditionalExpression;
2048 return isEqualNodes(node.condition, other.condition) && isEqualTokens(node.q uestion, other.question) && isEqualNodes(node.thenExpression, other.thenExpressi on) && isEqualTokens(node.colon, other.colon) && isEqualNodes(node.elseExpressio n, other.elseExpression); 1968 return isEqualNodes(node.condition, other.condition) && isEqualTokens(node.q uestion, other.question) && isEqualNodes(node.thenExpression, other.thenExpressi on) && isEqualTokens(node.colon, other.colon) && isEqualNodes(node.elseExpressio n, other.elseExpression);
2049 } 1969 }
2050 1970
2051 @override 1971 @override
2052 bool visitConstructorDeclaration(ConstructorDeclaration node) { 1972 bool visitConstructorDeclaration(ConstructorDeclaration node) {
2053 ConstructorDeclaration other = this._other as ConstructorDeclaration; 1973 ConstructorDeclaration other = _other as ConstructorDeclaration;
2054 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.externa lKeyword, other.externalKeyword) && isEqualTokens(node.constKeyword, other.const Keyword) && isEqualTokens(node.factoryKeyword, other.factoryKeyword) && isEqualN odes(node.returnType, other.returnType) && isEqualTokens(node.period, other.peri od) && isEqualNodes(node.name, other.name) && isEqualNodes(node.parameters, othe r.parameters) && isEqualTokens(node.separator, other.separator) && _isEqualNodeL ists(node.initializers, other.initializers) && isEqualNodes(node.redirectedConst ructor, other.redirectedConstructor) && isEqualNodes(node.body, other.body); 1974 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.externa lKeyword, other.externalKeyword) && isEqualTokens(node.constKeyword, other.const Keyword) && isEqualTokens(node.factoryKeyword, other.factoryKeyword) && isEqualN odes(node.returnType, other.returnType) && isEqualTokens(node.period, other.peri od) && isEqualNodes(node.name, other.name) && isEqualNodes(node.parameters, othe r.parameters) && isEqualTokens(node.separator, other.separator) && _isEqualNodeL ists(node.initializers, other.initializers) && isEqualNodes(node.redirectedConst ructor, other.redirectedConstructor) && isEqualNodes(node.body, other.body);
2055 } 1975 }
2056 1976
2057 @override 1977 @override
2058 bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) { 1978 bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
2059 ConstructorFieldInitializer other = this._other as ConstructorFieldInitializ er; 1979 ConstructorFieldInitializer other = _other as ConstructorFieldInitializer;
2060 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.peri od, other.period) && isEqualNodes(node.fieldName, other.fieldName) && isEqualTok ens(node.equals, other.equals) && isEqualNodes(node.expression, other.expression ); 1980 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.peri od, other.period) && isEqualNodes(node.fieldName, other.fieldName) && isEqualTok ens(node.equals, other.equals) && isEqualNodes(node.expression, other.expression );
2061 } 1981 }
2062 1982
2063 @override 1983 @override
2064 bool visitConstructorName(ConstructorName node) { 1984 bool visitConstructorName(ConstructorName node) {
2065 ConstructorName other = this._other as ConstructorName; 1985 ConstructorName other = _other as ConstructorName;
2066 return isEqualNodes(node.type, other.type) && isEqualTokens(node.period, oth er.period) && isEqualNodes(node.name, other.name); 1986 return isEqualNodes(node.type, other.type) && isEqualTokens(node.period, oth er.period) && isEqualNodes(node.name, other.name);
2067 } 1987 }
2068 1988
2069 @override 1989 @override
2070 bool visitContinueStatement(ContinueStatement node) { 1990 bool visitContinueStatement(ContinueStatement node) {
2071 ContinueStatement other = this._other as ContinueStatement; 1991 ContinueStatement other = _other as ContinueStatement;
2072 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.label , other.label) && isEqualTokens(node.semicolon, other.semicolon); 1992 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.label , other.label) && isEqualTokens(node.semicolon, other.semicolon);
2073 } 1993 }
2074 1994
2075 @override 1995 @override
2076 bool visitDeclaredIdentifier(DeclaredIdentifier node) { 1996 bool visitDeclaredIdentifier(DeclaredIdentifier node) {
2077 DeclaredIdentifier other = this._other as DeclaredIdentifier; 1997 DeclaredIdentifier other = _other as DeclaredIdentifier;
2078 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.type, other.type) && isEqualNodes(node.ide ntifier, other.identifier); 1998 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.type, other.type) && isEqualNodes(node.ide ntifier, other.identifier);
2079 } 1999 }
2080 2000
2081 @override 2001 @override
2082 bool visitDefaultFormalParameter(DefaultFormalParameter node) { 2002 bool visitDefaultFormalParameter(DefaultFormalParameter node) {
2083 DefaultFormalParameter other = this._other as DefaultFormalParameter; 2003 DefaultFormalParameter other = _other as DefaultFormalParameter;
2084 return isEqualNodes(node.parameter, other.parameter) && node.kind == other.k ind && isEqualTokens(node.separator, other.separator) && isEqualNodes(node.defau ltValue, other.defaultValue); 2004 return isEqualNodes(node.parameter, other.parameter) && node.kind == other.k ind && isEqualTokens(node.separator, other.separator) && isEqualNodes(node.defau ltValue, other.defaultValue);
2085 } 2005 }
2086 2006
2087 @override 2007 @override
2088 bool visitDoStatement(DoStatement node) { 2008 bool visitDoStatement(DoStatement node) {
2089 DoStatement other = this._other as DoStatement; 2009 DoStatement other = _other as DoStatement;
2090 return isEqualTokens(node.doKeyword, other.doKeyword) && isEqualNodes(node.b ody, other.body) && isEqualTokens(node.whileKeyword, other.whileKeyword) && isEq ualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.cond ition, other.condition) && isEqualTokens(node.rightParenthesis, other.rightParen thesis) && isEqualTokens(node.semicolon, other.semicolon); 2010 return isEqualTokens(node.doKeyword, other.doKeyword) && isEqualNodes(node.b ody, other.body) && isEqualTokens(node.whileKeyword, other.whileKeyword) && isEq ualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.cond ition, other.condition) && isEqualTokens(node.rightParenthesis, other.rightParen thesis) && isEqualTokens(node.semicolon, other.semicolon);
2091 } 2011 }
2092 2012
2093 @override 2013 @override
2094 bool visitDoubleLiteral(DoubleLiteral node) { 2014 bool visitDoubleLiteral(DoubleLiteral node) {
2095 DoubleLiteral other = this._other as DoubleLiteral; 2015 DoubleLiteral other = _other as DoubleLiteral;
2096 return isEqualTokens(node.literal, other.literal) && node.value == other.val ue; 2016 return isEqualTokens(node.literal, other.literal) && node.value == other.val ue;
2097 } 2017 }
2098 2018
2099 @override 2019 @override
2100 bool visitEmptyFunctionBody(EmptyFunctionBody node) { 2020 bool visitEmptyFunctionBody(EmptyFunctionBody node) {
2101 EmptyFunctionBody other = this._other as EmptyFunctionBody; 2021 EmptyFunctionBody other = _other as EmptyFunctionBody;
2102 return isEqualTokens(node.semicolon, other.semicolon); 2022 return isEqualTokens(node.semicolon, other.semicolon);
2103 } 2023 }
2104 2024
2105 @override 2025 @override
2106 bool visitEmptyStatement(EmptyStatement node) { 2026 bool visitEmptyStatement(EmptyStatement node) {
2107 EmptyStatement other = this._other as EmptyStatement; 2027 EmptyStatement other = _other as EmptyStatement;
2108 return isEqualTokens(node.semicolon, other.semicolon); 2028 return isEqualTokens(node.semicolon, other.semicolon);
2109 } 2029 }
2110 2030
2111 @override 2031 @override
2112 bool visitEnumConstantDeclaration(EnumConstantDeclaration node) { 2032 bool visitEnumConstantDeclaration(EnumConstantDeclaration node) {
2113 EnumConstantDeclaration other = this._other as EnumConstantDeclaration; 2033 EnumConstantDeclaration other = _other as EnumConstantDeclaration;
2114 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, ot her.name); 2034 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, ot her.name);
2115 } 2035 }
2116 2036
2117 @override 2037 @override
2118 bool visitEnumDeclaration(EnumDeclaration node) { 2038 bool visitEnumDeclaration(EnumDeclaration node) {
2119 EnumDeclaration other = this._other as EnumDeclaration; 2039 EnumDeclaration other = _other as EnumDeclaration;
2120 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.name, other.name) && isEqualTokens(node.le ftBracket, other.leftBracket) && _isEqualNodeLists(node.constants, other.constan ts) && isEqualTokens(node.rightBracket, other.rightBracket); 2040 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.name, other.name) && isEqualTokens(node.le ftBracket, other.leftBracket) && _isEqualNodeLists(node.constants, other.constan ts) && isEqualTokens(node.rightBracket, other.rightBracket);
2121 } 2041 }
2122 2042
2123 @override 2043 @override
2124 bool visitExportDirective(ExportDirective node) { 2044 bool visitExportDirective(ExportDirective node) {
2125 ExportDirective other = this._other as ExportDirective; 2045 ExportDirective other = _other as ExportDirective;
2126 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.uri, other.uri) && _isEqualNodeLists(node. combinators, other.combinators) && isEqualTokens(node.semicolon, other.semicolon ); 2046 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.uri, other.uri) && _isEqualNodeLists(node. combinators, other.combinators) && isEqualTokens(node.semicolon, other.semicolon );
2127 } 2047 }
2128 2048
2129 @override 2049 @override
2130 bool visitExpressionFunctionBody(ExpressionFunctionBody node) { 2050 bool visitExpressionFunctionBody(ExpressionFunctionBody node) {
2131 ExpressionFunctionBody other = this._other as ExpressionFunctionBody; 2051 ExpressionFunctionBody other = _other as ExpressionFunctionBody;
2132 return isEqualTokens(node.functionDefinition, other.functionDefinition) && i sEqualNodes(node.expression, other.expression) && isEqualTokens(node.semicolon, other.semicolon); 2052 return isEqualTokens(node.functionDefinition, other.functionDefinition) && i sEqualNodes(node.expression, other.expression) && isEqualTokens(node.semicolon, other.semicolon);
2133 } 2053 }
2134 2054
2135 @override 2055 @override
2136 bool visitExpressionStatement(ExpressionStatement node) { 2056 bool visitExpressionStatement(ExpressionStatement node) {
2137 ExpressionStatement other = this._other as ExpressionStatement; 2057 ExpressionStatement other = _other as ExpressionStatement;
2138 return isEqualNodes(node.expression, other.expression) && isEqualTokens(node .semicolon, other.semicolon); 2058 return isEqualNodes(node.expression, other.expression) && isEqualTokens(node .semicolon, other.semicolon);
2139 } 2059 }
2140 2060
2141 @override 2061 @override
2142 bool visitExtendsClause(ExtendsClause node) { 2062 bool visitExtendsClause(ExtendsClause node) {
2143 ExtendsClause other = this._other as ExtendsClause; 2063 ExtendsClause other = _other as ExtendsClause;
2144 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.super class, other.superclass); 2064 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.super class, other.superclass);
2145 } 2065 }
2146 2066
2147 @override 2067 @override
2148 bool visitFieldDeclaration(FieldDeclaration node) { 2068 bool visitFieldDeclaration(FieldDeclaration node) {
2149 FieldDeclaration other = this._other as FieldDeclaration; 2069 FieldDeclaration other = _other as FieldDeclaration;
2150 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.staticK eyword, other.staticKeyword) && isEqualNodes(node.fields, other.fields) && isEqu alTokens(node.semicolon, other.semicolon); 2070 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.staticK eyword, other.staticKeyword) && isEqualNodes(node.fields, other.fields) && isEqu alTokens(node.semicolon, other.semicolon);
2151 } 2071 }
2152 2072
2153 @override 2073 @override
2154 bool visitFieldFormalParameter(FieldFormalParameter node) { 2074 bool visitFieldFormalParameter(FieldFormalParameter node) {
2155 FieldFormalParameter other = this._other as FieldFormalParameter; 2075 FieldFormalParameter other = _other as FieldFormalParameter;
2156 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.type, other.type) && isEqualTokens(node.th isToken, other.thisToken) && isEqualTokens(node.period, other.period) && isEqual Nodes(node.identifier, other.identifier); 2076 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.type, other.type) && isEqualTokens(node.th isToken, other.thisToken) && isEqualTokens(node.period, other.period) && isEqual Nodes(node.identifier, other.identifier);
2157 } 2077 }
2158 2078
2159 @override 2079 @override
2160 bool visitForEachStatement(ForEachStatement node) { 2080 bool visitForEachStatement(ForEachStatement node) {
2161 ForEachStatement other = this._other as ForEachStatement; 2081 ForEachStatement other = _other as ForEachStatement;
2162 return isEqualTokens(node.forKeyword, other.forKeyword) && isEqualTokens(nod e.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.loopVariable, oth er.loopVariable) && isEqualTokens(node.inKeyword, other.inKeyword) && isEqualNod es(node.iterable, other.iterable) && isEqualTokens(node.rightParenthesis, other. rightParenthesis) && isEqualNodes(node.body, other.body); 2082 return isEqualTokens(node.forKeyword, other.forKeyword) && isEqualTokens(nod e.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.loopVariable, oth er.loopVariable) && isEqualTokens(node.inKeyword, other.inKeyword) && isEqualNod es(node.iterable, other.iterable) && isEqualTokens(node.rightParenthesis, other. rightParenthesis) && isEqualNodes(node.body, other.body);
2163 } 2083 }
2164 2084
2165 @override 2085 @override
2166 bool visitFormalParameterList(FormalParameterList node) { 2086 bool visitFormalParameterList(FormalParameterList node) {
2167 FormalParameterList other = this._other as FormalParameterList; 2087 FormalParameterList other = _other as FormalParameterList;
2168 return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && _isEqua lNodeLists(node.parameters, other.parameters) && isEqualTokens(node.leftDelimite r, other.leftDelimiter) && isEqualTokens(node.rightDelimiter, other.rightDelimit er) && isEqualTokens(node.rightParenthesis, other.rightParenthesis); 2088 return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && _isEqua lNodeLists(node.parameters, other.parameters) && isEqualTokens(node.leftDelimite r, other.leftDelimiter) && isEqualTokens(node.rightDelimiter, other.rightDelimit er) && isEqualTokens(node.rightParenthesis, other.rightParenthesis);
2169 } 2089 }
2170 2090
2171 @override 2091 @override
2172 bool visitForStatement(ForStatement node) { 2092 bool visitForStatement(ForStatement node) {
2173 ForStatement other = this._other as ForStatement; 2093 ForStatement other = _other as ForStatement;
2174 return isEqualTokens(node.forKeyword, other.forKeyword) && isEqualTokens(nod e.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.variables, other. variables) && isEqualNodes(node.initialization, other.initialization) && isEqual Tokens(node.leftSeparator, other.leftSeparator) && isEqualNodes(node.condition, other.condition) && isEqualTokens(node.rightSeparator, other.rightSeparator) && _isEqualNodeLists(node.updaters, other.updaters) && isEqualTokens(node.rightPare nthesis, other.rightParenthesis) && isEqualNodes(node.body, other.body); 2094 return isEqualTokens(node.forKeyword, other.forKeyword) && isEqualTokens(nod e.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.variables, other. variables) && isEqualNodes(node.initialization, other.initialization) && isEqual Tokens(node.leftSeparator, other.leftSeparator) && isEqualNodes(node.condition, other.condition) && isEqualTokens(node.rightSeparator, other.rightSeparator) && _isEqualNodeLists(node.updaters, other.updaters) && isEqualTokens(node.rightPare nthesis, other.rightParenthesis) && isEqualNodes(node.body, other.body);
2175 } 2095 }
2176 2096
2177 @override 2097 @override
2178 bool visitFunctionDeclaration(FunctionDeclaration node) { 2098 bool visitFunctionDeclaration(FunctionDeclaration node) {
2179 FunctionDeclaration other = this._other as FunctionDeclaration; 2099 FunctionDeclaration other = _other as FunctionDeclaration;
2180 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.externa lKeyword, other.externalKeyword) && isEqualNodes(node.returnType, other.returnTy pe) && isEqualTokens(node.propertyKeyword, other.propertyKeyword) && isEqualNode s(node.name, other.name) && isEqualNodes(node.functionExpression, other.function Expression); 2100 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.externa lKeyword, other.externalKeyword) && isEqualNodes(node.returnType, other.returnTy pe) && isEqualTokens(node.propertyKeyword, other.propertyKeyword) && isEqualNode s(node.name, other.name) && isEqualNodes(node.functionExpression, other.function Expression);
2181 } 2101 }
2182 2102
2183 @override 2103 @override
2184 bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { 2104 bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
2185 FunctionDeclarationStatement other = this._other as FunctionDeclarationState ment; 2105 FunctionDeclarationStatement other = _other as FunctionDeclarationStatement;
2186 return isEqualNodes(node.functionDeclaration, other.functionDeclaration); 2106 return isEqualNodes(node.functionDeclaration, other.functionDeclaration);
2187 } 2107 }
2188 2108
2189 @override 2109 @override
2190 bool visitFunctionExpression(FunctionExpression node) { 2110 bool visitFunctionExpression(FunctionExpression node) {
2191 FunctionExpression other = this._other as FunctionExpression; 2111 FunctionExpression other = _other as FunctionExpression;
2192 return isEqualNodes(node.parameters, other.parameters) && isEqualNodes(node. body, other.body); 2112 return isEqualNodes(node.parameters, other.parameters) && isEqualNodes(node. body, other.body);
2193 } 2113 }
2194 2114
2195 @override 2115 @override
2196 bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { 2116 bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
2197 FunctionExpressionInvocation other = this._other as FunctionExpressionInvoca tion; 2117 FunctionExpressionInvocation other = _other as FunctionExpressionInvocation;
2198 return isEqualNodes(node.function, other.function) && isEqualNodes(node.argu mentList, other.argumentList); 2118 return isEqualNodes(node.function, other.function) && isEqualNodes(node.argu mentList, other.argumentList);
2199 } 2119 }
2200 2120
2201 @override 2121 @override
2202 bool visitFunctionTypeAlias(FunctionTypeAlias node) { 2122 bool visitFunctionTypeAlias(FunctionTypeAlias node) {
2203 FunctionTypeAlias other = this._other as FunctionTypeAlias; 2123 FunctionTypeAlias other = _other as FunctionTypeAlias;
2204 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.returnType, other.returnType) && isEqualNo des(node.name, other.name) && isEqualNodes(node.typeParameters, other.typeParame ters) && isEqualNodes(node.parameters, other.parameters) && isEqualTokens(node.s emicolon, other.semicolon); 2124 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.returnType, other.returnType) && isEqualNo des(node.name, other.name) && isEqualNodes(node.typeParameters, other.typeParame ters) && isEqualNodes(node.parameters, other.parameters) && isEqualTokens(node.s emicolon, other.semicolon);
2205 } 2125 }
2206 2126
2207 @override 2127 @override
2208 bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { 2128 bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
2209 FunctionTypedFormalParameter other = this._other as FunctionTypedFormalParam eter; 2129 FunctionTypedFormalParameter other = _other as FunctionTypedFormalParameter;
2210 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.returnTy pe, other.returnType) && isEqualNodes(node.identifier, other.identifier) && isEq ualNodes(node.parameters, other.parameters); 2130 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.returnTy pe, other.returnType) && isEqualNodes(node.identifier, other.identifier) && isEq ualNodes(node.parameters, other.parameters);
2211 } 2131 }
2212 2132
2213 @override 2133 @override
2214 bool visitHideCombinator(HideCombinator node) { 2134 bool visitHideCombinator(HideCombinator node) {
2215 HideCombinator other = this._other as HideCombinator; 2135 HideCombinator other = _other as HideCombinator;
2216 return isEqualTokens(node.keyword, other.keyword) && _isEqualNodeLists(node. hiddenNames, other.hiddenNames); 2136 return isEqualTokens(node.keyword, other.keyword) && _isEqualNodeLists(node. hiddenNames, other.hiddenNames);
2217 } 2137 }
2218 2138
2219 @override 2139 @override
2220 bool visitIfStatement(IfStatement node) { 2140 bool visitIfStatement(IfStatement node) {
2221 IfStatement other = this._other as IfStatement; 2141 IfStatement other = _other as IfStatement;
2222 return isEqualTokens(node.ifKeyword, other.ifKeyword) && isEqualTokens(node. leftParenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.co ndition) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEq ualNodes(node.thenStatement, other.thenStatement) && isEqualTokens(node.elseKeyw ord, other.elseKeyword) && isEqualNodes(node.elseStatement, other.elseStatement) ; 2142 return isEqualTokens(node.ifKeyword, other.ifKeyword) && isEqualTokens(node. leftParenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.co ndition) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEq ualNodes(node.thenStatement, other.thenStatement) && isEqualTokens(node.elseKeyw ord, other.elseKeyword) && isEqualNodes(node.elseStatement, other.elseStatement) ;
2223 } 2143 }
2224 2144
2225 @override 2145 @override
2226 bool visitImplementsClause(ImplementsClause node) { 2146 bool visitImplementsClause(ImplementsClause node) {
2227 ImplementsClause other = this._other as ImplementsClause; 2147 ImplementsClause other = _other as ImplementsClause;
2228 return isEqualTokens(node.keyword, other.keyword) && _isEqualNodeLists(node. interfaces, other.interfaces); 2148 return isEqualTokens(node.keyword, other.keyword) && _isEqualNodeLists(node. interfaces, other.interfaces);
2229 } 2149 }
2230 2150
2231 @override 2151 @override
2232 bool visitImportDirective(ImportDirective node) { 2152 bool visitImportDirective(ImportDirective node) {
2233 ImportDirective other = this._other as ImportDirective; 2153 ImportDirective other = _other as ImportDirective;
2234 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.uri, other.uri) && isEqualTokens(node.asTo ken, other.asToken) && isEqualNodes(node.prefix, other.prefix) && _isEqualNodeLi sts(node.combinators, other.combinators) && isEqualTokens(node.semicolon, other. semicolon); 2154 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.uri, other.uri) && isEqualTokens(node.asTo ken, other.asToken) && isEqualNodes(node.prefix, other.prefix) && _isEqualNodeLi sts(node.combinators, other.combinators) && isEqualTokens(node.semicolon, other. semicolon);
2235 } 2155 }
2236 2156
2237 @override 2157 @override
2238 bool visitIndexExpression(IndexExpression node) { 2158 bool visitIndexExpression(IndexExpression node) {
2239 IndexExpression other = this._other as IndexExpression; 2159 IndexExpression other = _other as IndexExpression;
2240 return isEqualNodes(node.target, other.target) && isEqualTokens(node.leftBra cket, other.leftBracket) && isEqualNodes(node.index, other.index) && isEqualToke ns(node.rightBracket, other.rightBracket); 2160 return isEqualNodes(node.target, other.target) && isEqualTokens(node.leftBra cket, other.leftBracket) && isEqualNodes(node.index, other.index) && isEqualToke ns(node.rightBracket, other.rightBracket);
2241 } 2161 }
2242 2162
2243 @override 2163 @override
2244 bool visitInstanceCreationExpression(InstanceCreationExpression node) { 2164 bool visitInstanceCreationExpression(InstanceCreationExpression node) {
2245 InstanceCreationExpression other = this._other as InstanceCreationExpression ; 2165 InstanceCreationExpression other = _other as InstanceCreationExpression;
2246 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.const ructorName, other.constructorName) && isEqualNodes(node.argumentList, other.argu mentList); 2166 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.const ructorName, other.constructorName) && isEqualNodes(node.argumentList, other.argu mentList);
2247 } 2167 }
2248 2168
2249 @override 2169 @override
2250 bool visitIntegerLiteral(IntegerLiteral node) { 2170 bool visitIntegerLiteral(IntegerLiteral node) {
2251 IntegerLiteral other = this._other as IntegerLiteral; 2171 IntegerLiteral other = _other as IntegerLiteral;
2252 return isEqualTokens(node.literal, other.literal) && (node.value == other.va lue); 2172 return isEqualTokens(node.literal, other.literal) && (node.value == other.va lue);
2253 } 2173 }
2254 2174
2255 @override 2175 @override
2256 bool visitInterpolationExpression(InterpolationExpression node) { 2176 bool visitInterpolationExpression(InterpolationExpression node) {
2257 InterpolationExpression other = this._other as InterpolationExpression; 2177 InterpolationExpression other = _other as InterpolationExpression;
2258 return isEqualTokens(node.leftBracket, other.leftBracket) && isEqualNodes(no de.expression, other.expression) && isEqualTokens(node.rightBracket, other.right Bracket); 2178 return isEqualTokens(node.leftBracket, other.leftBracket) && isEqualNodes(no de.expression, other.expression) && isEqualTokens(node.rightBracket, other.right Bracket);
2259 } 2179 }
2260 2180
2261 @override 2181 @override
2262 bool visitInterpolationString(InterpolationString node) { 2182 bool visitInterpolationString(InterpolationString node) {
2263 InterpolationString other = this._other as InterpolationString; 2183 InterpolationString other = _other as InterpolationString;
2264 return isEqualTokens(node.contents, other.contents) && node.value == other.v alue; 2184 return isEqualTokens(node.contents, other.contents) && node.value == other.v alue;
2265 } 2185 }
2266 2186
2267 @override 2187 @override
2268 bool visitIsExpression(IsExpression node) { 2188 bool visitIsExpression(IsExpression node) {
2269 IsExpression other = this._other as IsExpression; 2189 IsExpression other = _other as IsExpression;
2270 return isEqualNodes(node.expression, other.expression) && isEqualTokens(node .isOperator, other.isOperator) && isEqualTokens(node.notOperator, other.notOpera tor) && isEqualNodes(node.type, other.type); 2190 return isEqualNodes(node.expression, other.expression) && isEqualTokens(node .isOperator, other.isOperator) && isEqualTokens(node.notOperator, other.notOpera tor) && isEqualNodes(node.type, other.type);
2271 } 2191 }
2272 2192
2273 @override 2193 @override
2274 bool visitLabel(Label node) { 2194 bool visitLabel(Label node) {
2275 Label other = this._other as Label; 2195 Label other = _other as Label;
2276 return isEqualNodes(node.label, other.label) && isEqualTokens(node.colon, ot her.colon); 2196 return isEqualNodes(node.label, other.label) && isEqualTokens(node.colon, ot her.colon);
2277 } 2197 }
2278 2198
2279 @override 2199 @override
2280 bool visitLabeledStatement(LabeledStatement node) { 2200 bool visitLabeledStatement(LabeledStatement node) {
2281 LabeledStatement other = this._other as LabeledStatement; 2201 LabeledStatement other = _other as LabeledStatement;
2282 return _isEqualNodeLists(node.labels, other.labels) && isEqualNodes(node.sta tement, other.statement); 2202 return _isEqualNodeLists(node.labels, other.labels) && isEqualNodes(node.sta tement, other.statement);
2283 } 2203 }
2284 2204
2285 @override 2205 @override
2286 bool visitLibraryDirective(LibraryDirective node) { 2206 bool visitLibraryDirective(LibraryDirective node) {
2287 LibraryDirective other = this._other as LibraryDirective; 2207 LibraryDirective other = _other as LibraryDirective;
2288 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.library Token, other.libraryToken) && isEqualNodes(node.name, other.name) && isEqualToke ns(node.semicolon, other.semicolon); 2208 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.library Token, other.libraryToken) && isEqualNodes(node.name, other.name) && isEqualToke ns(node.semicolon, other.semicolon);
2289 } 2209 }
2290 2210
2291 @override 2211 @override
2292 bool visitLibraryIdentifier(LibraryIdentifier node) { 2212 bool visitLibraryIdentifier(LibraryIdentifier node) {
2293 LibraryIdentifier other = this._other as LibraryIdentifier; 2213 LibraryIdentifier other = _other as LibraryIdentifier;
2294 return _isEqualNodeLists(node.components, other.components); 2214 return _isEqualNodeLists(node.components, other.components);
2295 } 2215 }
2296 2216
2297 @override 2217 @override
2298 bool visitListLiteral(ListLiteral node) { 2218 bool visitListLiteral(ListLiteral node) {
2299 ListLiteral other = this._other as ListLiteral; 2219 ListLiteral other = _other as ListLiteral;
2300 return isEqualTokens(node.constKeyword, other.constKeyword) && isEqualNodes( node.typeArguments, other.typeArguments) && isEqualTokens(node.leftBracket, othe r.leftBracket) && _isEqualNodeLists(node.elements, other.elements) && isEqualTok ens(node.rightBracket, other.rightBracket); 2220 return isEqualTokens(node.constKeyword, other.constKeyword) && isEqualNodes( node.typeArguments, other.typeArguments) && isEqualTokens(node.leftBracket, othe r.leftBracket) && _isEqualNodeLists(node.elements, other.elements) && isEqualTok ens(node.rightBracket, other.rightBracket);
2301 } 2221 }
2302 2222
2303 @override 2223 @override
2304 bool visitMapLiteral(MapLiteral node) { 2224 bool visitMapLiteral(MapLiteral node) {
2305 MapLiteral other = this._other as MapLiteral; 2225 MapLiteral other = _other as MapLiteral;
2306 return isEqualTokens(node.constKeyword, other.constKeyword) && isEqualNodes( node.typeArguments, other.typeArguments) && isEqualTokens(node.leftBracket, othe r.leftBracket) && _isEqualNodeLists(node.entries, other.entries) && isEqualToken s(node.rightBracket, other.rightBracket); 2226 return isEqualTokens(node.constKeyword, other.constKeyword) && isEqualNodes( node.typeArguments, other.typeArguments) && isEqualTokens(node.leftBracket, othe r.leftBracket) && _isEqualNodeLists(node.entries, other.entries) && isEqualToken s(node.rightBracket, other.rightBracket);
2307 } 2227 }
2308 2228
2309 @override 2229 @override
2310 bool visitMapLiteralEntry(MapLiteralEntry node) { 2230 bool visitMapLiteralEntry(MapLiteralEntry node) {
2311 MapLiteralEntry other = this._other as MapLiteralEntry; 2231 MapLiteralEntry other = _other as MapLiteralEntry;
2312 return isEqualNodes(node.key, other.key) && isEqualTokens(node.separator, ot her.separator) && isEqualNodes(node.value, other.value); 2232 return isEqualNodes(node.key, other.key) && isEqualTokens(node.separator, ot her.separator) && isEqualNodes(node.value, other.value);
2313 } 2233 }
2314 2234
2315 @override 2235 @override
2316 bool visitMethodDeclaration(MethodDeclaration node) { 2236 bool visitMethodDeclaration(MethodDeclaration node) {
2317 MethodDeclaration other = this._other as MethodDeclaration; 2237 MethodDeclaration other = _other as MethodDeclaration;
2318 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.externa lKeyword, other.externalKeyword) && isEqualTokens(node.modifierKeyword, other.mo difierKeyword) && isEqualNodes(node.returnType, other.returnType) && isEqualToke ns(node.propertyKeyword, other.propertyKeyword) && isEqualTokens(node.propertyKe yword, other.propertyKeyword) && isEqualNodes(node.name, other.name) && isEqualN odes(node.parameters, other.parameters) && isEqualNodes(node.body, other.body); 2238 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.externa lKeyword, other.externalKeyword) && isEqualTokens(node.modifierKeyword, other.mo difierKeyword) && isEqualNodes(node.returnType, other.returnType) && isEqualToke ns(node.propertyKeyword, other.propertyKeyword) && isEqualTokens(node.propertyKe yword, other.propertyKeyword) && isEqualNodes(node.name, other.name) && isEqualN odes(node.parameters, other.parameters) && isEqualNodes(node.body, other.body);
2319 } 2239 }
2320 2240
2321 @override 2241 @override
2322 bool visitMethodInvocation(MethodInvocation node) { 2242 bool visitMethodInvocation(MethodInvocation node) {
2323 MethodInvocation other = this._other as MethodInvocation; 2243 MethodInvocation other = _other as MethodInvocation;
2324 return isEqualNodes(node.target, other.target) && isEqualTokens(node.period, other.period) && isEqualNodes(node.methodName, other.methodName) && isEqualNode s(node.argumentList, other.argumentList); 2244 return isEqualNodes(node.target, other.target) && isEqualTokens(node.period, other.period) && isEqualNodes(node.methodName, other.methodName) && isEqualNode s(node.argumentList, other.argumentList);
2325 } 2245 }
2326 2246
2327 @override 2247 @override
2328 bool visitNamedExpression(NamedExpression node) { 2248 bool visitNamedExpression(NamedExpression node) {
2329 NamedExpression other = this._other as NamedExpression; 2249 NamedExpression other = _other as NamedExpression;
2330 return isEqualNodes(node.name, other.name) && isEqualNodes(node.expression, other.expression); 2250 return isEqualNodes(node.name, other.name) && isEqualNodes(node.expression, other.expression);
2331 } 2251 }
2332 2252
2333 @override 2253 @override
2334 bool visitNativeClause(NativeClause node) { 2254 bool visitNativeClause(NativeClause node) {
2335 NativeClause other = this._other as NativeClause; 2255 NativeClause other = _other as NativeClause;
2336 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.name, other.name); 2256 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.name, other.name);
2337 } 2257 }
2338 2258
2339 @override 2259 @override
2340 bool visitNativeFunctionBody(NativeFunctionBody node) { 2260 bool visitNativeFunctionBody(NativeFunctionBody node) {
2341 NativeFunctionBody other = this._other as NativeFunctionBody; 2261 NativeFunctionBody other = _other as NativeFunctionBody;
2342 return isEqualTokens(node.nativeToken, other.nativeToken) && isEqualNodes(no de.stringLiteral, other.stringLiteral) && isEqualTokens(node.semicolon, other.se micolon); 2262 return isEqualTokens(node.nativeToken, other.nativeToken) && isEqualNodes(no de.stringLiteral, other.stringLiteral) && isEqualTokens(node.semicolon, other.se micolon);
2343 } 2263 }
2344 2264
2345 @override 2265 @override
2346 bool visitNullLiteral(NullLiteral node) { 2266 bool visitNullLiteral(NullLiteral node) {
2347 NullLiteral other = this._other as NullLiteral; 2267 NullLiteral other = _other as NullLiteral;
2348 return isEqualTokens(node.literal, other.literal); 2268 return isEqualTokens(node.literal, other.literal);
2349 } 2269 }
2350 2270
2351 @override 2271 @override
2352 bool visitParenthesizedExpression(ParenthesizedExpression node) { 2272 bool visitParenthesizedExpression(ParenthesizedExpression node) {
2353 ParenthesizedExpression other = this._other as ParenthesizedExpression; 2273 ParenthesizedExpression other = _other as ParenthesizedExpression;
2354 return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqual Nodes(node.expression, other.expression) && isEqualTokens(node.rightParenthesis, other.rightParenthesis); 2274 return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqual Nodes(node.expression, other.expression) && isEqualTokens(node.rightParenthesis, other.rightParenthesis);
2355 } 2275 }
2356 2276
2357 @override 2277 @override
2358 bool visitPartDirective(PartDirective node) { 2278 bool visitPartDirective(PartDirective node) {
2359 PartDirective other = this._other as PartDirective; 2279 PartDirective other = _other as PartDirective;
2360 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.partTok en, other.partToken) && isEqualNodes(node.uri, other.uri) && isEqualTokens(node. semicolon, other.semicolon); 2280 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.partTok en, other.partToken) && isEqualNodes(node.uri, other.uri) && isEqualTokens(node. semicolon, other.semicolon);
2361 } 2281 }
2362 2282
2363 @override 2283 @override
2364 bool visitPartOfDirective(PartOfDirective node) { 2284 bool visitPartOfDirective(PartOfDirective node) {
2365 PartOfDirective other = this._other as PartOfDirective; 2285 PartOfDirective other = _other as PartOfDirective;
2366 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.partTok en, other.partToken) && isEqualTokens(node.ofToken, other.ofToken) && isEqualNod es(node.libraryName, other.libraryName) && isEqualTokens(node.semicolon, other.s emicolon); 2286 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.partTok en, other.partToken) && isEqualTokens(node.ofToken, other.ofToken) && isEqualNod es(node.libraryName, other.libraryName) && isEqualTokens(node.semicolon, other.s emicolon);
2367 } 2287 }
2368 2288
2369 @override 2289 @override
2370 bool visitPostfixExpression(PostfixExpression node) { 2290 bool visitPostfixExpression(PostfixExpression node) {
2371 PostfixExpression other = this._other as PostfixExpression; 2291 PostfixExpression other = _other as PostfixExpression;
2372 return isEqualNodes(node.operand, other.operand) && isEqualTokens(node.opera tor, other.operator); 2292 return isEqualNodes(node.operand, other.operand) && isEqualTokens(node.opera tor, other.operator);
2373 } 2293 }
2374 2294
2375 @override 2295 @override
2376 bool visitPrefixedIdentifier(PrefixedIdentifier node) { 2296 bool visitPrefixedIdentifier(PrefixedIdentifier node) {
2377 PrefixedIdentifier other = this._other as PrefixedIdentifier; 2297 PrefixedIdentifier other = _other as PrefixedIdentifier;
2378 return isEqualNodes(node.prefix, other.prefix) && isEqualTokens(node.period, other.period) && isEqualNodes(node.identifier, other.identifier); 2298 return isEqualNodes(node.prefix, other.prefix) && isEqualTokens(node.period, other.period) && isEqualNodes(node.identifier, other.identifier);
2379 } 2299 }
2380 2300
2381 @override 2301 @override
2382 bool visitPrefixExpression(PrefixExpression node) { 2302 bool visitPrefixExpression(PrefixExpression node) {
2383 PrefixExpression other = this._other as PrefixExpression; 2303 PrefixExpression other = _other as PrefixExpression;
2384 return isEqualTokens(node.operator, other.operator) && isEqualNodes(node.ope rand, other.operand); 2304 return isEqualTokens(node.operator, other.operator) && isEqualNodes(node.ope rand, other.operand);
2385 } 2305 }
2386 2306
2387 @override 2307 @override
2388 bool visitPropertyAccess(PropertyAccess node) { 2308 bool visitPropertyAccess(PropertyAccess node) {
2389 PropertyAccess other = this._other as PropertyAccess; 2309 PropertyAccess other = _other as PropertyAccess;
2390 return isEqualNodes(node.target, other.target) && isEqualTokens(node.operato r, other.operator) && isEqualNodes(node.propertyName, other.propertyName); 2310 return isEqualNodes(node.target, other.target) && isEqualTokens(node.operato r, other.operator) && isEqualNodes(node.propertyName, other.propertyName);
2391 } 2311 }
2392 2312
2393 @override 2313 @override
2394 bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation no de) { 2314 bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation no de) {
2395 RedirectingConstructorInvocation other = this._other as RedirectingConstruct orInvocation; 2315 RedirectingConstructorInvocation other = _other as RedirectingConstructorInv ocation;
2396 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.peri od, other.period) && isEqualNodes(node.constructorName, other.constructorName) & & isEqualNodes(node.argumentList, other.argumentList); 2316 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.peri od, other.period) && isEqualNodes(node.constructorName, other.constructorName) & & isEqualNodes(node.argumentList, other.argumentList);
2397 } 2317 }
2398 2318
2399 @override 2319 @override
2400 bool visitRethrowExpression(RethrowExpression node) { 2320 bool visitRethrowExpression(RethrowExpression node) {
2401 RethrowExpression other = this._other as RethrowExpression; 2321 RethrowExpression other = _other as RethrowExpression;
2402 return isEqualTokens(node.keyword, other.keyword); 2322 return isEqualTokens(node.keyword, other.keyword);
2403 } 2323 }
2404 2324
2405 @override 2325 @override
2406 bool visitReturnStatement(ReturnStatement node) { 2326 bool visitReturnStatement(ReturnStatement node) {
2407 ReturnStatement other = this._other as ReturnStatement; 2327 ReturnStatement other = _other as ReturnStatement;
2408 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.expre ssion, other.expression) && isEqualTokens(node.semicolon, other.semicolon); 2328 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.expre ssion, other.expression) && isEqualTokens(node.semicolon, other.semicolon);
2409 } 2329 }
2410 2330
2411 @override 2331 @override
2412 bool visitScriptTag(ScriptTag node) { 2332 bool visitScriptTag(ScriptTag node) {
2413 ScriptTag other = this._other as ScriptTag; 2333 ScriptTag other = _other as ScriptTag;
2414 return isEqualTokens(node.scriptTag, other.scriptTag); 2334 return isEqualTokens(node.scriptTag, other.scriptTag);
2415 } 2335 }
2416 2336
2417 @override 2337 @override
2418 bool visitShowCombinator(ShowCombinator node) { 2338 bool visitShowCombinator(ShowCombinator node) {
2419 ShowCombinator other = this._other as ShowCombinator; 2339 ShowCombinator other = _other as ShowCombinator;
2420 return isEqualTokens(node.keyword, other.keyword) && _isEqualNodeLists(node. shownNames, other.shownNames); 2340 return isEqualTokens(node.keyword, other.keyword) && _isEqualNodeLists(node. shownNames, other.shownNames);
2421 } 2341 }
2422 2342
2423 @override 2343 @override
2424 bool visitSimpleFormalParameter(SimpleFormalParameter node) { 2344 bool visitSimpleFormalParameter(SimpleFormalParameter node) {
2425 SimpleFormalParameter other = this._other as SimpleFormalParameter; 2345 SimpleFormalParameter other = _other as SimpleFormalParameter;
2426 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.type, other.type) && isEqualNodes(node.ide ntifier, other.identifier); 2346 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.type, other.type) && isEqualNodes(node.ide ntifier, other.identifier);
2427 } 2347 }
2428 2348
2429 @override 2349 @override
2430 bool visitSimpleIdentifier(SimpleIdentifier node) { 2350 bool visitSimpleIdentifier(SimpleIdentifier node) {
2431 SimpleIdentifier other = this._other as SimpleIdentifier; 2351 SimpleIdentifier other = _other as SimpleIdentifier;
2432 return isEqualTokens(node.token, other.token); 2352 return isEqualTokens(node.token, other.token);
2433 } 2353 }
2434 2354
2435 @override 2355 @override
2436 bool visitSimpleStringLiteral(SimpleStringLiteral node) { 2356 bool visitSimpleStringLiteral(SimpleStringLiteral node) {
2437 SimpleStringLiteral other = this._other as SimpleStringLiteral; 2357 SimpleStringLiteral other = _other as SimpleStringLiteral;
2438 return isEqualTokens(node.literal, other.literal) && (node.value == other.va lue); 2358 return isEqualTokens(node.literal, other.literal) && (node.value == other.va lue);
2439 } 2359 }
2440 2360
2441 @override 2361 @override
2442 bool visitStringInterpolation(StringInterpolation node) { 2362 bool visitStringInterpolation(StringInterpolation node) {
2443 StringInterpolation other = this._other as StringInterpolation; 2363 StringInterpolation other = _other as StringInterpolation;
2444 return _isEqualNodeLists(node.elements, other.elements); 2364 return _isEqualNodeLists(node.elements, other.elements);
2445 } 2365 }
2446 2366
2447 @override 2367 @override
2448 bool visitSuperConstructorInvocation(SuperConstructorInvocation node) { 2368 bool visitSuperConstructorInvocation(SuperConstructorInvocation node) {
2449 SuperConstructorInvocation other = this._other as SuperConstructorInvocation ; 2369 SuperConstructorInvocation other = _other as SuperConstructorInvocation;
2450 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.peri od, other.period) && isEqualNodes(node.constructorName, other.constructorName) & & isEqualNodes(node.argumentList, other.argumentList); 2370 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.peri od, other.period) && isEqualNodes(node.constructorName, other.constructorName) & & isEqualNodes(node.argumentList, other.argumentList);
2451 } 2371 }
2452 2372
2453 @override 2373 @override
2454 bool visitSuperExpression(SuperExpression node) { 2374 bool visitSuperExpression(SuperExpression node) {
2455 SuperExpression other = this._other as SuperExpression; 2375 SuperExpression other = _other as SuperExpression;
2456 return isEqualTokens(node.keyword, other.keyword); 2376 return isEqualTokens(node.keyword, other.keyword);
2457 } 2377 }
2458 2378
2459 @override 2379 @override
2460 bool visitSwitchCase(SwitchCase node) { 2380 bool visitSwitchCase(SwitchCase node) {
2461 SwitchCase other = this._other as SwitchCase; 2381 SwitchCase other = _other as SwitchCase;
2462 return _isEqualNodeLists(node.labels, other.labels) && isEqualTokens(node.ke yword, other.keyword) && isEqualNodes(node.expression, other.expression) && isEq ualTokens(node.colon, other.colon) && _isEqualNodeLists(node.statements, other.s tatements); 2382 return _isEqualNodeLists(node.labels, other.labels) && isEqualTokens(node.ke yword, other.keyword) && isEqualNodes(node.expression, other.expression) && isEq ualTokens(node.colon, other.colon) && _isEqualNodeLists(node.statements, other.s tatements);
2463 } 2383 }
2464 2384
2465 @override 2385 @override
2466 bool visitSwitchDefault(SwitchDefault node) { 2386 bool visitSwitchDefault(SwitchDefault node) {
2467 SwitchDefault other = this._other as SwitchDefault; 2387 SwitchDefault other = _other as SwitchDefault;
2468 return _isEqualNodeLists(node.labels, other.labels) && isEqualTokens(node.ke yword, other.keyword) && isEqualTokens(node.colon, other.colon) && _isEqualNodeL ists(node.statements, other.statements); 2388 return _isEqualNodeLists(node.labels, other.labels) && isEqualTokens(node.ke yword, other.keyword) && isEqualTokens(node.colon, other.colon) && _isEqualNodeL ists(node.statements, other.statements);
2469 } 2389 }
2470 2390
2471 @override 2391 @override
2472 bool visitSwitchStatement(SwitchStatement node) { 2392 bool visitSwitchStatement(SwitchStatement node) {
2473 SwitchStatement other = this._other as SwitchStatement; 2393 SwitchStatement other = _other as SwitchStatement;
2474 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.left Parenthesis, other.leftParenthesis) && isEqualNodes(node.expression, other.expre ssion) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqua lTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.members, other.members) && isEqualTokens(node.rightBracket, other.rightBracket); 2394 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.left Parenthesis, other.leftParenthesis) && isEqualNodes(node.expression, other.expre ssion) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqua lTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.members, other.members) && isEqualTokens(node.rightBracket, other.rightBracket);
2475 } 2395 }
2476 2396
2477 @override 2397 @override
2478 bool visitSymbolLiteral(SymbolLiteral node) { 2398 bool visitSymbolLiteral(SymbolLiteral node) {
2479 SymbolLiteral other = this._other as SymbolLiteral; 2399 SymbolLiteral other = _other as SymbolLiteral;
2480 return isEqualTokens(node.poundSign, other.poundSign) && _isEqualTokenLists( node.components, other.components); 2400 return isEqualTokens(node.poundSign, other.poundSign) && _isEqualTokenLists( node.components, other.components);
2481 } 2401 }
2482 2402
2483 @override 2403 @override
2484 bool visitThisExpression(ThisExpression node) { 2404 bool visitThisExpression(ThisExpression node) {
2485 ThisExpression other = this._other as ThisExpression; 2405 ThisExpression other = _other as ThisExpression;
2486 return isEqualTokens(node.keyword, other.keyword); 2406 return isEqualTokens(node.keyword, other.keyword);
2487 } 2407 }
2488 2408
2489 @override 2409 @override
2490 bool visitThrowExpression(ThrowExpression node) { 2410 bool visitThrowExpression(ThrowExpression node) {
2491 ThrowExpression other = this._other as ThrowExpression; 2411 ThrowExpression other = _other as ThrowExpression;
2492 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.expre ssion, other.expression); 2412 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.expre ssion, other.expression);
2493 } 2413 }
2494 2414
2495 @override 2415 @override
2496 bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { 2416 bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
2497 TopLevelVariableDeclaration other = this._other as TopLevelVariableDeclarati on; 2417 TopLevelVariableDeclaration other = _other as TopLevelVariableDeclaration;
2498 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.variable s, other.variables) && isEqualTokens(node.semicolon, other.semicolon); 2418 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.variable s, other.variables) && isEqualTokens(node.semicolon, other.semicolon);
2499 } 2419 }
2500 2420
2501 @override 2421 @override
2502 bool visitTryStatement(TryStatement node) { 2422 bool visitTryStatement(TryStatement node) {
2503 TryStatement other = this._other as TryStatement; 2423 TryStatement other = _other as TryStatement;
2504 return isEqualTokens(node.tryKeyword, other.tryKeyword) && isEqualNodes(node .body, other.body) && _isEqualNodeLists(node.catchClauses, other.catchClauses) & & isEqualTokens(node.finallyKeyword, other.finallyKeyword) && isEqualNodes(node. finallyBlock, other.finallyBlock); 2424 return isEqualTokens(node.tryKeyword, other.tryKeyword) && isEqualNodes(node .body, other.body) && _isEqualNodeLists(node.catchClauses, other.catchClauses) & & isEqualTokens(node.finallyKeyword, other.finallyKeyword) && isEqualNodes(node. finallyBlock, other.finallyBlock);
2505 } 2425 }
2506 2426
2507 @override 2427 @override
2508 bool visitTypeArgumentList(TypeArgumentList node) { 2428 bool visitTypeArgumentList(TypeArgumentList node) {
2509 TypeArgumentList other = this._other as TypeArgumentList; 2429 TypeArgumentList other = _other as TypeArgumentList;
2510 return isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLis ts(node.arguments, other.arguments) && isEqualTokens(node.rightBracket, other.ri ghtBracket); 2430 return isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLis ts(node.arguments, other.arguments) && isEqualTokens(node.rightBracket, other.ri ghtBracket);
2511 } 2431 }
2512 2432
2513 @override 2433 @override
2514 bool visitTypeName(TypeName node) { 2434 bool visitTypeName(TypeName node) {
2515 TypeName other = this._other as TypeName; 2435 TypeName other = _other as TypeName;
2516 return isEqualNodes(node.name, other.name) && isEqualNodes(node.typeArgument s, other.typeArguments); 2436 return isEqualNodes(node.name, other.name) && isEqualNodes(node.typeArgument s, other.typeArguments);
2517 } 2437 }
2518 2438
2519 @override 2439 @override
2520 bool visitTypeParameter(TypeParameter node) { 2440 bool visitTypeParameter(TypeParameter node) {
2521 TypeParameter other = this._other as TypeParameter; 2441 TypeParameter other = _other as TypeParameter;
2522 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, ot her.name) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.bou nd, other.bound); 2442 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, ot her.name) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.bou nd, other.bound);
2523 } 2443 }
2524 2444
2525 @override 2445 @override
2526 bool visitTypeParameterList(TypeParameterList node) { 2446 bool visitTypeParameterList(TypeParameterList node) {
2527 TypeParameterList other = this._other as TypeParameterList; 2447 TypeParameterList other = _other as TypeParameterList;
2528 return isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLis ts(node.typeParameters, other.typeParameters) && isEqualTokens(node.rightBracket , other.rightBracket); 2448 return isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLis ts(node.typeParameters, other.typeParameters) && isEqualTokens(node.rightBracket , other.rightBracket);
2529 } 2449 }
2530 2450
2531 @override 2451 @override
2532 bool visitVariableDeclaration(VariableDeclaration node) { 2452 bool visitVariableDeclaration(VariableDeclaration node) {
2533 VariableDeclaration other = this._other as VariableDeclaration; 2453 VariableDeclaration other = _other as VariableDeclaration;
2534 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, ot her.name) && isEqualTokens(node.equals, other.equals) && isEqualNodes(node.initi alizer, other.initializer); 2454 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, ot her.name) && isEqualTokens(node.equals, other.equals) && isEqualNodes(node.initi alizer, other.initializer);
2535 } 2455 }
2536 2456
2537 @override 2457 @override
2538 bool visitVariableDeclarationList(VariableDeclarationList node) { 2458 bool visitVariableDeclarationList(VariableDeclarationList node) {
2539 VariableDeclarationList other = this._other as VariableDeclarationList; 2459 VariableDeclarationList other = _other as VariableDeclarationList;
2540 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.type, other.type) && _isEqualNodeLists(nod e.variables, other.variables); 2460 return isEqualNodes(node.documentationComment, other.documentationComment) & & _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword , other.keyword) && isEqualNodes(node.type, other.type) && _isEqualNodeLists(nod e.variables, other.variables);
2541 } 2461 }
2542 2462
2543 @override 2463 @override
2544 bool visitVariableDeclarationStatement(VariableDeclarationStatement node) { 2464 bool visitVariableDeclarationStatement(VariableDeclarationStatement node) {
2545 VariableDeclarationStatement other = this._other as VariableDeclarationState ment; 2465 VariableDeclarationStatement other = _other as VariableDeclarationStatement;
2546 return isEqualNodes(node.variables, other.variables) && isEqualTokens(node.s emicolon, other.semicolon); 2466 return isEqualNodes(node.variables, other.variables) && isEqualTokens(node.s emicolon, other.semicolon);
2547 } 2467 }
2548 2468
2549 @override 2469 @override
2550 bool visitWhileStatement(WhileStatement node) { 2470 bool visitWhileStatement(WhileStatement node) {
2551 WhileStatement other = this._other as WhileStatement; 2471 WhileStatement other = _other as WhileStatement;
2552 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.left Parenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condit ion) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualN odes(node.body, other.body); 2472 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.left Parenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condit ion) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualN odes(node.body, other.body);
2553 } 2473 }
2554 2474
2555 @override 2475 @override
2556 bool visitWithClause(WithClause node) { 2476 bool visitWithClause(WithClause node) {
2557 WithClause other = this._other as WithClause; 2477 WithClause other = _other as WithClause;
2558 return isEqualTokens(node.withKeyword, other.withKeyword) && _isEqualNodeLis ts(node.mixinTypes, other.mixinTypes); 2478 return isEqualTokens(node.withKeyword, other.withKeyword) && _isEqualNodeLis ts(node.mixinTypes, other.mixinTypes);
2559 } 2479 }
2560 2480
2561 @override 2481 @override
2562 bool visitYieldStatement(YieldStatement node) { 2482 bool visitYieldStatement(YieldStatement node) {
2563 YieldStatement other = this._other as YieldStatement; 2483 YieldStatement other = _other as YieldStatement;
2564 return isEqualTokens(node.yieldKeyword, other.yieldKeyword) && isEqualNodes( node.expression, other.expression) && isEqualTokens(node.semicolon, other.semico lon); 2484 return isEqualTokens(node.yieldKeyword, other.yieldKeyword) && isEqualNodes( node.expression, other.expression) && isEqualTokens(node.semicolon, other.semico lon);
2565 } 2485 }
2566 2486
2567 /** 2487 /**
2568 * Return `true` if the given lists of AST nodes have the same size and corres ponding 2488 * Return `true` if the given lists of AST nodes have the same size and corres ponding
2569 * elements are equal. 2489 * elements are equal.
2570 * 2490 *
2571 * @param first the first node being compared 2491 * @param first the first node being compared
2572 * @param second the second node being compared 2492 * @param second the second node being compared
2573 * @return `true` if the given AST nodes have the same size and corresponding elements are 2493 * @return `true` if the given AST nodes have the same size and corresponding elements are
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
2652 && first.lexeme == second.lexeme; 2572 && first.lexeme == second.lexeme;
2653 } 2573 }
2654 } 2574 }
2655 2575
2656 /** 2576 /**
2657 * The abstract class `AstNode` defines the behavior common to all nodes in the AST structure 2577 * The abstract class `AstNode` defines the behavior common to all nodes in the AST structure
2658 * for a Dart program. 2578 * for a Dart program.
2659 */ 2579 */
2660 abstract class AstNode { 2580 abstract class AstNode {
2661 /** 2581 /**
2662 * An empty array of ast nodes.
2663 */
2664 static List<AstNode> EMPTY_ARRAY = new List<AstNode>(0);
2665
2666 /**
2667 * The parent of the node, or `null` if the node is the root of an AST structu re. 2582 * The parent of the node, or `null` if the node is the root of an AST structu re.
2668 */ 2583 */
2669 AstNode _parent; 2584 AstNode _parent;
2670 2585
2671 /** 2586 /**
2672 * A table mapping the names of properties to their values, or `null` if this node does not 2587 * A table mapping the names of properties to their values, or `null` if this node does not
2673 * have any properties associated with it. 2588 * have any properties associated with it.
2674 */ 2589 */
2675 Map<String, Object> _propertyMap; 2590 Map<String, Object> _propertyMap;
2676 2591
2677 /** 2592 /**
2593 * An empty array of ast nodes.
2594 */
2595 static const List<AstNode> EMPTY_ARRAY = const <AstNode>[];
2596
2597 /**
2678 * A comparator that can be used to sort AST nodes in lexical order. In other words, 2598 * A comparator that can be used to sort AST nodes in lexical order. In other words,
2679 * `compare` will return a negative value if the offset of the first node is l ess than the 2599 * `compare` will return a negative value if the offset of the first node is l ess than the
2680 * offset of the second node, zero (0) if the nodes have the same offset, and a positive value if 2600 * offset of the second node, zero (0) if the nodes have the same offset, and a positive value if
2681 * if the offset of the first node is greater than the offset of the second no de. 2601 * if the offset of the first node is greater than the offset of the second no de.
2682 */ 2602 */
2683 static Comparator<AstNode> LEXICAL_ORDER = (AstNode first, AstNode second) => second.offset - first.offset; 2603 static Comparator<AstNode> LEXICAL_ORDER = (AstNode first, AstNode second) => second.offset - first.offset;
2684 2604
2685 /** 2605 /**
2686 * Use the given visitor to visit this node. 2606 * Use the given visitor to visit this node.
2687 * 2607 *
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
2853 void visitChildren(AstVisitor visitor); 2773 void visitChildren(AstVisitor visitor);
2854 2774
2855 /** 2775 /**
2856 * Make this node the parent of the given child node. 2776 * Make this node the parent of the given child node.
2857 * 2777 *
2858 * @param child the node that will become a child of this node 2778 * @param child the node that will become a child of this node
2859 * @return the node that was made a child of this node 2779 * @return the node that was made a child of this node
2860 */ 2780 */
2861 AstNode becomeParentOf(AstNode child) { 2781 AstNode becomeParentOf(AstNode child) {
2862 if (child != null) { 2782 if (child != null) {
2863 AstNode node = child; 2783 child._parent = this;
2864 node.parent = this;
2865 } 2784 }
2866 return child; 2785 return child;
2867 } 2786 }
2868 2787
2869 /** 2788 /**
2870 * If the given child is not `null`, use the given visitor to visit it. 2789 * If the given child is not `null`, use the given visitor to visit it.
2871 * 2790 *
2872 * @param child the child to be visited 2791 * @param child the child to be visited
2873 * @param visitor the visitor that will be used to visit the child 2792 * @param visitor the visitor that will be used to visit the child
2874 */ 2793 */
2875 void safelyVisitChild(AstNode child, AstVisitor visitor) { 2794 void safelyVisitChild(AstNode child, AstVisitor visitor) {
2876 if (child != null) { 2795 if (child != null) {
2877 child.accept(visitor); 2796 child.accept(visitor);
2878 } 2797 }
2879 } 2798 }
2880 2799
2881 /** 2800 /**
2882 * Set the parent of this node to the given node. 2801 * Set the parent of this node to the given node.
2883 * 2802 *
2884 * @param newParent the node that is to be made the parent of this node 2803 * @param newParent the node that is to be made the parent of this node
2885 */ 2804 */
2805 @deprecated
2886 void set parent(AstNode newParent) { 2806 void set parent(AstNode newParent) {
2887 _parent = newParent; 2807 _parent = newParent;
2888 } 2808 }
2889 } 2809 }
2890 2810
2891 /** 2811 /**
2892 * The interface `AstVisitor` defines the behavior of objects that can be used t o visit an AST 2812 * The interface `AstVisitor` defines the behavior of objects that can be used t o visit an AST
2893 * structure. 2813 * structure.
2894 */ 2814 */
2895 abstract class AstVisitor<R> { 2815 abstract class AstVisitor<R> {
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
3120 */ 3040 */
3121 Expression _expression; 3041 Expression _expression;
3122 3042
3123 /** 3043 /**
3124 * Initialize a newly created await expression. 3044 * Initialize a newly created await expression.
3125 * 3045 *
3126 * @param awaitKeyword the 'await' keyword 3046 * @param awaitKeyword the 'await' keyword
3127 * @param expression the expression whose value is being waited on 3047 * @param expression the expression whose value is being waited on
3128 */ 3048 */
3129 AwaitExpression(this.awaitKeyword, Expression expression) { 3049 AwaitExpression(this.awaitKeyword, Expression expression) {
3130 this._expression = becomeParentOf(expression); 3050 _expression = becomeParentOf(expression);
3131 } 3051 }
3132 3052
3133 @override 3053 @override
3134 accept(AstVisitor visitor) => visitor.visitAwaitExpression(this); 3054 accept(AstVisitor visitor) => visitor.visitAwaitExpression(this);
3135 3055
3136 @override 3056 @override
3137 Token get beginToken { 3057 Token get beginToken {
3138 if (awaitKeyword != null) { 3058 if (awaitKeyword != null) {
3139 return awaitKeyword; 3059 return awaitKeyword;
3140 } 3060 }
(...skipping 12 matching lines...) Expand all
3153 3073
3154 @override 3074 @override
3155 int get precedence => 0; 3075 int get precedence => 0;
3156 3076
3157 /** 3077 /**
3158 * Set the expression whose value is being waited on to the given expression. 3078 * Set the expression whose value is being waited on to the given expression.
3159 * 3079 *
3160 * @param expression the expression whose value is being waited on 3080 * @param expression the expression whose value is being waited on
3161 */ 3081 */
3162 void set expression(Expression expression) { 3082 void set expression(Expression expression) {
3163 this._expression = becomeParentOf(expression); 3083 _expression = becomeParentOf(expression);
3164 } 3084 }
3165 3085
3166 @override 3086 @override
3167 void visitChildren(AstVisitor visitor) { 3087 void visitChildren(AstVisitor visitor) {
3168 safelyVisitChild(_expression, visitor); 3088 safelyVisitChild(_expression, visitor);
3169 } 3089 }
3170 } 3090 }
3171 3091
3172 /** 3092 /**
3173 * Instances of the class `BinaryExpression` represent a binary (infix) expressi on. 3093 * Instances of the class `BinaryExpression` represent a binary (infix) expressi on.
(...skipping 17 matching lines...) Expand all
3191 /** 3111 /**
3192 * The expression used to compute the right operand. 3112 * The expression used to compute the right operand.
3193 */ 3113 */
3194 Expression _rightOperand; 3114 Expression _rightOperand;
3195 3115
3196 /** 3116 /**
3197 * The element associated with the operator based on the static type of the le ft operand, or 3117 * The element associated with the operator based on the static type of the le ft operand, or
3198 * `null` if the AST structure has not been resolved, if the operator is not u ser definable, 3118 * `null` if the AST structure has not been resolved, if the operator is not u ser definable,
3199 * or if the operator could not be resolved. 3119 * or if the operator could not be resolved.
3200 */ 3120 */
3201 MethodElement _staticElement; 3121 MethodElement staticElement;
3202 3122
3203 /** 3123 /**
3204 * The element associated with the operator based on the propagated type of th e left operand, or 3124 * The element associated with the operator based on the propagated type of th e left operand, or
3205 * `null` if the AST structure has not been resolved, if the operator is not u ser definable, 3125 * `null` if the AST structure has not been resolved, if the operator is not u ser definable,
3206 * or if the operator could not be resolved. 3126 * or if the operator could not be resolved.
3207 */ 3127 */
3208 MethodElement _propagatedElement; 3128 MethodElement propagatedElement;
3209 3129
3210 /** 3130 /**
3211 * Initialize a newly created binary expression. 3131 * Initialize a newly created binary expression.
3212 * 3132 *
3213 * @param leftOperand the expression used to compute the left operand 3133 * @param leftOperand the expression used to compute the left operand
3214 * @param operator the binary operator being applied 3134 * @param operator the binary operator being applied
3215 * @param rightOperand the expression used to compute the right operand 3135 * @param rightOperand the expression used to compute the right operand
3216 */ 3136 */
3217 BinaryExpression(Expression leftOperand, this.operator, Expression rightOperan d) { 3137 BinaryExpression(Expression leftOperand, this.operator, Expression rightOperan d) {
3218 this._leftOperand = becomeParentOf(leftOperand); 3138 _leftOperand = becomeParentOf(leftOperand);
3219 this._rightOperand = becomeParentOf(rightOperand); 3139 _rightOperand = becomeParentOf(rightOperand);
3220 } 3140 }
3221 3141
3222 @override 3142 @override
3223 accept(AstVisitor visitor) => visitor.visitBinaryExpression(this); 3143 accept(AstVisitor visitor) => visitor.visitBinaryExpression(this);
3224 3144
3225 @override 3145 @override
3226 Token get beginToken => _leftOperand.beginToken; 3146 Token get beginToken => _leftOperand.beginToken;
3227 3147
3228 /** 3148 /**
3229 * Return the best element available for this operator. If resolution was able to find a better 3149 * Return the best element available for this operator. If resolution was able to find a better
(...skipping 18 matching lines...) Expand all
3248 * Return the expression used to compute the left operand. 3168 * Return the expression used to compute the left operand.
3249 * 3169 *
3250 * @return the expression used to compute the left operand 3170 * @return the expression used to compute the left operand
3251 */ 3171 */
3252 Expression get leftOperand => _leftOperand; 3172 Expression get leftOperand => _leftOperand;
3253 3173
3254 @override 3174 @override
3255 int get precedence => operator.type.precedence; 3175 int get precedence => operator.type.precedence;
3256 3176
3257 /** 3177 /**
3258 * Return the element associated with the operator based on the propagated typ e of the left
3259 * operand, or `null` if the AST structure has not been resolved, if the opera tor is not
3260 * user definable, or if the operator could not be resolved. One example of th e latter case is an
3261 * operator that is not defined for the type of the left-hand operand.
3262 *
3263 * @return the element associated with the operator
3264 */
3265 MethodElement get propagatedElement => _propagatedElement;
3266
3267 /**
3268 * Return the expression used to compute the right operand. 3178 * Return the expression used to compute the right operand.
3269 * 3179 *
3270 * @return the expression used to compute the right operand 3180 * @return the expression used to compute the right operand
3271 */ 3181 */
3272 Expression get rightOperand => _rightOperand; 3182 Expression get rightOperand => _rightOperand;
3273 3183
3274 /** 3184 /**
3275 * Return the element associated with the operator based on the static type of the left operand,
3276 * or `null` if the AST structure has not been resolved, if the operator is no t user
3277 * definable, or if the operator could not be resolved. One example of the lat ter case is an
3278 * operator that is not defined for the type of the left operand.
3279 *
3280 * @return the element associated with the operator
3281 */
3282 MethodElement get staticElement => _staticElement;
3283
3284 /**
3285 * Set the expression used to compute the left operand to the given expression . 3185 * Set the expression used to compute the left operand to the given expression .
3286 * 3186 *
3287 * @param expression the expression used to compute the left operand 3187 * @param expression the expression used to compute the left operand
3288 */ 3188 */
3289 void set leftOperand(Expression expression) { 3189 void set leftOperand(Expression expression) {
3290 _leftOperand = becomeParentOf(expression); 3190 _leftOperand = becomeParentOf(expression);
3291 } 3191 }
3292 3192
3293 /** 3193 /**
3294 * Set the element associated with the operator based on the propagated type o f the left operand
3295 * to the given element.
3296 *
3297 * @param element the element to be associated with the operator
3298 */
3299 void set propagatedElement(MethodElement element) {
3300 _propagatedElement = element;
3301 }
3302
3303 /**
3304 * Set the expression used to compute the right operand to the given expressio n. 3194 * Set the expression used to compute the right operand to the given expressio n.
3305 * 3195 *
3306 * @param expression the expression used to compute the right operand 3196 * @param expression the expression used to compute the right operand
3307 */ 3197 */
3308 void set rightOperand(Expression expression) { 3198 void set rightOperand(Expression expression) {
3309 _rightOperand = becomeParentOf(expression); 3199 _rightOperand = becomeParentOf(expression);
3310 } 3200 }
3311 3201
3312 /**
3313 * Set the element associated with the operator based on the static type of th e left operand to
3314 * the given element.
3315 *
3316 * @param element the static element to be associated with the operator
3317 */
3318 void set staticElement(MethodElement element) {
3319 _staticElement = element;
3320 }
3321
3322 @override 3202 @override
3323 void visitChildren(AstVisitor visitor) { 3203 void visitChildren(AstVisitor visitor) {
3324 safelyVisitChild(_leftOperand, visitor); 3204 safelyVisitChild(_leftOperand, visitor);
3325 safelyVisitChild(_rightOperand, visitor); 3205 safelyVisitChild(_rightOperand, visitor);
3326 } 3206 }
3327 3207
3328 /** 3208 /**
3329 * If the AST structure has been resolved, and the function being invoked is k nown based on 3209 * If the AST structure has been resolved, and the function being invoked is k nown based on
3330 * propagated type information, then return the parameter element representing the parameter to 3210 * propagated type information, then return the parameter element representing the parameter to
3331 * which the value of the right operand will be bound. Otherwise, return `null `. 3211 * which the value of the right operand will be bound. Otherwise, return `null `.
3332 * 3212 *
3333 * This method is only intended to be used by [Expression.propagatedParameterE lement]. 3213 * This method is only intended to be used by [Expression.propagatedParameterE lement].
3334 * 3214 *
3335 * @return the parameter element representing the parameter to which the value of the right 3215 * @return the parameter element representing the parameter to which the value of the right
3336 * operand will be bound 3216 * operand will be bound
3337 */ 3217 */
3338 ParameterElement get propagatedParameterElementForRightOperand { 3218 ParameterElement get propagatedParameterElementForRightOperand {
3339 if (_propagatedElement == null) { 3219 if (propagatedElement == null) {
3340 return null; 3220 return null;
3341 } 3221 }
3342 List<ParameterElement> parameters = _propagatedElement.parameters; 3222 List<ParameterElement> parameters = propagatedElement.parameters;
3343 if (parameters.length < 1) { 3223 if (parameters.length < 1) {
3344 return null; 3224 return null;
3345 } 3225 }
3346 return parameters[0]; 3226 return parameters[0];
3347 } 3227 }
3348 3228
3349 /** 3229 /**
3350 * If the AST structure has been resolved, and the function being invoked is k nown based on static 3230 * If the AST structure has been resolved, and the function being invoked is k nown based on static
3351 * type information, then return the parameter element representing the parame ter to which the 3231 * type information, then return the parameter element representing the parame ter to which the
3352 * value of the right operand will be bound. Otherwise, return `null`. 3232 * value of the right operand will be bound. Otherwise, return `null`.
3353 * 3233 *
3354 * This method is only intended to be used by [Expression.staticParameterEleme nt]. 3234 * This method is only intended to be used by [Expression.staticParameterEleme nt].
3355 * 3235 *
3356 * @return the parameter element representing the parameter to which the value of the right 3236 * @return the parameter element representing the parameter to which the value of the right
3357 * operand will be bound 3237 * operand will be bound
3358 */ 3238 */
3359 ParameterElement get staticParameterElementForRightOperand { 3239 ParameterElement get staticParameterElementForRightOperand {
3360 if (_staticElement == null) { 3240 if (staticElement == null) {
3361 return null; 3241 return null;
3362 } 3242 }
3363 List<ParameterElement> parameters = _staticElement.parameters; 3243 List<ParameterElement> parameters = staticElement.parameters;
3364 if (parameters.length < 1) { 3244 if (parameters.length < 1) {
3365 return null; 3245 return null;
3366 } 3246 }
3367 return parameters[0]; 3247 return parameters[0];
3368 } 3248 }
3369 } 3249 }
3370 3250
3371 /** 3251 /**
3372 * Instances of the class `Block` represent a sequence of statements. 3252 * Instances of the class `Block` represent a sequence of statements.
3373 * 3253 *
(...skipping 19 matching lines...) Expand all
3393 Token rightBracket; 3273 Token rightBracket;
3394 3274
3395 /** 3275 /**
3396 * Initialize a newly created block of code. 3276 * Initialize a newly created block of code.
3397 * 3277 *
3398 * @param leftBracket the left curly bracket 3278 * @param leftBracket the left curly bracket
3399 * @param statements the statements contained in the block 3279 * @param statements the statements contained in the block
3400 * @param rightBracket the right curly bracket 3280 * @param rightBracket the right curly bracket
3401 */ 3281 */
3402 Block(this.leftBracket, List<Statement> statements, this.rightBracket) { 3282 Block(this.leftBracket, List<Statement> statements, this.rightBracket) {
3403 this._statements = new NodeList<Statement>(this); 3283 _statements = new NodeList<Statement>(this, statements);
3404 this._statements.addAll(statements);
3405 } 3284 }
3406 3285
3407 @override 3286 @override
3408 accept(AstVisitor visitor) => visitor.visitBlock(this); 3287 accept(AstVisitor visitor) => visitor.visitBlock(this);
3409 3288
3410 @override 3289 @override
3411 Token get beginToken => leftBracket; 3290 Token get beginToken => leftBracket;
3412 3291
3413 @override 3292 @override
3414 Token get endToken => rightBracket; 3293 Token get endToken => rightBracket;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
3453 Block _block; 3332 Block _block;
3454 3333
3455 /** 3334 /**
3456 * Initialize a newly created function body consisting of a block of statement s. 3335 * Initialize a newly created function body consisting of a block of statement s.
3457 * 3336 *
3458 * @param keyword the token representing the 'async' or 'sync' keyword 3337 * @param keyword the token representing the 'async' or 'sync' keyword
3459 * @param star the star following the 'async' or 'sync' keyword 3338 * @param star the star following the 'async' or 'sync' keyword
3460 * @param block the block representing the body of the function 3339 * @param block the block representing the body of the function
3461 */ 3340 */
3462 BlockFunctionBody(this.keyword, this.star, Block block) { 3341 BlockFunctionBody(this.keyword, this.star, Block block) {
3463 this._block = becomeParentOf(block); 3342 _block = becomeParentOf(block);
3464 } 3343 }
3465 3344
3466 @override 3345 @override
3467 accept(AstVisitor visitor) => visitor.visitBlockFunctionBody(this); 3346 accept(AstVisitor visitor) => visitor.visitBlockFunctionBody(this);
3468 3347
3469 @override 3348 @override
3470 Token get beginToken => _block.beginToken; 3349 Token get beginToken => _block.beginToken;
3471 3350
3472 /** 3351 /**
3473 * Return the block representing the body of the function. 3352 * Return the block representing the body of the function.
(...skipping 19 matching lines...) Expand all
3493 3372
3494 @override 3373 @override
3495 bool get isSynchronous => keyword == null || keyword.lexeme != Parser.ASYNC; 3374 bool get isSynchronous => keyword == null || keyword.lexeme != Parser.ASYNC;
3496 3375
3497 /** 3376 /**
3498 * Set the block representing the body of the function to the given block. 3377 * Set the block representing the body of the function to the given block.
3499 * 3378 *
3500 * @param block the block representing the body of the function 3379 * @param block the block representing the body of the function
3501 */ 3380 */
3502 void set block(Block block) { 3381 void set block(Block block) {
3503 this._block = becomeParentOf(block); 3382 _block = becomeParentOf(block);
3504 } 3383 }
3505 3384
3506 @override 3385 @override
3507 void visitChildren(AstVisitor visitor) { 3386 void visitChildren(AstVisitor visitor) {
3508 safelyVisitChild(_block, visitor); 3387 safelyVisitChild(_block, visitor);
3509 } 3388 }
3510 } 3389 }
3511 3390
3512 /** 3391 /**
3513 * Instances of the class `BooleanLiteral` represent a boolean literal expressio n. 3392 * Instances of the class `BooleanLiteral` represent a boolean literal expressio n.
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
3595 } 3474 }
3596 } 3475 }
3597 3476
3598 @override 3477 @override
3599 R visitNode(AstNode node) { 3478 R visitNode(AstNode node) {
3600 node.visitChildren(_childVisitor); 3479 node.visitChildren(_childVisitor);
3601 return null; 3480 return null;
3602 } 3481 }
3603 3482
3604 BreadthFirstVisitor() { 3483 BreadthFirstVisitor() {
3605 this._childVisitor = new GeneralizingAstVisitor_BreadthFirstVisitor(this); 3484 _childVisitor = new GeneralizingAstVisitor_BreadthFirstVisitor(this);
3606 } 3485 }
3607 } 3486 }
3608 3487
3609 /** 3488 /**
3610 * Instances of the class `BreakStatement` represent a break statement. 3489 * Instances of the class `BreakStatement` represent a break statement.
3611 * 3490 *
3612 * <pre> 3491 * <pre>
3613 * breakStatement ::= 3492 * breakStatement ::=
3614 * 'break' [SimpleIdentifier]? ';' 3493 * 'break' [SimpleIdentifier]? ';'
3615 * </pre> 3494 * </pre>
(...skipping 15 matching lines...) Expand all
3631 Token semicolon; 3510 Token semicolon;
3632 3511
3633 /** 3512 /**
3634 * Initialize a newly created break statement. 3513 * Initialize a newly created break statement.
3635 * 3514 *
3636 * @param keyword the token representing the 'break' keyword 3515 * @param keyword the token representing the 'break' keyword
3637 * @param label the label associated with the statement 3516 * @param label the label associated with the statement
3638 * @param semicolon the semicolon terminating the statement 3517 * @param semicolon the semicolon terminating the statement
3639 */ 3518 */
3640 BreakStatement(this.keyword, SimpleIdentifier label, this.semicolon) { 3519 BreakStatement(this.keyword, SimpleIdentifier label, this.semicolon) {
3641 this._label = becomeParentOf(label); 3520 _label = becomeParentOf(label);
3642 } 3521 }
3643 3522
3644 @override 3523 @override
3645 accept(AstVisitor visitor) => visitor.visitBreakStatement(this); 3524 accept(AstVisitor visitor) => visitor.visitBreakStatement(this);
3646 3525
3647 @override 3526 @override
3648 Token get beginToken => keyword; 3527 Token get beginToken => keyword;
3649 3528
3650 @override 3529 @override
3651 Token get endToken => semicolon; 3530 Token get endToken => semicolon;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
3701 */ 3580 */
3702 NodeList<Expression> _cascadeSections; 3581 NodeList<Expression> _cascadeSections;
3703 3582
3704 /** 3583 /**
3705 * Initialize a newly created cascade expression. 3584 * Initialize a newly created cascade expression.
3706 * 3585 *
3707 * @param target the target of the cascade sections 3586 * @param target the target of the cascade sections
3708 * @param cascadeSections the cascade sections sharing the common target 3587 * @param cascadeSections the cascade sections sharing the common target
3709 */ 3588 */
3710 CascadeExpression(Expression target, List<Expression> cascadeSections) { 3589 CascadeExpression(Expression target, List<Expression> cascadeSections) {
3711 this._cascadeSections = new NodeList<Expression>(this); 3590 _target = becomeParentOf(target);
3712 this._target = becomeParentOf(target); 3591 _cascadeSections = new NodeList<Expression>(this, cascadeSections);
3713 this._cascadeSections.addAll(cascadeSections);
3714 } 3592 }
3715 3593
3716 @override 3594 @override
3717 accept(AstVisitor visitor) => visitor.visitCascadeExpression(this); 3595 accept(AstVisitor visitor) => visitor.visitCascadeExpression(this);
3718 3596
3719 @override 3597 @override
3720 Token get beginToken => _target.beginToken; 3598 Token get beginToken => _target.beginToken;
3721 3599
3722 /** 3600 /**
3723 * Return the cascade sections sharing the common target. 3601 * Return the cascade sections sharing the common target.
(...skipping 14 matching lines...) Expand all
3738 * @return the target of the cascade sections 3616 * @return the target of the cascade sections
3739 */ 3617 */
3740 Expression get target => _target; 3618 Expression get target => _target;
3741 3619
3742 /** 3620 /**
3743 * Set the target of the cascade sections to the given expression. 3621 * Set the target of the cascade sections to the given expression.
3744 * 3622 *
3745 * @param target the target of the cascade sections 3623 * @param target the target of the cascade sections
3746 */ 3624 */
3747 void set target(Expression target) { 3625 void set target(Expression target) {
3748 this._target = becomeParentOf(target); 3626 _target = becomeParentOf(target);
3749 } 3627 }
3750 3628
3751 @override 3629 @override
3752 void visitChildren(AstVisitor visitor) { 3630 void visitChildren(AstVisitor visitor) {
3753 safelyVisitChild(_target, visitor); 3631 safelyVisitChild(_target, visitor);
3754 _cascadeSections.accept(visitor); 3632 _cascadeSections.accept(visitor);
3755 } 3633 }
3756 } 3634 }
3757 3635
3758 /** 3636 /**
(...skipping 21 matching lines...) Expand all
3780 TypeName _exceptionType; 3658 TypeName _exceptionType;
3781 3659
3782 /** 3660 /**
3783 * The token representing the 'catch' keyword, or `null` if there is no 'catch ' keyword. 3661 * The token representing the 'catch' keyword, or `null` if there is no 'catch ' keyword.
3784 */ 3662 */
3785 Token catchKeyword; 3663 Token catchKeyword;
3786 3664
3787 /** 3665 /**
3788 * The left parenthesis. 3666 * The left parenthesis.
3789 */ 3667 */
3790 Token _leftParenthesis; 3668 Token leftParenthesis;
3791 3669
3792 /** 3670 /**
3793 * The parameter whose value will be the exception that was thrown. 3671 * The parameter whose value will be the exception that was thrown.
3794 */ 3672 */
3795 SimpleIdentifier _exceptionParameter; 3673 SimpleIdentifier _exceptionParameter;
3796 3674
3797 /** 3675 /**
3798 * The comma separating the exception parameter from the stack trace parameter , or `null` if 3676 * The comma separating the exception parameter from the stack trace parameter , or `null` if
3799 * there is no stack trace parameter. 3677 * there is no stack trace parameter.
3800 */ 3678 */
3801 Token comma; 3679 Token comma;
3802 3680
3803 /** 3681 /**
3804 * The parameter whose value will be the stack trace associated with the excep tion, or 3682 * The parameter whose value will be the stack trace associated with the excep tion, or
3805 * `null` if there is no stack trace parameter. 3683 * `null` if there is no stack trace parameter.
3806 */ 3684 */
3807 SimpleIdentifier _stackTraceParameter; 3685 SimpleIdentifier _stackTraceParameter;
3808 3686
3809 /** 3687 /**
3810 * The right parenthesis. 3688 * The right parenthesis.
3811 */ 3689 */
3812 Token _rightParenthesis; 3690 Token rightParenthesis;
3813 3691
3814 /** 3692 /**
3815 * The body of the catch block. 3693 * The body of the catch block.
3816 */ 3694 */
3817 Block _body; 3695 Block _body;
3818 3696
3819 /** 3697 /**
3820 * Initialize a newly created catch clause. 3698 * Initialize a newly created catch clause.
3821 * 3699 *
3822 * @param onKeyword the token representing the 'on' keyword 3700 * @param onKeyword the token representing the 'on' keyword
3823 * @param exceptionType the type of exceptions caught by this catch clause 3701 * @param exceptionType the type of exceptions caught by this catch clause
3824 * @param leftParenthesis the left parenthesis 3702 * @param leftParenthesis the left parenthesis
3825 * @param exceptionParameter the parameter whose value will be the exception t hat was thrown 3703 * @param exceptionParameter the parameter whose value will be the exception t hat was thrown
3826 * @param comma the comma separating the exception parameter from the stack tr ace parameter 3704 * @param comma the comma separating the exception parameter from the stack tr ace parameter
3827 * @param stackTraceParameter the parameter whose value will be the stack trac e associated with 3705 * @param stackTraceParameter the parameter whose value will be the stack trac e associated with
3828 * the exception 3706 * the exception
3829 * @param rightParenthesis the right parenthesis 3707 * @param rightParenthesis the right parenthesis
3830 * @param body the body of the catch block 3708 * @param body the body of the catch block
3831 */ 3709 */
3832 CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword, Token l eftParenthesis, SimpleIdentifier exceptionParameter, this.comma, SimpleIdentifie r stackTraceParameter, Token rightParenthesis, Block body) { 3710 CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword, this.le ftParenthesis, SimpleIdentifier exceptionParameter, this.comma, SimpleIdentifier stackTraceParameter, this.rightParenthesis, Block body) {
3833 this._exceptionType = becomeParentOf(exceptionType); 3711 _exceptionType = becomeParentOf(exceptionType);
3834 this._leftParenthesis = leftParenthesis; 3712 _exceptionParameter = becomeParentOf(exceptionParameter);
3835 this._exceptionParameter = becomeParentOf(exceptionParameter); 3713 _stackTraceParameter = becomeParentOf(stackTraceParameter);
3836 this._stackTraceParameter = becomeParentOf(stackTraceParameter); 3714 _body = becomeParentOf(body);
3837 this._rightParenthesis = rightParenthesis;
3838 this._body = becomeParentOf(body);
3839 } 3715 }
3840 3716
3841 @override 3717 @override
3842 accept(AstVisitor visitor) => visitor.visitCatchClause(this); 3718 accept(AstVisitor visitor) => visitor.visitCatchClause(this);
3843 3719
3844 @override 3720 @override
3845 Token get beginToken { 3721 Token get beginToken {
3846 if (onKeyword != null) { 3722 if (onKeyword != null) {
3847 return onKeyword; 3723 return onKeyword;
3848 } 3724 }
(...skipping 19 matching lines...) Expand all
3868 3744
3869 /** 3745 /**
3870 * Return the type of exceptions caught by this catch clause, or `null` if thi s catch clause 3746 * Return the type of exceptions caught by this catch clause, or `null` if thi s catch clause
3871 * catches every type of exception. 3747 * catches every type of exception.
3872 * 3748 *
3873 * @return the type of exceptions caught by this catch clause 3749 * @return the type of exceptions caught by this catch clause
3874 */ 3750 */
3875 TypeName get exceptionType => _exceptionType; 3751 TypeName get exceptionType => _exceptionType;
3876 3752
3877 /** 3753 /**
3878 * Return the left parenthesis.
3879 *
3880 * @return the left parenthesis
3881 */
3882 Token get leftParenthesis => _leftParenthesis;
3883
3884 /**
3885 * Return the right parenthesis.
3886 *
3887 * @return the right parenthesis
3888 */
3889 Token get rightParenthesis => _rightParenthesis;
3890
3891 /**
3892 * Return the parameter whose value will be the stack trace associated with th e exception, or 3754 * Return the parameter whose value will be the stack trace associated with th e exception, or
3893 * `null` if there is no stack trace parameter. 3755 * `null` if there is no stack trace parameter.
3894 * 3756 *
3895 * @return the parameter whose value will be the stack trace associated with t he exception 3757 * @return the parameter whose value will be the stack trace associated with t he exception
3896 */ 3758 */
3897 SimpleIdentifier get stackTraceParameter => _stackTraceParameter; 3759 SimpleIdentifier get stackTraceParameter => _stackTraceParameter;
3898 3760
3899 /** 3761 /**
3900 * Set the body of the catch block to the given block. 3762 * Set the body of the catch block to the given block.
3901 * 3763 *
(...skipping 11 matching lines...) Expand all
3913 void set exceptionParameter(SimpleIdentifier parameter) { 3775 void set exceptionParameter(SimpleIdentifier parameter) {
3914 _exceptionParameter = becomeParentOf(parameter); 3776 _exceptionParameter = becomeParentOf(parameter);
3915 } 3777 }
3916 3778
3917 /** 3779 /**
3918 * Set the type of exceptions caught by this catch clause to the given type. 3780 * Set the type of exceptions caught by this catch clause to the given type.
3919 * 3781 *
3920 * @param exceptionType the type of exceptions caught by this catch clause 3782 * @param exceptionType the type of exceptions caught by this catch clause
3921 */ 3783 */
3922 void set exceptionType(TypeName exceptionType) { 3784 void set exceptionType(TypeName exceptionType) {
3923 this._exceptionType = becomeParentOf(exceptionType); 3785 _exceptionType = becomeParentOf(exceptionType);
3924 } 3786 }
3925 3787
3926 /** 3788 /**
3927 * Set the left parenthesis to the given token.
3928 *
3929 * @param parenthesis the left parenthesis
3930 */
3931 void set leftParenthesis(Token parenthesis) {
3932 _leftParenthesis = parenthesis;
3933 }
3934
3935 /**
3936 * Set the right parenthesis to the given token.
3937 *
3938 * @param parenthesis the right parenthesis
3939 */
3940 void set rightParenthesis(Token parenthesis) {
3941 _rightParenthesis = parenthesis;
3942 }
3943
3944 /**
3945 * Set the parameter whose value will be the stack trace associated with the e xception to the 3789 * Set the parameter whose value will be the stack trace associated with the e xception to the
3946 * given parameter. 3790 * given parameter.
3947 * 3791 *
3948 * @param parameter the parameter whose value will be the stack trace associat ed with the 3792 * @param parameter the parameter whose value will be the stack trace associat ed with the
3949 * exception 3793 * exception
3950 */ 3794 */
3951 void set stackTraceParameter(SimpleIdentifier parameter) { 3795 void set stackTraceParameter(SimpleIdentifier parameter) {
3952 _stackTraceParameter = becomeParentOf(parameter); 3796 _stackTraceParameter = becomeParentOf(parameter);
3953 } 3797 }
3954 3798
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
4040 * @param name the name of the class being declared 3884 * @param name the name of the class being declared
4041 * @param typeParameters the type parameters for the class 3885 * @param typeParameters the type parameters for the class
4042 * @param extendsClause the extends clause for the class 3886 * @param extendsClause the extends clause for the class
4043 * @param withClause the with clause for the class 3887 * @param withClause the with clause for the class
4044 * @param implementsClause the implements clause for the class 3888 * @param implementsClause the implements clause for the class
4045 * @param leftBracket the left curly bracket 3889 * @param leftBracket the left curly bracket
4046 * @param members the members defined by the class 3890 * @param members the members defined by the class
4047 * @param rightBracket the right curly bracket 3891 * @param rightBracket the right curly bracket
4048 */ 3892 */
4049 ClassDeclaration(Comment comment, List<Annotation> metadata, this.abstractKeyw ord, this.classKeyword, SimpleIdentifier name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause implements Clause, this.leftBracket, List<ClassMember> members, this.rightBracket) : super( comment, metadata) { 3893 ClassDeclaration(Comment comment, List<Annotation> metadata, this.abstractKeyw ord, this.classKeyword, SimpleIdentifier name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause implements Clause, this.leftBracket, List<ClassMember> members, this.rightBracket) : super( comment, metadata) {
4050 this._members = new NodeList<ClassMember>(this); 3894 _name = becomeParentOf(name);
4051 this._name = becomeParentOf(name); 3895 _typeParameters = becomeParentOf(typeParameters);
4052 this._typeParameters = becomeParentOf(typeParameters); 3896 _extendsClause = becomeParentOf(extendsClause);
4053 this._extendsClause = becomeParentOf(extendsClause); 3897 _withClause = becomeParentOf(withClause);
4054 this._withClause = becomeParentOf(withClause); 3898 _implementsClause = becomeParentOf(implementsClause);
4055 this._implementsClause = becomeParentOf(implementsClause); 3899 _members = new NodeList<ClassMember>(this, members);
4056 this._members.addAll(members);
4057 } 3900 }
4058 3901
4059 @override 3902 @override
4060 accept(AstVisitor visitor) => visitor.visitClassDeclaration(this); 3903 accept(AstVisitor visitor) => visitor.visitClassDeclaration(this);
4061 3904
4062 /** 3905 /**
4063 * Return the constructor declared in the class with the given name. 3906 * Return the constructor declared in the class with the given name.
4064 * 3907 *
4065 * @param name the name of the constructor to find, `null` for default 3908 * @param name the name of the constructor to find, `null` for default
4066 * @return the found constructor or `null` if not found 3909 * @return the found constructor or `null` if not found
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
4187 * @return `true` if this class is declared to be an abstract class 4030 * @return `true` if this class is declared to be an abstract class
4188 */ 4031 */
4189 bool get isAbstract => abstractKeyword != null; 4032 bool get isAbstract => abstractKeyword != null;
4190 4033
4191 /** 4034 /**
4192 * Set the extends clause for this class to the given clause. 4035 * Set the extends clause for this class to the given clause.
4193 * 4036 *
4194 * @param extendsClause the extends clause for this class 4037 * @param extendsClause the extends clause for this class
4195 */ 4038 */
4196 void set extendsClause(ExtendsClause extendsClause) { 4039 void set extendsClause(ExtendsClause extendsClause) {
4197 this._extendsClause = becomeParentOf(extendsClause); 4040 _extendsClause = becomeParentOf(extendsClause);
4198 } 4041 }
4199 4042
4200 /** 4043 /**
4201 * Set the implements clause for the class to the given clause. 4044 * Set the implements clause for the class to the given clause.
4202 * 4045 *
4203 * @param implementsClause the implements clause for the class 4046 * @param implementsClause the implements clause for the class
4204 */ 4047 */
4205 void set implementsClause(ImplementsClause implementsClause) { 4048 void set implementsClause(ImplementsClause implementsClause) {
4206 this._implementsClause = becomeParentOf(implementsClause); 4049 _implementsClause = becomeParentOf(implementsClause);
4207 } 4050 }
4208 4051
4209 /** 4052 /**
4210 * Set the name of the class being declared to the given identifier. 4053 * Set the name of the class being declared to the given identifier.
4211 * 4054 *
4212 * @param identifier the name of the class being declared 4055 * @param identifier the name of the class being declared
4213 */ 4056 */
4214 void set name(SimpleIdentifier identifier) { 4057 void set name(SimpleIdentifier identifier) {
4215 _name = becomeParentOf(identifier); 4058 _name = becomeParentOf(identifier);
4216 } 4059 }
4217 4060
4218 /** 4061 /**
4219 * Set the native clause for this class to the given clause. 4062 * Set the native clause for this class to the given clause.
4220 * 4063 *
4221 * @param nativeClause the native clause for this class 4064 * @param nativeClause the native clause for this class
4222 */ 4065 */
4223 void set nativeClause(NativeClause nativeClause) { 4066 void set nativeClause(NativeClause nativeClause) {
4224 this._nativeClause = becomeParentOf(nativeClause); 4067 _nativeClause = becomeParentOf(nativeClause);
4225 } 4068 }
4226 4069
4227 /** 4070 /**
4228 * Set the type parameters for the class to the given list of type parameters. 4071 * Set the type parameters for the class to the given list of type parameters.
4229 * 4072 *
4230 * @param typeParameters the type parameters for the class 4073 * @param typeParameters the type parameters for the class
4231 */ 4074 */
4232 void set typeParameters(TypeParameterList typeParameters) { 4075 void set typeParameters(TypeParameterList typeParameters) {
4233 this._typeParameters = becomeParentOf(typeParameters); 4076 _typeParameters = becomeParentOf(typeParameters);
4234 } 4077 }
4235 4078
4236 /** 4079 /**
4237 * Set the with clause for the class to the given clause. 4080 * Set the with clause for the class to the given clause.
4238 * 4081 *
4239 * @param withClause the with clause for the class 4082 * @param withClause the with clause for the class
4240 */ 4083 */
4241 void set withClause(WithClause withClause) { 4084 void set withClause(WithClause withClause) {
4242 this._withClause = becomeParentOf(withClause); 4085 _withClause = becomeParentOf(withClause);
4243 } 4086 }
4244 4087
4245 @override 4088 @override
4246 void visitChildren(AstVisitor visitor) { 4089 void visitChildren(AstVisitor visitor) {
4247 super.visitChildren(visitor); 4090 super.visitChildren(visitor);
4248 safelyVisitChild(_name, visitor); 4091 safelyVisitChild(_name, visitor);
4249 safelyVisitChild(_typeParameters, visitor); 4092 safelyVisitChild(_typeParameters, visitor);
4250 safelyVisitChild(_extendsClause, visitor); 4093 safelyVisitChild(_extendsClause, visitor);
4251 safelyVisitChild(_withClause, visitor); 4094 safelyVisitChild(_withClause, visitor);
4252 safelyVisitChild(_implementsClause, visitor); 4095 safelyVisitChild(_implementsClause, visitor);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
4335 * @param name the name of the class being declared 4178 * @param name the name of the class being declared
4336 * @param typeParameters the type parameters for the class 4179 * @param typeParameters the type parameters for the class
4337 * @param equals the token for the '=' separating the name from the definition 4180 * @param equals the token for the '=' separating the name from the definition
4338 * @param abstractKeyword the token for the 'abstract' keyword 4181 * @param abstractKeyword the token for the 'abstract' keyword
4339 * @param superclass the name of the superclass of the class being declared 4182 * @param superclass the name of the superclass of the class being declared
4340 * @param withClause the with clause for this class 4183 * @param withClause the with clause for this class
4341 * @param implementsClause the implements clause for this class 4184 * @param implementsClause the implements clause for this class
4342 * @param semicolon the semicolon terminating the declaration 4185 * @param semicolon the semicolon terminating the declaration
4343 */ 4186 */
4344 ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, Simp leIdentifier name, TypeParameterList typeParameters, this.equals, this.abstractK eyword, TypeName superclass, WithClause withClause, ImplementsClause implementsC lause, Token semicolon) : super(comment, metadata, keyword, semicolon) { 4187 ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, Simp leIdentifier name, TypeParameterList typeParameters, this.equals, this.abstractK eyword, TypeName superclass, WithClause withClause, ImplementsClause implementsC lause, Token semicolon) : super(comment, metadata, keyword, semicolon) {
4345 this._name = becomeParentOf(name); 4188 _name = becomeParentOf(name);
4346 this._typeParameters = becomeParentOf(typeParameters); 4189 _typeParameters = becomeParentOf(typeParameters);
4347 this._superclass = becomeParentOf(superclass); 4190 _superclass = becomeParentOf(superclass);
4348 this._withClause = becomeParentOf(withClause); 4191 _withClause = becomeParentOf(withClause);
4349 this._implementsClause = becomeParentOf(implementsClause); 4192 _implementsClause = becomeParentOf(implementsClause);
4350 } 4193 }
4351 4194
4352 @override 4195 @override
4353 accept(AstVisitor visitor) => visitor.visitClassTypeAlias(this); 4196 accept(AstVisitor visitor) => visitor.visitClassTypeAlias(this);
4354 4197
4355 @override 4198 @override
4356 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme nt) : null; 4199 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme nt) : null;
4357 4200
4358 /** 4201 /**
4359 * Return the implements clause for this class, or `null` if there is no imple ments clause. 4202 * Return the implements clause for this class, or `null` if there is no imple ments clause.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
4397 * @return `true` if this class is declared to be an abstract class 4240 * @return `true` if this class is declared to be an abstract class
4398 */ 4241 */
4399 bool get isAbstract => abstractKeyword != null; 4242 bool get isAbstract => abstractKeyword != null;
4400 4243
4401 /** 4244 /**
4402 * Set the implements clause for this class to the given implements clause. 4245 * Set the implements clause for this class to the given implements clause.
4403 * 4246 *
4404 * @param implementsClause the implements clause for this class 4247 * @param implementsClause the implements clause for this class
4405 */ 4248 */
4406 void set implementsClause(ImplementsClause implementsClause) { 4249 void set implementsClause(ImplementsClause implementsClause) {
4407 this._implementsClause = becomeParentOf(implementsClause); 4250 _implementsClause = becomeParentOf(implementsClause);
4408 } 4251 }
4409 4252
4410 /** 4253 /**
4411 * Set the name of the class being declared to the given identifier. 4254 * Set the name of the class being declared to the given identifier.
4412 * 4255 *
4413 * @param name the name of the class being declared 4256 * @param name the name of the class being declared
4414 */ 4257 */
4415 void set name(SimpleIdentifier name) { 4258 void set name(SimpleIdentifier name) {
4416 this._name = becomeParentOf(name); 4259 _name = becomeParentOf(name);
4417 } 4260 }
4418 4261
4419 /** 4262 /**
4420 * Set the name of the superclass of the class being declared to the given nam e. 4263 * Set the name of the superclass of the class being declared to the given nam e.
4421 * 4264 *
4422 * @param superclass the name of the superclass of the class being declared 4265 * @param superclass the name of the superclass of the class being declared
4423 */ 4266 */
4424 void set superclass(TypeName superclass) { 4267 void set superclass(TypeName superclass) {
4425 this._superclass = becomeParentOf(superclass); 4268 _superclass = becomeParentOf(superclass);
4426 } 4269 }
4427 4270
4428 /** 4271 /**
4429 * Set the type parameters for the class to the given list of parameters. 4272 * Set the type parameters for the class to the given list of parameters.
4430 * 4273 *
4431 * @param typeParameters the type parameters for the class 4274 * @param typeParameters the type parameters for the class
4432 */ 4275 */
4433 void set typeParameters(TypeParameterList typeParameters) { 4276 void set typeParameters(TypeParameterList typeParameters) {
4434 this._typeParameters = becomeParentOf(typeParameters); 4277 _typeParameters = becomeParentOf(typeParameters);
4435 } 4278 }
4436 4279
4437 /** 4280 /**
4438 * Set the with clause for this class to the given with clause. 4281 * Set the with clause for this class to the given with clause.
4439 * 4282 *
4440 * @param withClause the with clause for this class 4283 * @param withClause the with clause for this class
4441 */ 4284 */
4442 void set withClause(WithClause withClause) { 4285 void set withClause(WithClause withClause) {
4443 this._withClause = becomeParentOf(withClause); 4286 _withClause = becomeParentOf(withClause);
4444 } 4287 }
4445 4288
4446 @override 4289 @override
4447 void visitChildren(AstVisitor visitor) { 4290 void visitChildren(AstVisitor visitor) {
4448 super.visitChildren(visitor); 4291 super.visitChildren(visitor);
4449 safelyVisitChild(_name, visitor); 4292 safelyVisitChild(_name, visitor);
4450 safelyVisitChild(_typeParameters, visitor); 4293 safelyVisitChild(_typeParameters, visitor);
4451 safelyVisitChild(_superclass, visitor); 4294 safelyVisitChild(_superclass, visitor);
4452 safelyVisitChild(_withClause, visitor); 4295 safelyVisitChild(_withClause, visitor);
4453 safelyVisitChild(_implementsClause, visitor); 4296 safelyVisitChild(_implementsClause, visitor);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
4553 NodeList<CommentReference> _references; 4396 NodeList<CommentReference> _references;
4554 4397
4555 /** 4398 /**
4556 * Initialize a newly created comment. 4399 * Initialize a newly created comment.
4557 * 4400 *
4558 * @param tokens the tokens representing the comment 4401 * @param tokens the tokens representing the comment
4559 * @param type the type of the comment 4402 * @param type the type of the comment
4560 * @param references the references embedded within the documentation comment 4403 * @param references the references embedded within the documentation comment
4561 */ 4404 */
4562 Comment(this.tokens, this._type, List<CommentReference> references) { 4405 Comment(this.tokens, this._type, List<CommentReference> references) {
4563 this._references = new NodeList<CommentReference>(this); 4406 _references = new NodeList<CommentReference>(this, references);
4564 this._references.addAll(references);
4565 } 4407 }
4566 4408
4567 @override 4409 @override
4568 accept(AstVisitor visitor) => visitor.visitComment(this); 4410 accept(AstVisitor visitor) => visitor.visitComment(this);
4569 4411
4570 @override 4412 @override
4571 Token get beginToken => tokens[0]; 4413 Token get beginToken => tokens[0];
4572 4414
4573 @override 4415 @override
4574 Token get endToken => tokens[tokens.length - 1]; 4416 Token get endToken => tokens[tokens.length - 1];
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
4627 */ 4469 */
4628 Identifier _identifier; 4470 Identifier _identifier;
4629 4471
4630 /** 4472 /**
4631 * Initialize a newly created reference to a Dart element. 4473 * Initialize a newly created reference to a Dart element.
4632 * 4474 *
4633 * @param newKeyword the token representing the 'new' keyword 4475 * @param newKeyword the token representing the 'new' keyword
4634 * @param identifier the identifier being referenced 4476 * @param identifier the identifier being referenced
4635 */ 4477 */
4636 CommentReference(this.newKeyword, Identifier identifier) { 4478 CommentReference(this.newKeyword, Identifier identifier) {
4637 this._identifier = becomeParentOf(identifier); 4479 _identifier = becomeParentOf(identifier);
4638 } 4480 }
4639 4481
4640 @override 4482 @override
4641 accept(AstVisitor visitor) => visitor.visitCommentReference(this); 4483 accept(AstVisitor visitor) => visitor.visitCommentReference(this);
4642 4484
4643 @override 4485 @override
4644 Token get beginToken => _identifier.beginToken; 4486 Token get beginToken => _identifier.beginToken;
4645 4487
4646 @override 4488 @override
4647 Token get endToken => _identifier.endToken; 4489 Token get endToken => _identifier.endToken;
4648 4490
4649 /** 4491 /**
4650 * Return the identifier being referenced. 4492 * Return the identifier being referenced.
4651 * 4493 *
4652 * @return the identifier being referenced 4494 * @return the identifier being referenced
4653 */ 4495 */
4654 Identifier get identifier => _identifier; 4496 Identifier get identifier => _identifier;
4655 4497
4656 /** 4498 /**
4657 * Set the identifier being referenced to the given identifier. 4499 * Set the identifier being referenced to the given identifier.
4658 * 4500 *
4659 * @param identifier the identifier being referenced 4501 * @param identifier the identifier being referenced
4660 */ 4502 */
4661 void set identifier(Identifier identifier) { 4503 void set identifier(Identifier identifier) {
4662 this._identifier = becomeParentOf(identifier); 4504 _identifier = becomeParentOf(identifier);
4663 } 4505 }
4664 4506
4665 @override 4507 @override
4666 void visitChildren(AstVisitor visitor) { 4508 void visitChildren(AstVisitor visitor) {
4667 safelyVisitChild(_identifier, visitor); 4509 safelyVisitChild(_identifier, visitor);
4668 } 4510 }
4669 } 4511 }
4670 4512
4671 /** 4513 /**
4672 * The enumeration `CommentType` encodes all the different types of comments tha t are 4514 * The enumeration `CommentType` encodes all the different types of comments
4673 * recognized by the parser. 4515 * that are recognized by the parser.
4674 */ 4516 */
4675 class CommentType extends Enum<CommentType> { 4517 class CommentType {
4676 /** 4518 /**
4677 * An end-of-line comment. 4519 * The name of the comment type.
4678 */ 4520 */
4679 static const CommentType END_OF_LINE = const CommentType('END_OF_LINE', 0); 4521 final String name;
4680 4522
4681 /** 4523 /**
4682 * A block comment. 4524 * A block comment.
4683 */ 4525 */
4684 static const CommentType BLOCK = const CommentType('BLOCK', 1); 4526 static const CommentType BLOCK = const CommentType('BLOCK');
4685 4527
4686 /** 4528 /**
4687 * A documentation comment. 4529 * A documentation comment.
4688 */ 4530 */
4689 static const CommentType DOCUMENTATION = const CommentType('DOCUMENTATION', 2) ; 4531 static const CommentType DOCUMENTATION = const CommentType('DOCUMENTATION');
4690 4532
4691 static const List<CommentType> values = const [END_OF_LINE, BLOCK, DOCUMENTATI ON]; 4533 /**
4534 * An end-of-line comment.
4535 */
4536 static const CommentType END_OF_LINE = const CommentType('END_OF_LINE');
4692 4537
4693 const CommentType(String name, int ordinal) : super(name, ordinal); 4538 /**
4539 * Initialize a newly created comment type to have the given [name].
4540 */
4541 const CommentType(this.name);
4542
4543 @override
4544 String toString() => name;
4694 } 4545 }
4695 4546
4696 /** 4547 /**
4697 * Instances of the class `CompilationUnit` represent a compilation unit. 4548 * Instances of the class `CompilationUnit` represent a compilation unit.
4698 * 4549 *
4699 * While the grammar restricts the order of the directives and declarations with in a compilation 4550 * While the grammar restricts the order of the directives and declarations with in a compilation
4700 * unit, this class does not enforce those restrictions. In particular, the chil dren of a 4551 * unit, this class does not enforce those restrictions. In particular, the chil dren of a
4701 * compilation unit will be visited in lexical order even if lexical order does not conform to the 4552 * compilation unit will be visited in lexical order even if lexical order does not conform to the
4702 * restrictions of the grammar. 4553 * restrictions of the grammar.
4703 * 4554 *
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
4759 /** 4610 /**
4760 * Initialize a newly created compilation unit to have the given directives an d declarations. 4611 * Initialize a newly created compilation unit to have the given directives an d declarations.
4761 * 4612 *
4762 * @param beginToken the first token in the token stream 4613 * @param beginToken the first token in the token stream
4763 * @param scriptTag the script tag at the beginning of the compilation unit 4614 * @param scriptTag the script tag at the beginning of the compilation unit
4764 * @param directives the directives contained in this compilation unit 4615 * @param directives the directives contained in this compilation unit
4765 * @param declarations the declarations contained in this compilation unit 4616 * @param declarations the declarations contained in this compilation unit
4766 * @param endToken the last token in the token stream 4617 * @param endToken the last token in the token stream
4767 */ 4618 */
4768 CompilationUnit(this.beginToken, ScriptTag scriptTag, List<Directive> directiv es, List<CompilationUnitMember> declarations, this.endToken) { 4619 CompilationUnit(this.beginToken, ScriptTag scriptTag, List<Directive> directiv es, List<CompilationUnitMember> declarations, this.endToken) {
4769 this._directives = new NodeList<Directive>(this); 4620 _scriptTag = becomeParentOf(scriptTag);
4770 this._declarations = new NodeList<CompilationUnitMember>(this); 4621 _directives = new NodeList<Directive>(this, directives);
4771 this._scriptTag = becomeParentOf(scriptTag); 4622 _declarations = new NodeList<CompilationUnitMember>(this, declarations);
4772 this._directives.addAll(directives);
4773 this._declarations.addAll(declarations);
4774 } 4623 }
4775 4624
4776 @override 4625 @override
4777 accept(AstVisitor visitor) => visitor.visitCompilationUnit(this); 4626 accept(AstVisitor visitor) => visitor.visitCompilationUnit(this);
4778 4627
4779 /** 4628 /**
4780 * Return the declarations contained in this compilation unit. 4629 * Return the declarations contained in this compilation unit.
4781 * 4630 *
4782 * @return the declarations contained in this compilation unit 4631 * @return the declarations contained in this compilation unit
4783 */ 4632 */
(...skipping 25 matching lines...) Expand all
4809 * @return the script tag at the beginning of the compilation unit 4658 * @return the script tag at the beginning of the compilation unit
4810 */ 4659 */
4811 ScriptTag get scriptTag => _scriptTag; 4660 ScriptTag get scriptTag => _scriptTag;
4812 4661
4813 /** 4662 /**
4814 * Set the script tag at the beginning of the compilation unit to the given sc ript tag. 4663 * Set the script tag at the beginning of the compilation unit to the given sc ript tag.
4815 * 4664 *
4816 * @param scriptTag the script tag at the beginning of the compilation unit 4665 * @param scriptTag the script tag at the beginning of the compilation unit
4817 */ 4666 */
4818 void set scriptTag(ScriptTag scriptTag) { 4667 void set scriptTag(ScriptTag scriptTag) {
4819 this._scriptTag = becomeParentOf(scriptTag); 4668 _scriptTag = becomeParentOf(scriptTag);
4820 } 4669 }
4821 4670
4822 @override 4671 @override
4823 void visitChildren(AstVisitor visitor) { 4672 void visitChildren(AstVisitor visitor) {
4824 safelyVisitChild(_scriptTag, visitor); 4673 safelyVisitChild(_scriptTag, visitor);
4825 if (_directivesAreBeforeDeclarations()) { 4674 if (_directivesAreBeforeDeclarations()) {
4826 _directives.accept(visitor); 4675 _directives.accept(visitor);
4827 _declarations.accept(visitor); 4676 _declarations.accept(visitor);
4828 } else { 4677 } else {
4829 for (AstNode child in sortedDirectivesAndDeclarations) { 4678 for (AstNode child in sortedDirectivesAndDeclarations) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
4924 * 4773 *
4925 * @param condition the condition used to determine which expression is execut ed next 4774 * @param condition the condition used to determine which expression is execut ed next
4926 * @param question the token used to separate the condition from the then expr ession 4775 * @param question the token used to separate the condition from the then expr ession
4927 * @param thenExpression the expression that is executed if the condition eval uates to 4776 * @param thenExpression the expression that is executed if the condition eval uates to
4928 * `true` 4777 * `true`
4929 * @param colon the token used to separate the then expression from the else e xpression 4778 * @param colon the token used to separate the then expression from the else e xpression
4930 * @param elseExpression the expression that is executed if the condition eval uates to 4779 * @param elseExpression the expression that is executed if the condition eval uates to
4931 * `false` 4780 * `false`
4932 */ 4781 */
4933 ConditionalExpression(Expression condition, this.question, Expression thenExpr ession, this.colon, Expression elseExpression) { 4782 ConditionalExpression(Expression condition, this.question, Expression thenExpr ession, this.colon, Expression elseExpression) {
4934 this._condition = becomeParentOf(condition); 4783 _condition = becomeParentOf(condition);
4935 this._thenExpression = becomeParentOf(thenExpression); 4784 _thenExpression = becomeParentOf(thenExpression);
4936 this._elseExpression = becomeParentOf(elseExpression); 4785 _elseExpression = becomeParentOf(elseExpression);
4937 } 4786 }
4938 4787
4939 @override 4788 @override
4940 accept(AstVisitor visitor) => visitor.visitConditionalExpression(this); 4789 accept(AstVisitor visitor) => visitor.visitConditionalExpression(this);
4941 4790
4942 @override 4791 @override
4943 Token get beginToken => _condition.beginToken; 4792 Token get beginToken => _condition.beginToken;
4944 4793
4945 /** 4794 /**
4946 * Return the condition used to determine which of the expressions is executed next. 4795 * Return the condition used to determine which of the expressions is executed next.
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
5474 * @param period the token for the period before the constructor name 5323 * @param period the token for the period before the constructor name
5475 * @param name the name of the constructor 5324 * @param name the name of the constructor
5476 * @param parameters the parameters associated with the constructor 5325 * @param parameters the parameters associated with the constructor
5477 * @param separator the token for the colon or equals before the initializers 5326 * @param separator the token for the colon or equals before the initializers
5478 * @param initializers the initializers associated with the constructor 5327 * @param initializers the initializers associated with the constructor
5479 * @param redirectedConstructor the name of the constructor to which this cons tructor will be 5328 * @param redirectedConstructor the name of the constructor to which this cons tructor will be
5480 * redirected 5329 * redirected
5481 * @param body the body of the constructor 5330 * @param body the body of the constructor
5482 */ 5331 */
5483 ConstructorDeclaration(Comment comment, List<Annotation> metadata, this.extern alKeyword, this.constKeyword, this.factoryKeyword, Identifier returnType, this.p eriod, SimpleIdentifier name, FormalParameterList parameters, this.separator, Li st<ConstructorInitializer> initializers, ConstructorName redirectedConstructor, FunctionBody body) : super(comment, metadata) { 5332 ConstructorDeclaration(Comment comment, List<Annotation> metadata, this.extern alKeyword, this.constKeyword, this.factoryKeyword, Identifier returnType, this.p eriod, SimpleIdentifier name, FormalParameterList parameters, this.separator, Li st<ConstructorInitializer> initializers, ConstructorName redirectedConstructor, FunctionBody body) : super(comment, metadata) {
5484 this._initializers = new NodeList<ConstructorInitializer>(this); 5333 _returnType = becomeParentOf(returnType);
5485 this._returnType = becomeParentOf(returnType); 5334 _name = becomeParentOf(name);
5486 this._name = becomeParentOf(name); 5335 _parameters = becomeParentOf(parameters);
5487 this._parameters = becomeParentOf(parameters); 5336 _initializers = new NodeList<ConstructorInitializer>(this, initializers);
5488 this._initializers.addAll(initializers); 5337 _redirectedConstructor = becomeParentOf(redirectedConstructor);
5489 this._redirectedConstructor = becomeParentOf(redirectedConstructor); 5338 _body = becomeParentOf(body);
5490 this._body = becomeParentOf(body);
5491 } 5339 }
5492 5340
5493 @override 5341 @override
5494 accept(AstVisitor visitor) => visitor.visitConstructorDeclaration(this); 5342 accept(AstVisitor visitor) => visitor.visitConstructorDeclaration(this);
5495 5343
5496 /** 5344 /**
5497 * Return the body of the constructor, or `null` if the constructor does not h ave a body. 5345 * Return the body of the constructor, or `null` if the constructor does not h ave a body.
5498 * 5346 *
5499 * @return the body of the constructor 5347 * @return the body of the constructor
5500 */ 5348 */
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
5566 void set name(SimpleIdentifier identifier) { 5414 void set name(SimpleIdentifier identifier) {
5567 _name = becomeParentOf(identifier); 5415 _name = becomeParentOf(identifier);
5568 } 5416 }
5569 5417
5570 /** 5418 /**
5571 * Set the parameters associated with the constructor to the given list of par ameters. 5419 * Set the parameters associated with the constructor to the given list of par ameters.
5572 * 5420 *
5573 * @param parameters the parameters associated with the constructor 5421 * @param parameters the parameters associated with the constructor
5574 */ 5422 */
5575 void set parameters(FormalParameterList parameters) { 5423 void set parameters(FormalParameterList parameters) {
5576 this._parameters = becomeParentOf(parameters); 5424 _parameters = becomeParentOf(parameters);
5577 } 5425 }
5578 5426
5579 /** 5427 /**
5580 * Set the name of the constructor to which this constructor will be redirecte d to the given 5428 * Set the name of the constructor to which this constructor will be redirecte d to the given
5581 * constructor name. 5429 * constructor name.
5582 * 5430 *
5583 * @param redirectedConstructor the name of the constructor to which this cons tructor will be 5431 * @param redirectedConstructor the name of the constructor to which this cons tructor will be
5584 * redirected 5432 * redirected
5585 */ 5433 */
5586 void set redirectedConstructor(ConstructorName redirectedConstructor) { 5434 void set redirectedConstructor(ConstructorName redirectedConstructor) {
5587 this._redirectedConstructor = becomeParentOf(redirectedConstructor); 5435 _redirectedConstructor = becomeParentOf(redirectedConstructor);
5588 } 5436 }
5589 5437
5590 /** 5438 /**
5591 * Set the type of object being created to the given type name. 5439 * Set the type of object being created to the given type name.
5592 * 5440 *
5593 * @param typeName the type of object being created 5441 * @param typeName the type of object being created
5594 */ 5442 */
5595 void set returnType(Identifier typeName) { 5443 void set returnType(Identifier typeName) {
5596 _returnType = becomeParentOf(typeName); 5444 _returnType = becomeParentOf(typeName);
5597 } 5445 }
5598 5446
5599 @override 5447 @override
5600 void visitChildren(AstVisitor visitor) { 5448 void visitChildren(AstVisitor visitor) {
5601 super.visitChildren(visitor); 5449 super.visitChildren(visitor);
5602 safelyVisitChild(_returnType, visitor); 5450 safelyVisitChild(_returnType, visitor);
5603 safelyVisitChild(_name, visitor); 5451 safelyVisitChild(_name, visitor);
5604 safelyVisitChild(_parameters, visitor); 5452 safelyVisitChild(_parameters, visitor);
5605 _initializers.accept(visitor); 5453 _initializers.accept(visitor);
5606 safelyVisitChild(_redirectedConstructor, visitor); 5454 safelyVisitChild(_redirectedConstructor, visitor);
5607 safelyVisitChild(_body, visitor); 5455 safelyVisitChild(_body, visitor);
5608 } 5456 }
5609 5457
5610 @override 5458 @override
5611 Token get firstTokenAfterCommentAndMetadata { 5459 Token get firstTokenAfterCommentAndMetadata {
5612 Token leftMost = _leftMost([externalKeyword, constKeyword, factoryKeyword]); 5460 Token leftMost = Token.lexicallyFirst([externalKeyword, constKeyword, factor yKeyword]);
5613 if (leftMost != null) { 5461 if (leftMost != null) {
5614 return leftMost; 5462 return leftMost;
5615 } 5463 }
5616 return _returnType.beginToken; 5464 return _returnType.beginToken;
5617 } 5465 }
5618
5619 /**
5620 * Return the left-most of the given tokens, or `null` if there are no tokens given or if
5621 * all of the given tokens are `null`.
5622 *
5623 * @param tokens the tokens being compared to find the left-most token
5624 * @return the left-most of the given tokens
5625 */
5626 Token _leftMost(List<Token> tokens) {
5627 Token leftMost = null;
5628 int offset = 2147483647;
5629 for (Token token in tokens) {
5630 if (token != null && token.offset < offset) {
5631 leftMost = token;
5632 }
5633 }
5634 return leftMost;
5635 }
5636 } 5466 }
5637 5467
5638 /** 5468 /**
5639 * Instances of the class `ConstructorFieldInitializer` represent the initializa tion of a 5469 * Instances of the class `ConstructorFieldInitializer` represent the initializa tion of a
5640 * field within a constructor's initialization list. 5470 * field within a constructor's initialization list.
5641 * 5471 *
5642 * <pre> 5472 * <pre>
5643 * fieldInitializer ::= 5473 * fieldInitializer ::=
5644 * ('this' '.')? [SimpleIdentifier] '=' [Expression] 5474 * ('this' '.')? [SimpleIdentifier] '=' [Expression]
5645 * </pre> 5475 * </pre>
(...skipping 29 matching lines...) Expand all
5675 * Initialize a newly created field initializer to initialize the field with t he given name to the 5505 * Initialize a newly created field initializer to initialize the field with t he given name to the
5676 * value of the given expression. 5506 * value of the given expression.
5677 * 5507 *
5678 * @param keyword the token for the 'this' keyword 5508 * @param keyword the token for the 'this' keyword
5679 * @param period the token for the period after the 'this' keyword 5509 * @param period the token for the period after the 'this' keyword
5680 * @param fieldName the name of the field being initialized 5510 * @param fieldName the name of the field being initialized
5681 * @param equals the token for the equal sign between the field name and the e xpression 5511 * @param equals the token for the equal sign between the field name and the e xpression
5682 * @param expression the expression computing the value to which the field wil l be initialized 5512 * @param expression the expression computing the value to which the field wil l be initialized
5683 */ 5513 */
5684 ConstructorFieldInitializer(this.keyword, this.period, SimpleIdentifier fieldN ame, this.equals, Expression expression) { 5514 ConstructorFieldInitializer(this.keyword, this.period, SimpleIdentifier fieldN ame, this.equals, Expression expression) {
5685 this._fieldName = becomeParentOf(fieldName); 5515 _fieldName = becomeParentOf(fieldName);
5686 this._expression = becomeParentOf(expression); 5516 _expression = becomeParentOf(expression);
5687 } 5517 }
5688 5518
5689 @override 5519 @override
5690 accept(AstVisitor visitor) => visitor.visitConstructorFieldInitializer(this); 5520 accept(AstVisitor visitor) => visitor.visitConstructorFieldInitializer(this);
5691 5521
5692 @override 5522 @override
5693 Token get beginToken { 5523 Token get beginToken {
5694 if (keyword != null) { 5524 if (keyword != null) {
5695 return keyword; 5525 return keyword;
5696 } 5526 }
(...skipping 17 matching lines...) Expand all
5714 */ 5544 */
5715 SimpleIdentifier get fieldName => _fieldName; 5545 SimpleIdentifier get fieldName => _fieldName;
5716 5546
5717 /** 5547 /**
5718 * Set the expression computing the value to which the field will be initializ ed to the given 5548 * Set the expression computing the value to which the field will be initializ ed to the given
5719 * expression. 5549 * expression.
5720 * 5550 *
5721 * @param expression the expression computing the value to which the field wil l be initialized 5551 * @param expression the expression computing the value to which the field wil l be initialized
5722 */ 5552 */
5723 void set expression(Expression expression) { 5553 void set expression(Expression expression) {
5724 this._expression = becomeParentOf(expression); 5554 _expression = becomeParentOf(expression);
5725 } 5555 }
5726 5556
5727 /** 5557 /**
5728 * Set the name of the field being initialized to the given identifier. 5558 * Set the name of the field being initialized to the given identifier.
5729 * 5559 *
5730 * @param identifier the name of the field being initialized 5560 * @param identifier the name of the field being initialized
5731 */ 5561 */
5732 void set fieldName(SimpleIdentifier identifier) { 5562 void set fieldName(SimpleIdentifier identifier) {
5733 _fieldName = becomeParentOf(identifier); 5563 _fieldName = becomeParentOf(identifier);
5734 } 5564 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
5777 * The name of the constructor, or `null` if the specified constructor is the unnamed 5607 * The name of the constructor, or `null` if the specified constructor is the unnamed
5778 * constructor. 5608 * constructor.
5779 */ 5609 */
5780 SimpleIdentifier _name; 5610 SimpleIdentifier _name;
5781 5611
5782 /** 5612 /**
5783 * The element associated with this constructor name based on static type info rmation, or 5613 * The element associated with this constructor name based on static type info rmation, or
5784 * `null` if the AST structure has not been resolved or if this constructor na me could not 5614 * `null` if the AST structure has not been resolved or if this constructor na me could not
5785 * be resolved. 5615 * be resolved.
5786 */ 5616 */
5787 ConstructorElement _staticElement; 5617 ConstructorElement staticElement;
5788 5618
5789 /** 5619 /**
5790 * Initialize a newly created constructor name. 5620 * Initialize a newly created constructor name.
5791 * 5621 *
5792 * @param type the name of the type defining the constructor 5622 * @param type the name of the type defining the constructor
5793 * @param period the token for the period before the constructor name 5623 * @param period the token for the period before the constructor name
5794 * @param name the name of the constructor 5624 * @param name the name of the constructor
5795 */ 5625 */
5796 ConstructorName(TypeName type, this.period, SimpleIdentifier name) { 5626 ConstructorName(TypeName type, this.period, SimpleIdentifier name) {
5797 this._type = becomeParentOf(type); 5627 _type = becomeParentOf(type);
5798 this._name = becomeParentOf(name); 5628 _name = becomeParentOf(name);
5799 } 5629 }
5800 5630
5801 @override 5631 @override
5802 accept(AstVisitor visitor) => visitor.visitConstructorName(this); 5632 accept(AstVisitor visitor) => visitor.visitConstructorName(this);
5803 5633
5804 @override 5634 @override
5805 Token get beginToken => _type.beginToken; 5635 Token get beginToken => _type.beginToken;
5806 5636
5807 @override 5637 @override
5808 Token get endToken { 5638 Token get endToken {
5809 if (_name != null) { 5639 if (_name != null) {
5810 return _name.endToken; 5640 return _name.endToken;
5811 } 5641 }
5812 return _type.endToken; 5642 return _type.endToken;
5813 } 5643 }
5814 5644
5815 /** 5645 /**
5816 * Return the name of the constructor, or `null` if the specified constructor is the unnamed 5646 * Return the name of the constructor, or `null` if the specified constructor is the unnamed
5817 * constructor. 5647 * constructor.
5818 * 5648 *
5819 * @return the name of the constructor 5649 * @return the name of the constructor
5820 */ 5650 */
5821 SimpleIdentifier get name => _name; 5651 SimpleIdentifier get name => _name;
5822 5652
5823 /** 5653 /**
5824 * Return the element associated with this constructor name based on static ty pe information, or
5825 * `null` if the AST structure has not been resolved or if this constructor na me could not
5826 * be resolved.
5827 *
5828 * @return the element associated with this constructor name
5829 */
5830 ConstructorElement get staticElement => _staticElement;
5831
5832 /**
5833 * Return the name of the type defining the constructor. 5654 * Return the name of the type defining the constructor.
5834 * 5655 *
5835 * @return the name of the type defining the constructor 5656 * @return the name of the type defining the constructor
5836 */ 5657 */
5837 TypeName get type => _type; 5658 TypeName get type => _type;
5838 5659
5839 /** 5660 /**
5840 * Set the name of the constructor to the given name. 5661 * Set the name of the constructor to the given name.
5841 * 5662 *
5842 * @param name the name of the constructor 5663 * @param name the name of the constructor
5843 */ 5664 */
5844 void set name(SimpleIdentifier name) { 5665 void set name(SimpleIdentifier name) {
5845 this._name = becomeParentOf(name); 5666 _name = becomeParentOf(name);
5846 } 5667 }
5847 5668
5848 /** 5669 /**
5849 * Set the element associated with this constructor name based on static type information to the
5850 * given element.
5851 *
5852 * @param element the element to be associated with this constructor name
5853 */
5854 void set staticElement(ConstructorElement element) {
5855 _staticElement = element;
5856 }
5857
5858 /**
5859 * Set the name of the type defining the constructor to the given type name. 5670 * Set the name of the type defining the constructor to the given type name.
5860 * 5671 *
5861 * @param type the name of the type defining the constructor 5672 * @param type the name of the type defining the constructor
5862 */ 5673 */
5863 void set type(TypeName type) { 5674 void set type(TypeName type) {
5864 this._type = becomeParentOf(type); 5675 _type = becomeParentOf(type);
5865 } 5676 }
5866 5677
5867 @override 5678 @override
5868 void visitChildren(AstVisitor visitor) { 5679 void visitChildren(AstVisitor visitor) {
5869 safelyVisitChild(_type, visitor); 5680 safelyVisitChild(_type, visitor);
5870 safelyVisitChild(_name, visitor); 5681 safelyVisitChild(_name, visitor);
5871 } 5682 }
5872 } 5683 }
5873 5684
5874 /** 5685 /**
(...skipping 21 matching lines...) Expand all
5896 Token semicolon; 5707 Token semicolon;
5897 5708
5898 /** 5709 /**
5899 * Initialize a newly created continue statement. 5710 * Initialize a newly created continue statement.
5900 * 5711 *
5901 * @param keyword the token representing the 'continue' keyword 5712 * @param keyword the token representing the 'continue' keyword
5902 * @param label the label associated with the statement 5713 * @param label the label associated with the statement
5903 * @param semicolon the semicolon terminating the statement 5714 * @param semicolon the semicolon terminating the statement
5904 */ 5715 */
5905 ContinueStatement(this.keyword, SimpleIdentifier label, this.semicolon) { 5716 ContinueStatement(this.keyword, SimpleIdentifier label, this.semicolon) {
5906 this._label = becomeParentOf(label); 5717 _label = becomeParentOf(label);
5907 } 5718 }
5908 5719
5909 @override 5720 @override
5910 accept(AstVisitor visitor) => visitor.visitContinueStatement(this); 5721 accept(AstVisitor visitor) => visitor.visitContinueStatement(this);
5911 5722
5912 @override 5723 @override
5913 Token get beginToken => keyword; 5724 Token get beginToken => keyword;
5914 5725
5915 @override 5726 @override
5916 Token get endToken => semicolon; 5727 Token get endToken => semicolon;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
5958 */ 5769 */
5959 Element get element; 5770 Element get element;
5960 } 5771 }
5961 5772
5962 /** 5773 /**
5963 * Instances of the class `DeclaredIdentifier` represent the declaration of a si ngle 5774 * Instances of the class `DeclaredIdentifier` represent the declaration of a si ngle
5964 * identifier. 5775 * identifier.
5965 * 5776 *
5966 * <pre> 5777 * <pre>
5967 * declaredIdentifier ::= 5778 * declaredIdentifier ::=
5968 * ([Annotation] finalConstVarOrType [SimpleIdentifier] 5779 * [Annotation] finalConstVarOrType [SimpleIdentifier]
5969 * </pre> 5780 * </pre>
5970 */ 5781 */
5971 class DeclaredIdentifier extends Declaration { 5782 class DeclaredIdentifier extends Declaration {
5972 /** 5783 /**
5973 * The token representing either the 'final', 'const' or 'var' keyword, or `nu ll` if no 5784 * The token representing either the 'final', 'const' or 'var' keyword, or `nu ll` if no
5974 * keyword was used. 5785 * keyword was used.
5975 */ 5786 */
5976 Token keyword; 5787 Token keyword;
5977 5788
5978 /** 5789 /**
(...skipping 10 matching lines...) Expand all
5989 /** 5800 /**
5990 * Initialize a newly created formal parameter. 5801 * Initialize a newly created formal parameter.
5991 * 5802 *
5992 * @param comment the documentation comment associated with this parameter 5803 * @param comment the documentation comment associated with this parameter
5993 * @param metadata the annotations associated with this parameter 5804 * @param metadata the annotations associated with this parameter
5994 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 5805 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
5995 * @param type the name of the declared type of the parameter 5806 * @param type the name of the declared type of the parameter
5996 * @param identifier the name of the parameter being declared 5807 * @param identifier the name of the parameter being declared
5997 */ 5808 */
5998 DeclaredIdentifier(Comment comment, List<Annotation> metadata, this.keyword, T ypeName type, SimpleIdentifier identifier) : super(comment, metadata) { 5809 DeclaredIdentifier(Comment comment, List<Annotation> metadata, this.keyword, T ypeName type, SimpleIdentifier identifier) : super(comment, metadata) {
5999 this._type = becomeParentOf(type); 5810 _type = becomeParentOf(type);
6000 this._identifier = becomeParentOf(identifier); 5811 _identifier = becomeParentOf(identifier);
6001 } 5812 }
6002 5813
6003 @override 5814 @override
6004 accept(AstVisitor visitor) => visitor.visitDeclaredIdentifier(this); 5815 accept(AstVisitor visitor) => visitor.visitDeclaredIdentifier(this);
6005 5816
6006 @override 5817 @override
6007 LocalVariableElement get element { 5818 LocalVariableElement get element {
6008 SimpleIdentifier identifier = this.identifier; 5819 if (_identifier == null) {
6009 if (identifier == null) {
6010 return null; 5820 return null;
6011 } 5821 }
6012 return identifier.staticElement as LocalVariableElement; 5822 return _identifier.staticElement as LocalVariableElement;
6013 } 5823 }
6014 5824
6015 @override 5825 @override
6016 Token get endToken => _identifier.endToken; 5826 Token get endToken => _identifier.endToken;
6017 5827
6018 /** 5828 /**
6019 * Return the name of the variable being declared. 5829 * Return the name of the variable being declared.
6020 * 5830 *
6021 * @return the name of the variable being declared 5831 * @return the name of the variable being declared
6022 */ 5832 */
(...skipping 22 matching lines...) Expand all
6045 * @return `true` if this variable was declared with the 'final' modifier 5855 * @return `true` if this variable was declared with the 'final' modifier
6046 */ 5856 */
6047 bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).key word == Keyword.FINAL; 5857 bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).key word == Keyword.FINAL;
6048 5858
6049 /** 5859 /**
6050 * Set the name of the variable being declared to the given name. 5860 * Set the name of the variable being declared to the given name.
6051 * 5861 *
6052 * @param identifier the new name of the variable being declared 5862 * @param identifier the new name of the variable being declared
6053 */ 5863 */
6054 void set identifier(SimpleIdentifier identifier) { 5864 void set identifier(SimpleIdentifier identifier) {
6055 this._identifier = becomeParentOf(identifier); 5865 _identifier = becomeParentOf(identifier);
6056 } 5866 }
6057 5867
6058 /** 5868 /**
6059 * Set the name of the declared type of the parameter to the given type name. 5869 * Set the name of the declared type of the parameter to the given type name.
6060 * 5870 *
6061 * @param typeName the name of the declared type of the parameter 5871 * @param typeName the name of the declared type of the parameter
6062 */ 5872 */
6063 void set type(TypeName typeName) { 5873 void set type(TypeName typeName) {
6064 _type = becomeParentOf(typeName); 5874 _type = becomeParentOf(typeName);
6065 } 5875 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
6120 5930
6121 /** 5931 /**
6122 * Initialize a newly created default formal parameter. 5932 * Initialize a newly created default formal parameter.
6123 * 5933 *
6124 * @param parameter the formal parameter with which the default value is assoc iated 5934 * @param parameter the formal parameter with which the default value is assoc iated
6125 * @param kind the kind of this parameter 5935 * @param kind the kind of this parameter
6126 * @param separator the token separating the parameter from the default value 5936 * @param separator the token separating the parameter from the default value
6127 * @param defaultValue the expression computing the default value for the para meter 5937 * @param defaultValue the expression computing the default value for the para meter
6128 */ 5938 */
6129 DefaultFormalParameter(NormalFormalParameter parameter, this.kind, this.separa tor, Expression defaultValue) { 5939 DefaultFormalParameter(NormalFormalParameter parameter, this.kind, this.separa tor, Expression defaultValue) {
6130 this._parameter = becomeParentOf(parameter); 5940 _parameter = becomeParentOf(parameter);
6131 this._defaultValue = becomeParentOf(defaultValue); 5941 _defaultValue = becomeParentOf(defaultValue);
6132 } 5942 }
6133 5943
6134 @override 5944 @override
6135 accept(AstVisitor visitor) => visitor.visitDefaultFormalParameter(this); 5945 accept(AstVisitor visitor) => visitor.visitDefaultFormalParameter(this);
6136 5946
6137 @override 5947 @override
6138 Token get beginToken => _parameter.beginToken; 5948 Token get beginToken => _parameter.beginToken;
6139 5949
6140 /** 5950 /**
6141 * Return the expression computing the default value for the parameter, or `nu ll` if there 5951 * Return the expression computing the default value for the parameter, or `nu ll` if there
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
6204 bool _result = false; 6014 bool _result = false;
6205 6015
6206 /** 6016 /**
6207 * Return `true` if the visitor found a [PrefixedIdentifier] that returned 6017 * Return `true` if the visitor found a [PrefixedIdentifier] that returned
6208 * `true` to the [PrefixedIdentifier.isDeferred] query. 6018 * `true` to the [PrefixedIdentifier.isDeferred] query.
6209 */ 6019 */
6210 bool get result => _result; 6020 bool get result => _result;
6211 6021
6212 @override 6022 @override
6213 Object visitPrefixedIdentifier(PrefixedIdentifier node) { 6023 Object visitPrefixedIdentifier(PrefixedIdentifier node) {
6214 // If result is already true, skip.
6215 if (!_result) { 6024 if (!_result) {
6216 // Set result to true if isDeferred() is true
6217 if (node.isDeferred) { 6025 if (node.isDeferred) {
6218 _result = true; 6026 _result = true;
6219 } 6027 }
6220 } 6028 }
6221 return null; 6029 return null;
6222 } 6030 }
6223 } 6031 }
6224 6032
6225 /** 6033 /**
6226 * The abstract class `Directive` defines the behavior common to nodes that repr esent a 6034 * The abstract class `Directive` defines the behavior common to nodes that repr esent a
6227 * directive. 6035 * directive.
6228 * 6036 *
6229 * <pre> 6037 * <pre>
6230 * directive ::= 6038 * directive ::=
6231 * [ExportDirective] 6039 * [ExportDirective]
6232 * | [ImportDirective] 6040 * | [ImportDirective]
6233 * | [LibraryDirective] 6041 * | [LibraryDirective]
6234 * | [PartDirective] 6042 * | [PartDirective]
6235 * | [PartOfDirective] 6043 * | [PartOfDirective]
6236 * </pre> 6044 * </pre>
6237 */ 6045 */
6238 abstract class Directive extends AnnotatedNode { 6046 abstract class Directive extends AnnotatedNode {
6239 /** 6047 /**
6240 * The element associated with this directive, or `null` if the AST structure has not been 6048 * The element associated with this directive, or `null` if the AST structure has not been
6241 * resolved or if this directive could not be resolved. 6049 * resolved or if this directive could not be resolved.
6242 */ 6050 */
6243 Element _element; 6051 Element element;
6244 6052
6245 /** 6053 /**
6246 * Initialize a newly create directive. 6054 * Initialize a newly create directive.
6247 * 6055 *
6248 * @param comment the documentation comment associated with this directive 6056 * @param comment the documentation comment associated with this directive
6249 * @param metadata the annotations associated with the directive 6057 * @param metadata the annotations associated with the directive
6250 */ 6058 */
6251 Directive(Comment comment, List<Annotation> metadata) : super(comment, metadat a); 6059 Directive(Comment comment, List<Annotation> metadata) : super(comment, metadat a);
6252 6060
6253 /** 6061 /**
6254 * Return the element associated with this directive, or `null` if the AST str ucture has not
6255 * been resolved or if this directive could not be resolved. Examples of the l atter case include a
6256 * directive that contains an invalid URL or a URL that does not exist.
6257 *
6258 * @return the element associated with this directive
6259 */
6260 Element get element => _element;
6261
6262 /**
6263 * Return the token representing the keyword that introduces this directive (' import', 'export', 6062 * Return the token representing the keyword that introduces this directive (' import', 'export',
6264 * 'library' or 'part'). 6063 * 'library' or 'part').
6265 * 6064 *
6266 * @return the token representing the keyword that introduces this directive 6065 * @return the token representing the keyword that introduces this directive
6267 */ 6066 */
6268 Token get keyword; 6067 Token get keyword;
6269
6270 /**
6271 * Set the element associated with this directive to the given element.
6272 *
6273 * @param element the element associated with this directive
6274 */
6275 void set element(Element element) {
6276 this._element = element;
6277 }
6278 } 6068 }
6279 6069
6280 /** 6070 /**
6281 * Instances of the class `DoStatement` represent a do statement. 6071 * Instances of the class `DoStatement` represent a do statement.
6282 * 6072 *
6283 * <pre> 6073 * <pre>
6284 * doStatement ::= 6074 * doStatement ::=
6285 * 'do' [Statement] 'while' '(' [Expression] ')' ';' 6075 * 'do' [Statement] 'while' '(' [Expression] ')' ';'
6286 * </pre> 6076 * </pre>
6287 */ 6077 */
6288 class DoStatement extends Statement { 6078 class DoStatement extends Statement {
6289 /** 6079 /**
6290 * The token representing the 'do' keyword. 6080 * The token representing the 'do' keyword.
6291 */ 6081 */
6292 Token doKeyword; 6082 Token doKeyword;
6293 6083
6294 /** 6084 /**
6295 * The body of the loop. 6085 * The body of the loop.
6296 */ 6086 */
6297 Statement _body; 6087 Statement _body;
6298 6088
6299 /** 6089 /**
6300 * The token representing the 'while' keyword. 6090 * The token representing the 'while' keyword.
6301 */ 6091 */
6302 Token whileKeyword; 6092 Token whileKeyword;
6303 6093
6304 /** 6094 /**
6305 * The left parenthesis. 6095 * The left parenthesis.
6306 */ 6096 */
6307 Token _leftParenthesis; 6097 Token leftParenthesis;
6308 6098
6309 /** 6099 /**
6310 * The condition that determines when the loop will terminate. 6100 * The condition that determines when the loop will terminate.
6311 */ 6101 */
6312 Expression _condition; 6102 Expression _condition;
6313 6103
6314 /** 6104 /**
6315 * The right parenthesis. 6105 * The right parenthesis.
6316 */ 6106 */
6317 Token _rightParenthesis; 6107 Token rightParenthesis;
6318 6108
6319 /** 6109 /**
6320 * The semicolon terminating the statement. 6110 * The semicolon terminating the statement.
6321 */ 6111 */
6322 Token semicolon; 6112 Token semicolon;
6323 6113
6324 /** 6114 /**
6325 * Initialize a newly created do loop. 6115 * Initialize a newly created do loop.
6326 * 6116 *
6327 * @param doKeyword the token representing the 'do' keyword 6117 * @param doKeyword the token representing the 'do' keyword
6328 * @param body the body of the loop 6118 * @param body the body of the loop
6329 * @param whileKeyword the token representing the 'while' keyword 6119 * @param whileKeyword the token representing the 'while' keyword
6330 * @param leftParenthesis the left parenthesis 6120 * @param leftParenthesis the left parenthesis
6331 * @param condition the condition that determines when the loop will terminate 6121 * @param condition the condition that determines when the loop will terminate
6332 * @param rightParenthesis the right parenthesis 6122 * @param rightParenthesis the right parenthesis
6333 * @param semicolon the semicolon terminating the statement 6123 * @param semicolon the semicolon terminating the statement
6334 */ 6124 */
6335 DoStatement(this.doKeyword, Statement body, this.whileKeyword, Token leftParen thesis, Expression condition, Token rightParenthesis, this.semicolon) { 6125 DoStatement(this.doKeyword, Statement body, this.whileKeyword, this.leftParent hesis, Expression condition, this.rightParenthesis, this.semicolon) {
6336 this._body = becomeParentOf(body); 6126 _body = becomeParentOf(body);
6337 this._leftParenthesis = leftParenthesis; 6127 _condition = becomeParentOf(condition);
6338 this._condition = becomeParentOf(condition);
6339 this._rightParenthesis = rightParenthesis;
6340 } 6128 }
6341 6129
6342 @override 6130 @override
6343 accept(AstVisitor visitor) => visitor.visitDoStatement(this); 6131 accept(AstVisitor visitor) => visitor.visitDoStatement(this);
6344 6132
6345 @override 6133 @override
6346 Token get beginToken => doKeyword; 6134 Token get beginToken => doKeyword;
6347 6135
6348 /** 6136 /**
6349 * Return the body of the loop. 6137 * Return the body of the loop.
6350 * 6138 *
6351 * @return the body of the loop 6139 * @return the body of the loop
6352 */ 6140 */
6353 Statement get body => _body; 6141 Statement get body => _body;
6354 6142
6355 /** 6143 /**
6356 * Return the condition that determines when the loop will terminate. 6144 * Return the condition that determines when the loop will terminate.
6357 * 6145 *
6358 * @return the condition that determines when the loop will terminate 6146 * @return the condition that determines when the loop will terminate
6359 */ 6147 */
6360 Expression get condition => _condition; 6148 Expression get condition => _condition;
6361 6149
6362 @override 6150 @override
6363 Token get endToken => semicolon; 6151 Token get endToken => semicolon;
6364 6152
6365 /** 6153 /**
6366 * Return the left parenthesis.
6367 *
6368 * @return the left parenthesis
6369 */
6370 Token get leftParenthesis => _leftParenthesis;
6371
6372 /**
6373 * Return the right parenthesis.
6374 *
6375 * @return the right parenthesis
6376 */
6377 Token get rightParenthesis => _rightParenthesis;
6378
6379 /**
6380 * Set the body of the loop to the given statement. 6154 * Set the body of the loop to the given statement.
6381 * 6155 *
6382 * @param statement the body of the loop 6156 * @param statement the body of the loop
6383 */ 6157 */
6384 void set body(Statement statement) { 6158 void set body(Statement statement) {
6385 _body = becomeParentOf(statement); 6159 _body = becomeParentOf(statement);
6386 } 6160 }
6387 6161
6388 /** 6162 /**
6389 * Set the condition that determines when the loop will terminate to the given expression. 6163 * Set the condition that determines when the loop will terminate to the given expression.
6390 * 6164 *
6391 * @param expression the condition that determines when the loop will terminat e 6165 * @param expression the condition that determines when the loop will terminat e
6392 */ 6166 */
6393 void set condition(Expression expression) { 6167 void set condition(Expression expression) {
6394 _condition = becomeParentOf(expression); 6168 _condition = becomeParentOf(expression);
6395 } 6169 }
6396 6170
6397 /**
6398 * Set the left parenthesis to the given token.
6399 *
6400 * @param parenthesis the left parenthesis
6401 */
6402 void set leftParenthesis(Token parenthesis) {
6403 _leftParenthesis = parenthesis;
6404 }
6405
6406 /**
6407 * Set the right parenthesis to the given token.
6408 *
6409 * @param parenthesis the right parenthesis
6410 */
6411 void set rightParenthesis(Token parenthesis) {
6412 _rightParenthesis = parenthesis;
6413 }
6414
6415 @override 6171 @override
6416 void visitChildren(AstVisitor visitor) { 6172 void visitChildren(AstVisitor visitor) {
6417 safelyVisitChild(_body, visitor); 6173 safelyVisitChild(_body, visitor);
6418 safelyVisitChild(_condition, visitor); 6174 safelyVisitChild(_condition, visitor);
6419 } 6175 }
6420 } 6176 }
6421 6177
6422 /** 6178 /**
6423 * Instances of the class `DoubleLiteral` represent a floating point literal exp ression. 6179 * Instances of the class `DoubleLiteral` represent a floating point literal exp ression.
6424 * 6180 *
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
6486 * 6242 *
6487 * @param node the node (not `null`) 6243 * @param node the node (not `null`)
6488 * @param offset the offset relative to source 6244 * @param offset the offset relative to source
6489 * @return the associated element, or `null` if none is found 6245 * @return the associated element, or `null` if none is found
6490 */ 6246 */
6491 static Element locateWithOffset(AstNode node, int offset) { 6247 static Element locateWithOffset(AstNode node, int offset) {
6492 if (node == null) { 6248 if (node == null) {
6493 return null; 6249 return null;
6494 } 6250 }
6495 // try to get Element from node 6251 // try to get Element from node
6496 { 6252 Element nodeElement = locate(node);
6497 Element nodeElement = locate(node); 6253 if (nodeElement != null) {
6498 if (nodeElement != null) { 6254 return nodeElement;
6499 return nodeElement;
6500 }
6501 } 6255 }
6502 // try to get Angular specific Element 6256 // TODO(brianwilkerson) Implement or delete the code below.
6503 { 6257 // // try to get Angular specific Element
6504 Element element = null; 6258 // {
6505 if (element != null) { 6259 // Element element = null;
6506 return element; 6260 // if (element != null) {
6507 } 6261 // return element;
6508 } 6262 // }
6509 // try to get Polymer specific Element 6263 // }
6510 { 6264 // // try to get Polymer specific Element
6511 Element element = null; 6265 // {
6512 if (element != null) { 6266 // Element element = null;
6513 return element; 6267 // if (element != null) {
6514 } 6268 // return element;
6515 } 6269 // }
6270 // }
6516 // no Element 6271 // no Element
6517 return null; 6272 return null;
6518 } 6273 }
6519 } 6274 }
6520 6275
6521 /** 6276 /**
6522 * Visitor that maps nodes to elements. 6277 * Visitor that maps nodes to elements.
6523 */ 6278 */
6524 class ElementLocator_ElementMapper extends GeneralizingAstVisitor<Element> { 6279 class ElementLocator_ElementMapper extends GeneralizingAstVisitor<Element> {
6525 @override 6280 @override
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
6704 SimpleIdentifier _name; 6459 SimpleIdentifier _name;
6705 6460
6706 /** 6461 /**
6707 * Initialize a newly created enum constant declaration. 6462 * Initialize a newly created enum constant declaration.
6708 * 6463 *
6709 * @param comment the documentation comment associated with this declaration 6464 * @param comment the documentation comment associated with this declaration
6710 * @param metadata the annotations associated with this declaration 6465 * @param metadata the annotations associated with this declaration
6711 * @param name the name of the constant 6466 * @param name the name of the constant
6712 */ 6467 */
6713 EnumConstantDeclaration(Comment comment, List<Annotation> metadata, SimpleIden tifier name) : super(comment, metadata) { 6468 EnumConstantDeclaration(Comment comment, List<Annotation> metadata, SimpleIden tifier name) : super(comment, metadata) {
6714 this._name = becomeParentOf(name); 6469 _name = becomeParentOf(name);
6715 } 6470 }
6716 6471
6717 @override 6472 @override
6718 accept(AstVisitor visitor) => visitor.visitEnumConstantDeclaration(this); 6473 accept(AstVisitor visitor) => visitor.visitEnumConstantDeclaration(this);
6719 6474
6720 @override 6475 @override
6721 FieldElement get element => _name == null ? null : (_name.staticElement as Fie ldElement); 6476 FieldElement get element => _name == null ? null : (_name.staticElement as Fie ldElement);
6722 6477
6723 @override 6478 @override
6724 Token get endToken => _name.endToken; 6479 Token get endToken => _name.endToken;
6725 6480
6726 /** 6481 /**
6727 * Return the name of the constant. 6482 * Return the name of the constant.
6728 * 6483 *
6729 * @return the name of the constant 6484 * @return the name of the constant
6730 */ 6485 */
6731 SimpleIdentifier get name => _name; 6486 SimpleIdentifier get name => _name;
6732 6487
6733 /** 6488 /**
6734 * Set the name of the constant to the given name. 6489 * Set the name of the constant to the given name.
6735 * 6490 *
6736 * @param name the name of the constant 6491 * @param name the name of the constant
6737 */ 6492 */
6738 void set name(SimpleIdentifier name) { 6493 void set name(SimpleIdentifier name) {
6739 this._name = becomeParentOf(name); 6494 _name = becomeParentOf(name);
6740 } 6495 }
6741 6496
6742 @override 6497 @override
6743 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; 6498 Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
6744 6499
6745 @override 6500 @override
6746 void visitChildren(AstVisitor visitor) { 6501 void visitChildren(AstVisitor visitor) {
6747 super.visitChildren(visitor); 6502 super.visitChildren(visitor);
6748 safelyVisitChild(_name, visitor); 6503 safelyVisitChild(_name, visitor);
6749 } 6504 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
6788 * 6543 *
6789 * @param comment the documentation comment associated with this member 6544 * @param comment the documentation comment associated with this member
6790 * @param metadata the annotations associated with this member 6545 * @param metadata the annotations associated with this member
6791 * @param keyword the 'enum' keyword 6546 * @param keyword the 'enum' keyword
6792 * @param name the name of the enumeration 6547 * @param name the name of the enumeration
6793 * @param leftBracket the left curly bracket 6548 * @param leftBracket the left curly bracket
6794 * @param constants the enumeration constants being declared 6549 * @param constants the enumeration constants being declared
6795 * @param rightBracket the right curly bracket 6550 * @param rightBracket the right curly bracket
6796 */ 6551 */
6797 EnumDeclaration(Comment comment, List<Annotation> metadata, this.keyword, Simp leIdentifier name, this.leftBracket, List<EnumConstantDeclaration> constants, th is.rightBracket) : super(comment, metadata) { 6552 EnumDeclaration(Comment comment, List<Annotation> metadata, this.keyword, Simp leIdentifier name, this.leftBracket, List<EnumConstantDeclaration> constants, th is.rightBracket) : super(comment, metadata) {
6798 this._constants = new NodeList<EnumConstantDeclaration>(this); 6553 _name = becomeParentOf(name);
6799 this._name = becomeParentOf(name); 6554 _constants = new NodeList<EnumConstantDeclaration>(this, constants);
6800 this._constants.addAll(constants);
6801 } 6555 }
6802 6556
6803 @override 6557 @override
6804 accept(AstVisitor visitor) => visitor.visitEnumDeclaration(this); 6558 accept(AstVisitor visitor) => visitor.visitEnumDeclaration(this);
6805 6559
6806 /** 6560 /**
6807 * Return the enumeration constants being declared. 6561 * Return the enumeration constants being declared.
6808 * 6562 *
6809 * @return the enumeration constants being declared 6563 * @return the enumeration constants being declared
6810 */ 6564 */
(...skipping 11 matching lines...) Expand all
6822 * @return the name of the enumeration 6576 * @return the name of the enumeration
6823 */ 6577 */
6824 SimpleIdentifier get name => _name; 6578 SimpleIdentifier get name => _name;
6825 6579
6826 /** 6580 /**
6827 * set the name of the enumeration to the given identifier. 6581 * set the name of the enumeration to the given identifier.
6828 * 6582 *
6829 * @param name the name of the enumeration 6583 * @param name the name of the enumeration
6830 */ 6584 */
6831 void set name(SimpleIdentifier name) { 6585 void set name(SimpleIdentifier name) {
6832 this._name = becomeParentOf(name); 6586 _name = becomeParentOf(name);
6833 } 6587 }
6834 6588
6835 @override 6589 @override
6836 Token get firstTokenAfterCommentAndMetadata => keyword; 6590 Token get firstTokenAfterCommentAndMetadata => keyword;
6837 6591
6838 @override 6592 @override
6839 void visitChildren(AstVisitor visitor) { 6593 void visitChildren(AstVisitor visitor) {
6840 super.visitChildren(visitor); 6594 super.visitChildren(visitor);
6841 safelyVisitChild(_name, visitor); 6595 safelyVisitChild(_name, visitor);
6842 _constants.accept(visitor); 6596 _constants.accept(visitor);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
6874 ExportDirective(Comment comment, List<Annotation> metadata, Token keyword, Str ingLiteral libraryUri, List<Combinator> combinators, Token semicolon) : super(co mment, metadata, keyword, libraryUri, combinators, semicolon); 6628 ExportDirective(Comment comment, List<Annotation> metadata, Token keyword, Str ingLiteral libraryUri, List<Combinator> combinators, Token semicolon) : super(co mment, metadata, keyword, libraryUri, combinators, semicolon);
6875 6629
6876 @override 6630 @override
6877 accept(AstVisitor visitor) => visitor.visitExportDirective(this); 6631 accept(AstVisitor visitor) => visitor.visitExportDirective(this);
6878 6632
6879 @override 6633 @override
6880 ExportElement get element => super.element as ExportElement; 6634 ExportElement get element => super.element as ExportElement;
6881 6635
6882 @override 6636 @override
6883 LibraryElement get uriElement { 6637 LibraryElement get uriElement {
6884 ExportElement exportElement = element; 6638 if (element != null) {
6885 if (exportElement != null) { 6639 return element.exportedLibrary;
6886 return exportElement.exportedLibrary;
6887 } 6640 }
6888 return null; 6641 return null;
6889 } 6642 }
6890 6643
6891 @override 6644 @override
6892 void visitChildren(AstVisitor visitor) { 6645 void visitChildren(AstVisitor visitor) {
6893 super.visitChildren(visitor); 6646 super.visitChildren(visitor);
6894 combinators.accept(visitor); 6647 combinators.accept(visitor);
6895 } 6648 }
6896 } 6649 }
6897 6650
6898 /** 6651 /**
6899 * Instances of the class `Expression` defines the behavior common to nodes that represent an 6652 * Instances of the class `Expression` defines the behavior common to nodes that represent an
6900 * expression. 6653 * expression.
6901 * 6654 *
6902 * <pre> 6655 * <pre>
6903 * expression ::= 6656 * expression ::=
6904 * [AssignmentExpression] 6657 * [AssignmentExpression]
6905 * | [ConditionalExpression] cascadeSection* 6658 * | [ConditionalExpression] cascadeSection*
6906 * | [ThrowExpression] 6659 * | [ThrowExpression]
6907 * </pre> 6660 * </pre>
6908 */ 6661 */
6909 abstract class Expression extends AstNode { 6662 abstract class Expression extends AstNode {
6910 /** 6663 /**
6911 * An empty list of expressions.
6912 */
6913 static const List<Expression> EMPTY_ARRAY = const <Expression>[];
6914
6915 /**
6916 * The static type of this expression, or `null` if the AST structure has not been resolved. 6664 * The static type of this expression, or `null` if the AST structure has not been resolved.
6917 */ 6665 */
6918 DartType staticType; 6666 DartType staticType;
6919 6667
6920 /** 6668 /**
6921 * The propagated type of this expression, or `null` if type propagation has n ot been 6669 * The propagated type of this expression, or `null` if type propagation has n ot been
6922 * performed on the AST structure. 6670 * performed on the AST structure.
6923 */ 6671 */
6924 DartType propagatedType; 6672 DartType propagatedType;
6925 6673
6926 /** 6674 /**
6675 * An empty list of expressions.
6676 */
6677 static const List<Expression> EMPTY_ARRAY = const <Expression>[];
6678
6679 /**
6927 * Return the best parameter element information available for this expression . If type 6680 * Return the best parameter element information available for this expression . If type
6928 * propagation was able to find a better parameter element than static analysi s, that type will be 6681 * propagation was able to find a better parameter element than static analysi s, that type will be
6929 * returned. Otherwise, the result of static analysis will be returned. 6682 * returned. Otherwise, the result of static analysis will be returned.
6930 * 6683 *
6931 * @return the parameter element representing the parameter to which the value of this expression 6684 * @return the parameter element representing the parameter to which the value of this expression
6932 * will be bound 6685 * will be bound
6933 */ 6686 */
6934 ParameterElement get bestParameterElement { 6687 ParameterElement get bestParameterElement {
6935 ParameterElement propagatedElement = propagatedParameterElement; 6688 ParameterElement propagatedElement = propagatedParameterElement;
6936 if (propagatedElement != null) { 6689 if (propagatedElement != null) {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
7085 /** 6838 /**
7086 * Initialize a newly created function body consisting of a block of statement s. 6839 * Initialize a newly created function body consisting of a block of statement s.
7087 * 6840 *
7088 * @param keyword the token representing the 'async' keyword 6841 * @param keyword the token representing the 'async' keyword
7089 * @param functionDefinition the token introducing the expression that represe nts the body of the 6842 * @param functionDefinition the token introducing the expression that represe nts the body of the
7090 * function 6843 * function
7091 * @param expression the expression representing the body of the function 6844 * @param expression the expression representing the body of the function
7092 * @param semicolon the semicolon terminating the statement 6845 * @param semicolon the semicolon terminating the statement
7093 */ 6846 */
7094 ExpressionFunctionBody(this.keyword, this.functionDefinition, Expression expre ssion, this.semicolon) { 6847 ExpressionFunctionBody(this.keyword, this.functionDefinition, Expression expre ssion, this.semicolon) {
7095 this._expression = becomeParentOf(expression); 6848 _expression = becomeParentOf(expression);
7096 } 6849 }
7097 6850
7098 @override 6851 @override
7099 accept(AstVisitor visitor) => visitor.visitExpressionFunctionBody(this); 6852 accept(AstVisitor visitor) => visitor.visitExpressionFunctionBody(this);
7100 6853
7101 @override 6854 @override
7102 Token get beginToken => functionDefinition; 6855 Token get beginToken => functionDefinition;
7103 6856
7104 @override 6857 @override
7105 Token get endToken { 6858 Token get endToken {
(...skipping 15 matching lines...) Expand all
7121 6874
7122 @override 6875 @override
7123 bool get isSynchronous => keyword == null; 6876 bool get isSynchronous => keyword == null;
7124 6877
7125 /** 6878 /**
7126 * Set the expression representing the body of the function to the given expre ssion. 6879 * Set the expression representing the body of the function to the given expre ssion.
7127 * 6880 *
7128 * @param expression the expression representing the body of the function 6881 * @param expression the expression representing the body of the function
7129 */ 6882 */
7130 void set expression(Expression expression) { 6883 void set expression(Expression expression) {
7131 this._expression = becomeParentOf(expression); 6884 _expression = becomeParentOf(expression);
7132 } 6885 }
7133 6886
7134 @override 6887 @override
7135 void visitChildren(AstVisitor visitor) { 6888 void visitChildren(AstVisitor visitor) {
7136 safelyVisitChild(_expression, visitor); 6889 safelyVisitChild(_expression, visitor);
7137 } 6890 }
7138 } 6891 }
7139 6892
7140 /** 6893 /**
7141 * Instances of the class `ExpressionStatement` wrap an expression as a statemen t. 6894 * Instances of the class `ExpressionStatement` wrap an expression as a statemen t.
(...skipping 15 matching lines...) Expand all
7157 */ 6910 */
7158 Token semicolon; 6911 Token semicolon;
7159 6912
7160 /** 6913 /**
7161 * Initialize a newly created expression statement. 6914 * Initialize a newly created expression statement.
7162 * 6915 *
7163 * @param expression the expression that comprises the statement 6916 * @param expression the expression that comprises the statement
7164 * @param semicolon the semicolon terminating the statement 6917 * @param semicolon the semicolon terminating the statement
7165 */ 6918 */
7166 ExpressionStatement(Expression expression, this.semicolon) { 6919 ExpressionStatement(Expression expression, this.semicolon) {
7167 this._expression = becomeParentOf(expression); 6920 _expression = becomeParentOf(expression);
7168 } 6921 }
7169 6922
7170 @override 6923 @override
7171 accept(AstVisitor visitor) => visitor.visitExpressionStatement(this); 6924 accept(AstVisitor visitor) => visitor.visitExpressionStatement(this);
7172 6925
7173 @override 6926 @override
7174 Token get beginToken => _expression.beginToken; 6927 Token get beginToken => _expression.beginToken;
7175 6928
7176 @override 6929 @override
7177 Token get endToken { 6930 Token get endToken {
(...skipping 12 matching lines...) Expand all
7190 6943
7191 @override 6944 @override
7192 bool get isSynthetic => _expression.isSynthetic && semicolon.isSynthetic; 6945 bool get isSynthetic => _expression.isSynthetic && semicolon.isSynthetic;
7193 6946
7194 /** 6947 /**
7195 * Set the expression that comprises the statement to the given expression. 6948 * Set the expression that comprises the statement to the given expression.
7196 * 6949 *
7197 * @param expression the expression that comprises the statement 6950 * @param expression the expression that comprises the statement
7198 */ 6951 */
7199 void set expression(Expression expression) { 6952 void set expression(Expression expression) {
7200 this._expression = becomeParentOf(expression); 6953 _expression = becomeParentOf(expression);
7201 } 6954 }
7202 6955
7203 @override 6956 @override
7204 void visitChildren(AstVisitor visitor) { 6957 void visitChildren(AstVisitor visitor) {
7205 safelyVisitChild(_expression, visitor); 6958 safelyVisitChild(_expression, visitor);
7206 } 6959 }
7207 } 6960 }
7208 6961
7209 /** 6962 /**
7210 * Instances of the class `ExtendsClause` represent the "extends" clause in a cl ass 6963 * Instances of the class `ExtendsClause` represent the "extends" clause in a cl ass
(...skipping 15 matching lines...) Expand all
7226 */ 6979 */
7227 TypeName _superclass; 6980 TypeName _superclass;
7228 6981
7229 /** 6982 /**
7230 * Initialize a newly created extends clause. 6983 * Initialize a newly created extends clause.
7231 * 6984 *
7232 * @param keyword the token representing the 'extends' keyword 6985 * @param keyword the token representing the 'extends' keyword
7233 * @param superclass the name of the class that is being extended 6986 * @param superclass the name of the class that is being extended
7234 */ 6987 */
7235 ExtendsClause(this.keyword, TypeName superclass) { 6988 ExtendsClause(this.keyword, TypeName superclass) {
7236 this._superclass = becomeParentOf(superclass); 6989 _superclass = becomeParentOf(superclass);
7237 } 6990 }
7238 6991
7239 @override 6992 @override
7240 accept(AstVisitor visitor) => visitor.visitExtendsClause(this); 6993 accept(AstVisitor visitor) => visitor.visitExtendsClause(this);
7241 6994
7242 @override 6995 @override
7243 Token get beginToken => keyword; 6996 Token get beginToken => keyword;
7244 6997
7245 @override 6998 @override
7246 Token get endToken => _superclass.endToken; 6999 Token get endToken => _superclass.endToken;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
7295 /** 7048 /**
7296 * Initialize a newly created field declaration. 7049 * Initialize a newly created field declaration.
7297 * 7050 *
7298 * @param comment the documentation comment associated with this field 7051 * @param comment the documentation comment associated with this field
7299 * @param metadata the annotations associated with this field 7052 * @param metadata the annotations associated with this field
7300 * @param staticKeyword the token representing the 'static' keyword 7053 * @param staticKeyword the token representing the 'static' keyword
7301 * @param fieldList the fields being declared 7054 * @param fieldList the fields being declared
7302 * @param semicolon the semicolon terminating the declaration 7055 * @param semicolon the semicolon terminating the declaration
7303 */ 7056 */
7304 FieldDeclaration(Comment comment, List<Annotation> metadata, this.staticKeywor d, VariableDeclarationList fieldList, this.semicolon) : super(comment, metadata) { 7057 FieldDeclaration(Comment comment, List<Annotation> metadata, this.staticKeywor d, VariableDeclarationList fieldList, this.semicolon) : super(comment, metadata) {
7305 this._fieldList = becomeParentOf(fieldList); 7058 _fieldList = becomeParentOf(fieldList);
7306 } 7059 }
7307 7060
7308 @override 7061 @override
7309 accept(AstVisitor visitor) => visitor.visitFieldDeclaration(this); 7062 accept(AstVisitor visitor) => visitor.visitFieldDeclaration(this);
7310 7063
7311 @override 7064 @override
7312 Element get element => null; 7065 Element get element => null;
7313 7066
7314 @override 7067 @override
7315 Token get endToken => semicolon; 7068 Token get endToken => semicolon;
(...skipping 11 matching lines...) Expand all
7327 * @return `true` if the fields are declared to be static 7080 * @return `true` if the fields are declared to be static
7328 */ 7081 */
7329 bool get isStatic => staticKeyword != null; 7082 bool get isStatic => staticKeyword != null;
7330 7083
7331 /** 7084 /**
7332 * Set the fields being declared to the given list of variables. 7085 * Set the fields being declared to the given list of variables.
7333 * 7086 *
7334 * @param fieldList the fields being declared 7087 * @param fieldList the fields being declared
7335 */ 7088 */
7336 void set fields(VariableDeclarationList fieldList) { 7089 void set fields(VariableDeclarationList fieldList) {
7337 this._fieldList = becomeParentOf(fieldList); 7090 _fieldList = becomeParentOf(fieldList);
7338 } 7091 }
7339 7092
7340 @override 7093 @override
7341 void visitChildren(AstVisitor visitor) { 7094 void visitChildren(AstVisitor visitor) {
7342 super.visitChildren(visitor); 7095 super.visitChildren(visitor);
7343 safelyVisitChild(_fieldList, visitor); 7096 safelyVisitChild(_fieldList, visitor);
7344 } 7097 }
7345 7098
7346 @override 7099 @override
7347 Token get firstTokenAfterCommentAndMetadata { 7100 Token get firstTokenAfterCommentAndMetadata {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
7396 * @param metadata the annotations associated with this parameter 7149 * @param metadata the annotations associated with this parameter
7397 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 7150 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
7398 * @param type the name of the declared type of the parameter 7151 * @param type the name of the declared type of the parameter
7399 * @param thisToken the token representing the 'this' keyword 7152 * @param thisToken the token representing the 'this' keyword
7400 * @param period the token representing the period 7153 * @param period the token representing the period
7401 * @param identifier the name of the parameter being declared 7154 * @param identifier the name of the parameter being declared
7402 * @param parameters the parameters of the function-typed parameter, or `null` if this is 7155 * @param parameters the parameters of the function-typed parameter, or `null` if this is
7403 * not a function-typed field formal parameter 7156 * not a function-typed field formal parameter
7404 */ 7157 */
7405 FieldFormalParameter(Comment comment, List<Annotation> metadata, this.keyword, TypeName type, this.thisToken, this.period, SimpleIdentifier identifier, Formal ParameterList parameters) : super(comment, metadata, identifier) { 7158 FieldFormalParameter(Comment comment, List<Annotation> metadata, this.keyword, TypeName type, this.thisToken, this.period, SimpleIdentifier identifier, Formal ParameterList parameters) : super(comment, metadata, identifier) {
7406 this._type = becomeParentOf(type); 7159 _type = becomeParentOf(type);
7407 this._parameters = becomeParentOf(parameters); 7160 _parameters = becomeParentOf(parameters);
7408 } 7161 }
7409 7162
7410 @override 7163 @override
7411 accept(AstVisitor visitor) => visitor.visitFieldFormalParameter(this); 7164 accept(AstVisitor visitor) => visitor.visitFieldFormalParameter(this);
7412 7165
7413 @override 7166 @override
7414 Token get beginToken { 7167 Token get beginToken {
7415 if (keyword != null) { 7168 if (keyword != null) {
7416 return keyword; 7169 return keyword;
7417 } else if (_type != null) { 7170 } else if (_type != null) {
(...skipping 27 matching lines...) Expand all
7445 7198
7446 @override 7199 @override
7447 bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).key word == Keyword.FINAL; 7200 bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).key word == Keyword.FINAL;
7448 7201
7449 /** 7202 /**
7450 * Set the parameters of the function-typed parameter to the given parameters. 7203 * Set the parameters of the function-typed parameter to the given parameters.
7451 * 7204 *
7452 * @param parameters the parameters of the function-typed parameter 7205 * @param parameters the parameters of the function-typed parameter
7453 */ 7206 */
7454 void set parameters(FormalParameterList parameters) { 7207 void set parameters(FormalParameterList parameters) {
7455 this._parameters = becomeParentOf(parameters); 7208 _parameters = becomeParentOf(parameters);
7456 } 7209 }
7457 7210
7458 /** 7211 /**
7459 * Set the name of the declared type of the parameter to the given type name. 7212 * Set the name of the declared type of the parameter to the given type name.
7460 * 7213 *
7461 * @param typeName the name of the declared type of the parameter 7214 * @param typeName the name of the declared type of the parameter
7462 */ 7215 */
7463 void set type(TypeName typeName) { 7216 void set type(TypeName typeName) {
7464 _type = becomeParentOf(typeName); 7217 _type = becomeParentOf(typeName);
7465 } 7218 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
7534 * 7287 *
7535 * @param awaitKeyword the token representing the 'await' keyword 7288 * @param awaitKeyword the token representing the 'await' keyword
7536 * @param forKeyword the token representing the 'for' keyword 7289 * @param forKeyword the token representing the 'for' keyword
7537 * @param leftParenthesis the left parenthesis 7290 * @param leftParenthesis the left parenthesis
7538 * @param loopVariable the declaration of the loop variable 7291 * @param loopVariable the declaration of the loop variable
7539 * @param iterator the expression evaluated to produce the iterator 7292 * @param iterator the expression evaluated to produce the iterator
7540 * @param rightParenthesis the right parenthesis 7293 * @param rightParenthesis the right parenthesis
7541 * @param body the body of the loop 7294 * @param body the body of the loop
7542 */ 7295 */
7543 ForEachStatement.con1(this.awaitKeyword, this.forKeyword, this.leftParenthesis , DeclaredIdentifier loopVariable, this.inKeyword, Expression iterator, this.rig htParenthesis, Statement body) { 7296 ForEachStatement.con1(this.awaitKeyword, this.forKeyword, this.leftParenthesis , DeclaredIdentifier loopVariable, this.inKeyword, Expression iterator, this.rig htParenthesis, Statement body) {
7544 this._loopVariable = becomeParentOf(loopVariable); 7297 _loopVariable = becomeParentOf(loopVariable);
7545 this._iterable = becomeParentOf(iterator); 7298 _iterable = becomeParentOf(iterator);
7546 this._body = becomeParentOf(body); 7299 _body = becomeParentOf(body);
7547 } 7300 }
7548 7301
7549 /** 7302 /**
7550 * Initialize a newly created for-each statement. 7303 * Initialize a newly created for-each statement.
7551 * 7304 *
7552 * @param awaitKeyword the token representing the 'await' keyword 7305 * @param awaitKeyword the token representing the 'await' keyword
7553 * @param forKeyword the token representing the 'for' keyword 7306 * @param forKeyword the token representing the 'for' keyword
7554 * @param leftParenthesis the left parenthesis 7307 * @param leftParenthesis the left parenthesis
7555 * @param identifier the loop variable 7308 * @param identifier the loop variable
7556 * @param iterator the expression evaluated to produce the iterator 7309 * @param iterator the expression evaluated to produce the iterator
7557 * @param rightParenthesis the right parenthesis 7310 * @param rightParenthesis the right parenthesis
7558 * @param body the body of the loop 7311 * @param body the body of the loop
7559 */ 7312 */
7560 ForEachStatement.con2(this.awaitKeyword, this.forKeyword, this.leftParenthesis , SimpleIdentifier identifier, this.inKeyword, Expression iterator, this.rightPa renthesis, Statement body) { 7313 ForEachStatement.con2(this.awaitKeyword, this.forKeyword, this.leftParenthesis , SimpleIdentifier identifier, this.inKeyword, Expression iterator, this.rightPa renthesis, Statement body) {
7561 this._identifier = becomeParentOf(identifier); 7314 _identifier = becomeParentOf(identifier);
7562 this._iterable = becomeParentOf(iterator); 7315 _iterable = becomeParentOf(iterator);
7563 this._body = becomeParentOf(body); 7316 _body = becomeParentOf(body);
7564 } 7317 }
7565 7318
7566 @override 7319 @override
7567 accept(AstVisitor visitor) => visitor.visitForEachStatement(this); 7320 accept(AstVisitor visitor) => visitor.visitForEachStatement(this);
7568 7321
7569 @override 7322 @override
7570 Token get beginToken => forKeyword; 7323 Token get beginToken => forKeyword;
7571 7324
7572 /** 7325 /**
7573 * Return the body of the loop. 7326 * Return the body of the loop.
(...skipping 26 matching lines...) Expand all
7600 * @return the declaration of the loop variable 7353 * @return the declaration of the loop variable
7601 */ 7354 */
7602 DeclaredIdentifier get loopVariable => _loopVariable; 7355 DeclaredIdentifier get loopVariable => _loopVariable;
7603 7356
7604 /** 7357 /**
7605 * Set the body of the loop to the given block. 7358 * Set the body of the loop to the given block.
7606 * 7359 *
7607 * @param body the body of the loop 7360 * @param body the body of the loop
7608 */ 7361 */
7609 void set body(Statement body) { 7362 void set body(Statement body) {
7610 this._body = becomeParentOf(body); 7363 _body = becomeParentOf(body);
7611 } 7364 }
7612 7365
7613 /** 7366 /**
7614 * Set the loop variable to the given variable. 7367 * Set the loop variable to the given variable.
7615 * 7368 *
7616 * @param identifier the loop variable 7369 * @param identifier the loop variable
7617 */ 7370 */
7618 void set identifier(SimpleIdentifier identifier) { 7371 void set identifier(SimpleIdentifier identifier) {
7619 this._identifier = becomeParentOf(identifier); 7372 _identifier = becomeParentOf(identifier);
7620 } 7373 }
7621 7374
7622 /** 7375 /**
7623 * Set the expression evaluated to produce the iterator to the given expressio n. 7376 * Set the expression evaluated to produce the iterator to the given expressio n.
7624 * 7377 *
7625 * @param expression the expression evaluated to produce the iterator 7378 * @param expression the expression evaluated to produce the iterator
7626 */ 7379 */
7627 void set iterable(Expression expression) { 7380 void set iterable(Expression expression) {
7628 _iterable = becomeParentOf(expression); 7381 _iterable = becomeParentOf(expression);
7629 } 7382 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
7725 * @param variableList the declaration of the loop variables 7478 * @param variableList the declaration of the loop variables
7726 * @param initialization the initialization expression 7479 * @param initialization the initialization expression
7727 * @param leftSeparator the semicolon separating the initializer and the condi tion 7480 * @param leftSeparator the semicolon separating the initializer and the condi tion
7728 * @param condition the condition used to determine when to terminate the loop 7481 * @param condition the condition used to determine when to terminate the loop
7729 * @param rightSeparator the semicolon separating the condition and the update r 7482 * @param rightSeparator the semicolon separating the condition and the update r
7730 * @param updaters the list of expressions run after each execution of the loo p body 7483 * @param updaters the list of expressions run after each execution of the loo p body
7731 * @param rightParenthesis the right parenthesis 7484 * @param rightParenthesis the right parenthesis
7732 * @param body the body of the loop 7485 * @param body the body of the loop
7733 */ 7486 */
7734 ForStatement(this.forKeyword, this.leftParenthesis, VariableDeclarationList va riableList, Expression initialization, this.leftSeparator, Expression condition, this.rightSeparator, List<Expression> updaters, this.rightParenthesis, Statemen t body) { 7487 ForStatement(this.forKeyword, this.leftParenthesis, VariableDeclarationList va riableList, Expression initialization, this.leftSeparator, Expression condition, this.rightSeparator, List<Expression> updaters, this.rightParenthesis, Statemen t body) {
7735 this._updaters = new NodeList<Expression>(this); 7488 _variableList = becomeParentOf(variableList);
7736 this._variableList = becomeParentOf(variableList); 7489 _initialization = becomeParentOf(initialization);
7737 this._initialization = becomeParentOf(initialization); 7490 _condition = becomeParentOf(condition);
7738 this._condition = becomeParentOf(condition); 7491 _updaters = new NodeList<Expression>(this, updaters);
7739 this._updaters.addAll(updaters); 7492 _body = becomeParentOf(body);
7740 this._body = becomeParentOf(body);
7741 } 7493 }
7742 7494
7743 @override 7495 @override
7744 accept(AstVisitor visitor) => visitor.visitForStatement(this); 7496 accept(AstVisitor visitor) => visitor.visitForStatement(this);
7745 7497
7746 @override 7498 @override
7747 Token get beginToken => forKeyword; 7499 Token get beginToken => forKeyword;
7748 7500
7749 /** 7501 /**
7750 * Return the body of the loop. 7502 * Return the body of the loop.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
7784 * @return the declaration of the loop variables, or `null` if there are no va riables 7536 * @return the declaration of the loop variables, or `null` if there are no va riables
7785 */ 7537 */
7786 VariableDeclarationList get variables => _variableList; 7538 VariableDeclarationList get variables => _variableList;
7787 7539
7788 /** 7540 /**
7789 * Set the body of the loop to the given statement. 7541 * Set the body of the loop to the given statement.
7790 * 7542 *
7791 * @param body the body of the loop 7543 * @param body the body of the loop
7792 */ 7544 */
7793 void set body(Statement body) { 7545 void set body(Statement body) {
7794 this._body = becomeParentOf(body); 7546 _body = becomeParentOf(body);
7795 } 7547 }
7796 7548
7797 /** 7549 /**
7798 * Set the condition used to determine when to terminate the loop to the given expression. 7550 * Set the condition used to determine when to terminate the loop to the given expression.
7799 * 7551 *
7800 * @param expression the condition used to determine when to terminate the loo p 7552 * @param expression the condition used to determine when to terminate the loo p
7801 */ 7553 */
7802 void set condition(Expression expression) { 7554 void set condition(Expression expression) {
7803 _condition = becomeParentOf(expression); 7555 _condition = becomeParentOf(expression);
7804 } 7556 }
7805 7557
7806 /** 7558 /**
7807 * Set the initialization expression to the given expression. 7559 * Set the initialization expression to the given expression.
7808 * 7560 *
7809 * @param initialization the initialization expression 7561 * @param initialization the initialization expression
7810 */ 7562 */
7811 void set initialization(Expression initialization) { 7563 void set initialization(Expression initialization) {
7812 this._initialization = becomeParentOf(initialization); 7564 _initialization = becomeParentOf(initialization);
7813 } 7565 }
7814 7566
7815 /** 7567 /**
7816 * Set the declaration of the loop variables to the given parameter. 7568 * Set the declaration of the loop variables to the given parameter.
7817 * 7569 *
7818 * @param variableList the declaration of the loop variables 7570 * @param variableList the declaration of the loop variables
7819 */ 7571 */
7820 void set variables(VariableDeclarationList variableList) { 7572 void set variables(VariableDeclarationList variableList) {
7821 this._variableList = becomeParentOf(variableList); 7573 _variableList = becomeParentOf(variableList);
7822 } 7574 }
7823 7575
7824 @override 7576 @override
7825 void visitChildren(AstVisitor visitor) { 7577 void visitChildren(AstVisitor visitor) {
7826 safelyVisitChild(_variableList, visitor); 7578 safelyVisitChild(_variableList, visitor);
7827 safelyVisitChild(_initialization, visitor); 7579 safelyVisitChild(_initialization, visitor);
7828 safelyVisitChild(_condition, visitor); 7580 safelyVisitChild(_condition, visitor);
7829 _updaters.accept(visitor); 7581 _updaters.accept(visitor);
7830 safelyVisitChild(_body, visitor); 7582 safelyVisitChild(_body, visitor);
7831 } 7583 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
7913 * '[' [DefaultFormalParameter] (',' [DefaultFormalParameter])* ']' 7665 * '[' [DefaultFormalParameter] (',' [DefaultFormalParameter])* ']'
7914 * 7666 *
7915 * namedFormalParameters ::= 7667 * namedFormalParameters ::=
7916 * '{' [DefaultFormalParameter] (',' [DefaultFormalParameter])* '}' 7668 * '{' [DefaultFormalParameter] (',' [DefaultFormalParameter])* '}'
7917 * </pre> 7669 * </pre>
7918 */ 7670 */
7919 class FormalParameterList extends AstNode { 7671 class FormalParameterList extends AstNode {
7920 /** 7672 /**
7921 * The left parenthesis. 7673 * The left parenthesis.
7922 */ 7674 */
7923 Token _leftParenthesis; 7675 Token leftParenthesis;
7924 7676
7925 /** 7677 /**
7926 * The parameters associated with the method. 7678 * The parameters associated with the method.
7927 */ 7679 */
7928 NodeList<FormalParameter> _parameters; 7680 NodeList<FormalParameter> _parameters;
7929 7681
7930 /** 7682 /**
7931 * The left square bracket ('[') or left curly brace ('{') introducing the opt ional parameters, or 7683 * The left square bracket ('[') or left curly brace ('{') introducing the opt ional parameters, or
7932 * `null` if there are no optional parameters. 7684 * `null` if there are no optional parameters.
7933 */ 7685 */
7934 Token _leftDelimiter; 7686 Token leftDelimiter;
7935 7687
7936 /** 7688 /**
7937 * The right square bracket (']') or right curly brace ('}') introducing the o ptional parameters, 7689 * The right square bracket (']') or right curly brace ('}') introducing the o ptional parameters,
7938 * or `null` if there are no optional parameters. 7690 * or `null` if there are no optional parameters.
7939 */ 7691 */
7940 Token _rightDelimiter; 7692 Token rightDelimiter;
7941 7693
7942 /** 7694 /**
7943 * The right parenthesis. 7695 * The right parenthesis.
7944 */ 7696 */
7945 Token _rightParenthesis; 7697 Token rightParenthesis;
7946 7698
7947 /** 7699 /**
7948 * Initialize a newly created parameter list. 7700 * Initialize a newly created parameter list.
7949 * 7701 *
7950 * @param leftParenthesis the left parenthesis 7702 * @param leftParenthesis the left parenthesis
7951 * @param parameters the parameters associated with the method 7703 * @param parameters the parameters associated with the method
7952 * @param leftDelimiter the left delimiter introducing the optional parameters 7704 * @param leftDelimiter the left delimiter introducing the optional parameters
7953 * @param rightDelimiter the right delimiter introducing the optional paramete rs 7705 * @param rightDelimiter the right delimiter introducing the optional paramete rs
7954 * @param rightParenthesis the right parenthesis 7706 * @param rightParenthesis the right parenthesis
7955 */ 7707 */
7956 FormalParameterList(Token leftParenthesis, List<FormalParameter> parameters, T oken leftDelimiter, Token rightDelimiter, Token rightParenthesis) { 7708 FormalParameterList(this.leftParenthesis, List<FormalParameter> parameters, th is.leftDelimiter, this.rightDelimiter, this.rightParenthesis) {
7957 this._parameters = new NodeList<FormalParameter>(this); 7709 _parameters = new NodeList<FormalParameter>(this, parameters);
7958 this._leftParenthesis = leftParenthesis;
7959 this._parameters.addAll(parameters);
7960 this._leftDelimiter = leftDelimiter;
7961 this._rightDelimiter = rightDelimiter;
7962 this._rightParenthesis = rightParenthesis;
7963 } 7710 }
7964 7711
7965 @override 7712 @override
7966 accept(AstVisitor visitor) => visitor.visitFormalParameterList(this); 7713 accept(AstVisitor visitor) => visitor.visitFormalParameterList(this);
7967 7714
7968 @override 7715 @override
7969 Token get beginToken => _leftParenthesis; 7716 Token get beginToken => leftParenthesis;
7970 7717
7971 @override 7718 @override
7972 Token get endToken => _rightParenthesis; 7719 Token get endToken => rightParenthesis;
7973
7974 /**
7975 * Return the left square bracket ('[') or left curly brace ('{') introducing the optional
7976 * parameters, or `null` if there are no optional parameters.
7977 *
7978 * @return the left square bracket ('[') or left curly brace ('{') introducing the optional
7979 * parameters
7980 */
7981 Token get leftDelimiter => _leftDelimiter;
7982
7983 /**
7984 * Return the left parenthesis.
7985 *
7986 * @return the left parenthesis
7987 */
7988 Token get leftParenthesis => _leftParenthesis;
7989 7720
7990 /** 7721 /**
7991 * Return an array containing the elements representing the parameters in this list. The array 7722 * Return an array containing the elements representing the parameters in this list. The array
7992 * will contain `null`s if the parameters in this list have not been resolved. 7723 * will contain `null`s if the parameters in this list have not been resolved.
7993 * 7724 *
7994 * @return the elements representing the parameters in this list 7725 * @return the elements representing the parameters in this list
7995 */ 7726 */
7996 List<ParameterElement> get parameterElements { 7727 List<ParameterElement> get parameterElements {
7997 int count = _parameters.length; 7728 int count = _parameters.length;
7998 List<ParameterElement> types = new List<ParameterElement>(count); 7729 List<ParameterElement> types = new List<ParameterElement>(count);
7999 for (int i = 0; i < count; i++) { 7730 for (int i = 0; i < count; i++) {
8000 types[i] = _parameters[i].element; 7731 types[i] = _parameters[i].element;
8001 } 7732 }
8002 return types; 7733 return types;
8003 } 7734 }
8004 7735
8005 /** 7736 /**
8006 * Return the parameters associated with the method. 7737 * Return the parameters associated with the method.
8007 * 7738 *
8008 * @return the parameters associated with the method 7739 * @return the parameters associated with the method
8009 */ 7740 */
8010 NodeList<FormalParameter> get parameters => _parameters; 7741 NodeList<FormalParameter> get parameters => _parameters;
8011 7742
8012 /**
8013 * Return the right square bracket (']') or right curly brace ('}') introducin g the optional
8014 * parameters, or `null` if there are no optional parameters.
8015 *
8016 * @return the right square bracket (']') or right curly brace ('}') introduci ng the optional
8017 * parameters
8018 */
8019 Token get rightDelimiter => _rightDelimiter;
8020
8021 /**
8022 * Return the right parenthesis.
8023 *
8024 * @return the right parenthesis
8025 */
8026 Token get rightParenthesis => _rightParenthesis;
8027
8028 /**
8029 * Set the left square bracket ('[') or left curly brace ('{') introducing the optional parameters
8030 * to the given token.
8031 *
8032 * @param bracket the left delimiter introducing the optional parameters
8033 */
8034 void set leftDelimiter(Token bracket) {
8035 _leftDelimiter = bracket;
8036 }
8037
8038 /**
8039 * Set the left parenthesis to the given token.
8040 *
8041 * @param parenthesis the left parenthesis
8042 */
8043 void set leftParenthesis(Token parenthesis) {
8044 _leftParenthesis = parenthesis;
8045 }
8046
8047 /**
8048 * Set the right square bracket (']') or right curly brace ('}') introducing t he optional
8049 * parameters to the given token.
8050 *
8051 * @param bracket the right delimiter introducing the optional parameters
8052 */
8053 void set rightDelimiter(Token bracket) {
8054 _rightDelimiter = bracket;
8055 }
8056
8057 /**
8058 * Set the right parenthesis to the given token.
8059 *
8060 * @param parenthesis the right parenthesis
8061 */
8062 void set rightParenthesis(Token parenthesis) {
8063 _rightParenthesis = parenthesis;
8064 }
8065
8066 @override 7743 @override
8067 void visitChildren(AstVisitor visitor) { 7744 void visitChildren(AstVisitor visitor) {
8068 _parameters.accept(visitor); 7745 _parameters.accept(visitor);
8069 } 7746 }
8070 } 7747 }
8071 7748
8072 /** 7749 /**
8073 * The abstract class `FunctionBody` defines the behavior common to objects repr esenting the 7750 * The abstract class `FunctionBody` defines the behavior common to objects repr esenting the
8074 * body of a function or method. 7751 * body of a function or method.
8075 * 7752 *
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
8163 * 7840 *
8164 * @param comment the documentation comment associated with this function 7841 * @param comment the documentation comment associated with this function
8165 * @param metadata the annotations associated with this function 7842 * @param metadata the annotations associated with this function
8166 * @param externalKeyword the token representing the 'external' keyword 7843 * @param externalKeyword the token representing the 'external' keyword
8167 * @param returnType the return type of the function 7844 * @param returnType the return type of the function
8168 * @param propertyKeyword the token representing the 'get' or 'set' keyword 7845 * @param propertyKeyword the token representing the 'get' or 'set' keyword
8169 * @param name the name of the function 7846 * @param name the name of the function
8170 * @param functionExpression the function expression being wrapped 7847 * @param functionExpression the function expression being wrapped
8171 */ 7848 */
8172 FunctionDeclaration(Comment comment, List<Annotation> metadata, this.externalK eyword, TypeName returnType, this.propertyKeyword, SimpleIdentifier name, Functi onExpression functionExpression) : super(comment, metadata) { 7849 FunctionDeclaration(Comment comment, List<Annotation> metadata, this.externalK eyword, TypeName returnType, this.propertyKeyword, SimpleIdentifier name, Functi onExpression functionExpression) : super(comment, metadata) {
8173 this._returnType = becomeParentOf(returnType); 7850 _returnType = becomeParentOf(returnType);
8174 this._name = becomeParentOf(name); 7851 _name = becomeParentOf(name);
8175 this._functionExpression = becomeParentOf(functionExpression); 7852 _functionExpression = becomeParentOf(functionExpression);
8176 } 7853 }
8177 7854
8178 @override 7855 @override
8179 accept(AstVisitor visitor) => visitor.visitFunctionDeclaration(this); 7856 accept(AstVisitor visitor) => visitor.visitFunctionDeclaration(this);
8180 7857
8181 @override 7858 @override
8182 ExecutableElement get element => _name != null ? (_name.staticElement as Execu tableElement) : null; 7859 ExecutableElement get element => _name != null ? (_name.staticElement as Execu tableElement) : null;
8183 7860
8184 @override 7861 @override
8185 Token get endToken => _functionExpression.endToken; 7862 Token get endToken => _functionExpression.endToken;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
8218 * @return `true` if this function declares a setter 7895 * @return `true` if this function declares a setter
8219 */ 7896 */
8220 bool get isSetter => propertyKeyword != null && (propertyKeyword as KeywordTok en).keyword == Keyword.SET; 7897 bool get isSetter => propertyKeyword != null && (propertyKeyword as KeywordTok en).keyword == Keyword.SET;
8221 7898
8222 /** 7899 /**
8223 * Set the function expression being wrapped to the given function expression. 7900 * Set the function expression being wrapped to the given function expression.
8224 * 7901 *
8225 * @param functionExpression the function expression being wrapped 7902 * @param functionExpression the function expression being wrapped
8226 */ 7903 */
8227 void set functionExpression(FunctionExpression functionExpression) { 7904 void set functionExpression(FunctionExpression functionExpression) {
8228 this._functionExpression = becomeParentOf(functionExpression); 7905 _functionExpression = becomeParentOf(functionExpression);
8229 } 7906 }
8230 7907
8231 /** 7908 /**
8232 * Set the name of the function to the given identifier. 7909 * Set the name of the function to the given identifier.
8233 * 7910 *
8234 * @param identifier the name of the function 7911 * @param identifier the name of the function
8235 */ 7912 */
8236 void set name(SimpleIdentifier identifier) { 7913 void set name(SimpleIdentifier identifier) {
8237 this._name = becomeParentOf(identifier); 7914 _name = becomeParentOf(identifier);
8238 } 7915 }
8239 7916
8240 /** 7917 /**
8241 * Set the return type of the function to the given name. 7918 * Set the return type of the function to the given name.
8242 * 7919 *
8243 * @param returnType the return type of the function 7920 * @param returnType the return type of the function
8244 */ 7921 */
8245 void set returnType(TypeName returnType) { 7922 void set returnType(TypeName returnType) {
8246 this._returnType = becomeParentOf(returnType); 7923 _returnType = becomeParentOf(returnType);
8247 } 7924 }
8248 7925
8249 @override 7926 @override
8250 void visitChildren(AstVisitor visitor) { 7927 void visitChildren(AstVisitor visitor) {
8251 super.visitChildren(visitor); 7928 super.visitChildren(visitor);
8252 safelyVisitChild(_returnType, visitor); 7929 safelyVisitChild(_returnType, visitor);
8253 safelyVisitChild(_name, visitor); 7930 safelyVisitChild(_name, visitor);
8254 safelyVisitChild(_functionExpression, visitor); 7931 safelyVisitChild(_functionExpression, visitor);
8255 } 7932 }
8256 7933
8257 @override 7934 @override
8258 Token get firstTokenAfterCommentAndMetadata { 7935 Token get firstTokenAfterCommentAndMetadata {
8259 if (externalKeyword != null) { 7936 if (externalKeyword != null) {
8260 return externalKeyword; 7937 return externalKeyword;
8261 } 7938 } else if (_returnType != null) {
8262 if (_returnType != null) {
8263 return _returnType.beginToken; 7939 return _returnType.beginToken;
8264 } else if (propertyKeyword != null) { 7940 } else if (propertyKeyword != null) {
8265 return propertyKeyword; 7941 return propertyKeyword;
8266 } else if (_name != null) { 7942 } else if (_name != null) {
8267 return _name.beginToken; 7943 return _name.beginToken;
8268 } 7944 }
8269 return _functionExpression.beginToken; 7945 return _functionExpression.beginToken;
8270 } 7946 }
8271 } 7947 }
8272 7948
8273 /** 7949 /**
8274 * Instances of the class `FunctionDeclarationStatement` wrap a [FunctionDeclara tion 7950 * Instances of the class `FunctionDeclarationStatement` wrap a [FunctionDeclara tion
8275 ] as a statement. 7951 ] as a statement.
8276 */ 7952 */
8277 class FunctionDeclarationStatement extends Statement { 7953 class FunctionDeclarationStatement extends Statement {
8278 /** 7954 /**
8279 * The function declaration being wrapped. 7955 * The function declaration being wrapped.
8280 */ 7956 */
8281 FunctionDeclaration _functionDeclaration; 7957 FunctionDeclaration _functionDeclaration;
8282 7958
8283 /** 7959 /**
8284 * Initialize a newly created function declaration statement. 7960 * Initialize a newly created function declaration statement.
8285 * 7961 *
8286 * @param functionDeclaration the the function declaration being wrapped 7962 * @param functionDeclaration the the function declaration being wrapped
8287 */ 7963 */
8288 FunctionDeclarationStatement(FunctionDeclaration functionDeclaration) { 7964 FunctionDeclarationStatement(FunctionDeclaration functionDeclaration) {
8289 this._functionDeclaration = becomeParentOf(functionDeclaration); 7965 _functionDeclaration = becomeParentOf(functionDeclaration);
8290 } 7966 }
8291 7967
8292 @override 7968 @override
8293 accept(AstVisitor visitor) => visitor.visitFunctionDeclarationStatement(this); 7969 accept(AstVisitor visitor) => visitor.visitFunctionDeclarationStatement(this);
8294 7970
8295 @override 7971 @override
8296 Token get beginToken => _functionDeclaration.beginToken; 7972 Token get beginToken => _functionDeclaration.beginToken;
8297 7973
8298 @override 7974 @override
8299 Token get endToken => _functionDeclaration.endToken; 7975 Token get endToken => _functionDeclaration.endToken;
8300 7976
8301 /** 7977 /**
8302 * Return the function declaration being wrapped. 7978 * Return the function declaration being wrapped.
8303 * 7979 *
8304 * @return the function declaration being wrapped 7980 * @return the function declaration being wrapped
8305 */ 7981 */
8306 FunctionDeclaration get functionDeclaration => _functionDeclaration; 7982 FunctionDeclaration get functionDeclaration => _functionDeclaration;
8307 7983
8308 /** 7984 /**
8309 * Set the function declaration being wrapped to the given function declaratio n. 7985 * Set the function declaration being wrapped to the given function declaratio n.
8310 * 7986 *
8311 * @param functionDeclaration the function declaration being wrapped 7987 * @param functionDeclaration the function declaration being wrapped
8312 */ 7988 */
8313 void set functionDeclaration(FunctionDeclaration functionDeclaration) { 7989 void set functionDeclaration(FunctionDeclaration functionDeclaration) {
8314 this._functionDeclaration = becomeParentOf(functionDeclaration); 7990 _functionDeclaration = becomeParentOf(functionDeclaration);
8315 } 7991 }
8316 7992
8317 @override 7993 @override
8318 void visitChildren(AstVisitor visitor) { 7994 void visitChildren(AstVisitor visitor) {
8319 safelyVisitChild(_functionDeclaration, visitor); 7995 safelyVisitChild(_functionDeclaration, visitor);
8320 } 7996 }
8321 } 7997 }
8322 7998
8323 /** 7999 /**
8324 * Instances of the class `FunctionExpression` represent a function expression. 8000 * Instances of the class `FunctionExpression` represent a function expression.
(...skipping 20 matching lines...) Expand all
8345 */ 8021 */
8346 ExecutableElement element; 8022 ExecutableElement element;
8347 8023
8348 /** 8024 /**
8349 * Initialize a newly created function declaration. 8025 * Initialize a newly created function declaration.
8350 * 8026 *
8351 * @param parameters the parameters associated with the function 8027 * @param parameters the parameters associated with the function
8352 * @param body the body of the function 8028 * @param body the body of the function
8353 */ 8029 */
8354 FunctionExpression(FormalParameterList parameters, FunctionBody body) { 8030 FunctionExpression(FormalParameterList parameters, FunctionBody body) {
8355 this._parameters = becomeParentOf(parameters); 8031 _parameters = becomeParentOf(parameters);
8356 this._body = becomeParentOf(body); 8032 _body = becomeParentOf(body);
8357 } 8033 }
8358 8034
8359 @override 8035 @override
8360 accept(AstVisitor visitor) => visitor.visitFunctionExpression(this); 8036 accept(AstVisitor visitor) => visitor.visitFunctionExpression(this);
8361 8037
8362 @override 8038 @override
8363 Token get beginToken { 8039 Token get beginToken {
8364 if (_parameters != null) { 8040 if (_parameters != null) {
8365 return _parameters.beginToken; 8041 return _parameters.beginToken;
8366 } else if (_body != null) { 8042 } else if (_body != null) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
8408 void set body(FunctionBody functionBody) { 8084 void set body(FunctionBody functionBody) {
8409 _body = becomeParentOf(functionBody); 8085 _body = becomeParentOf(functionBody);
8410 } 8086 }
8411 8087
8412 /** 8088 /**
8413 * Set the parameters associated with the function to the given list of parame ters. 8089 * Set the parameters associated with the function to the given list of parame ters.
8414 * 8090 *
8415 * @param parameters the parameters associated with the function 8091 * @param parameters the parameters associated with the function
8416 */ 8092 */
8417 void set parameters(FormalParameterList parameters) { 8093 void set parameters(FormalParameterList parameters) {
8418 this._parameters = becomeParentOf(parameters); 8094 _parameters = becomeParentOf(parameters);
8419 } 8095 }
8420 8096
8421 @override 8097 @override
8422 void visitChildren(AstVisitor visitor) { 8098 void visitChildren(AstVisitor visitor) {
8423 safelyVisitChild(_parameters, visitor); 8099 safelyVisitChild(_parameters, visitor);
8424 safelyVisitChild(_body, visitor); 8100 safelyVisitChild(_body, visitor);
8425 } 8101 }
8426 } 8102 }
8427 8103
8428 /** 8104 /**
(...skipping 22 matching lines...) Expand all
8451 /** 8127 /**
8452 * The element associated with the function being invoked based on static type information, or 8128 * The element associated with the function being invoked based on static type information, or
8453 * `null` if the AST structure has not been resolved or the function could not be resolved. 8129 * `null` if the AST structure has not been resolved or the function could not be resolved.
8454 */ 8130 */
8455 ExecutableElement staticElement; 8131 ExecutableElement staticElement;
8456 8132
8457 /** 8133 /**
8458 * The element associated with the function being invoked based on propagated type information, or 8134 * The element associated with the function being invoked based on propagated type information, or
8459 * `null` if the AST structure has not been resolved or the function could not be resolved. 8135 * `null` if the AST structure has not been resolved or the function could not be resolved.
8460 */ 8136 */
8461 ExecutableElement _propagatedElement; 8137 ExecutableElement propagatedElement;
8462 8138
8463 /** 8139 /**
8464 * Initialize a newly created function expression invocation. 8140 * Initialize a newly created function expression invocation.
8465 * 8141 *
8466 * @param function the expression producing the function being invoked 8142 * @param function the expression producing the function being invoked
8467 * @param argumentList the list of arguments to the method 8143 * @param argumentList the list of arguments to the method
8468 */ 8144 */
8469 FunctionExpressionInvocation(Expression function, ArgumentList argumentList) { 8145 FunctionExpressionInvocation(Expression function, ArgumentList argumentList) {
8470 this._function = becomeParentOf(function); 8146 _function = becomeParentOf(function);
8471 this._argumentList = becomeParentOf(argumentList); 8147 _argumentList = becomeParentOf(argumentList);
8472 } 8148 }
8473 8149
8474 @override 8150 @override
8475 accept(AstVisitor visitor) => visitor.visitFunctionExpressionInvocation(this); 8151 accept(AstVisitor visitor) => visitor.visitFunctionExpressionInvocation(this);
8476 8152
8477 /** 8153 /**
8478 * Return the list of arguments to the method. 8154 * Return the list of arguments to the method.
8479 * 8155 *
8480 * @return the list of arguments to the method 8156 * @return the list of arguments to the method
8481 */ 8157 */
(...skipping 25 matching lines...) Expand all
8507 * Return the expression producing the function being invoked. 8183 * Return the expression producing the function being invoked.
8508 * 8184 *
8509 * @return the expression producing the function being invoked 8185 * @return the expression producing the function being invoked
8510 */ 8186 */
8511 Expression get function => _function; 8187 Expression get function => _function;
8512 8188
8513 @override 8189 @override
8514 int get precedence => 15; 8190 int get precedence => 15;
8515 8191
8516 /** 8192 /**
8517 * Return the element associated with the function being invoked based on prop agated type
8518 * information, or `null` if the AST structure has not been resolved or the fu nction could
8519 * not be resolved. One common example of the latter case is an expression who se value can change
8520 * over time.
8521 *
8522 * @return the element associated with the function being invoked
8523 */
8524 ExecutableElement get propagatedElement => _propagatedElement;
8525
8526 /**
8527 * Set the list of arguments to the method to the given list. 8193 * Set the list of arguments to the method to the given list.
8528 * 8194 *
8529 * @param argumentList the list of arguments to the method 8195 * @param argumentList the list of arguments to the method
8530 */ 8196 */
8531 void set argumentList(ArgumentList argumentList) { 8197 void set argumentList(ArgumentList argumentList) {
8532 this._argumentList = becomeParentOf(argumentList); 8198 _argumentList = becomeParentOf(argumentList);
8533 } 8199 }
8534 8200
8535 /** 8201 /**
8536 * Set the expression producing the function being invoked to the given expres sion. 8202 * Set the expression producing the function being invoked to the given expres sion.
8537 * 8203 *
8538 * @param function the expression producing the function being invoked 8204 * @param function the expression producing the function being invoked
8539 */ 8205 */
8540 void set function(Expression function) { 8206 void set function(Expression function) {
8541 this._function = becomeParentOf(function); 8207 _function = becomeParentOf(function);
8542 }
8543
8544 /**
8545 * Set the element associated with the function being invoked based on propaga ted type information
8546 * to the given element.
8547 *
8548 * @param element the element to be associated with the function being invoked
8549 */
8550 void set propagatedElement(ExecutableElement element) {
8551 _propagatedElement = element;
8552 } 8208 }
8553 8209
8554 @override 8210 @override
8555 void visitChildren(AstVisitor visitor) { 8211 void visitChildren(AstVisitor visitor) {
8556 safelyVisitChild(_function, visitor); 8212 safelyVisitChild(_function, visitor);
8557 safelyVisitChild(_argumentList, visitor); 8213 safelyVisitChild(_argumentList, visitor);
8558 } 8214 }
8559 } 8215 }
8560 8216
8561 /** 8217 /**
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
8598 * @param comment the documentation comment associated with this type alias 8254 * @param comment the documentation comment associated with this type alias
8599 * @param metadata the annotations associated with this type alias 8255 * @param metadata the annotations associated with this type alias
8600 * @param keyword the token representing the 'typedef' keyword 8256 * @param keyword the token representing the 'typedef' keyword
8601 * @param returnType the name of the return type of the function type being de fined 8257 * @param returnType the name of the return type of the function type being de fined
8602 * @param name the name of the type being declared 8258 * @param name the name of the type being declared
8603 * @param typeParameters the type parameters for the type 8259 * @param typeParameters the type parameters for the type
8604 * @param parameters the parameters associated with the function 8260 * @param parameters the parameters associated with the function
8605 * @param semicolon the semicolon terminating the declaration 8261 * @param semicolon the semicolon terminating the declaration
8606 */ 8262 */
8607 FunctionTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, T ypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters, For malParameterList parameters, Token semicolon) : super(comment, metadata, keyword , semicolon) { 8263 FunctionTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, T ypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters, For malParameterList parameters, Token semicolon) : super(comment, metadata, keyword , semicolon) {
8608 this._returnType = becomeParentOf(returnType); 8264 _returnType = becomeParentOf(returnType);
8609 this._name = becomeParentOf(name); 8265 _name = becomeParentOf(name);
8610 this._typeParameters = becomeParentOf(typeParameters); 8266 _typeParameters = becomeParentOf(typeParameters);
8611 this._parameters = becomeParentOf(parameters); 8267 _parameters = becomeParentOf(parameters);
8612 } 8268 }
8613 8269
8614 @override 8270 @override
8615 accept(AstVisitor visitor) => visitor.visitFunctionTypeAlias(this); 8271 accept(AstVisitor visitor) => visitor.visitFunctionTypeAlias(this);
8616 8272
8617 @override 8273 @override
8618 FunctionTypeAliasElement get element => _name != null ? (_name.staticElement a s FunctionTypeAliasElement) : null; 8274 FunctionTypeAliasElement get element => _name != null ? (_name.staticElement a s FunctionTypeAliasElement) : null;
8619 8275
8620 /** 8276 /**
8621 * Return the name of the function type being declared. 8277 * Return the name of the function type being declared.
(...skipping 24 matching lines...) Expand all
8646 * @return the type parameters for the function type 8302 * @return the type parameters for the function type
8647 */ 8303 */
8648 TypeParameterList get typeParameters => _typeParameters; 8304 TypeParameterList get typeParameters => _typeParameters;
8649 8305
8650 /** 8306 /**
8651 * Set the name of the function type being declared to the given identifier. 8307 * Set the name of the function type being declared to the given identifier.
8652 * 8308 *
8653 * @param name the name of the function type being declared 8309 * @param name the name of the function type being declared
8654 */ 8310 */
8655 void set name(SimpleIdentifier name) { 8311 void set name(SimpleIdentifier name) {
8656 this._name = becomeParentOf(name); 8312 _name = becomeParentOf(name);
8657 } 8313 }
8658 8314
8659 /** 8315 /**
8660 * Set the parameters associated with the function type to the given list of p arameters. 8316 * Set the parameters associated with the function type to the given list of p arameters.
8661 * 8317 *
8662 * @param parameters the parameters associated with the function type 8318 * @param parameters the parameters associated with the function type
8663 */ 8319 */
8664 void set parameters(FormalParameterList parameters) { 8320 void set parameters(FormalParameterList parameters) {
8665 this._parameters = becomeParentOf(parameters); 8321 _parameters = becomeParentOf(parameters);
8666 } 8322 }
8667 8323
8668 /** 8324 /**
8669 * Set the name of the return type of the function type being defined to the g iven type name. 8325 * Set the name of the return type of the function type being defined to the g iven type name.
8670 * 8326 *
8671 * @param typeName the name of the return type of the function type being defi ned 8327 * @param typeName the name of the return type of the function type being defi ned
8672 */ 8328 */
8673 void set returnType(TypeName typeName) { 8329 void set returnType(TypeName typeName) {
8674 _returnType = becomeParentOf(typeName); 8330 _returnType = becomeParentOf(typeName);
8675 } 8331 }
8676 8332
8677 /** 8333 /**
8678 * Set the type parameters for the function type to the given list of paramete rs. 8334 * Set the type parameters for the function type to the given list of paramete rs.
8679 * 8335 *
8680 * @param typeParameters the type parameters for the function type 8336 * @param typeParameters the type parameters for the function type
8681 */ 8337 */
8682 void set typeParameters(TypeParameterList typeParameters) { 8338 void set typeParameters(TypeParameterList typeParameters) {
8683 this._typeParameters = becomeParentOf(typeParameters); 8339 _typeParameters = becomeParentOf(typeParameters);
8684 } 8340 }
8685 8341
8686 @override 8342 @override
8687 void visitChildren(AstVisitor visitor) { 8343 void visitChildren(AstVisitor visitor) {
8688 super.visitChildren(visitor); 8344 super.visitChildren(visitor);
8689 safelyVisitChild(_returnType, visitor); 8345 safelyVisitChild(_returnType, visitor);
8690 safelyVisitChild(_name, visitor); 8346 safelyVisitChild(_name, visitor);
8691 safelyVisitChild(_typeParameters, visitor); 8347 safelyVisitChild(_typeParameters, visitor);
8692 safelyVisitChild(_parameters, visitor); 8348 safelyVisitChild(_parameters, visitor);
8693 } 8349 }
(...skipping 23 matching lines...) Expand all
8717 * Initialize a newly created formal parameter. 8373 * Initialize a newly created formal parameter.
8718 * 8374 *
8719 * @param comment the documentation comment associated with this parameter 8375 * @param comment the documentation comment associated with this parameter
8720 * @param metadata the annotations associated with this parameter 8376 * @param metadata the annotations associated with this parameter
8721 * @param returnType the return type of the function, or `null` if the functio n does not 8377 * @param returnType the return type of the function, or `null` if the functio n does not
8722 * have a return type 8378 * have a return type
8723 * @param identifier the name of the function-typed parameter 8379 * @param identifier the name of the function-typed parameter
8724 * @param parameters the parameters of the function-typed parameter 8380 * @param parameters the parameters of the function-typed parameter
8725 */ 8381 */
8726 FunctionTypedFormalParameter(Comment comment, List<Annotation> metadata, TypeN ame returnType, SimpleIdentifier identifier, FormalParameterList parameters) : s uper(comment, metadata, identifier) { 8382 FunctionTypedFormalParameter(Comment comment, List<Annotation> metadata, TypeN ame returnType, SimpleIdentifier identifier, FormalParameterList parameters) : s uper(comment, metadata, identifier) {
8727 this._returnType = becomeParentOf(returnType); 8383 _returnType = becomeParentOf(returnType);
8728 this._parameters = becomeParentOf(parameters); 8384 _parameters = becomeParentOf(parameters);
8729 } 8385 }
8730 8386
8731 @override 8387 @override
8732 accept(AstVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this); 8388 accept(AstVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this);
8733 8389
8734 @override 8390 @override
8735 Token get beginToken { 8391 Token get beginToken {
8736 if (_returnType != null) { 8392 if (_returnType != null) {
8737 return _returnType.beginToken; 8393 return _returnType.beginToken;
8738 } 8394 }
(...skipping 23 matching lines...) Expand all
8762 8418
8763 @override 8419 @override
8764 bool get isFinal => false; 8420 bool get isFinal => false;
8765 8421
8766 /** 8422 /**
8767 * Set the parameters of the function-typed parameter to the given parameters. 8423 * Set the parameters of the function-typed parameter to the given parameters.
8768 * 8424 *
8769 * @param parameters the parameters of the function-typed parameter 8425 * @param parameters the parameters of the function-typed parameter
8770 */ 8426 */
8771 void set parameters(FormalParameterList parameters) { 8427 void set parameters(FormalParameterList parameters) {
8772 this._parameters = becomeParentOf(parameters); 8428 _parameters = becomeParentOf(parameters);
8773 } 8429 }
8774 8430
8775 /** 8431 /**
8776 * Set the return type of the function to the given type. 8432 * Set the return type of the function to the given type.
8777 * 8433 *
8778 * @param returnType the return type of the function 8434 * @param returnType the return type of the function
8779 */ 8435 */
8780 void set returnType(TypeName returnType) { 8436 void set returnType(TypeName returnType) {
8781 this._returnType = becomeParentOf(returnType); 8437 _returnType = becomeParentOf(returnType);
8782 } 8438 }
8783 8439
8784 @override 8440 @override
8785 void visitChildren(AstVisitor visitor) { 8441 void visitChildren(AstVisitor visitor) {
8786 super.visitChildren(visitor); 8442 super.visitChildren(visitor);
8787 safelyVisitChild(_returnType, visitor); 8443 safelyVisitChild(_returnType, visitor);
8788 safelyVisitChild(identifier, visitor); 8444 safelyVisitChild(identifier, visitor);
8789 safelyVisitChild(_parameters, visitor); 8445 safelyVisitChild(_parameters, visitor);
8790 } 8446 }
8791 } 8447 }
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
9202 */ 8858 */
9203 NodeList<SimpleIdentifier> _hiddenNames; 8859 NodeList<SimpleIdentifier> _hiddenNames;
9204 8860
9205 /** 8861 /**
9206 * Initialize a newly created import show combinator. 8862 * Initialize a newly created import show combinator.
9207 * 8863 *
9208 * @param keyword the comma introducing the combinator 8864 * @param keyword the comma introducing the combinator
9209 * @param hiddenNames the list of names from the library that are hidden by th is combinator 8865 * @param hiddenNames the list of names from the library that are hidden by th is combinator
9210 */ 8866 */
9211 HideCombinator(Token keyword, List<SimpleIdentifier> hiddenNames) : super(keyw ord) { 8867 HideCombinator(Token keyword, List<SimpleIdentifier> hiddenNames) : super(keyw ord) {
9212 this._hiddenNames = new NodeList<SimpleIdentifier>(this); 8868 _hiddenNames = new NodeList<SimpleIdentifier>(this, hiddenNames);
9213 this._hiddenNames.addAll(hiddenNames);
9214 } 8869 }
9215 8870
9216 @override 8871 @override
9217 accept(AstVisitor visitor) => visitor.visitHideCombinator(this); 8872 accept(AstVisitor visitor) => visitor.visitHideCombinator(this);
9218 8873
9219 @override 8874 @override
9220 Token get endToken => _hiddenNames.endToken; 8875 Token get endToken => _hiddenNames.endToken;
9221 8876
9222 /** 8877 /**
9223 * Return the list of names from the library that are hidden by this combinato r. 8878 * Return the list of names from the library that are hidden by this combinato r.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
9343 * 8998 *
9344 * @param ifKeyword the token representing the 'if' keyword 8999 * @param ifKeyword the token representing the 'if' keyword
9345 * @param leftParenthesis the left parenthesis 9000 * @param leftParenthesis the left parenthesis
9346 * @param condition the condition used to determine which of the statements is executed next 9001 * @param condition the condition used to determine which of the statements is executed next
9347 * @param rightParenthesis the right parenthesis 9002 * @param rightParenthesis the right parenthesis
9348 * @param thenStatement the statement that is executed if the condition evalua tes to `true` 9003 * @param thenStatement the statement that is executed if the condition evalua tes to `true`
9349 * @param elseKeyword the token representing the 'else' keyword 9004 * @param elseKeyword the token representing the 'else' keyword
9350 * @param elseStatement the statement that is executed if the condition evalua tes to `false` 9005 * @param elseStatement the statement that is executed if the condition evalua tes to `false`
9351 */ 9006 */
9352 IfStatement(this.ifKeyword, this.leftParenthesis, Expression condition, this.r ightParenthesis, Statement thenStatement, this.elseKeyword, Statement elseStatem ent) { 9007 IfStatement(this.ifKeyword, this.leftParenthesis, Expression condition, this.r ightParenthesis, Statement thenStatement, this.elseKeyword, Statement elseStatem ent) {
9353 this._condition = becomeParentOf(condition); 9008 _condition = becomeParentOf(condition);
9354 this._thenStatement = becomeParentOf(thenStatement); 9009 _thenStatement = becomeParentOf(thenStatement);
9355 this._elseStatement = becomeParentOf(elseStatement); 9010 _elseStatement = becomeParentOf(elseStatement);
9356 } 9011 }
9357 9012
9358 @override 9013 @override
9359 accept(AstVisitor visitor) => visitor.visitIfStatement(this); 9014 accept(AstVisitor visitor) => visitor.visitIfStatement(this);
9360 9015
9361 @override 9016 @override
9362 Token get beginToken => ifKeyword; 9017 Token get beginToken => ifKeyword;
9363 9018
9364 /** 9019 /**
9365 * Return the condition used to determine which of the statements is executed next. 9020 * Return the condition used to determine which of the statements is executed next.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
9449 */ 9104 */
9450 NodeList<TypeName> _interfaces; 9105 NodeList<TypeName> _interfaces;
9451 9106
9452 /** 9107 /**
9453 * Initialize a newly created implements clause. 9108 * Initialize a newly created implements clause.
9454 * 9109 *
9455 * @param keyword the token representing the 'implements' keyword 9110 * @param keyword the token representing the 'implements' keyword
9456 * @param interfaces the interfaces that are being implemented 9111 * @param interfaces the interfaces that are being implemented
9457 */ 9112 */
9458 ImplementsClause(this.keyword, List<TypeName> interfaces) { 9113 ImplementsClause(this.keyword, List<TypeName> interfaces) {
9459 this._interfaces = new NodeList<TypeName>(this); 9114 _interfaces = new NodeList<TypeName>(this, interfaces);
9460 this._interfaces.addAll(interfaces);
9461 } 9115 }
9462 9116
9463 @override 9117 @override
9464 accept(AstVisitor visitor) => visitor.visitImplementsClause(this); 9118 accept(AstVisitor visitor) => visitor.visitImplementsClause(this);
9465 9119
9466 @override 9120 @override
9467 Token get beginToken => keyword; 9121 Token get beginToken => keyword;
9468 9122
9469 @override 9123 @override
9470 Token get endToken => _interfaces.endToken; 9124 Token get endToken => _interfaces.endToken;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
9606 * @param metadata the annotations associated with the directive 9260 * @param metadata the annotations associated with the directive
9607 * @param keyword the token representing the 'import' keyword 9261 * @param keyword the token representing the 'import' keyword
9608 * @param libraryUri the URI of the library being imported 9262 * @param libraryUri the URI of the library being imported
9609 * @param deferredToken the token representing the 'deferred' token 9263 * @param deferredToken the token representing the 'deferred' token
9610 * @param asToken the token representing the 'as' token 9264 * @param asToken the token representing the 'as' token
9611 * @param prefix the prefix to be used with the imported names 9265 * @param prefix the prefix to be used with the imported names
9612 * @param combinators the combinators used to control how names are imported 9266 * @param combinators the combinators used to control how names are imported
9613 * @param semicolon the semicolon terminating the directive 9267 * @param semicolon the semicolon terminating the directive
9614 */ 9268 */
9615 ImportDirective(Comment comment, List<Annotation> metadata, Token keyword, Str ingLiteral libraryUri, this.deferredToken, this.asToken, SimpleIdentifier prefix , List<Combinator> combinators, Token semicolon) : super(comment, metadata, keyw ord, libraryUri, combinators, semicolon) { 9269 ImportDirective(Comment comment, List<Annotation> metadata, Token keyword, Str ingLiteral libraryUri, this.deferredToken, this.asToken, SimpleIdentifier prefix , List<Combinator> combinators, Token semicolon) : super(comment, metadata, keyw ord, libraryUri, combinators, semicolon) {
9616 this._prefix = becomeParentOf(prefix); 9270 _prefix = becomeParentOf(prefix);
9617 } 9271 }
9618 9272
9619 @override 9273 @override
9620 accept(AstVisitor visitor) => visitor.visitImportDirective(this); 9274 accept(AstVisitor visitor) => visitor.visitImportDirective(this);
9621 9275
9622 @override 9276 @override
9623 ImportElement get element => super.element as ImportElement; 9277 ImportElement get element => super.element as ImportElement;
9624 9278
9625 /** 9279 /**
9626 * Return the prefix to be used with the imported names, or `null` if the impo rted names are 9280 * Return the prefix to be used with the imported names, or `null` if the impo rted names are
(...skipping 11 matching lines...) Expand all
9638 } 9292 }
9639 return element.importedLibrary; 9293 return element.importedLibrary;
9640 } 9294 }
9641 9295
9642 /** 9296 /**
9643 * Set the prefix to be used with the imported names to the given identifier. 9297 * Set the prefix to be used with the imported names to the given identifier.
9644 * 9298 *
9645 * @param prefix the prefix to be used with the imported names 9299 * @param prefix the prefix to be used with the imported names
9646 */ 9300 */
9647 void set prefix(SimpleIdentifier prefix) { 9301 void set prefix(SimpleIdentifier prefix) {
9648 this._prefix = becomeParentOf(prefix); 9302 _prefix = becomeParentOf(prefix);
9649 } 9303 }
9650 9304
9651 @override 9305 @override
9652 void visitChildren(AstVisitor visitor) { 9306 void visitChildren(AstVisitor visitor) {
9653 super.visitChildren(visitor); 9307 super.visitChildren(visitor);
9654 safelyVisitChild(_prefix, visitor); 9308 safelyVisitChild(_prefix, visitor);
9655 combinators.accept(visitor); 9309 combinators.accept(visitor);
9656 } 9310 }
9657 } 9311 }
9658 9312
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
10307 9961
10308 /** 9962 /**
10309 * The period ("..") before a cascaded index expression, or `null` if this ind ex expression 9963 * The period ("..") before a cascaded index expression, or `null` if this ind ex expression
10310 * is not part of a cascade expression. 9964 * is not part of a cascade expression.
10311 */ 9965 */
10312 Token period; 9966 Token period;
10313 9967
10314 /** 9968 /**
10315 * The left square bracket. 9969 * The left square bracket.
10316 */ 9970 */
10317 Token _leftBracket; 9971 Token leftBracket;
10318 9972
10319 /** 9973 /**
10320 * The expression used to compute the index. 9974 * The expression used to compute the index.
10321 */ 9975 */
10322 Expression _index; 9976 Expression _index;
10323 9977
10324 /** 9978 /**
10325 * The right square bracket. 9979 * The right square bracket.
10326 */ 9980 */
10327 Token _rightBracket; 9981 Token rightBracket;
10328 9982
10329 /** 9983 /**
10330 * The element associated with the operator based on the static type of the ta rget, or 9984 * The element associated with the operator based on the static type of the ta rget, or
10331 * `null` if the AST structure has not been resolved or if the operator could not be 9985 * `null` if the AST structure has not been resolved or if the operator could not be
10332 * resolved. 9986 * resolved.
10333 */ 9987 */
10334 MethodElement _staticElement; 9988 MethodElement staticElement;
10335 9989
10336 /** 9990 /**
10337 * The element associated with the operator based on the propagated type of th e target, or 9991 * The element associated with the operator based on the propagated type of th e target, or
10338 * `null` if the AST structure has not been resolved or if the operator could not be 9992 * `null` if the AST structure has not been resolved or if the operator could not be
10339 * resolved. 9993 * resolved.
10340 */ 9994 */
10341 MethodElement _propagatedElement; 9995 MethodElement propagatedElement;
10342 9996
10343 /** 9997 /**
10344 * If this expression is both in a getter and setter context, the [AuxiliaryEl ements] will 9998 * If this expression is both in a getter and setter context, the [AuxiliaryEl ements] will
10345 * be set to hold onto the static and propagated information. The auxiliary el ement will hold onto 9999 * be set to hold onto the static and propagated information. The auxiliary el ement will hold onto
10346 * the elements from the getter context. 10000 * the elements from the getter context.
10347 */ 10001 */
10348 AuxiliaryElements auxiliaryElements = null; 10002 AuxiliaryElements auxiliaryElements = null;
10349 10003
10350 /** 10004 /**
10351 * Initialize a newly created index expression. 10005 * Initialize a newly created index expression.
10352 * 10006 *
10353 * @param target the expression used to compute the object being indexed 10007 * @param target the expression used to compute the object being indexed
10354 * @param leftBracket the left square bracket 10008 * @param leftBracket the left square bracket
10355 * @param index the expression used to compute the index 10009 * @param index the expression used to compute the index
10356 * @param rightBracket the right square bracket 10010 * @param rightBracket the right square bracket
10357 */ 10011 */
10358 IndexExpression.forTarget(Expression target, Token leftBracket, Expression ind ex, Token rightBracket) { 10012 IndexExpression.forTarget(Expression target, this.leftBracket, Expression inde x, this.rightBracket) {
10359 this._target = becomeParentOf(target); 10013 _target = becomeParentOf(target);
10360 this._leftBracket = leftBracket; 10014 _index = becomeParentOf(index);
10361 this._index = becomeParentOf(index);
10362 this._rightBracket = rightBracket;
10363 } 10015 }
10364 10016
10365 /** 10017 /**
10366 * Initialize a newly created index expression. 10018 * Initialize a newly created index expression.
10367 * 10019 *
10368 * @param period the period ("..") before a cascaded index expression 10020 * @param period the period ("..") before a cascaded index expression
10369 * @param leftBracket the left square bracket 10021 * @param leftBracket the left square bracket
10370 * @param index the expression used to compute the index 10022 * @param index the expression used to compute the index
10371 * @param rightBracket the right square bracket 10023 * @param rightBracket the right square bracket
10372 */ 10024 */
10373 IndexExpression.forCascade(this.period, Token leftBracket, Expression index, T oken rightBracket) { 10025 IndexExpression.forCascade(this.period, this.leftBracket, Expression index, th is.rightBracket) {
10374 this._leftBracket = leftBracket; 10026 _index = becomeParentOf(index);
10375 this._index = becomeParentOf(index);
10376 this._rightBracket = rightBracket;
10377 } 10027 }
10378 10028
10379 @override 10029 @override
10380 accept(AstVisitor visitor) => visitor.visitIndexExpression(this); 10030 accept(AstVisitor visitor) => visitor.visitIndexExpression(this);
10381 10031
10382 @override 10032 @override
10383 Token get beginToken { 10033 Token get beginToken {
10384 if (_target != null) { 10034 if (_target != null) {
10385 return _target.beginToken; 10035 return _target.beginToken;
10386 } 10036 }
(...skipping 10 matching lines...) Expand all
10397 */ 10047 */
10398 MethodElement get bestElement { 10048 MethodElement get bestElement {
10399 MethodElement element = propagatedElement; 10049 MethodElement element = propagatedElement;
10400 if (element == null) { 10050 if (element == null) {
10401 element = staticElement; 10051 element = staticElement;
10402 } 10052 }
10403 return element; 10053 return element;
10404 } 10054 }
10405 10055
10406 @override 10056 @override
10407 Token get endToken => _rightBracket; 10057 Token get endToken => rightBracket;
10408 10058
10409 /** 10059 /**
10410 * Return the expression used to compute the index. 10060 * Return the expression used to compute the index.
10411 * 10061 *
10412 * @return the expression used to compute the index 10062 * @return the expression used to compute the index
10413 */ 10063 */
10414 Expression get index => _index; 10064 Expression get index => _index;
10415 10065
10416 /**
10417 * Return the left square bracket.
10418 *
10419 * @return the left square bracket
10420 */
10421 Token get leftBracket => _leftBracket;
10422
10423 @override 10066 @override
10424 int get precedence => 15; 10067 int get precedence => 15;
10425 10068
10426 /** 10069 /**
10427 * Return the element associated with the operator based on the propagated typ e of the target, or
10428 * `null` if the AST structure has not been resolved or if the operator could not be
10429 * resolved. One example of the latter case is an operator that is not defined for the type of the
10430 * target.
10431 *
10432 * @return the element associated with this operator
10433 */
10434 MethodElement get propagatedElement => _propagatedElement;
10435
10436 /**
10437 * Return the expression used to compute the object being indexed. If this ind ex expression is not 10070 * Return the expression used to compute the object being indexed. If this ind ex expression is not
10438 * part of a cascade expression, then this is the same as [getTarget]. If this index 10071 * part of a cascade expression, then this is the same as [getTarget]. If this index
10439 * expression is part of a cascade expression, then the target expression stor ed with the cascade 10072 * expression is part of a cascade expression, then the target expression stor ed with the cascade
10440 * expression is returned. 10073 * expression is returned.
10441 * 10074 *
10442 * @return the expression used to compute the object being indexed 10075 * @return the expression used to compute the object being indexed
10443 * See [target]. 10076 * See [target].
10444 */ 10077 */
10445 Expression get realTarget { 10078 Expression get realTarget {
10446 if (isCascaded) { 10079 if (isCascaded) {
10447 AstNode ancestor = parent; 10080 AstNode ancestor = parent;
10448 while (ancestor is! CascadeExpression) { 10081 while (ancestor is! CascadeExpression) {
10449 if (ancestor == null) { 10082 if (ancestor == null) {
10450 return _target; 10083 return _target;
10451 } 10084 }
10452 ancestor = ancestor.parent; 10085 ancestor = ancestor.parent;
10453 } 10086 }
10454 return (ancestor as CascadeExpression).target; 10087 return (ancestor as CascadeExpression).target;
10455 } 10088 }
10456 return _target; 10089 return _target;
10457 } 10090 }
10458 10091
10459 /** 10092 /**
10460 * Return the right square bracket.
10461 *
10462 * @return the right square bracket
10463 */
10464 Token get rightBracket => _rightBracket;
10465
10466 /**
10467 * Return the element associated with the operator based on the static type of the target, or
10468 * `null` if the AST structure has not been resolved or if the operator could not be
10469 * resolved. One example of the latter case is an operator that is not defined for the type of the
10470 * target.
10471 *
10472 * @return the element associated with the operator
10473 */
10474 MethodElement get staticElement => _staticElement;
10475
10476 /**
10477 * Return the expression used to compute the object being indexed, or `null` i f this index 10093 * Return the expression used to compute the object being indexed, or `null` i f this index
10478 * expression is part of a cascade expression. 10094 * expression is part of a cascade expression.
10479 * 10095 *
10480 * @return the expression used to compute the object being indexed 10096 * @return the expression used to compute the object being indexed
10481 * See [realTarget]. 10097 * See [realTarget].
10482 */ 10098 */
10483 Expression get target => _target; 10099 Expression get target => _target;
10484 10100
10485 /** 10101 /**
10486 * Return `true` if this expression is computing a right-hand value. 10102 * Return `true` if this expression is computing a right-hand value.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
10539 /** 10155 /**
10540 * Set the expression used to compute the index to the given expression. 10156 * Set the expression used to compute the index to the given expression.
10541 * 10157 *
10542 * @param expression the expression used to compute the index 10158 * @param expression the expression used to compute the index
10543 */ 10159 */
10544 void set index(Expression expression) { 10160 void set index(Expression expression) {
10545 _index = becomeParentOf(expression); 10161 _index = becomeParentOf(expression);
10546 } 10162 }
10547 10163
10548 /** 10164 /**
10549 * Set the left square bracket to the given token.
10550 *
10551 * @param bracket the left square bracket
10552 */
10553 void set leftBracket(Token bracket) {
10554 _leftBracket = bracket;
10555 }
10556
10557 /**
10558 * Set the element associated with the operator based on the propagated type o f the target to the
10559 * given element.
10560 *
10561 * @param element the element to be associated with this operator
10562 */
10563 void set propagatedElement(MethodElement element) {
10564 _propagatedElement = element;
10565 }
10566
10567 /**
10568 * Set the right square bracket to the given token.
10569 *
10570 * @param bracket the right square bracket
10571 */
10572 void set rightBracket(Token bracket) {
10573 _rightBracket = bracket;
10574 }
10575
10576 /**
10577 * Set the element associated with the operator based on the static type of th e target to the
10578 * given element.
10579 *
10580 * @param element the static element to be associated with the operator
10581 */
10582 void set staticElement(MethodElement element) {
10583 _staticElement = element;
10584 }
10585
10586 /**
10587 * Set the expression used to compute the object being indexed to the given ex pression. 10165 * Set the expression used to compute the object being indexed to the given ex pression.
10588 * 10166 *
10589 * @param expression the expression used to compute the object being indexed 10167 * @param expression the expression used to compute the object being indexed
10590 */ 10168 */
10591 void set target(Expression expression) { 10169 void set target(Expression expression) {
10592 _target = becomeParentOf(expression); 10170 _target = becomeParentOf(expression);
10593 } 10171 }
10594 10172
10595 @override 10173 @override
10596 void visitChildren(AstVisitor visitor) { 10174 void visitChildren(AstVisitor visitor) {
10597 safelyVisitChild(_target, visitor); 10175 safelyVisitChild(_target, visitor);
10598 safelyVisitChild(_index, visitor); 10176 safelyVisitChild(_index, visitor);
10599 } 10177 }
10600 10178
10601 /** 10179 /**
10602 * If the AST structure has been resolved, and the function being invoked is k nown based on 10180 * If the AST structure has been resolved, and the function being invoked is k nown based on
10603 * propagated type information, then return the parameter element representing the parameter to 10181 * propagated type information, then return the parameter element representing the parameter to
10604 * which the value of the index expression will be bound. Otherwise, return `n ull`. 10182 * which the value of the index expression will be bound. Otherwise, return `n ull`.
10605 * 10183 *
10606 * This method is only intended to be used by [Expression.propagatedParameterE lement]. 10184 * This method is only intended to be used by [Expression.propagatedParameterE lement].
10607 * 10185 *
10608 * @return the parameter element representing the parameter to which the value of the index 10186 * @return the parameter element representing the parameter to which the value of the index
10609 * expression will be bound 10187 * expression will be bound
10610 */ 10188 */
10611 ParameterElement get propagatedParameterElementForIndex { 10189 ParameterElement get propagatedParameterElementForIndex {
10612 if (_propagatedElement == null) { 10190 if (propagatedElement == null) {
10613 return null; 10191 return null;
10614 } 10192 }
10615 List<ParameterElement> parameters = _propagatedElement.parameters; 10193 List<ParameterElement> parameters = propagatedElement.parameters;
10616 if (parameters.length < 1) { 10194 if (parameters.length < 1) {
10617 return null; 10195 return null;
10618 } 10196 }
10619 return parameters[0]; 10197 return parameters[0];
10620 } 10198 }
10621 10199
10622 /** 10200 /**
10623 * If the AST structure has been resolved, and the function being invoked is k nown based on static 10201 * If the AST structure has been resolved, and the function being invoked is k nown based on static
10624 * type information, then return the parameter element representing the parame ter to which the 10202 * type information, then return the parameter element representing the parame ter to which the
10625 * value of the index expression will be bound. Otherwise, return `null`. 10203 * value of the index expression will be bound. Otherwise, return `null`.
10626 * 10204 *
10627 * This method is only intended to be used by [Expression.staticParameterEleme nt]. 10205 * This method is only intended to be used by [Expression.staticParameterEleme nt].
10628 * 10206 *
10629 * @return the parameter element representing the parameter to which the value of the index 10207 * @return the parameter element representing the parameter to which the value of the index
10630 * expression will be bound 10208 * expression will be bound
10631 */ 10209 */
10632 ParameterElement get staticParameterElementForIndex { 10210 ParameterElement get staticParameterElementForIndex {
10633 if (_staticElement == null) { 10211 if (staticElement == null) {
10634 return null; 10212 return null;
10635 } 10213 }
10636 List<ParameterElement> parameters = _staticElement.parameters; 10214 List<ParameterElement> parameters = staticElement.parameters;
10637 if (parameters.length < 1) { 10215 if (parameters.length < 1) {
10638 return null; 10216 return null;
10639 } 10217 }
10640 return parameters[0]; 10218 return parameters[0];
10641 } 10219 }
10642 } 10220 }
10643 10221
10644 /** 10222 /**
10645 * Instances of the class `InstanceCreationExpression` represent an instance cre ation 10223 * Instances of the class `InstanceCreationExpression` represent an instance cre ation
10646 * expression. 10224 * expression.
(...skipping 21 matching lines...) Expand all
10668 10246
10669 /** 10247 /**
10670 * The element associated with the constructor based on static type informatio n, or `null` 10248 * The element associated with the constructor based on static type informatio n, or `null`
10671 * if the AST structure has not been resolved or if the constructor could not be resolved. 10249 * if the AST structure has not been resolved or if the constructor could not be resolved.
10672 */ 10250 */
10673 ConstructorElement staticElement; 10251 ConstructorElement staticElement;
10674 10252
10675 /** 10253 /**
10676 * The result of evaluating this expression, if it is constant. 10254 * The result of evaluating this expression, if it is constant.
10677 */ 10255 */
10678 EvaluationResultImpl _result; 10256 EvaluationResultImpl evaluationResult;
10679 10257
10680 /** 10258 /**
10681 * Initialize a newly created instance creation expression. 10259 * Initialize a newly created instance creation expression.
10682 * 10260 *
10683 * @param keyword the keyword used to indicate how an object should be created 10261 * @param keyword the keyword used to indicate how an object should be created
10684 * @param constructorName the name of the constructor to be invoked 10262 * @param constructorName the name of the constructor to be invoked
10685 * @param argumentList the list of arguments to the constructor 10263 * @param argumentList the list of arguments to the constructor
10686 */ 10264 */
10687 InstanceCreationExpression(this.keyword, ConstructorName constructorName, Argu mentList argumentList) { 10265 InstanceCreationExpression(this.keyword, ConstructorName constructorName, Argu mentList argumentList) {
10688 this._constructorName = becomeParentOf(constructorName); 10266 _constructorName = becomeParentOf(constructorName);
10689 this._argumentList = becomeParentOf(argumentList); 10267 _argumentList = becomeParentOf(argumentList);
10690 } 10268 }
10691 10269
10692 @override 10270 @override
10693 accept(AstVisitor visitor) => visitor.visitInstanceCreationExpression(this); 10271 accept(AstVisitor visitor) => visitor.visitInstanceCreationExpression(this);
10694 10272
10695 /** 10273 /**
10696 * Return the list of arguments to the constructor. 10274 * Return the list of arguments to the constructor.
10697 * 10275 *
10698 * @return the list of arguments to the constructor 10276 * @return the list of arguments to the constructor
10699 */ 10277 */
10700 ArgumentList get argumentList => _argumentList; 10278 ArgumentList get argumentList => _argumentList;
10701 10279
10702 @override 10280 @override
10703 Token get beginToken => keyword; 10281 Token get beginToken => keyword;
10704 10282
10705 /** 10283 /**
10706 * Return the name of the constructor to be invoked. 10284 * Return the name of the constructor to be invoked.
10707 * 10285 *
10708 * @return the name of the constructor to be invoked 10286 * @return the name of the constructor to be invoked
10709 */ 10287 */
10710 ConstructorName get constructorName => _constructorName; 10288 ConstructorName get constructorName => _constructorName;
10711 10289
10712 @override 10290 @override
10713 Token get endToken => _argumentList.endToken; 10291 Token get endToken => _argumentList.endToken;
10714 10292
10715 /**
10716 * Return the result of evaluating this constant as a compile-time constant ex pression, or
10717 * `null` if this variable is not a 'const' expression or an error prevented t he result from
10718 * being computed.
10719 *
10720 * @return the result of evaluating this constant
10721 */
10722 EvaluationResultImpl get evaluationResult => _result;
10723
10724 @override 10293 @override
10725 int get precedence => 16; 10294 int get precedence => 16;
10726 10295
10727 /** 10296 /**
10728 * Return `true` if this creation expression is used to invoke a constant cons tructor. 10297 * Return `true` if this creation expression is used to invoke a constant cons tructor.
10729 * 10298 *
10730 * @return `true` if this creation expression is used to invoke a constant con structor 10299 * @return `true` if this creation expression is used to invoke a constant con structor
10731 */ 10300 */
10732 bool get isConst => keyword is KeywordToken && (keyword as KeywordToken).keywo rd == Keyword.CONST; 10301 bool get isConst => keyword is KeywordToken && (keyword as KeywordToken).keywo rd == Keyword.CONST;
10733 10302
10734 /** 10303 /**
10735 * Set the list of arguments to the constructor to the given list. 10304 * Set the list of arguments to the constructor to the given list.
10736 * 10305 *
10737 * @param argumentList the list of arguments to the constructor 10306 * @param argumentList the list of arguments to the constructor
10738 */ 10307 */
10739 void set argumentList(ArgumentList argumentList) { 10308 void set argumentList(ArgumentList argumentList) {
10740 this._argumentList = becomeParentOf(argumentList); 10309 _argumentList = becomeParentOf(argumentList);
10741 } 10310 }
10742 10311
10743 /** 10312 /**
10744 * Set the name of the constructor to be invoked to the given name. 10313 * Set the name of the constructor to be invoked to the given name.
10745 * 10314 *
10746 * @param constructorName the name of the constructor to be invoked 10315 * @param constructorName the name of the constructor to be invoked
10747 */ 10316 */
10748 void set constructorName(ConstructorName constructorName) { 10317 void set constructorName(ConstructorName constructorName) {
10749 this._constructorName = becomeParentOf(constructorName); 10318 _constructorName = becomeParentOf(constructorName);
10750 }
10751
10752 /**
10753 * Set the result of evaluating this expression as a compile-time constant exp ression to the given
10754 * result.
10755 *
10756 * @param result the result of evaluating this expression
10757 */
10758 void set evaluationResult(EvaluationResultImpl result) {
10759 this._result = result;
10760 } 10319 }
10761 10320
10762 @override 10321 @override
10763 void visitChildren(AstVisitor visitor) { 10322 void visitChildren(AstVisitor visitor) {
10764 safelyVisitChild(_constructorName, visitor); 10323 safelyVisitChild(_constructorName, visitor);
10765 safelyVisitChild(_argumentList, visitor); 10324 safelyVisitChild(_argumentList, visitor);
10766 } 10325 }
10767 } 10326 }
10768 10327
10769 /** 10328 /**
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
10857 Token rightBracket; 10416 Token rightBracket;
10858 10417
10859 /** 10418 /**
10860 * Initialize a newly created interpolation expression. 10419 * Initialize a newly created interpolation expression.
10861 * 10420 *
10862 * @param leftBracket the left curly bracket 10421 * @param leftBracket the left curly bracket
10863 * @param expression the expression to be evaluated for the value to be conver ted into a string 10422 * @param expression the expression to be evaluated for the value to be conver ted into a string
10864 * @param rightBracket the right curly bracket 10423 * @param rightBracket the right curly bracket
10865 */ 10424 */
10866 InterpolationExpression(this.leftBracket, Expression expression, this.rightBra cket) { 10425 InterpolationExpression(this.leftBracket, Expression expression, this.rightBra cket) {
10867 this._expression = becomeParentOf(expression); 10426 _expression = becomeParentOf(expression);
10868 } 10427 }
10869 10428
10870 @override 10429 @override
10871 accept(AstVisitor visitor) => visitor.visitInterpolationExpression(this); 10430 accept(AstVisitor visitor) => visitor.visitInterpolationExpression(this);
10872 10431
10873 @override 10432 @override
10874 Token get beginToken => leftBracket; 10433 Token get beginToken => leftBracket;
10875 10434
10876 @override 10435 @override
10877 Token get endToken { 10436 Token get endToken {
(...skipping 10 matching lines...) Expand all
10888 */ 10447 */
10889 Expression get expression => _expression; 10448 Expression get expression => _expression;
10890 10449
10891 /** 10450 /**
10892 * Set the expression to be evaluated for the value to be converted into a str ing to the given 10451 * Set the expression to be evaluated for the value to be converted into a str ing to the given
10893 * expression. 10452 * expression.
10894 * 10453 *
10895 * @param expression the expression to be evaluated for the value to be conver ted into a string 10454 * @param expression the expression to be evaluated for the value to be conver ted into a string
10896 */ 10455 */
10897 void set expression(Expression expression) { 10456 void set expression(Expression expression) {
10898 this._expression = becomeParentOf(expression); 10457 _expression = becomeParentOf(expression);
10899 } 10458 }
10900 10459
10901 @override 10460 @override
10902 void visitChildren(AstVisitor visitor) { 10461 void visitChildren(AstVisitor visitor) {
10903 safelyVisitChild(_expression, visitor); 10462 safelyVisitChild(_expression, visitor);
10904 } 10463 }
10905 } 10464 }
10906 10465
10907 /** 10466 /**
10908 * Instances of the class `InterpolationString` represent a non-empty substring of an 10467 * Instances of the class `InterpolationString` represent a non-empty substring of an
10909 * interpolated string. 10468 * interpolated string.
10910 * 10469 *
10911 * <pre> 10470 * <pre>
10912 * interpolationString ::= 10471 * interpolationString ::=
10913 * characters 10472 * characters
10914 * </pre> 10473 * </pre>
10915 */ 10474 */
10916 class InterpolationString extends InterpolationElement { 10475 class InterpolationString extends InterpolationElement {
10917 /** 10476 /**
10918 * The characters that will be added to the string. 10477 * The characters that will be added to the string.
10919 */ 10478 */
10920 Token _contents; 10479 Token contents;
10921 10480
10922 /** 10481 /**
10923 * The value of the literal. 10482 * The value of the literal.
10924 */ 10483 */
10925 String _value; 10484 String _value;
10926 10485
10927 /** 10486 /**
10928 * Initialize a newly created string of characters that are part of a string i nterpolation. 10487 * Initialize a newly created string of characters that are part of a string i nterpolation.
10929 * 10488 *
10930 * @param the characters that will be added to the string 10489 * @param the characters that will be added to the string
10931 * @param value the value of the literal 10490 * @param value the value of the literal
10932 */ 10491 */
10933 InterpolationString(Token contents, String value) { 10492 InterpolationString(this.contents, String value) {
10934 this._contents = contents; 10493 _value = value;
10935 this._value = value;
10936 } 10494 }
10937 10495
10938 @override 10496 @override
10939 accept(AstVisitor visitor) => visitor.visitInterpolationString(this); 10497 accept(AstVisitor visitor) => visitor.visitInterpolationString(this);
10940 10498
10941 @override 10499 @override
10942 Token get beginToken => _contents; 10500 Token get beginToken => contents;
10943
10944 /**
10945 * Return the characters that will be added to the string.
10946 *
10947 * @return the characters that will be added to the string
10948 */
10949 Token get contents => _contents;
10950 10501
10951 @override 10502 @override
10952 Token get endToken => _contents; 10503 Token get endToken => contents;
10953 10504
10954 /** 10505 /**
10955 * Return the value of the literal. 10506 * Return the value of the literal.
10956 * 10507 *
10957 * @return the value of the literal 10508 * @return the value of the literal
10958 */ 10509 */
10959 String get value => _value; 10510 String get value => _value;
10960 10511
10961 /** 10512 /**
10962 * Set the characters that will be added to the string to those in the given s tring.
10963 *
10964 * @param string the characters that will be added to the string
10965 */
10966 void set contents(Token string) {
10967 _contents = string;
10968 }
10969
10970 /**
10971 * Set the value of the literal to the given string. 10513 * Set the value of the literal to the given string.
10972 * 10514 *
10973 * @param string the value of the literal 10515 * @param string the value of the literal
10974 */ 10516 */
10975 void set value(String string) { 10517 void set value(String string) {
10976 _value = string; 10518 _value = string;
10977 } 10519 }
10978 10520
10979 @override 10521 @override
10980 void visitChildren(AstVisitor visitor) { 10522 void visitChildren(AstVisitor visitor) {
10981 } 10523 }
10982 10524
10983 /** 10525 /**
10984 * Return the offset of the after-last contents character. 10526 * Return the offset of the after-last contents character.
10985 */ 10527 */
10986 int get contentsEnd { 10528 int get contentsEnd {
10987 int end = _contents.end; 10529 int end = contents.end;
10988 String lexeme = _contents.lexeme; 10530 String lexeme = contents.lexeme;
10989 if (StringUtilities.endsWith3(lexeme, 0x22, 0x22, 0x22) || 10531 if (StringUtilities.endsWith3(lexeme, 0x22, 0x22, 0x22) ||
10990 StringUtilities.endsWith3(lexeme, 0x27, 0x27, 0x27)) { 10532 StringUtilities.endsWith3(lexeme, 0x27, 0x27, 0x27)) {
10991 end -= 3; 10533 end -= 3;
10992 } else { 10534 } else {
10993 end -= 1; 10535 end -= 1;
10994 } 10536 }
10995 return end; 10537 return end;
10996 } 10538 }
10997 10539
10998 /** 10540 /**
10999 * Return the offset of the first contents character. 10541 * Return the offset of the first contents character.
11000 */ 10542 */
11001 int get contentsOffset { 10543 int get contentsOffset {
11002 int offset = _contents.offset; 10544 int offset = contents.offset;
11003 String lexeme = _contents.lexeme; 10545 String lexeme = contents.lexeme;
11004 if (lexeme.codeUnitAt(0) == 0x72) { 10546 if (lexeme.codeUnitAt(0) == 0x72) {
11005 offset += 1; 10547 offset += 1;
11006 } 10548 }
11007 if (StringUtilities.startsWith3(lexeme, offset, 0x22, 0x22, 0x22) || 10549 if (StringUtilities.startsWith3(lexeme, offset, 0x22, 0x22, 0x22) ||
11008 StringUtilities.startsWith3(lexeme, offset, 0x27, 0x27, 0x27)) { 10550 StringUtilities.startsWith3(lexeme, offset, 0x27, 0x27, 0x27)) {
11009 offset += 3; 10551 offset += 3;
11010 } else { 10552 } else {
11011 offset += 1; 10553 offset += 1;
11012 } 10554 }
11013 return offset; 10555 return offset;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
11045 10587
11046 /** 10588 /**
11047 * Initialize a newly created is expression. 10589 * Initialize a newly created is expression.
11048 * 10590 *
11049 * @param expression the expression used to compute the value whose type is be ing tested 10591 * @param expression the expression used to compute the value whose type is be ing tested
11050 * @param isOperator the is operator 10592 * @param isOperator the is operator
11051 * @param notOperator the not operator, or `null` if the sense of the test is not negated 10593 * @param notOperator the not operator, or `null` if the sense of the test is not negated
11052 * @param type the name of the type being tested for 10594 * @param type the name of the type being tested for
11053 */ 10595 */
11054 IsExpression(Expression expression, this.isOperator, this.notOperator, TypeNam e type) { 10596 IsExpression(Expression expression, this.isOperator, this.notOperator, TypeNam e type) {
11055 this._expression = becomeParentOf(expression); 10597 _expression = becomeParentOf(expression);
11056 this._type = becomeParentOf(type); 10598 _type = becomeParentOf(type);
11057 } 10599 }
11058 10600
11059 @override 10601 @override
11060 accept(AstVisitor visitor) => visitor.visitIsExpression(this); 10602 accept(AstVisitor visitor) => visitor.visitIsExpression(this);
11061 10603
11062 @override 10604 @override
11063 Token get beginToken => _expression.beginToken; 10605 Token get beginToken => _expression.beginToken;
11064 10606
11065 @override 10607 @override
11066 Token get endToken => _type.endToken; 10608 Token get endToken => _type.endToken;
(...skipping 15 matching lines...) Expand all
11082 */ 10624 */
11083 TypeName get type => _type; 10625 TypeName get type => _type;
11084 10626
11085 /** 10627 /**
11086 * Set the expression used to compute the value whose type is being tested to the given 10628 * Set the expression used to compute the value whose type is being tested to the given
11087 * expression. 10629 * expression.
11088 * 10630 *
11089 * @param expression the expression used to compute the value whose type is be ing tested 10631 * @param expression the expression used to compute the value whose type is be ing tested
11090 */ 10632 */
11091 void set expression(Expression expression) { 10633 void set expression(Expression expression) {
11092 this._expression = becomeParentOf(expression); 10634 _expression = becomeParentOf(expression);
11093 } 10635 }
11094 10636
11095 /** 10637 /**
11096 * Set the name of the type being tested for to the given name. 10638 * Set the name of the type being tested for to the given name.
11097 * 10639 *
11098 * @param name the name of the type being tested for 10640 * @param name the name of the type being tested for
11099 */ 10641 */
11100 void set type(TypeName name) { 10642 void set type(TypeName name) {
11101 this._type = becomeParentOf(name); 10643 _type = becomeParentOf(name);
11102 } 10644 }
11103 10645
11104 @override 10646 @override
11105 void visitChildren(AstVisitor visitor) { 10647 void visitChildren(AstVisitor visitor) {
11106 safelyVisitChild(_expression, visitor); 10648 safelyVisitChild(_expression, visitor);
11107 safelyVisitChild(_type, visitor); 10649 safelyVisitChild(_type, visitor);
11108 } 10650 }
11109 } 10651 }
11110 10652
11111 /** 10653 /**
(...skipping 15 matching lines...) Expand all
11127 */ 10669 */
11128 Token colon; 10670 Token colon;
11129 10671
11130 /** 10672 /**
11131 * Initialize a newly created label. 10673 * Initialize a newly created label.
11132 * 10674 *
11133 * @param label the label being applied 10675 * @param label the label being applied
11134 * @param colon the colon that separates the label from whatever follows 10676 * @param colon the colon that separates the label from whatever follows
11135 */ 10677 */
11136 Label(SimpleIdentifier label, this.colon) { 10678 Label(SimpleIdentifier label, this.colon) {
11137 this._label = becomeParentOf(label); 10679 _label = becomeParentOf(label);
11138 } 10680 }
11139 10681
11140 @override 10682 @override
11141 accept(AstVisitor visitor) => visitor.visitLabel(this); 10683 accept(AstVisitor visitor) => visitor.visitLabel(this);
11142 10684
11143 @override 10685 @override
11144 Token get beginToken => _label.beginToken; 10686 Token get beginToken => _label.beginToken;
11145 10687
11146 @override 10688 @override
11147 Token get endToken => colon; 10689 Token get endToken => colon;
11148 10690
11149 /** 10691 /**
11150 * Return the label being associated with the statement. 10692 * Return the label being associated with the statement.
11151 * 10693 *
11152 * @return the label being associated with the statement 10694 * @return the label being associated with the statement
11153 */ 10695 */
11154 SimpleIdentifier get label => _label; 10696 SimpleIdentifier get label => _label;
11155 10697
11156 /** 10698 /**
11157 * Set the label being associated with the statement to the given label. 10699 * Set the label being associated with the statement to the given label.
11158 * 10700 *
11159 * @param label the label being associated with the statement 10701 * @param label the label being associated with the statement
11160 */ 10702 */
11161 void set label(SimpleIdentifier label) { 10703 void set label(SimpleIdentifier label) {
11162 this._label = becomeParentOf(label); 10704 _label = becomeParentOf(label);
11163 } 10705 }
11164 10706
11165 @override 10707 @override
11166 void visitChildren(AstVisitor visitor) { 10708 void visitChildren(AstVisitor visitor) {
11167 safelyVisitChild(_label, visitor); 10709 safelyVisitChild(_label, visitor);
11168 } 10710 }
11169 } 10711 }
11170 10712
11171 /** 10713 /**
11172 * Instances of the class `LabeledStatement` represent a statement that has a la bel associated 10714 * Instances of the class `LabeledStatement` represent a statement that has a la bel associated
(...skipping 15 matching lines...) Expand all
11188 */ 10730 */
11189 Statement _statement; 10731 Statement _statement;
11190 10732
11191 /** 10733 /**
11192 * Initialize a newly created labeled statement. 10734 * Initialize a newly created labeled statement.
11193 * 10735 *
11194 * @param labels the labels being associated with the statement 10736 * @param labels the labels being associated with the statement
11195 * @param statement the statement with which the labels are being associated 10737 * @param statement the statement with which the labels are being associated
11196 */ 10738 */
11197 LabeledStatement(List<Label> labels, Statement statement) { 10739 LabeledStatement(List<Label> labels, Statement statement) {
11198 this._labels = new NodeList<Label>(this); 10740 _labels = new NodeList<Label>(this, labels);
11199 this._labels.addAll(labels); 10741 _statement = becomeParentOf(statement);
11200 this._statement = becomeParentOf(statement);
11201 } 10742 }
11202 10743
11203 @override 10744 @override
11204 accept(AstVisitor visitor) => visitor.visitLabeledStatement(this); 10745 accept(AstVisitor visitor) => visitor.visitLabeledStatement(this);
11205 10746
11206 @override 10747 @override
11207 Token get beginToken { 10748 Token get beginToken {
11208 if (!_labels.isEmpty) { 10749 if (!_labels.isEmpty) {
11209 return _labels.beginToken; 10750 return _labels.beginToken;
11210 } 10751 }
(...skipping 16 matching lines...) Expand all
11227 * @return the statement with which the labels are being associated 10768 * @return the statement with which the labels are being associated
11228 */ 10769 */
11229 Statement get statement => _statement; 10770 Statement get statement => _statement;
11230 10771
11231 /** 10772 /**
11232 * Set the statement with which the labels are being associated to the given s tatement. 10773 * Set the statement with which the labels are being associated to the given s tatement.
11233 * 10774 *
11234 * @param statement the statement with which the labels are being associated 10775 * @param statement the statement with which the labels are being associated
11235 */ 10776 */
11236 void set statement(Statement statement) { 10777 void set statement(Statement statement) {
11237 this._statement = becomeParentOf(statement); 10778 _statement = becomeParentOf(statement);
11238 } 10779 }
11239 10780
11240 @override 10781 @override
11241 void visitChildren(AstVisitor visitor) { 10782 void visitChildren(AstVisitor visitor) {
11242 _labels.accept(visitor); 10783 _labels.accept(visitor);
11243 safelyVisitChild(_statement, visitor); 10784 safelyVisitChild(_statement, visitor);
11244 } 10785 }
11245 } 10786 }
11246 10787
11247 /** 10788 /**
(...skipping 23 matching lines...) Expand all
11271 /** 10812 /**
11272 * Initialize a newly created library directive. 10813 * Initialize a newly created library directive.
11273 * 10814 *
11274 * @param comment the documentation comment associated with this directive 10815 * @param comment the documentation comment associated with this directive
11275 * @param metadata the annotations associated with the directive 10816 * @param metadata the annotations associated with the directive
11276 * @param libraryToken the token representing the 'library' token 10817 * @param libraryToken the token representing the 'library' token
11277 * @param name the name of the library being defined 10818 * @param name the name of the library being defined
11278 * @param semicolon the semicolon terminating the directive 10819 * @param semicolon the semicolon terminating the directive
11279 */ 10820 */
11280 LibraryDirective(Comment comment, List<Annotation> metadata, this.libraryToken , LibraryIdentifier name, this.semicolon) : super(comment, metadata) { 10821 LibraryDirective(Comment comment, List<Annotation> metadata, this.libraryToken , LibraryIdentifier name, this.semicolon) : super(comment, metadata) {
11281 this._name = becomeParentOf(name); 10822 _name = becomeParentOf(name);
11282 } 10823 }
11283 10824
11284 @override 10825 @override
11285 accept(AstVisitor visitor) => visitor.visitLibraryDirective(this); 10826 accept(AstVisitor visitor) => visitor.visitLibraryDirective(this);
11286 10827
11287 @override 10828 @override
11288 Token get endToken => semicolon; 10829 Token get endToken => semicolon;
11289 10830
11290 @override 10831 @override
11291 Token get keyword => libraryToken; 10832 Token get keyword => libraryToken;
11292 10833
11293 /** 10834 /**
11294 * Return the name of the library being defined. 10835 * Return the name of the library being defined.
11295 * 10836 *
11296 * @return the name of the library being defined 10837 * @return the name of the library being defined
11297 */ 10838 */
11298 LibraryIdentifier get name => _name; 10839 LibraryIdentifier get name => _name;
11299 10840
11300 /** 10841 /**
11301 * Set the name of the library being defined to the given name. 10842 * Set the name of the library being defined to the given name.
11302 * 10843 *
11303 * @param name the name of the library being defined 10844 * @param name the name of the library being defined
11304 */ 10845 */
11305 void set name(LibraryIdentifier name) { 10846 void set name(LibraryIdentifier name) {
11306 this._name = becomeParentOf(name); 10847 _name = becomeParentOf(name);
11307 } 10848 }
11308 10849
11309 @override 10850 @override
11310 void visitChildren(AstVisitor visitor) { 10851 void visitChildren(AstVisitor visitor) {
11311 super.visitChildren(visitor); 10852 super.visitChildren(visitor);
11312 safelyVisitChild(_name, visitor); 10853 safelyVisitChild(_name, visitor);
11313 } 10854 }
11314 10855
11315 @override 10856 @override
11316 Token get firstTokenAfterCommentAndMetadata => libraryToken; 10857 Token get firstTokenAfterCommentAndMetadata => libraryToken;
(...skipping 12 matching lines...) Expand all
11329 * The components of the identifier. 10870 * The components of the identifier.
11330 */ 10871 */
11331 NodeList<SimpleIdentifier> _components; 10872 NodeList<SimpleIdentifier> _components;
11332 10873
11333 /** 10874 /**
11334 * Initialize a newly created prefixed identifier. 10875 * Initialize a newly created prefixed identifier.
11335 * 10876 *
11336 * @param components the components of the identifier 10877 * @param components the components of the identifier
11337 */ 10878 */
11338 LibraryIdentifier(List<SimpleIdentifier> components) { 10879 LibraryIdentifier(List<SimpleIdentifier> components) {
11339 this._components = new NodeList<SimpleIdentifier>(this); 10880 _components = new NodeList<SimpleIdentifier>(this, components);
11340 this._components.addAll(components);
11341 } 10881 }
11342 10882
11343 @override 10883 @override
11344 accept(AstVisitor visitor) => visitor.visitLibraryIdentifier(this); 10884 accept(AstVisitor visitor) => visitor.visitLibraryIdentifier(this);
11345 10885
11346 @override 10886 @override
11347 Token get beginToken => _components.beginToken; 10887 Token get beginToken => _components.beginToken;
11348 10888
11349 @override 10889 @override
11350 Element get bestElement => staticElement; 10890 Element get bestElement => staticElement;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
11394 * 10934 *
11395 * <pre> 10935 * <pre>
11396 * listLiteral ::= 10936 * listLiteral ::=
11397 * 'const'? ('<' [TypeName] '>')? '[' ([Expression] ','?)? ']' 10937 * 'const'? ('<' [TypeName] '>')? '[' ([Expression] ','?)? ']'
11398 * </pre> 10938 * </pre>
11399 */ 10939 */
11400 class ListLiteral extends TypedLiteral { 10940 class ListLiteral extends TypedLiteral {
11401 /** 10941 /**
11402 * The left square bracket. 10942 * The left square bracket.
11403 */ 10943 */
11404 Token _leftBracket; 10944 Token leftBracket;
11405 10945
11406 /** 10946 /**
11407 * The expressions used to compute the elements of the list. 10947 * The expressions used to compute the elements of the list.
11408 */ 10948 */
11409 NodeList<Expression> _elements; 10949 NodeList<Expression> _elements;
11410 10950
11411 /** 10951 /**
11412 * The right square bracket. 10952 * The right square bracket.
11413 */ 10953 */
11414 Token _rightBracket; 10954 Token rightBracket;
11415 10955
11416 /** 10956 /**
11417 * Initialize a newly created list literal. 10957 * Initialize a newly created list literal.
11418 * 10958 *
11419 * @param constKeyword the token representing the 'const' keyword 10959 * @param constKeyword the token representing the 'const' keyword
11420 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 10960 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
11421 * arguments were declared 10961 * arguments were declared
11422 * @param leftBracket the left square bracket 10962 * @param leftBracket the left square bracket
11423 * @param elements the expressions used to compute the elements of the list 10963 * @param elements the expressions used to compute the elements of the list
11424 * @param rightBracket the right square bracket 10964 * @param rightBracket the right square bracket
11425 */ 10965 */
11426 ListLiteral(Token constKeyword, TypeArgumentList typeArguments, Token leftBrac ket, List<Expression> elements, Token rightBracket) : super(constKeyword, typeAr guments) { 10966 ListLiteral(Token constKeyword, TypeArgumentList typeArguments, this.leftBrack et, List<Expression> elements, this.rightBracket) : super(constKeyword, typeArgu ments) {
11427 this._elements = new NodeList<Expression>(this); 10967 _elements = new NodeList<Expression>(this, elements);
11428 this._leftBracket = leftBracket;
11429 this._elements.addAll(elements);
11430 this._rightBracket = rightBracket;
11431 } 10968 }
11432 10969
11433 @override 10970 @override
11434 accept(AstVisitor visitor) => visitor.visitListLiteral(this); 10971 accept(AstVisitor visitor) => visitor.visitListLiteral(this);
11435 10972
11436 @override 10973 @override
11437 Token get beginToken { 10974 Token get beginToken {
11438 Token token = constKeyword; 10975 if (constKeyword != null) {
11439 if (token != null) { 10976 return constKeyword;
11440 return token;
11441 } 10977 }
11442 TypeArgumentList typeArguments = this.typeArguments; 10978 TypeArgumentList typeArguments = this.typeArguments;
11443 if (typeArguments != null) { 10979 if (typeArguments != null) {
11444 return typeArguments.beginToken; 10980 return typeArguments.beginToken;
11445 } 10981 }
11446 return _leftBracket; 10982 return leftBracket;
11447 } 10983 }
11448 10984
11449 /** 10985 /**
11450 * Return the expressions used to compute the elements of the list. 10986 * Return the expressions used to compute the elements of the list.
11451 * 10987 *
11452 * @return the expressions used to compute the elements of the list 10988 * @return the expressions used to compute the elements of the list
11453 */ 10989 */
11454 NodeList<Expression> get elements => _elements; 10990 NodeList<Expression> get elements => _elements;
11455 10991
11456 @override 10992 @override
11457 Token get endToken => _rightBracket; 10993 Token get endToken => rightBracket;
11458
11459 /**
11460 * Return the left square bracket.
11461 *
11462 * @return the left square bracket
11463 */
11464 Token get leftBracket => _leftBracket;
11465
11466 /**
11467 * Return the right square bracket.
11468 *
11469 * @return the right square bracket
11470 */
11471 Token get rightBracket => _rightBracket;
11472
11473 /**
11474 * Set the left square bracket to the given token.
11475 *
11476 * @param bracket the left square bracket
11477 */
11478 void set leftBracket(Token bracket) {
11479 _leftBracket = bracket;
11480 }
11481
11482 /**
11483 * Set the right square bracket to the given token.
11484 *
11485 * @param bracket the right square bracket
11486 */
11487 void set rightBracket(Token bracket) {
11488 _rightBracket = bracket;
11489 }
11490 10994
11491 @override 10995 @override
11492 void visitChildren(AstVisitor visitor) { 10996 void visitChildren(AstVisitor visitor) {
11493 super.visitChildren(visitor); 10997 super.visitChildren(visitor);
11494 _elements.accept(visitor); 10998 _elements.accept(visitor);
11495 } 10999 }
11496 } 11000 }
11497 11001
11498 /** 11002 /**
11499 * The abstract class `Literal` defines the behavior common to nodes that repres ent a literal 11003 * The abstract class `Literal` defines the behavior common to nodes that repres ent a literal
(...skipping 20 matching lines...) Expand all
11520 * 11024 *
11521 * <pre> 11025 * <pre>
11522 * mapLiteral ::= 11026 * mapLiteral ::=
11523 * 'const'? ('<' [TypeName] (',' [TypeName])* '>')? '{' ([MapLiteralEntry] ( ',' [MapLiteralEntry])* ','?)? '}' 11027 * 'const'? ('<' [TypeName] (',' [TypeName])* '>')? '{' ([MapLiteralEntry] ( ',' [MapLiteralEntry])* ','?)? '}'
11524 * </pre> 11028 * </pre>
11525 */ 11029 */
11526 class MapLiteral extends TypedLiteral { 11030 class MapLiteral extends TypedLiteral {
11527 /** 11031 /**
11528 * The left curly bracket. 11032 * The left curly bracket.
11529 */ 11033 */
11530 Token _leftBracket; 11034 Token leftBracket;
11531 11035
11532 /** 11036 /**
11533 * The entries in the map. 11037 * The entries in the map.
11534 */ 11038 */
11535 NodeList<MapLiteralEntry> _entries; 11039 NodeList<MapLiteralEntry> _entries;
11536 11040
11537 /** 11041 /**
11538 * The right curly bracket. 11042 * The right curly bracket.
11539 */ 11043 */
11540 Token _rightBracket; 11044 Token rightBracket;
11541 11045
11542 /** 11046 /**
11543 * Initialize a newly created map literal. 11047 * Initialize a newly created map literal.
11544 * 11048 *
11545 * @param constKeyword the token representing the 'const' keyword 11049 * @param constKeyword the token representing the 'const' keyword
11546 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 11050 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
11547 * arguments were declared 11051 * arguments were declared
11548 * @param leftBracket the left curly bracket 11052 * @param leftBracket the left curly bracket
11549 * @param entries the entries in the map 11053 * @param entries the entries in the map
11550 * @param rightBracket the right curly bracket 11054 * @param rightBracket the right curly bracket
11551 */ 11055 */
11552 MapLiteral(Token constKeyword, TypeArgumentList typeArguments, Token leftBrack et, List<MapLiteralEntry> entries, Token rightBracket) : super(constKeyword, typ eArguments) { 11056 MapLiteral(Token constKeyword, TypeArgumentList typeArguments, this.leftBracke t, List<MapLiteralEntry> entries, this.rightBracket) : super(constKeyword, typeA rguments) {
11553 this._entries = new NodeList<MapLiteralEntry>(this); 11057 _entries = new NodeList<MapLiteralEntry>(this, entries);
11554 this._leftBracket = leftBracket;
11555 this._entries.addAll(entries);
11556 this._rightBracket = rightBracket;
11557 } 11058 }
11558 11059
11559 @override 11060 @override
11560 accept(AstVisitor visitor) => visitor.visitMapLiteral(this); 11061 accept(AstVisitor visitor) => visitor.visitMapLiteral(this);
11561 11062
11562 @override 11063 @override
11563 Token get beginToken { 11064 Token get beginToken {
11564 Token token = constKeyword; 11065 if (constKeyword != null) {
11565 if (token != null) { 11066 return constKeyword;
11566 return token;
11567 } 11067 }
11568 TypeArgumentList typeArguments = this.typeArguments; 11068 TypeArgumentList typeArguments = this.typeArguments;
11569 if (typeArguments != null) { 11069 if (typeArguments != null) {
11570 return typeArguments.beginToken; 11070 return typeArguments.beginToken;
11571 } 11071 }
11572 return _leftBracket; 11072 return leftBracket;
11573 } 11073 }
11574 11074
11575 @override 11075 @override
11576 Token get endToken => _rightBracket; 11076 Token get endToken => rightBracket;
11577 11077
11578 /** 11078 /**
11579 * Return the entries in the map. 11079 * Return the entries in the map.
11580 * 11080 *
11581 * @return the entries in the map 11081 * @return the entries in the map
11582 */ 11082 */
11583 NodeList<MapLiteralEntry> get entries => _entries; 11083 NodeList<MapLiteralEntry> get entries => _entries;
11584 11084
11585 /**
11586 * Return the left curly bracket.
11587 *
11588 * @return the left curly bracket
11589 */
11590 Token get leftBracket => _leftBracket;
11591
11592 /**
11593 * Return the right curly bracket.
11594 *
11595 * @return the right curly bracket
11596 */
11597 Token get rightBracket => _rightBracket;
11598
11599 /**
11600 * Set the left curly bracket to the given token.
11601 *
11602 * @param bracket the left curly bracket
11603 */
11604 void set leftBracket(Token bracket) {
11605 _leftBracket = bracket;
11606 }
11607
11608 /**
11609 * Set the right curly bracket to the given token.
11610 *
11611 * @param bracket the right curly bracket
11612 */
11613 void set rightBracket(Token bracket) {
11614 _rightBracket = bracket;
11615 }
11616
11617 @override 11085 @override
11618 void visitChildren(AstVisitor visitor) { 11086 void visitChildren(AstVisitor visitor) {
11619 super.visitChildren(visitor); 11087 super.visitChildren(visitor);
11620 _entries.accept(visitor); 11088 _entries.accept(visitor);
11621 } 11089 }
11622 } 11090 }
11623 11091
11624 /** 11092 /**
11625 * Instances of the class `MapLiteralEntry` represent a single key/value pair in a map 11093 * Instances of the class `MapLiteralEntry` represent a single key/value pair in a map
11626 * literal. 11094 * literal.
(...skipping 20 matching lines...) Expand all
11647 Expression _value; 11115 Expression _value;
11648 11116
11649 /** 11117 /**
11650 * Initialize a newly created map literal entry. 11118 * Initialize a newly created map literal entry.
11651 * 11119 *
11652 * @param key the expression computing the key with which the value will be as sociated 11120 * @param key the expression computing the key with which the value will be as sociated
11653 * @param separator the colon that separates the key from the value 11121 * @param separator the colon that separates the key from the value
11654 * @param value the expression computing the value that will be associated wit h the key 11122 * @param value the expression computing the value that will be associated wit h the key
11655 */ 11123 */
11656 MapLiteralEntry(Expression key, this.separator, Expression value) { 11124 MapLiteralEntry(Expression key, this.separator, Expression value) {
11657 this._key = becomeParentOf(key); 11125 _key = becomeParentOf(key);
11658 this._value = becomeParentOf(value); 11126 _value = becomeParentOf(value);
11659 } 11127 }
11660 11128
11661 @override 11129 @override
11662 accept(AstVisitor visitor) => visitor.visitMapLiteralEntry(this); 11130 accept(AstVisitor visitor) => visitor.visitMapLiteralEntry(this);
11663 11131
11664 @override 11132 @override
11665 Token get beginToken => _key.beginToken; 11133 Token get beginToken => _key.beginToken;
11666 11134
11667 @override 11135 @override
11668 Token get endToken => _value.endToken; 11136 Token get endToken => _value.endToken;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
11777 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword 11245 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword
11778 * @param returnType the return type of the method 11246 * @param returnType the return type of the method
11779 * @param propertyKeyword the token representing the 'get' or 'set' keyword 11247 * @param propertyKeyword the token representing the 'get' or 'set' keyword
11780 * @param operatorKeyword the token representing the 'operator' keyword 11248 * @param operatorKeyword the token representing the 'operator' keyword
11781 * @param name the name of the method 11249 * @param name the name of the method
11782 * @param parameters the parameters associated with the method, or `null` if t his method 11250 * @param parameters the parameters associated with the method, or `null` if t his method
11783 * declares a getter 11251 * declares a getter
11784 * @param body the body of the method 11252 * @param body the body of the method
11785 */ 11253 */
11786 MethodDeclaration(Comment comment, List<Annotation> metadata, this.externalKey word, this.modifierKeyword, TypeName returnType, this.propertyKeyword, this.oper atorKeyword, SimpleIdentifier name, FormalParameterList parameters, FunctionBody body) : super(comment, metadata) { 11254 MethodDeclaration(Comment comment, List<Annotation> metadata, this.externalKey word, this.modifierKeyword, TypeName returnType, this.propertyKeyword, this.oper atorKeyword, SimpleIdentifier name, FormalParameterList parameters, FunctionBody body) : super(comment, metadata) {
11787 this._returnType = becomeParentOf(returnType); 11255 _returnType = becomeParentOf(returnType);
11788 this._name = becomeParentOf(name); 11256 _name = becomeParentOf(name);
11789 this._parameters = becomeParentOf(parameters); 11257 _parameters = becomeParentOf(parameters);
11790 this._body = becomeParentOf(body); 11258 _body = becomeParentOf(body);
11791 } 11259 }
11792 11260
11793 @override 11261 @override
11794 accept(AstVisitor visitor) => visitor.visitMethodDeclaration(this); 11262 accept(AstVisitor visitor) => visitor.visitMethodDeclaration(this);
11795 11263
11796 /** 11264 /**
11797 * Return the body of the method. 11265 * Return the body of the method.
11798 * 11266 *
11799 * @return the body of the method 11267 * @return the body of the method
11800 */ 11268 */
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
11888 void set name(SimpleIdentifier identifier) { 11356 void set name(SimpleIdentifier identifier) {
11889 _name = becomeParentOf(identifier); 11357 _name = becomeParentOf(identifier);
11890 } 11358 }
11891 11359
11892 /** 11360 /**
11893 * Set the parameters associated with the method to the given list of paramete rs. 11361 * Set the parameters associated with the method to the given list of paramete rs.
11894 * 11362 *
11895 * @param parameters the parameters associated with the method 11363 * @param parameters the parameters associated with the method
11896 */ 11364 */
11897 void set parameters(FormalParameterList parameters) { 11365 void set parameters(FormalParameterList parameters) {
11898 this._parameters = becomeParentOf(parameters); 11366 _parameters = becomeParentOf(parameters);
11899 } 11367 }
11900 11368
11901 /** 11369 /**
11902 * Set the return type of the method to the given type name. 11370 * Set the return type of the method to the given type name.
11903 * 11371 *
11904 * @param typeName the return type of the method 11372 * @param typeName the return type of the method
11905 */ 11373 */
11906 void set returnType(TypeName typeName) { 11374 void set returnType(TypeName typeName) {
11907 _returnType = becomeParentOf(typeName); 11375 _returnType = becomeParentOf(typeName);
11908 } 11376 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
11968 11436
11969 /** 11437 /**
11970 * Initialize a newly created method invocation. 11438 * Initialize a newly created method invocation.
11971 * 11439 *
11972 * @param target the expression producing the object on which the method is de fined 11440 * @param target the expression producing the object on which the method is de fined
11973 * @param period the period that separates the target from the method name 11441 * @param period the period that separates the target from the method name
11974 * @param methodName the name of the method being invoked 11442 * @param methodName the name of the method being invoked
11975 * @param argumentList the list of arguments to the method 11443 * @param argumentList the list of arguments to the method
11976 */ 11444 */
11977 MethodInvocation(Expression target, this.period, SimpleIdentifier methodName, ArgumentList argumentList) { 11445 MethodInvocation(Expression target, this.period, SimpleIdentifier methodName, ArgumentList argumentList) {
11978 this._target = becomeParentOf(target); 11446 _target = becomeParentOf(target);
11979 this._methodName = becomeParentOf(methodName); 11447 _methodName = becomeParentOf(methodName);
11980 this._argumentList = becomeParentOf(argumentList); 11448 _argumentList = becomeParentOf(argumentList);
11981 } 11449 }
11982 11450
11983 @override 11451 @override
11984 accept(AstVisitor visitor) => visitor.visitMethodInvocation(this); 11452 accept(AstVisitor visitor) => visitor.visitMethodInvocation(this);
11985 11453
11986 /** 11454 /**
11987 * Return the list of arguments to the method. 11455 * Return the list of arguments to the method.
11988 * 11456 *
11989 * @return the list of arguments to the method 11457 * @return the list of arguments to the method
11990 */ 11458 */
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
12054 * @return `true` if this expression is cascaded 11522 * @return `true` if this expression is cascaded
12055 */ 11523 */
12056 bool get isCascaded => period != null && period.type == TokenType.PERIOD_PERIO D; 11524 bool get isCascaded => period != null && period.type == TokenType.PERIOD_PERIO D;
12057 11525
12058 /** 11526 /**
12059 * Set the list of arguments to the method to the given list. 11527 * Set the list of arguments to the method to the given list.
12060 * 11528 *
12061 * @param argumentList the list of arguments to the method 11529 * @param argumentList the list of arguments to the method
12062 */ 11530 */
12063 void set argumentList(ArgumentList argumentList) { 11531 void set argumentList(ArgumentList argumentList) {
12064 this._argumentList = becomeParentOf(argumentList); 11532 _argumentList = becomeParentOf(argumentList);
12065 } 11533 }
12066 11534
12067 /** 11535 /**
12068 * Set the name of the method being invoked to the given identifier. 11536 * Set the name of the method being invoked to the given identifier.
12069 * 11537 *
12070 * @param identifier the name of the method being invoked 11538 * @param identifier the name of the method being invoked
12071 */ 11539 */
12072 void set methodName(SimpleIdentifier identifier) { 11540 void set methodName(SimpleIdentifier identifier) {
12073 _methodName = becomeParentOf(identifier); 11541 _methodName = becomeParentOf(identifier);
12074 } 11542 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
12110 */ 11578 */
12111 Expression _expression; 11579 Expression _expression;
12112 11580
12113 /** 11581 /**
12114 * Initialize a newly created named expression. 11582 * Initialize a newly created named expression.
12115 * 11583 *
12116 * @param name the name associated with the expression 11584 * @param name the name associated with the expression
12117 * @param expression the expression with which the name is associated 11585 * @param expression the expression with which the name is associated
12118 */ 11586 */
12119 NamedExpression(Label name, Expression expression) { 11587 NamedExpression(Label name, Expression expression) {
12120 this._name = becomeParentOf(name); 11588 _name = becomeParentOf(name);
12121 this._expression = becomeParentOf(expression); 11589 _expression = becomeParentOf(expression);
12122 } 11590 }
12123 11591
12124 @override 11592 @override
12125 accept(AstVisitor visitor) => visitor.visitNamedExpression(this); 11593 accept(AstVisitor visitor) => visitor.visitNamedExpression(this);
12126 11594
12127 @override 11595 @override
12128 Token get beginToken => _name.beginToken; 11596 Token get beginToken => _name.beginToken;
12129 11597
12130 /** 11598 /**
12131 * Return the element representing the parameter being named by this expressio n, or `null` 11599 * Return the element representing the parameter being named by this expressio n, or `null`
(...skipping 29 matching lines...) Expand all
12161 11629
12162 @override 11630 @override
12163 int get precedence => 0; 11631 int get precedence => 0;
12164 11632
12165 /** 11633 /**
12166 * Set the expression with which the name is associated to the given expressio n. 11634 * Set the expression with which the name is associated to the given expressio n.
12167 * 11635 *
12168 * @param expression the expression with which the name is associated 11636 * @param expression the expression with which the name is associated
12169 */ 11637 */
12170 void set expression(Expression expression) { 11638 void set expression(Expression expression) {
12171 this._expression = becomeParentOf(expression); 11639 _expression = becomeParentOf(expression);
12172 } 11640 }
12173 11641
12174 /** 11642 /**
12175 * Set the name associated with the expression to the given identifier. 11643 * Set the name associated with the expression to the given identifier.
12176 * 11644 *
12177 * @param identifier the name associated with the expression 11645 * @param identifier the name associated with the expression
12178 */ 11646 */
12179 void set name(Label identifier) { 11647 void set name(Label identifier) {
12180 _name = becomeParentOf(identifier); 11648 _name = becomeParentOf(identifier);
12181 } 11649 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
12217 * Initialize a newly created namespace directive. 11685 * Initialize a newly created namespace directive.
12218 * 11686 *
12219 * @param comment the documentation comment associated with this directive 11687 * @param comment the documentation comment associated with this directive
12220 * @param metadata the annotations associated with the directive 11688 * @param metadata the annotations associated with the directive
12221 * @param keyword the token representing the 'import' or 'export' keyword 11689 * @param keyword the token representing the 'import' or 'export' keyword
12222 * @param libraryUri the URI of the library being imported or exported 11690 * @param libraryUri the URI of the library being imported or exported
12223 * @param combinators the combinators used to control which names are imported or exported 11691 * @param combinators the combinators used to control which names are imported or exported
12224 * @param semicolon the semicolon terminating the directive 11692 * @param semicolon the semicolon terminating the directive
12225 */ 11693 */
12226 NamespaceDirective(Comment comment, List<Annotation> metadata, this.keyword, S tringLiteral libraryUri, List<Combinator> combinators, this.semicolon) : super(c omment, metadata, libraryUri) { 11694 NamespaceDirective(Comment comment, List<Annotation> metadata, this.keyword, S tringLiteral libraryUri, List<Combinator> combinators, this.semicolon) : super(c omment, metadata, libraryUri) {
12227 this._combinators = new NodeList<Combinator>(this); 11695 _combinators = new NodeList<Combinator>(this, combinators);
12228 this._combinators.addAll(combinators);
12229 } 11696 }
12230 11697
12231 /** 11698 /**
12232 * Return the combinators used to control how names are imported or exported. 11699 * Return the combinators used to control how names are imported or exported.
12233 * 11700 *
12234 * @return the combinators used to control how names are imported or exported 11701 * @return the combinators used to control how names are imported or exported
12235 */ 11702 */
12236 NodeList<Combinator> get combinators => _combinators; 11703 NodeList<Combinator> get combinators => _combinators;
12237 11704
12238 @override 11705 @override
(...skipping 26 matching lines...) Expand all
12265 */ 11732 */
12266 StringLiteral _name; 11733 StringLiteral _name;
12267 11734
12268 /** 11735 /**
12269 * Initialize a newly created native clause. 11736 * Initialize a newly created native clause.
12270 * 11737 *
12271 * @param keyword the token representing the 'native' keyword 11738 * @param keyword the token representing the 'native' keyword
12272 * @param name the name of the native object that implements the class. 11739 * @param name the name of the native object that implements the class.
12273 */ 11740 */
12274 NativeClause(this.keyword, StringLiteral name) { 11741 NativeClause(this.keyword, StringLiteral name) {
12275 this._name = becomeParentOf(name); 11742 _name = becomeParentOf(name);
12276 } 11743 }
12277 11744
12278 @override 11745 @override
12279 accept(AstVisitor visitor) => visitor.visitNativeClause(this); 11746 accept(AstVisitor visitor) => visitor.visitNativeClause(this);
12280 11747
12281 @override 11748 @override
12282 Token get beginToken => keyword; 11749 Token get beginToken => keyword;
12283 11750
12284 @override 11751 @override
12285 Token get endToken => _name.endToken; 11752 Token get endToken => _name.endToken;
12286 11753
12287 /** 11754 /**
12288 * Return the name of the native object that implements the class. 11755 * Return the name of the native object that implements the class.
12289 * 11756 *
12290 * @return the name of the native object that implements the class 11757 * @return the name of the native object that implements the class
12291 */ 11758 */
12292 StringLiteral get name => _name; 11759 StringLiteral get name => _name;
12293 11760
12294 /** 11761 /**
12295 * Sets the name of the native object that implements the class. 11762 * Sets the name of the native object that implements the class.
12296 * 11763 *
12297 * @param name the name of the native object that implements the class. 11764 * @param name the name of the native object that implements the class.
12298 */ 11765 */
12299 void set name(StringLiteral name) { 11766 void set name(StringLiteral name) {
12300 this._name = becomeParentOf(name); 11767 _name = becomeParentOf(name);
12301 } 11768 }
12302 11769
12303 @override 11770 @override
12304 void visitChildren(AstVisitor visitor) { 11771 void visitChildren(AstVisitor visitor) {
12305 safelyVisitChild(_name, visitor); 11772 safelyVisitChild(_name, visitor);
12306 } 11773 }
12307 } 11774 }
12308 11775
12309 /** 11776 /**
12310 * Instances of the class `NativeFunctionBody` represent a function body that co nsists of a 11777 * Instances of the class `NativeFunctionBody` represent a function body that co nsists of a
12311 * native keyword followed by a string literal. 11778 * native keyword followed by a string literal.
12312 * 11779 *
12313 * <pre> 11780 * <pre>
12314 * nativeFunctionBody ::= 11781 * nativeFunctionBody ::=
12315 * 'native' [SimpleStringLiteral] ';' 11782 * 'native' [SimpleStringLiteral] ';'
12316 * </pre> 11783 * </pre>
12317 */ 11784 */
12318 class NativeFunctionBody extends FunctionBody { 11785 class NativeFunctionBody extends FunctionBody {
12319 /** 11786 /**
12320 * The token representing 'native' that marks the start of the function body. 11787 * The token representing 'native' that marks the start of the function body.
12321 */ 11788 */
12322 final Token nativeToken; 11789 Token nativeToken;
12323 11790
12324 /** 11791 /**
12325 * The string literal, after the 'native' token. 11792 * The string literal, after the 'native' token.
12326 */ 11793 */
12327 StringLiteral _stringLiteral; 11794 StringLiteral _stringLiteral;
12328 11795
12329 /** 11796 /**
12330 * The token representing the semicolon that marks the end of the function bod y. 11797 * The token representing the semicolon that marks the end of the function bod y.
12331 */ 11798 */
12332 final Token semicolon; 11799 Token semicolon;
12333 11800
12334 /** 11801 /**
12335 * Initialize a newly created function body consisting of the 'native' token, a string literal, 11802 * Initialize a newly created function body consisting of the 'native' token, a string literal,
12336 * and a semicolon. 11803 * and a semicolon.
12337 * 11804 *
12338 * @param nativeToken the token representing 'native' that marks the start of the function body 11805 * @param nativeToken the token representing 'native' that marks the start of the function body
12339 * @param stringLiteral the string literal 11806 * @param stringLiteral the string literal
12340 * @param semicolon the token representing the semicolon that marks the end of the function body 11807 * @param semicolon the token representing the semicolon that marks the end of the function body
12341 */ 11808 */
12342 NativeFunctionBody(this.nativeToken, StringLiteral stringLiteral, this.semicol on) { 11809 NativeFunctionBody(this.nativeToken, StringLiteral stringLiteral, this.semicol on) {
12343 this._stringLiteral = becomeParentOf(stringLiteral); 11810 _stringLiteral = becomeParentOf(stringLiteral);
12344 } 11811 }
12345 11812
12346 @override 11813 @override
12347 accept(AstVisitor visitor) => visitor.visitNativeFunctionBody(this); 11814 accept(AstVisitor visitor) => visitor.visitNativeFunctionBody(this);
12348 11815
12349 @override 11816 @override
12350 Token get beginToken => nativeToken; 11817 Token get beginToken => nativeToken;
12351 11818
12352 @override 11819 @override
12353 Token get endToken => semicolon; 11820 Token get endToken => semicolon;
12354 11821
12355 /** 11822 /**
12356 * Return the string literal representing the string after the 'native' token. 11823 * Return the string literal representing the string after the 'native' token.
12357 * 11824 *
12358 * @return the string literal representing the string after the 'native' token 11825 * @return the string literal representing the string after the 'native' token
12359 */ 11826 */
12360 StringLiteral get stringLiteral => _stringLiteral; 11827 StringLiteral get stringLiteral => _stringLiteral;
12361 11828
12362 /** 11829 /**
12363 * Set the string literal representing the string after the 'native' token to the given string. 11830 * Set the string literal representing the string after the 'native' token to the given string.
12364 * 11831 *
12365 * @param stringLiteral the string literal representing the string after the ' native' token 11832 * @param stringLiteral the string literal representing the string after the ' native' token
12366 */ 11833 */
12367 void set stringLiteral(StringLiteral stringLiteral) { 11834 void set stringLiteral(StringLiteral stringLiteral) {
12368 this._stringLiteral = becomeParentOf(stringLiteral); 11835 _stringLiteral = becomeParentOf(stringLiteral);
12369 } 11836 }
12370 11837
12371 @override 11838 @override
12372 void visitChildren(AstVisitor visitor) { 11839 void visitChildren(AstVisitor visitor) {
12373 safelyVisitChild(_stringLiteral, visitor); 11840 safelyVisitChild(_stringLiteral, visitor);
12374 } 11841 }
12375 } 11842 }
12376 11843
12377 /** 11844 /**
12378 * Instances of the class `NodeLocator` locate the [AstNode] associated with a 11845 * Instances of the class `NodeLocator` locate the [AstNode] associated with a
(...skipping 27 matching lines...) Expand all
12406 NodeLocator.con1(int offset) : this.con2(offset, offset); 11873 NodeLocator.con1(int offset) : this.con2(offset, offset);
12407 11874
12408 /** 11875 /**
12409 * Initialize a newly created locator to locate one or more [AstNode] by locat ing 11876 * Initialize a newly created locator to locate one or more [AstNode] by locat ing
12410 * the node within an AST structure that corresponds to the given range of cha racters in the 11877 * the node within an AST structure that corresponds to the given range of cha racters in the
12411 * source. 11878 * source.
12412 * 11879 *
12413 * @param start the start offset of the range used to identify the node 11880 * @param start the start offset of the range used to identify the node
12414 * @param end the end offset of the range used to identify the node 11881 * @param end the end offset of the range used to identify the node
12415 */ 11882 */
12416 NodeLocator.con2(int start, int end) { 11883 NodeLocator.con2(this._startOffset, this._endOffset);
12417 this._startOffset = start;
12418 this._endOffset = end;
12419 }
12420 11884
12421 /** 11885 /**
12422 * Return the node that was found that corresponds to the given source range, or `null` if 11886 * Return the node that was found that corresponds to the given source range, or `null` if
12423 * there is no such node. 11887 * there is no such node.
12424 * 11888 *
12425 * @return the node that was found 11889 * @return the node that was found
12426 */ 11890 */
12427 AstNode get foundNode => _foundNode; 11891 AstNode get foundNode => _foundNode;
12428 11892
12429 /** 11893 /**
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
12476 } 11940 }
12477 return null; 11941 return null;
12478 } 11942 }
12479 } 11943 }
12480 11944
12481 /** 11945 /**
12482 * Instances of the class `NodeFoundException` are used to cancel visiting after a node has 11946 * Instances of the class `NodeFoundException` are used to cancel visiting after a node has
12483 * been found. 11947 * been found.
12484 */ 11948 */
12485 class NodeLocator_NodeFoundException extends RuntimeException { 11949 class NodeLocator_NodeFoundException extends RuntimeException {
12486 static int _serialVersionUID = 1;
12487 } 11950 }
12488 11951
12489 /** 11952 /**
12490 * Instances of the class `NodeReplacer` implement an object that will replace o ne child node 11953 * Instances of the class `NodeReplacer` implement an object that will replace o ne child node
12491 * in an AST node with another node. 11954 * in an AST node with another node.
12492 */ 11955 */
12493 class NodeReplacer implements AstVisitor<bool> { 11956 class NodeReplacer implements AstVisitor<bool> {
12494 /** 11957 /**
12495 * Replace the old node with the new node in the AST structure containing the old node. 11958 * Replace the old node with the new node in the AST structure containing the old node.
12496 * 11959 *
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
13666 SimpleIdentifier _identifier; 13129 SimpleIdentifier _identifier;
13667 13130
13668 /** 13131 /**
13669 * Initialize a newly created formal parameter. 13132 * Initialize a newly created formal parameter.
13670 * 13133 *
13671 * @param comment the documentation comment associated with this parameter 13134 * @param comment the documentation comment associated with this parameter
13672 * @param metadata the annotations associated with this parameter 13135 * @param metadata the annotations associated with this parameter
13673 * @param identifier the name of the parameter being declared 13136 * @param identifier the name of the parameter being declared
13674 */ 13137 */
13675 NormalFormalParameter(Comment comment, List<Annotation> metadata, SimpleIdenti fier identifier) { 13138 NormalFormalParameter(Comment comment, List<Annotation> metadata, SimpleIdenti fier identifier) {
13676 this._metadata = new NodeList<Annotation>(this); 13139 _comment = becomeParentOf(comment);
13677 this._comment = becomeParentOf(comment); 13140 _metadata = new NodeList<Annotation>(this, metadata);
13678 this._metadata.addAll(metadata); 13141 _identifier = becomeParentOf(identifier);
13679 this._identifier = becomeParentOf(identifier);
13680 } 13142 }
13681 13143
13682 /** 13144 /**
13683 * Return the documentation comment associated with this parameter, or `null` if this 13145 * Return the documentation comment associated with this parameter, or `null` if this
13684 * parameter does not have a documentation comment associated with it. 13146 * parameter does not have a documentation comment associated with it.
13685 * 13147 *
13686 * @return the documentation comment associated with this parameter 13148 * @return the documentation comment associated with this parameter
13687 */ 13149 */
13688 Comment get documentationComment => _comment; 13150 Comment get documentationComment => _comment;
13689 13151
(...skipping 15 matching lines...) Expand all
13705 * @return the annotations associated with this parameter 13167 * @return the annotations associated with this parameter
13706 */ 13168 */
13707 NodeList<Annotation> get metadata => _metadata; 13169 NodeList<Annotation> get metadata => _metadata;
13708 13170
13709 /** 13171 /**
13710 * Set the documentation comment associated with this parameter to the given c omment 13172 * Set the documentation comment associated with this parameter to the given c omment
13711 * 13173 *
13712 * @param comment the documentation comment to be associated with this paramet er 13174 * @param comment the documentation comment to be associated with this paramet er
13713 */ 13175 */
13714 void set documentationComment(Comment comment) { 13176 void set documentationComment(Comment comment) {
13715 this._comment = becomeParentOf(comment); 13177 _comment = becomeParentOf(comment);
13716 } 13178 }
13717 13179
13718 /** 13180 /**
13719 * Set the name of the parameter being declared to the given identifier. 13181 * Set the name of the parameter being declared to the given identifier.
13720 * 13182 *
13721 * @param identifier the name of the parameter being declared 13183 * @param identifier the name of the parameter being declared
13722 */ 13184 */
13723 void set identifier(SimpleIdentifier identifier) { 13185 void set identifier(SimpleIdentifier identifier) {
13724 this._identifier = becomeParentOf(identifier); 13186 _identifier = becomeParentOf(identifier);
13725 } 13187 }
13726 13188
13727 /** 13189 /**
13728 * Set the metadata associated with this node to the given metadata. 13190 * Set the metadata associated with this node to the given metadata.
13729 * 13191 *
13730 * @param metadata the metadata to be associated with this node 13192 * @param metadata the metadata to be associated with this node
13731 */ 13193 */
13732 void set metadata(List<Annotation> metadata) { 13194 void set metadata(List<Annotation> metadata) {
13733 this._metadata.clear(); 13195 _metadata.clear();
13734 this._metadata.addAll(metadata); 13196 _metadata.addAll(metadata);
13735 } 13197 }
13736 13198
13737 @override 13199 @override
13738 void visitChildren(AstVisitor visitor) { 13200 void visitChildren(AstVisitor visitor) {
13739 // 13201 //
13740 // Note that subclasses are responsible for visiting the identifier because they often need to 13202 // Note that subclasses are responsible for visiting the identifier because they often need to
13741 // visit other nodes before visiting the identifier. 13203 // visit other nodes before visiting the identifier.
13742 // 13204 //
13743 if (_commentIsBeforeAnnotations()) { 13205 if (_commentIsBeforeAnnotations()) {
13744 safelyVisitChild(_comment, visitor); 13206 safelyVisitChild(_comment, visitor);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
13790 /** 13252 /**
13791 * The token representing the literal. 13253 * The token representing the literal.
13792 */ 13254 */
13793 Token literal; 13255 Token literal;
13794 13256
13795 /** 13257 /**
13796 * Initialize a newly created null literal. 13258 * Initialize a newly created null literal.
13797 * 13259 *
13798 * @param token the token representing the literal 13260 * @param token the token representing the literal
13799 */ 13261 */
13800 NullLiteral(Token token) { 13262 NullLiteral(this.literal);
13801 this.literal = token;
13802 }
13803 13263
13804 @override 13264 @override
13805 accept(AstVisitor visitor) => visitor.visitNullLiteral(this); 13265 accept(AstVisitor visitor) => visitor.visitNullLiteral(this);
13806 13266
13807 @override 13267 @override
13808 Token get beginToken => literal; 13268 Token get beginToken => literal;
13809 13269
13810 @override 13270 @override
13811 Token get endToken => literal; 13271 Token get endToken => literal;
13812 13272
13813 @override 13273 @override
13814 void visitChildren(AstVisitor visitor) { 13274 void visitChildren(AstVisitor visitor) {
13815 // There are no children to visit. 13275 // There are no children to visit.
13816 } 13276 }
13817 } 13277 }
13818 13278
13819 /** 13279 /**
13820 * Instances of the class `ParenthesizedExpression` represent a parenthesized ex pression. 13280 * Instances of the class `ParenthesizedExpression` represent a parenthesized ex pression.
13821 * 13281 *
13822 * <pre> 13282 * <pre>
13823 * parenthesizedExpression ::= 13283 * parenthesizedExpression ::=
13824 * '(' [Expression] ')' 13284 * '(' [Expression] ')'
13825 * </pre> 13285 * </pre>
13826 */ 13286 */
13827 class ParenthesizedExpression extends Expression { 13287 class ParenthesizedExpression extends Expression {
13828 /** 13288 /**
13829 * The left parenthesis. 13289 * The left parenthesis.
13830 */ 13290 */
13831 Token _leftParenthesis; 13291 Token leftParenthesis;
13832 13292
13833 /** 13293 /**
13834 * The expression within the parentheses. 13294 * The expression within the parentheses.
13835 */ 13295 */
13836 Expression _expression; 13296 Expression _expression;
13837 13297
13838 /** 13298 /**
13839 * The right parenthesis. 13299 * The right parenthesis.
13840 */ 13300 */
13841 Token _rightParenthesis; 13301 Token rightParenthesis;
13842 13302
13843 /** 13303 /**
13844 * Initialize a newly created parenthesized expression. 13304 * Initialize a newly created parenthesized expression.
13845 * 13305 *
13846 * @param leftParenthesis the left parenthesis 13306 * @param leftParenthesis the left parenthesis
13847 * @param expression the expression within the parentheses 13307 * @param expression the expression within the parentheses
13848 * @param rightParenthesis the right parenthesis 13308 * @param rightParenthesis the right parenthesis
13849 */ 13309 */
13850 ParenthesizedExpression(Token leftParenthesis, Expression expression, Token ri ghtParenthesis) { 13310 ParenthesizedExpression(this.leftParenthesis, Expression expression, this.righ tParenthesis) {
13851 this._leftParenthesis = leftParenthesis; 13311 _expression = becomeParentOf(expression);
13852 this._expression = becomeParentOf(expression);
13853 this._rightParenthesis = rightParenthesis;
13854 } 13312 }
13855 13313
13856 @override 13314 @override
13857 accept(AstVisitor visitor) => visitor.visitParenthesizedExpression(this); 13315 accept(AstVisitor visitor) => visitor.visitParenthesizedExpression(this);
13858 13316
13859 @override 13317 @override
13860 Token get beginToken => _leftParenthesis; 13318 Token get beginToken => leftParenthesis;
13861 13319
13862 @override 13320 @override
13863 Token get endToken => _rightParenthesis; 13321 Token get endToken => rightParenthesis;
13864 13322
13865 /** 13323 /**
13866 * Return the expression within the parentheses. 13324 * Return the expression within the parentheses.
13867 * 13325 *
13868 * @return the expression within the parentheses 13326 * @return the expression within the parentheses
13869 */ 13327 */
13870 Expression get expression => _expression; 13328 Expression get expression => _expression;
13871 13329
13872 /**
13873 * Return the left parenthesis.
13874 *
13875 * @return the left parenthesis
13876 */
13877 Token get leftParenthesis => _leftParenthesis;
13878
13879 @override 13330 @override
13880 int get precedence => 15; 13331 int get precedence => 15;
13881 13332
13882 /** 13333 /**
13883 * Return the right parenthesis.
13884 *
13885 * @return the right parenthesis
13886 */
13887 Token get rightParenthesis => _rightParenthesis;
13888
13889 /**
13890 * Set the expression within the parentheses to the given expression. 13334 * Set the expression within the parentheses to the given expression.
13891 * 13335 *
13892 * @param expression the expression within the parentheses 13336 * @param expression the expression within the parentheses
13893 */ 13337 */
13894 void set expression(Expression expression) { 13338 void set expression(Expression expression) {
13895 this._expression = becomeParentOf(expression); 13339 _expression = becomeParentOf(expression);
13896 }
13897
13898 /**
13899 * Set the left parenthesis to the given token.
13900 *
13901 * @param parenthesis the left parenthesis
13902 */
13903 void set leftParenthesis(Token parenthesis) {
13904 _leftParenthesis = parenthesis;
13905 }
13906
13907 /**
13908 * Set the right parenthesis to the given token.
13909 *
13910 * @param parenthesis the right parenthesis
13911 */
13912 void set rightParenthesis(Token parenthesis) {
13913 _rightParenthesis = parenthesis;
13914 } 13340 }
13915 13341
13916 @override 13342 @override
13917 void visitChildren(AstVisitor visitor) { 13343 void visitChildren(AstVisitor visitor) {
13918 safelyVisitChild(_expression, visitor); 13344 safelyVisitChild(_expression, visitor);
13919 } 13345 }
13920 } 13346 }
13921 13347
13922 /** 13348 /**
13923 * Instances of the class `PartDirective` represent a part directive. 13349 * Instances of the class `PartDirective` represent a part directive.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
13998 * Initialize a newly created part-of directive. 13424 * Initialize a newly created part-of directive.
13999 * 13425 *
14000 * @param comment the documentation comment associated with this directive 13426 * @param comment the documentation comment associated with this directive
14001 * @param metadata the annotations associated with the directive 13427 * @param metadata the annotations associated with the directive
14002 * @param partToken the token representing the 'part' token 13428 * @param partToken the token representing the 'part' token
14003 * @param ofToken the token representing the 'of' token 13429 * @param ofToken the token representing the 'of' token
14004 * @param libraryName the name of the library that the containing compilation unit is part of 13430 * @param libraryName the name of the library that the containing compilation unit is part of
14005 * @param semicolon the semicolon terminating the directive 13431 * @param semicolon the semicolon terminating the directive
14006 */ 13432 */
14007 PartOfDirective(Comment comment, List<Annotation> metadata, this.partToken, th is.ofToken, LibraryIdentifier libraryName, this.semicolon) : super(comment, meta data) { 13433 PartOfDirective(Comment comment, List<Annotation> metadata, this.partToken, th is.ofToken, LibraryIdentifier libraryName, this.semicolon) : super(comment, meta data) {
14008 this._libraryName = becomeParentOf(libraryName); 13434 _libraryName = becomeParentOf(libraryName);
14009 } 13435 }
14010 13436
14011 @override 13437 @override
14012 accept(AstVisitor visitor) => visitor.visitPartOfDirective(this); 13438 accept(AstVisitor visitor) => visitor.visitPartOfDirective(this);
14013 13439
14014 @override 13440 @override
14015 Token get endToken => semicolon; 13441 Token get endToken => semicolon;
14016 13442
14017 @override 13443 @override
14018 Token get keyword => partToken; 13444 Token get keyword => partToken;
14019 13445
14020 /** 13446 /**
14021 * Return the name of the library that the containing compilation unit is part of. 13447 * Return the name of the library that the containing compilation unit is part of.
14022 * 13448 *
14023 * @return the name of the library that the containing compilation unit is par t of 13449 * @return the name of the library that the containing compilation unit is par t of
14024 */ 13450 */
14025 LibraryIdentifier get libraryName => _libraryName; 13451 LibraryIdentifier get libraryName => _libraryName;
14026 13452
14027 /** 13453 /**
14028 * Set the name of the library that the containing compilation unit is part of to the given name. 13454 * Set the name of the library that the containing compilation unit is part of to the given name.
14029 * 13455 *
14030 * @param libraryName the name of the library that the containing compilation unit is part of 13456 * @param libraryName the name of the library that the containing compilation unit is part of
14031 */ 13457 */
14032 void set libraryName(LibraryIdentifier libraryName) { 13458 void set libraryName(LibraryIdentifier libraryName) {
14033 this._libraryName = becomeParentOf(libraryName); 13459 _libraryName = becomeParentOf(libraryName);
14034 } 13460 }
14035 13461
14036 @override 13462 @override
14037 void visitChildren(AstVisitor visitor) { 13463 void visitChildren(AstVisitor visitor) {
14038 super.visitChildren(visitor); 13464 super.visitChildren(visitor);
14039 safelyVisitChild(_libraryName, visitor); 13465 safelyVisitChild(_libraryName, visitor);
14040 } 13466 }
14041 13467
14042 @override 13468 @override
14043 Token get firstTokenAfterCommentAndMetadata => partToken; 13469 Token get firstTokenAfterCommentAndMetadata => partToken;
(...skipping 16 matching lines...) Expand all
14060 /** 13486 /**
14061 * The postfix operator being applied to the operand. 13487 * The postfix operator being applied to the operand.
14062 */ 13488 */
14063 Token operator; 13489 Token operator;
14064 13490
14065 /** 13491 /**
14066 * The element associated with this the operator based on the propagated type of the operand, or 13492 * The element associated with this the operator based on the propagated type of the operand, or
14067 * `null` if the AST structure has not been resolved, if the operator is not u ser definable, 13493 * `null` if the AST structure has not been resolved, if the operator is not u ser definable,
14068 * or if the operator could not be resolved. 13494 * or if the operator could not be resolved.
14069 */ 13495 */
14070 MethodElement _propagatedElement; 13496 MethodElement propagatedElement;
14071 13497
14072 /** 13498 /**
14073 * The element associated with the operator based on the static type of the op erand, or 13499 * The element associated with the operator based on the static type of the op erand, or
14074 * `null` if the AST structure has not been resolved, if the operator is not u ser definable, 13500 * `null` if the AST structure has not been resolved, if the operator is not u ser definable,
14075 * or if the operator could not be resolved. 13501 * or if the operator could not be resolved.
14076 */ 13502 */
14077 MethodElement _staticElement; 13503 MethodElement staticElement;
14078 13504
14079 /** 13505 /**
14080 * Initialize a newly created postfix expression. 13506 * Initialize a newly created postfix expression.
14081 * 13507 *
14082 * @param operand the expression computing the operand for the operator 13508 * @param operand the expression computing the operand for the operator
14083 * @param operator the postfix operator being applied to the operand 13509 * @param operator the postfix operator being applied to the operand
14084 */ 13510 */
14085 PostfixExpression(Expression operand, this.operator) { 13511 PostfixExpression(Expression operand, this.operator) {
14086 this._operand = becomeParentOf(operand); 13512 _operand = becomeParentOf(operand);
14087 } 13513 }
14088 13514
14089 @override 13515 @override
14090 accept(AstVisitor visitor) => visitor.visitPostfixExpression(this); 13516 accept(AstVisitor visitor) => visitor.visitPostfixExpression(this);
14091 13517
14092 @override 13518 @override
14093 Token get beginToken => _operand.beginToken; 13519 Token get beginToken => _operand.beginToken;
14094 13520
14095 /** 13521 /**
14096 * Return the best element available for this operator. If resolution was able to find a better 13522 * Return the best element available for this operator. If resolution was able to find a better
(...skipping 18 matching lines...) Expand all
14115 * Return the expression computing the operand for the operator. 13541 * Return the expression computing the operand for the operator.
14116 * 13542 *
14117 * @return the expression computing the operand for the operator 13543 * @return the expression computing the operand for the operator
14118 */ 13544 */
14119 Expression get operand => _operand; 13545 Expression get operand => _operand;
14120 13546
14121 @override 13547 @override
14122 int get precedence => 15; 13548 int get precedence => 15;
14123 13549
14124 /** 13550 /**
14125 * Return the element associated with the operator based on the propagated typ e of the operand, or
14126 * `null` if the AST structure has not been resolved, if the operator is not u ser definable,
14127 * or if the operator could not be resolved. One example of the latter case is an operator that is
14128 * not defined for the type of the operand.
14129 *
14130 * @return the element associated with the operator
14131 */
14132 MethodElement get propagatedElement => _propagatedElement;
14133
14134 /**
14135 * Return the element associated with the operator based on the static type of the operand, or
14136 * `null` if the AST structure has not been resolved, if the operator is not u ser definable,
14137 * or if the operator could not be resolved. One example of the latter case is an operator that is
14138 * not defined for the type of the operand.
14139 *
14140 * @return the element associated with the operator
14141 */
14142 MethodElement get staticElement => _staticElement;
14143
14144 /**
14145 * Set the expression computing the operand for the operator to the given expr ession. 13551 * Set the expression computing the operand for the operator to the given expr ession.
14146 * 13552 *
14147 * @param expression the expression computing the operand for the operator 13553 * @param expression the expression computing the operand for the operator
14148 */ 13554 */
14149 void set operand(Expression expression) { 13555 void set operand(Expression expression) {
14150 _operand = becomeParentOf(expression); 13556 _operand = becomeParentOf(expression);
14151 } 13557 }
14152 13558
14153 /**
14154 * Set the element associated with the operator based on the propagated type o f the operand to the
14155 * given element.
14156 *
14157 * @param element the element to be associated with the operator
14158 */
14159 void set propagatedElement(MethodElement element) {
14160 _propagatedElement = element;
14161 }
14162
14163 /**
14164 * Set the element associated with the operator based on the static type of th e operand to the
14165 * given element.
14166 *
14167 * @param element the element to be associated with the operator
14168 */
14169 void set staticElement(MethodElement element) {
14170 _staticElement = element;
14171 }
14172
14173 @override 13559 @override
14174 void visitChildren(AstVisitor visitor) { 13560 void visitChildren(AstVisitor visitor) {
14175 safelyVisitChild(_operand, visitor); 13561 safelyVisitChild(_operand, visitor);
14176 } 13562 }
14177 13563
14178 /** 13564 /**
14179 * If the AST structure has been resolved, and the function being invoked is k nown based on 13565 * If the AST structure has been resolved, and the function being invoked is k nown based on
14180 * propagated type information, then return the parameter element representing the parameter to 13566 * propagated type information, then return the parameter element representing the parameter to
14181 * which the value of the operand will be bound. Otherwise, return `null`. 13567 * which the value of the operand will be bound. Otherwise, return `null`.
14182 * 13568 *
14183 * This method is only intended to be used by [Expression.propagatedParameterE lement]. 13569 * This method is only intended to be used by [Expression.propagatedParameterE lement].
14184 * 13570 *
14185 * @return the parameter element representing the parameter to which the value of the right 13571 * @return the parameter element representing the parameter to which the value of the right
14186 * operand will be bound 13572 * operand will be bound
14187 */ 13573 */
14188 ParameterElement get propagatedParameterElementForOperand { 13574 ParameterElement get propagatedParameterElementForOperand {
14189 if (_propagatedElement == null) { 13575 if (propagatedElement == null) {
14190 return null; 13576 return null;
14191 } 13577 }
14192 List<ParameterElement> parameters = _propagatedElement.parameters; 13578 List<ParameterElement> parameters = propagatedElement.parameters;
14193 if (parameters.length < 1) { 13579 if (parameters.length < 1) {
14194 return null; 13580 return null;
14195 } 13581 }
14196 return parameters[0]; 13582 return parameters[0];
14197 } 13583 }
14198 13584
14199 /** 13585 /**
14200 * If the AST structure has been resolved, and the function being invoked is k nown based on static 13586 * If the AST structure has been resolved, and the function being invoked is k nown based on static
14201 * type information, then return the parameter element representing the parame ter to which the 13587 * type information, then return the parameter element representing the parame ter to which the
14202 * value of the operand will be bound. Otherwise, return `null`. 13588 * value of the operand will be bound. Otherwise, return `null`.
14203 * 13589 *
14204 * This method is only intended to be used by [Expression.staticParameterEleme nt]. 13590 * This method is only intended to be used by [Expression.staticParameterEleme nt].
14205 * 13591 *
14206 * @return the parameter element representing the parameter to which the value of the right 13592 * @return the parameter element representing the parameter to which the value of the right
14207 * operand will be bound 13593 * operand will be bound
14208 */ 13594 */
14209 ParameterElement get staticParameterElementForOperand { 13595 ParameterElement get staticParameterElementForOperand {
14210 if (_staticElement == null) { 13596 if (staticElement == null) {
14211 return null; 13597 return null;
14212 } 13598 }
14213 List<ParameterElement> parameters = _staticElement.parameters; 13599 List<ParameterElement> parameters = staticElement.parameters;
14214 if (parameters.length < 1) { 13600 if (parameters.length < 1) {
14215 return null; 13601 return null;
14216 } 13602 }
14217 return parameters[0]; 13603 return parameters[0];
14218 } 13604 }
14219 } 13605 }
14220 13606
14221 /** 13607 /**
14222 * Instances of the class `PrefixExpression` represent a prefix unary expression . 13608 * Instances of the class `PrefixExpression` represent a prefix unary expression .
14223 * 13609 *
(...skipping 11 matching lines...) Expand all
14235 /** 13621 /**
14236 * The expression computing the operand for the operator. 13622 * The expression computing the operand for the operator.
14237 */ 13623 */
14238 Expression _operand; 13624 Expression _operand;
14239 13625
14240 /** 13626 /**
14241 * The element associated with the operator based on the static type of the op erand, or 13627 * The element associated with the operator based on the static type of the op erand, or
14242 * `null` if the AST structure has not been resolved, if the operator is not u ser definable, 13628 * `null` if the AST structure has not been resolved, if the operator is not u ser definable,
14243 * or if the operator could not be resolved. 13629 * or if the operator could not be resolved.
14244 */ 13630 */
14245 MethodElement _staticElement; 13631 MethodElement staticElement;
14246 13632
14247 /** 13633 /**
14248 * The element associated with the operator based on the propagated type of th e operand, or 13634 * The element associated with the operator based on the propagated type of th e operand, or
14249 * `null` if the AST structure has not been resolved, if the operator is not u ser definable, 13635 * `null` if the AST structure has not been resolved, if the operator is not u ser definable,
14250 * or if the operator could not be resolved. 13636 * or if the operator could not be resolved.
14251 */ 13637 */
14252 MethodElement _propagatedElement; 13638 MethodElement propagatedElement;
14253 13639
14254 /** 13640 /**
14255 * Initialize a newly created prefix expression. 13641 * Initialize a newly created prefix expression.
14256 * 13642 *
14257 * @param operator the prefix operator being applied to the operand 13643 * @param operator the prefix operator being applied to the operand
14258 * @param operand the expression computing the operand for the operator 13644 * @param operand the expression computing the operand for the operator
14259 */ 13645 */
14260 PrefixExpression(this.operator, Expression operand) { 13646 PrefixExpression(this.operator, Expression operand) {
14261 this._operand = becomeParentOf(operand); 13647 _operand = becomeParentOf(operand);
14262 } 13648 }
14263 13649
14264 @override 13650 @override
14265 accept(AstVisitor visitor) => visitor.visitPrefixExpression(this); 13651 accept(AstVisitor visitor) => visitor.visitPrefixExpression(this);
14266 13652
14267 @override 13653 @override
14268 Token get beginToken => operator; 13654 Token get beginToken => operator;
14269 13655
14270 /** 13656 /**
14271 * Return the best element available for this operator. If resolution was able to find a better 13657 * Return the best element available for this operator. If resolution was able to find a better
(...skipping 18 matching lines...) Expand all
14290 * Return the expression computing the operand for the operator. 13676 * Return the expression computing the operand for the operator.
14291 * 13677 *
14292 * @return the expression computing the operand for the operator 13678 * @return the expression computing the operand for the operator
14293 */ 13679 */
14294 Expression get operand => _operand; 13680 Expression get operand => _operand;
14295 13681
14296 @override 13682 @override
14297 int get precedence => 14; 13683 int get precedence => 14;
14298 13684
14299 /** 13685 /**
14300 * Return the element associated with the operator based on the propagated typ e of the operand, or
14301 * `null` if the AST structure has not been resolved, if the operator is not u ser definable,
14302 * or if the operator could not be resolved. One example of the latter case is an operator that is
14303 * not defined for the type of the operand.
14304 *
14305 * @return the element associated with the operator
14306 */
14307 MethodElement get propagatedElement => _propagatedElement;
14308
14309 /**
14310 * Return the element associated with the operator based on the static type of the operand, or
14311 * `null` if the AST structure has not been resolved, if the operator is not u ser definable,
14312 * or if the operator could not be resolved. One example of the latter case is an operator that is
14313 * not defined for the type of the operand.
14314 *
14315 * @return the element associated with the operator
14316 */
14317 MethodElement get staticElement => _staticElement;
14318
14319 /**
14320 * Set the expression computing the operand for the operator to the given expr ession. 13686 * Set the expression computing the operand for the operator to the given expr ession.
14321 * 13687 *
14322 * @param expression the expression computing the operand for the operator 13688 * @param expression the expression computing the operand for the operator
14323 */ 13689 */
14324 void set operand(Expression expression) { 13690 void set operand(Expression expression) {
14325 _operand = becomeParentOf(expression); 13691 _operand = becomeParentOf(expression);
14326 } 13692 }
14327 13693
14328 /**
14329 * Set the element associated with the operator based on the propagated type o f the operand to the
14330 * given element.
14331 *
14332 * @param element the element to be associated with the operator
14333 */
14334 void set propagatedElement(MethodElement element) {
14335 _propagatedElement = element;
14336 }
14337
14338 /**
14339 * Set the element associated with the operator based on the static type of th e operand to the
14340 * given element.
14341 *
14342 * @param element the static element to be associated with the operator
14343 */
14344 void set staticElement(MethodElement element) {
14345 _staticElement = element;
14346 }
14347
14348 @override 13694 @override
14349 void visitChildren(AstVisitor visitor) { 13695 void visitChildren(AstVisitor visitor) {
14350 safelyVisitChild(_operand, visitor); 13696 safelyVisitChild(_operand, visitor);
14351 } 13697 }
14352 13698
14353 /** 13699 /**
14354 * If the AST structure has been resolved, and the function being invoked is k nown based on 13700 * If the AST structure has been resolved, and the function being invoked is k nown based on
14355 * propagated type information, then return the parameter element representing the parameter to 13701 * propagated type information, then return the parameter element representing the parameter to
14356 * which the value of the operand will be bound. Otherwise, return `null`. 13702 * which the value of the operand will be bound. Otherwise, return `null`.
14357 * 13703 *
14358 * This method is only intended to be used by [Expression.propagatedParameterE lement]. 13704 * This method is only intended to be used by [Expression.propagatedParameterE lement].
14359 * 13705 *
14360 * @return the parameter element representing the parameter to which the value of the right 13706 * @return the parameter element representing the parameter to which the value of the right
14361 * operand will be bound 13707 * operand will be bound
14362 */ 13708 */
14363 ParameterElement get propagatedParameterElementForOperand { 13709 ParameterElement get propagatedParameterElementForOperand {
14364 if (_propagatedElement == null) { 13710 if (propagatedElement == null) {
14365 return null; 13711 return null;
14366 } 13712 }
14367 List<ParameterElement> parameters = _propagatedElement.parameters; 13713 List<ParameterElement> parameters = propagatedElement.parameters;
14368 if (parameters.length < 1) { 13714 if (parameters.length < 1) {
14369 return null; 13715 return null;
14370 } 13716 }
14371 return parameters[0]; 13717 return parameters[0];
14372 } 13718 }
14373 13719
14374 /** 13720 /**
14375 * If the AST structure has been resolved, and the function being invoked is k nown based on static 13721 * If the AST structure has been resolved, and the function being invoked is k nown based on static
14376 * type information, then return the parameter element representing the parame ter to which the 13722 * type information, then return the parameter element representing the parame ter to which the
14377 * value of the operand will be bound. Otherwise, return `null`. 13723 * value of the operand will be bound. Otherwise, return `null`.
14378 * 13724 *
14379 * This method is only intended to be used by [Expression.staticParameterEleme nt]. 13725 * This method is only intended to be used by [Expression.staticParameterEleme nt].
14380 * 13726 *
14381 * @return the parameter element representing the parameter to which the value of the right 13727 * @return the parameter element representing the parameter to which the value of the right
14382 * operand will be bound 13728 * operand will be bound
14383 */ 13729 */
14384 ParameterElement get staticParameterElementForOperand { 13730 ParameterElement get staticParameterElementForOperand {
14385 if (_staticElement == null) { 13731 if (staticElement == null) {
14386 return null; 13732 return null;
14387 } 13733 }
14388 List<ParameterElement> parameters = _staticElement.parameters; 13734 List<ParameterElement> parameters = staticElement.parameters;
14389 if (parameters.length < 1) { 13735 if (parameters.length < 1) {
14390 return null; 13736 return null;
14391 } 13737 }
14392 return parameters[0]; 13738 return parameters[0];
14393 } 13739 }
14394 } 13740 }
14395 13741
14396 /** 13742 /**
14397 * Instances of the class `PrefixedIdentifier` represent either an identifier th at is prefixed 13743 * Instances of the class `PrefixedIdentifier` represent either an identifier th at is prefixed
14398 * or an access to an object property where the target of the property access is a simple 13744 * or an access to an object property where the target of the property access is a simple
(...skipping 21 matching lines...) Expand all
14420 SimpleIdentifier _identifier; 13766 SimpleIdentifier _identifier;
14421 13767
14422 /** 13768 /**
14423 * Initialize a newly created prefixed identifier. 13769 * Initialize a newly created prefixed identifier.
14424 * 13770 *
14425 * @param prefix the identifier being prefixed 13771 * @param prefix the identifier being prefixed
14426 * @param period the period used to separate the prefix from the identifier 13772 * @param period the period used to separate the prefix from the identifier
14427 * @param identifier the prefix associated with the library in which the ident ifier is defined 13773 * @param identifier the prefix associated with the library in which the ident ifier is defined
14428 */ 13774 */
14429 PrefixedIdentifier(SimpleIdentifier prefix, this.period, SimpleIdentifier iden tifier) { 13775 PrefixedIdentifier(SimpleIdentifier prefix, this.period, SimpleIdentifier iden tifier) {
14430 this._prefix = becomeParentOf(prefix); 13776 _prefix = becomeParentOf(prefix);
14431 this._identifier = becomeParentOf(identifier); 13777 _identifier = becomeParentOf(identifier);
14432 } 13778 }
14433 13779
14434 @override 13780 @override
14435 accept(AstVisitor visitor) => visitor.visitPrefixedIdentifier(this); 13781 accept(AstVisitor visitor) => visitor.visitPrefixedIdentifier(this);
14436 13782
14437 @override 13783 @override
14438 Token get beginToken => _prefix.beginToken; 13784 Token get beginToken => _prefix.beginToken;
14439 13785
14440 @override 13786 @override
14441 Element get bestElement { 13787 Element get bestElement {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
14504 } 13850 }
14505 return imports[0].isDeferred; 13851 return imports[0].isDeferred;
14506 } 13852 }
14507 13853
14508 /** 13854 /**
14509 * Set the identifier being prefixed to the given identifier. 13855 * Set the identifier being prefixed to the given identifier.
14510 * 13856 *
14511 * @param identifier the identifier being prefixed 13857 * @param identifier the identifier being prefixed
14512 */ 13858 */
14513 void set identifier(SimpleIdentifier identifier) { 13859 void set identifier(SimpleIdentifier identifier) {
14514 this._identifier = becomeParentOf(identifier); 13860 _identifier = becomeParentOf(identifier);
14515 } 13861 }
14516 13862
14517 /** 13863 /**
14518 * Set the prefix associated with the library in which the identifier is defin ed to the given 13864 * Set the prefix associated with the library in which the identifier is defin ed to the given
14519 * identifier. 13865 * identifier.
14520 * 13866 *
14521 * @param identifier the prefix associated with the library in which the ident ifier is defined 13867 * @param identifier the prefix associated with the library in which the ident ifier is defined
14522 */ 13868 */
14523 void set prefix(SimpleIdentifier identifier) { 13869 void set prefix(SimpleIdentifier identifier) {
14524 _prefix = becomeParentOf(identifier); 13870 _prefix = becomeParentOf(identifier);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
14560 SimpleIdentifier _propertyName; 13906 SimpleIdentifier _propertyName;
14561 13907
14562 /** 13908 /**
14563 * Initialize a newly created property access expression. 13909 * Initialize a newly created property access expression.
14564 * 13910 *
14565 * @param target the expression computing the object defining the property bei ng accessed 13911 * @param target the expression computing the object defining the property bei ng accessed
14566 * @param operator the property access operator 13912 * @param operator the property access operator
14567 * @param propertyName the name of the property being accessed 13913 * @param propertyName the name of the property being accessed
14568 */ 13914 */
14569 PropertyAccess(Expression target, this.operator, SimpleIdentifier propertyName ) { 13915 PropertyAccess(Expression target, this.operator, SimpleIdentifier propertyName ) {
14570 this._target = becomeParentOf(target); 13916 _target = becomeParentOf(target);
14571 this._propertyName = becomeParentOf(propertyName); 13917 _propertyName = becomeParentOf(propertyName);
14572 } 13918 }
14573 13919
14574 @override 13920 @override
14575 accept(AstVisitor visitor) => visitor.visitPropertyAccess(this); 13921 accept(AstVisitor visitor) => visitor.visitPropertyAccess(this);
14576 13922
14577 @override 13923 @override
14578 Token get beginToken { 13924 Token get beginToken {
14579 if (_target != null) { 13925 if (_target != null) {
14580 return _target.beginToken; 13926 return _target.beginToken;
14581 } 13927 }
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
15353 /** 14699 /**
15354 * Initialize a newly created redirecting invocation to invoke the constructor with the given name 14700 * Initialize a newly created redirecting invocation to invoke the constructor with the given name
15355 * with the given arguments. 14701 * with the given arguments.
15356 * 14702 *
15357 * @param keyword the token for the 'this' keyword 14703 * @param keyword the token for the 'this' keyword
15358 * @param period the token for the period before the name of the constructor t hat is being invoked 14704 * @param period the token for the period before the name of the constructor t hat is being invoked
15359 * @param constructorName the name of the constructor that is being invoked 14705 * @param constructorName the name of the constructor that is being invoked
15360 * @param argumentList the list of arguments to the constructor 14706 * @param argumentList the list of arguments to the constructor
15361 */ 14707 */
15362 RedirectingConstructorInvocation(this.keyword, this.period, SimpleIdentifier c onstructorName, ArgumentList argumentList) { 14708 RedirectingConstructorInvocation(this.keyword, this.period, SimpleIdentifier c onstructorName, ArgumentList argumentList) {
15363 this._constructorName = becomeParentOf(constructorName); 14709 _constructorName = becomeParentOf(constructorName);
15364 this._argumentList = becomeParentOf(argumentList); 14710 _argumentList = becomeParentOf(argumentList);
15365 } 14711 }
15366 14712
15367 @override 14713 @override
15368 accept(AstVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th is); 14714 accept(AstVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th is);
15369 14715
15370 /** 14716 /**
15371 * Return the list of arguments to the constructor. 14717 * Return the list of arguments to the constructor.
15372 * 14718 *
15373 * @return the list of arguments to the constructor 14719 * @return the list of arguments to the constructor
15374 */ 14720 */
(...skipping 12 matching lines...) Expand all
15387 14733
15388 @override 14734 @override
15389 Token get endToken => _argumentList.endToken; 14735 Token get endToken => _argumentList.endToken;
15390 14736
15391 /** 14737 /**
15392 * Set the list of arguments to the constructor to the given list. 14738 * Set the list of arguments to the constructor to the given list.
15393 * 14739 *
15394 * @param argumentList the list of arguments to the constructor 14740 * @param argumentList the list of arguments to the constructor
15395 */ 14741 */
15396 void set argumentList(ArgumentList argumentList) { 14742 void set argumentList(ArgumentList argumentList) {
15397 this._argumentList = becomeParentOf(argumentList); 14743 _argumentList = becomeParentOf(argumentList);
15398 } 14744 }
15399 14745
15400 /** 14746 /**
15401 * Set the name of the constructor that is being invoked to the given identifi er. 14747 * Set the name of the constructor that is being invoked to the given identifi er.
15402 * 14748 *
15403 * @param identifier the name of the constructor that is being invoked 14749 * @param identifier the name of the constructor that is being invoked
15404 */ 14750 */
15405 void set constructorName(SimpleIdentifier identifier) { 14751 void set constructorName(SimpleIdentifier identifier) {
15406 _constructorName = becomeParentOf(identifier); 14752 _constructorName = becomeParentOf(identifier);
15407 } 14753 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
15478 Token semicolon; 14824 Token semicolon;
15479 14825
15480 /** 14826 /**
15481 * Initialize a newly created return statement. 14827 * Initialize a newly created return statement.
15482 * 14828 *
15483 * @param keyword the token representing the 'return' keyword 14829 * @param keyword the token representing the 'return' keyword
15484 * @param expression the expression computing the value to be returned 14830 * @param expression the expression computing the value to be returned
15485 * @param semicolon the semicolon terminating the statement 14831 * @param semicolon the semicolon terminating the statement
15486 */ 14832 */
15487 ReturnStatement(this.keyword, Expression expression, this.semicolon) { 14833 ReturnStatement(this.keyword, Expression expression, this.semicolon) {
15488 this._expression = becomeParentOf(expression); 14834 _expression = becomeParentOf(expression);
15489 } 14835 }
15490 14836
15491 @override 14837 @override
15492 accept(AstVisitor visitor) => visitor.visitReturnStatement(this); 14838 accept(AstVisitor visitor) => visitor.visitReturnStatement(this);
15493 14839
15494 @override 14840 @override
15495 Token get beginToken => keyword; 14841 Token get beginToken => keyword;
15496 14842
15497 @override 14843 @override
15498 Token get endToken => semicolon; 14844 Token get endToken => semicolon;
15499 14845
15500 /** 14846 /**
15501 * Return the expression computing the value to be returned, or `null` if no e xplicit value 14847 * Return the expression computing the value to be returned, or `null` if no e xplicit value
15502 * was provided. 14848 * was provided.
15503 * 14849 *
15504 * @return the expression computing the value to be returned 14850 * @return the expression computing the value to be returned
15505 */ 14851 */
15506 Expression get expression => _expression; 14852 Expression get expression => _expression;
15507 14853
15508 /** 14854 /**
15509 * Set the expression computing the value to be returned to the given expressi on. 14855 * Set the expression computing the value to be returned to the given expressi on.
15510 * 14856 *
15511 * @param expression the expression computing the value to be returned 14857 * @param expression the expression computing the value to be returned
15512 */ 14858 */
15513 void set expression(Expression expression) { 14859 void set expression(Expression expression) {
15514 this._expression = becomeParentOf(expression); 14860 _expression = becomeParentOf(expression);
15515 } 14861 }
15516 14862
15517 @override 14863 @override
15518 void visitChildren(AstVisitor visitor) { 14864 void visitChildren(AstVisitor visitor) {
15519 safelyVisitChild(_expression, visitor); 14865 safelyVisitChild(_expression, visitor);
15520 } 14866 }
15521 } 14867 }
15522 14868
15523 /** 14869 /**
15524 * Traverse the AST from initial child node to successive parents, building a co llection of local 14870 * Traverse the AST from initial child node to successive parents, building a co llection of local
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
15754 */ 15100 */
15755 NodeList<SimpleIdentifier> _shownNames; 15101 NodeList<SimpleIdentifier> _shownNames;
15756 15102
15757 /** 15103 /**
15758 * Initialize a newly created import show combinator. 15104 * Initialize a newly created import show combinator.
15759 * 15105 *
15760 * @param keyword the comma introducing the combinator 15106 * @param keyword the comma introducing the combinator
15761 * @param shownNames the list of names from the library that are made visible by this combinator 15107 * @param shownNames the list of names from the library that are made visible by this combinator
15762 */ 15108 */
15763 ShowCombinator(Token keyword, List<SimpleIdentifier> shownNames) : super(keywo rd) { 15109 ShowCombinator(Token keyword, List<SimpleIdentifier> shownNames) : super(keywo rd) {
15764 this._shownNames = new NodeList<SimpleIdentifier>(this); 15110 _shownNames = new NodeList<SimpleIdentifier>(this, shownNames);
15765 this._shownNames.addAll(shownNames);
15766 } 15111 }
15767 15112
15768 @override 15113 @override
15769 accept(AstVisitor visitor) => visitor.visitShowCombinator(this); 15114 accept(AstVisitor visitor) => visitor.visitShowCombinator(this);
15770 15115
15771 @override 15116 @override
15772 Token get endToken => _shownNames.endToken; 15117 Token get endToken => _shownNames.endToken;
15773 15118
15774 /** 15119 /**
15775 * Return the list of names from the library that are made visible by this com binator. 15120 * Return the list of names from the library that are made visible by this com binator.
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
16134 /** 15479 /**
16135 * Initialize a newly created formal parameter. 15480 * Initialize a newly created formal parameter.
16136 * 15481 *
16137 * @param comment the documentation comment associated with this parameter 15482 * @param comment the documentation comment associated with this parameter
16138 * @param metadata the annotations associated with this parameter 15483 * @param metadata the annotations associated with this parameter
16139 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 15484 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
16140 * @param type the name of the declared type of the parameter 15485 * @param type the name of the declared type of the parameter
16141 * @param identifier the name of the parameter being declared 15486 * @param identifier the name of the parameter being declared
16142 */ 15487 */
16143 SimpleFormalParameter(Comment comment, List<Annotation> metadata, this.keyword , TypeName type, SimpleIdentifier identifier) : super(comment, metadata, identif ier) { 15488 SimpleFormalParameter(Comment comment, List<Annotation> metadata, this.keyword , TypeName type, SimpleIdentifier identifier) : super(comment, metadata, identif ier) {
16144 this._type = becomeParentOf(type); 15489 _type = becomeParentOf(type);
16145 } 15490 }
16146 15491
16147 @override 15492 @override
16148 accept(AstVisitor visitor) => visitor.visitSimpleFormalParameter(this); 15493 accept(AstVisitor visitor) => visitor.visitSimpleFormalParameter(this);
16149 15494
16150 @override 15495 @override
16151 Token get beginToken { 15496 Token get beginToken {
16152 NodeList<Annotation> metadata = this.metadata; 15497 NodeList<Annotation> metadata = this.metadata;
16153 if (!metadata.isEmpty) { 15498 if (!metadata.isEmpty) {
16154 return metadata.beginToken; 15499 return metadata.beginToken;
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
16537 Token literal; 15882 Token literal;
16538 15883
16539 /** 15884 /**
16540 * The value of the literal. 15885 * The value of the literal.
16541 */ 15886 */
16542 String _value; 15887 String _value;
16543 15888
16544 /** 15889 /**
16545 * The toolkit specific element associated with this literal, or `null`. 15890 * The toolkit specific element associated with this literal, or `null`.
16546 */ 15891 */
16547 Element _toolkitElement; 15892 Element toolkitElement;
16548 15893
16549 /** 15894 /**
16550 * Initialize a newly created simple string literal. 15895 * Initialize a newly created simple string literal.
16551 * 15896 *
16552 * @param literal the token representing the literal 15897 * @param literal the token representing the literal
16553 * @param value the value of the literal 15898 * @param value the value of the literal
16554 */ 15899 */
16555 SimpleStringLiteral(this.literal, String value) { 15900 SimpleStringLiteral(this.literal, String value) {
16556 this._value = StringUtilities.intern(value); 15901 _value = StringUtilities.intern(value);
16557 } 15902 }
16558 15903
16559 @override 15904 @override
16560 accept(AstVisitor visitor) => visitor.visitSimpleStringLiteral(this); 15905 accept(AstVisitor visitor) => visitor.visitSimpleStringLiteral(this);
16561 15906
16562 @override 15907 @override
16563 Token get beginToken => literal; 15908 Token get beginToken => literal;
16564 15909
16565 @override 15910 @override
16566 int get contentsOffset { 15911 int get contentsOffset {
(...skipping 11 matching lines...) Expand all
16578 15923
16579 @override 15924 @override
16580 int get contentsEnd { 15925 int get contentsEnd {
16581 return contentsOffset + value.length; 15926 return contentsOffset + value.length;
16582 } 15927 }
16583 15928
16584 @override 15929 @override
16585 Token get endToken => literal; 15930 Token get endToken => literal;
16586 15931
16587 /** 15932 /**
16588 * Return the toolkit specific, non-Dart, element associated with this literal , or `null`.
16589 *
16590 * @return the element associated with this literal
16591 */
16592 Element get toolkitElement => _toolkitElement;
16593
16594 /**
16595 * Return the value of the literal. 15933 * Return the value of the literal.
16596 * 15934 *
16597 * @return the value of the literal 15935 * @return the value of the literal
16598 */ 15936 */
16599 String get value => _value; 15937 String get value => _value;
16600 15938
16601 @override 15939 @override
16602 bool get isMultiline { 15940 bool get isMultiline {
16603 String lexeme = literal.lexeme; 15941 String lexeme = literal.lexeme;
16604 if (lexeme.length < 3) { 15942 if (lexeme.length < 3) {
(...skipping 22 matching lines...) Expand all
16627 if (codeZero == 0x72) { 15965 if (codeZero == 0x72) {
16628 return lexeme.length > 1 && lexeme.codeUnitAt(1) == 0x27; 15966 return lexeme.length > 1 && lexeme.codeUnitAt(1) == 0x27;
16629 } 15967 }
16630 return codeZero == 0x27; 15968 return codeZero == 0x27;
16631 } 15969 }
16632 15970
16633 @override 15971 @override
16634 bool get isSynthetic => literal.isSynthetic; 15972 bool get isSynthetic => literal.isSynthetic;
16635 15973
16636 /** 15974 /**
16637 * Set the toolkit specific, non-Dart, element associated with this literal.
16638 *
16639 * @param element the toolkit specific element to be associated with this lite ral
16640 */
16641 void set toolkitElement(Element element) {
16642 _toolkitElement = element;
16643 }
16644
16645 /**
16646 * Set the value of the literal to the given string. 15975 * Set the value of the literal to the given string.
16647 * 15976 *
16648 * @param string the value of the literal 15977 * @param string the value of the literal
16649 */ 15978 */
16650 void set value(String string) { 15979 void set value(String string) {
16651 _value = StringUtilities.intern(_value); 15980 _value = StringUtilities.intern(_value);
16652 } 15981 }
16653 15982
16654 @override 15983 @override
16655 void visitChildren(AstVisitor visitor) { 15984 void visitChildren(AstVisitor visitor) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
16701 * The elements that will be composed to produce the resulting string. 16030 * The elements that will be composed to produce the resulting string.
16702 */ 16031 */
16703 NodeList<InterpolationElement> _elements; 16032 NodeList<InterpolationElement> _elements;
16704 16033
16705 /** 16034 /**
16706 * Initialize a newly created string interpolation expression. 16035 * Initialize a newly created string interpolation expression.
16707 * 16036 *
16708 * @param elements the elements that will be composed to produce the resulting string 16037 * @param elements the elements that will be composed to produce the resulting string
16709 */ 16038 */
16710 StringInterpolation(List<InterpolationElement> elements) { 16039 StringInterpolation(List<InterpolationElement> elements) {
16711 this._elements = new NodeList<InterpolationElement>(this); 16040 _elements = new NodeList<InterpolationElement>(this, elements);
16712 this._elements.addAll(elements);
16713 } 16041 }
16714 16042
16715 @override 16043 @override
16716 accept(AstVisitor visitor) => visitor.visitStringInterpolation(this); 16044 accept(AstVisitor visitor) => visitor.visitStringInterpolation(this);
16717 16045
16718 @override 16046 @override
16719 Token get beginToken => _elements.beginToken; 16047 Token get beginToken => _elements.beginToken;
16720 16048
16721 /** 16049 /**
16722 * Return the elements that will be composed to produce the resulting string. 16050 * Return the elements that will be composed to produce the resulting string.
(...skipping 23 matching lines...) Expand all
16746 16074
16747 @override 16075 @override
16748 int get contentsEnd { 16076 int get contentsEnd {
16749 InterpolationString element = _elements.last; 16077 InterpolationString element = _elements.last;
16750 return element.contentsEnd; 16078 return element.contentsEnd;
16751 } 16079 }
16752 16080
16753 @override 16081 @override
16754 bool get isMultiline { 16082 bool get isMultiline {
16755 InterpolationString element = _elements.first; 16083 InterpolationString element = _elements.first;
16756 String lexeme = element._contents.lexeme; 16084 String lexeme = element.contents.lexeme;
16757 if (lexeme.length < 3) { 16085 if (lexeme.length < 3) {
16758 return false; 16086 return false;
16759 } 16087 }
16760 return StringUtilities.startsWith3(lexeme, 0, 0x22, 0x22, 0x22) || 16088 return StringUtilities.startsWith3(lexeme, 0, 0x22, 0x22, 0x22) ||
16761 StringUtilities.startsWith3(lexeme, 0, 0x27, 0x27, 0x27); 16089 StringUtilities.startsWith3(lexeme, 0, 0x27, 0x27, 0x27);
16762 } 16090 }
16763 16091
16764 @override 16092 @override
16765 bool get isRaw => false; 16093 bool get isRaw => false;
16766 16094
16767 16095
16768 @override 16096 @override
16769 bool get isSingleQuoted { 16097 bool get isSingleQuoted {
16770 InterpolationString lastString = _elements.first; 16098 InterpolationString lastString = _elements.first;
16771 String lexeme = lastString._contents.lexeme; 16099 String lexeme = lastString.contents.lexeme;
16772 return StringUtilities.startsWithChar(lexeme, 0x27); 16100 return StringUtilities.startsWithChar(lexeme, 0x27);
16773 } 16101 }
16774 } 16102 }
16775 16103
16776 /** 16104 /**
16777 * Instances of the class `StringLiteral` represent a string literal expression. 16105 * Instances of the class `StringLiteral` represent a string literal expression.
16778 * 16106 *
16779 * <pre> 16107 * <pre>
16780 * stringLiteral ::= 16108 * stringLiteral ::=
16781 * [SimpleStringLiteral] 16109 * [SimpleStringLiteral]
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
16885 /** 16213 /**
16886 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given 16214 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given
16887 * name with the given arguments. 16215 * name with the given arguments.
16888 * 16216 *
16889 * @param keyword the token for the 'super' keyword 16217 * @param keyword the token for the 'super' keyword
16890 * @param period the token for the period before the name of the constructor t hat is being invoked 16218 * @param period the token for the period before the name of the constructor t hat is being invoked
16891 * @param constructorName the name of the constructor that is being invoked 16219 * @param constructorName the name of the constructor that is being invoked
16892 * @param argumentList the list of arguments to the constructor 16220 * @param argumentList the list of arguments to the constructor
16893 */ 16221 */
16894 SuperConstructorInvocation(this.keyword, this.period, SimpleIdentifier constru ctorName, ArgumentList argumentList) { 16222 SuperConstructorInvocation(this.keyword, this.period, SimpleIdentifier constru ctorName, ArgumentList argumentList) {
16895 this._constructorName = becomeParentOf(constructorName); 16223 _constructorName = becomeParentOf(constructorName);
16896 this._argumentList = becomeParentOf(argumentList); 16224 _argumentList = becomeParentOf(argumentList);
16897 } 16225 }
16898 16226
16899 @override 16227 @override
16900 accept(AstVisitor visitor) => visitor.visitSuperConstructorInvocation(this); 16228 accept(AstVisitor visitor) => visitor.visitSuperConstructorInvocation(this);
16901 16229
16902 /** 16230 /**
16903 * Return the list of arguments to the constructor. 16231 * Return the list of arguments to the constructor.
16904 * 16232 *
16905 * @return the list of arguments to the constructor 16233 * @return the list of arguments to the constructor
16906 */ 16234 */
(...skipping 12 matching lines...) Expand all
16919 16247
16920 @override 16248 @override
16921 Token get endToken => _argumentList.endToken; 16249 Token get endToken => _argumentList.endToken;
16922 16250
16923 /** 16251 /**
16924 * Set the list of arguments to the constructor to the given list. 16252 * Set the list of arguments to the constructor to the given list.
16925 * 16253 *
16926 * @param argumentList the list of arguments to the constructor 16254 * @param argumentList the list of arguments to the constructor
16927 */ 16255 */
16928 void set argumentList(ArgumentList argumentList) { 16256 void set argumentList(ArgumentList argumentList) {
16929 this._argumentList = becomeParentOf(argumentList); 16257 _argumentList = becomeParentOf(argumentList);
16930 } 16258 }
16931 16259
16932 /** 16260 /**
16933 * Set the name of the constructor that is being invoked to the given identifi er. 16261 * Set the name of the constructor that is being invoked to the given identifi er.
16934 * 16262 *
16935 * @param identifier the name of the constructor that is being invoked 16263 * @param identifier the name of the constructor that is being invoked
16936 */ 16264 */
16937 void set constructorName(SimpleIdentifier identifier) { 16265 void set constructorName(SimpleIdentifier identifier) {
16938 _constructorName = becomeParentOf(identifier); 16266 _constructorName = becomeParentOf(identifier);
16939 } 16267 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
17001 /** 16329 /**
17002 * Initialize a newly created switch case. 16330 * Initialize a newly created switch case.
17003 * 16331 *
17004 * @param labels the labels associated with the switch member 16332 * @param labels the labels associated with the switch member
17005 * @param keyword the token representing the 'case' or 'default' keyword 16333 * @param keyword the token representing the 'case' or 'default' keyword
17006 * @param expression the expression controlling whether the statements will be executed 16334 * @param expression the expression controlling whether the statements will be executed
17007 * @param colon the colon separating the keyword or the expression from the st atements 16335 * @param colon the colon separating the keyword or the expression from the st atements
17008 * @param statements the statements that will be executed if this switch membe r is selected 16336 * @param statements the statements that will be executed if this switch membe r is selected
17009 */ 16337 */
17010 SwitchCase(List<Label> labels, Token keyword, Expression expression, Token col on, List<Statement> statements) : super(labels, keyword, colon, statements) { 16338 SwitchCase(List<Label> labels, Token keyword, Expression expression, Token col on, List<Statement> statements) : super(labels, keyword, colon, statements) {
17011 this._expression = becomeParentOf(expression); 16339 _expression = becomeParentOf(expression);
17012 } 16340 }
17013 16341
17014 @override 16342 @override
17015 accept(AstVisitor visitor) => visitor.visitSwitchCase(this); 16343 accept(AstVisitor visitor) => visitor.visitSwitchCase(this);
17016 16344
17017 /** 16345 /**
17018 * Return the expression controlling whether the statements will be executed. 16346 * Return the expression controlling whether the statements will be executed.
17019 * 16347 *
17020 * @return the expression controlling whether the statements will be executed 16348 * @return the expression controlling whether the statements will be executed
17021 */ 16349 */
17022 Expression get expression => _expression; 16350 Expression get expression => _expression;
17023 16351
17024 /** 16352 /**
17025 * Set the expression controlling whether the statements will be executed to t he given expression. 16353 * Set the expression controlling whether the statements will be executed to t he given expression.
17026 * 16354 *
17027 * @param expression the expression controlling whether the statements will be executed 16355 * @param expression the expression controlling whether the statements will be executed
17028 */ 16356 */
17029 void set expression(Expression expression) { 16357 void set expression(Expression expression) {
17030 this._expression = becomeParentOf(expression); 16358 _expression = becomeParentOf(expression);
17031 } 16359 }
17032 16360
17033 @override 16361 @override
17034 void visitChildren(AstVisitor visitor) { 16362 void visitChildren(AstVisitor visitor) {
17035 labels.accept(visitor); 16363 labels.accept(visitor);
17036 safelyVisitChild(_expression, visitor); 16364 safelyVisitChild(_expression, visitor);
17037 statements.accept(visitor); 16365 statements.accept(visitor);
17038 } 16366 }
17039 } 16367 }
17040 16368
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
17100 16428
17101 /** 16429 /**
17102 * Initialize a newly created switch member. 16430 * Initialize a newly created switch member.
17103 * 16431 *
17104 * @param labels the labels associated with the switch member 16432 * @param labels the labels associated with the switch member
17105 * @param keyword the token representing the 'case' or 'default' keyword 16433 * @param keyword the token representing the 'case' or 'default' keyword
17106 * @param colon the colon separating the keyword or the expression from the st atements 16434 * @param colon the colon separating the keyword or the expression from the st atements
17107 * @param statements the statements that will be executed if this switch membe r is selected 16435 * @param statements the statements that will be executed if this switch membe r is selected
17108 */ 16436 */
17109 SwitchMember(List<Label> labels, this.keyword, this.colon, List<Statement> sta tements) { 16437 SwitchMember(List<Label> labels, this.keyword, this.colon, List<Statement> sta tements) {
17110 this._labels = new NodeList<Label>(this); 16438 _labels = new NodeList<Label>(this, labels);
17111 this._statements = new NodeList<Statement>(this); 16439 _statements = new NodeList<Statement>(this, statements);
17112 this._labels.addAll(labels);
17113 this._statements.addAll(statements);
17114 } 16440 }
17115 16441
17116 @override 16442 @override
17117 Token get beginToken { 16443 Token get beginToken {
17118 if (!_labels.isEmpty) { 16444 if (!_labels.isEmpty) {
17119 return _labels.beginToken; 16445 return _labels.beginToken;
17120 } 16446 }
17121 return keyword; 16447 return keyword;
17122 } 16448 }
17123 16449
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
17193 * 16519 *
17194 * @param keyword the token representing the 'switch' keyword 16520 * @param keyword the token representing the 'switch' keyword
17195 * @param leftParenthesis the left parenthesis 16521 * @param leftParenthesis the left parenthesis
17196 * @param expression the expression used to determine which of the switch memb ers will be selected 16522 * @param expression the expression used to determine which of the switch memb ers will be selected
17197 * @param rightParenthesis the right parenthesis 16523 * @param rightParenthesis the right parenthesis
17198 * @param leftBracket the left curly bracket 16524 * @param leftBracket the left curly bracket
17199 * @param members the switch members that can be selected by the expression 16525 * @param members the switch members that can be selected by the expression
17200 * @param rightBracket the right curly bracket 16526 * @param rightBracket the right curly bracket
17201 */ 16527 */
17202 SwitchStatement(this.keyword, this.leftParenthesis, Expression expression, thi s.rightParenthesis, this.leftBracket, List<SwitchMember> members, this.rightBrac ket) { 16528 SwitchStatement(this.keyword, this.leftParenthesis, Expression expression, thi s.rightParenthesis, this.leftBracket, List<SwitchMember> members, this.rightBrac ket) {
17203 this._members = new NodeList<SwitchMember>(this); 16529 _expression = becomeParentOf(expression);
17204 this._expression = becomeParentOf(expression); 16530 _members = new NodeList<SwitchMember>(this, members);
17205 this._members.addAll(members);
17206 } 16531 }
17207 16532
17208 @override 16533 @override
17209 accept(AstVisitor visitor) => visitor.visitSwitchStatement(this); 16534 accept(AstVisitor visitor) => visitor.visitSwitchStatement(this);
17210 16535
17211 @override 16536 @override
17212 Token get beginToken => keyword; 16537 Token get beginToken => keyword;
17213 16538
17214 @override 16539 @override
17215 Token get endToken => rightBracket; 16540 Token get endToken => rightBracket;
(...skipping 12 matching lines...) Expand all
17228 */ 16553 */
17229 NodeList<SwitchMember> get members => _members; 16554 NodeList<SwitchMember> get members => _members;
17230 16555
17231 /** 16556 /**
17232 * Set the expression used to determine which of the switch members will be se lected to the given 16557 * Set the expression used to determine which of the switch members will be se lected to the given
17233 * expression. 16558 * expression.
17234 * 16559 *
17235 * @param expression the expression used to determine which of the switch memb ers will be selected 16560 * @param expression the expression used to determine which of the switch memb ers will be selected
17236 */ 16561 */
17237 void set expression(Expression expression) { 16562 void set expression(Expression expression) {
17238 this._expression = becomeParentOf(expression); 16563 _expression = becomeParentOf(expression);
17239 } 16564 }
17240 16565
17241 @override 16566 @override
17242 void visitChildren(AstVisitor visitor) { 16567 void visitChildren(AstVisitor visitor) {
17243 safelyVisitChild(_expression, visitor); 16568 safelyVisitChild(_expression, visitor);
17244 _members.accept(visitor); 16569 _members.accept(visitor);
17245 } 16570 }
17246 } 16571 }
17247 16572
17248 /** 16573 /**
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
17345 */ 16670 */
17346 Expression _expression; 16671 Expression _expression;
17347 16672
17348 /** 16673 /**
17349 * Initialize a newly created throw expression. 16674 * Initialize a newly created throw expression.
17350 * 16675 *
17351 * @param keyword the token representing the 'throw' keyword 16676 * @param keyword the token representing the 'throw' keyword
17352 * @param expression the expression computing the exception to be thrown 16677 * @param expression the expression computing the exception to be thrown
17353 */ 16678 */
17354 ThrowExpression(this.keyword, Expression expression) { 16679 ThrowExpression(this.keyword, Expression expression) {
17355 this._expression = becomeParentOf(expression); 16680 _expression = becomeParentOf(expression);
17356 } 16681 }
17357 16682
17358 @override 16683 @override
17359 accept(AstVisitor visitor) => visitor.visitThrowExpression(this); 16684 accept(AstVisitor visitor) => visitor.visitThrowExpression(this);
17360 16685
17361 @override 16686 @override
17362 Token get beginToken => keyword; 16687 Token get beginToken => keyword;
17363 16688
17364 @override 16689 @override
17365 Token get endToken { 16690 Token get endToken {
(...skipping 12 matching lines...) Expand all
17378 16703
17379 @override 16704 @override
17380 int get precedence => 0; 16705 int get precedence => 0;
17381 16706
17382 /** 16707 /**
17383 * Set the expression computing the exception to be thrown to the given expres sion. 16708 * Set the expression computing the exception to be thrown to the given expres sion.
17384 * 16709 *
17385 * @param expression the expression computing the exception to be thrown 16710 * @param expression the expression computing the exception to be thrown
17386 */ 16711 */
17387 void set expression(Expression expression) { 16712 void set expression(Expression expression) {
17388 this._expression = becomeParentOf(expression); 16713 _expression = becomeParentOf(expression);
17389 } 16714 }
17390 16715
17391 @override 16716 @override
17392 void visitChildren(AstVisitor visitor) { 16717 void visitChildren(AstVisitor visitor) {
17393 safelyVisitChild(_expression, visitor); 16718 safelyVisitChild(_expression, visitor);
17394 } 16719 }
17395 } 16720 }
17396 16721
17397 /** 16722 /**
17398 * Instances of the class `ToSourceVisitor` write a source representation of a v isited AST 16723 * Instances of the class `ToSourceVisitor` write a source representation of a v isited AST
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
18547 17872
18548 /** 17873 /**
18549 * Initialize a newly created top-level variable declaration. 17874 * Initialize a newly created top-level variable declaration.
18550 * 17875 *
18551 * @param comment the documentation comment associated with this variable 17876 * @param comment the documentation comment associated with this variable
18552 * @param metadata the annotations associated with this variable 17877 * @param metadata the annotations associated with this variable
18553 * @param variableList the top-level variables being declared 17878 * @param variableList the top-level variables being declared
18554 * @param semicolon the semicolon terminating the declaration 17879 * @param semicolon the semicolon terminating the declaration
18555 */ 17880 */
18556 TopLevelVariableDeclaration(Comment comment, List<Annotation> metadata, Variab leDeclarationList variableList, this.semicolon) : super(comment, metadata) { 17881 TopLevelVariableDeclaration(Comment comment, List<Annotation> metadata, Variab leDeclarationList variableList, this.semicolon) : super(comment, metadata) {
18557 this._variableList = becomeParentOf(variableList); 17882 _variableList = becomeParentOf(variableList);
18558 } 17883 }
18559 17884
18560 @override 17885 @override
18561 accept(AstVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this); 17886 accept(AstVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this);
18562 17887
18563 @override 17888 @override
18564 Element get element => null; 17889 Element get element => null;
18565 17890
18566 @override 17891 @override
18567 Token get endToken => semicolon; 17892 Token get endToken => semicolon;
18568 17893
18569 /** 17894 /**
18570 * Return the top-level variables being declared. 17895 * Return the top-level variables being declared.
18571 * 17896 *
18572 * @return the top-level variables being declared 17897 * @return the top-level variables being declared
18573 */ 17898 */
18574 VariableDeclarationList get variables => _variableList; 17899 VariableDeclarationList get variables => _variableList;
18575 17900
18576 /** 17901 /**
18577 * Set the top-level variables being declared to the given list of variables. 17902 * Set the top-level variables being declared to the given list of variables.
18578 * 17903 *
18579 * @param variableList the top-level variables being declared 17904 * @param variableList the top-level variables being declared
18580 */ 17905 */
18581 void set variables(VariableDeclarationList variableList) { 17906 void set variables(VariableDeclarationList variableList) {
18582 this._variableList = becomeParentOf(variableList); 17907 _variableList = becomeParentOf(variableList);
18583 } 17908 }
18584 17909
18585 @override 17910 @override
18586 void visitChildren(AstVisitor visitor) { 17911 void visitChildren(AstVisitor visitor) {
18587 super.visitChildren(visitor); 17912 super.visitChildren(visitor);
18588 safelyVisitChild(_variableList, visitor); 17913 safelyVisitChild(_variableList, visitor);
18589 } 17914 }
18590 17915
18591 @override 17916 @override
18592 Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken; 17917 Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
18634 /** 17959 /**
18635 * Initialize a newly created try statement. 17960 * Initialize a newly created try statement.
18636 * 17961 *
18637 * @param tryKeyword the token representing the 'try' keyword 17962 * @param tryKeyword the token representing the 'try' keyword
18638 * @param body the body of the statement 17963 * @param body the body of the statement
18639 * @param catchClauses the catch clauses contained in the try statement 17964 * @param catchClauses the catch clauses contained in the try statement
18640 * @param finallyKeyword the token representing the 'finally' keyword 17965 * @param finallyKeyword the token representing the 'finally' keyword
18641 * @param finallyBlock the finally block contained in the try statement 17966 * @param finallyBlock the finally block contained in the try statement
18642 */ 17967 */
18643 TryStatement(this.tryKeyword, Block body, List<CatchClause> catchClauses, this .finallyKeyword, Block finallyBlock) { 17968 TryStatement(this.tryKeyword, Block body, List<CatchClause> catchClauses, this .finallyKeyword, Block finallyBlock) {
18644 this._catchClauses = new NodeList<CatchClause>(this); 17969 _body = becomeParentOf(body);
18645 this._body = becomeParentOf(body); 17970 _catchClauses = new NodeList<CatchClause>(this, catchClauses);
18646 this._catchClauses.addAll(catchClauses); 17971 _finallyBlock = becomeParentOf(finallyBlock);
18647 this._finallyBlock = becomeParentOf(finallyBlock);
18648 } 17972 }
18649 17973
18650 @override 17974 @override
18651 accept(AstVisitor visitor) => visitor.visitTryStatement(this); 17975 accept(AstVisitor visitor) => visitor.visitTryStatement(this);
18652 17976
18653 @override 17977 @override
18654 Token get beginToken => tryKeyword; 17978 Token get beginToken => tryKeyword;
18655 17979
18656 /** 17980 /**
18657 * Return the body of the statement. 17981 * Return the body of the statement.
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
18778 Token rightBracket; 18102 Token rightBracket;
18779 18103
18780 /** 18104 /**
18781 * Initialize a newly created list of type arguments. 18105 * Initialize a newly created list of type arguments.
18782 * 18106 *
18783 * @param leftBracket the left bracket 18107 * @param leftBracket the left bracket
18784 * @param arguments the type arguments associated with the type 18108 * @param arguments the type arguments associated with the type
18785 * @param rightBracket the right bracket 18109 * @param rightBracket the right bracket
18786 */ 18110 */
18787 TypeArgumentList(this.leftBracket, List<TypeName> arguments, this.rightBracket ) { 18111 TypeArgumentList(this.leftBracket, List<TypeName> arguments, this.rightBracket ) {
18788 this._arguments = new NodeList<TypeName>(this); 18112 _arguments = new NodeList<TypeName>(this, arguments);
18789 this._arguments.addAll(arguments);
18790 } 18113 }
18791 18114
18792 @override 18115 @override
18793 accept(AstVisitor visitor) => visitor.visitTypeArgumentList(this); 18116 accept(AstVisitor visitor) => visitor.visitTypeArgumentList(this);
18794 18117
18795 /** 18118 /**
18796 * Return the type arguments associated with the type. 18119 * Return the type arguments associated with the type.
18797 * 18120 *
18798 * @return the type arguments associated with the type 18121 * @return the type arguments associated with the type
18799 */ 18122 */
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
18837 DartType type; 18160 DartType type;
18838 18161
18839 /** 18162 /**
18840 * Initialize a newly created type name. 18163 * Initialize a newly created type name.
18841 * 18164 *
18842 * @param name the name of the type 18165 * @param name the name of the type
18843 * @param typeArguments the type arguments associated with the type, or `null` if there are 18166 * @param typeArguments the type arguments associated with the type, or `null` if there are
18844 * no type arguments 18167 * no type arguments
18845 */ 18168 */
18846 TypeName(Identifier name, TypeArgumentList typeArguments) { 18169 TypeName(Identifier name, TypeArgumentList typeArguments) {
18847 this._name = becomeParentOf(name); 18170 _name = becomeParentOf(name);
18848 this._typeArguments = becomeParentOf(typeArguments); 18171 _typeArguments = becomeParentOf(typeArguments);
18849 } 18172 }
18850 18173
18851 @override 18174 @override
18852 accept(AstVisitor visitor) => visitor.visitTypeName(this); 18175 accept(AstVisitor visitor) => visitor.visitTypeName(this);
18853 18176
18854 @override 18177 @override
18855 Token get beginToken => _name.beginToken; 18178 Token get beginToken => _name.beginToken;
18856 18179
18857 @override 18180 @override
18858 Token get endToken { 18181 Token get endToken {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
18904 void set name(Identifier identifier) { 18227 void set name(Identifier identifier) {
18905 _name = becomeParentOf(identifier); 18228 _name = becomeParentOf(identifier);
18906 } 18229 }
18907 18230
18908 /** 18231 /**
18909 * Set the type arguments associated with the type to the given type arguments . 18232 * Set the type arguments associated with the type to the given type arguments .
18910 * 18233 *
18911 * @param typeArguments the type arguments associated with the type 18234 * @param typeArguments the type arguments associated with the type
18912 */ 18235 */
18913 void set typeArguments(TypeArgumentList typeArguments) { 18236 void set typeArguments(TypeArgumentList typeArguments) {
18914 this._typeArguments = becomeParentOf(typeArguments); 18237 _typeArguments = becomeParentOf(typeArguments);
18915 } 18238 }
18916 18239
18917 @override 18240 @override
18918 void visitChildren(AstVisitor visitor) { 18241 void visitChildren(AstVisitor visitor) {
18919 safelyVisitChild(_name, visitor); 18242 safelyVisitChild(_name, visitor);
18920 safelyVisitChild(_typeArguments, visitor); 18243 safelyVisitChild(_typeArguments, visitor);
18921 } 18244 }
18922 } 18245 }
18923 18246
18924 /** 18247 /**
(...skipping 25 matching lines...) Expand all
18950 /** 18273 /**
18951 * Initialize a newly created type parameter. 18274 * Initialize a newly created type parameter.
18952 * 18275 *
18953 * @param comment the documentation comment associated with the type parameter 18276 * @param comment the documentation comment associated with the type parameter
18954 * @param metadata the annotations associated with the type parameter 18277 * @param metadata the annotations associated with the type parameter
18955 * @param name the name of the type parameter 18278 * @param name the name of the type parameter
18956 * @param keyword the token representing the 'extends' keyword 18279 * @param keyword the token representing the 'extends' keyword
18957 * @param bound the name of the upper bound for legal arguments 18280 * @param bound the name of the upper bound for legal arguments
18958 */ 18281 */
18959 TypeParameter(Comment comment, List<Annotation> metadata, SimpleIdentifier nam e, this.keyword, TypeName bound) : super(comment, metadata) { 18282 TypeParameter(Comment comment, List<Annotation> metadata, SimpleIdentifier nam e, this.keyword, TypeName bound) : super(comment, metadata) {
18960 this._name = becomeParentOf(name); 18283 _name = becomeParentOf(name);
18961 this._bound = becomeParentOf(bound); 18284 _bound = becomeParentOf(bound);
18962 } 18285 }
18963 18286
18964 @override 18287 @override
18965 accept(AstVisitor visitor) => visitor.visitTypeParameter(this); 18288 accept(AstVisitor visitor) => visitor.visitTypeParameter(this);
18966 18289
18967 /** 18290 /**
18968 * Return the name of the upper bound for legal arguments, or `null` if there was no 18291 * Return the name of the upper bound for legal arguments, or `null` if there was no
18969 * explicit upper bound. 18292 * explicit upper bound.
18970 * 18293 *
18971 * @return the name of the upper bound for legal arguments 18294 * @return the name of the upper bound for legal arguments
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
19044 final Token rightBracket; 18367 final Token rightBracket;
19045 18368
19046 /** 18369 /**
19047 * Initialize a newly created list of type parameters. 18370 * Initialize a newly created list of type parameters.
19048 * 18371 *
19049 * @param leftBracket the left angle bracket 18372 * @param leftBracket the left angle bracket
19050 * @param typeParameters the type parameters in the list 18373 * @param typeParameters the type parameters in the list
19051 * @param rightBracket the right angle bracket 18374 * @param rightBracket the right angle bracket
19052 */ 18375 */
19053 TypeParameterList(this.leftBracket, List<TypeParameter> typeParameters, this.r ightBracket) { 18376 TypeParameterList(this.leftBracket, List<TypeParameter> typeParameters, this.r ightBracket) {
19054 this._typeParameters = new NodeList<TypeParameter>(this); 18377 _typeParameters = new NodeList<TypeParameter>(this, typeParameters);
19055 this._typeParameters.addAll(typeParameters);
19056 } 18378 }
19057 18379
19058 @override 18380 @override
19059 accept(AstVisitor visitor) => visitor.visitTypeParameterList(this); 18381 accept(AstVisitor visitor) => visitor.visitTypeParameterList(this);
19060 18382
19061 @override 18383 @override
19062 Token get beginToken => leftBracket; 18384 Token get beginToken => leftBracket;
19063 18385
19064 @override 18386 @override
19065 Token get endToken => rightBracket; 18387 Token get endToken => rightBracket;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
19100 TypeArgumentList _typeArguments; 18422 TypeArgumentList _typeArguments;
19101 18423
19102 /** 18424 /**
19103 * Initialize a newly created typed literal. 18425 * Initialize a newly created typed literal.
19104 * 18426 *
19105 * @param constKeyword the token representing the 'const' keyword 18427 * @param constKeyword the token representing the 'const' keyword
19106 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 18428 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
19107 * arguments were declared 18429 * arguments were declared
19108 */ 18430 */
19109 TypedLiteral(this.constKeyword, TypeArgumentList typeArguments) { 18431 TypedLiteral(this.constKeyword, TypeArgumentList typeArguments) {
19110 this._typeArguments = becomeParentOf(typeArguments); 18432 _typeArguments = becomeParentOf(typeArguments);
19111 } 18433 }
19112 18434
19113 /** 18435 /**
19114 * Return the type argument associated with this literal, or `null` if no type arguments 18436 * Return the type argument associated with this literal, or `null` if no type arguments
19115 * were declared. 18437 * were declared.
19116 * 18438 *
19117 * @return the type argument associated with this literal 18439 * @return the type argument associated with this literal
19118 */ 18440 */
19119 TypeArgumentList get typeArguments => _typeArguments; 18441 TypeArgumentList get typeArguments => _typeArguments;
19120 18442
19121 /** 18443 /**
19122 * Set the type argument associated with this literal to the given arguments. 18444 * Set the type argument associated with this literal to the given arguments.
19123 * 18445 *
19124 * @param typeArguments the type argument associated with this literal 18446 * @param typeArguments the type argument associated with this literal
19125 */ 18447 */
19126 void set typeArguments(TypeArgumentList typeArguments) { 18448 void set typeArguments(TypeArgumentList typeArguments) {
19127 this._typeArguments = becomeParentOf(typeArguments); 18449 _typeArguments = becomeParentOf(typeArguments);
19128 } 18450 }
19129 18451
19130 @override 18452 @override
19131 void visitChildren(AstVisitor visitor) { 18453 void visitChildren(AstVisitor visitor) {
19132 safelyVisitChild(_typeArguments, visitor); 18454 safelyVisitChild(_typeArguments, visitor);
19133 } 18455 }
19134 } 18456 }
19135 18457
19136 /** 18458 /**
19137 * Instances of the class `UnifyingAstVisitor` implement an AST visitor that wil l recursively 18459 * Instances of the class `UnifyingAstVisitor` implement an AST visitor that wil l recursively
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
19501 Source source; 18823 Source source;
19502 18824
19503 /** 18825 /**
19504 * Initialize a newly create URI-based directive. 18826 * Initialize a newly create URI-based directive.
19505 * 18827 *
19506 * @param comment the documentation comment associated with this directive 18828 * @param comment the documentation comment associated with this directive
19507 * @param metadata the annotations associated with the directive 18829 * @param metadata the annotations associated with the directive
19508 * @param uri the URI referenced by this directive 18830 * @param uri the URI referenced by this directive
19509 */ 18831 */
19510 UriBasedDirective(Comment comment, List<Annotation> metadata, StringLiteral ur i) : super(comment, metadata) { 18832 UriBasedDirective(Comment comment, List<Annotation> metadata, StringLiteral ur i) : super(comment, metadata) {
19511 this._uri = becomeParentOf(uri); 18833 _uri = becomeParentOf(uri);
19512 } 18834 }
19513 18835
19514 /** 18836 /**
19515 * Return the URI referenced by this directive. 18837 * Return the URI referenced by this directive.
19516 * 18838 *
19517 * @return the URI referenced by this directive 18839 * @return the URI referenced by this directive
19518 */ 18840 */
19519 StringLiteral get uri => _uri; 18841 StringLiteral get uri => _uri;
19520 18842
19521 /** 18843 /**
19522 * Return the element associated with the URI of this directive, or `null` if the AST 18844 * Return the element associated with the URI of this directive, or `null` if the AST
19523 * structure has not been resolved or if the URI could not be resolved. Exampl es of the latter 18845 * structure has not been resolved or if the URI could not be resolved. Exampl es of the latter
19524 * case include a directive that contains an invalid URL or a URL that does no t exist. 18846 * case include a directive that contains an invalid URL or a URL that does no t exist.
19525 * 18847 *
19526 * @return the element associated with this directive 18848 * @return the element associated with this directive
19527 */ 18849 */
19528 Element get uriElement; 18850 Element get uriElement;
19529 18851
19530 /** 18852 /**
19531 * Set the URI referenced by this directive to the given URI. 18853 * Set the URI referenced by this directive to the given URI.
19532 * 18854 *
19533 * @param uri the URI referenced by this directive 18855 * @param uri the URI referenced by this directive
19534 */ 18856 */
19535 void set uri(StringLiteral uri) { 18857 void set uri(StringLiteral uri) {
19536 this._uri = becomeParentOf(uri); 18858 _uri = becomeParentOf(uri);
19537 } 18859 }
19538 18860
19539 /** 18861 /**
19540 * Validate the given directive, but do not check for existence. 18862 * Validate the given directive, but do not check for existence.
19541 * 18863 *
19542 * @return a code indicating the problem if there is one, or `null` no problem 18864 * @return a code indicating the problem if there is one, or `null` no problem
19543 */ 18865 */
19544 UriValidationCode validate() { 18866 UriValidationCode validate() {
19545 StringLiteral uriLiteral = uri; 18867 StringLiteral uriLiteral = uri;
19546 if (uriLiteral is StringInterpolation) { 18868 if (uriLiteral is StringInterpolation) {
(...skipping 17 matching lines...) Expand all
19564 @override 18886 @override
19565 void visitChildren(AstVisitor visitor) { 18887 void visitChildren(AstVisitor visitor) {
19566 super.visitChildren(visitor); 18888 super.visitChildren(visitor);
19567 safelyVisitChild(_uri, visitor); 18889 safelyVisitChild(_uri, visitor);
19568 } 18890 }
19569 } 18891 }
19570 18892
19571 /** 18893 /**
19572 * Validation codes returned by [UriBasedDirective.validate]. 18894 * Validation codes returned by [UriBasedDirective.validate].
19573 */ 18895 */
19574 class UriValidationCode extends Enum<UriValidationCode> { 18896 class UriValidationCode {
19575 static const UriValidationCode INVALID_URI = const UriValidationCode('INVALID_ URI', 0); 18897 /**
18898 * The name of the validation code.
18899 */
18900 final String name;
19576 18901
19577 static const UriValidationCode URI_WITH_INTERPOLATION = const UriValidationCod e('URI_WITH_INTERPOLATION', 1); 18902 static const UriValidationCode INVALID_URI = const UriValidationCode('INVALID_ URI');
19578 18903
19579 static const UriValidationCode URI_WITH_DART_EXT_SCHEME = const UriValidationC ode('URI_WITH_DART_EXT_SCHEME', 2); 18904 static const UriValidationCode URI_WITH_INTERPOLATION = const UriValidationCod e('URI_WITH_INTERPOLATION');
19580 18905
19581 static const List<UriValidationCode> values = const [ 18906 static const UriValidationCode URI_WITH_DART_EXT_SCHEME = const UriValidationC ode('URI_WITH_DART_EXT_SCHEME');
19582 INVALID_URI,
19583 URI_WITH_INTERPOLATION,
19584 URI_WITH_DART_EXT_SCHEME];
19585 18907
19586 const UriValidationCode(String name, int ordinal) : super(name, ordinal); 18908 /**
18909 * Initialize a newly created validation code to have the given [name].
18910 */
18911 const UriValidationCode(this.name);
18912
18913 @override
18914 String toString() => name;
19587 } 18915 }
19588 18916
19589 /** 18917 /**
19590 * Instances of the class `VariableDeclaration` represent an identifier that has an initial 18918 * Instances of the class `VariableDeclaration` represent an identifier that has an initial
19591 * value associated with it. Instances of this class are always children of the class 18919 * value associated with it. Instances of this class are always children of the class
19592 * [VariableDeclarationList]. 18920 * [VariableDeclarationList].
19593 * 18921 *
19594 * <pre> 18922 * <pre>
19595 * variableDeclaration ::= 18923 * variableDeclaration ::=
19596 * [SimpleIdentifier] ('=' [Expression])? 18924 * [SimpleIdentifier] ('=' [Expression])?
(...skipping 20 matching lines...) Expand all
19617 /** 18945 /**
19618 * Initialize a newly created variable declaration. 18946 * Initialize a newly created variable declaration.
19619 * 18947 *
19620 * @param comment the documentation comment associated with this declaration 18948 * @param comment the documentation comment associated with this declaration
19621 * @param metadata the annotations associated with this member 18949 * @param metadata the annotations associated with this member
19622 * @param name the name of the variable being declared 18950 * @param name the name of the variable being declared
19623 * @param equals the equal sign separating the variable name from the initial value 18951 * @param equals the equal sign separating the variable name from the initial value
19624 * @param initializer the expression used to compute the initial value for the variable 18952 * @param initializer the expression used to compute the initial value for the variable
19625 */ 18953 */
19626 VariableDeclaration(Comment comment, List<Annotation> metadata, SimpleIdentifi er name, this.equals, Expression initializer) : super(comment, metadata) { 18954 VariableDeclaration(Comment comment, List<Annotation> metadata, SimpleIdentifi er name, this.equals, Expression initializer) : super(comment, metadata) {
19627 this._name = becomeParentOf(name); 18955 _name = becomeParentOf(name);
19628 this._initializer = becomeParentOf(initializer); 18956 _initializer = becomeParentOf(initializer);
19629 } 18957 }
19630 18958
19631 @override 18959 @override
19632 accept(AstVisitor visitor) => visitor.visitVariableDeclaration(this); 18960 accept(AstVisitor visitor) => visitor.visitVariableDeclaration(this);
19633 18961
19634 /** 18962 /**
19635 * This overridden implementation of getDocumentationComment() looks in the gr andparent node for 18963 * This overridden implementation of getDocumentationComment() looks in the gr andparent node for
19636 * dartdoc comments if no documentation is specifically available on the node. 18964 * dartdoc comments if no documentation is specifically available on the node.
19637 */ 18965 */
19638 @override 18966 @override
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
19696 AstNode parent = this.parent; 19024 AstNode parent = this.parent;
19697 return parent is VariableDeclarationList && parent.isFinal; 19025 return parent is VariableDeclarationList && parent.isFinal;
19698 } 19026 }
19699 19027
19700 /** 19028 /**
19701 * Set the expression used to compute the initial value for the variable to th e given expression. 19029 * Set the expression used to compute the initial value for the variable to th e given expression.
19702 * 19030 *
19703 * @param initializer the expression used to compute the initial value for the variable 19031 * @param initializer the expression used to compute the initial value for the variable
19704 */ 19032 */
19705 void set initializer(Expression initializer) { 19033 void set initializer(Expression initializer) {
19706 this._initializer = becomeParentOf(initializer); 19034 _initializer = becomeParentOf(initializer);
19707 } 19035 }
19708 19036
19709 /** 19037 /**
19710 * Set the name of the variable being declared to the given identifier. 19038 * Set the name of the variable being declared to the given identifier.
19711 * 19039 *
19712 * @param name the name of the variable being declared 19040 * @param name the name of the variable being declared
19713 */ 19041 */
19714 void set name(SimpleIdentifier name) { 19042 void set name(SimpleIdentifier name) {
19715 this._name = becomeParentOf(name); 19043 _name = becomeParentOf(name);
19716 } 19044 }
19717 19045
19718 @override 19046 @override
19719 void visitChildren(AstVisitor visitor) { 19047 void visitChildren(AstVisitor visitor) {
19720 super.visitChildren(visitor); 19048 super.visitChildren(visitor);
19721 safelyVisitChild(_name, visitor); 19049 safelyVisitChild(_name, visitor);
19722 safelyVisitChild(_initializer, visitor); 19050 safelyVisitChild(_initializer, visitor);
19723 } 19051 }
19724 19052
19725 @override 19053 @override
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
19761 /** 19089 /**
19762 * Initialize a newly created variable declaration list. 19090 * Initialize a newly created variable declaration list.
19763 * 19091 *
19764 * @param comment the documentation comment associated with this declaration l ist 19092 * @param comment the documentation comment associated with this declaration l ist
19765 * @param metadata the annotations associated with this declaration list 19093 * @param metadata the annotations associated with this declaration list
19766 * @param keyword the token representing the 'final', 'const' or 'var' keyword 19094 * @param keyword the token representing the 'final', 'const' or 'var' keyword
19767 * @param type the type of the variables being declared 19095 * @param type the type of the variables being declared
19768 * @param variables a list containing the individual variables being declared 19096 * @param variables a list containing the individual variables being declared
19769 */ 19097 */
19770 VariableDeclarationList(Comment comment, List<Annotation> metadata, this.keywo rd, TypeName type, List<VariableDeclaration> variables) : super(comment, metadat a) { 19098 VariableDeclarationList(Comment comment, List<Annotation> metadata, this.keywo rd, TypeName type, List<VariableDeclaration> variables) : super(comment, metadat a) {
19771 this._variables = new NodeList<VariableDeclaration>(this); 19099 _type = becomeParentOf(type);
19772 this._type = becomeParentOf(type); 19100 _variables = new NodeList<VariableDeclaration>(this, variables);
19773 this._variables.addAll(variables);
19774 } 19101 }
19775 19102
19776 @override 19103 @override
19777 accept(AstVisitor visitor) => visitor.visitVariableDeclarationList(this); 19104 accept(AstVisitor visitor) => visitor.visitVariableDeclarationList(this);
19778 19105
19779 @override 19106 @override
19780 Token get endToken => _variables.endToken; 19107 Token get endToken => _variables.endToken;
19781 19108
19782 /** 19109 /**
19783 * Return the type of the variables being declared, or `null` if no type was p rovided. 19110 * Return the type of the variables being declared, or `null` if no type was p rovided.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
19856 */ 19183 */
19857 Token semicolon; 19184 Token semicolon;
19858 19185
19859 /** 19186 /**
19860 * Initialize a newly created variable declaration statement. 19187 * Initialize a newly created variable declaration statement.
19861 * 19188 *
19862 * @param variableList the fields being declared 19189 * @param variableList the fields being declared
19863 * @param semicolon the semicolon terminating the statement 19190 * @param semicolon the semicolon terminating the statement
19864 */ 19191 */
19865 VariableDeclarationStatement(VariableDeclarationList variableList, this.semico lon) { 19192 VariableDeclarationStatement(VariableDeclarationList variableList, this.semico lon) {
19866 this._variableList = becomeParentOf(variableList); 19193 _variableList = becomeParentOf(variableList);
19867 } 19194 }
19868 19195
19869 @override 19196 @override
19870 accept(AstVisitor visitor) => visitor.visitVariableDeclarationStatement(this); 19197 accept(AstVisitor visitor) => visitor.visitVariableDeclarationStatement(this);
19871 19198
19872 @override 19199 @override
19873 Token get beginToken => _variableList.beginToken; 19200 Token get beginToken => _variableList.beginToken;
19874 19201
19875 @override 19202 @override
19876 Token get endToken => semicolon; 19203 Token get endToken => semicolon;
19877 19204
19878 /** 19205 /**
19879 * Return the variables being declared. 19206 * Return the variables being declared.
19880 * 19207 *
19881 * @return the variables being declared 19208 * @return the variables being declared
19882 */ 19209 */
19883 VariableDeclarationList get variables => _variableList; 19210 VariableDeclarationList get variables => _variableList;
19884 19211
19885 /** 19212 /**
19886 * Set the variables being declared to the given list of variables. 19213 * Set the variables being declared to the given list of variables.
19887 * 19214 *
19888 * @param variableList the variables being declared 19215 * @param variableList the variables being declared
19889 */ 19216 */
19890 void set variables(VariableDeclarationList variableList) { 19217 void set variables(VariableDeclarationList variableList) {
19891 this._variableList = becomeParentOf(variableList); 19218 _variableList = becomeParentOf(variableList);
19892 } 19219 }
19893 19220
19894 @override 19221 @override
19895 void visitChildren(AstVisitor visitor) { 19222 void visitChildren(AstVisitor visitor) {
19896 safelyVisitChild(_variableList, visitor); 19223 safelyVisitChild(_variableList, visitor);
19897 } 19224 }
19898 } 19225 }
19899 19226
19900 /** 19227 /**
19901 * Instances of the class `WhileStatement` represent a while statement. 19228 * Instances of the class `WhileStatement` represent a while statement.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
19934 /** 19261 /**
19935 * Initialize a newly created while statement. 19262 * Initialize a newly created while statement.
19936 * 19263 *
19937 * @param keyword the token representing the 'while' keyword 19264 * @param keyword the token representing the 'while' keyword
19938 * @param leftParenthesis the left parenthesis 19265 * @param leftParenthesis the left parenthesis
19939 * @param condition the expression used to determine whether to execute the bo dy of the loop 19266 * @param condition the expression used to determine whether to execute the bo dy of the loop
19940 * @param rightParenthesis the right parenthesis 19267 * @param rightParenthesis the right parenthesis
19941 * @param body the body of the loop 19268 * @param body the body of the loop
19942 */ 19269 */
19943 WhileStatement(this.keyword, this.leftParenthesis, Expression condition, this. rightParenthesis, Statement body) { 19270 WhileStatement(this.keyword, this.leftParenthesis, Expression condition, this. rightParenthesis, Statement body) {
19944 this._condition = becomeParentOf(condition); 19271 _condition = becomeParentOf(condition);
19945 this._body = becomeParentOf(body); 19272 _body = becomeParentOf(body);
19946 } 19273 }
19947 19274
19948 @override 19275 @override
19949 accept(AstVisitor visitor) => visitor.visitWhileStatement(this); 19276 accept(AstVisitor visitor) => visitor.visitWhileStatement(this);
19950 19277
19951 @override 19278 @override
19952 Token get beginToken => keyword; 19279 Token get beginToken => keyword;
19953 19280
19954 /** 19281 /**
19955 * Return the body of the loop. 19282 * Return the body of the loop.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
19999 * 19326 *
20000 * <pre> 19327 * <pre>
20001 * withClause ::= 19328 * withClause ::=
20002 * 'with' [TypeName] (',' [TypeName])* 19329 * 'with' [TypeName] (',' [TypeName])*
20003 * </pre> 19330 * </pre>
20004 */ 19331 */
20005 class WithClause extends AstNode { 19332 class WithClause extends AstNode {
20006 /** 19333 /**
20007 * The token representing the 'with' keyword. 19334 * The token representing the 'with' keyword.
20008 */ 19335 */
20009 Token _withKeyword; 19336 Token withKeyword;
20010 19337
20011 /** 19338 /**
20012 * The names of the mixins that were specified. 19339 * The names of the mixins that were specified.
20013 */ 19340 */
20014 NodeList<TypeName> _mixinTypes; 19341 NodeList<TypeName> _mixinTypes;
20015 19342
20016 /** 19343 /**
20017 * Initialize a newly created with clause. 19344 * Initialize a newly created with clause.
20018 * 19345 *
20019 * @param withKeyword the token representing the 'with' keyword 19346 * @param withKeyword the token representing the 'with' keyword
20020 * @param mixinTypes the names of the mixins that were specified 19347 * @param mixinTypes the names of the mixins that were specified
20021 */ 19348 */
20022 WithClause(Token withKeyword, List<TypeName> mixinTypes) { 19349 WithClause(this.withKeyword, List<TypeName> mixinTypes) {
20023 this._mixinTypes = new NodeList<TypeName>(this); 19350 _mixinTypes = new NodeList<TypeName>(this, mixinTypes);
20024 this._withKeyword = withKeyword;
20025 this._mixinTypes.addAll(mixinTypes);
20026 } 19351 }
20027 19352
20028 @override 19353 @override
20029 accept(AstVisitor visitor) => visitor.visitWithClause(this); 19354 accept(AstVisitor visitor) => visitor.visitWithClause(this);
20030 19355
20031 @override 19356 @override
20032 Token get beginToken => _withKeyword; 19357 Token get beginToken => withKeyword;
20033 19358
20034 @override 19359 @override
20035 Token get endToken => _mixinTypes.endToken; 19360 Token get endToken => _mixinTypes.endToken;
20036 19361
20037 /** 19362 /**
20038 * Return the names of the mixins that were specified. 19363 * Return the names of the mixins that were specified.
20039 * 19364 *
20040 * @return the names of the mixins that were specified 19365 * @return the names of the mixins that were specified
20041 */ 19366 */
20042 NodeList<TypeName> get mixinTypes => _mixinTypes; 19367 NodeList<TypeName> get mixinTypes => _mixinTypes;
20043 19368
20044 /** 19369 /**
20045 * Return the token representing the 'with' keyword.
20046 *
20047 * @return the token representing the 'with' keyword
20048 */
20049 Token get withKeyword => _withKeyword;
20050
20051 /**
20052 * Set the token representing the 'with' keyword to the given token. 19370 * Set the token representing the 'with' keyword to the given token.
20053 * 19371 *
20054 * @param withKeyword the token representing the 'with' keyword 19372 * @param withKeyword the token representing the 'with' keyword
20055 */ 19373 */
19374 @deprecated
20056 void set mixinKeyword(Token withKeyword) { 19375 void set mixinKeyword(Token withKeyword) {
20057 this._withKeyword = withKeyword; 19376 this.withKeyword = withKeyword;
20058 } 19377 }
20059 19378
20060 @override 19379 @override
20061 void visitChildren(AstVisitor visitor) { 19380 void visitChildren(AstVisitor visitor) {
20062 _mixinTypes.accept(visitor); 19381 _mixinTypes.accept(visitor);
20063 } 19382 }
20064 } 19383 }
20065 19384
20066 /** 19385 /**
20067 * Instances of the class `YieldStatement` implement a yield statement. 19386 * Instances of the class `YieldStatement` implement a yield statement.
(...skipping 21 matching lines...) Expand all
20089 19408
20090 /** 19409 /**
20091 * Initialize a newly created yield expression. 19410 * Initialize a newly created yield expression.
20092 * 19411 *
20093 * @param yieldKeyword the 'yield' keyword 19412 * @param yieldKeyword the 'yield' keyword
20094 * @param star the star following the 'yield' keyword 19413 * @param star the star following the 'yield' keyword
20095 * @param expression the expression whose value will be yielded 19414 * @param expression the expression whose value will be yielded
20096 * @param semicolon the semicolon following the expression 19415 * @param semicolon the semicolon following the expression
20097 */ 19416 */
20098 YieldStatement(this.yieldKeyword, this.star, Expression expression, this.semic olon) { 19417 YieldStatement(this.yieldKeyword, this.star, Expression expression, this.semic olon) {
20099 this._expression = becomeParentOf(expression); 19418 _expression = becomeParentOf(expression);
20100 } 19419 }
20101 19420
20102 @override 19421 @override
20103 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); 19422 accept(AstVisitor visitor) => visitor.visitYieldStatement(this);
20104 19423
20105 @override 19424 @override
20106 Token get beginToken { 19425 Token get beginToken {
20107 if (yieldKeyword != null) { 19426 if (yieldKeyword != null) {
20108 return yieldKeyword; 19427 return yieldKeyword;
20109 } 19428 }
(...skipping 14 matching lines...) Expand all
20124 * @return the expression whose value will be yielded 19443 * @return the expression whose value will be yielded
20125 */ 19444 */
20126 Expression get expression => _expression; 19445 Expression get expression => _expression;
20127 19446
20128 /** 19447 /**
20129 * Set the expression whose value will be yielded to the given expression. 19448 * Set the expression whose value will be yielded to the given expression.
20130 * 19449 *
20131 * @param expression the expression whose value will be yielded 19450 * @param expression the expression whose value will be yielded
20132 */ 19451 */
20133 void set expression(Expression expression) { 19452 void set expression(Expression expression) {
20134 this._expression = becomeParentOf(expression); 19453 _expression = becomeParentOf(expression);
20135 } 19454 }
20136 19455
20137 @override 19456 @override
20138 void visitChildren(AstVisitor visitor) { 19457 void visitChildren(AstVisitor visitor) {
20139 safelyVisitChild(_expression, visitor); 19458 safelyVisitChild(_expression, visitor);
20140 } 19459 }
20141 } 19460 }
19461
20142 /** 19462 /**
20143 * Instances of the class {@code NodeList} represent a list of AST nodes that ha ve a common parent. 19463 * Instances of the class `NodeList` represent a list of AST nodes that have a
19464 * common parent.
20144 */ 19465 */
20145 class NodeList<E extends AstNode> extends Object with ListMixin<E> { 19466 class NodeList<E extends AstNode> extends Object with ListMixin<E> {
20146 /** 19467 /**
20147 * Create an empty list with the given owner. This is a convenience method tha t allows the 19468 * Create an empty list with the given [owner].
20148 * compiler to determine the correct value of the type argument [E] without ne eding to
20149 * explicitly specify it.
20150 * 19469 *
20151 * @param owner the node that is the parent of each of the elements in the lis t 19470 * Use "new NodeList<E>(owner)"
20152 * @return the list that was created
20153 */ 19471 */
19472 @deprecated
20154 static NodeList create(AstNode owner) => new NodeList(owner); 19473 static NodeList create(AstNode owner) => new NodeList(owner);
20155 19474
20156 /** 19475 /**
20157 * The node that is the parent of each of the elements in the list. 19476 * The node that is the parent of each of the elements in the list.
20158 */ 19477 */
20159 AstNode owner; 19478 AstNode owner;
20160 19479
20161 /** 19480 /**
20162 * The elements contained in the list. 19481 * The elements contained in the list.
20163 */ 19482 */
20164 List<E> _elements = <E>[]; 19483 List<E> _elements = <E>[];
20165 19484
20166 /** 19485 /**
20167 * Initialize a newly created list of nodes to be empty. 19486 * Initialize a newly created list of nodes such that all of the nodes that
20168 * 19487 * are added to the list will have their parent set to the given [owner]. The
20169 * @param owner the node that is the parent of each of the elements in the lis t 19488 * list will initially be populated with the given [elements].
20170 */ 19489 */
20171 NodeList(this.owner); 19490 NodeList(this.owner, [List<E> elements]) {
19491 addAll(elements);
19492 }
20172 19493
20173 /** 19494 /**
20174 * Use the given visitor to visit each of the nodes in this list. 19495 * Use the given [visitor] to visit each of the nodes in this list.
20175 *
20176 * @param visitor the visitor to be used to visit the elements of this list
20177 */ 19496 */
20178 accept(AstVisitor visitor) { 19497 accept(AstVisitor visitor) {
20179 var length = _elements.length; 19498 int length = _elements.length;
20180 for (var i = 0; i < length; i++) { 19499 for (var i = 0; i < length; i++) {
20181 _elements[i].accept(visitor); 19500 _elements[i].accept(visitor);
20182 } 19501 }
20183 } 19502 }
19503
19504 @override
20184 void add(E node) { 19505 void add(E node) {
20185 insert(length, node); 19506 insert(length, node);
20186 } 19507 }
19508
19509 @override
20187 void insert(int index, E node) { 19510 void insert(int index, E node) {
20188 int length = _elements.length; 19511 int length = _elements.length;
20189 if (index < 0 || index > length) { 19512 if (index < 0 || index > length) {
20190 throw new RangeError("Index: $index, Size: ${_elements.length}"); 19513 throw new RangeError("Index: $index, Size: ${_elements.length}");
20191 } 19514 }
20192 owner.becomeParentOf(node); 19515 owner.becomeParentOf(node);
20193 if (length == 0) { 19516 if (length == 0) {
20194 _elements = <E> [node]; 19517 _elements.add(node);
20195 } else { 19518 } else {
20196 _elements.insert(index, node); 19519 _elements.insert(index, node);
20197 } 19520 }
20198 } 19521 }
19522
19523 @override
20199 bool addAll(Iterable<E> nodes) { 19524 bool addAll(Iterable<E> nodes) {
20200 if (nodes != null && !nodes.isEmpty) { 19525 if (nodes != null && !nodes.isEmpty) {
20201 _elements.addAll(nodes); 19526 _elements.addAll(nodes);
20202 for (E node in nodes) { 19527 for (E node in nodes) {
20203 owner.becomeParentOf(node); 19528 owner.becomeParentOf(node);
20204 } 19529 }
20205 return true; 19530 return true;
20206 } 19531 }
20207 return false; 19532 return false;
20208 } 19533 }
19534
20209 E operator[](int index) { 19535 E operator[](int index) {
20210 if (index < 0 || index >= _elements.length) { 19536 if (index < 0 || index >= _elements.length) {
20211 throw new RangeError("Index: $index, Size: ${_elements.length}"); 19537 throw new RangeError("Index: $index, Size: ${_elements.length}");
20212 } 19538 }
20213 return _elements[index] as E; 19539 return _elements[index];
20214 } 19540 }
20215 19541
20216 /** 19542 /**
20217 * Return the first token included in this node's source range. 19543 * Return the first token included in this node list's source range, or `null`
20218 * 19544 * if the list is empty.
20219 * @return the first token included in this node's source range
20220 */ 19545 */
20221 Token get beginToken { 19546 Token get beginToken {
20222 if (_elements.length == 0) { 19547 if (_elements.length == 0) {
20223 return null; 19548 return null;
20224 } 19549 }
20225 return _elements[0].beginToken; 19550 return _elements[0].beginToken;
20226 } 19551 }
20227 19552
20228 /** 19553 /**
20229 * Return the last token included in this node list's source range. 19554 * Return the last token included in this node list's source range, or `null`
20230 * 19555 * if the list is empty.
20231 * @return the last token included in this node list's source range
20232 */ 19556 */
20233 Token get endToken { 19557 Token get endToken {
20234 if (_elements.length == 0) { 19558 int length = _elements.length;
19559 if (length == 0) {
20235 return null; 19560 return null;
20236 } 19561 }
20237 return _elements[_elements.length - 1].endToken; 19562 return _elements[length - 1].endToken;
20238 } 19563 }
19564
19565 @override
20239 E removeAt(int index) { 19566 E removeAt(int index) {
20240 if (index < 0 || index >= _elements.length) { 19567 if (index < 0 || index >= _elements.length) {
20241 throw new RangeError("Index: $index, Size: ${_elements.length}"); 19568 throw new RangeError("Index: $index, Size: ${_elements.length}");
20242 } 19569 }
20243 E removedNode = _elements[index] as E; 19570 E removedNode = _elements[index];
20244 int length = _elements.length;
20245 if (length == 1) {
20246 _elements = AstNode.EMPTY_ARRAY;
20247 return removedNode;
20248 }
20249 _elements.removeAt(index); 19571 _elements.removeAt(index);
20250 return removedNode; 19572 return removedNode;
20251 } 19573 }
19574
20252 void operator[]=(int index, E node) { 19575 void operator[]=(int index, E node) {
20253 if (index < 0 || index >= _elements.length) { 19576 if (index < 0 || index >= _elements.length) {
20254 throw new RangeError("Index: $index, Size: ${_elements.length}"); 19577 throw new RangeError("Index: $index, Size: ${_elements.length}");
20255 } 19578 }
20256 owner.becomeParentOf(node); 19579 owner.becomeParentOf(node);
20257 _elements[index] = node; 19580 _elements[index] = node;
20258 } 19581 }
19582
19583 @override
20259 void clear() { 19584 void clear() {
20260 _elements = <E>[]; 19585 _elements = <E>[];
20261 } 19586 }
19587
20262 int get length => _elements.length; 19588 int get length => _elements.length;
19589
19590 @deprecated
20263 void set length(int value) { 19591 void set length(int value) {
20264 throw new UnsupportedError("Cannot resize NodeList."); 19592 throw new UnsupportedError("Cannot resize NodeList.");
20265 } 19593 }
20266 } 19594 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698