| OLD | NEW |
| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 * @param strings the strings that are implicitly concatenated | 44 * @param strings the strings that are implicitly concatenated |
| 45 */ | 45 */ |
| 46 AdjacentStrings(List<StringLiteral> strings) { | 46 AdjacentStrings(List<StringLiteral> strings) { |
| 47 _strings = new NodeList<StringLiteral>(this, strings); | 47 _strings = new NodeList<StringLiteral>(this, strings); |
| 48 } | 48 } |
| 49 | 49 |
| 50 @override | 50 @override |
| 51 Token get beginToken => _strings.beginToken; | 51 Token get beginToken => _strings.beginToken; |
| 52 | 52 |
| 53 @override | 53 @override |
| 54 Iterable get childEntities => new ChildEntities()..addAll(_strings); |
| 55 |
| 56 @override |
| 54 Token get endToken => _strings.endToken; | 57 Token get endToken => _strings.endToken; |
| 55 | 58 |
| 56 /** | 59 /** |
| 57 * Return the strings that are implicitly concatenated. | 60 * Return the strings that are implicitly concatenated. |
| 58 * | 61 * |
| 59 * @return the strings that are implicitly concatenated | 62 * @return the strings that are implicitly concatenated |
| 60 */ | 63 */ |
| 61 NodeList<StringLiteral> get strings => _strings; | 64 NodeList<StringLiteral> get strings => _strings; |
| 62 | 65 |
| 63 @override | 66 @override |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 * @return the comment and annotations associated with this node in the order
in which they | 172 * @return the comment and annotations associated with this node in the order
in which they |
| 170 * appeared in the original source | 173 * appeared in the original source |
| 171 */ | 174 */ |
| 172 List<AstNode> get sortedCommentAndAnnotations { | 175 List<AstNode> get sortedCommentAndAnnotations { |
| 173 return <AstNode>[] | 176 return <AstNode>[] |
| 174 ..add(_comment) | 177 ..add(_comment) |
| 175 ..addAll(_metadata) | 178 ..addAll(_metadata) |
| 176 ..sort(AstNode.LEXICAL_ORDER); | 179 ..sort(AstNode.LEXICAL_ORDER); |
| 177 } | 180 } |
| 178 | 181 |
| 182 ChildEntities get _childEntities { |
| 183 ChildEntities result = new ChildEntities(); |
| 184 if (_commentIsBeforeAnnotations()) { |
| 185 result |
| 186 ..add(_comment) |
| 187 ..addAll(_metadata); |
| 188 } else { |
| 189 result.addAll(sortedCommentAndAnnotations); |
| 190 } |
| 191 return result; |
| 192 } |
| 193 |
| 179 @override | 194 @override |
| 180 void visitChildren(AstVisitor visitor) { | 195 void visitChildren(AstVisitor visitor) { |
| 181 if (_commentIsBeforeAnnotations()) { | 196 if (_commentIsBeforeAnnotations()) { |
| 182 safelyVisitChild(_comment, visitor); | 197 safelyVisitChild(_comment, visitor); |
| 183 _metadata.accept(visitor); | 198 _metadata.accept(visitor); |
| 184 } else { | 199 } else { |
| 185 for (AstNode child in sortedCommentAndAnnotations) { | 200 for (AstNode child in sortedCommentAndAnnotations) { |
| 186 child.accept(visitor); | 201 child.accept(visitor); |
| 187 } | 202 } |
| 188 } | 203 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 * | 303 * |
| 289 * @param arguments the arguments to the constructor being invoked | 304 * @param arguments the arguments to the constructor being invoked |
| 290 */ | 305 */ |
| 291 void set arguments(ArgumentList arguments) { | 306 void set arguments(ArgumentList arguments) { |
| 292 _arguments = becomeParentOf(arguments); | 307 _arguments = becomeParentOf(arguments); |
| 293 } | 308 } |
| 294 | 309 |
| 295 @override | 310 @override |
| 296 Token get beginToken => atSign; | 311 Token get beginToken => atSign; |
| 297 | 312 |
| 313 @override |
| 314 Iterable get childEntities => new ChildEntities() |
| 315 ..add(atSign) |
| 316 ..add(_name) |
| 317 ..add(period) |
| 318 ..add(_constructorName) |
| 319 ..add(_arguments); |
| 320 |
| 298 /** | 321 /** |
| 299 * Return the name of the constructor being invoked, or `null` if this annotat
ion is not the | 322 * Return the name of the constructor being invoked, or `null` if this annotat
ion is not the |
| 300 * invocation of a named constructor. | 323 * invocation of a named constructor. |
| 301 * | 324 * |
| 302 * @return the name of the constructor being invoked | 325 * @return the name of the constructor being invoked |
| 303 */ | 326 */ |
| 304 SimpleIdentifier get constructorName => _constructorName; | 327 SimpleIdentifier get constructorName => _constructorName; |
| 305 | 328 |
| 306 /** | 329 /** |
| 307 * Set the name of the constructor being invoked to the given name. | 330 * Set the name of the constructor being invoked to the given name. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 * intermixed. | 463 * intermixed. |
| 441 * | 464 * |
| 442 * @return the expressions producing the values of the arguments | 465 * @return the expressions producing the values of the arguments |
| 443 */ | 466 */ |
| 444 NodeList<Expression> get arguments => _arguments; | 467 NodeList<Expression> get arguments => _arguments; |
| 445 | 468 |
| 446 @override | 469 @override |
| 447 Token get beginToken => leftParenthesis; | 470 Token get beginToken => leftParenthesis; |
| 448 | 471 |
| 449 /** | 472 /** |
| 473 * TODO(paulberry): Add commas. |
| 474 */ |
| 475 @override |
| 476 Iterable get childEntities => new ChildEntities() |
| 477 ..add(leftParenthesis) |
| 478 ..addAll(_arguments) |
| 479 ..add(rightParenthesis); |
| 480 |
| 481 /** |
| 450 * Set the parameter elements corresponding to each of the arguments in this l
ist to the given | 482 * Set the parameter elements corresponding to each of the arguments in this l
ist to the given |
| 451 * array of parameters. The array of parameters must be the same length as the
number of | 483 * array of parameters. The array of parameters must be the same length as the
number of |
| 452 * arguments, but can contain `null` entries if a given argument does not corr
espond to a | 484 * arguments, but can contain `null` entries if a given argument does not corr
espond to a |
| 453 * formal parameter. | 485 * formal parameter. |
| 454 * | 486 * |
| 455 * @param parameters the parameter elements corresponding to the arguments | 487 * @param parameters the parameter elements corresponding to the arguments |
| 456 */ | 488 */ |
| 457 void set | 489 void set |
| 458 correspondingPropagatedParameters(List<ParameterElement> parameters) { | 490 correspondingPropagatedParameters(List<ParameterElement> parameters) { |
| 459 if (parameters.length != _arguments.length) { | 491 if (parameters.length != _arguments.length) { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 */ | 610 */ |
| 579 AsExpression(Expression expression, this.asOperator, TypeName type) { | 611 AsExpression(Expression expression, this.asOperator, TypeName type) { |
| 580 _expression = becomeParentOf(expression); | 612 _expression = becomeParentOf(expression); |
| 581 _type = becomeParentOf(type); | 613 _type = becomeParentOf(type); |
| 582 } | 614 } |
| 583 | 615 |
| 584 @override | 616 @override |
| 585 Token get beginToken => _expression.beginToken; | 617 Token get beginToken => _expression.beginToken; |
| 586 | 618 |
| 587 @override | 619 @override |
| 620 Iterable get childEntities => new ChildEntities() |
| 621 ..add(_expression) |
| 622 ..add(asOperator) |
| 623 ..add(_type); |
| 624 |
| 625 @override |
| 588 Token get endToken => _type.endToken; | 626 Token get endToken => _type.endToken; |
| 589 | 627 |
| 590 /** | 628 /** |
| 591 * Return the expression used to compute the value being cast. | 629 * Return the expression used to compute the value being cast. |
| 592 * | 630 * |
| 593 * @return the expression used to compute the value being cast | 631 * @return the expression used to compute the value being cast |
| 594 */ | 632 */ |
| 595 Expression get expression => _expression; | 633 Expression get expression => _expression; |
| 596 | 634 |
| 597 /** | 635 /** |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 */ | 715 */ |
| 678 AssertStatement(this.keyword, this.leftParenthesis, Expression condition, | 716 AssertStatement(this.keyword, this.leftParenthesis, Expression condition, |
| 679 this.rightParenthesis, this.semicolon) { | 717 this.rightParenthesis, this.semicolon) { |
| 680 _condition = becomeParentOf(condition); | 718 _condition = becomeParentOf(condition); |
| 681 } | 719 } |
| 682 | 720 |
| 683 @override | 721 @override |
| 684 Token get beginToken => keyword; | 722 Token get beginToken => keyword; |
| 685 | 723 |
| 686 /** | 724 /** |
| 725 * TODO(paulberry): untested. |
| 726 */ |
| 727 @override |
| 728 Iterable get childEntities => new ChildEntities() |
| 729 ..add(keyword) |
| 730 ..add(leftParenthesis) |
| 731 ..add(_condition) |
| 732 ..add(rightParenthesis) |
| 733 ..add(semicolon); |
| 734 |
| 735 /** |
| 687 * Return the condition that is being asserted to be `true`. | 736 * Return the condition that is being asserted to be `true`. |
| 688 * | 737 * |
| 689 * @return the condition that is being asserted to be `true` | 738 * @return the condition that is being asserted to be `true` |
| 690 */ | 739 */ |
| 691 Expression get condition => _condition; | 740 Expression get condition => _condition; |
| 692 | 741 |
| 693 /** | 742 /** |
| 694 * Set the condition that is being asserted to be `true` to the given expressi
on. | 743 * Set the condition that is being asserted to be `true` to the given expressi
on. |
| 695 * | 744 * |
| 696 * @param the condition that is being asserted to be `true` | 745 * @param the condition that is being asserted to be `true` |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 */ | 839 */ |
| 791 MethodElement get bestElement { | 840 MethodElement get bestElement { |
| 792 MethodElement element = propagatedElement; | 841 MethodElement element = propagatedElement; |
| 793 if (element == null) { | 842 if (element == null) { |
| 794 element = staticElement; | 843 element = staticElement; |
| 795 } | 844 } |
| 796 return element; | 845 return element; |
| 797 } | 846 } |
| 798 | 847 |
| 799 @override | 848 @override |
| 849 Iterable get childEntities => new ChildEntities() |
| 850 ..add(_leftHandSide) |
| 851 ..add(operator) |
| 852 ..add(_rightHandSide); |
| 853 |
| 854 @override |
| 800 Token get endToken => _rightHandSide.endToken; | 855 Token get endToken => _rightHandSide.endToken; |
| 801 | 856 |
| 802 /** | 857 /** |
| 803 * Set the expression used to compute the left hand side to the given expressi
on. | 858 * Set the expression used to compute the left hand side to the given expressi
on. |
| 804 * | 859 * |
| 805 * @return the expression used to compute the left hand side | 860 * @return the expression used to compute the left hand side |
| 806 */ | 861 */ |
| 807 Expression get leftHandSide => _leftHandSide; | 862 Expression get leftHandSide => _leftHandSide; |
| 808 | 863 |
| 809 /** | 864 /** |
| (...skipping 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2946 Map<String, Object> _propertyMap; | 3001 Map<String, Object> _propertyMap; |
| 2947 | 3002 |
| 2948 /** | 3003 /** |
| 2949 * Return the first token included in this node's source range. | 3004 * Return the first token included in this node's source range. |
| 2950 * | 3005 * |
| 2951 * @return the first token included in this node's source range | 3006 * @return the first token included in this node's source range |
| 2952 */ | 3007 */ |
| 2953 Token get beginToken; | 3008 Token get beginToken; |
| 2954 | 3009 |
| 2955 /** | 3010 /** |
| 3011 * Iterate through all the entities (either AST nodes or tokens) which make |
| 3012 * up the contents of this node, including doc comments but excluding other |
| 3013 * comments. |
| 3014 */ |
| 3015 Iterable get childEntities; |
| 3016 |
| 3017 /** |
| 2956 * Return the offset of the character immediately following the last character
of this node's | 3018 * Return the offset of the character immediately following the last character
of this node's |
| 2957 * source range. This is equivalent to `node.getOffset() + node.getLength()`.
For a | 3019 * source range. This is equivalent to `node.getOffset() + node.getLength()`.
For a |
| 2958 * compilation unit this will be equal to the length of the unit's source. For
synthetic nodes | 3020 * compilation unit this will be equal to the length of the unit's source. For
synthetic nodes |
| 2959 * this will be equivalent to the node's offset (because the length is zero (0
) by definition). | 3021 * this will be equivalent to the node's offset (because the length is zero (0
) by definition). |
| 2960 * | 3022 * |
| 2961 * @return the offset of the character just past the node's source range | 3023 * @return the offset of the character just past the node's source range |
| 2962 */ | 3024 */ |
| 2963 int get end => offset + length; | 3025 int get end => offset + length; |
| 2964 | 3026 |
| 2965 /** | 3027 /** |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3396 | 3458 |
| 3397 @override | 3459 @override |
| 3398 Token get beginToken { | 3460 Token get beginToken { |
| 3399 if (awaitKeyword != null) { | 3461 if (awaitKeyword != null) { |
| 3400 return awaitKeyword; | 3462 return awaitKeyword; |
| 3401 } | 3463 } |
| 3402 return _expression.beginToken; | 3464 return _expression.beginToken; |
| 3403 } | 3465 } |
| 3404 | 3466 |
| 3405 @override | 3467 @override |
| 3468 Iterable get childEntities => new ChildEntities() |
| 3469 ..add(awaitKeyword) |
| 3470 ..add(_expression); |
| 3471 |
| 3472 @override |
| 3406 Token get endToken => _expression.endToken; | 3473 Token get endToken => _expression.endToken; |
| 3407 | 3474 |
| 3408 /** | 3475 /** |
| 3409 * Return the expression whose value is being waited on. | 3476 * Return the expression whose value is being waited on. |
| 3410 * | 3477 * |
| 3411 * @return the expression whose value is being waited on | 3478 * @return the expression whose value is being waited on |
| 3412 */ | 3479 */ |
| 3413 Expression get expression => _expression; | 3480 Expression get expression => _expression; |
| 3414 | 3481 |
| 3415 /** | 3482 /** |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3497 */ | 3564 */ |
| 3498 MethodElement get bestElement { | 3565 MethodElement get bestElement { |
| 3499 MethodElement element = propagatedElement; | 3566 MethodElement element = propagatedElement; |
| 3500 if (element == null) { | 3567 if (element == null) { |
| 3501 element = staticElement; | 3568 element = staticElement; |
| 3502 } | 3569 } |
| 3503 return element; | 3570 return element; |
| 3504 } | 3571 } |
| 3505 | 3572 |
| 3506 @override | 3573 @override |
| 3574 Iterable get childEntities => new ChildEntities() |
| 3575 ..add(_leftOperand) |
| 3576 ..add(operator) |
| 3577 ..add(_rightOperand); |
| 3578 |
| 3579 @override |
| 3507 Token get endToken => _rightOperand.endToken; | 3580 Token get endToken => _rightOperand.endToken; |
| 3508 | 3581 |
| 3509 /** | 3582 /** |
| 3510 * Return the expression used to compute the left operand. | 3583 * Return the expression used to compute the left operand. |
| 3511 * | 3584 * |
| 3512 * @return the expression used to compute the left operand | 3585 * @return the expression used to compute the left operand |
| 3513 */ | 3586 */ |
| 3514 Expression get leftOperand => _leftOperand; | 3587 Expression get leftOperand => _leftOperand; |
| 3515 | 3588 |
| 3516 /** | 3589 /** |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3625 * @param rightBracket the right curly bracket | 3698 * @param rightBracket the right curly bracket |
| 3626 */ | 3699 */ |
| 3627 Block(this.leftBracket, List<Statement> statements, this.rightBracket) { | 3700 Block(this.leftBracket, List<Statement> statements, this.rightBracket) { |
| 3628 _statements = new NodeList<Statement>(this, statements); | 3701 _statements = new NodeList<Statement>(this, statements); |
| 3629 } | 3702 } |
| 3630 | 3703 |
| 3631 @override | 3704 @override |
| 3632 Token get beginToken => leftBracket; | 3705 Token get beginToken => leftBracket; |
| 3633 | 3706 |
| 3634 @override | 3707 @override |
| 3708 Iterable get childEntities => new ChildEntities() |
| 3709 ..add(leftBracket) |
| 3710 ..addAll(_statements) |
| 3711 ..add(rightBracket); |
| 3712 |
| 3713 @override |
| 3635 Token get endToken => rightBracket; | 3714 Token get endToken => rightBracket; |
| 3636 | 3715 |
| 3637 /** | 3716 /** |
| 3638 * Return the statements contained in the block. | 3717 * Return the statements contained in the block. |
| 3639 * | 3718 * |
| 3640 * @return the statements contained in the block | 3719 * @return the statements contained in the block |
| 3641 */ | 3720 */ |
| 3642 NodeList<Statement> get statements => _statements; | 3721 NodeList<Statement> get statements => _statements; |
| 3643 | 3722 |
| 3644 @override | 3723 @override |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3700 /** | 3779 /** |
| 3701 * Set the block representing the body of the function to the given block. | 3780 * Set the block representing the body of the function to the given block. |
| 3702 * | 3781 * |
| 3703 * @param block the block representing the body of the function | 3782 * @param block the block representing the body of the function |
| 3704 */ | 3783 */ |
| 3705 void set block(Block block) { | 3784 void set block(Block block) { |
| 3706 _block = becomeParentOf(block); | 3785 _block = becomeParentOf(block); |
| 3707 } | 3786 } |
| 3708 | 3787 |
| 3709 @override | 3788 @override |
| 3789 Iterable get childEntities => new ChildEntities() |
| 3790 ..add(keyword) |
| 3791 ..add(star) |
| 3792 ..add(_block); |
| 3793 |
| 3794 @override |
| 3710 Token get endToken => _block.endToken; | 3795 Token get endToken => _block.endToken; |
| 3711 | 3796 |
| 3712 @override | 3797 @override |
| 3713 bool get isAsynchronous { | 3798 bool get isAsynchronous { |
| 3714 if (keyword == null) { | 3799 if (keyword == null) { |
| 3715 return false; | 3800 return false; |
| 3716 } | 3801 } |
| 3717 String keywordValue = keyword.lexeme; | 3802 String keywordValue = keyword.lexeme; |
| 3718 return keywordValue == Parser.ASYNC; | 3803 return keywordValue == Parser.ASYNC; |
| 3719 } | 3804 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3756 * Initialize a newly created boolean literal. | 3841 * Initialize a newly created boolean literal. |
| 3757 * | 3842 * |
| 3758 * @param literal the token representing the literal | 3843 * @param literal the token representing the literal |
| 3759 * @param value the value of the literal | 3844 * @param value the value of the literal |
| 3760 */ | 3845 */ |
| 3761 BooleanLiteral(this.literal, this.value); | 3846 BooleanLiteral(this.literal, this.value); |
| 3762 | 3847 |
| 3763 @override | 3848 @override |
| 3764 Token get beginToken => literal; | 3849 Token get beginToken => literal; |
| 3765 | 3850 |
| 3851 /** |
| 3852 * TODO(paulberry): untested. |
| 3853 */ |
| 3854 @override |
| 3855 Iterable get childEntities => new ChildEntities()..add(literal); |
| 3856 |
| 3766 @override | 3857 @override |
| 3767 Token get endToken => literal; | 3858 Token get endToken => literal; |
| 3768 | 3859 |
| 3769 @override | 3860 @override |
| 3770 bool get isSynthetic => literal.isSynthetic; | 3861 bool get isSynthetic => literal.isSynthetic; |
| 3771 | 3862 |
| 3772 @override | 3863 @override |
| 3773 accept(AstVisitor visitor) => visitor.visitBooleanLiteral(this); | 3864 accept(AstVisitor visitor) => visitor.visitBooleanLiteral(this); |
| 3774 | 3865 |
| 3775 @override | 3866 @override |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3872 * @param label the label associated with the statement | 3963 * @param label the label associated with the statement |
| 3873 * @param semicolon the semicolon terminating the statement | 3964 * @param semicolon the semicolon terminating the statement |
| 3874 */ | 3965 */ |
| 3875 BreakStatement(this.keyword, SimpleIdentifier label, this.semicolon) { | 3966 BreakStatement(this.keyword, SimpleIdentifier label, this.semicolon) { |
| 3876 _label = becomeParentOf(label); | 3967 _label = becomeParentOf(label); |
| 3877 } | 3968 } |
| 3878 | 3969 |
| 3879 @override | 3970 @override |
| 3880 Token get beginToken => keyword; | 3971 Token get beginToken => keyword; |
| 3881 | 3972 |
| 3973 /** |
| 3974 * TODO(paulberry): untested. |
| 3975 */ |
| 3976 @override |
| 3977 Iterable get childEntities => new ChildEntities() |
| 3978 ..add(keyword) |
| 3979 ..add(_label) |
| 3980 ..add(semicolon); |
| 3981 |
| 3882 @override | 3982 @override |
| 3883 Token get endToken => semicolon; | 3983 Token get endToken => semicolon; |
| 3884 | 3984 |
| 3885 /** | 3985 /** |
| 3886 * Return the label associated with the statement, or `null` if there is no la
bel. | 3986 * Return the label associated with the statement, or `null` if there is no la
bel. |
| 3887 * | 3987 * |
| 3888 * @return the label associated with the statement | 3988 * @return the label associated with the statement |
| 3889 */ | 3989 */ |
| 3890 SimpleIdentifier get label => _label; | 3990 SimpleIdentifier get label => _label; |
| 3891 | 3991 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3951 Token get beginToken => _target.beginToken; | 4051 Token get beginToken => _target.beginToken; |
| 3952 | 4052 |
| 3953 /** | 4053 /** |
| 3954 * Return the cascade sections sharing the common target. | 4054 * Return the cascade sections sharing the common target. |
| 3955 * | 4055 * |
| 3956 * @return the cascade sections sharing the common target | 4056 * @return the cascade sections sharing the common target |
| 3957 */ | 4057 */ |
| 3958 NodeList<Expression> get cascadeSections => _cascadeSections; | 4058 NodeList<Expression> get cascadeSections => _cascadeSections; |
| 3959 | 4059 |
| 3960 @override | 4060 @override |
| 4061 Iterable get childEntities => new ChildEntities() |
| 4062 ..add(_target) |
| 4063 ..addAll(_cascadeSections); |
| 4064 |
| 4065 @override |
| 3961 Token get endToken => _cascadeSections.endToken; | 4066 Token get endToken => _cascadeSections.endToken; |
| 3962 | 4067 |
| 3963 @override | 4068 @override |
| 3964 int get precedence => 2; | 4069 int get precedence => 2; |
| 3965 | 4070 |
| 3966 /** | 4071 /** |
| 3967 * Return the target of the cascade sections. | 4072 * Return the target of the cascade sections. |
| 3968 * | 4073 * |
| 3969 * @return the target of the cascade sections | 4074 * @return the target of the cascade sections |
| 3970 */ | 4075 */ |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4090 /** | 4195 /** |
| 4091 * Set the body of the catch block to the given block. | 4196 * Set the body of the catch block to the given block. |
| 4092 * | 4197 * |
| 4093 * @param block the body of the catch block | 4198 * @param block the body of the catch block |
| 4094 */ | 4199 */ |
| 4095 void set body(Block block) { | 4200 void set body(Block block) { |
| 4096 _body = becomeParentOf(block); | 4201 _body = becomeParentOf(block); |
| 4097 } | 4202 } |
| 4098 | 4203 |
| 4099 @override | 4204 @override |
| 4205 Iterable get childEntities => new ChildEntities() |
| 4206 ..add(onKeyword) |
| 4207 ..add(_exceptionType) |
| 4208 ..add(catchKeyword) |
| 4209 ..add(leftParenthesis) |
| 4210 ..add(_exceptionParameter) |
| 4211 ..add(comma) |
| 4212 ..add(_stackTraceParameter) |
| 4213 ..add(rightParenthesis) |
| 4214 ..add(_body); |
| 4215 |
| 4216 @override |
| 4100 Token get endToken => _body.endToken; | 4217 Token get endToken => _body.endToken; |
| 4101 | 4218 |
| 4102 /** | 4219 /** |
| 4103 * Return the parameter whose value will be the exception that was thrown. | 4220 * Return the parameter whose value will be the exception that was thrown. |
| 4104 * | 4221 * |
| 4105 * @return the parameter whose value will be the exception that was thrown | 4222 * @return the parameter whose value will be the exception that was thrown |
| 4106 */ | 4223 */ |
| 4107 SimpleIdentifier get exceptionParameter => _exceptionParameter; | 4224 SimpleIdentifier get exceptionParameter => _exceptionParameter; |
| 4108 | 4225 |
| 4109 /** | 4226 /** |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4157 @override | 4274 @override |
| 4158 void visitChildren(AstVisitor visitor) { | 4275 void visitChildren(AstVisitor visitor) { |
| 4159 safelyVisitChild(_exceptionType, visitor); | 4276 safelyVisitChild(_exceptionType, visitor); |
| 4160 safelyVisitChild(_exceptionParameter, visitor); | 4277 safelyVisitChild(_exceptionParameter, visitor); |
| 4161 safelyVisitChild(_stackTraceParameter, visitor); | 4278 safelyVisitChild(_stackTraceParameter, visitor); |
| 4162 safelyVisitChild(_body, visitor); | 4279 safelyVisitChild(_body, visitor); |
| 4163 } | 4280 } |
| 4164 } | 4281 } |
| 4165 | 4282 |
| 4166 /** | 4283 /** |
| 4284 * Helper class to allow iteration of child entities of an AST node. |
| 4285 */ |
| 4286 class ChildEntities extends Object with IterableMixin implements Iterable { |
| 4287 List _entities = []; |
| 4288 |
| 4289 @override |
| 4290 Iterator get iterator => _entities.iterator; |
| 4291 |
| 4292 /** |
| 4293 * Add an AST node or token as the next child entity, if it is not null. |
| 4294 */ |
| 4295 void add(entity) { |
| 4296 if (entity != null) { |
| 4297 assert(entity is Token || entity is AstNode); |
| 4298 _entities.add(entity); |
| 4299 } |
| 4300 } |
| 4301 |
| 4302 /** |
| 4303 * Add the given items as the next child entities, if [items] is not null. |
| 4304 */ |
| 4305 void addAll(Iterable items) { |
| 4306 if (items != null) { |
| 4307 _entities.addAll(items); |
| 4308 } |
| 4309 } |
| 4310 } |
| 4311 |
| 4312 /** |
| 4167 * Instances of the class `ClassDeclaration` represent the declaration of a clas
s. | 4313 * Instances of the class `ClassDeclaration` represent the declaration of a clas
s. |
| 4168 * | 4314 * |
| 4169 * <pre> | 4315 * <pre> |
| 4170 * classDeclaration ::= | 4316 * classDeclaration ::= |
| 4171 * 'abstract'? 'class' [SimpleIdentifier] [TypeParameterList]? | 4317 * 'abstract'? 'class' [SimpleIdentifier] [TypeParameterList]? |
| 4172 * ([ExtendsClause] [WithClause]?)? | 4318 * ([ExtendsClause] [WithClause]?)? |
| 4173 * [ImplementsClause]? | 4319 * [ImplementsClause]? |
| 4174 * '{' [ClassMember]* '}' | 4320 * '{' [ClassMember]* '}' |
| 4175 * </pre> | 4321 * </pre> |
| 4176 */ | 4322 */ |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4256 : super(comment, metadata) { | 4402 : super(comment, metadata) { |
| 4257 _name = becomeParentOf(name); | 4403 _name = becomeParentOf(name); |
| 4258 _typeParameters = becomeParentOf(typeParameters); | 4404 _typeParameters = becomeParentOf(typeParameters); |
| 4259 _extendsClause = becomeParentOf(extendsClause); | 4405 _extendsClause = becomeParentOf(extendsClause); |
| 4260 _withClause = becomeParentOf(withClause); | 4406 _withClause = becomeParentOf(withClause); |
| 4261 _implementsClause = becomeParentOf(implementsClause); | 4407 _implementsClause = becomeParentOf(implementsClause); |
| 4262 _members = new NodeList<ClassMember>(this, members); | 4408 _members = new NodeList<ClassMember>(this, members); |
| 4263 } | 4409 } |
| 4264 | 4410 |
| 4265 @override | 4411 @override |
| 4412 Iterable get childEntities => super._childEntities |
| 4413 ..add(abstractKeyword) |
| 4414 ..add(classKeyword) |
| 4415 ..add(_name) |
| 4416 ..add(_typeParameters) |
| 4417 ..add(_extendsClause) |
| 4418 ..add(_withClause) |
| 4419 ..add(_implementsClause) |
| 4420 ..add(_nativeClause) |
| 4421 ..add(leftBracket) |
| 4422 ..addAll(members) |
| 4423 ..add(rightBracket); |
| 4424 |
| 4425 @override |
| 4266 ClassElement get element => | 4426 ClassElement get element => |
| 4267 _name != null ? (_name.staticElement as ClassElement) : null; | 4427 _name != null ? (_name.staticElement as ClassElement) : null; |
| 4268 | 4428 |
| 4269 @override | 4429 @override |
| 4270 Token get endToken => rightBracket; | 4430 Token get endToken => rightBracket; |
| 4271 | 4431 |
| 4272 /** | 4432 /** |
| 4273 * Return the extends clause for this class, or `null` if the class does not e
xtend any | 4433 * Return the extends clause for this class, or `null` if the class does not e
xtend any |
| 4274 * other class. | 4434 * other class. |
| 4275 * | 4435 * |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4556 ImplementsClause implementsClause, Token semicolon) | 4716 ImplementsClause implementsClause, Token semicolon) |
| 4557 : super(comment, metadata, keyword, semicolon) { | 4717 : super(comment, metadata, keyword, semicolon) { |
| 4558 _name = becomeParentOf(name); | 4718 _name = becomeParentOf(name); |
| 4559 _typeParameters = becomeParentOf(typeParameters); | 4719 _typeParameters = becomeParentOf(typeParameters); |
| 4560 _superclass = becomeParentOf(superclass); | 4720 _superclass = becomeParentOf(superclass); |
| 4561 _withClause = becomeParentOf(withClause); | 4721 _withClause = becomeParentOf(withClause); |
| 4562 _implementsClause = becomeParentOf(implementsClause); | 4722 _implementsClause = becomeParentOf(implementsClause); |
| 4563 } | 4723 } |
| 4564 | 4724 |
| 4565 @override | 4725 @override |
| 4726 Iterable get childEntities => super._childEntities |
| 4727 ..add(keyword) |
| 4728 ..add(_name) |
| 4729 ..add(_typeParameters) |
| 4730 ..add(equals) |
| 4731 ..add(abstractKeyword) |
| 4732 ..add(_superclass) |
| 4733 ..add(_withClause) |
| 4734 ..add(_implementsClause) |
| 4735 ..add(semicolon); |
| 4736 |
| 4737 @override |
| 4566 ClassElement get element => | 4738 ClassElement get element => |
| 4567 _name != null ? (_name.staticElement as ClassElement) : null; | 4739 _name != null ? (_name.staticElement as ClassElement) : null; |
| 4568 | 4740 |
| 4569 /** | 4741 /** |
| 4570 * Return the implements clause for this class, or `null` if there is no imple
ments clause. | 4742 * Return the implements clause for this class, or `null` if there is no imple
ments clause. |
| 4571 * | 4743 * |
| 4572 * @return the implements clause for this class | 4744 * @return the implements clause for this class |
| 4573 */ | 4745 */ |
| 4574 ImplementsClause get implementsClause => _implementsClause; | 4746 ImplementsClause get implementsClause => _implementsClause; |
| 4575 | 4747 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4741 * @param references the references embedded within the documentation comment | 4913 * @param references the references embedded within the documentation comment |
| 4742 */ | 4914 */ |
| 4743 Comment(this.tokens, this._type, List<CommentReference> references) { | 4915 Comment(this.tokens, this._type, List<CommentReference> references) { |
| 4744 _references = new NodeList<CommentReference>(this, references); | 4916 _references = new NodeList<CommentReference>(this, references); |
| 4745 } | 4917 } |
| 4746 | 4918 |
| 4747 @override | 4919 @override |
| 4748 Token get beginToken => tokens[0]; | 4920 Token get beginToken => tokens[0]; |
| 4749 | 4921 |
| 4750 @override | 4922 @override |
| 4923 Iterable get childEntities => new ChildEntities()..addAll(tokens); |
| 4924 |
| 4925 @override |
| 4751 Token get endToken => tokens[tokens.length - 1]; | 4926 Token get endToken => tokens[tokens.length - 1]; |
| 4752 | 4927 |
| 4753 /** | 4928 /** |
| 4754 * Return `true` if this is a block comment. | 4929 * Return `true` if this is a block comment. |
| 4755 * | 4930 * |
| 4756 * @return `true` if this is a block comment | 4931 * @return `true` if this is a block comment |
| 4757 */ | 4932 */ |
| 4758 bool get isBlock => _type == CommentType.BLOCK; | 4933 bool get isBlock => _type == CommentType.BLOCK; |
| 4759 | 4934 |
| 4760 /** | 4935 /** |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4852 * @param identifier the identifier being referenced | 5027 * @param identifier the identifier being referenced |
| 4853 */ | 5028 */ |
| 4854 CommentReference(this.newKeyword, Identifier identifier) { | 5029 CommentReference(this.newKeyword, Identifier identifier) { |
| 4855 _identifier = becomeParentOf(identifier); | 5030 _identifier = becomeParentOf(identifier); |
| 4856 } | 5031 } |
| 4857 | 5032 |
| 4858 @override | 5033 @override |
| 4859 Token get beginToken => _identifier.beginToken; | 5034 Token get beginToken => _identifier.beginToken; |
| 4860 | 5035 |
| 4861 @override | 5036 @override |
| 5037 Iterable get childEntities => new ChildEntities() |
| 5038 ..add(newKeyword) |
| 5039 ..add(_identifier); |
| 5040 |
| 5041 @override |
| 4862 Token get endToken => _identifier.endToken; | 5042 Token get endToken => _identifier.endToken; |
| 4863 | 5043 |
| 4864 /** | 5044 /** |
| 4865 * Return the identifier being referenced. | 5045 * Return the identifier being referenced. |
| 4866 * | 5046 * |
| 4867 * @return the identifier being referenced | 5047 * @return the identifier being referenced |
| 4868 */ | 5048 */ |
| 4869 Identifier get identifier => _identifier; | 5049 Identifier get identifier => _identifier; |
| 4870 | 5050 |
| 4871 /** | 5051 /** |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4993 * @param endToken the last token in the token stream | 5173 * @param endToken the last token in the token stream |
| 4994 */ | 5174 */ |
| 4995 CompilationUnit(this.beginToken, ScriptTag scriptTag, | 5175 CompilationUnit(this.beginToken, ScriptTag scriptTag, |
| 4996 List<Directive> directives, List<CompilationUnitMember> declarations, | 5176 List<Directive> directives, List<CompilationUnitMember> declarations, |
| 4997 this.endToken) { | 5177 this.endToken) { |
| 4998 _scriptTag = becomeParentOf(scriptTag); | 5178 _scriptTag = becomeParentOf(scriptTag); |
| 4999 _directives = new NodeList<Directive>(this, directives); | 5179 _directives = new NodeList<Directive>(this, directives); |
| 5000 _declarations = new NodeList<CompilationUnitMember>(this, declarations); | 5180 _declarations = new NodeList<CompilationUnitMember>(this, declarations); |
| 5001 } | 5181 } |
| 5002 | 5182 |
| 5183 @override |
| 5184 Iterable get childEntities { |
| 5185 ChildEntities result = new ChildEntities()..add(_scriptTag); |
| 5186 if (_directivesAreBeforeDeclarations()) { |
| 5187 result |
| 5188 ..addAll(_directives) |
| 5189 ..addAll(_declarations); |
| 5190 } else { |
| 5191 result.addAll(sortedDirectivesAndDeclarations); |
| 5192 } |
| 5193 return result; |
| 5194 } |
| 5195 |
| 5003 /** | 5196 /** |
| 5004 * Return the declarations contained in this compilation unit. | 5197 * Return the declarations contained in this compilation unit. |
| 5005 * | 5198 * |
| 5006 * @return the declarations contained in this compilation unit | 5199 * @return the declarations contained in this compilation unit |
| 5007 */ | 5200 */ |
| 5008 NodeList<CompilationUnitMember> get declarations => _declarations; | 5201 NodeList<CompilationUnitMember> get declarations => _declarations; |
| 5009 | 5202 |
| 5010 /** | 5203 /** |
| 5011 * Return the directives contained in this compilation unit. | 5204 * Return the directives contained in this compilation unit. |
| 5012 * | 5205 * |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5162 Expression thenExpression, this.colon, Expression elseExpression) { | 5355 Expression thenExpression, this.colon, Expression elseExpression) { |
| 5163 _condition = becomeParentOf(condition); | 5356 _condition = becomeParentOf(condition); |
| 5164 _thenExpression = becomeParentOf(thenExpression); | 5357 _thenExpression = becomeParentOf(thenExpression); |
| 5165 _elseExpression = becomeParentOf(elseExpression); | 5358 _elseExpression = becomeParentOf(elseExpression); |
| 5166 } | 5359 } |
| 5167 | 5360 |
| 5168 @override | 5361 @override |
| 5169 Token get beginToken => _condition.beginToken; | 5362 Token get beginToken => _condition.beginToken; |
| 5170 | 5363 |
| 5171 /** | 5364 /** |
| 5365 * TODO(paulberry): untested. |
| 5366 */ |
| 5367 @override |
| 5368 Iterable get childEntities => new ChildEntities() |
| 5369 ..add(_condition) |
| 5370 ..add(question) |
| 5371 ..add(_thenExpression) |
| 5372 ..add(colon) |
| 5373 ..add(_elseExpression); |
| 5374 |
| 5375 /** |
| 5172 * Return the condition used to determine which of the expressions is executed
next. | 5376 * Return the condition used to determine which of the expressions is executed
next. |
| 5173 * | 5377 * |
| 5174 * @return the condition used to determine which expression is executed next | 5378 * @return the condition used to determine which expression is executed next |
| 5175 */ | 5379 */ |
| 5176 Expression get condition => _condition; | 5380 Expression get condition => _condition; |
| 5177 | 5381 |
| 5178 /** | 5382 /** |
| 5179 * Set the condition used to determine which of the expressions is executed ne
xt to the given | 5383 * Set the condition used to determine which of the expressions is executed ne
xt to the given |
| 5180 * expression. | 5384 * expression. |
| 5181 * | 5385 * |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5741 /** | 5945 /** |
| 5742 * Set the body of the constructor to the given function body. | 5946 * Set the body of the constructor to the given function body. |
| 5743 * | 5947 * |
| 5744 * @param functionBody the body of the constructor | 5948 * @param functionBody the body of the constructor |
| 5745 */ | 5949 */ |
| 5746 void set body(FunctionBody functionBody) { | 5950 void set body(FunctionBody functionBody) { |
| 5747 _body = becomeParentOf(functionBody); | 5951 _body = becomeParentOf(functionBody); |
| 5748 } | 5952 } |
| 5749 | 5953 |
| 5750 @override | 5954 @override |
| 5955 Iterable get childEntities => super._childEntities |
| 5956 ..add(externalKeyword) |
| 5957 ..add(constKeyword) |
| 5958 ..add(factoryKeyword) |
| 5959 ..add(_returnType) |
| 5960 ..add(period) |
| 5961 ..add(_name) |
| 5962 ..add(_parameters) |
| 5963 ..add(separator) |
| 5964 ..addAll(initializers) |
| 5965 ..add(_redirectedConstructor) |
| 5966 ..add(_body); |
| 5967 |
| 5968 @override |
| 5751 Token get endToken { | 5969 Token get endToken { |
| 5752 if (_body != null) { | 5970 if (_body != null) { |
| 5753 return _body.endToken; | 5971 return _body.endToken; |
| 5754 } else if (!_initializers.isEmpty) { | 5972 } else if (!_initializers.isEmpty) { |
| 5755 return _initializers.endToken; | 5973 return _initializers.endToken; |
| 5756 } | 5974 } |
| 5757 return _parameters.endToken; | 5975 return _parameters.endToken; |
| 5758 } | 5976 } |
| 5759 | 5977 |
| 5760 @override | 5978 @override |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5913 | 6131 |
| 5914 @override | 6132 @override |
| 5915 Token get beginToken { | 6133 Token get beginToken { |
| 5916 if (keyword != null) { | 6134 if (keyword != null) { |
| 5917 return keyword; | 6135 return keyword; |
| 5918 } | 6136 } |
| 5919 return _fieldName.beginToken; | 6137 return _fieldName.beginToken; |
| 5920 } | 6138 } |
| 5921 | 6139 |
| 5922 @override | 6140 @override |
| 6141 Iterable get childEntities => new ChildEntities() |
| 6142 ..add(keyword) |
| 6143 ..add(period) |
| 6144 ..add(_fieldName) |
| 6145 ..add(equals) |
| 6146 ..add(_expression); |
| 6147 |
| 6148 @override |
| 5923 Token get endToken => _expression.endToken; | 6149 Token get endToken => _expression.endToken; |
| 5924 | 6150 |
| 5925 /** | 6151 /** |
| 5926 * Return the expression computing the value to which the field will be initia
lized. | 6152 * Return the expression computing the value to which the field will be initia
lized. |
| 5927 * | 6153 * |
| 5928 * @return the expression computing the value to which the field will be initi
alized | 6154 * @return the expression computing the value to which the field will be initi
alized |
| 5929 */ | 6155 */ |
| 5930 Expression get expression => _expression; | 6156 Expression get expression => _expression; |
| 5931 | 6157 |
| 5932 /** | 6158 /** |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6020 */ | 6246 */ |
| 6021 ConstructorName(TypeName type, this.period, SimpleIdentifier name) { | 6247 ConstructorName(TypeName type, this.period, SimpleIdentifier name) { |
| 6022 _type = becomeParentOf(type); | 6248 _type = becomeParentOf(type); |
| 6023 _name = becomeParentOf(name); | 6249 _name = becomeParentOf(name); |
| 6024 } | 6250 } |
| 6025 | 6251 |
| 6026 @override | 6252 @override |
| 6027 Token get beginToken => _type.beginToken; | 6253 Token get beginToken => _type.beginToken; |
| 6028 | 6254 |
| 6029 @override | 6255 @override |
| 6256 Iterable get childEntities => new ChildEntities() |
| 6257 ..add(_type) |
| 6258 ..add(period) |
| 6259 ..add(_name); |
| 6260 |
| 6261 @override |
| 6030 Token get endToken { | 6262 Token get endToken { |
| 6031 if (_name != null) { | 6263 if (_name != null) { |
| 6032 return _name.endToken; | 6264 return _name.endToken; |
| 6033 } | 6265 } |
| 6034 return _type.endToken; | 6266 return _type.endToken; |
| 6035 } | 6267 } |
| 6036 | 6268 |
| 6037 /** | 6269 /** |
| 6038 * Return the name of the constructor, or `null` if the specified constructor
is the unnamed | 6270 * Return the name of the constructor, or `null` if the specified constructor
is the unnamed |
| 6039 * constructor. | 6271 * constructor. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6118 * @param label the label associated with the statement | 6350 * @param label the label associated with the statement |
| 6119 * @param semicolon the semicolon terminating the statement | 6351 * @param semicolon the semicolon terminating the statement |
| 6120 */ | 6352 */ |
| 6121 ContinueStatement(this.keyword, SimpleIdentifier label, this.semicolon) { | 6353 ContinueStatement(this.keyword, SimpleIdentifier label, this.semicolon) { |
| 6122 _label = becomeParentOf(label); | 6354 _label = becomeParentOf(label); |
| 6123 } | 6355 } |
| 6124 | 6356 |
| 6125 @override | 6357 @override |
| 6126 Token get beginToken => keyword; | 6358 Token get beginToken => keyword; |
| 6127 | 6359 |
| 6360 /** |
| 6361 * TODO(paulberry): untested. |
| 6362 */ |
| 6363 @override |
| 6364 Iterable get childEntities => new ChildEntities() |
| 6365 ..add(keyword) |
| 6366 ..add(_label) |
| 6367 ..add(semicolon); |
| 6368 |
| 6128 @override | 6369 @override |
| 6129 Token get endToken => semicolon; | 6370 Token get endToken => semicolon; |
| 6130 | 6371 |
| 6131 /** | 6372 /** |
| 6132 * Return the label associated with the statement, or `null` if there is no la
bel. | 6373 * Return the label associated with the statement, or `null` if there is no la
bel. |
| 6133 * | 6374 * |
| 6134 * @return the label associated with the statement | 6375 * @return the label associated with the statement |
| 6135 */ | 6376 */ |
| 6136 SimpleIdentifier get label => _label; | 6377 SimpleIdentifier get label => _label; |
| 6137 | 6378 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6212 * @param type the name of the declared type of the parameter | 6453 * @param type the name of the declared type of the parameter |
| 6213 * @param identifier the name of the parameter being declared | 6454 * @param identifier the name of the parameter being declared |
| 6214 */ | 6455 */ |
| 6215 DeclaredIdentifier(Comment comment, List<Annotation> metadata, this.keyword, | 6456 DeclaredIdentifier(Comment comment, List<Annotation> metadata, this.keyword, |
| 6216 TypeName type, SimpleIdentifier identifier) | 6457 TypeName type, SimpleIdentifier identifier) |
| 6217 : super(comment, metadata) { | 6458 : super(comment, metadata) { |
| 6218 _type = becomeParentOf(type); | 6459 _type = becomeParentOf(type); |
| 6219 _identifier = becomeParentOf(identifier); | 6460 _identifier = becomeParentOf(identifier); |
| 6220 } | 6461 } |
| 6221 | 6462 |
| 6463 /** |
| 6464 * TODO(paulberry): untested. |
| 6465 */ |
| 6466 @override |
| 6467 Iterable get childEntities => super._childEntities |
| 6468 ..add(keyword) |
| 6469 ..add(_type) |
| 6470 ..add(_identifier); |
| 6471 |
| 6222 @override | 6472 @override |
| 6223 LocalVariableElement get element { | 6473 LocalVariableElement get element { |
| 6224 if (_identifier == null) { | 6474 if (_identifier == null) { |
| 6225 return null; | 6475 return null; |
| 6226 } | 6476 } |
| 6227 return _identifier.staticElement as LocalVariableElement; | 6477 return _identifier.staticElement as LocalVariableElement; |
| 6228 } | 6478 } |
| 6229 | 6479 |
| 6230 @override | 6480 @override |
| 6231 Token get endToken => _identifier.endToken; | 6481 Token get endToken => _identifier.endToken; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6349 DefaultFormalParameter(NormalFormalParameter parameter, this.kind, | 6599 DefaultFormalParameter(NormalFormalParameter parameter, this.kind, |
| 6350 this.separator, Expression defaultValue) { | 6600 this.separator, Expression defaultValue) { |
| 6351 _parameter = becomeParentOf(parameter); | 6601 _parameter = becomeParentOf(parameter); |
| 6352 _defaultValue = becomeParentOf(defaultValue); | 6602 _defaultValue = becomeParentOf(defaultValue); |
| 6353 } | 6603 } |
| 6354 | 6604 |
| 6355 @override | 6605 @override |
| 6356 Token get beginToken => _parameter.beginToken; | 6606 Token get beginToken => _parameter.beginToken; |
| 6357 | 6607 |
| 6358 /** | 6608 /** |
| 6609 * TODO(paulberry): untested. |
| 6610 */ |
| 6611 @override |
| 6612 Iterable get childEntities => new ChildEntities() |
| 6613 ..add(_parameter) |
| 6614 ..add(separator) |
| 6615 ..add(_defaultValue); |
| 6616 |
| 6617 /** |
| 6359 * Return the expression computing the default value for the parameter, or `nu
ll` if there | 6618 * Return the expression computing the default value for the parameter, or `nu
ll` if there |
| 6360 * is no default value. | 6619 * is no default value. |
| 6361 * | 6620 * |
| 6362 * @return the expression computing the default value for the parameter | 6621 * @return the expression computing the default value for the parameter |
| 6363 */ | 6622 */ |
| 6364 Expression get defaultValue => _defaultValue; | 6623 Expression get defaultValue => _defaultValue; |
| 6365 | 6624 |
| 6366 /** | 6625 /** |
| 6367 * Set the expression computing the default value for the parameter to the giv
en expression. | 6626 * Set the expression computing the default value for the parameter to the giv
en expression. |
| 6368 * | 6627 * |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6553 | 6812 |
| 6554 /** | 6813 /** |
| 6555 * Set the body of the loop to the given statement. | 6814 * Set the body of the loop to the given statement. |
| 6556 * | 6815 * |
| 6557 * @param statement the body of the loop | 6816 * @param statement the body of the loop |
| 6558 */ | 6817 */ |
| 6559 void set body(Statement statement) { | 6818 void set body(Statement statement) { |
| 6560 _body = becomeParentOf(statement); | 6819 _body = becomeParentOf(statement); |
| 6561 } | 6820 } |
| 6562 | 6821 |
| 6822 @override |
| 6823 Iterable get childEntities => new ChildEntities() |
| 6824 ..add(doKeyword) |
| 6825 ..add(_body) |
| 6826 ..add(whileKeyword) |
| 6827 ..add(leftParenthesis) |
| 6828 ..add(_condition) |
| 6829 ..add(rightParenthesis) |
| 6830 ..add(semicolon); |
| 6831 |
| 6563 /** | 6832 /** |
| 6564 * Return the condition that determines when the loop will terminate. | 6833 * Return the condition that determines when the loop will terminate. |
| 6565 * | 6834 * |
| 6566 * @return the condition that determines when the loop will terminate | 6835 * @return the condition that determines when the loop will terminate |
| 6567 */ | 6836 */ |
| 6568 Expression get condition => _condition; | 6837 Expression get condition => _condition; |
| 6569 | 6838 |
| 6570 /** | 6839 /** |
| 6571 * Set the condition that determines when the loop will terminate to the given
expression. | 6840 * Set the condition that determines when the loop will terminate to the given
expression. |
| 6572 * | 6841 * |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6616 * Initialize a newly created floating point literal. | 6885 * Initialize a newly created floating point literal. |
| 6617 * | 6886 * |
| 6618 * @param literal the token representing the literal | 6887 * @param literal the token representing the literal |
| 6619 * @param value the value of the literal | 6888 * @param value the value of the literal |
| 6620 */ | 6889 */ |
| 6621 DoubleLiteral(this.literal, this.value); | 6890 DoubleLiteral(this.literal, this.value); |
| 6622 | 6891 |
| 6623 @override | 6892 @override |
| 6624 Token get beginToken => literal; | 6893 Token get beginToken => literal; |
| 6625 | 6894 |
| 6895 /** |
| 6896 * TODO(paulberry): untested. |
| 6897 */ |
| 6898 @override |
| 6899 Iterable get childEntities => new ChildEntities()..add(literal); |
| 6900 |
| 6626 @override | 6901 @override |
| 6627 Token get endToken => literal; | 6902 Token get endToken => literal; |
| 6628 | 6903 |
| 6629 @override | 6904 @override |
| 6630 accept(AstVisitor visitor) => visitor.visitDoubleLiteral(this); | 6905 accept(AstVisitor visitor) => visitor.visitDoubleLiteral(this); |
| 6631 | 6906 |
| 6632 @override | 6907 @override |
| 6633 void visitChildren(AstVisitor visitor) { | 6908 void visitChildren(AstVisitor visitor) { |
| 6634 // There are no children to visit. | 6909 // There are no children to visit. |
| 6635 } | 6910 } |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6813 /** | 7088 /** |
| 6814 * Initialize a newly created function body. | 7089 * Initialize a newly created function body. |
| 6815 * | 7090 * |
| 6816 * @param semicolon the token representing the semicolon that marks the end of
the function body | 7091 * @param semicolon the token representing the semicolon that marks the end of
the function body |
| 6817 */ | 7092 */ |
| 6818 EmptyFunctionBody(this.semicolon); | 7093 EmptyFunctionBody(this.semicolon); |
| 6819 | 7094 |
| 6820 @override | 7095 @override |
| 6821 Token get beginToken => semicolon; | 7096 Token get beginToken => semicolon; |
| 6822 | 7097 |
| 7098 /** |
| 7099 * TODO(paulberry): untested. |
| 7100 */ |
| 7101 @override |
| 7102 Iterable get childEntities => new ChildEntities()..add(semicolon); |
| 7103 |
| 6823 @override | 7104 @override |
| 6824 Token get endToken => semicolon; | 7105 Token get endToken => semicolon; |
| 6825 | 7106 |
| 6826 @override | 7107 @override |
| 6827 accept(AstVisitor visitor) => visitor.visitEmptyFunctionBody(this); | 7108 accept(AstVisitor visitor) => visitor.visitEmptyFunctionBody(this); |
| 6828 | 7109 |
| 6829 @override | 7110 @override |
| 6830 void visitChildren(AstVisitor visitor) { | 7111 void visitChildren(AstVisitor visitor) { |
| 6831 // Empty function bodies have no children. | 7112 // Empty function bodies have no children. |
| 6832 } | 7113 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 6849 /** | 7130 /** |
| 6850 * Initialize a newly created empty statement. | 7131 * Initialize a newly created empty statement. |
| 6851 * | 7132 * |
| 6852 * @param semicolon the semicolon terminating the statement | 7133 * @param semicolon the semicolon terminating the statement |
| 6853 */ | 7134 */ |
| 6854 EmptyStatement(this.semicolon); | 7135 EmptyStatement(this.semicolon); |
| 6855 | 7136 |
| 6856 @override | 7137 @override |
| 6857 Token get beginToken => semicolon; | 7138 Token get beginToken => semicolon; |
| 6858 | 7139 |
| 7140 /** |
| 7141 * TODO(paulberry): untested. |
| 7142 */ |
| 7143 @override |
| 7144 Iterable get childEntities => new ChildEntities()..add(semicolon); |
| 7145 |
| 6859 @override | 7146 @override |
| 6860 Token get endToken => semicolon; | 7147 Token get endToken => semicolon; |
| 6861 | 7148 |
| 6862 @override | 7149 @override |
| 6863 accept(AstVisitor visitor) => visitor.visitEmptyStatement(this); | 7150 accept(AstVisitor visitor) => visitor.visitEmptyStatement(this); |
| 6864 | 7151 |
| 6865 @override | 7152 @override |
| 6866 void visitChildren(AstVisitor visitor) { | 7153 void visitChildren(AstVisitor visitor) { |
| 6867 // There are no children to visit. | 7154 // There are no children to visit. |
| 6868 } | 7155 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 6884 * @param comment the documentation comment associated with this declaration | 7171 * @param comment the documentation comment associated with this declaration |
| 6885 * @param metadata the annotations associated with this declaration | 7172 * @param metadata the annotations associated with this declaration |
| 6886 * @param name the name of the constant | 7173 * @param name the name of the constant |
| 6887 */ | 7174 */ |
| 6888 EnumConstantDeclaration(Comment comment, List<Annotation> metadata, | 7175 EnumConstantDeclaration(Comment comment, List<Annotation> metadata, |
| 6889 SimpleIdentifier name) | 7176 SimpleIdentifier name) |
| 6890 : super(comment, metadata) { | 7177 : super(comment, metadata) { |
| 6891 _name = becomeParentOf(name); | 7178 _name = becomeParentOf(name); |
| 6892 } | 7179 } |
| 6893 | 7180 |
| 7181 /** |
| 7182 * TODO(paulberry): untested. |
| 7183 */ |
| 7184 @override |
| 7185 Iterable get childEntities => super._childEntities..add(_name); |
| 7186 |
| 6894 @override | 7187 @override |
| 6895 FieldElement get element => | 7188 FieldElement get element => |
| 6896 _name == null ? null : (_name.staticElement as FieldElement); | 7189 _name == null ? null : (_name.staticElement as FieldElement); |
| 6897 | 7190 |
| 6898 @override | 7191 @override |
| 6899 Token get endToken => _name.endToken; | 7192 Token get endToken => _name.endToken; |
| 6900 | 7193 |
| 6901 @override | 7194 @override |
| 6902 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; | 7195 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; |
| 6903 | 7196 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6974 */ | 7267 */ |
| 6975 EnumDeclaration(Comment comment, List<Annotation> metadata, this.keyword, | 7268 EnumDeclaration(Comment comment, List<Annotation> metadata, this.keyword, |
| 6976 SimpleIdentifier name, this.leftBracket, | 7269 SimpleIdentifier name, this.leftBracket, |
| 6977 List<EnumConstantDeclaration> constants, this.rightBracket) | 7270 List<EnumConstantDeclaration> constants, this.rightBracket) |
| 6978 : super(comment, metadata) { | 7271 : super(comment, metadata) { |
| 6979 _name = becomeParentOf(name); | 7272 _name = becomeParentOf(name); |
| 6980 _constants = new NodeList<EnumConstantDeclaration>(this, constants); | 7273 _constants = new NodeList<EnumConstantDeclaration>(this, constants); |
| 6981 } | 7274 } |
| 6982 | 7275 |
| 6983 /** | 7276 /** |
| 7277 * TODO(paulberry): untested. |
| 7278 */ |
| 7279 @override |
| 7280 Iterable get childEntities => super._childEntities |
| 7281 ..add(keyword) |
| 7282 ..add(_name) |
| 7283 ..add(leftBracket) |
| 7284 ..addAll(_constants) |
| 7285 ..add(rightBracket); |
| 7286 |
| 7287 /** |
| 6984 * Return the enumeration constants being declared. | 7288 * Return the enumeration constants being declared. |
| 6985 * | 7289 * |
| 6986 * @return the enumeration constants being declared | 7290 * @return the enumeration constants being declared |
| 6987 */ | 7291 */ |
| 6988 NodeList<EnumConstantDeclaration> get constants => _constants; | 7292 NodeList<EnumConstantDeclaration> get constants => _constants; |
| 6989 | 7293 |
| 6990 @override | 7294 @override |
| 6991 ClassElement get element => | 7295 ClassElement get element => |
| 6992 _name != null ? (_name.staticElement as ClassElement) : null; | 7296 _name != null ? (_name.staticElement as ClassElement) : null; |
| 6993 | 7297 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7051 * @param keyword the token representing the 'export' keyword | 7355 * @param keyword the token representing the 'export' keyword |
| 7052 * @param libraryUri the URI of the library being exported | 7356 * @param libraryUri the URI of the library being exported |
| 7053 * @param combinators the combinators used to control which names are exported | 7357 * @param combinators the combinators used to control which names are exported |
| 7054 * @param semicolon the semicolon terminating the directive | 7358 * @param semicolon the semicolon terminating the directive |
| 7055 */ | 7359 */ |
| 7056 ExportDirective(Comment comment, List<Annotation> metadata, Token keyword, | 7360 ExportDirective(Comment comment, List<Annotation> metadata, Token keyword, |
| 7057 StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) | 7361 StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) |
| 7058 : super(comment, metadata, keyword, libraryUri, combinators, semicolon); | 7362 : super(comment, metadata, keyword, libraryUri, combinators, semicolon); |
| 7059 | 7363 |
| 7060 @override | 7364 @override |
| 7365 Iterable get childEntities => super._childEntities |
| 7366 ..add(_uri) |
| 7367 ..addAll(combinators) |
| 7368 ..add(semicolon); |
| 7369 |
| 7370 @override |
| 7061 ExportElement get element => super.element as ExportElement; | 7371 ExportElement get element => super.element as ExportElement; |
| 7062 | 7372 |
| 7063 @override | 7373 @override |
| 7064 LibraryElement get uriElement { | 7374 LibraryElement get uriElement { |
| 7065 if (element != null) { | 7375 if (element != null) { |
| 7066 return element.exportedLibrary; | 7376 return element.exportedLibrary; |
| 7067 } | 7377 } |
| 7068 return null; | 7378 return null; |
| 7069 } | 7379 } |
| 7070 | 7380 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7276 */ | 7586 */ |
| 7277 ExpressionFunctionBody(this.keyword, this.functionDefinition, | 7587 ExpressionFunctionBody(this.keyword, this.functionDefinition, |
| 7278 Expression expression, this.semicolon) { | 7588 Expression expression, this.semicolon) { |
| 7279 _expression = becomeParentOf(expression); | 7589 _expression = becomeParentOf(expression); |
| 7280 } | 7590 } |
| 7281 | 7591 |
| 7282 @override | 7592 @override |
| 7283 Token get beginToken => functionDefinition; | 7593 Token get beginToken => functionDefinition; |
| 7284 | 7594 |
| 7285 @override | 7595 @override |
| 7596 Iterable get childEntities => new ChildEntities() |
| 7597 ..add(keyword) |
| 7598 ..add(functionDefinition) |
| 7599 ..add(_expression) |
| 7600 ..add(semicolon); |
| 7601 |
| 7602 @override |
| 7286 Token get endToken { | 7603 Token get endToken { |
| 7287 if (semicolon != null) { | 7604 if (semicolon != null) { |
| 7288 return semicolon; | 7605 return semicolon; |
| 7289 } | 7606 } |
| 7290 return _expression.endToken; | 7607 return _expression.endToken; |
| 7291 } | 7608 } |
| 7292 | 7609 |
| 7293 /** | 7610 /** |
| 7294 * Return the expression representing the body of the function. | 7611 * Return the expression representing the body of the function. |
| 7295 * | 7612 * |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7348 * @param semicolon the semicolon terminating the statement | 7665 * @param semicolon the semicolon terminating the statement |
| 7349 */ | 7666 */ |
| 7350 ExpressionStatement(Expression expression, this.semicolon) { | 7667 ExpressionStatement(Expression expression, this.semicolon) { |
| 7351 _expression = becomeParentOf(expression); | 7668 _expression = becomeParentOf(expression); |
| 7352 } | 7669 } |
| 7353 | 7670 |
| 7354 @override | 7671 @override |
| 7355 Token get beginToken => _expression.beginToken; | 7672 Token get beginToken => _expression.beginToken; |
| 7356 | 7673 |
| 7357 @override | 7674 @override |
| 7675 Iterable get childEntities => new ChildEntities() |
| 7676 ..add(_expression) |
| 7677 ..add(semicolon); |
| 7678 |
| 7679 @override |
| 7358 Token get endToken { | 7680 Token get endToken { |
| 7359 if (semicolon != null) { | 7681 if (semicolon != null) { |
| 7360 return semicolon; | 7682 return semicolon; |
| 7361 } | 7683 } |
| 7362 return _expression.endToken; | 7684 return _expression.endToken; |
| 7363 } | 7685 } |
| 7364 | 7686 |
| 7365 /** | 7687 /** |
| 7366 * Return the expression that comprises the statement. | 7688 * Return the expression that comprises the statement. |
| 7367 * | 7689 * |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7417 * @param superclass the name of the class that is being extended | 7739 * @param superclass the name of the class that is being extended |
| 7418 */ | 7740 */ |
| 7419 ExtendsClause(this.keyword, TypeName superclass) { | 7741 ExtendsClause(this.keyword, TypeName superclass) { |
| 7420 _superclass = becomeParentOf(superclass); | 7742 _superclass = becomeParentOf(superclass); |
| 7421 } | 7743 } |
| 7422 | 7744 |
| 7423 @override | 7745 @override |
| 7424 Token get beginToken => keyword; | 7746 Token get beginToken => keyword; |
| 7425 | 7747 |
| 7426 @override | 7748 @override |
| 7749 Iterable get childEntities => new ChildEntities() |
| 7750 ..add(keyword) |
| 7751 ..add(_superclass); |
| 7752 |
| 7753 @override |
| 7427 Token get endToken => _superclass.endToken; | 7754 Token get endToken => _superclass.endToken; |
| 7428 | 7755 |
| 7429 /** | 7756 /** |
| 7430 * Return the name of the class that is being extended. | 7757 * Return the name of the class that is being extended. |
| 7431 * | 7758 * |
| 7432 * @return the name of the class that is being extended | 7759 * @return the name of the class that is being extended |
| 7433 */ | 7760 */ |
| 7434 TypeName get superclass => _superclass; | 7761 TypeName get superclass => _superclass; |
| 7435 | 7762 |
| 7436 /** | 7763 /** |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7485 * @param fieldList the fields being declared | 7812 * @param fieldList the fields being declared |
| 7486 * @param semicolon the semicolon terminating the declaration | 7813 * @param semicolon the semicolon terminating the declaration |
| 7487 */ | 7814 */ |
| 7488 FieldDeclaration(Comment comment, List<Annotation> metadata, | 7815 FieldDeclaration(Comment comment, List<Annotation> metadata, |
| 7489 this.staticKeyword, VariableDeclarationList fieldList, this.semicolon) | 7816 this.staticKeyword, VariableDeclarationList fieldList, this.semicolon) |
| 7490 : super(comment, metadata) { | 7817 : super(comment, metadata) { |
| 7491 _fieldList = becomeParentOf(fieldList); | 7818 _fieldList = becomeParentOf(fieldList); |
| 7492 } | 7819 } |
| 7493 | 7820 |
| 7494 @override | 7821 @override |
| 7822 Iterable get childEntities => super._childEntities |
| 7823 ..add(staticKeyword) |
| 7824 ..add(_fieldList) |
| 7825 ..add(semicolon); |
| 7826 |
| 7827 @override |
| 7495 Element get element => null; | 7828 Element get element => null; |
| 7496 | 7829 |
| 7497 @override | 7830 @override |
| 7498 Token get endToken => semicolon; | 7831 Token get endToken => semicolon; |
| 7499 | 7832 |
| 7500 /** | 7833 /** |
| 7501 * Return the fields being declared. | 7834 * Return the fields being declared. |
| 7502 * | 7835 * |
| 7503 * @return the fields being declared | 7836 * @return the fields being declared |
| 7504 */ | 7837 */ |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7600 Token get beginToken { | 7933 Token get beginToken { |
| 7601 if (keyword != null) { | 7934 if (keyword != null) { |
| 7602 return keyword; | 7935 return keyword; |
| 7603 } else if (_type != null) { | 7936 } else if (_type != null) { |
| 7604 return _type.beginToken; | 7937 return _type.beginToken; |
| 7605 } | 7938 } |
| 7606 return thisToken; | 7939 return thisToken; |
| 7607 } | 7940 } |
| 7608 | 7941 |
| 7609 @override | 7942 @override |
| 7943 Iterable get childEntities => super._childEntities |
| 7944 ..add(keyword) |
| 7945 ..add(_type) |
| 7946 ..add(thisToken) |
| 7947 ..add(period) |
| 7948 ..add(identifier) |
| 7949 ..add(_parameters); |
| 7950 |
| 7951 @override |
| 7610 Token get endToken => identifier.endToken; | 7952 Token get endToken => identifier.endToken; |
| 7611 | 7953 |
| 7612 @override | 7954 @override |
| 7613 bool get isConst => | 7955 bool get isConst => |
| 7614 (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.
CONST; | 7956 (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.
CONST; |
| 7615 | 7957 |
| 7616 @override | 7958 @override |
| 7617 bool get isFinal => | 7959 bool get isFinal => |
| 7618 (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.
FINAL; | 7960 (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.
FINAL; |
| 7619 | 7961 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7771 /** | 8113 /** |
| 7772 * Set the body of the loop to the given block. | 8114 * Set the body of the loop to the given block. |
| 7773 * | 8115 * |
| 7774 * @param body the body of the loop | 8116 * @param body the body of the loop |
| 7775 */ | 8117 */ |
| 7776 void set body(Statement body) { | 8118 void set body(Statement body) { |
| 7777 _body = becomeParentOf(body); | 8119 _body = becomeParentOf(body); |
| 7778 } | 8120 } |
| 7779 | 8121 |
| 7780 @override | 8122 @override |
| 8123 Iterable get childEntities => new ChildEntities() |
| 8124 ..add(awaitKeyword) |
| 8125 ..add(forKeyword) |
| 8126 ..add(leftParenthesis) |
| 8127 ..add(_loopVariable) |
| 8128 ..add(_identifier) |
| 8129 ..add(inKeyword) |
| 8130 ..add(_iterable) |
| 8131 ..add(rightParenthesis) |
| 8132 ..add(_body); |
| 8133 |
| 8134 @override |
| 7781 Token get endToken => _body.endToken; | 8135 Token get endToken => _body.endToken; |
| 7782 | 8136 |
| 7783 /** | 8137 /** |
| 7784 * Return the loop variable, or `null` if the loop variable is declared in the
'for'. | 8138 * Return the loop variable, or `null` if the loop variable is declared in the
'for'. |
| 7785 * | 8139 * |
| 7786 * @return the loop variable | 8140 * @return the loop variable |
| 7787 */ | 8141 */ |
| 7788 SimpleIdentifier get identifier => _identifier; | 8142 SimpleIdentifier get identifier => _identifier; |
| 7789 | 8143 |
| 7790 /** | 8144 /** |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7973 */ | 8327 */ |
| 7974 FormalParameterList(this.leftParenthesis, List<FormalParameter> parameters, | 8328 FormalParameterList(this.leftParenthesis, List<FormalParameter> parameters, |
| 7975 this.leftDelimiter, this.rightDelimiter, this.rightParenthesis) { | 8329 this.leftDelimiter, this.rightDelimiter, this.rightParenthesis) { |
| 7976 _parameters = new NodeList<FormalParameter>(this, parameters); | 8330 _parameters = new NodeList<FormalParameter>(this, parameters); |
| 7977 } | 8331 } |
| 7978 | 8332 |
| 7979 @override | 8333 @override |
| 7980 Token get beginToken => leftParenthesis; | 8334 Token get beginToken => leftParenthesis; |
| 7981 | 8335 |
| 7982 @override | 8336 @override |
| 8337 Iterable get childEntities { |
| 8338 // TODO(paulberry): include commas. |
| 8339 ChildEntities result = new ChildEntities()..add(leftParenthesis); |
| 8340 bool leftDelimiterNeeded = leftDelimiter != null; |
| 8341 for (FormalParameter parameter in _parameters) { |
| 8342 if (leftDelimiterNeeded && leftDelimiter.offset < parameter.offset) { |
| 8343 result.add(leftDelimiter); |
| 8344 leftDelimiterNeeded = false; |
| 8345 } |
| 8346 result.add(parameter); |
| 8347 } |
| 8348 return result |
| 8349 ..add(rightDelimiter) |
| 8350 ..add(rightParenthesis); |
| 8351 } |
| 8352 |
| 8353 @override |
| 7983 Token get endToken => rightParenthesis; | 8354 Token get endToken => rightParenthesis; |
| 7984 | 8355 |
| 7985 /** | 8356 /** |
| 7986 * Return an array containing the elements representing the parameters in this
list. The array | 8357 * Return an array containing the elements representing the parameters in this
list. The array |
| 7987 * will contain `null`s if the parameters in this list have not been resolved. | 8358 * will contain `null`s if the parameters in this list have not been resolved. |
| 7988 * | 8359 * |
| 7989 * @return the elements representing the parameters in this list | 8360 * @return the elements representing the parameters in this list |
| 7990 */ | 8361 */ |
| 7991 List<ParameterElement> get parameterElements { | 8362 List<ParameterElement> get parameterElements { |
| 7992 int count = _parameters.length; | 8363 int count = _parameters.length; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8121 | 8492 |
| 8122 /** | 8493 /** |
| 8123 * Set the body of the loop to the given statement. | 8494 * Set the body of the loop to the given statement. |
| 8124 * | 8495 * |
| 8125 * @param body the body of the loop | 8496 * @param body the body of the loop |
| 8126 */ | 8497 */ |
| 8127 void set body(Statement body) { | 8498 void set body(Statement body) { |
| 8128 _body = becomeParentOf(body); | 8499 _body = becomeParentOf(body); |
| 8129 } | 8500 } |
| 8130 | 8501 |
| 8502 @override |
| 8503 Iterable get childEntities => new ChildEntities() |
| 8504 ..add(forKeyword) |
| 8505 ..add(leftParenthesis) |
| 8506 ..add(_variableList) |
| 8507 ..add(_initialization) |
| 8508 ..add(leftSeparator) |
| 8509 ..add(_condition) |
| 8510 ..add(rightSeparator) |
| 8511 ..addAll(_updaters) |
| 8512 ..add(rightParenthesis) |
| 8513 ..add(_body); |
| 8514 |
| 8131 /** | 8515 /** |
| 8132 * Return the condition used to determine when to terminate the loop, or `null
` if there is | 8516 * Return the condition used to determine when to terminate the loop, or `null
` if there is |
| 8133 * no condition. | 8517 * no condition. |
| 8134 * | 8518 * |
| 8135 * @return the condition used to determine when to terminate the loop | 8519 * @return the condition used to determine when to terminate the loop |
| 8136 */ | 8520 */ |
| 8137 Expression get condition => _condition; | 8521 Expression get condition => _condition; |
| 8138 | 8522 |
| 8139 /** | 8523 /** |
| 8140 * Set the condition used to determine when to terminate the loop to the given
expression. | 8524 * Set the condition used to determine when to terminate the loop to the given
expression. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8303 FunctionDeclaration(Comment comment, List<Annotation> metadata, | 8687 FunctionDeclaration(Comment comment, List<Annotation> metadata, |
| 8304 this.externalKeyword, TypeName returnType, this.propertyKeyword, | 8688 this.externalKeyword, TypeName returnType, this.propertyKeyword, |
| 8305 SimpleIdentifier name, FunctionExpression functionExpression) | 8689 SimpleIdentifier name, FunctionExpression functionExpression) |
| 8306 : super(comment, metadata) { | 8690 : super(comment, metadata) { |
| 8307 _returnType = becomeParentOf(returnType); | 8691 _returnType = becomeParentOf(returnType); |
| 8308 _name = becomeParentOf(name); | 8692 _name = becomeParentOf(name); |
| 8309 _functionExpression = becomeParentOf(functionExpression); | 8693 _functionExpression = becomeParentOf(functionExpression); |
| 8310 } | 8694 } |
| 8311 | 8695 |
| 8312 @override | 8696 @override |
| 8697 Iterable get childEntities => super._childEntities |
| 8698 ..add(externalKeyword) |
| 8699 ..add(_returnType) |
| 8700 ..add(propertyKeyword) |
| 8701 ..add(_name) |
| 8702 ..add(_functionExpression); |
| 8703 |
| 8704 @override |
| 8313 ExecutableElement get element => | 8705 ExecutableElement get element => |
| 8314 _name != null ? (_name.staticElement as ExecutableElement) : null; | 8706 _name != null ? (_name.staticElement as ExecutableElement) : null; |
| 8315 | 8707 |
| 8316 @override | 8708 @override |
| 8317 Token get endToken => _functionExpression.endToken; | 8709 Token get endToken => _functionExpression.endToken; |
| 8318 | 8710 |
| 8319 @override | 8711 @override |
| 8320 Token get firstTokenAfterCommentAndMetadata { | 8712 Token get firstTokenAfterCommentAndMetadata { |
| 8321 if (externalKeyword != null) { | 8713 if (externalKeyword != null) { |
| 8322 return externalKeyword; | 8714 return externalKeyword; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8424 * @param functionDeclaration the the function declaration being wrapped | 8816 * @param functionDeclaration the the function declaration being wrapped |
| 8425 */ | 8817 */ |
| 8426 FunctionDeclarationStatement(FunctionDeclaration functionDeclaration) { | 8818 FunctionDeclarationStatement(FunctionDeclaration functionDeclaration) { |
| 8427 _functionDeclaration = becomeParentOf(functionDeclaration); | 8819 _functionDeclaration = becomeParentOf(functionDeclaration); |
| 8428 } | 8820 } |
| 8429 | 8821 |
| 8430 @override | 8822 @override |
| 8431 Token get beginToken => _functionDeclaration.beginToken; | 8823 Token get beginToken => _functionDeclaration.beginToken; |
| 8432 | 8824 |
| 8433 @override | 8825 @override |
| 8826 Iterable get childEntities => new ChildEntities()..add(_functionDeclaration); |
| 8827 |
| 8828 @override |
| 8434 Token get endToken => _functionDeclaration.endToken; | 8829 Token get endToken => _functionDeclaration.endToken; |
| 8435 | 8830 |
| 8436 /** | 8831 /** |
| 8437 * Return the function declaration being wrapped. | 8832 * Return the function declaration being wrapped. |
| 8438 * | 8833 * |
| 8439 * @return the function declaration being wrapped | 8834 * @return the function declaration being wrapped |
| 8440 */ | 8835 */ |
| 8441 FunctionDeclaration get functionDeclaration => _functionDeclaration; | 8836 FunctionDeclaration get functionDeclaration => _functionDeclaration; |
| 8442 | 8837 |
| 8443 /** | 8838 /** |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8516 /** | 8911 /** |
| 8517 * Set the body of the function to the given function body. | 8912 * Set the body of the function to the given function body. |
| 8518 * | 8913 * |
| 8519 * @param functionBody the body of the function | 8914 * @param functionBody the body of the function |
| 8520 */ | 8915 */ |
| 8521 void set body(FunctionBody functionBody) { | 8916 void set body(FunctionBody functionBody) { |
| 8522 _body = becomeParentOf(functionBody); | 8917 _body = becomeParentOf(functionBody); |
| 8523 } | 8918 } |
| 8524 | 8919 |
| 8525 @override | 8920 @override |
| 8921 Iterable get childEntities => new ChildEntities() |
| 8922 ..add(_parameters) |
| 8923 ..add(_body); |
| 8924 |
| 8925 @override |
| 8526 Token get endToken { | 8926 Token get endToken { |
| 8527 if (_body != null) { | 8927 if (_body != null) { |
| 8528 return _body.endToken; | 8928 return _body.endToken; |
| 8529 } else if (_parameters != null) { | 8929 } else if (_parameters != null) { |
| 8530 return _parameters.endToken; | 8930 return _parameters.endToken; |
| 8531 } | 8931 } |
| 8532 // This should never be reached because external functions must be named, | 8932 // This should never be reached because external functions must be named, |
| 8533 // hence either the body or the name should be non-null. | 8933 // hence either the body or the name should be non-null. |
| 8534 throw new IllegalStateException("Non-external functions must have a body"); | 8934 throw new IllegalStateException("Non-external functions must have a body"); |
| 8535 } | 8935 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8637 * @return the best element available for this function | 9037 * @return the best element available for this function |
| 8638 */ | 9038 */ |
| 8639 ExecutableElement get bestElement { | 9039 ExecutableElement get bestElement { |
| 8640 ExecutableElement element = propagatedElement; | 9040 ExecutableElement element = propagatedElement; |
| 8641 if (element == null) { | 9041 if (element == null) { |
| 8642 element = staticElement; | 9042 element = staticElement; |
| 8643 } | 9043 } |
| 8644 return element; | 9044 return element; |
| 8645 } | 9045 } |
| 8646 | 9046 |
| 9047 /** |
| 9048 * TODO(paulberry): untested. |
| 9049 */ |
| 9050 @override |
| 9051 Iterable get childEntities => new ChildEntities() |
| 9052 ..add(_function) |
| 9053 ..add(_argumentList); |
| 9054 |
| 8647 @override | 9055 @override |
| 8648 Token get endToken => _argumentList.endToken; | 9056 Token get endToken => _argumentList.endToken; |
| 8649 | 9057 |
| 8650 /** | 9058 /** |
| 8651 * Return the expression producing the function being invoked. | 9059 * Return the expression producing the function being invoked. |
| 8652 * | 9060 * |
| 8653 * @return the expression producing the function being invoked | 9061 * @return the expression producing the function being invoked |
| 8654 */ | 9062 */ |
| 8655 Expression get function => _function; | 9063 Expression get function => _function; |
| 8656 | 9064 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8726 TypeName returnType, SimpleIdentifier name, TypeParameterList typeParamete
rs, | 9134 TypeName returnType, SimpleIdentifier name, TypeParameterList typeParamete
rs, |
| 8727 FormalParameterList parameters, Token semicolon) | 9135 FormalParameterList parameters, Token semicolon) |
| 8728 : super(comment, metadata, keyword, semicolon) { | 9136 : super(comment, metadata, keyword, semicolon) { |
| 8729 _returnType = becomeParentOf(returnType); | 9137 _returnType = becomeParentOf(returnType); |
| 8730 _name = becomeParentOf(name); | 9138 _name = becomeParentOf(name); |
| 8731 _typeParameters = becomeParentOf(typeParameters); | 9139 _typeParameters = becomeParentOf(typeParameters); |
| 8732 _parameters = becomeParentOf(parameters); | 9140 _parameters = becomeParentOf(parameters); |
| 8733 } | 9141 } |
| 8734 | 9142 |
| 8735 @override | 9143 @override |
| 9144 Iterable get childEntities => super._childEntities |
| 9145 ..add(keyword) |
| 9146 ..add(_returnType) |
| 9147 ..add(_name) |
| 9148 ..add(_typeParameters) |
| 9149 ..add(_parameters) |
| 9150 ..add(semicolon); |
| 9151 |
| 9152 @override |
| 8736 FunctionTypeAliasElement get element => | 9153 FunctionTypeAliasElement get element => |
| 8737 _name != null ? (_name.staticElement as FunctionTypeAliasElement) : null; | 9154 _name != null ? (_name.staticElement as FunctionTypeAliasElement) : null; |
| 8738 | 9155 |
| 8739 /** | 9156 /** |
| 8740 * Return the name of the function type being declared. | 9157 * Return the name of the function type being declared. |
| 8741 * | 9158 * |
| 8742 * @return the name of the function type being declared | 9159 * @return the name of the function type being declared |
| 8743 */ | 9160 */ |
| 8744 SimpleIdentifier get name => _name; | 9161 SimpleIdentifier get name => _name; |
| 8745 | 9162 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8854 } | 9271 } |
| 8855 | 9272 |
| 8856 @override | 9273 @override |
| 8857 Token get beginToken { | 9274 Token get beginToken { |
| 8858 if (_returnType != null) { | 9275 if (_returnType != null) { |
| 8859 return _returnType.beginToken; | 9276 return _returnType.beginToken; |
| 8860 } | 9277 } |
| 8861 return identifier.beginToken; | 9278 return identifier.beginToken; |
| 8862 } | 9279 } |
| 8863 | 9280 |
| 9281 /** |
| 9282 * TODO(paulberry): untested. |
| 9283 */ |
| 9284 @override |
| 9285 Iterable get childEntities => super._childEntities |
| 9286 ..add(_returnType) |
| 9287 ..add(identifier) |
| 9288 ..add(parameters); |
| 9289 |
| 8864 @override | 9290 @override |
| 8865 Token get endToken => _parameters.endToken; | 9291 Token get endToken => _parameters.endToken; |
| 8866 | 9292 |
| 8867 @override | 9293 @override |
| 8868 bool get isConst => false; | 9294 bool get isConst => false; |
| 8869 | 9295 |
| 8870 @override | 9296 @override |
| 8871 bool get isFinal => false; | 9297 bool get isFinal => false; |
| 8872 | 9298 |
| 8873 /** | 9299 /** |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9366 * | 9792 * |
| 9367 * @param keyword the comma introducing the combinator | 9793 * @param keyword the comma introducing the combinator |
| 9368 * @param hiddenNames the list of names from the library that are hidden by th
is combinator | 9794 * @param hiddenNames the list of names from the library that are hidden by th
is combinator |
| 9369 */ | 9795 */ |
| 9370 HideCombinator(Token keyword, List<SimpleIdentifier> hiddenNames) | 9796 HideCombinator(Token keyword, List<SimpleIdentifier> hiddenNames) |
| 9371 : super(keyword) { | 9797 : super(keyword) { |
| 9372 _hiddenNames = new NodeList<SimpleIdentifier>(this, hiddenNames); | 9798 _hiddenNames = new NodeList<SimpleIdentifier>(this, hiddenNames); |
| 9373 } | 9799 } |
| 9374 | 9800 |
| 9375 @override | 9801 @override |
| 9802 Iterable get childEntities => new ChildEntities() |
| 9803 ..add(keyword) |
| 9804 ..addAll(_hiddenNames); |
| 9805 |
| 9806 @override |
| 9376 Token get endToken => _hiddenNames.endToken; | 9807 Token get endToken => _hiddenNames.endToken; |
| 9377 | 9808 |
| 9378 /** | 9809 /** |
| 9379 * Return the list of names from the library that are hidden by this combinato
r. | 9810 * Return the list of names from the library that are hidden by this combinato
r. |
| 9380 * | 9811 * |
| 9381 * @return the list of names from the library that are hidden by this combinat
or | 9812 * @return the list of names from the library that are hidden by this combinat
or |
| 9382 */ | 9813 */ |
| 9383 NodeList<SimpleIdentifier> get hiddenNames => _hiddenNames; | 9814 NodeList<SimpleIdentifier> get hiddenNames => _hiddenNames; |
| 9384 | 9815 |
| 9385 @override | 9816 @override |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9513 this.rightParenthesis, Statement thenStatement, this.elseKeyword, | 9944 this.rightParenthesis, Statement thenStatement, this.elseKeyword, |
| 9514 Statement elseStatement) { | 9945 Statement elseStatement) { |
| 9515 _condition = becomeParentOf(condition); | 9946 _condition = becomeParentOf(condition); |
| 9516 _thenStatement = becomeParentOf(thenStatement); | 9947 _thenStatement = becomeParentOf(thenStatement); |
| 9517 _elseStatement = becomeParentOf(elseStatement); | 9948 _elseStatement = becomeParentOf(elseStatement); |
| 9518 } | 9949 } |
| 9519 | 9950 |
| 9520 @override | 9951 @override |
| 9521 Token get beginToken => ifKeyword; | 9952 Token get beginToken => ifKeyword; |
| 9522 | 9953 |
| 9954 @override |
| 9955 Iterable get childEntities => new ChildEntities() |
| 9956 ..add(ifKeyword) |
| 9957 ..add(leftParenthesis) |
| 9958 ..add(_condition) |
| 9959 ..add(rightParenthesis) |
| 9960 ..add(_thenStatement) |
| 9961 ..add(elseKeyword) |
| 9962 ..add(_elseStatement); |
| 9963 |
| 9523 /** | 9964 /** |
| 9524 * Return the condition used to determine which of the statements is executed
next. | 9965 * Return the condition used to determine which of the statements is executed
next. |
| 9525 * | 9966 * |
| 9526 * @return the condition used to determine which statement is executed next | 9967 * @return the condition used to determine which statement is executed next |
| 9527 */ | 9968 */ |
| 9528 Expression get condition => _condition; | 9969 Expression get condition => _condition; |
| 9529 | 9970 |
| 9530 /** | 9971 /** |
| 9531 * Set the condition used to determine which of the statements is executed nex
t to the given | 9972 * Set the condition used to determine which of the statements is executed nex
t to the given |
| 9532 * expression. | 9973 * expression. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9617 * @param keyword the token representing the 'implements' keyword | 10058 * @param keyword the token representing the 'implements' keyword |
| 9618 * @param interfaces the interfaces that are being implemented | 10059 * @param interfaces the interfaces that are being implemented |
| 9619 */ | 10060 */ |
| 9620 ImplementsClause(this.keyword, List<TypeName> interfaces) { | 10061 ImplementsClause(this.keyword, List<TypeName> interfaces) { |
| 9621 _interfaces = new NodeList<TypeName>(this, interfaces); | 10062 _interfaces = new NodeList<TypeName>(this, interfaces); |
| 9622 } | 10063 } |
| 9623 | 10064 |
| 9624 @override | 10065 @override |
| 9625 Token get beginToken => keyword; | 10066 Token get beginToken => keyword; |
| 9626 | 10067 |
| 10068 /** |
| 10069 * TODO(paulberry): add commas. |
| 10070 */ |
| 10071 @override |
| 10072 Iterable get childEntities => new ChildEntities() |
| 10073 ..add(keyword) |
| 10074 ..addAll(interfaces); |
| 10075 |
| 9627 @override | 10076 @override |
| 9628 Token get endToken => _interfaces.endToken; | 10077 Token get endToken => _interfaces.endToken; |
| 9629 | 10078 |
| 9630 /** | 10079 /** |
| 9631 * Return the list of the interfaces that are being implemented. | 10080 * Return the list of the interfaces that are being implemented. |
| 9632 * | 10081 * |
| 9633 * @return the list of the interfaces that are being implemented | 10082 * @return the list of the interfaces that are being implemented |
| 9634 */ | 10083 */ |
| 9635 NodeList<TypeName> get interfaces => _interfaces; | 10084 NodeList<TypeName> get interfaces => _interfaces; |
| 9636 | 10085 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9777 * @param semicolon the semicolon terminating the directive | 10226 * @param semicolon the semicolon terminating the directive |
| 9778 */ | 10227 */ |
| 9779 ImportDirective(Comment comment, List<Annotation> metadata, Token keyword, | 10228 ImportDirective(Comment comment, List<Annotation> metadata, Token keyword, |
| 9780 StringLiteral libraryUri, this.deferredToken, this.asToken, | 10229 StringLiteral libraryUri, this.deferredToken, this.asToken, |
| 9781 SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon) | 10230 SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon) |
| 9782 : super(comment, metadata, keyword, libraryUri, combinators, semicolon) { | 10231 : super(comment, metadata, keyword, libraryUri, combinators, semicolon) { |
| 9783 _prefix = becomeParentOf(prefix); | 10232 _prefix = becomeParentOf(prefix); |
| 9784 } | 10233 } |
| 9785 | 10234 |
| 9786 @override | 10235 @override |
| 10236 Iterable get childEntities => super._childEntities |
| 10237 ..add(_uri) |
| 10238 ..add(deferredToken) |
| 10239 ..add(asToken) |
| 10240 ..add(_prefix) |
| 10241 ..addAll(combinators) |
| 10242 ..add(semicolon); |
| 10243 |
| 10244 @override |
| 9787 ImportElement get element => super.element as ImportElement; | 10245 ImportElement get element => super.element as ImportElement; |
| 9788 | 10246 |
| 9789 /** | 10247 /** |
| 9790 * Return the prefix to be used with the imported names, or `null` if the impo
rted names are | 10248 * Return the prefix to be used with the imported names, or `null` if the impo
rted names are |
| 9791 * not prefixed. | 10249 * not prefixed. |
| 9792 * | 10250 * |
| 9793 * @return the prefix to be used with the imported names | 10251 * @return the prefix to be used with the imported names |
| 9794 */ | 10252 */ |
| 9795 SimpleIdentifier get prefix => _prefix; | 10253 SimpleIdentifier get prefix => _prefix; |
| 9796 | 10254 |
| (...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11014 * @return the best element available for this operator | 11472 * @return the best element available for this operator |
| 11015 */ | 11473 */ |
| 11016 MethodElement get bestElement { | 11474 MethodElement get bestElement { |
| 11017 MethodElement element = propagatedElement; | 11475 MethodElement element = propagatedElement; |
| 11018 if (element == null) { | 11476 if (element == null) { |
| 11019 element = staticElement; | 11477 element = staticElement; |
| 11020 } | 11478 } |
| 11021 return element; | 11479 return element; |
| 11022 } | 11480 } |
| 11023 | 11481 |
| 11482 /** |
| 11483 * TODO(paulberry): untested. |
| 11484 */ |
| 11485 @override |
| 11486 Iterable get childEntities => new ChildEntities() |
| 11487 ..add(_target) |
| 11488 ..add(period) |
| 11489 ..add(leftBracket) |
| 11490 ..add(_index) |
| 11491 ..add(rightBracket); |
| 11492 |
| 11024 @override | 11493 @override |
| 11025 Token get endToken => rightBracket; | 11494 Token get endToken => rightBracket; |
| 11026 | 11495 |
| 11027 /** | 11496 /** |
| 11028 * Return the expression used to compute the index. | 11497 * Return the expression used to compute the index. |
| 11029 * | 11498 * |
| 11030 * @return the expression used to compute the index | 11499 * @return the expression used to compute the index |
| 11031 */ | 11500 */ |
| 11032 Expression get index => _index; | 11501 Expression get index => _index; |
| 11033 | 11502 |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11252 * | 11721 * |
| 11253 * @param argumentList the list of arguments to the constructor | 11722 * @param argumentList the list of arguments to the constructor |
| 11254 */ | 11723 */ |
| 11255 void set argumentList(ArgumentList argumentList) { | 11724 void set argumentList(ArgumentList argumentList) { |
| 11256 _argumentList = becomeParentOf(argumentList); | 11725 _argumentList = becomeParentOf(argumentList); |
| 11257 } | 11726 } |
| 11258 | 11727 |
| 11259 @override | 11728 @override |
| 11260 Token get beginToken => keyword; | 11729 Token get beginToken => keyword; |
| 11261 | 11730 |
| 11731 @override |
| 11732 Iterable get childEntities => new ChildEntities() |
| 11733 ..add(keyword) |
| 11734 ..add(_constructorName) |
| 11735 ..add(_argumentList); |
| 11736 |
| 11262 /** | 11737 /** |
| 11263 * Return the name of the constructor to be invoked. | 11738 * Return the name of the constructor to be invoked. |
| 11264 * | 11739 * |
| 11265 * @return the name of the constructor to be invoked | 11740 * @return the name of the constructor to be invoked |
| 11266 */ | 11741 */ |
| 11267 ConstructorName get constructorName => _constructorName; | 11742 ConstructorName get constructorName => _constructorName; |
| 11268 | 11743 |
| 11269 /** | 11744 /** |
| 11270 * Set the name of the constructor to be invoked to the given name. | 11745 * Set the name of the constructor to be invoked to the given name. |
| 11271 * | 11746 * |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11330 * Initialize a newly created integer literal. | 11805 * Initialize a newly created integer literal. |
| 11331 * | 11806 * |
| 11332 * @param literal the token representing the literal | 11807 * @param literal the token representing the literal |
| 11333 * @param value the value of the literal | 11808 * @param value the value of the literal |
| 11334 */ | 11809 */ |
| 11335 IntegerLiteral(this.literal, this.value); | 11810 IntegerLiteral(this.literal, this.value); |
| 11336 | 11811 |
| 11337 @override | 11812 @override |
| 11338 Token get beginToken => literal; | 11813 Token get beginToken => literal; |
| 11339 | 11814 |
| 11815 /** |
| 11816 * TODO(paulberry): untested. |
| 11817 */ |
| 11818 @override |
| 11819 Iterable get childEntities => new ChildEntities()..add(literal); |
| 11820 |
| 11340 @override | 11821 @override |
| 11341 Token get endToken => literal; | 11822 Token get endToken => literal; |
| 11342 | 11823 |
| 11343 @override | 11824 @override |
| 11344 accept(AstVisitor visitor) => visitor.visitIntegerLiteral(this); | 11825 accept(AstVisitor visitor) => visitor.visitIntegerLiteral(this); |
| 11345 | 11826 |
| 11346 @override | 11827 @override |
| 11347 void visitChildren(AstVisitor visitor) { | 11828 void visitChildren(AstVisitor visitor) { |
| 11348 // There are no children to visit. | 11829 // There are no children to visit. |
| 11349 } | 11830 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11398 */ | 11879 */ |
| 11399 InterpolationExpression(this.leftBracket, Expression expression, | 11880 InterpolationExpression(this.leftBracket, Expression expression, |
| 11400 this.rightBracket) { | 11881 this.rightBracket) { |
| 11401 _expression = becomeParentOf(expression); | 11882 _expression = becomeParentOf(expression); |
| 11402 } | 11883 } |
| 11403 | 11884 |
| 11404 @override | 11885 @override |
| 11405 Token get beginToken => leftBracket; | 11886 Token get beginToken => leftBracket; |
| 11406 | 11887 |
| 11407 @override | 11888 @override |
| 11889 Iterable get childEntities => new ChildEntities() |
| 11890 ..add(leftBracket) |
| 11891 ..add(_expression) |
| 11892 ..add(rightBracket); |
| 11893 |
| 11894 @override |
| 11408 Token get endToken { | 11895 Token get endToken { |
| 11409 if (rightBracket != null) { | 11896 if (rightBracket != null) { |
| 11410 return rightBracket; | 11897 return rightBracket; |
| 11411 } | 11898 } |
| 11412 return _expression.endToken; | 11899 return _expression.endToken; |
| 11413 } | 11900 } |
| 11414 | 11901 |
| 11415 /** | 11902 /** |
| 11416 * Return the expression to be evaluated for the value to be converted into a
string. | 11903 * Return the expression to be evaluated for the value to be converted into a
string. |
| 11417 * | 11904 * |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11465 * @param value the value of the literal | 11952 * @param value the value of the literal |
| 11466 */ | 11953 */ |
| 11467 InterpolationString(this.contents, String value) { | 11954 InterpolationString(this.contents, String value) { |
| 11468 _value = value; | 11955 _value = value; |
| 11469 } | 11956 } |
| 11470 | 11957 |
| 11471 @override | 11958 @override |
| 11472 Token get beginToken => contents; | 11959 Token get beginToken => contents; |
| 11473 | 11960 |
| 11474 /** | 11961 /** |
| 11962 * TODO(paulberry): untested. |
| 11963 */ |
| 11964 @override |
| 11965 Iterable get childEntities => new ChildEntities()..add(contents); |
| 11966 |
| 11967 /** |
| 11475 * Return the offset of the after-last contents character. | 11968 * Return the offset of the after-last contents character. |
| 11476 */ | 11969 */ |
| 11477 int get contentsEnd { | 11970 int get contentsEnd { |
| 11478 int end = contents.end; | 11971 int end = contents.end; |
| 11479 String lexeme = contents.lexeme; | 11972 String lexeme = contents.lexeme; |
| 11480 if (StringUtilities.endsWith3(lexeme, 0x22, 0x22, 0x22) || | 11973 if (StringUtilities.endsWith3(lexeme, 0x22, 0x22, 0x22) || |
| 11481 StringUtilities.endsWith3(lexeme, 0x27, 0x27, 0x27)) { | 11974 StringUtilities.endsWith3(lexeme, 0x27, 0x27, 0x27)) { |
| 11482 end -= 3; | 11975 end -= 3; |
| 11483 } else { | 11976 } else { |
| 11484 end -= 1; | 11977 end -= 1; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11571 IsExpression(Expression expression, this.isOperator, this.notOperator, | 12064 IsExpression(Expression expression, this.isOperator, this.notOperator, |
| 11572 TypeName type) { | 12065 TypeName type) { |
| 11573 _expression = becomeParentOf(expression); | 12066 _expression = becomeParentOf(expression); |
| 11574 _type = becomeParentOf(type); | 12067 _type = becomeParentOf(type); |
| 11575 } | 12068 } |
| 11576 | 12069 |
| 11577 @override | 12070 @override |
| 11578 Token get beginToken => _expression.beginToken; | 12071 Token get beginToken => _expression.beginToken; |
| 11579 | 12072 |
| 11580 @override | 12073 @override |
| 12074 Iterable get childEntities => new ChildEntities() |
| 12075 ..add(_expression) |
| 12076 ..add(isOperator) |
| 12077 ..add(notOperator) |
| 12078 ..add(_type); |
| 12079 |
| 12080 @override |
| 11581 Token get endToken => _type.endToken; | 12081 Token get endToken => _type.endToken; |
| 11582 | 12082 |
| 11583 /** | 12083 /** |
| 11584 * Return the expression used to compute the value whose type is being tested. | 12084 * Return the expression used to compute the value whose type is being tested. |
| 11585 * | 12085 * |
| 11586 * @return the expression used to compute the value whose type is being tested | 12086 * @return the expression used to compute the value whose type is being tested |
| 11587 */ | 12087 */ |
| 11588 Expression get expression => _expression; | 12088 Expression get expression => _expression; |
| 11589 | 12089 |
| 11590 /** | 12090 /** |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11651 * @param label the label being applied | 12151 * @param label the label being applied |
| 11652 * @param colon the colon that separates the label from whatever follows | 12152 * @param colon the colon that separates the label from whatever follows |
| 11653 */ | 12153 */ |
| 11654 Label(SimpleIdentifier label, this.colon) { | 12154 Label(SimpleIdentifier label, this.colon) { |
| 11655 _label = becomeParentOf(label); | 12155 _label = becomeParentOf(label); |
| 11656 } | 12156 } |
| 11657 | 12157 |
| 11658 @override | 12158 @override |
| 11659 Token get beginToken => _label.beginToken; | 12159 Token get beginToken => _label.beginToken; |
| 11660 | 12160 |
| 12161 /** |
| 12162 * TODO(paulberry): untested. |
| 12163 */ |
| 12164 @override |
| 12165 Iterable get childEntities => new ChildEntities() |
| 12166 ..add(_label) |
| 12167 ..add(colon); |
| 12168 |
| 11661 @override | 12169 @override |
| 11662 Token get endToken => colon; | 12170 Token get endToken => colon; |
| 11663 | 12171 |
| 11664 /** | 12172 /** |
| 11665 * Return the label being associated with the statement. | 12173 * Return the label being associated with the statement. |
| 11666 * | 12174 * |
| 11667 * @return the label being associated with the statement | 12175 * @return the label being associated with the statement |
| 11668 */ | 12176 */ |
| 11669 SimpleIdentifier get label => _label; | 12177 SimpleIdentifier get label => _label; |
| 11670 | 12178 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11718 } | 12226 } |
| 11719 | 12227 |
| 11720 @override | 12228 @override |
| 11721 Token get beginToken { | 12229 Token get beginToken { |
| 11722 if (!_labels.isEmpty) { | 12230 if (!_labels.isEmpty) { |
| 11723 return _labels.beginToken; | 12231 return _labels.beginToken; |
| 11724 } | 12232 } |
| 11725 return _statement.beginToken; | 12233 return _statement.beginToken; |
| 11726 } | 12234 } |
| 11727 | 12235 |
| 12236 /** |
| 12237 * TODO(paulberry): untested. |
| 12238 */ |
| 12239 @override |
| 12240 Iterable get childEntities => new ChildEntities() |
| 12241 ..addAll(_labels) |
| 12242 ..add(_statement); |
| 12243 |
| 11728 @override | 12244 @override |
| 11729 Token get endToken => _statement.endToken; | 12245 Token get endToken => _statement.endToken; |
| 11730 | 12246 |
| 11731 /** | 12247 /** |
| 11732 * Return the labels being associated with the statement. | 12248 * Return the labels being associated with the statement. |
| 11733 * | 12249 * |
| 11734 * @return the labels being associated with the statement | 12250 * @return the labels being associated with the statement |
| 11735 */ | 12251 */ |
| 11736 NodeList<Label> get labels => _labels; | 12252 NodeList<Label> get labels => _labels; |
| 11737 | 12253 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11797 * @param name the name of the library being defined | 12313 * @param name the name of the library being defined |
| 11798 * @param semicolon the semicolon terminating the directive | 12314 * @param semicolon the semicolon terminating the directive |
| 11799 */ | 12315 */ |
| 11800 LibraryDirective(Comment comment, List<Annotation> metadata, | 12316 LibraryDirective(Comment comment, List<Annotation> metadata, |
| 11801 this.libraryToken, LibraryIdentifier name, this.semicolon) | 12317 this.libraryToken, LibraryIdentifier name, this.semicolon) |
| 11802 : super(comment, metadata) { | 12318 : super(comment, metadata) { |
| 11803 _name = becomeParentOf(name); | 12319 _name = becomeParentOf(name); |
| 11804 } | 12320 } |
| 11805 | 12321 |
| 11806 @override | 12322 @override |
| 12323 Iterable get childEntities => super._childEntities |
| 12324 ..add(libraryToken) |
| 12325 ..add(_name) |
| 12326 ..add(semicolon); |
| 12327 |
| 12328 @override |
| 11807 Token get endToken => semicolon; | 12329 Token get endToken => semicolon; |
| 11808 | 12330 |
| 11809 @override | 12331 @override |
| 11810 Token get firstTokenAfterCommentAndMetadata => libraryToken; | 12332 Token get firstTokenAfterCommentAndMetadata => libraryToken; |
| 11811 | 12333 |
| 11812 @override | 12334 @override |
| 11813 Token get keyword => libraryToken; | 12335 Token get keyword => libraryToken; |
| 11814 | 12336 |
| 11815 /** | 12337 /** |
| 11816 * Return the name of the library being defined. | 12338 * Return the name of the library being defined. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11861 _components = new NodeList<SimpleIdentifier>(this, components); | 12383 _components = new NodeList<SimpleIdentifier>(this, components); |
| 11862 } | 12384 } |
| 11863 | 12385 |
| 11864 @override | 12386 @override |
| 11865 Token get beginToken => _components.beginToken; | 12387 Token get beginToken => _components.beginToken; |
| 11866 | 12388 |
| 11867 @override | 12389 @override |
| 11868 Element get bestElement => staticElement; | 12390 Element get bestElement => staticElement; |
| 11869 | 12391 |
| 11870 /** | 12392 /** |
| 12393 * TODO(paulberry): add "." tokens. |
| 12394 */ |
| 12395 @override |
| 12396 Iterable get childEntities => new ChildEntities()..addAll(_components); |
| 12397 |
| 12398 /** |
| 11871 * Return the components of the identifier. | 12399 * Return the components of the identifier. |
| 11872 * | 12400 * |
| 11873 * @return the components of the identifier | 12401 * @return the components of the identifier |
| 11874 */ | 12402 */ |
| 11875 NodeList<SimpleIdentifier> get components => _components; | 12403 NodeList<SimpleIdentifier> get components => _components; |
| 11876 | 12404 |
| 11877 @override | 12405 @override |
| 11878 Token get endToken => _components.endToken; | 12406 Token get endToken => _components.endToken; |
| 11879 | 12407 |
| 11880 @override | 12408 @override |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11956 return constKeyword; | 12484 return constKeyword; |
| 11957 } | 12485 } |
| 11958 TypeArgumentList typeArguments = this.typeArguments; | 12486 TypeArgumentList typeArguments = this.typeArguments; |
| 11959 if (typeArguments != null) { | 12487 if (typeArguments != null) { |
| 11960 return typeArguments.beginToken; | 12488 return typeArguments.beginToken; |
| 11961 } | 12489 } |
| 11962 return leftBracket; | 12490 return leftBracket; |
| 11963 } | 12491 } |
| 11964 | 12492 |
| 11965 /** | 12493 /** |
| 12494 * TODO(paulberry): add commas. |
| 12495 */ |
| 12496 @override |
| 12497 Iterable get childEntities => super._childEntities |
| 12498 ..add(leftBracket) |
| 12499 ..addAll(_elements) |
| 12500 ..add(rightBracket); |
| 12501 |
| 12502 /** |
| 11966 * Return the expressions used to compute the elements of the list. | 12503 * Return the expressions used to compute the elements of the list. |
| 11967 * | 12504 * |
| 11968 * @return the expressions used to compute the elements of the list | 12505 * @return the expressions used to compute the elements of the list |
| 11969 */ | 12506 */ |
| 11970 NodeList<Expression> get elements => _elements; | 12507 NodeList<Expression> get elements => _elements; |
| 11971 | 12508 |
| 11972 @override | 12509 @override |
| 11973 Token get endToken => rightBracket; | 12510 Token get endToken => rightBracket; |
| 11974 | 12511 |
| 11975 @override | 12512 @override |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12047 if (constKeyword != null) { | 12584 if (constKeyword != null) { |
| 12048 return constKeyword; | 12585 return constKeyword; |
| 12049 } | 12586 } |
| 12050 TypeArgumentList typeArguments = this.typeArguments; | 12587 TypeArgumentList typeArguments = this.typeArguments; |
| 12051 if (typeArguments != null) { | 12588 if (typeArguments != null) { |
| 12052 return typeArguments.beginToken; | 12589 return typeArguments.beginToken; |
| 12053 } | 12590 } |
| 12054 return leftBracket; | 12591 return leftBracket; |
| 12055 } | 12592 } |
| 12056 | 12593 |
| 12594 /** |
| 12595 * TODO(paulberry): untested. |
| 12596 * TODO(paulberry): add commas. |
| 12597 */ |
| 12598 @override |
| 12599 Iterable get childEntities => super._childEntities |
| 12600 ..add(leftBracket) |
| 12601 ..addAll(entries) |
| 12602 ..add(rightBracket); |
| 12603 |
| 12057 @override | 12604 @override |
| 12058 Token get endToken => rightBracket; | 12605 Token get endToken => rightBracket; |
| 12059 | 12606 |
| 12060 /** | 12607 /** |
| 12061 * Return the entries in the map. | 12608 * Return the entries in the map. |
| 12062 * | 12609 * |
| 12063 * @return the entries in the map | 12610 * @return the entries in the map |
| 12064 */ | 12611 */ |
| 12065 NodeList<MapLiteralEntry> get entries => _entries; | 12612 NodeList<MapLiteralEntry> get entries => _entries; |
| 12066 | 12613 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12107 * @param value the expression computing the value that will be associated wit
h the key | 12654 * @param value the expression computing the value that will be associated wit
h the key |
| 12108 */ | 12655 */ |
| 12109 MapLiteralEntry(Expression key, this.separator, Expression value) { | 12656 MapLiteralEntry(Expression key, this.separator, Expression value) { |
| 12110 _key = becomeParentOf(key); | 12657 _key = becomeParentOf(key); |
| 12111 _value = becomeParentOf(value); | 12658 _value = becomeParentOf(value); |
| 12112 } | 12659 } |
| 12113 | 12660 |
| 12114 @override | 12661 @override |
| 12115 Token get beginToken => _key.beginToken; | 12662 Token get beginToken => _key.beginToken; |
| 12116 | 12663 |
| 12664 /** |
| 12665 * TODO(paulberry): untested. |
| 12666 */ |
| 12667 @override |
| 12668 Iterable get childEntities => new ChildEntities() |
| 12669 ..add(_key) |
| 12670 ..add(separator) |
| 12671 ..add(_value); |
| 12672 |
| 12117 @override | 12673 @override |
| 12118 Token get endToken => _value.endToken; | 12674 Token get endToken => _value.endToken; |
| 12119 | 12675 |
| 12120 /** | 12676 /** |
| 12121 * Return the expression computing the key with which the value will be associ
ated. | 12677 * Return the expression computing the key with which the value will be associ
ated. |
| 12122 * | 12678 * |
| 12123 * @return the expression computing the key with which the value will be assoc
iated | 12679 * @return the expression computing the key with which the value will be assoc
iated |
| 12124 */ | 12680 */ |
| 12125 Expression get key => _key; | 12681 Expression get key => _key; |
| 12126 | 12682 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12256 | 12812 |
| 12257 /** | 12813 /** |
| 12258 * Set the body of the method to the given function body. | 12814 * Set the body of the method to the given function body. |
| 12259 * | 12815 * |
| 12260 * @param functionBody the body of the method | 12816 * @param functionBody the body of the method |
| 12261 */ | 12817 */ |
| 12262 void set body(FunctionBody functionBody) { | 12818 void set body(FunctionBody functionBody) { |
| 12263 _body = becomeParentOf(functionBody); | 12819 _body = becomeParentOf(functionBody); |
| 12264 } | 12820 } |
| 12265 | 12821 |
| 12822 @override |
| 12823 Iterable get childEntities => super._childEntities |
| 12824 ..add(externalKeyword) |
| 12825 ..add(modifierKeyword) |
| 12826 ..add(_returnType) |
| 12827 ..add(propertyKeyword) |
| 12828 ..add(operatorKeyword) |
| 12829 ..add(_name) |
| 12830 ..add(_parameters) |
| 12831 ..add(_body); |
| 12832 |
| 12266 /** | 12833 /** |
| 12267 * Return the element associated with this method, or `null` if the AST struct
ure has not | 12834 * Return the element associated with this method, or `null` if the AST struct
ure has not |
| 12268 * been resolved. The element can either be a [MethodElement], if this represe
nts the | 12835 * been resolved. The element can either be a [MethodElement], if this represe
nts the |
| 12269 * declaration of a normal method, or a [PropertyAccessorElement] if this repr
esents the | 12836 * declaration of a normal method, or a [PropertyAccessorElement] if this repr
esents the |
| 12270 * declaration of either a getter or a setter. | 12837 * declaration of either a getter or a setter. |
| 12271 * | 12838 * |
| 12272 * @return the element associated with this method | 12839 * @return the element associated with this method |
| 12273 */ | 12840 */ |
| 12274 @override | 12841 @override |
| 12275 ExecutableElement get element => | 12842 ExecutableElement get element => |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12466 Token get beginToken { | 13033 Token get beginToken { |
| 12467 if (_target != null) { | 13034 if (_target != null) { |
| 12468 return _target.beginToken; | 13035 return _target.beginToken; |
| 12469 } else if (period != null) { | 13036 } else if (period != null) { |
| 12470 return period; | 13037 return period; |
| 12471 } | 13038 } |
| 12472 return _methodName.beginToken; | 13039 return _methodName.beginToken; |
| 12473 } | 13040 } |
| 12474 | 13041 |
| 12475 @override | 13042 @override |
| 13043 Iterable get childEntities => new ChildEntities() |
| 13044 ..add(_target) |
| 13045 ..add(period) |
| 13046 ..add(_methodName) |
| 13047 ..add(_argumentList); |
| 13048 |
| 13049 @override |
| 12476 Token get endToken => _argumentList.endToken; | 13050 Token get endToken => _argumentList.endToken; |
| 12477 | 13051 |
| 12478 /** | 13052 /** |
| 12479 * Return `true` if this expression is cascaded. If it is, then the target of
this | 13053 * Return `true` if this expression is cascaded. If it is, then the target of
this |
| 12480 * expression is not stored locally but is stored in the nearest ancestor that
is a | 13054 * expression is not stored locally but is stored in the nearest ancestor that
is a |
| 12481 * [CascadeExpression]. | 13055 * [CascadeExpression]. |
| 12482 * | 13056 * |
| 12483 * @return `true` if this expression is cascaded | 13057 * @return `true` if this expression is cascaded |
| 12484 */ | 13058 */ |
| 12485 bool get isCascaded => | 13059 bool get isCascaded => |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12584 * @param expression the expression with which the name is associated | 13158 * @param expression the expression with which the name is associated |
| 12585 */ | 13159 */ |
| 12586 NamedExpression(Label name, Expression expression) { | 13160 NamedExpression(Label name, Expression expression) { |
| 12587 _name = becomeParentOf(name); | 13161 _name = becomeParentOf(name); |
| 12588 _expression = becomeParentOf(expression); | 13162 _expression = becomeParentOf(expression); |
| 12589 } | 13163 } |
| 12590 | 13164 |
| 12591 @override | 13165 @override |
| 12592 Token get beginToken => _name.beginToken; | 13166 Token get beginToken => _name.beginToken; |
| 12593 | 13167 |
| 13168 @override |
| 13169 Iterable get childEntities => new ChildEntities() |
| 13170 ..add(_name) |
| 13171 ..add(_expression); |
| 13172 |
| 12594 /** | 13173 /** |
| 12595 * Return the element representing the parameter being named by this expressio
n, or `null` | 13174 * Return the element representing the parameter being named by this expressio
n, or `null` |
| 12596 * if the AST structure has not been resolved or if there is no parameter with
the same name as | 13175 * if the AST structure has not been resolved or if there is no parameter with
the same name as |
| 12597 * this expression. | 13176 * this expression. |
| 12598 * | 13177 * |
| 12599 * @return the element representing the parameter being named by this expressi
on | 13178 * @return the element representing the parameter being named by this expressi
on |
| 12600 */ | 13179 */ |
| 12601 ParameterElement get element { | 13180 ParameterElement get element { |
| 12602 Element element = _name.label.staticElement; | 13181 Element element = _name.label.staticElement; |
| 12603 if (element is ParameterElement) { | 13182 if (element is ParameterElement) { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12739 * @param keyword the token representing the 'native' keyword | 13318 * @param keyword the token representing the 'native' keyword |
| 12740 * @param name the name of the native object that implements the class. | 13319 * @param name the name of the native object that implements the class. |
| 12741 */ | 13320 */ |
| 12742 NativeClause(this.keyword, StringLiteral name) { | 13321 NativeClause(this.keyword, StringLiteral name) { |
| 12743 _name = becomeParentOf(name); | 13322 _name = becomeParentOf(name); |
| 12744 } | 13323 } |
| 12745 | 13324 |
| 12746 @override | 13325 @override |
| 12747 Token get beginToken => keyword; | 13326 Token get beginToken => keyword; |
| 12748 | 13327 |
| 13328 /** |
| 13329 * TODO(paulberry): untested. |
| 13330 */ |
| 13331 @override |
| 13332 Iterable get childEntities => new ChildEntities() |
| 13333 ..add(keyword) |
| 13334 ..add(_name); |
| 13335 |
| 12749 @override | 13336 @override |
| 12750 Token get endToken => _name.endToken; | 13337 Token get endToken => _name.endToken; |
| 12751 | 13338 |
| 12752 /** | 13339 /** |
| 12753 * Return the name of the native object that implements the class. | 13340 * Return the name of the native object that implements the class. |
| 12754 * | 13341 * |
| 12755 * @return the name of the native object that implements the class | 13342 * @return the name of the native object that implements the class |
| 12756 */ | 13343 */ |
| 12757 StringLiteral get name => _name; | 13344 StringLiteral get name => _name; |
| 12758 | 13345 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12808 * @param semicolon the token representing the semicolon that marks the end of
the function body | 13395 * @param semicolon the token representing the semicolon that marks the end of
the function body |
| 12809 */ | 13396 */ |
| 12810 NativeFunctionBody(this.nativeToken, StringLiteral stringLiteral, | 13397 NativeFunctionBody(this.nativeToken, StringLiteral stringLiteral, |
| 12811 this.semicolon) { | 13398 this.semicolon) { |
| 12812 _stringLiteral = becomeParentOf(stringLiteral); | 13399 _stringLiteral = becomeParentOf(stringLiteral); |
| 12813 } | 13400 } |
| 12814 | 13401 |
| 12815 @override | 13402 @override |
| 12816 Token get beginToken => nativeToken; | 13403 Token get beginToken => nativeToken; |
| 12817 | 13404 |
| 13405 /** |
| 13406 * TODO(paulberry): untested. |
| 13407 */ |
| 13408 @override |
| 13409 Iterable get childEntities => new ChildEntities() |
| 13410 ..add(nativeToken) |
| 13411 ..add(_stringLiteral) |
| 13412 ..add(semicolon); |
| 13413 |
| 12818 @override | 13414 @override |
| 12819 Token get endToken => semicolon; | 13415 Token get endToken => semicolon; |
| 12820 | 13416 |
| 12821 /** | 13417 /** |
| 12822 * Return the string literal representing the string after the 'native' token. | 13418 * Return the string literal representing the string after the 'native' token. |
| 12823 * | 13419 * |
| 12824 * @return the string literal representing the string after the 'native' token | 13420 * @return the string literal representing the string after the 'native' token |
| 12825 */ | 13421 */ |
| 12826 StringLiteral get stringLiteral => _stringLiteral; | 13422 StringLiteral get stringLiteral => _stringLiteral; |
| 12827 | 13423 |
| (...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14346 * @return the comment and annotations associated with this parameter in the o
rder in which they | 14942 * @return the comment and annotations associated with this parameter in the o
rder in which they |
| 14347 * appeared in the original source | 14943 * appeared in the original source |
| 14348 */ | 14944 */ |
| 14349 List<AstNode> get sortedCommentAndAnnotations { | 14945 List<AstNode> get sortedCommentAndAnnotations { |
| 14350 return <AstNode>[] | 14946 return <AstNode>[] |
| 14351 ..add(_comment) | 14947 ..add(_comment) |
| 14352 ..addAll(_metadata) | 14948 ..addAll(_metadata) |
| 14353 ..sort(AstNode.LEXICAL_ORDER); | 14949 ..sort(AstNode.LEXICAL_ORDER); |
| 14354 } | 14950 } |
| 14355 | 14951 |
| 14952 ChildEntities get _childEntities { |
| 14953 ChildEntities result = new ChildEntities(); |
| 14954 if (_commentIsBeforeAnnotations()) { |
| 14955 result |
| 14956 ..add(_comment) |
| 14957 ..addAll(_metadata); |
| 14958 } else { |
| 14959 result.addAll(sortedCommentAndAnnotations); |
| 14960 } |
| 14961 return result; |
| 14962 } |
| 14963 |
| 14356 @override | 14964 @override |
| 14357 void visitChildren(AstVisitor visitor) { | 14965 void visitChildren(AstVisitor visitor) { |
| 14358 // | 14966 // |
| 14359 // Note that subclasses are responsible for visiting the identifier because | 14967 // Note that subclasses are responsible for visiting the identifier because |
| 14360 // they often need to visit other nodes before visiting the identifier. | 14968 // they often need to visit other nodes before visiting the identifier. |
| 14361 // | 14969 // |
| 14362 if (_commentIsBeforeAnnotations()) { | 14970 if (_commentIsBeforeAnnotations()) { |
| 14363 safelyVisitChild(_comment, visitor); | 14971 safelyVisitChild(_comment, visitor); |
| 14364 _metadata.accept(visitor); | 14972 _metadata.accept(visitor); |
| 14365 } else { | 14973 } else { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14400 /** | 15008 /** |
| 14401 * Initialize a newly created null literal. | 15009 * Initialize a newly created null literal. |
| 14402 * | 15010 * |
| 14403 * @param token the token representing the literal | 15011 * @param token the token representing the literal |
| 14404 */ | 15012 */ |
| 14405 NullLiteral(this.literal); | 15013 NullLiteral(this.literal); |
| 14406 | 15014 |
| 14407 @override | 15015 @override |
| 14408 Token get beginToken => literal; | 15016 Token get beginToken => literal; |
| 14409 | 15017 |
| 15018 /** |
| 15019 * TODO(paulberry): untested. |
| 15020 */ |
| 15021 @override |
| 15022 Iterable get childEntities => new ChildEntities()..add(literal); |
| 15023 |
| 14410 @override | 15024 @override |
| 14411 Token get endToken => literal; | 15025 Token get endToken => literal; |
| 14412 | 15026 |
| 14413 @override | 15027 @override |
| 14414 accept(AstVisitor visitor) => visitor.visitNullLiteral(this); | 15028 accept(AstVisitor visitor) => visitor.visitNullLiteral(this); |
| 14415 | 15029 |
| 14416 @override | 15030 @override |
| 14417 void visitChildren(AstVisitor visitor) { | 15031 void visitChildren(AstVisitor visitor) { |
| 14418 // There are no children to visit. | 15032 // There are no children to visit. |
| 14419 } | 15033 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14452 */ | 15066 */ |
| 14453 ParenthesizedExpression(this.leftParenthesis, Expression expression, | 15067 ParenthesizedExpression(this.leftParenthesis, Expression expression, |
| 14454 this.rightParenthesis) { | 15068 this.rightParenthesis) { |
| 14455 _expression = becomeParentOf(expression); | 15069 _expression = becomeParentOf(expression); |
| 14456 } | 15070 } |
| 14457 | 15071 |
| 14458 @override | 15072 @override |
| 14459 Token get beginToken => leftParenthesis; | 15073 Token get beginToken => leftParenthesis; |
| 14460 | 15074 |
| 14461 @override | 15075 @override |
| 15076 Iterable get childEntities => new ChildEntities() |
| 15077 ..add(leftParenthesis) |
| 15078 ..add(_expression) |
| 15079 ..add(rightParenthesis); |
| 15080 |
| 15081 @override |
| 14462 Token get endToken => rightParenthesis; | 15082 Token get endToken => rightParenthesis; |
| 14463 | 15083 |
| 14464 /** | 15084 /** |
| 14465 * Return the expression within the parentheses. | 15085 * Return the expression within the parentheses. |
| 14466 * | 15086 * |
| 14467 * @return the expression within the parentheses | 15087 * @return the expression within the parentheses |
| 14468 */ | 15088 */ |
| 14469 Expression get expression => _expression; | 15089 Expression get expression => _expression; |
| 14470 | 15090 |
| 14471 /** | 15091 /** |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14514 * @param comment the documentation comment associated with this directive | 15134 * @param comment the documentation comment associated with this directive |
| 14515 * @param metadata the annotations associated with the directive | 15135 * @param metadata the annotations associated with the directive |
| 14516 * @param partToken the token representing the 'part' token | 15136 * @param partToken the token representing the 'part' token |
| 14517 * @param partUri the URI of the part being included | 15137 * @param partUri the URI of the part being included |
| 14518 * @param semicolon the semicolon terminating the directive | 15138 * @param semicolon the semicolon terminating the directive |
| 14519 */ | 15139 */ |
| 14520 PartDirective(Comment comment, List<Annotation> metadata, this.partToken, | 15140 PartDirective(Comment comment, List<Annotation> metadata, this.partToken, |
| 14521 StringLiteral partUri, this.semicolon) | 15141 StringLiteral partUri, this.semicolon) |
| 14522 : super(comment, metadata, partUri); | 15142 : super(comment, metadata, partUri); |
| 14523 | 15143 |
| 15144 /** |
| 15145 * TODO(paulberry): untested. |
| 15146 */ |
| 15147 @override |
| 15148 Iterable get childEntities => super._childEntities |
| 15149 ..add(partToken) |
| 15150 ..add(_uri) |
| 15151 ..add(semicolon); |
| 15152 |
| 14524 @override | 15153 @override |
| 14525 Token get endToken => semicolon; | 15154 Token get endToken => semicolon; |
| 14526 | 15155 |
| 14527 @override | 15156 @override |
| 14528 Token get firstTokenAfterCommentAndMetadata => partToken; | 15157 Token get firstTokenAfterCommentAndMetadata => partToken; |
| 14529 | 15158 |
| 14530 @override | 15159 @override |
| 14531 Token get keyword => partToken; | 15160 Token get keyword => partToken; |
| 14532 | 15161 |
| 14533 @override | 15162 @override |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14576 * @param libraryName the name of the library that the containing compilation
unit is part of | 15205 * @param libraryName the name of the library that the containing compilation
unit is part of |
| 14577 * @param semicolon the semicolon terminating the directive | 15206 * @param semicolon the semicolon terminating the directive |
| 14578 */ | 15207 */ |
| 14579 PartOfDirective(Comment comment, List<Annotation> metadata, this.partToken, | 15208 PartOfDirective(Comment comment, List<Annotation> metadata, this.partToken, |
| 14580 this.ofToken, LibraryIdentifier libraryName, this.semicolon) | 15209 this.ofToken, LibraryIdentifier libraryName, this.semicolon) |
| 14581 : super(comment, metadata) { | 15210 : super(comment, metadata) { |
| 14582 _libraryName = becomeParentOf(libraryName); | 15211 _libraryName = becomeParentOf(libraryName); |
| 14583 } | 15212 } |
| 14584 | 15213 |
| 14585 @override | 15214 @override |
| 15215 Iterable get childEntities => super._childEntities |
| 15216 ..add(partToken) |
| 15217 ..add(ofToken) |
| 15218 ..add(_libraryName) |
| 15219 ..add(semicolon); |
| 15220 |
| 15221 @override |
| 14586 Token get endToken => semicolon; | 15222 Token get endToken => semicolon; |
| 14587 | 15223 |
| 14588 @override | 15224 @override |
| 14589 Token get firstTokenAfterCommentAndMetadata => partToken; | 15225 Token get firstTokenAfterCommentAndMetadata => partToken; |
| 14590 | 15226 |
| 14591 @override | 15227 @override |
| 14592 Token get keyword => partToken; | 15228 Token get keyword => partToken; |
| 14593 | 15229 |
| 14594 /** | 15230 /** |
| 14595 * Return the name of the library that the containing compilation unit is part
of. | 15231 * Return the name of the library that the containing compilation unit is part
of. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14672 * @return the best element available for this operator | 15308 * @return the best element available for this operator |
| 14673 */ | 15309 */ |
| 14674 MethodElement get bestElement { | 15310 MethodElement get bestElement { |
| 14675 MethodElement element = propagatedElement; | 15311 MethodElement element = propagatedElement; |
| 14676 if (element == null) { | 15312 if (element == null) { |
| 14677 element = staticElement; | 15313 element = staticElement; |
| 14678 } | 15314 } |
| 14679 return element; | 15315 return element; |
| 14680 } | 15316 } |
| 14681 | 15317 |
| 15318 /** |
| 15319 * TODO(paulberry): untested. |
| 15320 */ |
| 15321 @override |
| 15322 Iterable get childEntities => new ChildEntities() |
| 15323 ..add(_operand) |
| 15324 ..add(operator); |
| 15325 |
| 14682 @override | 15326 @override |
| 14683 Token get endToken => operator; | 15327 Token get endToken => operator; |
| 14684 | 15328 |
| 14685 /** | 15329 /** |
| 14686 * Return the expression computing the operand for the operator. | 15330 * Return the expression computing the operand for the operator. |
| 14687 * | 15331 * |
| 14688 * @return the expression computing the operand for the operator | 15332 * @return the expression computing the operand for the operator |
| 14689 */ | 15333 */ |
| 14690 Expression get operand => _operand; | 15334 Expression get operand => _operand; |
| 14691 | 15335 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14796 | 15440 |
| 14797 @override | 15441 @override |
| 14798 Element get bestElement { | 15442 Element get bestElement { |
| 14799 if (_identifier == null) { | 15443 if (_identifier == null) { |
| 14800 return null; | 15444 return null; |
| 14801 } | 15445 } |
| 14802 return _identifier.bestElement; | 15446 return _identifier.bestElement; |
| 14803 } | 15447 } |
| 14804 | 15448 |
| 14805 @override | 15449 @override |
| 15450 Iterable get childEntities => new ChildEntities() |
| 15451 ..add(_prefix) |
| 15452 ..add(period) |
| 15453 ..add(_identifier); |
| 15454 |
| 15455 @override |
| 14806 Token get endToken => _identifier.endToken; | 15456 Token get endToken => _identifier.endToken; |
| 14807 | 15457 |
| 14808 /** | 15458 /** |
| 14809 * Return the identifier being prefixed. | 15459 * Return the identifier being prefixed. |
| 14810 * | 15460 * |
| 14811 * @return the identifier being prefixed | 15461 * @return the identifier being prefixed |
| 14812 */ | 15462 */ |
| 14813 SimpleIdentifier get identifier => _identifier; | 15463 SimpleIdentifier get identifier => _identifier; |
| 14814 | 15464 |
| 14815 /** | 15465 /** |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14948 */ | 15598 */ |
| 14949 MethodElement get bestElement { | 15599 MethodElement get bestElement { |
| 14950 MethodElement element = propagatedElement; | 15600 MethodElement element = propagatedElement; |
| 14951 if (element == null) { | 15601 if (element == null) { |
| 14952 element = staticElement; | 15602 element = staticElement; |
| 14953 } | 15603 } |
| 14954 return element; | 15604 return element; |
| 14955 } | 15605 } |
| 14956 | 15606 |
| 14957 @override | 15607 @override |
| 15608 Iterable get childEntities => new ChildEntities() |
| 15609 ..add(operator) |
| 15610 ..add(_operand); |
| 15611 |
| 15612 @override |
| 14958 Token get endToken => _operand.endToken; | 15613 Token get endToken => _operand.endToken; |
| 14959 | 15614 |
| 14960 /** | 15615 /** |
| 14961 * Return the expression computing the operand for the operator. | 15616 * Return the expression computing the operand for the operator. |
| 14962 * | 15617 * |
| 14963 * @return the expression computing the operand for the operator | 15618 * @return the expression computing the operand for the operator |
| 14964 */ | 15619 */ |
| 14965 Expression get operand => _operand; | 15620 Expression get operand => _operand; |
| 14966 | 15621 |
| 14967 /** | 15622 /** |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15070 | 15725 |
| 15071 @override | 15726 @override |
| 15072 Token get beginToken { | 15727 Token get beginToken { |
| 15073 if (_target != null) { | 15728 if (_target != null) { |
| 15074 return _target.beginToken; | 15729 return _target.beginToken; |
| 15075 } | 15730 } |
| 15076 return operator; | 15731 return operator; |
| 15077 } | 15732 } |
| 15078 | 15733 |
| 15079 @override | 15734 @override |
| 15735 Iterable get childEntities => new ChildEntities() |
| 15736 ..add(_target) |
| 15737 ..add(operator) |
| 15738 ..add(_propertyName); |
| 15739 |
| 15740 @override |
| 15080 Token get endToken => _propertyName.endToken; | 15741 Token get endToken => _propertyName.endToken; |
| 15081 | 15742 |
| 15082 @override | 15743 @override |
| 15083 bool get isAssignable => true; | 15744 bool get isAssignable => true; |
| 15084 | 15745 |
| 15085 /** | 15746 /** |
| 15086 * Return `true` if this expression is cascaded. If it is, then the target of
this | 15747 * Return `true` if this expression is cascaded. If it is, then the target of
this |
| 15087 * expression is not stored locally but is stored in the nearest ancestor that
is a | 15748 * expression is not stored locally but is stored in the nearest ancestor that
is a |
| 15088 * [CascadeExpression]. | 15749 * [CascadeExpression]. |
| 15089 * | 15750 * |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15876 * | 16537 * |
| 15877 * @param argumentList the list of arguments to the constructor | 16538 * @param argumentList the list of arguments to the constructor |
| 15878 */ | 16539 */ |
| 15879 void set argumentList(ArgumentList argumentList) { | 16540 void set argumentList(ArgumentList argumentList) { |
| 15880 _argumentList = becomeParentOf(argumentList); | 16541 _argumentList = becomeParentOf(argumentList); |
| 15881 } | 16542 } |
| 15882 | 16543 |
| 15883 @override | 16544 @override |
| 15884 Token get beginToken => keyword; | 16545 Token get beginToken => keyword; |
| 15885 | 16546 |
| 16547 @override |
| 16548 Iterable get childEntities => new ChildEntities() |
| 16549 ..add(keyword) |
| 16550 ..add(period) |
| 16551 ..add(_constructorName) |
| 16552 ..add(_argumentList); |
| 16553 |
| 15886 /** | 16554 /** |
| 15887 * Return the name of the constructor that is being invoked, or `null` if the
unnamed | 16555 * Return the name of the constructor that is being invoked, or `null` if the
unnamed |
| 15888 * constructor is being invoked. | 16556 * constructor is being invoked. |
| 15889 * | 16557 * |
| 15890 * @return the name of the constructor that is being invoked | 16558 * @return the name of the constructor that is being invoked |
| 15891 */ | 16559 */ |
| 15892 SimpleIdentifier get constructorName => _constructorName; | 16560 SimpleIdentifier get constructorName => _constructorName; |
| 15893 | 16561 |
| 15894 /** | 16562 /** |
| 15895 * Set the name of the constructor that is being invoked to the given identifi
er. | 16563 * Set the name of the constructor that is being invoked to the given identifi
er. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15931 /** | 16599 /** |
| 15932 * Initialize a newly created rethrow expression. | 16600 * Initialize a newly created rethrow expression. |
| 15933 * | 16601 * |
| 15934 * @param keyword the token representing the 'rethrow' keyword | 16602 * @param keyword the token representing the 'rethrow' keyword |
| 15935 */ | 16603 */ |
| 15936 RethrowExpression(this.keyword); | 16604 RethrowExpression(this.keyword); |
| 15937 | 16605 |
| 15938 @override | 16606 @override |
| 15939 Token get beginToken => keyword; | 16607 Token get beginToken => keyword; |
| 15940 | 16608 |
| 16609 /** |
| 16610 * TODO(paulberry): untested. |
| 16611 */ |
| 16612 @override |
| 16613 Iterable get childEntities => new ChildEntities()..add(keyword); |
| 16614 |
| 15941 @override | 16615 @override |
| 15942 Token get endToken => keyword; | 16616 Token get endToken => keyword; |
| 15943 | 16617 |
| 15944 @override | 16618 @override |
| 15945 int get precedence => 0; | 16619 int get precedence => 0; |
| 15946 | 16620 |
| 15947 @override | 16621 @override |
| 15948 accept(AstVisitor visitor) => visitor.visitRethrowExpression(this); | 16622 accept(AstVisitor visitor) => visitor.visitRethrowExpression(this); |
| 15949 | 16623 |
| 15950 @override | 16624 @override |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15986 * @param semicolon the semicolon terminating the statement | 16660 * @param semicolon the semicolon terminating the statement |
| 15987 */ | 16661 */ |
| 15988 ReturnStatement(this.keyword, Expression expression, this.semicolon) { | 16662 ReturnStatement(this.keyword, Expression expression, this.semicolon) { |
| 15989 _expression = becomeParentOf(expression); | 16663 _expression = becomeParentOf(expression); |
| 15990 } | 16664 } |
| 15991 | 16665 |
| 15992 @override | 16666 @override |
| 15993 Token get beginToken => keyword; | 16667 Token get beginToken => keyword; |
| 15994 | 16668 |
| 15995 @override | 16669 @override |
| 16670 Iterable get childEntities => new ChildEntities() |
| 16671 ..add(keyword) |
| 16672 ..add(_expression) |
| 16673 ..add(semicolon); |
| 16674 |
| 16675 @override |
| 15996 Token get endToken => semicolon; | 16676 Token get endToken => semicolon; |
| 15997 | 16677 |
| 15998 /** | 16678 /** |
| 15999 * Return the expression computing the value to be returned, or `null` if no e
xplicit value | 16679 * Return the expression computing the value to be returned, or `null` if no e
xplicit value |
| 16000 * was provided. | 16680 * was provided. |
| 16001 * | 16681 * |
| 16002 * @return the expression computing the value to be returned | 16682 * @return the expression computing the value to be returned |
| 16003 */ | 16683 */ |
| 16004 Expression get expression => _expression; | 16684 Expression get expression => _expression; |
| 16005 | 16685 |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16224 /** | 16904 /** |
| 16225 * Initialize a newly created script tag. | 16905 * Initialize a newly created script tag. |
| 16226 * | 16906 * |
| 16227 * @param scriptTag the token representing this script tag | 16907 * @param scriptTag the token representing this script tag |
| 16228 */ | 16908 */ |
| 16229 ScriptTag(this.scriptTag); | 16909 ScriptTag(this.scriptTag); |
| 16230 | 16910 |
| 16231 @override | 16911 @override |
| 16232 Token get beginToken => scriptTag; | 16912 Token get beginToken => scriptTag; |
| 16233 | 16913 |
| 16914 /** |
| 16915 * TODO(paulberry): untested. |
| 16916 */ |
| 16917 @override |
| 16918 Iterable get childEntities => new ChildEntities()..add(scriptTag); |
| 16919 |
| 16234 @override | 16920 @override |
| 16235 Token get endToken => scriptTag; | 16921 Token get endToken => scriptTag; |
| 16236 | 16922 |
| 16237 @override | 16923 @override |
| 16238 accept(AstVisitor visitor) => visitor.visitScriptTag(this); | 16924 accept(AstVisitor visitor) => visitor.visitScriptTag(this); |
| 16239 | 16925 |
| 16240 @override | 16926 @override |
| 16241 void visitChildren(AstVisitor visitor) { | 16927 void visitChildren(AstVisitor visitor) { |
| 16242 // There are no children to visit. | 16928 // There are no children to visit. |
| 16243 } | 16929 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 16262 * Initialize a newly created import show combinator. | 16948 * Initialize a newly created import show combinator. |
| 16263 * | 16949 * |
| 16264 * @param keyword the comma introducing the combinator | 16950 * @param keyword the comma introducing the combinator |
| 16265 * @param shownNames the list of names from the library that are made visible
by this combinator | 16951 * @param shownNames the list of names from the library that are made visible
by this combinator |
| 16266 */ | 16952 */ |
| 16267 ShowCombinator(Token keyword, List<SimpleIdentifier> shownNames) | 16953 ShowCombinator(Token keyword, List<SimpleIdentifier> shownNames) |
| 16268 : super(keyword) { | 16954 : super(keyword) { |
| 16269 _shownNames = new NodeList<SimpleIdentifier>(this, shownNames); | 16955 _shownNames = new NodeList<SimpleIdentifier>(this, shownNames); |
| 16270 } | 16956 } |
| 16271 | 16957 |
| 16958 /** |
| 16959 * TODO(paulberry): add commas. |
| 16960 */ |
| 16961 @override |
| 16962 Iterable get childEntities => new ChildEntities() |
| 16963 ..add(keyword) |
| 16964 ..addAll(_shownNames); |
| 16965 |
| 16272 @override | 16966 @override |
| 16273 Token get endToken => _shownNames.endToken; | 16967 Token get endToken => _shownNames.endToken; |
| 16274 | 16968 |
| 16275 /** | 16969 /** |
| 16276 * Return the list of names from the library that are made visible by this com
binator. | 16970 * Return the list of names from the library that are made visible by this com
binator. |
| 16277 * | 16971 * |
| 16278 * @return the list of names from the library that are made visible by this co
mbinator | 16972 * @return the list of names from the library that are made visible by this co
mbinator |
| 16279 */ | 16973 */ |
| 16280 NodeList<SimpleIdentifier> get shownNames => _shownNames; | 16974 NodeList<SimpleIdentifier> get shownNames => _shownNames; |
| 16281 | 16975 |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16662 if (!metadata.isEmpty) { | 17356 if (!metadata.isEmpty) { |
| 16663 return metadata.beginToken; | 17357 return metadata.beginToken; |
| 16664 } else if (keyword != null) { | 17358 } else if (keyword != null) { |
| 16665 return keyword; | 17359 return keyword; |
| 16666 } else if (_type != null) { | 17360 } else if (_type != null) { |
| 16667 return _type.beginToken; | 17361 return _type.beginToken; |
| 16668 } | 17362 } |
| 16669 return identifier.beginToken; | 17363 return identifier.beginToken; |
| 16670 } | 17364 } |
| 16671 | 17365 |
| 17366 /** |
| 17367 * TODO(paulberry): untested. |
| 17368 */ |
| 17369 @override |
| 17370 Iterable get childEntities => super._childEntities |
| 17371 ..add(keyword) |
| 17372 ..add(_type) |
| 17373 ..add(identifier); |
| 17374 |
| 16672 @override | 17375 @override |
| 16673 Token get endToken => identifier.endToken; | 17376 Token get endToken => identifier.endToken; |
| 16674 | 17377 |
| 16675 @override | 17378 @override |
| 16676 bool get isConst => | 17379 bool get isConst => |
| 16677 (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.
CONST; | 17380 (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.
CONST; |
| 16678 | 17381 |
| 16679 @override | 17382 @override |
| 16680 bool get isFinal => | 17383 bool get isFinal => |
| 16681 (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.
FINAL; | 17384 (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.
FINAL; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16757 Token get beginToken => token; | 17460 Token get beginToken => token; |
| 16758 | 17461 |
| 16759 @override | 17462 @override |
| 16760 Element get bestElement { | 17463 Element get bestElement { |
| 16761 if (_propagatedElement == null) { | 17464 if (_propagatedElement == null) { |
| 16762 return _staticElement; | 17465 return _staticElement; |
| 16763 } | 17466 } |
| 16764 return _propagatedElement; | 17467 return _propagatedElement; |
| 16765 } | 17468 } |
| 16766 | 17469 |
| 17470 /** |
| 17471 * TODO(paulberry): untested. |
| 17472 */ |
| 17473 @override |
| 17474 Iterable get childEntities => new ChildEntities()..add(token); |
| 17475 |
| 16767 @override | 17476 @override |
| 16768 Token get endToken => token; | 17477 Token get endToken => token; |
| 16769 | 17478 |
| 16770 /** | 17479 /** |
| 16771 * Returns `true` if this identifier is the "name" part of a prefixed identifi
er or a method | 17480 * Returns `true` if this identifier is the "name" part of a prefixed identifi
er or a method |
| 16772 * invocation. | 17481 * invocation. |
| 16773 * | 17482 * |
| 16774 * @return `true` if this identifier is the "name" part of a prefixed identifi
er or a method | 17483 * @return `true` if this identifier is the "name" part of a prefixed identifi
er or a method |
| 16775 * invocation | 17484 * invocation |
| 16776 */ | 17485 */ |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17095 * @param value the value of the literal | 17804 * @param value the value of the literal |
| 17096 */ | 17805 */ |
| 17097 SimpleStringLiteral(this.literal, String value) { | 17806 SimpleStringLiteral(this.literal, String value) { |
| 17098 _value = StringUtilities.intern(value); | 17807 _value = StringUtilities.intern(value); |
| 17099 } | 17808 } |
| 17100 | 17809 |
| 17101 @override | 17810 @override |
| 17102 Token get beginToken => literal; | 17811 Token get beginToken => literal; |
| 17103 | 17812 |
| 17104 @override | 17813 @override |
| 17814 Iterable get childEntities => new ChildEntities()..add(literal); |
| 17815 |
| 17816 @override |
| 17105 int get contentsEnd { | 17817 int get contentsEnd { |
| 17106 return contentsOffset + value.length; | 17818 return contentsOffset + value.length; |
| 17107 } | 17819 } |
| 17108 | 17820 |
| 17109 @override | 17821 @override |
| 17110 int get contentsOffset { | 17822 int get contentsOffset { |
| 17111 int contentsOffset = 0; | 17823 int contentsOffset = 0; |
| 17112 if (isRaw) { | 17824 if (isRaw) { |
| 17113 contentsOffset += 1; | 17825 contentsOffset += 1; |
| 17114 } | 17826 } |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17277 * @param elements the elements that will be composed to produce the resulting
string | 17989 * @param elements the elements that will be composed to produce the resulting
string |
| 17278 */ | 17990 */ |
| 17279 StringInterpolation(List<InterpolationElement> elements) { | 17991 StringInterpolation(List<InterpolationElement> elements) { |
| 17280 _elements = new NodeList<InterpolationElement>(this, elements); | 17992 _elements = new NodeList<InterpolationElement>(this, elements); |
| 17281 } | 17993 } |
| 17282 | 17994 |
| 17283 @override | 17995 @override |
| 17284 Token get beginToken => _elements.beginToken; | 17996 Token get beginToken => _elements.beginToken; |
| 17285 | 17997 |
| 17286 @override | 17998 @override |
| 17999 Iterable get childEntities => new ChildEntities()..addAll(_elements); |
| 18000 |
| 18001 @override |
| 17287 int get contentsEnd { | 18002 int get contentsEnd { |
| 17288 InterpolationString element = _elements.last; | 18003 InterpolationString element = _elements.last; |
| 17289 return element.contentsEnd; | 18004 return element.contentsEnd; |
| 17290 } | 18005 } |
| 17291 | 18006 |
| 17292 @override | 18007 @override |
| 17293 int get contentsOffset { | 18008 int get contentsOffset { |
| 17294 InterpolationString element = _elements.first; | 18009 InterpolationString element = _elements.first; |
| 17295 return element.contentsOffset; | 18010 return element.contentsOffset; |
| 17296 } | 18011 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 17327 } | 18042 } |
| 17328 | 18043 |
| 17329 @override | 18044 @override |
| 17330 accept(AstVisitor visitor) => visitor.visitStringInterpolation(this); | 18045 accept(AstVisitor visitor) => visitor.visitStringInterpolation(this); |
| 17331 | 18046 |
| 17332 @override | 18047 @override |
| 17333 void appendStringValue(StringBuffer buffer) { | 18048 void appendStringValue(StringBuffer buffer) { |
| 17334 throw new IllegalArgumentException(); | 18049 throw new IllegalArgumentException(); |
| 17335 } | 18050 } |
| 17336 | 18051 |
| 17337 | |
| 17338 @override | 18052 @override |
| 17339 void visitChildren(AstVisitor visitor) { | 18053 void visitChildren(AstVisitor visitor) { |
| 17340 _elements.accept(visitor); | 18054 _elements.accept(visitor); |
| 17341 } | 18055 } |
| 17342 } | 18056 } |
| 17343 | 18057 |
| 17344 /** | 18058 /** |
| 17345 * Instances of the class `StringLiteral` represent a string literal expression. | 18059 * Instances of the class `StringLiteral` represent a string literal expression. |
| 17346 * | 18060 * |
| 17347 * <pre> | 18061 * <pre> |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17439 * | 18153 * |
| 17440 * @param argumentList the list of arguments to the constructor | 18154 * @param argumentList the list of arguments to the constructor |
| 17441 */ | 18155 */ |
| 17442 void set argumentList(ArgumentList argumentList) { | 18156 void set argumentList(ArgumentList argumentList) { |
| 17443 _argumentList = becomeParentOf(argumentList); | 18157 _argumentList = becomeParentOf(argumentList); |
| 17444 } | 18158 } |
| 17445 | 18159 |
| 17446 @override | 18160 @override |
| 17447 Token get beginToken => keyword; | 18161 Token get beginToken => keyword; |
| 17448 | 18162 |
| 18163 @override |
| 18164 Iterable get childEntities => new ChildEntities() |
| 18165 ..add(keyword) |
| 18166 ..add(period) |
| 18167 ..add(_constructorName) |
| 18168 ..add(_argumentList); |
| 18169 |
| 17449 /** | 18170 /** |
| 17450 * Return the name of the constructor that is being invoked, or `null` if the
unnamed | 18171 * Return the name of the constructor that is being invoked, or `null` if the
unnamed |
| 17451 * constructor is being invoked. | 18172 * constructor is being invoked. |
| 17452 * | 18173 * |
| 17453 * @return the name of the constructor that is being invoked | 18174 * @return the name of the constructor that is being invoked |
| 17454 */ | 18175 */ |
| 17455 SimpleIdentifier get constructorName => _constructorName; | 18176 SimpleIdentifier get constructorName => _constructorName; |
| 17456 | 18177 |
| 17457 /** | 18178 /** |
| 17458 * Set the name of the constructor that is being invoked to the given identifi
er. | 18179 * Set the name of the constructor that is being invoked to the given identifi
er. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17493 /** | 18214 /** |
| 17494 * Initialize a newly created super expression. | 18215 * Initialize a newly created super expression. |
| 17495 * | 18216 * |
| 17496 * @param keyword the token representing the keyword | 18217 * @param keyword the token representing the keyword |
| 17497 */ | 18218 */ |
| 17498 SuperExpression(this.keyword); | 18219 SuperExpression(this.keyword); |
| 17499 | 18220 |
| 17500 @override | 18221 @override |
| 17501 Token get beginToken => keyword; | 18222 Token get beginToken => keyword; |
| 17502 | 18223 |
| 18224 /** |
| 18225 * TODO(paulberry): untested. |
| 18226 */ |
| 18227 @override |
| 18228 Iterable get childEntities => new ChildEntities()..add(keyword); |
| 18229 |
| 17503 @override | 18230 @override |
| 17504 Token get endToken => keyword; | 18231 Token get endToken => keyword; |
| 17505 | 18232 |
| 17506 @override | 18233 @override |
| 17507 int get precedence => 16; | 18234 int get precedence => 16; |
| 17508 | 18235 |
| 17509 @override | 18236 @override |
| 17510 accept(AstVisitor visitor) => visitor.visitSuperExpression(this); | 18237 accept(AstVisitor visitor) => visitor.visitSuperExpression(this); |
| 17511 | 18238 |
| 17512 @override | 18239 @override |
| (...skipping 24 matching lines...) Expand all Loading... |
| 17537 * @param expression the expression controlling whether the statements will be
executed | 18264 * @param expression the expression controlling whether the statements will be
executed |
| 17538 * @param colon the colon separating the keyword or the expression from the st
atements | 18265 * @param colon the colon separating the keyword or the expression from the st
atements |
| 17539 * @param statements the statements that will be executed if this switch membe
r is selected | 18266 * @param statements the statements that will be executed if this switch membe
r is selected |
| 17540 */ | 18267 */ |
| 17541 SwitchCase(List<Label> labels, Token keyword, Expression expression, | 18268 SwitchCase(List<Label> labels, Token keyword, Expression expression, |
| 17542 Token colon, List<Statement> statements) | 18269 Token colon, List<Statement> statements) |
| 17543 : super(labels, keyword, colon, statements) { | 18270 : super(labels, keyword, colon, statements) { |
| 17544 _expression = becomeParentOf(expression); | 18271 _expression = becomeParentOf(expression); |
| 17545 } | 18272 } |
| 17546 | 18273 |
| 18274 @override |
| 18275 Iterable get childEntities => new ChildEntities() |
| 18276 ..addAll(labels) |
| 18277 ..add(keyword) |
| 18278 ..add(_expression) |
| 18279 ..add(colon) |
| 18280 ..addAll(statements); |
| 18281 |
| 17547 /** | 18282 /** |
| 17548 * Return the expression controlling whether the statements will be executed. | 18283 * Return the expression controlling whether the statements will be executed. |
| 17549 * | 18284 * |
| 17550 * @return the expression controlling whether the statements will be executed | 18285 * @return the expression controlling whether the statements will be executed |
| 17551 */ | 18286 */ |
| 17552 Expression get expression => _expression; | 18287 Expression get expression => _expression; |
| 17553 | 18288 |
| 17554 /** | 18289 /** |
| 17555 * Set the expression controlling whether the statements will be executed to t
he given expression. | 18290 * Set the expression controlling whether the statements will be executed to t
he given expression. |
| 17556 * | 18291 * |
| (...skipping 28 matching lines...) Expand all Loading... |
| 17585 * | 18320 * |
| 17586 * @param labels the labels associated with the switch member | 18321 * @param labels the labels associated with the switch member |
| 17587 * @param keyword the token representing the 'case' or 'default' keyword | 18322 * @param keyword the token representing the 'case' or 'default' keyword |
| 17588 * @param colon the colon separating the keyword or the expression from the st
atements | 18323 * @param colon the colon separating the keyword or the expression from the st
atements |
| 17589 * @param statements the statements that will be executed if this switch membe
r is selected | 18324 * @param statements the statements that will be executed if this switch membe
r is selected |
| 17590 */ | 18325 */ |
| 17591 SwitchDefault(List<Label> labels, Token keyword, Token colon, | 18326 SwitchDefault(List<Label> labels, Token keyword, Token colon, |
| 17592 List<Statement> statements) | 18327 List<Statement> statements) |
| 17593 : super(labels, keyword, colon, statements); | 18328 : super(labels, keyword, colon, statements); |
| 17594 | 18329 |
| 18330 /** |
| 18331 * TODO(paulberry): untested. |
| 18332 */ |
| 18333 @override |
| 18334 Iterable get childEntities => new ChildEntities() |
| 18335 ..addAll(labels) |
| 18336 ..add(keyword) |
| 18337 ..add(colon) |
| 18338 ..addAll(statements); |
| 18339 |
| 17595 @override | 18340 @override |
| 17596 accept(AstVisitor visitor) => visitor.visitSwitchDefault(this); | 18341 accept(AstVisitor visitor) => visitor.visitSwitchDefault(this); |
| 17597 | 18342 |
| 17598 @override | 18343 @override |
| 17599 void visitChildren(AstVisitor visitor) { | 18344 void visitChildren(AstVisitor visitor) { |
| 17600 labels.accept(visitor); | 18345 labels.accept(visitor); |
| 17601 statements.accept(visitor); | 18346 statements.accept(visitor); |
| 17602 } | 18347 } |
| 17603 } | 18348 } |
| 17604 | 18349 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17737 this.rightParenthesis, this.leftBracket, List<SwitchMember> members, | 18482 this.rightParenthesis, this.leftBracket, List<SwitchMember> members, |
| 17738 this.rightBracket) { | 18483 this.rightBracket) { |
| 17739 _expression = becomeParentOf(expression); | 18484 _expression = becomeParentOf(expression); |
| 17740 _members = new NodeList<SwitchMember>(this, members); | 18485 _members = new NodeList<SwitchMember>(this, members); |
| 17741 } | 18486 } |
| 17742 | 18487 |
| 17743 @override | 18488 @override |
| 17744 Token get beginToken => keyword; | 18489 Token get beginToken => keyword; |
| 17745 | 18490 |
| 17746 @override | 18491 @override |
| 18492 Iterable get childEntities => new ChildEntities() |
| 18493 ..add(keyword) |
| 18494 ..add(leftParenthesis) |
| 18495 ..add(_expression) |
| 18496 ..add(rightParenthesis) |
| 18497 ..add(leftBracket) |
| 18498 ..addAll(_members) |
| 18499 ..add(rightBracket); |
| 18500 |
| 18501 @override |
| 17747 Token get endToken => rightBracket; | 18502 Token get endToken => rightBracket; |
| 17748 | 18503 |
| 17749 /** | 18504 /** |
| 17750 * Return the expression used to determine which of the switch members will be
selected. | 18505 * Return the expression used to determine which of the switch members will be
selected. |
| 17751 * | 18506 * |
| 17752 * @return the expression used to determine which of the switch members will b
e selected | 18507 * @return the expression used to determine which of the switch members will b
e selected |
| 17753 */ | 18508 */ |
| 17754 Expression get expression => _expression; | 18509 Expression get expression => _expression; |
| 17755 | 18510 |
| 17756 /** | 18511 /** |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17803 * Initialize a newly created symbol literal. | 18558 * Initialize a newly created symbol literal. |
| 17804 * | 18559 * |
| 17805 * @param poundSign the token introducing the literal | 18560 * @param poundSign the token introducing the literal |
| 17806 * @param components the components of the literal | 18561 * @param components the components of the literal |
| 17807 */ | 18562 */ |
| 17808 SymbolLiteral(this.poundSign, this.components); | 18563 SymbolLiteral(this.poundSign, this.components); |
| 17809 | 18564 |
| 17810 @override | 18565 @override |
| 17811 Token get beginToken => poundSign; | 18566 Token get beginToken => poundSign; |
| 17812 | 18567 |
| 18568 /** |
| 18569 * TODO(paulberry): untested. |
| 18570 * TODO(paulberry): add "." tokens. |
| 18571 */ |
| 18572 @override |
| 18573 Iterable get childEntities => new ChildEntities() |
| 18574 ..add(poundSign) |
| 18575 ..addAll(components); |
| 18576 |
| 17813 @override | 18577 @override |
| 17814 Token get endToken => components[components.length - 1]; | 18578 Token get endToken => components[components.length - 1]; |
| 17815 | 18579 |
| 17816 @override | 18580 @override |
| 17817 accept(AstVisitor visitor) => visitor.visitSymbolLiteral(this); | 18581 accept(AstVisitor visitor) => visitor.visitSymbolLiteral(this); |
| 17818 | 18582 |
| 17819 @override | 18583 @override |
| 17820 void visitChildren(AstVisitor visitor) { | 18584 void visitChildren(AstVisitor visitor) { |
| 17821 // There are no children to visit. | 18585 // There are no children to visit. |
| 17822 } | 18586 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 17839 /** | 18603 /** |
| 17840 * Initialize a newly created this expression. | 18604 * Initialize a newly created this expression. |
| 17841 * | 18605 * |
| 17842 * @param keyword the token representing the keyword | 18606 * @param keyword the token representing the keyword |
| 17843 */ | 18607 */ |
| 17844 ThisExpression(this.keyword); | 18608 ThisExpression(this.keyword); |
| 17845 | 18609 |
| 17846 @override | 18610 @override |
| 17847 Token get beginToken => keyword; | 18611 Token get beginToken => keyword; |
| 17848 | 18612 |
| 18613 /** |
| 18614 * TODO(paulberry): untested. |
| 18615 */ |
| 18616 @override |
| 18617 Iterable get childEntities => new ChildEntities()..add(keyword); |
| 18618 |
| 17849 @override | 18619 @override |
| 17850 Token get endToken => keyword; | 18620 Token get endToken => keyword; |
| 17851 | 18621 |
| 17852 @override | 18622 @override |
| 17853 int get precedence => 16; | 18623 int get precedence => 16; |
| 17854 | 18624 |
| 17855 @override | 18625 @override |
| 17856 accept(AstVisitor visitor) => visitor.visitThisExpression(this); | 18626 accept(AstVisitor visitor) => visitor.visitThisExpression(this); |
| 17857 | 18627 |
| 17858 @override | 18628 @override |
| (...skipping 28 matching lines...) Expand all Loading... |
| 17887 * @param expression the expression computing the exception to be thrown | 18657 * @param expression the expression computing the exception to be thrown |
| 17888 */ | 18658 */ |
| 17889 ThrowExpression(this.keyword, Expression expression) { | 18659 ThrowExpression(this.keyword, Expression expression) { |
| 17890 _expression = becomeParentOf(expression); | 18660 _expression = becomeParentOf(expression); |
| 17891 } | 18661 } |
| 17892 | 18662 |
| 17893 @override | 18663 @override |
| 17894 Token get beginToken => keyword; | 18664 Token get beginToken => keyword; |
| 17895 | 18665 |
| 17896 @override | 18666 @override |
| 18667 Iterable get childEntities => new ChildEntities() |
| 18668 ..add(keyword) |
| 18669 ..add(_expression); |
| 18670 |
| 18671 @override |
| 17897 Token get endToken { | 18672 Token get endToken { |
| 17898 if (_expression != null) { | 18673 if (_expression != null) { |
| 17899 return _expression.endToken; | 18674 return _expression.endToken; |
| 17900 } | 18675 } |
| 17901 return keyword; | 18676 return keyword; |
| 17902 } | 18677 } |
| 17903 | 18678 |
| 17904 /** | 18679 /** |
| 17905 * Return the expression computing the exception to be thrown. | 18680 * Return the expression computing the exception to be thrown. |
| 17906 * | 18681 * |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17958 * @param variableList the top-level variables being declared | 18733 * @param variableList the top-level variables being declared |
| 17959 * @param semicolon the semicolon terminating the declaration | 18734 * @param semicolon the semicolon terminating the declaration |
| 17960 */ | 18735 */ |
| 17961 TopLevelVariableDeclaration(Comment comment, List<Annotation> metadata, | 18736 TopLevelVariableDeclaration(Comment comment, List<Annotation> metadata, |
| 17962 VariableDeclarationList variableList, this.semicolon) | 18737 VariableDeclarationList variableList, this.semicolon) |
| 17963 : super(comment, metadata) { | 18738 : super(comment, metadata) { |
| 17964 _variableList = becomeParentOf(variableList); | 18739 _variableList = becomeParentOf(variableList); |
| 17965 } | 18740 } |
| 17966 | 18741 |
| 17967 @override | 18742 @override |
| 18743 Iterable get childEntities => super._childEntities |
| 18744 ..add(_variableList) |
| 18745 ..add(semicolon); |
| 18746 |
| 18747 @override |
| 17968 Element get element => null; | 18748 Element get element => null; |
| 17969 | 18749 |
| 17970 @override | 18750 @override |
| 17971 Token get endToken => semicolon; | 18751 Token get endToken => semicolon; |
| 17972 | 18752 |
| 17973 @override | 18753 @override |
| 17974 Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken; | 18754 Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken; |
| 17975 | 18755 |
| 17976 /** | 18756 /** |
| 17977 * Return the top-level variables being declared. | 18757 * Return the top-level variables being declared. |
| (...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19207 } | 19987 } |
| 19208 | 19988 |
| 19209 /** | 19989 /** |
| 19210 * Return the catch clauses contained in the try statement. | 19990 * Return the catch clauses contained in the try statement. |
| 19211 * | 19991 * |
| 19212 * @return the catch clauses contained in the try statement | 19992 * @return the catch clauses contained in the try statement |
| 19213 */ | 19993 */ |
| 19214 NodeList<CatchClause> get catchClauses => _catchClauses; | 19994 NodeList<CatchClause> get catchClauses => _catchClauses; |
| 19215 | 19995 |
| 19216 @override | 19996 @override |
| 19997 Iterable get childEntities => new ChildEntities() |
| 19998 ..add(tryKeyword) |
| 19999 ..add(_body) |
| 20000 ..addAll(_catchClauses) |
| 20001 ..add(finallyKeyword) |
| 20002 ..add(_finallyBlock); |
| 20003 |
| 20004 @override |
| 19217 Token get endToken { | 20005 Token get endToken { |
| 19218 if (_finallyBlock != null) { | 20006 if (_finallyBlock != null) { |
| 19219 return _finallyBlock.endToken; | 20007 return _finallyBlock.endToken; |
| 19220 } else if (finallyKeyword != null) { | 20008 } else if (finallyKeyword != null) { |
| 19221 return finallyKeyword; | 20009 return finallyKeyword; |
| 19222 } else if (!_catchClauses.isEmpty) { | 20010 } else if (!_catchClauses.isEmpty) { |
| 19223 return _catchClauses.endToken; | 20011 return _catchClauses.endToken; |
| 19224 } | 20012 } |
| 19225 return _body.endToken; | 20013 return _body.endToken; |
| 19226 } | 20014 } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19334 /** | 20122 /** |
| 19335 * Return the type arguments associated with the type. | 20123 * Return the type arguments associated with the type. |
| 19336 * | 20124 * |
| 19337 * @return the type arguments associated with the type | 20125 * @return the type arguments associated with the type |
| 19338 */ | 20126 */ |
| 19339 NodeList<TypeName> get arguments => _arguments; | 20127 NodeList<TypeName> get arguments => _arguments; |
| 19340 | 20128 |
| 19341 @override | 20129 @override |
| 19342 Token get beginToken => leftBracket; | 20130 Token get beginToken => leftBracket; |
| 19343 | 20131 |
| 20132 /** |
| 20133 * TODO(paulberry): Add commas. |
| 20134 */ |
| 20135 @override |
| 20136 Iterable get childEntities => new ChildEntities() |
| 20137 ..add(leftBracket) |
| 20138 ..addAll(_arguments) |
| 20139 ..add(rightBracket); |
| 20140 |
| 19344 @override | 20141 @override |
| 19345 Token get endToken => rightBracket; | 20142 Token get endToken => rightBracket; |
| 19346 | 20143 |
| 19347 @override | 20144 @override |
| 19348 accept(AstVisitor visitor) => visitor.visitTypeArgumentList(this); | 20145 accept(AstVisitor visitor) => visitor.visitTypeArgumentList(this); |
| 19349 | 20146 |
| 19350 @override | 20147 @override |
| 19351 void visitChildren(AstVisitor visitor) { | 20148 void visitChildren(AstVisitor visitor) { |
| 19352 _arguments.accept(visitor); | 20149 _arguments.accept(visitor); |
| 19353 } | 20150 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19396 | 20193 |
| 19397 /** | 20194 /** |
| 19398 * Set the type argument associated with this literal to the given arguments. | 20195 * Set the type argument associated with this literal to the given arguments. |
| 19399 * | 20196 * |
| 19400 * @param typeArguments the type argument associated with this literal | 20197 * @param typeArguments the type argument associated with this literal |
| 19401 */ | 20198 */ |
| 19402 void set typeArguments(TypeArgumentList typeArguments) { | 20199 void set typeArguments(TypeArgumentList typeArguments) { |
| 19403 _typeArguments = becomeParentOf(typeArguments); | 20200 _typeArguments = becomeParentOf(typeArguments); |
| 19404 } | 20201 } |
| 19405 | 20202 |
| 20203 ChildEntities get _childEntities => new ChildEntities() |
| 20204 ..add(constKeyword) |
| 20205 ..add(_typeArguments); |
| 20206 |
| 19406 @override | 20207 @override |
| 19407 void visitChildren(AstVisitor visitor) { | 20208 void visitChildren(AstVisitor visitor) { |
| 19408 safelyVisitChild(_typeArguments, visitor); | 20209 safelyVisitChild(_typeArguments, visitor); |
| 19409 } | 20210 } |
| 19410 } | 20211 } |
| 19411 | 20212 |
| 19412 /** | 20213 /** |
| 19413 * Instances of the class `TypeName` represent the name of a type, which can opt
ionally | 20214 * Instances of the class `TypeName` represent the name of a type, which can opt
ionally |
| 19414 * include type arguments. | 20215 * include type arguments. |
| 19415 * | 20216 * |
| (...skipping 27 matching lines...) Expand all Loading... |
| 19443 */ | 20244 */ |
| 19444 TypeName(Identifier name, TypeArgumentList typeArguments) { | 20245 TypeName(Identifier name, TypeArgumentList typeArguments) { |
| 19445 _name = becomeParentOf(name); | 20246 _name = becomeParentOf(name); |
| 19446 _typeArguments = becomeParentOf(typeArguments); | 20247 _typeArguments = becomeParentOf(typeArguments); |
| 19447 } | 20248 } |
| 19448 | 20249 |
| 19449 @override | 20250 @override |
| 19450 Token get beginToken => _name.beginToken; | 20251 Token get beginToken => _name.beginToken; |
| 19451 | 20252 |
| 19452 @override | 20253 @override |
| 20254 Iterable get childEntities => new ChildEntities() |
| 20255 ..add(_name) |
| 20256 ..add(_typeArguments); |
| 20257 |
| 20258 @override |
| 19453 Token get endToken { | 20259 Token get endToken { |
| 19454 if (_typeArguments != null) { | 20260 if (_typeArguments != null) { |
| 19455 return _typeArguments.endToken; | 20261 return _typeArguments.endToken; |
| 19456 } | 20262 } |
| 19457 return _name.endToken; | 20263 return _name.endToken; |
| 19458 } | 20264 } |
| 19459 | 20265 |
| 19460 /** | 20266 /** |
| 19461 * Return `true` if this type is a deferred type. | 20267 * Return `true` if this type is a deferred type. |
| 19462 * | 20268 * |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19572 /** | 20378 /** |
| 19573 * Set the name of the upper bound for legal arguments to the given type name. | 20379 * Set the name of the upper bound for legal arguments to the given type name. |
| 19574 * | 20380 * |
| 19575 * @param typeName the name of the upper bound for legal arguments | 20381 * @param typeName the name of the upper bound for legal arguments |
| 19576 */ | 20382 */ |
| 19577 void set bound(TypeName typeName) { | 20383 void set bound(TypeName typeName) { |
| 19578 _bound = becomeParentOf(typeName); | 20384 _bound = becomeParentOf(typeName); |
| 19579 } | 20385 } |
| 19580 | 20386 |
| 19581 @override | 20387 @override |
| 20388 Iterable get childEntities => super._childEntities |
| 20389 ..add(_name) |
| 20390 ..add(keyword) |
| 20391 ..add(_bound); |
| 20392 |
| 20393 @override |
| 19582 TypeParameterElement get element => | 20394 TypeParameterElement get element => |
| 19583 _name != null ? (_name.staticElement as TypeParameterElement) : null; | 20395 _name != null ? (_name.staticElement as TypeParameterElement) : null; |
| 19584 | 20396 |
| 19585 @override | 20397 @override |
| 19586 Token get endToken { | 20398 Token get endToken { |
| 19587 if (_bound == null) { | 20399 if (_bound == null) { |
| 19588 return _name.endToken; | 20400 return _name.endToken; |
| 19589 } | 20401 } |
| 19590 return _bound.endToken; | 20402 return _bound.endToken; |
| 19591 } | 20403 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19653 */ | 20465 */ |
| 19654 TypeParameterList(this.leftBracket, List<TypeParameter> typeParameters, | 20466 TypeParameterList(this.leftBracket, List<TypeParameter> typeParameters, |
| 19655 this.rightBracket) { | 20467 this.rightBracket) { |
| 19656 _typeParameters = new NodeList<TypeParameter>(this, typeParameters); | 20468 _typeParameters = new NodeList<TypeParameter>(this, typeParameters); |
| 19657 } | 20469 } |
| 19658 | 20470 |
| 19659 @override | 20471 @override |
| 19660 Token get beginToken => leftBracket; | 20472 Token get beginToken => leftBracket; |
| 19661 | 20473 |
| 19662 @override | 20474 @override |
| 20475 Iterable get childEntities => new ChildEntities() |
| 20476 ..add(leftBracket) |
| 20477 ..addAll(_typeParameters) |
| 20478 ..add(rightBracket); |
| 20479 |
| 20480 @override |
| 19663 Token get endToken => rightBracket; | 20481 Token get endToken => rightBracket; |
| 19664 | 20482 |
| 19665 /** | 20483 /** |
| 19666 * Return the type parameters for the type. | 20484 * Return the type parameters for the type. |
| 19667 * | 20485 * |
| 19668 * @return the type parameters for the type | 20486 * @return the type parameters for the type |
| 19669 */ | 20487 */ |
| 19670 NodeList<TypeParameter> get typeParameters => _typeParameters; | 20488 NodeList<TypeParameter> get typeParameters => _typeParameters; |
| 19671 | 20489 |
| 19672 @override | 20490 @override |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20193 * @param equals the equal sign separating the variable name from the initial
value | 21011 * @param equals the equal sign separating the variable name from the initial
value |
| 20194 * @param initializer the expression used to compute the initial value for the
variable | 21012 * @param initializer the expression used to compute the initial value for the
variable |
| 20195 */ | 21013 */ |
| 20196 VariableDeclaration(Comment comment, List<Annotation> metadata, | 21014 VariableDeclaration(Comment comment, List<Annotation> metadata, |
| 20197 SimpleIdentifier name, this.equals, Expression initializer) | 21015 SimpleIdentifier name, this.equals, Expression initializer) |
| 20198 : super(comment, metadata) { | 21016 : super(comment, metadata) { |
| 20199 _name = becomeParentOf(name); | 21017 _name = becomeParentOf(name); |
| 20200 _initializer = becomeParentOf(initializer); | 21018 _initializer = becomeParentOf(initializer); |
| 20201 } | 21019 } |
| 20202 | 21020 |
| 21021 @override |
| 21022 Iterable get childEntities => super._childEntities |
| 21023 ..add(_name) |
| 21024 ..add(equals) |
| 21025 ..add(_initializer); |
| 21026 |
| 20203 /** | 21027 /** |
| 20204 * This overridden implementation of getDocumentationComment() looks in the gr
andparent node for | 21028 * This overridden implementation of getDocumentationComment() looks in the gr
andparent node for |
| 20205 * dartdoc comments if no documentation is specifically available on the node. | 21029 * dartdoc comments if no documentation is specifically available on the node. |
| 20206 */ | 21030 */ |
| 20207 @override | 21031 @override |
| 20208 Comment get documentationComment { | 21032 Comment get documentationComment { |
| 20209 Comment comment = super.documentationComment; | 21033 Comment comment = super.documentationComment; |
| 20210 if (comment == null) { | 21034 if (comment == null) { |
| 20211 if (parent != null && parent.parent != null) { | 21035 if (parent != null && parent.parent != null) { |
| 20212 AstNode node = parent.parent; | 21036 AstNode node = parent.parent; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20340 * @param type the type of the variables being declared | 21164 * @param type the type of the variables being declared |
| 20341 * @param variables a list containing the individual variables being declared | 21165 * @param variables a list containing the individual variables being declared |
| 20342 */ | 21166 */ |
| 20343 VariableDeclarationList(Comment comment, List<Annotation> metadata, | 21167 VariableDeclarationList(Comment comment, List<Annotation> metadata, |
| 20344 this.keyword, TypeName type, List<VariableDeclaration> variables) | 21168 this.keyword, TypeName type, List<VariableDeclaration> variables) |
| 20345 : super(comment, metadata) { | 21169 : super(comment, metadata) { |
| 20346 _type = becomeParentOf(type); | 21170 _type = becomeParentOf(type); |
| 20347 _variables = new NodeList<VariableDeclaration>(this, variables); | 21171 _variables = new NodeList<VariableDeclaration>(this, variables); |
| 20348 } | 21172 } |
| 20349 | 21173 |
| 21174 /** |
| 21175 * TODO(paulberry): include commas. |
| 21176 */ |
| 21177 @override |
| 21178 Iterable get childEntities => super._childEntities |
| 21179 ..add(keyword) |
| 21180 ..add(_type) |
| 21181 ..addAll(_variables); |
| 21182 |
| 20350 @override | 21183 @override |
| 20351 Token get endToken => _variables.endToken; | 21184 Token get endToken => _variables.endToken; |
| 20352 | 21185 |
| 20353 @override | 21186 @override |
| 20354 Token get firstTokenAfterCommentAndMetadata { | 21187 Token get firstTokenAfterCommentAndMetadata { |
| 20355 if (keyword != null) { | 21188 if (keyword != null) { |
| 20356 return keyword; | 21189 return keyword; |
| 20357 } else if (_type != null) { | 21190 } else if (_type != null) { |
| 20358 return _type.beginToken; | 21191 return _type.beginToken; |
| 20359 } | 21192 } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20440 */ | 21273 */ |
| 20441 VariableDeclarationStatement(VariableDeclarationList variableList, | 21274 VariableDeclarationStatement(VariableDeclarationList variableList, |
| 20442 this.semicolon) { | 21275 this.semicolon) { |
| 20443 _variableList = becomeParentOf(variableList); | 21276 _variableList = becomeParentOf(variableList); |
| 20444 } | 21277 } |
| 20445 | 21278 |
| 20446 @override | 21279 @override |
| 20447 Token get beginToken => _variableList.beginToken; | 21280 Token get beginToken => _variableList.beginToken; |
| 20448 | 21281 |
| 20449 @override | 21282 @override |
| 21283 Iterable get childEntities => new ChildEntities() |
| 21284 ..add(_variableList) |
| 21285 ..add(semicolon); |
| 21286 |
| 21287 @override |
| 20450 Token get endToken => semicolon; | 21288 Token get endToken => semicolon; |
| 20451 | 21289 |
| 20452 /** | 21290 /** |
| 20453 * Return the variables being declared. | 21291 * Return the variables being declared. |
| 20454 * | 21292 * |
| 20455 * @return the variables being declared | 21293 * @return the variables being declared |
| 20456 */ | 21294 */ |
| 20457 VariableDeclarationList get variables => _variableList; | 21295 VariableDeclarationList get variables => _variableList; |
| 20458 | 21296 |
| 20459 /** | 21297 /** |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20535 | 21373 |
| 20536 /** | 21374 /** |
| 20537 * Set the body of the loop to the given statement. | 21375 * Set the body of the loop to the given statement. |
| 20538 * | 21376 * |
| 20539 * @param statement the body of the loop | 21377 * @param statement the body of the loop |
| 20540 */ | 21378 */ |
| 20541 void set body(Statement statement) { | 21379 void set body(Statement statement) { |
| 20542 _body = becomeParentOf(statement); | 21380 _body = becomeParentOf(statement); |
| 20543 } | 21381 } |
| 20544 | 21382 |
| 21383 @override |
| 21384 Iterable get childEntities => new ChildEntities() |
| 21385 ..add(keyword) |
| 21386 ..add(leftParenthesis) |
| 21387 ..add(_condition) |
| 21388 ..add(rightParenthesis) |
| 21389 ..add(_body); |
| 21390 |
| 20545 /** | 21391 /** |
| 20546 * Return the expression used to determine whether to execute the body of the
loop. | 21392 * Return the expression used to determine whether to execute the body of the
loop. |
| 20547 * | 21393 * |
| 20548 * @return the expression used to determine whether to execute the body of the
loop | 21394 * @return the expression used to determine whether to execute the body of the
loop |
| 20549 */ | 21395 */ |
| 20550 Expression get condition => _condition; | 21396 Expression get condition => _condition; |
| 20551 | 21397 |
| 20552 /** | 21398 /** |
| 20553 * Set the expression used to determine whether to execute the body of the loo
p to the given | 21399 * Set the expression used to determine whether to execute the body of the loo
p to the given |
| 20554 * expression. | 21400 * expression. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20597 * @param withKeyword the token representing the 'with' keyword | 21443 * @param withKeyword the token representing the 'with' keyword |
| 20598 * @param mixinTypes the names of the mixins that were specified | 21444 * @param mixinTypes the names of the mixins that were specified |
| 20599 */ | 21445 */ |
| 20600 WithClause(this.withKeyword, List<TypeName> mixinTypes) { | 21446 WithClause(this.withKeyword, List<TypeName> mixinTypes) { |
| 20601 _mixinTypes = new NodeList<TypeName>(this, mixinTypes); | 21447 _mixinTypes = new NodeList<TypeName>(this, mixinTypes); |
| 20602 } | 21448 } |
| 20603 | 21449 |
| 20604 @override | 21450 @override |
| 20605 Token get beginToken => withKeyword; | 21451 Token get beginToken => withKeyword; |
| 20606 | 21452 |
| 21453 /** |
| 21454 * TODO(paulberry): add commas. |
| 21455 */ |
| 21456 @override |
| 21457 Iterable get childEntities => new ChildEntities() |
| 21458 ..add(withKeyword) |
| 21459 ..addAll(_mixinTypes); |
| 21460 |
| 20607 @override | 21461 @override |
| 20608 Token get endToken => _mixinTypes.endToken; | 21462 Token get endToken => _mixinTypes.endToken; |
| 20609 | 21463 |
| 20610 /** | 21464 /** |
| 20611 * Set the token representing the 'with' keyword to the given token. | 21465 * Set the token representing the 'with' keyword to the given token. |
| 20612 * | 21466 * |
| 20613 * @param withKeyword the token representing the 'with' keyword | 21467 * @param withKeyword the token representing the 'with' keyword |
| 20614 */ | 21468 */ |
| 20615 @deprecated | 21469 @deprecated |
| 20616 void set mixinKeyword(Token withKeyword) { | 21470 void set mixinKeyword(Token withKeyword) { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20671 } | 21525 } |
| 20672 | 21526 |
| 20673 @override | 21527 @override |
| 20674 Token get beginToken { | 21528 Token get beginToken { |
| 20675 if (yieldKeyword != null) { | 21529 if (yieldKeyword != null) { |
| 20676 return yieldKeyword; | 21530 return yieldKeyword; |
| 20677 } | 21531 } |
| 20678 return _expression.beginToken; | 21532 return _expression.beginToken; |
| 20679 } | 21533 } |
| 20680 | 21534 |
| 21535 /** |
| 21536 * TODO(paulberry): untested. |
| 21537 */ |
| 21538 @override |
| 21539 Iterable get childEntities => new ChildEntities() |
| 21540 ..add(yieldKeyword) |
| 21541 ..add(star) |
| 21542 ..add(_expression) |
| 21543 ..add(semicolon); |
| 21544 |
| 20681 @override | 21545 @override |
| 20682 Token get endToken { | 21546 Token get endToken { |
| 20683 if (semicolon != null) { | 21547 if (semicolon != null) { |
| 20684 return semicolon; | 21548 return semicolon; |
| 20685 } | 21549 } |
| 20686 return _expression.endToken; | 21550 return _expression.endToken; |
| 20687 } | 21551 } |
| 20688 | 21552 |
| 20689 /** | 21553 /** |
| 20690 * Return the expression whose value will be yielded. | 21554 * Return the expression whose value will be yielded. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 20703 } | 21567 } |
| 20704 | 21568 |
| 20705 @override | 21569 @override |
| 20706 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); | 21570 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); |
| 20707 | 21571 |
| 20708 @override | 21572 @override |
| 20709 void visitChildren(AstVisitor visitor) { | 21573 void visitChildren(AstVisitor visitor) { |
| 20710 safelyVisitChild(_expression, visitor); | 21574 safelyVisitChild(_expression, visitor); |
| 20711 } | 21575 } |
| 20712 } | 21576 } |
| OLD | NEW |