OLD | NEW |
1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
3 library engine.ast; | 3 library engine.ast; |
4 import 'dart:collection'; | 4 import 'dart:collection'; |
5 import 'java_core.dart'; | 5 import 'java_core.dart'; |
6 import 'java_engine.dart'; | 6 import 'java_engine.dart'; |
7 import 'error.dart'; | 7 import 'error.dart'; |
8 import 'source.dart' show LineInfo; | 8 import 'source.dart' show LineInfo; |
9 import 'scanner.dart'; | 9 import 'scanner.dart'; |
10 import 'engine.dart' show AnalysisEngine; | 10 import 'engine.dart' show AnalysisEngine; |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 * [StringLiteral] [StringLiteral]+ | 371 * [StringLiteral] [StringLiteral]+ |
372 * </pre> | 372 * </pre> |
373 * | 373 * |
374 * @coverage dart.engine.ast | 374 * @coverage dart.engine.ast |
375 */ | 375 */ |
376 class AdjacentStrings extends StringLiteral { | 376 class AdjacentStrings extends StringLiteral { |
377 | 377 |
378 /** | 378 /** |
379 * The strings that are implicitly concatenated. | 379 * The strings that are implicitly concatenated. |
380 */ | 380 */ |
381 NodeList<StringLiteral> _strings; | 381 NodeList<StringLiteral> strings; |
382 | 382 |
383 /** | 383 /** |
384 * Initialize a newly created list of adjacent strings. | 384 * Initialize a newly created list of adjacent strings. |
385 * | 385 * |
386 * @param strings the strings that are implicitly concatenated | 386 * @param strings the strings that are implicitly concatenated |
387 */ | 387 */ |
388 AdjacentStrings.full(List<StringLiteral> strings) { | 388 AdjacentStrings.full(List<StringLiteral> strings) { |
389 this._strings = new NodeList<StringLiteral>(this); | 389 this.strings = new NodeList<StringLiteral>(this); |
390 this._strings.addAll(strings); | 390 this.strings.addAll(strings); |
391 } | 391 } |
392 | 392 |
393 /** | 393 /** |
394 * Initialize a newly created list of adjacent strings. | 394 * Initialize a newly created list of adjacent strings. |
395 * | 395 * |
396 * @param strings the strings that are implicitly concatenated | 396 * @param strings the strings that are implicitly concatenated |
397 */ | 397 */ |
398 AdjacentStrings({List<StringLiteral> strings}) : this.full(strings); | 398 AdjacentStrings({List<StringLiteral> strings}) : this.full(strings); |
399 accept(ASTVisitor visitor) => visitor.visitAdjacentStrings(this); | 399 accept(ASTVisitor visitor) => visitor.visitAdjacentStrings(this); |
400 Token get beginToken => _strings.beginToken; | 400 Token get beginToken => strings.beginToken; |
401 Token get endToken => _strings.endToken; | 401 Token get endToken => strings.endToken; |
402 | |
403 /** | |
404 * Return the strings that are implicitly concatenated. | |
405 * | |
406 * @return the strings that are implicitly concatenated | |
407 */ | |
408 NodeList<StringLiteral> get strings => _strings; | |
409 void visitChildren(ASTVisitor visitor) { | 402 void visitChildren(ASTVisitor visitor) { |
410 _strings.accept(visitor); | 403 strings.accept(visitor); |
411 } | 404 } |
412 void appendStringValue(JavaStringBuilder builder) { | 405 void appendStringValue(JavaStringBuilder builder) { |
413 for (StringLiteral stringLiteral in strings) { | 406 for (StringLiteral stringLiteral in strings) { |
414 stringLiteral.appendStringValue(builder); | 407 stringLiteral.appendStringValue(builder); |
415 } | 408 } |
416 } | 409 } |
417 } | 410 } |
418 /** | 411 /** |
419 * The abstract class `AnnotatedNode` defines the behavior of nodes that can be
annotated with | 412 * The abstract class `AnnotatedNode` defines the behavior of nodes that can be
annotated with |
420 * both a comment and metadata. | 413 * both a comment and metadata. |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 * '@' [Identifier] ('.' [SimpleIdentifier])? [ArgumentList]? | 556 * '@' [Identifier] ('.' [SimpleIdentifier])? [ArgumentList]? |
564 * </pre> | 557 * </pre> |
565 * | 558 * |
566 * @coverage dart.engine.ast | 559 * @coverage dart.engine.ast |
567 */ | 560 */ |
568 class Annotation extends ASTNode { | 561 class Annotation extends ASTNode { |
569 | 562 |
570 /** | 563 /** |
571 * The at sign that introduced the annotation. | 564 * The at sign that introduced the annotation. |
572 */ | 565 */ |
573 Token _atSign; | 566 Token atSign; |
574 | 567 |
575 /** | 568 /** |
576 * The name of the class defining the constructor that is being invoked or the
name of the field | 569 * The name of the class defining the constructor that is being invoked or the
name of the field |
577 * that is being referenced. | 570 * that is being referenced. |
578 */ | 571 */ |
579 Identifier _name; | 572 Identifier _name; |
580 | 573 |
581 /** | 574 /** |
582 * The period before the constructor name, or `null` if this annotation is not
the | 575 * The period before the constructor name, or `null` if this annotation is not
the |
583 * invocation of a named constructor. | 576 * invocation of a named constructor. |
584 */ | 577 */ |
585 Token _period; | 578 Token period; |
586 | 579 |
587 /** | 580 /** |
588 * The name of the constructor being invoked, or `null` if this annotation is
not the | 581 * The name of the constructor being invoked, or `null` if this annotation is
not the |
589 * invocation of a named constructor. | 582 * invocation of a named constructor. |
590 */ | 583 */ |
591 SimpleIdentifier _constructorName; | 584 SimpleIdentifier _constructorName; |
592 | 585 |
593 /** | 586 /** |
594 * The arguments to the constructor being invoked, or `null` if this annotatio
n is not the | 587 * The arguments to the constructor being invoked, or `null` if this annotatio
n is not the |
595 * invocation of a constructor. | 588 * invocation of a constructor. |
(...skipping 13 matching lines...) Expand all Loading... |
609 * @param name the name of the class defining the constructor that is being in
voked or the name of | 602 * @param name the name of the class defining the constructor that is being in
voked or the name of |
610 * the field that is being referenced | 603 * the field that is being referenced |
611 * @param period the period before the constructor name, or `null` if this ann
otation is not | 604 * @param period the period before the constructor name, or `null` if this ann
otation is not |
612 * the invocation of a named constructor | 605 * the invocation of a named constructor |
613 * @param constructorName the name of the constructor being invoked, or `null`
if this | 606 * @param constructorName the name of the constructor being invoked, or `null`
if this |
614 * annotation is not the invocation of a named constructor | 607 * annotation is not the invocation of a named constructor |
615 * @param arguments the arguments to the constructor being invoked, or `null`
if this | 608 * @param arguments the arguments to the constructor being invoked, or `null`
if this |
616 * annotation is not the invocation of a constructor | 609 * annotation is not the invocation of a constructor |
617 */ | 610 */ |
618 Annotation.full(Token atSign, Identifier name, Token period, SimpleIdentifier
constructorName, ArgumentList arguments) { | 611 Annotation.full(Token atSign, Identifier name, Token period, SimpleIdentifier
constructorName, ArgumentList arguments) { |
619 this._atSign = atSign; | 612 this.atSign = atSign; |
620 this._name = becomeParentOf(name); | 613 this._name = becomeParentOf(name); |
621 this._period = period; | 614 this.period = period; |
622 this._constructorName = becomeParentOf(constructorName); | 615 this._constructorName = becomeParentOf(constructorName); |
623 this._arguments = becomeParentOf(arguments); | 616 this._arguments = becomeParentOf(arguments); |
624 } | 617 } |
625 | 618 |
626 /** | 619 /** |
627 * Initialize a newly created annotation. | 620 * Initialize a newly created annotation. |
628 * | 621 * |
629 * @param atSign the at sign that introduced the annotation | 622 * @param atSign the at sign that introduced the annotation |
630 * @param name the name of the class defining the constructor that is being in
voked or the name of | 623 * @param name the name of the class defining the constructor that is being in
voked or the name of |
631 * the field that is being referenced | 624 * the field that is being referenced |
632 * @param period the period before the constructor name, or `null` if this ann
otation is not | 625 * @param period the period before the constructor name, or `null` if this ann
otation is not |
633 * the invocation of a named constructor | 626 * the invocation of a named constructor |
634 * @param constructorName the name of the constructor being invoked, or `null`
if this | 627 * @param constructorName the name of the constructor being invoked, or `null`
if this |
635 * annotation is not the invocation of a named constructor | 628 * annotation is not the invocation of a named constructor |
636 * @param arguments the arguments to the constructor being invoked, or `null`
if this | 629 * @param arguments the arguments to the constructor being invoked, or `null`
if this |
637 * annotation is not the invocation of a constructor | 630 * annotation is not the invocation of a constructor |
638 */ | 631 */ |
639 Annotation({Token atSign, Identifier name, Token period, SimpleIdentifier cons
tructorName, ArgumentList arguments}) : this.full(atSign, name, period, construc
torName, arguments); | 632 Annotation({Token atSign, Identifier name, Token period, SimpleIdentifier cons
tructorName, ArgumentList arguments}) : this.full(atSign, name, period, construc
torName, arguments); |
640 accept(ASTVisitor visitor) => visitor.visitAnnotation(this); | 633 accept(ASTVisitor visitor) => visitor.visitAnnotation(this); |
641 | 634 |
642 /** | 635 /** |
643 * Return the arguments to the constructor being invoked, or `null` if this an
notation is | 636 * Return the arguments to the constructor being invoked, or `null` if this an
notation is |
644 * not the invocation of a constructor. | 637 * not the invocation of a constructor. |
645 * | 638 * |
646 * @return the arguments to the constructor being invoked | 639 * @return the arguments to the constructor being invoked |
647 */ | 640 */ |
648 ArgumentList get arguments => _arguments; | 641 ArgumentList get arguments => _arguments; |
649 | 642 Token get beginToken => atSign; |
650 /** | |
651 * Return the at sign that introduced the annotation. | |
652 * | |
653 * @return the at sign that introduced the annotation | |
654 */ | |
655 Token get atSign => _atSign; | |
656 Token get beginToken => _atSign; | |
657 | 643 |
658 /** | 644 /** |
659 * Return the name of the constructor being invoked, or `null` if this annotat
ion is not the | 645 * Return the name of the constructor being invoked, or `null` if this annotat
ion is not the |
660 * invocation of a named constructor. | 646 * invocation of a named constructor. |
661 * | 647 * |
662 * @return the name of the constructor being invoked | 648 * @return the name of the constructor being invoked |
663 */ | 649 */ |
664 SimpleIdentifier get constructorName => _constructorName; | 650 SimpleIdentifier get constructorName => _constructorName; |
665 | 651 |
666 /** | 652 /** |
(...skipping 22 matching lines...) Expand all Loading... |
689 | 675 |
690 /** | 676 /** |
691 * Return the name of the class defining the constructor that is being invoked
or the name of the | 677 * Return the name of the class defining the constructor that is being invoked
or the name of the |
692 * field that is being referenced. | 678 * field that is being referenced. |
693 * | 679 * |
694 * @return the name of the constructor being invoked or the name of the field
being referenced | 680 * @return the name of the constructor being invoked or the name of the field
being referenced |
695 */ | 681 */ |
696 Identifier get name => _name; | 682 Identifier get name => _name; |
697 | 683 |
698 /** | 684 /** |
699 * Return the period before the constructor name, or `null` if this annotation
is not the | |
700 * invocation of a named constructor. | |
701 * | |
702 * @return the period before the constructor name | |
703 */ | |
704 Token get period => _period; | |
705 | |
706 /** | |
707 * Set the arguments to the constructor being invoked to the given arguments. | 685 * Set the arguments to the constructor being invoked to the given arguments. |
708 * | 686 * |
709 * @param arguments the arguments to the constructor being invoked | 687 * @param arguments the arguments to the constructor being invoked |
710 */ | 688 */ |
711 void set arguments(ArgumentList arguments2) { | 689 void set arguments(ArgumentList arguments2) { |
712 this._arguments = becomeParentOf(arguments2); | 690 this._arguments = becomeParentOf(arguments2); |
713 } | 691 } |
714 | 692 |
715 /** | 693 /** |
716 * Set the at sign that introduced the annotation to the given token. | |
717 * | |
718 * @param atSign the at sign that introduced the annotation | |
719 */ | |
720 void set atSign(Token atSign2) { | |
721 this._atSign = atSign2; | |
722 } | |
723 | |
724 /** | |
725 * Set the name of the constructor being invoked to the given name. | 694 * Set the name of the constructor being invoked to the given name. |
726 * | 695 * |
727 * @param constructorName the name of the constructor being invoked | 696 * @param constructorName the name of the constructor being invoked |
728 */ | 697 */ |
729 void set constructorName(SimpleIdentifier constructorName2) { | 698 void set constructorName(SimpleIdentifier constructorName2) { |
730 this._constructorName = becomeParentOf(constructorName2); | 699 this._constructorName = becomeParentOf(constructorName2); |
731 } | 700 } |
732 | 701 |
733 /** | 702 /** |
734 * Set the element associated with this annotation based. | 703 * Set the element associated with this annotation based. |
735 * | 704 * |
736 * @param element the element to be associated with this identifier | 705 * @param element the element to be associated with this identifier |
737 */ | 706 */ |
738 void set element(Element element2) { | 707 void set element(Element element2) { |
739 this._element = element2; | 708 this._element = element2; |
740 } | 709 } |
741 | 710 |
742 /** | 711 /** |
743 * Set the name of the class defining the constructor that is being invoked or
the name of the | 712 * Set the name of the class defining the constructor that is being invoked or
the name of the |
744 * field that is being referenced to the given name. | 713 * field that is being referenced to the given name. |
745 * | 714 * |
746 * @param name the name of the constructor being invoked or the name of the fi
eld being referenced | 715 * @param name the name of the constructor being invoked or the name of the fi
eld being referenced |
747 */ | 716 */ |
748 void set name(Identifier name2) { | 717 void set name(Identifier name2) { |
749 this._name = becomeParentOf(name2); | 718 this._name = becomeParentOf(name2); |
750 } | 719 } |
751 | |
752 /** | |
753 * Set the period before the constructor name to the given token. | |
754 * | |
755 * @param period the period before the constructor name | |
756 */ | |
757 void set period(Token period2) { | |
758 this._period = period2; | |
759 } | |
760 void visitChildren(ASTVisitor visitor) { | 720 void visitChildren(ASTVisitor visitor) { |
761 safelyVisitChild(_name, visitor); | 721 safelyVisitChild(_name, visitor); |
762 safelyVisitChild(_constructorName, visitor); | 722 safelyVisitChild(_constructorName, visitor); |
763 safelyVisitChild(_arguments, visitor); | 723 safelyVisitChild(_arguments, visitor); |
764 } | 724 } |
765 } | 725 } |
766 /** | 726 /** |
767 * Instances of the class `ArgumentDefinitionTest` represent an argument definit
ion test. | 727 * Instances of the class `ArgumentDefinitionTest` represent an argument definit
ion test. |
768 * | 728 * |
769 * <pre> | 729 * <pre> |
770 * argumentDefinitionTest ::= | 730 * argumentDefinitionTest ::= |
771 * '?' [SimpleIdentifier] | 731 * '?' [SimpleIdentifier] |
772 * </pre> | 732 * </pre> |
773 * | 733 * |
774 * @coverage dart.engine.ast | 734 * @coverage dart.engine.ast |
775 */ | 735 */ |
776 class ArgumentDefinitionTest extends Expression { | 736 class ArgumentDefinitionTest extends Expression { |
777 | 737 |
778 /** | 738 /** |
779 * The token representing the question mark. | 739 * The token representing the question mark. |
780 */ | 740 */ |
781 Token _question; | 741 Token question; |
782 | 742 |
783 /** | 743 /** |
784 * The identifier representing the argument being tested. | 744 * The identifier representing the argument being tested. |
785 */ | 745 */ |
786 SimpleIdentifier _identifier; | 746 SimpleIdentifier _identifier; |
787 | 747 |
788 /** | 748 /** |
789 * Initialize a newly created argument definition test. | 749 * Initialize a newly created argument definition test. |
790 * | 750 * |
791 * @param question the token representing the question mark | 751 * @param question the token representing the question mark |
792 * @param identifier the identifier representing the argument being tested | 752 * @param identifier the identifier representing the argument being tested |
793 */ | 753 */ |
794 ArgumentDefinitionTest.full(Token question, SimpleIdentifier identifier) { | 754 ArgumentDefinitionTest.full(Token question, SimpleIdentifier identifier) { |
795 this._question = question; | 755 this.question = question; |
796 this._identifier = becomeParentOf(identifier); | 756 this._identifier = becomeParentOf(identifier); |
797 } | 757 } |
798 | 758 |
799 /** | 759 /** |
800 * Initialize a newly created argument definition test. | 760 * Initialize a newly created argument definition test. |
801 * | 761 * |
802 * @param question the token representing the question mark | 762 * @param question the token representing the question mark |
803 * @param identifier the identifier representing the argument being tested | 763 * @param identifier the identifier representing the argument being tested |
804 */ | 764 */ |
805 ArgumentDefinitionTest({Token question, SimpleIdentifier identifier}) : this.f
ull(question, identifier); | 765 ArgumentDefinitionTest({Token question, SimpleIdentifier identifier}) : this.f
ull(question, identifier); |
806 accept(ASTVisitor visitor) => visitor.visitArgumentDefinitionTest(this); | 766 accept(ASTVisitor visitor) => visitor.visitArgumentDefinitionTest(this); |
807 Token get beginToken => _question; | 767 Token get beginToken => question; |
808 Token get endToken => _identifier.endToken; | 768 Token get endToken => _identifier.endToken; |
809 | 769 |
810 /** | 770 /** |
811 * Return the identifier representing the argument being tested. | 771 * Return the identifier representing the argument being tested. |
812 * | 772 * |
813 * @return the identifier representing the argument being tested | 773 * @return the identifier representing the argument being tested |
814 */ | 774 */ |
815 SimpleIdentifier get identifier => _identifier; | 775 SimpleIdentifier get identifier => _identifier; |
816 | 776 |
817 /** | 777 /** |
818 * Return the token representing the question mark. | |
819 * | |
820 * @return the token representing the question mark | |
821 */ | |
822 Token get question => _question; | |
823 | |
824 /** | |
825 * Set the identifier representing the argument being tested to the given iden
tifier. | 778 * Set the identifier representing the argument being tested to the given iden
tifier. |
826 * | 779 * |
827 * @param identifier the identifier representing the argument being tested | 780 * @param identifier the identifier representing the argument being tested |
828 */ | 781 */ |
829 void set identifier(SimpleIdentifier identifier2) { | 782 void set identifier(SimpleIdentifier identifier2) { |
830 this._identifier = becomeParentOf(identifier2); | 783 this._identifier = becomeParentOf(identifier2); |
831 } | 784 } |
832 | |
833 /** | |
834 * Set the token representing the question mark to the given token. | |
835 * | |
836 * @param question the token representing the question mark | |
837 */ | |
838 void set question(Token question2) { | |
839 this._question = question2; | |
840 } | |
841 void visitChildren(ASTVisitor visitor) { | 785 void visitChildren(ASTVisitor visitor) { |
842 safelyVisitChild(_identifier, visitor); | 786 safelyVisitChild(_identifier, visitor); |
843 } | 787 } |
844 } | 788 } |
845 /** | 789 /** |
846 * Instances of the class `ArgumentList` represent a list of arguments in the in
vocation of a | 790 * Instances of the class `ArgumentList` represent a list of arguments in the in
vocation of a |
847 * executable element: a function, method, or constructor. | 791 * executable element: a function, method, or constructor. |
848 * | 792 * |
849 * <pre> | 793 * <pre> |
850 * argumentList ::= | 794 * argumentList ::= |
851 * '(' arguments? ')' | 795 * '(' arguments? ')' |
852 * | 796 * |
853 * arguments ::= | 797 * arguments ::= |
854 * [NamedExpression] (',' [NamedExpression])* | 798 * [NamedExpression] (',' [NamedExpression])* |
855 * | [Expression] (',' [NamedExpression])* | 799 * | [Expression] (',' [NamedExpression])* |
856 * </pre> | 800 * </pre> |
857 * | 801 * |
858 * @coverage dart.engine.ast | 802 * @coverage dart.engine.ast |
859 */ | 803 */ |
860 class ArgumentList extends ASTNode { | 804 class ArgumentList extends ASTNode { |
861 | 805 |
862 /** | 806 /** |
863 * The left parenthesis. | 807 * The left parenthesis. |
864 */ | 808 */ |
865 Token _leftParenthesis; | 809 Token _leftParenthesis; |
866 | 810 |
867 /** | 811 /** |
868 * The expressions producing the values of the arguments. | 812 * The expressions producing the values of the arguments. |
869 */ | 813 */ |
870 NodeList<Expression> _arguments; | 814 NodeList<Expression> arguments; |
871 | 815 |
872 /** | 816 /** |
873 * The right parenthesis. | 817 * The right parenthesis. |
874 */ | 818 */ |
875 Token _rightParenthesis; | 819 Token _rightParenthesis; |
876 | 820 |
877 /** | 821 /** |
878 * An array containing the elements representing the parameters corresponding
to each of the | 822 * An array containing the elements representing the parameters corresponding
to each of the |
879 * arguments in this list, or `null` if the AST has not been resolved or if th
e function or | 823 * arguments in this list, or `null` if the AST has not been resolved or if th
e function or |
880 * method being invoked could not be determined based on static type informati
on. The array must | 824 * method being invoked could not be determined based on static type informati
on. The array must |
(...skipping 12 matching lines...) Expand all Loading... |
893 List<ParameterElement> _correspondingPropagatedParameters; | 837 List<ParameterElement> _correspondingPropagatedParameters; |
894 | 838 |
895 /** | 839 /** |
896 * Initialize a newly created list of arguments. | 840 * Initialize a newly created list of arguments. |
897 * | 841 * |
898 * @param leftParenthesis the left parenthesis | 842 * @param leftParenthesis the left parenthesis |
899 * @param arguments the expressions producing the values of the arguments | 843 * @param arguments the expressions producing the values of the arguments |
900 * @param rightParenthesis the right parenthesis | 844 * @param rightParenthesis the right parenthesis |
901 */ | 845 */ |
902 ArgumentList.full(Token leftParenthesis, List<Expression> arguments, Token rig
htParenthesis) { | 846 ArgumentList.full(Token leftParenthesis, List<Expression> arguments, Token rig
htParenthesis) { |
903 this._arguments = new NodeList<Expression>(this); | 847 this.arguments = new NodeList<Expression>(this); |
904 this._leftParenthesis = leftParenthesis; | 848 this._leftParenthesis = leftParenthesis; |
905 this._arguments.addAll(arguments); | 849 this.arguments.addAll(arguments); |
906 this._rightParenthesis = rightParenthesis; | 850 this._rightParenthesis = rightParenthesis; |
907 } | 851 } |
908 | 852 |
909 /** | 853 /** |
910 * Initialize a newly created list of arguments. | 854 * Initialize a newly created list of arguments. |
911 * | 855 * |
912 * @param leftParenthesis the left parenthesis | 856 * @param leftParenthesis the left parenthesis |
913 * @param arguments the expressions producing the values of the arguments | 857 * @param arguments the expressions producing the values of the arguments |
914 * @param rightParenthesis the right parenthesis | 858 * @param rightParenthesis the right parenthesis |
915 */ | 859 */ |
916 ArgumentList({Token leftParenthesis, List<Expression> arguments, Token rightPa
renthesis}) : this.full(leftParenthesis, arguments, rightParenthesis); | 860 ArgumentList({Token leftParenthesis, List<Expression> arguments, Token rightPa
renthesis}) : this.full(leftParenthesis, arguments, rightParenthesis); |
917 accept(ASTVisitor visitor) => visitor.visitArgumentList(this); | 861 accept(ASTVisitor visitor) => visitor.visitArgumentList(this); |
918 | |
919 /** | |
920 * Return the expressions producing the values of the arguments. Although the
language requires | |
921 * that positional arguments appear before named arguments, this class allows
them to be | |
922 * intermixed. | |
923 * | |
924 * @return the expressions producing the values of the arguments | |
925 */ | |
926 NodeList<Expression> get arguments => _arguments; | |
927 Token get beginToken => _leftParenthesis; | 862 Token get beginToken => _leftParenthesis; |
928 Token get endToken => _rightParenthesis; | 863 Token get endToken => _rightParenthesis; |
929 | 864 |
930 /** | 865 /** |
931 * Return the left parenthesis. | 866 * Return the left parenthesis. |
932 * | 867 * |
933 * @return the left parenthesis | 868 * @return the left parenthesis |
934 */ | 869 */ |
935 Token get leftParenthesis => _leftParenthesis; | 870 Token get leftParenthesis => _leftParenthesis; |
936 | 871 |
937 /** | 872 /** |
938 * Return the right parenthesis. | 873 * Return the right parenthesis. |
939 * | 874 * |
940 * @return the right parenthesis | 875 * @return the right parenthesis |
941 */ | 876 */ |
942 Token get rightParenthesis => _rightParenthesis; | 877 Token get rightParenthesis => _rightParenthesis; |
943 | 878 |
944 /** | 879 /** |
945 * Set the parameter elements corresponding to each of the arguments in this l
ist to the given | 880 * Set the parameter elements corresponding to each of the arguments in this l
ist to the given |
946 * array of parameters. The array of parameters must be the same length as the
number of | 881 * array of parameters. The array of parameters must be the same length as the
number of |
947 * arguments, but can contain `null` entries if a given argument does not corr
espond to a | 882 * arguments, but can contain `null` entries if a given argument does not corr
espond to a |
948 * formal parameter. | 883 * formal parameter. |
949 * | 884 * |
950 * @param parameters the parameter elements corresponding to the arguments | 885 * @param parameters the parameter elements corresponding to the arguments |
951 */ | 886 */ |
952 void set correspondingPropagatedParameters(List<ParameterElement> parameters)
{ | 887 void set correspondingPropagatedParameters(List<ParameterElement> parameters)
{ |
953 if (parameters.length != _arguments.length) { | 888 if (parameters.length != arguments.length) { |
954 throw new IllegalArgumentException("Expected ${_arguments.length} paramete
rs, not ${parameters.length}"); | 889 throw new IllegalArgumentException("Expected ${arguments.length} parameter
s, not ${parameters.length}"); |
955 } | 890 } |
956 _correspondingPropagatedParameters = parameters; | 891 _correspondingPropagatedParameters = parameters; |
957 } | 892 } |
958 | 893 |
959 /** | 894 /** |
960 * Set the parameter elements corresponding to each of the arguments in this l
ist to the given | 895 * Set the parameter elements corresponding to each of the arguments in this l
ist to the given |
961 * array of parameters. The array of parameters must be the same length as the
number of | 896 * array of parameters. The array of parameters must be the same length as the
number of |
962 * arguments, but can contain `null` entries if a given argument does not corr
espond to a | 897 * arguments, but can contain `null` entries if a given argument does not corr
espond to a |
963 * formal parameter. | 898 * formal parameter. |
964 * | 899 * |
965 * @param parameters the parameter elements corresponding to the arguments | 900 * @param parameters the parameter elements corresponding to the arguments |
966 */ | 901 */ |
967 void set correspondingStaticParameters(List<ParameterElement> parameters) { | 902 void set correspondingStaticParameters(List<ParameterElement> parameters) { |
968 if (parameters.length != _arguments.length) { | 903 if (parameters.length != arguments.length) { |
969 throw new IllegalArgumentException("Expected ${_arguments.length} paramete
rs, not ${parameters.length}"); | 904 throw new IllegalArgumentException("Expected ${arguments.length} parameter
s, not ${parameters.length}"); |
970 } | 905 } |
971 _correspondingStaticParameters = parameters; | 906 _correspondingStaticParameters = parameters; |
972 } | 907 } |
973 | 908 |
974 /** | 909 /** |
975 * Set the left parenthesis to the given token. | 910 * Set the left parenthesis to the given token. |
976 * | 911 * |
977 * @param parenthesis the left parenthesis | 912 * @param parenthesis the left parenthesis |
978 */ | 913 */ |
979 void set leftParenthesis(Token parenthesis) { | 914 void set leftParenthesis(Token parenthesis) { |
980 _leftParenthesis = parenthesis; | 915 _leftParenthesis = parenthesis; |
981 } | 916 } |
982 | 917 |
983 /** | 918 /** |
984 * Set the right parenthesis to the given token. | 919 * Set the right parenthesis to the given token. |
985 * | 920 * |
986 * @param parenthesis the right parenthesis | 921 * @param parenthesis the right parenthesis |
987 */ | 922 */ |
988 void set rightParenthesis(Token parenthesis) { | 923 void set rightParenthesis(Token parenthesis) { |
989 _rightParenthesis = parenthesis; | 924 _rightParenthesis = parenthesis; |
990 } | 925 } |
991 void visitChildren(ASTVisitor visitor) { | 926 void visitChildren(ASTVisitor visitor) { |
992 _arguments.accept(visitor); | 927 arguments.accept(visitor); |
993 } | 928 } |
994 | 929 |
995 /** | 930 /** |
996 * If the given expression is a child of this list, and the AST structure has
been resolved, and | 931 * If the given expression is a child of this list, and the AST structure has
been resolved, and |
997 * the function being invoked is known based on propagated type information, a
nd the expression | 932 * the function being invoked is known based on propagated type information, a
nd the expression |
998 * corresponds to one of the parameters of the function being invoked, then re
turn the parameter | 933 * corresponds to one of the parameters of the function being invoked, then re
turn the parameter |
999 * element representing the parameter to which the value of the given expressi
on will be bound. | 934 * element representing the parameter to which the value of the given expressi
on will be bound. |
1000 * Otherwise, return `null`. | 935 * Otherwise, return `null`. |
1001 * | 936 * |
1002 * This method is only intended to be used by [Expression#getPropagatedParamet
erElement]. | 937 * This method is only intended to be used by [Expression#getPropagatedParamet
erElement]. |
1003 * | 938 * |
1004 * @param expression the expression corresponding to the parameter to be retur
ned | 939 * @param expression the expression corresponding to the parameter to be retur
ned |
1005 * @return the parameter element representing the parameter to which the value
of the expression | 940 * @return the parameter element representing the parameter to which the value
of the expression |
1006 * will be bound | 941 * will be bound |
1007 */ | 942 */ |
1008 ParameterElement getPropagatedParameterElementFor(Expression expression) { | 943 ParameterElement getPropagatedParameterElementFor(Expression expression) { |
1009 if (_correspondingPropagatedParameters == null) { | 944 if (_correspondingPropagatedParameters == null) { |
1010 return null; | 945 return null; |
1011 } | 946 } |
1012 int index = _arguments.indexOf(expression); | 947 int index = arguments.indexOf(expression); |
1013 if (index < 0) { | 948 if (index < 0) { |
1014 return null; | 949 return null; |
1015 } | 950 } |
1016 return _correspondingPropagatedParameters[index]; | 951 return _correspondingPropagatedParameters[index]; |
1017 } | 952 } |
1018 | 953 |
1019 /** | 954 /** |
1020 * If the given expression is a child of this list, and the AST structure has
been resolved, and | 955 * If the given expression is a child of this list, and the AST structure has
been resolved, and |
1021 * the function being invoked is known based on static type information, and t
he expression | 956 * the function being invoked is known based on static type information, and t
he expression |
1022 * corresponds to one of the parameters of the function being invoked, then re
turn the parameter | 957 * corresponds to one of the parameters of the function being invoked, then re
turn the parameter |
1023 * element representing the parameter to which the value of the given expressi
on will be bound. | 958 * element representing the parameter to which the value of the given expressi
on will be bound. |
1024 * Otherwise, return `null`. | 959 * Otherwise, return `null`. |
1025 * | 960 * |
1026 * This method is only intended to be used by [Expression#getStaticParameterEl
ement]. | 961 * This method is only intended to be used by [Expression#getStaticParameterEl
ement]. |
1027 * | 962 * |
1028 * @param expression the expression corresponding to the parameter to be retur
ned | 963 * @param expression the expression corresponding to the parameter to be retur
ned |
1029 * @return the parameter element representing the parameter to which the value
of the expression | 964 * @return the parameter element representing the parameter to which the value
of the expression |
1030 * will be bound | 965 * will be bound |
1031 */ | 966 */ |
1032 ParameterElement getStaticParameterElementFor(Expression expression) { | 967 ParameterElement getStaticParameterElementFor(Expression expression) { |
1033 if (_correspondingStaticParameters == null) { | 968 if (_correspondingStaticParameters == null) { |
1034 return null; | 969 return null; |
1035 } | 970 } |
1036 int index = _arguments.indexOf(expression); | 971 int index = arguments.indexOf(expression); |
1037 if (index < 0) { | 972 if (index < 0) { |
1038 return null; | 973 return null; |
1039 } | 974 } |
1040 return _correspondingStaticParameters[index]; | 975 return _correspondingStaticParameters[index]; |
1041 } | 976 } |
1042 } | 977 } |
1043 /** | 978 /** |
1044 * Instances of the class `AsExpression` represent an 'as' expression. | 979 * Instances of the class `AsExpression` represent an 'as' expression. |
1045 * | 980 * |
1046 * <pre> | 981 * <pre> |
1047 * asExpression ::= | 982 * asExpression ::= |
1048 * [Expression] 'as' [TypeName] | 983 * [Expression] 'as' [TypeName] |
1049 * </pre> | 984 * </pre> |
1050 * | 985 * |
1051 * @coverage dart.engine.ast | 986 * @coverage dart.engine.ast |
1052 */ | 987 */ |
1053 class AsExpression extends Expression { | 988 class AsExpression extends Expression { |
1054 | 989 |
1055 /** | 990 /** |
1056 * The expression used to compute the value being cast. | 991 * The expression used to compute the value being cast. |
1057 */ | 992 */ |
1058 Expression _expression; | 993 Expression _expression; |
1059 | 994 |
1060 /** | 995 /** |
1061 * The as operator. | 996 * The as operator. |
1062 */ | 997 */ |
1063 Token _asOperator; | 998 Token asOperator; |
1064 | 999 |
1065 /** | 1000 /** |
1066 * The name of the type being cast to. | 1001 * The name of the type being cast to. |
1067 */ | 1002 */ |
1068 TypeName _type; | 1003 TypeName _type; |
1069 | 1004 |
1070 /** | 1005 /** |
1071 * Initialize a newly created as expression. | 1006 * Initialize a newly created as expression. |
1072 * | 1007 * |
1073 * @param expression the expression used to compute the value being cast | 1008 * @param expression the expression used to compute the value being cast |
1074 * @param isOperator the is operator | 1009 * @param isOperator the is operator |
1075 * @param type the name of the type being cast to | 1010 * @param type the name of the type being cast to |
1076 */ | 1011 */ |
1077 AsExpression.full(Expression expression, Token isOperator, TypeName type) { | 1012 AsExpression.full(Expression expression, Token isOperator, TypeName type) { |
1078 this._expression = becomeParentOf(expression); | 1013 this._expression = becomeParentOf(expression); |
1079 this._asOperator = isOperator; | 1014 this.asOperator = isOperator; |
1080 this._type = becomeParentOf(type); | 1015 this._type = becomeParentOf(type); |
1081 } | 1016 } |
1082 | 1017 |
1083 /** | 1018 /** |
1084 * Initialize a newly created as expression. | 1019 * Initialize a newly created as expression. |
1085 * | 1020 * |
1086 * @param expression the expression used to compute the value being cast | 1021 * @param expression the expression used to compute the value being cast |
1087 * @param isOperator the is operator | 1022 * @param isOperator the is operator |
1088 * @param type the name of the type being cast to | 1023 * @param type the name of the type being cast to |
1089 */ | 1024 */ |
1090 AsExpression({Expression expression, Token isOperator, TypeName type}) : this.
full(expression, isOperator, type); | 1025 AsExpression({Expression expression, Token isOperator, TypeName type}) : this.
full(expression, isOperator, type); |
1091 accept(ASTVisitor visitor) => visitor.visitAsExpression(this); | 1026 accept(ASTVisitor visitor) => visitor.visitAsExpression(this); |
1092 | |
1093 /** | |
1094 * Return the as operator being applied. | |
1095 * | |
1096 * @return the as operator being applied | |
1097 */ | |
1098 Token get asOperator => _asOperator; | |
1099 Token get beginToken => _expression.beginToken; | 1027 Token get beginToken => _expression.beginToken; |
1100 Token get endToken => _type.endToken; | 1028 Token get endToken => _type.endToken; |
1101 | 1029 |
1102 /** | 1030 /** |
1103 * Return the expression used to compute the value being cast. | 1031 * Return the expression used to compute the value being cast. |
1104 * | 1032 * |
1105 * @return the expression used to compute the value being cast | 1033 * @return the expression used to compute the value being cast |
1106 */ | 1034 */ |
1107 Expression get expression => _expression; | 1035 Expression get expression => _expression; |
1108 | 1036 |
1109 /** | 1037 /** |
1110 * Return the name of the type being cast to. | 1038 * Return the name of the type being cast to. |
1111 * | 1039 * |
1112 * @return the name of the type being cast to | 1040 * @return the name of the type being cast to |
1113 */ | 1041 */ |
1114 TypeName get type => _type; | 1042 TypeName get type => _type; |
1115 | 1043 |
1116 /** | 1044 /** |
1117 * Set the is operator being applied to the given operator. | |
1118 * | |
1119 * @param asOperator the is operator being applied | |
1120 */ | |
1121 void set asOperator(Token asOperator2) { | |
1122 this._asOperator = asOperator2; | |
1123 } | |
1124 | |
1125 /** | |
1126 * Set the expression used to compute the value being cast to the given expres
sion. | 1045 * Set the expression used to compute the value being cast to the given expres
sion. |
1127 * | 1046 * |
1128 * @param expression the expression used to compute the value being cast | 1047 * @param expression the expression used to compute the value being cast |
1129 */ | 1048 */ |
1130 void set expression(Expression expression2) { | 1049 void set expression(Expression expression2) { |
1131 this._expression = becomeParentOf(expression2); | 1050 this._expression = becomeParentOf(expression2); |
1132 } | 1051 } |
1133 | 1052 |
1134 /** | 1053 /** |
1135 * Set the name of the type being cast to to the given name. | 1054 * Set the name of the type being cast to to the given name. |
(...skipping 16 matching lines...) Expand all Loading... |
1152 * 'assert' '(' [Expression] ')' ';' | 1071 * 'assert' '(' [Expression] ')' ';' |
1153 * </pre> | 1072 * </pre> |
1154 * | 1073 * |
1155 * @coverage dart.engine.ast | 1074 * @coverage dart.engine.ast |
1156 */ | 1075 */ |
1157 class AssertStatement extends Statement { | 1076 class AssertStatement extends Statement { |
1158 | 1077 |
1159 /** | 1078 /** |
1160 * The token representing the 'assert' keyword. | 1079 * The token representing the 'assert' keyword. |
1161 */ | 1080 */ |
1162 Token _keyword; | 1081 Token keyword; |
1163 | 1082 |
1164 /** | 1083 /** |
1165 * The left parenthesis. | 1084 * The left parenthesis. |
1166 */ | 1085 */ |
1167 Token _leftParenthesis; | 1086 Token leftParenthesis; |
1168 | 1087 |
1169 /** | 1088 /** |
1170 * The condition that is being asserted to be `true`. | 1089 * The condition that is being asserted to be `true`. |
1171 */ | 1090 */ |
1172 Expression _condition; | 1091 Expression _condition; |
1173 | 1092 |
1174 /** | 1093 /** |
1175 * The right parenthesis. | 1094 * The right parenthesis. |
1176 */ | 1095 */ |
1177 Token _rightParenthesis; | 1096 Token rightParenthesis; |
1178 | 1097 |
1179 /** | 1098 /** |
1180 * The semicolon terminating the statement. | 1099 * The semicolon terminating the statement. |
1181 */ | 1100 */ |
1182 Token _semicolon; | 1101 Token semicolon; |
1183 | 1102 |
1184 /** | 1103 /** |
1185 * Initialize a newly created assert statement. | 1104 * Initialize a newly created assert statement. |
1186 * | 1105 * |
1187 * @param keyword the token representing the 'assert' keyword | 1106 * @param keyword the token representing the 'assert' keyword |
1188 * @param leftParenthesis the left parenthesis | 1107 * @param leftParenthesis the left parenthesis |
1189 * @param condition the condition that is being asserted to be `true` | 1108 * @param condition the condition that is being asserted to be `true` |
1190 * @param rightParenthesis the right parenthesis | 1109 * @param rightParenthesis the right parenthesis |
1191 * @param semicolon the semicolon terminating the statement | 1110 * @param semicolon the semicolon terminating the statement |
1192 */ | 1111 */ |
1193 AssertStatement.full(Token keyword, Token leftParenthesis, Expression conditio
n, Token rightParenthesis, Token semicolon) { | 1112 AssertStatement.full(Token keyword, Token leftParenthesis, Expression conditio
n, Token rightParenthesis, Token semicolon) { |
1194 this._keyword = keyword; | 1113 this.keyword = keyword; |
1195 this._leftParenthesis = leftParenthesis; | 1114 this.leftParenthesis = leftParenthesis; |
1196 this._condition = becomeParentOf(condition); | 1115 this._condition = becomeParentOf(condition); |
1197 this._rightParenthesis = rightParenthesis; | 1116 this.rightParenthesis = rightParenthesis; |
1198 this._semicolon = semicolon; | 1117 this.semicolon = semicolon; |
1199 } | 1118 } |
1200 | 1119 |
1201 /** | 1120 /** |
1202 * Initialize a newly created assert statement. | 1121 * Initialize a newly created assert statement. |
1203 * | 1122 * |
1204 * @param keyword the token representing the 'assert' keyword | 1123 * @param keyword the token representing the 'assert' keyword |
1205 * @param leftParenthesis the left parenthesis | 1124 * @param leftParenthesis the left parenthesis |
1206 * @param condition the condition that is being asserted to be `true` | 1125 * @param condition the condition that is being asserted to be `true` |
1207 * @param rightParenthesis the right parenthesis | 1126 * @param rightParenthesis the right parenthesis |
1208 * @param semicolon the semicolon terminating the statement | 1127 * @param semicolon the semicolon terminating the statement |
1209 */ | 1128 */ |
1210 AssertStatement({Token keyword, Token leftParenthesis, Expression condition, T
oken rightParenthesis, Token semicolon}) : this.full(keyword, leftParenthesis, c
ondition, rightParenthesis, semicolon); | 1129 AssertStatement({Token keyword, Token leftParenthesis, Expression condition, T
oken rightParenthesis, Token semicolon}) : this.full(keyword, leftParenthesis, c
ondition, rightParenthesis, semicolon); |
1211 accept(ASTVisitor visitor) => visitor.visitAssertStatement(this); | 1130 accept(ASTVisitor visitor) => visitor.visitAssertStatement(this); |
1212 Token get beginToken => _keyword; | 1131 Token get beginToken => keyword; |
1213 | 1132 |
1214 /** | 1133 /** |
1215 * Return the condition that is being asserted to be `true`. | 1134 * Return the condition that is being asserted to be `true`. |
1216 * | 1135 * |
1217 * @return the condition that is being asserted to be `true` | 1136 * @return the condition that is being asserted to be `true` |
1218 */ | 1137 */ |
1219 Expression get condition => _condition; | 1138 Expression get condition => _condition; |
1220 Token get endToken => _semicolon; | 1139 Token get endToken => semicolon; |
1221 | |
1222 /** | |
1223 * Return the token representing the 'assert' keyword. | |
1224 * | |
1225 * @return the token representing the 'assert' keyword | |
1226 */ | |
1227 Token get keyword => _keyword; | |
1228 | |
1229 /** | |
1230 * Return the left parenthesis. | |
1231 * | |
1232 * @return the left parenthesis | |
1233 */ | |
1234 Token get leftParenthesis => _leftParenthesis; | |
1235 | |
1236 /** | |
1237 * Return the right parenthesis. | |
1238 * | |
1239 * @return the right parenthesis | |
1240 */ | |
1241 Token get rightParenthesis => _rightParenthesis; | |
1242 | |
1243 /** | |
1244 * Return the semicolon terminating the statement. | |
1245 * | |
1246 * @return the semicolon terminating the statement | |
1247 */ | |
1248 Token get semicolon => _semicolon; | |
1249 | 1140 |
1250 /** | 1141 /** |
1251 * Set the condition that is being asserted to be `true` to the given expressi
on. | 1142 * Set the condition that is being asserted to be `true` to the given expressi
on. |
1252 * | 1143 * |
1253 * @param the condition that is being asserted to be `true` | 1144 * @param the condition that is being asserted to be `true` |
1254 */ | 1145 */ |
1255 void set condition(Expression condition2) { | 1146 void set condition(Expression condition2) { |
1256 this._condition = becomeParentOf(condition2); | 1147 this._condition = becomeParentOf(condition2); |
1257 } | 1148 } |
1258 | |
1259 /** | |
1260 * Set the token representing the 'assert' keyword to the given token. | |
1261 * | |
1262 * @param keyword the token representing the 'assert' keyword | |
1263 */ | |
1264 void set keyword(Token keyword2) { | |
1265 this._keyword = keyword2; | |
1266 } | |
1267 | |
1268 /** | |
1269 * Set the left parenthesis to the given token. | |
1270 * | |
1271 * @param the left parenthesis | |
1272 */ | |
1273 void set leftParenthesis(Token leftParenthesis2) { | |
1274 this._leftParenthesis = leftParenthesis2; | |
1275 } | |
1276 | |
1277 /** | |
1278 * Set the right parenthesis to the given token. | |
1279 * | |
1280 * @param rightParenthesis the right parenthesis | |
1281 */ | |
1282 void set rightParenthesis(Token rightParenthesis2) { | |
1283 this._rightParenthesis = rightParenthesis2; | |
1284 } | |
1285 | |
1286 /** | |
1287 * Set the semicolon terminating the statement to the given token. | |
1288 * | |
1289 * @param semicolon the semicolon terminating the statement | |
1290 */ | |
1291 void set semicolon(Token semicolon2) { | |
1292 this._semicolon = semicolon2; | |
1293 } | |
1294 void visitChildren(ASTVisitor visitor) { | 1149 void visitChildren(ASTVisitor visitor) { |
1295 safelyVisitChild(_condition, visitor); | 1150 safelyVisitChild(_condition, visitor); |
1296 } | 1151 } |
1297 } | 1152 } |
1298 /** | 1153 /** |
1299 * Instances of the class `AssignmentExpression` represent an assignment express
ion. | 1154 * Instances of the class `AssignmentExpression` represent an assignment express
ion. |
1300 * | 1155 * |
1301 * <pre> | 1156 * <pre> |
1302 * assignmentExpression ::= | 1157 * assignmentExpression ::= |
1303 * [Expression] [Token] [Expression] | 1158 * [Expression] [Token] [Expression] |
1304 * </pre> | 1159 * </pre> |
1305 * | 1160 * |
1306 * @coverage dart.engine.ast | 1161 * @coverage dart.engine.ast |
1307 */ | 1162 */ |
1308 class AssignmentExpression extends Expression { | 1163 class AssignmentExpression extends Expression { |
1309 | 1164 |
1310 /** | 1165 /** |
1311 * The expression used to compute the left hand side. | 1166 * The expression used to compute the left hand side. |
1312 */ | 1167 */ |
1313 Expression _leftHandSide; | 1168 Expression _leftHandSide; |
1314 | 1169 |
1315 /** | 1170 /** |
1316 * The assignment operator being applied. | 1171 * The assignment operator being applied. |
1317 */ | 1172 */ |
1318 Token _operator; | 1173 Token operator; |
1319 | 1174 |
1320 /** | 1175 /** |
1321 * The expression used to compute the right hand side. | 1176 * The expression used to compute the right hand side. |
1322 */ | 1177 */ |
1323 Expression _rightHandSide; | 1178 Expression _rightHandSide; |
1324 | 1179 |
1325 /** | 1180 /** |
1326 * The element associated with the operator based on the static type of the le
ft-hand-side, or | 1181 * The element associated with the operator based on the static type of the le
ft-hand-side, or |
1327 * `null` if the AST structure has not been resolved, if the operator is not a
compound | 1182 * `null` if the AST structure has not been resolved, if the operator is not a
compound |
1328 * operator, or if the operator could not be resolved. | 1183 * operator, or if the operator could not be resolved. |
1329 */ | 1184 */ |
1330 MethodElement _staticElement; | 1185 MethodElement _staticElement; |
1331 | 1186 |
1332 /** | 1187 /** |
1333 * The element associated with the operator based on the propagated type of th
e left-hand-side, or | 1188 * The element associated with the operator based on the propagated type of th
e left-hand-side, or |
1334 * `null` if the AST structure has not been resolved, if the operator is not a
compound | 1189 * `null` if the AST structure has not been resolved, if the operator is not a
compound |
1335 * operator, or if the operator could not be resolved. | 1190 * operator, or if the operator could not be resolved. |
1336 */ | 1191 */ |
1337 MethodElement _propagatedElement; | 1192 MethodElement _propagatedElement; |
1338 | 1193 |
1339 /** | 1194 /** |
1340 * Initialize a newly created assignment expression. | 1195 * Initialize a newly created assignment expression. |
1341 * | 1196 * |
1342 * @param leftHandSide the expression used to compute the left hand side | 1197 * @param leftHandSide the expression used to compute the left hand side |
1343 * @param operator the assignment operator being applied | 1198 * @param operator the assignment operator being applied |
1344 * @param rightHandSide the expression used to compute the right hand side | 1199 * @param rightHandSide the expression used to compute the right hand side |
1345 */ | 1200 */ |
1346 AssignmentExpression.full(Expression leftHandSide, Token operator, Expression
rightHandSide) { | 1201 AssignmentExpression.full(Expression leftHandSide, Token operator, Expression
rightHandSide) { |
1347 this._leftHandSide = becomeParentOf(leftHandSide); | 1202 this._leftHandSide = becomeParentOf(leftHandSide); |
1348 this._operator = operator; | 1203 this.operator = operator; |
1349 this._rightHandSide = becomeParentOf(rightHandSide); | 1204 this._rightHandSide = becomeParentOf(rightHandSide); |
1350 } | 1205 } |
1351 | 1206 |
1352 /** | 1207 /** |
1353 * Initialize a newly created assignment expression. | 1208 * Initialize a newly created assignment expression. |
1354 * | 1209 * |
1355 * @param leftHandSide the expression used to compute the left hand side | 1210 * @param leftHandSide the expression used to compute the left hand side |
1356 * @param operator the assignment operator being applied | 1211 * @param operator the assignment operator being applied |
1357 * @param rightHandSide the expression used to compute the right hand side | 1212 * @param rightHandSide the expression used to compute the right hand side |
1358 */ | 1213 */ |
(...skipping 19 matching lines...) Expand all Loading... |
1378 Token get endToken => _rightHandSide.endToken; | 1233 Token get endToken => _rightHandSide.endToken; |
1379 | 1234 |
1380 /** | 1235 /** |
1381 * Set the expression used to compute the left hand side to the given expressi
on. | 1236 * Set the expression used to compute the left hand side to the given expressi
on. |
1382 * | 1237 * |
1383 * @return the expression used to compute the left hand side | 1238 * @return the expression used to compute the left hand side |
1384 */ | 1239 */ |
1385 Expression get leftHandSide => _leftHandSide; | 1240 Expression get leftHandSide => _leftHandSide; |
1386 | 1241 |
1387 /** | 1242 /** |
1388 * Return the assignment operator being applied. | |
1389 * | |
1390 * @return the assignment operator being applied | |
1391 */ | |
1392 Token get operator => _operator; | |
1393 | |
1394 /** | |
1395 * Return the element associated with the operator based on the propagated typ
e of the | 1243 * Return the element associated with the operator based on the propagated typ
e of the |
1396 * left-hand-side, or `null` if the AST structure has not been resolved, if th
e operator is | 1244 * left-hand-side, or `null` if the AST structure has not been resolved, if th
e operator is |
1397 * not a compound operator, or if the operator could not be resolved. One exam
ple of the latter | 1245 * not a compound operator, or if the operator could not be resolved. One exam
ple of the latter |
1398 * case is an operator that is not defined for the type of the left-hand opera
nd. | 1246 * case is an operator that is not defined for the type of the left-hand opera
nd. |
1399 * | 1247 * |
1400 * @return the element associated with the operator | 1248 * @return the element associated with the operator |
1401 */ | 1249 */ |
1402 MethodElement get propagatedElement => _propagatedElement; | 1250 MethodElement get propagatedElement => _propagatedElement; |
1403 | 1251 |
1404 /** | 1252 /** |
(...skipping 16 matching lines...) Expand all Loading... |
1421 /** | 1269 /** |
1422 * Return the expression used to compute the left hand side. | 1270 * Return the expression used to compute the left hand side. |
1423 * | 1271 * |
1424 * @param expression the expression used to compute the left hand side | 1272 * @param expression the expression used to compute the left hand side |
1425 */ | 1273 */ |
1426 void set leftHandSide(Expression expression) { | 1274 void set leftHandSide(Expression expression) { |
1427 _leftHandSide = becomeParentOf(expression); | 1275 _leftHandSide = becomeParentOf(expression); |
1428 } | 1276 } |
1429 | 1277 |
1430 /** | 1278 /** |
1431 * Set the assignment operator being applied to the given operator. | |
1432 * | |
1433 * @param operator the assignment operator being applied | |
1434 */ | |
1435 void set operator(Token operator2) { | |
1436 this._operator = operator2; | |
1437 } | |
1438 | |
1439 /** | |
1440 * Set the element associated with the operator based on the propagated type o
f the left-hand-side | 1279 * Set the element associated with the operator based on the propagated type o
f the left-hand-side |
1441 * to the given element. | 1280 * to the given element. |
1442 * | 1281 * |
1443 * @param element the element to be associated with the operator | 1282 * @param element the element to be associated with the operator |
1444 */ | 1283 */ |
1445 void set propagatedElement(MethodElement element) { | 1284 void set propagatedElement(MethodElement element) { |
1446 _propagatedElement = element; | 1285 _propagatedElement = element; |
1447 } | 1286 } |
1448 | 1287 |
1449 /** | 1288 /** |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 class BinaryExpression extends Expression { | 1363 class BinaryExpression extends Expression { |
1525 | 1364 |
1526 /** | 1365 /** |
1527 * The expression used to compute the left operand. | 1366 * The expression used to compute the left operand. |
1528 */ | 1367 */ |
1529 Expression _leftOperand; | 1368 Expression _leftOperand; |
1530 | 1369 |
1531 /** | 1370 /** |
1532 * The binary operator being applied. | 1371 * The binary operator being applied. |
1533 */ | 1372 */ |
1534 Token _operator; | 1373 Token operator; |
1535 | 1374 |
1536 /** | 1375 /** |
1537 * The expression used to compute the right operand. | 1376 * The expression used to compute the right operand. |
1538 */ | 1377 */ |
1539 Expression _rightOperand; | 1378 Expression _rightOperand; |
1540 | 1379 |
1541 /** | 1380 /** |
1542 * The element associated with the operator based on the static type of the le
ft operand, or | 1381 * The element associated with the operator based on the static type of the le
ft operand, or |
1543 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, | 1382 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, |
1544 * or if the operator could not be resolved. | 1383 * or if the operator could not be resolved. |
1545 */ | 1384 */ |
1546 MethodElement _staticElement; | 1385 MethodElement _staticElement; |
1547 | 1386 |
1548 /** | 1387 /** |
1549 * The element associated with the operator based on the propagated type of th
e left operand, or | 1388 * The element associated with the operator based on the propagated type of th
e left operand, or |
1550 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, | 1389 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, |
1551 * or if the operator could not be resolved. | 1390 * or if the operator could not be resolved. |
1552 */ | 1391 */ |
1553 MethodElement _propagatedElement; | 1392 MethodElement _propagatedElement; |
1554 | 1393 |
1555 /** | 1394 /** |
1556 * Initialize a newly created binary expression. | 1395 * Initialize a newly created binary expression. |
1557 * | 1396 * |
1558 * @param leftOperand the expression used to compute the left operand | 1397 * @param leftOperand the expression used to compute the left operand |
1559 * @param operator the binary operator being applied | 1398 * @param operator the binary operator being applied |
1560 * @param rightOperand the expression used to compute the right operand | 1399 * @param rightOperand the expression used to compute the right operand |
1561 */ | 1400 */ |
1562 BinaryExpression.full(Expression leftOperand, Token operator, Expression right
Operand) { | 1401 BinaryExpression.full(Expression leftOperand, Token operator, Expression right
Operand) { |
1563 this._leftOperand = becomeParentOf(leftOperand); | 1402 this._leftOperand = becomeParentOf(leftOperand); |
1564 this._operator = operator; | 1403 this.operator = operator; |
1565 this._rightOperand = becomeParentOf(rightOperand); | 1404 this._rightOperand = becomeParentOf(rightOperand); |
1566 } | 1405 } |
1567 | 1406 |
1568 /** | 1407 /** |
1569 * Initialize a newly created binary expression. | 1408 * Initialize a newly created binary expression. |
1570 * | 1409 * |
1571 * @param leftOperand the expression used to compute the left operand | 1410 * @param leftOperand the expression used to compute the left operand |
1572 * @param operator the binary operator being applied | 1411 * @param operator the binary operator being applied |
1573 * @param rightOperand the expression used to compute the right operand | 1412 * @param rightOperand the expression used to compute the right operand |
1574 */ | 1413 */ |
(...skipping 19 matching lines...) Expand all Loading... |
1594 Token get endToken => _rightOperand.endToken; | 1433 Token get endToken => _rightOperand.endToken; |
1595 | 1434 |
1596 /** | 1435 /** |
1597 * Return the expression used to compute the left operand. | 1436 * Return the expression used to compute the left operand. |
1598 * | 1437 * |
1599 * @return the expression used to compute the left operand | 1438 * @return the expression used to compute the left operand |
1600 */ | 1439 */ |
1601 Expression get leftOperand => _leftOperand; | 1440 Expression get leftOperand => _leftOperand; |
1602 | 1441 |
1603 /** | 1442 /** |
1604 * Return the binary operator being applied. | |
1605 * | |
1606 * @return the binary operator being applied | |
1607 */ | |
1608 Token get operator => _operator; | |
1609 | |
1610 /** | |
1611 * Return the element associated with the operator based on the propagated typ
e of the left | 1443 * Return the element associated with the operator based on the propagated typ
e of the left |
1612 * operand, or `null` if the AST structure has not been resolved, if the opera
tor is not | 1444 * operand, or `null` if the AST structure has not been resolved, if the opera
tor is not |
1613 * user definable, or if the operator could not be resolved. One example of th
e latter case is an | 1445 * user definable, or if the operator could not be resolved. One example of th
e latter case is an |
1614 * operator that is not defined for the type of the left-hand operand. | 1446 * operator that is not defined for the type of the left-hand operand. |
1615 * | 1447 * |
1616 * @return the element associated with the operator | 1448 * @return the element associated with the operator |
1617 */ | 1449 */ |
1618 MethodElement get propagatedElement => _propagatedElement; | 1450 MethodElement get propagatedElement => _propagatedElement; |
1619 | 1451 |
1620 /** | 1452 /** |
(...skipping 16 matching lines...) Expand all Loading... |
1637 /** | 1469 /** |
1638 * Set the expression used to compute the left operand to the given expression
. | 1470 * Set the expression used to compute the left operand to the given expression
. |
1639 * | 1471 * |
1640 * @param expression the expression used to compute the left operand | 1472 * @param expression the expression used to compute the left operand |
1641 */ | 1473 */ |
1642 void set leftOperand(Expression expression) { | 1474 void set leftOperand(Expression expression) { |
1643 _leftOperand = becomeParentOf(expression); | 1475 _leftOperand = becomeParentOf(expression); |
1644 } | 1476 } |
1645 | 1477 |
1646 /** | 1478 /** |
1647 * Set the binary operator being applied to the given operator. | |
1648 * | |
1649 * @return the binary operator being applied | |
1650 */ | |
1651 void set operator(Token operator2) { | |
1652 this._operator = operator2; | |
1653 } | |
1654 | |
1655 /** | |
1656 * Set the element associated with the operator based on the propagated type o
f the left operand | 1479 * Set the element associated with the operator based on the propagated type o
f the left operand |
1657 * to the given element. | 1480 * to the given element. |
1658 * | 1481 * |
1659 * @param element the element to be associated with the operator | 1482 * @param element the element to be associated with the operator |
1660 */ | 1483 */ |
1661 void set propagatedElement(MethodElement element) { | 1484 void set propagatedElement(MethodElement element) { |
1662 _propagatedElement = element; | 1485 _propagatedElement = element; |
1663 } | 1486 } |
1664 | 1487 |
1665 /** | 1488 /** |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1735 * '{' statement* '}' | 1558 * '{' statement* '}' |
1736 * </pre> | 1559 * </pre> |
1737 * | 1560 * |
1738 * @coverage dart.engine.ast | 1561 * @coverage dart.engine.ast |
1739 */ | 1562 */ |
1740 class Block extends Statement { | 1563 class Block extends Statement { |
1741 | 1564 |
1742 /** | 1565 /** |
1743 * The left curly bracket. | 1566 * The left curly bracket. |
1744 */ | 1567 */ |
1745 Token _leftBracket; | 1568 Token leftBracket; |
1746 | 1569 |
1747 /** | 1570 /** |
1748 * The statements contained in the block. | 1571 * The statements contained in the block. |
1749 */ | 1572 */ |
1750 NodeList<Statement> _statements; | 1573 NodeList<Statement> statements; |
1751 | 1574 |
1752 /** | 1575 /** |
1753 * The right curly bracket. | 1576 * The right curly bracket. |
1754 */ | 1577 */ |
1755 Token _rightBracket; | 1578 Token rightBracket; |
1756 | 1579 |
1757 /** | 1580 /** |
1758 * Initialize a newly created block of code. | 1581 * Initialize a newly created block of code. |
1759 * | 1582 * |
1760 * @param leftBracket the left curly bracket | 1583 * @param leftBracket the left curly bracket |
1761 * @param statements the statements contained in the block | 1584 * @param statements the statements contained in the block |
1762 * @param rightBracket the right curly bracket | 1585 * @param rightBracket the right curly bracket |
1763 */ | 1586 */ |
1764 Block.full(Token leftBracket, List<Statement> statements, Token rightBracket)
{ | 1587 Block.full(Token leftBracket, List<Statement> statements, Token rightBracket)
{ |
1765 this._statements = new NodeList<Statement>(this); | 1588 this.statements = new NodeList<Statement>(this); |
1766 this._leftBracket = leftBracket; | 1589 this.leftBracket = leftBracket; |
1767 this._statements.addAll(statements); | 1590 this.statements.addAll(statements); |
1768 this._rightBracket = rightBracket; | 1591 this.rightBracket = rightBracket; |
1769 } | 1592 } |
1770 | 1593 |
1771 /** | 1594 /** |
1772 * Initialize a newly created block of code. | 1595 * Initialize a newly created block of code. |
1773 * | 1596 * |
1774 * @param leftBracket the left curly bracket | 1597 * @param leftBracket the left curly bracket |
1775 * @param statements the statements contained in the block | 1598 * @param statements the statements contained in the block |
1776 * @param rightBracket the right curly bracket | 1599 * @param rightBracket the right curly bracket |
1777 */ | 1600 */ |
1778 Block({Token leftBracket, List<Statement> statements, Token rightBracket}) : t
his.full(leftBracket, statements, rightBracket); | 1601 Block({Token leftBracket, List<Statement> statements, Token rightBracket}) : t
his.full(leftBracket, statements, rightBracket); |
1779 accept(ASTVisitor visitor) => visitor.visitBlock(this); | 1602 accept(ASTVisitor visitor) => visitor.visitBlock(this); |
1780 Token get beginToken => _leftBracket; | 1603 Token get beginToken => leftBracket; |
1781 Token get endToken => _rightBracket; | 1604 Token get endToken => rightBracket; |
1782 | |
1783 /** | |
1784 * Return the left curly bracket. | |
1785 * | |
1786 * @return the left curly bracket | |
1787 */ | |
1788 Token get leftBracket => _leftBracket; | |
1789 | |
1790 /** | |
1791 * Return the right curly bracket. | |
1792 * | |
1793 * @return the right curly bracket | |
1794 */ | |
1795 Token get rightBracket => _rightBracket; | |
1796 | |
1797 /** | |
1798 * Return the statements contained in the block. | |
1799 * | |
1800 * @return the statements contained in the block | |
1801 */ | |
1802 NodeList<Statement> get statements => _statements; | |
1803 | |
1804 /** | |
1805 * Set the left curly bracket to the given token. | |
1806 * | |
1807 * @param leftBracket the left curly bracket | |
1808 */ | |
1809 void set leftBracket(Token leftBracket2) { | |
1810 this._leftBracket = leftBracket2; | |
1811 } | |
1812 | |
1813 /** | |
1814 * Set the right curly bracket to the given token. | |
1815 * | |
1816 * @param rightBracket the right curly bracket | |
1817 */ | |
1818 void set rightBracket(Token rightBracket2) { | |
1819 this._rightBracket = rightBracket2; | |
1820 } | |
1821 void visitChildren(ASTVisitor visitor) { | 1605 void visitChildren(ASTVisitor visitor) { |
1822 _statements.accept(visitor); | 1606 statements.accept(visitor); |
1823 } | 1607 } |
1824 } | 1608 } |
1825 /** | 1609 /** |
1826 * Instances of the class `BlockFunctionBody` represent a function body that con
sists of a | 1610 * Instances of the class `BlockFunctionBody` represent a function body that con
sists of a |
1827 * block of statements. | 1611 * block of statements. |
1828 * | 1612 * |
1829 * <pre> | 1613 * <pre> |
1830 * blockFunctionBody ::= | 1614 * blockFunctionBody ::= |
1831 * [Block] | 1615 * [Block] |
1832 * </pre> | 1616 * </pre> |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 * 'false' | 'true' | 1670 * 'false' | 'true' |
1887 * </pre> | 1671 * </pre> |
1888 * | 1672 * |
1889 * @coverage dart.engine.ast | 1673 * @coverage dart.engine.ast |
1890 */ | 1674 */ |
1891 class BooleanLiteral extends Literal { | 1675 class BooleanLiteral extends Literal { |
1892 | 1676 |
1893 /** | 1677 /** |
1894 * The token representing the literal. | 1678 * The token representing the literal. |
1895 */ | 1679 */ |
1896 Token _literal; | 1680 Token literal; |
1897 | 1681 |
1898 /** | 1682 /** |
1899 * The value of the literal. | 1683 * The value of the literal. |
1900 */ | 1684 */ |
1901 bool _value = false; | 1685 bool value = false; |
1902 | 1686 |
1903 /** | 1687 /** |
1904 * Initialize a newly created boolean literal. | 1688 * Initialize a newly created boolean literal. |
1905 * | 1689 * |
1906 * @param literal the token representing the literal | 1690 * @param literal the token representing the literal |
1907 * @param value the value of the literal | 1691 * @param value the value of the literal |
1908 */ | 1692 */ |
1909 BooleanLiteral.full(Token literal, bool value) { | 1693 BooleanLiteral.full(Token literal, bool value) { |
1910 this._literal = literal; | 1694 this.literal = literal; |
1911 this._value = value; | 1695 this.value = value; |
1912 } | 1696 } |
1913 | 1697 |
1914 /** | 1698 /** |
1915 * Initialize a newly created boolean literal. | 1699 * Initialize a newly created boolean literal. |
1916 * | 1700 * |
1917 * @param literal the token representing the literal | 1701 * @param literal the token representing the literal |
1918 * @param value the value of the literal | 1702 * @param value the value of the literal |
1919 */ | 1703 */ |
1920 BooleanLiteral({Token literal, bool value}) : this.full(literal, value); | 1704 BooleanLiteral({Token literal, bool value}) : this.full(literal, value); |
1921 accept(ASTVisitor visitor) => visitor.visitBooleanLiteral(this); | 1705 accept(ASTVisitor visitor) => visitor.visitBooleanLiteral(this); |
1922 Token get beginToken => _literal; | 1706 Token get beginToken => literal; |
1923 Token get endToken => _literal; | 1707 Token get endToken => literal; |
1924 | 1708 bool get isSynthetic => literal.isSynthetic; |
1925 /** | |
1926 * Return the token representing the literal. | |
1927 * | |
1928 * @return the token representing the literal | |
1929 */ | |
1930 Token get literal => _literal; | |
1931 | |
1932 /** | |
1933 * Return the value of the literal. | |
1934 * | |
1935 * @return the value of the literal | |
1936 */ | |
1937 bool get value => _value; | |
1938 bool get isSynthetic => _literal.isSynthetic; | |
1939 | |
1940 /** | |
1941 * Set the token representing the literal to the given token. | |
1942 * | |
1943 * @param literal the token representing the literal | |
1944 */ | |
1945 void set literal(Token literal2) { | |
1946 this._literal = literal2; | |
1947 } | |
1948 | |
1949 /** | |
1950 * Set the value of the literal to the given value. | |
1951 * | |
1952 * @param value the value of the literal | |
1953 */ | |
1954 void set value(bool value2) { | |
1955 this._value = value2; | |
1956 } | |
1957 void visitChildren(ASTVisitor visitor) { | 1709 void visitChildren(ASTVisitor visitor) { |
1958 } | 1710 } |
1959 } | 1711 } |
1960 /** | 1712 /** |
1961 * Instances of the class `BreakStatement` represent a break statement. | 1713 * Instances of the class `BreakStatement` represent a break statement. |
1962 * | 1714 * |
1963 * <pre> | 1715 * <pre> |
1964 * breakStatement ::= | 1716 * breakStatement ::= |
1965 * 'break' [SimpleIdentifier]? ';' | 1717 * 'break' [SimpleIdentifier]? ';' |
1966 * </pre> | 1718 * </pre> |
1967 * | 1719 * |
1968 * @coverage dart.engine.ast | 1720 * @coverage dart.engine.ast |
1969 */ | 1721 */ |
1970 class BreakStatement extends Statement { | 1722 class BreakStatement extends Statement { |
1971 | 1723 |
1972 /** | 1724 /** |
1973 * The token representing the 'break' keyword. | 1725 * The token representing the 'break' keyword. |
1974 */ | 1726 */ |
1975 Token _keyword; | 1727 Token keyword; |
1976 | 1728 |
1977 /** | 1729 /** |
1978 * The label associated with the statement, or `null` if there is no label. | 1730 * The label associated with the statement, or `null` if there is no label. |
1979 */ | 1731 */ |
1980 SimpleIdentifier _label; | 1732 SimpleIdentifier _label; |
1981 | 1733 |
1982 /** | 1734 /** |
1983 * The semicolon terminating the statement. | 1735 * The semicolon terminating the statement. |
1984 */ | 1736 */ |
1985 Token _semicolon; | 1737 Token semicolon; |
1986 | 1738 |
1987 /** | 1739 /** |
1988 * Initialize a newly created break statement. | 1740 * Initialize a newly created break statement. |
1989 * | 1741 * |
1990 * @param keyword the token representing the 'break' keyword | 1742 * @param keyword the token representing the 'break' keyword |
1991 * @param label the label associated with the statement | 1743 * @param label the label associated with the statement |
1992 * @param semicolon the semicolon terminating the statement | 1744 * @param semicolon the semicolon terminating the statement |
1993 */ | 1745 */ |
1994 BreakStatement.full(Token keyword, SimpleIdentifier label, Token semicolon) { | 1746 BreakStatement.full(Token keyword, SimpleIdentifier label, Token semicolon) { |
1995 this._keyword = keyword; | 1747 this.keyword = keyword; |
1996 this._label = becomeParentOf(label); | 1748 this._label = becomeParentOf(label); |
1997 this._semicolon = semicolon; | 1749 this.semicolon = semicolon; |
1998 } | 1750 } |
1999 | 1751 |
2000 /** | 1752 /** |
2001 * Initialize a newly created break statement. | 1753 * Initialize a newly created break statement. |
2002 * | 1754 * |
2003 * @param keyword the token representing the 'break' keyword | 1755 * @param keyword the token representing the 'break' keyword |
2004 * @param label the label associated with the statement | 1756 * @param label the label associated with the statement |
2005 * @param semicolon the semicolon terminating the statement | 1757 * @param semicolon the semicolon terminating the statement |
2006 */ | 1758 */ |
2007 BreakStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : thi
s.full(keyword, label, semicolon); | 1759 BreakStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : thi
s.full(keyword, label, semicolon); |
2008 accept(ASTVisitor visitor) => visitor.visitBreakStatement(this); | 1760 accept(ASTVisitor visitor) => visitor.visitBreakStatement(this); |
2009 Token get beginToken => _keyword; | 1761 Token get beginToken => keyword; |
2010 Token get endToken => _semicolon; | 1762 Token get endToken => semicolon; |
2011 | |
2012 /** | |
2013 * Return the token representing the 'break' keyword. | |
2014 * | |
2015 * @return the token representing the 'break' keyword | |
2016 */ | |
2017 Token get keyword => _keyword; | |
2018 | 1763 |
2019 /** | 1764 /** |
2020 * Return the label associated with the statement, or `null` if there is no la
bel. | 1765 * Return the label associated with the statement, or `null` if there is no la
bel. |
2021 * | 1766 * |
2022 * @return the label associated with the statement | 1767 * @return the label associated with the statement |
2023 */ | 1768 */ |
2024 SimpleIdentifier get label => _label; | 1769 SimpleIdentifier get label => _label; |
2025 | 1770 |
2026 /** | 1771 /** |
2027 * Return the semicolon terminating the statement. | |
2028 * | |
2029 * @return the semicolon terminating the statement | |
2030 */ | |
2031 Token get semicolon => _semicolon; | |
2032 | |
2033 /** | |
2034 * Set the token representing the 'break' keyword to the given token. | |
2035 * | |
2036 * @param keyword the token representing the 'break' keyword | |
2037 */ | |
2038 void set keyword(Token keyword2) { | |
2039 this._keyword = keyword2; | |
2040 } | |
2041 | |
2042 /** | |
2043 * Set the label associated with the statement to the given identifier. | 1772 * Set the label associated with the statement to the given identifier. |
2044 * | 1773 * |
2045 * @param identifier the label associated with the statement | 1774 * @param identifier the label associated with the statement |
2046 */ | 1775 */ |
2047 void set label(SimpleIdentifier identifier) { | 1776 void set label(SimpleIdentifier identifier) { |
2048 _label = becomeParentOf(identifier); | 1777 _label = becomeParentOf(identifier); |
2049 } | 1778 } |
2050 | |
2051 /** | |
2052 * Set the semicolon terminating the statement to the given token. | |
2053 * | |
2054 * @param semicolon the semicolon terminating the statement | |
2055 */ | |
2056 void set semicolon(Token semicolon2) { | |
2057 this._semicolon = semicolon2; | |
2058 } | |
2059 void visitChildren(ASTVisitor visitor) { | 1779 void visitChildren(ASTVisitor visitor) { |
2060 safelyVisitChild(_label, visitor); | 1780 safelyVisitChild(_label, visitor); |
2061 } | 1781 } |
2062 } | 1782 } |
2063 /** | 1783 /** |
2064 * Instances of the class `CascadeExpression` represent a sequence of cascaded e
xpressions: | 1784 * Instances of the class `CascadeExpression` represent a sequence of cascaded e
xpressions: |
2065 * expressions that share a common target. There are three kinds of expressions
that can be used in | 1785 * expressions that share a common target. There are three kinds of expressions
that can be used in |
2066 * a cascade expression: [IndexExpression], [MethodInvocation] and | 1786 * a cascade expression: [IndexExpression], [MethodInvocation] and |
2067 * [PropertyAccess]. | 1787 * [PropertyAccess]. |
2068 * | 1788 * |
(...skipping 14 matching lines...) Expand all Loading... |
2083 class CascadeExpression extends Expression { | 1803 class CascadeExpression extends Expression { |
2084 | 1804 |
2085 /** | 1805 /** |
2086 * The target of the cascade sections. | 1806 * The target of the cascade sections. |
2087 */ | 1807 */ |
2088 Expression _target; | 1808 Expression _target; |
2089 | 1809 |
2090 /** | 1810 /** |
2091 * The cascade sections sharing the common target. | 1811 * The cascade sections sharing the common target. |
2092 */ | 1812 */ |
2093 NodeList<Expression> _cascadeSections; | 1813 NodeList<Expression> cascadeSections; |
2094 | 1814 |
2095 /** | 1815 /** |
2096 * Initialize a newly created cascade expression. | 1816 * Initialize a newly created cascade expression. |
2097 * | 1817 * |
2098 * @param target the target of the cascade sections | 1818 * @param target the target of the cascade sections |
2099 * @param cascadeSections the cascade sections sharing the common target | 1819 * @param cascadeSections the cascade sections sharing the common target |
2100 */ | 1820 */ |
2101 CascadeExpression.full(Expression target, List<Expression> cascadeSections) { | 1821 CascadeExpression.full(Expression target, List<Expression> cascadeSections) { |
2102 this._cascadeSections = new NodeList<Expression>(this); | 1822 this.cascadeSections = new NodeList<Expression>(this); |
2103 this._target = becomeParentOf(target); | 1823 this._target = becomeParentOf(target); |
2104 this._cascadeSections.addAll(cascadeSections); | 1824 this.cascadeSections.addAll(cascadeSections); |
2105 } | 1825 } |
2106 | 1826 |
2107 /** | 1827 /** |
2108 * Initialize a newly created cascade expression. | 1828 * Initialize a newly created cascade expression. |
2109 * | 1829 * |
2110 * @param target the target of the cascade sections | 1830 * @param target the target of the cascade sections |
2111 * @param cascadeSections the cascade sections sharing the common target | 1831 * @param cascadeSections the cascade sections sharing the common target |
2112 */ | 1832 */ |
2113 CascadeExpression({Expression target, List<Expression> cascadeSections}) : thi
s.full(target, cascadeSections); | 1833 CascadeExpression({Expression target, List<Expression> cascadeSections}) : thi
s.full(target, cascadeSections); |
2114 accept(ASTVisitor visitor) => visitor.visitCascadeExpression(this); | 1834 accept(ASTVisitor visitor) => visitor.visitCascadeExpression(this); |
2115 Token get beginToken => _target.beginToken; | 1835 Token get beginToken => _target.beginToken; |
2116 | 1836 Token get endToken => cascadeSections.endToken; |
2117 /** | |
2118 * Return the cascade sections sharing the common target. | |
2119 * | |
2120 * @return the cascade sections sharing the common target | |
2121 */ | |
2122 NodeList<Expression> get cascadeSections => _cascadeSections; | |
2123 Token get endToken => _cascadeSections.endToken; | |
2124 | 1837 |
2125 /** | 1838 /** |
2126 * Return the target of the cascade sections. | 1839 * Return the target of the cascade sections. |
2127 * | 1840 * |
2128 * @return the target of the cascade sections | 1841 * @return the target of the cascade sections |
2129 */ | 1842 */ |
2130 Expression get target => _target; | 1843 Expression get target => _target; |
2131 | 1844 |
2132 /** | 1845 /** |
2133 * Set the target of the cascade sections to the given expression. | 1846 * Set the target of the cascade sections to the given expression. |
2134 * | 1847 * |
2135 * @param target the target of the cascade sections | 1848 * @param target the target of the cascade sections |
2136 */ | 1849 */ |
2137 void set target(Expression target2) { | 1850 void set target(Expression target2) { |
2138 this._target = becomeParentOf(target2); | 1851 this._target = becomeParentOf(target2); |
2139 } | 1852 } |
2140 void visitChildren(ASTVisitor visitor) { | 1853 void visitChildren(ASTVisitor visitor) { |
2141 safelyVisitChild(_target, visitor); | 1854 safelyVisitChild(_target, visitor); |
2142 _cascadeSections.accept(visitor); | 1855 cascadeSections.accept(visitor); |
2143 } | 1856 } |
2144 } | 1857 } |
2145 /** | 1858 /** |
2146 * Instances of the class `CatchClause` represent a catch clause within a try st
atement. | 1859 * Instances of the class `CatchClause` represent a catch clause within a try st
atement. |
2147 * | 1860 * |
2148 * <pre> | 1861 * <pre> |
2149 * onPart ::= | 1862 * onPart ::= |
2150 * catchPart [Block] | 1863 * catchPart [Block] |
2151 * | 'on' type catchPart? [Block] | 1864 * | 'on' type catchPart? [Block] |
2152 * | 1865 * |
2153 * catchPart ::= | 1866 * catchPart ::= |
2154 * 'catch' '(' [SimpleIdentifier] (',' [SimpleIdentifier])? ')' | 1867 * 'catch' '(' [SimpleIdentifier] (',' [SimpleIdentifier])? ')' |
2155 * </pre> | 1868 * </pre> |
2156 * | 1869 * |
2157 * @coverage dart.engine.ast | 1870 * @coverage dart.engine.ast |
2158 */ | 1871 */ |
2159 class CatchClause extends ASTNode { | 1872 class CatchClause extends ASTNode { |
2160 | 1873 |
2161 /** | 1874 /** |
2162 * The token representing the 'on' keyword, or `null` if there is no 'on' keyw
ord. | 1875 * The token representing the 'on' keyword, or `null` if there is no 'on' keyw
ord. |
2163 */ | 1876 */ |
2164 Token _onKeyword; | 1877 Token onKeyword; |
2165 | 1878 |
2166 /** | 1879 /** |
2167 * The type of exceptions caught by this catch clause, or `null` if this catch
clause | 1880 * The type of exceptions caught by this catch clause, or `null` if this catch
clause |
2168 * catches every type of exception. | 1881 * catches every type of exception. |
2169 */ | 1882 */ |
2170 TypeName _exceptionType; | 1883 TypeName exceptionType; |
2171 | 1884 |
2172 /** | 1885 /** |
2173 * The token representing the 'catch' keyword, or `null` if there is no 'catch
' keyword. | 1886 * The token representing the 'catch' keyword, or `null` if there is no 'catch
' keyword. |
2174 */ | 1887 */ |
2175 Token _catchKeyword; | 1888 Token catchKeyword; |
2176 | 1889 |
2177 /** | 1890 /** |
2178 * The left parenthesis. | 1891 * The left parenthesis. |
2179 */ | 1892 */ |
2180 Token _leftParenthesis; | 1893 Token _leftParenthesis; |
2181 | 1894 |
2182 /** | 1895 /** |
2183 * The parameter whose value will be the exception that was thrown. | 1896 * The parameter whose value will be the exception that was thrown. |
2184 */ | 1897 */ |
2185 SimpleIdentifier _exceptionParameter; | 1898 SimpleIdentifier _exceptionParameter; |
2186 | 1899 |
2187 /** | 1900 /** |
2188 * The comma separating the exception parameter from the stack trace parameter
, or `null` if | 1901 * The comma separating the exception parameter from the stack trace parameter
, or `null` if |
2189 * there is no stack trace parameter. | 1902 * there is no stack trace parameter. |
2190 */ | 1903 */ |
2191 Token _comma; | 1904 Token comma; |
2192 | 1905 |
2193 /** | 1906 /** |
2194 * The parameter whose value will be the stack trace associated with the excep
tion, or | 1907 * The parameter whose value will be the stack trace associated with the excep
tion, or |
2195 * `null` if there is no stack trace parameter. | 1908 * `null` if there is no stack trace parameter. |
2196 */ | 1909 */ |
2197 SimpleIdentifier _stackTraceParameter; | 1910 SimpleIdentifier _stackTraceParameter; |
2198 | 1911 |
2199 /** | 1912 /** |
2200 * The right parenthesis. | 1913 * The right parenthesis. |
2201 */ | 1914 */ |
(...skipping 11 matching lines...) Expand all Loading... |
2213 * @param exceptionType the type of exceptions caught by this catch clause | 1926 * @param exceptionType the type of exceptions caught by this catch clause |
2214 * @param leftParenthesis the left parenthesis | 1927 * @param leftParenthesis the left parenthesis |
2215 * @param exceptionParameter the parameter whose value will be the exception t
hat was thrown | 1928 * @param exceptionParameter the parameter whose value will be the exception t
hat was thrown |
2216 * @param comma the comma separating the exception parameter from the stack tr
ace parameter | 1929 * @param comma the comma separating the exception parameter from the stack tr
ace parameter |
2217 * @param stackTraceParameter the parameter whose value will be the stack trac
e associated with | 1930 * @param stackTraceParameter the parameter whose value will be the stack trac
e associated with |
2218 * the exception | 1931 * the exception |
2219 * @param rightParenthesis the right parenthesis | 1932 * @param rightParenthesis the right parenthesis |
2220 * @param body the body of the catch block | 1933 * @param body the body of the catch block |
2221 */ | 1934 */ |
2222 CatchClause.full(Token onKeyword, TypeName exceptionType, Token catchKeyword,
Token leftParenthesis, SimpleIdentifier exceptionParameter, Token comma, SimpleI
dentifier stackTraceParameter, Token rightParenthesis, Block body) { | 1935 CatchClause.full(Token onKeyword, TypeName exceptionType, Token catchKeyword,
Token leftParenthesis, SimpleIdentifier exceptionParameter, Token comma, SimpleI
dentifier stackTraceParameter, Token rightParenthesis, Block body) { |
2223 this._onKeyword = onKeyword; | 1936 this.onKeyword = onKeyword; |
2224 this._exceptionType = becomeParentOf(exceptionType); | 1937 this.exceptionType = becomeParentOf(exceptionType); |
2225 this._catchKeyword = catchKeyword; | 1938 this.catchKeyword = catchKeyword; |
2226 this._leftParenthesis = leftParenthesis; | 1939 this._leftParenthesis = leftParenthesis; |
2227 this._exceptionParameter = becomeParentOf(exceptionParameter); | 1940 this._exceptionParameter = becomeParentOf(exceptionParameter); |
2228 this._comma = comma; | 1941 this.comma = comma; |
2229 this._stackTraceParameter = becomeParentOf(stackTraceParameter); | 1942 this._stackTraceParameter = becomeParentOf(stackTraceParameter); |
2230 this._rightParenthesis = rightParenthesis; | 1943 this._rightParenthesis = rightParenthesis; |
2231 this._body = becomeParentOf(body); | 1944 this._body = becomeParentOf(body); |
2232 } | 1945 } |
2233 | 1946 |
2234 /** | 1947 /** |
2235 * Initialize a newly created catch clause. | 1948 * Initialize a newly created catch clause. |
2236 * | 1949 * |
2237 * @param onKeyword the token representing the 'on' keyword | 1950 * @param onKeyword the token representing the 'on' keyword |
2238 * @param exceptionType the type of exceptions caught by this catch clause | 1951 * @param exceptionType the type of exceptions caught by this catch clause |
2239 * @param leftParenthesis the left parenthesis | 1952 * @param leftParenthesis the left parenthesis |
2240 * @param exceptionParameter the parameter whose value will be the exception t
hat was thrown | 1953 * @param exceptionParameter the parameter whose value will be the exception t
hat was thrown |
2241 * @param comma the comma separating the exception parameter from the stack tr
ace parameter | 1954 * @param comma the comma separating the exception parameter from the stack tr
ace parameter |
2242 * @param stackTraceParameter the parameter whose value will be the stack trac
e associated with | 1955 * @param stackTraceParameter the parameter whose value will be the stack trac
e associated with |
2243 * the exception | 1956 * the exception |
2244 * @param rightParenthesis the right parenthesis | 1957 * @param rightParenthesis the right parenthesis |
2245 * @param body the body of the catch block | 1958 * @param body the body of the catch block |
2246 */ | 1959 */ |
2247 CatchClause({Token onKeyword, TypeName exceptionType, Token catchKeyword, Toke
n leftParenthesis, SimpleIdentifier exceptionParameter, Token comma, SimpleIdent
ifier stackTraceParameter, Token rightParenthesis, Block body}) : this.full(onKe
yword, exceptionType, catchKeyword, leftParenthesis, exceptionParameter, comma,
stackTraceParameter, rightParenthesis, body); | 1960 CatchClause({Token onKeyword, TypeName exceptionType, Token catchKeyword, Toke
n leftParenthesis, SimpleIdentifier exceptionParameter, Token comma, SimpleIdent
ifier stackTraceParameter, Token rightParenthesis, Block body}) : this.full(onKe
yword, exceptionType, catchKeyword, leftParenthesis, exceptionParameter, comma,
stackTraceParameter, rightParenthesis, body); |
2248 accept(ASTVisitor visitor) => visitor.visitCatchClause(this); | 1961 accept(ASTVisitor visitor) => visitor.visitCatchClause(this); |
2249 Token get beginToken { | 1962 Token get beginToken { |
2250 if (_onKeyword != null) { | 1963 if (onKeyword != null) { |
2251 return _onKeyword; | 1964 return onKeyword; |
2252 } | 1965 } |
2253 return _catchKeyword; | 1966 return catchKeyword; |
2254 } | 1967 } |
2255 | 1968 |
2256 /** | 1969 /** |
2257 * Return the body of the catch block. | 1970 * Return the body of the catch block. |
2258 * | 1971 * |
2259 * @return the body of the catch block | 1972 * @return the body of the catch block |
2260 */ | 1973 */ |
2261 Block get body => _body; | 1974 Block get body => _body; |
2262 | |
2263 /** | |
2264 * Return the token representing the 'catch' keyword, or `null` if there is no
'catch' | |
2265 * keyword. | |
2266 * | |
2267 * @return the token representing the 'catch' keyword | |
2268 */ | |
2269 Token get catchKeyword => _catchKeyword; | |
2270 | |
2271 /** | |
2272 * Return the comma, or `null` if there is no stack trace parameter. | |
2273 * | |
2274 * @return the comma | |
2275 */ | |
2276 Token get comma => _comma; | |
2277 Token get endToken => _body.endToken; | 1975 Token get endToken => _body.endToken; |
2278 | 1976 |
2279 /** | 1977 /** |
2280 * Return the parameter whose value will be the exception that was thrown. | 1978 * Return the parameter whose value will be the exception that was thrown. |
2281 * | 1979 * |
2282 * @return the parameter whose value will be the exception that was thrown | 1980 * @return the parameter whose value will be the exception that was thrown |
2283 */ | 1981 */ |
2284 SimpleIdentifier get exceptionParameter => _exceptionParameter; | 1982 SimpleIdentifier get exceptionParameter => _exceptionParameter; |
2285 | 1983 |
2286 /** | 1984 /** |
2287 * Return the type of exceptions caught by this catch clause, or `null` if thi
s catch clause | |
2288 * catches every type of exception. | |
2289 * | |
2290 * @return the type of exceptions caught by this catch clause | |
2291 */ | |
2292 TypeName get exceptionType => _exceptionType; | |
2293 | |
2294 /** | |
2295 * Return the left parenthesis. | 1985 * Return the left parenthesis. |
2296 * | 1986 * |
2297 * @return the left parenthesis | 1987 * @return the left parenthesis |
2298 */ | 1988 */ |
2299 Token get leftParenthesis => _leftParenthesis; | 1989 Token get leftParenthesis => _leftParenthesis; |
2300 | 1990 |
2301 /** | 1991 /** |
2302 * Return the token representing the 'on' keyword, or `null` if there is no 'o
n' keyword. | |
2303 * | |
2304 * @return the token representing the 'on' keyword | |
2305 */ | |
2306 Token get onKeyword => _onKeyword; | |
2307 | |
2308 /** | |
2309 * Return the right parenthesis. | 1992 * Return the right parenthesis. |
2310 * | 1993 * |
2311 * @return the right parenthesis | 1994 * @return the right parenthesis |
2312 */ | 1995 */ |
2313 Token get rightParenthesis => _rightParenthesis; | 1996 Token get rightParenthesis => _rightParenthesis; |
2314 | 1997 |
2315 /** | 1998 /** |
2316 * Return the parameter whose value will be the stack trace associated with th
e exception, or | 1999 * Return the parameter whose value will be the stack trace associated with th
e exception, or |
2317 * `null` if there is no stack trace parameter. | 2000 * `null` if there is no stack trace parameter. |
2318 * | 2001 * |
2319 * @return the parameter whose value will be the stack trace associated with t
he exception | 2002 * @return the parameter whose value will be the stack trace associated with t
he exception |
2320 */ | 2003 */ |
2321 SimpleIdentifier get stackTraceParameter => _stackTraceParameter; | 2004 SimpleIdentifier get stackTraceParameter => _stackTraceParameter; |
2322 | 2005 |
2323 /** | 2006 /** |
2324 * Set the body of the catch block to the given block. | 2007 * Set the body of the catch block to the given block. |
2325 * | 2008 * |
2326 * @param block the body of the catch block | 2009 * @param block the body of the catch block |
2327 */ | 2010 */ |
2328 void set body(Block block) { | 2011 void set body(Block block) { |
2329 _body = becomeParentOf(block); | 2012 _body = becomeParentOf(block); |
2330 } | 2013 } |
2331 | 2014 |
2332 /** | 2015 /** |
2333 * Set the token representing the 'catch' keyword to the given token. | |
2334 * | |
2335 * @param catchKeyword the token representing the 'catch' keyword | |
2336 */ | |
2337 void set catchKeyword(Token catchKeyword2) { | |
2338 this._catchKeyword = catchKeyword2; | |
2339 } | |
2340 | |
2341 /** | |
2342 * Set the comma to the given token. | |
2343 * | |
2344 * @param comma the comma | |
2345 */ | |
2346 void set comma(Token comma2) { | |
2347 this._comma = comma2; | |
2348 } | |
2349 | |
2350 /** | |
2351 * Set the parameter whose value will be the exception that was thrown to the
given parameter. | 2016 * Set the parameter whose value will be the exception that was thrown to the
given parameter. |
2352 * | 2017 * |
2353 * @param parameter the parameter whose value will be the exception that was t
hrown | 2018 * @param parameter the parameter whose value will be the exception that was t
hrown |
2354 */ | 2019 */ |
2355 void set exceptionParameter(SimpleIdentifier parameter) { | 2020 void set exceptionParameter(SimpleIdentifier parameter) { |
2356 _exceptionParameter = becomeParentOf(parameter); | 2021 _exceptionParameter = becomeParentOf(parameter); |
2357 } | 2022 } |
2358 | 2023 |
2359 /** | 2024 /** |
2360 * Set the type of exceptions caught by this catch clause to the given type. | |
2361 * | |
2362 * @param exceptionType the type of exceptions caught by this catch clause | |
2363 */ | |
2364 void set exceptionType(TypeName exceptionType2) { | |
2365 this._exceptionType = exceptionType2; | |
2366 } | |
2367 | |
2368 /** | |
2369 * Set the left parenthesis to the given token. | 2025 * Set the left parenthesis to the given token. |
2370 * | 2026 * |
2371 * @param parenthesis the left parenthesis | 2027 * @param parenthesis the left parenthesis |
2372 */ | 2028 */ |
2373 void set leftParenthesis(Token parenthesis) { | 2029 void set leftParenthesis(Token parenthesis) { |
2374 _leftParenthesis = parenthesis; | 2030 _leftParenthesis = parenthesis; |
2375 } | 2031 } |
2376 | 2032 |
2377 /** | 2033 /** |
2378 * Set the token representing the 'on' keyword to the given keyword. | |
2379 * | |
2380 * @param onKeyword the token representing the 'on' keyword | |
2381 */ | |
2382 void set onKeyword(Token onKeyword2) { | |
2383 this._onKeyword = onKeyword2; | |
2384 } | |
2385 | |
2386 /** | |
2387 * Set the right parenthesis to the given token. | 2034 * Set the right parenthesis to the given token. |
2388 * | 2035 * |
2389 * @param parenthesis the right parenthesis | 2036 * @param parenthesis the right parenthesis |
2390 */ | 2037 */ |
2391 void set rightParenthesis(Token parenthesis) { | 2038 void set rightParenthesis(Token parenthesis) { |
2392 _rightParenthesis = parenthesis; | 2039 _rightParenthesis = parenthesis; |
2393 } | 2040 } |
2394 | 2041 |
2395 /** | 2042 /** |
2396 * Set the parameter whose value will be the stack trace associated with the e
xception to the | 2043 * Set the parameter whose value will be the stack trace associated with the e
xception to the |
2397 * given parameter. | 2044 * given parameter. |
2398 * | 2045 * |
2399 * @param parameter the parameter whose value will be the stack trace associat
ed with the | 2046 * @param parameter the parameter whose value will be the stack trace associat
ed with the |
2400 * exception | 2047 * exception |
2401 */ | 2048 */ |
2402 void set stackTraceParameter(SimpleIdentifier parameter) { | 2049 void set stackTraceParameter(SimpleIdentifier parameter) { |
2403 _stackTraceParameter = becomeParentOf(parameter); | 2050 _stackTraceParameter = becomeParentOf(parameter); |
2404 } | 2051 } |
2405 void visitChildren(ASTVisitor visitor) { | 2052 void visitChildren(ASTVisitor visitor) { |
2406 safelyVisitChild(_exceptionType, visitor); | 2053 safelyVisitChild(exceptionType, visitor); |
2407 safelyVisitChild(_exceptionParameter, visitor); | 2054 safelyVisitChild(_exceptionParameter, visitor); |
2408 safelyVisitChild(_stackTraceParameter, visitor); | 2055 safelyVisitChild(_stackTraceParameter, visitor); |
2409 safelyVisitChild(_body, visitor); | 2056 safelyVisitChild(_body, visitor); |
2410 } | 2057 } |
2411 } | 2058 } |
2412 /** | 2059 /** |
2413 * Instances of the class `ClassDeclaration` represent the declaration of a clas
s. | 2060 * Instances of the class `ClassDeclaration` represent the declaration of a clas
s. |
2414 * | 2061 * |
2415 * <pre> | 2062 * <pre> |
2416 * classDeclaration ::= | 2063 * classDeclaration ::= |
2417 * 'abstract'? 'class' [SimpleIdentifier] [TypeParameterList]? | 2064 * 'abstract'? 'class' [SimpleIdentifier] [TypeParameterList]? |
2418 * ([ExtendsClause] [WithClause]?)? | 2065 * ([ExtendsClause] [WithClause]?)? |
2419 * [ImplementsClause]? | 2066 * [ImplementsClause]? |
2420 * '{' [ClassMember]* '}' | 2067 * '{' [ClassMember]* '}' |
2421 * </pre> | 2068 * </pre> |
2422 * | 2069 * |
2423 * @coverage dart.engine.ast | 2070 * @coverage dart.engine.ast |
2424 */ | 2071 */ |
2425 class ClassDeclaration extends CompilationUnitMember { | 2072 class ClassDeclaration extends CompilationUnitMember { |
2426 | 2073 |
2427 /** | 2074 /** |
2428 * The 'abstract' keyword, or `null` if the keyword was absent. | 2075 * The 'abstract' keyword, or `null` if the keyword was absent. |
2429 */ | 2076 */ |
2430 Token _abstractKeyword; | 2077 Token abstractKeyword; |
2431 | 2078 |
2432 /** | 2079 /** |
2433 * The token representing the 'class' keyword. | 2080 * The token representing the 'class' keyword. |
2434 */ | 2081 */ |
2435 Token _classKeyword; | 2082 Token classKeyword; |
2436 | 2083 |
2437 /** | 2084 /** |
2438 * The name of the class being declared. | 2085 * The name of the class being declared. |
2439 */ | 2086 */ |
2440 SimpleIdentifier _name; | 2087 SimpleIdentifier _name; |
2441 | 2088 |
2442 /** | 2089 /** |
2443 * The type parameters for the class, or `null` if the class does not have any
type | 2090 * The type parameters for the class, or `null` if the class does not have any
type |
2444 * parameters. | 2091 * parameters. |
2445 */ | 2092 */ |
2446 TypeParameterList _typeParameters; | 2093 TypeParameterList typeParameters; |
2447 | 2094 |
2448 /** | 2095 /** |
2449 * The extends clause for the class, or `null` if the class does not extend an
y other class. | 2096 * The extends clause for the class, or `null` if the class does not extend an
y other class. |
2450 */ | 2097 */ |
2451 ExtendsClause _extendsClause; | 2098 ExtendsClause _extendsClause; |
2452 | 2099 |
2453 /** | 2100 /** |
2454 * The with clause for the class, or `null` if the class does not have a with
clause. | 2101 * The with clause for the class, or `null` if the class does not have a with
clause. |
2455 */ | 2102 */ |
2456 WithClause _withClause; | 2103 WithClause _withClause; |
2457 | 2104 |
2458 /** | 2105 /** |
2459 * The implements clause for the class, or `null` if the class does not implem
ent any | 2106 * The implements clause for the class, or `null` if the class does not implem
ent any |
2460 * interfaces. | 2107 * interfaces. |
2461 */ | 2108 */ |
2462 ImplementsClause _implementsClause; | 2109 ImplementsClause _implementsClause; |
2463 | 2110 |
2464 /** | 2111 /** |
2465 * The native clause for the class, or `null` if the class does not have a nat
ive clause. | 2112 * The native clause for the class, or `null` if the class does not have a nat
ive clause. |
2466 */ | 2113 */ |
2467 NativeClause _nativeClause; | 2114 NativeClause nativeClause; |
2468 | 2115 |
2469 /** | 2116 /** |
2470 * The left curly bracket. | 2117 * The left curly bracket. |
2471 */ | 2118 */ |
2472 Token _leftBracket; | 2119 Token leftBracket; |
2473 | 2120 |
2474 /** | 2121 /** |
2475 * The members defined by the class. | 2122 * The members defined by the class. |
2476 */ | 2123 */ |
2477 NodeList<ClassMember> _members; | 2124 NodeList<ClassMember> members; |
2478 | 2125 |
2479 /** | 2126 /** |
2480 * The right curly bracket. | 2127 * The right curly bracket. |
2481 */ | 2128 */ |
2482 Token _rightBracket; | 2129 Token rightBracket; |
2483 | 2130 |
2484 /** | 2131 /** |
2485 * Initialize a newly created class declaration. | 2132 * Initialize a newly created class declaration. |
2486 * | 2133 * |
2487 * @param comment the documentation comment associated with this class | 2134 * @param comment the documentation comment associated with this class |
2488 * @param metadata the annotations associated with this class | 2135 * @param metadata the annotations associated with this class |
2489 * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was
absent | 2136 * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was
absent |
2490 * @param classKeyword the token representing the 'class' keyword | 2137 * @param classKeyword the token representing the 'class' keyword |
2491 * @param name the name of the class being declared | 2138 * @param name the name of the class being declared |
2492 * @param typeParameters the type parameters for the class | 2139 * @param typeParameters the type parameters for the class |
2493 * @param extendsClause the extends clause for the class | 2140 * @param extendsClause the extends clause for the class |
2494 * @param withClause the with clause for the class | 2141 * @param withClause the with clause for the class |
2495 * @param implementsClause the implements clause for the class | 2142 * @param implementsClause the implements clause for the class |
2496 * @param leftBracket the left curly bracket | 2143 * @param leftBracket the left curly bracket |
2497 * @param members the members defined by the class | 2144 * @param members the members defined by the class |
2498 * @param rightBracket the right curly bracket | 2145 * @param rightBracket the right curly bracket |
2499 */ | 2146 */ |
2500 ClassDeclaration.full(Comment comment, List<Annotation> metadata, Token abstra
ctKeyword, Token classKeyword, SimpleIdentifier name, TypeParameterList typePara
meters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause imp
lementsClause, Token leftBracket, List<ClassMember> members, Token rightBracket)
: super.full(comment, metadata) { | 2147 ClassDeclaration.full(Comment comment, List<Annotation> metadata, Token abstra
ctKeyword, Token classKeyword, SimpleIdentifier name, TypeParameterList typePara
meters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause imp
lementsClause, Token leftBracket, List<ClassMember> members, Token rightBracket)
: super.full(comment, metadata) { |
2501 this._members = new NodeList<ClassMember>(this); | 2148 this.members = new NodeList<ClassMember>(this); |
2502 this._abstractKeyword = abstractKeyword; | 2149 this.abstractKeyword = abstractKeyword; |
2503 this._classKeyword = classKeyword; | 2150 this.classKeyword = classKeyword; |
2504 this._name = becomeParentOf(name); | 2151 this._name = becomeParentOf(name); |
2505 this._typeParameters = becomeParentOf(typeParameters); | 2152 this.typeParameters = becomeParentOf(typeParameters); |
2506 this._extendsClause = becomeParentOf(extendsClause); | 2153 this._extendsClause = becomeParentOf(extendsClause); |
2507 this._withClause = becomeParentOf(withClause); | 2154 this._withClause = becomeParentOf(withClause); |
2508 this._implementsClause = becomeParentOf(implementsClause); | 2155 this._implementsClause = becomeParentOf(implementsClause); |
2509 this._leftBracket = leftBracket; | 2156 this.leftBracket = leftBracket; |
2510 this._members.addAll(members); | 2157 this.members.addAll(members); |
2511 this._rightBracket = rightBracket; | 2158 this.rightBracket = rightBracket; |
2512 } | 2159 } |
2513 | 2160 |
2514 /** | 2161 /** |
2515 * Initialize a newly created class declaration. | 2162 * Initialize a newly created class declaration. |
2516 * | 2163 * |
2517 * @param comment the documentation comment associated with this class | 2164 * @param comment the documentation comment associated with this class |
2518 * @param metadata the annotations associated with this class | 2165 * @param metadata the annotations associated with this class |
2519 * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was
absent | 2166 * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was
absent |
2520 * @param classKeyword the token representing the 'class' keyword | 2167 * @param classKeyword the token representing the 'class' keyword |
2521 * @param name the name of the class being declared | 2168 * @param name the name of the class being declared |
2522 * @param typeParameters the type parameters for the class | 2169 * @param typeParameters the type parameters for the class |
2523 * @param extendsClause the extends clause for the class | 2170 * @param extendsClause the extends clause for the class |
2524 * @param withClause the with clause for the class | 2171 * @param withClause the with clause for the class |
2525 * @param implementsClause the implements clause for the class | 2172 * @param implementsClause the implements clause for the class |
2526 * @param leftBracket the left curly bracket | 2173 * @param leftBracket the left curly bracket |
2527 * @param members the members defined by the class | 2174 * @param members the members defined by the class |
2528 * @param rightBracket the right curly bracket | 2175 * @param rightBracket the right curly bracket |
2529 */ | 2176 */ |
2530 ClassDeclaration({Comment comment, List<Annotation> metadata, Token abstractKe
yword, Token classKeyword, SimpleIdentifier name, TypeParameterList typeParamete
rs, ExtendsClause extendsClause, WithClause withClause, ImplementsClause impleme
ntsClause, Token leftBracket, List<ClassMember> members, Token rightBracket}) :
this.full(comment, metadata, abstractKeyword, classKeyword, name, typeParameters
, extendsClause, withClause, implementsClause, leftBracket, members, rightBracke
t); | 2177 ClassDeclaration({Comment comment, List<Annotation> metadata, Token abstractKe
yword, Token classKeyword, SimpleIdentifier name, TypeParameterList typeParamete
rs, ExtendsClause extendsClause, WithClause withClause, ImplementsClause impleme
ntsClause, Token leftBracket, List<ClassMember> members, Token rightBracket}) :
this.full(comment, metadata, abstractKeyword, classKeyword, name, typeParameters
, extendsClause, withClause, implementsClause, leftBracket, members, rightBracke
t); |
2531 accept(ASTVisitor visitor) => visitor.visitClassDeclaration(this); | 2178 accept(ASTVisitor visitor) => visitor.visitClassDeclaration(this); |
2532 | |
2533 /** | |
2534 * Return the 'abstract' keyword, or `null` if the keyword was absent. | |
2535 * | |
2536 * @return the 'abstract' keyword | |
2537 */ | |
2538 Token get abstractKeyword => _abstractKeyword; | |
2539 | |
2540 /** | |
2541 * Return the token representing the 'class' keyword. | |
2542 * | |
2543 * @return the token representing the 'class' keyword | |
2544 */ | |
2545 Token get classKeyword => _classKeyword; | |
2546 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme
nt) : null; | 2179 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme
nt) : null; |
2547 Token get endToken => _rightBracket; | 2180 Token get endToken => rightBracket; |
2548 | 2181 |
2549 /** | 2182 /** |
2550 * Return the extends clause for this class, or `null` if the class does not e
xtend any | 2183 * Return the extends clause for this class, or `null` if the class does not e
xtend any |
2551 * other class. | 2184 * other class. |
2552 * | 2185 * |
2553 * @return the extends clause for this class | 2186 * @return the extends clause for this class |
2554 */ | 2187 */ |
2555 ExtendsClause get extendsClause => _extendsClause; | 2188 ExtendsClause get extendsClause => _extendsClause; |
2556 | 2189 |
2557 /** | 2190 /** |
2558 * Return the implements clause for the class, or `null` if the class does not
implement any | 2191 * Return the implements clause for the class, or `null` if the class does not
implement any |
2559 * interfaces. | 2192 * interfaces. |
2560 * | 2193 * |
2561 * @return the implements clause for the class | 2194 * @return the implements clause for the class |
2562 */ | 2195 */ |
2563 ImplementsClause get implementsClause => _implementsClause; | 2196 ImplementsClause get implementsClause => _implementsClause; |
2564 | 2197 |
2565 /** | 2198 /** |
2566 * Return the left curly bracket. | |
2567 * | |
2568 * @return the left curly bracket | |
2569 */ | |
2570 Token get leftBracket => _leftBracket; | |
2571 | |
2572 /** | |
2573 * Return the members defined by the class. | |
2574 * | |
2575 * @return the members defined by the class | |
2576 */ | |
2577 NodeList<ClassMember> get members => _members; | |
2578 | |
2579 /** | |
2580 * Return the name of the class being declared. | 2199 * Return the name of the class being declared. |
2581 * | 2200 * |
2582 * @return the name of the class being declared | 2201 * @return the name of the class being declared |
2583 */ | 2202 */ |
2584 SimpleIdentifier get name => _name; | 2203 SimpleIdentifier get name => _name; |
2585 | 2204 |
2586 /** | 2205 /** |
2587 * Return the native clause for this class, or `null` if the class does not ha
ve a native | |
2588 * cluse. | |
2589 * | |
2590 * @return the native clause for this class | |
2591 */ | |
2592 NativeClause get nativeClause => _nativeClause; | |
2593 | |
2594 /** | |
2595 * Return the right curly bracket. | |
2596 * | |
2597 * @return the right curly bracket | |
2598 */ | |
2599 Token get rightBracket => _rightBracket; | |
2600 | |
2601 /** | |
2602 * Return the type parameters for the class, or `null` if the class does not h
ave any type | |
2603 * parameters. | |
2604 * | |
2605 * @return the type parameters for the class | |
2606 */ | |
2607 TypeParameterList get typeParameters => _typeParameters; | |
2608 | |
2609 /** | |
2610 * Return the with clause for the class, or `null` if the class does not have
a with clause. | 2206 * Return the with clause for the class, or `null` if the class does not have
a with clause. |
2611 * | 2207 * |
2612 * @return the with clause for the class | 2208 * @return the with clause for the class |
2613 */ | 2209 */ |
2614 WithClause get withClause => _withClause; | 2210 WithClause get withClause => _withClause; |
2615 | 2211 |
2616 /** | 2212 /** |
2617 * Set the 'abstract' keyword to the given keyword. | |
2618 * | |
2619 * @param abstractKeyword the 'abstract' keyword | |
2620 */ | |
2621 void set abstractKeyword(Token abstractKeyword2) { | |
2622 this._abstractKeyword = abstractKeyword2; | |
2623 } | |
2624 | |
2625 /** | |
2626 * Set the token representing the 'class' keyword to the given token. | |
2627 * | |
2628 * @param classKeyword the token representing the 'class' keyword | |
2629 */ | |
2630 void set classKeyword(Token classKeyword2) { | |
2631 this._classKeyword = classKeyword2; | |
2632 } | |
2633 | |
2634 /** | |
2635 * Set the extends clause for this class to the given clause. | 2213 * Set the extends clause for this class to the given clause. |
2636 * | 2214 * |
2637 * @param extendsClause the extends clause for this class | 2215 * @param extendsClause the extends clause for this class |
2638 */ | 2216 */ |
2639 void set extendsClause(ExtendsClause extendsClause2) { | 2217 void set extendsClause(ExtendsClause extendsClause2) { |
2640 this._extendsClause = becomeParentOf(extendsClause2); | 2218 this._extendsClause = becomeParentOf(extendsClause2); |
2641 } | 2219 } |
2642 | 2220 |
2643 /** | 2221 /** |
2644 * Set the implements clause for the class to the given clause. | 2222 * Set the implements clause for the class to the given clause. |
2645 * | 2223 * |
2646 * @param implementsClause the implements clause for the class | 2224 * @param implementsClause the implements clause for the class |
2647 */ | 2225 */ |
2648 void set implementsClause(ImplementsClause implementsClause2) { | 2226 void set implementsClause(ImplementsClause implementsClause2) { |
2649 this._implementsClause = becomeParentOf(implementsClause2); | 2227 this._implementsClause = becomeParentOf(implementsClause2); |
2650 } | 2228 } |
2651 | 2229 |
2652 /** | 2230 /** |
2653 * Set the left curly bracket to the given token. | |
2654 * | |
2655 * @param leftBracket the left curly bracket | |
2656 */ | |
2657 void set leftBracket(Token leftBracket2) { | |
2658 this._leftBracket = leftBracket2; | |
2659 } | |
2660 | |
2661 /** | |
2662 * Set the name of the class being declared to the given identifier. | 2231 * Set the name of the class being declared to the given identifier. |
2663 * | 2232 * |
2664 * @param identifier the name of the class being declared | 2233 * @param identifier the name of the class being declared |
2665 */ | 2234 */ |
2666 void set name(SimpleIdentifier identifier) { | 2235 void set name(SimpleIdentifier identifier) { |
2667 _name = becomeParentOf(identifier); | 2236 _name = becomeParentOf(identifier); |
2668 } | 2237 } |
2669 | 2238 |
2670 /** | 2239 /** |
2671 * Set the native clause for this class to the given clause. | |
2672 * | |
2673 * @param nativeClause the native clause for this class | |
2674 */ | |
2675 void set nativeClause(NativeClause nativeClause2) { | |
2676 this._nativeClause = nativeClause2; | |
2677 } | |
2678 | |
2679 /** | |
2680 * Set the right curly bracket to the given token. | |
2681 * | |
2682 * @param rightBracket the right curly bracket | |
2683 */ | |
2684 void set rightBracket(Token rightBracket2) { | |
2685 this._rightBracket = rightBracket2; | |
2686 } | |
2687 | |
2688 /** | |
2689 * Set the type parameters for the class to the given list of type parameters. | |
2690 * | |
2691 * @param typeParameters the type parameters for the class | |
2692 */ | |
2693 void set typeParameters(TypeParameterList typeParameters2) { | |
2694 this._typeParameters = typeParameters2; | |
2695 } | |
2696 | |
2697 /** | |
2698 * Set the with clause for the class to the given clause. | 2240 * Set the with clause for the class to the given clause. |
2699 * | 2241 * |
2700 * @param withClause the with clause for the class | 2242 * @param withClause the with clause for the class |
2701 */ | 2243 */ |
2702 void set withClause(WithClause withClause2) { | 2244 void set withClause(WithClause withClause2) { |
2703 this._withClause = becomeParentOf(withClause2); | 2245 this._withClause = becomeParentOf(withClause2); |
2704 } | 2246 } |
2705 void visitChildren(ASTVisitor visitor) { | 2247 void visitChildren(ASTVisitor visitor) { |
2706 super.visitChildren(visitor); | 2248 super.visitChildren(visitor); |
2707 safelyVisitChild(_name, visitor); | 2249 safelyVisitChild(_name, visitor); |
2708 safelyVisitChild(_typeParameters, visitor); | 2250 safelyVisitChild(typeParameters, visitor); |
2709 safelyVisitChild(_extendsClause, visitor); | 2251 safelyVisitChild(_extendsClause, visitor); |
2710 safelyVisitChild(_withClause, visitor); | 2252 safelyVisitChild(_withClause, visitor); |
2711 safelyVisitChild(_implementsClause, visitor); | 2253 safelyVisitChild(_implementsClause, visitor); |
2712 safelyVisitChild(_nativeClause, visitor); | 2254 safelyVisitChild(nativeClause, visitor); |
2713 members.accept(visitor); | 2255 members.accept(visitor); |
2714 } | 2256 } |
2715 Token get firstTokenAfterCommentAndMetadata { | 2257 Token get firstTokenAfterCommentAndMetadata { |
2716 if (_abstractKeyword != null) { | 2258 if (abstractKeyword != null) { |
2717 return _abstractKeyword; | 2259 return abstractKeyword; |
2718 } | 2260 } |
2719 return _classKeyword; | 2261 return classKeyword; |
2720 } | 2262 } |
2721 } | 2263 } |
2722 /** | 2264 /** |
2723 * The abstract class `ClassMember` defines the behavior common to nodes that de
clare a name | 2265 * The abstract class `ClassMember` defines the behavior common to nodes that de
clare a name |
2724 * within the scope of a class. | 2266 * within the scope of a class. |
2725 * | 2267 * |
2726 * @coverage dart.engine.ast | 2268 * @coverage dart.engine.ast |
2727 */ | 2269 */ |
2728 abstract class ClassMember extends Declaration { | 2270 abstract class ClassMember extends Declaration { |
2729 | 2271 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2765 | 2307 |
2766 /** | 2308 /** |
2767 * The type parameters for the class, or `null` if the class does not have any
type | 2309 * The type parameters for the class, or `null` if the class does not have any
type |
2768 * parameters. | 2310 * parameters. |
2769 */ | 2311 */ |
2770 TypeParameterList _typeParameters; | 2312 TypeParameterList _typeParameters; |
2771 | 2313 |
2772 /** | 2314 /** |
2773 * The token for the '=' separating the name from the definition. | 2315 * The token for the '=' separating the name from the definition. |
2774 */ | 2316 */ |
2775 Token _equals; | 2317 Token equals; |
2776 | 2318 |
2777 /** | 2319 /** |
2778 * The token for the 'abstract' keyword, or `null` if this is not defining an
abstract | 2320 * The token for the 'abstract' keyword, or `null` if this is not defining an
abstract |
2779 * class. | 2321 * class. |
2780 */ | 2322 */ |
2781 Token _abstractKeyword; | 2323 Token abstractKeyword; |
2782 | 2324 |
2783 /** | 2325 /** |
2784 * The name of the superclass of the class being declared. | 2326 * The name of the superclass of the class being declared. |
2785 */ | 2327 */ |
2786 TypeName _superclass; | 2328 TypeName _superclass; |
2787 | 2329 |
2788 /** | 2330 /** |
2789 * The with clause for this class. | 2331 * The with clause for this class. |
2790 */ | 2332 */ |
2791 WithClause _withClause; | 2333 WithClause _withClause; |
(...skipping 14 matching lines...) Expand all Loading... |
2806 * @param equals the token for the '=' separating the name from the definition | 2348 * @param equals the token for the '=' separating the name from the definition |
2807 * @param abstractKeyword the token for the 'abstract' keyword | 2349 * @param abstractKeyword the token for the 'abstract' keyword |
2808 * @param superclass the name of the superclass of the class being declared | 2350 * @param superclass the name of the superclass of the class being declared |
2809 * @param withClause the with clause for this class | 2351 * @param withClause the with clause for this class |
2810 * @param implementsClause the implements clause for this class | 2352 * @param implementsClause the implements clause for this class |
2811 * @param semicolon the semicolon terminating the declaration | 2353 * @param semicolon the semicolon terminating the declaration |
2812 */ | 2354 */ |
2813 ClassTypeAlias.full(Comment comment, List<Annotation> metadata, Token keyword,
SimpleIdentifier name, TypeParameterList typeParameters, Token equals, Token ab
stractKeyword, TypeName superclass, WithClause withClause, ImplementsClause impl
ementsClause, Token semicolon) : super.full(comment, metadata, keyword, semicolo
n) { | 2355 ClassTypeAlias.full(Comment comment, List<Annotation> metadata, Token keyword,
SimpleIdentifier name, TypeParameterList typeParameters, Token equals, Token ab
stractKeyword, TypeName superclass, WithClause withClause, ImplementsClause impl
ementsClause, Token semicolon) : super.full(comment, metadata, keyword, semicolo
n) { |
2814 this._name = becomeParentOf(name); | 2356 this._name = becomeParentOf(name); |
2815 this._typeParameters = becomeParentOf(typeParameters); | 2357 this._typeParameters = becomeParentOf(typeParameters); |
2816 this._equals = equals; | 2358 this.equals = equals; |
2817 this._abstractKeyword = abstractKeyword; | 2359 this.abstractKeyword = abstractKeyword; |
2818 this._superclass = becomeParentOf(superclass); | 2360 this._superclass = becomeParentOf(superclass); |
2819 this._withClause = becomeParentOf(withClause); | 2361 this._withClause = becomeParentOf(withClause); |
2820 this._implementsClause = becomeParentOf(implementsClause); | 2362 this._implementsClause = becomeParentOf(implementsClause); |
2821 } | 2363 } |
2822 | 2364 |
2823 /** | 2365 /** |
2824 * Initialize a newly created class type alias. | 2366 * Initialize a newly created class type alias. |
2825 * | 2367 * |
2826 * @param comment the documentation comment associated with this type alias | 2368 * @param comment the documentation comment associated with this type alias |
2827 * @param metadata the annotations associated with this type alias | 2369 * @param metadata the annotations associated with this type alias |
2828 * @param keyword the token representing the 'typedef' keyword | 2370 * @param keyword the token representing the 'typedef' keyword |
2829 * @param name the name of the class being declared | 2371 * @param name the name of the class being declared |
2830 * @param typeParameters the type parameters for the class | 2372 * @param typeParameters the type parameters for the class |
2831 * @param equals the token for the '=' separating the name from the definition | 2373 * @param equals the token for the '=' separating the name from the definition |
2832 * @param abstractKeyword the token for the 'abstract' keyword | 2374 * @param abstractKeyword the token for the 'abstract' keyword |
2833 * @param superclass the name of the superclass of the class being declared | 2375 * @param superclass the name of the superclass of the class being declared |
2834 * @param withClause the with clause for this class | 2376 * @param withClause the with clause for this class |
2835 * @param implementsClause the implements clause for this class | 2377 * @param implementsClause the implements clause for this class |
2836 * @param semicolon the semicolon terminating the declaration | 2378 * @param semicolon the semicolon terminating the declaration |
2837 */ | 2379 */ |
2838 ClassTypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Sim
pleIdentifier name, TypeParameterList typeParameters, Token equals, Token abstra
ctKeyword, TypeName superclass, WithClause withClause, ImplementsClause implemen
tsClause, Token semicolon}) : this.full(comment, metadata, keyword, name, typePa
rameters, equals, abstractKeyword, superclass, withClause, implementsClause, sem
icolon); | 2380 ClassTypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Sim
pleIdentifier name, TypeParameterList typeParameters, Token equals, Token abstra
ctKeyword, TypeName superclass, WithClause withClause, ImplementsClause implemen
tsClause, Token semicolon}) : this.full(comment, metadata, keyword, name, typePa
rameters, equals, abstractKeyword, superclass, withClause, implementsClause, sem
icolon); |
2839 accept(ASTVisitor visitor) => visitor.visitClassTypeAlias(this); | 2381 accept(ASTVisitor visitor) => visitor.visitClassTypeAlias(this); |
2840 | |
2841 /** | |
2842 * Return the token for the 'abstract' keyword, or `null` if this is not defin
ing an | |
2843 * abstract class. | |
2844 * | |
2845 * @return the token for the 'abstract' keyword | |
2846 */ | |
2847 Token get abstractKeyword => _abstractKeyword; | |
2848 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme
nt) : null; | 2382 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme
nt) : null; |
2849 | 2383 |
2850 /** | 2384 /** |
2851 * Return the token for the '=' separating the name from the definition. | |
2852 * | |
2853 * @return the token for the '=' separating the name from the definition | |
2854 */ | |
2855 Token get equals => _equals; | |
2856 | |
2857 /** | |
2858 * Return the implements clause for this class, or `null` if there is no imple
ments clause. | 2385 * Return the implements clause for this class, or `null` if there is no imple
ments clause. |
2859 * | 2386 * |
2860 * @return the implements clause for this class | 2387 * @return the implements clause for this class |
2861 */ | 2388 */ |
2862 ImplementsClause get implementsClause => _implementsClause; | 2389 ImplementsClause get implementsClause => _implementsClause; |
2863 | 2390 |
2864 /** | 2391 /** |
2865 * Return the name of the class being declared. | 2392 * Return the name of the class being declared. |
2866 * | 2393 * |
2867 * @return the name of the class being declared | 2394 * @return the name of the class being declared |
(...skipping 16 matching lines...) Expand all Loading... |
2884 TypeParameterList get typeParameters => _typeParameters; | 2411 TypeParameterList get typeParameters => _typeParameters; |
2885 | 2412 |
2886 /** | 2413 /** |
2887 * Return the with clause for this class. | 2414 * Return the with clause for this class. |
2888 * | 2415 * |
2889 * @return the with clause for this class | 2416 * @return the with clause for this class |
2890 */ | 2417 */ |
2891 WithClause get withClause => _withClause; | 2418 WithClause get withClause => _withClause; |
2892 | 2419 |
2893 /** | 2420 /** |
2894 * Set the token for the 'abstract' keyword to the given token. | |
2895 * | |
2896 * @param abstractKeyword the token for the 'abstract' keyword | |
2897 */ | |
2898 void set abstractKeyword(Token abstractKeyword2) { | |
2899 this._abstractKeyword = abstractKeyword2; | |
2900 } | |
2901 | |
2902 /** | |
2903 * Set the token for the '=' separating the name from the definition to the gi
ven token. | |
2904 * | |
2905 * @param equals the token for the '=' separating the name from the definition | |
2906 */ | |
2907 void set equals(Token equals2) { | |
2908 this._equals = equals2; | |
2909 } | |
2910 | |
2911 /** | |
2912 * Set the implements clause for this class to the given implements clause. | 2421 * Set the implements clause for this class to the given implements clause. |
2913 * | 2422 * |
2914 * @param implementsClause the implements clause for this class | 2423 * @param implementsClause the implements clause for this class |
2915 */ | 2424 */ |
2916 void set implementsClause(ImplementsClause implementsClause2) { | 2425 void set implementsClause(ImplementsClause implementsClause2) { |
2917 this._implementsClause = becomeParentOf(implementsClause2); | 2426 this._implementsClause = becomeParentOf(implementsClause2); |
2918 } | 2427 } |
2919 | 2428 |
2920 /** | 2429 /** |
2921 * Set the name of the class being declared to the given identifier. | 2430 * Set the name of the class being declared to the given identifier. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2971 * | [ShowCombinator] | 2480 * | [ShowCombinator] |
2972 * </pre> | 2481 * </pre> |
2973 * | 2482 * |
2974 * @coverage dart.engine.ast | 2483 * @coverage dart.engine.ast |
2975 */ | 2484 */ |
2976 abstract class Combinator extends ASTNode { | 2485 abstract class Combinator extends ASTNode { |
2977 | 2486 |
2978 /** | 2487 /** |
2979 * The keyword specifying what kind of processing is to be done on the importe
d names. | 2488 * The keyword specifying what kind of processing is to be done on the importe
d names. |
2980 */ | 2489 */ |
2981 Token _keyword; | 2490 Token keyword; |
2982 | 2491 |
2983 /** | 2492 /** |
2984 * Initialize a newly created import combinator. | 2493 * Initialize a newly created import combinator. |
2985 * | 2494 * |
2986 * @param keyword the keyword specifying what kind of processing is to be done
on the imported | 2495 * @param keyword the keyword specifying what kind of processing is to be done
on the imported |
2987 * names | 2496 * names |
2988 */ | 2497 */ |
2989 Combinator.full(Token keyword) { | 2498 Combinator.full(Token keyword) { |
2990 this._keyword = keyword; | 2499 this.keyword = keyword; |
2991 } | 2500 } |
2992 | 2501 |
2993 /** | 2502 /** |
2994 * Initialize a newly created import combinator. | 2503 * Initialize a newly created import combinator. |
2995 * | 2504 * |
2996 * @param keyword the keyword specifying what kind of processing is to be done
on the imported | 2505 * @param keyword the keyword specifying what kind of processing is to be done
on the imported |
2997 * names | 2506 * names |
2998 */ | 2507 */ |
2999 Combinator({Token keyword}) : this.full(keyword); | 2508 Combinator({Token keyword}) : this.full(keyword); |
3000 Token get beginToken => _keyword; | 2509 Token get beginToken => keyword; |
3001 | |
3002 /** | |
3003 * Return the keyword specifying what kind of processing is to be done on the
imported names. | |
3004 * | |
3005 * @return the keyword specifying what kind of processing is to be done on the
imported names | |
3006 */ | |
3007 Token get keyword => _keyword; | |
3008 | |
3009 /** | |
3010 * Set the keyword specifying what kind of processing is to be done on the imp
orted names to the | |
3011 * given token. | |
3012 * | |
3013 * @param keyword the keyword specifying what kind of processing is to be done
on the imported | |
3014 * names | |
3015 */ | |
3016 void set keyword(Token keyword2) { | |
3017 this._keyword = keyword2; | |
3018 } | |
3019 } | 2510 } |
3020 /** | 2511 /** |
3021 * Instances of the class `Comment` represent a comment within the source code. | 2512 * Instances of the class `Comment` represent a comment within the source code. |
3022 * | 2513 * |
3023 * <pre> | 2514 * <pre> |
3024 * comment ::= | 2515 * comment ::= |
3025 * endOfLineComment | 2516 * endOfLineComment |
3026 * | blockComment | 2517 * | blockComment |
3027 * | documentationComment | 2518 * | documentationComment |
3028 * | 2519 * |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3070 * Create an end-of-line comment. | 2561 * Create an end-of-line comment. |
3071 * | 2562 * |
3072 * @param tokens the tokens representing the comment | 2563 * @param tokens the tokens representing the comment |
3073 * @return the end-of-line comment that was created | 2564 * @return the end-of-line comment that was created |
3074 */ | 2565 */ |
3075 static Comment createEndOfLineComment(List<Token> tokens) => new Comment.full(
tokens, CommentType.END_OF_LINE, null); | 2566 static Comment createEndOfLineComment(List<Token> tokens) => new Comment.full(
tokens, CommentType.END_OF_LINE, null); |
3076 | 2567 |
3077 /** | 2568 /** |
3078 * The tokens representing the comment. | 2569 * The tokens representing the comment. |
3079 */ | 2570 */ |
3080 List<Token> _tokens; | 2571 List<Token> tokens; |
3081 | 2572 |
3082 /** | 2573 /** |
3083 * The type of the comment. | 2574 * The type of the comment. |
3084 */ | 2575 */ |
3085 CommentType _type; | 2576 CommentType _type; |
3086 | 2577 |
3087 /** | 2578 /** |
3088 * The references embedded within the documentation comment. This list will be
empty unless this | 2579 * The references embedded within the documentation comment. This list will be
empty unless this |
3089 * is a documentation comment that has references embedded within it. | 2580 * is a documentation comment that has references embedded within it. |
3090 */ | 2581 */ |
3091 NodeList<CommentReference> _references; | 2582 NodeList<CommentReference> references; |
3092 | 2583 |
3093 /** | 2584 /** |
3094 * Initialize a newly created comment. | 2585 * Initialize a newly created comment. |
3095 * | 2586 * |
3096 * @param tokens the tokens representing the comment | 2587 * @param tokens the tokens representing the comment |
3097 * @param type the type of the comment | 2588 * @param type the type of the comment |
3098 * @param references the references embedded within the documentation comment | 2589 * @param references the references embedded within the documentation comment |
3099 */ | 2590 */ |
3100 Comment.full(List<Token> tokens, CommentType type, List<CommentReference> refe
rences) { | 2591 Comment.full(List<Token> tokens, CommentType type, List<CommentReference> refe
rences) { |
3101 this._references = new NodeList<CommentReference>(this); | 2592 this.references = new NodeList<CommentReference>(this); |
3102 this._tokens = tokens; | 2593 this.tokens = tokens; |
3103 this._type = type; | 2594 this._type = type; |
3104 this._references.addAll(references); | 2595 this.references.addAll(references); |
3105 } | 2596 } |
3106 | 2597 |
3107 /** | 2598 /** |
3108 * Initialize a newly created comment. | 2599 * Initialize a newly created comment. |
3109 * | 2600 * |
3110 * @param tokens the tokens representing the comment | 2601 * @param tokens the tokens representing the comment |
3111 * @param type the type of the comment | 2602 * @param type the type of the comment |
3112 * @param references the references embedded within the documentation comment | 2603 * @param references the references embedded within the documentation comment |
3113 */ | 2604 */ |
3114 Comment({List<Token> tokens, CommentType type, List<CommentReference> referenc
es}) : this.full(tokens, type, references); | 2605 Comment({List<Token> tokens, CommentType type, List<CommentReference> referenc
es}) : this.full(tokens, type, references); |
3115 accept(ASTVisitor visitor) => visitor.visitComment(this); | 2606 accept(ASTVisitor visitor) => visitor.visitComment(this); |
3116 Token get beginToken => _tokens[0]; | 2607 Token get beginToken => tokens[0]; |
3117 Token get endToken => _tokens[_tokens.length - 1]; | 2608 Token get endToken => tokens[tokens.length - 1]; |
3118 | |
3119 /** | |
3120 * Return the references embedded within the documentation comment. | |
3121 * | |
3122 * @return the references embedded within the documentation comment | |
3123 */ | |
3124 NodeList<CommentReference> get references => _references; | |
3125 | |
3126 /** | |
3127 * Return the tokens representing the comment. | |
3128 * | |
3129 * @return the tokens representing the comment | |
3130 */ | |
3131 List<Token> get tokens => _tokens; | |
3132 | 2609 |
3133 /** | 2610 /** |
3134 * Return `true` if this is a block comment. | 2611 * Return `true` if this is a block comment. |
3135 * | 2612 * |
3136 * @return `true` if this is a block comment | 2613 * @return `true` if this is a block comment |
3137 */ | 2614 */ |
3138 bool get isBlock => identical(_type, CommentType.BLOCK); | 2615 bool get isBlock => identical(_type, CommentType.BLOCK); |
3139 | 2616 |
3140 /** | 2617 /** |
3141 * Return `true` if this is a documentation comment. | 2618 * Return `true` if this is a documentation comment. |
3142 * | 2619 * |
3143 * @return `true` if this is a documentation comment | 2620 * @return `true` if this is a documentation comment |
3144 */ | 2621 */ |
3145 bool get isDocumentation => identical(_type, CommentType.DOCUMENTATION); | 2622 bool get isDocumentation => identical(_type, CommentType.DOCUMENTATION); |
3146 | 2623 |
3147 /** | 2624 /** |
3148 * Return `true` if this is an end-of-line comment. | 2625 * Return `true` if this is an end-of-line comment. |
3149 * | 2626 * |
3150 * @return `true` if this is an end-of-line comment | 2627 * @return `true` if this is an end-of-line comment |
3151 */ | 2628 */ |
3152 bool get isEndOfLine => identical(_type, CommentType.END_OF_LINE); | 2629 bool get isEndOfLine => identical(_type, CommentType.END_OF_LINE); |
3153 void visitChildren(ASTVisitor visitor) { | 2630 void visitChildren(ASTVisitor visitor) { |
3154 _references.accept(visitor); | 2631 references.accept(visitor); |
3155 } | 2632 } |
3156 } | 2633 } |
3157 /** | 2634 /** |
3158 * The enumeration `CommentType` encodes all the different types of comments tha
t are | 2635 * The enumeration `CommentType` encodes all the different types of comments tha
t are |
3159 * recognized by the parser. | 2636 * recognized by the parser. |
3160 */ | 2637 */ |
3161 class CommentType extends Enum<CommentType> { | 2638 class CommentType extends Enum<CommentType> { |
3162 | 2639 |
3163 /** | 2640 /** |
3164 * An end-of-line comment. | 2641 * An end-of-line comment. |
(...skipping 21 matching lines...) Expand all Loading... |
3186 * '[' 'new'? [Identifier] ']' | 2663 * '[' 'new'? [Identifier] ']' |
3187 * </pre> | 2664 * </pre> |
3188 * | 2665 * |
3189 * @coverage dart.engine.ast | 2666 * @coverage dart.engine.ast |
3190 */ | 2667 */ |
3191 class CommentReference extends ASTNode { | 2668 class CommentReference extends ASTNode { |
3192 | 2669 |
3193 /** | 2670 /** |
3194 * The token representing the 'new' keyword, or `null` if there was no 'new' k
eyword. | 2671 * The token representing the 'new' keyword, or `null` if there was no 'new' k
eyword. |
3195 */ | 2672 */ |
3196 Token _newKeyword; | 2673 Token newKeyword; |
3197 | 2674 |
3198 /** | 2675 /** |
3199 * The identifier being referenced. | 2676 * The identifier being referenced. |
3200 */ | 2677 */ |
3201 Identifier _identifier; | 2678 Identifier _identifier; |
3202 | 2679 |
3203 /** | 2680 /** |
3204 * Initialize a newly created reference to a Dart element. | 2681 * Initialize a newly created reference to a Dart element. |
3205 * | 2682 * |
3206 * @param newKeyword the token representing the 'new' keyword | 2683 * @param newKeyword the token representing the 'new' keyword |
3207 * @param identifier the identifier being referenced | 2684 * @param identifier the identifier being referenced |
3208 */ | 2685 */ |
3209 CommentReference.full(Token newKeyword, Identifier identifier) { | 2686 CommentReference.full(Token newKeyword, Identifier identifier) { |
3210 this._newKeyword = newKeyword; | 2687 this.newKeyword = newKeyword; |
3211 this._identifier = becomeParentOf(identifier); | 2688 this._identifier = becomeParentOf(identifier); |
3212 } | 2689 } |
3213 | 2690 |
3214 /** | 2691 /** |
3215 * Initialize a newly created reference to a Dart element. | 2692 * Initialize a newly created reference to a Dart element. |
3216 * | 2693 * |
3217 * @param newKeyword the token representing the 'new' keyword | 2694 * @param newKeyword the token representing the 'new' keyword |
3218 * @param identifier the identifier being referenced | 2695 * @param identifier the identifier being referenced |
3219 */ | 2696 */ |
3220 CommentReference({Token newKeyword, Identifier identifier}) : this.full(newKey
word, identifier); | 2697 CommentReference({Token newKeyword, Identifier identifier}) : this.full(newKey
word, identifier); |
3221 accept(ASTVisitor visitor) => visitor.visitCommentReference(this); | 2698 accept(ASTVisitor visitor) => visitor.visitCommentReference(this); |
3222 Token get beginToken => _identifier.beginToken; | 2699 Token get beginToken => _identifier.beginToken; |
3223 Token get endToken => _identifier.endToken; | 2700 Token get endToken => _identifier.endToken; |
3224 | 2701 |
3225 /** | 2702 /** |
3226 * Return the identifier being referenced. | 2703 * Return the identifier being referenced. |
3227 * | 2704 * |
3228 * @return the identifier being referenced | 2705 * @return the identifier being referenced |
3229 */ | 2706 */ |
3230 Identifier get identifier => _identifier; | 2707 Identifier get identifier => _identifier; |
3231 | 2708 |
3232 /** | 2709 /** |
3233 * Return the token representing the 'new' keyword, or `null` if there was no
'new' keyword. | |
3234 * | |
3235 * @return the token representing the 'new' keyword | |
3236 */ | |
3237 Token get newKeyword => _newKeyword; | |
3238 | |
3239 /** | |
3240 * Set the identifier being referenced to the given identifier. | 2710 * Set the identifier being referenced to the given identifier. |
3241 * | 2711 * |
3242 * @param identifier the identifier being referenced | 2712 * @param identifier the identifier being referenced |
3243 */ | 2713 */ |
3244 void set identifier(Identifier identifier2) { | 2714 void set identifier(Identifier identifier2) { |
3245 identifier2 = becomeParentOf(identifier2); | 2715 identifier2 = becomeParentOf(identifier2); |
3246 } | 2716 } |
3247 | |
3248 /** | |
3249 * Set the token representing the 'new' keyword to the given token. | |
3250 * | |
3251 * @param newKeyword the token representing the 'new' keyword | |
3252 */ | |
3253 void set newKeyword(Token newKeyword2) { | |
3254 this._newKeyword = newKeyword2; | |
3255 } | |
3256 void visitChildren(ASTVisitor visitor) { | 2717 void visitChildren(ASTVisitor visitor) { |
3257 safelyVisitChild(_identifier, visitor); | 2718 safelyVisitChild(_identifier, visitor); |
3258 } | 2719 } |
3259 } | 2720 } |
3260 /** | 2721 /** |
3261 * Instances of the class `CompilationUnit` represent a compilation unit. | 2722 * Instances of the class `CompilationUnit` represent a compilation unit. |
3262 * | 2723 * |
3263 * While the grammar restricts the order of the directives and declarations with
in a compilation | 2724 * While the grammar restricts the order of the directives and declarations with
in a compilation |
3264 * unit, this class does not enforce those restrictions. In particular, the chil
dren of a | 2725 * unit, this class does not enforce those restrictions. In particular, the chil
dren of a |
3265 * compilation unit will be visited in lexical order even if lexical order does
not conform to the | 2726 * compilation unit will be visited in lexical order even if lexical order does
not conform to the |
(...skipping 26 matching lines...) Expand all Loading... |
3292 | 2753 |
3293 /** | 2754 /** |
3294 * The script tag at the beginning of the compilation unit, or `null` if there
is no script | 2755 * The script tag at the beginning of the compilation unit, or `null` if there
is no script |
3295 * tag in this compilation unit. | 2756 * tag in this compilation unit. |
3296 */ | 2757 */ |
3297 ScriptTag _scriptTag; | 2758 ScriptTag _scriptTag; |
3298 | 2759 |
3299 /** | 2760 /** |
3300 * The directives contained in this compilation unit. | 2761 * The directives contained in this compilation unit. |
3301 */ | 2762 */ |
3302 NodeList<Directive> _directives; | 2763 NodeList<Directive> directives; |
3303 | 2764 |
3304 /** | 2765 /** |
3305 * The declarations contained in this compilation unit. | 2766 * The declarations contained in this compilation unit. |
3306 */ | 2767 */ |
3307 NodeList<CompilationUnitMember> _declarations; | 2768 NodeList<CompilationUnitMember> declarations; |
3308 | 2769 |
3309 /** | 2770 /** |
3310 * The last token in the token stream that was parsed to form this compilation
unit. This token | 2771 * The last token in the token stream that was parsed to form this compilation
unit. This token |
3311 * should always have a type of [TokenType.EOF]. | 2772 * should always have a type of [TokenType.EOF]. |
3312 */ | 2773 */ |
3313 Token _endToken; | 2774 Token _endToken; |
3314 | 2775 |
3315 /** | 2776 /** |
3316 * The element associated with this compilation unit, or `null` if the AST str
ucture has not | 2777 * The element associated with this compilation unit, or `null` if the AST str
ucture has not |
3317 * been resolved. | 2778 * been resolved. |
3318 */ | 2779 */ |
3319 CompilationUnitElement _element; | 2780 CompilationUnitElement element; |
3320 | 2781 |
3321 /** | 2782 /** |
3322 * The line information for this compilation unit. | 2783 * The line information for this compilation unit. |
3323 */ | 2784 */ |
3324 LineInfo _lineInfo; | 2785 LineInfo lineInfo; |
3325 | 2786 |
3326 /** | 2787 /** |
3327 * The parsing errors encountered when the receiver was parsed. | 2788 * The parsing errors encountered when the receiver was parsed. |
3328 */ | 2789 */ |
3329 List<AnalysisError> _parsingErrors = AnalysisError.NO_ERRORS; | 2790 List<AnalysisError> _parsingErrors = AnalysisError.NO_ERRORS; |
3330 | 2791 |
3331 /** | 2792 /** |
3332 * The resolution errors encountered when the receiver was resolved. | 2793 * The resolution errors encountered when the receiver was resolved. |
3333 */ | 2794 */ |
3334 List<AnalysisError> _resolutionErrors = AnalysisError.NO_ERRORS; | 2795 List<AnalysisError> _resolutionErrors = AnalysisError.NO_ERRORS; |
3335 | 2796 |
3336 /** | 2797 /** |
3337 * Initialize a newly created compilation unit to have the given directives an
d declarations. | 2798 * Initialize a newly created compilation unit to have the given directives an
d declarations. |
3338 * | 2799 * |
3339 * @param beginToken the first token in the token stream | 2800 * @param beginToken the first token in the token stream |
3340 * @param scriptTag the script tag at the beginning of the compilation unit | 2801 * @param scriptTag the script tag at the beginning of the compilation unit |
3341 * @param directives the directives contained in this compilation unit | 2802 * @param directives the directives contained in this compilation unit |
3342 * @param declarations the declarations contained in this compilation unit | 2803 * @param declarations the declarations contained in this compilation unit |
3343 * @param endToken the last token in the token stream | 2804 * @param endToken the last token in the token stream |
3344 */ | 2805 */ |
3345 CompilationUnit.full(Token beginToken, ScriptTag scriptTag, List<Directive> di
rectives, List<CompilationUnitMember> declarations, Token endToken) { | 2806 CompilationUnit.full(Token beginToken, ScriptTag scriptTag, List<Directive> di
rectives, List<CompilationUnitMember> declarations, Token endToken) { |
3346 this._directives = new NodeList<Directive>(this); | 2807 this.directives = new NodeList<Directive>(this); |
3347 this._declarations = new NodeList<CompilationUnitMember>(this); | 2808 this.declarations = new NodeList<CompilationUnitMember>(this); |
3348 this._beginToken = beginToken; | 2809 this._beginToken = beginToken; |
3349 this._scriptTag = becomeParentOf(scriptTag); | 2810 this._scriptTag = becomeParentOf(scriptTag); |
3350 this._directives.addAll(directives); | 2811 this.directives.addAll(directives); |
3351 this._declarations.addAll(declarations); | 2812 this.declarations.addAll(declarations); |
3352 this._endToken = endToken; | 2813 this._endToken = endToken; |
3353 } | 2814 } |
3354 | 2815 |
3355 /** | 2816 /** |
3356 * Initialize a newly created compilation unit to have the given directives an
d declarations. | 2817 * Initialize a newly created compilation unit to have the given directives an
d declarations. |
3357 * | 2818 * |
3358 * @param beginToken the first token in the token stream | 2819 * @param beginToken the first token in the token stream |
3359 * @param scriptTag the script tag at the beginning of the compilation unit | 2820 * @param scriptTag the script tag at the beginning of the compilation unit |
3360 * @param directives the directives contained in this compilation unit | 2821 * @param directives the directives contained in this compilation unit |
3361 * @param declarations the declarations contained in this compilation unit | 2822 * @param declarations the declarations contained in this compilation unit |
3362 * @param endToken the last token in the token stream | 2823 * @param endToken the last token in the token stream |
3363 */ | 2824 */ |
3364 CompilationUnit({Token beginToken, ScriptTag scriptTag, List<Directive> direct
ives, List<CompilationUnitMember> declarations, Token endToken}) : this.full(beg
inToken, scriptTag, directives, declarations, endToken); | 2825 CompilationUnit({Token beginToken, ScriptTag scriptTag, List<Directive> direct
ives, List<CompilationUnitMember> declarations, Token endToken}) : this.full(beg
inToken, scriptTag, directives, declarations, endToken); |
3365 accept(ASTVisitor visitor) => visitor.visitCompilationUnit(this); | 2826 accept(ASTVisitor visitor) => visitor.visitCompilationUnit(this); |
3366 Token get beginToken => _beginToken; | 2827 Token get beginToken => _beginToken; |
3367 | |
3368 /** | |
3369 * Return the declarations contained in this compilation unit. | |
3370 * | |
3371 * @return the declarations contained in this compilation unit | |
3372 */ | |
3373 NodeList<CompilationUnitMember> get declarations => _declarations; | |
3374 | |
3375 /** | |
3376 * Return the directives contained in this compilation unit. | |
3377 * | |
3378 * @return the directives contained in this compilation unit | |
3379 */ | |
3380 NodeList<Directive> get directives => _directives; | |
3381 | |
3382 /** | |
3383 * Return the element associated with this compilation unit, or `null` if the
AST structure | |
3384 * has not been resolved. | |
3385 * | |
3386 * @return the element associated with this compilation unit | |
3387 */ | |
3388 CompilationUnitElement get element => _element; | |
3389 Token get endToken => _endToken; | 2828 Token get endToken => _endToken; |
3390 | 2829 |
3391 /** | 2830 /** |
3392 * Return an array containing all of the errors associated with the receiver.
The array will be | 2831 * Return an array containing all of the errors associated with the receiver.
The array will be |
3393 * empty if the receiver has not been resolved and there were no parse errors. | 2832 * empty if the receiver has not been resolved and there were no parse errors. |
3394 * | 2833 * |
3395 * @return the errors associated with the receiver | 2834 * @return the errors associated with the receiver |
3396 */ | 2835 */ |
3397 List<AnalysisError> get errors { | 2836 List<AnalysisError> get errors { |
3398 List<AnalysisError> parserErrors = parsingErrors; | 2837 List<AnalysisError> parserErrors = parsingErrors; |
3399 List<AnalysisError> resolverErrors = resolutionErrors; | 2838 List<AnalysisError> resolverErrors = resolutionErrors; |
3400 if (resolverErrors.length == 0) { | 2839 if (resolverErrors.length == 0) { |
3401 return parserErrors; | 2840 return parserErrors; |
3402 } else if (parserErrors.length == 0) { | 2841 } else if (parserErrors.length == 0) { |
3403 return resolverErrors; | 2842 return resolverErrors; |
3404 } else { | 2843 } else { |
3405 List<AnalysisError> allErrors = new List<AnalysisError>(parserErrors.lengt
h + resolverErrors.length); | 2844 List<AnalysisError> allErrors = new List<AnalysisError>(parserErrors.lengt
h + resolverErrors.length); |
3406 JavaSystem.arraycopy(parserErrors, 0, allErrors, 0, parserErrors.length); | 2845 JavaSystem.arraycopy(parserErrors, 0, allErrors, 0, parserErrors.length); |
3407 JavaSystem.arraycopy(resolverErrors, 0, allErrors, parserErrors.length, re
solverErrors.length); | 2846 JavaSystem.arraycopy(resolverErrors, 0, allErrors, parserErrors.length, re
solverErrors.length); |
3408 return allErrors; | 2847 return allErrors; |
3409 } | 2848 } |
3410 } | 2849 } |
3411 int get length { | 2850 int get length { |
3412 Token endToken = this.endToken; | 2851 Token endToken = this.endToken; |
3413 if (endToken == null) { | 2852 if (endToken == null) { |
3414 return 0; | 2853 return 0; |
3415 } | 2854 } |
3416 return endToken.offset + endToken.length; | 2855 return endToken.offset + endToken.length; |
3417 } | 2856 } |
3418 | |
3419 /** | |
3420 * Return the line information for this compilation unit. | |
3421 * | |
3422 * @return the line information for this compilation unit | |
3423 */ | |
3424 LineInfo get lineInfo => _lineInfo; | |
3425 int get offset => 0; | 2857 int get offset => 0; |
3426 | 2858 |
3427 /** | 2859 /** |
3428 * Return an array containing all of the parsing errors associated with the re
ceiver. | 2860 * Return an array containing all of the parsing errors associated with the re
ceiver. |
3429 * | 2861 * |
3430 * @return the parsing errors associated with the receiver | 2862 * @return the parsing errors associated with the receiver |
3431 */ | 2863 */ |
3432 List<AnalysisError> get parsingErrors => _parsingErrors; | 2864 List<AnalysisError> get parsingErrors => _parsingErrors; |
3433 | 2865 |
3434 /** | 2866 /** |
3435 * Return an array containing all of the resolution errors associated with the
receiver. The array | 2867 * Return an array containing all of the resolution errors associated with the
receiver. The array |
3436 * will be empty if the receiver has not been resolved. | 2868 * will be empty if the receiver has not been resolved. |
3437 * | 2869 * |
3438 * @return the resolution errors associated with the receiver | 2870 * @return the resolution errors associated with the receiver |
3439 */ | 2871 */ |
3440 List<AnalysisError> get resolutionErrors => _resolutionErrors; | 2872 List<AnalysisError> get resolutionErrors => _resolutionErrors; |
3441 | 2873 |
3442 /** | 2874 /** |
3443 * Return the script tag at the beginning of the compilation unit, or `null` i
f there is no | 2875 * Return the script tag at the beginning of the compilation unit, or `null` i
f there is no |
3444 * script tag in this compilation unit. | 2876 * script tag in this compilation unit. |
3445 * | 2877 * |
3446 * @return the script tag at the beginning of the compilation unit | 2878 * @return the script tag at the beginning of the compilation unit |
3447 */ | 2879 */ |
3448 ScriptTag get scriptTag => _scriptTag; | 2880 ScriptTag get scriptTag => _scriptTag; |
3449 | 2881 |
3450 /** | 2882 /** |
3451 * Set the element associated with this compilation unit to the given element. | |
3452 * | |
3453 * @param element the element associated with this compilation unit | |
3454 */ | |
3455 void set element(CompilationUnitElement element2) { | |
3456 this._element = element2; | |
3457 } | |
3458 | |
3459 /** | |
3460 * Set the line information for this compilation unit to the given line inform
ation. | |
3461 * | |
3462 * @param errors the line information to associate with this compilation unit | |
3463 */ | |
3464 void set lineInfo(LineInfo lineInfo2) { | |
3465 this._lineInfo = lineInfo2; | |
3466 } | |
3467 | |
3468 /** | |
3469 * Set the parse errors associated with this compilation unit to the given err
ors. | 2883 * Set the parse errors associated with this compilation unit to the given err
ors. |
3470 * | 2884 * |
3471 * @param the parse errors to be associated with this compilation unit | 2885 * @param the parse errors to be associated with this compilation unit |
3472 */ | 2886 */ |
3473 void set parsingErrors(List<AnalysisError> errors) { | 2887 void set parsingErrors(List<AnalysisError> errors) { |
3474 _parsingErrors = errors == null ? AnalysisError.NO_ERRORS : errors; | 2888 _parsingErrors = errors == null ? AnalysisError.NO_ERRORS : errors; |
3475 } | 2889 } |
3476 | 2890 |
3477 /** | 2891 /** |
3478 * Set the resolution errors associated with this compilation unit to the give
n errors. | 2892 * Set the resolution errors associated with this compilation unit to the give
n errors. |
3479 * | 2893 * |
3480 * @param the resolution errors to be associated with this compilation unit | 2894 * @param the resolution errors to be associated with this compilation unit |
3481 */ | 2895 */ |
3482 void set resolutionErrors(List<AnalysisError> errors) { | 2896 void set resolutionErrors(List<AnalysisError> errors) { |
3483 _resolutionErrors = errors == null ? AnalysisError.NO_ERRORS : errors; | 2897 _resolutionErrors = errors == null ? AnalysisError.NO_ERRORS : errors; |
3484 } | 2898 } |
3485 | 2899 |
3486 /** | 2900 /** |
3487 * Set the script tag at the beginning of the compilation unit to the given sc
ript tag. | 2901 * Set the script tag at the beginning of the compilation unit to the given sc
ript tag. |
3488 * | 2902 * |
3489 * @param scriptTag the script tag at the beginning of the compilation unit | 2903 * @param scriptTag the script tag at the beginning of the compilation unit |
3490 */ | 2904 */ |
3491 void set scriptTag(ScriptTag scriptTag2) { | 2905 void set scriptTag(ScriptTag scriptTag2) { |
3492 this._scriptTag = becomeParentOf(scriptTag2); | 2906 this._scriptTag = becomeParentOf(scriptTag2); |
3493 } | 2907 } |
3494 void visitChildren(ASTVisitor visitor) { | 2908 void visitChildren(ASTVisitor visitor) { |
3495 safelyVisitChild(_scriptTag, visitor); | 2909 safelyVisitChild(_scriptTag, visitor); |
3496 if (directivesAreBeforeDeclarations()) { | 2910 if (directivesAreBeforeDeclarations()) { |
3497 _directives.accept(visitor); | 2911 directives.accept(visitor); |
3498 _declarations.accept(visitor); | 2912 declarations.accept(visitor); |
3499 } else { | 2913 } else { |
3500 for (ASTNode child in sortedDirectivesAndDeclarations) { | 2914 for (ASTNode child in sortedDirectivesAndDeclarations) { |
3501 child.accept(visitor); | 2915 child.accept(visitor); |
3502 } | 2916 } |
3503 } | 2917 } |
3504 } | 2918 } |
3505 | 2919 |
3506 /** | 2920 /** |
3507 * Return `true` if all of the directives are lexically before any declaration
s. | 2921 * Return `true` if all of the directives are lexically before any declaration
s. |
3508 * | 2922 * |
3509 * @return `true` if all of the directives are lexically before any declaratio
ns | 2923 * @return `true` if all of the directives are lexically before any declaratio
ns |
3510 */ | 2924 */ |
3511 bool directivesAreBeforeDeclarations() { | 2925 bool directivesAreBeforeDeclarations() { |
3512 if (_directives.isEmpty || _declarations.isEmpty) { | 2926 if (directives.isEmpty || declarations.isEmpty) { |
3513 return true; | 2927 return true; |
3514 } | 2928 } |
3515 Directive lastDirective = _directives[_directives.length - 1]; | 2929 Directive lastDirective = directives[directives.length - 1]; |
3516 CompilationUnitMember firstDeclaration = _declarations[0]; | 2930 CompilationUnitMember firstDeclaration = declarations[0]; |
3517 return lastDirective.offset < firstDeclaration.offset; | 2931 return lastDirective.offset < firstDeclaration.offset; |
3518 } | 2932 } |
3519 | 2933 |
3520 /** | 2934 /** |
3521 * Return an array containing all of the directives and declarations in this c
ompilation unit, | 2935 * Return an array containing all of the directives and declarations in this c
ompilation unit, |
3522 * sorted in lexical order. | 2936 * sorted in lexical order. |
3523 * | 2937 * |
3524 * @return the directives and declarations in this compilation unit in the ord
er in which they | 2938 * @return the directives and declarations in this compilation unit in the ord
er in which they |
3525 * appeared in the original source | 2939 * appeared in the original source |
3526 */ | 2940 */ |
3527 List<ASTNode> get sortedDirectivesAndDeclarations { | 2941 List<ASTNode> get sortedDirectivesAndDeclarations { |
3528 List<ASTNode> childList = new List<ASTNode>(); | 2942 List<ASTNode> childList = new List<ASTNode>(); |
3529 childList.addAll(_directives); | 2943 childList.addAll(directives); |
3530 childList.addAll(_declarations); | 2944 childList.addAll(declarations); |
3531 List<ASTNode> children = new List.from(childList); | 2945 List<ASTNode> children = new List.from(childList); |
3532 children.sort(ASTNode.LEXICAL_ORDER); | 2946 children.sort(ASTNode.LEXICAL_ORDER); |
3533 return children; | 2947 return children; |
3534 } | 2948 } |
3535 } | 2949 } |
3536 /** | 2950 /** |
3537 * Instances of the class `CompilationUnitMember` defines the behavior common to
nodes that | 2951 * Instances of the class `CompilationUnitMember` defines the behavior common to
nodes that |
3538 * declare a name within the scope of a compilation unit. | 2952 * declare a name within the scope of a compilation unit. |
3539 * | 2953 * |
3540 * <pre> | 2954 * <pre> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3580 class ConditionalExpression extends Expression { | 2994 class ConditionalExpression extends Expression { |
3581 | 2995 |
3582 /** | 2996 /** |
3583 * The condition used to determine which of the expressions is executed next. | 2997 * The condition used to determine which of the expressions is executed next. |
3584 */ | 2998 */ |
3585 Expression _condition; | 2999 Expression _condition; |
3586 | 3000 |
3587 /** | 3001 /** |
3588 * The token used to separate the condition from the then expression. | 3002 * The token used to separate the condition from the then expression. |
3589 */ | 3003 */ |
3590 Token _question; | 3004 Token question; |
3591 | 3005 |
3592 /** | 3006 /** |
3593 * The expression that is executed if the condition evaluates to `true`. | 3007 * The expression that is executed if the condition evaluates to `true`. |
3594 */ | 3008 */ |
3595 Expression _thenExpression; | 3009 Expression _thenExpression; |
3596 | 3010 |
3597 /** | 3011 /** |
3598 * The token used to separate the then expression from the else expression. | 3012 * The token used to separate the then expression from the else expression. |
3599 */ | 3013 */ |
3600 Token _colon; | 3014 Token colon; |
3601 | 3015 |
3602 /** | 3016 /** |
3603 * The expression that is executed if the condition evaluates to `false`. | 3017 * The expression that is executed if the condition evaluates to `false`. |
3604 */ | 3018 */ |
3605 Expression _elseExpression; | 3019 Expression _elseExpression; |
3606 | 3020 |
3607 /** | 3021 /** |
3608 * Initialize a newly created conditional expression. | 3022 * Initialize a newly created conditional expression. |
3609 * | 3023 * |
3610 * @param condition the condition used to determine which expression is execut
ed next | 3024 * @param condition the condition used to determine which expression is execut
ed next |
3611 * @param question the token used to separate the condition from the then expr
ession | 3025 * @param question the token used to separate the condition from the then expr
ession |
3612 * @param thenExpression the expression that is executed if the condition eval
uates to | 3026 * @param thenExpression the expression that is executed if the condition eval
uates to |
3613 * `true` | 3027 * `true` |
3614 * @param colon the token used to separate the then expression from the else e
xpression | 3028 * @param colon the token used to separate the then expression from the else e
xpression |
3615 * @param elseExpression the expression that is executed if the condition eval
uates to | 3029 * @param elseExpression the expression that is executed if the condition eval
uates to |
3616 * `false` | 3030 * `false` |
3617 */ | 3031 */ |
3618 ConditionalExpression.full(Expression condition, Token question, Expression th
enExpression, Token colon, Expression elseExpression) { | 3032 ConditionalExpression.full(Expression condition, Token question, Expression th
enExpression, Token colon, Expression elseExpression) { |
3619 this._condition = becomeParentOf(condition); | 3033 this._condition = becomeParentOf(condition); |
3620 this._question = question; | 3034 this.question = question; |
3621 this._thenExpression = becomeParentOf(thenExpression); | 3035 this._thenExpression = becomeParentOf(thenExpression); |
3622 this._colon = colon; | 3036 this.colon = colon; |
3623 this._elseExpression = becomeParentOf(elseExpression); | 3037 this._elseExpression = becomeParentOf(elseExpression); |
3624 } | 3038 } |
3625 | 3039 |
3626 /** | 3040 /** |
3627 * Initialize a newly created conditional expression. | 3041 * Initialize a newly created conditional expression. |
3628 * | 3042 * |
3629 * @param condition the condition used to determine which expression is execut
ed next | 3043 * @param condition the condition used to determine which expression is execut
ed next |
3630 * @param question the token used to separate the condition from the then expr
ession | 3044 * @param question the token used to separate the condition from the then expr
ession |
3631 * @param thenExpression the expression that is executed if the condition eval
uates to | 3045 * @param thenExpression the expression that is executed if the condition eval
uates to |
3632 * `true` | 3046 * `true` |
3633 * @param colon the token used to separate the then expression from the else e
xpression | 3047 * @param colon the token used to separate the then expression from the else e
xpression |
3634 * @param elseExpression the expression that is executed if the condition eval
uates to | 3048 * @param elseExpression the expression that is executed if the condition eval
uates to |
3635 * `false` | 3049 * `false` |
3636 */ | 3050 */ |
3637 ConditionalExpression({Expression condition, Token question, Expression thenEx
pression, Token colon, Expression elseExpression}) : this.full(condition, questi
on, thenExpression, colon, elseExpression); | 3051 ConditionalExpression({Expression condition, Token question, Expression thenEx
pression, Token colon, Expression elseExpression}) : this.full(condition, questi
on, thenExpression, colon, elseExpression); |
3638 accept(ASTVisitor visitor) => visitor.visitConditionalExpression(this); | 3052 accept(ASTVisitor visitor) => visitor.visitConditionalExpression(this); |
3639 Token get beginToken => _condition.beginToken; | 3053 Token get beginToken => _condition.beginToken; |
3640 | 3054 |
3641 /** | 3055 /** |
3642 * Return the token used to separate the then expression from the else express
ion. | |
3643 * | |
3644 * @return the token used to separate the then expression from the else expres
sion | |
3645 */ | |
3646 Token get colon => _colon; | |
3647 | |
3648 /** | |
3649 * Return the condition used to determine which of the expressions is executed
next. | 3056 * Return the condition used to determine which of the expressions is executed
next. |
3650 * | 3057 * |
3651 * @return the condition used to determine which expression is executed next | 3058 * @return the condition used to determine which expression is executed next |
3652 */ | 3059 */ |
3653 Expression get condition => _condition; | 3060 Expression get condition => _condition; |
3654 | 3061 |
3655 /** | 3062 /** |
3656 * Return the expression that is executed if the condition evaluates to `false
`. | 3063 * Return the expression that is executed if the condition evaluates to `false
`. |
3657 * | 3064 * |
3658 * @return the expression that is executed if the condition evaluates to `fals
e` | 3065 * @return the expression that is executed if the condition evaluates to `fals
e` |
3659 */ | 3066 */ |
3660 Expression get elseExpression => _elseExpression; | 3067 Expression get elseExpression => _elseExpression; |
3661 Token get endToken => _elseExpression.endToken; | 3068 Token get endToken => _elseExpression.endToken; |
3662 | 3069 |
3663 /** | 3070 /** |
3664 * Return the token used to separate the condition from the then expression. | |
3665 * | |
3666 * @return the token used to separate the condition from the then expression | |
3667 */ | |
3668 Token get question => _question; | |
3669 | |
3670 /** | |
3671 * Return the expression that is executed if the condition evaluates to `true`
. | 3071 * Return the expression that is executed if the condition evaluates to `true`
. |
3672 * | 3072 * |
3673 * @return the expression that is executed if the condition evaluates to `true
` | 3073 * @return the expression that is executed if the condition evaluates to `true
` |
3674 */ | 3074 */ |
3675 Expression get thenExpression => _thenExpression; | 3075 Expression get thenExpression => _thenExpression; |
3676 | 3076 |
3677 /** | 3077 /** |
3678 * Set the token used to separate the then expression from the else expression
to the given token. | |
3679 * | |
3680 * @param colon the token used to separate the then expression from the else e
xpression | |
3681 */ | |
3682 void set colon(Token colon2) { | |
3683 this._colon = colon2; | |
3684 } | |
3685 | |
3686 /** | |
3687 * Set the condition used to determine which of the expressions is executed ne
xt to the given | 3078 * Set the condition used to determine which of the expressions is executed ne
xt to the given |
3688 * expression. | 3079 * expression. |
3689 * | 3080 * |
3690 * @param expression the condition used to determine which expression is execu
ted next | 3081 * @param expression the condition used to determine which expression is execu
ted next |
3691 */ | 3082 */ |
3692 void set condition(Expression expression) { | 3083 void set condition(Expression expression) { |
3693 _condition = becomeParentOf(expression); | 3084 _condition = becomeParentOf(expression); |
3694 } | 3085 } |
3695 | 3086 |
3696 /** | 3087 /** |
3697 * Set the expression that is executed if the condition evaluates to `false` t
o the given | 3088 * Set the expression that is executed if the condition evaluates to `false` t
o the given |
3698 * expression. | 3089 * expression. |
3699 * | 3090 * |
3700 * @param expression the expression that is executed if the condition evaluate
s to `false` | 3091 * @param expression the expression that is executed if the condition evaluate
s to `false` |
3701 */ | 3092 */ |
3702 void set elseExpression(Expression expression) { | 3093 void set elseExpression(Expression expression) { |
3703 _elseExpression = becomeParentOf(expression); | 3094 _elseExpression = becomeParentOf(expression); |
3704 } | 3095 } |
3705 | 3096 |
3706 /** | 3097 /** |
3707 * Set the token used to separate the condition from the then expression to th
e given token. | |
3708 * | |
3709 * @param question the token used to separate the condition from the then expr
ession | |
3710 */ | |
3711 void set question(Token question2) { | |
3712 this._question = question2; | |
3713 } | |
3714 | |
3715 /** | |
3716 * Set the expression that is executed if the condition evaluates to `true` to
the given | 3098 * Set the expression that is executed if the condition evaluates to `true` to
the given |
3717 * expression. | 3099 * expression. |
3718 * | 3100 * |
3719 * @param expression the expression that is executed if the condition evaluate
s to `true` | 3101 * @param expression the expression that is executed if the condition evaluate
s to `true` |
3720 */ | 3102 */ |
3721 void set thenExpression(Expression expression) { | 3103 void set thenExpression(Expression expression) { |
3722 _thenExpression = becomeParentOf(expression); | 3104 _thenExpression = becomeParentOf(expression); |
3723 } | 3105 } |
3724 void visitChildren(ASTVisitor visitor) { | 3106 void visitChildren(ASTVisitor visitor) { |
3725 safelyVisitChild(_condition, visitor); | 3107 safelyVisitChild(_condition, visitor); |
(...skipping 24 matching lines...) Expand all Loading... |
3750 * ':' [ConstructorInitializer] (',' [ConstructorInitializer])* | 3132 * ':' [ConstructorInitializer] (',' [ConstructorInitializer])* |
3751 * </pre> | 3133 * </pre> |
3752 * | 3134 * |
3753 * @coverage dart.engine.ast | 3135 * @coverage dart.engine.ast |
3754 */ | 3136 */ |
3755 class ConstructorDeclaration extends ClassMember { | 3137 class ConstructorDeclaration extends ClassMember { |
3756 | 3138 |
3757 /** | 3139 /** |
3758 * The token for the 'external' keyword, or `null` if the constructor is not e
xternal. | 3140 * The token for the 'external' keyword, or `null` if the constructor is not e
xternal. |
3759 */ | 3141 */ |
3760 Token _externalKeyword; | 3142 Token externalKeyword; |
3761 | 3143 |
3762 /** | 3144 /** |
3763 * The token for the 'const' keyword, or `null` if the constructor is not a co
nst | 3145 * The token for the 'const' keyword, or `null` if the constructor is not a co
nst |
3764 * constructor. | 3146 * constructor. |
3765 */ | 3147 */ |
3766 Token _constKeyword; | 3148 Token constKeyword; |
3767 | 3149 |
3768 /** | 3150 /** |
3769 * The token for the 'factory' keyword, or `null` if the constructor is not a
factory | 3151 * The token for the 'factory' keyword, or `null` if the constructor is not a
factory |
3770 * constructor. | 3152 * constructor. |
3771 */ | 3153 */ |
3772 Token _factoryKeyword; | 3154 Token factoryKeyword; |
3773 | 3155 |
3774 /** | 3156 /** |
3775 * The type of object being created. This can be different than the type in wh
ich the constructor | 3157 * The type of object being created. This can be different than the type in wh
ich the constructor |
3776 * is being declared if the constructor is the implementation of a factory con
structor. | 3158 * is being declared if the constructor is the implementation of a factory con
structor. |
3777 */ | 3159 */ |
3778 Identifier _returnType; | 3160 Identifier _returnType; |
3779 | 3161 |
3780 /** | 3162 /** |
3781 * The token for the period before the constructor name, or `null` if the cons
tructor being | 3163 * The token for the period before the constructor name, or `null` if the cons
tructor being |
3782 * declared is unnamed. | 3164 * declared is unnamed. |
3783 */ | 3165 */ |
3784 Token _period; | 3166 Token period; |
3785 | 3167 |
3786 /** | 3168 /** |
3787 * The name of the constructor, or `null` if the constructor being declared is
unnamed. | 3169 * The name of the constructor, or `null` if the constructor being declared is
unnamed. |
3788 */ | 3170 */ |
3789 SimpleIdentifier _name; | 3171 SimpleIdentifier _name; |
3790 | 3172 |
3791 /** | 3173 /** |
3792 * The parameters associated with the constructor. | 3174 * The parameters associated with the constructor. |
3793 */ | 3175 */ |
3794 FormalParameterList _parameters; | 3176 FormalParameterList _parameters; |
3795 | 3177 |
3796 /** | 3178 /** |
3797 * The token for the separator (colon or equals) before the initializer list o
r redirection, or | 3179 * The token for the separator (colon or equals) before the initializer list o
r redirection, or |
3798 * `null` if there are no initializers. | 3180 * `null` if there are no initializers. |
3799 */ | 3181 */ |
3800 Token _separator; | 3182 Token separator; |
3801 | 3183 |
3802 /** | 3184 /** |
3803 * The initializers associated with the constructor. | 3185 * The initializers associated with the constructor. |
3804 */ | 3186 */ |
3805 NodeList<ConstructorInitializer> _initializers; | 3187 NodeList<ConstructorInitializer> initializers; |
3806 | 3188 |
3807 /** | 3189 /** |
3808 * The name of the constructor to which this constructor will be redirected, o
r `null` if | 3190 * The name of the constructor to which this constructor will be redirected, o
r `null` if |
3809 * this is not a redirecting factory constructor. | 3191 * this is not a redirecting factory constructor. |
3810 */ | 3192 */ |
3811 ConstructorName _redirectedConstructor; | 3193 ConstructorName _redirectedConstructor; |
3812 | 3194 |
3813 /** | 3195 /** |
3814 * The body of the constructor, or `null` if the constructor does not have a b
ody. | 3196 * The body of the constructor, or `null` if the constructor does not have a b
ody. |
3815 */ | 3197 */ |
(...skipping 17 matching lines...) Expand all Loading... |
3833 * @param period the token for the period before the constructor name | 3215 * @param period the token for the period before the constructor name |
3834 * @param name the name of the constructor | 3216 * @param name the name of the constructor |
3835 * @param parameters the parameters associated with the constructor | 3217 * @param parameters the parameters associated with the constructor |
3836 * @param separator the token for the colon or equals before the initializers | 3218 * @param separator the token for the colon or equals before the initializers |
3837 * @param initializers the initializers associated with the constructor | 3219 * @param initializers the initializers associated with the constructor |
3838 * @param redirectedConstructor the name of the constructor to which this cons
tructor will be | 3220 * @param redirectedConstructor the name of the constructor to which this cons
tructor will be |
3839 * redirected | 3221 * redirected |
3840 * @param body the body of the constructor | 3222 * @param body the body of the constructor |
3841 */ | 3223 */ |
3842 ConstructorDeclaration.full(Comment comment, List<Annotation> metadata, Token
externalKeyword, Token constKeyword, Token factoryKeyword, Identifier returnType
, Token period, SimpleIdentifier name, FormalParameterList parameters, Token sep
arator, List<ConstructorInitializer> initializers, ConstructorName redirectedCon
structor, FunctionBody body) : super.full(comment, metadata) { | 3224 ConstructorDeclaration.full(Comment comment, List<Annotation> metadata, Token
externalKeyword, Token constKeyword, Token factoryKeyword, Identifier returnType
, Token period, SimpleIdentifier name, FormalParameterList parameters, Token sep
arator, List<ConstructorInitializer> initializers, ConstructorName redirectedCon
structor, FunctionBody body) : super.full(comment, metadata) { |
3843 this._initializers = new NodeList<ConstructorInitializer>(this); | 3225 this.initializers = new NodeList<ConstructorInitializer>(this); |
3844 this._externalKeyword = externalKeyword; | 3226 this.externalKeyword = externalKeyword; |
3845 this._constKeyword = constKeyword; | 3227 this.constKeyword = constKeyword; |
3846 this._factoryKeyword = factoryKeyword; | 3228 this.factoryKeyword = factoryKeyword; |
3847 this._returnType = becomeParentOf(returnType); | 3229 this._returnType = becomeParentOf(returnType); |
3848 this._period = period; | 3230 this.period = period; |
3849 this._name = becomeParentOf(name); | 3231 this._name = becomeParentOf(name); |
3850 this._parameters = becomeParentOf(parameters); | 3232 this._parameters = becomeParentOf(parameters); |
3851 this._separator = separator; | 3233 this.separator = separator; |
3852 this._initializers.addAll(initializers); | 3234 this.initializers.addAll(initializers); |
3853 this._redirectedConstructor = becomeParentOf(redirectedConstructor); | 3235 this._redirectedConstructor = becomeParentOf(redirectedConstructor); |
3854 this._body = becomeParentOf(body); | 3236 this._body = becomeParentOf(body); |
3855 } | 3237 } |
3856 | 3238 |
3857 /** | 3239 /** |
3858 * Initialize a newly created constructor declaration. | 3240 * Initialize a newly created constructor declaration. |
3859 * | 3241 * |
3860 * @param externalKeyword the token for the 'external' keyword | 3242 * @param externalKeyword the token for the 'external' keyword |
3861 * @param comment the documentation comment associated with this constructor | 3243 * @param comment the documentation comment associated with this constructor |
3862 * @param metadata the annotations associated with this constructor | 3244 * @param metadata the annotations associated with this constructor |
(...skipping 11 matching lines...) Expand all Loading... |
3874 */ | 3256 */ |
3875 ConstructorDeclaration({Comment comment, List<Annotation> metadata, Token exte
rnalKeyword, Token constKeyword, Token factoryKeyword, Identifier returnType, To
ken period, SimpleIdentifier name, FormalParameterList parameters, Token separat
or, List<ConstructorInitializer> initializers, ConstructorName redirectedConstru
ctor, FunctionBody body}) : this.full(comment, metadata, externalKeyword, constK
eyword, factoryKeyword, returnType, period, name, parameters, separator, initial
izers, redirectedConstructor, body); | 3257 ConstructorDeclaration({Comment comment, List<Annotation> metadata, Token exte
rnalKeyword, Token constKeyword, Token factoryKeyword, Identifier returnType, To
ken period, SimpleIdentifier name, FormalParameterList parameters, Token separat
or, List<ConstructorInitializer> initializers, ConstructorName redirectedConstru
ctor, FunctionBody body}) : this.full(comment, metadata, externalKeyword, constK
eyword, factoryKeyword, returnType, period, name, parameters, separator, initial
izers, redirectedConstructor, body); |
3876 accept(ASTVisitor visitor) => visitor.visitConstructorDeclaration(this); | 3258 accept(ASTVisitor visitor) => visitor.visitConstructorDeclaration(this); |
3877 | 3259 |
3878 /** | 3260 /** |
3879 * Return the body of the constructor, or `null` if the constructor does not h
ave a body. | 3261 * Return the body of the constructor, or `null` if the constructor does not h
ave a body. |
3880 * | 3262 * |
3881 * @return the body of the constructor | 3263 * @return the body of the constructor |
3882 */ | 3264 */ |
3883 FunctionBody get body => _body; | 3265 FunctionBody get body => _body; |
3884 | |
3885 /** | |
3886 * Return the token for the 'const' keyword. | |
3887 * | |
3888 * @return the token for the 'const' keyword | |
3889 */ | |
3890 Token get constKeyword => _constKeyword; | |
3891 ConstructorElement get element => _element; | 3266 ConstructorElement get element => _element; |
3892 Token get endToken { | 3267 Token get endToken { |
3893 if (_body != null) { | 3268 if (_body != null) { |
3894 return _body.endToken; | 3269 return _body.endToken; |
3895 } else if (!_initializers.isEmpty) { | 3270 } else if (!initializers.isEmpty) { |
3896 return _initializers.endToken; | 3271 return initializers.endToken; |
3897 } | 3272 } |
3898 return _parameters.endToken; | 3273 return _parameters.endToken; |
3899 } | 3274 } |
3900 | 3275 |
3901 /** | 3276 /** |
3902 * Return the token for the 'external' keyword, or `null` if the constructor i
s not | |
3903 * external. | |
3904 * | |
3905 * @return the token for the 'external' keyword | |
3906 */ | |
3907 Token get externalKeyword => _externalKeyword; | |
3908 | |
3909 /** | |
3910 * Return the token for the 'factory' keyword. | |
3911 * | |
3912 * @return the token for the 'factory' keyword | |
3913 */ | |
3914 Token get factoryKeyword => _factoryKeyword; | |
3915 | |
3916 /** | |
3917 * Return the initializers associated with the constructor. | |
3918 * | |
3919 * @return the initializers associated with the constructor | |
3920 */ | |
3921 NodeList<ConstructorInitializer> get initializers => _initializers; | |
3922 | |
3923 /** | |
3924 * Return the name of the constructor, or `null` if the constructor being decl
ared is | 3277 * Return the name of the constructor, or `null` if the constructor being decl
ared is |
3925 * unnamed. | 3278 * unnamed. |
3926 * | 3279 * |
3927 * @return the name of the constructor | 3280 * @return the name of the constructor |
3928 */ | 3281 */ |
3929 SimpleIdentifier get name => _name; | 3282 SimpleIdentifier get name => _name; |
3930 | 3283 |
3931 /** | 3284 /** |
3932 * Return the parameters associated with the constructor. | 3285 * Return the parameters associated with the constructor. |
3933 * | 3286 * |
3934 * @return the parameters associated with the constructor | 3287 * @return the parameters associated with the constructor |
3935 */ | 3288 */ |
3936 FormalParameterList get parameters => _parameters; | 3289 FormalParameterList get parameters => _parameters; |
3937 | 3290 |
3938 /** | 3291 /** |
3939 * Return the token for the period before the constructor name, or `null` if t
he constructor | |
3940 * being declared is unnamed. | |
3941 * | |
3942 * @return the token for the period before the constructor name | |
3943 */ | |
3944 Token get period => _period; | |
3945 | |
3946 /** | |
3947 * Return the name of the constructor to which this constructor will be redire
cted, or | 3292 * Return the name of the constructor to which this constructor will be redire
cted, or |
3948 * `null` if this is not a redirecting factory constructor. | 3293 * `null` if this is not a redirecting factory constructor. |
3949 * | 3294 * |
3950 * @return the name of the constructor to which this constructor will be redir
ected | 3295 * @return the name of the constructor to which this constructor will be redir
ected |
3951 */ | 3296 */ |
3952 ConstructorName get redirectedConstructor => _redirectedConstructor; | 3297 ConstructorName get redirectedConstructor => _redirectedConstructor; |
3953 | 3298 |
3954 /** | 3299 /** |
3955 * Return the type of object being created. This can be different than the typ
e in which the | 3300 * Return the type of object being created. This can be different than the typ
e in which the |
3956 * constructor is being declared if the constructor is the implementation of a
factory | 3301 * constructor is being declared if the constructor is the implementation of a
factory |
3957 * constructor. | 3302 * constructor. |
3958 * | 3303 * |
3959 * @return the type of object being created | 3304 * @return the type of object being created |
3960 */ | 3305 */ |
3961 Identifier get returnType => _returnType; | 3306 Identifier get returnType => _returnType; |
3962 | 3307 |
3963 /** | 3308 /** |
3964 * Return the token for the separator (colon or equals) before the initializer
list or | |
3965 * redirection, or `null` if there are no initializers. | |
3966 * | |
3967 * @return the token for the separator before the initializer list or redirect
ion | |
3968 */ | |
3969 Token get separator => _separator; | |
3970 | |
3971 /** | |
3972 * Set the body of the constructor to the given function body. | 3309 * Set the body of the constructor to the given function body. |
3973 * | 3310 * |
3974 * @param functionBody the body of the constructor | 3311 * @param functionBody the body of the constructor |
3975 */ | 3312 */ |
3976 void set body(FunctionBody functionBody) { | 3313 void set body(FunctionBody functionBody) { |
3977 _body = becomeParentOf(functionBody); | 3314 _body = becomeParentOf(functionBody); |
3978 } | 3315 } |
3979 | 3316 |
3980 /** | 3317 /** |
3981 * Set the token for the 'const' keyword to the given token. | |
3982 * | |
3983 * @param constKeyword the token for the 'const' keyword | |
3984 */ | |
3985 void set constKeyword(Token constKeyword2) { | |
3986 this._constKeyword = constKeyword2; | |
3987 } | |
3988 | |
3989 /** | |
3990 * Set the element associated with this constructor to the given element. | 3318 * Set the element associated with this constructor to the given element. |
3991 * | 3319 * |
3992 * @param element the element associated with this constructor | 3320 * @param element the element associated with this constructor |
3993 */ | 3321 */ |
3994 void set element(ConstructorElement element2) { | 3322 void set element(ConstructorElement element2) { |
3995 this._element = element2; | 3323 this._element = element2; |
3996 } | 3324 } |
3997 | 3325 |
3998 /** | 3326 /** |
3999 * Set the token for the 'external' keyword to the given token. | |
4000 * | |
4001 * @param externalKeyword the token for the 'external' keyword | |
4002 */ | |
4003 void set externalKeyword(Token externalKeyword2) { | |
4004 this._externalKeyword = externalKeyword2; | |
4005 } | |
4006 | |
4007 /** | |
4008 * Set the token for the 'factory' keyword to the given token. | |
4009 * | |
4010 * @param factoryKeyword the token for the 'factory' keyword | |
4011 */ | |
4012 void set factoryKeyword(Token factoryKeyword2) { | |
4013 this._factoryKeyword = factoryKeyword2; | |
4014 } | |
4015 | |
4016 /** | |
4017 * Set the name of the constructor to the given identifier. | 3327 * Set the name of the constructor to the given identifier. |
4018 * | 3328 * |
4019 * @param identifier the name of the constructor | 3329 * @param identifier the name of the constructor |
4020 */ | 3330 */ |
4021 void set name(SimpleIdentifier identifier) { | 3331 void set name(SimpleIdentifier identifier) { |
4022 _name = becomeParentOf(identifier); | 3332 _name = becomeParentOf(identifier); |
4023 } | 3333 } |
4024 | 3334 |
4025 /** | 3335 /** |
4026 * Set the parameters associated with the constructor to the given list of par
ameters. | 3336 * Set the parameters associated with the constructor to the given list of par
ameters. |
4027 * | 3337 * |
4028 * @param parameters the parameters associated with the constructor | 3338 * @param parameters the parameters associated with the constructor |
4029 */ | 3339 */ |
4030 void set parameters(FormalParameterList parameters2) { | 3340 void set parameters(FormalParameterList parameters2) { |
4031 this._parameters = becomeParentOf(parameters2); | 3341 this._parameters = becomeParentOf(parameters2); |
4032 } | 3342 } |
4033 | 3343 |
4034 /** | 3344 /** |
4035 * Set the token for the period before the constructor name to the given token
. | |
4036 * | |
4037 * @param period the token for the period before the constructor name | |
4038 */ | |
4039 void set period(Token period2) { | |
4040 this._period = period2; | |
4041 } | |
4042 | |
4043 /** | |
4044 * Set the name of the constructor to which this constructor will be redirecte
d to the given | 3345 * Set the name of the constructor to which this constructor will be redirecte
d to the given |
4045 * constructor name. | 3346 * constructor name. |
4046 * | 3347 * |
4047 * @param redirectedConstructor the name of the constructor to which this cons
tructor will be | 3348 * @param redirectedConstructor the name of the constructor to which this cons
tructor will be |
4048 * redirected | 3349 * redirected |
4049 */ | 3350 */ |
4050 void set redirectedConstructor(ConstructorName redirectedConstructor2) { | 3351 void set redirectedConstructor(ConstructorName redirectedConstructor2) { |
4051 this._redirectedConstructor = becomeParentOf(redirectedConstructor2); | 3352 this._redirectedConstructor = becomeParentOf(redirectedConstructor2); |
4052 } | 3353 } |
4053 | 3354 |
4054 /** | 3355 /** |
4055 * Set the type of object being created to the given type name. | 3356 * Set the type of object being created to the given type name. |
4056 * | 3357 * |
4057 * @param typeName the type of object being created | 3358 * @param typeName the type of object being created |
4058 */ | 3359 */ |
4059 void set returnType(Identifier typeName) { | 3360 void set returnType(Identifier typeName) { |
4060 _returnType = becomeParentOf(typeName); | 3361 _returnType = becomeParentOf(typeName); |
4061 } | 3362 } |
4062 | |
4063 /** | |
4064 * Set the token for the separator (colon or equals) before the initializers t
o the given token. | |
4065 * | |
4066 * @param separator the token for the separator (colon or equals) before the i
nitializers | |
4067 */ | |
4068 void set separator(Token separator2) { | |
4069 this._separator = separator2; | |
4070 } | |
4071 void visitChildren(ASTVisitor visitor) { | 3363 void visitChildren(ASTVisitor visitor) { |
4072 super.visitChildren(visitor); | 3364 super.visitChildren(visitor); |
4073 safelyVisitChild(_returnType, visitor); | 3365 safelyVisitChild(_returnType, visitor); |
4074 safelyVisitChild(_name, visitor); | 3366 safelyVisitChild(_name, visitor); |
4075 safelyVisitChild(_parameters, visitor); | 3367 safelyVisitChild(_parameters, visitor); |
4076 _initializers.accept(visitor); | 3368 initializers.accept(visitor); |
4077 safelyVisitChild(_redirectedConstructor, visitor); | 3369 safelyVisitChild(_redirectedConstructor, visitor); |
4078 safelyVisitChild(_body, visitor); | 3370 safelyVisitChild(_body, visitor); |
4079 } | 3371 } |
4080 Token get firstTokenAfterCommentAndMetadata { | 3372 Token get firstTokenAfterCommentAndMetadata { |
4081 Token leftMost2 = leftMost([_externalKeyword, _constKeyword, _factoryKeyword
]); | 3373 Token leftMost2 = leftMost([externalKeyword, constKeyword, factoryKeyword]); |
4082 if (leftMost2 != null) { | 3374 if (leftMost2 != null) { |
4083 return leftMost2; | 3375 return leftMost2; |
4084 } | 3376 } |
4085 return _returnType.beginToken; | 3377 return _returnType.beginToken; |
4086 } | 3378 } |
4087 | 3379 |
4088 /** | 3380 /** |
4089 * Return the left-most of the given tokens, or `null` if there are no tokens
given or if | 3381 * Return the left-most of the given tokens, or `null` if there are no tokens
given or if |
4090 * all of the given tokens are `null`. | 3382 * all of the given tokens are `null`. |
4091 * | 3383 * |
(...skipping 20 matching lines...) Expand all Loading... |
4112 * ('this' '.')? [SimpleIdentifier] '=' [Expression] | 3404 * ('this' '.')? [SimpleIdentifier] '=' [Expression] |
4113 * </pre> | 3405 * </pre> |
4114 * | 3406 * |
4115 * @coverage dart.engine.ast | 3407 * @coverage dart.engine.ast |
4116 */ | 3408 */ |
4117 class ConstructorFieldInitializer extends ConstructorInitializer { | 3409 class ConstructorFieldInitializer extends ConstructorInitializer { |
4118 | 3410 |
4119 /** | 3411 /** |
4120 * The token for the 'this' keyword, or `null` if there is no 'this' keyword. | 3412 * The token for the 'this' keyword, or `null` if there is no 'this' keyword. |
4121 */ | 3413 */ |
4122 Token _keyword; | 3414 Token keyword; |
4123 | 3415 |
4124 /** | 3416 /** |
4125 * The token for the period after the 'this' keyword, or `null` if there is no
'this' | 3417 * The token for the period after the 'this' keyword, or `null` if there is no
'this' |
4126 * keyword. | 3418 * keyword. |
4127 */ | 3419 */ |
4128 Token _period; | 3420 Token period; |
4129 | 3421 |
4130 /** | 3422 /** |
4131 * The name of the field being initialized. | 3423 * The name of the field being initialized. |
4132 */ | 3424 */ |
4133 SimpleIdentifier _fieldName; | 3425 SimpleIdentifier _fieldName; |
4134 | 3426 |
4135 /** | 3427 /** |
4136 * The token for the equal sign between the field name and the expression. | 3428 * The token for the equal sign between the field name and the expression. |
4137 */ | 3429 */ |
4138 Token _equals; | 3430 Token equals; |
4139 | 3431 |
4140 /** | 3432 /** |
4141 * The expression computing the value to which the field will be initialized. | 3433 * The expression computing the value to which the field will be initialized. |
4142 */ | 3434 */ |
4143 Expression _expression; | 3435 Expression _expression; |
4144 | 3436 |
4145 /** | 3437 /** |
4146 * Initialize a newly created field initializer to initialize the field with t
he given name to the | 3438 * Initialize a newly created field initializer to initialize the field with t
he given name to the |
4147 * value of the given expression. | 3439 * value of the given expression. |
4148 * | 3440 * |
4149 * @param keyword the token for the 'this' keyword | 3441 * @param keyword the token for the 'this' keyword |
4150 * @param period the token for the period after the 'this' keyword | 3442 * @param period the token for the period after the 'this' keyword |
4151 * @param fieldName the name of the field being initialized | 3443 * @param fieldName the name of the field being initialized |
4152 * @param equals the token for the equal sign between the field name and the e
xpression | 3444 * @param equals the token for the equal sign between the field name and the e
xpression |
4153 * @param expression the expression computing the value to which the field wil
l be initialized | 3445 * @param expression the expression computing the value to which the field wil
l be initialized |
4154 */ | 3446 */ |
4155 ConstructorFieldInitializer.full(Token keyword, Token period, SimpleIdentifier
fieldName, Token equals, Expression expression) { | 3447 ConstructorFieldInitializer.full(Token keyword, Token period, SimpleIdentifier
fieldName, Token equals, Expression expression) { |
4156 this._keyword = keyword; | 3448 this.keyword = keyword; |
4157 this._period = period; | 3449 this.period = period; |
4158 this._fieldName = becomeParentOf(fieldName); | 3450 this._fieldName = becomeParentOf(fieldName); |
4159 this._equals = equals; | 3451 this.equals = equals; |
4160 this._expression = becomeParentOf(expression); | 3452 this._expression = becomeParentOf(expression); |
4161 } | 3453 } |
4162 | 3454 |
4163 /** | 3455 /** |
4164 * Initialize a newly created field initializer to initialize the field with t
he given name to the | 3456 * Initialize a newly created field initializer to initialize the field with t
he given name to the |
4165 * value of the given expression. | 3457 * value of the given expression. |
4166 * | 3458 * |
4167 * @param keyword the token for the 'this' keyword | 3459 * @param keyword the token for the 'this' keyword |
4168 * @param period the token for the period after the 'this' keyword | 3460 * @param period the token for the period after the 'this' keyword |
4169 * @param fieldName the name of the field being initialized | 3461 * @param fieldName the name of the field being initialized |
4170 * @param equals the token for the equal sign between the field name and the e
xpression | 3462 * @param equals the token for the equal sign between the field name and the e
xpression |
4171 * @param expression the expression computing the value to which the field wil
l be initialized | 3463 * @param expression the expression computing the value to which the field wil
l be initialized |
4172 */ | 3464 */ |
4173 ConstructorFieldInitializer({Token keyword, Token period, SimpleIdentifier fie
ldName, Token equals, Expression expression}) : this.full(keyword, period, field
Name, equals, expression); | 3465 ConstructorFieldInitializer({Token keyword, Token period, SimpleIdentifier fie
ldName, Token equals, Expression expression}) : this.full(keyword, period, field
Name, equals, expression); |
4174 accept(ASTVisitor visitor) => visitor.visitConstructorFieldInitializer(this); | 3466 accept(ASTVisitor visitor) => visitor.visitConstructorFieldInitializer(this); |
4175 Token get beginToken { | 3467 Token get beginToken { |
4176 if (_keyword != null) { | 3468 if (keyword != null) { |
4177 return _keyword; | 3469 return keyword; |
4178 } | 3470 } |
4179 return _fieldName.beginToken; | 3471 return _fieldName.beginToken; |
4180 } | 3472 } |
4181 Token get endToken => _expression.endToken; | 3473 Token get endToken => _expression.endToken; |
4182 | 3474 |
4183 /** | 3475 /** |
4184 * Return the token for the equal sign between the field name and the expressi
on. | |
4185 * | |
4186 * @return the token for the equal sign between the field name and the express
ion | |
4187 */ | |
4188 Token get equals => _equals; | |
4189 | |
4190 /** | |
4191 * Return the expression computing the value to which the field will be initia
lized. | 3476 * Return the expression computing the value to which the field will be initia
lized. |
4192 * | 3477 * |
4193 * @return the expression computing the value to which the field will be initi
alized | 3478 * @return the expression computing the value to which the field will be initi
alized |
4194 */ | 3479 */ |
4195 Expression get expression => _expression; | 3480 Expression get expression => _expression; |
4196 | 3481 |
4197 /** | 3482 /** |
4198 * Return the name of the field being initialized. | 3483 * Return the name of the field being initialized. |
4199 * | 3484 * |
4200 * @return the name of the field being initialized | 3485 * @return the name of the field being initialized |
4201 */ | 3486 */ |
4202 SimpleIdentifier get fieldName => _fieldName; | 3487 SimpleIdentifier get fieldName => _fieldName; |
4203 | 3488 |
4204 /** | 3489 /** |
4205 * Return the token for the 'this' keyword, or `null` if there is no 'this' ke
yword. | |
4206 * | |
4207 * @return the token for the 'this' keyword | |
4208 */ | |
4209 Token get keyword => _keyword; | |
4210 | |
4211 /** | |
4212 * Return the token for the period after the 'this' keyword, or `null` if ther
e is no 'this' | |
4213 * keyword. | |
4214 * | |
4215 * @return the token for the period after the 'this' keyword | |
4216 */ | |
4217 Token get period => _period; | |
4218 | |
4219 /** | |
4220 * Set the token for the equal sign between the field name and the expression
to the given token. | |
4221 * | |
4222 * @param equals the token for the equal sign between the field name and the e
xpression | |
4223 */ | |
4224 void set equals(Token equals2) { | |
4225 this._equals = equals2; | |
4226 } | |
4227 | |
4228 /** | |
4229 * Set the expression computing the value to which the field will be initializ
ed to the given | 3490 * Set the expression computing the value to which the field will be initializ
ed to the given |
4230 * expression. | 3491 * expression. |
4231 * | 3492 * |
4232 * @param expression the expression computing the value to which the field wil
l be initialized | 3493 * @param expression the expression computing the value to which the field wil
l be initialized |
4233 */ | 3494 */ |
4234 void set expression(Expression expression2) { | 3495 void set expression(Expression expression2) { |
4235 this._expression = becomeParentOf(expression2); | 3496 this._expression = becomeParentOf(expression2); |
4236 } | 3497 } |
4237 | 3498 |
4238 /** | 3499 /** |
4239 * Set the name of the field being initialized to the given identifier. | 3500 * Set the name of the field being initialized to the given identifier. |
4240 * | 3501 * |
4241 * @param identifier the name of the field being initialized | 3502 * @param identifier the name of the field being initialized |
4242 */ | 3503 */ |
4243 void set fieldName(SimpleIdentifier identifier) { | 3504 void set fieldName(SimpleIdentifier identifier) { |
4244 _fieldName = becomeParentOf(identifier); | 3505 _fieldName = becomeParentOf(identifier); |
4245 } | 3506 } |
4246 | |
4247 /** | |
4248 * Set the token for the 'this' keyword to the given token. | |
4249 * | |
4250 * @param keyword the token for the 'this' keyword | |
4251 */ | |
4252 void set keyword(Token keyword2) { | |
4253 this._keyword = keyword2; | |
4254 } | |
4255 | |
4256 /** | |
4257 * Set the token for the period after the 'this' keyword to the given token. | |
4258 * | |
4259 * @param period the token for the period after the 'this' keyword | |
4260 */ | |
4261 void set period(Token period2) { | |
4262 this._period = period2; | |
4263 } | |
4264 void visitChildren(ASTVisitor visitor) { | 3507 void visitChildren(ASTVisitor visitor) { |
4265 safelyVisitChild(_fieldName, visitor); | 3508 safelyVisitChild(_fieldName, visitor); |
4266 safelyVisitChild(_expression, visitor); | 3509 safelyVisitChild(_expression, visitor); |
4267 } | 3510 } |
4268 } | 3511 } |
4269 /** | 3512 /** |
4270 * Instances of the class `ConstructorInitializer` defines the behavior of nodes
that can | 3513 * Instances of the class `ConstructorInitializer` defines the behavior of nodes
that can |
4271 * occur in the initializer list of a constructor declaration. | 3514 * occur in the initializer list of a constructor declaration. |
4272 * | 3515 * |
4273 * <pre> | 3516 * <pre> |
(...skipping 20 matching lines...) Expand all Loading... |
4294 | 3537 |
4295 /** | 3538 /** |
4296 * The name of the type defining the constructor. | 3539 * The name of the type defining the constructor. |
4297 */ | 3540 */ |
4298 TypeName _type; | 3541 TypeName _type; |
4299 | 3542 |
4300 /** | 3543 /** |
4301 * The token for the period before the constructor name, or `null` if the spec
ified | 3544 * The token for the period before the constructor name, or `null` if the spec
ified |
4302 * constructor is the unnamed constructor. | 3545 * constructor is the unnamed constructor. |
4303 */ | 3546 */ |
4304 Token _period; | 3547 Token period; |
4305 | 3548 |
4306 /** | 3549 /** |
4307 * The name of the constructor, or `null` if the specified constructor is the
unnamed | 3550 * The name of the constructor, or `null` if the specified constructor is the
unnamed |
4308 * constructor. | 3551 * constructor. |
4309 */ | 3552 */ |
4310 SimpleIdentifier _name; | 3553 SimpleIdentifier _name; |
4311 | 3554 |
4312 /** | 3555 /** |
4313 * The element associated with this constructor name based on static type info
rmation, or | 3556 * The element associated with this constructor name based on static type info
rmation, or |
4314 * `null` if the AST structure has not been resolved or if this constructor na
me could not | 3557 * `null` if the AST structure has not been resolved or if this constructor na
me could not |
(...skipping 10 matching lines...) Expand all Loading... |
4325 | 3568 |
4326 /** | 3569 /** |
4327 * Initialize a newly created constructor name. | 3570 * Initialize a newly created constructor name. |
4328 * | 3571 * |
4329 * @param type the name of the type defining the constructor | 3572 * @param type the name of the type defining the constructor |
4330 * @param period the token for the period before the constructor name | 3573 * @param period the token for the period before the constructor name |
4331 * @param name the name of the constructor | 3574 * @param name the name of the constructor |
4332 */ | 3575 */ |
4333 ConstructorName.full(TypeName type, Token period, SimpleIdentifier name) { | 3576 ConstructorName.full(TypeName type, Token period, SimpleIdentifier name) { |
4334 this._type = becomeParentOf(type); | 3577 this._type = becomeParentOf(type); |
4335 this._period = period; | 3578 this.period = period; |
4336 this._name = becomeParentOf(name); | 3579 this._name = becomeParentOf(name); |
4337 } | 3580 } |
4338 | 3581 |
4339 /** | 3582 /** |
4340 * Initialize a newly created constructor name. | 3583 * Initialize a newly created constructor name. |
4341 * | 3584 * |
4342 * @param type the name of the type defining the constructor | 3585 * @param type the name of the type defining the constructor |
4343 * @param period the token for the period before the constructor name | 3586 * @param period the token for the period before the constructor name |
4344 * @param name the name of the constructor | 3587 * @param name the name of the constructor |
4345 */ | 3588 */ |
(...skipping 18 matching lines...) Expand all Loading... |
4364 | 3607 |
4365 /** | 3608 /** |
4366 * Return the name of the constructor, or `null` if the specified constructor
is the unnamed | 3609 * Return the name of the constructor, or `null` if the specified constructor
is the unnamed |
4367 * constructor. | 3610 * constructor. |
4368 * | 3611 * |
4369 * @return the name of the constructor | 3612 * @return the name of the constructor |
4370 */ | 3613 */ |
4371 SimpleIdentifier get name => _name; | 3614 SimpleIdentifier get name => _name; |
4372 | 3615 |
4373 /** | 3616 /** |
4374 * Return the token for the period before the constructor name, or `null` if t
he specified | |
4375 * constructor is the unnamed constructor. | |
4376 * | |
4377 * @return the token for the period before the constructor name | |
4378 */ | |
4379 Token get period => _period; | |
4380 | |
4381 /** | |
4382 * Return the element associated with this constructor name based on static ty
pe information, or | 3617 * Return the element associated with this constructor name based on static ty
pe information, or |
4383 * `null` if the AST structure has not been resolved or if this constructor na
me could not | 3618 * `null` if the AST structure has not been resolved or if this constructor na
me could not |
4384 * be resolved. | 3619 * be resolved. |
4385 * | 3620 * |
4386 * @return the element associated with this constructor name | 3621 * @return the element associated with this constructor name |
4387 */ | 3622 */ |
4388 ConstructorElement get staticElement => _staticElement; | 3623 ConstructorElement get staticElement => _staticElement; |
4389 | 3624 |
4390 /** | 3625 /** |
4391 * Return the name of the type defining the constructor. | 3626 * Return the name of the type defining the constructor. |
(...skipping 15 matching lines...) Expand all Loading... |
4407 /** | 3642 /** |
4408 * Set the name of the constructor to the given name. | 3643 * Set the name of the constructor to the given name. |
4409 * | 3644 * |
4410 * @param name the name of the constructor | 3645 * @param name the name of the constructor |
4411 */ | 3646 */ |
4412 void set name(SimpleIdentifier name2) { | 3647 void set name(SimpleIdentifier name2) { |
4413 this._name = becomeParentOf(name2); | 3648 this._name = becomeParentOf(name2); |
4414 } | 3649 } |
4415 | 3650 |
4416 /** | 3651 /** |
4417 * Return the token for the period before the constructor name to the given to
ken. | |
4418 * | |
4419 * @param period the token for the period before the constructor name | |
4420 */ | |
4421 void set period(Token period2) { | |
4422 this._period = period2; | |
4423 } | |
4424 | |
4425 /** | |
4426 * Set the element associated with this constructor name based on static type
information to the | 3652 * Set the element associated with this constructor name based on static type
information to the |
4427 * given element. | 3653 * given element. |
4428 * | 3654 * |
4429 * @param element the element to be associated with this constructor name | 3655 * @param element the element to be associated with this constructor name |
4430 */ | 3656 */ |
4431 void set staticElement(ConstructorElement element) { | 3657 void set staticElement(ConstructorElement element) { |
4432 _staticElement = element; | 3658 _staticElement = element; |
4433 } | 3659 } |
4434 | 3660 |
4435 /** | 3661 /** |
(...skipping 17 matching lines...) Expand all Loading... |
4453 * 'continue' [SimpleIdentifier]? ';' | 3679 * 'continue' [SimpleIdentifier]? ';' |
4454 * </pre> | 3680 * </pre> |
4455 * | 3681 * |
4456 * @coverage dart.engine.ast | 3682 * @coverage dart.engine.ast |
4457 */ | 3683 */ |
4458 class ContinueStatement extends Statement { | 3684 class ContinueStatement extends Statement { |
4459 | 3685 |
4460 /** | 3686 /** |
4461 * The token representing the 'continue' keyword. | 3687 * The token representing the 'continue' keyword. |
4462 */ | 3688 */ |
4463 Token _keyword; | 3689 Token keyword; |
4464 | 3690 |
4465 /** | 3691 /** |
4466 * The label associated with the statement, or `null` if there is no label. | 3692 * The label associated with the statement, or `null` if there is no label. |
4467 */ | 3693 */ |
4468 SimpleIdentifier _label; | 3694 SimpleIdentifier _label; |
4469 | 3695 |
4470 /** | 3696 /** |
4471 * The semicolon terminating the statement. | 3697 * The semicolon terminating the statement. |
4472 */ | 3698 */ |
4473 Token _semicolon; | 3699 Token semicolon; |
4474 | 3700 |
4475 /** | 3701 /** |
4476 * Initialize a newly created continue statement. | 3702 * Initialize a newly created continue statement. |
4477 * | 3703 * |
4478 * @param keyword the token representing the 'continue' keyword | 3704 * @param keyword the token representing the 'continue' keyword |
4479 * @param label the label associated with the statement | 3705 * @param label the label associated with the statement |
4480 * @param semicolon the semicolon terminating the statement | 3706 * @param semicolon the semicolon terminating the statement |
4481 */ | 3707 */ |
4482 ContinueStatement.full(Token keyword, SimpleIdentifier label, Token semicolon)
{ | 3708 ContinueStatement.full(Token keyword, SimpleIdentifier label, Token semicolon)
{ |
4483 this._keyword = keyword; | 3709 this.keyword = keyword; |
4484 this._label = becomeParentOf(label); | 3710 this._label = becomeParentOf(label); |
4485 this._semicolon = semicolon; | 3711 this.semicolon = semicolon; |
4486 } | 3712 } |
4487 | 3713 |
4488 /** | 3714 /** |
4489 * Initialize a newly created continue statement. | 3715 * Initialize a newly created continue statement. |
4490 * | 3716 * |
4491 * @param keyword the token representing the 'continue' keyword | 3717 * @param keyword the token representing the 'continue' keyword |
4492 * @param label the label associated with the statement | 3718 * @param label the label associated with the statement |
4493 * @param semicolon the semicolon terminating the statement | 3719 * @param semicolon the semicolon terminating the statement |
4494 */ | 3720 */ |
4495 ContinueStatement({Token keyword, SimpleIdentifier label, Token semicolon}) :
this.full(keyword, label, semicolon); | 3721 ContinueStatement({Token keyword, SimpleIdentifier label, Token semicolon}) :
this.full(keyword, label, semicolon); |
4496 accept(ASTVisitor visitor) => visitor.visitContinueStatement(this); | 3722 accept(ASTVisitor visitor) => visitor.visitContinueStatement(this); |
4497 Token get beginToken => _keyword; | 3723 Token get beginToken => keyword; |
4498 Token get endToken => _semicolon; | 3724 Token get endToken => semicolon; |
4499 | |
4500 /** | |
4501 * Return the token representing the 'continue' keyword. | |
4502 * | |
4503 * @return the token representing the 'continue' keyword | |
4504 */ | |
4505 Token get keyword => _keyword; | |
4506 | 3725 |
4507 /** | 3726 /** |
4508 * Return the label associated with the statement, or `null` if there is no la
bel. | 3727 * Return the label associated with the statement, or `null` if there is no la
bel. |
4509 * | 3728 * |
4510 * @return the label associated with the statement | 3729 * @return the label associated with the statement |
4511 */ | 3730 */ |
4512 SimpleIdentifier get label => _label; | 3731 SimpleIdentifier get label => _label; |
4513 | 3732 |
4514 /** | 3733 /** |
4515 * Return the semicolon terminating the statement. | |
4516 * | |
4517 * @return the semicolon terminating the statement | |
4518 */ | |
4519 Token get semicolon => _semicolon; | |
4520 | |
4521 /** | |
4522 * Set the token representing the 'continue' keyword to the given token. | |
4523 * | |
4524 * @param keyword the token representing the 'continue' keyword | |
4525 */ | |
4526 void set keyword(Token keyword2) { | |
4527 this._keyword = keyword2; | |
4528 } | |
4529 | |
4530 /** | |
4531 * Set the label associated with the statement to the given label. | 3734 * Set the label associated with the statement to the given label. |
4532 * | 3735 * |
4533 * @param identifier the label associated with the statement | 3736 * @param identifier the label associated with the statement |
4534 */ | 3737 */ |
4535 void set label(SimpleIdentifier identifier) { | 3738 void set label(SimpleIdentifier identifier) { |
4536 _label = becomeParentOf(identifier); | 3739 _label = becomeParentOf(identifier); |
4537 } | 3740 } |
4538 | |
4539 /** | |
4540 * Set the semicolon terminating the statement to the given token. | |
4541 * | |
4542 * @param semicolon the semicolon terminating the statement | |
4543 */ | |
4544 void set semicolon(Token semicolon2) { | |
4545 this._semicolon = semicolon2; | |
4546 } | |
4547 void visitChildren(ASTVisitor visitor) { | 3741 void visitChildren(ASTVisitor visitor) { |
4548 safelyVisitChild(_label, visitor); | 3742 safelyVisitChild(_label, visitor); |
4549 } | 3743 } |
4550 } | 3744 } |
4551 /** | 3745 /** |
4552 * The abstract class `Declaration` defines the behavior common to nodes that re
present the | 3746 * The abstract class `Declaration` defines the behavior common to nodes that re
present the |
4553 * declaration of a name. Each declared name is visible within a name scope. | 3747 * declaration of a name. Each declared name is visible within a name scope. |
4554 * | 3748 * |
4555 * @coverage dart.engine.ast | 3749 * @coverage dart.engine.ast |
4556 */ | 3750 */ |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4590 * </pre> | 3784 * </pre> |
4591 * | 3785 * |
4592 * @coverage dart.engine.ast | 3786 * @coverage dart.engine.ast |
4593 */ | 3787 */ |
4594 class DeclaredIdentifier extends Declaration { | 3788 class DeclaredIdentifier extends Declaration { |
4595 | 3789 |
4596 /** | 3790 /** |
4597 * The token representing either the 'final', 'const' or 'var' keyword, or `nu
ll` if no | 3791 * The token representing either the 'final', 'const' or 'var' keyword, or `nu
ll` if no |
4598 * keyword was used. | 3792 * keyword was used. |
4599 */ | 3793 */ |
4600 Token _keyword; | 3794 Token keyword; |
4601 | 3795 |
4602 /** | 3796 /** |
4603 * The name of the declared type of the parameter, or `null` if the parameter
does not have | 3797 * The name of the declared type of the parameter, or `null` if the parameter
does not have |
4604 * a declared type. | 3798 * a declared type. |
4605 */ | 3799 */ |
4606 TypeName _type; | 3800 TypeName _type; |
4607 | 3801 |
4608 /** | 3802 /** |
4609 * The name of the variable being declared. | 3803 * The name of the variable being declared. |
4610 */ | 3804 */ |
4611 SimpleIdentifier _identifier; | 3805 SimpleIdentifier identifier; |
4612 | 3806 |
4613 /** | 3807 /** |
4614 * Initialize a newly created formal parameter. | 3808 * Initialize a newly created formal parameter. |
4615 * | 3809 * |
4616 * @param comment the documentation comment associated with this parameter | 3810 * @param comment the documentation comment associated with this parameter |
4617 * @param metadata the annotations associated with this parameter | 3811 * @param metadata the annotations associated with this parameter |
4618 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword | 3812 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword |
4619 * @param type the name of the declared type of the parameter | 3813 * @param type the name of the declared type of the parameter |
4620 * @param identifier the name of the parameter being declared | 3814 * @param identifier the name of the parameter being declared |
4621 */ | 3815 */ |
4622 DeclaredIdentifier.full(Comment comment, List<Annotation> metadata, Token keyw
ord, TypeName type, SimpleIdentifier identifier) : super.full(comment, metadata)
{ | 3816 DeclaredIdentifier.full(Comment comment, List<Annotation> metadata, Token keyw
ord, TypeName type, SimpleIdentifier identifier) : super.full(comment, metadata)
{ |
4623 this._keyword = keyword; | 3817 this.keyword = keyword; |
4624 this._type = becomeParentOf(type); | 3818 this._type = becomeParentOf(type); |
4625 this._identifier = becomeParentOf(identifier); | 3819 this.identifier = becomeParentOf(identifier); |
4626 } | 3820 } |
4627 | 3821 |
4628 /** | 3822 /** |
4629 * Initialize a newly created formal parameter. | 3823 * Initialize a newly created formal parameter. |
4630 * | 3824 * |
4631 * @param comment the documentation comment associated with this parameter | 3825 * @param comment the documentation comment associated with this parameter |
4632 * @param metadata the annotations associated with this parameter | 3826 * @param metadata the annotations associated with this parameter |
4633 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword | 3827 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword |
4634 * @param type the name of the declared type of the parameter | 3828 * @param type the name of the declared type of the parameter |
4635 * @param identifier the name of the parameter being declared | 3829 * @param identifier the name of the parameter being declared |
4636 */ | 3830 */ |
4637 DeclaredIdentifier({Comment comment, List<Annotation> metadata, Token keyword,
TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, key
word, type, identifier); | 3831 DeclaredIdentifier({Comment comment, List<Annotation> metadata, Token keyword,
TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, key
word, type, identifier); |
4638 accept(ASTVisitor visitor) => visitor.visitDeclaredIdentifier(this); | 3832 accept(ASTVisitor visitor) => visitor.visitDeclaredIdentifier(this); |
4639 LocalVariableElement get element { | 3833 LocalVariableElement get element { |
4640 SimpleIdentifier identifier = this.identifier; | 3834 SimpleIdentifier identifier2 = identifier; |
4641 if (identifier == null) { | 3835 if (identifier2 == null) { |
4642 return null; | 3836 return null; |
4643 } | 3837 } |
4644 return identifier.staticElement as LocalVariableElement; | 3838 return identifier2.staticElement as LocalVariableElement; |
4645 } | 3839 } |
4646 Token get endToken => _identifier.endToken; | 3840 Token get endToken => identifier.endToken; |
4647 | |
4648 /** | |
4649 * Return the name of the variable being declared. | |
4650 * | |
4651 * @return the name of the variable being declared | |
4652 */ | |
4653 SimpleIdentifier get identifier => _identifier; | |
4654 | |
4655 /** | |
4656 * Return the token representing either the 'final', 'const' or 'var' keyword,
or `null` if | |
4657 * no keyword was used. | |
4658 * | |
4659 * @return the token representing either the 'final', 'const' or 'var' keyword | |
4660 */ | |
4661 Token get keyword => _keyword; | |
4662 | 3841 |
4663 /** | 3842 /** |
4664 * Return the name of the declared type of the parameter, or `null` if the par
ameter does | 3843 * Return the name of the declared type of the parameter, or `null` if the par
ameter does |
4665 * not have a declared type. | 3844 * not have a declared type. |
4666 * | 3845 * |
4667 * @return the name of the declared type of the parameter | 3846 * @return the name of the declared type of the parameter |
4668 */ | 3847 */ |
4669 TypeName get type => _type; | 3848 TypeName get type => _type; |
4670 | 3849 |
4671 /** | 3850 /** |
4672 * Return `true` if this variable was declared with the 'const' modifier. | 3851 * Return `true` if this variable was declared with the 'const' modifier. |
4673 * | 3852 * |
4674 * @return `true` if this variable was declared with the 'const' modifier | 3853 * @return `true` if this variable was declared with the 'const' modifier |
4675 */ | 3854 */ |
4676 bool get isConst => (_keyword is KeywordToken) && identical(((_keyword as Keyw
ordToken)).keyword, Keyword.CONST); | 3855 bool get isConst => (keyword is KeywordToken) && identical(((keyword as Keywor
dToken)).keyword, Keyword.CONST); |
4677 | 3856 |
4678 /** | 3857 /** |
4679 * Return `true` if this variable was declared with the 'final' modifier. Vari
ables that are | 3858 * Return `true` if this variable was declared with the 'final' modifier. Vari
ables that are |
4680 * declared with the 'const' modifier will return `false` even though they are
implicitly | 3859 * declared with the 'const' modifier will return `false` even though they are
implicitly |
4681 * final. | 3860 * final. |
4682 * | 3861 * |
4683 * @return `true` if this variable was declared with the 'final' modifier | 3862 * @return `true` if this variable was declared with the 'final' modifier |
4684 */ | 3863 */ |
4685 bool get isFinal => (_keyword is KeywordToken) && identical(((_keyword as Keyw
ordToken)).keyword, Keyword.FINAL); | 3864 bool get isFinal => (keyword is KeywordToken) && identical(((keyword as Keywor
dToken)).keyword, Keyword.FINAL); |
4686 | |
4687 /** | |
4688 * Set the token representing either the 'final', 'const' or 'var' keyword to
the given token. | |
4689 * | |
4690 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword | |
4691 */ | |
4692 void set keyword(Token keyword2) { | |
4693 this._keyword = keyword2; | |
4694 } | |
4695 | 3865 |
4696 /** | 3866 /** |
4697 * Set the name of the declared type of the parameter to the given type name. | 3867 * Set the name of the declared type of the parameter to the given type name. |
4698 * | 3868 * |
4699 * @param typeName the name of the declared type of the parameter | 3869 * @param typeName the name of the declared type of the parameter |
4700 */ | 3870 */ |
4701 void set type(TypeName typeName) { | 3871 void set type(TypeName typeName) { |
4702 _type = becomeParentOf(typeName); | 3872 _type = becomeParentOf(typeName); |
4703 } | 3873 } |
4704 void visitChildren(ASTVisitor visitor) { | 3874 void visitChildren(ASTVisitor visitor) { |
4705 super.visitChildren(visitor); | 3875 super.visitChildren(visitor); |
4706 safelyVisitChild(_type, visitor); | 3876 safelyVisitChild(_type, visitor); |
4707 safelyVisitChild(_identifier, visitor); | 3877 safelyVisitChild(identifier, visitor); |
4708 } | 3878 } |
4709 Token get firstTokenAfterCommentAndMetadata { | 3879 Token get firstTokenAfterCommentAndMetadata { |
4710 if (_keyword != null) { | 3880 if (keyword != null) { |
4711 return _keyword; | 3881 return keyword; |
4712 } else if (_type != null) { | 3882 } else if (_type != null) { |
4713 return _type.beginToken; | 3883 return _type.beginToken; |
4714 } | 3884 } |
4715 return _identifier.beginToken; | 3885 return identifier.beginToken; |
4716 } | 3886 } |
4717 } | 3887 } |
4718 /** | 3888 /** |
4719 * Instances of the class `DefaultFormalParameter` represent a formal parameter
with a default | 3889 * Instances of the class `DefaultFormalParameter` represent a formal parameter
with a default |
4720 * value. There are two kinds of parameters that are both represented by this cl
ass: named formal | 3890 * value. There are two kinds of parameters that are both represented by this cl
ass: named formal |
4721 * parameters and positional formal parameters. | 3891 * parameters and positional formal parameters. |
4722 * | 3892 * |
4723 * <pre> | 3893 * <pre> |
4724 * defaultFormalParameter ::= | 3894 * defaultFormalParameter ::= |
4725 * [NormalFormalParameter] ('=' [Expression])? | 3895 * [NormalFormalParameter] ('=' [Expression])? |
(...skipping 13 matching lines...) Expand all Loading... |
4739 | 3909 |
4740 /** | 3910 /** |
4741 * The kind of this parameter. | 3911 * The kind of this parameter. |
4742 */ | 3912 */ |
4743 ParameterKind _kind; | 3913 ParameterKind _kind; |
4744 | 3914 |
4745 /** | 3915 /** |
4746 * The token separating the parameter from the default value, or `null` if the
re is no | 3916 * The token separating the parameter from the default value, or `null` if the
re is no |
4747 * default value. | 3917 * default value. |
4748 */ | 3918 */ |
4749 Token _separator; | 3919 Token separator; |
4750 | 3920 |
4751 /** | 3921 /** |
4752 * The expression computing the default value for the parameter, or `null` if
there is no | 3922 * The expression computing the default value for the parameter, or `null` if
there is no |
4753 * default value. | 3923 * default value. |
4754 */ | 3924 */ |
4755 Expression _defaultValue; | 3925 Expression _defaultValue; |
4756 | 3926 |
4757 /** | 3927 /** |
4758 * Initialize a newly created default formal parameter. | 3928 * Initialize a newly created default formal parameter. |
4759 * | 3929 * |
4760 * @param parameter the formal parameter with which the default value is assoc
iated | 3930 * @param parameter the formal parameter with which the default value is assoc
iated |
4761 * @param kind the kind of this parameter | 3931 * @param kind the kind of this parameter |
4762 * @param separator the token separating the parameter from the default value | 3932 * @param separator the token separating the parameter from the default value |
4763 * @param defaultValue the expression computing the default value for the para
meter | 3933 * @param defaultValue the expression computing the default value for the para
meter |
4764 */ | 3934 */ |
4765 DefaultFormalParameter.full(NormalFormalParameter parameter, ParameterKind kin
d, Token separator, Expression defaultValue) { | 3935 DefaultFormalParameter.full(NormalFormalParameter parameter, ParameterKind kin
d, Token separator, Expression defaultValue) { |
4766 this._parameter = becomeParentOf(parameter); | 3936 this._parameter = becomeParentOf(parameter); |
4767 this._kind = kind; | 3937 this._kind = kind; |
4768 this._separator = separator; | 3938 this.separator = separator; |
4769 this._defaultValue = becomeParentOf(defaultValue); | 3939 this._defaultValue = becomeParentOf(defaultValue); |
4770 } | 3940 } |
4771 | 3941 |
4772 /** | 3942 /** |
4773 * Initialize a newly created default formal parameter. | 3943 * Initialize a newly created default formal parameter. |
4774 * | 3944 * |
4775 * @param parameter the formal parameter with which the default value is assoc
iated | 3945 * @param parameter the formal parameter with which the default value is assoc
iated |
4776 * @param kind the kind of this parameter | 3946 * @param kind the kind of this parameter |
4777 * @param separator the token separating the parameter from the default value | 3947 * @param separator the token separating the parameter from the default value |
4778 * @param defaultValue the expression computing the default value for the para
meter | 3948 * @param defaultValue the expression computing the default value for the para
meter |
(...skipping 17 matching lines...) Expand all Loading... |
4796 } | 3966 } |
4797 SimpleIdentifier get identifier => _parameter.identifier; | 3967 SimpleIdentifier get identifier => _parameter.identifier; |
4798 ParameterKind get kind => _kind; | 3968 ParameterKind get kind => _kind; |
4799 | 3969 |
4800 /** | 3970 /** |
4801 * Return the formal parameter with which the default value is associated. | 3971 * Return the formal parameter with which the default value is associated. |
4802 * | 3972 * |
4803 * @return the formal parameter with which the default value is associated | 3973 * @return the formal parameter with which the default value is associated |
4804 */ | 3974 */ |
4805 NormalFormalParameter get parameter => _parameter; | 3975 NormalFormalParameter get parameter => _parameter; |
4806 | |
4807 /** | |
4808 * Return the token separating the parameter from the default value, or `null`
if there is | |
4809 * no default value. | |
4810 * | |
4811 * @return the token separating the parameter from the default value | |
4812 */ | |
4813 Token get separator => _separator; | |
4814 bool get isConst => _parameter != null && _parameter.isConst; | 3976 bool get isConst => _parameter != null && _parameter.isConst; |
4815 bool get isFinal => _parameter != null && _parameter.isFinal; | 3977 bool get isFinal => _parameter != null && _parameter.isFinal; |
4816 | 3978 |
4817 /** | 3979 /** |
4818 * Set the expression computing the default value for the parameter to the giv
en expression. | 3980 * Set the expression computing the default value for the parameter to the giv
en expression. |
4819 * | 3981 * |
4820 * @param expression the expression computing the default value for the parame
ter | 3982 * @param expression the expression computing the default value for the parame
ter |
4821 */ | 3983 */ |
4822 void set defaultValue(Expression expression) { | 3984 void set defaultValue(Expression expression) { |
4823 _defaultValue = becomeParentOf(expression); | 3985 _defaultValue = becomeParentOf(expression); |
4824 } | 3986 } |
4825 | 3987 |
4826 /** | 3988 /** |
4827 * Set the kind of this parameter to the given kind. | 3989 * Set the kind of this parameter to the given kind. |
4828 * | 3990 * |
4829 * @param kind the kind of this parameter | 3991 * @param kind the kind of this parameter |
4830 */ | 3992 */ |
4831 void set kind(ParameterKind kind2) { | 3993 void set kind(ParameterKind kind2) { |
4832 this._kind = kind2; | 3994 this._kind = kind2; |
4833 } | 3995 } |
4834 | 3996 |
4835 /** | 3997 /** |
4836 * Set the formal parameter with which the default value is associated to the
given parameter. | 3998 * Set the formal parameter with which the default value is associated to the
given parameter. |
4837 * | 3999 * |
4838 * @param formalParameter the formal parameter with which the default value is
associated | 4000 * @param formalParameter the formal parameter with which the default value is
associated |
4839 */ | 4001 */ |
4840 void set parameter(NormalFormalParameter formalParameter) { | 4002 void set parameter(NormalFormalParameter formalParameter) { |
4841 _parameter = becomeParentOf(formalParameter); | 4003 _parameter = becomeParentOf(formalParameter); |
4842 } | 4004 } |
4843 | |
4844 /** | |
4845 * Set the token separating the parameter from the default value to the given
token. | |
4846 * | |
4847 * @param separator the token separating the parameter from the default value | |
4848 */ | |
4849 void set separator(Token separator2) { | |
4850 this._separator = separator2; | |
4851 } | |
4852 void visitChildren(ASTVisitor visitor) { | 4005 void visitChildren(ASTVisitor visitor) { |
4853 safelyVisitChild(_parameter, visitor); | 4006 safelyVisitChild(_parameter, visitor); |
4854 safelyVisitChild(_defaultValue, visitor); | 4007 safelyVisitChild(_defaultValue, visitor); |
4855 } | 4008 } |
4856 } | 4009 } |
4857 /** | 4010 /** |
4858 * The abstract class `Directive` defines the behavior common to nodes that repr
esent a | 4011 * The abstract class `Directive` defines the behavior common to nodes that repr
esent a |
4859 * directive. | 4012 * directive. |
4860 * | 4013 * |
4861 * <pre> | 4014 * <pre> |
4862 * directive ::= | 4015 * directive ::= |
4863 * [ExportDirective] | 4016 * [ExportDirective] |
4864 * | [ImportDirective] | 4017 * | [ImportDirective] |
4865 * | [LibraryDirective] | 4018 * | [LibraryDirective] |
4866 * | [PartDirective] | 4019 * | [PartDirective] |
4867 * | [PartOfDirective] | 4020 * | [PartOfDirective] |
4868 * </pre> | 4021 * </pre> |
4869 * | 4022 * |
4870 * @coverage dart.engine.ast | 4023 * @coverage dart.engine.ast |
4871 */ | 4024 */ |
4872 abstract class Directive extends AnnotatedNode { | 4025 abstract class Directive extends AnnotatedNode { |
4873 | 4026 |
4874 /** | 4027 /** |
4875 * The element associated with this directive, or `null` if the AST structure
has not been | 4028 * The element associated with this directive, or `null` if the AST structure
has not been |
4876 * resolved or if this directive could not be resolved. | 4029 * resolved or if this directive could not be resolved. |
4877 */ | 4030 */ |
4878 Element _element; | 4031 Element element; |
4879 | 4032 |
4880 /** | 4033 /** |
4881 * Initialize a newly create directive. | 4034 * Initialize a newly create directive. |
4882 * | 4035 * |
4883 * @param comment the documentation comment associated with this directive | 4036 * @param comment the documentation comment associated with this directive |
4884 * @param metadata the annotations associated with the directive | 4037 * @param metadata the annotations associated with the directive |
4885 */ | 4038 */ |
4886 Directive.full(Comment comment, List<Annotation> metadata) : super.full(commen
t, metadata); | 4039 Directive.full(Comment comment, List<Annotation> metadata) : super.full(commen
t, metadata); |
4887 | 4040 |
4888 /** | 4041 /** |
4889 * Initialize a newly create directive. | 4042 * Initialize a newly create directive. |
4890 * | 4043 * |
4891 * @param comment the documentation comment associated with this directive | 4044 * @param comment the documentation comment associated with this directive |
4892 * @param metadata the annotations associated with the directive | 4045 * @param metadata the annotations associated with the directive |
4893 */ | 4046 */ |
4894 Directive({Comment comment, List<Annotation> metadata}) : this.full(comment, m
etadata); | 4047 Directive({Comment comment, List<Annotation> metadata}) : this.full(comment, m
etadata); |
4895 | 4048 |
4896 /** | 4049 /** |
4897 * Return the element associated with this directive, or `null` if the AST str
ucture has not | |
4898 * been resolved or if this directive could not be resolved. Examples of the l
atter case include a | |
4899 * directive that contains an invalid URL or a URL that does not exist. | |
4900 * | |
4901 * @return the element associated with this directive | |
4902 */ | |
4903 Element get element => _element; | |
4904 | |
4905 /** | |
4906 * Return the token representing the keyword that introduces this directive ('
import', 'export', | 4050 * Return the token representing the keyword that introduces this directive ('
import', 'export', |
4907 * 'library' or 'part'). | 4051 * 'library' or 'part'). |
4908 * | 4052 * |
4909 * @return the token representing the keyword that introduces this directive | 4053 * @return the token representing the keyword that introduces this directive |
4910 */ | 4054 */ |
4911 Token get keyword; | 4055 Token get keyword; |
4912 | |
4913 /** | |
4914 * Set the element associated with this directive to the given element. | |
4915 * | |
4916 * @param element the element associated with this directive | |
4917 */ | |
4918 void set element(Element element2) { | |
4919 this._element = element2; | |
4920 } | |
4921 } | 4056 } |
4922 /** | 4057 /** |
4923 * Instances of the class `DoStatement` represent a do statement. | 4058 * Instances of the class `DoStatement` represent a do statement. |
4924 * | 4059 * |
4925 * <pre> | 4060 * <pre> |
4926 * doStatement ::= | 4061 * doStatement ::= |
4927 * 'do' [Statement] 'while' '(' [Expression] ')' ';' | 4062 * 'do' [Statement] 'while' '(' [Expression] ')' ';' |
4928 * </pre> | 4063 * </pre> |
4929 * | 4064 * |
4930 * @coverage dart.engine.ast | 4065 * @coverage dart.engine.ast |
4931 */ | 4066 */ |
4932 class DoStatement extends Statement { | 4067 class DoStatement extends Statement { |
4933 | 4068 |
4934 /** | 4069 /** |
4935 * The token representing the 'do' keyword. | 4070 * The token representing the 'do' keyword. |
4936 */ | 4071 */ |
4937 Token _doKeyword; | 4072 Token doKeyword; |
4938 | 4073 |
4939 /** | 4074 /** |
4940 * The body of the loop. | 4075 * The body of the loop. |
4941 */ | 4076 */ |
4942 Statement _body; | 4077 Statement _body; |
4943 | 4078 |
4944 /** | 4079 /** |
4945 * The token representing the 'while' keyword. | 4080 * The token representing the 'while' keyword. |
4946 */ | 4081 */ |
4947 Token _whileKeyword; | 4082 Token whileKeyword; |
4948 | 4083 |
4949 /** | 4084 /** |
4950 * The left parenthesis. | 4085 * The left parenthesis. |
4951 */ | 4086 */ |
4952 Token _leftParenthesis; | 4087 Token _leftParenthesis; |
4953 | 4088 |
4954 /** | 4089 /** |
4955 * The condition that determines when the loop will terminate. | 4090 * The condition that determines when the loop will terminate. |
4956 */ | 4091 */ |
4957 Expression _condition; | 4092 Expression _condition; |
4958 | 4093 |
4959 /** | 4094 /** |
4960 * The right parenthesis. | 4095 * The right parenthesis. |
4961 */ | 4096 */ |
4962 Token _rightParenthesis; | 4097 Token _rightParenthesis; |
4963 | 4098 |
4964 /** | 4099 /** |
4965 * The semicolon terminating the statement. | 4100 * The semicolon terminating the statement. |
4966 */ | 4101 */ |
4967 Token _semicolon; | 4102 Token semicolon; |
4968 | 4103 |
4969 /** | 4104 /** |
4970 * Initialize a newly created do loop. | 4105 * Initialize a newly created do loop. |
4971 * | 4106 * |
4972 * @param doKeyword the token representing the 'do' keyword | 4107 * @param doKeyword the token representing the 'do' keyword |
4973 * @param body the body of the loop | 4108 * @param body the body of the loop |
4974 * @param whileKeyword the token representing the 'while' keyword | 4109 * @param whileKeyword the token representing the 'while' keyword |
4975 * @param leftParenthesis the left parenthesis | 4110 * @param leftParenthesis the left parenthesis |
4976 * @param condition the condition that determines when the loop will terminate | 4111 * @param condition the condition that determines when the loop will terminate |
4977 * @param rightParenthesis the right parenthesis | 4112 * @param rightParenthesis the right parenthesis |
4978 * @param semicolon the semicolon terminating the statement | 4113 * @param semicolon the semicolon terminating the statement |
4979 */ | 4114 */ |
4980 DoStatement.full(Token doKeyword, Statement body, Token whileKeyword, Token le
ftParenthesis, Expression condition, Token rightParenthesis, Token semicolon) { | 4115 DoStatement.full(Token doKeyword, Statement body, Token whileKeyword, Token le
ftParenthesis, Expression condition, Token rightParenthesis, Token semicolon) { |
4981 this._doKeyword = doKeyword; | 4116 this.doKeyword = doKeyword; |
4982 this._body = becomeParentOf(body); | 4117 this._body = becomeParentOf(body); |
4983 this._whileKeyword = whileKeyword; | 4118 this.whileKeyword = whileKeyword; |
4984 this._leftParenthesis = leftParenthesis; | 4119 this._leftParenthesis = leftParenthesis; |
4985 this._condition = becomeParentOf(condition); | 4120 this._condition = becomeParentOf(condition); |
4986 this._rightParenthesis = rightParenthesis; | 4121 this._rightParenthesis = rightParenthesis; |
4987 this._semicolon = semicolon; | 4122 this.semicolon = semicolon; |
4988 } | 4123 } |
4989 | 4124 |
4990 /** | 4125 /** |
4991 * Initialize a newly created do loop. | 4126 * Initialize a newly created do loop. |
4992 * | 4127 * |
4993 * @param doKeyword the token representing the 'do' keyword | 4128 * @param doKeyword the token representing the 'do' keyword |
4994 * @param body the body of the loop | 4129 * @param body the body of the loop |
4995 * @param whileKeyword the token representing the 'while' keyword | 4130 * @param whileKeyword the token representing the 'while' keyword |
4996 * @param leftParenthesis the left parenthesis | 4131 * @param leftParenthesis the left parenthesis |
4997 * @param condition the condition that determines when the loop will terminate | 4132 * @param condition the condition that determines when the loop will terminate |
4998 * @param rightParenthesis the right parenthesis | 4133 * @param rightParenthesis the right parenthesis |
4999 * @param semicolon the semicolon terminating the statement | 4134 * @param semicolon the semicolon terminating the statement |
5000 */ | 4135 */ |
5001 DoStatement({Token doKeyword, Statement body, Token whileKeyword, Token leftPa
renthesis, Expression condition, Token rightParenthesis, Token semicolon}) : thi
s.full(doKeyword, body, whileKeyword, leftParenthesis, condition, rightParenthes
is, semicolon); | 4136 DoStatement({Token doKeyword, Statement body, Token whileKeyword, Token leftPa
renthesis, Expression condition, Token rightParenthesis, Token semicolon}) : thi
s.full(doKeyword, body, whileKeyword, leftParenthesis, condition, rightParenthes
is, semicolon); |
5002 accept(ASTVisitor visitor) => visitor.visitDoStatement(this); | 4137 accept(ASTVisitor visitor) => visitor.visitDoStatement(this); |
5003 Token get beginToken => _doKeyword; | 4138 Token get beginToken => doKeyword; |
5004 | 4139 |
5005 /** | 4140 /** |
5006 * Return the body of the loop. | 4141 * Return the body of the loop. |
5007 * | 4142 * |
5008 * @return the body of the loop | 4143 * @return the body of the loop |
5009 */ | 4144 */ |
5010 Statement get body => _body; | 4145 Statement get body => _body; |
5011 | 4146 |
5012 /** | 4147 /** |
5013 * Return the condition that determines when the loop will terminate. | 4148 * Return the condition that determines when the loop will terminate. |
5014 * | 4149 * |
5015 * @return the condition that determines when the loop will terminate | 4150 * @return the condition that determines when the loop will terminate |
5016 */ | 4151 */ |
5017 Expression get condition => _condition; | 4152 Expression get condition => _condition; |
5018 | 4153 Token get endToken => semicolon; |
5019 /** | |
5020 * Return the token representing the 'do' keyword. | |
5021 * | |
5022 * @return the token representing the 'do' keyword | |
5023 */ | |
5024 Token get doKeyword => _doKeyword; | |
5025 Token get endToken => _semicolon; | |
5026 | 4154 |
5027 /** | 4155 /** |
5028 * Return the left parenthesis. | 4156 * Return the left parenthesis. |
5029 * | 4157 * |
5030 * @return the left parenthesis | 4158 * @return the left parenthesis |
5031 */ | 4159 */ |
5032 Token get leftParenthesis => _leftParenthesis; | 4160 Token get leftParenthesis => _leftParenthesis; |
5033 | 4161 |
5034 /** | 4162 /** |
5035 * Return the right parenthesis. | 4163 * Return the right parenthesis. |
5036 * | 4164 * |
5037 * @return the right parenthesis | 4165 * @return the right parenthesis |
5038 */ | 4166 */ |
5039 Token get rightParenthesis => _rightParenthesis; | 4167 Token get rightParenthesis => _rightParenthesis; |
5040 | 4168 |
5041 /** | 4169 /** |
5042 * Return the semicolon terminating the statement. | |
5043 * | |
5044 * @return the semicolon terminating the statement | |
5045 */ | |
5046 Token get semicolon => _semicolon; | |
5047 | |
5048 /** | |
5049 * Return the token representing the 'while' keyword. | |
5050 * | |
5051 * @return the token representing the 'while' keyword | |
5052 */ | |
5053 Token get whileKeyword => _whileKeyword; | |
5054 | |
5055 /** | |
5056 * Set the body of the loop to the given statement. | 4170 * Set the body of the loop to the given statement. |
5057 * | 4171 * |
5058 * @param statement the body of the loop | 4172 * @param statement the body of the loop |
5059 */ | 4173 */ |
5060 void set body(Statement statement) { | 4174 void set body(Statement statement) { |
5061 _body = becomeParentOf(statement); | 4175 _body = becomeParentOf(statement); |
5062 } | 4176 } |
5063 | 4177 |
5064 /** | 4178 /** |
5065 * Set the condition that determines when the loop will terminate to the given
expression. | 4179 * Set the condition that determines when the loop will terminate to the given
expression. |
5066 * | 4180 * |
5067 * @param expression the condition that determines when the loop will terminat
e | 4181 * @param expression the condition that determines when the loop will terminat
e |
5068 */ | 4182 */ |
5069 void set condition(Expression expression) { | 4183 void set condition(Expression expression) { |
5070 _condition = becomeParentOf(expression); | 4184 _condition = becomeParentOf(expression); |
5071 } | 4185 } |
5072 | 4186 |
5073 /** | 4187 /** |
5074 * Set the token representing the 'do' keyword to the given token. | |
5075 * | |
5076 * @param doKeyword the token representing the 'do' keyword | |
5077 */ | |
5078 void set doKeyword(Token doKeyword2) { | |
5079 this._doKeyword = doKeyword2; | |
5080 } | |
5081 | |
5082 /** | |
5083 * Set the left parenthesis to the given token. | 4188 * Set the left parenthesis to the given token. |
5084 * | 4189 * |
5085 * @param parenthesis the left parenthesis | 4190 * @param parenthesis the left parenthesis |
5086 */ | 4191 */ |
5087 void set leftParenthesis(Token parenthesis) { | 4192 void set leftParenthesis(Token parenthesis) { |
5088 _leftParenthesis = parenthesis; | 4193 _leftParenthesis = parenthesis; |
5089 } | 4194 } |
5090 | 4195 |
5091 /** | 4196 /** |
5092 * Set the right parenthesis to the given token. | 4197 * Set the right parenthesis to the given token. |
5093 * | 4198 * |
5094 * @param parenthesis the right parenthesis | 4199 * @param parenthesis the right parenthesis |
5095 */ | 4200 */ |
5096 void set rightParenthesis(Token parenthesis) { | 4201 void set rightParenthesis(Token parenthesis) { |
5097 _rightParenthesis = parenthesis; | 4202 _rightParenthesis = parenthesis; |
5098 } | 4203 } |
5099 | |
5100 /** | |
5101 * Set the semicolon terminating the statement to the given token. | |
5102 * | |
5103 * @param semicolon the semicolon terminating the statement | |
5104 */ | |
5105 void set semicolon(Token semicolon2) { | |
5106 this._semicolon = semicolon2; | |
5107 } | |
5108 | |
5109 /** | |
5110 * Set the token representing the 'while' keyword to the given token. | |
5111 * | |
5112 * @param whileKeyword the token representing the 'while' keyword | |
5113 */ | |
5114 void set whileKeyword(Token whileKeyword2) { | |
5115 this._whileKeyword = whileKeyword2; | |
5116 } | |
5117 void visitChildren(ASTVisitor visitor) { | 4204 void visitChildren(ASTVisitor visitor) { |
5118 safelyVisitChild(_body, visitor); | 4205 safelyVisitChild(_body, visitor); |
5119 safelyVisitChild(_condition, visitor); | 4206 safelyVisitChild(_condition, visitor); |
5120 } | 4207 } |
5121 } | 4208 } |
5122 /** | 4209 /** |
5123 * Instances of the class `DoubleLiteral` represent a floating point literal exp
ression. | 4210 * Instances of the class `DoubleLiteral` represent a floating point literal exp
ression. |
5124 * | 4211 * |
5125 * <pre> | 4212 * <pre> |
5126 * doubleLiteral ::= | 4213 * doubleLiteral ::= |
5127 * decimalDigit+ ('.' decimalDigit*)? exponent? | 4214 * decimalDigit+ ('.' decimalDigit*)? exponent? |
5128 * | '.' decimalDigit+ exponent? | 4215 * | '.' decimalDigit+ exponent? |
5129 * | 4216 * |
5130 * exponent ::= | 4217 * exponent ::= |
5131 * ('e' | 'E') ('+' | '-')? decimalDigit+ | 4218 * ('e' | 'E') ('+' | '-')? decimalDigit+ |
5132 * </pre> | 4219 * </pre> |
5133 * | 4220 * |
5134 * @coverage dart.engine.ast | 4221 * @coverage dart.engine.ast |
5135 */ | 4222 */ |
5136 class DoubleLiteral extends Literal { | 4223 class DoubleLiteral extends Literal { |
5137 | 4224 |
5138 /** | 4225 /** |
5139 * The token representing the literal. | 4226 * The token representing the literal. |
5140 */ | 4227 */ |
5141 Token _literal; | 4228 Token literal; |
5142 | 4229 |
5143 /** | 4230 /** |
5144 * The value of the literal. | 4231 * The value of the literal. |
5145 */ | 4232 */ |
5146 double _value = 0.0; | 4233 double value = 0.0; |
5147 | 4234 |
5148 /** | 4235 /** |
5149 * Initialize a newly created floating point literal. | 4236 * Initialize a newly created floating point literal. |
5150 * | 4237 * |
5151 * @param literal the token representing the literal | 4238 * @param literal the token representing the literal |
5152 * @param value the value of the literal | 4239 * @param value the value of the literal |
5153 */ | 4240 */ |
5154 DoubleLiteral.full(Token literal, double value) { | 4241 DoubleLiteral.full(Token literal, double value) { |
5155 this._literal = literal; | 4242 this.literal = literal; |
5156 this._value = value; | 4243 this.value = value; |
5157 } | 4244 } |
5158 | 4245 |
5159 /** | 4246 /** |
5160 * Initialize a newly created floating point literal. | 4247 * Initialize a newly created floating point literal. |
5161 * | 4248 * |
5162 * @param literal the token representing the literal | 4249 * @param literal the token representing the literal |
5163 * @param value the value of the literal | 4250 * @param value the value of the literal |
5164 */ | 4251 */ |
5165 DoubleLiteral({Token literal, double value}) : this.full(literal, value); | 4252 DoubleLiteral({Token literal, double value}) : this.full(literal, value); |
5166 accept(ASTVisitor visitor) => visitor.visitDoubleLiteral(this); | 4253 accept(ASTVisitor visitor) => visitor.visitDoubleLiteral(this); |
5167 Token get beginToken => _literal; | 4254 Token get beginToken => literal; |
5168 Token get endToken => _literal; | 4255 Token get endToken => literal; |
5169 | |
5170 /** | |
5171 * Return the token representing the literal. | |
5172 * | |
5173 * @return the token representing the literal | |
5174 */ | |
5175 Token get literal => _literal; | |
5176 | |
5177 /** | |
5178 * Return the value of the literal. | |
5179 * | |
5180 * @return the value of the literal | |
5181 */ | |
5182 double get value => _value; | |
5183 | |
5184 /** | |
5185 * Set the token representing the literal to the given token. | |
5186 * | |
5187 * @param literal the token representing the literal | |
5188 */ | |
5189 void set literal(Token literal2) { | |
5190 this._literal = literal2; | |
5191 } | |
5192 | |
5193 /** | |
5194 * Set the value of the literal to the given value. | |
5195 * | |
5196 * @param value the value of the literal | |
5197 */ | |
5198 void set value(double value2) { | |
5199 this._value = value2; | |
5200 } | |
5201 void visitChildren(ASTVisitor visitor) { | 4256 void visitChildren(ASTVisitor visitor) { |
5202 } | 4257 } |
5203 } | 4258 } |
5204 /** | 4259 /** |
5205 * Instances of the class `EmptyFunctionBody` represent an empty function body,
which can only | 4260 * Instances of the class `EmptyFunctionBody` represent an empty function body,
which can only |
5206 * appear in constructors or abstract methods. | 4261 * appear in constructors or abstract methods. |
5207 * | 4262 * |
5208 * <pre> | 4263 * <pre> |
5209 * emptyFunctionBody ::= | 4264 * emptyFunctionBody ::= |
5210 * ';' | 4265 * ';' |
5211 * </pre> | 4266 * </pre> |
5212 * | 4267 * |
5213 * @coverage dart.engine.ast | 4268 * @coverage dart.engine.ast |
5214 */ | 4269 */ |
5215 class EmptyFunctionBody extends FunctionBody { | 4270 class EmptyFunctionBody extends FunctionBody { |
5216 | 4271 |
5217 /** | 4272 /** |
5218 * The token representing the semicolon that marks the end of the function bod
y. | 4273 * The token representing the semicolon that marks the end of the function bod
y. |
5219 */ | 4274 */ |
5220 Token _semicolon; | 4275 Token semicolon; |
5221 | 4276 |
5222 /** | 4277 /** |
5223 * Initialize a newly created function body. | 4278 * Initialize a newly created function body. |
5224 * | 4279 * |
5225 * @param semicolon the token representing the semicolon that marks the end of
the function body | 4280 * @param semicolon the token representing the semicolon that marks the end of
the function body |
5226 */ | 4281 */ |
5227 EmptyFunctionBody.full(Token semicolon) { | 4282 EmptyFunctionBody.full(Token semicolon) { |
5228 this._semicolon = semicolon; | 4283 this.semicolon = semicolon; |
5229 } | 4284 } |
5230 | 4285 |
5231 /** | 4286 /** |
5232 * Initialize a newly created function body. | 4287 * Initialize a newly created function body. |
5233 * | 4288 * |
5234 * @param semicolon the token representing the semicolon that marks the end of
the function body | 4289 * @param semicolon the token representing the semicolon that marks the end of
the function body |
5235 */ | 4290 */ |
5236 EmptyFunctionBody({Token semicolon}) : this.full(semicolon); | 4291 EmptyFunctionBody({Token semicolon}) : this.full(semicolon); |
5237 accept(ASTVisitor visitor) => visitor.visitEmptyFunctionBody(this); | 4292 accept(ASTVisitor visitor) => visitor.visitEmptyFunctionBody(this); |
5238 Token get beginToken => _semicolon; | 4293 Token get beginToken => semicolon; |
5239 Token get endToken => _semicolon; | 4294 Token get endToken => semicolon; |
5240 | |
5241 /** | |
5242 * Return the token representing the semicolon that marks the end of the funct
ion body. | |
5243 * | |
5244 * @return the token representing the semicolon that marks the end of the func
tion body | |
5245 */ | |
5246 Token get semicolon => _semicolon; | |
5247 | |
5248 /** | |
5249 * Set the token representing the semicolon that marks the end of the function
body to the given | |
5250 * token. | |
5251 * | |
5252 * @param semicolon the token representing the semicolon that marks the end of
the function body | |
5253 */ | |
5254 void set semicolon(Token semicolon2) { | |
5255 this._semicolon = semicolon2; | |
5256 } | |
5257 void visitChildren(ASTVisitor visitor) { | 4295 void visitChildren(ASTVisitor visitor) { |
5258 } | 4296 } |
5259 } | 4297 } |
5260 /** | 4298 /** |
5261 * Instances of the class `EmptyStatement` represent an empty statement. | 4299 * Instances of the class `EmptyStatement` represent an empty statement. |
5262 * | 4300 * |
5263 * <pre> | 4301 * <pre> |
5264 * emptyStatement ::= | 4302 * emptyStatement ::= |
5265 * ';' | 4303 * ';' |
5266 * </pre> | 4304 * </pre> |
5267 * | 4305 * |
5268 * @coverage dart.engine.ast | 4306 * @coverage dart.engine.ast |
5269 */ | 4307 */ |
5270 class EmptyStatement extends Statement { | 4308 class EmptyStatement extends Statement { |
5271 | 4309 |
5272 /** | 4310 /** |
5273 * The semicolon terminating the statement. | 4311 * The semicolon terminating the statement. |
5274 */ | 4312 */ |
5275 Token _semicolon; | 4313 Token semicolon; |
5276 | 4314 |
5277 /** | 4315 /** |
5278 * Initialize a newly created empty statement. | 4316 * Initialize a newly created empty statement. |
5279 * | 4317 * |
5280 * @param semicolon the semicolon terminating the statement | 4318 * @param semicolon the semicolon terminating the statement |
5281 */ | 4319 */ |
5282 EmptyStatement.full(Token semicolon) { | 4320 EmptyStatement.full(Token semicolon) { |
5283 this._semicolon = semicolon; | 4321 this.semicolon = semicolon; |
5284 } | 4322 } |
5285 | 4323 |
5286 /** | 4324 /** |
5287 * Initialize a newly created empty statement. | 4325 * Initialize a newly created empty statement. |
5288 * | 4326 * |
5289 * @param semicolon the semicolon terminating the statement | 4327 * @param semicolon the semicolon terminating the statement |
5290 */ | 4328 */ |
5291 EmptyStatement({Token semicolon}) : this.full(semicolon); | 4329 EmptyStatement({Token semicolon}) : this.full(semicolon); |
5292 accept(ASTVisitor visitor) => visitor.visitEmptyStatement(this); | 4330 accept(ASTVisitor visitor) => visitor.visitEmptyStatement(this); |
5293 Token get beginToken => _semicolon; | 4331 Token get beginToken => semicolon; |
5294 Token get endToken => _semicolon; | 4332 Token get endToken => semicolon; |
5295 | |
5296 /** | |
5297 * Return the semicolon terminating the statement. | |
5298 * | |
5299 * @return the semicolon terminating the statement | |
5300 */ | |
5301 Token get semicolon => _semicolon; | |
5302 | |
5303 /** | |
5304 * Set the semicolon terminating the statement to the given token. | |
5305 * | |
5306 * @param semicolon the semicolon terminating the statement | |
5307 */ | |
5308 void set semicolon(Token semicolon2) { | |
5309 this._semicolon = semicolon2; | |
5310 } | |
5311 void visitChildren(ASTVisitor visitor) { | 4333 void visitChildren(ASTVisitor visitor) { |
5312 } | 4334 } |
5313 } | 4335 } |
5314 /** | 4336 /** |
5315 * Ephemeral identifiers are created as needed to mimic the presence of an empty
identifier. | 4337 * Ephemeral identifiers are created as needed to mimic the presence of an empty
identifier. |
5316 * | 4338 * |
5317 * @coverage dart.engine.ast | 4339 * @coverage dart.engine.ast |
5318 */ | 4340 */ |
5319 class EphemeralIdentifier extends SimpleIdentifier { | 4341 class EphemeralIdentifier extends SimpleIdentifier { |
5320 EphemeralIdentifier.full(ASTNode parent, int location) : super.full(new Token(
TokenType.IDENTIFIER, location)) { | 4342 EphemeralIdentifier.full(ASTNode parent, int location) : super.full(new Token(
TokenType.IDENTIFIER, location)) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5352 * @param comment the documentation comment associated with this directive | 4374 * @param comment the documentation comment associated with this directive |
5353 * @param metadata the annotations associated with the directive | 4375 * @param metadata the annotations associated with the directive |
5354 * @param keyword the token representing the 'export' keyword | 4376 * @param keyword the token representing the 'export' keyword |
5355 * @param libraryUri the URI of the library being exported | 4377 * @param libraryUri the URI of the library being exported |
5356 * @param combinators the combinators used to control which names are exported | 4378 * @param combinators the combinators used to control which names are exported |
5357 * @param semicolon the semicolon terminating the directive | 4379 * @param semicolon the semicolon terminating the directive |
5358 */ | 4380 */ |
5359 ExportDirective({Comment comment, List<Annotation> metadata, Token keyword, St
ringLiteral libraryUri, List<Combinator> combinators, Token semicolon}) : this.f
ull(comment, metadata, keyword, libraryUri, combinators, semicolon); | 4381 ExportDirective({Comment comment, List<Annotation> metadata, Token keyword, St
ringLiteral libraryUri, List<Combinator> combinators, Token semicolon}) : this.f
ull(comment, metadata, keyword, libraryUri, combinators, semicolon); |
5360 accept(ASTVisitor visitor) => visitor.visitExportDirective(this); | 4382 accept(ASTVisitor visitor) => visitor.visitExportDirective(this); |
5361 LibraryElement get uriElement { | 4383 LibraryElement get uriElement { |
5362 Element element = this.element; | 4384 Element element2 = element; |
5363 if (element is ExportElement) { | 4385 if (element2 is ExportElement) { |
5364 return ((element as ExportElement)).exportedLibrary; | 4386 return ((element2 as ExportElement)).exportedLibrary; |
5365 } | 4387 } |
5366 return null; | 4388 return null; |
5367 } | 4389 } |
5368 void visitChildren(ASTVisitor visitor) { | 4390 void visitChildren(ASTVisitor visitor) { |
5369 super.visitChildren(visitor); | 4391 super.visitChildren(visitor); |
5370 combinators.accept(visitor); | 4392 combinators.accept(visitor); |
5371 } | 4393 } |
5372 } | 4394 } |
5373 /** | 4395 /** |
5374 * Instances of the class `Expression` defines the behavior common to nodes that
represent an | 4396 * Instances of the class `Expression` defines the behavior common to nodes that
represent an |
5375 * expression. | 4397 * expression. |
5376 * | 4398 * |
5377 * <pre> | 4399 * <pre> |
5378 * expression ::= | 4400 * expression ::= |
5379 * [AssignmentExpression] | 4401 * [AssignmentExpression] |
5380 * | [ConditionalExpression] cascadeSection* | 4402 * | [ConditionalExpression] cascadeSection* |
5381 * | [ThrowExpression] | 4403 * | [ThrowExpression] |
5382 * </pre> | 4404 * </pre> |
5383 * | 4405 * |
5384 * @coverage dart.engine.ast | 4406 * @coverage dart.engine.ast |
5385 */ | 4407 */ |
5386 abstract class Expression extends ASTNode { | 4408 abstract class Expression extends ASTNode { |
5387 | 4409 |
5388 /** | 4410 /** |
5389 * The static type of this expression, or `null` if the AST structure has not
been resolved. | 4411 * The static type of this expression, or `null` if the AST structure has not
been resolved. |
5390 */ | 4412 */ |
5391 Type2 _staticType; | 4413 Type2 staticType; |
5392 | 4414 |
5393 /** | 4415 /** |
5394 * The propagated type of this expression, or `null` if type propagation has n
ot been | 4416 * The propagated type of this expression, or `null` if type propagation has n
ot been |
5395 * performed on the AST structure. | 4417 * performed on the AST structure. |
5396 */ | 4418 */ |
5397 Type2 _propagatedType; | 4419 Type2 propagatedType; |
5398 | 4420 |
5399 /** | 4421 /** |
5400 * Return the best type information available for this expression. If type pro
pagation was able to | 4422 * Return the best type information available for this expression. If type pro
pagation was able to |
5401 * find a better type than static analysis, that type will be returned. Otherw
ise, the result of | 4423 * find a better type than static analysis, that type will be returned. Otherw
ise, the result of |
5402 * static analysis will be returned. If no type analysis has been performed, t
hen the type | 4424 * static analysis will be returned. If no type analysis has been performed, t
hen the type |
5403 * 'dynamic' will be returned. | 4425 * 'dynamic' will be returned. |
5404 * | 4426 * |
5405 * @return the best type information available for this expression | 4427 * @return the best type information available for this expression |
5406 */ | 4428 */ |
5407 Type2 get bestType { | 4429 Type2 get bestType { |
5408 if (_propagatedType != null) { | 4430 if (propagatedType != null) { |
5409 return _propagatedType; | 4431 return propagatedType; |
5410 } else if (_staticType != null) { | 4432 } else if (staticType != null) { |
5411 return _staticType; | 4433 return staticType; |
5412 } | 4434 } |
5413 return DynamicTypeImpl.instance; | 4435 return DynamicTypeImpl.instance; |
5414 } | 4436 } |
5415 | 4437 |
5416 /** | 4438 /** |
5417 * If this expression is an argument to an invocation, and the AST structure h
as been resolved, | 4439 * If this expression is an argument to an invocation, and the AST structure h
as been resolved, |
5418 * and the function being invoked is known based on propagated type informatio
n, and this | 4440 * and the function being invoked is known based on propagated type informatio
n, and this |
5419 * expression corresponds to one of the parameters of the function being invok
ed, then return the | 4441 * expression corresponds to one of the parameters of the function being invok
ed, then return the |
5420 * parameter element representing the parameter to which the value of this exp
ression will be | 4442 * parameter element representing the parameter to which the value of this exp
ression will be |
5421 * bound. Otherwise, return `null`. | 4443 * bound. Otherwise, return `null`. |
(...skipping 22 matching lines...) Expand all Loading... |
5444 } | 4466 } |
5445 } else if (parent is PrefixExpression) { | 4467 } else if (parent is PrefixExpression) { |
5446 return ((parent as PrefixExpression)).propagatedParameterElementForOperand
; | 4468 return ((parent as PrefixExpression)).propagatedParameterElementForOperand
; |
5447 } else if (parent is PostfixExpression) { | 4469 } else if (parent is PostfixExpression) { |
5448 return ((parent as PostfixExpression)).propagatedParameterElementForOperan
d; | 4470 return ((parent as PostfixExpression)).propagatedParameterElementForOperan
d; |
5449 } | 4471 } |
5450 return null; | 4472 return null; |
5451 } | 4473 } |
5452 | 4474 |
5453 /** | 4475 /** |
5454 * Return the propagated type of this expression, or `null` if type propagatio
n has not been | |
5455 * performed on the AST structure. | |
5456 * | |
5457 * @return the propagated type of this expression | |
5458 */ | |
5459 Type2 get propagatedType => _propagatedType; | |
5460 | |
5461 /** | |
5462 * If this expression is an argument to an invocation, and the AST structure h
as been resolved, | 4476 * If this expression is an argument to an invocation, and the AST structure h
as been resolved, |
5463 * and the function being invoked is known based on static type information, a
nd this expression | 4477 * and the function being invoked is known based on static type information, a
nd this expression |
5464 * corresponds to one of the parameters of the function being invoked, then re
turn the parameter | 4478 * corresponds to one of the parameters of the function being invoked, then re
turn the parameter |
5465 * element representing the parameter to which the value of this expression wi
ll be bound. | 4479 * element representing the parameter to which the value of this expression wi
ll be bound. |
5466 * Otherwise, return `null`. | 4480 * Otherwise, return `null`. |
5467 * | 4481 * |
5468 * @return the parameter element representing the parameter to which the value
of this expression | 4482 * @return the parameter element representing the parameter to which the value
of this expression |
5469 * will be bound | 4483 * will be bound |
5470 */ | 4484 */ |
5471 ParameterElement get staticParameterElement { | 4485 ParameterElement get staticParameterElement { |
(...skipping 17 matching lines...) Expand all Loading... |
5489 } | 4503 } |
5490 } else if (parent is PrefixExpression) { | 4504 } else if (parent is PrefixExpression) { |
5491 return ((parent as PrefixExpression)).staticParameterElementForOperand; | 4505 return ((parent as PrefixExpression)).staticParameterElementForOperand; |
5492 } else if (parent is PostfixExpression) { | 4506 } else if (parent is PostfixExpression) { |
5493 return ((parent as PostfixExpression)).staticParameterElementForOperand; | 4507 return ((parent as PostfixExpression)).staticParameterElementForOperand; |
5494 } | 4508 } |
5495 return null; | 4509 return null; |
5496 } | 4510 } |
5497 | 4511 |
5498 /** | 4512 /** |
5499 * Return the static type of this expression, or `null` if the AST structure h
as not been | |
5500 * resolved. | |
5501 * | |
5502 * @return the static type of this expression | |
5503 */ | |
5504 Type2 get staticType => _staticType; | |
5505 | |
5506 /** | |
5507 * Return `true` if this expression is syntactically valid for the LHS of an | 4513 * Return `true` if this expression is syntactically valid for the LHS of an |
5508 * [AssignmentExpression]. | 4514 * [AssignmentExpression]. |
5509 * | 4515 * |
5510 * @return `true` if this expression matches the `assignableExpression` produc
tion | 4516 * @return `true` if this expression matches the `assignableExpression` produc
tion |
5511 */ | 4517 */ |
5512 bool get isAssignable => false; | 4518 bool get isAssignable => false; |
5513 | |
5514 /** | |
5515 * Set the propagated type of this expression to the given type. | |
5516 * | |
5517 * @param propagatedType the propagated type of this expression | |
5518 */ | |
5519 void set propagatedType(Type2 propagatedType2) { | |
5520 this._propagatedType = propagatedType2; | |
5521 } | |
5522 | |
5523 /** | |
5524 * Set the static type of this expression to the given type. | |
5525 * | |
5526 * @param staticType the static type of this expression | |
5527 */ | |
5528 void set staticType(Type2 staticType2) { | |
5529 this._staticType = staticType2; | |
5530 } | |
5531 } | 4519 } |
5532 /** | 4520 /** |
5533 * Instances of the class `ExpressionFunctionBody` represent a function body con
sisting of a | 4521 * Instances of the class `ExpressionFunctionBody` represent a function body con
sisting of a |
5534 * single expression. | 4522 * single expression. |
5535 * | 4523 * |
5536 * <pre> | 4524 * <pre> |
5537 * expressionFunctionBody ::= | 4525 * expressionFunctionBody ::= |
5538 * '=>' [Expression] ';' | 4526 * '=>' [Expression] ';' |
5539 * </pre> | 4527 * </pre> |
5540 * | 4528 * |
5541 * @coverage dart.engine.ast | 4529 * @coverage dart.engine.ast |
5542 */ | 4530 */ |
5543 class ExpressionFunctionBody extends FunctionBody { | 4531 class ExpressionFunctionBody extends FunctionBody { |
5544 | 4532 |
5545 /** | 4533 /** |
5546 * The token introducing the expression that represents the body of the functi
on. | 4534 * The token introducing the expression that represents the body of the functi
on. |
5547 */ | 4535 */ |
5548 Token _functionDefinition; | 4536 Token functionDefinition; |
5549 | 4537 |
5550 /** | 4538 /** |
5551 * The expression representing the body of the function. | 4539 * The expression representing the body of the function. |
5552 */ | 4540 */ |
5553 Expression _expression; | 4541 Expression _expression; |
5554 | 4542 |
5555 /** | 4543 /** |
5556 * The semicolon terminating the statement. | 4544 * The semicolon terminating the statement. |
5557 */ | 4545 */ |
5558 Token _semicolon; | 4546 Token semicolon; |
5559 | 4547 |
5560 /** | 4548 /** |
5561 * Initialize a newly created function body consisting of a block of statement
s. | 4549 * Initialize a newly created function body consisting of a block of statement
s. |
5562 * | 4550 * |
5563 * @param functionDefinition the token introducing the expression that represe
nts the body of the | 4551 * @param functionDefinition the token introducing the expression that represe
nts the body of the |
5564 * function | 4552 * function |
5565 * @param expression the expression representing the body of the function | 4553 * @param expression the expression representing the body of the function |
5566 * @param semicolon the semicolon terminating the statement | 4554 * @param semicolon the semicolon terminating the statement |
5567 */ | 4555 */ |
5568 ExpressionFunctionBody.full(Token functionDefinition, Expression expression, T
oken semicolon) { | 4556 ExpressionFunctionBody.full(Token functionDefinition, Expression expression, T
oken semicolon) { |
5569 this._functionDefinition = functionDefinition; | 4557 this.functionDefinition = functionDefinition; |
5570 this._expression = becomeParentOf(expression); | 4558 this._expression = becomeParentOf(expression); |
5571 this._semicolon = semicolon; | 4559 this.semicolon = semicolon; |
5572 } | 4560 } |
5573 | 4561 |
5574 /** | 4562 /** |
5575 * Initialize a newly created function body consisting of a block of statement
s. | 4563 * Initialize a newly created function body consisting of a block of statement
s. |
5576 * | 4564 * |
5577 * @param functionDefinition the token introducing the expression that represe
nts the body of the | 4565 * @param functionDefinition the token introducing the expression that represe
nts the body of the |
5578 * function | 4566 * function |
5579 * @param expression the expression representing the body of the function | 4567 * @param expression the expression representing the body of the function |
5580 * @param semicolon the semicolon terminating the statement | 4568 * @param semicolon the semicolon terminating the statement |
5581 */ | 4569 */ |
5582 ExpressionFunctionBody({Token functionDefinition, Expression expression, Token
semicolon}) : this.full(functionDefinition, expression, semicolon); | 4570 ExpressionFunctionBody({Token functionDefinition, Expression expression, Token
semicolon}) : this.full(functionDefinition, expression, semicolon); |
5583 accept(ASTVisitor visitor) => visitor.visitExpressionFunctionBody(this); | 4571 accept(ASTVisitor visitor) => visitor.visitExpressionFunctionBody(this); |
5584 Token get beginToken => _functionDefinition; | 4572 Token get beginToken => functionDefinition; |
5585 Token get endToken { | 4573 Token get endToken { |
5586 if (_semicolon != null) { | 4574 if (semicolon != null) { |
5587 return _semicolon; | 4575 return semicolon; |
5588 } | 4576 } |
5589 return _expression.endToken; | 4577 return _expression.endToken; |
5590 } | 4578 } |
5591 | 4579 |
5592 /** | 4580 /** |
5593 * Return the expression representing the body of the function. | 4581 * Return the expression representing the body of the function. |
5594 * | 4582 * |
5595 * @return the expression representing the body of the function | 4583 * @return the expression representing the body of the function |
5596 */ | 4584 */ |
5597 Expression get expression => _expression; | 4585 Expression get expression => _expression; |
5598 | 4586 |
5599 /** | 4587 /** |
5600 * Return the token introducing the expression that represents the body of the
function. | |
5601 * | |
5602 * @return the function definition token | |
5603 */ | |
5604 Token get functionDefinition => _functionDefinition; | |
5605 | |
5606 /** | |
5607 * Return the semicolon terminating the statement. | |
5608 * | |
5609 * @return the semicolon terminating the statement | |
5610 */ | |
5611 Token get semicolon => _semicolon; | |
5612 | |
5613 /** | |
5614 * Set the expression representing the body of the function to the given expre
ssion. | 4588 * Set the expression representing the body of the function to the given expre
ssion. |
5615 * | 4589 * |
5616 * @param expression the expression representing the body of the function | 4590 * @param expression the expression representing the body of the function |
5617 */ | 4591 */ |
5618 void set expression(Expression expression2) { | 4592 void set expression(Expression expression2) { |
5619 this._expression = becomeParentOf(expression2); | 4593 this._expression = becomeParentOf(expression2); |
5620 } | 4594 } |
5621 | |
5622 /** | |
5623 * Set the token introducing the expression that represents the body of the fu
nction to the given | |
5624 * token. | |
5625 * | |
5626 * @param functionDefinition the function definition token | |
5627 */ | |
5628 void set functionDefinition(Token functionDefinition2) { | |
5629 this._functionDefinition = functionDefinition2; | |
5630 } | |
5631 | |
5632 /** | |
5633 * Set the semicolon terminating the statement to the given token. | |
5634 * | |
5635 * @param semicolon the semicolon terminating the statement | |
5636 */ | |
5637 void set semicolon(Token semicolon2) { | |
5638 this._semicolon = semicolon2; | |
5639 } | |
5640 void visitChildren(ASTVisitor visitor) { | 4595 void visitChildren(ASTVisitor visitor) { |
5641 safelyVisitChild(_expression, visitor); | 4596 safelyVisitChild(_expression, visitor); |
5642 } | 4597 } |
5643 } | 4598 } |
5644 /** | 4599 /** |
5645 * Instances of the class `ExpressionStatement` wrap an expression as a statemen
t. | 4600 * Instances of the class `ExpressionStatement` wrap an expression as a statemen
t. |
5646 * | 4601 * |
5647 * <pre> | 4602 * <pre> |
5648 * expressionStatement ::= | 4603 * expressionStatement ::= |
5649 * [Expression]? ';' | 4604 * [Expression]? ';' |
5650 * </pre> | 4605 * </pre> |
5651 * | 4606 * |
5652 * @coverage dart.engine.ast | 4607 * @coverage dart.engine.ast |
5653 */ | 4608 */ |
5654 class ExpressionStatement extends Statement { | 4609 class ExpressionStatement extends Statement { |
5655 | 4610 |
5656 /** | 4611 /** |
5657 * The expression that comprises the statement. | 4612 * The expression that comprises the statement. |
5658 */ | 4613 */ |
5659 Expression _expression; | 4614 Expression _expression; |
5660 | 4615 |
5661 /** | 4616 /** |
5662 * The semicolon terminating the statement, or `null` if the expression is a f
unction | 4617 * The semicolon terminating the statement, or `null` if the expression is a f
unction |
5663 * expression and therefore isn't followed by a semicolon. | 4618 * expression and therefore isn't followed by a semicolon. |
5664 */ | 4619 */ |
5665 Token _semicolon; | 4620 Token semicolon; |
5666 | 4621 |
5667 /** | 4622 /** |
5668 * Initialize a newly created expression statement. | 4623 * Initialize a newly created expression statement. |
5669 * | 4624 * |
5670 * @param expression the expression that comprises the statement | 4625 * @param expression the expression that comprises the statement |
5671 * @param semicolon the semicolon terminating the statement | 4626 * @param semicolon the semicolon terminating the statement |
5672 */ | 4627 */ |
5673 ExpressionStatement.full(Expression expression, Token semicolon) { | 4628 ExpressionStatement.full(Expression expression, Token semicolon) { |
5674 this._expression = becomeParentOf(expression); | 4629 this._expression = becomeParentOf(expression); |
5675 this._semicolon = semicolon; | 4630 this.semicolon = semicolon; |
5676 } | 4631 } |
5677 | 4632 |
5678 /** | 4633 /** |
5679 * Initialize a newly created expression statement. | 4634 * Initialize a newly created expression statement. |
5680 * | 4635 * |
5681 * @param expression the expression that comprises the statement | 4636 * @param expression the expression that comprises the statement |
5682 * @param semicolon the semicolon terminating the statement | 4637 * @param semicolon the semicolon terminating the statement |
5683 */ | 4638 */ |
5684 ExpressionStatement({Expression expression, Token semicolon}) : this.full(expr
ession, semicolon); | 4639 ExpressionStatement({Expression expression, Token semicolon}) : this.full(expr
ession, semicolon); |
5685 accept(ASTVisitor visitor) => visitor.visitExpressionStatement(this); | 4640 accept(ASTVisitor visitor) => visitor.visitExpressionStatement(this); |
5686 Token get beginToken => _expression.beginToken; | 4641 Token get beginToken => _expression.beginToken; |
5687 Token get endToken { | 4642 Token get endToken { |
5688 if (_semicolon != null) { | 4643 if (semicolon != null) { |
5689 return _semicolon; | 4644 return semicolon; |
5690 } | 4645 } |
5691 return _expression.endToken; | 4646 return _expression.endToken; |
5692 } | 4647 } |
5693 | 4648 |
5694 /** | 4649 /** |
5695 * Return the expression that comprises the statement. | 4650 * Return the expression that comprises the statement. |
5696 * | 4651 * |
5697 * @return the expression that comprises the statement | 4652 * @return the expression that comprises the statement |
5698 */ | 4653 */ |
5699 Expression get expression => _expression; | 4654 Expression get expression => _expression; |
5700 | 4655 bool get isSynthetic => _expression.isSynthetic && semicolon.isSynthetic; |
5701 /** | |
5702 * Return the semicolon terminating the statement, or `null` if the expression
is a function | |
5703 * expression and therefore isn't followed by a semicolon. | |
5704 * | |
5705 * @return the semicolon terminating the statement | |
5706 */ | |
5707 Token get semicolon => _semicolon; | |
5708 bool get isSynthetic => _expression.isSynthetic && _semicolon.isSynthetic; | |
5709 | 4656 |
5710 /** | 4657 /** |
5711 * Set the expression that comprises the statement to the given expression. | 4658 * Set the expression that comprises the statement to the given expression. |
5712 * | 4659 * |
5713 * @param expression the expression that comprises the statement | 4660 * @param expression the expression that comprises the statement |
5714 */ | 4661 */ |
5715 void set expression(Expression expression2) { | 4662 void set expression(Expression expression2) { |
5716 this._expression = becomeParentOf(expression2); | 4663 this._expression = becomeParentOf(expression2); |
5717 } | 4664 } |
5718 | |
5719 /** | |
5720 * Set the semicolon terminating the statement to the given token. | |
5721 * | |
5722 * @param semicolon the semicolon terminating the statement | |
5723 */ | |
5724 void set semicolon(Token semicolon2) { | |
5725 this._semicolon = semicolon2; | |
5726 } | |
5727 void visitChildren(ASTVisitor visitor) { | 4665 void visitChildren(ASTVisitor visitor) { |
5728 safelyVisitChild(_expression, visitor); | 4666 safelyVisitChild(_expression, visitor); |
5729 } | 4667 } |
5730 } | 4668 } |
5731 /** | 4669 /** |
5732 * Instances of the class `ExtendsClause` represent the "extends" clause in a cl
ass | 4670 * Instances of the class `ExtendsClause` represent the "extends" clause in a cl
ass |
5733 * declaration. | 4671 * declaration. |
5734 * | 4672 * |
5735 * <pre> | 4673 * <pre> |
5736 * extendsClause ::= | 4674 * extendsClause ::= |
5737 * 'extends' [TypeName] | 4675 * 'extends' [TypeName] |
5738 * </pre> | 4676 * </pre> |
5739 * | 4677 * |
5740 * @coverage dart.engine.ast | 4678 * @coverage dart.engine.ast |
5741 */ | 4679 */ |
5742 class ExtendsClause extends ASTNode { | 4680 class ExtendsClause extends ASTNode { |
5743 | 4681 |
5744 /** | 4682 /** |
5745 * The token representing the 'extends' keyword. | 4683 * The token representing the 'extends' keyword. |
5746 */ | 4684 */ |
5747 Token _keyword; | 4685 Token keyword; |
5748 | 4686 |
5749 /** | 4687 /** |
5750 * The name of the class that is being extended. | 4688 * The name of the class that is being extended. |
5751 */ | 4689 */ |
5752 TypeName _superclass; | 4690 TypeName _superclass; |
5753 | 4691 |
5754 /** | 4692 /** |
5755 * Initialize a newly created extends clause. | 4693 * Initialize a newly created extends clause. |
5756 * | 4694 * |
5757 * @param keyword the token representing the 'extends' keyword | 4695 * @param keyword the token representing the 'extends' keyword |
5758 * @param superclass the name of the class that is being extended | 4696 * @param superclass the name of the class that is being extended |
5759 */ | 4697 */ |
5760 ExtendsClause.full(Token keyword, TypeName superclass) { | 4698 ExtendsClause.full(Token keyword, TypeName superclass) { |
5761 this._keyword = keyword; | 4699 this.keyword = keyword; |
5762 this._superclass = becomeParentOf(superclass); | 4700 this._superclass = becomeParentOf(superclass); |
5763 } | 4701 } |
5764 | 4702 |
5765 /** | 4703 /** |
5766 * Initialize a newly created extends clause. | 4704 * Initialize a newly created extends clause. |
5767 * | 4705 * |
5768 * @param keyword the token representing the 'extends' keyword | 4706 * @param keyword the token representing the 'extends' keyword |
5769 * @param superclass the name of the class that is being extended | 4707 * @param superclass the name of the class that is being extended |
5770 */ | 4708 */ |
5771 ExtendsClause({Token keyword, TypeName superclass}) : this.full(keyword, super
class); | 4709 ExtendsClause({Token keyword, TypeName superclass}) : this.full(keyword, super
class); |
5772 accept(ASTVisitor visitor) => visitor.visitExtendsClause(this); | 4710 accept(ASTVisitor visitor) => visitor.visitExtendsClause(this); |
5773 Token get beginToken => _keyword; | 4711 Token get beginToken => keyword; |
5774 Token get endToken => _superclass.endToken; | 4712 Token get endToken => _superclass.endToken; |
5775 | 4713 |
5776 /** | 4714 /** |
5777 * Return the token representing the 'extends' keyword. | |
5778 * | |
5779 * @return the token representing the 'extends' keyword | |
5780 */ | |
5781 Token get keyword => _keyword; | |
5782 | |
5783 /** | |
5784 * Return the name of the class that is being extended. | 4715 * Return the name of the class that is being extended. |
5785 * | 4716 * |
5786 * @return the name of the class that is being extended | 4717 * @return the name of the class that is being extended |
5787 */ | 4718 */ |
5788 TypeName get superclass => _superclass; | 4719 TypeName get superclass => _superclass; |
5789 | 4720 |
5790 /** | 4721 /** |
5791 * Set the token representing the 'extends' keyword to the given token. | |
5792 * | |
5793 * @param keyword the token representing the 'extends' keyword | |
5794 */ | |
5795 void set keyword(Token keyword2) { | |
5796 this._keyword = keyword2; | |
5797 } | |
5798 | |
5799 /** | |
5800 * Set the name of the class that is being extended to the given name. | 4722 * Set the name of the class that is being extended to the given name. |
5801 * | 4723 * |
5802 * @param name the name of the class that is being extended | 4724 * @param name the name of the class that is being extended |
5803 */ | 4725 */ |
5804 void set superclass(TypeName name) { | 4726 void set superclass(TypeName name) { |
5805 _superclass = becomeParentOf(name); | 4727 _superclass = becomeParentOf(name); |
5806 } | 4728 } |
5807 void visitChildren(ASTVisitor visitor) { | 4729 void visitChildren(ASTVisitor visitor) { |
5808 safelyVisitChild(_superclass, visitor); | 4730 safelyVisitChild(_superclass, visitor); |
5809 } | 4731 } |
5810 } | 4732 } |
5811 /** | 4733 /** |
5812 * Instances of the class `FieldDeclaration` represent the declaration of one or
more fields | 4734 * Instances of the class `FieldDeclaration` represent the declaration of one or
more fields |
5813 * of the same type. | 4735 * of the same type. |
5814 * | 4736 * |
5815 * <pre> | 4737 * <pre> |
5816 * fieldDeclaration ::= | 4738 * fieldDeclaration ::= |
5817 * 'static'? [VariableDeclarationList] ';' | 4739 * 'static'? [VariableDeclarationList] ';' |
5818 * </pre> | 4740 * </pre> |
5819 * | 4741 * |
5820 * @coverage dart.engine.ast | 4742 * @coverage dart.engine.ast |
5821 */ | 4743 */ |
5822 class FieldDeclaration extends ClassMember { | 4744 class FieldDeclaration extends ClassMember { |
5823 | 4745 |
5824 /** | 4746 /** |
5825 * The token representing the 'static' keyword, or `null` if the fields are no
t static. | 4747 * The token representing the 'static' keyword, or `null` if the fields are no
t static. |
5826 */ | 4748 */ |
5827 Token _staticKeyword; | 4749 Token staticKeyword; |
5828 | 4750 |
5829 /** | 4751 /** |
5830 * The fields being declared. | 4752 * The fields being declared. |
5831 */ | 4753 */ |
5832 VariableDeclarationList _fieldList; | 4754 VariableDeclarationList _fieldList; |
5833 | 4755 |
5834 /** | 4756 /** |
5835 * The semicolon terminating the declaration. | 4757 * The semicolon terminating the declaration. |
5836 */ | 4758 */ |
5837 Token _semicolon; | 4759 Token semicolon; |
5838 | 4760 |
5839 /** | 4761 /** |
5840 * Initialize a newly created field declaration. | 4762 * Initialize a newly created field declaration. |
5841 * | 4763 * |
5842 * @param comment the documentation comment associated with this field | 4764 * @param comment the documentation comment associated with this field |
5843 * @param metadata the annotations associated with this field | 4765 * @param metadata the annotations associated with this field |
5844 * @param staticKeyword the token representing the 'static' keyword | 4766 * @param staticKeyword the token representing the 'static' keyword |
5845 * @param fieldList the fields being declared | 4767 * @param fieldList the fields being declared |
5846 * @param semicolon the semicolon terminating the declaration | 4768 * @param semicolon the semicolon terminating the declaration |
5847 */ | 4769 */ |
5848 FieldDeclaration.full(Comment comment, List<Annotation> metadata, Token static
Keyword, VariableDeclarationList fieldList, Token semicolon) : super.full(commen
t, metadata) { | 4770 FieldDeclaration.full(Comment comment, List<Annotation> metadata, Token static
Keyword, VariableDeclarationList fieldList, Token semicolon) : super.full(commen
t, metadata) { |
5849 this._staticKeyword = staticKeyword; | 4771 this.staticKeyword = staticKeyword; |
5850 this._fieldList = becomeParentOf(fieldList); | 4772 this._fieldList = becomeParentOf(fieldList); |
5851 this._semicolon = semicolon; | 4773 this.semicolon = semicolon; |
5852 } | 4774 } |
5853 | 4775 |
5854 /** | 4776 /** |
5855 * Initialize a newly created field declaration. | 4777 * Initialize a newly created field declaration. |
5856 * | 4778 * |
5857 * @param comment the documentation comment associated with this field | 4779 * @param comment the documentation comment associated with this field |
5858 * @param metadata the annotations associated with this field | 4780 * @param metadata the annotations associated with this field |
5859 * @param staticKeyword the token representing the 'static' keyword | 4781 * @param staticKeyword the token representing the 'static' keyword |
5860 * @param fieldList the fields being declared | 4782 * @param fieldList the fields being declared |
5861 * @param semicolon the semicolon terminating the declaration | 4783 * @param semicolon the semicolon terminating the declaration |
5862 */ | 4784 */ |
5863 FieldDeclaration({Comment comment, List<Annotation> metadata, Token staticKeyw
ord, VariableDeclarationList fieldList, Token semicolon}) : this.full(comment, m
etadata, staticKeyword, fieldList, semicolon); | 4785 FieldDeclaration({Comment comment, List<Annotation> metadata, Token staticKeyw
ord, VariableDeclarationList fieldList, Token semicolon}) : this.full(comment, m
etadata, staticKeyword, fieldList, semicolon); |
5864 accept(ASTVisitor visitor) => visitor.visitFieldDeclaration(this); | 4786 accept(ASTVisitor visitor) => visitor.visitFieldDeclaration(this); |
5865 Element get element => null; | 4787 Element get element => null; |
5866 Token get endToken => _semicolon; | 4788 Token get endToken => semicolon; |
5867 | 4789 |
5868 /** | 4790 /** |
5869 * Return the fields being declared. | 4791 * Return the fields being declared. |
5870 * | 4792 * |
5871 * @return the fields being declared | 4793 * @return the fields being declared |
5872 */ | 4794 */ |
5873 VariableDeclarationList get fields => _fieldList; | 4795 VariableDeclarationList get fields => _fieldList; |
5874 | 4796 |
5875 /** | 4797 /** |
5876 * Return the token representing the 'static' keyword, or `null` if the fields
are not | |
5877 * static. | |
5878 * | |
5879 * @return the token representing the 'static' keyword | |
5880 */ | |
5881 Token get staticKeyword => _staticKeyword; | |
5882 | |
5883 /** | |
5884 * Return the semicolon terminating the declaration. | |
5885 * | |
5886 * @return the semicolon terminating the declaration | |
5887 */ | |
5888 Token get semicolon => _semicolon; | |
5889 | |
5890 /** | |
5891 * Return `true` if the fields are static. | 4798 * Return `true` if the fields are static. |
5892 * | 4799 * |
5893 * @return `true` if the fields are declared to be static | 4800 * @return `true` if the fields are declared to be static |
5894 */ | 4801 */ |
5895 bool get isStatic => _staticKeyword != null; | 4802 bool get isStatic => staticKeyword != null; |
5896 | 4803 |
5897 /** | 4804 /** |
5898 * Set the fields being declared to the given list of variables. | 4805 * Set the fields being declared to the given list of variables. |
5899 * | 4806 * |
5900 * @param fieldList the fields being declared | 4807 * @param fieldList the fields being declared |
5901 */ | 4808 */ |
5902 void set fields(VariableDeclarationList fieldList) { | 4809 void set fields(VariableDeclarationList fieldList) { |
5903 fieldList = becomeParentOf(fieldList); | 4810 fieldList = becomeParentOf(fieldList); |
5904 } | 4811 } |
5905 | |
5906 /** | |
5907 * Set the token representing the 'static' keyword to the given token. | |
5908 * | |
5909 * @param keyword the token representing the 'static' keyword | |
5910 */ | |
5911 void set staticKeyword(Token keyword) { | |
5912 this._staticKeyword = keyword; | |
5913 } | |
5914 | |
5915 /** | |
5916 * Set the semicolon terminating the declaration to the given token. | |
5917 * | |
5918 * @param semicolon the semicolon terminating the declaration | |
5919 */ | |
5920 void set semicolon(Token semicolon2) { | |
5921 this._semicolon = semicolon2; | |
5922 } | |
5923 void visitChildren(ASTVisitor visitor) { | 4812 void visitChildren(ASTVisitor visitor) { |
5924 super.visitChildren(visitor); | 4813 super.visitChildren(visitor); |
5925 safelyVisitChild(_fieldList, visitor); | 4814 safelyVisitChild(_fieldList, visitor); |
5926 } | 4815 } |
5927 Token get firstTokenAfterCommentAndMetadata { | 4816 Token get firstTokenAfterCommentAndMetadata { |
5928 if (_staticKeyword != null) { | 4817 if (staticKeyword != null) { |
5929 return _staticKeyword; | 4818 return staticKeyword; |
5930 } | 4819 } |
5931 return _fieldList.beginToken; | 4820 return _fieldList.beginToken; |
5932 } | 4821 } |
5933 } | 4822 } |
5934 /** | 4823 /** |
5935 * Instances of the class `FieldFormalParameter` represent a field formal parame
ter. | 4824 * Instances of the class `FieldFormalParameter` represent a field formal parame
ter. |
5936 * | 4825 * |
5937 * <pre> | 4826 * <pre> |
5938 * fieldFormalParameter ::= | 4827 * fieldFormalParameter ::= |
5939 * ('final' [TypeName] | 'const' [TypeName] | 'var' | [TypeName])? 'this' '.
' [SimpleIdentifier] [FormalParameterList]? | 4828 * ('final' [TypeName] | 'const' [TypeName] | 'var' | [TypeName])? 'this' '.
' [SimpleIdentifier] [FormalParameterList]? |
5940 * </pre> | 4829 * </pre> |
5941 * | 4830 * |
5942 * @coverage dart.engine.ast | 4831 * @coverage dart.engine.ast |
5943 */ | 4832 */ |
5944 class FieldFormalParameter extends NormalFormalParameter { | 4833 class FieldFormalParameter extends NormalFormalParameter { |
5945 | 4834 |
5946 /** | 4835 /** |
5947 * The token representing either the 'final', 'const' or 'var' keyword, or `nu
ll` if no | 4836 * The token representing either the 'final', 'const' or 'var' keyword, or `nu
ll` if no |
5948 * keyword was used. | 4837 * keyword was used. |
5949 */ | 4838 */ |
5950 Token _keyword; | 4839 Token keyword; |
5951 | 4840 |
5952 /** | 4841 /** |
5953 * The name of the declared type of the parameter, or `null` if the parameter
does not have | 4842 * The name of the declared type of the parameter, or `null` if the parameter
does not have |
5954 * a declared type. | 4843 * a declared type. |
5955 */ | 4844 */ |
5956 TypeName _type; | 4845 TypeName _type; |
5957 | 4846 |
5958 /** | 4847 /** |
5959 * The token representing the 'this' keyword. | 4848 * The token representing the 'this' keyword. |
5960 */ | 4849 */ |
5961 Token _thisToken; | 4850 Token thisToken; |
5962 | 4851 |
5963 /** | 4852 /** |
5964 * The token representing the period. | 4853 * The token representing the period. |
5965 */ | 4854 */ |
5966 Token _period; | 4855 Token period; |
5967 | 4856 |
5968 /** | 4857 /** |
5969 * The parameters of the function-typed parameter, or `null` if this is not a
function-typed | 4858 * The parameters of the function-typed parameter, or `null` if this is not a
function-typed |
5970 * field formal parameter. | 4859 * field formal parameter. |
5971 */ | 4860 */ |
5972 FormalParameterList _parameters; | 4861 FormalParameterList _parameters; |
5973 | 4862 |
5974 /** | 4863 /** |
5975 * Initialize a newly created formal parameter. | 4864 * Initialize a newly created formal parameter. |
5976 * | 4865 * |
5977 * @param comment the documentation comment associated with this parameter | 4866 * @param comment the documentation comment associated with this parameter |
5978 * @param metadata the annotations associated with this parameter | 4867 * @param metadata the annotations associated with this parameter |
5979 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword | 4868 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword |
5980 * @param type the name of the declared type of the parameter | 4869 * @param type the name of the declared type of the parameter |
5981 * @param thisToken the token representing the 'this' keyword | 4870 * @param thisToken the token representing the 'this' keyword |
5982 * @param period the token representing the period | 4871 * @param period the token representing the period |
5983 * @param identifier the name of the parameter being declared | 4872 * @param identifier the name of the parameter being declared |
5984 * @param parameters the parameters of the function-typed parameter, or `null`
if this is | 4873 * @param parameters the parameters of the function-typed parameter, or `null`
if this is |
5985 * not a function-typed field formal parameter | 4874 * not a function-typed field formal parameter |
5986 */ | 4875 */ |
5987 FieldFormalParameter.full(Comment comment, List<Annotation> metadata, Token ke
yword, TypeName type, Token thisToken, Token period, SimpleIdentifier identifier
, FormalParameterList parameters) : super.full(comment, metadata, identifier) { | 4876 FieldFormalParameter.full(Comment comment, List<Annotation> metadata, Token ke
yword, TypeName type, Token thisToken, Token period, SimpleIdentifier identifier
, FormalParameterList parameters) : super.full(comment, metadata, identifier) { |
5988 this._keyword = keyword; | 4877 this.keyword = keyword; |
5989 this._type = becomeParentOf(type); | 4878 this._type = becomeParentOf(type); |
5990 this._thisToken = thisToken; | 4879 this.thisToken = thisToken; |
5991 this._period = period; | 4880 this.period = period; |
5992 this._parameters = becomeParentOf(parameters); | 4881 this._parameters = becomeParentOf(parameters); |
5993 } | 4882 } |
5994 | 4883 |
5995 /** | 4884 /** |
5996 * Initialize a newly created formal parameter. | 4885 * Initialize a newly created formal parameter. |
5997 * | 4886 * |
5998 * @param comment the documentation comment associated with this parameter | 4887 * @param comment the documentation comment associated with this parameter |
5999 * @param metadata the annotations associated with this parameter | 4888 * @param metadata the annotations associated with this parameter |
6000 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword | 4889 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword |
6001 * @param type the name of the declared type of the parameter | 4890 * @param type the name of the declared type of the parameter |
6002 * @param thisToken the token representing the 'this' keyword | 4891 * @param thisToken the token representing the 'this' keyword |
6003 * @param period the token representing the period | 4892 * @param period the token representing the period |
6004 * @param identifier the name of the parameter being declared | 4893 * @param identifier the name of the parameter being declared |
6005 * @param parameters the parameters of the function-typed parameter, or `null`
if this is | 4894 * @param parameters the parameters of the function-typed parameter, or `null`
if this is |
6006 * not a function-typed field formal parameter | 4895 * not a function-typed field formal parameter |
6007 */ | 4896 */ |
6008 FieldFormalParameter({Comment comment, List<Annotation> metadata, Token keywor
d, TypeName type, Token thisToken, Token period, SimpleIdentifier identifier, Fo
rmalParameterList parameters}) : this.full(comment, metadata, keyword, type, thi
sToken, period, identifier, parameters); | 4897 FieldFormalParameter({Comment comment, List<Annotation> metadata, Token keywor
d, TypeName type, Token thisToken, Token period, SimpleIdentifier identifier, Fo
rmalParameterList parameters}) : this.full(comment, metadata, keyword, type, thi
sToken, period, identifier, parameters); |
6009 accept(ASTVisitor visitor) => visitor.visitFieldFormalParameter(this); | 4898 accept(ASTVisitor visitor) => visitor.visitFieldFormalParameter(this); |
6010 Token get beginToken { | 4899 Token get beginToken { |
6011 if (_keyword != null) { | 4900 if (keyword != null) { |
6012 return _keyword; | 4901 return keyword; |
6013 } else if (_type != null) { | 4902 } else if (_type != null) { |
6014 return _type.beginToken; | 4903 return _type.beginToken; |
6015 } | 4904 } |
6016 return _thisToken; | 4905 return thisToken; |
6017 } | 4906 } |
6018 Token get endToken => identifier.endToken; | 4907 Token get endToken => identifier.endToken; |
6019 | 4908 |
6020 /** | 4909 /** |
6021 * Return the token representing either the 'final', 'const' or 'var' keyword,
or `null` if | |
6022 * no keyword was used. | |
6023 * | |
6024 * @return the token representing either the 'final', 'const' or 'var' keyword | |
6025 */ | |
6026 Token get keyword => _keyword; | |
6027 | |
6028 /** | |
6029 * Return the parameters of the function-typed parameter, or `null` if this is
not a | 4910 * Return the parameters of the function-typed parameter, or `null` if this is
not a |
6030 * function-typed field formal parameter. | 4911 * function-typed field formal parameter. |
6031 * | 4912 * |
6032 * @return the parameters of the function-typed parameter | 4913 * @return the parameters of the function-typed parameter |
6033 */ | 4914 */ |
6034 FormalParameterList get parameters => _parameters; | 4915 FormalParameterList get parameters => _parameters; |
6035 | 4916 |
6036 /** | 4917 /** |
6037 * Return the token representing the period. | |
6038 * | |
6039 * @return the token representing the period | |
6040 */ | |
6041 Token get period => _period; | |
6042 | |
6043 /** | |
6044 * Return the token representing the 'this' keyword. | |
6045 * | |
6046 * @return the token representing the 'this' keyword | |
6047 */ | |
6048 Token get thisToken => _thisToken; | |
6049 | |
6050 /** | |
6051 * Return the name of the declared type of the parameter, or `null` if the par
ameter does | 4918 * Return the name of the declared type of the parameter, or `null` if the par
ameter does |
6052 * not have a declared type. Note that if this is a function-typed field forma
l parameter this is | 4919 * not have a declared type. Note that if this is a function-typed field forma
l parameter this is |
6053 * the return type of the function. | 4920 * the return type of the function. |
6054 * | 4921 * |
6055 * @return the name of the declared type of the parameter | 4922 * @return the name of the declared type of the parameter |
6056 */ | 4923 */ |
6057 TypeName get type => _type; | 4924 TypeName get type => _type; |
6058 bool get isConst => (_keyword is KeywordToken) && identical(((_keyword as Keyw
ordToken)).keyword, Keyword.CONST); | 4925 bool get isConst => (keyword is KeywordToken) && identical(((keyword as Keywor
dToken)).keyword, Keyword.CONST); |
6059 bool get isFinal => (_keyword is KeywordToken) && identical(((_keyword as Keyw
ordToken)).keyword, Keyword.FINAL); | 4926 bool get isFinal => (keyword is KeywordToken) && identical(((keyword as Keywor
dToken)).keyword, Keyword.FINAL); |
6060 | |
6061 /** | |
6062 * Set the token representing either the 'final', 'const' or 'var' keyword to
the given token. | |
6063 * | |
6064 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword | |
6065 */ | |
6066 void set keyword(Token keyword2) { | |
6067 this._keyword = keyword2; | |
6068 } | |
6069 | 4927 |
6070 /** | 4928 /** |
6071 * Set the parameters of the function-typed parameter to the given parameters. | 4929 * Set the parameters of the function-typed parameter to the given parameters. |
6072 * | 4930 * |
6073 * @param parameters the parameters of the function-typed parameter | 4931 * @param parameters the parameters of the function-typed parameter |
6074 */ | 4932 */ |
6075 void set parameters(FormalParameterList parameters2) { | 4933 void set parameters(FormalParameterList parameters2) { |
6076 this._parameters = becomeParentOf(parameters2); | 4934 this._parameters = becomeParentOf(parameters2); |
6077 } | 4935 } |
6078 | 4936 |
6079 /** | 4937 /** |
6080 * Set the token representing the period to the given token. | |
6081 * | |
6082 * @param period the token representing the period | |
6083 */ | |
6084 void set period(Token period2) { | |
6085 this._period = period2; | |
6086 } | |
6087 | |
6088 /** | |
6089 * Set the token representing the 'this' keyword to the given token. | |
6090 * | |
6091 * @param thisToken the token representing the 'this' keyword | |
6092 */ | |
6093 void set thisToken(Token thisToken2) { | |
6094 this._thisToken = thisToken2; | |
6095 } | |
6096 | |
6097 /** | |
6098 * Set the name of the declared type of the parameter to the given type name. | 4938 * Set the name of the declared type of the parameter to the given type name. |
6099 * | 4939 * |
6100 * @param typeName the name of the declared type of the parameter | 4940 * @param typeName the name of the declared type of the parameter |
6101 */ | 4941 */ |
6102 void set type(TypeName typeName) { | 4942 void set type(TypeName typeName) { |
6103 _type = becomeParentOf(typeName); | 4943 _type = becomeParentOf(typeName); |
6104 } | 4944 } |
6105 void visitChildren(ASTVisitor visitor) { | 4945 void visitChildren(ASTVisitor visitor) { |
6106 super.visitChildren(visitor); | 4946 super.visitChildren(visitor); |
6107 safelyVisitChild(_type, visitor); | 4947 safelyVisitChild(_type, visitor); |
6108 safelyVisitChild(identifier, visitor); | 4948 safelyVisitChild(identifier, visitor); |
6109 safelyVisitChild(_parameters, visitor); | 4949 safelyVisitChild(_parameters, visitor); |
6110 } | 4950 } |
6111 } | 4951 } |
6112 /** | 4952 /** |
6113 * Instances of the class `ForEachStatement` represent a for-each statement. | 4953 * Instances of the class `ForEachStatement` represent a for-each statement. |
6114 * | 4954 * |
6115 * <pre> | 4955 * <pre> |
6116 * forEachStatement ::= | 4956 * forEachStatement ::= |
6117 * 'for' '(' [SimpleFormalParameter] 'in' [Expression] ')' [Block] | 4957 * 'for' '(' [SimpleFormalParameter] 'in' [Expression] ')' [Block] |
6118 * </pre> | 4958 * </pre> |
6119 * | 4959 * |
6120 * @coverage dart.engine.ast | 4960 * @coverage dart.engine.ast |
6121 */ | 4961 */ |
6122 class ForEachStatement extends Statement { | 4962 class ForEachStatement extends Statement { |
6123 | 4963 |
6124 /** | 4964 /** |
6125 * The token representing the 'for' keyword. | 4965 * The token representing the 'for' keyword. |
6126 */ | 4966 */ |
6127 Token _forKeyword; | 4967 Token forKeyword; |
6128 | 4968 |
6129 /** | 4969 /** |
6130 * The left parenthesis. | 4970 * The left parenthesis. |
6131 */ | 4971 */ |
6132 Token _leftParenthesis; | 4972 Token leftParenthesis; |
6133 | 4973 |
6134 /** | 4974 /** |
6135 * The declaration of the loop variable. | 4975 * The declaration of the loop variable. |
6136 */ | 4976 */ |
6137 DeclaredIdentifier _loopVariable; | 4977 DeclaredIdentifier _loopVariable; |
6138 | 4978 |
6139 /** | 4979 /** |
6140 * The token representing the 'in' keyword. | 4980 * The token representing the 'in' keyword. |
6141 */ | 4981 */ |
6142 Token _inKeyword; | 4982 Token inKeyword; |
6143 | 4983 |
6144 /** | 4984 /** |
6145 * The expression evaluated to produce the iterator. | 4985 * The expression evaluated to produce the iterator. |
6146 */ | 4986 */ |
6147 Expression _iterator; | 4987 Expression _iterator; |
6148 | 4988 |
6149 /** | 4989 /** |
6150 * The right parenthesis. | 4990 * The right parenthesis. |
6151 */ | 4991 */ |
6152 Token _rightParenthesis; | 4992 Token rightParenthesis; |
6153 | 4993 |
6154 /** | 4994 /** |
6155 * The body of the loop. | 4995 * The body of the loop. |
6156 */ | 4996 */ |
6157 Statement _body; | 4997 Statement _body; |
6158 | 4998 |
6159 /** | 4999 /** |
6160 * Initialize a newly created for-each statement. | 5000 * Initialize a newly created for-each statement. |
6161 * | 5001 * |
6162 * @param forKeyword the token representing the 'for' keyword | 5002 * @param forKeyword the token representing the 'for' keyword |
6163 * @param leftParenthesis the left parenthesis | 5003 * @param leftParenthesis the left parenthesis |
6164 * @param loopVariable the declaration of the loop variable | 5004 * @param loopVariable the declaration of the loop variable |
6165 * @param iterator the expression evaluated to produce the iterator | 5005 * @param iterator the expression evaluated to produce the iterator |
6166 * @param rightParenthesis the right parenthesis | 5006 * @param rightParenthesis the right parenthesis |
6167 * @param body the body of the loop | 5007 * @param body the body of the loop |
6168 */ | 5008 */ |
6169 ForEachStatement.full(Token forKeyword, Token leftParenthesis, DeclaredIdentif
ier loopVariable, Token inKeyword, Expression iterator, Token rightParenthesis,
Statement body) { | 5009 ForEachStatement.full(Token forKeyword, Token leftParenthesis, DeclaredIdentif
ier loopVariable, Token inKeyword, Expression iterator, Token rightParenthesis,
Statement body) { |
6170 this._forKeyword = forKeyword; | 5010 this.forKeyword = forKeyword; |
6171 this._leftParenthesis = leftParenthesis; | 5011 this.leftParenthesis = leftParenthesis; |
6172 this._loopVariable = becomeParentOf(loopVariable); | 5012 this._loopVariable = becomeParentOf(loopVariable); |
6173 this._inKeyword = inKeyword; | 5013 this.inKeyword = inKeyword; |
6174 this._iterator = becomeParentOf(iterator); | 5014 this._iterator = becomeParentOf(iterator); |
6175 this._rightParenthesis = rightParenthesis; | 5015 this.rightParenthesis = rightParenthesis; |
6176 this._body = becomeParentOf(body); | 5016 this._body = becomeParentOf(body); |
6177 } | 5017 } |
6178 | 5018 |
6179 /** | 5019 /** |
6180 * Initialize a newly created for-each statement. | 5020 * Initialize a newly created for-each statement. |
6181 * | 5021 * |
6182 * @param forKeyword the token representing the 'for' keyword | 5022 * @param forKeyword the token representing the 'for' keyword |
6183 * @param leftParenthesis the left parenthesis | 5023 * @param leftParenthesis the left parenthesis |
6184 * @param loopVariable the declaration of the loop variable | 5024 * @param loopVariable the declaration of the loop variable |
6185 * @param iterator the expression evaluated to produce the iterator | 5025 * @param iterator the expression evaluated to produce the iterator |
6186 * @param rightParenthesis the right parenthesis | 5026 * @param rightParenthesis the right parenthesis |
6187 * @param body the body of the loop | 5027 * @param body the body of the loop |
6188 */ | 5028 */ |
6189 ForEachStatement({Token forKeyword, Token leftParenthesis, DeclaredIdentifier
loopVariable, Token inKeyword, Expression iterator, Token rightParenthesis, Stat
ement body}) : this.full(forKeyword, leftParenthesis, loopVariable, inKeyword, i
terator, rightParenthesis, body); | 5029 ForEachStatement({Token forKeyword, Token leftParenthesis, DeclaredIdentifier
loopVariable, Token inKeyword, Expression iterator, Token rightParenthesis, Stat
ement body}) : this.full(forKeyword, leftParenthesis, loopVariable, inKeyword, i
terator, rightParenthesis, body); |
6190 accept(ASTVisitor visitor) => visitor.visitForEachStatement(this); | 5030 accept(ASTVisitor visitor) => visitor.visitForEachStatement(this); |
6191 Token get beginToken => _forKeyword; | 5031 Token get beginToken => forKeyword; |
6192 | 5032 |
6193 /** | 5033 /** |
6194 * Return the body of the loop. | 5034 * Return the body of the loop. |
6195 * | 5035 * |
6196 * @return the body of the loop | 5036 * @return the body of the loop |
6197 */ | 5037 */ |
6198 Statement get body => _body; | 5038 Statement get body => _body; |
6199 Token get endToken => _body.endToken; | 5039 Token get endToken => _body.endToken; |
6200 | 5040 |
6201 /** | 5041 /** |
6202 * Return the token representing the 'for' keyword. | |
6203 * | |
6204 * @return the token representing the 'for' keyword | |
6205 */ | |
6206 Token get forKeyword => _forKeyword; | |
6207 | |
6208 /** | |
6209 * Return the token representing the 'in' keyword. | |
6210 * | |
6211 * @return the token representing the 'in' keyword | |
6212 */ | |
6213 Token get inKeyword => _inKeyword; | |
6214 | |
6215 /** | |
6216 * Return the expression evaluated to produce the iterator. | 5042 * Return the expression evaluated to produce the iterator. |
6217 * | 5043 * |
6218 * @return the expression evaluated to produce the iterator | 5044 * @return the expression evaluated to produce the iterator |
6219 */ | 5045 */ |
6220 Expression get iterator => _iterator; | 5046 Expression get iterator => _iterator; |
6221 | 5047 |
6222 /** | 5048 /** |
6223 * Return the left parenthesis. | |
6224 * | |
6225 * @return the left parenthesis | |
6226 */ | |
6227 Token get leftParenthesis => _leftParenthesis; | |
6228 | |
6229 /** | |
6230 * Return the declaration of the loop variable. | 5049 * Return the declaration of the loop variable. |
6231 * | 5050 * |
6232 * @return the declaration of the loop variable | 5051 * @return the declaration of the loop variable |
6233 */ | 5052 */ |
6234 DeclaredIdentifier get loopVariable => _loopVariable; | 5053 DeclaredIdentifier get loopVariable => _loopVariable; |
6235 | 5054 |
6236 /** | 5055 /** |
6237 * Return the right parenthesis. | |
6238 * | |
6239 * @return the right parenthesis | |
6240 */ | |
6241 Token get rightParenthesis => _rightParenthesis; | |
6242 | |
6243 /** | |
6244 * Set the body of the loop to the given block. | 5056 * Set the body of the loop to the given block. |
6245 * | 5057 * |
6246 * @param body the body of the loop | 5058 * @param body the body of the loop |
6247 */ | 5059 */ |
6248 void set body(Statement body2) { | 5060 void set body(Statement body2) { |
6249 this._body = becomeParentOf(body2); | 5061 this._body = becomeParentOf(body2); |
6250 } | 5062 } |
6251 | 5063 |
6252 /** | 5064 /** |
6253 * Set the token representing the 'for' keyword to the given token. | |
6254 * | |
6255 * @param forKeyword the token representing the 'for' keyword | |
6256 */ | |
6257 void set forKeyword(Token forKeyword2) { | |
6258 this._forKeyword = forKeyword2; | |
6259 } | |
6260 | |
6261 /** | |
6262 * Set the token representing the 'in' keyword to the given token. | |
6263 * | |
6264 * @param inKeyword the token representing the 'in' keyword | |
6265 */ | |
6266 void set inKeyword(Token inKeyword2) { | |
6267 this._inKeyword = inKeyword2; | |
6268 } | |
6269 | |
6270 /** | |
6271 * Set the expression evaluated to produce the iterator to the given expressio
n. | 5065 * Set the expression evaluated to produce the iterator to the given expressio
n. |
6272 * | 5066 * |
6273 * @param expression the expression evaluated to produce the iterator | 5067 * @param expression the expression evaluated to produce the iterator |
6274 */ | 5068 */ |
6275 void set iterator(Expression expression) { | 5069 void set iterator(Expression expression) { |
6276 _iterator = becomeParentOf(expression); | 5070 _iterator = becomeParentOf(expression); |
6277 } | 5071 } |
6278 | 5072 |
6279 /** | 5073 /** |
6280 * Set the left parenthesis to the given token. | |
6281 * | |
6282 * @param leftParenthesis the left parenthesis | |
6283 */ | |
6284 void set leftParenthesis(Token leftParenthesis2) { | |
6285 this._leftParenthesis = leftParenthesis2; | |
6286 } | |
6287 | |
6288 /** | |
6289 * Set the declaration of the loop variable to the given variable. | 5074 * Set the declaration of the loop variable to the given variable. |
6290 * | 5075 * |
6291 * @param variable the declaration of the loop variable | 5076 * @param variable the declaration of the loop variable |
6292 */ | 5077 */ |
6293 void set loopVariable(DeclaredIdentifier variable) { | 5078 void set loopVariable(DeclaredIdentifier variable) { |
6294 _loopVariable = becomeParentOf(variable); | 5079 _loopVariable = becomeParentOf(variable); |
6295 } | 5080 } |
6296 | |
6297 /** | |
6298 * Set the right parenthesis to the given token. | |
6299 * | |
6300 * @param rightParenthesis the right parenthesis | |
6301 */ | |
6302 void set rightParenthesis(Token rightParenthesis2) { | |
6303 this._rightParenthesis = rightParenthesis2; | |
6304 } | |
6305 void visitChildren(ASTVisitor visitor) { | 5081 void visitChildren(ASTVisitor visitor) { |
6306 safelyVisitChild(_loopVariable, visitor); | 5082 safelyVisitChild(_loopVariable, visitor); |
6307 safelyVisitChild(_iterator, visitor); | 5083 safelyVisitChild(_iterator, visitor); |
6308 safelyVisitChild(_body, visitor); | 5084 safelyVisitChild(_body, visitor); |
6309 } | 5085 } |
6310 } | 5086 } |
6311 /** | 5087 /** |
6312 * Instances of the class `ForStatement` represent a for statement. | 5088 * Instances of the class `ForStatement` represent a for statement. |
6313 * | 5089 * |
6314 * <pre> | 5090 * <pre> |
6315 * forStatement ::= | 5091 * forStatement ::= |
6316 * 'for' '(' forLoopParts ')' [Statement] | 5092 * 'for' '(' forLoopParts ')' [Statement] |
6317 * | 5093 * |
6318 * forLoopParts ::= | 5094 * forLoopParts ::= |
6319 * forInitializerStatement ';' [Expression]? ';' [Expression]? | 5095 * forInitializerStatement ';' [Expression]? ';' [Expression]? |
6320 * | 5096 * |
6321 * forInitializerStatement ::= | 5097 * forInitializerStatement ::= |
6322 * [DefaultFormalParameter] | 5098 * [DefaultFormalParameter] |
6323 * | [Expression]? | 5099 * | [Expression]? |
6324 * </pre> | 5100 * </pre> |
6325 * | 5101 * |
6326 * @coverage dart.engine.ast | 5102 * @coverage dart.engine.ast |
6327 */ | 5103 */ |
6328 class ForStatement extends Statement { | 5104 class ForStatement extends Statement { |
6329 | 5105 |
6330 /** | 5106 /** |
6331 * The token representing the 'for' keyword. | 5107 * The token representing the 'for' keyword. |
6332 */ | 5108 */ |
6333 Token _forKeyword; | 5109 Token forKeyword; |
6334 | 5110 |
6335 /** | 5111 /** |
6336 * The left parenthesis. | 5112 * The left parenthesis. |
6337 */ | 5113 */ |
6338 Token _leftParenthesis; | 5114 Token leftParenthesis; |
6339 | 5115 |
6340 /** | 5116 /** |
6341 * The declaration of the loop variables, or `null` if there are no variables.
Note that a | 5117 * The declaration of the loop variables, or `null` if there are no variables.
Note that a |
6342 * for statement cannot have both a variable list and an initialization expres
sion, but can | 5118 * for statement cannot have both a variable list and an initialization expres
sion, but can |
6343 * validly have neither. | 5119 * validly have neither. |
6344 */ | 5120 */ |
6345 VariableDeclarationList _variableList; | 5121 VariableDeclarationList _variableList; |
6346 | 5122 |
6347 /** | 5123 /** |
6348 * The initialization expression, or `null` if there is no initialization expr
ession. Note | 5124 * The initialization expression, or `null` if there is no initialization expr
ession. Note |
6349 * that a for statement cannot have both a variable list and an initialization
expression, but can | 5125 * that a for statement cannot have both a variable list and an initialization
expression, but can |
6350 * validly have neither. | 5126 * validly have neither. |
6351 */ | 5127 */ |
6352 Expression _initialization; | 5128 Expression _initialization; |
6353 | 5129 |
6354 /** | 5130 /** |
6355 * The semicolon separating the initializer and the condition. | 5131 * The semicolon separating the initializer and the condition. |
6356 */ | 5132 */ |
6357 Token _leftSeparator; | 5133 Token leftSeparator; |
6358 | 5134 |
6359 /** | 5135 /** |
6360 * The condition used to determine when to terminate the loop, or `null` if th
ere is no | 5136 * The condition used to determine when to terminate the loop, or `null` if th
ere is no |
6361 * condition. | 5137 * condition. |
6362 */ | 5138 */ |
6363 Expression _condition; | 5139 Expression _condition; |
6364 | 5140 |
6365 /** | 5141 /** |
6366 * The semicolon separating the condition and the updater. | 5142 * The semicolon separating the condition and the updater. |
6367 */ | 5143 */ |
6368 Token _rightSeparator; | 5144 Token rightSeparator; |
6369 | 5145 |
6370 /** | 5146 /** |
6371 * The list of expressions run after each execution of the loop body. | 5147 * The list of expressions run after each execution of the loop body. |
6372 */ | 5148 */ |
6373 NodeList<Expression> _updaters; | 5149 NodeList<Expression> updaters; |
6374 | 5150 |
6375 /** | 5151 /** |
6376 * The right parenthesis. | 5152 * The right parenthesis. |
6377 */ | 5153 */ |
6378 Token _rightParenthesis; | 5154 Token rightParenthesis; |
6379 | 5155 |
6380 /** | 5156 /** |
6381 * The body of the loop. | 5157 * The body of the loop. |
6382 */ | 5158 */ |
6383 Statement _body; | 5159 Statement _body; |
6384 | 5160 |
6385 /** | 5161 /** |
6386 * Initialize a newly created for statement. | 5162 * Initialize a newly created for statement. |
6387 * | 5163 * |
6388 * @param forKeyword the token representing the 'for' keyword | 5164 * @param forKeyword the token representing the 'for' keyword |
6389 * @param leftParenthesis the left parenthesis | 5165 * @param leftParenthesis the left parenthesis |
6390 * @param variableList the declaration of the loop variables | 5166 * @param variableList the declaration of the loop variables |
6391 * @param initialization the initialization expression | 5167 * @param initialization the initialization expression |
6392 * @param leftSeparator the semicolon separating the initializer and the condi
tion | 5168 * @param leftSeparator the semicolon separating the initializer and the condi
tion |
6393 * @param condition the condition used to determine when to terminate the loop | 5169 * @param condition the condition used to determine when to terminate the loop |
6394 * @param rightSeparator the semicolon separating the condition and the update
r | 5170 * @param rightSeparator the semicolon separating the condition and the update
r |
6395 * @param updaters the list of expressions run after each execution of the loo
p body | 5171 * @param updaters the list of expressions run after each execution of the loo
p body |
6396 * @param rightParenthesis the right parenthesis | 5172 * @param rightParenthesis the right parenthesis |
6397 * @param body the body of the loop | 5173 * @param body the body of the loop |
6398 */ | 5174 */ |
6399 ForStatement.full(Token forKeyword, Token leftParenthesis, VariableDeclaration
List variableList, Expression initialization, Token leftSeparator, Expression co
ndition, Token rightSeparator, List<Expression> updaters, Token rightParenthesis
, Statement body) { | 5175 ForStatement.full(Token forKeyword, Token leftParenthesis, VariableDeclaration
List variableList, Expression initialization, Token leftSeparator, Expression co
ndition, Token rightSeparator, List<Expression> updaters, Token rightParenthesis
, Statement body) { |
6400 this._updaters = new NodeList<Expression>(this); | 5176 this.updaters = new NodeList<Expression>(this); |
6401 this._forKeyword = forKeyword; | 5177 this.forKeyword = forKeyword; |
6402 this._leftParenthesis = leftParenthesis; | 5178 this.leftParenthesis = leftParenthesis; |
6403 this._variableList = becomeParentOf(variableList); | 5179 this._variableList = becomeParentOf(variableList); |
6404 this._initialization = becomeParentOf(initialization); | 5180 this._initialization = becomeParentOf(initialization); |
6405 this._leftSeparator = leftSeparator; | 5181 this.leftSeparator = leftSeparator; |
6406 this._condition = becomeParentOf(condition); | 5182 this._condition = becomeParentOf(condition); |
6407 this._rightSeparator = rightSeparator; | 5183 this.rightSeparator = rightSeparator; |
6408 this._updaters.addAll(updaters); | 5184 this.updaters.addAll(updaters); |
6409 this._rightParenthesis = rightParenthesis; | 5185 this.rightParenthesis = rightParenthesis; |
6410 this._body = becomeParentOf(body); | 5186 this._body = becomeParentOf(body); |
6411 } | 5187 } |
6412 | 5188 |
6413 /** | 5189 /** |
6414 * Initialize a newly created for statement. | 5190 * Initialize a newly created for statement. |
6415 * | 5191 * |
6416 * @param forKeyword the token representing the 'for' keyword | 5192 * @param forKeyword the token representing the 'for' keyword |
6417 * @param leftParenthesis the left parenthesis | 5193 * @param leftParenthesis the left parenthesis |
6418 * @param variableList the declaration of the loop variables | 5194 * @param variableList the declaration of the loop variables |
6419 * @param initialization the initialization expression | 5195 * @param initialization the initialization expression |
6420 * @param leftSeparator the semicolon separating the initializer and the condi
tion | 5196 * @param leftSeparator the semicolon separating the initializer and the condi
tion |
6421 * @param condition the condition used to determine when to terminate the loop | 5197 * @param condition the condition used to determine when to terminate the loop |
6422 * @param rightSeparator the semicolon separating the condition and the update
r | 5198 * @param rightSeparator the semicolon separating the condition and the update
r |
6423 * @param updaters the list of expressions run after each execution of the loo
p body | 5199 * @param updaters the list of expressions run after each execution of the loo
p body |
6424 * @param rightParenthesis the right parenthesis | 5200 * @param rightParenthesis the right parenthesis |
6425 * @param body the body of the loop | 5201 * @param body the body of the loop |
6426 */ | 5202 */ |
6427 ForStatement({Token forKeyword, Token leftParenthesis, VariableDeclarationList
variableList, Expression initialization, Token leftSeparator, Expression condit
ion, Token rightSeparator, List<Expression> updaters, Token rightParenthesis, St
atement body}) : this.full(forKeyword, leftParenthesis, variableList, initializa
tion, leftSeparator, condition, rightSeparator, updaters, rightParenthesis, body
); | 5203 ForStatement({Token forKeyword, Token leftParenthesis, VariableDeclarationList
variableList, Expression initialization, Token leftSeparator, Expression condit
ion, Token rightSeparator, List<Expression> updaters, Token rightParenthesis, St
atement body}) : this.full(forKeyword, leftParenthesis, variableList, initializa
tion, leftSeparator, condition, rightSeparator, updaters, rightParenthesis, body
); |
6428 accept(ASTVisitor visitor) => visitor.visitForStatement(this); | 5204 accept(ASTVisitor visitor) => visitor.visitForStatement(this); |
6429 Token get beginToken => _forKeyword; | 5205 Token get beginToken => forKeyword; |
6430 | 5206 |
6431 /** | 5207 /** |
6432 * Return the body of the loop. | 5208 * Return the body of the loop. |
6433 * | 5209 * |
6434 * @return the body of the loop | 5210 * @return the body of the loop |
6435 */ | 5211 */ |
6436 Statement get body => _body; | 5212 Statement get body => _body; |
6437 | 5213 |
6438 /** | 5214 /** |
6439 * Return the condition used to determine when to terminate the loop, or `null
` if there is | 5215 * Return the condition used to determine when to terminate the loop, or `null
` if there is |
6440 * no condition. | 5216 * no condition. |
6441 * | 5217 * |
6442 * @return the condition used to determine when to terminate the loop | 5218 * @return the condition used to determine when to terminate the loop |
6443 */ | 5219 */ |
6444 Expression get condition => _condition; | 5220 Expression get condition => _condition; |
6445 Token get endToken => _body.endToken; | 5221 Token get endToken => _body.endToken; |
6446 | 5222 |
6447 /** | 5223 /** |
6448 * Return the token representing the 'for' keyword. | |
6449 * | |
6450 * @return the token representing the 'for' keyword | |
6451 */ | |
6452 Token get forKeyword => _forKeyword; | |
6453 | |
6454 /** | |
6455 * Return the initialization expression, or `null` if there is no initializati
on expression. | 5224 * Return the initialization expression, or `null` if there is no initializati
on expression. |
6456 * | 5225 * |
6457 * @return the initialization expression | 5226 * @return the initialization expression |
6458 */ | 5227 */ |
6459 Expression get initialization => _initialization; | 5228 Expression get initialization => _initialization; |
6460 | 5229 |
6461 /** | 5230 /** |
6462 * Return the left parenthesis. | |
6463 * | |
6464 * @return the left parenthesis | |
6465 */ | |
6466 Token get leftParenthesis => _leftParenthesis; | |
6467 | |
6468 /** | |
6469 * Return the semicolon separating the initializer and the condition. | |
6470 * | |
6471 * @return the semicolon separating the initializer and the condition | |
6472 */ | |
6473 Token get leftSeparator => _leftSeparator; | |
6474 | |
6475 /** | |
6476 * Return the right parenthesis. | |
6477 * | |
6478 * @return the right parenthesis | |
6479 */ | |
6480 Token get rightParenthesis => _rightParenthesis; | |
6481 | |
6482 /** | |
6483 * Return the semicolon separating the condition and the updater. | |
6484 * | |
6485 * @return the semicolon separating the condition and the updater | |
6486 */ | |
6487 Token get rightSeparator => _rightSeparator; | |
6488 | |
6489 /** | |
6490 * Return the list of expressions run after each execution of the loop body. | |
6491 * | |
6492 * @return the list of expressions run after each execution of the loop body | |
6493 */ | |
6494 NodeList<Expression> get updaters => _updaters; | |
6495 | |
6496 /** | |
6497 * Return the declaration of the loop variables, or `null` if there are no var
iables. | 5231 * Return the declaration of the loop variables, or `null` if there are no var
iables. |
6498 * | 5232 * |
6499 * @return the declaration of the loop variables, or `null` if there are no va
riables | 5233 * @return the declaration of the loop variables, or `null` if there are no va
riables |
6500 */ | 5234 */ |
6501 VariableDeclarationList get variables => _variableList; | 5235 VariableDeclarationList get variables => _variableList; |
6502 | 5236 |
6503 /** | 5237 /** |
6504 * Set the body of the loop to the given statement. | 5238 * Set the body of the loop to the given statement. |
6505 * | 5239 * |
6506 * @param body the body of the loop | 5240 * @param body the body of the loop |
6507 */ | 5241 */ |
6508 void set body(Statement body2) { | 5242 void set body(Statement body2) { |
6509 this._body = becomeParentOf(body2); | 5243 this._body = becomeParentOf(body2); |
6510 } | 5244 } |
6511 | 5245 |
6512 /** | 5246 /** |
6513 * Set the condition used to determine when to terminate the loop to the given
expression. | 5247 * Set the condition used to determine when to terminate the loop to the given
expression. |
6514 * | 5248 * |
6515 * @param expression the condition used to determine when to terminate the loo
p | 5249 * @param expression the condition used to determine when to terminate the loo
p |
6516 */ | 5250 */ |
6517 void set condition(Expression expression) { | 5251 void set condition(Expression expression) { |
6518 _condition = becomeParentOf(expression); | 5252 _condition = becomeParentOf(expression); |
6519 } | 5253 } |
6520 | 5254 |
6521 /** | 5255 /** |
6522 * Set the token representing the 'for' keyword to the given token. | |
6523 * | |
6524 * @param forKeyword the token representing the 'for' keyword | |
6525 */ | |
6526 void set forKeyword(Token forKeyword2) { | |
6527 this._forKeyword = forKeyword2; | |
6528 } | |
6529 | |
6530 /** | |
6531 * Set the initialization expression to the given expression. | 5256 * Set the initialization expression to the given expression. |
6532 * | 5257 * |
6533 * @param initialization the initialization expression | 5258 * @param initialization the initialization expression |
6534 */ | 5259 */ |
6535 void set initialization(Expression initialization2) { | 5260 void set initialization(Expression initialization2) { |
6536 this._initialization = becomeParentOf(initialization2); | 5261 this._initialization = becomeParentOf(initialization2); |
6537 } | 5262 } |
6538 | 5263 |
6539 /** | 5264 /** |
6540 * Set the left parenthesis to the given token. | |
6541 * | |
6542 * @param leftParenthesis the left parenthesis | |
6543 */ | |
6544 void set leftParenthesis(Token leftParenthesis2) { | |
6545 this._leftParenthesis = leftParenthesis2; | |
6546 } | |
6547 | |
6548 /** | |
6549 * Set the semicolon separating the initializer and the condition to the given
token. | |
6550 * | |
6551 * @param leftSeparator the semicolon separating the initializer and the condi
tion | |
6552 */ | |
6553 void set leftSeparator(Token leftSeparator2) { | |
6554 this._leftSeparator = leftSeparator2; | |
6555 } | |
6556 | |
6557 /** | |
6558 * Set the right parenthesis to the given token. | |
6559 * | |
6560 * @param rightParenthesis the right parenthesis | |
6561 */ | |
6562 void set rightParenthesis(Token rightParenthesis2) { | |
6563 this._rightParenthesis = rightParenthesis2; | |
6564 } | |
6565 | |
6566 /** | |
6567 * Set the semicolon separating the condition and the updater to the given tok
en. | |
6568 * | |
6569 * @param rightSeparator the semicolon separating the condition and the update
r | |
6570 */ | |
6571 void set rightSeparator(Token rightSeparator2) { | |
6572 this._rightSeparator = rightSeparator2; | |
6573 } | |
6574 | |
6575 /** | |
6576 * Set the declaration of the loop variables to the given parameter. | 5265 * Set the declaration of the loop variables to the given parameter. |
6577 * | 5266 * |
6578 * @param variableList the declaration of the loop variables | 5267 * @param variableList the declaration of the loop variables |
6579 */ | 5268 */ |
6580 void set variables(VariableDeclarationList variableList) { | 5269 void set variables(VariableDeclarationList variableList) { |
6581 variableList = becomeParentOf(variableList); | 5270 variableList = becomeParentOf(variableList); |
6582 } | 5271 } |
6583 void visitChildren(ASTVisitor visitor) { | 5272 void visitChildren(ASTVisitor visitor) { |
6584 safelyVisitChild(_variableList, visitor); | 5273 safelyVisitChild(_variableList, visitor); |
6585 safelyVisitChild(_initialization, visitor); | 5274 safelyVisitChild(_initialization, visitor); |
6586 safelyVisitChild(_condition, visitor); | 5275 safelyVisitChild(_condition, visitor); |
6587 _updaters.accept(visitor); | 5276 updaters.accept(visitor); |
6588 safelyVisitChild(_body, visitor); | 5277 safelyVisitChild(_body, visitor); |
6589 } | 5278 } |
6590 } | 5279 } |
6591 /** | 5280 /** |
6592 * The abstract class `FormalParameter` defines the behavior of objects represen
ting a | 5281 * The abstract class `FormalParameter` defines the behavior of objects represen
ting a |
6593 * parameter to a function. | 5282 * parameter to a function. |
6594 * | 5283 * |
6595 * <pre> | 5284 * <pre> |
6596 * formalParameter ::= | 5285 * formalParameter ::= |
6597 * [NormalFormalParameter] | 5286 * [NormalFormalParameter] |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6681 class FormalParameterList extends ASTNode { | 5370 class FormalParameterList extends ASTNode { |
6682 | 5371 |
6683 /** | 5372 /** |
6684 * The left parenthesis. | 5373 * The left parenthesis. |
6685 */ | 5374 */ |
6686 Token _leftParenthesis; | 5375 Token _leftParenthesis; |
6687 | 5376 |
6688 /** | 5377 /** |
6689 * The parameters associated with the method. | 5378 * The parameters associated with the method. |
6690 */ | 5379 */ |
6691 NodeList<FormalParameter> _parameters; | 5380 NodeList<FormalParameter> parameters; |
6692 | 5381 |
6693 /** | 5382 /** |
6694 * The left square bracket ('[') or left curly brace ('{') introducing the opt
ional parameters, or | 5383 * The left square bracket ('[') or left curly brace ('{') introducing the opt
ional parameters, or |
6695 * `null` if there are no optional parameters. | 5384 * `null` if there are no optional parameters. |
6696 */ | 5385 */ |
6697 Token _leftDelimiter; | 5386 Token _leftDelimiter; |
6698 | 5387 |
6699 /** | 5388 /** |
6700 * The right square bracket (']') or right curly brace ('}') introducing the o
ptional parameters, | 5389 * The right square bracket (']') or right curly brace ('}') introducing the o
ptional parameters, |
6701 * or `null` if there are no optional parameters. | 5390 * or `null` if there are no optional parameters. |
6702 */ | 5391 */ |
6703 Token _rightDelimiter; | 5392 Token _rightDelimiter; |
6704 | 5393 |
6705 /** | 5394 /** |
6706 * The right parenthesis. | 5395 * The right parenthesis. |
6707 */ | 5396 */ |
6708 Token _rightParenthesis; | 5397 Token _rightParenthesis; |
6709 | 5398 |
6710 /** | 5399 /** |
6711 * Initialize a newly created parameter list. | 5400 * Initialize a newly created parameter list. |
6712 * | 5401 * |
6713 * @param leftParenthesis the left parenthesis | 5402 * @param leftParenthesis the left parenthesis |
6714 * @param parameters the parameters associated with the method | 5403 * @param parameters the parameters associated with the method |
6715 * @param leftDelimiter the left delimiter introducing the optional parameters | 5404 * @param leftDelimiter the left delimiter introducing the optional parameters |
6716 * @param rightDelimiter the right delimiter introducing the optional paramete
rs | 5405 * @param rightDelimiter the right delimiter introducing the optional paramete
rs |
6717 * @param rightParenthesis the right parenthesis | 5406 * @param rightParenthesis the right parenthesis |
6718 */ | 5407 */ |
6719 FormalParameterList.full(Token leftParenthesis, List<FormalParameter> paramete
rs, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis) { | 5408 FormalParameterList.full(Token leftParenthesis, List<FormalParameter> paramete
rs, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis) { |
6720 this._parameters = new NodeList<FormalParameter>(this); | 5409 this.parameters = new NodeList<FormalParameter>(this); |
6721 this._leftParenthesis = leftParenthesis; | 5410 this._leftParenthesis = leftParenthesis; |
6722 this._parameters.addAll(parameters); | 5411 this.parameters.addAll(parameters); |
6723 this._leftDelimiter = leftDelimiter; | 5412 this._leftDelimiter = leftDelimiter; |
6724 this._rightDelimiter = rightDelimiter; | 5413 this._rightDelimiter = rightDelimiter; |
6725 this._rightParenthesis = rightParenthesis; | 5414 this._rightParenthesis = rightParenthesis; |
6726 } | 5415 } |
6727 | 5416 |
6728 /** | 5417 /** |
6729 * Initialize a newly created parameter list. | 5418 * Initialize a newly created parameter list. |
6730 * | 5419 * |
6731 * @param leftParenthesis the left parenthesis | 5420 * @param leftParenthesis the left parenthesis |
6732 * @param parameters the parameters associated with the method | 5421 * @param parameters the parameters associated with the method |
(...skipping 22 matching lines...) Expand all Loading... |
6755 */ | 5444 */ |
6756 Token get leftParenthesis => _leftParenthesis; | 5445 Token get leftParenthesis => _leftParenthesis; |
6757 | 5446 |
6758 /** | 5447 /** |
6759 * Return an array containing the elements representing the parameters in this
list. The array | 5448 * Return an array containing the elements representing the parameters in this
list. The array |
6760 * will contain `null`s if the parameters in this list have not been resolved. | 5449 * will contain `null`s if the parameters in this list have not been resolved. |
6761 * | 5450 * |
6762 * @return the elements representing the parameters in this list | 5451 * @return the elements representing the parameters in this list |
6763 */ | 5452 */ |
6764 List<ParameterElement> get parameterElements { | 5453 List<ParameterElement> get parameterElements { |
6765 int count = _parameters.length; | 5454 int count = parameters.length; |
6766 List<ParameterElement> types = new List<ParameterElement>(count); | 5455 List<ParameterElement> types = new List<ParameterElement>(count); |
6767 for (int i = 0; i < count; i++) { | 5456 for (int i = 0; i < count; i++) { |
6768 types[i] = _parameters[i].element; | 5457 types[i] = parameters[i].element; |
6769 } | 5458 } |
6770 return types; | 5459 return types; |
6771 } | 5460 } |
6772 | 5461 |
6773 /** | 5462 /** |
6774 * Return the parameters associated with the method. | |
6775 * | |
6776 * @return the parameters associated with the method | |
6777 */ | |
6778 NodeList<FormalParameter> get parameters => _parameters; | |
6779 | |
6780 /** | |
6781 * Return the right square bracket (']') or right curly brace ('}') introducin
g the optional | 5463 * Return the right square bracket (']') or right curly brace ('}') introducin
g the optional |
6782 * parameters, or `null` if there are no optional parameters. | 5464 * parameters, or `null` if there are no optional parameters. |
6783 * | 5465 * |
6784 * @return the right square bracket (']') or right curly brace ('}') introduci
ng the optional | 5466 * @return the right square bracket (']') or right curly brace ('}') introduci
ng the optional |
6785 * parameters | 5467 * parameters |
6786 */ | 5468 */ |
6787 Token get rightDelimiter => _rightDelimiter; | 5469 Token get rightDelimiter => _rightDelimiter; |
6788 | 5470 |
6789 /** | 5471 /** |
6790 * Return the right parenthesis. | 5472 * Return the right parenthesis. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6824 | 5506 |
6825 /** | 5507 /** |
6826 * Set the right parenthesis to the given token. | 5508 * Set the right parenthesis to the given token. |
6827 * | 5509 * |
6828 * @param parenthesis the right parenthesis | 5510 * @param parenthesis the right parenthesis |
6829 */ | 5511 */ |
6830 void set rightParenthesis(Token parenthesis) { | 5512 void set rightParenthesis(Token parenthesis) { |
6831 _rightParenthesis = parenthesis; | 5513 _rightParenthesis = parenthesis; |
6832 } | 5514 } |
6833 void visitChildren(ASTVisitor visitor) { | 5515 void visitChildren(ASTVisitor visitor) { |
6834 _parameters.accept(visitor); | 5516 parameters.accept(visitor); |
6835 } | 5517 } |
6836 } | 5518 } |
6837 /** | 5519 /** |
6838 * The abstract class `FunctionBody` defines the behavior common to objects repr
esenting the | 5520 * The abstract class `FunctionBody` defines the behavior common to objects repr
esenting the |
6839 * body of a function or method. | 5521 * body of a function or method. |
6840 * | 5522 * |
6841 * <pre> | 5523 * <pre> |
6842 * functionBody ::= | 5524 * functionBody ::= |
6843 * [BlockFunctionBody] | 5525 * [BlockFunctionBody] |
6844 * | [EmptyFunctionBody] | 5526 * | [EmptyFunctionBody] |
(...skipping 17 matching lines...) Expand all Loading... |
6862 * </pre> | 5544 * </pre> |
6863 * | 5545 * |
6864 * @coverage dart.engine.ast | 5546 * @coverage dart.engine.ast |
6865 */ | 5547 */ |
6866 class FunctionDeclaration extends CompilationUnitMember { | 5548 class FunctionDeclaration extends CompilationUnitMember { |
6867 | 5549 |
6868 /** | 5550 /** |
6869 * The token representing the 'external' keyword, or `null` if this is not an
external | 5551 * The token representing the 'external' keyword, or `null` if this is not an
external |
6870 * function. | 5552 * function. |
6871 */ | 5553 */ |
6872 Token _externalKeyword; | 5554 Token externalKeyword; |
6873 | 5555 |
6874 /** | 5556 /** |
6875 * The return type of the function, or `null` if no return type was declared. | 5557 * The return type of the function, or `null` if no return type was declared. |
6876 */ | 5558 */ |
6877 TypeName _returnType; | 5559 TypeName _returnType; |
6878 | 5560 |
6879 /** | 5561 /** |
6880 * The token representing the 'get' or 'set' keyword, or `null` if this is a f
unction | 5562 * The token representing the 'get' or 'set' keyword, or `null` if this is a f
unction |
6881 * declaration rather than a property declaration. | 5563 * declaration rather than a property declaration. |
6882 */ | 5564 */ |
6883 Token _propertyKeyword; | 5565 Token propertyKeyword; |
6884 | 5566 |
6885 /** | 5567 /** |
6886 * The name of the function, or `null` if the function is not named. | 5568 * The name of the function, or `null` if the function is not named. |
6887 */ | 5569 */ |
6888 SimpleIdentifier _name; | 5570 SimpleIdentifier _name; |
6889 | 5571 |
6890 /** | 5572 /** |
6891 * The function expression being wrapped. | 5573 * The function expression being wrapped. |
6892 */ | 5574 */ |
6893 FunctionExpression _functionExpression; | 5575 FunctionExpression _functionExpression; |
6894 | 5576 |
6895 /** | 5577 /** |
6896 * Initialize a newly created function declaration. | 5578 * Initialize a newly created function declaration. |
6897 * | 5579 * |
6898 * @param comment the documentation comment associated with this function | 5580 * @param comment the documentation comment associated with this function |
6899 * @param metadata the annotations associated with this function | 5581 * @param metadata the annotations associated with this function |
6900 * @param externalKeyword the token representing the 'external' keyword | 5582 * @param externalKeyword the token representing the 'external' keyword |
6901 * @param returnType the return type of the function | 5583 * @param returnType the return type of the function |
6902 * @param propertyKeyword the token representing the 'get' or 'set' keyword | 5584 * @param propertyKeyword the token representing the 'get' or 'set' keyword |
6903 * @param name the name of the function | 5585 * @param name the name of the function |
6904 * @param functionExpression the function expression being wrapped | 5586 * @param functionExpression the function expression being wrapped |
6905 */ | 5587 */ |
6906 FunctionDeclaration.full(Comment comment, List<Annotation> metadata, Token ext
ernalKeyword, TypeName returnType, Token propertyKeyword, SimpleIdentifier name,
FunctionExpression functionExpression) : super.full(comment, metadata) { | 5588 FunctionDeclaration.full(Comment comment, List<Annotation> metadata, Token ext
ernalKeyword, TypeName returnType, Token propertyKeyword, SimpleIdentifier name,
FunctionExpression functionExpression) : super.full(comment, metadata) { |
6907 this._externalKeyword = externalKeyword; | 5589 this.externalKeyword = externalKeyword; |
6908 this._returnType = becomeParentOf(returnType); | 5590 this._returnType = becomeParentOf(returnType); |
6909 this._propertyKeyword = propertyKeyword; | 5591 this.propertyKeyword = propertyKeyword; |
6910 this._name = becomeParentOf(name); | 5592 this._name = becomeParentOf(name); |
6911 this._functionExpression = becomeParentOf(functionExpression); | 5593 this._functionExpression = becomeParentOf(functionExpression); |
6912 } | 5594 } |
6913 | 5595 |
6914 /** | 5596 /** |
6915 * Initialize a newly created function declaration. | 5597 * Initialize a newly created function declaration. |
6916 * | 5598 * |
6917 * @param comment the documentation comment associated with this function | 5599 * @param comment the documentation comment associated with this function |
6918 * @param metadata the annotations associated with this function | 5600 * @param metadata the annotations associated with this function |
6919 * @param externalKeyword the token representing the 'external' keyword | 5601 * @param externalKeyword the token representing the 'external' keyword |
6920 * @param returnType the return type of the function | 5602 * @param returnType the return type of the function |
6921 * @param propertyKeyword the token representing the 'get' or 'set' keyword | 5603 * @param propertyKeyword the token representing the 'get' or 'set' keyword |
6922 * @param name the name of the function | 5604 * @param name the name of the function |
6923 * @param functionExpression the function expression being wrapped | 5605 * @param functionExpression the function expression being wrapped |
6924 */ | 5606 */ |
6925 FunctionDeclaration({Comment comment, List<Annotation> metadata, Token externa
lKeyword, TypeName returnType, Token propertyKeyword, SimpleIdentifier name, Fun
ctionExpression functionExpression}) : this.full(comment, metadata, externalKeyw
ord, returnType, propertyKeyword, name, functionExpression); | 5607 FunctionDeclaration({Comment comment, List<Annotation> metadata, Token externa
lKeyword, TypeName returnType, Token propertyKeyword, SimpleIdentifier name, Fun
ctionExpression functionExpression}) : this.full(comment, metadata, externalKeyw
ord, returnType, propertyKeyword, name, functionExpression); |
6926 accept(ASTVisitor visitor) => visitor.visitFunctionDeclaration(this); | 5608 accept(ASTVisitor visitor) => visitor.visitFunctionDeclaration(this); |
6927 ExecutableElement get element => _name != null ? (_name.staticElement as Execu
tableElement) : null; | 5609 ExecutableElement get element => _name != null ? (_name.staticElement as Execu
tableElement) : null; |
6928 Token get endToken => _functionExpression.endToken; | 5610 Token get endToken => _functionExpression.endToken; |
6929 | 5611 |
6930 /** | 5612 /** |
6931 * Return the token representing the 'external' keyword, or `null` if this is
not an | |
6932 * external function. | |
6933 * | |
6934 * @return the token representing the 'external' keyword | |
6935 */ | |
6936 Token get externalKeyword => _externalKeyword; | |
6937 | |
6938 /** | |
6939 * Return the function expression being wrapped. | 5613 * Return the function expression being wrapped. |
6940 * | 5614 * |
6941 * @return the function expression being wrapped | 5615 * @return the function expression being wrapped |
6942 */ | 5616 */ |
6943 FunctionExpression get functionExpression => _functionExpression; | 5617 FunctionExpression get functionExpression => _functionExpression; |
6944 | 5618 |
6945 /** | 5619 /** |
6946 * Return the name of the function, or `null` if the function is not named. | 5620 * Return the name of the function, or `null` if the function is not named. |
6947 * | 5621 * |
6948 * @return the name of the function | 5622 * @return the name of the function |
6949 */ | 5623 */ |
6950 SimpleIdentifier get name => _name; | 5624 SimpleIdentifier get name => _name; |
6951 | 5625 |
6952 /** | 5626 /** |
6953 * Return the token representing the 'get' or 'set' keyword, or `null` if this
is a function | |
6954 * declaration rather than a property declaration. | |
6955 * | |
6956 * @return the token representing the 'get' or 'set' keyword | |
6957 */ | |
6958 Token get propertyKeyword => _propertyKeyword; | |
6959 | |
6960 /** | |
6961 * Return the return type of the function, or `null` if no return type was dec
lared. | 5627 * Return the return type of the function, or `null` if no return type was dec
lared. |
6962 * | 5628 * |
6963 * @return the return type of the function | 5629 * @return the return type of the function |
6964 */ | 5630 */ |
6965 TypeName get returnType => _returnType; | 5631 TypeName get returnType => _returnType; |
6966 | 5632 |
6967 /** | 5633 /** |
6968 * Return `true` if this function declares a getter. | 5634 * Return `true` if this function declares a getter. |
6969 * | 5635 * |
6970 * @return `true` if this function declares a getter | 5636 * @return `true` if this function declares a getter |
6971 */ | 5637 */ |
6972 bool get isGetter => _propertyKeyword != null && identical(((_propertyKeyword
as KeywordToken)).keyword, Keyword.GET); | 5638 bool get isGetter => propertyKeyword != null && identical(((propertyKeyword as
KeywordToken)).keyword, Keyword.GET); |
6973 | 5639 |
6974 /** | 5640 /** |
6975 * Return `true` if this function declares a setter. | 5641 * Return `true` if this function declares a setter. |
6976 * | 5642 * |
6977 * @return `true` if this function declares a setter | 5643 * @return `true` if this function declares a setter |
6978 */ | 5644 */ |
6979 bool get isSetter => _propertyKeyword != null && identical(((_propertyKeyword
as KeywordToken)).keyword, Keyword.SET); | 5645 bool get isSetter => propertyKeyword != null && identical(((propertyKeyword as
KeywordToken)).keyword, Keyword.SET); |
6980 | |
6981 /** | |
6982 * Set the token representing the 'external' keyword to the given token. | |
6983 * | |
6984 * @param externalKeyword the token representing the 'external' keyword | |
6985 */ | |
6986 void set externalKeyword(Token externalKeyword2) { | |
6987 this._externalKeyword = externalKeyword2; | |
6988 } | |
6989 | 5646 |
6990 /** | 5647 /** |
6991 * Set the function expression being wrapped to the given function expression. | 5648 * Set the function expression being wrapped to the given function expression. |
6992 * | 5649 * |
6993 * @param functionExpression the function expression being wrapped | 5650 * @param functionExpression the function expression being wrapped |
6994 */ | 5651 */ |
6995 void set functionExpression(FunctionExpression functionExpression2) { | 5652 void set functionExpression(FunctionExpression functionExpression2) { |
6996 functionExpression2 = becomeParentOf(functionExpression2); | 5653 functionExpression2 = becomeParentOf(functionExpression2); |
6997 } | 5654 } |
6998 | 5655 |
6999 /** | 5656 /** |
7000 * Set the name of the function to the given identifier. | 5657 * Set the name of the function to the given identifier. |
7001 * | 5658 * |
7002 * @param identifier the name of the function | 5659 * @param identifier the name of the function |
7003 */ | 5660 */ |
7004 void set name(SimpleIdentifier identifier) { | 5661 void set name(SimpleIdentifier identifier) { |
7005 _name = becomeParentOf(identifier); | 5662 _name = becomeParentOf(identifier); |
7006 } | 5663 } |
7007 | 5664 |
7008 /** | 5665 /** |
7009 * Set the token representing the 'get' or 'set' keyword to the given token. | |
7010 * | |
7011 * @param propertyKeyword the token representing the 'get' or 'set' keyword | |
7012 */ | |
7013 void set propertyKeyword(Token propertyKeyword2) { | |
7014 this._propertyKeyword = propertyKeyword2; | |
7015 } | |
7016 | |
7017 /** | |
7018 * Set the return type of the function to the given name. | 5666 * Set the return type of the function to the given name. |
7019 * | 5667 * |
7020 * @param name the return type of the function | 5668 * @param name the return type of the function |
7021 */ | 5669 */ |
7022 void set returnType(TypeName name) { | 5670 void set returnType(TypeName name) { |
7023 _returnType = becomeParentOf(name); | 5671 _returnType = becomeParentOf(name); |
7024 } | 5672 } |
7025 void visitChildren(ASTVisitor visitor) { | 5673 void visitChildren(ASTVisitor visitor) { |
7026 super.visitChildren(visitor); | 5674 super.visitChildren(visitor); |
7027 safelyVisitChild(_returnType, visitor); | 5675 safelyVisitChild(_returnType, visitor); |
7028 safelyVisitChild(_name, visitor); | 5676 safelyVisitChild(_name, visitor); |
7029 safelyVisitChild(_functionExpression, visitor); | 5677 safelyVisitChild(_functionExpression, visitor); |
7030 } | 5678 } |
7031 Token get firstTokenAfterCommentAndMetadata { | 5679 Token get firstTokenAfterCommentAndMetadata { |
7032 if (_externalKeyword != null) { | 5680 if (externalKeyword != null) { |
7033 return _externalKeyword; | 5681 return externalKeyword; |
7034 } | 5682 } |
7035 if (_returnType != null) { | 5683 if (_returnType != null) { |
7036 return _returnType.beginToken; | 5684 return _returnType.beginToken; |
7037 } else if (_propertyKeyword != null) { | 5685 } else if (propertyKeyword != null) { |
7038 return _propertyKeyword; | 5686 return propertyKeyword; |
7039 } else if (_name != null) { | 5687 } else if (_name != null) { |
7040 return _name.beginToken; | 5688 return _name.beginToken; |
7041 } | 5689 } |
7042 return _functionExpression.beginToken; | 5690 return _functionExpression.beginToken; |
7043 } | 5691 } |
7044 } | 5692 } |
7045 /** | 5693 /** |
7046 * Instances of the class `FunctionDeclarationStatement` wrap a [FunctionDeclara
tion | 5694 * Instances of the class `FunctionDeclarationStatement` wrap a [FunctionDeclara
tion |
7047 ] as a statement. | 5695 ] as a statement. |
7048 * | 5696 * |
7049 * @coverage dart.engine.ast | 5697 * @coverage dart.engine.ast |
7050 */ | 5698 */ |
7051 class FunctionDeclarationStatement extends Statement { | 5699 class FunctionDeclarationStatement extends Statement { |
7052 | 5700 |
7053 /** | 5701 /** |
7054 * The function declaration being wrapped. | 5702 * The function declaration being wrapped. |
7055 */ | 5703 */ |
7056 FunctionDeclaration _functionDeclaration; | 5704 FunctionDeclaration functionDeclaration; |
7057 | 5705 |
7058 /** | 5706 /** |
7059 * Initialize a newly created function declaration statement. | 5707 * Initialize a newly created function declaration statement. |
7060 * | 5708 * |
7061 * @param functionDeclaration the the function declaration being wrapped | 5709 * @param functionDeclaration the the function declaration being wrapped |
7062 */ | 5710 */ |
7063 FunctionDeclarationStatement.full(FunctionDeclaration functionDeclaration) { | 5711 FunctionDeclarationStatement.full(FunctionDeclaration functionDeclaration) { |
7064 this._functionDeclaration = becomeParentOf(functionDeclaration); | 5712 this.functionDeclaration = becomeParentOf(functionDeclaration); |
7065 } | 5713 } |
7066 | 5714 |
7067 /** | 5715 /** |
7068 * Initialize a newly created function declaration statement. | 5716 * Initialize a newly created function declaration statement. |
7069 * | 5717 * |
7070 * @param functionDeclaration the the function declaration being wrapped | 5718 * @param functionDeclaration the the function declaration being wrapped |
7071 */ | 5719 */ |
7072 FunctionDeclarationStatement({FunctionDeclaration functionDeclaration}) : this
.full(functionDeclaration); | 5720 FunctionDeclarationStatement({FunctionDeclaration functionDeclaration}) : this
.full(functionDeclaration); |
7073 accept(ASTVisitor visitor) => visitor.visitFunctionDeclarationStatement(this); | 5721 accept(ASTVisitor visitor) => visitor.visitFunctionDeclarationStatement(this); |
7074 Token get beginToken => _functionDeclaration.beginToken; | 5722 Token get beginToken => functionDeclaration.beginToken; |
7075 Token get endToken => _functionDeclaration.endToken; | 5723 Token get endToken => functionDeclaration.endToken; |
7076 | |
7077 /** | |
7078 * Return the function declaration being wrapped. | |
7079 * | |
7080 * @return the function declaration being wrapped | |
7081 */ | |
7082 FunctionDeclaration get functionDeclaration => _functionDeclaration; | |
7083 | 5724 |
7084 /** | 5725 /** |
7085 * Set the function declaration being wrapped to the given function declaratio
n. | 5726 * Set the function declaration being wrapped to the given function declaratio
n. |
7086 * | 5727 * |
7087 * @param functionDeclaration the function declaration being wrapped | 5728 * @param functionDeclaration the function declaration being wrapped |
7088 */ | 5729 */ |
7089 void set functionExpression(FunctionDeclaration functionDeclaration2) { | 5730 void set functionExpression(FunctionDeclaration functionDeclaration2) { |
7090 this._functionDeclaration = becomeParentOf(functionDeclaration2); | 5731 this.functionDeclaration = becomeParentOf(functionDeclaration2); |
7091 } | 5732 } |
7092 void visitChildren(ASTVisitor visitor) { | 5733 void visitChildren(ASTVisitor visitor) { |
7093 safelyVisitChild(_functionDeclaration, visitor); | 5734 safelyVisitChild(functionDeclaration, visitor); |
7094 } | 5735 } |
7095 } | 5736 } |
7096 /** | 5737 /** |
7097 * Instances of the class `FunctionExpression` represent a function expression. | 5738 * Instances of the class `FunctionExpression` represent a function expression. |
7098 * | 5739 * |
7099 * <pre> | 5740 * <pre> |
7100 * functionExpression ::= | 5741 * functionExpression ::= |
7101 * [FormalParameterList] [FunctionBody] | 5742 * [FormalParameterList] [FunctionBody] |
7102 * </pre> | 5743 * </pre> |
7103 * | 5744 * |
7104 * @coverage dart.engine.ast | 5745 * @coverage dart.engine.ast |
7105 */ | 5746 */ |
7106 class FunctionExpression extends Expression { | 5747 class FunctionExpression extends Expression { |
7107 | 5748 |
7108 /** | 5749 /** |
7109 * The parameters associated with the function. | 5750 * The parameters associated with the function. |
7110 */ | 5751 */ |
7111 FormalParameterList _parameters; | 5752 FormalParameterList _parameters; |
7112 | 5753 |
7113 /** | 5754 /** |
7114 * The body of the function, or `null` if this is an external function. | 5755 * The body of the function, or `null` if this is an external function. |
7115 */ | 5756 */ |
7116 FunctionBody _body; | 5757 FunctionBody _body; |
7117 | 5758 |
7118 /** | 5759 /** |
7119 * The element associated with the function, or `null` if the AST structure ha
s not been | 5760 * The element associated with the function, or `null` if the AST structure ha
s not been |
7120 * resolved. | 5761 * resolved. |
7121 */ | 5762 */ |
7122 ExecutableElement _element; | 5763 ExecutableElement element; |
7123 | 5764 |
7124 /** | 5765 /** |
7125 * Initialize a newly created function declaration. | 5766 * Initialize a newly created function declaration. |
7126 * | 5767 * |
7127 * @param parameters the parameters associated with the function | 5768 * @param parameters the parameters associated with the function |
7128 * @param body the body of the function | 5769 * @param body the body of the function |
7129 */ | 5770 */ |
7130 FunctionExpression.full(FormalParameterList parameters, FunctionBody body) { | 5771 FunctionExpression.full(FormalParameterList parameters, FunctionBody body) { |
7131 this._parameters = becomeParentOf(parameters); | 5772 this._parameters = becomeParentOf(parameters); |
7132 this._body = becomeParentOf(body); | 5773 this._body = becomeParentOf(body); |
(...skipping 15 matching lines...) Expand all Loading... |
7148 } | 5789 } |
7149 throw new IllegalStateException("Non-external functions must have a body"); | 5790 throw new IllegalStateException("Non-external functions must have a body"); |
7150 } | 5791 } |
7151 | 5792 |
7152 /** | 5793 /** |
7153 * Return the body of the function, or `null` if this is an external function. | 5794 * Return the body of the function, or `null` if this is an external function. |
7154 * | 5795 * |
7155 * @return the body of the function | 5796 * @return the body of the function |
7156 */ | 5797 */ |
7157 FunctionBody get body => _body; | 5798 FunctionBody get body => _body; |
7158 | |
7159 /** | |
7160 * Return the element associated with this function, or `null` if the AST stru
cture has not | |
7161 * been resolved. | |
7162 * | |
7163 * @return the element associated with this function | |
7164 */ | |
7165 ExecutableElement get element => _element; | |
7166 Token get endToken { | 5799 Token get endToken { |
7167 if (_body != null) { | 5800 if (_body != null) { |
7168 return _body.endToken; | 5801 return _body.endToken; |
7169 } else if (_parameters != null) { | 5802 } else if (_parameters != null) { |
7170 return _parameters.endToken; | 5803 return _parameters.endToken; |
7171 } | 5804 } |
7172 throw new IllegalStateException("Non-external functions must have a body"); | 5805 throw new IllegalStateException("Non-external functions must have a body"); |
7173 } | 5806 } |
7174 | 5807 |
7175 /** | 5808 /** |
7176 * Return the parameters associated with the function. | 5809 * Return the parameters associated with the function. |
7177 * | 5810 * |
7178 * @return the parameters associated with the function | 5811 * @return the parameters associated with the function |
7179 */ | 5812 */ |
7180 FormalParameterList get parameters => _parameters; | 5813 FormalParameterList get parameters => _parameters; |
7181 | 5814 |
7182 /** | 5815 /** |
7183 * Set the body of the function to the given function body. | 5816 * Set the body of the function to the given function body. |
7184 * | 5817 * |
7185 * @param functionBody the body of the function | 5818 * @param functionBody the body of the function |
7186 */ | 5819 */ |
7187 void set body(FunctionBody functionBody) { | 5820 void set body(FunctionBody functionBody) { |
7188 _body = becomeParentOf(functionBody); | 5821 _body = becomeParentOf(functionBody); |
7189 } | 5822 } |
7190 | 5823 |
7191 /** | 5824 /** |
7192 * Set the element associated with this function to the given element. | |
7193 * | |
7194 * @param element the element associated with this function | |
7195 */ | |
7196 void set element(ExecutableElement element2) { | |
7197 this._element = element2; | |
7198 } | |
7199 | |
7200 /** | |
7201 * Set the parameters associated with the function to the given list of parame
ters. | 5825 * Set the parameters associated with the function to the given list of parame
ters. |
7202 * | 5826 * |
7203 * @param parameters the parameters associated with the function | 5827 * @param parameters the parameters associated with the function |
7204 */ | 5828 */ |
7205 void set parameters(FormalParameterList parameters2) { | 5829 void set parameters(FormalParameterList parameters2) { |
7206 this._parameters = becomeParentOf(parameters2); | 5830 this._parameters = becomeParentOf(parameters2); |
7207 } | 5831 } |
7208 void visitChildren(ASTVisitor visitor) { | 5832 void visitChildren(ASTVisitor visitor) { |
7209 safelyVisitChild(_parameters, visitor); | 5833 safelyVisitChild(_parameters, visitor); |
7210 safelyVisitChild(_body, visitor); | 5834 safelyVisitChild(_body, visitor); |
(...skipping 22 matching lines...) Expand all Loading... |
7233 | 5857 |
7234 /** | 5858 /** |
7235 * The list of arguments to the function. | 5859 * The list of arguments to the function. |
7236 */ | 5860 */ |
7237 ArgumentList _argumentList; | 5861 ArgumentList _argumentList; |
7238 | 5862 |
7239 /** | 5863 /** |
7240 * The element associated with the function being invoked based on static type
information, or | 5864 * The element associated with the function being invoked based on static type
information, or |
7241 * `null` if the AST structure has not been resolved or the function could not
be resolved. | 5865 * `null` if the AST structure has not been resolved or the function could not
be resolved. |
7242 */ | 5866 */ |
7243 ExecutableElement _staticElement; | 5867 ExecutableElement staticElement; |
7244 | 5868 |
7245 /** | 5869 /** |
7246 * The element associated with the function being invoked based on propagated
type information, or | 5870 * The element associated with the function being invoked based on propagated
type information, or |
7247 * `null` if the AST structure has not been resolved or the function could not
be resolved. | 5871 * `null` if the AST structure has not been resolved or the function could not
be resolved. |
7248 */ | 5872 */ |
7249 ExecutableElement _propagatedElement; | 5873 ExecutableElement _propagatedElement; |
7250 | 5874 |
7251 /** | 5875 /** |
7252 * Initialize a newly created function expression invocation. | 5876 * Initialize a newly created function expression invocation. |
7253 * | 5877 * |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7304 * Return the element associated with the function being invoked based on prop
agated type | 5928 * Return the element associated with the function being invoked based on prop
agated type |
7305 * information, or `null` if the AST structure has not been resolved or the fu
nction could | 5929 * information, or `null` if the AST structure has not been resolved or the fu
nction could |
7306 * not be resolved. One common example of the latter case is an expression who
se value can change | 5930 * not be resolved. One common example of the latter case is an expression who
se value can change |
7307 * over time. | 5931 * over time. |
7308 * | 5932 * |
7309 * @return the element associated with the function being invoked | 5933 * @return the element associated with the function being invoked |
7310 */ | 5934 */ |
7311 ExecutableElement get propagatedElement => _propagatedElement; | 5935 ExecutableElement get propagatedElement => _propagatedElement; |
7312 | 5936 |
7313 /** | 5937 /** |
7314 * Return the element associated with the function being invoked based on stat
ic type information, | |
7315 * or `null` if the AST structure has not been resolved or the function could
not be | |
7316 * resolved. One common example of the latter case is an expression whose valu
e can change over | |
7317 * time. | |
7318 * | |
7319 * @return the element associated with the function | |
7320 */ | |
7321 ExecutableElement get staticElement => _staticElement; | |
7322 | |
7323 /** | |
7324 * Set the list of arguments to the method to the given list. | 5938 * Set the list of arguments to the method to the given list. |
7325 * | 5939 * |
7326 * @param argumentList the list of arguments to the method | 5940 * @param argumentList the list of arguments to the method |
7327 */ | 5941 */ |
7328 void set argumentList(ArgumentList argumentList2) { | 5942 void set argumentList(ArgumentList argumentList2) { |
7329 this._argumentList = becomeParentOf(argumentList2); | 5943 this._argumentList = becomeParentOf(argumentList2); |
7330 } | 5944 } |
7331 | 5945 |
7332 /** | 5946 /** |
7333 * Set the expression producing the function being invoked to the given expres
sion. | 5947 * Set the expression producing the function being invoked to the given expres
sion. |
7334 * | 5948 * |
7335 * @param function the expression producing the function being invoked | 5949 * @param function the expression producing the function being invoked |
7336 */ | 5950 */ |
7337 void set function(Expression function2) { | 5951 void set function(Expression function2) { |
7338 function2 = becomeParentOf(function2); | 5952 function2 = becomeParentOf(function2); |
7339 } | 5953 } |
7340 | 5954 |
7341 /** | 5955 /** |
7342 * Set the element associated with the function being invoked based on propaga
ted type information | 5956 * Set the element associated with the function being invoked based on propaga
ted type information |
7343 * to the given element. | 5957 * to the given element. |
7344 * | 5958 * |
7345 * @param element the element to be associated with the function being invoked | 5959 * @param element the element to be associated with the function being invoked |
7346 */ | 5960 */ |
7347 void set propagatedElement(ExecutableElement element) { | 5961 void set propagatedElement(ExecutableElement element) { |
7348 _propagatedElement = element; | 5962 _propagatedElement = element; |
7349 } | 5963 } |
7350 | |
7351 /** | |
7352 * Set the element associated with the function being invoked based on static
type information to | |
7353 * the given element. | |
7354 * | |
7355 * @param element the element to be associated with the function | |
7356 */ | |
7357 void set staticElement(ExecutableElement element) { | |
7358 this._staticElement = element; | |
7359 } | |
7360 void visitChildren(ASTVisitor visitor) { | 5964 void visitChildren(ASTVisitor visitor) { |
7361 safelyVisitChild(_function, visitor); | 5965 safelyVisitChild(_function, visitor); |
7362 safelyVisitChild(_argumentList, visitor); | 5966 safelyVisitChild(_argumentList, visitor); |
7363 } | 5967 } |
7364 } | 5968 } |
7365 /** | 5969 /** |
7366 * Instances of the class `FunctionTypeAlias` represent a function type alias. | 5970 * Instances of the class `FunctionTypeAlias` represent a function type alias. |
7367 * | 5971 * |
7368 * <pre> | 5972 * <pre> |
7369 * functionTypeAlias ::= | 5973 * functionTypeAlias ::= |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7615 * 'hide' [SimpleIdentifier] (',' [SimpleIdentifier])* | 6219 * 'hide' [SimpleIdentifier] (',' [SimpleIdentifier])* |
7616 * </pre> | 6220 * </pre> |
7617 * | 6221 * |
7618 * @coverage dart.engine.ast | 6222 * @coverage dart.engine.ast |
7619 */ | 6223 */ |
7620 class HideCombinator extends Combinator { | 6224 class HideCombinator extends Combinator { |
7621 | 6225 |
7622 /** | 6226 /** |
7623 * The list of names from the library that are hidden by this combinator. | 6227 * The list of names from the library that are hidden by this combinator. |
7624 */ | 6228 */ |
7625 NodeList<SimpleIdentifier> _hiddenNames; | 6229 NodeList<SimpleIdentifier> hiddenNames; |
7626 | 6230 |
7627 /** | 6231 /** |
7628 * Initialize a newly created import show combinator. | 6232 * Initialize a newly created import show combinator. |
7629 * | 6233 * |
7630 * @param keyword the comma introducing the combinator | 6234 * @param keyword the comma introducing the combinator |
7631 * @param hiddenNames the list of names from the library that are hidden by th
is combinator | 6235 * @param hiddenNames the list of names from the library that are hidden by th
is combinator |
7632 */ | 6236 */ |
7633 HideCombinator.full(Token keyword, List<SimpleIdentifier> hiddenNames) : super
.full(keyword) { | 6237 HideCombinator.full(Token keyword, List<SimpleIdentifier> hiddenNames) : super
.full(keyword) { |
7634 this._hiddenNames = new NodeList<SimpleIdentifier>(this); | 6238 this.hiddenNames = new NodeList<SimpleIdentifier>(this); |
7635 this._hiddenNames.addAll(hiddenNames); | 6239 this.hiddenNames.addAll(hiddenNames); |
7636 } | 6240 } |
7637 | 6241 |
7638 /** | 6242 /** |
7639 * Initialize a newly created import show combinator. | 6243 * Initialize a newly created import show combinator. |
7640 * | 6244 * |
7641 * @param keyword the comma introducing the combinator | 6245 * @param keyword the comma introducing the combinator |
7642 * @param hiddenNames the list of names from the library that are hidden by th
is combinator | 6246 * @param hiddenNames the list of names from the library that are hidden by th
is combinator |
7643 */ | 6247 */ |
7644 HideCombinator({Token keyword, List<SimpleIdentifier> hiddenNames}) : this.ful
l(keyword, hiddenNames); | 6248 HideCombinator({Token keyword, List<SimpleIdentifier> hiddenNames}) : this.ful
l(keyword, hiddenNames); |
7645 accept(ASTVisitor visitor) => visitor.visitHideCombinator(this); | 6249 accept(ASTVisitor visitor) => visitor.visitHideCombinator(this); |
7646 Token get endToken => _hiddenNames.endToken; | 6250 Token get endToken => hiddenNames.endToken; |
7647 | |
7648 /** | |
7649 * Return the list of names from the library that are hidden by this combinato
r. | |
7650 * | |
7651 * @return the list of names from the library that are hidden by this combinat
or | |
7652 */ | |
7653 NodeList<SimpleIdentifier> get hiddenNames => _hiddenNames; | |
7654 void visitChildren(ASTVisitor visitor) { | 6251 void visitChildren(ASTVisitor visitor) { |
7655 _hiddenNames.accept(visitor); | 6252 hiddenNames.accept(visitor); |
7656 } | 6253 } |
7657 } | 6254 } |
7658 /** | 6255 /** |
7659 * The abstract class `Identifier` defines the behavior common to nodes that rep
resent an | 6256 * The abstract class `Identifier` defines the behavior common to nodes that rep
resent an |
7660 * identifier. | 6257 * identifier. |
7661 * | 6258 * |
7662 * <pre> | 6259 * <pre> |
7663 * identifier ::= | 6260 * identifier ::= |
7664 * [SimpleIdentifier] | 6261 * [SimpleIdentifier] |
7665 * | [PrefixedIdentifier] | 6262 * | [PrefixedIdentifier] |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7724 * 'if' '(' [Expression] ')' [Statement] ('else' [Statement])? | 6321 * 'if' '(' [Expression] ')' [Statement] ('else' [Statement])? |
7725 * </pre> | 6322 * </pre> |
7726 * | 6323 * |
7727 * @coverage dart.engine.ast | 6324 * @coverage dart.engine.ast |
7728 */ | 6325 */ |
7729 class IfStatement extends Statement { | 6326 class IfStatement extends Statement { |
7730 | 6327 |
7731 /** | 6328 /** |
7732 * The token representing the 'if' keyword. | 6329 * The token representing the 'if' keyword. |
7733 */ | 6330 */ |
7734 Token _ifKeyword; | 6331 Token ifKeyword; |
7735 | 6332 |
7736 /** | 6333 /** |
7737 * The left parenthesis. | 6334 * The left parenthesis. |
7738 */ | 6335 */ |
7739 Token _leftParenthesis; | 6336 Token leftParenthesis; |
7740 | 6337 |
7741 /** | 6338 /** |
7742 * The condition used to determine which of the statements is executed next. | 6339 * The condition used to determine which of the statements is executed next. |
7743 */ | 6340 */ |
7744 Expression _condition; | 6341 Expression _condition; |
7745 | 6342 |
7746 /** | 6343 /** |
7747 * The right parenthesis. | 6344 * The right parenthesis. |
7748 */ | 6345 */ |
7749 Token _rightParenthesis; | 6346 Token rightParenthesis; |
7750 | 6347 |
7751 /** | 6348 /** |
7752 * The statement that is executed if the condition evaluates to `true`. | 6349 * The statement that is executed if the condition evaluates to `true`. |
7753 */ | 6350 */ |
7754 Statement _thenStatement; | 6351 Statement _thenStatement; |
7755 | 6352 |
7756 /** | 6353 /** |
7757 * The token representing the 'else' keyword, or `null` if there is no else st
atement. | 6354 * The token representing the 'else' keyword, or `null` if there is no else st
atement. |
7758 */ | 6355 */ |
7759 Token _elseKeyword; | 6356 Token elseKeyword; |
7760 | 6357 |
7761 /** | 6358 /** |
7762 * The statement that is executed if the condition evaluates to `false`, or `n
ull` if | 6359 * The statement that is executed if the condition evaluates to `false`, or `n
ull` if |
7763 * there is no else statement. | 6360 * there is no else statement. |
7764 */ | 6361 */ |
7765 Statement _elseStatement; | 6362 Statement _elseStatement; |
7766 | 6363 |
7767 /** | 6364 /** |
7768 * Initialize a newly created if statement. | 6365 * Initialize a newly created if statement. |
7769 * | 6366 * |
7770 * @param ifKeyword the token representing the 'if' keyword | 6367 * @param ifKeyword the token representing the 'if' keyword |
7771 * @param leftParenthesis the left parenthesis | 6368 * @param leftParenthesis the left parenthesis |
7772 * @param condition the condition used to determine which of the statements is
executed next | 6369 * @param condition the condition used to determine which of the statements is
executed next |
7773 * @param rightParenthesis the right parenthesis | 6370 * @param rightParenthesis the right parenthesis |
7774 * @param thenStatement the statement that is executed if the condition evalua
tes to `true` | 6371 * @param thenStatement the statement that is executed if the condition evalua
tes to `true` |
7775 * @param elseKeyword the token representing the 'else' keyword | 6372 * @param elseKeyword the token representing the 'else' keyword |
7776 * @param elseStatement the statement that is executed if the condition evalua
tes to `false` | 6373 * @param elseStatement the statement that is executed if the condition evalua
tes to `false` |
7777 */ | 6374 */ |
7778 IfStatement.full(Token ifKeyword, Token leftParenthesis, Expression condition,
Token rightParenthesis, Statement thenStatement, Token elseKeyword, Statement e
lseStatement) { | 6375 IfStatement.full(Token ifKeyword, Token leftParenthesis, Expression condition,
Token rightParenthesis, Statement thenStatement, Token elseKeyword, Statement e
lseStatement) { |
7779 this._ifKeyword = ifKeyword; | 6376 this.ifKeyword = ifKeyword; |
7780 this._leftParenthesis = leftParenthesis; | 6377 this.leftParenthesis = leftParenthesis; |
7781 this._condition = becomeParentOf(condition); | 6378 this._condition = becomeParentOf(condition); |
7782 this._rightParenthesis = rightParenthesis; | 6379 this.rightParenthesis = rightParenthesis; |
7783 this._thenStatement = becomeParentOf(thenStatement); | 6380 this._thenStatement = becomeParentOf(thenStatement); |
7784 this._elseKeyword = elseKeyword; | 6381 this.elseKeyword = elseKeyword; |
7785 this._elseStatement = becomeParentOf(elseStatement); | 6382 this._elseStatement = becomeParentOf(elseStatement); |
7786 } | 6383 } |
7787 | 6384 |
7788 /** | 6385 /** |
7789 * Initialize a newly created if statement. | 6386 * Initialize a newly created if statement. |
7790 * | 6387 * |
7791 * @param ifKeyword the token representing the 'if' keyword | 6388 * @param ifKeyword the token representing the 'if' keyword |
7792 * @param leftParenthesis the left parenthesis | 6389 * @param leftParenthesis the left parenthesis |
7793 * @param condition the condition used to determine which of the statements is
executed next | 6390 * @param condition the condition used to determine which of the statements is
executed next |
7794 * @param rightParenthesis the right parenthesis | 6391 * @param rightParenthesis the right parenthesis |
7795 * @param thenStatement the statement that is executed if the condition evalua
tes to `true` | 6392 * @param thenStatement the statement that is executed if the condition evalua
tes to `true` |
7796 * @param elseKeyword the token representing the 'else' keyword | 6393 * @param elseKeyword the token representing the 'else' keyword |
7797 * @param elseStatement the statement that is executed if the condition evalua
tes to `false` | 6394 * @param elseStatement the statement that is executed if the condition evalua
tes to `false` |
7798 */ | 6395 */ |
7799 IfStatement({Token ifKeyword, Token leftParenthesis, Expression condition, Tok
en rightParenthesis, Statement thenStatement, Token elseKeyword, Statement elseS
tatement}) : this.full(ifKeyword, leftParenthesis, condition, rightParenthesis,
thenStatement, elseKeyword, elseStatement); | 6396 IfStatement({Token ifKeyword, Token leftParenthesis, Expression condition, Tok
en rightParenthesis, Statement thenStatement, Token elseKeyword, Statement elseS
tatement}) : this.full(ifKeyword, leftParenthesis, condition, rightParenthesis,
thenStatement, elseKeyword, elseStatement); |
7800 accept(ASTVisitor visitor) => visitor.visitIfStatement(this); | 6397 accept(ASTVisitor visitor) => visitor.visitIfStatement(this); |
7801 Token get beginToken => _ifKeyword; | 6398 Token get beginToken => ifKeyword; |
7802 | 6399 |
7803 /** | 6400 /** |
7804 * Return the condition used to determine which of the statements is executed
next. | 6401 * Return the condition used to determine which of the statements is executed
next. |
7805 * | 6402 * |
7806 * @return the condition used to determine which statement is executed next | 6403 * @return the condition used to determine which statement is executed next |
7807 */ | 6404 */ |
7808 Expression get condition => _condition; | 6405 Expression get condition => _condition; |
7809 | 6406 |
7810 /** | 6407 /** |
7811 * Return the token representing the 'else' keyword, or `null` if there is no
else | |
7812 * statement. | |
7813 * | |
7814 * @return the token representing the 'else' keyword | |
7815 */ | |
7816 Token get elseKeyword => _elseKeyword; | |
7817 | |
7818 /** | |
7819 * Return the statement that is executed if the condition evaluates to `false`
, or | 6408 * Return the statement that is executed if the condition evaluates to `false`
, or |
7820 * `null` if there is no else statement. | 6409 * `null` if there is no else statement. |
7821 * | 6410 * |
7822 * @return the statement that is executed if the condition evaluates to `false
` | 6411 * @return the statement that is executed if the condition evaluates to `false
` |
7823 */ | 6412 */ |
7824 Statement get elseStatement => _elseStatement; | 6413 Statement get elseStatement => _elseStatement; |
7825 Token get endToken { | 6414 Token get endToken { |
7826 if (_elseStatement != null) { | 6415 if (_elseStatement != null) { |
7827 return _elseStatement.endToken; | 6416 return _elseStatement.endToken; |
7828 } | 6417 } |
7829 return _thenStatement.endToken; | 6418 return _thenStatement.endToken; |
7830 } | 6419 } |
7831 | 6420 |
7832 /** | 6421 /** |
7833 * Return the token representing the 'if' keyword. | |
7834 * | |
7835 * @return the token representing the 'if' keyword | |
7836 */ | |
7837 Token get ifKeyword => _ifKeyword; | |
7838 | |
7839 /** | |
7840 * Return the left parenthesis. | |
7841 * | |
7842 * @return the left parenthesis | |
7843 */ | |
7844 Token get leftParenthesis => _leftParenthesis; | |
7845 | |
7846 /** | |
7847 * Return the right parenthesis. | |
7848 * | |
7849 * @return the right parenthesis | |
7850 */ | |
7851 Token get rightParenthesis => _rightParenthesis; | |
7852 | |
7853 /** | |
7854 * Return the statement that is executed if the condition evaluates to `true`. | 6422 * Return the statement that is executed if the condition evaluates to `true`. |
7855 * | 6423 * |
7856 * @return the statement that is executed if the condition evaluates to `true` | 6424 * @return the statement that is executed if the condition evaluates to `true` |
7857 */ | 6425 */ |
7858 Statement get thenStatement => _thenStatement; | 6426 Statement get thenStatement => _thenStatement; |
7859 | 6427 |
7860 /** | 6428 /** |
7861 * Set the condition used to determine which of the statements is executed nex
t to the given | 6429 * Set the condition used to determine which of the statements is executed nex
t to the given |
7862 * expression. | 6430 * expression. |
7863 * | 6431 * |
7864 * @param expression the condition used to determine which statement is execut
ed next | 6432 * @param expression the condition used to determine which statement is execut
ed next |
7865 */ | 6433 */ |
7866 void set condition(Expression expression) { | 6434 void set condition(Expression expression) { |
7867 _condition = becomeParentOf(expression); | 6435 _condition = becomeParentOf(expression); |
7868 } | 6436 } |
7869 | 6437 |
7870 /** | 6438 /** |
7871 * Set the token representing the 'else' keyword to the given token. | |
7872 * | |
7873 * @param elseKeyword the token representing the 'else' keyword | |
7874 */ | |
7875 void set elseKeyword(Token elseKeyword2) { | |
7876 this._elseKeyword = elseKeyword2; | |
7877 } | |
7878 | |
7879 /** | |
7880 * Set the statement that is executed if the condition evaluates to `false` to
the given | 6439 * Set the statement that is executed if the condition evaluates to `false` to
the given |
7881 * statement. | 6440 * statement. |
7882 * | 6441 * |
7883 * @param statement the statement that is executed if the condition evaluates
to `false` | 6442 * @param statement the statement that is executed if the condition evaluates
to `false` |
7884 */ | 6443 */ |
7885 void set elseStatement(Statement statement) { | 6444 void set elseStatement(Statement statement) { |
7886 _elseStatement = becomeParentOf(statement); | 6445 _elseStatement = becomeParentOf(statement); |
7887 } | 6446 } |
7888 | 6447 |
7889 /** | 6448 /** |
7890 * Set the token representing the 'if' keyword to the given token. | |
7891 * | |
7892 * @param ifKeyword the token representing the 'if' keyword | |
7893 */ | |
7894 void set ifKeyword(Token ifKeyword2) { | |
7895 this._ifKeyword = ifKeyword2; | |
7896 } | |
7897 | |
7898 /** | |
7899 * Set the left parenthesis to the given token. | |
7900 * | |
7901 * @param leftParenthesis the left parenthesis | |
7902 */ | |
7903 void set leftParenthesis(Token leftParenthesis2) { | |
7904 this._leftParenthesis = leftParenthesis2; | |
7905 } | |
7906 | |
7907 /** | |
7908 * Set the right parenthesis to the given token. | |
7909 * | |
7910 * @param rightParenthesis the right parenthesis | |
7911 */ | |
7912 void set rightParenthesis(Token rightParenthesis2) { | |
7913 this._rightParenthesis = rightParenthesis2; | |
7914 } | |
7915 | |
7916 /** | |
7917 * Set the statement that is executed if the condition evaluates to `true` to
the given | 6449 * Set the statement that is executed if the condition evaluates to `true` to
the given |
7918 * statement. | 6450 * statement. |
7919 * | 6451 * |
7920 * @param statement the statement that is executed if the condition evaluates
to `true` | 6452 * @param statement the statement that is executed if the condition evaluates
to `true` |
7921 */ | 6453 */ |
7922 void set thenStatement(Statement statement) { | 6454 void set thenStatement(Statement statement) { |
7923 _thenStatement = becomeParentOf(statement); | 6455 _thenStatement = becomeParentOf(statement); |
7924 } | 6456 } |
7925 void visitChildren(ASTVisitor visitor) { | 6457 void visitChildren(ASTVisitor visitor) { |
7926 safelyVisitChild(_condition, visitor); | 6458 safelyVisitChild(_condition, visitor); |
(...skipping 10 matching lines...) Expand all Loading... |
7937 * 'implements' [TypeName] (',' [TypeName])* | 6469 * 'implements' [TypeName] (',' [TypeName])* |
7938 * </pre> | 6470 * </pre> |
7939 * | 6471 * |
7940 * @coverage dart.engine.ast | 6472 * @coverage dart.engine.ast |
7941 */ | 6473 */ |
7942 class ImplementsClause extends ASTNode { | 6474 class ImplementsClause extends ASTNode { |
7943 | 6475 |
7944 /** | 6476 /** |
7945 * The token representing the 'implements' keyword. | 6477 * The token representing the 'implements' keyword. |
7946 */ | 6478 */ |
7947 Token _keyword; | 6479 Token keyword; |
7948 | 6480 |
7949 /** | 6481 /** |
7950 * The interfaces that are being implemented. | 6482 * The interfaces that are being implemented. |
7951 */ | 6483 */ |
7952 NodeList<TypeName> _interfaces; | 6484 NodeList<TypeName> interfaces; |
7953 | 6485 |
7954 /** | 6486 /** |
7955 * Initialize a newly created implements clause. | 6487 * Initialize a newly created implements clause. |
7956 * | 6488 * |
7957 * @param keyword the token representing the 'implements' keyword | 6489 * @param keyword the token representing the 'implements' keyword |
7958 * @param interfaces the interfaces that are being implemented | 6490 * @param interfaces the interfaces that are being implemented |
7959 */ | 6491 */ |
7960 ImplementsClause.full(Token keyword, List<TypeName> interfaces) { | 6492 ImplementsClause.full(Token keyword, List<TypeName> interfaces) { |
7961 this._interfaces = new NodeList<TypeName>(this); | 6493 this.interfaces = new NodeList<TypeName>(this); |
7962 this._keyword = keyword; | 6494 this.keyword = keyword; |
7963 this._interfaces.addAll(interfaces); | 6495 this.interfaces.addAll(interfaces); |
7964 } | 6496 } |
7965 | 6497 |
7966 /** | 6498 /** |
7967 * Initialize a newly created implements clause. | 6499 * Initialize a newly created implements clause. |
7968 * | 6500 * |
7969 * @param keyword the token representing the 'implements' keyword | 6501 * @param keyword the token representing the 'implements' keyword |
7970 * @param interfaces the interfaces that are being implemented | 6502 * @param interfaces the interfaces that are being implemented |
7971 */ | 6503 */ |
7972 ImplementsClause({Token keyword, List<TypeName> interfaces}) : this.full(keywo
rd, interfaces); | 6504 ImplementsClause({Token keyword, List<TypeName> interfaces}) : this.full(keywo
rd, interfaces); |
7973 accept(ASTVisitor visitor) => visitor.visitImplementsClause(this); | 6505 accept(ASTVisitor visitor) => visitor.visitImplementsClause(this); |
7974 Token get beginToken => _keyword; | 6506 Token get beginToken => keyword; |
7975 Token get endToken => _interfaces.endToken; | 6507 Token get endToken => interfaces.endToken; |
7976 | |
7977 /** | |
7978 * Return the list of the interfaces that are being implemented. | |
7979 * | |
7980 * @return the list of the interfaces that are being implemented | |
7981 */ | |
7982 NodeList<TypeName> get interfaces => _interfaces; | |
7983 | |
7984 /** | |
7985 * Return the token representing the 'implements' keyword. | |
7986 * | |
7987 * @return the token representing the 'implements' keyword | |
7988 */ | |
7989 Token get keyword => _keyword; | |
7990 | |
7991 /** | |
7992 * Set the token representing the 'implements' keyword to the given token. | |
7993 * | |
7994 * @param keyword the token representing the 'implements' keyword | |
7995 */ | |
7996 void set keyword(Token keyword2) { | |
7997 this._keyword = keyword2; | |
7998 } | |
7999 void visitChildren(ASTVisitor visitor) { | 6508 void visitChildren(ASTVisitor visitor) { |
8000 _interfaces.accept(visitor); | 6509 interfaces.accept(visitor); |
8001 } | 6510 } |
8002 } | 6511 } |
8003 /** | 6512 /** |
8004 * Instances of the class `ImportDirective` represent an import directive. | 6513 * Instances of the class `ImportDirective` represent an import directive. |
8005 * | 6514 * |
8006 * <pre> | 6515 * <pre> |
8007 * importDirective ::= | 6516 * importDirective ::= |
8008 * [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* ';
' | 6517 * [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* ';
' |
8009 * </pre> | 6518 * </pre> |
8010 * | 6519 * |
8011 * @coverage dart.engine.ast | 6520 * @coverage dart.engine.ast |
8012 */ | 6521 */ |
8013 class ImportDirective extends NamespaceDirective { | 6522 class ImportDirective extends NamespaceDirective { |
8014 | 6523 |
8015 /** | 6524 /** |
8016 * The token representing the 'as' token, or `null` if the imported names are
not prefixed. | 6525 * The token representing the 'as' token, or `null` if the imported names are
not prefixed. |
8017 */ | 6526 */ |
8018 Token _asToken; | 6527 Token asToken; |
8019 | 6528 |
8020 /** | 6529 /** |
8021 * The prefix to be used with the imported names, or `null` if the imported na
mes are not | 6530 * The prefix to be used with the imported names, or `null` if the imported na
mes are not |
8022 * prefixed. | 6531 * prefixed. |
8023 */ | 6532 */ |
8024 SimpleIdentifier _prefix; | 6533 SimpleIdentifier _prefix; |
8025 | 6534 |
8026 /** | 6535 /** |
8027 * Initialize a newly created import directive. | 6536 * Initialize a newly created import directive. |
8028 * | 6537 * |
8029 * @param comment the documentation comment associated with this directive | 6538 * @param comment the documentation comment associated with this directive |
8030 * @param metadata the annotations associated with the directive | 6539 * @param metadata the annotations associated with the directive |
8031 * @param keyword the token representing the 'import' keyword | 6540 * @param keyword the token representing the 'import' keyword |
8032 * @param libraryUri the URI of the library being imported | 6541 * @param libraryUri the URI of the library being imported |
8033 * @param asToken the token representing the 'as' token | 6542 * @param asToken the token representing the 'as' token |
8034 * @param prefix the prefix to be used with the imported names | 6543 * @param prefix the prefix to be used with the imported names |
8035 * @param combinators the combinators used to control how names are imported | 6544 * @param combinators the combinators used to control how names are imported |
8036 * @param semicolon the semicolon terminating the directive | 6545 * @param semicolon the semicolon terminating the directive |
8037 */ | 6546 */ |
8038 ImportDirective.full(Comment comment, List<Annotation> metadata, Token keyword
, StringLiteral libraryUri, Token asToken, SimpleIdentifier prefix, List<Combina
tor> combinators, Token semicolon) : super.full(comment, metadata, keyword, libr
aryUri, combinators, semicolon) { | 6547 ImportDirective.full(Comment comment, List<Annotation> metadata, Token keyword
, StringLiteral libraryUri, Token asToken, SimpleIdentifier prefix, List<Combina
tor> combinators, Token semicolon) : super.full(comment, metadata, keyword, libr
aryUri, combinators, semicolon) { |
8039 this._asToken = asToken; | 6548 this.asToken = asToken; |
8040 this._prefix = becomeParentOf(prefix); | 6549 this._prefix = becomeParentOf(prefix); |
8041 } | 6550 } |
8042 | 6551 |
8043 /** | 6552 /** |
8044 * Initialize a newly created import directive. | 6553 * Initialize a newly created import directive. |
8045 * | 6554 * |
8046 * @param comment the documentation comment associated with this directive | 6555 * @param comment the documentation comment associated with this directive |
8047 * @param metadata the annotations associated with the directive | 6556 * @param metadata the annotations associated with the directive |
8048 * @param keyword the token representing the 'import' keyword | 6557 * @param keyword the token representing the 'import' keyword |
8049 * @param libraryUri the URI of the library being imported | 6558 * @param libraryUri the URI of the library being imported |
8050 * @param asToken the token representing the 'as' token | 6559 * @param asToken the token representing the 'as' token |
8051 * @param prefix the prefix to be used with the imported names | 6560 * @param prefix the prefix to be used with the imported names |
8052 * @param combinators the combinators used to control how names are imported | 6561 * @param combinators the combinators used to control how names are imported |
8053 * @param semicolon the semicolon terminating the directive | 6562 * @param semicolon the semicolon terminating the directive |
8054 */ | 6563 */ |
8055 ImportDirective({Comment comment, List<Annotation> metadata, Token keyword, St
ringLiteral libraryUri, Token asToken, SimpleIdentifier prefix, List<Combinator>
combinators, Token semicolon}) : this.full(comment, metadata, keyword, libraryU
ri, asToken, prefix, combinators, semicolon); | 6564 ImportDirective({Comment comment, List<Annotation> metadata, Token keyword, St
ringLiteral libraryUri, Token asToken, SimpleIdentifier prefix, List<Combinator>
combinators, Token semicolon}) : this.full(comment, metadata, keyword, libraryU
ri, asToken, prefix, combinators, semicolon); |
8056 accept(ASTVisitor visitor) => visitor.visitImportDirective(this); | 6565 accept(ASTVisitor visitor) => visitor.visitImportDirective(this); |
8057 | 6566 |
8058 /** | 6567 /** |
8059 * Return the token representing the 'as' token, or `null` if the imported nam
es are not | |
8060 * prefixed. | |
8061 * | |
8062 * @return the token representing the 'as' token | |
8063 */ | |
8064 Token get asToken => _asToken; | |
8065 | |
8066 /** | |
8067 * Return the prefix to be used with the imported names, or `null` if the impo
rted names are | 6568 * Return the prefix to be used with the imported names, or `null` if the impo
rted names are |
8068 * not prefixed. | 6569 * not prefixed. |
8069 * | 6570 * |
8070 * @return the prefix to be used with the imported names | 6571 * @return the prefix to be used with the imported names |
8071 */ | 6572 */ |
8072 SimpleIdentifier get prefix => _prefix; | 6573 SimpleIdentifier get prefix => _prefix; |
8073 LibraryElement get uriElement { | 6574 LibraryElement get uriElement { |
8074 Element element = this.element; | 6575 Element element2 = element; |
8075 if (element is ImportElement) { | 6576 if (element2 is ImportElement) { |
8076 return ((element as ImportElement)).importedLibrary; | 6577 return ((element2 as ImportElement)).importedLibrary; |
8077 } | 6578 } |
8078 return null; | 6579 return null; |
8079 } | 6580 } |
8080 | 6581 |
8081 /** | 6582 /** |
8082 * Set the token representing the 'as' token to the given token. | |
8083 * | |
8084 * @param asToken the token representing the 'as' token | |
8085 */ | |
8086 void set asToken(Token asToken2) { | |
8087 this._asToken = asToken2; | |
8088 } | |
8089 | |
8090 /** | |
8091 * Set the prefix to be used with the imported names to the given identifier. | 6583 * Set the prefix to be used with the imported names to the given identifier. |
8092 * | 6584 * |
8093 * @param prefix the prefix to be used with the imported names | 6585 * @param prefix the prefix to be used with the imported names |
8094 */ | 6586 */ |
8095 void set prefix(SimpleIdentifier prefix2) { | 6587 void set prefix(SimpleIdentifier prefix2) { |
8096 this._prefix = becomeParentOf(prefix2); | 6588 this._prefix = becomeParentOf(prefix2); |
8097 } | 6589 } |
8098 void visitChildren(ASTVisitor visitor) { | 6590 void visitChildren(ASTVisitor visitor) { |
8099 super.visitChildren(visitor); | 6591 super.visitChildren(visitor); |
8100 safelyVisitChild(_prefix, visitor); | 6592 safelyVisitChild(_prefix, visitor); |
(...skipping 15 matching lines...) Expand all Loading... |
8116 /** | 6608 /** |
8117 * The expression used to compute the object being indexed, or `null` if this
index | 6609 * The expression used to compute the object being indexed, or `null` if this
index |
8118 * expression is part of a cascade expression. | 6610 * expression is part of a cascade expression. |
8119 */ | 6611 */ |
8120 Expression _target; | 6612 Expression _target; |
8121 | 6613 |
8122 /** | 6614 /** |
8123 * The period ("..") before a cascaded index expression, or `null` if this ind
ex expression | 6615 * The period ("..") before a cascaded index expression, or `null` if this ind
ex expression |
8124 * is not part of a cascade expression. | 6616 * is not part of a cascade expression. |
8125 */ | 6617 */ |
8126 Token _period; | 6618 Token period; |
8127 | 6619 |
8128 /** | 6620 /** |
8129 * The left square bracket. | 6621 * The left square bracket. |
8130 */ | 6622 */ |
8131 Token _leftBracket; | 6623 Token _leftBracket; |
8132 | 6624 |
8133 /** | 6625 /** |
8134 * The expression used to compute the index. | 6626 * The expression used to compute the index. |
8135 */ | 6627 */ |
8136 Expression _index; | 6628 Expression _index; |
(...skipping 15 matching lines...) Expand all Loading... |
8152 * `null` if the AST structure has not been resolved or if the operator could
not be | 6644 * `null` if the AST structure has not been resolved or if the operator could
not be |
8153 * resolved. | 6645 * resolved. |
8154 */ | 6646 */ |
8155 MethodElement _propagatedElement; | 6647 MethodElement _propagatedElement; |
8156 | 6648 |
8157 /** | 6649 /** |
8158 * If this expression is both in a getter and setter context, the [AuxiliaryEl
ements] will | 6650 * If this expression is both in a getter and setter context, the [AuxiliaryEl
ements] will |
8159 * be set to hold onto the static and propagated information. The auxiliary el
ement will hold onto | 6651 * be set to hold onto the static and propagated information. The auxiliary el
ement will hold onto |
8160 * the elements from the getter context. | 6652 * the elements from the getter context. |
8161 */ | 6653 */ |
8162 AuxiliaryElements _auxiliaryElements = null; | 6654 AuxiliaryElements auxiliaryElements = null; |
8163 | 6655 |
8164 /** | 6656 /** |
8165 * Initialize a newly created index expression. | 6657 * Initialize a newly created index expression. |
8166 * | 6658 * |
8167 * @param target the expression used to compute the object being indexed | 6659 * @param target the expression used to compute the object being indexed |
8168 * @param leftBracket the left square bracket | 6660 * @param leftBracket the left square bracket |
8169 * @param index the expression used to compute the index | 6661 * @param index the expression used to compute the index |
8170 * @param rightBracket the right square bracket | 6662 * @param rightBracket the right square bracket |
8171 */ | 6663 */ |
8172 IndexExpression.forTarget_full(Expression target, Token leftBracket, Expressio
n index, Token rightBracket) { | 6664 IndexExpression.forTarget_full(Expression target, Token leftBracket, Expressio
n index, Token rightBracket) { |
(...skipping 15 matching lines...) Expand all Loading... |
8188 | 6680 |
8189 /** | 6681 /** |
8190 * Initialize a newly created index expression. | 6682 * Initialize a newly created index expression. |
8191 * | 6683 * |
8192 * @param period the period ("..") before a cascaded index expression | 6684 * @param period the period ("..") before a cascaded index expression |
8193 * @param leftBracket the left square bracket | 6685 * @param leftBracket the left square bracket |
8194 * @param index the expression used to compute the index | 6686 * @param index the expression used to compute the index |
8195 * @param rightBracket the right square bracket | 6687 * @param rightBracket the right square bracket |
8196 */ | 6688 */ |
8197 IndexExpression.forCascade_full(Token period, Token leftBracket, Expression in
dex, Token rightBracket) { | 6689 IndexExpression.forCascade_full(Token period, Token leftBracket, Expression in
dex, Token rightBracket) { |
8198 this._period = period; | 6690 this.period = period; |
8199 this._leftBracket = leftBracket; | 6691 this._leftBracket = leftBracket; |
8200 this._index = becomeParentOf(index); | 6692 this._index = becomeParentOf(index); |
8201 this._rightBracket = rightBracket; | 6693 this._rightBracket = rightBracket; |
8202 } | 6694 } |
8203 | 6695 |
8204 /** | 6696 /** |
8205 * Initialize a newly created index expression. | 6697 * Initialize a newly created index expression. |
8206 * | 6698 * |
8207 * @param period the period ("..") before a cascaded index expression | 6699 * @param period the period ("..") before a cascaded index expression |
8208 * @param leftBracket the left square bracket | 6700 * @param leftBracket the left square bracket |
8209 * @param index the expression used to compute the index | 6701 * @param index the expression used to compute the index |
8210 * @param rightBracket the right square bracket | 6702 * @param rightBracket the right square bracket |
8211 */ | 6703 */ |
8212 IndexExpression.forCascade({Token period, Token leftBracket, Expression index,
Token rightBracket}) : this.forCascade_full(period, leftBracket, index, rightBr
acket); | 6704 IndexExpression.forCascade({Token period, Token leftBracket, Expression index,
Token rightBracket}) : this.forCascade_full(period, leftBracket, index, rightBr
acket); |
8213 accept(ASTVisitor visitor) => visitor.visitIndexExpression(this); | 6705 accept(ASTVisitor visitor) => visitor.visitIndexExpression(this); |
8214 | |
8215 /** | |
8216 * Get the auxiliary elements, this will be `null` if the node is not in a get
ter and setter | |
8217 * context, or if it is not yet fully resolved. | |
8218 */ | |
8219 AuxiliaryElements get auxiliaryElements => _auxiliaryElements; | |
8220 Token get beginToken { | 6706 Token get beginToken { |
8221 if (_target != null) { | 6707 if (_target != null) { |
8222 return _target.beginToken; | 6708 return _target.beginToken; |
8223 } | 6709 } |
8224 return _period; | 6710 return period; |
8225 } | 6711 } |
8226 | 6712 |
8227 /** | 6713 /** |
8228 * Return the best element available for this operator. If resolution was able
to find a better | 6714 * Return the best element available for this operator. If resolution was able
to find a better |
8229 * element based on type propagation, that element will be returned. Otherwise
, the element found | 6715 * element based on type propagation, that element will be returned. Otherwise
, the element found |
8230 * using the result of static analysis will be returned. If resolution has not
been performed, | 6716 * using the result of static analysis will be returned. If resolution has not
been performed, |
8231 * then `null` will be returned. | 6717 * then `null` will be returned. |
8232 * | 6718 * |
8233 * @return the best element available for this operator | 6719 * @return the best element available for this operator |
8234 */ | 6720 */ |
(...skipping 14 matching lines...) Expand all Loading... |
8249 Expression get index => _index; | 6735 Expression get index => _index; |
8250 | 6736 |
8251 /** | 6737 /** |
8252 * Return the left square bracket. | 6738 * Return the left square bracket. |
8253 * | 6739 * |
8254 * @return the left square bracket | 6740 * @return the left square bracket |
8255 */ | 6741 */ |
8256 Token get leftBracket => _leftBracket; | 6742 Token get leftBracket => _leftBracket; |
8257 | 6743 |
8258 /** | 6744 /** |
8259 * Return the period ("..") before a cascaded index expression, or `null` if t
his index | |
8260 * expression is not part of a cascade expression. | |
8261 * | |
8262 * @return the period ("..") before a cascaded index expression | |
8263 */ | |
8264 Token get period => _period; | |
8265 | |
8266 /** | |
8267 * Return the element associated with the operator based on the propagated typ
e of the target, or | 6745 * Return the element associated with the operator based on the propagated typ
e of the target, or |
8268 * `null` if the AST structure has not been resolved or if the operator could
not be | 6746 * `null` if the AST structure has not been resolved or if the operator could
not be |
8269 * resolved. One example of the latter case is an operator that is not defined
for the type of the | 6747 * resolved. One example of the latter case is an operator that is not defined
for the type of the |
8270 * target. | 6748 * target. |
8271 * | 6749 * |
8272 * @return the element associated with this operator | 6750 * @return the element associated with this operator |
8273 */ | 6751 */ |
8274 MethodElement get propagatedElement => _propagatedElement; | 6752 MethodElement get propagatedElement => _propagatedElement; |
8275 | 6753 |
8276 /** | 6754 /** |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8365 } | 6843 } |
8366 bool get isAssignable => true; | 6844 bool get isAssignable => true; |
8367 | 6845 |
8368 /** | 6846 /** |
8369 * Return `true` if this expression is cascaded. If it is, then the target of
this | 6847 * Return `true` if this expression is cascaded. If it is, then the target of
this |
8370 * expression is not stored locally but is stored in the nearest ancestor that
is a | 6848 * expression is not stored locally but is stored in the nearest ancestor that
is a |
8371 * [CascadeExpression]. | 6849 * [CascadeExpression]. |
8372 * | 6850 * |
8373 * @return `true` if this expression is cascaded | 6851 * @return `true` if this expression is cascaded |
8374 */ | 6852 */ |
8375 bool get isCascaded => _period != null; | 6853 bool get isCascaded => period != null; |
8376 | |
8377 /** | |
8378 * Set the auxiliary elements. | |
8379 */ | |
8380 void set auxiliaryElements(AuxiliaryElements auxiliaryElements2) { | |
8381 this._auxiliaryElements = auxiliaryElements2; | |
8382 } | |
8383 | 6854 |
8384 /** | 6855 /** |
8385 * Set the expression used to compute the index to the given expression. | 6856 * Set the expression used to compute the index to the given expression. |
8386 * | 6857 * |
8387 * @param expression the expression used to compute the index | 6858 * @param expression the expression used to compute the index |
8388 */ | 6859 */ |
8389 void set index(Expression expression) { | 6860 void set index(Expression expression) { |
8390 _index = becomeParentOf(expression); | 6861 _index = becomeParentOf(expression); |
8391 } | 6862 } |
8392 | 6863 |
8393 /** | 6864 /** |
8394 * Set the left square bracket to the given token. | 6865 * Set the left square bracket to the given token. |
8395 * | 6866 * |
8396 * @param bracket the left square bracket | 6867 * @param bracket the left square bracket |
8397 */ | 6868 */ |
8398 void set leftBracket(Token bracket) { | 6869 void set leftBracket(Token bracket) { |
8399 _leftBracket = bracket; | 6870 _leftBracket = bracket; |
8400 } | 6871 } |
8401 | 6872 |
8402 /** | 6873 /** |
8403 * Set the period ("..") before a cascaded index expression to the given token
. | |
8404 * | |
8405 * @param period the period ("..") before a cascaded index expression | |
8406 */ | |
8407 void set period(Token period2) { | |
8408 this._period = period2; | |
8409 } | |
8410 | |
8411 /** | |
8412 * Set the element associated with the operator based on the propagated type o
f the target to the | 6874 * Set the element associated with the operator based on the propagated type o
f the target to the |
8413 * given element. | 6875 * given element. |
8414 * | 6876 * |
8415 * @param element the element to be associated with this operator | 6877 * @param element the element to be associated with this operator |
8416 */ | 6878 */ |
8417 void set propagatedElement(MethodElement element) { | 6879 void set propagatedElement(MethodElement element) { |
8418 _propagatedElement = element; | 6880 _propagatedElement = element; |
8419 } | 6881 } |
8420 | 6882 |
8421 /** | 6883 /** |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8501 * ('new' | 'const') [TypeName] ('.' [SimpleIdentifier])? [ArgumentList] | 6963 * ('new' | 'const') [TypeName] ('.' [SimpleIdentifier])? [ArgumentList] |
8502 * </pre> | 6964 * </pre> |
8503 * | 6965 * |
8504 * @coverage dart.engine.ast | 6966 * @coverage dart.engine.ast |
8505 */ | 6967 */ |
8506 class InstanceCreationExpression extends Expression { | 6968 class InstanceCreationExpression extends Expression { |
8507 | 6969 |
8508 /** | 6970 /** |
8509 * The keyword used to indicate how an object should be created. | 6971 * The keyword used to indicate how an object should be created. |
8510 */ | 6972 */ |
8511 Token _keyword; | 6973 Token keyword; |
8512 | 6974 |
8513 /** | 6975 /** |
8514 * The name of the constructor to be invoked. | 6976 * The name of the constructor to be invoked. |
8515 */ | 6977 */ |
8516 ConstructorName _constructorName; | 6978 ConstructorName constructorName; |
8517 | 6979 |
8518 /** | 6980 /** |
8519 * The list of arguments to the constructor. | 6981 * The list of arguments to the constructor. |
8520 */ | 6982 */ |
8521 ArgumentList _argumentList; | 6983 ArgumentList _argumentList; |
8522 | 6984 |
8523 /** | 6985 /** |
8524 * The element associated with the constructor based on static type informatio
n, or `null` | 6986 * The element associated with the constructor based on static type informatio
n, or `null` |
8525 * if the AST structure has not been resolved or if the constructor could not
be resolved. | 6987 * if the AST structure has not been resolved or if the constructor could not
be resolved. |
8526 */ | 6988 */ |
8527 ConstructorElement _staticElement; | 6989 ConstructorElement staticElement; |
8528 | 6990 |
8529 /** | 6991 /** |
8530 * The element associated with the constructor based on propagated type inform
ation, or | 6992 * The element associated with the constructor based on propagated type inform
ation, or |
8531 * `null` if the AST structure has not been resolved or if the constructor cou
ld not be | 6993 * `null` if the AST structure has not been resolved or if the constructor cou
ld not be |
8532 * resolved. | 6994 * resolved. |
8533 */ | 6995 */ |
8534 ConstructorElement _propagatedElement; | 6996 ConstructorElement element; |
8535 | 6997 |
8536 /** | 6998 /** |
8537 * Initialize a newly created instance creation expression. | 6999 * Initialize a newly created instance creation expression. |
8538 * | 7000 * |
8539 * @param keyword the keyword used to indicate how an object should be created | 7001 * @param keyword the keyword used to indicate how an object should be created |
8540 * @param constructorName the name of the constructor to be invoked | 7002 * @param constructorName the name of the constructor to be invoked |
8541 * @param argumentList the list of arguments to the constructor | 7003 * @param argumentList the list of arguments to the constructor |
8542 */ | 7004 */ |
8543 InstanceCreationExpression.full(Token keyword, ConstructorName constructorName
, ArgumentList argumentList) { | 7005 InstanceCreationExpression.full(Token keyword, ConstructorName constructorName
, ArgumentList argumentList) { |
8544 this._keyword = keyword; | 7006 this.keyword = keyword; |
8545 this._constructorName = becomeParentOf(constructorName); | 7007 this.constructorName = becomeParentOf(constructorName); |
8546 this._argumentList = becomeParentOf(argumentList); | 7008 this._argumentList = becomeParentOf(argumentList); |
8547 } | 7009 } |
8548 | 7010 |
8549 /** | 7011 /** |
8550 * Initialize a newly created instance creation expression. | 7012 * Initialize a newly created instance creation expression. |
8551 * | 7013 * |
8552 * @param keyword the keyword used to indicate how an object should be created | 7014 * @param keyword the keyword used to indicate how an object should be created |
8553 * @param constructorName the name of the constructor to be invoked | 7015 * @param constructorName the name of the constructor to be invoked |
8554 * @param argumentList the list of arguments to the constructor | 7016 * @param argumentList the list of arguments to the constructor |
8555 */ | 7017 */ |
8556 InstanceCreationExpression({Token keyword, ConstructorName constructorName, Ar
gumentList argumentList}) : this.full(keyword, constructorName, argumentList); | 7018 InstanceCreationExpression({Token keyword, ConstructorName constructorName, Ar
gumentList argumentList}) : this.full(keyword, constructorName, argumentList); |
8557 accept(ASTVisitor visitor) => visitor.visitInstanceCreationExpression(this); | 7019 accept(ASTVisitor visitor) => visitor.visitInstanceCreationExpression(this); |
8558 | 7020 |
8559 /** | 7021 /** |
8560 * Return the list of arguments to the constructor. | 7022 * Return the list of arguments to the constructor. |
8561 * | 7023 * |
8562 * @return the list of arguments to the constructor | 7024 * @return the list of arguments to the constructor |
8563 */ | 7025 */ |
8564 ArgumentList get argumentList => _argumentList; | 7026 ArgumentList get argumentList => _argumentList; |
8565 Token get beginToken => _keyword; | 7027 Token get beginToken => keyword; |
8566 | |
8567 /** | |
8568 * Return the name of the constructor to be invoked. | |
8569 * | |
8570 * @return the name of the constructor to be invoked | |
8571 */ | |
8572 ConstructorName get constructorName => _constructorName; | |
8573 | |
8574 /** | |
8575 * Return the element associated with the constructor based on propagated type
information, or | |
8576 * `null` if the AST structure has not been resolved or if the constructor cou
ld not be | |
8577 * resolved. | |
8578 * | |
8579 * @return the element associated with the constructor | |
8580 */ | |
8581 ConstructorElement get element => _propagatedElement; | |
8582 Token get endToken => _argumentList.endToken; | 7028 Token get endToken => _argumentList.endToken; |
8583 | 7029 |
8584 /** | 7030 /** |
8585 * Return the keyword used to indicate how an object should be created. | |
8586 * | |
8587 * @return the keyword used to indicate how an object should be created | |
8588 */ | |
8589 Token get keyword => _keyword; | |
8590 | |
8591 /** | |
8592 * Return the element associated with the constructor based on static type inf
ormation, or | |
8593 * `null` if the AST structure has not been resolved or if the constructor cou
ld not be | |
8594 * resolved. | |
8595 * | |
8596 * @return the element associated with the constructor | |
8597 */ | |
8598 ConstructorElement get staticElement => _staticElement; | |
8599 | |
8600 /** | |
8601 * Return `true` if this creation expression is used to invoke a constant cons
tructor. | 7031 * Return `true` if this creation expression is used to invoke a constant cons
tructor. |
8602 * | 7032 * |
8603 * @return `true` if this creation expression is used to invoke a constant con
structor | 7033 * @return `true` if this creation expression is used to invoke a constant con
structor |
8604 */ | 7034 */ |
8605 bool get isConst => _keyword is KeywordToken && identical(((_keyword as Keywor
dToken)).keyword, Keyword.CONST); | 7035 bool get isConst => keyword is KeywordToken && identical(((keyword as KeywordT
oken)).keyword, Keyword.CONST); |
8606 | 7036 |
8607 /** | 7037 /** |
8608 * Set the list of arguments to the constructor to the given list. | 7038 * Set the list of arguments to the constructor to the given list. |
8609 * | 7039 * |
8610 * @param argumentList the list of arguments to the constructor | 7040 * @param argumentList the list of arguments to the constructor |
8611 */ | 7041 */ |
8612 void set argumentList(ArgumentList argumentList2) { | 7042 void set argumentList(ArgumentList argumentList2) { |
8613 this._argumentList = becomeParentOf(argumentList2); | 7043 this._argumentList = becomeParentOf(argumentList2); |
8614 } | 7044 } |
8615 | |
8616 /** | |
8617 * Set the name of the constructor to be invoked to the given name. | |
8618 * | |
8619 * @param constructorName the name of the constructor to be invoked | |
8620 */ | |
8621 void set constructorName(ConstructorName constructorName2) { | |
8622 this._constructorName = constructorName2; | |
8623 } | |
8624 | |
8625 /** | |
8626 * Set the element associated with the constructor based on propagated type in
formation to the | |
8627 * given element. | |
8628 * | |
8629 * @param element the element to be associated with the constructor | |
8630 */ | |
8631 void set element(ConstructorElement element2) { | |
8632 this._propagatedElement = element2; | |
8633 } | |
8634 | |
8635 /** | |
8636 * Set the keyword used to indicate how an object should be created to the giv
en keyword. | |
8637 * | |
8638 * @param keyword the keyword used to indicate how an object should be created | |
8639 */ | |
8640 void set keyword(Token keyword2) { | |
8641 this._keyword = keyword2; | |
8642 } | |
8643 | |
8644 /** | |
8645 * Set the element associated with the constructor based on static type inform
ation to the given | |
8646 * element. | |
8647 * | |
8648 * @param element the element to be associated with the constructor | |
8649 */ | |
8650 void set staticElement(ConstructorElement element) { | |
8651 this._staticElement = element; | |
8652 } | |
8653 void visitChildren(ASTVisitor visitor) { | 7045 void visitChildren(ASTVisitor visitor) { |
8654 safelyVisitChild(_constructorName, visitor); | 7046 safelyVisitChild(constructorName, visitor); |
8655 safelyVisitChild(_argumentList, visitor); | 7047 safelyVisitChild(_argumentList, visitor); |
8656 } | 7048 } |
8657 } | 7049 } |
8658 /** | 7050 /** |
8659 * Instances of the class `IntegerLiteral` represent an integer literal expressi
on. | 7051 * Instances of the class `IntegerLiteral` represent an integer literal expressi
on. |
8660 * | 7052 * |
8661 * <pre> | 7053 * <pre> |
8662 * integerLiteral ::= | 7054 * integerLiteral ::= |
8663 * decimalIntegerLiteral | 7055 * decimalIntegerLiteral |
8664 * | hexidecimalIntegerLiteral | 7056 * | hexidecimalIntegerLiteral |
8665 * | 7057 * |
8666 * decimalIntegerLiteral ::= | 7058 * decimalIntegerLiteral ::= |
8667 * decimalDigit+ | 7059 * decimalDigit+ |
8668 * | 7060 * |
8669 * hexidecimalIntegerLiteral ::= | 7061 * hexidecimalIntegerLiteral ::= |
8670 * '0x' hexidecimalDigit+ | 7062 * '0x' hexidecimalDigit+ |
8671 * | '0X' hexidecimalDigit+ | 7063 * | '0X' hexidecimalDigit+ |
8672 * </pre> | 7064 * </pre> |
8673 * | 7065 * |
8674 * @coverage dart.engine.ast | 7066 * @coverage dart.engine.ast |
8675 */ | 7067 */ |
8676 class IntegerLiteral extends Literal { | 7068 class IntegerLiteral extends Literal { |
8677 | 7069 |
8678 /** | 7070 /** |
8679 * The token representing the literal. | 7071 * The token representing the literal. |
8680 */ | 7072 */ |
8681 Token _literal; | 7073 Token literal; |
8682 | 7074 |
8683 /** | 7075 /** |
8684 * The value of the literal. | 7076 * The value of the literal. |
8685 */ | 7077 */ |
8686 int _value = 0; | 7078 int value = 0; |
8687 | 7079 |
8688 /** | 7080 /** |
8689 * Initialize a newly created integer literal. | 7081 * Initialize a newly created integer literal. |
8690 * | 7082 * |
8691 * @param literal the token representing the literal | 7083 * @param literal the token representing the literal |
8692 * @param value the value of the literal | 7084 * @param value the value of the literal |
8693 */ | 7085 */ |
8694 IntegerLiteral.full(Token literal, int value) { | 7086 IntegerLiteral.full(Token literal, int value) { |
8695 this._literal = literal; | 7087 this.literal = literal; |
8696 this._value = value; | 7088 this.value = value; |
8697 } | 7089 } |
8698 | 7090 |
8699 /** | 7091 /** |
8700 * Initialize a newly created integer literal. | 7092 * Initialize a newly created integer literal. |
8701 * | 7093 * |
8702 * @param literal the token representing the literal | 7094 * @param literal the token representing the literal |
8703 * @param value the value of the literal | 7095 * @param value the value of the literal |
8704 */ | 7096 */ |
8705 IntegerLiteral({Token literal, int value}) : this.full(literal, value); | 7097 IntegerLiteral({Token literal, int value}) : this.full(literal, value); |
8706 accept(ASTVisitor visitor) => visitor.visitIntegerLiteral(this); | 7098 accept(ASTVisitor visitor) => visitor.visitIntegerLiteral(this); |
8707 Token get beginToken => _literal; | 7099 Token get beginToken => literal; |
8708 Token get endToken => _literal; | 7100 Token get endToken => literal; |
8709 | |
8710 /** | |
8711 * Return the token representing the literal. | |
8712 * | |
8713 * @return the token representing the literal | |
8714 */ | |
8715 Token get literal => _literal; | |
8716 | |
8717 /** | |
8718 * Return the value of the literal. | |
8719 * | |
8720 * @return the value of the literal | |
8721 */ | |
8722 int get value => _value; | |
8723 | |
8724 /** | |
8725 * Set the token representing the literal to the given token. | |
8726 * | |
8727 * @param literal the token representing the literal | |
8728 */ | |
8729 void set literal(Token literal2) { | |
8730 this._literal = literal2; | |
8731 } | |
8732 | |
8733 /** | |
8734 * Set the value of the literal to the given value. | |
8735 * | |
8736 * @param value the value of the literal | |
8737 */ | |
8738 void set value(int value2) { | |
8739 this._value = value2; | |
8740 } | |
8741 void visitChildren(ASTVisitor visitor) { | 7101 void visitChildren(ASTVisitor visitor) { |
8742 } | 7102 } |
8743 } | 7103 } |
8744 /** | 7104 /** |
8745 * The abstract class `InterpolationElement` defines the behavior common to elem
ents within a | 7105 * The abstract class `InterpolationElement` defines the behavior common to elem
ents within a |
8746 * [StringInterpolation]. | 7106 * [StringInterpolation]. |
8747 * | 7107 * |
8748 * <pre> | 7108 * <pre> |
8749 * interpolationElement ::= | 7109 * interpolationElement ::= |
8750 * [InterpolationExpression] | 7110 * [InterpolationExpression] |
(...skipping 15 matching lines...) Expand all Loading... |
8766 * </pre> | 7126 * </pre> |
8767 * | 7127 * |
8768 * @coverage dart.engine.ast | 7128 * @coverage dart.engine.ast |
8769 */ | 7129 */ |
8770 class InterpolationExpression extends InterpolationElement { | 7130 class InterpolationExpression extends InterpolationElement { |
8771 | 7131 |
8772 /** | 7132 /** |
8773 * The token used to introduce the interpolation expression; either '$' if the
expression is a | 7133 * The token used to introduce the interpolation expression; either '$' if the
expression is a |
8774 * simple identifier or '${' if the expression is a full expression. | 7134 * simple identifier or '${' if the expression is a full expression. |
8775 */ | 7135 */ |
8776 Token _leftBracket; | 7136 Token leftBracket; |
8777 | 7137 |
8778 /** | 7138 /** |
8779 * The expression to be evaluated for the value to be converted into a string. | 7139 * The expression to be evaluated for the value to be converted into a string. |
8780 */ | 7140 */ |
8781 Expression _expression; | 7141 Expression _expression; |
8782 | 7142 |
8783 /** | 7143 /** |
8784 * The right curly bracket, or `null` if the expression is an identifier witho
ut brackets. | 7144 * The right curly bracket, or `null` if the expression is an identifier witho
ut brackets. |
8785 */ | 7145 */ |
8786 Token _rightBracket; | 7146 Token rightBracket; |
8787 | 7147 |
8788 /** | 7148 /** |
8789 * Initialize a newly created interpolation expression. | 7149 * Initialize a newly created interpolation expression. |
8790 * | 7150 * |
8791 * @param leftBracket the left curly bracket | 7151 * @param leftBracket the left curly bracket |
8792 * @param expression the expression to be evaluated for the value to be conver
ted into a string | 7152 * @param expression the expression to be evaluated for the value to be conver
ted into a string |
8793 * @param rightBracket the right curly bracket | 7153 * @param rightBracket the right curly bracket |
8794 */ | 7154 */ |
8795 InterpolationExpression.full(Token leftBracket, Expression expression, Token r
ightBracket) { | 7155 InterpolationExpression.full(Token leftBracket, Expression expression, Token r
ightBracket) { |
8796 this._leftBracket = leftBracket; | 7156 this.leftBracket = leftBracket; |
8797 this._expression = becomeParentOf(expression); | 7157 this._expression = becomeParentOf(expression); |
8798 this._rightBracket = rightBracket; | 7158 this.rightBracket = rightBracket; |
8799 } | 7159 } |
8800 | 7160 |
8801 /** | 7161 /** |
8802 * Initialize a newly created interpolation expression. | 7162 * Initialize a newly created interpolation expression. |
8803 * | 7163 * |
8804 * @param leftBracket the left curly bracket | 7164 * @param leftBracket the left curly bracket |
8805 * @param expression the expression to be evaluated for the value to be conver
ted into a string | 7165 * @param expression the expression to be evaluated for the value to be conver
ted into a string |
8806 * @param rightBracket the right curly bracket | 7166 * @param rightBracket the right curly bracket |
8807 */ | 7167 */ |
8808 InterpolationExpression({Token leftBracket, Expression expression, Token right
Bracket}) : this.full(leftBracket, expression, rightBracket); | 7168 InterpolationExpression({Token leftBracket, Expression expression, Token right
Bracket}) : this.full(leftBracket, expression, rightBracket); |
8809 accept(ASTVisitor visitor) => visitor.visitInterpolationExpression(this); | 7169 accept(ASTVisitor visitor) => visitor.visitInterpolationExpression(this); |
8810 Token get beginToken => _leftBracket; | 7170 Token get beginToken => leftBracket; |
8811 Token get endToken { | 7171 Token get endToken { |
8812 if (_rightBracket != null) { | 7172 if (rightBracket != null) { |
8813 return _rightBracket; | 7173 return rightBracket; |
8814 } | 7174 } |
8815 return _expression.endToken; | 7175 return _expression.endToken; |
8816 } | 7176 } |
8817 | 7177 |
8818 /** | 7178 /** |
8819 * Return the expression to be evaluated for the value to be converted into a
string. | 7179 * Return the expression to be evaluated for the value to be converted into a
string. |
8820 * | 7180 * |
8821 * @return the expression to be evaluated for the value to be converted into a
string | 7181 * @return the expression to be evaluated for the value to be converted into a
string |
8822 */ | 7182 */ |
8823 Expression get expression => _expression; | 7183 Expression get expression => _expression; |
8824 | 7184 |
8825 /** | 7185 /** |
8826 * Return the left curly bracket. | |
8827 * | |
8828 * @return the left curly bracket | |
8829 */ | |
8830 Token get leftBracket => _leftBracket; | |
8831 | |
8832 /** | |
8833 * Return the right curly bracket. | |
8834 * | |
8835 * @return the right curly bracket | |
8836 */ | |
8837 Token get rightBracket => _rightBracket; | |
8838 | |
8839 /** | |
8840 * Set the expression to be evaluated for the value to be converted into a str
ing to the given | 7186 * Set the expression to be evaluated for the value to be converted into a str
ing to the given |
8841 * expression. | 7187 * expression. |
8842 * | 7188 * |
8843 * @param expression the expression to be evaluated for the value to be conver
ted into a string | 7189 * @param expression the expression to be evaluated for the value to be conver
ted into a string |
8844 */ | 7190 */ |
8845 void set expression(Expression expression2) { | 7191 void set expression(Expression expression2) { |
8846 this._expression = becomeParentOf(expression2); | 7192 this._expression = becomeParentOf(expression2); |
8847 } | 7193 } |
8848 | |
8849 /** | |
8850 * Set the left curly bracket to the given token. | |
8851 * | |
8852 * @param leftBracket the left curly bracket | |
8853 */ | |
8854 void set leftBracket(Token leftBracket2) { | |
8855 this._leftBracket = leftBracket2; | |
8856 } | |
8857 | |
8858 /** | |
8859 * Set the right curly bracket to the given token. | |
8860 * | |
8861 * @param rightBracket the right curly bracket | |
8862 */ | |
8863 void set rightBracket(Token rightBracket2) { | |
8864 this._rightBracket = rightBracket2; | |
8865 } | |
8866 void visitChildren(ASTVisitor visitor) { | 7194 void visitChildren(ASTVisitor visitor) { |
8867 safelyVisitChild(_expression, visitor); | 7195 safelyVisitChild(_expression, visitor); |
8868 } | 7196 } |
8869 } | 7197 } |
8870 /** | 7198 /** |
8871 * Instances of the class `InterpolationString` represent a non-empty substring
of an | 7199 * Instances of the class `InterpolationString` represent a non-empty substring
of an |
8872 * interpolated string. | 7200 * interpolated string. |
8873 * | 7201 * |
8874 * <pre> | 7202 * <pre> |
8875 * interpolationString ::= | 7203 * interpolationString ::= |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8959 class IsExpression extends Expression { | 7287 class IsExpression extends Expression { |
8960 | 7288 |
8961 /** | 7289 /** |
8962 * The expression used to compute the value whose type is being tested. | 7290 * The expression used to compute the value whose type is being tested. |
8963 */ | 7291 */ |
8964 Expression _expression; | 7292 Expression _expression; |
8965 | 7293 |
8966 /** | 7294 /** |
8967 * The is operator. | 7295 * The is operator. |
8968 */ | 7296 */ |
8969 Token _isOperator; | 7297 Token isOperator; |
8970 | 7298 |
8971 /** | 7299 /** |
8972 * The not operator, or `null` if the sense of the test is not negated. | 7300 * The not operator, or `null` if the sense of the test is not negated. |
8973 */ | 7301 */ |
8974 Token _notOperator; | 7302 Token notOperator; |
8975 | 7303 |
8976 /** | 7304 /** |
8977 * The name of the type being tested for. | 7305 * The name of the type being tested for. |
8978 */ | 7306 */ |
8979 TypeName _type; | 7307 TypeName _type; |
8980 | 7308 |
8981 /** | 7309 /** |
8982 * Initialize a newly created is expression. | 7310 * Initialize a newly created is expression. |
8983 * | 7311 * |
8984 * @param expression the expression used to compute the value whose type is be
ing tested | 7312 * @param expression the expression used to compute the value whose type is be
ing tested |
8985 * @param isOperator the is operator | 7313 * @param isOperator the is operator |
8986 * @param notOperator the not operator, or `null` if the sense of the test is
not negated | 7314 * @param notOperator the not operator, or `null` if the sense of the test is
not negated |
8987 * @param type the name of the type being tested for | 7315 * @param type the name of the type being tested for |
8988 */ | 7316 */ |
8989 IsExpression.full(Expression expression, Token isOperator, Token notOperator,
TypeName type) { | 7317 IsExpression.full(Expression expression, Token isOperator, Token notOperator,
TypeName type) { |
8990 this._expression = becomeParentOf(expression); | 7318 this._expression = becomeParentOf(expression); |
8991 this._isOperator = isOperator; | 7319 this.isOperator = isOperator; |
8992 this._notOperator = notOperator; | 7320 this.notOperator = notOperator; |
8993 this._type = becomeParentOf(type); | 7321 this._type = becomeParentOf(type); |
8994 } | 7322 } |
8995 | 7323 |
8996 /** | 7324 /** |
8997 * Initialize a newly created is expression. | 7325 * Initialize a newly created is expression. |
8998 * | 7326 * |
8999 * @param expression the expression used to compute the value whose type is be
ing tested | 7327 * @param expression the expression used to compute the value whose type is be
ing tested |
9000 * @param isOperator the is operator | 7328 * @param isOperator the is operator |
9001 * @param notOperator the not operator, or `null` if the sense of the test is
not negated | 7329 * @param notOperator the not operator, or `null` if the sense of the test is
not negated |
9002 * @param type the name of the type being tested for | 7330 * @param type the name of the type being tested for |
9003 */ | 7331 */ |
9004 IsExpression({Expression expression, Token isOperator, Token notOperator, Type
Name type}) : this.full(expression, isOperator, notOperator, type); | 7332 IsExpression({Expression expression, Token isOperator, Token notOperator, Type
Name type}) : this.full(expression, isOperator, notOperator, type); |
9005 accept(ASTVisitor visitor) => visitor.visitIsExpression(this); | 7333 accept(ASTVisitor visitor) => visitor.visitIsExpression(this); |
9006 Token get beginToken => _expression.beginToken; | 7334 Token get beginToken => _expression.beginToken; |
9007 Token get endToken => _type.endToken; | 7335 Token get endToken => _type.endToken; |
9008 | 7336 |
9009 /** | 7337 /** |
9010 * Return the expression used to compute the value whose type is being tested. | 7338 * Return the expression used to compute the value whose type is being tested. |
9011 * | 7339 * |
9012 * @return the expression used to compute the value whose type is being tested | 7340 * @return the expression used to compute the value whose type is being tested |
9013 */ | 7341 */ |
9014 Expression get expression => _expression; | 7342 Expression get expression => _expression; |
9015 | 7343 |
9016 /** | 7344 /** |
9017 * Return the is operator being applied. | |
9018 * | |
9019 * @return the is operator being applied | |
9020 */ | |
9021 Token get isOperator => _isOperator; | |
9022 | |
9023 /** | |
9024 * Return the not operator being applied. | |
9025 * | |
9026 * @return the not operator being applied | |
9027 */ | |
9028 Token get notOperator => _notOperator; | |
9029 | |
9030 /** | |
9031 * Return the name of the type being tested for. | 7345 * Return the name of the type being tested for. |
9032 * | 7346 * |
9033 * @return the name of the type being tested for | 7347 * @return the name of the type being tested for |
9034 */ | 7348 */ |
9035 TypeName get type => _type; | 7349 TypeName get type => _type; |
9036 | 7350 |
9037 /** | 7351 /** |
9038 * Set the expression used to compute the value whose type is being tested to
the given | 7352 * Set the expression used to compute the value whose type is being tested to
the given |
9039 * expression. | 7353 * expression. |
9040 * | 7354 * |
9041 * @param expression the expression used to compute the value whose type is be
ing tested | 7355 * @param expression the expression used to compute the value whose type is be
ing tested |
9042 */ | 7356 */ |
9043 void set expression(Expression expression2) { | 7357 void set expression(Expression expression2) { |
9044 this._expression = becomeParentOf(expression2); | 7358 this._expression = becomeParentOf(expression2); |
9045 } | 7359 } |
9046 | 7360 |
9047 /** | 7361 /** |
9048 * Set the is operator being applied to the given operator. | |
9049 * | |
9050 * @param isOperator the is operator being applied | |
9051 */ | |
9052 void set isOperator(Token isOperator2) { | |
9053 this._isOperator = isOperator2; | |
9054 } | |
9055 | |
9056 /** | |
9057 * Set the not operator being applied to the given operator. | |
9058 * | |
9059 * @param notOperator the is operator being applied | |
9060 */ | |
9061 void set notOperator(Token notOperator2) { | |
9062 this._notOperator = notOperator2; | |
9063 } | |
9064 | |
9065 /** | |
9066 * Set the name of the type being tested for to the given name. | 7362 * Set the name of the type being tested for to the given name. |
9067 * | 7363 * |
9068 * @param name the name of the type being tested for | 7364 * @param name the name of the type being tested for |
9069 */ | 7365 */ |
9070 void set type(TypeName name) { | 7366 void set type(TypeName name) { |
9071 this._type = becomeParentOf(name); | 7367 this._type = becomeParentOf(name); |
9072 } | 7368 } |
9073 void visitChildren(ASTVisitor visitor) { | 7369 void visitChildren(ASTVisitor visitor) { |
9074 safelyVisitChild(_expression, visitor); | 7370 safelyVisitChild(_expression, visitor); |
9075 safelyVisitChild(_type, visitor); | 7371 safelyVisitChild(_type, visitor); |
(...skipping 12 matching lines...) Expand all Loading... |
9088 class Label extends ASTNode { | 7384 class Label extends ASTNode { |
9089 | 7385 |
9090 /** | 7386 /** |
9091 * The label being associated with the statement. | 7387 * The label being associated with the statement. |
9092 */ | 7388 */ |
9093 SimpleIdentifier _label; | 7389 SimpleIdentifier _label; |
9094 | 7390 |
9095 /** | 7391 /** |
9096 * The colon that separates the label from the statement. | 7392 * The colon that separates the label from the statement. |
9097 */ | 7393 */ |
9098 Token _colon; | 7394 Token colon; |
9099 | 7395 |
9100 /** | 7396 /** |
9101 * Initialize a newly created label. | 7397 * Initialize a newly created label. |
9102 * | 7398 * |
9103 * @param label the label being applied | 7399 * @param label the label being applied |
9104 * @param colon the colon that separates the label from whatever follows | 7400 * @param colon the colon that separates the label from whatever follows |
9105 */ | 7401 */ |
9106 Label.full(SimpleIdentifier label, Token colon) { | 7402 Label.full(SimpleIdentifier label, Token colon) { |
9107 this._label = becomeParentOf(label); | 7403 this._label = becomeParentOf(label); |
9108 this._colon = colon; | 7404 this.colon = colon; |
9109 } | 7405 } |
9110 | 7406 |
9111 /** | 7407 /** |
9112 * Initialize a newly created label. | 7408 * Initialize a newly created label. |
9113 * | 7409 * |
9114 * @param label the label being applied | 7410 * @param label the label being applied |
9115 * @param colon the colon that separates the label from whatever follows | 7411 * @param colon the colon that separates the label from whatever follows |
9116 */ | 7412 */ |
9117 Label({SimpleIdentifier label, Token colon}) : this.full(label, colon); | 7413 Label({SimpleIdentifier label, Token colon}) : this.full(label, colon); |
9118 accept(ASTVisitor visitor) => visitor.visitLabel(this); | 7414 accept(ASTVisitor visitor) => visitor.visitLabel(this); |
9119 Token get beginToken => _label.beginToken; | 7415 Token get beginToken => _label.beginToken; |
9120 | 7416 Token get endToken => colon; |
9121 /** | |
9122 * Return the colon that separates the label from the statement. | |
9123 * | |
9124 * @return the colon that separates the label from the statement | |
9125 */ | |
9126 Token get colon => _colon; | |
9127 Token get endToken => _colon; | |
9128 | 7417 |
9129 /** | 7418 /** |
9130 * Return the label being associated with the statement. | 7419 * Return the label being associated with the statement. |
9131 * | 7420 * |
9132 * @return the label being associated with the statement | 7421 * @return the label being associated with the statement |
9133 */ | 7422 */ |
9134 SimpleIdentifier get label => _label; | 7423 SimpleIdentifier get label => _label; |
9135 | 7424 |
9136 /** | 7425 /** |
9137 * Set the colon that separates the label from the statement to the given toke
n. | |
9138 * | |
9139 * @param colon the colon that separates the label from the statement | |
9140 */ | |
9141 void set colon(Token colon2) { | |
9142 this._colon = colon2; | |
9143 } | |
9144 | |
9145 /** | |
9146 * Set the label being associated with the statement to the given label. | 7426 * Set the label being associated with the statement to the given label. |
9147 * | 7427 * |
9148 * @param label the label being associated with the statement | 7428 * @param label the label being associated with the statement |
9149 */ | 7429 */ |
9150 void set label(SimpleIdentifier label2) { | 7430 void set label(SimpleIdentifier label2) { |
9151 this._label = becomeParentOf(label2); | 7431 this._label = becomeParentOf(label2); |
9152 } | 7432 } |
9153 void visitChildren(ASTVisitor visitor) { | 7433 void visitChildren(ASTVisitor visitor) { |
9154 safelyVisitChild(_label, visitor); | 7434 safelyVisitChild(_label, visitor); |
9155 } | 7435 } |
9156 } | 7436 } |
9157 /** | 7437 /** |
9158 * Instances of the class `LabeledStatement` represent a statement that has a la
bel associated | 7438 * Instances of the class `LabeledStatement` represent a statement that has a la
bel associated |
9159 * with them. | 7439 * with them. |
9160 * | 7440 * |
9161 * <pre> | 7441 * <pre> |
9162 * labeledStatement ::= | 7442 * labeledStatement ::= |
9163 * [Label]+ [Statement] | 7443 * [Label]+ [Statement] |
9164 * </pre> | 7444 * </pre> |
9165 * | 7445 * |
9166 * @coverage dart.engine.ast | 7446 * @coverage dart.engine.ast |
9167 */ | 7447 */ |
9168 class LabeledStatement extends Statement { | 7448 class LabeledStatement extends Statement { |
9169 | 7449 |
9170 /** | 7450 /** |
9171 * The labels being associated with the statement. | 7451 * The labels being associated with the statement. |
9172 */ | 7452 */ |
9173 NodeList<Label> _labels; | 7453 NodeList<Label> labels; |
9174 | 7454 |
9175 /** | 7455 /** |
9176 * The statement with which the labels are being associated. | 7456 * The statement with which the labels are being associated. |
9177 */ | 7457 */ |
9178 Statement _statement; | 7458 Statement _statement; |
9179 | 7459 |
9180 /** | 7460 /** |
9181 * Initialize a newly created labeled statement. | 7461 * Initialize a newly created labeled statement. |
9182 * | 7462 * |
9183 * @param labels the labels being associated with the statement | 7463 * @param labels the labels being associated with the statement |
9184 * @param statement the statement with which the labels are being associated | 7464 * @param statement the statement with which the labels are being associated |
9185 */ | 7465 */ |
9186 LabeledStatement.full(List<Label> labels, Statement statement) { | 7466 LabeledStatement.full(List<Label> labels, Statement statement) { |
9187 this._labels = new NodeList<Label>(this); | 7467 this.labels = new NodeList<Label>(this); |
9188 this._labels.addAll(labels); | 7468 this.labels.addAll(labels); |
9189 this._statement = becomeParentOf(statement); | 7469 this._statement = becomeParentOf(statement); |
9190 } | 7470 } |
9191 | 7471 |
9192 /** | 7472 /** |
9193 * Initialize a newly created labeled statement. | 7473 * Initialize a newly created labeled statement. |
9194 * | 7474 * |
9195 * @param labels the labels being associated with the statement | 7475 * @param labels the labels being associated with the statement |
9196 * @param statement the statement with which the labels are being associated | 7476 * @param statement the statement with which the labels are being associated |
9197 */ | 7477 */ |
9198 LabeledStatement({List<Label> labels, Statement statement}) : this.full(labels
, statement); | 7478 LabeledStatement({List<Label> labels, Statement statement}) : this.full(labels
, statement); |
9199 accept(ASTVisitor visitor) => visitor.visitLabeledStatement(this); | 7479 accept(ASTVisitor visitor) => visitor.visitLabeledStatement(this); |
9200 Token get beginToken { | 7480 Token get beginToken { |
9201 if (!_labels.isEmpty) { | 7481 if (!labels.isEmpty) { |
9202 return _labels.beginToken; | 7482 return labels.beginToken; |
9203 } | 7483 } |
9204 return _statement.beginToken; | 7484 return _statement.beginToken; |
9205 } | 7485 } |
9206 Token get endToken => _statement.endToken; | 7486 Token get endToken => _statement.endToken; |
9207 | 7487 |
9208 /** | 7488 /** |
9209 * Return the labels being associated with the statement. | |
9210 * | |
9211 * @return the labels being associated with the statement | |
9212 */ | |
9213 NodeList<Label> get labels => _labels; | |
9214 | |
9215 /** | |
9216 * Return the statement with which the labels are being associated. | 7489 * Return the statement with which the labels are being associated. |
9217 * | 7490 * |
9218 * @return the statement with which the labels are being associated | 7491 * @return the statement with which the labels are being associated |
9219 */ | 7492 */ |
9220 Statement get statement => _statement; | 7493 Statement get statement => _statement; |
9221 | 7494 |
9222 /** | 7495 /** |
9223 * Set the statement with which the labels are being associated to the given s
tatement. | 7496 * Set the statement with which the labels are being associated to the given s
tatement. |
9224 * | 7497 * |
9225 * @param statement the statement with which the labels are being associated | 7498 * @param statement the statement with which the labels are being associated |
9226 */ | 7499 */ |
9227 void set statement(Statement statement2) { | 7500 void set statement(Statement statement2) { |
9228 this._statement = becomeParentOf(statement2); | 7501 this._statement = becomeParentOf(statement2); |
9229 } | 7502 } |
9230 void visitChildren(ASTVisitor visitor) { | 7503 void visitChildren(ASTVisitor visitor) { |
9231 _labels.accept(visitor); | 7504 labels.accept(visitor); |
9232 safelyVisitChild(_statement, visitor); | 7505 safelyVisitChild(_statement, visitor); |
9233 } | 7506 } |
9234 } | 7507 } |
9235 /** | 7508 /** |
9236 * Instances of the class `LibraryDirective` represent a library directive. | 7509 * Instances of the class `LibraryDirective` represent a library directive. |
9237 * | 7510 * |
9238 * <pre> | 7511 * <pre> |
9239 * libraryDirective ::= | 7512 * libraryDirective ::= |
9240 * [Annotation] 'library' [Identifier] ';' | 7513 * [Annotation] 'library' [Identifier] ';' |
9241 * </pre> | 7514 * </pre> |
9242 * | 7515 * |
9243 * @coverage dart.engine.ast | 7516 * @coverage dart.engine.ast |
9244 */ | 7517 */ |
9245 class LibraryDirective extends Directive { | 7518 class LibraryDirective extends Directive { |
9246 | 7519 |
9247 /** | 7520 /** |
9248 * The token representing the 'library' token. | 7521 * The token representing the 'library' token. |
9249 */ | 7522 */ |
9250 Token _libraryToken; | 7523 Token libraryToken; |
9251 | 7524 |
9252 /** | 7525 /** |
9253 * The name of the library being defined. | 7526 * The name of the library being defined. |
9254 */ | 7527 */ |
9255 LibraryIdentifier _name; | 7528 LibraryIdentifier _name; |
9256 | 7529 |
9257 /** | 7530 /** |
9258 * The semicolon terminating the directive. | 7531 * The semicolon terminating the directive. |
9259 */ | 7532 */ |
9260 Token _semicolon; | 7533 Token semicolon; |
9261 | 7534 |
9262 /** | 7535 /** |
9263 * Initialize a newly created library directive. | 7536 * Initialize a newly created library directive. |
9264 * | 7537 * |
9265 * @param comment the documentation comment associated with this directive | 7538 * @param comment the documentation comment associated with this directive |
9266 * @param metadata the annotations associated with the directive | 7539 * @param metadata the annotations associated with the directive |
9267 * @param libraryToken the token representing the 'library' token | 7540 * @param libraryToken the token representing the 'library' token |
9268 * @param name the name of the library being defined | 7541 * @param name the name of the library being defined |
9269 * @param semicolon the semicolon terminating the directive | 7542 * @param semicolon the semicolon terminating the directive |
9270 */ | 7543 */ |
9271 LibraryDirective.full(Comment comment, List<Annotation> metadata, Token librar
yToken, LibraryIdentifier name, Token semicolon) : super.full(comment, metadata)
{ | 7544 LibraryDirective.full(Comment comment, List<Annotation> metadata, Token librar
yToken, LibraryIdentifier name, Token semicolon) : super.full(comment, metadata)
{ |
9272 this._libraryToken = libraryToken; | 7545 this.libraryToken = libraryToken; |
9273 this._name = becomeParentOf(name); | 7546 this._name = becomeParentOf(name); |
9274 this._semicolon = semicolon; | 7547 this.semicolon = semicolon; |
9275 } | 7548 } |
9276 | 7549 |
9277 /** | 7550 /** |
9278 * Initialize a newly created library directive. | 7551 * Initialize a newly created library directive. |
9279 * | 7552 * |
9280 * @param comment the documentation comment associated with this directive | 7553 * @param comment the documentation comment associated with this directive |
9281 * @param metadata the annotations associated with the directive | 7554 * @param metadata the annotations associated with the directive |
9282 * @param libraryToken the token representing the 'library' token | 7555 * @param libraryToken the token representing the 'library' token |
9283 * @param name the name of the library being defined | 7556 * @param name the name of the library being defined |
9284 * @param semicolon the semicolon terminating the directive | 7557 * @param semicolon the semicolon terminating the directive |
9285 */ | 7558 */ |
9286 LibraryDirective({Comment comment, List<Annotation> metadata, Token libraryTok
en, LibraryIdentifier name, Token semicolon}) : this.full(comment, metadata, lib
raryToken, name, semicolon); | 7559 LibraryDirective({Comment comment, List<Annotation> metadata, Token libraryTok
en, LibraryIdentifier name, Token semicolon}) : this.full(comment, metadata, lib
raryToken, name, semicolon); |
9287 accept(ASTVisitor visitor) => visitor.visitLibraryDirective(this); | 7560 accept(ASTVisitor visitor) => visitor.visitLibraryDirective(this); |
9288 Token get endToken => _semicolon; | 7561 Token get endToken => semicolon; |
9289 Token get keyword => _libraryToken; | 7562 Token get keyword => libraryToken; |
9290 | |
9291 /** | |
9292 * Return the token representing the 'library' token. | |
9293 * | |
9294 * @return the token representing the 'library' token | |
9295 */ | |
9296 Token get libraryToken => _libraryToken; | |
9297 | 7563 |
9298 /** | 7564 /** |
9299 * Return the name of the library being defined. | 7565 * Return the name of the library being defined. |
9300 * | 7566 * |
9301 * @return the name of the library being defined | 7567 * @return the name of the library being defined |
9302 */ | 7568 */ |
9303 LibraryIdentifier get name => _name; | 7569 LibraryIdentifier get name => _name; |
9304 | 7570 |
9305 /** | 7571 /** |
9306 * Return the semicolon terminating the directive. | |
9307 * | |
9308 * @return the semicolon terminating the directive | |
9309 */ | |
9310 Token get semicolon => _semicolon; | |
9311 | |
9312 /** | |
9313 * Set the token representing the 'library' token to the given token. | |
9314 * | |
9315 * @param libraryToken the token representing the 'library' token | |
9316 */ | |
9317 void set libraryToken(Token libraryToken2) { | |
9318 this._libraryToken = libraryToken2; | |
9319 } | |
9320 | |
9321 /** | |
9322 * Set the name of the library being defined to the given name. | 7572 * Set the name of the library being defined to the given name. |
9323 * | 7573 * |
9324 * @param name the name of the library being defined | 7574 * @param name the name of the library being defined |
9325 */ | 7575 */ |
9326 void set name(LibraryIdentifier name2) { | 7576 void set name(LibraryIdentifier name2) { |
9327 this._name = becomeParentOf(name2); | 7577 this._name = becomeParentOf(name2); |
9328 } | 7578 } |
9329 | |
9330 /** | |
9331 * Set the semicolon terminating the directive to the given token. | |
9332 * | |
9333 * @param semicolon the semicolon terminating the directive | |
9334 */ | |
9335 void set semicolon(Token semicolon2) { | |
9336 this._semicolon = semicolon2; | |
9337 } | |
9338 void visitChildren(ASTVisitor visitor) { | 7579 void visitChildren(ASTVisitor visitor) { |
9339 super.visitChildren(visitor); | 7580 super.visitChildren(visitor); |
9340 safelyVisitChild(_name, visitor); | 7581 safelyVisitChild(_name, visitor); |
9341 } | 7582 } |
9342 Token get firstTokenAfterCommentAndMetadata => _libraryToken; | 7583 Token get firstTokenAfterCommentAndMetadata => libraryToken; |
9343 } | 7584 } |
9344 /** | 7585 /** |
9345 * Instances of the class `LibraryIdentifier` represent the identifier for a lib
rary. | 7586 * Instances of the class `LibraryIdentifier` represent the identifier for a lib
rary. |
9346 * | 7587 * |
9347 * <pre> | 7588 * <pre> |
9348 * libraryIdentifier ::= | 7589 * libraryIdentifier ::= |
9349 * [SimpleIdentifier] ('.' [SimpleIdentifier])* | 7590 * [SimpleIdentifier] ('.' [SimpleIdentifier])* |
9350 * </pre> | 7591 * </pre> |
9351 * | 7592 * |
9352 * @coverage dart.engine.ast | 7593 * @coverage dart.engine.ast |
9353 */ | 7594 */ |
9354 class LibraryIdentifier extends Identifier { | 7595 class LibraryIdentifier extends Identifier { |
9355 | 7596 |
9356 /** | 7597 /** |
9357 * The components of the identifier. | 7598 * The components of the identifier. |
9358 */ | 7599 */ |
9359 NodeList<SimpleIdentifier> _components; | 7600 NodeList<SimpleIdentifier> components; |
9360 | 7601 |
9361 /** | 7602 /** |
9362 * Initialize a newly created prefixed identifier. | 7603 * Initialize a newly created prefixed identifier. |
9363 * | 7604 * |
9364 * @param components the components of the identifier | 7605 * @param components the components of the identifier |
9365 */ | 7606 */ |
9366 LibraryIdentifier.full(List<SimpleIdentifier> components) { | 7607 LibraryIdentifier.full(List<SimpleIdentifier> components) { |
9367 this._components = new NodeList<SimpleIdentifier>(this); | 7608 this.components = new NodeList<SimpleIdentifier>(this); |
9368 this._components.addAll(components); | 7609 this.components.addAll(components); |
9369 } | 7610 } |
9370 | 7611 |
9371 /** | 7612 /** |
9372 * Initialize a newly created prefixed identifier. | 7613 * Initialize a newly created prefixed identifier. |
9373 * | 7614 * |
9374 * @param components the components of the identifier | 7615 * @param components the components of the identifier |
9375 */ | 7616 */ |
9376 LibraryIdentifier({List<SimpleIdentifier> components}) : this.full(components)
; | 7617 LibraryIdentifier({List<SimpleIdentifier> components}) : this.full(components)
; |
9377 accept(ASTVisitor visitor) => visitor.visitLibraryIdentifier(this); | 7618 accept(ASTVisitor visitor) => visitor.visitLibraryIdentifier(this); |
9378 Token get beginToken => _components.beginToken; | 7619 Token get beginToken => components.beginToken; |
9379 Element get bestElement => staticElement; | 7620 Element get bestElement => staticElement; |
9380 | 7621 Token get endToken => components.endToken; |
9381 /** | |
9382 * Return the components of the identifier. | |
9383 * | |
9384 * @return the components of the identifier | |
9385 */ | |
9386 NodeList<SimpleIdentifier> get components => _components; | |
9387 Token get endToken => _components.endToken; | |
9388 String get name { | 7622 String get name { |
9389 JavaStringBuilder builder = new JavaStringBuilder(); | 7623 JavaStringBuilder builder = new JavaStringBuilder(); |
9390 bool needsPeriod = false; | 7624 bool needsPeriod = false; |
9391 for (SimpleIdentifier identifier in _components) { | 7625 for (SimpleIdentifier identifier in components) { |
9392 if (needsPeriod) { | 7626 if (needsPeriod) { |
9393 builder.append("."); | 7627 builder.append("."); |
9394 } else { | 7628 } else { |
9395 needsPeriod = true; | 7629 needsPeriod = true; |
9396 } | 7630 } |
9397 builder.append(identifier.name); | 7631 builder.append(identifier.name); |
9398 } | 7632 } |
9399 return builder.toString(); | 7633 return builder.toString(); |
9400 } | 7634 } |
9401 Element get propagatedElement => null; | 7635 Element get propagatedElement => null; |
9402 Element get staticElement => null; | 7636 Element get staticElement => null; |
9403 void visitChildren(ASTVisitor visitor) { | 7637 void visitChildren(ASTVisitor visitor) { |
9404 _components.accept(visitor); | 7638 components.accept(visitor); |
9405 } | 7639 } |
9406 } | 7640 } |
9407 /** | 7641 /** |
9408 * Instances of the class `ListLiteral` represent a list literal. | 7642 * Instances of the class `ListLiteral` represent a list literal. |
9409 * | 7643 * |
9410 * <pre> | 7644 * <pre> |
9411 * listLiteral ::= | 7645 * listLiteral ::= |
9412 * 'const'? ('<' [TypeName] '>')? '[' ([Expression] ','?)? ']' | 7646 * 'const'? ('<' [TypeName] '>')? '[' ([Expression] ','?)? ']' |
9413 * </pre> | 7647 * </pre> |
9414 * | 7648 * |
9415 * @coverage dart.engine.ast | 7649 * @coverage dart.engine.ast |
9416 */ | 7650 */ |
9417 class ListLiteral extends TypedLiteral { | 7651 class ListLiteral extends TypedLiteral { |
9418 | 7652 |
9419 /** | 7653 /** |
9420 * The left square bracket. | 7654 * The left square bracket. |
9421 */ | 7655 */ |
9422 Token _leftBracket; | 7656 Token _leftBracket; |
9423 | 7657 |
9424 /** | 7658 /** |
9425 * The expressions used to compute the elements of the list. | 7659 * The expressions used to compute the elements of the list. |
9426 */ | 7660 */ |
9427 NodeList<Expression> _elements; | 7661 NodeList<Expression> elements; |
9428 | 7662 |
9429 /** | 7663 /** |
9430 * The right square bracket. | 7664 * The right square bracket. |
9431 */ | 7665 */ |
9432 Token _rightBracket; | 7666 Token _rightBracket; |
9433 | 7667 |
9434 /** | 7668 /** |
9435 * Initialize a newly created list literal. | 7669 * Initialize a newly created list literal. |
9436 * | 7670 * |
9437 * @param constKeyword the token representing the 'const' keyword | 7671 * @param constKeyword the token representing the 'const' keyword |
9438 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type | 7672 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type |
9439 * arguments were declared | 7673 * arguments were declared |
9440 * @param leftBracket the left square bracket | 7674 * @param leftBracket the left square bracket |
9441 * @param elements the expressions used to compute the elements of the list | 7675 * @param elements the expressions used to compute the elements of the list |
9442 * @param rightBracket the right square bracket | 7676 * @param rightBracket the right square bracket |
9443 */ | 7677 */ |
9444 ListLiteral.full(Token constKeyword, TypeArgumentList typeArguments, Token lef
tBracket, List<Expression> elements, Token rightBracket) : super.full(constKeywo
rd, typeArguments) { | 7678 ListLiteral.full(Token constKeyword, TypeArgumentList typeArguments, Token lef
tBracket, List<Expression> elements, Token rightBracket) : super.full(constKeywo
rd, typeArguments) { |
9445 this._elements = new NodeList<Expression>(this); | 7679 this.elements = new NodeList<Expression>(this); |
9446 this._leftBracket = leftBracket; | 7680 this._leftBracket = leftBracket; |
9447 this._elements.addAll(elements); | 7681 this.elements.addAll(elements); |
9448 this._rightBracket = rightBracket; | 7682 this._rightBracket = rightBracket; |
9449 } | 7683 } |
9450 | 7684 |
9451 /** | 7685 /** |
9452 * Initialize a newly created list literal. | 7686 * Initialize a newly created list literal. |
9453 * | 7687 * |
9454 * @param constKeyword the token representing the 'const' keyword | 7688 * @param constKeyword the token representing the 'const' keyword |
9455 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type | 7689 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type |
9456 * arguments were declared | 7690 * arguments were declared |
9457 * @param leftBracket the left square bracket | 7691 * @param leftBracket the left square bracket |
9458 * @param elements the expressions used to compute the elements of the list | 7692 * @param elements the expressions used to compute the elements of the list |
9459 * @param rightBracket the right square bracket | 7693 * @param rightBracket the right square bracket |
9460 */ | 7694 */ |
9461 ListLiteral({Token constKeyword, TypeArgumentList typeArguments, Token leftBra
cket, List<Expression> elements, Token rightBracket}) : this.full(constKeyword,
typeArguments, leftBracket, elements, rightBracket); | 7695 ListLiteral({Token constKeyword, TypeArgumentList typeArguments, Token leftBra
cket, List<Expression> elements, Token rightBracket}) : this.full(constKeyword,
typeArguments, leftBracket, elements, rightBracket); |
9462 accept(ASTVisitor visitor) => visitor.visitListLiteral(this); | 7696 accept(ASTVisitor visitor) => visitor.visitListLiteral(this); |
9463 Token get beginToken { | 7697 Token get beginToken { |
9464 Token token = constKeyword; | 7698 Token token = constKeyword; |
9465 if (token != null) { | 7699 if (token != null) { |
9466 return token; | 7700 return token; |
9467 } | 7701 } |
9468 TypeArgumentList typeArguments = this.typeArguments; | 7702 TypeArgumentList typeArguments2 = typeArguments; |
9469 if (typeArguments != null) { | 7703 if (typeArguments2 != null) { |
9470 return typeArguments.beginToken; | 7704 return typeArguments2.beginToken; |
9471 } | 7705 } |
9472 return _leftBracket; | 7706 return _leftBracket; |
9473 } | 7707 } |
9474 | |
9475 /** | |
9476 * Return the expressions used to compute the elements of the list. | |
9477 * | |
9478 * @return the expressions used to compute the elements of the list | |
9479 */ | |
9480 NodeList<Expression> get elements => _elements; | |
9481 Token get endToken => _rightBracket; | 7708 Token get endToken => _rightBracket; |
9482 | 7709 |
9483 /** | 7710 /** |
9484 * Return the left square bracket. | 7711 * Return the left square bracket. |
9485 * | 7712 * |
9486 * @return the left square bracket | 7713 * @return the left square bracket |
9487 */ | 7714 */ |
9488 Token get leftBracket => _leftBracket; | 7715 Token get leftBracket => _leftBracket; |
9489 | 7716 |
9490 /** | 7717 /** |
(...skipping 15 matching lines...) Expand all Loading... |
9506 /** | 7733 /** |
9507 * Set the right square bracket to the given token. | 7734 * Set the right square bracket to the given token. |
9508 * | 7735 * |
9509 * @param bracket the right square bracket | 7736 * @param bracket the right square bracket |
9510 */ | 7737 */ |
9511 void set rightBracket(Token bracket) { | 7738 void set rightBracket(Token bracket) { |
9512 _rightBracket = bracket; | 7739 _rightBracket = bracket; |
9513 } | 7740 } |
9514 void visitChildren(ASTVisitor visitor) { | 7741 void visitChildren(ASTVisitor visitor) { |
9515 super.visitChildren(visitor); | 7742 super.visitChildren(visitor); |
9516 _elements.accept(visitor); | 7743 elements.accept(visitor); |
9517 } | 7744 } |
9518 } | 7745 } |
9519 /** | 7746 /** |
9520 * The abstract class `Literal` defines the behavior common to nodes that repres
ent a literal | 7747 * The abstract class `Literal` defines the behavior common to nodes that repres
ent a literal |
9521 * expression. | 7748 * expression. |
9522 * | 7749 * |
9523 * <pre> | 7750 * <pre> |
9524 * literal ::= | 7751 * literal ::= |
9525 * [BooleanLiteral] | 7752 * [BooleanLiteral] |
9526 * | [DoubleLiteral] | 7753 * | [DoubleLiteral] |
(...skipping 21 matching lines...) Expand all Loading... |
9548 class MapLiteral extends TypedLiteral { | 7775 class MapLiteral extends TypedLiteral { |
9549 | 7776 |
9550 /** | 7777 /** |
9551 * The left curly bracket. | 7778 * The left curly bracket. |
9552 */ | 7779 */ |
9553 Token _leftBracket; | 7780 Token _leftBracket; |
9554 | 7781 |
9555 /** | 7782 /** |
9556 * The entries in the map. | 7783 * The entries in the map. |
9557 */ | 7784 */ |
9558 NodeList<MapLiteralEntry> _entries; | 7785 NodeList<MapLiteralEntry> entries; |
9559 | 7786 |
9560 /** | 7787 /** |
9561 * The right curly bracket. | 7788 * The right curly bracket. |
9562 */ | 7789 */ |
9563 Token _rightBracket; | 7790 Token _rightBracket; |
9564 | 7791 |
9565 /** | 7792 /** |
9566 * Initialize a newly created map literal. | 7793 * Initialize a newly created map literal. |
9567 * | 7794 * |
9568 * @param constKeyword the token representing the 'const' keyword | 7795 * @param constKeyword the token representing the 'const' keyword |
9569 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type | 7796 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type |
9570 * arguments were declared | 7797 * arguments were declared |
9571 * @param leftBracket the left curly bracket | 7798 * @param leftBracket the left curly bracket |
9572 * @param entries the entries in the map | 7799 * @param entries the entries in the map |
9573 * @param rightBracket the right curly bracket | 7800 * @param rightBracket the right curly bracket |
9574 */ | 7801 */ |
9575 MapLiteral.full(Token constKeyword, TypeArgumentList typeArguments, Token left
Bracket, List<MapLiteralEntry> entries, Token rightBracket) : super.full(constKe
yword, typeArguments) { | 7802 MapLiteral.full(Token constKeyword, TypeArgumentList typeArguments, Token left
Bracket, List<MapLiteralEntry> entries, Token rightBracket) : super.full(constKe
yword, typeArguments) { |
9576 this._entries = new NodeList<MapLiteralEntry>(this); | 7803 this.entries = new NodeList<MapLiteralEntry>(this); |
9577 this._leftBracket = leftBracket; | 7804 this._leftBracket = leftBracket; |
9578 this._entries.addAll(entries); | 7805 this.entries.addAll(entries); |
9579 this._rightBracket = rightBracket; | 7806 this._rightBracket = rightBracket; |
9580 } | 7807 } |
9581 | 7808 |
9582 /** | 7809 /** |
9583 * Initialize a newly created map literal. | 7810 * Initialize a newly created map literal. |
9584 * | 7811 * |
9585 * @param constKeyword the token representing the 'const' keyword | 7812 * @param constKeyword the token representing the 'const' keyword |
9586 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type | 7813 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type |
9587 * arguments were declared | 7814 * arguments were declared |
9588 * @param leftBracket the left curly bracket | 7815 * @param leftBracket the left curly bracket |
9589 * @param entries the entries in the map | 7816 * @param entries the entries in the map |
9590 * @param rightBracket the right curly bracket | 7817 * @param rightBracket the right curly bracket |
9591 */ | 7818 */ |
9592 MapLiteral({Token constKeyword, TypeArgumentList typeArguments, Token leftBrac
ket, List<MapLiteralEntry> entries, Token rightBracket}) : this.full(constKeywor
d, typeArguments, leftBracket, entries, rightBracket); | 7819 MapLiteral({Token constKeyword, TypeArgumentList typeArguments, Token leftBrac
ket, List<MapLiteralEntry> entries, Token rightBracket}) : this.full(constKeywor
d, typeArguments, leftBracket, entries, rightBracket); |
9593 accept(ASTVisitor visitor) => visitor.visitMapLiteral(this); | 7820 accept(ASTVisitor visitor) => visitor.visitMapLiteral(this); |
9594 Token get beginToken { | 7821 Token get beginToken { |
9595 Token token = constKeyword; | 7822 Token token = constKeyword; |
9596 if (token != null) { | 7823 if (token != null) { |
9597 return token; | 7824 return token; |
9598 } | 7825 } |
9599 TypeArgumentList typeArguments = this.typeArguments; | 7826 TypeArgumentList typeArguments2 = typeArguments; |
9600 if (typeArguments != null) { | 7827 if (typeArguments2 != null) { |
9601 return typeArguments.beginToken; | 7828 return typeArguments2.beginToken; |
9602 } | 7829 } |
9603 return _leftBracket; | 7830 return _leftBracket; |
9604 } | 7831 } |
9605 Token get endToken => _rightBracket; | 7832 Token get endToken => _rightBracket; |
9606 | 7833 |
9607 /** | 7834 /** |
9608 * Return the entries in the map. | |
9609 * | |
9610 * @return the entries in the map | |
9611 */ | |
9612 NodeList<MapLiteralEntry> get entries => _entries; | |
9613 | |
9614 /** | |
9615 * Return the left curly bracket. | 7835 * Return the left curly bracket. |
9616 * | 7836 * |
9617 * @return the left curly bracket | 7837 * @return the left curly bracket |
9618 */ | 7838 */ |
9619 Token get leftBracket => _leftBracket; | 7839 Token get leftBracket => _leftBracket; |
9620 | 7840 |
9621 /** | 7841 /** |
9622 * Return the right curly bracket. | 7842 * Return the right curly bracket. |
9623 * | 7843 * |
9624 * @return the right curly bracket | 7844 * @return the right curly bracket |
(...skipping 12 matching lines...) Expand all Loading... |
9637 /** | 7857 /** |
9638 * Set the right curly bracket to the given token. | 7858 * Set the right curly bracket to the given token. |
9639 * | 7859 * |
9640 * @param bracket the right curly bracket | 7860 * @param bracket the right curly bracket |
9641 */ | 7861 */ |
9642 void set rightBracket(Token bracket) { | 7862 void set rightBracket(Token bracket) { |
9643 _rightBracket = bracket; | 7863 _rightBracket = bracket; |
9644 } | 7864 } |
9645 void visitChildren(ASTVisitor visitor) { | 7865 void visitChildren(ASTVisitor visitor) { |
9646 super.visitChildren(visitor); | 7866 super.visitChildren(visitor); |
9647 _entries.accept(visitor); | 7867 entries.accept(visitor); |
9648 } | 7868 } |
9649 } | 7869 } |
9650 /** | 7870 /** |
9651 * Instances of the class `MapLiteralEntry` represent a single key/value pair in
a map | 7871 * Instances of the class `MapLiteralEntry` represent a single key/value pair in
a map |
9652 * literal. | 7872 * literal. |
9653 * | 7873 * |
9654 * <pre> | 7874 * <pre> |
9655 * mapLiteralEntry ::= | 7875 * mapLiteralEntry ::= |
9656 * [Expression] ':' [Expression] | 7876 * [Expression] ':' [Expression] |
9657 * </pre> | 7877 * </pre> |
9658 * | 7878 * |
9659 * @coverage dart.engine.ast | 7879 * @coverage dart.engine.ast |
9660 */ | 7880 */ |
9661 class MapLiteralEntry extends ASTNode { | 7881 class MapLiteralEntry extends ASTNode { |
9662 | 7882 |
9663 /** | 7883 /** |
9664 * The expression computing the key with which the value will be associated. | 7884 * The expression computing the key with which the value will be associated. |
9665 */ | 7885 */ |
9666 Expression _key; | 7886 Expression _key; |
9667 | 7887 |
9668 /** | 7888 /** |
9669 * The colon that separates the key from the value. | 7889 * The colon that separates the key from the value. |
9670 */ | 7890 */ |
9671 Token _separator; | 7891 Token separator; |
9672 | 7892 |
9673 /** | 7893 /** |
9674 * The expression computing the value that will be associated with the key. | 7894 * The expression computing the value that will be associated with the key. |
9675 */ | 7895 */ |
9676 Expression _value; | 7896 Expression _value; |
9677 | 7897 |
9678 /** | 7898 /** |
9679 * Initialize a newly created map literal entry. | 7899 * Initialize a newly created map literal entry. |
9680 * | 7900 * |
9681 * @param key the expression computing the key with which the value will be as
sociated | 7901 * @param key the expression computing the key with which the value will be as
sociated |
9682 * @param separator the colon that separates the key from the value | 7902 * @param separator the colon that separates the key from the value |
9683 * @param value the expression computing the value that will be associated wit
h the key | 7903 * @param value the expression computing the value that will be associated wit
h the key |
9684 */ | 7904 */ |
9685 MapLiteralEntry.full(Expression key, Token separator, Expression value) { | 7905 MapLiteralEntry.full(Expression key, Token separator, Expression value) { |
9686 this._key = becomeParentOf(key); | 7906 this._key = becomeParentOf(key); |
9687 this._separator = separator; | 7907 this.separator = separator; |
9688 this._value = becomeParentOf(value); | 7908 this._value = becomeParentOf(value); |
9689 } | 7909 } |
9690 | 7910 |
9691 /** | 7911 /** |
9692 * Initialize a newly created map literal entry. | 7912 * Initialize a newly created map literal entry. |
9693 * | 7913 * |
9694 * @param key the expression computing the key with which the value will be as
sociated | 7914 * @param key the expression computing the key with which the value will be as
sociated |
9695 * @param separator the colon that separates the key from the value | 7915 * @param separator the colon that separates the key from the value |
9696 * @param value the expression computing the value that will be associated wit
h the key | 7916 * @param value the expression computing the value that will be associated wit
h the key |
9697 */ | 7917 */ |
9698 MapLiteralEntry({Expression key, Token separator, Expression value}) : this.fu
ll(key, separator, value); | 7918 MapLiteralEntry({Expression key, Token separator, Expression value}) : this.fu
ll(key, separator, value); |
9699 accept(ASTVisitor visitor) => visitor.visitMapLiteralEntry(this); | 7919 accept(ASTVisitor visitor) => visitor.visitMapLiteralEntry(this); |
9700 Token get beginToken => _key.beginToken; | 7920 Token get beginToken => _key.beginToken; |
9701 Token get endToken => _value.endToken; | 7921 Token get endToken => _value.endToken; |
9702 | 7922 |
9703 /** | 7923 /** |
9704 * Return the expression computing the key with which the value will be associ
ated. | 7924 * Return the expression computing the key with which the value will be associ
ated. |
9705 * | 7925 * |
9706 * @return the expression computing the key with which the value will be assoc
iated | 7926 * @return the expression computing the key with which the value will be assoc
iated |
9707 */ | 7927 */ |
9708 Expression get key => _key; | 7928 Expression get key => _key; |
9709 | 7929 |
9710 /** | 7930 /** |
9711 * Return the colon that separates the key from the value. | |
9712 * | |
9713 * @return the colon that separates the key from the value | |
9714 */ | |
9715 Token get separator => _separator; | |
9716 | |
9717 /** | |
9718 * Return the expression computing the value that will be associated with the
key. | 7931 * Return the expression computing the value that will be associated with the
key. |
9719 * | 7932 * |
9720 * @return the expression computing the value that will be associated with the
key | 7933 * @return the expression computing the value that will be associated with the
key |
9721 */ | 7934 */ |
9722 Expression get value => _value; | 7935 Expression get value => _value; |
9723 | 7936 |
9724 /** | 7937 /** |
9725 * Set the expression computing the key with which the value will be associate
d to the given | 7938 * Set the expression computing the key with which the value will be associate
d to the given |
9726 * string. | 7939 * string. |
9727 * | 7940 * |
9728 * @param string the expression computing the key with which the value will be
associated | 7941 * @param string the expression computing the key with which the value will be
associated |
9729 */ | 7942 */ |
9730 void set key(Expression string) { | 7943 void set key(Expression string) { |
9731 _key = becomeParentOf(string); | 7944 _key = becomeParentOf(string); |
9732 } | 7945 } |
9733 | 7946 |
9734 /** | 7947 /** |
9735 * Set the colon that separates the key from the value to the given token. | |
9736 * | |
9737 * @param separator the colon that separates the key from the value | |
9738 */ | |
9739 void set separator(Token separator2) { | |
9740 this._separator = separator2; | |
9741 } | |
9742 | |
9743 /** | |
9744 * Set the expression computing the value that will be associated with the key
to the given | 7948 * Set the expression computing the value that will be associated with the key
to the given |
9745 * expression. | 7949 * expression. |
9746 * | 7950 * |
9747 * @param expression the expression computing the value that will be associate
d with the key | 7951 * @param expression the expression computing the value that will be associate
d with the key |
9748 */ | 7952 */ |
9749 void set value(Expression expression) { | 7953 void set value(Expression expression) { |
9750 _value = becomeParentOf(expression); | 7954 _value = becomeParentOf(expression); |
9751 } | 7955 } |
9752 void visitChildren(ASTVisitor visitor) { | 7956 void visitChildren(ASTVisitor visitor) { |
9753 safelyVisitChild(_key, visitor); | 7957 safelyVisitChild(_key, visitor); |
(...skipping 16 matching lines...) Expand all Loading... |
9770 * | 'operator' [SimpleIdentifier] | 7974 * | 'operator' [SimpleIdentifier] |
9771 * </pre> | 7975 * </pre> |
9772 * | 7976 * |
9773 * @coverage dart.engine.ast | 7977 * @coverage dart.engine.ast |
9774 */ | 7978 */ |
9775 class MethodDeclaration extends ClassMember { | 7979 class MethodDeclaration extends ClassMember { |
9776 | 7980 |
9777 /** | 7981 /** |
9778 * The token for the 'external' keyword, or `null` if the constructor is not e
xternal. | 7982 * The token for the 'external' keyword, or `null` if the constructor is not e
xternal. |
9779 */ | 7983 */ |
9780 Token _externalKeyword; | 7984 Token externalKeyword; |
9781 | 7985 |
9782 /** | 7986 /** |
9783 * The token representing the 'abstract' or 'static' keyword, or `null` if nei
ther modifier | 7987 * The token representing the 'abstract' or 'static' keyword, or `null` if nei
ther modifier |
9784 * was specified. | 7988 * was specified. |
9785 */ | 7989 */ |
9786 Token _modifierKeyword; | 7990 Token modifierKeyword; |
9787 | 7991 |
9788 /** | 7992 /** |
9789 * The return type of the method, or `null` if no return type was declared. | 7993 * The return type of the method, or `null` if no return type was declared. |
9790 */ | 7994 */ |
9791 TypeName _returnType; | 7995 TypeName _returnType; |
9792 | 7996 |
9793 /** | 7997 /** |
9794 * The token representing the 'get' or 'set' keyword, or `null` if this is a m
ethod | 7998 * The token representing the 'get' or 'set' keyword, or `null` if this is a m
ethod |
9795 * declaration rather than a property declaration. | 7999 * declaration rather than a property declaration. |
9796 */ | 8000 */ |
9797 Token _propertyKeyword; | 8001 Token propertyKeyword; |
9798 | 8002 |
9799 /** | 8003 /** |
9800 * The token representing the 'operator' keyword, or `null` if this method doe
s not declare | 8004 * The token representing the 'operator' keyword, or `null` if this method doe
s not declare |
9801 * an operator. | 8005 * an operator. |
9802 */ | 8006 */ |
9803 Token _operatorKeyword; | 8007 Token operatorKeyword; |
9804 | 8008 |
9805 /** | 8009 /** |
9806 * The name of the method. | 8010 * The name of the method. |
9807 */ | 8011 */ |
9808 SimpleIdentifier _name; | 8012 SimpleIdentifier _name; |
9809 | 8013 |
9810 /** | 8014 /** |
9811 * The parameters associated with the method, or `null` if this method declare
s a getter. | 8015 * The parameters associated with the method, or `null` if this method declare
s a getter. |
9812 */ | 8016 */ |
9813 FormalParameterList _parameters; | 8017 FormalParameterList _parameters; |
(...skipping 12 matching lines...) Expand all Loading... |
9826 * @param modifierKeyword the token representing the 'abstract' or 'static' ke
yword | 8030 * @param modifierKeyword the token representing the 'abstract' or 'static' ke
yword |
9827 * @param returnType the return type of the method | 8031 * @param returnType the return type of the method |
9828 * @param propertyKeyword the token representing the 'get' or 'set' keyword | 8032 * @param propertyKeyword the token representing the 'get' or 'set' keyword |
9829 * @param operatorKeyword the token representing the 'operator' keyword | 8033 * @param operatorKeyword the token representing the 'operator' keyword |
9830 * @param name the name of the method | 8034 * @param name the name of the method |
9831 * @param parameters the parameters associated with the method, or `null` if t
his method | 8035 * @param parameters the parameters associated with the method, or `null` if t
his method |
9832 * declares a getter | 8036 * declares a getter |
9833 * @param body the body of the method | 8037 * @param body the body of the method |
9834 */ | 8038 */ |
9835 MethodDeclaration.full(Comment comment, List<Annotation> metadata, Token exter
nalKeyword, Token modifierKeyword, TypeName returnType, Token propertyKeyword, T
oken operatorKeyword, SimpleIdentifier name, FormalParameterList parameters, Fun
ctionBody body) : super.full(comment, metadata) { | 8039 MethodDeclaration.full(Comment comment, List<Annotation> metadata, Token exter
nalKeyword, Token modifierKeyword, TypeName returnType, Token propertyKeyword, T
oken operatorKeyword, SimpleIdentifier name, FormalParameterList parameters, Fun
ctionBody body) : super.full(comment, metadata) { |
9836 this._externalKeyword = externalKeyword; | 8040 this.externalKeyword = externalKeyword; |
9837 this._modifierKeyword = modifierKeyword; | 8041 this.modifierKeyword = modifierKeyword; |
9838 this._returnType = becomeParentOf(returnType); | 8042 this._returnType = becomeParentOf(returnType); |
9839 this._propertyKeyword = propertyKeyword; | 8043 this.propertyKeyword = propertyKeyword; |
9840 this._operatorKeyword = operatorKeyword; | 8044 this.operatorKeyword = operatorKeyword; |
9841 this._name = becomeParentOf(name); | 8045 this._name = becomeParentOf(name); |
9842 this._parameters = becomeParentOf(parameters); | 8046 this._parameters = becomeParentOf(parameters); |
9843 this._body = becomeParentOf(body); | 8047 this._body = becomeParentOf(body); |
9844 } | 8048 } |
9845 | 8049 |
9846 /** | 8050 /** |
9847 * Initialize a newly created method declaration. | 8051 * Initialize a newly created method declaration. |
9848 * | 8052 * |
9849 * @param externalKeyword the token for the 'external' keyword | 8053 * @param externalKeyword the token for the 'external' keyword |
9850 * @param comment the documentation comment associated with this method | 8054 * @param comment the documentation comment associated with this method |
(...skipping 22 matching lines...) Expand all Loading... |
9873 * been resolved. The element can either be a [MethodElement], if this represe
nts the | 8077 * been resolved. The element can either be a [MethodElement], if this represe
nts the |
9874 * declaration of a normal method, or a [PropertyAccessorElement] if this repr
esents the | 8078 * declaration of a normal method, or a [PropertyAccessorElement] if this repr
esents the |
9875 * declaration of either a getter or a setter. | 8079 * declaration of either a getter or a setter. |
9876 * | 8080 * |
9877 * @return the element associated with this method | 8081 * @return the element associated with this method |
9878 */ | 8082 */ |
9879 ExecutableElement get element => _name != null ? (_name.staticElement as Execu
tableElement) : null; | 8083 ExecutableElement get element => _name != null ? (_name.staticElement as Execu
tableElement) : null; |
9880 Token get endToken => _body.endToken; | 8084 Token get endToken => _body.endToken; |
9881 | 8085 |
9882 /** | 8086 /** |
9883 * Return the token for the 'external' keyword, or `null` if the constructor i
s not | |
9884 * external. | |
9885 * | |
9886 * @return the token for the 'external' keyword | |
9887 */ | |
9888 Token get externalKeyword => _externalKeyword; | |
9889 | |
9890 /** | |
9891 * Return the token representing the 'abstract' or 'static' keyword, or `null`
if neither | |
9892 * modifier was specified. | |
9893 * | |
9894 * @return the token representing the 'abstract' or 'static' keyword | |
9895 */ | |
9896 Token get modifierKeyword => _modifierKeyword; | |
9897 | |
9898 /** | |
9899 * Return the name of the method. | 8087 * Return the name of the method. |
9900 * | 8088 * |
9901 * @return the name of the method | 8089 * @return the name of the method |
9902 */ | 8090 */ |
9903 SimpleIdentifier get name => _name; | 8091 SimpleIdentifier get name => _name; |
9904 | 8092 |
9905 /** | 8093 /** |
9906 * Return the token representing the 'operator' keyword, or `null` if this met
hod does not | |
9907 * declare an operator. | |
9908 * | |
9909 * @return the token representing the 'operator' keyword | |
9910 */ | |
9911 Token get operatorKeyword => _operatorKeyword; | |
9912 | |
9913 /** | |
9914 * Return the parameters associated with the method, or `null` if this method
declares a | 8094 * Return the parameters associated with the method, or `null` if this method
declares a |
9915 * getter. | 8095 * getter. |
9916 * | 8096 * |
9917 * @return the parameters associated with the method | 8097 * @return the parameters associated with the method |
9918 */ | 8098 */ |
9919 FormalParameterList get parameters => _parameters; | 8099 FormalParameterList get parameters => _parameters; |
9920 | 8100 |
9921 /** | 8101 /** |
9922 * Return the token representing the 'get' or 'set' keyword, or `null` if this
is a method | |
9923 * declaration rather than a property declaration. | |
9924 * | |
9925 * @return the token representing the 'get' or 'set' keyword | |
9926 */ | |
9927 Token get propertyKeyword => _propertyKeyword; | |
9928 | |
9929 /** | |
9930 * Return the return type of the method, or `null` if no return type was decla
red. | 8102 * Return the return type of the method, or `null` if no return type was decla
red. |
9931 * | 8103 * |
9932 * @return the return type of the method | 8104 * @return the return type of the method |
9933 */ | 8105 */ |
9934 TypeName get returnType => _returnType; | 8106 TypeName get returnType => _returnType; |
9935 | 8107 |
9936 /** | 8108 /** |
9937 * Return `true` if this method is declared to be an abstract method. | 8109 * Return `true` if this method is declared to be an abstract method. |
9938 * | 8110 * |
9939 * @return `true` if this method is declared to be an abstract method | 8111 * @return `true` if this method is declared to be an abstract method |
9940 */ | 8112 */ |
9941 bool get isAbstract => _externalKeyword == null && (_body is EmptyFunctionBody
); | 8113 bool get isAbstract => externalKeyword == null && (_body is EmptyFunctionBody)
; |
9942 | 8114 |
9943 /** | 8115 /** |
9944 * Return `true` if this method declares a getter. | 8116 * Return `true` if this method declares a getter. |
9945 * | 8117 * |
9946 * @return `true` if this method declares a getter | 8118 * @return `true` if this method declares a getter |
9947 */ | 8119 */ |
9948 bool get isGetter => _propertyKeyword != null && identical(((_propertyKeyword
as KeywordToken)).keyword, Keyword.GET); | 8120 bool get isGetter => propertyKeyword != null && identical(((propertyKeyword as
KeywordToken)).keyword, Keyword.GET); |
9949 | 8121 |
9950 /** | 8122 /** |
9951 * Return `true` if this method declares an operator. | 8123 * Return `true` if this method declares an operator. |
9952 * | 8124 * |
9953 * @return `true` if this method declares an operator | 8125 * @return `true` if this method declares an operator |
9954 */ | 8126 */ |
9955 bool get isOperator => _operatorKeyword != null; | 8127 bool get isOperator => operatorKeyword != null; |
9956 | 8128 |
9957 /** | 8129 /** |
9958 * Return `true` if this method declares a setter. | 8130 * Return `true` if this method declares a setter. |
9959 * | 8131 * |
9960 * @return `true` if this method declares a setter | 8132 * @return `true` if this method declares a setter |
9961 */ | 8133 */ |
9962 bool get isSetter => _propertyKeyword != null && identical(((_propertyKeyword
as KeywordToken)).keyword, Keyword.SET); | 8134 bool get isSetter => propertyKeyword != null && identical(((propertyKeyword as
KeywordToken)).keyword, Keyword.SET); |
9963 | 8135 |
9964 /** | 8136 /** |
9965 * Return `true` if this method is declared to be a static method. | 8137 * Return `true` if this method is declared to be a static method. |
9966 * | 8138 * |
9967 * @return `true` if this method is declared to be a static method | 8139 * @return `true` if this method is declared to be a static method |
9968 */ | 8140 */ |
9969 bool get isStatic => _modifierKeyword != null && identical(((_modifierKeyword
as KeywordToken)).keyword, Keyword.STATIC); | 8141 bool get isStatic => modifierKeyword != null && identical(((modifierKeyword as
KeywordToken)).keyword, Keyword.STATIC); |
9970 | 8142 |
9971 /** | 8143 /** |
9972 * Set the body of the method to the given function body. | 8144 * Set the body of the method to the given function body. |
9973 * | 8145 * |
9974 * @param functionBody the body of the method | 8146 * @param functionBody the body of the method |
9975 */ | 8147 */ |
9976 void set body(FunctionBody functionBody) { | 8148 void set body(FunctionBody functionBody) { |
9977 _body = becomeParentOf(functionBody); | 8149 _body = becomeParentOf(functionBody); |
9978 } | 8150 } |
9979 | 8151 |
9980 /** | 8152 /** |
9981 * Set the token for the 'external' keyword to the given token. | |
9982 * | |
9983 * @param externalKeyword the token for the 'external' keyword | |
9984 */ | |
9985 void set externalKeyword(Token externalKeyword2) { | |
9986 this._externalKeyword = externalKeyword2; | |
9987 } | |
9988 | |
9989 /** | |
9990 * Set the token representing the 'abstract' or 'static' keyword to the given
token. | |
9991 * | |
9992 * @param modifierKeyword the token representing the 'abstract' or 'static' ke
yword | |
9993 */ | |
9994 void set modifierKeyword(Token modifierKeyword2) { | |
9995 this._modifierKeyword = modifierKeyword2; | |
9996 } | |
9997 | |
9998 /** | |
9999 * Set the name of the method to the given identifier. | 8153 * Set the name of the method to the given identifier. |
10000 * | 8154 * |
10001 * @param identifier the name of the method | 8155 * @param identifier the name of the method |
10002 */ | 8156 */ |
10003 void set name(SimpleIdentifier identifier) { | 8157 void set name(SimpleIdentifier identifier) { |
10004 _name = becomeParentOf(identifier); | 8158 _name = becomeParentOf(identifier); |
10005 } | 8159 } |
10006 | 8160 |
10007 /** | 8161 /** |
10008 * Set the token representing the 'operator' keyword to the given token. | |
10009 * | |
10010 * @param operatorKeyword the token representing the 'operator' keyword | |
10011 */ | |
10012 void set operatorKeyword(Token operatorKeyword2) { | |
10013 this._operatorKeyword = operatorKeyword2; | |
10014 } | |
10015 | |
10016 /** | |
10017 * Set the parameters associated with the method to the given list of paramete
rs. | 8162 * Set the parameters associated with the method to the given list of paramete
rs. |
10018 * | 8163 * |
10019 * @param parameters the parameters associated with the method | 8164 * @param parameters the parameters associated with the method |
10020 */ | 8165 */ |
10021 void set parameters(FormalParameterList parameters2) { | 8166 void set parameters(FormalParameterList parameters2) { |
10022 this._parameters = becomeParentOf(parameters2); | 8167 this._parameters = becomeParentOf(parameters2); |
10023 } | 8168 } |
10024 | 8169 |
10025 /** | 8170 /** |
10026 * Set the token representing the 'get' or 'set' keyword to the given token. | |
10027 * | |
10028 * @param propertyKeyword the token representing the 'get' or 'set' keyword | |
10029 */ | |
10030 void set propertyKeyword(Token propertyKeyword2) { | |
10031 this._propertyKeyword = propertyKeyword2; | |
10032 } | |
10033 | |
10034 /** | |
10035 * Set the return type of the method to the given type name. | 8171 * Set the return type of the method to the given type name. |
10036 * | 8172 * |
10037 * @param typeName the return type of the method | 8173 * @param typeName the return type of the method |
10038 */ | 8174 */ |
10039 void set returnType(TypeName typeName) { | 8175 void set returnType(TypeName typeName) { |
10040 _returnType = becomeParentOf(typeName); | 8176 _returnType = becomeParentOf(typeName); |
10041 } | 8177 } |
10042 void visitChildren(ASTVisitor visitor) { | 8178 void visitChildren(ASTVisitor visitor) { |
10043 super.visitChildren(visitor); | 8179 super.visitChildren(visitor); |
10044 safelyVisitChild(_returnType, visitor); | 8180 safelyVisitChild(_returnType, visitor); |
10045 safelyVisitChild(_name, visitor); | 8181 safelyVisitChild(_name, visitor); |
10046 safelyVisitChild(_parameters, visitor); | 8182 safelyVisitChild(_parameters, visitor); |
10047 safelyVisitChild(_body, visitor); | 8183 safelyVisitChild(_body, visitor); |
10048 } | 8184 } |
10049 Token get firstTokenAfterCommentAndMetadata { | 8185 Token get firstTokenAfterCommentAndMetadata { |
10050 if (_modifierKeyword != null) { | 8186 if (modifierKeyword != null) { |
10051 return _modifierKeyword; | 8187 return modifierKeyword; |
10052 } else if (_returnType != null) { | 8188 } else if (_returnType != null) { |
10053 return _returnType.beginToken; | 8189 return _returnType.beginToken; |
10054 } else if (_propertyKeyword != null) { | 8190 } else if (propertyKeyword != null) { |
10055 return _propertyKeyword; | 8191 return propertyKeyword; |
10056 } else if (_operatorKeyword != null) { | 8192 } else if (operatorKeyword != null) { |
10057 return _operatorKeyword; | 8193 return operatorKeyword; |
10058 } | 8194 } |
10059 return _name.beginToken; | 8195 return _name.beginToken; |
10060 } | 8196 } |
10061 } | 8197 } |
10062 /** | 8198 /** |
10063 * Instances of the class `MethodInvocation` represent the invocation of either
a function or | 8199 * Instances of the class `MethodInvocation` represent the invocation of either
a function or |
10064 * a method. Invocations of functions resulting from evaluating an expression ar
e represented by | 8200 * a method. Invocations of functions resulting from evaluating an expression ar
e represented by |
10065 * [FunctionExpressionInvocation] nodes. Invocations of getters | 8201 * [FunctionExpressionInvocation] nodes. Invocations of getters |
10066 * and setters are represented by either [PrefixedIdentifier] or | 8202 * and setters are represented by either [PrefixedIdentifier] or |
10067 * [PropertyAccess] nodes. | 8203 * [PropertyAccess] nodes. |
(...skipping 10 matching lines...) Expand all Loading... |
10078 /** | 8214 /** |
10079 * The expression producing the object on which the method is defined, or `nul
l` if there is | 8215 * The expression producing the object on which the method is defined, or `nul
l` if there is |
10080 * no target (that is, the target is implicitly `this`). | 8216 * no target (that is, the target is implicitly `this`). |
10081 */ | 8217 */ |
10082 Expression _target; | 8218 Expression _target; |
10083 | 8219 |
10084 /** | 8220 /** |
10085 * The period that separates the target from the method name, or `null` if the
re is no | 8221 * The period that separates the target from the method name, or `null` if the
re is no |
10086 * target. | 8222 * target. |
10087 */ | 8223 */ |
10088 Token _period; | 8224 Token period; |
10089 | 8225 |
10090 /** | 8226 /** |
10091 * The name of the method being invoked. | 8227 * The name of the method being invoked. |
10092 */ | 8228 */ |
10093 SimpleIdentifier _methodName; | 8229 SimpleIdentifier _methodName; |
10094 | 8230 |
10095 /** | 8231 /** |
10096 * The list of arguments to the method. | 8232 * The list of arguments to the method. |
10097 */ | 8233 */ |
10098 ArgumentList _argumentList; | 8234 ArgumentList _argumentList; |
10099 | 8235 |
10100 /** | 8236 /** |
10101 * Initialize a newly created method invocation. | 8237 * Initialize a newly created method invocation. |
10102 * | 8238 * |
10103 * @param target the expression producing the object on which the method is de
fined | 8239 * @param target the expression producing the object on which the method is de
fined |
10104 * @param period the period that separates the target from the method name | 8240 * @param period the period that separates the target from the method name |
10105 * @param methodName the name of the method being invoked | 8241 * @param methodName the name of the method being invoked |
10106 * @param argumentList the list of arguments to the method | 8242 * @param argumentList the list of arguments to the method |
10107 */ | 8243 */ |
10108 MethodInvocation.full(Expression target, Token period, SimpleIdentifier method
Name, ArgumentList argumentList) { | 8244 MethodInvocation.full(Expression target, Token period, SimpleIdentifier method
Name, ArgumentList argumentList) { |
10109 this._target = becomeParentOf(target); | 8245 this._target = becomeParentOf(target); |
10110 this._period = period; | 8246 this.period = period; |
10111 this._methodName = becomeParentOf(methodName); | 8247 this._methodName = becomeParentOf(methodName); |
10112 this._argumentList = becomeParentOf(argumentList); | 8248 this._argumentList = becomeParentOf(argumentList); |
10113 } | 8249 } |
10114 | 8250 |
10115 /** | 8251 /** |
10116 * Initialize a newly created method invocation. | 8252 * Initialize a newly created method invocation. |
10117 * | 8253 * |
10118 * @param target the expression producing the object on which the method is de
fined | 8254 * @param target the expression producing the object on which the method is de
fined |
10119 * @param period the period that separates the target from the method name | 8255 * @param period the period that separates the target from the method name |
10120 * @param methodName the name of the method being invoked | 8256 * @param methodName the name of the method being invoked |
10121 * @param argumentList the list of arguments to the method | 8257 * @param argumentList the list of arguments to the method |
10122 */ | 8258 */ |
10123 MethodInvocation({Expression target, Token period, SimpleIdentifier methodName
, ArgumentList argumentList}) : this.full(target, period, methodName, argumentLi
st); | 8259 MethodInvocation({Expression target, Token period, SimpleIdentifier methodName
, ArgumentList argumentList}) : this.full(target, period, methodName, argumentLi
st); |
10124 accept(ASTVisitor visitor) => visitor.visitMethodInvocation(this); | 8260 accept(ASTVisitor visitor) => visitor.visitMethodInvocation(this); |
10125 | 8261 |
10126 /** | 8262 /** |
10127 * Return the list of arguments to the method. | 8263 * Return the list of arguments to the method. |
10128 * | 8264 * |
10129 * @return the list of arguments to the method | 8265 * @return the list of arguments to the method |
10130 */ | 8266 */ |
10131 ArgumentList get argumentList => _argumentList; | 8267 ArgumentList get argumentList => _argumentList; |
10132 Token get beginToken { | 8268 Token get beginToken { |
10133 if (_target != null) { | 8269 if (_target != null) { |
10134 return _target.beginToken; | 8270 return _target.beginToken; |
10135 } else if (_period != null) { | 8271 } else if (period != null) { |
10136 return _period; | 8272 return period; |
10137 } | 8273 } |
10138 return _methodName.beginToken; | 8274 return _methodName.beginToken; |
10139 } | 8275 } |
10140 Token get endToken => _argumentList.endToken; | 8276 Token get endToken => _argumentList.endToken; |
10141 | 8277 |
10142 /** | 8278 /** |
10143 * Return the name of the method being invoked. | 8279 * Return the name of the method being invoked. |
10144 * | 8280 * |
10145 * @return the name of the method being invoked | 8281 * @return the name of the method being invoked |
10146 */ | 8282 */ |
10147 SimpleIdentifier get methodName => _methodName; | 8283 SimpleIdentifier get methodName => _methodName; |
10148 | 8284 |
10149 /** | 8285 /** |
10150 * Return the period that separates the target from the method name, or `null`
if there is | |
10151 * no target. | |
10152 * | |
10153 * @return the period that separates the target from the method name | |
10154 */ | |
10155 Token get period => _period; | |
10156 | |
10157 /** | |
10158 * Return the expression used to compute the receiver of the invocation. If th
is invocation is not | 8286 * Return the expression used to compute the receiver of the invocation. If th
is invocation is not |
10159 * part of a cascade expression, then this is the same as [getTarget]. If this
invocation | 8287 * part of a cascade expression, then this is the same as [getTarget]. If this
invocation |
10160 * is part of a cascade expression, then the target stored with the cascade ex
pression is | 8288 * is part of a cascade expression, then the target stored with the cascade ex
pression is |
10161 * returned. | 8289 * returned. |
10162 * | 8290 * |
10163 * @return the expression used to compute the receiver of the invocation | 8291 * @return the expression used to compute the receiver of the invocation |
10164 * @see #getTarget() | 8292 * @see #getTarget() |
10165 */ | 8293 */ |
10166 Expression get realTarget { | 8294 Expression get realTarget { |
10167 if (isCascaded) { | 8295 if (isCascaded) { |
(...skipping 19 matching lines...) Expand all Loading... |
10187 */ | 8315 */ |
10188 Expression get target => _target; | 8316 Expression get target => _target; |
10189 | 8317 |
10190 /** | 8318 /** |
10191 * Return `true` if this expression is cascaded. If it is, then the target of
this | 8319 * Return `true` if this expression is cascaded. If it is, then the target of
this |
10192 * expression is not stored locally but is stored in the nearest ancestor that
is a | 8320 * expression is not stored locally but is stored in the nearest ancestor that
is a |
10193 * [CascadeExpression]. | 8321 * [CascadeExpression]. |
10194 * | 8322 * |
10195 * @return `true` if this expression is cascaded | 8323 * @return `true` if this expression is cascaded |
10196 */ | 8324 */ |
10197 bool get isCascaded => _period != null && identical(_period.type, TokenType.PE
RIOD_PERIOD); | 8325 bool get isCascaded => period != null && identical(period.type, TokenType.PERI
OD_PERIOD); |
10198 | 8326 |
10199 /** | 8327 /** |
10200 * Set the list of arguments to the method to the given list. | 8328 * Set the list of arguments to the method to the given list. |
10201 * | 8329 * |
10202 * @param argumentList the list of arguments to the method | 8330 * @param argumentList the list of arguments to the method |
10203 */ | 8331 */ |
10204 void set argumentList(ArgumentList argumentList2) { | 8332 void set argumentList(ArgumentList argumentList2) { |
10205 this._argumentList = becomeParentOf(argumentList2); | 8333 this._argumentList = becomeParentOf(argumentList2); |
10206 } | 8334 } |
10207 | 8335 |
10208 /** | 8336 /** |
10209 * Set the name of the method being invoked to the given identifier. | 8337 * Set the name of the method being invoked to the given identifier. |
10210 * | 8338 * |
10211 * @param identifier the name of the method being invoked | 8339 * @param identifier the name of the method being invoked |
10212 */ | 8340 */ |
10213 void set methodName(SimpleIdentifier identifier) { | 8341 void set methodName(SimpleIdentifier identifier) { |
10214 _methodName = becomeParentOf(identifier); | 8342 _methodName = becomeParentOf(identifier); |
10215 } | 8343 } |
10216 | 8344 |
10217 /** | 8345 /** |
10218 * Set the period that separates the target from the method name to the given
token. | |
10219 * | |
10220 * @param period the period that separates the target from the method name | |
10221 */ | |
10222 void set period(Token period2) { | |
10223 this._period = period2; | |
10224 } | |
10225 | |
10226 /** | |
10227 * Set the expression producing the object on which the method is defined to t
he given expression. | 8346 * Set the expression producing the object on which the method is defined to t
he given expression. |
10228 * | 8347 * |
10229 * @param expression the expression producing the object on which the method i
s defined | 8348 * @param expression the expression producing the object on which the method i
s defined |
10230 */ | 8349 */ |
10231 void set target(Expression expression) { | 8350 void set target(Expression expression) { |
10232 _target = becomeParentOf(expression); | 8351 _target = becomeParentOf(expression); |
10233 } | 8352 } |
10234 void visitChildren(ASTVisitor visitor) { | 8353 void visitChildren(ASTVisitor visitor) { |
10235 safelyVisitChild(_target, visitor); | 8354 safelyVisitChild(_target, visitor); |
10236 safelyVisitChild(_methodName, visitor); | 8355 safelyVisitChild(_methodName, visitor); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10348 abstract class NamespaceDirective extends UriBasedDirective { | 8467 abstract class NamespaceDirective extends UriBasedDirective { |
10349 | 8468 |
10350 /** | 8469 /** |
10351 * The token representing the 'import' or 'export' keyword. | 8470 * The token representing the 'import' or 'export' keyword. |
10352 */ | 8471 */ |
10353 Token _keyword; | 8472 Token _keyword; |
10354 | 8473 |
10355 /** | 8474 /** |
10356 * The combinators used to control which names are imported or exported. | 8475 * The combinators used to control which names are imported or exported. |
10357 */ | 8476 */ |
10358 NodeList<Combinator> _combinators; | 8477 NodeList<Combinator> combinators; |
10359 | 8478 |
10360 /** | 8479 /** |
10361 * The semicolon terminating the directive. | 8480 * The semicolon terminating the directive. |
10362 */ | 8481 */ |
10363 Token _semicolon; | 8482 Token semicolon; |
10364 | 8483 |
10365 /** | 8484 /** |
10366 * Initialize a newly created namespace directive. | 8485 * Initialize a newly created namespace directive. |
10367 * | 8486 * |
10368 * @param comment the documentation comment associated with this directive | 8487 * @param comment the documentation comment associated with this directive |
10369 * @param metadata the annotations associated with the directive | 8488 * @param metadata the annotations associated with the directive |
10370 * @param keyword the token representing the 'import' or 'export' keyword | 8489 * @param keyword the token representing the 'import' or 'export' keyword |
10371 * @param libraryUri the URI of the library being imported or exported | 8490 * @param libraryUri the URI of the library being imported or exported |
10372 * @param combinators the combinators used to control which names are imported
or exported | 8491 * @param combinators the combinators used to control which names are imported
or exported |
10373 * @param semicolon the semicolon terminating the directive | 8492 * @param semicolon the semicolon terminating the directive |
10374 */ | 8493 */ |
10375 NamespaceDirective.full(Comment comment, List<Annotation> metadata, Token keyw
ord, StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) :
super.full(comment, metadata, libraryUri) { | 8494 NamespaceDirective.full(Comment comment, List<Annotation> metadata, Token keyw
ord, StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) :
super.full(comment, metadata, libraryUri) { |
10376 this._combinators = new NodeList<Combinator>(this); | 8495 this.combinators = new NodeList<Combinator>(this); |
10377 this._keyword = keyword; | 8496 this._keyword = keyword; |
10378 this._combinators.addAll(combinators); | 8497 this.combinators.addAll(combinators); |
10379 this._semicolon = semicolon; | 8498 this.semicolon = semicolon; |
10380 } | 8499 } |
10381 | 8500 |
10382 /** | 8501 /** |
10383 * Initialize a newly created namespace directive. | 8502 * Initialize a newly created namespace directive. |
10384 * | 8503 * |
10385 * @param comment the documentation comment associated with this directive | 8504 * @param comment the documentation comment associated with this directive |
10386 * @param metadata the annotations associated with the directive | 8505 * @param metadata the annotations associated with the directive |
10387 * @param keyword the token representing the 'import' or 'export' keyword | 8506 * @param keyword the token representing the 'import' or 'export' keyword |
10388 * @param libraryUri the URI of the library being imported or exported | 8507 * @param libraryUri the URI of the library being imported or exported |
10389 * @param combinators the combinators used to control which names are imported
or exported | 8508 * @param combinators the combinators used to control which names are imported
or exported |
10390 * @param semicolon the semicolon terminating the directive | 8509 * @param semicolon the semicolon terminating the directive |
10391 */ | 8510 */ |
10392 NamespaceDirective({Comment comment, List<Annotation> metadata, Token keyword,
StringLiteral libraryUri, List<Combinator> combinators, Token semicolon}) : thi
s.full(comment, metadata, keyword, libraryUri, combinators, semicolon); | 8511 NamespaceDirective({Comment comment, List<Annotation> metadata, Token keyword,
StringLiteral libraryUri, List<Combinator> combinators, Token semicolon}) : thi
s.full(comment, metadata, keyword, libraryUri, combinators, semicolon); |
10393 | 8512 Token get endToken => semicolon; |
10394 /** | |
10395 * Return the combinators used to control how names are imported or exported. | |
10396 * | |
10397 * @return the combinators used to control how names are imported or exported | |
10398 */ | |
10399 NodeList<Combinator> get combinators => _combinators; | |
10400 Token get endToken => _semicolon; | |
10401 Token get keyword => _keyword; | 8513 Token get keyword => _keyword; |
10402 | |
10403 /** | |
10404 * Return the semicolon terminating the directive. | |
10405 * | |
10406 * @return the semicolon terminating the directive | |
10407 */ | |
10408 Token get semicolon => _semicolon; | |
10409 LibraryElement get uriElement; | 8514 LibraryElement get uriElement; |
10410 | 8515 |
10411 /** | 8516 /** |
10412 * Set the token representing the 'import' or 'export' keyword to the given to
ken. | 8517 * Set the token representing the 'import' or 'export' keyword to the given to
ken. |
10413 * | 8518 * |
10414 * @param exportToken the token representing the 'import' or 'export' keyword | 8519 * @param exportToken the token representing the 'import' or 'export' keyword |
10415 */ | 8520 */ |
10416 void set keyword(Token exportToken) { | 8521 void set keyword(Token exportToken) { |
10417 this._keyword = exportToken; | 8522 this._keyword = exportToken; |
10418 } | 8523 } |
10419 | |
10420 /** | |
10421 * Set the semicolon terminating the directive to the given token. | |
10422 * | |
10423 * @param semicolon the semicolon terminating the directive | |
10424 */ | |
10425 void set semicolon(Token semicolon2) { | |
10426 this._semicolon = semicolon2; | |
10427 } | |
10428 Token get firstTokenAfterCommentAndMetadata => _keyword; | 8524 Token get firstTokenAfterCommentAndMetadata => _keyword; |
10429 } | 8525 } |
10430 /** | 8526 /** |
10431 * Instances of the class `NativeClause` represent the "native" clause in an cla
ss | 8527 * Instances of the class `NativeClause` represent the "native" clause in an cla
ss |
10432 * declaration. | 8528 * declaration. |
10433 * | 8529 * |
10434 * <pre> | 8530 * <pre> |
10435 * nativeClause ::= | 8531 * nativeClause ::= |
10436 * 'native' [StringLiteral] | 8532 * 'native' [StringLiteral] |
10437 * </pre> | 8533 * </pre> |
10438 * | 8534 * |
10439 * @coverage dart.engine.ast | 8535 * @coverage dart.engine.ast |
10440 */ | 8536 */ |
10441 class NativeClause extends ASTNode { | 8537 class NativeClause extends ASTNode { |
10442 | 8538 |
10443 /** | 8539 /** |
10444 * The token representing the 'native' keyword. | 8540 * The token representing the 'native' keyword. |
10445 */ | 8541 */ |
10446 Token _keyword; | 8542 Token keyword; |
10447 | 8543 |
10448 /** | 8544 /** |
10449 * The name of the native object that implements the class. | 8545 * The name of the native object that implements the class. |
10450 */ | 8546 */ |
10451 StringLiteral _name; | 8547 StringLiteral name; |
10452 | 8548 |
10453 /** | 8549 /** |
10454 * Initialize a newly created native clause. | 8550 * Initialize a newly created native clause. |
10455 * | 8551 * |
10456 * @param keyword the token representing the 'native' keyword | 8552 * @param keyword the token representing the 'native' keyword |
10457 * @param name the name of the native object that implements the class. | 8553 * @param name the name of the native object that implements the class. |
10458 */ | 8554 */ |
10459 NativeClause.full(Token keyword, StringLiteral name) { | 8555 NativeClause.full(Token keyword, StringLiteral name) { |
10460 this._keyword = keyword; | 8556 this.keyword = keyword; |
10461 this._name = name; | 8557 this.name = name; |
10462 } | 8558 } |
10463 | 8559 |
10464 /** | 8560 /** |
10465 * Initialize a newly created native clause. | 8561 * Initialize a newly created native clause. |
10466 * | 8562 * |
10467 * @param keyword the token representing the 'native' keyword | 8563 * @param keyword the token representing the 'native' keyword |
10468 * @param name the name of the native object that implements the class. | 8564 * @param name the name of the native object that implements the class. |
10469 */ | 8565 */ |
10470 NativeClause({Token keyword, StringLiteral name}) : this.full(keyword, name); | 8566 NativeClause({Token keyword, StringLiteral name}) : this.full(keyword, name); |
10471 accept(ASTVisitor visitor) => visitor.visitNativeClause(this); | 8567 accept(ASTVisitor visitor) => visitor.visitNativeClause(this); |
10472 Token get beginToken => _keyword; | 8568 Token get beginToken => keyword; |
10473 Token get endToken => _name.endToken; | 8569 Token get endToken => name.endToken; |
10474 | |
10475 /** | |
10476 * Return the token representing the 'native' keyword. | |
10477 * | |
10478 * @return the token representing the 'native' keyword | |
10479 */ | |
10480 Token get keyword => _keyword; | |
10481 | |
10482 /** | |
10483 * Return the name of the native object that implements the class. | |
10484 * | |
10485 * @return the name of the native object that implements the class | |
10486 */ | |
10487 StringLiteral get name => _name; | |
10488 | |
10489 /** | |
10490 * Set the token representing the 'native' keyword to the given token. | |
10491 * | |
10492 * @param keyword the token representing the 'native' keyword | |
10493 */ | |
10494 void set keyword(Token keyword2) { | |
10495 this._keyword = keyword2; | |
10496 } | |
10497 | |
10498 /** | |
10499 * Sets the name of the native object that implements the class. | |
10500 * | |
10501 * @param name the name of the native object that implements the class. | |
10502 */ | |
10503 void set name(StringLiteral name2) { | |
10504 this._name = name2; | |
10505 } | |
10506 void visitChildren(ASTVisitor visitor) { | 8570 void visitChildren(ASTVisitor visitor) { |
10507 safelyVisitChild(_name, visitor); | 8571 safelyVisitChild(name, visitor); |
10508 } | 8572 } |
10509 } | 8573 } |
10510 /** | 8574 /** |
10511 * Instances of the class `NativeFunctionBody` represent a function body that co
nsists of a | 8575 * Instances of the class `NativeFunctionBody` represent a function body that co
nsists of a |
10512 * native keyword followed by a string literal. | 8576 * native keyword followed by a string literal. |
10513 * | 8577 * |
10514 * <pre> | 8578 * <pre> |
10515 * nativeFunctionBody ::= | 8579 * nativeFunctionBody ::= |
10516 * 'native' [SimpleStringLiteral] ';' | 8580 * 'native' [SimpleStringLiteral] ';' |
10517 * </pre> | 8581 * </pre> |
10518 * | 8582 * |
10519 * @coverage dart.engine.ast | 8583 * @coverage dart.engine.ast |
10520 */ | 8584 */ |
10521 class NativeFunctionBody extends FunctionBody { | 8585 class NativeFunctionBody extends FunctionBody { |
10522 | 8586 |
10523 /** | 8587 /** |
10524 * The token representing 'native' that marks the start of the function body. | 8588 * The token representing 'native' that marks the start of the function body. |
10525 */ | 8589 */ |
10526 Token _nativeToken; | 8590 Token nativeToken; |
10527 | 8591 |
10528 /** | 8592 /** |
10529 * The string literal, after the 'native' token. | 8593 * The string literal, after the 'native' token. |
10530 */ | 8594 */ |
10531 StringLiteral _stringLiteral; | 8595 StringLiteral stringLiteral; |
10532 | 8596 |
10533 /** | 8597 /** |
10534 * The token representing the semicolon that marks the end of the function bod
y. | 8598 * The token representing the semicolon that marks the end of the function bod
y. |
10535 */ | 8599 */ |
10536 Token _semicolon; | 8600 Token semicolon; |
10537 | 8601 |
10538 /** | 8602 /** |
10539 * Initialize a newly created function body consisting of the 'native' token,
a string literal, | 8603 * Initialize a newly created function body consisting of the 'native' token,
a string literal, |
10540 * and a semicolon. | 8604 * and a semicolon. |
10541 * | 8605 * |
10542 * @param nativeToken the token representing 'native' that marks the start of
the function body | 8606 * @param nativeToken the token representing 'native' that marks the start of
the function body |
10543 * @param stringLiteral the string literal | 8607 * @param stringLiteral the string literal |
10544 * @param semicolon the token representing the semicolon that marks the end of
the function body | 8608 * @param semicolon the token representing the semicolon that marks the end of
the function body |
10545 */ | 8609 */ |
10546 NativeFunctionBody.full(Token nativeToken, StringLiteral stringLiteral, Token
semicolon) { | 8610 NativeFunctionBody.full(Token nativeToken, StringLiteral stringLiteral, Token
semicolon) { |
10547 this._nativeToken = nativeToken; | 8611 this.nativeToken = nativeToken; |
10548 this._stringLiteral = becomeParentOf(stringLiteral); | 8612 this.stringLiteral = becomeParentOf(stringLiteral); |
10549 this._semicolon = semicolon; | 8613 this.semicolon = semicolon; |
10550 } | 8614 } |
10551 | 8615 |
10552 /** | 8616 /** |
10553 * Initialize a newly created function body consisting of the 'native' token,
a string literal, | 8617 * Initialize a newly created function body consisting of the 'native' token,
a string literal, |
10554 * and a semicolon. | 8618 * and a semicolon. |
10555 * | 8619 * |
10556 * @param nativeToken the token representing 'native' that marks the start of
the function body | 8620 * @param nativeToken the token representing 'native' that marks the start of
the function body |
10557 * @param stringLiteral the string literal | 8621 * @param stringLiteral the string literal |
10558 * @param semicolon the token representing the semicolon that marks the end of
the function body | 8622 * @param semicolon the token representing the semicolon that marks the end of
the function body |
10559 */ | 8623 */ |
10560 NativeFunctionBody({Token nativeToken, StringLiteral stringLiteral, Token semi
colon}) : this.full(nativeToken, stringLiteral, semicolon); | 8624 NativeFunctionBody({Token nativeToken, StringLiteral stringLiteral, Token semi
colon}) : this.full(nativeToken, stringLiteral, semicolon); |
10561 accept(ASTVisitor visitor) => visitor.visitNativeFunctionBody(this); | 8625 accept(ASTVisitor visitor) => visitor.visitNativeFunctionBody(this); |
10562 Token get beginToken => _nativeToken; | 8626 Token get beginToken => nativeToken; |
10563 Token get endToken => _semicolon; | 8627 Token get endToken => semicolon; |
10564 | |
10565 /** | |
10566 * Return the simple identifier representing the 'native' token. | |
10567 * | |
10568 * @return the simple identifier representing the 'native' token | |
10569 */ | |
10570 Token get nativeToken => _nativeToken; | |
10571 | |
10572 /** | |
10573 * Return the token representing the semicolon that marks the end of the funct
ion body. | |
10574 * | |
10575 * @return the token representing the semicolon that marks the end of the func
tion body | |
10576 */ | |
10577 Token get semicolon => _semicolon; | |
10578 | |
10579 /** | |
10580 * Return the string literal representing the string after the 'native' token. | |
10581 * | |
10582 * @return the string literal representing the string after the 'native' token | |
10583 */ | |
10584 StringLiteral get stringLiteral => _stringLiteral; | |
10585 void visitChildren(ASTVisitor visitor) { | 8628 void visitChildren(ASTVisitor visitor) { |
10586 safelyVisitChild(_stringLiteral, visitor); | 8629 safelyVisitChild(stringLiteral, visitor); |
10587 } | 8630 } |
10588 } | 8631 } |
10589 /** | 8632 /** |
10590 * The abstract class `NormalFormalParameter` defines the behavior common to for
mal parameters | 8633 * The abstract class `NormalFormalParameter` defines the behavior common to for
mal parameters |
10591 * that are required (are not optional). | 8634 * that are required (are not optional). |
10592 * | 8635 * |
10593 * <pre> | 8636 * <pre> |
10594 * normalFormalParameter ::= | 8637 * normalFormalParameter ::= |
10595 * [FunctionTypedFormalParameter] | 8638 * [FunctionTypedFormalParameter] |
10596 * | [FieldFormalParameter] | 8639 * | [FieldFormalParameter] |
10597 * | [SimpleFormalParameter] | 8640 * | [SimpleFormalParameter] |
10598 * </pre> | 8641 * </pre> |
10599 * | 8642 * |
10600 * @coverage dart.engine.ast | 8643 * @coverage dart.engine.ast |
10601 */ | 8644 */ |
10602 abstract class NormalFormalParameter extends FormalParameter { | 8645 abstract class NormalFormalParameter extends FormalParameter { |
10603 | 8646 |
10604 /** | 8647 /** |
10605 * The documentation comment associated with this parameter, or `null` if this
parameter | 8648 * The documentation comment associated with this parameter, or `null` if this
parameter |
10606 * does not have a documentation comment associated with it. | 8649 * does not have a documentation comment associated with it. |
10607 */ | 8650 */ |
10608 Comment _comment; | 8651 Comment _comment; |
10609 | 8652 |
10610 /** | 8653 /** |
10611 * The annotations associated with this parameter. | 8654 * The annotations associated with this parameter. |
10612 */ | 8655 */ |
10613 NodeList<Annotation> _metadata; | 8656 NodeList<Annotation> metadata; |
10614 | 8657 |
10615 /** | 8658 /** |
10616 * The name of the parameter being declared. | 8659 * The name of the parameter being declared. |
10617 */ | 8660 */ |
10618 SimpleIdentifier _identifier; | 8661 SimpleIdentifier _identifier; |
10619 | 8662 |
10620 /** | 8663 /** |
10621 * Initialize a newly created formal parameter. | 8664 * Initialize a newly created formal parameter. |
10622 * | 8665 * |
10623 * @param comment the documentation comment associated with this parameter | 8666 * @param comment the documentation comment associated with this parameter |
10624 * @param metadata the annotations associated with this parameter | 8667 * @param metadata the annotations associated with this parameter |
10625 * @param identifier the name of the parameter being declared | 8668 * @param identifier the name of the parameter being declared |
10626 */ | 8669 */ |
10627 NormalFormalParameter.full(Comment comment, List<Annotation> metadata, SimpleI
dentifier identifier) { | 8670 NormalFormalParameter.full(Comment comment, List<Annotation> metadata, SimpleI
dentifier identifier) { |
10628 this._metadata = new NodeList<Annotation>(this); | 8671 this.metadata = new NodeList<Annotation>(this); |
10629 this._comment = becomeParentOf(comment); | 8672 this._comment = becomeParentOf(comment); |
10630 this._metadata.addAll(metadata); | 8673 this.metadata.addAll(metadata); |
10631 this._identifier = becomeParentOf(identifier); | 8674 this._identifier = becomeParentOf(identifier); |
10632 } | 8675 } |
10633 | 8676 |
10634 /** | 8677 /** |
10635 * Initialize a newly created formal parameter. | 8678 * Initialize a newly created formal parameter. |
10636 * | 8679 * |
10637 * @param comment the documentation comment associated with this parameter | 8680 * @param comment the documentation comment associated with this parameter |
10638 * @param metadata the annotations associated with this parameter | 8681 * @param metadata the annotations associated with this parameter |
10639 * @param identifier the name of the parameter being declared | 8682 * @param identifier the name of the parameter being declared |
10640 */ | 8683 */ |
10641 NormalFormalParameter({Comment comment, List<Annotation> metadata, SimpleIdent
ifier identifier}) : this.full(comment, metadata, identifier); | 8684 NormalFormalParameter({Comment comment, List<Annotation> metadata, SimpleIdent
ifier identifier}) : this.full(comment, metadata, identifier); |
10642 | 8685 |
10643 /** | 8686 /** |
10644 * Return the documentation comment associated with this parameter, or `null`
if this | 8687 * Return the documentation comment associated with this parameter, or `null`
if this |
10645 * parameter does not have a documentation comment associated with it. | 8688 * parameter does not have a documentation comment associated with it. |
10646 * | 8689 * |
10647 * @return the documentation comment associated with this parameter | 8690 * @return the documentation comment associated with this parameter |
10648 */ | 8691 */ |
10649 Comment get documentationComment => _comment; | 8692 Comment get documentationComment => _comment; |
10650 SimpleIdentifier get identifier => _identifier; | 8693 SimpleIdentifier get identifier => _identifier; |
10651 ParameterKind get kind { | 8694 ParameterKind get kind { |
10652 ASTNode parent = this.parent; | 8695 ASTNode parent = this.parent; |
10653 if (parent is DefaultFormalParameter) { | 8696 if (parent is DefaultFormalParameter) { |
10654 return ((parent as DefaultFormalParameter)).kind; | 8697 return ((parent as DefaultFormalParameter)).kind; |
10655 } | 8698 } |
10656 return ParameterKind.REQUIRED; | 8699 return ParameterKind.REQUIRED; |
10657 } | 8700 } |
10658 | 8701 |
10659 /** | 8702 /** |
10660 * Return the annotations associated with this parameter. | |
10661 * | |
10662 * @return the annotations associated with this parameter | |
10663 */ | |
10664 NodeList<Annotation> get metadata => _metadata; | |
10665 | |
10666 /** | |
10667 * Set the documentation comment associated with this parameter to the given c
omment | 8703 * Set the documentation comment associated with this parameter to the given c
omment |
10668 * | 8704 * |
10669 * @param comment the documentation comment to be associated with this paramet
er | 8705 * @param comment the documentation comment to be associated with this paramet
er |
10670 */ | 8706 */ |
10671 void set documentationComment(Comment comment2) { | 8707 void set documentationComment(Comment comment2) { |
10672 this._comment = becomeParentOf(comment2); | 8708 this._comment = becomeParentOf(comment2); |
10673 } | 8709 } |
10674 | 8710 |
10675 /** | 8711 /** |
10676 * Set the name of the parameter being declared to the given identifier. | 8712 * Set the name of the parameter being declared to the given identifier. |
10677 * | 8713 * |
10678 * @param identifier the name of the parameter being declared | 8714 * @param identifier the name of the parameter being declared |
10679 */ | 8715 */ |
10680 void set identifier(SimpleIdentifier identifier2) { | 8716 void set identifier(SimpleIdentifier identifier2) { |
10681 this._identifier = becomeParentOf(identifier2); | 8717 this._identifier = becomeParentOf(identifier2); |
10682 } | 8718 } |
10683 void visitChildren(ASTVisitor visitor) { | 8719 void visitChildren(ASTVisitor visitor) { |
10684 if (commentIsBeforeAnnotations()) { | 8720 if (commentIsBeforeAnnotations()) { |
10685 safelyVisitChild(_comment, visitor); | 8721 safelyVisitChild(_comment, visitor); |
10686 _metadata.accept(visitor); | 8722 metadata.accept(visitor); |
10687 } else { | 8723 } else { |
10688 for (ASTNode child in sortedCommentAndAnnotations) { | 8724 for (ASTNode child in sortedCommentAndAnnotations) { |
10689 child.accept(visitor); | 8725 child.accept(visitor); |
10690 } | 8726 } |
10691 } | 8727 } |
10692 } | 8728 } |
10693 | 8729 |
10694 /** | 8730 /** |
10695 * Return `true` if the comment is lexically before any annotations. | 8731 * Return `true` if the comment is lexically before any annotations. |
10696 * | 8732 * |
10697 * @return `true` if the comment is lexically before any annotations | 8733 * @return `true` if the comment is lexically before any annotations |
10698 */ | 8734 */ |
10699 bool commentIsBeforeAnnotations() { | 8735 bool commentIsBeforeAnnotations() { |
10700 if (_comment == null || _metadata.isEmpty) { | 8736 if (_comment == null || metadata.isEmpty) { |
10701 return true; | 8737 return true; |
10702 } | 8738 } |
10703 Annotation firstAnnotation = _metadata[0]; | 8739 Annotation firstAnnotation = metadata[0]; |
10704 return _comment.offset < firstAnnotation.offset; | 8740 return _comment.offset < firstAnnotation.offset; |
10705 } | 8741 } |
10706 | 8742 |
10707 /** | 8743 /** |
10708 * Return an array containing the comment and annotations associated with this
parameter, sorted | 8744 * Return an array containing the comment and annotations associated with this
parameter, sorted |
10709 * in lexical order. | 8745 * in lexical order. |
10710 * | 8746 * |
10711 * @return the comment and annotations associated with this parameter in the o
rder in which they | 8747 * @return the comment and annotations associated with this parameter in the o
rder in which they |
10712 * appeared in the original source | 8748 * appeared in the original source |
10713 */ | 8749 */ |
10714 List<ASTNode> get sortedCommentAndAnnotations { | 8750 List<ASTNode> get sortedCommentAndAnnotations { |
10715 List<ASTNode> childList = new List<ASTNode>(); | 8751 List<ASTNode> childList = new List<ASTNode>(); |
10716 childList.add(_comment); | 8752 childList.add(_comment); |
10717 childList.addAll(_metadata); | 8753 childList.addAll(metadata); |
10718 List<ASTNode> children = new List.from(childList); | 8754 List<ASTNode> children = new List.from(childList); |
10719 children.sort(ASTNode.LEXICAL_ORDER); | 8755 children.sort(ASTNode.LEXICAL_ORDER); |
10720 return children; | 8756 return children; |
10721 } | 8757 } |
10722 } | 8758 } |
10723 /** | 8759 /** |
10724 * Instances of the class `NullLiteral` represent a null literal expression. | 8760 * Instances of the class `NullLiteral` represent a null literal expression. |
10725 * | 8761 * |
10726 * <pre> | 8762 * <pre> |
10727 * nullLiteral ::= | 8763 * nullLiteral ::= |
10728 * 'null' | 8764 * 'null' |
10729 * </pre> | 8765 * </pre> |
10730 * | 8766 * |
10731 * @coverage dart.engine.ast | 8767 * @coverage dart.engine.ast |
10732 */ | 8768 */ |
10733 class NullLiteral extends Literal { | 8769 class NullLiteral extends Literal { |
10734 | 8770 |
10735 /** | 8771 /** |
10736 * The token representing the literal. | 8772 * The token representing the literal. |
10737 */ | 8773 */ |
10738 Token _literal; | 8774 Token literal; |
10739 | 8775 |
10740 /** | 8776 /** |
10741 * Initialize a newly created null literal. | 8777 * Initialize a newly created null literal. |
10742 * | 8778 * |
10743 * @param token the token representing the literal | 8779 * @param token the token representing the literal |
10744 */ | 8780 */ |
10745 NullLiteral.full(Token token) { | 8781 NullLiteral.full(Token token) { |
10746 this._literal = token; | 8782 this.literal = token; |
10747 } | 8783 } |
10748 | 8784 |
10749 /** | 8785 /** |
10750 * Initialize a newly created null literal. | 8786 * Initialize a newly created null literal. |
10751 * | 8787 * |
10752 * @param token the token representing the literal | 8788 * @param token the token representing the literal |
10753 */ | 8789 */ |
10754 NullLiteral({Token token}) : this.full(token); | 8790 NullLiteral({Token token}) : this.full(token); |
10755 accept(ASTVisitor visitor) => visitor.visitNullLiteral(this); | 8791 accept(ASTVisitor visitor) => visitor.visitNullLiteral(this); |
10756 Token get beginToken => _literal; | 8792 Token get beginToken => literal; |
10757 Token get endToken => _literal; | 8793 Token get endToken => literal; |
10758 | |
10759 /** | |
10760 * Return the token representing the literal. | |
10761 * | |
10762 * @return the token representing the literal | |
10763 */ | |
10764 Token get literal => _literal; | |
10765 | |
10766 /** | |
10767 * Set the token representing the literal to the given token. | |
10768 * | |
10769 * @param literal the token representing the literal | |
10770 */ | |
10771 void set literal(Token literal2) { | |
10772 this._literal = literal2; | |
10773 } | |
10774 void visitChildren(ASTVisitor visitor) { | 8794 void visitChildren(ASTVisitor visitor) { |
10775 } | 8795 } |
10776 } | 8796 } |
10777 /** | 8797 /** |
10778 * Instances of the class `ParenthesizedExpression` represent a parenthesized ex
pression. | 8798 * Instances of the class `ParenthesizedExpression` represent a parenthesized ex
pression. |
10779 * | 8799 * |
10780 * <pre> | 8800 * <pre> |
10781 * parenthesizedExpression ::= | 8801 * parenthesizedExpression ::= |
10782 * '(' [Expression] ')' | 8802 * '(' [Expression] ')' |
10783 * </pre> | 8803 * </pre> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10885 * [Annotation] 'part' [StringLiteral] ';' | 8905 * [Annotation] 'part' [StringLiteral] ';' |
10886 * </pre> | 8906 * </pre> |
10887 * | 8907 * |
10888 * @coverage dart.engine.ast | 8908 * @coverage dart.engine.ast |
10889 */ | 8909 */ |
10890 class PartDirective extends UriBasedDirective { | 8910 class PartDirective extends UriBasedDirective { |
10891 | 8911 |
10892 /** | 8912 /** |
10893 * The token representing the 'part' token. | 8913 * The token representing the 'part' token. |
10894 */ | 8914 */ |
10895 Token _partToken; | 8915 Token partToken; |
10896 | 8916 |
10897 /** | 8917 /** |
10898 * The semicolon terminating the directive. | 8918 * The semicolon terminating the directive. |
10899 */ | 8919 */ |
10900 Token _semicolon; | 8920 Token semicolon; |
10901 | 8921 |
10902 /** | 8922 /** |
10903 * Initialize a newly created part directive. | 8923 * Initialize a newly created part directive. |
10904 * | 8924 * |
10905 * @param comment the documentation comment associated with this directive | 8925 * @param comment the documentation comment associated with this directive |
10906 * @param metadata the annotations associated with the directive | 8926 * @param metadata the annotations associated with the directive |
10907 * @param partToken the token representing the 'part' token | 8927 * @param partToken the token representing the 'part' token |
10908 * @param partUri the URI of the part being included | 8928 * @param partUri the URI of the part being included |
10909 * @param semicolon the semicolon terminating the directive | 8929 * @param semicolon the semicolon terminating the directive |
10910 */ | 8930 */ |
10911 PartDirective.full(Comment comment, List<Annotation> metadata, Token partToken
, StringLiteral partUri, Token semicolon) : super.full(comment, metadata, partUr
i) { | 8931 PartDirective.full(Comment comment, List<Annotation> metadata, Token partToken
, StringLiteral partUri, Token semicolon) : super.full(comment, metadata, partUr
i) { |
10912 this._partToken = partToken; | 8932 this.partToken = partToken; |
10913 this._semicolon = semicolon; | 8933 this.semicolon = semicolon; |
10914 } | 8934 } |
10915 | 8935 |
10916 /** | 8936 /** |
10917 * Initialize a newly created part directive. | 8937 * Initialize a newly created part directive. |
10918 * | 8938 * |
10919 * @param comment the documentation comment associated with this directive | 8939 * @param comment the documentation comment associated with this directive |
10920 * @param metadata the annotations associated with the directive | 8940 * @param metadata the annotations associated with the directive |
10921 * @param partToken the token representing the 'part' token | 8941 * @param partToken the token representing the 'part' token |
10922 * @param partUri the URI of the part being included | 8942 * @param partUri the URI of the part being included |
10923 * @param semicolon the semicolon terminating the directive | 8943 * @param semicolon the semicolon terminating the directive |
10924 */ | 8944 */ |
10925 PartDirective({Comment comment, List<Annotation> metadata, Token partToken, St
ringLiteral partUri, Token semicolon}) : this.full(comment, metadata, partToken,
partUri, semicolon); | 8945 PartDirective({Comment comment, List<Annotation> metadata, Token partToken, St
ringLiteral partUri, Token semicolon}) : this.full(comment, metadata, partToken,
partUri, semicolon); |
10926 accept(ASTVisitor visitor) => visitor.visitPartDirective(this); | 8946 accept(ASTVisitor visitor) => visitor.visitPartDirective(this); |
10927 Token get endToken => _semicolon; | 8947 Token get endToken => semicolon; |
10928 Token get keyword => _partToken; | 8948 Token get keyword => partToken; |
10929 | |
10930 /** | |
10931 * Return the token representing the 'part' token. | |
10932 * | |
10933 * @return the token representing the 'part' token | |
10934 */ | |
10935 Token get partToken => _partToken; | |
10936 | |
10937 /** | |
10938 * Return the semicolon terminating the directive. | |
10939 * | |
10940 * @return the semicolon terminating the directive | |
10941 */ | |
10942 Token get semicolon => _semicolon; | |
10943 CompilationUnitElement get uriElement => element as CompilationUnitElement; | 8949 CompilationUnitElement get uriElement => element as CompilationUnitElement; |
10944 | 8950 Token get firstTokenAfterCommentAndMetadata => partToken; |
10945 /** | |
10946 * Set the token representing the 'part' token to the given token. | |
10947 * | |
10948 * @param partToken the token representing the 'part' token | |
10949 */ | |
10950 void set partToken(Token partToken2) { | |
10951 this._partToken = partToken2; | |
10952 } | |
10953 | |
10954 /** | |
10955 * Set the semicolon terminating the directive to the given token. | |
10956 * | |
10957 * @param semicolon the semicolon terminating the directive | |
10958 */ | |
10959 void set semicolon(Token semicolon2) { | |
10960 this._semicolon = semicolon2; | |
10961 } | |
10962 Token get firstTokenAfterCommentAndMetadata => _partToken; | |
10963 } | 8951 } |
10964 /** | 8952 /** |
10965 * Instances of the class `PartOfDirective` represent a part-of directive. | 8953 * Instances of the class `PartOfDirective` represent a part-of directive. |
10966 * | 8954 * |
10967 * <pre> | 8955 * <pre> |
10968 * partOfDirective ::= | 8956 * partOfDirective ::= |
10969 * [Annotation] 'part' 'of' [Identifier] ';' | 8957 * [Annotation] 'part' 'of' [Identifier] ';' |
10970 * </pre> | 8958 * </pre> |
10971 * | 8959 * |
10972 * @coverage dart.engine.ast | 8960 * @coverage dart.engine.ast |
10973 */ | 8961 */ |
10974 class PartOfDirective extends Directive { | 8962 class PartOfDirective extends Directive { |
10975 | 8963 |
10976 /** | 8964 /** |
10977 * The token representing the 'part' token. | 8965 * The token representing the 'part' token. |
10978 */ | 8966 */ |
10979 Token _partToken; | 8967 Token partToken; |
10980 | 8968 |
10981 /** | 8969 /** |
10982 * The token representing the 'of' token. | 8970 * The token representing the 'of' token. |
10983 */ | 8971 */ |
10984 Token _ofToken; | 8972 Token ofToken; |
10985 | 8973 |
10986 /** | 8974 /** |
10987 * The name of the library that the containing compilation unit is part of. | 8975 * The name of the library that the containing compilation unit is part of. |
10988 */ | 8976 */ |
10989 LibraryIdentifier _libraryName; | 8977 LibraryIdentifier _libraryName; |
10990 | 8978 |
10991 /** | 8979 /** |
10992 * The semicolon terminating the directive. | 8980 * The semicolon terminating the directive. |
10993 */ | 8981 */ |
10994 Token _semicolon; | 8982 Token semicolon; |
10995 | 8983 |
10996 /** | 8984 /** |
10997 * Initialize a newly created part-of directive. | 8985 * Initialize a newly created part-of directive. |
10998 * | 8986 * |
10999 * @param comment the documentation comment associated with this directive | 8987 * @param comment the documentation comment associated with this directive |
11000 * @param metadata the annotations associated with the directive | 8988 * @param metadata the annotations associated with the directive |
11001 * @param partToken the token representing the 'part' token | 8989 * @param partToken the token representing the 'part' token |
11002 * @param ofToken the token representing the 'of' token | 8990 * @param ofToken the token representing the 'of' token |
11003 * @param libraryName the name of the library that the containing compilation
unit is part of | 8991 * @param libraryName the name of the library that the containing compilation
unit is part of |
11004 * @param semicolon the semicolon terminating the directive | 8992 * @param semicolon the semicolon terminating the directive |
11005 */ | 8993 */ |
11006 PartOfDirective.full(Comment comment, List<Annotation> metadata, Token partTok
en, Token ofToken, LibraryIdentifier libraryName, Token semicolon) : super.full(
comment, metadata) { | 8994 PartOfDirective.full(Comment comment, List<Annotation> metadata, Token partTok
en, Token ofToken, LibraryIdentifier libraryName, Token semicolon) : super.full(
comment, metadata) { |
11007 this._partToken = partToken; | 8995 this.partToken = partToken; |
11008 this._ofToken = ofToken; | 8996 this.ofToken = ofToken; |
11009 this._libraryName = becomeParentOf(libraryName); | 8997 this._libraryName = becomeParentOf(libraryName); |
11010 this._semicolon = semicolon; | 8998 this.semicolon = semicolon; |
11011 } | 8999 } |
11012 | 9000 |
11013 /** | 9001 /** |
11014 * Initialize a newly created part-of directive. | 9002 * Initialize a newly created part-of directive. |
11015 * | 9003 * |
11016 * @param comment the documentation comment associated with this directive | 9004 * @param comment the documentation comment associated with this directive |
11017 * @param metadata the annotations associated with the directive | 9005 * @param metadata the annotations associated with the directive |
11018 * @param partToken the token representing the 'part' token | 9006 * @param partToken the token representing the 'part' token |
11019 * @param ofToken the token representing the 'of' token | 9007 * @param ofToken the token representing the 'of' token |
11020 * @param libraryName the name of the library that the containing compilation
unit is part of | 9008 * @param libraryName the name of the library that the containing compilation
unit is part of |
11021 * @param semicolon the semicolon terminating the directive | 9009 * @param semicolon the semicolon terminating the directive |
11022 */ | 9010 */ |
11023 PartOfDirective({Comment comment, List<Annotation> metadata, Token partToken,
Token ofToken, LibraryIdentifier libraryName, Token semicolon}) : this.full(comm
ent, metadata, partToken, ofToken, libraryName, semicolon); | 9011 PartOfDirective({Comment comment, List<Annotation> metadata, Token partToken,
Token ofToken, LibraryIdentifier libraryName, Token semicolon}) : this.full(comm
ent, metadata, partToken, ofToken, libraryName, semicolon); |
11024 accept(ASTVisitor visitor) => visitor.visitPartOfDirective(this); | 9012 accept(ASTVisitor visitor) => visitor.visitPartOfDirective(this); |
11025 Token get endToken => _semicolon; | 9013 Token get endToken => semicolon; |
11026 Token get keyword => _partToken; | 9014 Token get keyword => partToken; |
11027 | 9015 |
11028 /** | 9016 /** |
11029 * Return the name of the library that the containing compilation unit is part
of. | 9017 * Return the name of the library that the containing compilation unit is part
of. |
11030 * | 9018 * |
11031 * @return the name of the library that the containing compilation unit is par
t of | 9019 * @return the name of the library that the containing compilation unit is par
t of |
11032 */ | 9020 */ |
11033 LibraryIdentifier get libraryName => _libraryName; | 9021 LibraryIdentifier get libraryName => _libraryName; |
11034 | 9022 |
11035 /** | 9023 /** |
11036 * Return the token representing the 'of' token. | |
11037 * | |
11038 * @return the token representing the 'of' token | |
11039 */ | |
11040 Token get ofToken => _ofToken; | |
11041 | |
11042 /** | |
11043 * Return the token representing the 'part' token. | |
11044 * | |
11045 * @return the token representing the 'part' token | |
11046 */ | |
11047 Token get partToken => _partToken; | |
11048 | |
11049 /** | |
11050 * Return the semicolon terminating the directive. | |
11051 * | |
11052 * @return the semicolon terminating the directive | |
11053 */ | |
11054 Token get semicolon => _semicolon; | |
11055 | |
11056 /** | |
11057 * Set the name of the library that the containing compilation unit is part of
to the given name. | 9024 * Set the name of the library that the containing compilation unit is part of
to the given name. |
11058 * | 9025 * |
11059 * @param libraryName the name of the library that the containing compilation
unit is part of | 9026 * @param libraryName the name of the library that the containing compilation
unit is part of |
11060 */ | 9027 */ |
11061 void set libraryName(LibraryIdentifier libraryName2) { | 9028 void set libraryName(LibraryIdentifier libraryName2) { |
11062 this._libraryName = becomeParentOf(libraryName2); | 9029 this._libraryName = becomeParentOf(libraryName2); |
11063 } | 9030 } |
11064 | |
11065 /** | |
11066 * Set the token representing the 'of' token to the given token. | |
11067 * | |
11068 * @param ofToken the token representing the 'of' token | |
11069 */ | |
11070 void set ofToken(Token ofToken2) { | |
11071 this._ofToken = ofToken2; | |
11072 } | |
11073 | |
11074 /** | |
11075 * Set the token representing the 'part' token to the given token. | |
11076 * | |
11077 * @param partToken the token representing the 'part' token | |
11078 */ | |
11079 void set partToken(Token partToken2) { | |
11080 this._partToken = partToken2; | |
11081 } | |
11082 | |
11083 /** | |
11084 * Set the semicolon terminating the directive to the given token. | |
11085 * | |
11086 * @param semicolon the semicolon terminating the directive | |
11087 */ | |
11088 void set semicolon(Token semicolon2) { | |
11089 this._semicolon = semicolon2; | |
11090 } | |
11091 void visitChildren(ASTVisitor visitor) { | 9031 void visitChildren(ASTVisitor visitor) { |
11092 super.visitChildren(visitor); | 9032 super.visitChildren(visitor); |
11093 safelyVisitChild(_libraryName, visitor); | 9033 safelyVisitChild(_libraryName, visitor); |
11094 } | 9034 } |
11095 Token get firstTokenAfterCommentAndMetadata => _partToken; | 9035 Token get firstTokenAfterCommentAndMetadata => partToken; |
11096 } | 9036 } |
11097 /** | 9037 /** |
11098 * Instances of the class `PostfixExpression` represent a postfix unary expressi
on. | 9038 * Instances of the class `PostfixExpression` represent a postfix unary expressi
on. |
11099 * | 9039 * |
11100 * <pre> | 9040 * <pre> |
11101 * postfixExpression ::= | 9041 * postfixExpression ::= |
11102 * [Expression] [Token] | 9042 * [Expression] [Token] |
11103 * </pre> | 9043 * </pre> |
11104 * | 9044 * |
11105 * @coverage dart.engine.ast | 9045 * @coverage dart.engine.ast |
11106 */ | 9046 */ |
11107 class PostfixExpression extends Expression { | 9047 class PostfixExpression extends Expression { |
11108 | 9048 |
11109 /** | 9049 /** |
11110 * The expression computing the operand for the operator. | 9050 * The expression computing the operand for the operator. |
11111 */ | 9051 */ |
11112 Expression _operand; | 9052 Expression _operand; |
11113 | 9053 |
11114 /** | 9054 /** |
11115 * The postfix operator being applied to the operand. | 9055 * The postfix operator being applied to the operand. |
11116 */ | 9056 */ |
11117 Token _operator; | 9057 Token operator; |
11118 | 9058 |
11119 /** | 9059 /** |
11120 * The element associated with this the operator based on the propagated type
of the operand, or | 9060 * The element associated with this the operator based on the propagated type
of the operand, or |
11121 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, | 9061 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, |
11122 * or if the operator could not be resolved. | 9062 * or if the operator could not be resolved. |
11123 */ | 9063 */ |
11124 MethodElement _propagatedElement; | 9064 MethodElement _propagatedElement; |
11125 | 9065 |
11126 /** | 9066 /** |
11127 * The element associated with the operator based on the static type of the op
erand, or | 9067 * The element associated with the operator based on the static type of the op
erand, or |
11128 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, | 9068 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, |
11129 * or if the operator could not be resolved. | 9069 * or if the operator could not be resolved. |
11130 */ | 9070 */ |
11131 MethodElement _staticElement; | 9071 MethodElement _staticElement; |
11132 | 9072 |
11133 /** | 9073 /** |
11134 * Initialize a newly created postfix expression. | 9074 * Initialize a newly created postfix expression. |
11135 * | 9075 * |
11136 * @param operand the expression computing the operand for the operator | 9076 * @param operand the expression computing the operand for the operator |
11137 * @param operator the postfix operator being applied to the operand | 9077 * @param operator the postfix operator being applied to the operand |
11138 */ | 9078 */ |
11139 PostfixExpression.full(Expression operand, Token operator) { | 9079 PostfixExpression.full(Expression operand, Token operator) { |
11140 this._operand = becomeParentOf(operand); | 9080 this._operand = becomeParentOf(operand); |
11141 this._operator = operator; | 9081 this.operator = operator; |
11142 } | 9082 } |
11143 | 9083 |
11144 /** | 9084 /** |
11145 * Initialize a newly created postfix expression. | 9085 * Initialize a newly created postfix expression. |
11146 * | 9086 * |
11147 * @param operand the expression computing the operand for the operator | 9087 * @param operand the expression computing the operand for the operator |
11148 * @param operator the postfix operator being applied to the operand | 9088 * @param operator the postfix operator being applied to the operand |
11149 */ | 9089 */ |
11150 PostfixExpression({Expression operand, Token operator}) : this.full(operand, o
perator); | 9090 PostfixExpression({Expression operand, Token operator}) : this.full(operand, o
perator); |
11151 accept(ASTVisitor visitor) => visitor.visitPostfixExpression(this); | 9091 accept(ASTVisitor visitor) => visitor.visitPostfixExpression(this); |
11152 Token get beginToken => _operand.beginToken; | 9092 Token get beginToken => _operand.beginToken; |
11153 | 9093 |
11154 /** | 9094 /** |
11155 * Return the best element available for this operator. If resolution was able
to find a better | 9095 * Return the best element available for this operator. If resolution was able
to find a better |
11156 * element based on type propagation, that element will be returned. Otherwise
, the element found | 9096 * element based on type propagation, that element will be returned. Otherwise
, the element found |
11157 * using the result of static analysis will be returned. If resolution has not
been performed, | 9097 * using the result of static analysis will be returned. If resolution has not
been performed, |
11158 * then `null` will be returned. | 9098 * then `null` will be returned. |
11159 * | 9099 * |
11160 * @return the best element available for this operator | 9100 * @return the best element available for this operator |
11161 */ | 9101 */ |
11162 MethodElement get bestElement { | 9102 MethodElement get bestElement { |
11163 MethodElement element = propagatedElement; | 9103 MethodElement element = propagatedElement; |
11164 if (element == null) { | 9104 if (element == null) { |
11165 element = staticElement; | 9105 element = staticElement; |
11166 } | 9106 } |
11167 return element; | 9107 return element; |
11168 } | 9108 } |
11169 Token get endToken => _operator; | 9109 Token get endToken => operator; |
11170 | 9110 |
11171 /** | 9111 /** |
11172 * Return the expression computing the operand for the operator. | 9112 * Return the expression computing the operand for the operator. |
11173 * | 9113 * |
11174 * @return the expression computing the operand for the operator | 9114 * @return the expression computing the operand for the operator |
11175 */ | 9115 */ |
11176 Expression get operand => _operand; | 9116 Expression get operand => _operand; |
11177 | 9117 |
11178 /** | 9118 /** |
11179 * Return the postfix operator being applied to the operand. | |
11180 * | |
11181 * @return the postfix operator being applied to the operand | |
11182 */ | |
11183 Token get operator => _operator; | |
11184 | |
11185 /** | |
11186 * Return the element associated with the operator based on the propagated typ
e of the operand, or | 9119 * Return the element associated with the operator based on the propagated typ
e of the operand, or |
11187 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, | 9120 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, |
11188 * or if the operator could not be resolved. One example of the latter case is
an operator that is | 9121 * or if the operator could not be resolved. One example of the latter case is
an operator that is |
11189 * not defined for the type of the operand. | 9122 * not defined for the type of the operand. |
11190 * | 9123 * |
11191 * @return the element associated with the operator | 9124 * @return the element associated with the operator |
11192 */ | 9125 */ |
11193 MethodElement get propagatedElement => _propagatedElement; | 9126 MethodElement get propagatedElement => _propagatedElement; |
11194 | 9127 |
11195 /** | 9128 /** |
11196 * Return the element associated with the operator based on the static type of
the operand, or | 9129 * Return the element associated with the operator based on the static type of
the operand, or |
11197 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, | 9130 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, |
11198 * or if the operator could not be resolved. One example of the latter case is
an operator that is | 9131 * or if the operator could not be resolved. One example of the latter case is
an operator that is |
11199 * not defined for the type of the operand. | 9132 * not defined for the type of the operand. |
11200 * | 9133 * |
11201 * @return the element associated with the operator | 9134 * @return the element associated with the operator |
11202 */ | 9135 */ |
11203 MethodElement get staticElement => _staticElement; | 9136 MethodElement get staticElement => _staticElement; |
11204 | 9137 |
11205 /** | 9138 /** |
11206 * Set the expression computing the operand for the operator to the given expr
ession. | 9139 * Set the expression computing the operand for the operator to the given expr
ession. |
11207 * | 9140 * |
11208 * @param expression the expression computing the operand for the operator | 9141 * @param expression the expression computing the operand for the operator |
11209 */ | 9142 */ |
11210 void set operand(Expression expression) { | 9143 void set operand(Expression expression) { |
11211 _operand = becomeParentOf(expression); | 9144 _operand = becomeParentOf(expression); |
11212 } | 9145 } |
11213 | 9146 |
11214 /** | 9147 /** |
11215 * Set the postfix operator being applied to the operand to the given operator
. | |
11216 * | |
11217 * @param operator the postfix operator being applied to the operand | |
11218 */ | |
11219 void set operator(Token operator2) { | |
11220 this._operator = operator2; | |
11221 } | |
11222 | |
11223 /** | |
11224 * Set the element associated with the operator based on the propagated type o
f the operand to the | 9148 * Set the element associated with the operator based on the propagated type o
f the operand to the |
11225 * given element. | 9149 * given element. |
11226 * | 9150 * |
11227 * @param element the element to be associated with the operator | 9151 * @param element the element to be associated with the operator |
11228 */ | 9152 */ |
11229 void set propagatedElement(MethodElement element) { | 9153 void set propagatedElement(MethodElement element) { |
11230 _propagatedElement = element; | 9154 _propagatedElement = element; |
11231 } | 9155 } |
11232 | 9156 |
11233 /** | 9157 /** |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11293 * [Token] [Expression] | 9217 * [Token] [Expression] |
11294 * </pre> | 9218 * </pre> |
11295 * | 9219 * |
11296 * @coverage dart.engine.ast | 9220 * @coverage dart.engine.ast |
11297 */ | 9221 */ |
11298 class PrefixExpression extends Expression { | 9222 class PrefixExpression extends Expression { |
11299 | 9223 |
11300 /** | 9224 /** |
11301 * The prefix operator being applied to the operand. | 9225 * The prefix operator being applied to the operand. |
11302 */ | 9226 */ |
11303 Token _operator; | 9227 Token operator; |
11304 | 9228 |
11305 /** | 9229 /** |
11306 * The expression computing the operand for the operator. | 9230 * The expression computing the operand for the operator. |
11307 */ | 9231 */ |
11308 Expression _operand; | 9232 Expression _operand; |
11309 | 9233 |
11310 /** | 9234 /** |
11311 * The element associated with the operator based on the static type of the op
erand, or | 9235 * The element associated with the operator based on the static type of the op
erand, or |
11312 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, | 9236 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, |
11313 * or if the operator could not be resolved. | 9237 * or if the operator could not be resolved. |
11314 */ | 9238 */ |
11315 MethodElement _staticElement; | 9239 MethodElement _staticElement; |
11316 | 9240 |
11317 /** | 9241 /** |
11318 * The element associated with the operator based on the propagated type of th
e operand, or | 9242 * The element associated with the operator based on the propagated type of th
e operand, or |
11319 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, | 9243 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, |
11320 * or if the operator could not be resolved. | 9244 * or if the operator could not be resolved. |
11321 */ | 9245 */ |
11322 MethodElement _propagatedElement; | 9246 MethodElement _propagatedElement; |
11323 | 9247 |
11324 /** | 9248 /** |
11325 * Initialize a newly created prefix expression. | 9249 * Initialize a newly created prefix expression. |
11326 * | 9250 * |
11327 * @param operator the prefix operator being applied to the operand | 9251 * @param operator the prefix operator being applied to the operand |
11328 * @param operand the expression computing the operand for the operator | 9252 * @param operand the expression computing the operand for the operator |
11329 */ | 9253 */ |
11330 PrefixExpression.full(Token operator, Expression operand) { | 9254 PrefixExpression.full(Token operator, Expression operand) { |
11331 this._operator = operator; | 9255 this.operator = operator; |
11332 this._operand = becomeParentOf(operand); | 9256 this._operand = becomeParentOf(operand); |
11333 } | 9257 } |
11334 | 9258 |
11335 /** | 9259 /** |
11336 * Initialize a newly created prefix expression. | 9260 * Initialize a newly created prefix expression. |
11337 * | 9261 * |
11338 * @param operator the prefix operator being applied to the operand | 9262 * @param operator the prefix operator being applied to the operand |
11339 * @param operand the expression computing the operand for the operator | 9263 * @param operand the expression computing the operand for the operator |
11340 */ | 9264 */ |
11341 PrefixExpression({Token operator, Expression operand}) : this.full(operator, o
perand); | 9265 PrefixExpression({Token operator, Expression operand}) : this.full(operator, o
perand); |
11342 accept(ASTVisitor visitor) => visitor.visitPrefixExpression(this); | 9266 accept(ASTVisitor visitor) => visitor.visitPrefixExpression(this); |
11343 Token get beginToken => _operator; | 9267 Token get beginToken => operator; |
11344 | 9268 |
11345 /** | 9269 /** |
11346 * Return the best element available for this operator. If resolution was able
to find a better | 9270 * Return the best element available for this operator. If resolution was able
to find a better |
11347 * element based on type propagation, that element will be returned. Otherwise
, the element found | 9271 * element based on type propagation, that element will be returned. Otherwise
, the element found |
11348 * using the result of static analysis will be returned. If resolution has not
been performed, | 9272 * using the result of static analysis will be returned. If resolution has not
been performed, |
11349 * then `null` will be returned. | 9273 * then `null` will be returned. |
11350 * | 9274 * |
11351 * @return the best element available for this operator | 9275 * @return the best element available for this operator |
11352 */ | 9276 */ |
11353 MethodElement get bestElement { | 9277 MethodElement get bestElement { |
11354 MethodElement element = propagatedElement; | 9278 MethodElement element = propagatedElement; |
11355 if (element == null) { | 9279 if (element == null) { |
11356 element = staticElement; | 9280 element = staticElement; |
11357 } | 9281 } |
11358 return element; | 9282 return element; |
11359 } | 9283 } |
11360 Token get endToken => _operand.endToken; | 9284 Token get endToken => _operand.endToken; |
11361 | 9285 |
11362 /** | 9286 /** |
11363 * Return the expression computing the operand for the operator. | 9287 * Return the expression computing the operand for the operator. |
11364 * | 9288 * |
11365 * @return the expression computing the operand for the operator | 9289 * @return the expression computing the operand for the operator |
11366 */ | 9290 */ |
11367 Expression get operand => _operand; | 9291 Expression get operand => _operand; |
11368 | 9292 |
11369 /** | 9293 /** |
11370 * Return the prefix operator being applied to the operand. | |
11371 * | |
11372 * @return the prefix operator being applied to the operand | |
11373 */ | |
11374 Token get operator => _operator; | |
11375 | |
11376 /** | |
11377 * Return the element associated with the operator based on the propagated typ
e of the operand, or | 9294 * Return the element associated with the operator based on the propagated typ
e of the operand, or |
11378 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, | 9295 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, |
11379 * or if the operator could not be resolved. One example of the latter case is
an operator that is | 9296 * or if the operator could not be resolved. One example of the latter case is
an operator that is |
11380 * not defined for the type of the operand. | 9297 * not defined for the type of the operand. |
11381 * | 9298 * |
11382 * @return the element associated with the operator | 9299 * @return the element associated with the operator |
11383 */ | 9300 */ |
11384 MethodElement get propagatedElement => _propagatedElement; | 9301 MethodElement get propagatedElement => _propagatedElement; |
11385 | 9302 |
11386 /** | 9303 /** |
11387 * Return the element associated with the operator based on the static type of
the operand, or | 9304 * Return the element associated with the operator based on the static type of
the operand, or |
11388 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, | 9305 * `null` if the AST structure has not been resolved, if the operator is not u
ser definable, |
11389 * or if the operator could not be resolved. One example of the latter case is
an operator that is | 9306 * or if the operator could not be resolved. One example of the latter case is
an operator that is |
11390 * not defined for the type of the operand. | 9307 * not defined for the type of the operand. |
11391 * | 9308 * |
11392 * @return the element associated with the operator | 9309 * @return the element associated with the operator |
11393 */ | 9310 */ |
11394 MethodElement get staticElement => _staticElement; | 9311 MethodElement get staticElement => _staticElement; |
11395 | 9312 |
11396 /** | 9313 /** |
11397 * Set the expression computing the operand for the operator to the given expr
ession. | 9314 * Set the expression computing the operand for the operator to the given expr
ession. |
11398 * | 9315 * |
11399 * @param expression the expression computing the operand for the operator | 9316 * @param expression the expression computing the operand for the operator |
11400 */ | 9317 */ |
11401 void set operand(Expression expression) { | 9318 void set operand(Expression expression) { |
11402 _operand = becomeParentOf(expression); | 9319 _operand = becomeParentOf(expression); |
11403 } | 9320 } |
11404 | 9321 |
11405 /** | 9322 /** |
11406 * Set the prefix operator being applied to the operand to the given operator. | |
11407 * | |
11408 * @param operator the prefix operator being applied to the operand | |
11409 */ | |
11410 void set operator(Token operator2) { | |
11411 this._operator = operator2; | |
11412 } | |
11413 | |
11414 /** | |
11415 * Set the element associated with the operator based on the propagated type o
f the operand to the | 9323 * Set the element associated with the operator based on the propagated type o
f the operand to the |
11416 * given element. | 9324 * given element. |
11417 * | 9325 * |
11418 * @param element the element to be associated with the operator | 9326 * @param element the element to be associated with the operator |
11419 */ | 9327 */ |
11420 void set propagatedElement(MethodElement element) { | 9328 void set propagatedElement(MethodElement element) { |
11421 _propagatedElement = element; | 9329 _propagatedElement = element; |
11422 } | 9330 } |
11423 | 9331 |
11424 /** | 9332 /** |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11491 class PrefixedIdentifier extends Identifier { | 9399 class PrefixedIdentifier extends Identifier { |
11492 | 9400 |
11493 /** | 9401 /** |
11494 * The prefix associated with the library in which the identifier is defined. | 9402 * The prefix associated with the library in which the identifier is defined. |
11495 */ | 9403 */ |
11496 SimpleIdentifier _prefix; | 9404 SimpleIdentifier _prefix; |
11497 | 9405 |
11498 /** | 9406 /** |
11499 * The period used to separate the prefix from the identifier. | 9407 * The period used to separate the prefix from the identifier. |
11500 */ | 9408 */ |
11501 Token _period; | 9409 Token period; |
11502 | 9410 |
11503 /** | 9411 /** |
11504 * The identifier being prefixed. | 9412 * The identifier being prefixed. |
11505 */ | 9413 */ |
11506 SimpleIdentifier _identifier; | 9414 SimpleIdentifier _identifier; |
11507 | 9415 |
11508 /** | 9416 /** |
11509 * Initialize a newly created prefixed identifier. | 9417 * Initialize a newly created prefixed identifier. |
11510 * | 9418 * |
11511 * @param prefix the identifier being prefixed | 9419 * @param prefix the identifier being prefixed |
11512 * @param period the period used to separate the prefix from the identifier | 9420 * @param period the period used to separate the prefix from the identifier |
11513 * @param identifier the prefix associated with the library in which the ident
ifier is defined | 9421 * @param identifier the prefix associated with the library in which the ident
ifier is defined |
11514 */ | 9422 */ |
11515 PrefixedIdentifier.full(SimpleIdentifier prefix, Token period, SimpleIdentifie
r identifier) { | 9423 PrefixedIdentifier.full(SimpleIdentifier prefix, Token period, SimpleIdentifie
r identifier) { |
11516 this._prefix = becomeParentOf(prefix); | 9424 this._prefix = becomeParentOf(prefix); |
11517 this._period = period; | 9425 this.period = period; |
11518 this._identifier = becomeParentOf(identifier); | 9426 this._identifier = becomeParentOf(identifier); |
11519 } | 9427 } |
11520 | 9428 |
11521 /** | 9429 /** |
11522 * Initialize a newly created prefixed identifier. | 9430 * Initialize a newly created prefixed identifier. |
11523 * | 9431 * |
11524 * @param prefix the identifier being prefixed | 9432 * @param prefix the identifier being prefixed |
11525 * @param period the period used to separate the prefix from the identifier | 9433 * @param period the period used to separate the prefix from the identifier |
11526 * @param identifier the prefix associated with the library in which the ident
ifier is defined | 9434 * @param identifier the prefix associated with the library in which the ident
ifier is defined |
11527 */ | 9435 */ |
(...skipping 10 matching lines...) Expand all Loading... |
11538 | 9446 |
11539 /** | 9447 /** |
11540 * Return the identifier being prefixed. | 9448 * Return the identifier being prefixed. |
11541 * | 9449 * |
11542 * @return the identifier being prefixed | 9450 * @return the identifier being prefixed |
11543 */ | 9451 */ |
11544 SimpleIdentifier get identifier => _identifier; | 9452 SimpleIdentifier get identifier => _identifier; |
11545 String get name => "${_prefix.name}.${_identifier.name}"; | 9453 String get name => "${_prefix.name}.${_identifier.name}"; |
11546 | 9454 |
11547 /** | 9455 /** |
11548 * Return the period used to separate the prefix from the identifier. | |
11549 * | |
11550 * @return the period used to separate the prefix from the identifier | |
11551 */ | |
11552 Token get period => _period; | |
11553 | |
11554 /** | |
11555 * Return the prefix associated with the library in which the identifier is de
fined. | 9456 * Return the prefix associated with the library in which the identifier is de
fined. |
11556 * | 9457 * |
11557 * @return the prefix associated with the library in which the identifier is d
efined | 9458 * @return the prefix associated with the library in which the identifier is d
efined |
11558 */ | 9459 */ |
11559 SimpleIdentifier get prefix => _prefix; | 9460 SimpleIdentifier get prefix => _prefix; |
11560 Element get propagatedElement { | 9461 Element get propagatedElement { |
11561 if (_identifier == null) { | 9462 if (_identifier == null) { |
11562 return null; | 9463 return null; |
11563 } | 9464 } |
11564 return _identifier.propagatedElement; | 9465 return _identifier.propagatedElement; |
11565 } | 9466 } |
11566 Element get staticElement { | 9467 Element get staticElement { |
11567 if (_identifier == null) { | 9468 if (_identifier == null) { |
11568 return null; | 9469 return null; |
11569 } | 9470 } |
11570 return _identifier.staticElement; | 9471 return _identifier.staticElement; |
11571 } | 9472 } |
11572 | 9473 |
11573 /** | 9474 /** |
11574 * Set the identifier being prefixed to the given identifier. | 9475 * Set the identifier being prefixed to the given identifier. |
11575 * | 9476 * |
11576 * @param identifier the identifier being prefixed | 9477 * @param identifier the identifier being prefixed |
11577 */ | 9478 */ |
11578 void set identifier(SimpleIdentifier identifier2) { | 9479 void set identifier(SimpleIdentifier identifier2) { |
11579 this._identifier = becomeParentOf(identifier2); | 9480 this._identifier = becomeParentOf(identifier2); |
11580 } | 9481 } |
11581 | 9482 |
11582 /** | 9483 /** |
11583 * Set the period used to separate the prefix from the identifier to the given
token. | |
11584 * | |
11585 * @param period the period used to separate the prefix from the identifier | |
11586 */ | |
11587 void set period(Token period2) { | |
11588 this._period = period2; | |
11589 } | |
11590 | |
11591 /** | |
11592 * Set the prefix associated with the library in which the identifier is defin
ed to the given | 9484 * Set the prefix associated with the library in which the identifier is defin
ed to the given |
11593 * identifier. | 9485 * identifier. |
11594 * | 9486 * |
11595 * @param identifier the prefix associated with the library in which the ident
ifier is defined | 9487 * @param identifier the prefix associated with the library in which the ident
ifier is defined |
11596 */ | 9488 */ |
11597 void set prefix(SimpleIdentifier identifier) { | 9489 void set prefix(SimpleIdentifier identifier) { |
11598 _prefix = becomeParentOf(identifier); | 9490 _prefix = becomeParentOf(identifier); |
11599 } | 9491 } |
11600 void visitChildren(ASTVisitor visitor) { | 9492 void visitChildren(ASTVisitor visitor) { |
11601 safelyVisitChild(_prefix, visitor); | 9493 safelyVisitChild(_prefix, visitor); |
(...skipping 17 matching lines...) Expand all Loading... |
11619 class PropertyAccess extends Expression { | 9511 class PropertyAccess extends Expression { |
11620 | 9512 |
11621 /** | 9513 /** |
11622 * The expression computing the object defining the property being accessed. | 9514 * The expression computing the object defining the property being accessed. |
11623 */ | 9515 */ |
11624 Expression _target; | 9516 Expression _target; |
11625 | 9517 |
11626 /** | 9518 /** |
11627 * The property access operator. | 9519 * The property access operator. |
11628 */ | 9520 */ |
11629 Token _operator; | 9521 Token operator; |
11630 | 9522 |
11631 /** | 9523 /** |
11632 * The name of the property being accessed. | 9524 * The name of the property being accessed. |
11633 */ | 9525 */ |
11634 SimpleIdentifier _propertyName; | 9526 SimpleIdentifier _propertyName; |
11635 | 9527 |
11636 /** | 9528 /** |
11637 * Initialize a newly created property access expression. | 9529 * Initialize a newly created property access expression. |
11638 * | 9530 * |
11639 * @param target the expression computing the object defining the property bei
ng accessed | 9531 * @param target the expression computing the object defining the property bei
ng accessed |
11640 * @param operator the property access operator | 9532 * @param operator the property access operator |
11641 * @param propertyName the name of the property being accessed | 9533 * @param propertyName the name of the property being accessed |
11642 */ | 9534 */ |
11643 PropertyAccess.full(Expression target, Token operator, SimpleIdentifier proper
tyName) { | 9535 PropertyAccess.full(Expression target, Token operator, SimpleIdentifier proper
tyName) { |
11644 this._target = becomeParentOf(target); | 9536 this._target = becomeParentOf(target); |
11645 this._operator = operator; | 9537 this.operator = operator; |
11646 this._propertyName = becomeParentOf(propertyName); | 9538 this._propertyName = becomeParentOf(propertyName); |
11647 } | 9539 } |
11648 | 9540 |
11649 /** | 9541 /** |
11650 * Initialize a newly created property access expression. | 9542 * Initialize a newly created property access expression. |
11651 * | 9543 * |
11652 * @param target the expression computing the object defining the property bei
ng accessed | 9544 * @param target the expression computing the object defining the property bei
ng accessed |
11653 * @param operator the property access operator | 9545 * @param operator the property access operator |
11654 * @param propertyName the name of the property being accessed | 9546 * @param propertyName the name of the property being accessed |
11655 */ | 9547 */ |
11656 PropertyAccess({Expression target, Token operator, SimpleIdentifier propertyNa
me}) : this.full(target, operator, propertyName); | 9548 PropertyAccess({Expression target, Token operator, SimpleIdentifier propertyNa
me}) : this.full(target, operator, propertyName); |
11657 accept(ASTVisitor visitor) => visitor.visitPropertyAccess(this); | 9549 accept(ASTVisitor visitor) => visitor.visitPropertyAccess(this); |
11658 Token get beginToken { | 9550 Token get beginToken { |
11659 if (_target != null) { | 9551 if (_target != null) { |
11660 return _target.beginToken; | 9552 return _target.beginToken; |
11661 } | 9553 } |
11662 return _operator; | 9554 return operator; |
11663 } | 9555 } |
11664 Token get endToken => _propertyName.endToken; | 9556 Token get endToken => _propertyName.endToken; |
11665 | 9557 |
11666 /** | 9558 /** |
11667 * Return the property access operator. | |
11668 * | |
11669 * @return the property access operator | |
11670 */ | |
11671 Token get operator => _operator; | |
11672 | |
11673 /** | |
11674 * Return the name of the property being accessed. | 9559 * Return the name of the property being accessed. |
11675 * | 9560 * |
11676 * @return the name of the property being accessed | 9561 * @return the name of the property being accessed |
11677 */ | 9562 */ |
11678 SimpleIdentifier get propertyName => _propertyName; | 9563 SimpleIdentifier get propertyName => _propertyName; |
11679 | 9564 |
11680 /** | 9565 /** |
11681 * Return the expression used to compute the receiver of the invocation. If th
is invocation is not | 9566 * Return the expression used to compute the receiver of the invocation. If th
is invocation is not |
11682 * part of a cascade expression, then this is the same as [getTarget]. If this
invocation | 9567 * part of a cascade expression, then this is the same as [getTarget]. If this
invocation |
11683 * is part of a cascade expression, then the target stored with the cascade ex
pression is | 9568 * is part of a cascade expression, then the target stored with the cascade ex
pression is |
(...skipping 26 matching lines...) Expand all Loading... |
11710 Expression get target => _target; | 9595 Expression get target => _target; |
11711 bool get isAssignable => true; | 9596 bool get isAssignable => true; |
11712 | 9597 |
11713 /** | 9598 /** |
11714 * Return `true` if this expression is cascaded. If it is, then the target of
this | 9599 * Return `true` if this expression is cascaded. If it is, then the target of
this |
11715 * expression is not stored locally but is stored in the nearest ancestor that
is a | 9600 * expression is not stored locally but is stored in the nearest ancestor that
is a |
11716 * [CascadeExpression]. | 9601 * [CascadeExpression]. |
11717 * | 9602 * |
11718 * @return `true` if this expression is cascaded | 9603 * @return `true` if this expression is cascaded |
11719 */ | 9604 */ |
11720 bool get isCascaded => _operator != null && identical(_operator.type, TokenTyp
e.PERIOD_PERIOD); | 9605 bool get isCascaded => operator != null && identical(operator.type, TokenType.
PERIOD_PERIOD); |
11721 | |
11722 /** | |
11723 * Set the property access operator to the given token. | |
11724 * | |
11725 * @param operator the property access operator | |
11726 */ | |
11727 void set operator(Token operator2) { | |
11728 this._operator = operator2; | |
11729 } | |
11730 | 9606 |
11731 /** | 9607 /** |
11732 * Set the name of the property being accessed to the given identifier. | 9608 * Set the name of the property being accessed to the given identifier. |
11733 * | 9609 * |
11734 * @param identifier the name of the property being accessed | 9610 * @param identifier the name of the property being accessed |
11735 */ | 9611 */ |
11736 void set propertyName(SimpleIdentifier identifier) { | 9612 void set propertyName(SimpleIdentifier identifier) { |
11737 _propertyName = becomeParentOf(identifier); | 9613 _propertyName = becomeParentOf(identifier); |
11738 } | 9614 } |
11739 | 9615 |
(...skipping 20 matching lines...) Expand all Loading... |
11760 * 'this' ('.' identifier)? arguments | 9636 * 'this' ('.' identifier)? arguments |
11761 * </pre> | 9637 * </pre> |
11762 * | 9638 * |
11763 * @coverage dart.engine.ast | 9639 * @coverage dart.engine.ast |
11764 */ | 9640 */ |
11765 class RedirectingConstructorInvocation extends ConstructorInitializer { | 9641 class RedirectingConstructorInvocation extends ConstructorInitializer { |
11766 | 9642 |
11767 /** | 9643 /** |
11768 * The token for the 'this' keyword. | 9644 * The token for the 'this' keyword. |
11769 */ | 9645 */ |
11770 Token _keyword; | 9646 Token keyword; |
11771 | 9647 |
11772 /** | 9648 /** |
11773 * The token for the period before the name of the constructor that is being i
nvoked, or | 9649 * The token for the period before the name of the constructor that is being i
nvoked, or |
11774 * `null` if the unnamed constructor is being invoked. | 9650 * `null` if the unnamed constructor is being invoked. |
11775 */ | 9651 */ |
11776 Token _period; | 9652 Token period; |
11777 | 9653 |
11778 /** | 9654 /** |
11779 * The name of the constructor that is being invoked, or `null` if the unnamed
constructor | 9655 * The name of the constructor that is being invoked, or `null` if the unnamed
constructor |
11780 * is being invoked. | 9656 * is being invoked. |
11781 */ | 9657 */ |
11782 SimpleIdentifier _constructorName; | 9658 SimpleIdentifier _constructorName; |
11783 | 9659 |
11784 /** | 9660 /** |
11785 * The list of arguments to the constructor. | 9661 * The list of arguments to the constructor. |
11786 */ | 9662 */ |
11787 ArgumentList _argumentList; | 9663 ArgumentList _argumentList; |
11788 | 9664 |
11789 /** | 9665 /** |
11790 * The element associated with the constructor based on static type informatio
n, or `null` | 9666 * The element associated with the constructor based on static type informatio
n, or `null` |
11791 * if the AST structure has not been resolved or if the constructor could not
be resolved. | 9667 * if the AST structure has not been resolved or if the constructor could not
be resolved. |
11792 */ | 9668 */ |
11793 ConstructorElement _staticElement; | 9669 ConstructorElement staticElement; |
11794 | 9670 |
11795 /** | 9671 /** |
11796 * The element associated with the constructor based on propagated type inform
ation, or | 9672 * The element associated with the constructor based on propagated type inform
ation, or |
11797 * `null` if the AST structure has not been resolved or if the constructor cou
ld not be | 9673 * `null` if the AST structure has not been resolved or if the constructor cou
ld not be |
11798 * resolved. | 9674 * resolved. |
11799 */ | 9675 */ |
11800 ConstructorElement _propagatedElement; | 9676 ConstructorElement _propagatedElement; |
11801 | 9677 |
11802 /** | 9678 /** |
11803 * Initialize a newly created redirecting invocation to invoke the constructor
with the given name | 9679 * Initialize a newly created redirecting invocation to invoke the constructor
with the given name |
11804 * with the given arguments. | 9680 * with the given arguments. |
11805 * | 9681 * |
11806 * @param keyword the token for the 'this' keyword | 9682 * @param keyword the token for the 'this' keyword |
11807 * @param period the token for the period before the name of the constructor t
hat is being invoked | 9683 * @param period the token for the period before the name of the constructor t
hat is being invoked |
11808 * @param constructorName the name of the constructor that is being invoked | 9684 * @param constructorName the name of the constructor that is being invoked |
11809 * @param argumentList the list of arguments to the constructor | 9685 * @param argumentList the list of arguments to the constructor |
11810 */ | 9686 */ |
11811 RedirectingConstructorInvocation.full(Token keyword, Token period, SimpleIdent
ifier constructorName, ArgumentList argumentList) { | 9687 RedirectingConstructorInvocation.full(Token keyword, Token period, SimpleIdent
ifier constructorName, ArgumentList argumentList) { |
11812 this._keyword = keyword; | 9688 this.keyword = keyword; |
11813 this._period = period; | 9689 this.period = period; |
11814 this._constructorName = becomeParentOf(constructorName); | 9690 this._constructorName = becomeParentOf(constructorName); |
11815 this._argumentList = becomeParentOf(argumentList); | 9691 this._argumentList = becomeParentOf(argumentList); |
11816 } | 9692 } |
11817 | 9693 |
11818 /** | 9694 /** |
11819 * Initialize a newly created redirecting invocation to invoke the constructor
with the given name | 9695 * Initialize a newly created redirecting invocation to invoke the constructor
with the given name |
11820 * with the given arguments. | 9696 * with the given arguments. |
11821 * | 9697 * |
11822 * @param keyword the token for the 'this' keyword | 9698 * @param keyword the token for the 'this' keyword |
11823 * @param period the token for the period before the name of the constructor t
hat is being invoked | 9699 * @param period the token for the period before the name of the constructor t
hat is being invoked |
11824 * @param constructorName the name of the constructor that is being invoked | 9700 * @param constructorName the name of the constructor that is being invoked |
11825 * @param argumentList the list of arguments to the constructor | 9701 * @param argumentList the list of arguments to the constructor |
11826 */ | 9702 */ |
11827 RedirectingConstructorInvocation({Token keyword, Token period, SimpleIdentifie
r constructorName, ArgumentList argumentList}) : this.full(keyword, period, cons
tructorName, argumentList); | 9703 RedirectingConstructorInvocation({Token keyword, Token period, SimpleIdentifie
r constructorName, ArgumentList argumentList}) : this.full(keyword, period, cons
tructorName, argumentList); |
11828 accept(ASTVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th
is); | 9704 accept(ASTVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th
is); |
11829 | 9705 |
11830 /** | 9706 /** |
11831 * Return the list of arguments to the constructor. | 9707 * Return the list of arguments to the constructor. |
11832 * | 9708 * |
11833 * @return the list of arguments to the constructor | 9709 * @return the list of arguments to the constructor |
11834 */ | 9710 */ |
11835 ArgumentList get argumentList => _argumentList; | 9711 ArgumentList get argumentList => _argumentList; |
11836 Token get beginToken => _keyword; | 9712 Token get beginToken => keyword; |
11837 | 9713 |
11838 /** | 9714 /** |
11839 * Return the name of the constructor that is being invoked, or `null` if the
unnamed | 9715 * Return the name of the constructor that is being invoked, or `null` if the
unnamed |
11840 * constructor is being invoked. | 9716 * constructor is being invoked. |
11841 * | 9717 * |
11842 * @return the name of the constructor that is being invoked | 9718 * @return the name of the constructor that is being invoked |
11843 */ | 9719 */ |
11844 SimpleIdentifier get constructorName => _constructorName; | 9720 SimpleIdentifier get constructorName => _constructorName; |
11845 | 9721 |
11846 /** | 9722 /** |
11847 * Return the element associated with the constructor based on propagated type
information, or | 9723 * Return the element associated with the constructor based on propagated type
information, or |
11848 * `null` if the AST structure has not been resolved or if the constructor cou
ld not be | 9724 * `null` if the AST structure has not been resolved or if the constructor cou
ld not be |
11849 * resolved. | 9725 * resolved. |
11850 * | 9726 * |
11851 * @return the element associated with the super constructor | 9727 * @return the element associated with the super constructor |
11852 */ | 9728 */ |
11853 ConstructorElement get element => _propagatedElement; | 9729 ConstructorElement get element => _propagatedElement; |
11854 Token get endToken => _argumentList.endToken; | 9730 Token get endToken => _argumentList.endToken; |
11855 | 9731 |
11856 /** | 9732 /** |
11857 * Return the token for the 'this' keyword. | |
11858 * | |
11859 * @return the token for the 'this' keyword | |
11860 */ | |
11861 Token get keyword => _keyword; | |
11862 | |
11863 /** | |
11864 * Return the token for the period before the name of the constructor that is
being invoked, or | |
11865 * `null` if the unnamed constructor is being invoked. | |
11866 * | |
11867 * @return the token for the period before the name of the constructor that is
being invoked | |
11868 */ | |
11869 Token get period => _period; | |
11870 | |
11871 /** | |
11872 * Return the element associated with the constructor based on static type inf
ormation, or | |
11873 * `null` if the AST structure has not been resolved or if the constructor cou
ld not be | |
11874 * resolved. | |
11875 * | |
11876 * @return the element associated with the constructor | |
11877 */ | |
11878 ConstructorElement get staticElement => _staticElement; | |
11879 | |
11880 /** | |
11881 * Set the list of arguments to the constructor to the given list. | 9733 * Set the list of arguments to the constructor to the given list. |
11882 * | 9734 * |
11883 * @param argumentList the list of arguments to the constructor | 9735 * @param argumentList the list of arguments to the constructor |
11884 */ | 9736 */ |
11885 void set argumentList(ArgumentList argumentList2) { | 9737 void set argumentList(ArgumentList argumentList2) { |
11886 this._argumentList = becomeParentOf(argumentList2); | 9738 this._argumentList = becomeParentOf(argumentList2); |
11887 } | 9739 } |
11888 | 9740 |
11889 /** | 9741 /** |
11890 * Set the name of the constructor that is being invoked to the given identifi
er. | 9742 * Set the name of the constructor that is being invoked to the given identifi
er. |
11891 * | 9743 * |
11892 * @param identifier the name of the constructor that is being invoked | 9744 * @param identifier the name of the constructor that is being invoked |
11893 */ | 9745 */ |
11894 void set constructorName(SimpleIdentifier identifier) { | 9746 void set constructorName(SimpleIdentifier identifier) { |
11895 _constructorName = becomeParentOf(identifier); | 9747 _constructorName = becomeParentOf(identifier); |
11896 } | 9748 } |
11897 | 9749 |
11898 /** | 9750 /** |
11899 * Set the element associated with the constructor based on propagated type in
formation to the | 9751 * Set the element associated with the constructor based on propagated type in
formation to the |
11900 * given element. | 9752 * given element. |
11901 * | 9753 * |
11902 * @param element the element to be associated with the constructor | 9754 * @param element the element to be associated with the constructor |
11903 */ | 9755 */ |
11904 void set element(ConstructorElement element2) { | 9756 void set element(ConstructorElement element2) { |
11905 _propagatedElement = element2; | 9757 _propagatedElement = element2; |
11906 } | 9758 } |
11907 | |
11908 /** | |
11909 * Set the token for the 'this' keyword to the given token. | |
11910 * | |
11911 * @param keyword the token for the 'this' keyword | |
11912 */ | |
11913 void set keyword(Token keyword2) { | |
11914 this._keyword = keyword2; | |
11915 } | |
11916 | |
11917 /** | |
11918 * Set the token for the period before the name of the constructor that is bei
ng invoked to the | |
11919 * given token. | |
11920 * | |
11921 * @param period the token for the period before the name of the constructor t
hat is being invoked | |
11922 */ | |
11923 void set period(Token period2) { | |
11924 this._period = period2; | |
11925 } | |
11926 | |
11927 /** | |
11928 * Set the element associated with the constructor based on static type inform
ation to the given | |
11929 * element. | |
11930 * | |
11931 * @param element the element to be associated with the constructor | |
11932 */ | |
11933 void set staticElement(ConstructorElement element) { | |
11934 this._staticElement = element; | |
11935 } | |
11936 void visitChildren(ASTVisitor visitor) { | 9759 void visitChildren(ASTVisitor visitor) { |
11937 safelyVisitChild(_constructorName, visitor); | 9760 safelyVisitChild(_constructorName, visitor); |
11938 safelyVisitChild(_argumentList, visitor); | 9761 safelyVisitChild(_argumentList, visitor); |
11939 } | 9762 } |
11940 } | 9763 } |
11941 /** | 9764 /** |
11942 * Instances of the class `RethrowExpression` represent a rethrow expression. | 9765 * Instances of the class `RethrowExpression` represent a rethrow expression. |
11943 * | 9766 * |
11944 * <pre> | 9767 * <pre> |
11945 * rethrowExpression ::= | 9768 * rethrowExpression ::= |
11946 * 'rethrow' | 9769 * 'rethrow' |
11947 * </pre> | 9770 * </pre> |
11948 * | 9771 * |
11949 * @coverage dart.engine.ast | 9772 * @coverage dart.engine.ast |
11950 */ | 9773 */ |
11951 class RethrowExpression extends Expression { | 9774 class RethrowExpression extends Expression { |
11952 | 9775 |
11953 /** | 9776 /** |
11954 * The token representing the 'rethrow' keyword. | 9777 * The token representing the 'rethrow' keyword. |
11955 */ | 9778 */ |
11956 Token _keyword; | 9779 Token keyword; |
11957 | 9780 |
11958 /** | 9781 /** |
11959 * Initialize a newly created rethrow expression. | 9782 * Initialize a newly created rethrow expression. |
11960 * | 9783 * |
11961 * @param keyword the token representing the 'rethrow' keyword | 9784 * @param keyword the token representing the 'rethrow' keyword |
11962 */ | 9785 */ |
11963 RethrowExpression.full(Token keyword) { | 9786 RethrowExpression.full(Token keyword) { |
11964 this._keyword = keyword; | 9787 this.keyword = keyword; |
11965 } | 9788 } |
11966 | 9789 |
11967 /** | 9790 /** |
11968 * Initialize a newly created rethrow expression. | 9791 * Initialize a newly created rethrow expression. |
11969 * | 9792 * |
11970 * @param keyword the token representing the 'rethrow' keyword | 9793 * @param keyword the token representing the 'rethrow' keyword |
11971 */ | 9794 */ |
11972 RethrowExpression({Token keyword}) : this.full(keyword); | 9795 RethrowExpression({Token keyword}) : this.full(keyword); |
11973 accept(ASTVisitor visitor) => visitor.visitRethrowExpression(this); | 9796 accept(ASTVisitor visitor) => visitor.visitRethrowExpression(this); |
11974 Token get beginToken => _keyword; | 9797 Token get beginToken => keyword; |
11975 Token get endToken => _keyword; | 9798 Token get endToken => keyword; |
11976 | |
11977 /** | |
11978 * Return the token representing the 'rethrow' keyword. | |
11979 * | |
11980 * @return the token representing the 'rethrow' keyword | |
11981 */ | |
11982 Token get keyword => _keyword; | |
11983 | |
11984 /** | |
11985 * Set the token representing the 'rethrow' keyword to the given token. | |
11986 * | |
11987 * @param keyword the token representing the 'rethrow' keyword | |
11988 */ | |
11989 void set keyword(Token keyword2) { | |
11990 this._keyword = keyword2; | |
11991 } | |
11992 void visitChildren(ASTVisitor visitor) { | 9799 void visitChildren(ASTVisitor visitor) { |
11993 } | 9800 } |
11994 } | 9801 } |
11995 /** | 9802 /** |
11996 * Instances of the class `ReturnStatement` represent a return statement. | 9803 * Instances of the class `ReturnStatement` represent a return statement. |
11997 * | 9804 * |
11998 * <pre> | 9805 * <pre> |
11999 * returnStatement ::= | 9806 * returnStatement ::= |
12000 * 'return' [Expression]? ';' | 9807 * 'return' [Expression]? ';' |
12001 * </pre> | 9808 * </pre> |
12002 * | 9809 * |
12003 * @coverage dart.engine.ast | 9810 * @coverage dart.engine.ast |
12004 */ | 9811 */ |
12005 class ReturnStatement extends Statement { | 9812 class ReturnStatement extends Statement { |
12006 | 9813 |
12007 /** | 9814 /** |
12008 * The token representing the 'return' keyword. | 9815 * The token representing the 'return' keyword. |
12009 */ | 9816 */ |
12010 Token _keyword; | 9817 Token keyword; |
12011 | 9818 |
12012 /** | 9819 /** |
12013 * The expression computing the value to be returned, or `null` if no explicit
value was | 9820 * The expression computing the value to be returned, or `null` if no explicit
value was |
12014 * provided. | 9821 * provided. |
12015 */ | 9822 */ |
12016 Expression _expression; | 9823 Expression _expression; |
12017 | 9824 |
12018 /** | 9825 /** |
12019 * The semicolon terminating the statement. | 9826 * The semicolon terminating the statement. |
12020 */ | 9827 */ |
12021 Token _semicolon; | 9828 Token semicolon; |
12022 | 9829 |
12023 /** | 9830 /** |
12024 * Initialize a newly created return statement. | 9831 * Initialize a newly created return statement. |
12025 * | 9832 * |
12026 * @param keyword the token representing the 'return' keyword | 9833 * @param keyword the token representing the 'return' keyword |
12027 * @param expression the expression computing the value to be returned | 9834 * @param expression the expression computing the value to be returned |
12028 * @param semicolon the semicolon terminating the statement | 9835 * @param semicolon the semicolon terminating the statement |
12029 */ | 9836 */ |
12030 ReturnStatement.full(Token keyword, Expression expression, Token semicolon) { | 9837 ReturnStatement.full(Token keyword, Expression expression, Token semicolon) { |
12031 this._keyword = keyword; | 9838 this.keyword = keyword; |
12032 this._expression = becomeParentOf(expression); | 9839 this._expression = becomeParentOf(expression); |
12033 this._semicolon = semicolon; | 9840 this.semicolon = semicolon; |
12034 } | 9841 } |
12035 | 9842 |
12036 /** | 9843 /** |
12037 * Initialize a newly created return statement. | 9844 * Initialize a newly created return statement. |
12038 * | 9845 * |
12039 * @param keyword the token representing the 'return' keyword | 9846 * @param keyword the token representing the 'return' keyword |
12040 * @param expression the expression computing the value to be returned | 9847 * @param expression the expression computing the value to be returned |
12041 * @param semicolon the semicolon terminating the statement | 9848 * @param semicolon the semicolon terminating the statement |
12042 */ | 9849 */ |
12043 ReturnStatement({Token keyword, Expression expression, Token semicolon}) : thi
s.full(keyword, expression, semicolon); | 9850 ReturnStatement({Token keyword, Expression expression, Token semicolon}) : thi
s.full(keyword, expression, semicolon); |
12044 accept(ASTVisitor visitor) => visitor.visitReturnStatement(this); | 9851 accept(ASTVisitor visitor) => visitor.visitReturnStatement(this); |
12045 Token get beginToken => _keyword; | 9852 Token get beginToken => keyword; |
12046 Token get endToken => _semicolon; | 9853 Token get endToken => semicolon; |
12047 | 9854 |
12048 /** | 9855 /** |
12049 * Return the expression computing the value to be returned, or `null` if no e
xplicit value | 9856 * Return the expression computing the value to be returned, or `null` if no e
xplicit value |
12050 * was provided. | 9857 * was provided. |
12051 * | 9858 * |
12052 * @return the expression computing the value to be returned | 9859 * @return the expression computing the value to be returned |
12053 */ | 9860 */ |
12054 Expression get expression => _expression; | 9861 Expression get expression => _expression; |
12055 | 9862 |
12056 /** | 9863 /** |
12057 * Return the token representing the 'return' keyword. | |
12058 * | |
12059 * @return the token representing the 'return' keyword | |
12060 */ | |
12061 Token get keyword => _keyword; | |
12062 | |
12063 /** | |
12064 * Return the semicolon terminating the statement. | |
12065 * | |
12066 * @return the semicolon terminating the statement | |
12067 */ | |
12068 Token get semicolon => _semicolon; | |
12069 | |
12070 /** | |
12071 * Set the expression computing the value to be returned to the given expressi
on. | 9864 * Set the expression computing the value to be returned to the given expressi
on. |
12072 * | 9865 * |
12073 * @param expression the expression computing the value to be returned | 9866 * @param expression the expression computing the value to be returned |
12074 */ | 9867 */ |
12075 void set expression(Expression expression2) { | 9868 void set expression(Expression expression2) { |
12076 this._expression = becomeParentOf(expression2); | 9869 this._expression = becomeParentOf(expression2); |
12077 } | 9870 } |
12078 | |
12079 /** | |
12080 * Set the token representing the 'return' keyword to the given token. | |
12081 * | |
12082 * @param keyword the token representing the 'return' keyword | |
12083 */ | |
12084 void set keyword(Token keyword2) { | |
12085 this._keyword = keyword2; | |
12086 } | |
12087 | |
12088 /** | |
12089 * Set the semicolon terminating the statement to the given token. | |
12090 * | |
12091 * @param semicolon the semicolon terminating the statement | |
12092 */ | |
12093 void set semicolon(Token semicolon2) { | |
12094 this._semicolon = semicolon2; | |
12095 } | |
12096 void visitChildren(ASTVisitor visitor) { | 9871 void visitChildren(ASTVisitor visitor) { |
12097 safelyVisitChild(_expression, visitor); | 9872 safelyVisitChild(_expression, visitor); |
12098 } | 9873 } |
12099 } | 9874 } |
12100 /** | 9875 /** |
12101 * Instances of the class `ScriptTag` represent the script tag that can optional
ly occur at | 9876 * Instances of the class `ScriptTag` represent the script tag that can optional
ly occur at |
12102 * the beginning of a compilation unit. | 9877 * the beginning of a compilation unit. |
12103 * | 9878 * |
12104 * <pre> | 9879 * <pre> |
12105 * scriptTag ::= | 9880 * scriptTag ::= |
12106 * '#!' (~NEWLINE)* NEWLINE | 9881 * '#!' (~NEWLINE)* NEWLINE |
12107 * </pre> | 9882 * </pre> |
12108 * | 9883 * |
12109 * @coverage dart.engine.ast | 9884 * @coverage dart.engine.ast |
12110 */ | 9885 */ |
12111 class ScriptTag extends ASTNode { | 9886 class ScriptTag extends ASTNode { |
12112 | 9887 |
12113 /** | 9888 /** |
12114 * The token representing this script tag. | 9889 * The token representing this script tag. |
12115 */ | 9890 */ |
12116 Token _scriptTag; | 9891 Token scriptTag; |
12117 | 9892 |
12118 /** | 9893 /** |
12119 * Initialize a newly created script tag. | 9894 * Initialize a newly created script tag. |
12120 * | 9895 * |
12121 * @param scriptTag the token representing this script tag | 9896 * @param scriptTag the token representing this script tag |
12122 */ | 9897 */ |
12123 ScriptTag.full(Token scriptTag) { | 9898 ScriptTag.full(Token scriptTag) { |
12124 this._scriptTag = scriptTag; | 9899 this.scriptTag = scriptTag; |
12125 } | 9900 } |
12126 | 9901 |
12127 /** | 9902 /** |
12128 * Initialize a newly created script tag. | 9903 * Initialize a newly created script tag. |
12129 * | 9904 * |
12130 * @param scriptTag the token representing this script tag | 9905 * @param scriptTag the token representing this script tag |
12131 */ | 9906 */ |
12132 ScriptTag({Token scriptTag}) : this.full(scriptTag); | 9907 ScriptTag({Token scriptTag}) : this.full(scriptTag); |
12133 accept(ASTVisitor visitor) => visitor.visitScriptTag(this); | 9908 accept(ASTVisitor visitor) => visitor.visitScriptTag(this); |
12134 Token get beginToken => _scriptTag; | 9909 Token get beginToken => scriptTag; |
12135 Token get endToken => _scriptTag; | 9910 Token get endToken => scriptTag; |
12136 | |
12137 /** | |
12138 * Return the token representing this script tag. | |
12139 * | |
12140 * @return the token representing this script tag | |
12141 */ | |
12142 Token get scriptTag => _scriptTag; | |
12143 | |
12144 /** | |
12145 * Set the token representing this script tag to the given script tag. | |
12146 * | |
12147 * @param scriptTag the token representing this script tag | |
12148 */ | |
12149 void set scriptTag(Token scriptTag2) { | |
12150 this._scriptTag = scriptTag2; | |
12151 } | |
12152 void visitChildren(ASTVisitor visitor) { | 9911 void visitChildren(ASTVisitor visitor) { |
12153 } | 9912 } |
12154 } | 9913 } |
12155 /** | 9914 /** |
12156 * Instances of the class `ShowCombinator` represent a combinator that restricts
the names | 9915 * Instances of the class `ShowCombinator` represent a combinator that restricts
the names |
12157 * being imported to those in a given list. | 9916 * being imported to those in a given list. |
12158 * | 9917 * |
12159 * <pre> | 9918 * <pre> |
12160 * showCombinator ::= | 9919 * showCombinator ::= |
12161 * 'show' [SimpleIdentifier] (',' [SimpleIdentifier])* | 9920 * 'show' [SimpleIdentifier] (',' [SimpleIdentifier])* |
12162 * </pre> | 9921 * </pre> |
12163 * | 9922 * |
12164 * @coverage dart.engine.ast | 9923 * @coverage dart.engine.ast |
12165 */ | 9924 */ |
12166 class ShowCombinator extends Combinator { | 9925 class ShowCombinator extends Combinator { |
12167 | 9926 |
12168 /** | 9927 /** |
12169 * The list of names from the library that are made visible by this combinator
. | 9928 * The list of names from the library that are made visible by this combinator
. |
12170 */ | 9929 */ |
12171 NodeList<SimpleIdentifier> _shownNames; | 9930 NodeList<SimpleIdentifier> shownNames; |
12172 | 9931 |
12173 /** | 9932 /** |
12174 * Initialize a newly created import show combinator. | 9933 * Initialize a newly created import show combinator. |
12175 * | 9934 * |
12176 * @param keyword the comma introducing the combinator | 9935 * @param keyword the comma introducing the combinator |
12177 * @param shownNames the list of names from the library that are made visible
by this combinator | 9936 * @param shownNames the list of names from the library that are made visible
by this combinator |
12178 */ | 9937 */ |
12179 ShowCombinator.full(Token keyword, List<SimpleIdentifier> shownNames) : super.
full(keyword) { | 9938 ShowCombinator.full(Token keyword, List<SimpleIdentifier> shownNames) : super.
full(keyword) { |
12180 this._shownNames = new NodeList<SimpleIdentifier>(this); | 9939 this.shownNames = new NodeList<SimpleIdentifier>(this); |
12181 this._shownNames.addAll(shownNames); | 9940 this.shownNames.addAll(shownNames); |
12182 } | 9941 } |
12183 | 9942 |
12184 /** | 9943 /** |
12185 * Initialize a newly created import show combinator. | 9944 * Initialize a newly created import show combinator. |
12186 * | 9945 * |
12187 * @param keyword the comma introducing the combinator | 9946 * @param keyword the comma introducing the combinator |
12188 * @param shownNames the list of names from the library that are made visible
by this combinator | 9947 * @param shownNames the list of names from the library that are made visible
by this combinator |
12189 */ | 9948 */ |
12190 ShowCombinator({Token keyword, List<SimpleIdentifier> shownNames}) : this.full
(keyword, shownNames); | 9949 ShowCombinator({Token keyword, List<SimpleIdentifier> shownNames}) : this.full
(keyword, shownNames); |
12191 accept(ASTVisitor visitor) => visitor.visitShowCombinator(this); | 9950 accept(ASTVisitor visitor) => visitor.visitShowCombinator(this); |
12192 Token get endToken => _shownNames.endToken; | 9951 Token get endToken => shownNames.endToken; |
12193 | |
12194 /** | |
12195 * Return the list of names from the library that are made visible by this com
binator. | |
12196 * | |
12197 * @return the list of names from the library that are made visible by this co
mbinator | |
12198 */ | |
12199 NodeList<SimpleIdentifier> get shownNames => _shownNames; | |
12200 void visitChildren(ASTVisitor visitor) { | 9952 void visitChildren(ASTVisitor visitor) { |
12201 _shownNames.accept(visitor); | 9953 shownNames.accept(visitor); |
12202 } | 9954 } |
12203 } | 9955 } |
12204 /** | 9956 /** |
12205 * Instances of the class `SimpleFormalParameter` represent a simple formal para
meter. | 9957 * Instances of the class `SimpleFormalParameter` represent a simple formal para
meter. |
12206 * | 9958 * |
12207 * <pre> | 9959 * <pre> |
12208 * simpleFormalParameter ::= | 9960 * simpleFormalParameter ::= |
12209 * ('final' [TypeName] | 'var' | [TypeName])? [SimpleIdentifier] | 9961 * ('final' [TypeName] | 'var' | [TypeName])? [SimpleIdentifier] |
12210 * </pre> | 9962 * </pre> |
12211 * | 9963 * |
12212 * @coverage dart.engine.ast | 9964 * @coverage dart.engine.ast |
12213 */ | 9965 */ |
12214 class SimpleFormalParameter extends NormalFormalParameter { | 9966 class SimpleFormalParameter extends NormalFormalParameter { |
12215 | 9967 |
12216 /** | 9968 /** |
12217 * The token representing either the 'final', 'const' or 'var' keyword, or `nu
ll` if no | 9969 * The token representing either the 'final', 'const' or 'var' keyword, or `nu
ll` if no |
12218 * keyword was used. | 9970 * keyword was used. |
12219 */ | 9971 */ |
12220 Token _keyword; | 9972 Token keyword; |
12221 | 9973 |
12222 /** | 9974 /** |
12223 * The name of the declared type of the parameter, or `null` if the parameter
does not have | 9975 * The name of the declared type of the parameter, or `null` if the parameter
does not have |
12224 * a declared type. | 9976 * a declared type. |
12225 */ | 9977 */ |
12226 TypeName _type; | 9978 TypeName _type; |
12227 | 9979 |
12228 /** | 9980 /** |
12229 * Initialize a newly created formal parameter. | 9981 * Initialize a newly created formal parameter. |
12230 * | 9982 * |
12231 * @param comment the documentation comment associated with this parameter | 9983 * @param comment the documentation comment associated with this parameter |
12232 * @param metadata the annotations associated with this parameter | 9984 * @param metadata the annotations associated with this parameter |
12233 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword | 9985 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword |
12234 * @param type the name of the declared type of the parameter | 9986 * @param type the name of the declared type of the parameter |
12235 * @param identifier the name of the parameter being declared | 9987 * @param identifier the name of the parameter being declared |
12236 */ | 9988 */ |
12237 SimpleFormalParameter.full(Comment comment, List<Annotation> metadata, Token k
eyword, TypeName type, SimpleIdentifier identifier) : super.full(comment, metada
ta, identifier) { | 9989 SimpleFormalParameter.full(Comment comment, List<Annotation> metadata, Token k
eyword, TypeName type, SimpleIdentifier identifier) : super.full(comment, metada
ta, identifier) { |
12238 this._keyword = keyword; | 9990 this.keyword = keyword; |
12239 this._type = becomeParentOf(type); | 9991 this._type = becomeParentOf(type); |
12240 } | 9992 } |
12241 | 9993 |
12242 /** | 9994 /** |
12243 * Initialize a newly created formal parameter. | 9995 * Initialize a newly created formal parameter. |
12244 * | 9996 * |
12245 * @param comment the documentation comment associated with this parameter | 9997 * @param comment the documentation comment associated with this parameter |
12246 * @param metadata the annotations associated with this parameter | 9998 * @param metadata the annotations associated with this parameter |
12247 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword | 9999 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword |
12248 * @param type the name of the declared type of the parameter | 10000 * @param type the name of the declared type of the parameter |
12249 * @param identifier the name of the parameter being declared | 10001 * @param identifier the name of the parameter being declared |
12250 */ | 10002 */ |
12251 SimpleFormalParameter({Comment comment, List<Annotation> metadata, Token keywo
rd, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata,
keyword, type, identifier); | 10003 SimpleFormalParameter({Comment comment, List<Annotation> metadata, Token keywo
rd, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata,
keyword, type, identifier); |
12252 accept(ASTVisitor visitor) => visitor.visitSimpleFormalParameter(this); | 10004 accept(ASTVisitor visitor) => visitor.visitSimpleFormalParameter(this); |
12253 Token get beginToken { | 10005 Token get beginToken { |
12254 if (_keyword != null) { | 10006 if (keyword != null) { |
12255 return _keyword; | 10007 return keyword; |
12256 } else if (_type != null) { | 10008 } else if (_type != null) { |
12257 return _type.beginToken; | 10009 return _type.beginToken; |
12258 } | 10010 } |
12259 return identifier.beginToken; | 10011 return identifier.beginToken; |
12260 } | 10012 } |
12261 Token get endToken => identifier.endToken; | 10013 Token get endToken => identifier.endToken; |
12262 | 10014 |
12263 /** | 10015 /** |
12264 * Return the token representing either the 'final', 'const' or 'var' keyword. | |
12265 * | |
12266 * @return the token representing either the 'final', 'const' or 'var' keyword | |
12267 */ | |
12268 Token get keyword => _keyword; | |
12269 | |
12270 /** | |
12271 * Return the name of the declared type of the parameter, or `null` if the par
ameter does | 10016 * Return the name of the declared type of the parameter, or `null` if the par
ameter does |
12272 * not have a declared type. | 10017 * not have a declared type. |
12273 * | 10018 * |
12274 * @return the name of the declared type of the parameter | 10019 * @return the name of the declared type of the parameter |
12275 */ | 10020 */ |
12276 TypeName get type => _type; | 10021 TypeName get type => _type; |
12277 bool get isConst => (_keyword is KeywordToken) && identical(((_keyword as Keyw
ordToken)).keyword, Keyword.CONST); | 10022 bool get isConst => (keyword is KeywordToken) && identical(((keyword as Keywor
dToken)).keyword, Keyword.CONST); |
12278 bool get isFinal => (_keyword is KeywordToken) && identical(((_keyword as Keyw
ordToken)).keyword, Keyword.FINAL); | 10023 bool get isFinal => (keyword is KeywordToken) && identical(((keyword as Keywor
dToken)).keyword, Keyword.FINAL); |
12279 | |
12280 /** | |
12281 * Set the token representing either the 'final', 'const' or 'var' keyword to
the given token. | |
12282 * | |
12283 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword | |
12284 */ | |
12285 void set keyword(Token keyword2) { | |
12286 this._keyword = keyword2; | |
12287 } | |
12288 | 10024 |
12289 /** | 10025 /** |
12290 * Set the name of the declared type of the parameter to the given type name. | 10026 * Set the name of the declared type of the parameter to the given type name. |
12291 * | 10027 * |
12292 * @param typeName the name of the declared type of the parameter | 10028 * @param typeName the name of the declared type of the parameter |
12293 */ | 10029 */ |
12294 void set type(TypeName typeName) { | 10030 void set type(TypeName typeName) { |
12295 _type = becomeParentOf(typeName); | 10031 _type = becomeParentOf(typeName); |
12296 } | 10032 } |
12297 void visitChildren(ASTVisitor visitor) { | 10033 void visitChildren(ASTVisitor visitor) { |
(...skipping 14 matching lines...) Expand all Loading... |
12312 * internalCharacter ::= '_' | '$' | letter | digit | 10048 * internalCharacter ::= '_' | '$' | letter | digit |
12313 * </pre> | 10049 * </pre> |
12314 * | 10050 * |
12315 * @coverage dart.engine.ast | 10051 * @coverage dart.engine.ast |
12316 */ | 10052 */ |
12317 class SimpleIdentifier extends Identifier { | 10053 class SimpleIdentifier extends Identifier { |
12318 | 10054 |
12319 /** | 10055 /** |
12320 * The token representing the identifier. | 10056 * The token representing the identifier. |
12321 */ | 10057 */ |
12322 Token _token; | 10058 Token token; |
12323 | 10059 |
12324 /** | 10060 /** |
12325 * The element associated with this identifier based on static type informatio
n, or `null` | 10061 * The element associated with this identifier based on static type informatio
n, or `null` |
12326 * if the AST structure has not been resolved or if this identifier could not
be resolved. | 10062 * if the AST structure has not been resolved or if this identifier could not
be resolved. |
12327 */ | 10063 */ |
12328 Element _staticElement; | 10064 Element _staticElement; |
12329 | 10065 |
12330 /** | 10066 /** |
12331 * The element associated with this identifier based on propagated type inform
ation, or | 10067 * The element associated with this identifier based on propagated type inform
ation, or |
12332 * `null` if the AST structure has not been resolved or if this identifier cou
ld not be | 10068 * `null` if the AST structure has not been resolved or if this identifier cou
ld not be |
12333 * resolved. | 10069 * resolved. |
12334 */ | 10070 */ |
12335 Element _propagatedElement; | 10071 Element _propagatedElement; |
12336 | 10072 |
12337 /** | 10073 /** |
12338 * If this expression is both in a getter and setter context, the [AuxiliaryEl
ements] will | 10074 * If this expression is both in a getter and setter context, the [AuxiliaryEl
ements] will |
12339 * be set to hold onto the static and propagated information. The auxiliary el
ement will hold onto | 10075 * be set to hold onto the static and propagated information. The auxiliary el
ement will hold onto |
12340 * the elements from the getter context. | 10076 * the elements from the getter context. |
12341 */ | 10077 */ |
12342 AuxiliaryElements _auxiliaryElements = null; | 10078 AuxiliaryElements auxiliaryElements = null; |
12343 | 10079 |
12344 /** | 10080 /** |
12345 * Initialize a newly created identifier. | 10081 * Initialize a newly created identifier. |
12346 * | 10082 * |
12347 * @param token the token representing the identifier | 10083 * @param token the token representing the identifier |
12348 */ | 10084 */ |
12349 SimpleIdentifier.full(Token token) { | 10085 SimpleIdentifier.full(Token token) { |
12350 this._token = token; | 10086 this.token = token; |
12351 } | 10087 } |
12352 | 10088 |
12353 /** | 10089 /** |
12354 * Initialize a newly created identifier. | 10090 * Initialize a newly created identifier. |
12355 * | 10091 * |
12356 * @param token the token representing the identifier | 10092 * @param token the token representing the identifier |
12357 */ | 10093 */ |
12358 SimpleIdentifier({Token token}) : this.full(token); | 10094 SimpleIdentifier({Token token}) : this.full(token); |
12359 accept(ASTVisitor visitor) => visitor.visitSimpleIdentifier(this); | 10095 accept(ASTVisitor visitor) => visitor.visitSimpleIdentifier(this); |
12360 | 10096 Token get beginToken => token; |
12361 /** | |
12362 * Get the auxiliary elements, this will be `null` if the node is not in a get
ter and setter | |
12363 * context, or if it is not yet fully resolved. | |
12364 */ | |
12365 AuxiliaryElements get auxiliaryElements => _auxiliaryElements; | |
12366 Token get beginToken => _token; | |
12367 Element get bestElement { | 10097 Element get bestElement { |
12368 if (_propagatedElement == null) { | 10098 if (_propagatedElement == null) { |
12369 return _staticElement; | 10099 return _staticElement; |
12370 } | 10100 } |
12371 return _propagatedElement; | 10101 return _propagatedElement; |
12372 } | 10102 } |
12373 Token get endToken => _token; | 10103 Token get endToken => token; |
12374 String get name => _token.lexeme; | 10104 String get name => token.lexeme; |
12375 Element get propagatedElement => _propagatedElement; | 10105 Element get propagatedElement => _propagatedElement; |
12376 Element get staticElement => _staticElement; | 10106 Element get staticElement => _staticElement; |
12377 | 10107 |
12378 /** | 10108 /** |
12379 * Return the token representing the identifier. | |
12380 * | |
12381 * @return the token representing the identifier | |
12382 */ | |
12383 Token get token => _token; | |
12384 | |
12385 /** | |
12386 * Return `true` if this identifier is the name being declared in a declaratio
n. | 10109 * Return `true` if this identifier is the name being declared in a declaratio
n. |
12387 * | 10110 * |
12388 * @return `true` if this identifier is the name being declared in a declarati
on | 10111 * @return `true` if this identifier is the name being declared in a declarati
on |
12389 */ | 10112 */ |
12390 bool inDeclarationContext() { | 10113 bool inDeclarationContext() { |
12391 ASTNode parent = this.parent; | 10114 ASTNode parent = this.parent; |
12392 if (parent is CatchClause) { | 10115 if (parent is CatchClause) { |
12393 CatchClause clause = parent as CatchClause; | 10116 CatchClause clause = parent as CatchClause; |
12394 return identical(this, clause.exceptionParameter) || identical(this, claus
e.stackTraceParameter); | 10117 return identical(this, clause.exceptionParameter) || identical(this, claus
e.stackTraceParameter); |
12395 } else if (parent is ClassDeclaration) { | 10118 } else if (parent is ClassDeclaration) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12486 } | 10209 } |
12487 if (parent is PrefixExpression) { | 10210 if (parent is PrefixExpression) { |
12488 return ((parent as PrefixExpression)).operator.type.isIncrementOperator; | 10211 return ((parent as PrefixExpression)).operator.type.isIncrementOperator; |
12489 } else if (parent is PostfixExpression) { | 10212 } else if (parent is PostfixExpression) { |
12490 return true; | 10213 return true; |
12491 } else if (parent is AssignmentExpression) { | 10214 } else if (parent is AssignmentExpression) { |
12492 return identical(((parent as AssignmentExpression)).leftHandSide, target); | 10215 return identical(((parent as AssignmentExpression)).leftHandSide, target); |
12493 } | 10216 } |
12494 return false; | 10217 return false; |
12495 } | 10218 } |
12496 bool get isSynthetic => _token.isSynthetic; | 10219 bool get isSynthetic => token.isSynthetic; |
12497 | |
12498 /** | |
12499 * Set the auxiliary elements. | |
12500 */ | |
12501 void set auxiliaryElements(AuxiliaryElements auxiliaryElements2) { | |
12502 this._auxiliaryElements = auxiliaryElements2; | |
12503 } | |
12504 | 10220 |
12505 /** | 10221 /** |
12506 * Set the element associated with this identifier based on propagated type in
formation to the | 10222 * Set the element associated with this identifier based on propagated type in
formation to the |
12507 * given element. | 10223 * given element. |
12508 * | 10224 * |
12509 * @param element the element to be associated with this identifier | 10225 * @param element the element to be associated with this identifier |
12510 */ | 10226 */ |
12511 void set propagatedElement(Element element) { | 10227 void set propagatedElement(Element element) { |
12512 _propagatedElement = validateElement2(element); | 10228 _propagatedElement = validateElement2(element); |
12513 } | 10229 } |
12514 | 10230 |
12515 /** | 10231 /** |
12516 * Set the element associated with this identifier based on static type inform
ation to the given | 10232 * Set the element associated with this identifier based on static type inform
ation to the given |
12517 * element. | 10233 * element. |
12518 * | 10234 * |
12519 * @param element the element to be associated with this identifier | 10235 * @param element the element to be associated with this identifier |
12520 */ | 10236 */ |
12521 void set staticElement(Element element) { | 10237 void set staticElement(Element element) { |
12522 _staticElement = validateElement2(element); | 10238 _staticElement = validateElement2(element); |
12523 } | 10239 } |
12524 | |
12525 /** | |
12526 * Set the token representing the identifier to the given token. | |
12527 * | |
12528 * @param token the token representing the literal | |
12529 */ | |
12530 void set token(Token token2) { | |
12531 this._token = token2; | |
12532 } | |
12533 void visitChildren(ASTVisitor visitor) { | 10240 void visitChildren(ASTVisitor visitor) { |
12534 } | 10241 } |
12535 | 10242 |
12536 /** | 10243 /** |
12537 * Return the given element if it is an appropriate element based on the paren
t of this | 10244 * Return the given element if it is an appropriate element based on the paren
t of this |
12538 * identifier, or `null` if it is not appropriate. | 10245 * identifier, or `null` if it is not appropriate. |
12539 * | 10246 * |
12540 * @param element the element to be associated with this identifier | 10247 * @param element the element to be associated with this identifier |
12541 * @return the element to be associated with this identifier | 10248 * @return the element to be associated with this identifier |
12542 */ | 10249 */ |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12607 * '"' characters '"' | 10314 * '"' characters '"' |
12608 * </pre> | 10315 * </pre> |
12609 * | 10316 * |
12610 * @coverage dart.engine.ast | 10317 * @coverage dart.engine.ast |
12611 */ | 10318 */ |
12612 class SimpleStringLiteral extends StringLiteral { | 10319 class SimpleStringLiteral extends StringLiteral { |
12613 | 10320 |
12614 /** | 10321 /** |
12615 * The token representing the literal. | 10322 * The token representing the literal. |
12616 */ | 10323 */ |
12617 Token _literal; | 10324 Token literal; |
12618 | 10325 |
12619 /** | 10326 /** |
12620 * The value of the literal. | 10327 * The value of the literal. |
12621 */ | 10328 */ |
12622 String _value; | 10329 String _value; |
12623 | 10330 |
12624 /** | 10331 /** |
12625 * Initialize a newly created simple string literal. | 10332 * Initialize a newly created simple string literal. |
12626 * | 10333 * |
12627 * @param literal the token representing the literal | 10334 * @param literal the token representing the literal |
12628 * @param value the value of the literal | 10335 * @param value the value of the literal |
12629 */ | 10336 */ |
12630 SimpleStringLiteral.full(Token literal, String value) { | 10337 SimpleStringLiteral.full(Token literal, String value) { |
12631 this._literal = literal; | 10338 this.literal = literal; |
12632 this._value = StringUtilities.intern(value); | 10339 this._value = StringUtilities.intern(value); |
12633 } | 10340 } |
12634 | 10341 |
12635 /** | 10342 /** |
12636 * Initialize a newly created simple string literal. | 10343 * Initialize a newly created simple string literal. |
12637 * | 10344 * |
12638 * @param literal the token representing the literal | 10345 * @param literal the token representing the literal |
12639 * @param value the value of the literal | 10346 * @param value the value of the literal |
12640 */ | 10347 */ |
12641 SimpleStringLiteral({Token literal, String value}) : this.full(literal, value)
; | 10348 SimpleStringLiteral({Token literal, String value}) : this.full(literal, value)
; |
12642 accept(ASTVisitor visitor) => visitor.visitSimpleStringLiteral(this); | 10349 accept(ASTVisitor visitor) => visitor.visitSimpleStringLiteral(this); |
12643 Token get beginToken => _literal; | 10350 Token get beginToken => literal; |
12644 Token get endToken => _literal; | 10351 Token get endToken => literal; |
12645 | |
12646 /** | |
12647 * Return the token representing the literal. | |
12648 * | |
12649 * @return the token representing the literal | |
12650 */ | |
12651 Token get literal => _literal; | |
12652 | 10352 |
12653 /** | 10353 /** |
12654 * Return the value of the literal. | 10354 * Return the value of the literal. |
12655 * | 10355 * |
12656 * @return the value of the literal | 10356 * @return the value of the literal |
12657 */ | 10357 */ |
12658 String get value => _value; | 10358 String get value => _value; |
12659 | 10359 |
12660 /** | 10360 /** |
12661 * Return `true` if this string literal is a multi-line string. | 10361 * Return `true` if this string literal is a multi-line string. |
12662 * | 10362 * |
12663 * @return `true` if this string literal is a multi-line string | 10363 * @return `true` if this string literal is a multi-line string |
12664 */ | 10364 */ |
12665 bool get isMultiline { | 10365 bool get isMultiline { |
12666 if (_value.length < 6) { | 10366 if (_value.length < 6) { |
12667 return false; | 10367 return false; |
12668 } | 10368 } |
12669 return _value.endsWith("\"\"\"") || _value.endsWith("'''"); | 10369 return _value.endsWith("\"\"\"") || _value.endsWith("'''"); |
12670 } | 10370 } |
12671 | 10371 |
12672 /** | 10372 /** |
12673 * Return `true` if this string literal is a raw string. | 10373 * Return `true` if this string literal is a raw string. |
12674 * | 10374 * |
12675 * @return `true` if this string literal is a raw string | 10375 * @return `true` if this string literal is a raw string |
12676 */ | 10376 */ |
12677 bool get isRaw => _value.codeUnitAt(0) == 0x40; | 10377 bool get isRaw => _value.codeUnitAt(0) == 0x40; |
12678 bool get isSynthetic => _literal.isSynthetic; | 10378 bool get isSynthetic => literal.isSynthetic; |
12679 | |
12680 /** | |
12681 * Set the token representing the literal to the given token. | |
12682 * | |
12683 * @param literal the token representing the literal | |
12684 */ | |
12685 void set literal(Token literal2) { | |
12686 this._literal = literal2; | |
12687 } | |
12688 | 10379 |
12689 /** | 10380 /** |
12690 * Set the value of the literal to the given string. | 10381 * Set the value of the literal to the given string. |
12691 * | 10382 * |
12692 * @param string the value of the literal | 10383 * @param string the value of the literal |
12693 */ | 10384 */ |
12694 void set value(String string) { | 10385 void set value(String string) { |
12695 _value = StringUtilities.intern(_value); | 10386 _value = StringUtilities.intern(_value); |
12696 } | 10387 } |
12697 void visitChildren(ASTVisitor visitor) { | 10388 void visitChildren(ASTVisitor visitor) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12735 * | '"' [InterpolationElement]* '"' | 10426 * | '"' [InterpolationElement]* '"' |
12736 * </pre> | 10427 * </pre> |
12737 * | 10428 * |
12738 * @coverage dart.engine.ast | 10429 * @coverage dart.engine.ast |
12739 */ | 10430 */ |
12740 class StringInterpolation extends StringLiteral { | 10431 class StringInterpolation extends StringLiteral { |
12741 | 10432 |
12742 /** | 10433 /** |
12743 * The elements that will be composed to produce the resulting string. | 10434 * The elements that will be composed to produce the resulting string. |
12744 */ | 10435 */ |
12745 NodeList<InterpolationElement> _elements; | 10436 NodeList<InterpolationElement> elements; |
12746 | 10437 |
12747 /** | 10438 /** |
12748 * Initialize a newly created string interpolation expression. | 10439 * Initialize a newly created string interpolation expression. |
12749 * | 10440 * |
12750 * @param elements the elements that will be composed to produce the resulting
string | 10441 * @param elements the elements that will be composed to produce the resulting
string |
12751 */ | 10442 */ |
12752 StringInterpolation.full(List<InterpolationElement> elements) { | 10443 StringInterpolation.full(List<InterpolationElement> elements) { |
12753 this._elements = new NodeList<InterpolationElement>(this); | 10444 this.elements = new NodeList<InterpolationElement>(this); |
12754 this._elements.addAll(elements); | 10445 this.elements.addAll(elements); |
12755 } | 10446 } |
12756 | 10447 |
12757 /** | 10448 /** |
12758 * Initialize a newly created string interpolation expression. | 10449 * Initialize a newly created string interpolation expression. |
12759 * | 10450 * |
12760 * @param elements the elements that will be composed to produce the resulting
string | 10451 * @param elements the elements that will be composed to produce the resulting
string |
12761 */ | 10452 */ |
12762 StringInterpolation({List<InterpolationElement> elements}) : this.full(element
s); | 10453 StringInterpolation({List<InterpolationElement> elements}) : this.full(element
s); |
12763 accept(ASTVisitor visitor) => visitor.visitStringInterpolation(this); | 10454 accept(ASTVisitor visitor) => visitor.visitStringInterpolation(this); |
12764 Token get beginToken => _elements.beginToken; | 10455 Token get beginToken => elements.beginToken; |
12765 | 10456 Token get endToken => elements.endToken; |
12766 /** | |
12767 * Return the elements that will be composed to produce the resulting string. | |
12768 * | |
12769 * @return the elements that will be composed to produce the resulting string | |
12770 */ | |
12771 NodeList<InterpolationElement> get elements => _elements; | |
12772 Token get endToken => _elements.endToken; | |
12773 void visitChildren(ASTVisitor visitor) { | 10457 void visitChildren(ASTVisitor visitor) { |
12774 _elements.accept(visitor); | 10458 elements.accept(visitor); |
12775 } | 10459 } |
12776 void appendStringValue(JavaStringBuilder builder) { | 10460 void appendStringValue(JavaStringBuilder builder) { |
12777 throw new IllegalArgumentException(); | 10461 throw new IllegalArgumentException(); |
12778 } | 10462 } |
12779 } | 10463 } |
12780 /** | 10464 /** |
12781 * Instances of the class `StringLiteral` represent a string literal expression. | 10465 * Instances of the class `StringLiteral` represent a string literal expression. |
12782 * | 10466 * |
12783 * <pre> | 10467 * <pre> |
12784 * stringLiteral ::= | 10468 * stringLiteral ::= |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12825 * 'super' ('.' [SimpleIdentifier])? [ArgumentList] | 10509 * 'super' ('.' [SimpleIdentifier])? [ArgumentList] |
12826 * </pre> | 10510 * </pre> |
12827 * | 10511 * |
12828 * @coverage dart.engine.ast | 10512 * @coverage dart.engine.ast |
12829 */ | 10513 */ |
12830 class SuperConstructorInvocation extends ConstructorInitializer { | 10514 class SuperConstructorInvocation extends ConstructorInitializer { |
12831 | 10515 |
12832 /** | 10516 /** |
12833 * The token for the 'super' keyword. | 10517 * The token for the 'super' keyword. |
12834 */ | 10518 */ |
12835 Token _keyword; | 10519 Token keyword; |
12836 | 10520 |
12837 /** | 10521 /** |
12838 * The token for the period before the name of the constructor that is being i
nvoked, or | 10522 * The token for the period before the name of the constructor that is being i
nvoked, or |
12839 * `null` if the unnamed constructor is being invoked. | 10523 * `null` if the unnamed constructor is being invoked. |
12840 */ | 10524 */ |
12841 Token _period; | 10525 Token period; |
12842 | 10526 |
12843 /** | 10527 /** |
12844 * The name of the constructor that is being invoked, or `null` if the unnamed
constructor | 10528 * The name of the constructor that is being invoked, or `null` if the unnamed
constructor |
12845 * is being invoked. | 10529 * is being invoked. |
12846 */ | 10530 */ |
12847 SimpleIdentifier _constructorName; | 10531 SimpleIdentifier _constructorName; |
12848 | 10532 |
12849 /** | 10533 /** |
12850 * The list of arguments to the constructor. | 10534 * The list of arguments to the constructor. |
12851 */ | 10535 */ |
12852 ArgumentList _argumentList; | 10536 ArgumentList _argumentList; |
12853 | 10537 |
12854 /** | 10538 /** |
12855 * The element associated with the constructor based on static type informatio
n, or `null` | 10539 * The element associated with the constructor based on static type informatio
n, or `null` |
12856 * if the AST structure has not been resolved or if the constructor could not
be resolved. | 10540 * if the AST structure has not been resolved or if the constructor could not
be resolved. |
12857 */ | 10541 */ |
12858 ConstructorElement _staticElement; | 10542 ConstructorElement staticElement; |
12859 | 10543 |
12860 /** | 10544 /** |
12861 * The element associated with the constructor based on propagated type inform
ation, or `null` if the AST structure has not been | 10545 * The element associated with the constructor based on propagated type inform
ation, or `null` if the AST structure has not been |
12862 * resolved or if the constructor could not be resolved. | 10546 * resolved or if the constructor could not be resolved. |
12863 */ | 10547 */ |
12864 ConstructorElement _propagatedElement; | 10548 ConstructorElement _propagatedElement; |
12865 | 10549 |
12866 /** | 10550 /** |
12867 * Initialize a newly created super invocation to invoke the inherited constru
ctor with the given | 10551 * Initialize a newly created super invocation to invoke the inherited constru
ctor with the given |
12868 * name with the given arguments. | 10552 * name with the given arguments. |
12869 * | 10553 * |
12870 * @param keyword the token for the 'super' keyword | 10554 * @param keyword the token for the 'super' keyword |
12871 * @param period the token for the period before the name of the constructor t
hat is being invoked | 10555 * @param period the token for the period before the name of the constructor t
hat is being invoked |
12872 * @param constructorName the name of the constructor that is being invoked | 10556 * @param constructorName the name of the constructor that is being invoked |
12873 * @param argumentList the list of arguments to the constructor | 10557 * @param argumentList the list of arguments to the constructor |
12874 */ | 10558 */ |
12875 SuperConstructorInvocation.full(Token keyword, Token period, SimpleIdentifier
constructorName, ArgumentList argumentList) { | 10559 SuperConstructorInvocation.full(Token keyword, Token period, SimpleIdentifier
constructorName, ArgumentList argumentList) { |
12876 this._keyword = keyword; | 10560 this.keyword = keyword; |
12877 this._period = period; | 10561 this.period = period; |
12878 this._constructorName = becomeParentOf(constructorName); | 10562 this._constructorName = becomeParentOf(constructorName); |
12879 this._argumentList = becomeParentOf(argumentList); | 10563 this._argumentList = becomeParentOf(argumentList); |
12880 } | 10564 } |
12881 | 10565 |
12882 /** | 10566 /** |
12883 * Initialize a newly created super invocation to invoke the inherited constru
ctor with the given | 10567 * Initialize a newly created super invocation to invoke the inherited constru
ctor with the given |
12884 * name with the given arguments. | 10568 * name with the given arguments. |
12885 * | 10569 * |
12886 * @param keyword the token for the 'super' keyword | 10570 * @param keyword the token for the 'super' keyword |
12887 * @param period the token for the period before the name of the constructor t
hat is being invoked | 10571 * @param period the token for the period before the name of the constructor t
hat is being invoked |
12888 * @param constructorName the name of the constructor that is being invoked | 10572 * @param constructorName the name of the constructor that is being invoked |
12889 * @param argumentList the list of arguments to the constructor | 10573 * @param argumentList the list of arguments to the constructor |
12890 */ | 10574 */ |
12891 SuperConstructorInvocation({Token keyword, Token period, SimpleIdentifier cons
tructorName, ArgumentList argumentList}) : this.full(keyword, period, constructo
rName, argumentList); | 10575 SuperConstructorInvocation({Token keyword, Token period, SimpleIdentifier cons
tructorName, ArgumentList argumentList}) : this.full(keyword, period, constructo
rName, argumentList); |
12892 accept(ASTVisitor visitor) => visitor.visitSuperConstructorInvocation(this); | 10576 accept(ASTVisitor visitor) => visitor.visitSuperConstructorInvocation(this); |
12893 | 10577 |
12894 /** | 10578 /** |
12895 * Return the list of arguments to the constructor. | 10579 * Return the list of arguments to the constructor. |
12896 * | 10580 * |
12897 * @return the list of arguments to the constructor | 10581 * @return the list of arguments to the constructor |
12898 */ | 10582 */ |
12899 ArgumentList get argumentList => _argumentList; | 10583 ArgumentList get argumentList => _argumentList; |
12900 Token get beginToken => _keyword; | 10584 Token get beginToken => keyword; |
12901 | 10585 |
12902 /** | 10586 /** |
12903 * Return the name of the constructor that is being invoked, or `null` if the
unnamed | 10587 * Return the name of the constructor that is being invoked, or `null` if the
unnamed |
12904 * constructor is being invoked. | 10588 * constructor is being invoked. |
12905 * | 10589 * |
12906 * @return the name of the constructor that is being invoked | 10590 * @return the name of the constructor that is being invoked |
12907 */ | 10591 */ |
12908 SimpleIdentifier get constructorName => _constructorName; | 10592 SimpleIdentifier get constructorName => _constructorName; |
12909 | 10593 |
12910 /** | 10594 /** |
12911 * Return the element associated with the constructor based on propagated type
information, or | 10595 * Return the element associated with the constructor based on propagated type
information, or |
12912 * `null` if the AST structure has not been resolved or if the constructor cou
ld not be | 10596 * `null` if the AST structure has not been resolved or if the constructor cou
ld not be |
12913 * resolved. | 10597 * resolved. |
12914 * | 10598 * |
12915 * @return the element associated with the super constructor | 10599 * @return the element associated with the super constructor |
12916 */ | 10600 */ |
12917 ConstructorElement get element => _propagatedElement; | 10601 ConstructorElement get element => _propagatedElement; |
12918 Token get endToken => _argumentList.endToken; | 10602 Token get endToken => _argumentList.endToken; |
12919 | 10603 |
12920 /** | 10604 /** |
12921 * Return the token for the 'super' keyword. | |
12922 * | |
12923 * @return the token for the 'super' keyword | |
12924 */ | |
12925 Token get keyword => _keyword; | |
12926 | |
12927 /** | |
12928 * Return the token for the period before the name of the constructor that is
being invoked, or | |
12929 * `null` if the unnamed constructor is being invoked. | |
12930 * | |
12931 * @return the token for the period before the name of the constructor that is
being invoked | |
12932 */ | |
12933 Token get period => _period; | |
12934 | |
12935 /** | |
12936 * Return the element associated with the constructor based on static type inf
ormation, or | |
12937 * `null` if the AST structure has not been resolved or if the constructor cou
ld not be | |
12938 * resolved. | |
12939 * | |
12940 * @return the element associated with the constructor | |
12941 */ | |
12942 ConstructorElement get staticElement => _staticElement; | |
12943 | |
12944 /** | |
12945 * Set the list of arguments to the constructor to the given list. | 10605 * Set the list of arguments to the constructor to the given list. |
12946 * | 10606 * |
12947 * @param argumentList the list of arguments to the constructor | 10607 * @param argumentList the list of arguments to the constructor |
12948 */ | 10608 */ |
12949 void set argumentList(ArgumentList argumentList2) { | 10609 void set argumentList(ArgumentList argumentList2) { |
12950 this._argumentList = becomeParentOf(argumentList2); | 10610 this._argumentList = becomeParentOf(argumentList2); |
12951 } | 10611 } |
12952 | 10612 |
12953 /** | 10613 /** |
12954 * Set the name of the constructor that is being invoked to the given identifi
er. | 10614 * Set the name of the constructor that is being invoked to the given identifi
er. |
12955 * | 10615 * |
12956 * @param identifier the name of the constructor that is being invoked | 10616 * @param identifier the name of the constructor that is being invoked |
12957 */ | 10617 */ |
12958 void set constructorName(SimpleIdentifier identifier) { | 10618 void set constructorName(SimpleIdentifier identifier) { |
12959 _constructorName = becomeParentOf(identifier); | 10619 _constructorName = becomeParentOf(identifier); |
12960 } | 10620 } |
12961 | 10621 |
12962 /** | 10622 /** |
12963 * Set the element associated with the constructor based on propagated type in
formation to the | 10623 * Set the element associated with the constructor based on propagated type in
formation to the |
12964 * given element. | 10624 * given element. |
12965 * | 10625 * |
12966 * @param element the element to be associated with the constructor | 10626 * @param element the element to be associated with the constructor |
12967 */ | 10627 */ |
12968 void set element(ConstructorElement element2) { | 10628 void set element(ConstructorElement element2) { |
12969 _propagatedElement = element2; | 10629 _propagatedElement = element2; |
12970 } | 10630 } |
12971 | |
12972 /** | |
12973 * Set the token for the 'super' keyword to the given token. | |
12974 * | |
12975 * @param keyword the token for the 'super' keyword | |
12976 */ | |
12977 void set keyword(Token keyword2) { | |
12978 this._keyword = keyword2; | |
12979 } | |
12980 | |
12981 /** | |
12982 * Set the token for the period before the name of the constructor that is bei
ng invoked to the | |
12983 * given token. | |
12984 * | |
12985 * @param period the token for the period before the name of the constructor t
hat is being invoked | |
12986 */ | |
12987 void set period(Token period2) { | |
12988 this._period = period2; | |
12989 } | |
12990 | |
12991 /** | |
12992 * Set the element associated with the constructor based on static type inform
ation to the given | |
12993 * element. | |
12994 * | |
12995 * @param element the element to be associated with the constructor | |
12996 */ | |
12997 void set staticElement(ConstructorElement element) { | |
12998 this._staticElement = element; | |
12999 } | |
13000 void visitChildren(ASTVisitor visitor) { | 10631 void visitChildren(ASTVisitor visitor) { |
13001 safelyVisitChild(_constructorName, visitor); | 10632 safelyVisitChild(_constructorName, visitor); |
13002 safelyVisitChild(_argumentList, visitor); | 10633 safelyVisitChild(_argumentList, visitor); |
13003 } | 10634 } |
13004 } | 10635 } |
13005 /** | 10636 /** |
13006 * Instances of the class `SuperExpression` represent a super expression. | 10637 * Instances of the class `SuperExpression` represent a super expression. |
13007 * | 10638 * |
13008 * <pre> | 10639 * <pre> |
13009 * superExpression ::= | 10640 * superExpression ::= |
13010 * 'super' | 10641 * 'super' |
13011 * </pre> | 10642 * </pre> |
13012 * | 10643 * |
13013 * @coverage dart.engine.ast | 10644 * @coverage dart.engine.ast |
13014 */ | 10645 */ |
13015 class SuperExpression extends Expression { | 10646 class SuperExpression extends Expression { |
13016 | 10647 |
13017 /** | 10648 /** |
13018 * The token representing the keyword. | 10649 * The token representing the keyword. |
13019 */ | 10650 */ |
13020 Token _keyword; | 10651 Token keyword; |
13021 | 10652 |
13022 /** | 10653 /** |
13023 * Initialize a newly created super expression. | 10654 * Initialize a newly created super expression. |
13024 * | 10655 * |
13025 * @param keyword the token representing the keyword | 10656 * @param keyword the token representing the keyword |
13026 */ | 10657 */ |
13027 SuperExpression.full(Token keyword) { | 10658 SuperExpression.full(Token keyword) { |
13028 this._keyword = keyword; | 10659 this.keyword = keyword; |
13029 } | 10660 } |
13030 | 10661 |
13031 /** | 10662 /** |
13032 * Initialize a newly created super expression. | 10663 * Initialize a newly created super expression. |
13033 * | 10664 * |
13034 * @param keyword the token representing the keyword | 10665 * @param keyword the token representing the keyword |
13035 */ | 10666 */ |
13036 SuperExpression({Token keyword}) : this.full(keyword); | 10667 SuperExpression({Token keyword}) : this.full(keyword); |
13037 accept(ASTVisitor visitor) => visitor.visitSuperExpression(this); | 10668 accept(ASTVisitor visitor) => visitor.visitSuperExpression(this); |
13038 Token get beginToken => _keyword; | 10669 Token get beginToken => keyword; |
13039 Token get endToken => _keyword; | 10670 Token get endToken => keyword; |
13040 | |
13041 /** | |
13042 * Return the token representing the keyword. | |
13043 * | |
13044 * @return the token representing the keyword | |
13045 */ | |
13046 Token get keyword => _keyword; | |
13047 | |
13048 /** | |
13049 * Set the token representing the keyword to the given token. | |
13050 * | |
13051 * @param keyword the token representing the keyword | |
13052 */ | |
13053 void set keyword(Token keyword2) { | |
13054 this._keyword = keyword2; | |
13055 } | |
13056 void visitChildren(ASTVisitor visitor) { | 10671 void visitChildren(ASTVisitor visitor) { |
13057 } | 10672 } |
13058 } | 10673 } |
13059 /** | 10674 /** |
13060 * Instances of the class `SwitchCase` represent the case in a switch statement. | 10675 * Instances of the class `SwitchCase` represent the case in a switch statement. |
13061 * | 10676 * |
13062 * <pre> | 10677 * <pre> |
13063 * switchCase ::= | 10678 * switchCase ::= |
13064 * [SimpleIdentifier]* 'case' [Expression] ':' [Statement]* | 10679 * [SimpleIdentifier]* 'case' [Expression] ':' [Statement]* |
13065 * </pre> | 10680 * </pre> |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13166 * | switchDefault | 10781 * | switchDefault |
13167 * </pre> | 10782 * </pre> |
13168 * | 10783 * |
13169 * @coverage dart.engine.ast | 10784 * @coverage dart.engine.ast |
13170 */ | 10785 */ |
13171 abstract class SwitchMember extends ASTNode { | 10786 abstract class SwitchMember extends ASTNode { |
13172 | 10787 |
13173 /** | 10788 /** |
13174 * The labels associated with the switch member. | 10789 * The labels associated with the switch member. |
13175 */ | 10790 */ |
13176 NodeList<Label> _labels; | 10791 NodeList<Label> labels; |
13177 | 10792 |
13178 /** | 10793 /** |
13179 * The token representing the 'case' or 'default' keyword. | 10794 * The token representing the 'case' or 'default' keyword. |
13180 */ | 10795 */ |
13181 Token _keyword; | 10796 Token keyword; |
13182 | 10797 |
13183 /** | 10798 /** |
13184 * The colon separating the keyword or the expression from the statements. | 10799 * The colon separating the keyword or the expression from the statements. |
13185 */ | 10800 */ |
13186 Token _colon; | 10801 Token colon; |
13187 | 10802 |
13188 /** | 10803 /** |
13189 * The statements that will be executed if this switch member is selected. | 10804 * The statements that will be executed if this switch member is selected. |
13190 */ | 10805 */ |
13191 NodeList<Statement> _statements; | 10806 NodeList<Statement> statements; |
13192 | 10807 |
13193 /** | 10808 /** |
13194 * Initialize a newly created switch member. | 10809 * Initialize a newly created switch member. |
13195 * | 10810 * |
13196 * @param labels the labels associated with the switch member | 10811 * @param labels the labels associated with the switch member |
13197 * @param keyword the token representing the 'case' or 'default' keyword | 10812 * @param keyword the token representing the 'case' or 'default' keyword |
13198 * @param colon the colon separating the keyword or the expression from the st
atements | 10813 * @param colon the colon separating the keyword or the expression from the st
atements |
13199 * @param statements the statements that will be executed if this switch membe
r is selected | 10814 * @param statements the statements that will be executed if this switch membe
r is selected |
13200 */ | 10815 */ |
13201 SwitchMember.full(List<Label> labels, Token keyword, Token colon, List<Stateme
nt> statements) { | 10816 SwitchMember.full(List<Label> labels, Token keyword, Token colon, List<Stateme
nt> statements) { |
13202 this._labels = new NodeList<Label>(this); | 10817 this.labels = new NodeList<Label>(this); |
13203 this._statements = new NodeList<Statement>(this); | 10818 this.statements = new NodeList<Statement>(this); |
13204 this._labels.addAll(labels); | 10819 this.labels.addAll(labels); |
13205 this._keyword = keyword; | 10820 this.keyword = keyword; |
13206 this._colon = colon; | 10821 this.colon = colon; |
13207 this._statements.addAll(statements); | 10822 this.statements.addAll(statements); |
13208 } | 10823 } |
13209 | 10824 |
13210 /** | 10825 /** |
13211 * Initialize a newly created switch member. | 10826 * Initialize a newly created switch member. |
13212 * | 10827 * |
13213 * @param labels the labels associated with the switch member | 10828 * @param labels the labels associated with the switch member |
13214 * @param keyword the token representing the 'case' or 'default' keyword | 10829 * @param keyword the token representing the 'case' or 'default' keyword |
13215 * @param colon the colon separating the keyword or the expression from the st
atements | 10830 * @param colon the colon separating the keyword or the expression from the st
atements |
13216 * @param statements the statements that will be executed if this switch membe
r is selected | 10831 * @param statements the statements that will be executed if this switch membe
r is selected |
13217 */ | 10832 */ |
13218 SwitchMember({List<Label> labels, Token keyword, Token colon, List<Statement>
statements}) : this.full(labels, keyword, colon, statements); | 10833 SwitchMember({List<Label> labels, Token keyword, Token colon, List<Statement>
statements}) : this.full(labels, keyword, colon, statements); |
13219 Token get beginToken { | 10834 Token get beginToken { |
13220 if (!_labels.isEmpty) { | 10835 if (!labels.isEmpty) { |
13221 return _labels.beginToken; | 10836 return labels.beginToken; |
13222 } | 10837 } |
13223 return _keyword; | 10838 return keyword; |
13224 } | 10839 } |
13225 | |
13226 /** | |
13227 * Return the colon separating the keyword or the expression from the statemen
ts. | |
13228 * | |
13229 * @return the colon separating the keyword or the expression from the stateme
nts | |
13230 */ | |
13231 Token get colon => _colon; | |
13232 Token get endToken { | 10840 Token get endToken { |
13233 if (!_statements.isEmpty) { | 10841 if (!statements.isEmpty) { |
13234 return _statements.endToken; | 10842 return statements.endToken; |
13235 } | 10843 } |
13236 return _colon; | 10844 return colon; |
13237 } | |
13238 | |
13239 /** | |
13240 * Return the token representing the 'case' or 'default' keyword. | |
13241 * | |
13242 * @return the token representing the 'case' or 'default' keyword | |
13243 */ | |
13244 Token get keyword => _keyword; | |
13245 | |
13246 /** | |
13247 * Return the labels associated with the switch member. | |
13248 * | |
13249 * @return the labels associated with the switch member | |
13250 */ | |
13251 NodeList<Label> get labels => _labels; | |
13252 | |
13253 /** | |
13254 * Return the statements that will be executed if this switch member is select
ed. | |
13255 * | |
13256 * @return the statements that will be executed if this switch member is selec
ted | |
13257 */ | |
13258 NodeList<Statement> get statements => _statements; | |
13259 | |
13260 /** | |
13261 * Set the colon separating the keyword or the expression from the statements
to the given token. | |
13262 * | |
13263 * @param colon the colon separating the keyword or the expression from the st
atements | |
13264 */ | |
13265 void set colon(Token colon2) { | |
13266 this._colon = colon2; | |
13267 } | |
13268 | |
13269 /** | |
13270 * Set the token representing the 'case' or 'default' keyword to the given tok
en. | |
13271 * | |
13272 * @param keyword the token representing the 'case' or 'default' keyword | |
13273 */ | |
13274 void set keyword(Token keyword2) { | |
13275 this._keyword = keyword2; | |
13276 } | 10845 } |
13277 } | 10846 } |
13278 /** | 10847 /** |
13279 * Instances of the class `SwitchStatement` represent a switch statement. | 10848 * Instances of the class `SwitchStatement` represent a switch statement. |
13280 * | 10849 * |
13281 * <pre> | 10850 * <pre> |
13282 * switchStatement ::= | 10851 * switchStatement ::= |
13283 * 'switch' '(' [Expression] ')' '{' [SwitchCase]* [SwitchDefault]? '}' | 10852 * 'switch' '(' [Expression] ')' '{' [SwitchCase]* [SwitchDefault]? '}' |
13284 * </pre> | 10853 * </pre> |
13285 * | 10854 * |
13286 * @coverage dart.engine.ast | 10855 * @coverage dart.engine.ast |
13287 */ | 10856 */ |
13288 class SwitchStatement extends Statement { | 10857 class SwitchStatement extends Statement { |
13289 | 10858 |
13290 /** | 10859 /** |
13291 * The token representing the 'switch' keyword. | 10860 * The token representing the 'switch' keyword. |
13292 */ | 10861 */ |
13293 Token _keyword; | 10862 Token keyword; |
13294 | 10863 |
13295 /** | 10864 /** |
13296 * The left parenthesis. | 10865 * The left parenthesis. |
13297 */ | 10866 */ |
13298 Token _leftParenthesis; | 10867 Token leftParenthesis; |
13299 | 10868 |
13300 /** | 10869 /** |
13301 * The expression used to determine which of the switch members will be select
ed. | 10870 * The expression used to determine which of the switch members will be select
ed. |
13302 */ | 10871 */ |
13303 Expression _expression; | 10872 Expression _expression; |
13304 | 10873 |
13305 /** | 10874 /** |
13306 * The right parenthesis. | 10875 * The right parenthesis. |
13307 */ | 10876 */ |
13308 Token _rightParenthesis; | 10877 Token rightParenthesis; |
13309 | 10878 |
13310 /** | 10879 /** |
13311 * The left curly bracket. | 10880 * The left curly bracket. |
13312 */ | 10881 */ |
13313 Token _leftBracket; | 10882 Token leftBracket; |
13314 | 10883 |
13315 /** | 10884 /** |
13316 * The switch members that can be selected by the expression. | 10885 * The switch members that can be selected by the expression. |
13317 */ | 10886 */ |
13318 NodeList<SwitchMember> _members; | 10887 NodeList<SwitchMember> members; |
13319 | 10888 |
13320 /** | 10889 /** |
13321 * The right curly bracket. | 10890 * The right curly bracket. |
13322 */ | 10891 */ |
13323 Token _rightBracket; | 10892 Token rightBracket; |
13324 | 10893 |
13325 /** | 10894 /** |
13326 * Initialize a newly created switch statement. | 10895 * Initialize a newly created switch statement. |
13327 * | 10896 * |
13328 * @param keyword the token representing the 'switch' keyword | 10897 * @param keyword the token representing the 'switch' keyword |
13329 * @param leftParenthesis the left parenthesis | 10898 * @param leftParenthesis the left parenthesis |
13330 * @param expression the expression used to determine which of the switch memb
ers will be selected | 10899 * @param expression the expression used to determine which of the switch memb
ers will be selected |
13331 * @param rightParenthesis the right parenthesis | 10900 * @param rightParenthesis the right parenthesis |
13332 * @param leftBracket the left curly bracket | 10901 * @param leftBracket the left curly bracket |
13333 * @param members the switch members that can be selected by the expression | 10902 * @param members the switch members that can be selected by the expression |
13334 * @param rightBracket the right curly bracket | 10903 * @param rightBracket the right curly bracket |
13335 */ | 10904 */ |
13336 SwitchStatement.full(Token keyword, Token leftParenthesis, Expression expressi
on, Token rightParenthesis, Token leftBracket, List<SwitchMember> members, Token
rightBracket) { | 10905 SwitchStatement.full(Token keyword, Token leftParenthesis, Expression expressi
on, Token rightParenthesis, Token leftBracket, List<SwitchMember> members, Token
rightBracket) { |
13337 this._members = new NodeList<SwitchMember>(this); | 10906 this.members = new NodeList<SwitchMember>(this); |
13338 this._keyword = keyword; | 10907 this.keyword = keyword; |
13339 this._leftParenthesis = leftParenthesis; | 10908 this.leftParenthesis = leftParenthesis; |
13340 this._expression = becomeParentOf(expression); | 10909 this._expression = becomeParentOf(expression); |
13341 this._rightParenthesis = rightParenthesis; | 10910 this.rightParenthesis = rightParenthesis; |
13342 this._leftBracket = leftBracket; | 10911 this.leftBracket = leftBracket; |
13343 this._members.addAll(members); | 10912 this.members.addAll(members); |
13344 this._rightBracket = rightBracket; | 10913 this.rightBracket = rightBracket; |
13345 } | 10914 } |
13346 | 10915 |
13347 /** | 10916 /** |
13348 * Initialize a newly created switch statement. | 10917 * Initialize a newly created switch statement. |
13349 * | 10918 * |
13350 * @param keyword the token representing the 'switch' keyword | 10919 * @param keyword the token representing the 'switch' keyword |
13351 * @param leftParenthesis the left parenthesis | 10920 * @param leftParenthesis the left parenthesis |
13352 * @param expression the expression used to determine which of the switch memb
ers will be selected | 10921 * @param expression the expression used to determine which of the switch memb
ers will be selected |
13353 * @param rightParenthesis the right parenthesis | 10922 * @param rightParenthesis the right parenthesis |
13354 * @param leftBracket the left curly bracket | 10923 * @param leftBracket the left curly bracket |
13355 * @param members the switch members that can be selected by the expression | 10924 * @param members the switch members that can be selected by the expression |
13356 * @param rightBracket the right curly bracket | 10925 * @param rightBracket the right curly bracket |
13357 */ | 10926 */ |
13358 SwitchStatement({Token keyword, Token leftParenthesis, Expression expression,
Token rightParenthesis, Token leftBracket, List<SwitchMember> members, Token rig
htBracket}) : this.full(keyword, leftParenthesis, expression, rightParenthesis,
leftBracket, members, rightBracket); | 10927 SwitchStatement({Token keyword, Token leftParenthesis, Expression expression,
Token rightParenthesis, Token leftBracket, List<SwitchMember> members, Token rig
htBracket}) : this.full(keyword, leftParenthesis, expression, rightParenthesis,
leftBracket, members, rightBracket); |
13359 accept(ASTVisitor visitor) => visitor.visitSwitchStatement(this); | 10928 accept(ASTVisitor visitor) => visitor.visitSwitchStatement(this); |
13360 Token get beginToken => _keyword; | 10929 Token get beginToken => keyword; |
13361 Token get endToken => _rightBracket; | 10930 Token get endToken => rightBracket; |
13362 | 10931 |
13363 /** | 10932 /** |
13364 * Return the expression used to determine which of the switch members will be
selected. | 10933 * Return the expression used to determine which of the switch members will be
selected. |
13365 * | 10934 * |
13366 * @return the expression used to determine which of the switch members will b
e selected | 10935 * @return the expression used to determine which of the switch members will b
e selected |
13367 */ | 10936 */ |
13368 Expression get expression => _expression; | 10937 Expression get expression => _expression; |
13369 | 10938 |
13370 /** | 10939 /** |
13371 * Return the token representing the 'switch' keyword. | |
13372 * | |
13373 * @return the token representing the 'switch' keyword | |
13374 */ | |
13375 Token get keyword => _keyword; | |
13376 | |
13377 /** | |
13378 * Return the left curly bracket. | |
13379 * | |
13380 * @return the left curly bracket | |
13381 */ | |
13382 Token get leftBracket => _leftBracket; | |
13383 | |
13384 /** | |
13385 * Return the left parenthesis. | |
13386 * | |
13387 * @return the left parenthesis | |
13388 */ | |
13389 Token get leftParenthesis => _leftParenthesis; | |
13390 | |
13391 /** | |
13392 * Return the switch members that can be selected by the expression. | |
13393 * | |
13394 * @return the switch members that can be selected by the expression | |
13395 */ | |
13396 NodeList<SwitchMember> get members => _members; | |
13397 | |
13398 /** | |
13399 * Return the right curly bracket. | |
13400 * | |
13401 * @return the right curly bracket | |
13402 */ | |
13403 Token get rightBracket => _rightBracket; | |
13404 | |
13405 /** | |
13406 * Return the right parenthesis. | |
13407 * | |
13408 * @return the right parenthesis | |
13409 */ | |
13410 Token get rightParenthesis => _rightParenthesis; | |
13411 | |
13412 /** | |
13413 * Set the expression used to determine which of the switch members will be se
lected to the given | 10940 * Set the expression used to determine which of the switch members will be se
lected to the given |
13414 * expression. | 10941 * expression. |
13415 * | 10942 * |
13416 * @param expression the expression used to determine which of the switch memb
ers will be selected | 10943 * @param expression the expression used to determine which of the switch memb
ers will be selected |
13417 */ | 10944 */ |
13418 void set expression(Expression expression2) { | 10945 void set expression(Expression expression2) { |
13419 this._expression = becomeParentOf(expression2); | 10946 this._expression = becomeParentOf(expression2); |
13420 } | 10947 } |
13421 | |
13422 /** | |
13423 * Set the token representing the 'switch' keyword to the given token. | |
13424 * | |
13425 * @param keyword the token representing the 'switch' keyword | |
13426 */ | |
13427 void set keyword(Token keyword2) { | |
13428 this._keyword = keyword2; | |
13429 } | |
13430 | |
13431 /** | |
13432 * Set the left curly bracket to the given token. | |
13433 * | |
13434 * @param leftBracket the left curly bracket | |
13435 */ | |
13436 void set leftBracket(Token leftBracket2) { | |
13437 this._leftBracket = leftBracket2; | |
13438 } | |
13439 | |
13440 /** | |
13441 * Set the left parenthesis to the given token. | |
13442 * | |
13443 * @param leftParenthesis the left parenthesis | |
13444 */ | |
13445 void set leftParenthesis(Token leftParenthesis2) { | |
13446 this._leftParenthesis = leftParenthesis2; | |
13447 } | |
13448 | |
13449 /** | |
13450 * Set the right curly bracket to the given token. | |
13451 * | |
13452 * @param rightBracket the right curly bracket | |
13453 */ | |
13454 void set rightBracket(Token rightBracket2) { | |
13455 this._rightBracket = rightBracket2; | |
13456 } | |
13457 | |
13458 /** | |
13459 * Set the right parenthesis to the given token. | |
13460 * | |
13461 * @param rightParenthesis the right parenthesis | |
13462 */ | |
13463 void set rightParenthesis(Token rightParenthesis2) { | |
13464 this._rightParenthesis = rightParenthesis2; | |
13465 } | |
13466 void visitChildren(ASTVisitor visitor) { | 10948 void visitChildren(ASTVisitor visitor) { |
13467 safelyVisitChild(_expression, visitor); | 10949 safelyVisitChild(_expression, visitor); |
13468 _members.accept(visitor); | 10950 members.accept(visitor); |
13469 } | 10951 } |
13470 } | 10952 } |
13471 /** | 10953 /** |
13472 * Instances of the class `SymbolLiteral` represent a symbol literal expression. | 10954 * Instances of the class `SymbolLiteral` represent a symbol literal expression. |
13473 * | 10955 * |
13474 * <pre> | 10956 * <pre> |
13475 * symbolLiteral ::= | 10957 * symbolLiteral ::= |
13476 * '#' (operator | (identifier ('.' identifier)*)) | 10958 * '#' (operator | (identifier ('.' identifier)*)) |
13477 * </pre> | 10959 * </pre> |
13478 * | 10960 * |
13479 * @coverage dart.engine.ast | 10961 * @coverage dart.engine.ast |
13480 */ | 10962 */ |
13481 class SymbolLiteral extends Literal { | 10963 class SymbolLiteral extends Literal { |
13482 | 10964 |
13483 /** | 10965 /** |
13484 * The token introducing the literal. | 10966 * The token introducing the literal. |
13485 */ | 10967 */ |
13486 Token _poundSign; | 10968 Token poundSign; |
13487 | 10969 |
13488 /** | 10970 /** |
13489 * The components of the literal. | 10971 * The components of the literal. |
13490 */ | 10972 */ |
13491 List<Token> _components; | 10973 List<Token> components; |
13492 | 10974 |
13493 /** | 10975 /** |
13494 * Initialize a newly created symbol literal. | 10976 * Initialize a newly created symbol literal. |
13495 * | 10977 * |
13496 * @param poundSign the token introducing the literal | 10978 * @param poundSign the token introducing the literal |
13497 * @param components the components of the literal | 10979 * @param components the components of the literal |
13498 */ | 10980 */ |
13499 SymbolLiteral.full(Token poundSign, List<Token> components) { | 10981 SymbolLiteral.full(Token poundSign, List<Token> components) { |
13500 this._poundSign = poundSign; | 10982 this.poundSign = poundSign; |
13501 this._components = components; | 10983 this.components = components; |
13502 } | 10984 } |
13503 | 10985 |
13504 /** | 10986 /** |
13505 * Initialize a newly created symbol literal. | 10987 * Initialize a newly created symbol literal. |
13506 * | 10988 * |
13507 * @param poundSign the token introducing the literal | 10989 * @param poundSign the token introducing the literal |
13508 * @param components the components of the literal | 10990 * @param components the components of the literal |
13509 */ | 10991 */ |
13510 SymbolLiteral({Token poundSign, List<Token> components}) : this.full(poundSign
, components); | 10992 SymbolLiteral({Token poundSign, List<Token> components}) : this.full(poundSign
, components); |
13511 accept(ASTVisitor visitor) => visitor.visitSymbolLiteral(this); | 10993 accept(ASTVisitor visitor) => visitor.visitSymbolLiteral(this); |
13512 Token get beginToken => _poundSign; | 10994 Token get beginToken => poundSign; |
13513 | 10995 Token get endToken => components[components.length - 1]; |
13514 /** | |
13515 * Return the components of the literal. | |
13516 * | |
13517 * @return the components of the literal | |
13518 */ | |
13519 List<Token> get components => _components; | |
13520 Token get endToken => _components[_components.length - 1]; | |
13521 | |
13522 /** | |
13523 * Return the token introducing the literal. | |
13524 * | |
13525 * @return the token introducing the literal | |
13526 */ | |
13527 Token get poundSign => _poundSign; | |
13528 | |
13529 /** | |
13530 * Set the token introducing the literal to the given token. | |
13531 * | |
13532 * @param poundSign the token introducing the literal | |
13533 */ | |
13534 void set poundSign(Token poundSign2) { | |
13535 this._poundSign = poundSign2; | |
13536 } | |
13537 void visitChildren(ASTVisitor visitor) { | 10996 void visitChildren(ASTVisitor visitor) { |
13538 } | 10997 } |
13539 } | 10998 } |
13540 /** | 10999 /** |
13541 * Instances of the class `ThisExpression` represent a this expression. | 11000 * Instances of the class `ThisExpression` represent a this expression. |
13542 * | 11001 * |
13543 * <pre> | 11002 * <pre> |
13544 * thisExpression ::= | 11003 * thisExpression ::= |
13545 * 'this' | 11004 * 'this' |
13546 * </pre> | 11005 * </pre> |
13547 * | 11006 * |
13548 * @coverage dart.engine.ast | 11007 * @coverage dart.engine.ast |
13549 */ | 11008 */ |
13550 class ThisExpression extends Expression { | 11009 class ThisExpression extends Expression { |
13551 | 11010 |
13552 /** | 11011 /** |
13553 * The token representing the keyword. | 11012 * The token representing the keyword. |
13554 */ | 11013 */ |
13555 Token _keyword; | 11014 Token keyword; |
13556 | 11015 |
13557 /** | 11016 /** |
13558 * Initialize a newly created this expression. | 11017 * Initialize a newly created this expression. |
13559 * | 11018 * |
13560 * @param keyword the token representing the keyword | 11019 * @param keyword the token representing the keyword |
13561 */ | 11020 */ |
13562 ThisExpression.full(Token keyword) { | 11021 ThisExpression.full(Token keyword) { |
13563 this._keyword = keyword; | 11022 this.keyword = keyword; |
13564 } | 11023 } |
13565 | 11024 |
13566 /** | 11025 /** |
13567 * Initialize a newly created this expression. | 11026 * Initialize a newly created this expression. |
13568 * | 11027 * |
13569 * @param keyword the token representing the keyword | 11028 * @param keyword the token representing the keyword |
13570 */ | 11029 */ |
13571 ThisExpression({Token keyword}) : this.full(keyword); | 11030 ThisExpression({Token keyword}) : this.full(keyword); |
13572 accept(ASTVisitor visitor) => visitor.visitThisExpression(this); | 11031 accept(ASTVisitor visitor) => visitor.visitThisExpression(this); |
13573 Token get beginToken => _keyword; | 11032 Token get beginToken => keyword; |
13574 Token get endToken => _keyword; | 11033 Token get endToken => keyword; |
13575 | |
13576 /** | |
13577 * Return the token representing the keyword. | |
13578 * | |
13579 * @return the token representing the keyword | |
13580 */ | |
13581 Token get keyword => _keyword; | |
13582 | |
13583 /** | |
13584 * Set the token representing the keyword to the given token. | |
13585 * | |
13586 * @param keyword the token representing the keyword | |
13587 */ | |
13588 void set keyword(Token keyword2) { | |
13589 this._keyword = keyword2; | |
13590 } | |
13591 void visitChildren(ASTVisitor visitor) { | 11034 void visitChildren(ASTVisitor visitor) { |
13592 } | 11035 } |
13593 } | 11036 } |
13594 /** | 11037 /** |
13595 * Instances of the class `ThrowExpression` represent a throw expression. | 11038 * Instances of the class `ThrowExpression` represent a throw expression. |
13596 * | 11039 * |
13597 * <pre> | 11040 * <pre> |
13598 * throwExpression ::= | 11041 * throwExpression ::= |
13599 * 'throw' [Expression] | 11042 * 'throw' [Expression] |
13600 * </pre> | 11043 * </pre> |
13601 * | 11044 * |
13602 * @coverage dart.engine.ast | 11045 * @coverage dart.engine.ast |
13603 */ | 11046 */ |
13604 class ThrowExpression extends Expression { | 11047 class ThrowExpression extends Expression { |
13605 | 11048 |
13606 /** | 11049 /** |
13607 * The token representing the 'throw' keyword. | 11050 * The token representing the 'throw' keyword. |
13608 */ | 11051 */ |
13609 Token _keyword; | 11052 Token keyword; |
13610 | 11053 |
13611 /** | 11054 /** |
13612 * The expression computing the exception to be thrown. | 11055 * The expression computing the exception to be thrown. |
13613 */ | 11056 */ |
13614 Expression _expression; | 11057 Expression _expression; |
13615 | 11058 |
13616 /** | 11059 /** |
13617 * Initialize a newly created throw expression. | 11060 * Initialize a newly created throw expression. |
13618 * | 11061 * |
13619 * @param keyword the token representing the 'throw' keyword | 11062 * @param keyword the token representing the 'throw' keyword |
13620 * @param expression the expression computing the exception to be thrown | 11063 * @param expression the expression computing the exception to be thrown |
13621 */ | 11064 */ |
13622 ThrowExpression.full(Token keyword, Expression expression) { | 11065 ThrowExpression.full(Token keyword, Expression expression) { |
13623 this._keyword = keyword; | 11066 this.keyword = keyword; |
13624 this._expression = becomeParentOf(expression); | 11067 this._expression = becomeParentOf(expression); |
13625 } | 11068 } |
13626 | 11069 |
13627 /** | 11070 /** |
13628 * Initialize a newly created throw expression. | 11071 * Initialize a newly created throw expression. |
13629 * | 11072 * |
13630 * @param keyword the token representing the 'throw' keyword | 11073 * @param keyword the token representing the 'throw' keyword |
13631 * @param expression the expression computing the exception to be thrown | 11074 * @param expression the expression computing the exception to be thrown |
13632 */ | 11075 */ |
13633 ThrowExpression({Token keyword, Expression expression}) : this.full(keyword, e
xpression); | 11076 ThrowExpression({Token keyword, Expression expression}) : this.full(keyword, e
xpression); |
13634 accept(ASTVisitor visitor) => visitor.visitThrowExpression(this); | 11077 accept(ASTVisitor visitor) => visitor.visitThrowExpression(this); |
13635 Token get beginToken => _keyword; | 11078 Token get beginToken => keyword; |
13636 Token get endToken { | 11079 Token get endToken { |
13637 if (_expression != null) { | 11080 if (_expression != null) { |
13638 return _expression.endToken; | 11081 return _expression.endToken; |
13639 } | 11082 } |
13640 return _keyword; | 11083 return keyword; |
13641 } | 11084 } |
13642 | 11085 |
13643 /** | 11086 /** |
13644 * Return the expression computing the exception to be thrown. | 11087 * Return the expression computing the exception to be thrown. |
13645 * | 11088 * |
13646 * @return the expression computing the exception to be thrown | 11089 * @return the expression computing the exception to be thrown |
13647 */ | 11090 */ |
13648 Expression get expression => _expression; | 11091 Expression get expression => _expression; |
13649 | 11092 |
13650 /** | 11093 /** |
13651 * Return the token representing the 'throw' keyword. | |
13652 * | |
13653 * @return the token representing the 'throw' keyword | |
13654 */ | |
13655 Token get keyword => _keyword; | |
13656 | |
13657 /** | |
13658 * Set the expression computing the exception to be thrown to the given expres
sion. | 11094 * Set the expression computing the exception to be thrown to the given expres
sion. |
13659 * | 11095 * |
13660 * @param expression the expression computing the exception to be thrown | 11096 * @param expression the expression computing the exception to be thrown |
13661 */ | 11097 */ |
13662 void set expression(Expression expression2) { | 11098 void set expression(Expression expression2) { |
13663 this._expression = becomeParentOf(expression2); | 11099 this._expression = becomeParentOf(expression2); |
13664 } | 11100 } |
13665 | |
13666 /** | |
13667 * Set the token representing the 'throw' keyword to the given token. | |
13668 * | |
13669 * @param keyword the token representing the 'throw' keyword | |
13670 */ | |
13671 void set keyword(Token keyword2) { | |
13672 this._keyword = keyword2; | |
13673 } | |
13674 void visitChildren(ASTVisitor visitor) { | 11101 void visitChildren(ASTVisitor visitor) { |
13675 safelyVisitChild(_expression, visitor); | 11102 safelyVisitChild(_expression, visitor); |
13676 } | 11103 } |
13677 } | 11104 } |
13678 /** | 11105 /** |
13679 * Instances of the class `TopLevelVariableDeclaration` represent the declaratio
n of one or | 11106 * Instances of the class `TopLevelVariableDeclaration` represent the declaratio
n of one or |
13680 * more top-level variables of the same type. | 11107 * more top-level variables of the same type. |
13681 * | 11108 * |
13682 * <pre> | 11109 * <pre> |
13683 * topLevelVariableDeclaration ::= | 11110 * topLevelVariableDeclaration ::= |
13684 * ('final' | 'const') type? staticFinalDeclarationList ';' | 11111 * ('final' | 'const') type? staticFinalDeclarationList ';' |
13685 * | variableDeclaration ';' | 11112 * | variableDeclaration ';' |
13686 * </pre> | 11113 * </pre> |
13687 * | 11114 * |
13688 * @coverage dart.engine.ast | 11115 * @coverage dart.engine.ast |
13689 */ | 11116 */ |
13690 class TopLevelVariableDeclaration extends CompilationUnitMember { | 11117 class TopLevelVariableDeclaration extends CompilationUnitMember { |
13691 | 11118 |
13692 /** | 11119 /** |
13693 * The top-level variables being declared. | 11120 * The top-level variables being declared. |
13694 */ | 11121 */ |
13695 VariableDeclarationList _variableList; | 11122 VariableDeclarationList _variableList; |
13696 | 11123 |
13697 /** | 11124 /** |
13698 * The semicolon terminating the declaration. | 11125 * The semicolon terminating the declaration. |
13699 */ | 11126 */ |
13700 Token _semicolon; | 11127 Token semicolon; |
13701 | 11128 |
13702 /** | 11129 /** |
13703 * Initialize a newly created top-level variable declaration. | 11130 * Initialize a newly created top-level variable declaration. |
13704 * | 11131 * |
13705 * @param comment the documentation comment associated with this variable | 11132 * @param comment the documentation comment associated with this variable |
13706 * @param metadata the annotations associated with this variable | 11133 * @param metadata the annotations associated with this variable |
13707 * @param variableList the top-level variables being declared | 11134 * @param variableList the top-level variables being declared |
13708 * @param semicolon the semicolon terminating the declaration | 11135 * @param semicolon the semicolon terminating the declaration |
13709 */ | 11136 */ |
13710 TopLevelVariableDeclaration.full(Comment comment, List<Annotation> metadata, V
ariableDeclarationList variableList, Token semicolon) : super.full(comment, meta
data) { | 11137 TopLevelVariableDeclaration.full(Comment comment, List<Annotation> metadata, V
ariableDeclarationList variableList, Token semicolon) : super.full(comment, meta
data) { |
13711 this._variableList = becomeParentOf(variableList); | 11138 this._variableList = becomeParentOf(variableList); |
13712 this._semicolon = semicolon; | 11139 this.semicolon = semicolon; |
13713 } | 11140 } |
13714 | 11141 |
13715 /** | 11142 /** |
13716 * Initialize a newly created top-level variable declaration. | 11143 * Initialize a newly created top-level variable declaration. |
13717 * | 11144 * |
13718 * @param comment the documentation comment associated with this variable | 11145 * @param comment the documentation comment associated with this variable |
13719 * @param metadata the annotations associated with this variable | 11146 * @param metadata the annotations associated with this variable |
13720 * @param variableList the top-level variables being declared | 11147 * @param variableList the top-level variables being declared |
13721 * @param semicolon the semicolon terminating the declaration | 11148 * @param semicolon the semicolon terminating the declaration |
13722 */ | 11149 */ |
13723 TopLevelVariableDeclaration({Comment comment, List<Annotation> metadata, Varia
bleDeclarationList variableList, Token semicolon}) : this.full(comment, metadata
, variableList, semicolon); | 11150 TopLevelVariableDeclaration({Comment comment, List<Annotation> metadata, Varia
bleDeclarationList variableList, Token semicolon}) : this.full(comment, metadata
, variableList, semicolon); |
13724 accept(ASTVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this); | 11151 accept(ASTVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this); |
13725 Element get element => null; | 11152 Element get element => null; |
13726 Token get endToken => _semicolon; | 11153 Token get endToken => semicolon; |
13727 | |
13728 /** | |
13729 * Return the semicolon terminating the declaration. | |
13730 * | |
13731 * @return the semicolon terminating the declaration | |
13732 */ | |
13733 Token get semicolon => _semicolon; | |
13734 | 11154 |
13735 /** | 11155 /** |
13736 * Return the top-level variables being declared. | 11156 * Return the top-level variables being declared. |
13737 * | 11157 * |
13738 * @return the top-level variables being declared | 11158 * @return the top-level variables being declared |
13739 */ | 11159 */ |
13740 VariableDeclarationList get variables => _variableList; | 11160 VariableDeclarationList get variables => _variableList; |
13741 | 11161 |
13742 /** | 11162 /** |
13743 * Set the semicolon terminating the declaration to the given token. | |
13744 * | |
13745 * @param semicolon the semicolon terminating the declaration | |
13746 */ | |
13747 void set semicolon(Token semicolon2) { | |
13748 this._semicolon = semicolon2; | |
13749 } | |
13750 | |
13751 /** | |
13752 * Set the top-level variables being declared to the given list of variables. | 11163 * Set the top-level variables being declared to the given list of variables. |
13753 * | 11164 * |
13754 * @param variableList the top-level variables being declared | 11165 * @param variableList the top-level variables being declared |
13755 */ | 11166 */ |
13756 void set variables(VariableDeclarationList variableList) { | 11167 void set variables(VariableDeclarationList variableList) { |
13757 variableList = becomeParentOf(variableList); | 11168 variableList = becomeParentOf(variableList); |
13758 } | 11169 } |
13759 void visitChildren(ASTVisitor visitor) { | 11170 void visitChildren(ASTVisitor visitor) { |
13760 super.visitChildren(visitor); | 11171 super.visitChildren(visitor); |
13761 safelyVisitChild(_variableList, visitor); | 11172 safelyVisitChild(_variableList, visitor); |
(...skipping 11 matching lines...) Expand all Loading... |
13773 * 'finally' [Block] | 11184 * 'finally' [Block] |
13774 * </pre> | 11185 * </pre> |
13775 * | 11186 * |
13776 * @coverage dart.engine.ast | 11187 * @coverage dart.engine.ast |
13777 */ | 11188 */ |
13778 class TryStatement extends Statement { | 11189 class TryStatement extends Statement { |
13779 | 11190 |
13780 /** | 11191 /** |
13781 * The token representing the 'try' keyword. | 11192 * The token representing the 'try' keyword. |
13782 */ | 11193 */ |
13783 Token _tryKeyword; | 11194 Token tryKeyword; |
13784 | 11195 |
13785 /** | 11196 /** |
13786 * The body of the statement. | 11197 * The body of the statement. |
13787 */ | 11198 */ |
13788 Block _body; | 11199 Block _body; |
13789 | 11200 |
13790 /** | 11201 /** |
13791 * The catch clauses contained in the try statement. | 11202 * The catch clauses contained in the try statement. |
13792 */ | 11203 */ |
13793 NodeList<CatchClause> _catchClauses; | 11204 NodeList<CatchClause> catchClauses; |
13794 | 11205 |
13795 /** | 11206 /** |
13796 * The token representing the 'finally' keyword, or `null` if the statement do
es not contain | 11207 * The token representing the 'finally' keyword, or `null` if the statement do
es not contain |
13797 * a finally clause. | 11208 * a finally clause. |
13798 */ | 11209 */ |
13799 Token _finallyKeyword; | 11210 Token finallyKeyword; |
13800 | 11211 |
13801 /** | 11212 /** |
13802 * The finally block contained in the try statement, or `null` if the statemen
t does not | 11213 * The finally block contained in the try statement, or `null` if the statemen
t does not |
13803 * contain a finally clause. | 11214 * contain a finally clause. |
13804 */ | 11215 */ |
13805 Block _finallyBlock; | 11216 Block _finallyBlock; |
13806 | 11217 |
13807 /** | 11218 /** |
13808 * Initialize a newly created try statement. | 11219 * Initialize a newly created try statement. |
13809 * | 11220 * |
13810 * @param tryKeyword the token representing the 'try' keyword | 11221 * @param tryKeyword the token representing the 'try' keyword |
13811 * @param body the body of the statement | 11222 * @param body the body of the statement |
13812 * @param catchClauses the catch clauses contained in the try statement | 11223 * @param catchClauses the catch clauses contained in the try statement |
13813 * @param finallyKeyword the token representing the 'finally' keyword | 11224 * @param finallyKeyword the token representing the 'finally' keyword |
13814 * @param finallyBlock the finally block contained in the try statement | 11225 * @param finallyBlock the finally block contained in the try statement |
13815 */ | 11226 */ |
13816 TryStatement.full(Token tryKeyword, Block body, List<CatchClause> catchClauses
, Token finallyKeyword, Block finallyBlock) { | 11227 TryStatement.full(Token tryKeyword, Block body, List<CatchClause> catchClauses
, Token finallyKeyword, Block finallyBlock) { |
13817 this._catchClauses = new NodeList<CatchClause>(this); | 11228 this.catchClauses = new NodeList<CatchClause>(this); |
13818 this._tryKeyword = tryKeyword; | 11229 this.tryKeyword = tryKeyword; |
13819 this._body = becomeParentOf(body); | 11230 this._body = becomeParentOf(body); |
13820 this._catchClauses.addAll(catchClauses); | 11231 this.catchClauses.addAll(catchClauses); |
13821 this._finallyKeyword = finallyKeyword; | 11232 this.finallyKeyword = finallyKeyword; |
13822 this._finallyBlock = becomeParentOf(finallyBlock); | 11233 this._finallyBlock = becomeParentOf(finallyBlock); |
13823 } | 11234 } |
13824 | 11235 |
13825 /** | 11236 /** |
13826 * Initialize a newly created try statement. | 11237 * Initialize a newly created try statement. |
13827 * | 11238 * |
13828 * @param tryKeyword the token representing the 'try' keyword | 11239 * @param tryKeyword the token representing the 'try' keyword |
13829 * @param body the body of the statement | 11240 * @param body the body of the statement |
13830 * @param catchClauses the catch clauses contained in the try statement | 11241 * @param catchClauses the catch clauses contained in the try statement |
13831 * @param finallyKeyword the token representing the 'finally' keyword | 11242 * @param finallyKeyword the token representing the 'finally' keyword |
13832 * @param finallyBlock the finally block contained in the try statement | 11243 * @param finallyBlock the finally block contained in the try statement |
13833 */ | 11244 */ |
13834 TryStatement({Token tryKeyword, Block body, List<CatchClause> catchClauses, To
ken finallyKeyword, Block finallyBlock}) : this.full(tryKeyword, body, catchClau
ses, finallyKeyword, finallyBlock); | 11245 TryStatement({Token tryKeyword, Block body, List<CatchClause> catchClauses, To
ken finallyKeyword, Block finallyBlock}) : this.full(tryKeyword, body, catchClau
ses, finallyKeyword, finallyBlock); |
13835 accept(ASTVisitor visitor) => visitor.visitTryStatement(this); | 11246 accept(ASTVisitor visitor) => visitor.visitTryStatement(this); |
13836 Token get beginToken => _tryKeyword; | 11247 Token get beginToken => tryKeyword; |
13837 | 11248 |
13838 /** | 11249 /** |
13839 * Return the body of the statement. | 11250 * Return the body of the statement. |
13840 * | 11251 * |
13841 * @return the body of the statement | 11252 * @return the body of the statement |
13842 */ | 11253 */ |
13843 Block get body => _body; | 11254 Block get body => _body; |
13844 | |
13845 /** | |
13846 * Return the catch clauses contained in the try statement. | |
13847 * | |
13848 * @return the catch clauses contained in the try statement | |
13849 */ | |
13850 NodeList<CatchClause> get catchClauses => _catchClauses; | |
13851 Token get endToken { | 11255 Token get endToken { |
13852 if (_finallyBlock != null) { | 11256 if (_finallyBlock != null) { |
13853 return _finallyBlock.endToken; | 11257 return _finallyBlock.endToken; |
13854 } else if (_finallyKeyword != null) { | 11258 } else if (finallyKeyword != null) { |
13855 return _finallyKeyword; | 11259 return finallyKeyword; |
13856 } else if (!_catchClauses.isEmpty) { | 11260 } else if (!catchClauses.isEmpty) { |
13857 return _catchClauses.endToken; | 11261 return catchClauses.endToken; |
13858 } | 11262 } |
13859 return _body.endToken; | 11263 return _body.endToken; |
13860 } | 11264 } |
13861 | 11265 |
13862 /** | 11266 /** |
13863 * Return the finally block contained in the try statement, or `null` if the s
tatement does | 11267 * Return the finally block contained in the try statement, or `null` if the s
tatement does |
13864 * not contain a finally clause. | 11268 * not contain a finally clause. |
13865 * | 11269 * |
13866 * @return the finally block contained in the try statement | 11270 * @return the finally block contained in the try statement |
13867 */ | 11271 */ |
13868 Block get finallyBlock => _finallyBlock; | 11272 Block get finallyBlock => _finallyBlock; |
13869 | 11273 |
13870 /** | 11274 /** |
13871 * Return the token representing the 'finally' keyword, or `null` if the state
ment does not | |
13872 * contain a finally clause. | |
13873 * | |
13874 * @return the token representing the 'finally' keyword | |
13875 */ | |
13876 Token get finallyKeyword => _finallyKeyword; | |
13877 | |
13878 /** | |
13879 * Return the token representing the 'try' keyword. | |
13880 * | |
13881 * @return the token representing the 'try' keyword | |
13882 */ | |
13883 Token get tryKeyword => _tryKeyword; | |
13884 | |
13885 /** | |
13886 * Set the body of the statement to the given block. | 11275 * Set the body of the statement to the given block. |
13887 * | 11276 * |
13888 * @param block the body of the statement | 11277 * @param block the body of the statement |
13889 */ | 11278 */ |
13890 void set body(Block block) { | 11279 void set body(Block block) { |
13891 _body = becomeParentOf(block); | 11280 _body = becomeParentOf(block); |
13892 } | 11281 } |
13893 | 11282 |
13894 /** | 11283 /** |
13895 * Set the finally block contained in the try statement to the given block. | 11284 * Set the finally block contained in the try statement to the given block. |
13896 * | 11285 * |
13897 * @param block the finally block contained in the try statement | 11286 * @param block the finally block contained in the try statement |
13898 */ | 11287 */ |
13899 void set finallyBlock(Block block) { | 11288 void set finallyBlock(Block block) { |
13900 _finallyBlock = becomeParentOf(block); | 11289 _finallyBlock = becomeParentOf(block); |
13901 } | 11290 } |
13902 | |
13903 /** | |
13904 * Set the token representing the 'finally' keyword to the given token. | |
13905 * | |
13906 * @param finallyKeyword the token representing the 'finally' keyword | |
13907 */ | |
13908 void set finallyKeyword(Token finallyKeyword2) { | |
13909 this._finallyKeyword = finallyKeyword2; | |
13910 } | |
13911 | |
13912 /** | |
13913 * Set the token representing the 'try' keyword to the given token. | |
13914 * | |
13915 * @param tryKeyword the token representing the 'try' keyword | |
13916 */ | |
13917 void set tryKeyword(Token tryKeyword2) { | |
13918 this._tryKeyword = tryKeyword2; | |
13919 } | |
13920 void visitChildren(ASTVisitor visitor) { | 11291 void visitChildren(ASTVisitor visitor) { |
13921 safelyVisitChild(_body, visitor); | 11292 safelyVisitChild(_body, visitor); |
13922 _catchClauses.accept(visitor); | 11293 catchClauses.accept(visitor); |
13923 safelyVisitChild(_finallyBlock, visitor); | 11294 safelyVisitChild(_finallyBlock, visitor); |
13924 } | 11295 } |
13925 } | 11296 } |
13926 /** | 11297 /** |
13927 * The abstract class `TypeAlias` defines the behavior common to declarations of
type aliases. | 11298 * The abstract class `TypeAlias` defines the behavior common to declarations of
type aliases. |
13928 * | 11299 * |
13929 * <pre> | 11300 * <pre> |
13930 * typeAlias ::= | 11301 * typeAlias ::= |
13931 * 'typedef' typeAliasBody | 11302 * 'typedef' typeAliasBody |
13932 * | 11303 * |
13933 * typeAliasBody ::= | 11304 * typeAliasBody ::= |
13934 * classTypeAlias | 11305 * classTypeAlias |
13935 * | functionTypeAlias | 11306 * | functionTypeAlias |
13936 * </pre> | 11307 * </pre> |
13937 * | 11308 * |
13938 * @coverage dart.engine.ast | 11309 * @coverage dart.engine.ast |
13939 */ | 11310 */ |
13940 abstract class TypeAlias extends CompilationUnitMember { | 11311 abstract class TypeAlias extends CompilationUnitMember { |
13941 | 11312 |
13942 /** | 11313 /** |
13943 * The token representing the 'typedef' keyword. | 11314 * The token representing the 'typedef' keyword. |
13944 */ | 11315 */ |
13945 Token _keyword; | 11316 Token keyword; |
13946 | 11317 |
13947 /** | 11318 /** |
13948 * The semicolon terminating the declaration. | 11319 * The semicolon terminating the declaration. |
13949 */ | 11320 */ |
13950 Token _semicolon; | 11321 Token semicolon; |
13951 | 11322 |
13952 /** | 11323 /** |
13953 * Initialize a newly created type alias. | 11324 * Initialize a newly created type alias. |
13954 * | 11325 * |
13955 * @param comment the documentation comment associated with this type alias | 11326 * @param comment the documentation comment associated with this type alias |
13956 * @param metadata the annotations associated with this type alias | 11327 * @param metadata the annotations associated with this type alias |
13957 * @param keyword the token representing the 'typedef' keyword | 11328 * @param keyword the token representing the 'typedef' keyword |
13958 * @param semicolon the semicolon terminating the declaration | 11329 * @param semicolon the semicolon terminating the declaration |
13959 */ | 11330 */ |
13960 TypeAlias.full(Comment comment, List<Annotation> metadata, Token keyword, Toke
n semicolon) : super.full(comment, metadata) { | 11331 TypeAlias.full(Comment comment, List<Annotation> metadata, Token keyword, Toke
n semicolon) : super.full(comment, metadata) { |
13961 this._keyword = keyword; | 11332 this.keyword = keyword; |
13962 this._semicolon = semicolon; | 11333 this.semicolon = semicolon; |
13963 } | 11334 } |
13964 | 11335 |
13965 /** | 11336 /** |
13966 * Initialize a newly created type alias. | 11337 * Initialize a newly created type alias. |
13967 * | 11338 * |
13968 * @param comment the documentation comment associated with this type alias | 11339 * @param comment the documentation comment associated with this type alias |
13969 * @param metadata the annotations associated with this type alias | 11340 * @param metadata the annotations associated with this type alias |
13970 * @param keyword the token representing the 'typedef' keyword | 11341 * @param keyword the token representing the 'typedef' keyword |
13971 * @param semicolon the semicolon terminating the declaration | 11342 * @param semicolon the semicolon terminating the declaration |
13972 */ | 11343 */ |
13973 TypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Token se
micolon}) : this.full(comment, metadata, keyword, semicolon); | 11344 TypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Token se
micolon}) : this.full(comment, metadata, keyword, semicolon); |
13974 Token get endToken => _semicolon; | 11345 Token get endToken => semicolon; |
13975 | 11346 Token get firstTokenAfterCommentAndMetadata => keyword; |
13976 /** | |
13977 * Return the token representing the 'typedef' keyword. | |
13978 * | |
13979 * @return the token representing the 'typedef' keyword | |
13980 */ | |
13981 Token get keyword => _keyword; | |
13982 | |
13983 /** | |
13984 * Return the semicolon terminating the declaration. | |
13985 * | |
13986 * @return the semicolon terminating the declaration | |
13987 */ | |
13988 Token get semicolon => _semicolon; | |
13989 | |
13990 /** | |
13991 * Set the token representing the 'typedef' keyword to the given token. | |
13992 * | |
13993 * @param keyword the token representing the 'typedef' keyword | |
13994 */ | |
13995 void set keyword(Token keyword2) { | |
13996 this._keyword = keyword2; | |
13997 } | |
13998 | |
13999 /** | |
14000 * Set the semicolon terminating the declaration to the given token. | |
14001 * | |
14002 * @param semicolon the semicolon terminating the declaration | |
14003 */ | |
14004 void set semicolon(Token semicolon2) { | |
14005 this._semicolon = semicolon2; | |
14006 } | |
14007 Token get firstTokenAfterCommentAndMetadata => _keyword; | |
14008 } | 11347 } |
14009 /** | 11348 /** |
14010 * Instances of the class `TypeArgumentList` represent a list of type arguments. | 11349 * Instances of the class `TypeArgumentList` represent a list of type arguments. |
14011 * | 11350 * |
14012 * <pre> | 11351 * <pre> |
14013 * typeArguments ::= | 11352 * typeArguments ::= |
14014 * '<' typeName (',' typeName)* '>' | 11353 * '<' typeName (',' typeName)* '>' |
14015 * </pre> | 11354 * </pre> |
14016 * | 11355 * |
14017 * @coverage dart.engine.ast | 11356 * @coverage dart.engine.ast |
14018 */ | 11357 */ |
14019 class TypeArgumentList extends ASTNode { | 11358 class TypeArgumentList extends ASTNode { |
14020 | 11359 |
14021 /** | 11360 /** |
14022 * The left bracket. | 11361 * The left bracket. |
14023 */ | 11362 */ |
14024 Token _leftBracket; | 11363 Token leftBracket; |
14025 | 11364 |
14026 /** | 11365 /** |
14027 * The type arguments associated with the type. | 11366 * The type arguments associated with the type. |
14028 */ | 11367 */ |
14029 NodeList<TypeName> _arguments; | 11368 NodeList<TypeName> arguments; |
14030 | 11369 |
14031 /** | 11370 /** |
14032 * The right bracket. | 11371 * The right bracket. |
14033 */ | 11372 */ |
14034 Token _rightBracket; | 11373 Token rightBracket; |
14035 | 11374 |
14036 /** | 11375 /** |
14037 * Initialize a newly created list of type arguments. | 11376 * Initialize a newly created list of type arguments. |
14038 * | 11377 * |
14039 * @param leftBracket the left bracket | 11378 * @param leftBracket the left bracket |
14040 * @param arguments the type arguments associated with the type | 11379 * @param arguments the type arguments associated with the type |
14041 * @param rightBracket the right bracket | 11380 * @param rightBracket the right bracket |
14042 */ | 11381 */ |
14043 TypeArgumentList.full(Token leftBracket, List<TypeName> arguments, Token right
Bracket) { | 11382 TypeArgumentList.full(Token leftBracket, List<TypeName> arguments, Token right
Bracket) { |
14044 this._arguments = new NodeList<TypeName>(this); | 11383 this.arguments = new NodeList<TypeName>(this); |
14045 this._leftBracket = leftBracket; | 11384 this.leftBracket = leftBracket; |
14046 this._arguments.addAll(arguments); | 11385 this.arguments.addAll(arguments); |
14047 this._rightBracket = rightBracket; | 11386 this.rightBracket = rightBracket; |
14048 } | 11387 } |
14049 | 11388 |
14050 /** | 11389 /** |
14051 * Initialize a newly created list of type arguments. | 11390 * Initialize a newly created list of type arguments. |
14052 * | 11391 * |
14053 * @param leftBracket the left bracket | 11392 * @param leftBracket the left bracket |
14054 * @param arguments the type arguments associated with the type | 11393 * @param arguments the type arguments associated with the type |
14055 * @param rightBracket the right bracket | 11394 * @param rightBracket the right bracket |
14056 */ | 11395 */ |
14057 TypeArgumentList({Token leftBracket, List<TypeName> arguments, Token rightBrac
ket}) : this.full(leftBracket, arguments, rightBracket); | 11396 TypeArgumentList({Token leftBracket, List<TypeName> arguments, Token rightBrac
ket}) : this.full(leftBracket, arguments, rightBracket); |
14058 accept(ASTVisitor visitor) => visitor.visitTypeArgumentList(this); | 11397 accept(ASTVisitor visitor) => visitor.visitTypeArgumentList(this); |
14059 | 11398 Token get beginToken => leftBracket; |
14060 /** | 11399 Token get endToken => rightBracket; |
14061 * Return the type arguments associated with the type. | |
14062 * | |
14063 * @return the type arguments associated with the type | |
14064 */ | |
14065 NodeList<TypeName> get arguments => _arguments; | |
14066 Token get beginToken => _leftBracket; | |
14067 Token get endToken => _rightBracket; | |
14068 | |
14069 /** | |
14070 * Return the left bracket. | |
14071 * | |
14072 * @return the left bracket | |
14073 */ | |
14074 Token get leftBracket => _leftBracket; | |
14075 | |
14076 /** | |
14077 * Return the right bracket. | |
14078 * | |
14079 * @return the right bracket | |
14080 */ | |
14081 Token get rightBracket => _rightBracket; | |
14082 | |
14083 /** | |
14084 * Set the left bracket to the given token. | |
14085 * | |
14086 * @param leftBracket the left bracket | |
14087 */ | |
14088 void set leftBracket(Token leftBracket2) { | |
14089 this._leftBracket = leftBracket2; | |
14090 } | |
14091 | |
14092 /** | |
14093 * Set the right bracket to the given token. | |
14094 * | |
14095 * @param rightBracket the right bracket | |
14096 */ | |
14097 void set rightBracket(Token rightBracket2) { | |
14098 this._rightBracket = rightBracket2; | |
14099 } | |
14100 void visitChildren(ASTVisitor visitor) { | 11400 void visitChildren(ASTVisitor visitor) { |
14101 _arguments.accept(visitor); | 11401 arguments.accept(visitor); |
14102 } | 11402 } |
14103 } | 11403 } |
14104 /** | 11404 /** |
14105 * Instances of the class `TypeName` represent the name of a type, which can opt
ionally | 11405 * Instances of the class `TypeName` represent the name of a type, which can opt
ionally |
14106 * include type arguments. | 11406 * include type arguments. |
14107 * | 11407 * |
14108 * <pre> | 11408 * <pre> |
14109 * typeName ::= | 11409 * typeName ::= |
14110 * [Identifier] typeArguments? | 11410 * [Identifier] typeArguments? |
14111 * </pre> | 11411 * </pre> |
14112 * | 11412 * |
14113 * @coverage dart.engine.ast | 11413 * @coverage dart.engine.ast |
14114 */ | 11414 */ |
14115 class TypeName extends ASTNode { | 11415 class TypeName extends ASTNode { |
14116 | 11416 |
14117 /** | 11417 /** |
14118 * The name of the type. | 11418 * The name of the type. |
14119 */ | 11419 */ |
14120 Identifier _name; | 11420 Identifier _name; |
14121 | 11421 |
14122 /** | 11422 /** |
14123 * The type arguments associated with the type, or `null` if there are no type
arguments. | 11423 * The type arguments associated with the type, or `null` if there are no type
arguments. |
14124 */ | 11424 */ |
14125 TypeArgumentList _typeArguments; | 11425 TypeArgumentList _typeArguments; |
14126 | 11426 |
14127 /** | 11427 /** |
14128 * The type being named, or `null` if the AST structure has not been resolved. | 11428 * The type being named, or `null` if the AST structure has not been resolved. |
14129 */ | 11429 */ |
14130 Type2 _type; | 11430 Type2 type; |
14131 | 11431 |
14132 /** | 11432 /** |
14133 * Initialize a newly created type name. | 11433 * Initialize a newly created type name. |
14134 * | 11434 * |
14135 * @param name the name of the type | 11435 * @param name the name of the type |
14136 * @param typeArguments the type arguments associated with the type, or `null`
if there are | 11436 * @param typeArguments the type arguments associated with the type, or `null`
if there are |
14137 * no type arguments | 11437 * no type arguments |
14138 */ | 11438 */ |
14139 TypeName.full(Identifier name, TypeArgumentList typeArguments) { | 11439 TypeName.full(Identifier name, TypeArgumentList typeArguments) { |
14140 this._name = becomeParentOf(name); | 11440 this._name = becomeParentOf(name); |
(...skipping 18 matching lines...) Expand all Loading... |
14159 } | 11459 } |
14160 | 11460 |
14161 /** | 11461 /** |
14162 * Return the name of the type. | 11462 * Return the name of the type. |
14163 * | 11463 * |
14164 * @return the name of the type | 11464 * @return the name of the type |
14165 */ | 11465 */ |
14166 Identifier get name => _name; | 11466 Identifier get name => _name; |
14167 | 11467 |
14168 /** | 11468 /** |
14169 * Return the type being named, or `null` if the AST structure has not been re
solved. | |
14170 * | |
14171 * @return the type being named | |
14172 */ | |
14173 Type2 get type => _type; | |
14174 | |
14175 /** | |
14176 * Return the type arguments associated with the type, or `null` if there are
no type | 11469 * Return the type arguments associated with the type, or `null` if there are
no type |
14177 * arguments. | 11470 * arguments. |
14178 * | 11471 * |
14179 * @return the type arguments associated with the type | 11472 * @return the type arguments associated with the type |
14180 */ | 11473 */ |
14181 TypeArgumentList get typeArguments => _typeArguments; | 11474 TypeArgumentList get typeArguments => _typeArguments; |
14182 bool get isSynthetic => _name.isSynthetic && _typeArguments == null; | 11475 bool get isSynthetic => _name.isSynthetic && _typeArguments == null; |
14183 | 11476 |
14184 /** | 11477 /** |
14185 * Set the name of the type to the given identifier. | 11478 * Set the name of the type to the given identifier. |
14186 * | 11479 * |
14187 * @param identifier the name of the type | 11480 * @param identifier the name of the type |
14188 */ | 11481 */ |
14189 void set name(Identifier identifier) { | 11482 void set name(Identifier identifier) { |
14190 _name = becomeParentOf(identifier); | 11483 _name = becomeParentOf(identifier); |
14191 } | 11484 } |
14192 | 11485 |
14193 /** | 11486 /** |
14194 * Set the type being named to the given type. | |
14195 * | |
14196 * @param type the type being named | |
14197 */ | |
14198 void set type(Type2 type2) { | |
14199 this._type = type2; | |
14200 } | |
14201 | |
14202 /** | |
14203 * Set the type arguments associated with the type to the given type arguments
. | 11487 * Set the type arguments associated with the type to the given type arguments
. |
14204 * | 11488 * |
14205 * @param typeArguments the type arguments associated with the type | 11489 * @param typeArguments the type arguments associated with the type |
14206 */ | 11490 */ |
14207 void set typeArguments(TypeArgumentList typeArguments2) { | 11491 void set typeArguments(TypeArgumentList typeArguments2) { |
14208 this._typeArguments = becomeParentOf(typeArguments2); | 11492 this._typeArguments = becomeParentOf(typeArguments2); |
14209 } | 11493 } |
14210 void visitChildren(ASTVisitor visitor) { | 11494 void visitChildren(ASTVisitor visitor) { |
14211 safelyVisitChild(_name, visitor); | 11495 safelyVisitChild(_name, visitor); |
14212 safelyVisitChild(_typeArguments, visitor); | 11496 safelyVisitChild(_typeArguments, visitor); |
(...skipping 13 matching lines...) Expand all Loading... |
14226 | 11510 |
14227 /** | 11511 /** |
14228 * The name of the type parameter. | 11512 * The name of the type parameter. |
14229 */ | 11513 */ |
14230 SimpleIdentifier _name; | 11514 SimpleIdentifier _name; |
14231 | 11515 |
14232 /** | 11516 /** |
14233 * The token representing the 'extends' keyword, or `null` if there was no exp
licit upper | 11517 * The token representing the 'extends' keyword, or `null` if there was no exp
licit upper |
14234 * bound. | 11518 * bound. |
14235 */ | 11519 */ |
14236 Token _keyword; | 11520 Token keyword; |
14237 | 11521 |
14238 /** | 11522 /** |
14239 * The name of the upper bound for legal arguments, or `null` if there was no
explicit upper | 11523 * The name of the upper bound for legal arguments, or `null` if there was no
explicit upper |
14240 * bound. | 11524 * bound. |
14241 */ | 11525 */ |
14242 TypeName _bound; | 11526 TypeName _bound; |
14243 | 11527 |
14244 /** | 11528 /** |
14245 * Initialize a newly created type parameter. | 11529 * Initialize a newly created type parameter. |
14246 * | 11530 * |
14247 * @param comment the documentation comment associated with the type parameter | 11531 * @param comment the documentation comment associated with the type parameter |
14248 * @param metadata the annotations associated with the type parameter | 11532 * @param metadata the annotations associated with the type parameter |
14249 * @param name the name of the type parameter | 11533 * @param name the name of the type parameter |
14250 * @param keyword the token representing the 'extends' keyword | 11534 * @param keyword the token representing the 'extends' keyword |
14251 * @param bound the name of the upper bound for legal arguments | 11535 * @param bound the name of the upper bound for legal arguments |
14252 */ | 11536 */ |
14253 TypeParameter.full(Comment comment, List<Annotation> metadata, SimpleIdentifie
r name, Token keyword, TypeName bound) : super.full(comment, metadata) { | 11537 TypeParameter.full(Comment comment, List<Annotation> metadata, SimpleIdentifie
r name, Token keyword, TypeName bound) : super.full(comment, metadata) { |
14254 this._name = becomeParentOf(name); | 11538 this._name = becomeParentOf(name); |
14255 this._keyword = keyword; | 11539 this.keyword = keyword; |
14256 this._bound = becomeParentOf(bound); | 11540 this._bound = becomeParentOf(bound); |
14257 } | 11541 } |
14258 | 11542 |
14259 /** | 11543 /** |
14260 * Initialize a newly created type parameter. | 11544 * Initialize a newly created type parameter. |
14261 * | 11545 * |
14262 * @param comment the documentation comment associated with the type parameter | 11546 * @param comment the documentation comment associated with the type parameter |
14263 * @param metadata the annotations associated with the type parameter | 11547 * @param metadata the annotations associated with the type parameter |
14264 * @param name the name of the type parameter | 11548 * @param name the name of the type parameter |
14265 * @param keyword the token representing the 'extends' keyword | 11549 * @param keyword the token representing the 'extends' keyword |
(...skipping 11 matching lines...) Expand all Loading... |
14277 TypeName get bound => _bound; | 11561 TypeName get bound => _bound; |
14278 TypeVariableElement get element => _name != null ? (_name.staticElement as Typ
eVariableElement) : null; | 11562 TypeVariableElement get element => _name != null ? (_name.staticElement as Typ
eVariableElement) : null; |
14279 Token get endToken { | 11563 Token get endToken { |
14280 if (_bound == null) { | 11564 if (_bound == null) { |
14281 return _name.endToken; | 11565 return _name.endToken; |
14282 } | 11566 } |
14283 return _bound.endToken; | 11567 return _bound.endToken; |
14284 } | 11568 } |
14285 | 11569 |
14286 /** | 11570 /** |
14287 * Return the token representing the 'extends' keyword, or `null` if there was
no explicit | |
14288 * upper bound. | |
14289 * | |
14290 * @return the token representing the 'extends' keyword | |
14291 */ | |
14292 Token get keyword => _keyword; | |
14293 | |
14294 /** | |
14295 * Return the name of the type parameter. | 11571 * Return the name of the type parameter. |
14296 * | 11572 * |
14297 * @return the name of the type parameter | 11573 * @return the name of the type parameter |
14298 */ | 11574 */ |
14299 SimpleIdentifier get name => _name; | 11575 SimpleIdentifier get name => _name; |
14300 | 11576 |
14301 /** | 11577 /** |
14302 * Set the name of the upper bound for legal arguments to the given type name. | 11578 * Set the name of the upper bound for legal arguments to the given type name. |
14303 * | 11579 * |
14304 * @param typeName the name of the upper bound for legal arguments | 11580 * @param typeName the name of the upper bound for legal arguments |
14305 */ | 11581 */ |
14306 void set bound(TypeName typeName) { | 11582 void set bound(TypeName typeName) { |
14307 _bound = becomeParentOf(typeName); | 11583 _bound = becomeParentOf(typeName); |
14308 } | 11584 } |
14309 | 11585 |
14310 /** | 11586 /** |
14311 * Set the token representing the 'extends' keyword to the given token. | |
14312 * | |
14313 * @param keyword the token representing the 'extends' keyword | |
14314 */ | |
14315 void set keyword(Token keyword2) { | |
14316 this._keyword = keyword2; | |
14317 } | |
14318 | |
14319 /** | |
14320 * Set the name of the type parameter to the given identifier. | 11587 * Set the name of the type parameter to the given identifier. |
14321 * | 11588 * |
14322 * @param identifier the name of the type parameter | 11589 * @param identifier the name of the type parameter |
14323 */ | 11590 */ |
14324 void set name(SimpleIdentifier identifier) { | 11591 void set name(SimpleIdentifier identifier) { |
14325 _name = becomeParentOf(identifier); | 11592 _name = becomeParentOf(identifier); |
14326 } | 11593 } |
14327 void visitChildren(ASTVisitor visitor) { | 11594 void visitChildren(ASTVisitor visitor) { |
14328 super.visitChildren(visitor); | 11595 super.visitChildren(visitor); |
14329 safelyVisitChild(_name, visitor); | 11596 safelyVisitChild(_name, visitor); |
14330 safelyVisitChild(_bound, visitor); | 11597 safelyVisitChild(_bound, visitor); |
14331 } | 11598 } |
14332 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; | 11599 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; |
14333 } | 11600 } |
14334 /** | 11601 /** |
14335 * Instances of the class `TypeParameterList` represent type parameters within a
declaration. | 11602 * Instances of the class `TypeParameterList` represent type parameters within a
declaration. |
14336 * | 11603 * |
14337 * <pre> | 11604 * <pre> |
14338 * typeParameterList ::= | 11605 * typeParameterList ::= |
14339 * '<' [TypeParameter] (',' [TypeParameter])* '>' | 11606 * '<' [TypeParameter] (',' [TypeParameter])* '>' |
14340 * </pre> | 11607 * </pre> |
14341 * | 11608 * |
14342 * @coverage dart.engine.ast | 11609 * @coverage dart.engine.ast |
14343 */ | 11610 */ |
14344 class TypeParameterList extends ASTNode { | 11611 class TypeParameterList extends ASTNode { |
14345 | 11612 |
14346 /** | 11613 /** |
14347 * The left angle bracket. | 11614 * The left angle bracket. |
14348 */ | 11615 */ |
14349 Token _leftBracket; | 11616 Token leftBracket; |
14350 | 11617 |
14351 /** | 11618 /** |
14352 * The type parameters in the list. | 11619 * The type parameters in the list. |
14353 */ | 11620 */ |
14354 NodeList<TypeParameter> _typeParameters; | 11621 NodeList<TypeParameter> typeParameters; |
14355 | 11622 |
14356 /** | 11623 /** |
14357 * The right angle bracket. | 11624 * The right angle bracket. |
14358 */ | 11625 */ |
14359 Token _rightBracket; | 11626 Token rightBracket; |
14360 | 11627 |
14361 /** | 11628 /** |
14362 * Initialize a newly created list of type parameters. | 11629 * Initialize a newly created list of type parameters. |
14363 * | 11630 * |
14364 * @param leftBracket the left angle bracket | 11631 * @param leftBracket the left angle bracket |
14365 * @param typeParameters the type parameters in the list | 11632 * @param typeParameters the type parameters in the list |
14366 * @param rightBracket the right angle bracket | 11633 * @param rightBracket the right angle bracket |
14367 */ | 11634 */ |
14368 TypeParameterList.full(Token leftBracket, List<TypeParameter> typeParameters,
Token rightBracket) { | 11635 TypeParameterList.full(Token leftBracket, List<TypeParameter> typeParameters,
Token rightBracket) { |
14369 this._typeParameters = new NodeList<TypeParameter>(this); | 11636 this.typeParameters = new NodeList<TypeParameter>(this); |
14370 this._leftBracket = leftBracket; | 11637 this.leftBracket = leftBracket; |
14371 this._typeParameters.addAll(typeParameters); | 11638 this.typeParameters.addAll(typeParameters); |
14372 this._rightBracket = rightBracket; | 11639 this.rightBracket = rightBracket; |
14373 } | 11640 } |
14374 | 11641 |
14375 /** | 11642 /** |
14376 * Initialize a newly created list of type parameters. | 11643 * Initialize a newly created list of type parameters. |
14377 * | 11644 * |
14378 * @param leftBracket the left angle bracket | 11645 * @param leftBracket the left angle bracket |
14379 * @param typeParameters the type parameters in the list | 11646 * @param typeParameters the type parameters in the list |
14380 * @param rightBracket the right angle bracket | 11647 * @param rightBracket the right angle bracket |
14381 */ | 11648 */ |
14382 TypeParameterList({Token leftBracket, List<TypeParameter> typeParameters, Toke
n rightBracket}) : this.full(leftBracket, typeParameters, rightBracket); | 11649 TypeParameterList({Token leftBracket, List<TypeParameter> typeParameters, Toke
n rightBracket}) : this.full(leftBracket, typeParameters, rightBracket); |
14383 accept(ASTVisitor visitor) => visitor.visitTypeParameterList(this); | 11650 accept(ASTVisitor visitor) => visitor.visitTypeParameterList(this); |
14384 Token get beginToken => _leftBracket; | 11651 Token get beginToken => leftBracket; |
14385 Token get endToken => _rightBracket; | 11652 Token get endToken => rightBracket; |
14386 | |
14387 /** | |
14388 * Return the left angle bracket. | |
14389 * | |
14390 * @return the left angle bracket | |
14391 */ | |
14392 Token get leftBracket => _leftBracket; | |
14393 | |
14394 /** | |
14395 * Return the right angle bracket. | |
14396 * | |
14397 * @return the right angle bracket | |
14398 */ | |
14399 Token get rightBracket => _rightBracket; | |
14400 | |
14401 /** | |
14402 * Return the type parameters for the type. | |
14403 * | |
14404 * @return the type parameters for the type | |
14405 */ | |
14406 NodeList<TypeParameter> get typeParameters => _typeParameters; | |
14407 void visitChildren(ASTVisitor visitor) { | 11653 void visitChildren(ASTVisitor visitor) { |
14408 _typeParameters.accept(visitor); | 11654 typeParameters.accept(visitor); |
14409 } | 11655 } |
14410 } | 11656 } |
14411 /** | 11657 /** |
14412 * The abstract class `TypedLiteral` defines the behavior common to literals tha
t have a type | 11658 * The abstract class `TypedLiteral` defines the behavior common to literals tha
t have a type |
14413 * associated with them. | 11659 * associated with them. |
14414 * | 11660 * |
14415 * <pre> | 11661 * <pre> |
14416 * listLiteral ::= | 11662 * listLiteral ::= |
14417 * [ListLiteral] | 11663 * [ListLiteral] |
14418 * | [MapLiteral] | 11664 * | [MapLiteral] |
14419 * </pre> | 11665 * </pre> |
14420 * | 11666 * |
14421 * @coverage dart.engine.ast | 11667 * @coverage dart.engine.ast |
14422 */ | 11668 */ |
14423 abstract class TypedLiteral extends Literal { | 11669 abstract class TypedLiteral extends Literal { |
14424 | 11670 |
14425 /** | 11671 /** |
14426 * The token representing the 'const' keyword, or `null` if the literal is not
a constant. | 11672 * The token representing the 'const' keyword, or `null` if the literal is not
a constant. |
14427 */ | 11673 */ |
14428 Token _constKeyword; | 11674 Token constKeyword; |
14429 | 11675 |
14430 /** | 11676 /** |
14431 * The type argument associated with this literal, or `null` if no type argume
nts were | 11677 * The type argument associated with this literal, or `null` if no type argume
nts were |
14432 * declared. | 11678 * declared. |
14433 */ | 11679 */ |
14434 TypeArgumentList _typeArguments; | 11680 TypeArgumentList typeArguments; |
14435 | 11681 |
14436 /** | 11682 /** |
14437 * Initialize a newly created typed literal. | 11683 * Initialize a newly created typed literal. |
14438 * | 11684 * |
14439 * @param constKeyword the token representing the 'const' keyword | 11685 * @param constKeyword the token representing the 'const' keyword |
14440 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type | 11686 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type |
14441 * arguments were declared | 11687 * arguments were declared |
14442 */ | 11688 */ |
14443 TypedLiteral.full(Token constKeyword, TypeArgumentList typeArguments) { | 11689 TypedLiteral.full(Token constKeyword, TypeArgumentList typeArguments) { |
14444 this._constKeyword = constKeyword; | 11690 this.constKeyword = constKeyword; |
14445 this._typeArguments = becomeParentOf(typeArguments); | 11691 this.typeArguments = becomeParentOf(typeArguments); |
14446 } | 11692 } |
14447 | 11693 |
14448 /** | 11694 /** |
14449 * Initialize a newly created typed literal. | 11695 * Initialize a newly created typed literal. |
14450 * | 11696 * |
14451 * @param constKeyword the token representing the 'const' keyword | 11697 * @param constKeyword the token representing the 'const' keyword |
14452 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type | 11698 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type |
14453 * arguments were declared | 11699 * arguments were declared |
14454 */ | 11700 */ |
14455 TypedLiteral({Token constKeyword, TypeArgumentList typeArguments}) : this.full
(constKeyword, typeArguments); | 11701 TypedLiteral({Token constKeyword, TypeArgumentList typeArguments}) : this.full
(constKeyword, typeArguments); |
14456 | |
14457 /** | |
14458 * Return the token representing the 'const' keyword. | |
14459 * | |
14460 * @return the token representing the 'const' keyword | |
14461 */ | |
14462 Token get constKeyword => _constKeyword; | |
14463 | |
14464 /** | |
14465 * Return the type argument associated with this literal, or `null` if no type
arguments | |
14466 * were declared. | |
14467 * | |
14468 * @return the type argument associated with this literal | |
14469 */ | |
14470 TypeArgumentList get typeArguments => _typeArguments; | |
14471 | |
14472 /** | |
14473 * Set the token representing the 'const' keyword to the given keyword. | |
14474 * | |
14475 * @param keyword the token representing the 'const' keyword | |
14476 */ | |
14477 void set constKeyword(Token keyword) { | |
14478 this._constKeyword = keyword; | |
14479 } | |
14480 | |
14481 /** | |
14482 * Set the type argument associated with this literal to the given arguments. | |
14483 * | |
14484 * @param typeArguments the type argument associated with this literal | |
14485 */ | |
14486 void set typeArguments(TypeArgumentList typeArguments2) { | |
14487 this._typeArguments = typeArguments2; | |
14488 } | |
14489 void visitChildren(ASTVisitor visitor) { | 11702 void visitChildren(ASTVisitor visitor) { |
14490 safelyVisitChild(_typeArguments, visitor); | 11703 safelyVisitChild(typeArguments, visitor); |
14491 } | 11704 } |
14492 } | 11705 } |
14493 /** | 11706 /** |
14494 * The abstract class `UriBasedDirective` defines the behavior common to nodes t
hat represent | 11707 * The abstract class `UriBasedDirective` defines the behavior common to nodes t
hat represent |
14495 * a directive that references a URI. | 11708 * a directive that references a URI. |
14496 * | 11709 * |
14497 * <pre> | 11710 * <pre> |
14498 * uriBasedDirective ::= | 11711 * uriBasedDirective ::= |
14499 * [ExportDirective] | 11712 * [ExportDirective] |
14500 * | [ImportDirective] | 11713 * | [ImportDirective] |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14575 | 11788 |
14576 /** | 11789 /** |
14577 * The name of the variable being declared. | 11790 * The name of the variable being declared. |
14578 */ | 11791 */ |
14579 SimpleIdentifier _name; | 11792 SimpleIdentifier _name; |
14580 | 11793 |
14581 /** | 11794 /** |
14582 * The equal sign separating the variable name from the initial value, or `nul
l` if the | 11795 * The equal sign separating the variable name from the initial value, or `nul
l` if the |
14583 * initial value was not specified. | 11796 * initial value was not specified. |
14584 */ | 11797 */ |
14585 Token _equals; | 11798 Token equals; |
14586 | 11799 |
14587 /** | 11800 /** |
14588 * The expression used to compute the initial value for the variable, or `null
` if the | 11801 * The expression used to compute the initial value for the variable, or `null
` if the |
14589 * initial value was not specified. | 11802 * initial value was not specified. |
14590 */ | 11803 */ |
14591 Expression _initializer; | 11804 Expression _initializer; |
14592 | 11805 |
14593 /** | 11806 /** |
14594 * Initialize a newly created variable declaration. | 11807 * Initialize a newly created variable declaration. |
14595 * | 11808 * |
14596 * @param comment the documentation comment associated with this declaration | 11809 * @param comment the documentation comment associated with this declaration |
14597 * @param metadata the annotations associated with this member | 11810 * @param metadata the annotations associated with this member |
14598 * @param name the name of the variable being declared | 11811 * @param name the name of the variable being declared |
14599 * @param equals the equal sign separating the variable name from the initial
value | 11812 * @param equals the equal sign separating the variable name from the initial
value |
14600 * @param initializer the expression used to compute the initial value for the
variable | 11813 * @param initializer the expression used to compute the initial value for the
variable |
14601 */ | 11814 */ |
14602 VariableDeclaration.full(Comment comment, List<Annotation> metadata, SimpleIde
ntifier name, Token equals, Expression initializer) : super.full(comment, metada
ta) { | 11815 VariableDeclaration.full(Comment comment, List<Annotation> metadata, SimpleIde
ntifier name, Token equals, Expression initializer) : super.full(comment, metada
ta) { |
14603 this._name = becomeParentOf(name); | 11816 this._name = becomeParentOf(name); |
14604 this._equals = equals; | 11817 this.equals = equals; |
14605 this._initializer = becomeParentOf(initializer); | 11818 this._initializer = becomeParentOf(initializer); |
14606 } | 11819 } |
14607 | 11820 |
14608 /** | 11821 /** |
14609 * Initialize a newly created variable declaration. | 11822 * Initialize a newly created variable declaration. |
14610 * | 11823 * |
14611 * @param comment the documentation comment associated with this declaration | 11824 * @param comment the documentation comment associated with this declaration |
14612 * @param metadata the annotations associated with this member | 11825 * @param metadata the annotations associated with this member |
14613 * @param name the name of the variable being declared | 11826 * @param name the name of the variable being declared |
14614 * @param equals the equal sign separating the variable name from the initial
value | 11827 * @param equals the equal sign separating the variable name from the initial
value |
(...skipping 20 matching lines...) Expand all Loading... |
14635 } | 11848 } |
14636 VariableElement get element => _name != null ? (_name.staticElement as Variabl
eElement) : null; | 11849 VariableElement get element => _name != null ? (_name.staticElement as Variabl
eElement) : null; |
14637 Token get endToken { | 11850 Token get endToken { |
14638 if (_initializer != null) { | 11851 if (_initializer != null) { |
14639 return _initializer.endToken; | 11852 return _initializer.endToken; |
14640 } | 11853 } |
14641 return _name.endToken; | 11854 return _name.endToken; |
14642 } | 11855 } |
14643 | 11856 |
14644 /** | 11857 /** |
14645 * Return the equal sign separating the variable name from the initial value,
or `null` if | |
14646 * the initial value was not specified. | |
14647 * | |
14648 * @return the equal sign separating the variable name from the initial value | |
14649 */ | |
14650 Token get equals => _equals; | |
14651 | |
14652 /** | |
14653 * Return the expression used to compute the initial value for the variable, o
r `null` if | 11858 * Return the expression used to compute the initial value for the variable, o
r `null` if |
14654 * the initial value was not specified. | 11859 * the initial value was not specified. |
14655 * | 11860 * |
14656 * @return the expression used to compute the initial value for the variable | 11861 * @return the expression used to compute the initial value for the variable |
14657 */ | 11862 */ |
14658 Expression get initializer => _initializer; | 11863 Expression get initializer => _initializer; |
14659 | 11864 |
14660 /** | 11865 /** |
14661 * Return the name of the variable being declared. | 11866 * Return the name of the variable being declared. |
14662 * | 11867 * |
(...skipping 17 matching lines...) Expand all Loading... |
14680 * final. | 11885 * final. |
14681 * | 11886 * |
14682 * @return `true` if this variable was declared with the 'final' modifier | 11887 * @return `true` if this variable was declared with the 'final' modifier |
14683 */ | 11888 */ |
14684 bool get isFinal { | 11889 bool get isFinal { |
14685 ASTNode parent = this.parent; | 11890 ASTNode parent = this.parent; |
14686 return parent is VariableDeclarationList && ((parent as VariableDeclarationL
ist)).isFinal; | 11891 return parent is VariableDeclarationList && ((parent as VariableDeclarationL
ist)).isFinal; |
14687 } | 11892 } |
14688 | 11893 |
14689 /** | 11894 /** |
14690 * Set the equal sign separating the variable name from the initial value to t
he given token. | |
14691 * | |
14692 * @param equals the equal sign separating the variable name from the initial
value | |
14693 */ | |
14694 void set equals(Token equals2) { | |
14695 this._equals = equals2; | |
14696 } | |
14697 | |
14698 /** | |
14699 * Set the expression used to compute the initial value for the variable to th
e given expression. | 11895 * Set the expression used to compute the initial value for the variable to th
e given expression. |
14700 * | 11896 * |
14701 * @param initializer the expression used to compute the initial value for the
variable | 11897 * @param initializer the expression used to compute the initial value for the
variable |
14702 */ | 11898 */ |
14703 void set initializer(Expression initializer2) { | 11899 void set initializer(Expression initializer2) { |
14704 this._initializer = becomeParentOf(initializer2); | 11900 this._initializer = becomeParentOf(initializer2); |
14705 } | 11901 } |
14706 | 11902 |
14707 /** | 11903 /** |
14708 * Set the name of the variable being declared to the given identifier. | 11904 * Set the name of the variable being declared to the given identifier. |
(...skipping 26 matching lines...) Expand all Loading... |
14735 * </pre> | 11931 * </pre> |
14736 * | 11932 * |
14737 * @coverage dart.engine.ast | 11933 * @coverage dart.engine.ast |
14738 */ | 11934 */ |
14739 class VariableDeclarationList extends AnnotatedNode { | 11935 class VariableDeclarationList extends AnnotatedNode { |
14740 | 11936 |
14741 /** | 11937 /** |
14742 * The token representing the 'final', 'const' or 'var' keyword, or `null` if
no keyword was | 11938 * The token representing the 'final', 'const' or 'var' keyword, or `null` if
no keyword was |
14743 * included. | 11939 * included. |
14744 */ | 11940 */ |
14745 Token _keyword; | 11941 Token keyword; |
14746 | 11942 |
14747 /** | 11943 /** |
14748 * The type of the variables being declared, or `null` if no type was provided
. | 11944 * The type of the variables being declared, or `null` if no type was provided
. |
14749 */ | 11945 */ |
14750 TypeName _type; | 11946 TypeName _type; |
14751 | 11947 |
14752 /** | 11948 /** |
14753 * A list containing the individual variables being declared. | 11949 * A list containing the individual variables being declared. |
14754 */ | 11950 */ |
14755 NodeList<VariableDeclaration> _variables; | 11951 NodeList<VariableDeclaration> variables; |
14756 | 11952 |
14757 /** | 11953 /** |
14758 * Initialize a newly created variable declaration list. | 11954 * Initialize a newly created variable declaration list. |
14759 * | 11955 * |
14760 * @param comment the documentation comment associated with this declaration l
ist | 11956 * @param comment the documentation comment associated with this declaration l
ist |
14761 * @param metadata the annotations associated with this declaration list | 11957 * @param metadata the annotations associated with this declaration list |
14762 * @param keyword the token representing the 'final', 'const' or 'var' keyword | 11958 * @param keyword the token representing the 'final', 'const' or 'var' keyword |
14763 * @param type the type of the variables being declared | 11959 * @param type the type of the variables being declared |
14764 * @param variables a list containing the individual variables being declared | 11960 * @param variables a list containing the individual variables being declared |
14765 */ | 11961 */ |
14766 VariableDeclarationList.full(Comment comment, List<Annotation> metadata, Token
keyword, TypeName type, List<VariableDeclaration> variables) : super.full(comme
nt, metadata) { | 11962 VariableDeclarationList.full(Comment comment, List<Annotation> metadata, Token
keyword, TypeName type, List<VariableDeclaration> variables) : super.full(comme
nt, metadata) { |
14767 this._variables = new NodeList<VariableDeclaration>(this); | 11963 this.variables = new NodeList<VariableDeclaration>(this); |
14768 this._keyword = keyword; | 11964 this.keyword = keyword; |
14769 this._type = becomeParentOf(type); | 11965 this._type = becomeParentOf(type); |
14770 this._variables.addAll(variables); | 11966 this.variables.addAll(variables); |
14771 } | 11967 } |
14772 | 11968 |
14773 /** | 11969 /** |
14774 * Initialize a newly created variable declaration list. | 11970 * Initialize a newly created variable declaration list. |
14775 * | 11971 * |
14776 * @param comment the documentation comment associated with this declaration l
ist | 11972 * @param comment the documentation comment associated with this declaration l
ist |
14777 * @param metadata the annotations associated with this declaration list | 11973 * @param metadata the annotations associated with this declaration list |
14778 * @param keyword the token representing the 'final', 'const' or 'var' keyword | 11974 * @param keyword the token representing the 'final', 'const' or 'var' keyword |
14779 * @param type the type of the variables being declared | 11975 * @param type the type of the variables being declared |
14780 * @param variables a list containing the individual variables being declared | 11976 * @param variables a list containing the individual variables being declared |
14781 */ | 11977 */ |
14782 VariableDeclarationList({Comment comment, List<Annotation> metadata, Token key
word, TypeName type, List<VariableDeclaration> variables}) : this.full(comment,
metadata, keyword, type, variables); | 11978 VariableDeclarationList({Comment comment, List<Annotation> metadata, Token key
word, TypeName type, List<VariableDeclaration> variables}) : this.full(comment,
metadata, keyword, type, variables); |
14783 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this); | 11979 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this); |
14784 Token get endToken => _variables.endToken; | 11980 Token get endToken => variables.endToken; |
14785 | |
14786 /** | |
14787 * Return the token representing the 'final', 'const' or 'var' keyword, or `nu
ll` if no | |
14788 * keyword was included. | |
14789 * | |
14790 * @return the token representing the 'final', 'const' or 'var' keyword | |
14791 */ | |
14792 Token get keyword => _keyword; | |
14793 | 11981 |
14794 /** | 11982 /** |
14795 * Return the type of the variables being declared, or `null` if no type was p
rovided. | 11983 * Return the type of the variables being declared, or `null` if no type was p
rovided. |
14796 * | 11984 * |
14797 * @return the type of the variables being declared | 11985 * @return the type of the variables being declared |
14798 */ | 11986 */ |
14799 TypeName get type => _type; | 11987 TypeName get type => _type; |
14800 | 11988 |
14801 /** | 11989 /** |
14802 * Return a list containing the individual variables being declared. | |
14803 * | |
14804 * @return a list containing the individual variables being declared | |
14805 */ | |
14806 NodeList<VariableDeclaration> get variables => _variables; | |
14807 | |
14808 /** | |
14809 * Return `true` if the variables in this list were declared with the 'const'
modifier. | 11990 * Return `true` if the variables in this list were declared with the 'const'
modifier. |
14810 * | 11991 * |
14811 * @return `true` if the variables in this list were declared with the 'const'
modifier | 11992 * @return `true` if the variables in this list were declared with the 'const'
modifier |
14812 */ | 11993 */ |
14813 bool get isConst => _keyword is KeywordToken && identical(((_keyword as Keywor
dToken)).keyword, Keyword.CONST); | 11994 bool get isConst => keyword is KeywordToken && identical(((keyword as KeywordT
oken)).keyword, Keyword.CONST); |
14814 | 11995 |
14815 /** | 11996 /** |
14816 * Return `true` if the variables in this list were declared with the 'final'
modifier. | 11997 * Return `true` if the variables in this list were declared with the 'final'
modifier. |
14817 * Variables that are declared with the 'const' modifier will return `false` e
ven though | 11998 * Variables that are declared with the 'const' modifier will return `false` e
ven though |
14818 * they are implicitly final. | 11999 * they are implicitly final. |
14819 * | 12000 * |
14820 * @return `true` if the variables in this list were declared with the 'final'
modifier | 12001 * @return `true` if the variables in this list were declared with the 'final'
modifier |
14821 */ | 12002 */ |
14822 bool get isFinal => _keyword is KeywordToken && identical(((_keyword as Keywor
dToken)).keyword, Keyword.FINAL); | 12003 bool get isFinal => keyword is KeywordToken && identical(((keyword as KeywordT
oken)).keyword, Keyword.FINAL); |
14823 | |
14824 /** | |
14825 * Set the token representing the 'final', 'const' or 'var' keyword to the giv
en token. | |
14826 * | |
14827 * @param keyword the token representing the 'final', 'const' or 'var' keyword | |
14828 */ | |
14829 void set keyword(Token keyword2) { | |
14830 this._keyword = keyword2; | |
14831 } | |
14832 | 12004 |
14833 /** | 12005 /** |
14834 * Set the type of the variables being declared to the given type name. | 12006 * Set the type of the variables being declared to the given type name. |
14835 * | 12007 * |
14836 * @param typeName the type of the variables being declared | 12008 * @param typeName the type of the variables being declared |
14837 */ | 12009 */ |
14838 void set type(TypeName typeName) { | 12010 void set type(TypeName typeName) { |
14839 _type = becomeParentOf(typeName); | 12011 _type = becomeParentOf(typeName); |
14840 } | 12012 } |
14841 void visitChildren(ASTVisitor visitor) { | 12013 void visitChildren(ASTVisitor visitor) { |
14842 safelyVisitChild(_type, visitor); | 12014 safelyVisitChild(_type, visitor); |
14843 _variables.accept(visitor); | 12015 variables.accept(visitor); |
14844 } | 12016 } |
14845 Token get firstTokenAfterCommentAndMetadata { | 12017 Token get firstTokenAfterCommentAndMetadata { |
14846 if (_keyword != null) { | 12018 if (keyword != null) { |
14847 return _keyword; | 12019 return keyword; |
14848 } else if (_type != null) { | 12020 } else if (_type != null) { |
14849 return _type.beginToken; | 12021 return _type.beginToken; |
14850 } | 12022 } |
14851 return _variables.beginToken; | 12023 return variables.beginToken; |
14852 } | 12024 } |
14853 } | 12025 } |
14854 /** | 12026 /** |
14855 * Instances of the class `VariableDeclarationStatement` represent a list of var
iables that | 12027 * Instances of the class `VariableDeclarationStatement` represent a list of var
iables that |
14856 * are being declared in a context where a statement is required. | 12028 * are being declared in a context where a statement is required. |
14857 * | 12029 * |
14858 * <pre> | 12030 * <pre> |
14859 * variableDeclarationStatement ::= | 12031 * variableDeclarationStatement ::= |
14860 * [VariableDeclarationList] ';' | 12032 * [VariableDeclarationList] ';' |
14861 * </pre> | 12033 * </pre> |
14862 * | 12034 * |
14863 * @coverage dart.engine.ast | 12035 * @coverage dart.engine.ast |
14864 */ | 12036 */ |
14865 class VariableDeclarationStatement extends Statement { | 12037 class VariableDeclarationStatement extends Statement { |
14866 | 12038 |
14867 /** | 12039 /** |
14868 * The variables being declared. | 12040 * The variables being declared. |
14869 */ | 12041 */ |
14870 VariableDeclarationList _variableList; | 12042 VariableDeclarationList _variableList; |
14871 | 12043 |
14872 /** | 12044 /** |
14873 * The semicolon terminating the statement. | 12045 * The semicolon terminating the statement. |
14874 */ | 12046 */ |
14875 Token _semicolon; | 12047 Token semicolon; |
14876 | 12048 |
14877 /** | 12049 /** |
14878 * Initialize a newly created variable declaration statement. | 12050 * Initialize a newly created variable declaration statement. |
14879 * | 12051 * |
14880 * @param variableList the fields being declared | 12052 * @param variableList the fields being declared |
14881 * @param semicolon the semicolon terminating the statement | 12053 * @param semicolon the semicolon terminating the statement |
14882 */ | 12054 */ |
14883 VariableDeclarationStatement.full(VariableDeclarationList variableList, Token
semicolon) { | 12055 VariableDeclarationStatement.full(VariableDeclarationList variableList, Token
semicolon) { |
14884 this._variableList = becomeParentOf(variableList); | 12056 this._variableList = becomeParentOf(variableList); |
14885 this._semicolon = semicolon; | 12057 this.semicolon = semicolon; |
14886 } | 12058 } |
14887 | 12059 |
14888 /** | 12060 /** |
14889 * Initialize a newly created variable declaration statement. | 12061 * Initialize a newly created variable declaration statement. |
14890 * | 12062 * |
14891 * @param variableList the fields being declared | 12063 * @param variableList the fields being declared |
14892 * @param semicolon the semicolon terminating the statement | 12064 * @param semicolon the semicolon terminating the statement |
14893 */ | 12065 */ |
14894 VariableDeclarationStatement({VariableDeclarationList variableList, Token semi
colon}) : this.full(variableList, semicolon); | 12066 VariableDeclarationStatement({VariableDeclarationList variableList, Token semi
colon}) : this.full(variableList, semicolon); |
14895 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationStatement(this); | 12067 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationStatement(this); |
14896 Token get beginToken => _variableList.beginToken; | 12068 Token get beginToken => _variableList.beginToken; |
14897 Token get endToken => _semicolon; | 12069 Token get endToken => semicolon; |
14898 | |
14899 /** | |
14900 * Return the semicolon terminating the statement. | |
14901 * | |
14902 * @return the semicolon terminating the statement | |
14903 */ | |
14904 Token get semicolon => _semicolon; | |
14905 | 12070 |
14906 /** | 12071 /** |
14907 * Return the variables being declared. | 12072 * Return the variables being declared. |
14908 * | 12073 * |
14909 * @return the variables being declared | 12074 * @return the variables being declared |
14910 */ | 12075 */ |
14911 VariableDeclarationList get variables => _variableList; | 12076 VariableDeclarationList get variables => _variableList; |
14912 | 12077 |
14913 /** | 12078 /** |
14914 * Set the semicolon terminating the statement to the given token. | |
14915 * | |
14916 * @param semicolon the semicolon terminating the statement | |
14917 */ | |
14918 void set semicolon(Token semicolon2) { | |
14919 this._semicolon = semicolon2; | |
14920 } | |
14921 | |
14922 /** | |
14923 * Set the variables being declared to the given list of variables. | 12079 * Set the variables being declared to the given list of variables. |
14924 * | 12080 * |
14925 * @param variableList the variables being declared | 12081 * @param variableList the variables being declared |
14926 */ | 12082 */ |
14927 void set variables(VariableDeclarationList variableList2) { | 12083 void set variables(VariableDeclarationList variableList2) { |
14928 this._variableList = becomeParentOf(variableList2); | 12084 this._variableList = becomeParentOf(variableList2); |
14929 } | 12085 } |
14930 void visitChildren(ASTVisitor visitor) { | 12086 void visitChildren(ASTVisitor visitor) { |
14931 safelyVisitChild(_variableList, visitor); | 12087 safelyVisitChild(_variableList, visitor); |
14932 } | 12088 } |
14933 } | 12089 } |
14934 /** | 12090 /** |
14935 * Instances of the class `WhileStatement` represent a while statement. | 12091 * Instances of the class `WhileStatement` represent a while statement. |
14936 * | 12092 * |
14937 * <pre> | 12093 * <pre> |
14938 * whileStatement ::= | 12094 * whileStatement ::= |
14939 * 'while' '(' [Expression] ')' [Statement] | 12095 * 'while' '(' [Expression] ')' [Statement] |
14940 * </pre> | 12096 * </pre> |
14941 * | 12097 * |
14942 * @coverage dart.engine.ast | 12098 * @coverage dart.engine.ast |
14943 */ | 12099 */ |
14944 class WhileStatement extends Statement { | 12100 class WhileStatement extends Statement { |
14945 | 12101 |
14946 /** | 12102 /** |
14947 * The token representing the 'while' keyword. | 12103 * The token representing the 'while' keyword. |
14948 */ | 12104 */ |
14949 Token _keyword; | 12105 Token keyword; |
14950 | 12106 |
14951 /** | 12107 /** |
14952 * The left parenthesis. | 12108 * The left parenthesis. |
14953 */ | 12109 */ |
14954 Token _leftParenthesis; | 12110 Token leftParenthesis; |
14955 | 12111 |
14956 /** | 12112 /** |
14957 * The expression used to determine whether to execute the body of the loop. | 12113 * The expression used to determine whether to execute the body of the loop. |
14958 */ | 12114 */ |
14959 Expression _condition; | 12115 Expression _condition; |
14960 | 12116 |
14961 /** | 12117 /** |
14962 * The right parenthesis. | 12118 * The right parenthesis. |
14963 */ | 12119 */ |
14964 Token _rightParenthesis; | 12120 Token rightParenthesis; |
14965 | 12121 |
14966 /** | 12122 /** |
14967 * The body of the loop. | 12123 * The body of the loop. |
14968 */ | 12124 */ |
14969 Statement _body; | 12125 Statement _body; |
14970 | 12126 |
14971 /** | 12127 /** |
14972 * Initialize a newly created while statement. | 12128 * Initialize a newly created while statement. |
14973 * | 12129 * |
14974 * @param keyword the token representing the 'while' keyword | 12130 * @param keyword the token representing the 'while' keyword |
14975 * @param leftParenthesis the left parenthesis | 12131 * @param leftParenthesis the left parenthesis |
14976 * @param condition the expression used to determine whether to execute the bo
dy of the loop | 12132 * @param condition the expression used to determine whether to execute the bo
dy of the loop |
14977 * @param rightParenthesis the right parenthesis | 12133 * @param rightParenthesis the right parenthesis |
14978 * @param body the body of the loop | 12134 * @param body the body of the loop |
14979 */ | 12135 */ |
14980 WhileStatement.full(Token keyword, Token leftParenthesis, Expression condition
, Token rightParenthesis, Statement body) { | 12136 WhileStatement.full(Token keyword, Token leftParenthesis, Expression condition
, Token rightParenthesis, Statement body) { |
14981 this._keyword = keyword; | 12137 this.keyword = keyword; |
14982 this._leftParenthesis = leftParenthesis; | 12138 this.leftParenthesis = leftParenthesis; |
14983 this._condition = becomeParentOf(condition); | 12139 this._condition = becomeParentOf(condition); |
14984 this._rightParenthesis = rightParenthesis; | 12140 this.rightParenthesis = rightParenthesis; |
14985 this._body = becomeParentOf(body); | 12141 this._body = becomeParentOf(body); |
14986 } | 12142 } |
14987 | 12143 |
14988 /** | 12144 /** |
14989 * Initialize a newly created while statement. | 12145 * Initialize a newly created while statement. |
14990 * | 12146 * |
14991 * @param keyword the token representing the 'while' keyword | 12147 * @param keyword the token representing the 'while' keyword |
14992 * @param leftParenthesis the left parenthesis | 12148 * @param leftParenthesis the left parenthesis |
14993 * @param condition the expression used to determine whether to execute the bo
dy of the loop | 12149 * @param condition the expression used to determine whether to execute the bo
dy of the loop |
14994 * @param rightParenthesis the right parenthesis | 12150 * @param rightParenthesis the right parenthesis |
14995 * @param body the body of the loop | 12151 * @param body the body of the loop |
14996 */ | 12152 */ |
14997 WhileStatement({Token keyword, Token leftParenthesis, Expression condition, To
ken rightParenthesis, Statement body}) : this.full(keyword, leftParenthesis, con
dition, rightParenthesis, body); | 12153 WhileStatement({Token keyword, Token leftParenthesis, Expression condition, To
ken rightParenthesis, Statement body}) : this.full(keyword, leftParenthesis, con
dition, rightParenthesis, body); |
14998 accept(ASTVisitor visitor) => visitor.visitWhileStatement(this); | 12154 accept(ASTVisitor visitor) => visitor.visitWhileStatement(this); |
14999 Token get beginToken => _keyword; | 12155 Token get beginToken => keyword; |
15000 | 12156 |
15001 /** | 12157 /** |
15002 * Return the body of the loop. | 12158 * Return the body of the loop. |
15003 * | 12159 * |
15004 * @return the body of the loop | 12160 * @return the body of the loop |
15005 */ | 12161 */ |
15006 Statement get body => _body; | 12162 Statement get body => _body; |
15007 | 12163 |
15008 /** | 12164 /** |
15009 * Return the expression used to determine whether to execute the body of the
loop. | 12165 * Return the expression used to determine whether to execute the body of the
loop. |
15010 * | 12166 * |
15011 * @return the expression used to determine whether to execute the body of the
loop | 12167 * @return the expression used to determine whether to execute the body of the
loop |
15012 */ | 12168 */ |
15013 Expression get condition => _condition; | 12169 Expression get condition => _condition; |
15014 Token get endToken => _body.endToken; | 12170 Token get endToken => _body.endToken; |
15015 | 12171 |
15016 /** | 12172 /** |
15017 * Return the token representing the 'while' keyword. | |
15018 * | |
15019 * @return the token representing the 'while' keyword | |
15020 */ | |
15021 Token get keyword => _keyword; | |
15022 | |
15023 /** | |
15024 * Return the left parenthesis. | |
15025 * | |
15026 * @return the left parenthesis | |
15027 */ | |
15028 Token get leftParenthesis => _leftParenthesis; | |
15029 | |
15030 /** | |
15031 * Return the right parenthesis. | |
15032 * | |
15033 * @return the right parenthesis | |
15034 */ | |
15035 Token get rightParenthesis => _rightParenthesis; | |
15036 | |
15037 /** | |
15038 * Set the body of the loop to the given statement. | 12173 * Set the body of the loop to the given statement. |
15039 * | 12174 * |
15040 * @param statement the body of the loop | 12175 * @param statement the body of the loop |
15041 */ | 12176 */ |
15042 void set body(Statement statement) { | 12177 void set body(Statement statement) { |
15043 _body = becomeParentOf(statement); | 12178 _body = becomeParentOf(statement); |
15044 } | 12179 } |
15045 | 12180 |
15046 /** | 12181 /** |
15047 * Set the expression used to determine whether to execute the body of the loo
p to the given | 12182 * Set the expression used to determine whether to execute the body of the loo
p to the given |
15048 * expression. | 12183 * expression. |
15049 * | 12184 * |
15050 * @param expression the expression used to determine whether to execute the b
ody of the loop | 12185 * @param expression the expression used to determine whether to execute the b
ody of the loop |
15051 */ | 12186 */ |
15052 void set condition(Expression expression) { | 12187 void set condition(Expression expression) { |
15053 _condition = becomeParentOf(expression); | 12188 _condition = becomeParentOf(expression); |
15054 } | 12189 } |
15055 | |
15056 /** | |
15057 * Set the token representing the 'while' keyword to the given token. | |
15058 * | |
15059 * @param keyword the token representing the 'while' keyword | |
15060 */ | |
15061 void set keyword(Token keyword2) { | |
15062 this._keyword = keyword2; | |
15063 } | |
15064 | |
15065 /** | |
15066 * Set the left parenthesis to the given token. | |
15067 * | |
15068 * @param leftParenthesis the left parenthesis | |
15069 */ | |
15070 void set leftParenthesis(Token leftParenthesis2) { | |
15071 this._leftParenthesis = leftParenthesis2; | |
15072 } | |
15073 | |
15074 /** | |
15075 * Set the right parenthesis to the given token. | |
15076 * | |
15077 * @param rightParenthesis the right parenthesis | |
15078 */ | |
15079 void set rightParenthesis(Token rightParenthesis2) { | |
15080 this._rightParenthesis = rightParenthesis2; | |
15081 } | |
15082 void visitChildren(ASTVisitor visitor) { | 12190 void visitChildren(ASTVisitor visitor) { |
15083 safelyVisitChild(_condition, visitor); | 12191 safelyVisitChild(_condition, visitor); |
15084 safelyVisitChild(_body, visitor); | 12192 safelyVisitChild(_body, visitor); |
15085 } | 12193 } |
15086 } | 12194 } |
15087 /** | 12195 /** |
15088 * Instances of the class `WithClause` represent the with clause in a class decl
aration. | 12196 * Instances of the class `WithClause` represent the with clause in a class decl
aration. |
15089 * | 12197 * |
15090 * <pre> | 12198 * <pre> |
15091 * withClause ::= | 12199 * withClause ::= |
15092 * 'with' [TypeName] (',' [TypeName])* | 12200 * 'with' [TypeName] (',' [TypeName])* |
15093 * </pre> | 12201 * </pre> |
15094 * | 12202 * |
15095 * @coverage dart.engine.ast | 12203 * @coverage dart.engine.ast |
15096 */ | 12204 */ |
15097 class WithClause extends ASTNode { | 12205 class WithClause extends ASTNode { |
15098 | 12206 |
15099 /** | 12207 /** |
15100 * The token representing the 'with' keyword. | 12208 * The token representing the 'with' keyword. |
15101 */ | 12209 */ |
15102 Token _withKeyword; | 12210 Token withKeyword; |
15103 | 12211 |
15104 /** | 12212 /** |
15105 * The names of the mixins that were specified. | 12213 * The names of the mixins that were specified. |
15106 */ | 12214 */ |
15107 NodeList<TypeName> _mixinTypes; | 12215 NodeList<TypeName> mixinTypes; |
15108 | 12216 |
15109 /** | 12217 /** |
15110 * Initialize a newly created with clause. | 12218 * Initialize a newly created with clause. |
15111 * | 12219 * |
15112 * @param withKeyword the token representing the 'with' keyword | 12220 * @param withKeyword the token representing the 'with' keyword |
15113 * @param mixinTypes the names of the mixins that were specified | 12221 * @param mixinTypes the names of the mixins that were specified |
15114 */ | 12222 */ |
15115 WithClause.full(Token withKeyword, List<TypeName> mixinTypes) { | 12223 WithClause.full(Token withKeyword, List<TypeName> mixinTypes) { |
15116 this._mixinTypes = new NodeList<TypeName>(this); | 12224 this.mixinTypes = new NodeList<TypeName>(this); |
15117 this._withKeyword = withKeyword; | 12225 this.withKeyword = withKeyword; |
15118 this._mixinTypes.addAll(mixinTypes); | 12226 this.mixinTypes.addAll(mixinTypes); |
15119 } | 12227 } |
15120 | 12228 |
15121 /** | 12229 /** |
15122 * Initialize a newly created with clause. | 12230 * Initialize a newly created with clause. |
15123 * | 12231 * |
15124 * @param withKeyword the token representing the 'with' keyword | 12232 * @param withKeyword the token representing the 'with' keyword |
15125 * @param mixinTypes the names of the mixins that were specified | 12233 * @param mixinTypes the names of the mixins that were specified |
15126 */ | 12234 */ |
15127 WithClause({Token withKeyword, List<TypeName> mixinTypes}) : this.full(withKey
word, mixinTypes); | 12235 WithClause({Token withKeyword, List<TypeName> mixinTypes}) : this.full(withKey
word, mixinTypes); |
15128 accept(ASTVisitor visitor) => visitor.visitWithClause(this); | 12236 accept(ASTVisitor visitor) => visitor.visitWithClause(this); |
15129 Token get beginToken => _withKeyword; | 12237 Token get beginToken => withKeyword; |
15130 Token get endToken => _mixinTypes.endToken; | 12238 Token get endToken => mixinTypes.endToken; |
15131 | |
15132 /** | |
15133 * Return the names of the mixins that were specified. | |
15134 * | |
15135 * @return the names of the mixins that were specified | |
15136 */ | |
15137 NodeList<TypeName> get mixinTypes => _mixinTypes; | |
15138 | |
15139 /** | |
15140 * Return the token representing the 'with' keyword. | |
15141 * | |
15142 * @return the token representing the 'with' keyword | |
15143 */ | |
15144 Token get withKeyword => _withKeyword; | |
15145 | 12239 |
15146 /** | 12240 /** |
15147 * Set the token representing the 'with' keyword to the given token. | 12241 * Set the token representing the 'with' keyword to the given token. |
15148 * | 12242 * |
15149 * @param withKeyword the token representing the 'with' keyword | 12243 * @param withKeyword the token representing the 'with' keyword |
15150 */ | 12244 */ |
15151 void set mixinKeyword(Token withKeyword2) { | 12245 void set mixinKeyword(Token withKeyword2) { |
15152 this._withKeyword = withKeyword2; | 12246 this.withKeyword = withKeyword2; |
15153 } | 12247 } |
15154 void visitChildren(ASTVisitor visitor) { | 12248 void visitChildren(ASTVisitor visitor) { |
15155 _mixinTypes.accept(visitor); | 12249 mixinTypes.accept(visitor); |
15156 } | 12250 } |
15157 } | 12251 } |
15158 /** | 12252 /** |
15159 * Instances of the class `BreadthFirstVisitor` implement an AST visitor that wi
ll recursively | 12253 * Instances of the class `BreadthFirstVisitor` implement an AST visitor that wi
ll recursively |
15160 * visit all of the nodes in an AST structure, similar to [GeneralizingASTVisito
r]. This | 12254 * visit all of the nodes in an AST structure, similar to [GeneralizingASTVisito
r]. This |
15161 * visitor uses a breadth-first ordering rather than the depth-first ordering of | 12255 * visitor uses a breadth-first ordering rather than the depth-first ordering of |
15162 * [GeneralizingASTVisitor]. | 12256 * [GeneralizingASTVisitor]. |
15163 * | 12257 * |
15164 * Subclasses that override a visit method must either invoke the overridden vis
it method or | 12258 * Subclasses that override a visit method must either invoke the overridden vis
it method or |
15165 * explicitly invoke the more general visit method. Failure to do so will cause
the visit methods | 12259 * explicitly invoke the more general visit method. Failure to do so will cause
the visit methods |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15755 | 12849 |
15756 /** | 12850 /** |
15757 * The end offset of the range used to identify the node. | 12851 * The end offset of the range used to identify the node. |
15758 */ | 12852 */ |
15759 int _endOffset = 0; | 12853 int _endOffset = 0; |
15760 | 12854 |
15761 /** | 12855 /** |
15762 * The element that was found that corresponds to the given source range, or `
null` if there | 12856 * The element that was found that corresponds to the given source range, or `
null` if there |
15763 * is no such element. | 12857 * is no such element. |
15764 */ | 12858 */ |
15765 ASTNode _foundNode; | 12859 ASTNode foundNode; |
15766 | 12860 |
15767 /** | 12861 /** |
15768 * Initialize a newly created locator to locate one or more [ASTNode] by locat
ing | 12862 * Initialize a newly created locator to locate one or more [ASTNode] by locat
ing |
15769 * the node within an AST structure that corresponds to the given offset in th
e source. | 12863 * the node within an AST structure that corresponds to the given offset in th
e source. |
15770 * | 12864 * |
15771 * @param offset the offset used to identify the node | 12865 * @param offset the offset used to identify the node |
15772 */ | 12866 */ |
15773 NodeLocator.con1(int offset) : this.con2(offset, offset); | 12867 NodeLocator.con1(int offset) : this.con2(offset, offset); |
15774 | 12868 |
15775 /** | 12869 /** |
15776 * Initialize a newly created locator to locate one or more [ASTNode] by locat
ing | 12870 * Initialize a newly created locator to locate one or more [ASTNode] by locat
ing |
15777 * the node within an AST structure that corresponds to the given range of cha
racters in the | 12871 * the node within an AST structure that corresponds to the given range of cha
racters in the |
15778 * source. | 12872 * source. |
15779 * | 12873 * |
15780 * @param start the start offset of the range used to identify the node | 12874 * @param start the start offset of the range used to identify the node |
15781 * @param end the end offset of the range used to identify the node | 12875 * @param end the end offset of the range used to identify the node |
15782 */ | 12876 */ |
15783 NodeLocator.con2(int start, int end) { | 12877 NodeLocator.con2(int start, int end) { |
15784 this._startOffset = start; | 12878 this._startOffset = start; |
15785 this._endOffset = end; | 12879 this._endOffset = end; |
15786 } | 12880 } |
15787 | 12881 |
15788 /** | 12882 /** |
15789 * Return the node that was found that corresponds to the given source range,
or `null` if | |
15790 * there is no such node. | |
15791 * | |
15792 * @return the node that was found | |
15793 */ | |
15794 ASTNode get foundNode => _foundNode; | |
15795 | |
15796 /** | |
15797 * Search within the given AST node for an identifier representing a [DartElem
ent] in the specified source range. Return the element that was found, or `null`
if | 12883 * Search within the given AST node for an identifier representing a [DartElem
ent] in the specified source range. Return the element that was found, or `null`
if |
15798 * no element was found. | 12884 * no element was found. |
15799 * | 12885 * |
15800 * @param node the AST node within which to search | 12886 * @param node the AST node within which to search |
15801 * @return the element that was found | 12887 * @return the element that was found |
15802 */ | 12888 */ |
15803 ASTNode searchWithin(ASTNode node) { | 12889 ASTNode searchWithin(ASTNode node) { |
15804 if (node == null) { | 12890 if (node == null) { |
15805 return null; | 12891 return null; |
15806 } | 12892 } |
15807 try { | 12893 try { |
15808 node.accept(this); | 12894 node.accept(this); |
15809 } on NodeLocator_NodeFoundException catch (exception) { | 12895 } on NodeLocator_NodeFoundException catch (exception) { |
15810 } catch (exception) { | 12896 } catch (exception) { |
15811 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a
t offset (${_startOffset} - ${_endOffset})", exception); | 12897 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a
t offset (${_startOffset} - ${_endOffset})", exception); |
15812 return null; | 12898 return null; |
15813 } | 12899 } |
15814 return _foundNode; | 12900 return foundNode; |
15815 } | 12901 } |
15816 Object visitNode(ASTNode node) { | 12902 Object visitNode(ASTNode node) { |
15817 int start = node.offset; | 12903 int start = node.offset; |
15818 int end = start + node.length; | 12904 int end = start + node.length; |
15819 if (end < _startOffset) { | 12905 if (end < _startOffset) { |
15820 return null; | 12906 return null; |
15821 } | 12907 } |
15822 if (start > _endOffset) { | 12908 if (start > _endOffset) { |
15823 return null; | 12909 return null; |
15824 } | 12910 } |
15825 try { | 12911 try { |
15826 node.visitChildren(this); | 12912 node.visitChildren(this); |
15827 } on NodeLocator_NodeFoundException catch (exception) { | 12913 } on NodeLocator_NodeFoundException catch (exception) { |
15828 throw exception; | 12914 throw exception; |
15829 } catch (exception) { | 12915 } catch (exception) { |
15830 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra
versing an AST structure.", exception); | 12916 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra
versing an AST structure.", exception); |
15831 } | 12917 } |
15832 if (start <= _startOffset && _endOffset <= end) { | 12918 if (start <= _startOffset && _endOffset <= end) { |
15833 _foundNode = node; | 12919 foundNode = node; |
15834 throw new NodeLocator_NodeFoundException(); | 12920 throw new NodeLocator_NodeFoundException(); |
15835 } | 12921 } |
15836 return null; | 12922 return null; |
15837 } | 12923 } |
15838 } | 12924 } |
15839 /** | 12925 /** |
15840 * Instances of the class `NodeFoundException` are used to cancel visiting after
a node has | 12926 * Instances of the class `NodeFoundException` are used to cancel visiting after
a node has |
15841 * been found. | 12927 * been found. |
15842 */ | 12928 */ |
15843 class NodeLocator_NodeFoundException extends RuntimeException { | 12929 class NodeLocator_NodeFoundException extends RuntimeException { |
(...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17390 * Traverse the AST from initial child node to successive parents, building a co
llection of local | 14476 * Traverse the AST from initial child node to successive parents, building a co
llection of local |
17391 * variable and parameter names visible to the initial child node. In case of na
me shadowing, the | 14477 * variable and parameter names visible to the initial child node. In case of na
me shadowing, the |
17392 * first name seen is the most specific one so names are not redefined. | 14478 * first name seen is the most specific one so names are not redefined. |
17393 * | 14479 * |
17394 * Completion test code coverage is 95%. The two basic blocks that are not execu
ted cannot be | 14480 * Completion test code coverage is 95%. The two basic blocks that are not execu
ted cannot be |
17395 * executed. They are included for future reference. | 14481 * executed. They are included for future reference. |
17396 * | 14482 * |
17397 * @coverage com.google.dart.engine.services.completion | 14483 * @coverage com.google.dart.engine.services.completion |
17398 */ | 14484 */ |
17399 class ScopedNameFinder extends GeneralizingASTVisitor<Object> { | 14485 class ScopedNameFinder extends GeneralizingASTVisitor<Object> { |
17400 Declaration _declarationNode; | 14486 Declaration declaration; |
17401 ASTNode _immediateChild; | 14487 ASTNode _immediateChild; |
17402 Map<String, SimpleIdentifier> _locals = new Map<String, SimpleIdentifier>(); | 14488 final Map<String, SimpleIdentifier> locals = new Map<String, SimpleIdentifier>
(); |
17403 int _position = 0; | 14489 int _position = 0; |
17404 bool _referenceIsWithinLocalFunction = false; | 14490 bool _referenceIsWithinLocalFunction = false; |
17405 ScopedNameFinder(int position) { | 14491 ScopedNameFinder(int position) { |
17406 this._position = position; | 14492 this._position = position; |
17407 } | 14493 } |
17408 Declaration get declaration => _declarationNode; | |
17409 Map<String, SimpleIdentifier> get locals => _locals; | |
17410 Object visitBlock(Block node) { | 14494 Object visitBlock(Block node) { |
17411 checkStatements(node.statements); | 14495 checkStatements(node.statements); |
17412 return super.visitBlock(node); | 14496 return super.visitBlock(node); |
17413 } | 14497 } |
17414 Object visitCatchClause(CatchClause node) { | 14498 Object visitCatchClause(CatchClause node) { |
17415 addToScope(node.exceptionParameter); | 14499 addToScope(node.exceptionParameter); |
17416 addToScope(node.stackTraceParameter); | 14500 addToScope(node.stackTraceParameter); |
17417 return super.visitCatchClause(node); | 14501 return super.visitCatchClause(node); |
17418 } | 14502 } |
17419 Object visitConstructorDeclaration(ConstructorDeclaration node) { | 14503 Object visitConstructorDeclaration(ConstructorDeclaration node) { |
17420 if (_immediateChild != node.parameters) { | 14504 if (_immediateChild != node.parameters) { |
17421 addParameters(node.parameters.parameters); | 14505 addParameters(node.parameters.parameters); |
17422 } | 14506 } |
17423 _declarationNode = node; | 14507 declaration = node; |
17424 return null; | 14508 return null; |
17425 } | 14509 } |
17426 Object visitFieldDeclaration(FieldDeclaration node) { | 14510 Object visitFieldDeclaration(FieldDeclaration node) { |
17427 _declarationNode = node; | 14511 declaration = node; |
17428 return null; | 14512 return null; |
17429 } | 14513 } |
17430 Object visitForEachStatement(ForEachStatement node) { | 14514 Object visitForEachStatement(ForEachStatement node) { |
17431 addToScope(node.loopVariable.identifier); | 14515 addToScope(node.loopVariable.identifier); |
17432 return super.visitForEachStatement(node); | 14516 return super.visitForEachStatement(node); |
17433 } | 14517 } |
17434 Object visitForStatement(ForStatement node) { | 14518 Object visitForStatement(ForStatement node) { |
17435 if (_immediateChild != node.variables && node.variables != null) { | 14519 if (_immediateChild != node.variables && node.variables != null) { |
17436 addVariables(node.variables.variables); | 14520 addVariables(node.variables.variables); |
17437 } | 14521 } |
17438 return super.visitForStatement(node); | 14522 return super.visitForStatement(node); |
17439 } | 14523 } |
17440 Object visitFunctionDeclaration(FunctionDeclaration node) { | 14524 Object visitFunctionDeclaration(FunctionDeclaration node) { |
17441 if (node.parent is! FunctionDeclarationStatement) { | 14525 if (node.parent is! FunctionDeclarationStatement) { |
17442 _declarationNode = node; | 14526 declaration = node; |
17443 return null; | 14527 return null; |
17444 } | 14528 } |
17445 return super.visitFunctionDeclaration(node); | 14529 return super.visitFunctionDeclaration(node); |
17446 } | 14530 } |
17447 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { | 14531 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { |
17448 _referenceIsWithinLocalFunction = true; | 14532 _referenceIsWithinLocalFunction = true; |
17449 return super.visitFunctionDeclarationStatement(node); | 14533 return super.visitFunctionDeclarationStatement(node); |
17450 } | 14534 } |
17451 Object visitFunctionExpression(FunctionExpression node) { | 14535 Object visitFunctionExpression(FunctionExpression node) { |
17452 if (node.parameters != null && _immediateChild != node.parameters) { | 14536 if (node.parameters != null && _immediateChild != node.parameters) { |
17453 addParameters(node.parameters.parameters); | 14537 addParameters(node.parameters.parameters); |
17454 } | 14538 } |
17455 return super.visitFunctionExpression(node); | 14539 return super.visitFunctionExpression(node); |
17456 } | 14540 } |
17457 Object visitMethodDeclaration(MethodDeclaration node) { | 14541 Object visitMethodDeclaration(MethodDeclaration node) { |
17458 if (node.parameters == null) { | 14542 if (node.parameters == null) { |
17459 return null; | 14543 return null; |
17460 } | 14544 } |
17461 if (_immediateChild != node.parameters) { | 14545 if (_immediateChild != node.parameters) { |
17462 addParameters(node.parameters.parameters); | 14546 addParameters(node.parameters.parameters); |
17463 } | 14547 } |
17464 _declarationNode = node; | 14548 declaration = node; |
17465 return null; | 14549 return null; |
17466 } | 14550 } |
17467 Object visitNode(ASTNode node) { | 14551 Object visitNode(ASTNode node) { |
17468 _immediateChild = node; | 14552 _immediateChild = node; |
17469 ASTNode parent = node.parent; | 14553 ASTNode parent = node.parent; |
17470 if (parent != null) { | 14554 if (parent != null) { |
17471 parent.accept(this); | 14555 parent.accept(this); |
17472 } | 14556 } |
17473 return null; | 14557 return null; |
17474 } | 14558 } |
17475 Object visitSwitchMember(SwitchMember node) { | 14559 Object visitSwitchMember(SwitchMember node) { |
17476 checkStatements(node.statements); | 14560 checkStatements(node.statements); |
17477 return super.visitSwitchMember(node); | 14561 return super.visitSwitchMember(node); |
17478 } | 14562 } |
17479 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { | 14563 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { |
17480 _declarationNode = node; | 14564 declaration = node; |
17481 return null; | 14565 return null; |
17482 } | 14566 } |
17483 Object visitTypeAlias(TypeAlias node) { | 14567 Object visitTypeAlias(TypeAlias node) { |
17484 _declarationNode = node; | 14568 declaration = node; |
17485 return null; | 14569 return null; |
17486 } | 14570 } |
17487 void addParameters(NodeList<FormalParameter> vars) { | 14571 void addParameters(NodeList<FormalParameter> vars) { |
17488 for (FormalParameter var2 in vars) { | 14572 for (FormalParameter var2 in vars) { |
17489 addToScope(var2.identifier); | 14573 addToScope(var2.identifier); |
17490 } | 14574 } |
17491 } | 14575 } |
17492 void addToScope(SimpleIdentifier identifier) { | 14576 void addToScope(SimpleIdentifier identifier) { |
17493 if (identifier != null && isInRange(identifier)) { | 14577 if (identifier != null && isInRange(identifier)) { |
17494 String name = identifier.name; | 14578 String name = identifier.name; |
17495 if (!_locals.containsKey(name)) { | 14579 if (!locals.containsKey(name)) { |
17496 _locals[name] = identifier; | 14580 locals[name] = identifier; |
17497 } | 14581 } |
17498 } | 14582 } |
17499 } | 14583 } |
17500 void addVariables(NodeList<VariableDeclaration> vars) { | 14584 void addVariables(NodeList<VariableDeclaration> vars) { |
17501 for (VariableDeclaration var2 in vars) { | 14585 for (VariableDeclaration var2 in vars) { |
17502 addToScope(var2.name); | 14586 addToScope(var2.name); |
17503 } | 14587 } |
17504 } | 14588 } |
17505 | 14589 |
17506 /** | 14590 /** |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17587 return elements[elements.length - 1].endToken; | 14671 return elements[elements.length - 1].endToken; |
17588 } | 14672 } |
17589 /** | 14673 /** |
17590 * Return the node that is the parent of each of the elements in the list. | 14674 * Return the node that is the parent of each of the elements in the list. |
17591 * @return the node that is the parent of each of the elements in the list | 14675 * @return the node that is the parent of each of the elements in the list |
17592 */ | 14676 */ |
17593 ASTNode getOwner() { | 14677 ASTNode getOwner() { |
17594 return owner; | 14678 return owner; |
17595 } | 14679 } |
17596 } | 14680 } |
OLD | NEW |