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

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

Issue 109853003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 3
4 library engine.ast; 4 library engine.ast;
5 5
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'java_core.dart'; 7 import 'java_core.dart';
8 import 'java_engine.dart'; 8 import 'java_engine.dart';
9 import 'source.dart' show LineInfo; 9 import 'source.dart' show LineInfo;
10 import 'scanner.dart'; 10 import 'scanner.dart';
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 * adjacentStrings ::= 478 * adjacentStrings ::=
479 * [StringLiteral] [StringLiteral]+ 479 * [StringLiteral] [StringLiteral]+
480 * </pre> 480 * </pre>
481 * 481 *
482 * @coverage dart.engine.ast 482 * @coverage dart.engine.ast
483 */ 483 */
484 class AdjacentStrings extends StringLiteral { 484 class AdjacentStrings extends StringLiteral {
485 /** 485 /**
486 * The strings that are implicitly concatenated. 486 * The strings that are implicitly concatenated.
487 */ 487 */
488 NodeList<StringLiteral> strings; 488 NodeList<StringLiteral> _strings;
489 489
490 /** 490 /**
491 * Initialize a newly created list of adjacent strings. 491 * Initialize a newly created list of adjacent strings.
492 * 492 *
493 * @param strings the strings that are implicitly concatenated 493 * @param strings the strings that are implicitly concatenated
494 */ 494 */
495 AdjacentStrings.full(List<StringLiteral> strings) { 495 AdjacentStrings(List<StringLiteral> strings) {
496 this.strings = new NodeList<StringLiteral>(this); 496 this._strings = new NodeList<StringLiteral>(this);
497 this.strings.addAll(strings); 497 this._strings.addAll(strings);
498 } 498 }
499 499
500 /**
501 * Initialize a newly created list of adjacent strings.
502 *
503 * @param strings the strings that are implicitly concatenated
504 */
505 AdjacentStrings({List<StringLiteral> strings}) : this.full(strings);
506
507 accept(ASTVisitor visitor) => visitor.visitAdjacentStrings(this); 500 accept(ASTVisitor visitor) => visitor.visitAdjacentStrings(this);
508 501
509 Token get beginToken => strings.beginToken; 502 Token get beginToken => _strings.beginToken;
510 503
511 Token get endToken => strings.endToken; 504 Token get endToken => _strings.endToken;
505
506 /**
507 * Return the strings that are implicitly concatenated.
508 *
509 * @return the strings that are implicitly concatenated
510 */
511 NodeList<StringLiteral> get strings => _strings;
512 512
513 void visitChildren(ASTVisitor visitor) { 513 void visitChildren(ASTVisitor visitor) {
514 strings.accept(visitor); 514 _strings.accept(visitor);
515 } 515 }
516 516
517 void appendStringValue(JavaStringBuilder builder) { 517 void appendStringValue(JavaStringBuilder builder) {
518 for (StringLiteral stringLiteral in strings) { 518 for (StringLiteral stringLiteral in strings) {
519 stringLiteral.appendStringValue(builder); 519 stringLiteral.appendStringValue(builder);
520 } 520 }
521 } 521 }
522 } 522 }
523 523
524 /** 524 /**
(...skipping 13 matching lines...) Expand all
538 * The annotations associated with this node. 538 * The annotations associated with this node.
539 */ 539 */
540 NodeList<Annotation> _metadata; 540 NodeList<Annotation> _metadata;
541 541
542 /** 542 /**
543 * Initialize a newly created node. 543 * Initialize a newly created node.
544 * 544 *
545 * @param comment the documentation comment associated with this node 545 * @param comment the documentation comment associated with this node
546 * @param metadata the annotations associated with this node 546 * @param metadata the annotations associated with this node
547 */ 547 */
548 AnnotatedNode.full(Comment comment, List<Annotation> metadata) { 548 AnnotatedNode(Comment comment, List<Annotation> metadata) {
549 this._metadata = new NodeList<Annotation>(this); 549 this._metadata = new NodeList<Annotation>(this);
550 this._comment = becomeParentOf(comment); 550 this._comment = becomeParentOf(comment);
551 this._metadata.addAll(metadata); 551 this._metadata.addAll(metadata);
552 } 552 }
553 553
554 /**
555 * Initialize a newly created node.
556 *
557 * @param comment the documentation comment associated with this node
558 * @param metadata the annotations associated with this node
559 */
560 AnnotatedNode({Comment comment, List<Annotation> metadata}) : this.full(commen t, metadata);
561
562 Token get beginToken { 554 Token get beginToken {
563 if (_comment == null) { 555 if (_comment == null) {
564 if (_metadata.isEmpty) { 556 if (_metadata.isEmpty) {
565 return firstTokenAfterCommentAndMetadata; 557 return firstTokenAfterCommentAndMetadata;
566 } else { 558 } else {
567 return _metadata.beginToken; 559 return _metadata.beginToken;
568 } 560 }
569 } else if (_metadata.isEmpty) { 561 } else if (_metadata.isEmpty) {
570 return _comment.beginToken; 562 return _comment.beginToken;
571 } 563 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 * @param atSign the at sign that introduced the annotation 707 * @param atSign the at sign that introduced the annotation
716 * @param name the name of the class defining the constructor that is being in voked or the name of 708 * @param name the name of the class defining the constructor that is being in voked or the name of
717 * the field that is being referenced 709 * the field that is being referenced
718 * @param period the period before the constructor name, or `null` if this ann otation is not 710 * @param period the period before the constructor name, or `null` if this ann otation is not
719 * the invocation of a named constructor 711 * the invocation of a named constructor
720 * @param constructorName the name of the constructor being invoked, or `null` if this 712 * @param constructorName the name of the constructor being invoked, or `null` if this
721 * annotation is not the invocation of a named constructor 713 * annotation is not the invocation of a named constructor
722 * @param arguments the arguments to the constructor being invoked, or `null` if this 714 * @param arguments the arguments to the constructor being invoked, or `null` if this
723 * annotation is not the invocation of a constructor 715 * annotation is not the invocation of a constructor
724 */ 716 */
725 Annotation.full(Token atSign, Identifier name, Token period, SimpleIdentifier constructorName, ArgumentList arguments) { 717 Annotation(this.atSign, Identifier name, this.period, SimpleIdentifier constru ctorName, ArgumentList arguments) {
726 this.atSign = atSign;
727 this._name = becomeParentOf(name); 718 this._name = becomeParentOf(name);
728 this.period = period;
729 this._constructorName = becomeParentOf(constructorName); 719 this._constructorName = becomeParentOf(constructorName);
730 this._arguments = becomeParentOf(arguments); 720 this._arguments = becomeParentOf(arguments);
731 } 721 }
732 722
733 /**
734 * Initialize a newly created annotation.
735 *
736 * @param atSign the at sign that introduced the annotation
737 * @param name the name of the class defining the constructor that is being in voked or the name of
738 * the field that is being referenced
739 * @param period the period before the constructor name, or `null` if this ann otation is not
740 * the invocation of a named constructor
741 * @param constructorName the name of the constructor being invoked, or `null` if this
742 * annotation is not the invocation of a named constructor
743 * @param arguments the arguments to the constructor being invoked, or `null` if this
744 * annotation is not the invocation of a constructor
745 */
746 Annotation({Token atSign, Identifier name, Token period, SimpleIdentifier cons tructorName, ArgumentList arguments}) : this.full(atSign, name, period, construc torName, arguments);
747
748 accept(ASTVisitor visitor) => visitor.visitAnnotation(this); 723 accept(ASTVisitor visitor) => visitor.visitAnnotation(this);
749 724
750 /** 725 /**
751 * Return the arguments to the constructor being invoked, or `null` if this an notation is 726 * Return the arguments to the constructor being invoked, or `null` if this an notation is
752 * not the invocation of a constructor. 727 * not the invocation of a constructor.
753 * 728 *
754 * @return the arguments to the constructor being invoked 729 * @return the arguments to the constructor being invoked
755 */ 730 */
756 ArgumentList get arguments => _arguments; 731 ArgumentList get arguments => _arguments;
757 732
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 * The identifier representing the argument being tested. 837 * The identifier representing the argument being tested.
863 */ 838 */
864 SimpleIdentifier _identifier; 839 SimpleIdentifier _identifier;
865 840
866 /** 841 /**
867 * Initialize a newly created argument definition test. 842 * Initialize a newly created argument definition test.
868 * 843 *
869 * @param question the token representing the question mark 844 * @param question the token representing the question mark
870 * @param identifier the identifier representing the argument being tested 845 * @param identifier the identifier representing the argument being tested
871 */ 846 */
872 ArgumentDefinitionTest.full(Token question, SimpleIdentifier identifier) { 847 ArgumentDefinitionTest(this.question, SimpleIdentifier identifier) {
873 this.question = question;
874 this._identifier = becomeParentOf(identifier); 848 this._identifier = becomeParentOf(identifier);
875 } 849 }
876 850
877 /**
878 * Initialize a newly created argument definition test.
879 *
880 * @param question the token representing the question mark
881 * @param identifier the identifier representing the argument being tested
882 */
883 ArgumentDefinitionTest({Token question, SimpleIdentifier identifier}) : this.f ull(question, identifier);
884
885 accept(ASTVisitor visitor) => visitor.visitArgumentDefinitionTest(this); 851 accept(ASTVisitor visitor) => visitor.visitArgumentDefinitionTest(this);
886 852
887 Token get beginToken => question; 853 Token get beginToken => question;
888 854
889 Token get endToken => _identifier.endToken; 855 Token get endToken => _identifier.endToken;
890 856
891 /** 857 /**
892 * Return the identifier representing the argument being tested. 858 * Return the identifier representing the argument being tested.
893 * 859 *
894 * @return the identifier representing the argument being tested 860 * @return the identifier representing the argument being tested
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 */ 894 */
929 class ArgumentList extends ASTNode { 895 class ArgumentList extends ASTNode {
930 /** 896 /**
931 * The left parenthesis. 897 * The left parenthesis.
932 */ 898 */
933 Token _leftParenthesis; 899 Token _leftParenthesis;
934 900
935 /** 901 /**
936 * The expressions producing the values of the arguments. 902 * The expressions producing the values of the arguments.
937 */ 903 */
938 NodeList<Expression> arguments; 904 NodeList<Expression> _arguments;
939 905
940 /** 906 /**
941 * The right parenthesis. 907 * The right parenthesis.
942 */ 908 */
943 Token _rightParenthesis; 909 Token _rightParenthesis;
944 910
945 /** 911 /**
946 * An array containing the elements representing the parameters corresponding to each of the 912 * An array containing the elements representing the parameters corresponding to each of the
947 * arguments in this list, or `null` if the AST has not been resolved or if th e function or 913 * arguments in this list, or `null` if the AST has not been resolved or if th e function or
948 * method being invoked could not be determined based on static type informati on. The array must 914 * method being invoked could not be determined based on static type informati on. The array must
(...skipping 11 matching lines...) Expand all
960 */ 926 */
961 List<ParameterElement> _correspondingPropagatedParameters; 927 List<ParameterElement> _correspondingPropagatedParameters;
962 928
963 /** 929 /**
964 * Initialize a newly created list of arguments. 930 * Initialize a newly created list of arguments.
965 * 931 *
966 * @param leftParenthesis the left parenthesis 932 * @param leftParenthesis the left parenthesis
967 * @param arguments the expressions producing the values of the arguments 933 * @param arguments the expressions producing the values of the arguments
968 * @param rightParenthesis the right parenthesis 934 * @param rightParenthesis the right parenthesis
969 */ 935 */
970 ArgumentList.full(Token leftParenthesis, List<Expression> arguments, Token rig htParenthesis) { 936 ArgumentList(Token leftParenthesis, List<Expression> arguments, Token rightPar enthesis) {
971 this.arguments = new NodeList<Expression>(this); 937 this._arguments = new NodeList<Expression>(this);
972 this._leftParenthesis = leftParenthesis; 938 this._leftParenthesis = leftParenthesis;
973 this.arguments.addAll(arguments); 939 this._arguments.addAll(arguments);
974 this._rightParenthesis = rightParenthesis; 940 this._rightParenthesis = rightParenthesis;
975 } 941 }
976 942
943 accept(ASTVisitor visitor) => visitor.visitArgumentList(this);
944
977 /** 945 /**
978 * Initialize a newly created list of arguments. 946 * Return the expressions producing the values of the arguments. Although the language requires
947 * that positional arguments appear before named arguments, this class allows them to be
948 * intermixed.
979 * 949 *
980 * @param leftParenthesis the left parenthesis 950 * @return the expressions producing the values of the arguments
981 * @param arguments the expressions producing the values of the arguments
982 * @param rightParenthesis the right parenthesis
983 */ 951 */
984 ArgumentList({Token leftParenthesis, List<Expression> arguments, Token rightPa renthesis}) : this.full(leftParenthesis, arguments, rightParenthesis); 952 NodeList<Expression> get arguments => _arguments;
985
986 accept(ASTVisitor visitor) => visitor.visitArgumentList(this);
987 953
988 Token get beginToken => _leftParenthesis; 954 Token get beginToken => _leftParenthesis;
989 955
990 Token get endToken => _rightParenthesis; 956 Token get endToken => _rightParenthesis;
991 957
992 /** 958 /**
993 * Return the left parenthesis. 959 * Return the left parenthesis.
994 * 960 *
995 * @return the left parenthesis 961 * @return the left parenthesis
996 */ 962 */
997 Token get leftParenthesis => _leftParenthesis; 963 Token get leftParenthesis => _leftParenthesis;
998 964
999 /** 965 /**
1000 * Return the right parenthesis. 966 * Return the right parenthesis.
1001 * 967 *
1002 * @return the right parenthesis 968 * @return the right parenthesis
1003 */ 969 */
1004 Token get rightParenthesis => _rightParenthesis; 970 Token get rightParenthesis => _rightParenthesis;
1005 971
1006 /** 972 /**
1007 * Set the parameter elements corresponding to each of the arguments in this l ist to the given 973 * Set the parameter elements corresponding to each of the arguments in this l ist to the given
1008 * array of parameters. The array of parameters must be the same length as the number of 974 * array of parameters. The array of parameters must be the same length as the number of
1009 * arguments, but can contain `null` entries if a given argument does not corr espond to a 975 * arguments, but can contain `null` entries if a given argument does not corr espond to a
1010 * formal parameter. 976 * formal parameter.
1011 * 977 *
1012 * @param parameters the parameter elements corresponding to the arguments 978 * @param parameters the parameter elements corresponding to the arguments
1013 */ 979 */
1014 void set correspondingPropagatedParameters(List<ParameterElement> parameters) { 980 void set correspondingPropagatedParameters(List<ParameterElement> parameters) {
1015 if (parameters.length != arguments.length) { 981 if (parameters.length != _arguments.length) {
1016 throw new IllegalArgumentException("Expected ${arguments.length} parameter s, not ${parameters.length}"); 982 throw new IllegalArgumentException("Expected ${_arguments.length} paramete rs, not ${parameters.length}");
1017 } 983 }
1018 _correspondingPropagatedParameters = parameters; 984 _correspondingPropagatedParameters = parameters;
1019 } 985 }
1020 986
1021 /** 987 /**
1022 * Set the parameter elements corresponding to each of the arguments in this l ist to the given 988 * Set the parameter elements corresponding to each of the arguments in this l ist to the given
1023 * array of parameters. The array of parameters must be the same length as the number of 989 * array of parameters. The array of parameters must be the same length as the number of
1024 * arguments, but can contain `null` entries if a given argument does not corr espond to a 990 * arguments, but can contain `null` entries if a given argument does not corr espond to a
1025 * formal parameter. 991 * formal parameter.
1026 * 992 *
1027 * @param parameters the parameter elements corresponding to the arguments 993 * @param parameters the parameter elements corresponding to the arguments
1028 */ 994 */
1029 void set correspondingStaticParameters(List<ParameterElement> parameters) { 995 void set correspondingStaticParameters(List<ParameterElement> parameters) {
1030 if (parameters.length != arguments.length) { 996 if (parameters.length != _arguments.length) {
1031 throw new IllegalArgumentException("Expected ${arguments.length} parameter s, not ${parameters.length}"); 997 throw new IllegalArgumentException("Expected ${_arguments.length} paramete rs, not ${parameters.length}");
1032 } 998 }
1033 _correspondingStaticParameters = parameters; 999 _correspondingStaticParameters = parameters;
1034 } 1000 }
1035 1001
1036 /** 1002 /**
1037 * Set the left parenthesis to the given token. 1003 * Set the left parenthesis to the given token.
1038 * 1004 *
1039 * @param parenthesis the left parenthesis 1005 * @param parenthesis the left parenthesis
1040 */ 1006 */
1041 void set leftParenthesis(Token parenthesis) { 1007 void set leftParenthesis(Token parenthesis) {
1042 _leftParenthesis = parenthesis; 1008 _leftParenthesis = parenthesis;
1043 } 1009 }
1044 1010
1045 /** 1011 /**
1046 * Set the right parenthesis to the given token. 1012 * Set the right parenthesis to the given token.
1047 * 1013 *
1048 * @param parenthesis the right parenthesis 1014 * @param parenthesis the right parenthesis
1049 */ 1015 */
1050 void set rightParenthesis(Token parenthesis) { 1016 void set rightParenthesis(Token parenthesis) {
1051 _rightParenthesis = parenthesis; 1017 _rightParenthesis = parenthesis;
1052 } 1018 }
1053 1019
1054 void visitChildren(ASTVisitor visitor) { 1020 void visitChildren(ASTVisitor visitor) {
1055 arguments.accept(visitor); 1021 _arguments.accept(visitor);
1056 } 1022 }
1057 1023
1058 /** 1024 /**
1059 * If the given expression is a child of this list, and the AST structure has been resolved, and 1025 * If the given expression is a child of this list, and the AST structure has been resolved, and
1060 * the function being invoked is known based on propagated type information, a nd the expression 1026 * the function being invoked is known based on propagated type information, a nd the expression
1061 * corresponds to one of the parameters of the function being invoked, then re turn the parameter 1027 * corresponds to one of the parameters of the function being invoked, then re turn the parameter
1062 * element representing the parameter to which the value of the given expressi on will be bound. 1028 * element representing the parameter to which the value of the given expressi on will be bound.
1063 * Otherwise, return `null`. 1029 * Otherwise, return `null`.
1064 * 1030 *
1065 * This method is only intended to be used by [Expression#getPropagatedParamet erElement]. 1031 * This method is only intended to be used by [Expression#getPropagatedParamet erElement].
1066 * 1032 *
1067 * @param expression the expression corresponding to the parameter to be retur ned 1033 * @param expression the expression corresponding to the parameter to be retur ned
1068 * @return the parameter element representing the parameter to which the value of the expression 1034 * @return the parameter element representing the parameter to which the value of the expression
1069 * will be bound 1035 * will be bound
1070 */ 1036 */
1071 ParameterElement getPropagatedParameterElementFor(Expression expression) { 1037 ParameterElement getPropagatedParameterElementFor(Expression expression) {
1072 if (_correspondingPropagatedParameters == null) { 1038 if (_correspondingPropagatedParameters == null) {
1073 return null; 1039 return null;
1074 } 1040 }
1075 int index = arguments.indexOf(expression); 1041 int index = _arguments.indexOf(expression);
1076 if (index < 0) { 1042 if (index < 0) {
1077 return null; 1043 return null;
1078 } 1044 }
1079 return _correspondingPropagatedParameters[index]; 1045 return _correspondingPropagatedParameters[index];
1080 } 1046 }
1081 1047
1082 /** 1048 /**
1083 * If the given expression is a child of this list, and the AST structure has been resolved, and 1049 * If the given expression is a child of this list, and the AST structure has been resolved, and
1084 * the function being invoked is known based on static type information, and t he expression 1050 * the function being invoked is known based on static type information, and t he expression
1085 * corresponds to one of the parameters of the function being invoked, then re turn the parameter 1051 * corresponds to one of the parameters of the function being invoked, then re turn the parameter
1086 * element representing the parameter to which the value of the given expressi on will be bound. 1052 * element representing the parameter to which the value of the given expressi on will be bound.
1087 * Otherwise, return `null`. 1053 * Otherwise, return `null`.
1088 * 1054 *
1089 * This method is only intended to be used by [Expression#getStaticParameterEl ement]. 1055 * This method is only intended to be used by [Expression#getStaticParameterEl ement].
1090 * 1056 *
1091 * @param expression the expression corresponding to the parameter to be retur ned 1057 * @param expression the expression corresponding to the parameter to be retur ned
1092 * @return the parameter element representing the parameter to which the value of the expression 1058 * @return the parameter element representing the parameter to which the value of the expression
1093 * will be bound 1059 * will be bound
1094 */ 1060 */
1095 ParameterElement getStaticParameterElementFor(Expression expression) { 1061 ParameterElement getStaticParameterElementFor(Expression expression) {
1096 if (_correspondingStaticParameters == null) { 1062 if (_correspondingStaticParameters == null) {
1097 return null; 1063 return null;
1098 } 1064 }
1099 int index = arguments.indexOf(expression); 1065 int index = _arguments.indexOf(expression);
1100 if (index < 0) { 1066 if (index < 0) {
1101 return null; 1067 return null;
1102 } 1068 }
1103 return _correspondingStaticParameters[index]; 1069 return _correspondingStaticParameters[index];
1104 } 1070 }
1105 } 1071 }
1106 1072
1107 /** 1073 /**
1108 * Instances of the class `AsExpression` represent an 'as' expression. 1074 * Instances of the class `AsExpression` represent an 'as' expression.
1109 * 1075 *
(...skipping 20 matching lines...) Expand all
1130 */ 1096 */
1131 TypeName _type; 1097 TypeName _type;
1132 1098
1133 /** 1099 /**
1134 * Initialize a newly created as expression. 1100 * Initialize a newly created as expression.
1135 * 1101 *
1136 * @param expression the expression used to compute the value being cast 1102 * @param expression the expression used to compute the value being cast
1137 * @param isOperator the is operator 1103 * @param isOperator the is operator
1138 * @param type the name of the type being cast to 1104 * @param type the name of the type being cast to
1139 */ 1105 */
1140 AsExpression.full(Expression expression, Token isOperator, TypeName type) { 1106 AsExpression(Expression expression, Token isOperator, TypeName type) {
1141 this._expression = becomeParentOf(expression); 1107 this._expression = becomeParentOf(expression);
1142 this.asOperator = isOperator; 1108 this.asOperator = isOperator;
1143 this._type = becomeParentOf(type); 1109 this._type = becomeParentOf(type);
1144 } 1110 }
1145 1111
1146 /**
1147 * Initialize a newly created as expression.
1148 *
1149 * @param expression the expression used to compute the value being cast
1150 * @param isOperator the is operator
1151 * @param type the name of the type being cast to
1152 */
1153 AsExpression({Expression expression, Token isOperator, TypeName type}) : this. full(expression, isOperator, type);
1154
1155 accept(ASTVisitor visitor) => visitor.visitAsExpression(this); 1112 accept(ASTVisitor visitor) => visitor.visitAsExpression(this);
1156 1113
1157 Token get beginToken => _expression.beginToken; 1114 Token get beginToken => _expression.beginToken;
1158 1115
1159 Token get endToken => _type.endToken; 1116 Token get endToken => _type.endToken;
1160 1117
1161 /** 1118 /**
1162 * Return the expression used to compute the value being cast. 1119 * Return the expression used to compute the value being cast.
1163 * 1120 *
1164 * @return the expression used to compute the value being cast 1121 * @return the expression used to compute the value being cast
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 1193
1237 /** 1194 /**
1238 * Initialize a newly created assert statement. 1195 * Initialize a newly created assert statement.
1239 * 1196 *
1240 * @param keyword the token representing the 'assert' keyword 1197 * @param keyword the token representing the 'assert' keyword
1241 * @param leftParenthesis the left parenthesis 1198 * @param leftParenthesis the left parenthesis
1242 * @param condition the condition that is being asserted to be `true` 1199 * @param condition the condition that is being asserted to be `true`
1243 * @param rightParenthesis the right parenthesis 1200 * @param rightParenthesis the right parenthesis
1244 * @param semicolon the semicolon terminating the statement 1201 * @param semicolon the semicolon terminating the statement
1245 */ 1202 */
1246 AssertStatement.full(Token keyword, Token leftParenthesis, Expression conditio n, Token rightParenthesis, Token semicolon) { 1203 AssertStatement(this.keyword, this.leftParenthesis, Expression condition, this .rightParenthesis, this.semicolon) {
1247 this.keyword = keyword;
1248 this.leftParenthesis = leftParenthesis;
1249 this._condition = becomeParentOf(condition); 1204 this._condition = becomeParentOf(condition);
1250 this.rightParenthesis = rightParenthesis;
1251 this.semicolon = semicolon;
1252 } 1205 }
1253 1206
1254 /**
1255 * Initialize a newly created assert statement.
1256 *
1257 * @param keyword the token representing the 'assert' keyword
1258 * @param leftParenthesis the left parenthesis
1259 * @param condition the condition that is being asserted to be `true`
1260 * @param rightParenthesis the right parenthesis
1261 * @param semicolon the semicolon terminating the statement
1262 */
1263 AssertStatement({Token keyword, Token leftParenthesis, Expression condition, T oken rightParenthesis, Token semicolon}) : this.full(keyword, leftParenthesis, c ondition, rightParenthesis, semicolon);
1264
1265 accept(ASTVisitor visitor) => visitor.visitAssertStatement(this); 1207 accept(ASTVisitor visitor) => visitor.visitAssertStatement(this);
1266 1208
1267 Token get beginToken => keyword; 1209 Token get beginToken => keyword;
1268 1210
1269 /** 1211 /**
1270 * Return the condition that is being asserted to be `true`. 1212 * Return the condition that is being asserted to be `true`.
1271 * 1213 *
1272 * @return the condition that is being asserted to be `true` 1214 * @return the condition that is being asserted to be `true`
1273 */ 1215 */
1274 Expression get condition => _condition; 1216 Expression get condition => _condition;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 */ 1271 */
1330 MethodElement _propagatedElement; 1272 MethodElement _propagatedElement;
1331 1273
1332 /** 1274 /**
1333 * Initialize a newly created assignment expression. 1275 * Initialize a newly created assignment expression.
1334 * 1276 *
1335 * @param leftHandSide the expression used to compute the left hand side 1277 * @param leftHandSide the expression used to compute the left hand side
1336 * @param operator the assignment operator being applied 1278 * @param operator the assignment operator being applied
1337 * @param rightHandSide the expression used to compute the right hand side 1279 * @param rightHandSide the expression used to compute the right hand side
1338 */ 1280 */
1339 AssignmentExpression.full(Expression leftHandSide, Token operator, Expression rightHandSide) { 1281 AssignmentExpression(Expression leftHandSide, this.operator, Expression rightH andSide) {
1340 this._leftHandSide = becomeParentOf(leftHandSide); 1282 this._leftHandSide = becomeParentOf(leftHandSide);
1341 this.operator = operator;
1342 this._rightHandSide = becomeParentOf(rightHandSide); 1283 this._rightHandSide = becomeParentOf(rightHandSide);
1343 } 1284 }
1344 1285
1345 /**
1346 * Initialize a newly created assignment expression.
1347 *
1348 * @param leftHandSide the expression used to compute the left hand side
1349 * @param operator the assignment operator being applied
1350 * @param rightHandSide the expression used to compute the right hand side
1351 */
1352 AssignmentExpression({Expression leftHandSide, Token operator, Expression righ tHandSide}) : this.full(leftHandSide, operator, rightHandSide);
1353
1354 accept(ASTVisitor visitor) => visitor.visitAssignmentExpression(this); 1286 accept(ASTVisitor visitor) => visitor.visitAssignmentExpression(this);
1355 1287
1356 Token get beginToken => _leftHandSide.beginToken; 1288 Token get beginToken => _leftHandSide.beginToken;
1357 1289
1358 /** 1290 /**
1359 * Return the best element available for this operator. If resolution was able to find a better 1291 * Return the best element available for this operator. If resolution was able to find a better
1360 * element based on type propagation, that element will be returned. Otherwise , the element found 1292 * element based on type propagation, that element will be returned. Otherwise , the element found
1361 * using the result of static analysis will be returned. If resolution has not been performed, 1293 * using the result of static analysis will be returned. If resolution has not been performed,
1362 * then `null` will be returned. 1294 * then `null` will be returned.
1363 * 1295 *
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 */ 1467 */
1536 MethodElement _propagatedElement; 1468 MethodElement _propagatedElement;
1537 1469
1538 /** 1470 /**
1539 * Initialize a newly created binary expression. 1471 * Initialize a newly created binary expression.
1540 * 1472 *
1541 * @param leftOperand the expression used to compute the left operand 1473 * @param leftOperand the expression used to compute the left operand
1542 * @param operator the binary operator being applied 1474 * @param operator the binary operator being applied
1543 * @param rightOperand the expression used to compute the right operand 1475 * @param rightOperand the expression used to compute the right operand
1544 */ 1476 */
1545 BinaryExpression.full(Expression leftOperand, Token operator, Expression right Operand) { 1477 BinaryExpression(Expression leftOperand, this.operator, Expression rightOperan d) {
1546 this._leftOperand = becomeParentOf(leftOperand); 1478 this._leftOperand = becomeParentOf(leftOperand);
1547 this.operator = operator;
1548 this._rightOperand = becomeParentOf(rightOperand); 1479 this._rightOperand = becomeParentOf(rightOperand);
1549 } 1480 }
1550 1481
1551 /**
1552 * Initialize a newly created binary expression.
1553 *
1554 * @param leftOperand the expression used to compute the left operand
1555 * @param operator the binary operator being applied
1556 * @param rightOperand the expression used to compute the right operand
1557 */
1558 BinaryExpression({Expression leftOperand, Token operator, Expression rightOper and}) : this.full(leftOperand, operator, rightOperand);
1559
1560 accept(ASTVisitor visitor) => visitor.visitBinaryExpression(this); 1482 accept(ASTVisitor visitor) => visitor.visitBinaryExpression(this);
1561 1483
1562 Token get beginToken => _leftOperand.beginToken; 1484 Token get beginToken => _leftOperand.beginToken;
1563 1485
1564 /** 1486 /**
1565 * Return the best element available for this operator. If resolution was able to find a better 1487 * Return the best element available for this operator. If resolution was able to find a better
1566 * element based on type propagation, that element will be returned. Otherwise , the element found 1488 * element based on type propagation, that element will be returned. Otherwise , the element found
1567 * using the result of static analysis will be returned. If resolution has not been performed, 1489 * using the result of static analysis will be returned. If resolution has not been performed,
1568 * then `null` will be returned. 1490 * then `null` will be returned.
1569 * 1491 *
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1713 */ 1635 */
1714 class Block extends Statement { 1636 class Block extends Statement {
1715 /** 1637 /**
1716 * The left curly bracket. 1638 * The left curly bracket.
1717 */ 1639 */
1718 Token leftBracket; 1640 Token leftBracket;
1719 1641
1720 /** 1642 /**
1721 * The statements contained in the block. 1643 * The statements contained in the block.
1722 */ 1644 */
1723 NodeList<Statement> statements; 1645 NodeList<Statement> _statements;
1724 1646
1725 /** 1647 /**
1726 * The right curly bracket. 1648 * The right curly bracket.
1727 */ 1649 */
1728 Token rightBracket; 1650 Token rightBracket;
1729 1651
1730 /** 1652 /**
1731 * Initialize a newly created block of code. 1653 * Initialize a newly created block of code.
1732 * 1654 *
1733 * @param leftBracket the left curly bracket 1655 * @param leftBracket the left curly bracket
1734 * @param statements the statements contained in the block 1656 * @param statements the statements contained in the block
1735 * @param rightBracket the right curly bracket 1657 * @param rightBracket the right curly bracket
1736 */ 1658 */
1737 Block.full(Token leftBracket, List<Statement> statements, Token rightBracket) { 1659 Block(this.leftBracket, List<Statement> statements, this.rightBracket) {
1738 this.statements = new NodeList<Statement>(this); 1660 this._statements = new NodeList<Statement>(this);
1739 this.leftBracket = leftBracket; 1661 this._statements.addAll(statements);
1740 this.statements.addAll(statements);
1741 this.rightBracket = rightBracket;
1742 } 1662 }
1743 1663
1744 /**
1745 * Initialize a newly created block of code.
1746 *
1747 * @param leftBracket the left curly bracket
1748 * @param statements the statements contained in the block
1749 * @param rightBracket the right curly bracket
1750 */
1751 Block({Token leftBracket, List<Statement> statements, Token rightBracket}) : t his.full(leftBracket, statements, rightBracket);
1752
1753 accept(ASTVisitor visitor) => visitor.visitBlock(this); 1664 accept(ASTVisitor visitor) => visitor.visitBlock(this);
1754 1665
1755 Token get beginToken => leftBracket; 1666 Token get beginToken => leftBracket;
1756 1667
1757 Token get endToken => rightBracket; 1668 Token get endToken => rightBracket;
1758 1669
1670 /**
1671 * Return the statements contained in the block.
1672 *
1673 * @return the statements contained in the block
1674 */
1675 NodeList<Statement> get statements => _statements;
1676
1759 void visitChildren(ASTVisitor visitor) { 1677 void visitChildren(ASTVisitor visitor) {
1760 statements.accept(visitor); 1678 _statements.accept(visitor);
1761 } 1679 }
1762 } 1680 }
1763 1681
1764 /** 1682 /**
1765 * Instances of the class `BlockFunctionBody` represent a function body that con sists of a 1683 * Instances of the class `BlockFunctionBody` represent a function body that con sists of a
1766 * block of statements. 1684 * block of statements.
1767 * 1685 *
1768 * <pre> 1686 * <pre>
1769 * blockFunctionBody ::= 1687 * blockFunctionBody ::=
1770 * [Block] 1688 * [Block]
1771 * </pre> 1689 * </pre>
1772 * 1690 *
1773 * @coverage dart.engine.ast 1691 * @coverage dart.engine.ast
1774 */ 1692 */
1775 class BlockFunctionBody extends FunctionBody { 1693 class BlockFunctionBody extends FunctionBody {
1776 /** 1694 /**
1777 * The block representing the body of the function. 1695 * The block representing the body of the function.
1778 */ 1696 */
1779 Block _block; 1697 Block _block;
1780 1698
1781 /** 1699 /**
1782 * Initialize a newly created function body consisting of a block of statement s. 1700 * Initialize a newly created function body consisting of a block of statement s.
1783 * 1701 *
1784 * @param block the block representing the body of the function 1702 * @param block the block representing the body of the function
1785 */ 1703 */
1786 BlockFunctionBody.full(Block block) { 1704 BlockFunctionBody(Block block) {
1787 this._block = becomeParentOf(block); 1705 this._block = becomeParentOf(block);
1788 } 1706 }
1789 1707
1790 /**
1791 * Initialize a newly created function body consisting of a block of statement s.
1792 *
1793 * @param block the block representing the body of the function
1794 */
1795 BlockFunctionBody({Block block}) : this.full(block);
1796
1797 accept(ASTVisitor visitor) => visitor.visitBlockFunctionBody(this); 1708 accept(ASTVisitor visitor) => visitor.visitBlockFunctionBody(this);
1798 1709
1799 Token get beginToken => _block.beginToken; 1710 Token get beginToken => _block.beginToken;
1800 1711
1801 /** 1712 /**
1802 * Return the block representing the body of the function. 1713 * Return the block representing the body of the function.
1803 * 1714 *
1804 * @return the block representing the body of the function 1715 * @return the block representing the body of the function
1805 */ 1716 */
1806 Block get block => _block; 1717 Block get block => _block;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1841 * The value of the literal. 1752 * The value of the literal.
1842 */ 1753 */
1843 bool value = false; 1754 bool value = false;
1844 1755
1845 /** 1756 /**
1846 * Initialize a newly created boolean literal. 1757 * Initialize a newly created boolean literal.
1847 * 1758 *
1848 * @param literal the token representing the literal 1759 * @param literal the token representing the literal
1849 * @param value the value of the literal 1760 * @param value the value of the literal
1850 */ 1761 */
1851 BooleanLiteral.full(Token literal, bool value) { 1762 BooleanLiteral(this.literal, this.value);
1852 this.literal = literal;
1853 this.value = value;
1854 }
1855
1856 /**
1857 * Initialize a newly created boolean literal.
1858 *
1859 * @param literal the token representing the literal
1860 * @param value the value of the literal
1861 */
1862 BooleanLiteral({Token literal, bool value}) : this.full(literal, value);
1863 1763
1864 accept(ASTVisitor visitor) => visitor.visitBooleanLiteral(this); 1764 accept(ASTVisitor visitor) => visitor.visitBooleanLiteral(this);
1865 1765
1866 Token get beginToken => literal; 1766 Token get beginToken => literal;
1867 1767
1868 Token get endToken => literal; 1768 Token get endToken => literal;
1869 1769
1870 bool get isSynthetic => literal.isSynthetic; 1770 bool get isSynthetic => literal.isSynthetic;
1871 1771
1872 void visitChildren(ASTVisitor visitor) { 1772 void visitChildren(ASTVisitor visitor) {
(...skipping 26 matching lines...) Expand all
1899 */ 1799 */
1900 Token semicolon; 1800 Token semicolon;
1901 1801
1902 /** 1802 /**
1903 * Initialize a newly created break statement. 1803 * Initialize a newly created break statement.
1904 * 1804 *
1905 * @param keyword the token representing the 'break' keyword 1805 * @param keyword the token representing the 'break' keyword
1906 * @param label the label associated with the statement 1806 * @param label the label associated with the statement
1907 * @param semicolon the semicolon terminating the statement 1807 * @param semicolon the semicolon terminating the statement
1908 */ 1808 */
1909 BreakStatement.full(Token keyword, SimpleIdentifier label, Token semicolon) { 1809 BreakStatement(this.keyword, SimpleIdentifier label, this.semicolon) {
1910 this.keyword = keyword;
1911 this._label = becomeParentOf(label); 1810 this._label = becomeParentOf(label);
1912 this.semicolon = semicolon;
1913 } 1811 }
1914 1812
1915 /**
1916 * Initialize a newly created break statement.
1917 *
1918 * @param keyword the token representing the 'break' keyword
1919 * @param label the label associated with the statement
1920 * @param semicolon the semicolon terminating the statement
1921 */
1922 BreakStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : thi s.full(keyword, label, semicolon);
1923
1924 accept(ASTVisitor visitor) => visitor.visitBreakStatement(this); 1813 accept(ASTVisitor visitor) => visitor.visitBreakStatement(this);
1925 1814
1926 Token get beginToken => keyword; 1815 Token get beginToken => keyword;
1927 1816
1928 Token get endToken => semicolon; 1817 Token get endToken => semicolon;
1929 1818
1930 /** 1819 /**
1931 * Return the label associated with the statement, or `null` if there is no la bel. 1820 * Return the label associated with the statement, or `null` if there is no la bel.
1932 * 1821 *
1933 * @return the label associated with the statement 1822 * @return the label associated with the statement
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1970 */ 1859 */
1971 class CascadeExpression extends Expression { 1860 class CascadeExpression extends Expression {
1972 /** 1861 /**
1973 * The target of the cascade sections. 1862 * The target of the cascade sections.
1974 */ 1863 */
1975 Expression _target; 1864 Expression _target;
1976 1865
1977 /** 1866 /**
1978 * The cascade sections sharing the common target. 1867 * The cascade sections sharing the common target.
1979 */ 1868 */
1980 NodeList<Expression> cascadeSections; 1869 NodeList<Expression> _cascadeSections;
1981 1870
1982 /** 1871 /**
1983 * Initialize a newly created cascade expression. 1872 * Initialize a newly created cascade expression.
1984 * 1873 *
1985 * @param target the target of the cascade sections 1874 * @param target the target of the cascade sections
1986 * @param cascadeSections the cascade sections sharing the common target 1875 * @param cascadeSections the cascade sections sharing the common target
1987 */ 1876 */
1988 CascadeExpression.full(Expression target, List<Expression> cascadeSections) { 1877 CascadeExpression(Expression target, List<Expression> cascadeSections) {
1989 this.cascadeSections = new NodeList<Expression>(this); 1878 this._cascadeSections = new NodeList<Expression>(this);
1990 this._target = becomeParentOf(target); 1879 this._target = becomeParentOf(target);
1991 this.cascadeSections.addAll(cascadeSections); 1880 this._cascadeSections.addAll(cascadeSections);
1992 } 1881 }
1993 1882
1994 /**
1995 * Initialize a newly created cascade expression.
1996 *
1997 * @param target the target of the cascade sections
1998 * @param cascadeSections the cascade sections sharing the common target
1999 */
2000 CascadeExpression({Expression target, List<Expression> cascadeSections}) : thi s.full(target, cascadeSections);
2001
2002 accept(ASTVisitor visitor) => visitor.visitCascadeExpression(this); 1883 accept(ASTVisitor visitor) => visitor.visitCascadeExpression(this);
2003 1884
2004 Token get beginToken => _target.beginToken; 1885 Token get beginToken => _target.beginToken;
2005 1886
2006 Token get endToken => cascadeSections.endToken; 1887 /**
1888 * Return the cascade sections sharing the common target.
1889 *
1890 * @return the cascade sections sharing the common target
1891 */
1892 NodeList<Expression> get cascadeSections => _cascadeSections;
1893
1894 Token get endToken => _cascadeSections.endToken;
2007 1895
2008 int get precedence => 2; 1896 int get precedence => 2;
2009 1897
2010 /** 1898 /**
2011 * Return the target of the cascade sections. 1899 * Return the target of the cascade sections.
2012 * 1900 *
2013 * @return the target of the cascade sections 1901 * @return the target of the cascade sections
2014 */ 1902 */
2015 Expression get target => _target; 1903 Expression get target => _target;
2016 1904
2017 /** 1905 /**
2018 * Set the target of the cascade sections to the given expression. 1906 * Set the target of the cascade sections to the given expression.
2019 * 1907 *
2020 * @param target the target of the cascade sections 1908 * @param target the target of the cascade sections
2021 */ 1909 */
2022 void set target(Expression target) { 1910 void set target(Expression target) {
2023 this._target = becomeParentOf(target); 1911 this._target = becomeParentOf(target);
2024 } 1912 }
2025 1913
2026 void visitChildren(ASTVisitor visitor) { 1914 void visitChildren(ASTVisitor visitor) {
2027 safelyVisitChild(_target, visitor); 1915 safelyVisitChild(_target, visitor);
2028 cascadeSections.accept(visitor); 1916 _cascadeSections.accept(visitor);
2029 } 1917 }
2030 } 1918 }
2031 1919
2032 /** 1920 /**
2033 * Instances of the class `CatchClause` represent a catch clause within a try st atement. 1921 * Instances of the class `CatchClause` represent a catch clause within a try st atement.
2034 * 1922 *
2035 * <pre> 1923 * <pre>
2036 * onPart ::= 1924 * onPart ::=
2037 * catchPart [Block] 1925 * catchPart [Block]
2038 * | 'on' type catchPart? [Block] 1926 * | 'on' type catchPart? [Block]
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2098 * @param onKeyword the token representing the 'on' keyword 1986 * @param onKeyword the token representing the 'on' keyword
2099 * @param exceptionType the type of exceptions caught by this catch clause 1987 * @param exceptionType the type of exceptions caught by this catch clause
2100 * @param leftParenthesis the left parenthesis 1988 * @param leftParenthesis the left parenthesis
2101 * @param exceptionParameter the parameter whose value will be the exception t hat was thrown 1989 * @param exceptionParameter the parameter whose value will be the exception t hat was thrown
2102 * @param comma the comma separating the exception parameter from the stack tr ace parameter 1990 * @param comma the comma separating the exception parameter from the stack tr ace parameter
2103 * @param stackTraceParameter the parameter whose value will be the stack trac e associated with 1991 * @param stackTraceParameter the parameter whose value will be the stack trac e associated with
2104 * the exception 1992 * the exception
2105 * @param rightParenthesis the right parenthesis 1993 * @param rightParenthesis the right parenthesis
2106 * @param body the body of the catch block 1994 * @param body the body of the catch block
2107 */ 1995 */
2108 CatchClause.full(Token onKeyword, TypeName exceptionType, Token catchKeyword, Token leftParenthesis, SimpleIdentifier exceptionParameter, Token comma, SimpleI dentifier stackTraceParameter, Token rightParenthesis, Block body) { 1996 CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword, Token l eftParenthesis, SimpleIdentifier exceptionParameter, this.comma, SimpleIdentifie r stackTraceParameter, Token rightParenthesis, Block body) {
2109 this.onKeyword = onKeyword;
2110 this.exceptionType = becomeParentOf(exceptionType); 1997 this.exceptionType = becomeParentOf(exceptionType);
2111 this.catchKeyword = catchKeyword;
2112 this._leftParenthesis = leftParenthesis; 1998 this._leftParenthesis = leftParenthesis;
2113 this._exceptionParameter = becomeParentOf(exceptionParameter); 1999 this._exceptionParameter = becomeParentOf(exceptionParameter);
2114 this.comma = comma;
2115 this._stackTraceParameter = becomeParentOf(stackTraceParameter); 2000 this._stackTraceParameter = becomeParentOf(stackTraceParameter);
2116 this._rightParenthesis = rightParenthesis; 2001 this._rightParenthesis = rightParenthesis;
2117 this._body = becomeParentOf(body); 2002 this._body = becomeParentOf(body);
2118 } 2003 }
2119 2004
2120 /**
2121 * Initialize a newly created catch clause.
2122 *
2123 * @param onKeyword the token representing the 'on' keyword
2124 * @param exceptionType the type of exceptions caught by this catch clause
2125 * @param leftParenthesis the left parenthesis
2126 * @param exceptionParameter the parameter whose value will be the exception t hat was thrown
2127 * @param comma the comma separating the exception parameter from the stack tr ace parameter
2128 * @param stackTraceParameter the parameter whose value will be the stack trac e associated with
2129 * the exception
2130 * @param rightParenthesis the right parenthesis
2131 * @param body the body of the catch block
2132 */
2133 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);
2134
2135 accept(ASTVisitor visitor) => visitor.visitCatchClause(this); 2005 accept(ASTVisitor visitor) => visitor.visitCatchClause(this);
2136 2006
2137 Token get beginToken { 2007 Token get beginToken {
2138 if (onKeyword != null) { 2008 if (onKeyword != null) {
2139 return onKeyword; 2009 return onKeyword;
2140 } 2010 }
2141 return catchKeyword; 2011 return catchKeyword;
2142 } 2012 }
2143 2013
2144 /** 2014 /**
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2291 NativeClause nativeClause; 2161 NativeClause nativeClause;
2292 2162
2293 /** 2163 /**
2294 * The left curly bracket. 2164 * The left curly bracket.
2295 */ 2165 */
2296 Token leftBracket; 2166 Token leftBracket;
2297 2167
2298 /** 2168 /**
2299 * The members defined by the class. 2169 * The members defined by the class.
2300 */ 2170 */
2301 NodeList<ClassMember> members; 2171 NodeList<ClassMember> _members;
2302 2172
2303 /** 2173 /**
2304 * The right curly bracket. 2174 * The right curly bracket.
2305 */ 2175 */
2306 Token rightBracket; 2176 Token rightBracket;
2307 2177
2308 /** 2178 /**
2309 * Initialize a newly created class declaration. 2179 * Initialize a newly created class declaration.
2310 * 2180 *
2311 * @param comment the documentation comment associated with this class 2181 * @param comment the documentation comment associated with this class
2312 * @param metadata the annotations associated with this class 2182 * @param metadata the annotations associated with this class
2313 * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was absent 2183 * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was absent
2314 * @param classKeyword the token representing the 'class' keyword 2184 * @param classKeyword the token representing the 'class' keyword
2315 * @param name the name of the class being declared 2185 * @param name the name of the class being declared
2316 * @param typeParameters the type parameters for the class 2186 * @param typeParameters the type parameters for the class
2317 * @param extendsClause the extends clause for the class 2187 * @param extendsClause the extends clause for the class
2318 * @param withClause the with clause for the class 2188 * @param withClause the with clause for the class
2319 * @param implementsClause the implements clause for the class 2189 * @param implementsClause the implements clause for the class
2320 * @param leftBracket the left curly bracket 2190 * @param leftBracket the left curly bracket
2321 * @param members the members defined by the class 2191 * @param members the members defined by the class
2322 * @param rightBracket the right curly bracket 2192 * @param rightBracket the right curly bracket
2323 */ 2193 */
2324 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) { 2194 ClassDeclaration(Comment comment, List<Annotation> metadata, this.abstractKeyw ord, this.classKeyword, SimpleIdentifier name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause implements Clause, this.leftBracket, List<ClassMember> members, this.rightBracket) : super( comment, metadata) {
2325 this.members = new NodeList<ClassMember>(this); 2195 this._members = new NodeList<ClassMember>(this);
2326 this.abstractKeyword = abstractKeyword;
2327 this.classKeyword = classKeyword;
2328 this._name = becomeParentOf(name); 2196 this._name = becomeParentOf(name);
2329 this.typeParameters = becomeParentOf(typeParameters); 2197 this.typeParameters = becomeParentOf(typeParameters);
2330 this._extendsClause = becomeParentOf(extendsClause); 2198 this._extendsClause = becomeParentOf(extendsClause);
2331 this._withClause = becomeParentOf(withClause); 2199 this._withClause = becomeParentOf(withClause);
2332 this._implementsClause = becomeParentOf(implementsClause); 2200 this._implementsClause = becomeParentOf(implementsClause);
2333 this.leftBracket = leftBracket; 2201 this._members.addAll(members);
2334 this.members.addAll(members);
2335 this.rightBracket = rightBracket;
2336 } 2202 }
2337 2203
2338 /**
2339 * Initialize a newly created class declaration.
2340 *
2341 * @param comment the documentation comment associated with this class
2342 * @param metadata the annotations associated with this class
2343 * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was absent
2344 * @param classKeyword the token representing the 'class' keyword
2345 * @param name the name of the class being declared
2346 * @param typeParameters the type parameters for the class
2347 * @param extendsClause the extends clause for the class
2348 * @param withClause the with clause for the class
2349 * @param implementsClause the implements clause for the class
2350 * @param leftBracket the left curly bracket
2351 * @param members the members defined by the class
2352 * @param rightBracket the right curly bracket
2353 */
2354 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);
2355
2356 accept(ASTVisitor visitor) => visitor.visitClassDeclaration(this); 2204 accept(ASTVisitor visitor) => visitor.visitClassDeclaration(this);
2357 2205
2358 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme nt) : null; 2206 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme nt) : null;
2359 2207
2360 Token get endToken => rightBracket; 2208 Token get endToken => rightBracket;
2361 2209
2362 /** 2210 /**
2363 * Return the extends clause for this class, or `null` if the class does not e xtend any 2211 * Return the extends clause for this class, or `null` if the class does not e xtend any
2364 * other class. 2212 * other class.
2365 * 2213 *
2366 * @return the extends clause for this class 2214 * @return the extends clause for this class
2367 */ 2215 */
2368 ExtendsClause get extendsClause => _extendsClause; 2216 ExtendsClause get extendsClause => _extendsClause;
2369 2217
2370 /** 2218 /**
2219 * Return the field declared in the class with the given name.
2220 *
2221 * @param name the name of the field to find
2222 * @return the found field or `null` if not found
2223 */
2224 VariableDeclaration getField(String name) {
2225 for (ClassMember classMember in _members) {
2226 if (classMember is FieldDeclaration) {
2227 FieldDeclaration fieldDeclaration = classMember as FieldDeclaration;
2228 NodeList<VariableDeclaration> fields = fieldDeclaration.fields.variables ;
2229 for (VariableDeclaration field in fields) {
2230 SimpleIdentifier fieldName = field.name;
2231 if (fieldName != null && name == fieldName.name) {
2232 return field;
2233 }
2234 }
2235 }
2236 }
2237 return null;
2238 }
2239
2240 /**
2371 * Return the implements clause for the class, or `null` if the class does not implement any 2241 * Return the implements clause for the class, or `null` if the class does not implement any
2372 * interfaces. 2242 * interfaces.
2373 * 2243 *
2374 * @return the implements clause for the class 2244 * @return the implements clause for the class
2375 */ 2245 */
2376 ImplementsClause get implementsClause => _implementsClause; 2246 ImplementsClause get implementsClause => _implementsClause;
2377 2247
2378 /** 2248 /**
2249 * Return the members defined by the class.
2250 *
2251 * @return the members defined by the class
2252 */
2253 NodeList<ClassMember> get members => _members;
2254
2255 /**
2379 * Return the name of the class being declared. 2256 * Return the name of the class being declared.
2380 * 2257 *
2381 * @return the name of the class being declared 2258 * @return the name of the class being declared
2382 */ 2259 */
2383 SimpleIdentifier get name => _name; 2260 SimpleIdentifier get name => _name;
2384 2261
2385 /** 2262 /**
2386 * Return the with clause for the class, or `null` if the class does not have a with clause. 2263 * Return the with clause for the class, or `null` if the class does not have a with clause.
2387 * 2264 *
2388 * @return the with clause for the class 2265 * @return the with clause for the class
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
2450 * 2327 *
2451 * @coverage dart.engine.ast 2328 * @coverage dart.engine.ast
2452 */ 2329 */
2453 abstract class ClassMember extends Declaration { 2330 abstract class ClassMember extends Declaration {
2454 /** 2331 /**
2455 * Initialize a newly created member of a class. 2332 * Initialize a newly created member of a class.
2456 * 2333 *
2457 * @param comment the documentation comment associated with this member 2334 * @param comment the documentation comment associated with this member
2458 * @param metadata the annotations associated with this member 2335 * @param metadata the annotations associated with this member
2459 */ 2336 */
2460 ClassMember.full(Comment comment, List<Annotation> metadata) : super.full(comm ent, metadata); 2337 ClassMember(Comment comment, List<Annotation> metadata) : super(comment, metad ata);
2461
2462 /**
2463 * Initialize a newly created member of a class.
2464 *
2465 * @param comment the documentation comment associated with this member
2466 * @param metadata the annotations associated with this member
2467 */
2468 ClassMember({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata);
2469 } 2338 }
2470 2339
2471 /** 2340 /**
2472 * Instances of the class `ClassTypeAlias` represent a class type alias. 2341 * Instances of the class `ClassTypeAlias` represent a class type alias.
2473 * 2342 *
2474 * <pre> 2343 * <pre>
2475 * classTypeAlias ::= 2344 * classTypeAlias ::=
2476 * [SimpleIdentifier] [TypeParameterList]? '=' 'abstract'? mixinApplication 2345 * [SimpleIdentifier] [TypeParameterList]? '=' 'abstract'? mixinApplication
2477 * 2346 *
2478 * mixinApplication ::= 2347 * mixinApplication ::=
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 * @param keyword the token representing the 'typedef' keyword 2396 * @param keyword the token representing the 'typedef' keyword
2528 * @param name the name of the class being declared 2397 * @param name the name of the class being declared
2529 * @param typeParameters the type parameters for the class 2398 * @param typeParameters the type parameters for the class
2530 * @param equals the token for the '=' separating the name from the definition 2399 * @param equals the token for the '=' separating the name from the definition
2531 * @param abstractKeyword the token for the 'abstract' keyword 2400 * @param abstractKeyword the token for the 'abstract' keyword
2532 * @param superclass the name of the superclass of the class being declared 2401 * @param superclass the name of the superclass of the class being declared
2533 * @param withClause the with clause for this class 2402 * @param withClause the with clause for this class
2534 * @param implementsClause the implements clause for this class 2403 * @param implementsClause the implements clause for this class
2535 * @param semicolon the semicolon terminating the declaration 2404 * @param semicolon the semicolon terminating the declaration
2536 */ 2405 */
2537 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) { 2406 ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, Simp leIdentifier name, TypeParameterList typeParameters, this.equals, this.abstractK eyword, TypeName superclass, WithClause withClause, ImplementsClause implementsC lause, Token semicolon) : super(comment, metadata, keyword, semicolon) {
2538 this._name = becomeParentOf(name); 2407 this._name = becomeParentOf(name);
2539 this._typeParameters = becomeParentOf(typeParameters); 2408 this._typeParameters = becomeParentOf(typeParameters);
2540 this.equals = equals;
2541 this.abstractKeyword = abstractKeyword;
2542 this._superclass = becomeParentOf(superclass); 2409 this._superclass = becomeParentOf(superclass);
2543 this._withClause = becomeParentOf(withClause); 2410 this._withClause = becomeParentOf(withClause);
2544 this._implementsClause = becomeParentOf(implementsClause); 2411 this._implementsClause = becomeParentOf(implementsClause);
2545 } 2412 }
2546 2413
2547 /**
2548 * Initialize a newly created class type alias.
2549 *
2550 * @param comment the documentation comment associated with this type alias
2551 * @param metadata the annotations associated with this type alias
2552 * @param keyword the token representing the 'typedef' keyword
2553 * @param name the name of the class being declared
2554 * @param typeParameters the type parameters for the class
2555 * @param equals the token for the '=' separating the name from the definition
2556 * @param abstractKeyword the token for the 'abstract' keyword
2557 * @param superclass the name of the superclass of the class being declared
2558 * @param withClause the with clause for this class
2559 * @param implementsClause the implements clause for this class
2560 * @param semicolon the semicolon terminating the declaration
2561 */
2562 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);
2563
2564 accept(ASTVisitor visitor) => visitor.visitClassTypeAlias(this); 2414 accept(ASTVisitor visitor) => visitor.visitClassTypeAlias(this);
2565 2415
2566 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme nt) : null; 2416 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme nt) : null;
2567 2417
2568 /** 2418 /**
2569 * Return the implements clause for this class, or `null` if there is no imple ments clause. 2419 * Return the implements clause for this class, or `null` if there is no imple ments clause.
2570 * 2420 *
2571 * @return the implements clause for this class 2421 * @return the implements clause for this class
2572 */ 2422 */
2573 ImplementsClause get implementsClause => _implementsClause; 2423 ImplementsClause get implementsClause => _implementsClause;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
2673 * The keyword specifying what kind of processing is to be done on the importe d names. 2523 * The keyword specifying what kind of processing is to be done on the importe d names.
2674 */ 2524 */
2675 Token keyword; 2525 Token keyword;
2676 2526
2677 /** 2527 /**
2678 * Initialize a newly created import combinator. 2528 * Initialize a newly created import combinator.
2679 * 2529 *
2680 * @param keyword the keyword specifying what kind of processing is to be done on the imported 2530 * @param keyword the keyword specifying what kind of processing is to be done on the imported
2681 * names 2531 * names
2682 */ 2532 */
2683 Combinator.full(Token keyword) { 2533 Combinator(this.keyword);
2684 this.keyword = keyword;
2685 }
2686
2687 /**
2688 * Initialize a newly created import combinator.
2689 *
2690 * @param keyword the keyword specifying what kind of processing is to be done on the imported
2691 * names
2692 */
2693 Combinator({Token keyword}) : this.full(keyword);
2694 2534
2695 Token get beginToken => keyword; 2535 Token get beginToken => keyword;
2696 } 2536 }
2697 2537
2698 /** 2538 /**
2699 * Instances of the class `Comment` represent a comment within the source code. 2539 * Instances of the class `Comment` represent a comment within the source code.
2700 * 2540 *
2701 * <pre> 2541 * <pre>
2702 * comment ::= 2542 * comment ::=
2703 * endOfLineComment 2543 * endOfLineComment
(...skipping 13 matching lines...) Expand all
2717 * 2557 *
2718 * @coverage dart.engine.ast 2558 * @coverage dart.engine.ast
2719 */ 2559 */
2720 class Comment extends ASTNode { 2560 class Comment extends ASTNode {
2721 /** 2561 /**
2722 * Create a block comment. 2562 * Create a block comment.
2723 * 2563 *
2724 * @param tokens the tokens representing the comment 2564 * @param tokens the tokens representing the comment
2725 * @return the block comment that was created 2565 * @return the block comment that was created
2726 */ 2566 */
2727 static Comment createBlockComment(List<Token> tokens) => new Comment.full(toke ns, CommentType.BLOCK, null); 2567 static Comment createBlockComment(List<Token> tokens) => new Comment(tokens, C ommentType.BLOCK, null);
2728 2568
2729 /** 2569 /**
2730 * Create a documentation comment. 2570 * Create a documentation comment.
2731 * 2571 *
2732 * @param tokens the tokens representing the comment 2572 * @param tokens the tokens representing the comment
2733 * @return the documentation comment that was created 2573 * @return the documentation comment that was created
2734 */ 2574 */
2735 static Comment createDocumentationComment(List<Token> tokens) => new Comment.f ull(tokens, CommentType.DOCUMENTATION, new List<CommentReference>()); 2575 static Comment createDocumentationComment(List<Token> tokens) => new Comment(t okens, CommentType.DOCUMENTATION, new List<CommentReference>());
2736 2576
2737 /** 2577 /**
2738 * Create a documentation comment. 2578 * Create a documentation comment.
2739 * 2579 *
2740 * @param tokens the tokens representing the comment 2580 * @param tokens the tokens representing the comment
2741 * @param references the references embedded within the documentation comment 2581 * @param references the references embedded within the documentation comment
2742 * @return the documentation comment that was created 2582 * @return the documentation comment that was created
2743 */ 2583 */
2744 static Comment createDocumentationComment2(List<Token> tokens, List<CommentRef erence> references) => new Comment.full(tokens, CommentType.DOCUMENTATION, refer ences); 2584 static Comment createDocumentationComment2(List<Token> tokens, List<CommentRef erence> references) => new Comment(tokens, CommentType.DOCUMENTATION, references );
2745 2585
2746 /** 2586 /**
2747 * Create an end-of-line comment. 2587 * Create an end-of-line comment.
2748 * 2588 *
2749 * @param tokens the tokens representing the comment 2589 * @param tokens the tokens representing the comment
2750 * @return the end-of-line comment that was created 2590 * @return the end-of-line comment that was created
2751 */ 2591 */
2752 static Comment createEndOfLineComment(List<Token> tokens) => new Comment.full( tokens, CommentType.END_OF_LINE, null); 2592 static Comment createEndOfLineComment(List<Token> tokens) => new Comment(token s, CommentType.END_OF_LINE, null);
2753 2593
2754 /** 2594 /**
2755 * The tokens representing the comment. 2595 * The tokens representing the comment.
2756 */ 2596 */
2757 List<Token> tokens; 2597 final List<Token> tokens;
2758 2598
2759 /** 2599 /**
2760 * The type of the comment. 2600 * The type of the comment.
2761 */ 2601 */
2762 CommentType _type; 2602 CommentType _type;
2763 2603
2764 /** 2604 /**
2765 * The references embedded within the documentation comment. This list will be empty unless this 2605 * The references embedded within the documentation comment. This list will be empty unless this
2766 * is a documentation comment that has references embedded within it. 2606 * is a documentation comment that has references embedded within it.
2767 */ 2607 */
2768 NodeList<CommentReference> references; 2608 NodeList<CommentReference> _references;
2769 2609
2770 /** 2610 /**
2771 * Initialize a newly created comment. 2611 * Initialize a newly created comment.
2772 * 2612 *
2773 * @param tokens the tokens representing the comment 2613 * @param tokens the tokens representing the comment
2774 * @param type the type of the comment 2614 * @param type the type of the comment
2775 * @param references the references embedded within the documentation comment 2615 * @param references the references embedded within the documentation comment
2776 */ 2616 */
2777 Comment.full(List<Token> tokens, CommentType type, List<CommentReference> refe rences) { 2617 Comment(this.tokens, CommentType type, List<CommentReference> references) {
2778 this.references = new NodeList<CommentReference>(this); 2618 this._references = new NodeList<CommentReference>(this);
2779 this.tokens = tokens;
2780 this._type = type; 2619 this._type = type;
2781 this.references.addAll(references); 2620 this._references.addAll(references);
2782 } 2621 }
2783 2622
2784 /**
2785 * Initialize a newly created comment.
2786 *
2787 * @param tokens the tokens representing the comment
2788 * @param type the type of the comment
2789 * @param references the references embedded within the documentation comment
2790 */
2791 Comment({List<Token> tokens, CommentType type, List<CommentReference> referenc es}) : this.full(tokens, type, references);
2792
2793 accept(ASTVisitor visitor) => visitor.visitComment(this); 2623 accept(ASTVisitor visitor) => visitor.visitComment(this);
2794 2624
2795 Token get beginToken => tokens[0]; 2625 Token get beginToken => tokens[0];
2796 2626
2797 Token get endToken => tokens[tokens.length - 1]; 2627 Token get endToken => tokens[tokens.length - 1];
2798 2628
2799 /** 2629 /**
2630 * Return the references embedded within the documentation comment.
2631 *
2632 * @return the references embedded within the documentation comment
2633 */
2634 NodeList<CommentReference> get references => _references;
2635
2636 /**
2800 * Return `true` if this is a block comment. 2637 * Return `true` if this is a block comment.
2801 * 2638 *
2802 * @return `true` if this is a block comment 2639 * @return `true` if this is a block comment
2803 */ 2640 */
2804 bool get isBlock => identical(_type, CommentType.BLOCK); 2641 bool get isBlock => identical(_type, CommentType.BLOCK);
2805 2642
2806 /** 2643 /**
2807 * Return `true` if this is a documentation comment. 2644 * Return `true` if this is a documentation comment.
2808 * 2645 *
2809 * @return `true` if this is a documentation comment 2646 * @return `true` if this is a documentation comment
2810 */ 2647 */
2811 bool get isDocumentation => identical(_type, CommentType.DOCUMENTATION); 2648 bool get isDocumentation => identical(_type, CommentType.DOCUMENTATION);
2812 2649
2813 /** 2650 /**
2814 * Return `true` if this is an end-of-line comment. 2651 * Return `true` if this is an end-of-line comment.
2815 * 2652 *
2816 * @return `true` if this is an end-of-line comment 2653 * @return `true` if this is an end-of-line comment
2817 */ 2654 */
2818 bool get isEndOfLine => identical(_type, CommentType.END_OF_LINE); 2655 bool get isEndOfLine => identical(_type, CommentType.END_OF_LINE);
2819 2656
2820 void visitChildren(ASTVisitor visitor) { 2657 void visitChildren(ASTVisitor visitor) {
2821 references.accept(visitor); 2658 _references.accept(visitor);
2822 } 2659 }
2823 } 2660 }
2824 2661
2825 /** 2662 /**
2826 * The enumeration `CommentType` encodes all the different types of comments tha t are 2663 * The enumeration `CommentType` encodes all the different types of comments tha t are
2827 * recognized by the parser. 2664 * recognized by the parser.
2828 */ 2665 */
2829 class CommentType extends Enum<CommentType> { 2666 class CommentType extends Enum<CommentType> {
2830 /** 2667 /**
2831 * An end-of-line comment. 2668 * An end-of-line comment.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2868 * The identifier being referenced. 2705 * The identifier being referenced.
2869 */ 2706 */
2870 Identifier _identifier; 2707 Identifier _identifier;
2871 2708
2872 /** 2709 /**
2873 * Initialize a newly created reference to a Dart element. 2710 * Initialize a newly created reference to a Dart element.
2874 * 2711 *
2875 * @param newKeyword the token representing the 'new' keyword 2712 * @param newKeyword the token representing the 'new' keyword
2876 * @param identifier the identifier being referenced 2713 * @param identifier the identifier being referenced
2877 */ 2714 */
2878 CommentReference.full(Token newKeyword, Identifier identifier) { 2715 CommentReference(this.newKeyword, Identifier identifier) {
2879 this.newKeyword = newKeyword;
2880 this._identifier = becomeParentOf(identifier); 2716 this._identifier = becomeParentOf(identifier);
2881 } 2717 }
2882 2718
2883 /**
2884 * Initialize a newly created reference to a Dart element.
2885 *
2886 * @param newKeyword the token representing the 'new' keyword
2887 * @param identifier the identifier being referenced
2888 */
2889 CommentReference({Token newKeyword, Identifier identifier}) : this.full(newKey word, identifier);
2890
2891 accept(ASTVisitor visitor) => visitor.visitCommentReference(this); 2719 accept(ASTVisitor visitor) => visitor.visitCommentReference(this);
2892 2720
2893 Token get beginToken => _identifier.beginToken; 2721 Token get beginToken => _identifier.beginToken;
2894 2722
2895 Token get endToken => _identifier.endToken; 2723 Token get endToken => _identifier.endToken;
2896 2724
2897 /** 2725 /**
2898 * Return the identifier being referenced. 2726 * Return the identifier being referenced.
2899 * 2727 *
2900 * @return the identifier being referenced 2728 * @return the identifier being referenced
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2938 * declarations ::= 2766 * declarations ::=
2939 * [CompilationUnitMember]* 2767 * [CompilationUnitMember]*
2940 * </pre> 2768 * </pre>
2941 * 2769 *
2942 * @coverage dart.engine.ast 2770 * @coverage dart.engine.ast
2943 */ 2771 */
2944 class CompilationUnit extends ASTNode { 2772 class CompilationUnit extends ASTNode {
2945 /** 2773 /**
2946 * The first token in the token stream that was parsed to form this compilatio n unit. 2774 * The first token in the token stream that was parsed to form this compilatio n unit.
2947 */ 2775 */
2948 Token _beginToken; 2776 final Token beginToken;
2949 2777
2950 /** 2778 /**
2951 * The script tag at the beginning of the compilation unit, or `null` if there is no script 2779 * The script tag at the beginning of the compilation unit, or `null` if there is no script
2952 * tag in this compilation unit. 2780 * tag in this compilation unit.
2953 */ 2781 */
2954 ScriptTag _scriptTag; 2782 ScriptTag _scriptTag;
2955 2783
2956 /** 2784 /**
2957 * The directives contained in this compilation unit. 2785 * The directives contained in this compilation unit.
2958 */ 2786 */
2959 NodeList<Directive> directives; 2787 NodeList<Directive> _directives;
2960 2788
2961 /** 2789 /**
2962 * The declarations contained in this compilation unit. 2790 * The declarations contained in this compilation unit.
2963 */ 2791 */
2964 NodeList<CompilationUnitMember> declarations; 2792 NodeList<CompilationUnitMember> _declarations;
2965 2793
2966 /** 2794 /**
2967 * The last token in the token stream that was parsed to form this compilation unit. This token 2795 * The last token in the token stream that was parsed to form this compilation unit. This token
2968 * should always have a type of [TokenType.EOF]. 2796 * should always have a type of [TokenType.EOF].
2969 */ 2797 */
2970 Token _endToken; 2798 final Token endToken;
2971 2799
2972 /** 2800 /**
2973 * The element associated with this compilation unit, or `null` if the AST str ucture has not 2801 * The element associated with this compilation unit, or `null` if the AST str ucture has not
2974 * been resolved. 2802 * been resolved.
2975 */ 2803 */
2976 CompilationUnitElement element; 2804 CompilationUnitElement element;
2977 2805
2978 /** 2806 /**
2979 * The line information for this compilation unit. 2807 * The line information for this compilation unit.
2980 */ 2808 */
2981 LineInfo lineInfo; 2809 LineInfo lineInfo;
2982 2810
2983 /** 2811 /**
2984 * Initialize a newly created compilation unit to have the given directives an d declarations. 2812 * Initialize a newly created compilation unit to have the given directives an d declarations.
2985 * 2813 *
2986 * @param beginToken the first token in the token stream 2814 * @param beginToken the first token in the token stream
2987 * @param scriptTag the script tag at the beginning of the compilation unit 2815 * @param scriptTag the script tag at the beginning of the compilation unit
2988 * @param directives the directives contained in this compilation unit 2816 * @param directives the directives contained in this compilation unit
2989 * @param declarations the declarations contained in this compilation unit 2817 * @param declarations the declarations contained in this compilation unit
2990 * @param endToken the last token in the token stream 2818 * @param endToken the last token in the token stream
2991 */ 2819 */
2992 CompilationUnit.full(Token beginToken, ScriptTag scriptTag, List<Directive> di rectives, List<CompilationUnitMember> declarations, Token endToken) { 2820 CompilationUnit(this.beginToken, ScriptTag scriptTag, List<Directive> directiv es, List<CompilationUnitMember> declarations, this.endToken) {
2993 this.directives = new NodeList<Directive>(this); 2821 this._directives = new NodeList<Directive>(this);
2994 this.declarations = new NodeList<CompilationUnitMember>(this); 2822 this._declarations = new NodeList<CompilationUnitMember>(this);
2995 this._beginToken = beginToken;
2996 this._scriptTag = becomeParentOf(scriptTag); 2823 this._scriptTag = becomeParentOf(scriptTag);
2997 this.directives.addAll(directives); 2824 this._directives.addAll(directives);
2998 this.declarations.addAll(declarations); 2825 this._declarations.addAll(declarations);
2999 this._endToken = endToken;
3000 } 2826 }
3001 2827
3002 /**
3003 * Initialize a newly created compilation unit to have the given directives an d declarations.
3004 *
3005 * @param beginToken the first token in the token stream
3006 * @param scriptTag the script tag at the beginning of the compilation unit
3007 * @param directives the directives contained in this compilation unit
3008 * @param declarations the declarations contained in this compilation unit
3009 * @param endToken the last token in the token stream
3010 */
3011 CompilationUnit({Token beginToken, ScriptTag scriptTag, List<Directive> direct ives, List<CompilationUnitMember> declarations, Token endToken}) : this.full(beg inToken, scriptTag, directives, declarations, endToken);
3012
3013 accept(ASTVisitor visitor) => visitor.visitCompilationUnit(this); 2828 accept(ASTVisitor visitor) => visitor.visitCompilationUnit(this);
3014 2829
3015 Token get beginToken => _beginToken; 2830 /**
2831 * Return the declarations contained in this compilation unit.
2832 *
2833 * @return the declarations contained in this compilation unit
2834 */
2835 NodeList<CompilationUnitMember> get declarations => _declarations;
3016 2836
3017 Token get endToken => _endToken; 2837 /**
2838 * Return the directives contained in this compilation unit.
2839 *
2840 * @return the directives contained in this compilation unit
2841 */
2842 NodeList<Directive> get directives => _directives;
3018 2843
3019 int get length { 2844 int get length {
3020 Token endToken = this.endToken; 2845 Token endToken = this.endToken;
3021 if (endToken == null) { 2846 if (endToken == null) {
3022 return 0; 2847 return 0;
3023 } 2848 }
3024 return endToken.offset + endToken.length; 2849 return endToken.offset + endToken.length;
3025 } 2850 }
3026 2851
3027 int get offset => 0; 2852 int get offset => 0;
(...skipping 11 matching lines...) Expand all
3039 * 2864 *
3040 * @param scriptTag the script tag at the beginning of the compilation unit 2865 * @param scriptTag the script tag at the beginning of the compilation unit
3041 */ 2866 */
3042 void set scriptTag(ScriptTag scriptTag) { 2867 void set scriptTag(ScriptTag scriptTag) {
3043 this._scriptTag = becomeParentOf(scriptTag); 2868 this._scriptTag = becomeParentOf(scriptTag);
3044 } 2869 }
3045 2870
3046 void visitChildren(ASTVisitor visitor) { 2871 void visitChildren(ASTVisitor visitor) {
3047 safelyVisitChild(_scriptTag, visitor); 2872 safelyVisitChild(_scriptTag, visitor);
3048 if (directivesAreBeforeDeclarations()) { 2873 if (directivesAreBeforeDeclarations()) {
3049 directives.accept(visitor); 2874 _directives.accept(visitor);
3050 declarations.accept(visitor); 2875 _declarations.accept(visitor);
3051 } else { 2876 } else {
3052 for (ASTNode child in sortedDirectivesAndDeclarations) { 2877 for (ASTNode child in sortedDirectivesAndDeclarations) {
3053 child.accept(visitor); 2878 child.accept(visitor);
3054 } 2879 }
3055 } 2880 }
3056 } 2881 }
3057 2882
3058 /** 2883 /**
3059 * Return `true` if all of the directives are lexically before any declaration s. 2884 * Return `true` if all of the directives are lexically before any declaration s.
3060 * 2885 *
3061 * @return `true` if all of the directives are lexically before any declaratio ns 2886 * @return `true` if all of the directives are lexically before any declaratio ns
3062 */ 2887 */
3063 bool directivesAreBeforeDeclarations() { 2888 bool directivesAreBeforeDeclarations() {
3064 if (directives.isEmpty || declarations.isEmpty) { 2889 if (_directives.isEmpty || _declarations.isEmpty) {
3065 return true; 2890 return true;
3066 } 2891 }
3067 Directive lastDirective = directives[directives.length - 1]; 2892 Directive lastDirective = _directives[_directives.length - 1];
3068 CompilationUnitMember firstDeclaration = declarations[0]; 2893 CompilationUnitMember firstDeclaration = _declarations[0];
3069 return lastDirective.offset < firstDeclaration.offset; 2894 return lastDirective.offset < firstDeclaration.offset;
3070 } 2895 }
3071 2896
3072 /** 2897 /**
3073 * Return an array containing all of the directives and declarations in this c ompilation unit, 2898 * Return an array containing all of the directives and declarations in this c ompilation unit,
3074 * sorted in lexical order. 2899 * sorted in lexical order.
3075 * 2900 *
3076 * @return the directives and declarations in this compilation unit in the ord er in which they 2901 * @return the directives and declarations in this compilation unit in the ord er in which they
3077 * appeared in the original source 2902 * appeared in the original source
3078 */ 2903 */
3079 List<ASTNode> get sortedDirectivesAndDeclarations { 2904 List<ASTNode> get sortedDirectivesAndDeclarations {
3080 List<ASTNode> childList = new List<ASTNode>(); 2905 List<ASTNode> childList = new List<ASTNode>();
3081 childList.addAll(directives); 2906 childList.addAll(_directives);
3082 childList.addAll(declarations); 2907 childList.addAll(_declarations);
3083 List<ASTNode> children = new List.from(childList); 2908 List<ASTNode> children = new List.from(childList);
3084 children.sort(ASTNode.LEXICAL_ORDER); 2909 children.sort(ASTNode.LEXICAL_ORDER);
3085 return children; 2910 return children;
3086 } 2911 }
3087 } 2912 }
3088 2913
3089 /** 2914 /**
3090 * Instances of the class `CompilationUnitMember` defines the behavior common to nodes that 2915 * Instances of the class `CompilationUnitMember` defines the behavior common to nodes that
3091 * declare a name within the scope of a compilation unit. 2916 * declare a name within the scope of a compilation unit.
3092 * 2917 *
3093 * <pre> 2918 * <pre>
3094 * compilationUnitMember ::= 2919 * compilationUnitMember ::=
3095 * [ClassDeclaration] 2920 * [ClassDeclaration]
3096 * | [TypeAlias] 2921 * | [TypeAlias]
3097 * | [FunctionDeclaration] 2922 * | [FunctionDeclaration]
3098 * | [MethodDeclaration] 2923 * | [MethodDeclaration]
3099 * | [VariableDeclaration] 2924 * | [VariableDeclaration]
3100 * | [VariableDeclaration] 2925 * | [VariableDeclaration]
3101 * </pre> 2926 * </pre>
3102 * 2927 *
3103 * @coverage dart.engine.ast 2928 * @coverage dart.engine.ast
3104 */ 2929 */
3105 abstract class CompilationUnitMember extends Declaration { 2930 abstract class CompilationUnitMember extends Declaration {
3106 /** 2931 /**
3107 * Initialize a newly created generic compilation unit member. 2932 * Initialize a newly created generic compilation unit member.
3108 * 2933 *
3109 * @param comment the documentation comment associated with this member 2934 * @param comment the documentation comment associated with this member
3110 * @param metadata the annotations associated with this member 2935 * @param metadata the annotations associated with this member
3111 */ 2936 */
3112 CompilationUnitMember.full(Comment comment, List<Annotation> metadata) : super .full(comment, metadata); 2937 CompilationUnitMember(Comment comment, List<Annotation> metadata) : super(comm ent, metadata);
3113
3114 /**
3115 * Initialize a newly created generic compilation unit member.
3116 *
3117 * @param comment the documentation comment associated with this member
3118 * @param metadata the annotations associated with this member
3119 */
3120 CompilationUnitMember({Comment comment, List<Annotation> metadata}) : this.ful l(comment, metadata);
3121 } 2938 }
3122 2939
3123 /** 2940 /**
3124 * Instances of the class `ConditionalExpression` represent a conditional expres sion. 2941 * Instances of the class `ConditionalExpression` represent a conditional expres sion.
3125 * 2942 *
3126 * <pre> 2943 * <pre>
3127 * conditionalExpression ::= 2944 * conditionalExpression ::=
3128 * [Expression] '?' [Expression] ':' [Expression] 2945 * [Expression] '?' [Expression] ':' [Expression]
3129 * </pre> 2946 * </pre>
3130 * 2947 *
(...skipping 29 matching lines...) Expand all
3160 * Initialize a newly created conditional expression. 2977 * Initialize a newly created conditional expression.
3161 * 2978 *
3162 * @param condition the condition used to determine which expression is execut ed next 2979 * @param condition the condition used to determine which expression is execut ed next
3163 * @param question the token used to separate the condition from the then expr ession 2980 * @param question the token used to separate the condition from the then expr ession
3164 * @param thenExpression the expression that is executed if the condition eval uates to 2981 * @param thenExpression the expression that is executed if the condition eval uates to
3165 * `true` 2982 * `true`
3166 * @param colon the token used to separate the then expression from the else e xpression 2983 * @param colon the token used to separate the then expression from the else e xpression
3167 * @param elseExpression the expression that is executed if the condition eval uates to 2984 * @param elseExpression the expression that is executed if the condition eval uates to
3168 * `false` 2985 * `false`
3169 */ 2986 */
3170 ConditionalExpression.full(Expression condition, Token question, Expression th enExpression, Token colon, Expression elseExpression) { 2987 ConditionalExpression(Expression condition, this.question, Expression thenExpr ession, this.colon, Expression elseExpression) {
3171 this._condition = becomeParentOf(condition); 2988 this._condition = becomeParentOf(condition);
3172 this.question = question;
3173 this._thenExpression = becomeParentOf(thenExpression); 2989 this._thenExpression = becomeParentOf(thenExpression);
3174 this.colon = colon;
3175 this._elseExpression = becomeParentOf(elseExpression); 2990 this._elseExpression = becomeParentOf(elseExpression);
3176 } 2991 }
3177 2992
3178 /**
3179 * Initialize a newly created conditional expression.
3180 *
3181 * @param condition the condition used to determine which expression is execut ed next
3182 * @param question the token used to separate the condition from the then expr ession
3183 * @param thenExpression the expression that is executed if the condition eval uates to
3184 * `true`
3185 * @param colon the token used to separate the then expression from the else e xpression
3186 * @param elseExpression the expression that is executed if the condition eval uates to
3187 * `false`
3188 */
3189 ConditionalExpression({Expression condition, Token question, Expression thenEx pression, Token colon, Expression elseExpression}) : this.full(condition, questi on, thenExpression, colon, elseExpression);
3190
3191 accept(ASTVisitor visitor) => visitor.visitConditionalExpression(this); 2993 accept(ASTVisitor visitor) => visitor.visitConditionalExpression(this);
3192 2994
3193 Token get beginToken => _condition.beginToken; 2995 Token get beginToken => _condition.beginToken;
3194 2996
3195 /** 2997 /**
3196 * Return the condition used to determine which of the expressions is executed next. 2998 * Return the condition used to determine which of the expressions is executed next.
3197 * 2999 *
3198 * @return the condition used to determine which expression is executed next 3000 * @return the condition used to determine which expression is executed next
3199 */ 3001 */
3200 Expression get condition => _condition; 3002 Expression get condition => _condition;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
3321 3123
3322 /** 3124 /**
3323 * The token for the separator (colon or equals) before the initializer list o r redirection, or 3125 * The token for the separator (colon or equals) before the initializer list o r redirection, or
3324 * `null` if there are no initializers. 3126 * `null` if there are no initializers.
3325 */ 3127 */
3326 Token separator; 3128 Token separator;
3327 3129
3328 /** 3130 /**
3329 * The initializers associated with the constructor. 3131 * The initializers associated with the constructor.
3330 */ 3132 */
3331 NodeList<ConstructorInitializer> initializers; 3133 NodeList<ConstructorInitializer> _initializers;
3332 3134
3333 /** 3135 /**
3334 * The name of the constructor to which this constructor will be redirected, o r `null` if 3136 * The name of the constructor to which this constructor will be redirected, o r `null` if
3335 * this is not a redirecting factory constructor. 3137 * this is not a redirecting factory constructor.
3336 */ 3138 */
3337 ConstructorName _redirectedConstructor; 3139 ConstructorName _redirectedConstructor;
3338 3140
3339 /** 3141 /**
3340 * The body of the constructor, or `null` if the constructor does not have a b ody. 3142 * The body of the constructor, or `null` if the constructor does not have a b ody.
3341 */ 3143 */
3342 FunctionBody _body; 3144 FunctionBody _body;
3343 3145
3344 /** 3146 /**
3345 * The element associated with this constructor, or `null` if the AST structur e has not been 3147 * The element associated with this constructor, or `null` if the AST structur e has not been
3346 * resolved or if this constructor could not be resolved. 3148 * resolved or if this constructor could not be resolved.
3347 */ 3149 */
3348 ConstructorElement _element; 3150 ConstructorElement element;
3349 3151
3350 /** 3152 /**
3351 * Initialize a newly created constructor declaration. 3153 * Initialize a newly created constructor declaration.
3352 * 3154 *
3353 * @param externalKeyword the token for the 'external' keyword 3155 * @param externalKeyword the token for the 'external' keyword
3354 * @param comment the documentation comment associated with this constructor 3156 * @param comment the documentation comment associated with this constructor
3355 * @param metadata the annotations associated with this constructor 3157 * @param metadata the annotations associated with this constructor
3356 * @param constKeyword the token for the 'const' keyword 3158 * @param constKeyword the token for the 'const' keyword
3357 * @param factoryKeyword the token for the 'factory' keyword 3159 * @param factoryKeyword the token for the 'factory' keyword
3358 * @param returnType the return type of the constructor 3160 * @param returnType the return type of the constructor
3359 * @param period the token for the period before the constructor name 3161 * @param period the token for the period before the constructor name
3360 * @param name the name of the constructor 3162 * @param name the name of the constructor
3361 * @param parameters the parameters associated with the constructor 3163 * @param parameters the parameters associated with the constructor
3362 * @param separator the token for the colon or equals before the initializers 3164 * @param separator the token for the colon or equals before the initializers
3363 * @param initializers the initializers associated with the constructor 3165 * @param initializers the initializers associated with the constructor
3364 * @param redirectedConstructor the name of the constructor to which this cons tructor will be 3166 * @param redirectedConstructor the name of the constructor to which this cons tructor will be
3365 * redirected 3167 * redirected
3366 * @param body the body of the constructor 3168 * @param body the body of the constructor
3367 */ 3169 */
3368 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) { 3170 ConstructorDeclaration(Comment comment, List<Annotation> metadata, this.extern alKeyword, this.constKeyword, this.factoryKeyword, Identifier returnType, this.p eriod, SimpleIdentifier name, FormalParameterList parameters, this.separator, Li st<ConstructorInitializer> initializers, ConstructorName redirectedConstructor, FunctionBody body) : super(comment, metadata) {
3369 this.initializers = new NodeList<ConstructorInitializer>(this); 3171 this._initializers = new NodeList<ConstructorInitializer>(this);
3370 this.externalKeyword = externalKeyword;
3371 this.constKeyword = constKeyword;
3372 this.factoryKeyword = factoryKeyword;
3373 this._returnType = becomeParentOf(returnType); 3172 this._returnType = becomeParentOf(returnType);
3374 this.period = period;
3375 this._name = becomeParentOf(name); 3173 this._name = becomeParentOf(name);
3376 this._parameters = becomeParentOf(parameters); 3174 this._parameters = becomeParentOf(parameters);
3377 this.separator = separator; 3175 this._initializers.addAll(initializers);
3378 this.initializers.addAll(initializers);
3379 this._redirectedConstructor = becomeParentOf(redirectedConstructor); 3176 this._redirectedConstructor = becomeParentOf(redirectedConstructor);
3380 this._body = becomeParentOf(body); 3177 this._body = becomeParentOf(body);
3381 } 3178 }
3382 3179
3383 /**
3384 * Initialize a newly created constructor declaration.
3385 *
3386 * @param externalKeyword the token for the 'external' keyword
3387 * @param comment the documentation comment associated with this constructor
3388 * @param metadata the annotations associated with this constructor
3389 * @param constKeyword the token for the 'const' keyword
3390 * @param factoryKeyword the token for the 'factory' keyword
3391 * @param returnType the return type of the constructor
3392 * @param period the token for the period before the constructor name
3393 * @param name the name of the constructor
3394 * @param parameters the parameters associated with the constructor
3395 * @param separator the token for the colon or equals before the initializers
3396 * @param initializers the initializers associated with the constructor
3397 * @param redirectedConstructor the name of the constructor to which this cons tructor will be
3398 * redirected
3399 * @param body the body of the constructor
3400 */
3401 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);
3402
3403 accept(ASTVisitor visitor) => visitor.visitConstructorDeclaration(this); 3180 accept(ASTVisitor visitor) => visitor.visitConstructorDeclaration(this);
3404 3181
3405 /** 3182 /**
3406 * Return the body of the constructor, or `null` if the constructor does not h ave a body. 3183 * Return the body of the constructor, or `null` if the constructor does not h ave a body.
3407 * 3184 *
3408 * @return the body of the constructor 3185 * @return the body of the constructor
3409 */ 3186 */
3410 FunctionBody get body => _body; 3187 FunctionBody get body => _body;
3411 3188
3412 ConstructorElement get element => _element;
3413
3414 Token get endToken { 3189 Token get endToken {
3415 if (_body != null) { 3190 if (_body != null) {
3416 return _body.endToken; 3191 return _body.endToken;
3417 } else if (!initializers.isEmpty) { 3192 } else if (!_initializers.isEmpty) {
3418 return initializers.endToken; 3193 return _initializers.endToken;
3419 } 3194 }
3420 return _parameters.endToken; 3195 return _parameters.endToken;
3421 } 3196 }
3422 3197
3423 /** 3198 /**
3199 * Return the initializers associated with the constructor.
3200 *
3201 * @return the initializers associated with the constructor
3202 */
3203 NodeList<ConstructorInitializer> get initializers => _initializers;
3204
3205 /**
3424 * Return the name of the constructor, or `null` if the constructor being decl ared is 3206 * Return the name of the constructor, or `null` if the constructor being decl ared is
3425 * unnamed. 3207 * unnamed.
3426 * 3208 *
3427 * @return the name of the constructor 3209 * @return the name of the constructor
3428 */ 3210 */
3429 SimpleIdentifier get name => _name; 3211 SimpleIdentifier get name => _name;
3430 3212
3431 /** 3213 /**
3432 * Return the parameters associated with the constructor. 3214 * Return the parameters associated with the constructor.
3433 * 3215 *
(...skipping 21 matching lines...) Expand all
3455 /** 3237 /**
3456 * Set the body of the constructor to the given function body. 3238 * Set the body of the constructor to the given function body.
3457 * 3239 *
3458 * @param functionBody the body of the constructor 3240 * @param functionBody the body of the constructor
3459 */ 3241 */
3460 void set body(FunctionBody functionBody) { 3242 void set body(FunctionBody functionBody) {
3461 _body = becomeParentOf(functionBody); 3243 _body = becomeParentOf(functionBody);
3462 } 3244 }
3463 3245
3464 /** 3246 /**
3465 * Set the element associated with this constructor to the given element.
3466 *
3467 * @param element the element associated with this constructor
3468 */
3469 void set element(ConstructorElement element) {
3470 this._element = element;
3471 }
3472
3473 /**
3474 * Set the name of the constructor to the given identifier. 3247 * Set the name of the constructor to the given identifier.
3475 * 3248 *
3476 * @param identifier the name of the constructor 3249 * @param identifier the name of the constructor
3477 */ 3250 */
3478 void set name(SimpleIdentifier identifier) { 3251 void set name(SimpleIdentifier identifier) {
3479 _name = becomeParentOf(identifier); 3252 _name = becomeParentOf(identifier);
3480 } 3253 }
3481 3254
3482 /** 3255 /**
3483 * Set the parameters associated with the constructor to the given list of par ameters. 3256 * Set the parameters associated with the constructor to the given list of par ameters.
(...skipping 22 matching lines...) Expand all
3506 */ 3279 */
3507 void set returnType(Identifier typeName) { 3280 void set returnType(Identifier typeName) {
3508 _returnType = becomeParentOf(typeName); 3281 _returnType = becomeParentOf(typeName);
3509 } 3282 }
3510 3283
3511 void visitChildren(ASTVisitor visitor) { 3284 void visitChildren(ASTVisitor visitor) {
3512 super.visitChildren(visitor); 3285 super.visitChildren(visitor);
3513 safelyVisitChild(_returnType, visitor); 3286 safelyVisitChild(_returnType, visitor);
3514 safelyVisitChild(_name, visitor); 3287 safelyVisitChild(_name, visitor);
3515 safelyVisitChild(_parameters, visitor); 3288 safelyVisitChild(_parameters, visitor);
3516 initializers.accept(visitor); 3289 _initializers.accept(visitor);
3517 safelyVisitChild(_redirectedConstructor, visitor); 3290 safelyVisitChild(_redirectedConstructor, visitor);
3518 safelyVisitChild(_body, visitor); 3291 safelyVisitChild(_body, visitor);
3519 } 3292 }
3520 3293
3521 Token get firstTokenAfterCommentAndMetadata { 3294 Token get firstTokenAfterCommentAndMetadata {
3522 Token leftMost = this.leftMost([externalKeyword, constKeyword, factoryKeywor d]); 3295 Token leftMost = this.leftMost([externalKeyword, constKeyword, factoryKeywor d]);
3523 if (leftMost != null) { 3296 if (leftMost != null) {
3524 return leftMost; 3297 return leftMost;
3525 } 3298 }
3526 return _returnType.beginToken; 3299 return _returnType.beginToken;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
3586 /** 3359 /**
3587 * Initialize a newly created field initializer to initialize the field with t he given name to the 3360 * Initialize a newly created field initializer to initialize the field with t he given name to the
3588 * value of the given expression. 3361 * value of the given expression.
3589 * 3362 *
3590 * @param keyword the token for the 'this' keyword 3363 * @param keyword the token for the 'this' keyword
3591 * @param period the token for the period after the 'this' keyword 3364 * @param period the token for the period after the 'this' keyword
3592 * @param fieldName the name of the field being initialized 3365 * @param fieldName the name of the field being initialized
3593 * @param equals the token for the equal sign between the field name and the e xpression 3366 * @param equals the token for the equal sign between the field name and the e xpression
3594 * @param expression the expression computing the value to which the field wil l be initialized 3367 * @param expression the expression computing the value to which the field wil l be initialized
3595 */ 3368 */
3596 ConstructorFieldInitializer.full(Token keyword, Token period, SimpleIdentifier fieldName, Token equals, Expression expression) { 3369 ConstructorFieldInitializer(this.keyword, this.period, SimpleIdentifier fieldN ame, this.equals, Expression expression) {
3597 this.keyword = keyword;
3598 this.period = period;
3599 this._fieldName = becomeParentOf(fieldName); 3370 this._fieldName = becomeParentOf(fieldName);
3600 this.equals = equals;
3601 this._expression = becomeParentOf(expression); 3371 this._expression = becomeParentOf(expression);
3602 } 3372 }
3603 3373
3604 /**
3605 * Initialize a newly created field initializer to initialize the field with t he given name to the
3606 * value of the given expression.
3607 *
3608 * @param keyword the token for the 'this' keyword
3609 * @param period the token for the period after the 'this' keyword
3610 * @param fieldName the name of the field being initialized
3611 * @param equals the token for the equal sign between the field name and the e xpression
3612 * @param expression the expression computing the value to which the field wil l be initialized
3613 */
3614 ConstructorFieldInitializer({Token keyword, Token period, SimpleIdentifier fie ldName, Token equals, Expression expression}) : this.full(keyword, period, field Name, equals, expression);
3615
3616 accept(ASTVisitor visitor) => visitor.visitConstructorFieldInitializer(this); 3374 accept(ASTVisitor visitor) => visitor.visitConstructorFieldInitializer(this);
3617 3375
3618 Token get beginToken { 3376 Token get beginToken {
3619 if (keyword != null) { 3377 if (keyword != null) {
3620 return keyword; 3378 return keyword;
3621 } 3379 }
3622 return _fieldName.beginToken; 3380 return _fieldName.beginToken;
3623 } 3381 }
3624 3382
3625 Token get endToken => _expression.endToken; 3383 Token get endToken => _expression.endToken;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
3713 */ 3471 */
3714 ConstructorElement _staticElement; 3472 ConstructorElement _staticElement;
3715 3473
3716 /** 3474 /**
3717 * Initialize a newly created constructor name. 3475 * Initialize a newly created constructor name.
3718 * 3476 *
3719 * @param type the name of the type defining the constructor 3477 * @param type the name of the type defining the constructor
3720 * @param period the token for the period before the constructor name 3478 * @param period the token for the period before the constructor name
3721 * @param name the name of the constructor 3479 * @param name the name of the constructor
3722 */ 3480 */
3723 ConstructorName.full(TypeName type, Token period, SimpleIdentifier name) { 3481 ConstructorName(TypeName type, this.period, SimpleIdentifier name) {
3724 this._type = becomeParentOf(type); 3482 this._type = becomeParentOf(type);
3725 this.period = period;
3726 this._name = becomeParentOf(name); 3483 this._name = becomeParentOf(name);
3727 } 3484 }
3728 3485
3729 /**
3730 * Initialize a newly created constructor name.
3731 *
3732 * @param type the name of the type defining the constructor
3733 * @param period the token for the period before the constructor name
3734 * @param name the name of the constructor
3735 */
3736 ConstructorName({TypeName type, Token period, SimpleIdentifier name}) : this.f ull(type, period, name);
3737
3738 accept(ASTVisitor visitor) => visitor.visitConstructorName(this); 3486 accept(ASTVisitor visitor) => visitor.visitConstructorName(this);
3739 3487
3740 Token get beginToken => _type.beginToken; 3488 Token get beginToken => _type.beginToken;
3741 3489
3742 Token get endToken { 3490 Token get endToken {
3743 if (_name != null) { 3491 if (_name != null) {
3744 return _name.endToken; 3492 return _name.endToken;
3745 } 3493 }
3746 return _type.endToken; 3494 return _type.endToken;
3747 } 3495 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
3830 */ 3578 */
3831 Token semicolon; 3579 Token semicolon;
3832 3580
3833 /** 3581 /**
3834 * Initialize a newly created continue statement. 3582 * Initialize a newly created continue statement.
3835 * 3583 *
3836 * @param keyword the token representing the 'continue' keyword 3584 * @param keyword the token representing the 'continue' keyword
3837 * @param label the label associated with the statement 3585 * @param label the label associated with the statement
3838 * @param semicolon the semicolon terminating the statement 3586 * @param semicolon the semicolon terminating the statement
3839 */ 3587 */
3840 ContinueStatement.full(Token keyword, SimpleIdentifier label, Token semicolon) { 3588 ContinueStatement(this.keyword, SimpleIdentifier label, this.semicolon) {
3841 this.keyword = keyword;
3842 this._label = becomeParentOf(label); 3589 this._label = becomeParentOf(label);
3843 this.semicolon = semicolon;
3844 } 3590 }
3845 3591
3846 /**
3847 * Initialize a newly created continue statement.
3848 *
3849 * @param keyword the token representing the 'continue' keyword
3850 * @param label the label associated with the statement
3851 * @param semicolon the semicolon terminating the statement
3852 */
3853 ContinueStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : this.full(keyword, label, semicolon);
3854
3855 accept(ASTVisitor visitor) => visitor.visitContinueStatement(this); 3592 accept(ASTVisitor visitor) => visitor.visitContinueStatement(this);
3856 3593
3857 Token get beginToken => keyword; 3594 Token get beginToken => keyword;
3858 3595
3859 Token get endToken => semicolon; 3596 Token get endToken => semicolon;
3860 3597
3861 /** 3598 /**
3862 * Return the label associated with the statement, or `null` if there is no la bel. 3599 * Return the label associated with the statement, or `null` if there is no la bel.
3863 * 3600 *
3864 * @return the label associated with the statement 3601 * @return the label associated with the statement
(...skipping 20 matching lines...) Expand all
3885 * 3622 *
3886 * @coverage dart.engine.ast 3623 * @coverage dart.engine.ast
3887 */ 3624 */
3888 abstract class Declaration extends AnnotatedNode { 3625 abstract class Declaration extends AnnotatedNode {
3889 /** 3626 /**
3890 * Initialize a newly created declaration. 3627 * Initialize a newly created declaration.
3891 * 3628 *
3892 * @param comment the documentation comment associated with this declaration 3629 * @param comment the documentation comment associated with this declaration
3893 * @param metadata the annotations associated with this declaration 3630 * @param metadata the annotations associated with this declaration
3894 */ 3631 */
3895 Declaration.full(Comment comment, List<Annotation> metadata) : super.full(comm ent, metadata); 3632 Declaration(Comment comment, List<Annotation> metadata) : super(comment, metad ata);
3896
3897 /**
3898 * Initialize a newly created declaration.
3899 *
3900 * @param comment the documentation comment associated with this declaration
3901 * @param metadata the annotations associated with this declaration
3902 */
3903 Declaration({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata);
3904 3633
3905 /** 3634 /**
3906 * Return the element associated with this declaration, or `null` if either th is node 3635 * Return the element associated with this declaration, or `null` if either th is node
3907 * corresponds to a list of declarations or if the AST structure has not been resolved. 3636 * corresponds to a list of declarations or if the AST structure has not been resolved.
3908 * 3637 *
3909 * @return the element associated with this declaration 3638 * @return the element associated with this declaration
3910 */ 3639 */
3911 Element get element; 3640 Element get element;
3912 } 3641 }
3913 3642
(...skipping 17 matching lines...) Expand all
3931 3660
3932 /** 3661 /**
3933 * The name of the declared type of the parameter, or `null` if the parameter does not have 3662 * The name of the declared type of the parameter, or `null` if the parameter does not have
3934 * a declared type. 3663 * a declared type.
3935 */ 3664 */
3936 TypeName _type; 3665 TypeName _type;
3937 3666
3938 /** 3667 /**
3939 * The name of the variable being declared. 3668 * The name of the variable being declared.
3940 */ 3669 */
3941 SimpleIdentifier identifier; 3670 SimpleIdentifier _identifier;
3942 3671
3943 /** 3672 /**
3944 * Initialize a newly created formal parameter. 3673 * Initialize a newly created formal parameter.
3945 * 3674 *
3946 * @param comment the documentation comment associated with this parameter 3675 * @param comment the documentation comment associated with this parameter
3947 * @param metadata the annotations associated with this parameter 3676 * @param metadata the annotations associated with this parameter
3948 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 3677 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
3949 * @param type the name of the declared type of the parameter 3678 * @param type the name of the declared type of the parameter
3950 * @param identifier the name of the parameter being declared 3679 * @param identifier the name of the parameter being declared
3951 */ 3680 */
3952 DeclaredIdentifier.full(Comment comment, List<Annotation> metadata, Token keyw ord, TypeName type, SimpleIdentifier identifier) : super.full(comment, metadata) { 3681 DeclaredIdentifier(Comment comment, List<Annotation> metadata, this.keyword, T ypeName type, SimpleIdentifier identifier) : super(comment, metadata) {
3953 this.keyword = keyword;
3954 this._type = becomeParentOf(type); 3682 this._type = becomeParentOf(type);
3955 this.identifier = becomeParentOf(identifier); 3683 this._identifier = becomeParentOf(identifier);
3956 } 3684 }
3957 3685
3958 /**
3959 * Initialize a newly created formal parameter.
3960 *
3961 * @param comment the documentation comment associated with this parameter
3962 * @param metadata the annotations associated with this parameter
3963 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
3964 * @param type the name of the declared type of the parameter
3965 * @param identifier the name of the parameter being declared
3966 */
3967 DeclaredIdentifier({Comment comment, List<Annotation> metadata, Token keyword, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, key word, type, identifier);
3968
3969 accept(ASTVisitor visitor) => visitor.visitDeclaredIdentifier(this); 3686 accept(ASTVisitor visitor) => visitor.visitDeclaredIdentifier(this);
3970 3687
3971 LocalVariableElement get element { 3688 LocalVariableElement get element {
3972 SimpleIdentifier identifier = this.identifier; 3689 SimpleIdentifier identifier = this.identifier;
3973 if (identifier == null) { 3690 if (identifier == null) {
3974 return null; 3691 return null;
3975 } 3692 }
3976 return identifier.staticElement as LocalVariableElement; 3693 return identifier.staticElement as LocalVariableElement;
3977 } 3694 }
3978 3695
3979 Token get endToken => identifier.endToken; 3696 Token get endToken => _identifier.endToken;
3697
3698 /**
3699 * Return the name of the variable being declared.
3700 *
3701 * @return the name of the variable being declared
3702 */
3703 SimpleIdentifier get identifier => _identifier;
3980 3704
3981 /** 3705 /**
3982 * Return the name of the declared type of the parameter, or `null` if the par ameter does 3706 * Return the name of the declared type of the parameter, or `null` if the par ameter does
3983 * not have a declared type. 3707 * not have a declared type.
3984 * 3708 *
3985 * @return the name of the declared type of the parameter 3709 * @return the name of the declared type of the parameter
3986 */ 3710 */
3987 TypeName get type => _type; 3711 TypeName get type => _type;
3988 3712
3989 /** 3713 /**
(...skipping 17 matching lines...) Expand all
4007 * 3731 *
4008 * @param typeName the name of the declared type of the parameter 3732 * @param typeName the name of the declared type of the parameter
4009 */ 3733 */
4010 void set type(TypeName typeName) { 3734 void set type(TypeName typeName) {
4011 _type = becomeParentOf(typeName); 3735 _type = becomeParentOf(typeName);
4012 } 3736 }
4013 3737
4014 void visitChildren(ASTVisitor visitor) { 3738 void visitChildren(ASTVisitor visitor) {
4015 super.visitChildren(visitor); 3739 super.visitChildren(visitor);
4016 safelyVisitChild(_type, visitor); 3740 safelyVisitChild(_type, visitor);
4017 safelyVisitChild(identifier, visitor); 3741 safelyVisitChild(_identifier, visitor);
4018 } 3742 }
4019 3743
4020 Token get firstTokenAfterCommentAndMetadata { 3744 Token get firstTokenAfterCommentAndMetadata {
4021 if (keyword != null) { 3745 if (keyword != null) {
4022 return keyword; 3746 return keyword;
4023 } else if (_type != null) { 3747 } else if (_type != null) {
4024 return _type.beginToken; 3748 return _type.beginToken;
4025 } 3749 }
4026 return identifier.beginToken; 3750 return _identifier.beginToken;
4027 } 3751 }
4028 } 3752 }
4029 3753
4030 /** 3754 /**
4031 * Instances of the class `DefaultFormalParameter` represent a formal parameter with a default 3755 * Instances of the class `DefaultFormalParameter` represent a formal parameter with a default
4032 * value. There are two kinds of parameters that are both represented by this cl ass: named formal 3756 * value. There are two kinds of parameters that are both represented by this cl ass: named formal
4033 * parameters and positional formal parameters. 3757 * parameters and positional formal parameters.
4034 * 3758 *
4035 * <pre> 3759 * <pre>
4036 * defaultFormalParameter ::= 3760 * defaultFormalParameter ::=
4037 * [NormalFormalParameter] ('=' [Expression])? 3761 * [NormalFormalParameter] ('=' [Expression])?
4038 * 3762 *
4039 * defaultNamedParameter ::= 3763 * defaultNamedParameter ::=
4040 * [NormalFormalParameter] (':' [Expression])? 3764 * [NormalFormalParameter] (':' [Expression])?
4041 * </pre> 3765 * </pre>
4042 * 3766 *
4043 * @coverage dart.engine.ast 3767 * @coverage dart.engine.ast
4044 */ 3768 */
4045 class DefaultFormalParameter extends FormalParameter { 3769 class DefaultFormalParameter extends FormalParameter {
4046 /** 3770 /**
4047 * The formal parameter with which the default value is associated. 3771 * The formal parameter with which the default value is associated.
4048 */ 3772 */
4049 NormalFormalParameter _parameter; 3773 NormalFormalParameter _parameter;
4050 3774
4051 /** 3775 /**
4052 * The kind of this parameter. 3776 * The kind of this parameter.
4053 */ 3777 */
4054 ParameterKind _kind; 3778 ParameterKind kind;
4055 3779
4056 /** 3780 /**
4057 * The token separating the parameter from the default value, or `null` if the re is no 3781 * The token separating the parameter from the default value, or `null` if the re is no
4058 * default value. 3782 * default value.
4059 */ 3783 */
4060 Token separator; 3784 Token separator;
4061 3785
4062 /** 3786 /**
4063 * The expression computing the default value for the parameter, or `null` if there is no 3787 * The expression computing the default value for the parameter, or `null` if there is no
4064 * default value. 3788 * default value.
4065 */ 3789 */
4066 Expression _defaultValue; 3790 Expression _defaultValue;
4067 3791
4068 /** 3792 /**
4069 * Initialize a newly created default formal parameter. 3793 * Initialize a newly created default formal parameter.
4070 * 3794 *
4071 * @param parameter the formal parameter with which the default value is assoc iated 3795 * @param parameter the formal parameter with which the default value is assoc iated
4072 * @param kind the kind of this parameter 3796 * @param kind the kind of this parameter
4073 * @param separator the token separating the parameter from the default value 3797 * @param separator the token separating the parameter from the default value
4074 * @param defaultValue the expression computing the default value for the para meter 3798 * @param defaultValue the expression computing the default value for the para meter
4075 */ 3799 */
4076 DefaultFormalParameter.full(NormalFormalParameter parameter, ParameterKind kin d, Token separator, Expression defaultValue) { 3800 DefaultFormalParameter(NormalFormalParameter parameter, this.kind, this.separa tor, Expression defaultValue) {
4077 this._parameter = becomeParentOf(parameter); 3801 this._parameter = becomeParentOf(parameter);
4078 this._kind = kind;
4079 this.separator = separator;
4080 this._defaultValue = becomeParentOf(defaultValue); 3802 this._defaultValue = becomeParentOf(defaultValue);
4081 } 3803 }
4082 3804
4083 /**
4084 * Initialize a newly created default formal parameter.
4085 *
4086 * @param parameter the formal parameter with which the default value is assoc iated
4087 * @param kind the kind of this parameter
4088 * @param separator the token separating the parameter from the default value
4089 * @param defaultValue the expression computing the default value for the para meter
4090 */
4091 DefaultFormalParameter({NormalFormalParameter parameter, ParameterKind kind, T oken separator, Expression defaultValue}) : this.full(parameter, kind, separator , defaultValue);
4092
4093 accept(ASTVisitor visitor) => visitor.visitDefaultFormalParameter(this); 3805 accept(ASTVisitor visitor) => visitor.visitDefaultFormalParameter(this);
4094 3806
4095 Token get beginToken => _parameter.beginToken; 3807 Token get beginToken => _parameter.beginToken;
4096 3808
4097 /** 3809 /**
4098 * Return the expression computing the default value for the parameter, or `nu ll` if there 3810 * Return the expression computing the default value for the parameter, or `nu ll` if there
4099 * is no default value. 3811 * is no default value.
4100 * 3812 *
4101 * @return the expression computing the default value for the parameter 3813 * @return the expression computing the default value for the parameter
4102 */ 3814 */
4103 Expression get defaultValue => _defaultValue; 3815 Expression get defaultValue => _defaultValue;
4104 3816
4105 Token get endToken { 3817 Token get endToken {
4106 if (_defaultValue != null) { 3818 if (_defaultValue != null) {
4107 return _defaultValue.endToken; 3819 return _defaultValue.endToken;
4108 } 3820 }
4109 return _parameter.endToken; 3821 return _parameter.endToken;
4110 } 3822 }
4111 3823
4112 SimpleIdentifier get identifier => _parameter.identifier; 3824 SimpleIdentifier get identifier => _parameter.identifier;
4113 3825
4114 ParameterKind get kind => _kind;
4115
4116 /** 3826 /**
4117 * Return the formal parameter with which the default value is associated. 3827 * Return the formal parameter with which the default value is associated.
4118 * 3828 *
4119 * @return the formal parameter with which the default value is associated 3829 * @return the formal parameter with which the default value is associated
4120 */ 3830 */
4121 NormalFormalParameter get parameter => _parameter; 3831 NormalFormalParameter get parameter => _parameter;
4122 3832
4123 bool get isConst => _parameter != null && _parameter.isConst; 3833 bool get isConst => _parameter != null && _parameter.isConst;
4124 3834
4125 bool get isFinal => _parameter != null && _parameter.isFinal; 3835 bool get isFinal => _parameter != null && _parameter.isFinal;
4126 3836
4127 /** 3837 /**
4128 * Set the expression computing the default value for the parameter to the giv en expression. 3838 * Set the expression computing the default value for the parameter to the giv en expression.
4129 * 3839 *
4130 * @param expression the expression computing the default value for the parame ter 3840 * @param expression the expression computing the default value for the parame ter
4131 */ 3841 */
4132 void set defaultValue(Expression expression) { 3842 void set defaultValue(Expression expression) {
4133 _defaultValue = becomeParentOf(expression); 3843 _defaultValue = becomeParentOf(expression);
4134 } 3844 }
4135 3845
4136 /** 3846 /**
4137 * Set the kind of this parameter to the given kind.
4138 *
4139 * @param kind the kind of this parameter
4140 */
4141 void set kind(ParameterKind kind) {
4142 this._kind = kind;
4143 }
4144
4145 /**
4146 * Set the formal parameter with which the default value is associated to the given parameter. 3847 * Set the formal parameter with which the default value is associated to the given parameter.
4147 * 3848 *
4148 * @param formalParameter the formal parameter with which the default value is associated 3849 * @param formalParameter the formal parameter with which the default value is associated
4149 */ 3850 */
4150 void set parameter(NormalFormalParameter formalParameter) { 3851 void set parameter(NormalFormalParameter formalParameter) {
4151 _parameter = becomeParentOf(formalParameter); 3852 _parameter = becomeParentOf(formalParameter);
4152 } 3853 }
4153 3854
4154 void visitChildren(ASTVisitor visitor) { 3855 void visitChildren(ASTVisitor visitor) {
4155 safelyVisitChild(_parameter, visitor); 3856 safelyVisitChild(_parameter, visitor);
(...skipping 22 matching lines...) Expand all
4178 * resolved or if this directive could not be resolved. 3879 * resolved or if this directive could not be resolved.
4179 */ 3880 */
4180 Element _element; 3881 Element _element;
4181 3882
4182 /** 3883 /**
4183 * Initialize a newly create directive. 3884 * Initialize a newly create directive.
4184 * 3885 *
4185 * @param comment the documentation comment associated with this directive 3886 * @param comment the documentation comment associated with this directive
4186 * @param metadata the annotations associated with the directive 3887 * @param metadata the annotations associated with the directive
4187 */ 3888 */
4188 Directive.full(Comment comment, List<Annotation> metadata) : super.full(commen t, metadata); 3889 Directive(Comment comment, List<Annotation> metadata) : super(comment, metadat a);
4189
4190 /**
4191 * Initialize a newly create directive.
4192 *
4193 * @param comment the documentation comment associated with this directive
4194 * @param metadata the annotations associated with the directive
4195 */
4196 Directive({Comment comment, List<Annotation> metadata}) : this.full(comment, m etadata);
4197 3890
4198 /** 3891 /**
4199 * Return the element associated with this directive, or `null` if the AST str ucture has not 3892 * Return the element associated with this directive, or `null` if the AST str ucture has not
4200 * been resolved or if this directive could not be resolved. Examples of the l atter case include a 3893 * been resolved or if this directive could not be resolved. Examples of the l atter case include a
4201 * directive that contains an invalid URL or a URL that does not exist. 3894 * directive that contains an invalid URL or a URL that does not exist.
4202 * 3895 *
4203 * @return the element associated with this directive 3896 * @return the element associated with this directive
4204 */ 3897 */
4205 Element get element => _element; 3898 Element get element => _element;
4206 3899
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
4272 * Initialize a newly created do loop. 3965 * Initialize a newly created do loop.
4273 * 3966 *
4274 * @param doKeyword the token representing the 'do' keyword 3967 * @param doKeyword the token representing the 'do' keyword
4275 * @param body the body of the loop 3968 * @param body the body of the loop
4276 * @param whileKeyword the token representing the 'while' keyword 3969 * @param whileKeyword the token representing the 'while' keyword
4277 * @param leftParenthesis the left parenthesis 3970 * @param leftParenthesis the left parenthesis
4278 * @param condition the condition that determines when the loop will terminate 3971 * @param condition the condition that determines when the loop will terminate
4279 * @param rightParenthesis the right parenthesis 3972 * @param rightParenthesis the right parenthesis
4280 * @param semicolon the semicolon terminating the statement 3973 * @param semicolon the semicolon terminating the statement
4281 */ 3974 */
4282 DoStatement.full(Token doKeyword, Statement body, Token whileKeyword, Token le ftParenthesis, Expression condition, Token rightParenthesis, Token semicolon) { 3975 DoStatement(this.doKeyword, Statement body, this.whileKeyword, Token leftParen thesis, Expression condition, Token rightParenthesis, this.semicolon) {
4283 this.doKeyword = doKeyword;
4284 this._body = becomeParentOf(body); 3976 this._body = becomeParentOf(body);
4285 this.whileKeyword = whileKeyword;
4286 this._leftParenthesis = leftParenthesis; 3977 this._leftParenthesis = leftParenthesis;
4287 this._condition = becomeParentOf(condition); 3978 this._condition = becomeParentOf(condition);
4288 this._rightParenthesis = rightParenthesis; 3979 this._rightParenthesis = rightParenthesis;
4289 this.semicolon = semicolon;
4290 } 3980 }
4291 3981
4292 /**
4293 * Initialize a newly created do loop.
4294 *
4295 * @param doKeyword the token representing the 'do' keyword
4296 * @param body the body of the loop
4297 * @param whileKeyword the token representing the 'while' keyword
4298 * @param leftParenthesis the left parenthesis
4299 * @param condition the condition that determines when the loop will terminate
4300 * @param rightParenthesis the right parenthesis
4301 * @param semicolon the semicolon terminating the statement
4302 */
4303 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);
4304
4305 accept(ASTVisitor visitor) => visitor.visitDoStatement(this); 3982 accept(ASTVisitor visitor) => visitor.visitDoStatement(this);
4306 3983
4307 Token get beginToken => doKeyword; 3984 Token get beginToken => doKeyword;
4308 3985
4309 /** 3986 /**
4310 * Return the body of the loop. 3987 * Return the body of the loop.
4311 * 3988 *
4312 * @return the body of the loop 3989 * @return the body of the loop
4313 */ 3990 */
4314 Statement get body => _body; 3991 Statement get body => _body;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
4402 * The value of the literal. 4079 * The value of the literal.
4403 */ 4080 */
4404 double value = 0.0; 4081 double value = 0.0;
4405 4082
4406 /** 4083 /**
4407 * Initialize a newly created floating point literal. 4084 * Initialize a newly created floating point literal.
4408 * 4085 *
4409 * @param literal the token representing the literal 4086 * @param literal the token representing the literal
4410 * @param value the value of the literal 4087 * @param value the value of the literal
4411 */ 4088 */
4412 DoubleLiteral.full(Token literal, double value) { 4089 DoubleLiteral(this.literal, this.value);
4413 this.literal = literal;
4414 this.value = value;
4415 }
4416
4417 /**
4418 * Initialize a newly created floating point literal.
4419 *
4420 * @param literal the token representing the literal
4421 * @param value the value of the literal
4422 */
4423 DoubleLiteral({Token literal, double value}) : this.full(literal, value);
4424 4090
4425 accept(ASTVisitor visitor) => visitor.visitDoubleLiteral(this); 4091 accept(ASTVisitor visitor) => visitor.visitDoubleLiteral(this);
4426 4092
4427 Token get beginToken => literal; 4093 Token get beginToken => literal;
4428 4094
4429 Token get endToken => literal; 4095 Token get endToken => literal;
4430 4096
4431 void visitChildren(ASTVisitor visitor) { 4097 void visitChildren(ASTVisitor visitor) {
4432 } 4098 }
4433 } 4099 }
(...skipping 13 matching lines...) Expand all
4447 /** 4113 /**
4448 * The token representing the semicolon that marks the end of the function bod y. 4114 * The token representing the semicolon that marks the end of the function bod y.
4449 */ 4115 */
4450 Token semicolon; 4116 Token semicolon;
4451 4117
4452 /** 4118 /**
4453 * Initialize a newly created function body. 4119 * Initialize a newly created function body.
4454 * 4120 *
4455 * @param semicolon the token representing the semicolon that marks the end of the function body 4121 * @param semicolon the token representing the semicolon that marks the end of the function body
4456 */ 4122 */
4457 EmptyFunctionBody.full(Token semicolon) { 4123 EmptyFunctionBody(this.semicolon);
4458 this.semicolon = semicolon;
4459 }
4460
4461 /**
4462 * Initialize a newly created function body.
4463 *
4464 * @param semicolon the token representing the semicolon that marks the end of the function body
4465 */
4466 EmptyFunctionBody({Token semicolon}) : this.full(semicolon);
4467 4124
4468 accept(ASTVisitor visitor) => visitor.visitEmptyFunctionBody(this); 4125 accept(ASTVisitor visitor) => visitor.visitEmptyFunctionBody(this);
4469 4126
4470 Token get beginToken => semicolon; 4127 Token get beginToken => semicolon;
4471 4128
4472 Token get endToken => semicolon; 4129 Token get endToken => semicolon;
4473 4130
4474 void visitChildren(ASTVisitor visitor) { 4131 void visitChildren(ASTVisitor visitor) {
4475 } 4132 }
4476 } 4133 }
(...skipping 12 matching lines...) Expand all
4489 /** 4146 /**
4490 * The semicolon terminating the statement. 4147 * The semicolon terminating the statement.
4491 */ 4148 */
4492 Token semicolon; 4149 Token semicolon;
4493 4150
4494 /** 4151 /**
4495 * Initialize a newly created empty statement. 4152 * Initialize a newly created empty statement.
4496 * 4153 *
4497 * @param semicolon the semicolon terminating the statement 4154 * @param semicolon the semicolon terminating the statement
4498 */ 4155 */
4499 EmptyStatement.full(Token semicolon) { 4156 EmptyStatement(this.semicolon);
4500 this.semicolon = semicolon;
4501 }
4502
4503 /**
4504 * Initialize a newly created empty statement.
4505 *
4506 * @param semicolon the semicolon terminating the statement
4507 */
4508 EmptyStatement({Token semicolon}) : this.full(semicolon);
4509 4157
4510 accept(ASTVisitor visitor) => visitor.visitEmptyStatement(this); 4158 accept(ASTVisitor visitor) => visitor.visitEmptyStatement(this);
4511 4159
4512 Token get beginToken => semicolon; 4160 Token get beginToken => semicolon;
4513 4161
4514 Token get endToken => semicolon; 4162 Token get endToken => semicolon;
4515 4163
4516 void visitChildren(ASTVisitor visitor) { 4164 void visitChildren(ASTVisitor visitor) {
4517 } 4165 }
4518 } 4166 }
4519 4167
4520 /** 4168 /**
4521 * Ephemeral identifiers are created as needed to mimic the presence of an empty identifier. 4169 * Ephemeral identifiers are created as needed to mimic the presence of an empty identifier.
4522 * 4170 *
4523 * @coverage dart.engine.ast 4171 * @coverage dart.engine.ast
4524 */ 4172 */
4525 class EphemeralIdentifier extends SimpleIdentifier { 4173 class EphemeralIdentifier extends SimpleIdentifier {
4526 EphemeralIdentifier.full(ASTNode parent, int location) : super.full(new String Token(TokenType.IDENTIFIER, "", location)) { 4174 EphemeralIdentifier(ASTNode parent, int location) : super(new StringToken(Toke nType.IDENTIFIER, "", location)) {
4527 parent.becomeParentOf(this); 4175 parent.becomeParentOf(this);
4528 } 4176 }
4529
4530 EphemeralIdentifier({ASTNode parent, int location}) : this.full(parent, locati on);
4531 } 4177 }
4532 4178
4533 /** 4179 /**
4534 * Instances of the class `ExportDirective` represent an export directive. 4180 * Instances of the class `ExportDirective` represent an export directive.
4535 * 4181 *
4536 * <pre> 4182 * <pre>
4537 * exportDirective ::= 4183 * exportDirective ::=
4538 * [Annotation] 'export' [StringLiteral] [Combinator]* ';' 4184 * [Annotation] 'export' [StringLiteral] [Combinator]* ';'
4539 * </pre> 4185 * </pre>
4540 * 4186 *
4541 * @coverage dart.engine.ast 4187 * @coverage dart.engine.ast
4542 */ 4188 */
4543 class ExportDirective extends NamespaceDirective { 4189 class ExportDirective extends NamespaceDirective {
4544 /** 4190 /**
4545 * Initialize a newly created export directive. 4191 * Initialize a newly created export directive.
4546 * 4192 *
4547 * @param comment the documentation comment associated with this directive 4193 * @param comment the documentation comment associated with this directive
4548 * @param metadata the annotations associated with the directive 4194 * @param metadata the annotations associated with the directive
4549 * @param keyword the token representing the 'export' keyword 4195 * @param keyword the token representing the 'export' keyword
4550 * @param libraryUri the URI of the library being exported 4196 * @param libraryUri the URI of the library being exported
4551 * @param combinators the combinators used to control which names are exported 4197 * @param combinators the combinators used to control which names are exported
4552 * @param semicolon the semicolon terminating the directive 4198 * @param semicolon the semicolon terminating the directive
4553 */ 4199 */
4554 ExportDirective.full(Comment comment, List<Annotation> metadata, Token keyword , StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) : sup er.full(comment, metadata, keyword, libraryUri, combinators, semicolon); 4200 ExportDirective(Comment comment, List<Annotation> metadata, Token keyword, Str ingLiteral libraryUri, List<Combinator> combinators, Token semicolon) : super(co mment, metadata, keyword, libraryUri, combinators, semicolon);
4555
4556 /**
4557 * Initialize a newly created export directive.
4558 *
4559 * @param comment the documentation comment associated with this directive
4560 * @param metadata the annotations associated with the directive
4561 * @param keyword the token representing the 'export' keyword
4562 * @param libraryUri the URI of the library being exported
4563 * @param combinators the combinators used to control which names are exported
4564 * @param semicolon the semicolon terminating the directive
4565 */
4566 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);
4567 4201
4568 accept(ASTVisitor visitor) => visitor.visitExportDirective(this); 4202 accept(ASTVisitor visitor) => visitor.visitExportDirective(this);
4569 4203
4570 LibraryElement get uriElement { 4204 LibraryElement get uriElement {
4571 Element element = this.element; 4205 Element element = this.element;
4572 if (element is ExportElement) { 4206 if (element is ExportElement) {
4573 return (element as ExportElement).exportedLibrary; 4207 return (element as ExportElement).exportedLibrary;
4574 } 4208 }
4575 return null; 4209 return null;
4576 } 4210 }
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
4763 Token semicolon; 4397 Token semicolon;
4764 4398
4765 /** 4399 /**
4766 * Initialize a newly created function body consisting of a block of statement s. 4400 * Initialize a newly created function body consisting of a block of statement s.
4767 * 4401 *
4768 * @param functionDefinition the token introducing the expression that represe nts the body of the 4402 * @param functionDefinition the token introducing the expression that represe nts the body of the
4769 * function 4403 * function
4770 * @param expression the expression representing the body of the function 4404 * @param expression the expression representing the body of the function
4771 * @param semicolon the semicolon terminating the statement 4405 * @param semicolon the semicolon terminating the statement
4772 */ 4406 */
4773 ExpressionFunctionBody.full(Token functionDefinition, Expression expression, T oken semicolon) { 4407 ExpressionFunctionBody(this.functionDefinition, Expression expression, this.se micolon) {
4774 this.functionDefinition = functionDefinition;
4775 this._expression = becomeParentOf(expression); 4408 this._expression = becomeParentOf(expression);
4776 this.semicolon = semicolon;
4777 } 4409 }
4778 4410
4779 /**
4780 * Initialize a newly created function body consisting of a block of statement s.
4781 *
4782 * @param functionDefinition the token introducing the expression that represe nts the body of the
4783 * function
4784 * @param expression the expression representing the body of the function
4785 * @param semicolon the semicolon terminating the statement
4786 */
4787 ExpressionFunctionBody({Token functionDefinition, Expression expression, Token semicolon}) : this.full(functionDefinition, expression, semicolon);
4788
4789 accept(ASTVisitor visitor) => visitor.visitExpressionFunctionBody(this); 4411 accept(ASTVisitor visitor) => visitor.visitExpressionFunctionBody(this);
4790 4412
4791 Token get beginToken => functionDefinition; 4413 Token get beginToken => functionDefinition;
4792 4414
4793 Token get endToken { 4415 Token get endToken {
4794 if (semicolon != null) { 4416 if (semicolon != null) {
4795 return semicolon; 4417 return semicolon;
4796 } 4418 }
4797 return _expression.endToken; 4419 return _expression.endToken;
4798 } 4420 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
4839 * expression and therefore isn't followed by a semicolon. 4461 * expression and therefore isn't followed by a semicolon.
4840 */ 4462 */
4841 Token semicolon; 4463 Token semicolon;
4842 4464
4843 /** 4465 /**
4844 * Initialize a newly created expression statement. 4466 * Initialize a newly created expression statement.
4845 * 4467 *
4846 * @param expression the expression that comprises the statement 4468 * @param expression the expression that comprises the statement
4847 * @param semicolon the semicolon terminating the statement 4469 * @param semicolon the semicolon terminating the statement
4848 */ 4470 */
4849 ExpressionStatement.full(Expression expression, Token semicolon) { 4471 ExpressionStatement(Expression expression, this.semicolon) {
4850 this._expression = becomeParentOf(expression); 4472 this._expression = becomeParentOf(expression);
4851 this.semicolon = semicolon;
4852 } 4473 }
4853 4474
4854 /**
4855 * Initialize a newly created expression statement.
4856 *
4857 * @param expression the expression that comprises the statement
4858 * @param semicolon the semicolon terminating the statement
4859 */
4860 ExpressionStatement({Expression expression, Token semicolon}) : this.full(expr ession, semicolon);
4861
4862 accept(ASTVisitor visitor) => visitor.visitExpressionStatement(this); 4475 accept(ASTVisitor visitor) => visitor.visitExpressionStatement(this);
4863 4476
4864 Token get beginToken => _expression.beginToken; 4477 Token get beginToken => _expression.beginToken;
4865 4478
4866 Token get endToken { 4479 Token get endToken {
4867 if (semicolon != null) { 4480 if (semicolon != null) {
4868 return semicolon; 4481 return semicolon;
4869 } 4482 }
4870 return _expression.endToken; 4483 return _expression.endToken;
4871 } 4484 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
4914 * The name of the class that is being extended. 4527 * The name of the class that is being extended.
4915 */ 4528 */
4916 TypeName _superclass; 4529 TypeName _superclass;
4917 4530
4918 /** 4531 /**
4919 * Initialize a newly created extends clause. 4532 * Initialize a newly created extends clause.
4920 * 4533 *
4921 * @param keyword the token representing the 'extends' keyword 4534 * @param keyword the token representing the 'extends' keyword
4922 * @param superclass the name of the class that is being extended 4535 * @param superclass the name of the class that is being extended
4923 */ 4536 */
4924 ExtendsClause.full(Token keyword, TypeName superclass) { 4537 ExtendsClause(this.keyword, TypeName superclass) {
4925 this.keyword = keyword;
4926 this._superclass = becomeParentOf(superclass); 4538 this._superclass = becomeParentOf(superclass);
4927 } 4539 }
4928 4540
4929 /**
4930 * Initialize a newly created extends clause.
4931 *
4932 * @param keyword the token representing the 'extends' keyword
4933 * @param superclass the name of the class that is being extended
4934 */
4935 ExtendsClause({Token keyword, TypeName superclass}) : this.full(keyword, super class);
4936
4937 accept(ASTVisitor visitor) => visitor.visitExtendsClause(this); 4541 accept(ASTVisitor visitor) => visitor.visitExtendsClause(this);
4938 4542
4939 Token get beginToken => keyword; 4543 Token get beginToken => keyword;
4940 4544
4941 Token get endToken => _superclass.endToken; 4545 Token get endToken => _superclass.endToken;
4942 4546
4943 /** 4547 /**
4944 * Return the name of the class that is being extended. 4548 * Return the name of the class that is being extended.
4945 * 4549 *
4946 * @return the name of the class that is being extended 4550 * @return the name of the class that is being extended
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
4990 4594
4991 /** 4595 /**
4992 * Initialize a newly created field declaration. 4596 * Initialize a newly created field declaration.
4993 * 4597 *
4994 * @param comment the documentation comment associated with this field 4598 * @param comment the documentation comment associated with this field
4995 * @param metadata the annotations associated with this field 4599 * @param metadata the annotations associated with this field
4996 * @param staticKeyword the token representing the 'static' keyword 4600 * @param staticKeyword the token representing the 'static' keyword
4997 * @param fieldList the fields being declared 4601 * @param fieldList the fields being declared
4998 * @param semicolon the semicolon terminating the declaration 4602 * @param semicolon the semicolon terminating the declaration
4999 */ 4603 */
5000 FieldDeclaration.full(Comment comment, List<Annotation> metadata, Token static Keyword, VariableDeclarationList fieldList, Token semicolon) : super.full(commen t, metadata) { 4604 FieldDeclaration(Comment comment, List<Annotation> metadata, this.staticKeywor d, VariableDeclarationList fieldList, this.semicolon) : super(comment, metadata) {
5001 this.staticKeyword = staticKeyword;
5002 this._fieldList = becomeParentOf(fieldList); 4605 this._fieldList = becomeParentOf(fieldList);
5003 this.semicolon = semicolon;
5004 } 4606 }
5005 4607
5006 /**
5007 * Initialize a newly created field declaration.
5008 *
5009 * @param comment the documentation comment associated with this field
5010 * @param metadata the annotations associated with this field
5011 * @param staticKeyword the token representing the 'static' keyword
5012 * @param fieldList the fields being declared
5013 * @param semicolon the semicolon terminating the declaration
5014 */
5015 FieldDeclaration({Comment comment, List<Annotation> metadata, Token staticKeyw ord, VariableDeclarationList fieldList, Token semicolon}) : this.full(comment, m etadata, staticKeyword, fieldList, semicolon);
5016
5017 accept(ASTVisitor visitor) => visitor.visitFieldDeclaration(this); 4608 accept(ASTVisitor visitor) => visitor.visitFieldDeclaration(this);
5018 4609
5019 Element get element => null; 4610 Element get element => null;
5020 4611
5021 Token get endToken => semicolon; 4612 Token get endToken => semicolon;
5022 4613
5023 /** 4614 /**
5024 * Return the fields being declared. 4615 * Return the fields being declared.
5025 * 4616 *
5026 * @return the fields being declared 4617 * @return the fields being declared
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
5101 * @param comment the documentation comment associated with this parameter 4692 * @param comment the documentation comment associated with this parameter
5102 * @param metadata the annotations associated with this parameter 4693 * @param metadata the annotations associated with this parameter
5103 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 4694 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
5104 * @param type the name of the declared type of the parameter 4695 * @param type the name of the declared type of the parameter
5105 * @param thisToken the token representing the 'this' keyword 4696 * @param thisToken the token representing the 'this' keyword
5106 * @param period the token representing the period 4697 * @param period the token representing the period
5107 * @param identifier the name of the parameter being declared 4698 * @param identifier the name of the parameter being declared
5108 * @param parameters the parameters of the function-typed parameter, or `null` if this is 4699 * @param parameters the parameters of the function-typed parameter, or `null` if this is
5109 * not a function-typed field formal parameter 4700 * not a function-typed field formal parameter
5110 */ 4701 */
5111 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) { 4702 FieldFormalParameter(Comment comment, List<Annotation> metadata, this.keyword, TypeName type, this.thisToken, this.period, SimpleIdentifier identifier, Formal ParameterList parameters) : super(comment, metadata, identifier) {
5112 this.keyword = keyword;
5113 this._type = becomeParentOf(type); 4703 this._type = becomeParentOf(type);
5114 this.thisToken = thisToken;
5115 this.period = period;
5116 this._parameters = becomeParentOf(parameters); 4704 this._parameters = becomeParentOf(parameters);
5117 } 4705 }
5118 4706
5119 /**
5120 * Initialize a newly created formal parameter.
5121 *
5122 * @param comment the documentation comment associated with this parameter
5123 * @param metadata the annotations associated with this parameter
5124 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
5125 * @param type the name of the declared type of the parameter
5126 * @param thisToken the token representing the 'this' keyword
5127 * @param period the token representing the period
5128 * @param identifier the name of the parameter being declared
5129 * @param parameters the parameters of the function-typed parameter, or `null` if this is
5130 * not a function-typed field formal parameter
5131 */
5132 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);
5133
5134 accept(ASTVisitor visitor) => visitor.visitFieldFormalParameter(this); 4707 accept(ASTVisitor visitor) => visitor.visitFieldFormalParameter(this);
5135 4708
5136 Token get beginToken { 4709 Token get beginToken {
5137 if (keyword != null) { 4710 if (keyword != null) {
5138 return keyword; 4711 return keyword;
5139 } else if (_type != null) { 4712 } else if (_type != null) {
5140 return _type.beginToken; 4713 return _type.beginToken;
5141 } 4714 }
5142 return thisToken; 4715 return thisToken;
5143 } 4716 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
5247 /** 4820 /**
5248 * Initialize a newly created for-each statement. 4821 * Initialize a newly created for-each statement.
5249 * 4822 *
5250 * @param forKeyword the token representing the 'for' keyword 4823 * @param forKeyword the token representing the 'for' keyword
5251 * @param leftParenthesis the left parenthesis 4824 * @param leftParenthesis the left parenthesis
5252 * @param loopVariable the declaration of the loop variable 4825 * @param loopVariable the declaration of the loop variable
5253 * @param iterator the expression evaluated to produce the iterator 4826 * @param iterator the expression evaluated to produce the iterator
5254 * @param rightParenthesis the right parenthesis 4827 * @param rightParenthesis the right parenthesis
5255 * @param body the body of the loop 4828 * @param body the body of the loop
5256 */ 4829 */
5257 ForEachStatement.con1_full(Token forKeyword, Token leftParenthesis, DeclaredId entifier loopVariable, Token inKeyword, Expression iterator, Token rightParenthe sis, Statement body) { 4830 ForEachStatement.con1(this.forKeyword, this.leftParenthesis, DeclaredIdentifie r loopVariable, this.inKeyword, Expression iterator, this.rightParenthesis, Stat ement body) {
5258 this.forKeyword = forKeyword;
5259 this.leftParenthesis = leftParenthesis;
5260 this._loopVariable = becomeParentOf(loopVariable); 4831 this._loopVariable = becomeParentOf(loopVariable);
5261 this.inKeyword = inKeyword;
5262 this._iterator = becomeParentOf(iterator); 4832 this._iterator = becomeParentOf(iterator);
5263 this.rightParenthesis = rightParenthesis;
5264 this._body = becomeParentOf(body); 4833 this._body = becomeParentOf(body);
5265 } 4834 }
5266 4835
5267 /** 4836 /**
5268 * Initialize a newly created for-each statement. 4837 * Initialize a newly created for-each statement.
5269 * 4838 *
5270 * @param forKeyword the token representing the 'for' keyword 4839 * @param forKeyword the token representing the 'for' keyword
5271 * @param leftParenthesis the left parenthesis 4840 * @param leftParenthesis the left parenthesis
5272 * @param loopVariable the declaration of the loop variable
5273 * @param iterator the expression evaluated to produce the iterator
5274 * @param rightParenthesis the right parenthesis
5275 * @param body the body of the loop
5276 */
5277 ForEachStatement.con1({Token forKeyword, Token leftParenthesis, DeclaredIdenti fier loopVariable, Token inKeyword, Expression iterator, Token rightParenthesis, Statement body}) : this.con1_full(forKeyword, leftParenthesis, loopVariable, in Keyword, iterator, rightParenthesis, body);
5278
5279 /**
5280 * Initialize a newly created for-each statement.
5281 *
5282 * @param forKeyword the token representing the 'for' keyword
5283 * @param leftParenthesis the left parenthesis
5284 * @param identifier the loop variable 4841 * @param identifier the loop variable
5285 * @param iterator the expression evaluated to produce the iterator 4842 * @param iterator the expression evaluated to produce the iterator
5286 * @param rightParenthesis the right parenthesis 4843 * @param rightParenthesis the right parenthesis
5287 * @param body the body of the loop 4844 * @param body the body of the loop
5288 */ 4845 */
5289 ForEachStatement.con2_full(Token forKeyword, Token leftParenthesis, SimpleIden tifier identifier, Token inKeyword, Expression iterator, Token rightParenthesis, Statement body) { 4846 ForEachStatement.con2(this.forKeyword, this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword, Expression iterator, this.rightParenthesis, Statemen t body) {
5290 this.forKeyword = forKeyword;
5291 this.leftParenthesis = leftParenthesis;
5292 this._identifier = becomeParentOf(identifier); 4847 this._identifier = becomeParentOf(identifier);
5293 this.inKeyword = inKeyword;
5294 this._iterator = becomeParentOf(iterator); 4848 this._iterator = becomeParentOf(iterator);
5295 this.rightParenthesis = rightParenthesis;
5296 this._body = becomeParentOf(body); 4849 this._body = becomeParentOf(body);
5297 } 4850 }
5298 4851
5299 /**
5300 * Initialize a newly created for-each statement.
5301 *
5302 * @param forKeyword the token representing the 'for' keyword
5303 * @param leftParenthesis the left parenthesis
5304 * @param identifier the loop variable
5305 * @param iterator the expression evaluated to produce the iterator
5306 * @param rightParenthesis the right parenthesis
5307 * @param body the body of the loop
5308 */
5309 ForEachStatement.con2({Token forKeyword, Token leftParenthesis, SimpleIdentifi er identifier, Token inKeyword, Expression iterator, Token rightParenthesis, Sta tement body}) : this.con2_full(forKeyword, leftParenthesis, identifier, inKeywor d, iterator, rightParenthesis, body);
5310
5311 accept(ASTVisitor visitor) => visitor.visitForEachStatement(this); 4852 accept(ASTVisitor visitor) => visitor.visitForEachStatement(this);
5312 4853
5313 Token get beginToken => forKeyword; 4854 Token get beginToken => forKeyword;
5314 4855
5315 /** 4856 /**
5316 * Return the body of the loop. 4857 * Return the body of the loop.
5317 * 4858 *
5318 * @return the body of the loop 4859 * @return the body of the loop
5319 */ 4860 */
5320 Statement get body => _body; 4861 Statement get body => _body;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
5441 Expression _condition; 4982 Expression _condition;
5442 4983
5443 /** 4984 /**
5444 * The semicolon separating the condition and the updater. 4985 * The semicolon separating the condition and the updater.
5445 */ 4986 */
5446 Token rightSeparator; 4987 Token rightSeparator;
5447 4988
5448 /** 4989 /**
5449 * The list of expressions run after each execution of the loop body. 4990 * The list of expressions run after each execution of the loop body.
5450 */ 4991 */
5451 NodeList<Expression> updaters; 4992 NodeList<Expression> _updaters;
5452 4993
5453 /** 4994 /**
5454 * The right parenthesis. 4995 * The right parenthesis.
5455 */ 4996 */
5456 Token rightParenthesis; 4997 Token rightParenthesis;
5457 4998
5458 /** 4999 /**
5459 * The body of the loop. 5000 * The body of the loop.
5460 */ 5001 */
5461 Statement _body; 5002 Statement _body;
5462 5003
5463 /** 5004 /**
5464 * Initialize a newly created for statement. 5005 * Initialize a newly created for statement.
5465 * 5006 *
5466 * @param forKeyword the token representing the 'for' keyword 5007 * @param forKeyword the token representing the 'for' keyword
5467 * @param leftParenthesis the left parenthesis 5008 * @param leftParenthesis the left parenthesis
5468 * @param variableList the declaration of the loop variables 5009 * @param variableList the declaration of the loop variables
5469 * @param initialization the initialization expression 5010 * @param initialization the initialization expression
5470 * @param leftSeparator the semicolon separating the initializer and the condi tion 5011 * @param leftSeparator the semicolon separating the initializer and the condi tion
5471 * @param condition the condition used to determine when to terminate the loop 5012 * @param condition the condition used to determine when to terminate the loop
5472 * @param rightSeparator the semicolon separating the condition and the update r 5013 * @param rightSeparator the semicolon separating the condition and the update r
5473 * @param updaters the list of expressions run after each execution of the loo p body 5014 * @param updaters the list of expressions run after each execution of the loo p body
5474 * @param rightParenthesis the right parenthesis 5015 * @param rightParenthesis the right parenthesis
5475 * @param body the body of the loop 5016 * @param body the body of the loop
5476 */ 5017 */
5477 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) { 5018 ForStatement(this.forKeyword, this.leftParenthesis, VariableDeclarationList va riableList, Expression initialization, this.leftSeparator, Expression condition, this.rightSeparator, List<Expression> updaters, this.rightParenthesis, Statemen t body) {
5478 this.updaters = new NodeList<Expression>(this); 5019 this._updaters = new NodeList<Expression>(this);
5479 this.forKeyword = forKeyword;
5480 this.leftParenthesis = leftParenthesis;
5481 this._variableList = becomeParentOf(variableList); 5020 this._variableList = becomeParentOf(variableList);
5482 this._initialization = becomeParentOf(initialization); 5021 this._initialization = becomeParentOf(initialization);
5483 this.leftSeparator = leftSeparator;
5484 this._condition = becomeParentOf(condition); 5022 this._condition = becomeParentOf(condition);
5485 this.rightSeparator = rightSeparator; 5023 this._updaters.addAll(updaters);
5486 this.updaters.addAll(updaters);
5487 this.rightParenthesis = rightParenthesis;
5488 this._body = becomeParentOf(body); 5024 this._body = becomeParentOf(body);
5489 } 5025 }
5490 5026
5491 /**
5492 * Initialize a newly created for statement.
5493 *
5494 * @param forKeyword the token representing the 'for' keyword
5495 * @param leftParenthesis the left parenthesis
5496 * @param variableList the declaration of the loop variables
5497 * @param initialization the initialization expression
5498 * @param leftSeparator the semicolon separating the initializer and the condi tion
5499 * @param condition the condition used to determine when to terminate the loop
5500 * @param rightSeparator the semicolon separating the condition and the update r
5501 * @param updaters the list of expressions run after each execution of the loo p body
5502 * @param rightParenthesis the right parenthesis
5503 * @param body the body of the loop
5504 */
5505 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 );
5506
5507 accept(ASTVisitor visitor) => visitor.visitForStatement(this); 5027 accept(ASTVisitor visitor) => visitor.visitForStatement(this);
5508 5028
5509 Token get beginToken => forKeyword; 5029 Token get beginToken => forKeyword;
5510 5030
5511 /** 5031 /**
5512 * Return the body of the loop. 5032 * Return the body of the loop.
5513 * 5033 *
5514 * @return the body of the loop 5034 * @return the body of the loop
5515 */ 5035 */
5516 Statement get body => _body; 5036 Statement get body => _body;
5517 5037
5518 /** 5038 /**
5519 * Return the condition used to determine when to terminate the loop, or `null ` if there is 5039 * Return the condition used to determine when to terminate the loop, or `null ` if there is
5520 * no condition. 5040 * no condition.
5521 * 5041 *
5522 * @return the condition used to determine when to terminate the loop 5042 * @return the condition used to determine when to terminate the loop
5523 */ 5043 */
5524 Expression get condition => _condition; 5044 Expression get condition => _condition;
5525 5045
5526 Token get endToken => _body.endToken; 5046 Token get endToken => _body.endToken;
5527 5047
5528 /** 5048 /**
5529 * Return the initialization expression, or `null` if there is no initializati on expression. 5049 * Return the initialization expression, or `null` if there is no initializati on expression.
5530 * 5050 *
5531 * @return the initialization expression 5051 * @return the initialization expression
5532 */ 5052 */
5533 Expression get initialization => _initialization; 5053 Expression get initialization => _initialization;
5534 5054
5535 /** 5055 /**
5056 * Return the list of expressions run after each execution of the loop body.
5057 *
5058 * @return the list of expressions run after each execution of the loop body
5059 */
5060 NodeList<Expression> get updaters => _updaters;
5061
5062 /**
5536 * Return the declaration of the loop variables, or `null` if there are no var iables. 5063 * Return the declaration of the loop variables, or `null` if there are no var iables.
5537 * 5064 *
5538 * @return the declaration of the loop variables, or `null` if there are no va riables 5065 * @return the declaration of the loop variables, or `null` if there are no va riables
5539 */ 5066 */
5540 VariableDeclarationList get variables => _variableList; 5067 VariableDeclarationList get variables => _variableList;
5541 5068
5542 /** 5069 /**
5543 * Set the body of the loop to the given statement. 5070 * Set the body of the loop to the given statement.
5544 * 5071 *
5545 * @param body the body of the loop 5072 * @param body the body of the loop
(...skipping 26 matching lines...) Expand all
5572 * @param variableList the declaration of the loop variables 5099 * @param variableList the declaration of the loop variables
5573 */ 5100 */
5574 void set variables(VariableDeclarationList variableList) { 5101 void set variables(VariableDeclarationList variableList) {
5575 variableList = becomeParentOf(variableList); 5102 variableList = becomeParentOf(variableList);
5576 } 5103 }
5577 5104
5578 void visitChildren(ASTVisitor visitor) { 5105 void visitChildren(ASTVisitor visitor) {
5579 safelyVisitChild(_variableList, visitor); 5106 safelyVisitChild(_variableList, visitor);
5580 safelyVisitChild(_initialization, visitor); 5107 safelyVisitChild(_initialization, visitor);
5581 safelyVisitChild(_condition, visitor); 5108 safelyVisitChild(_condition, visitor);
5582 updaters.accept(visitor); 5109 _updaters.accept(visitor);
5583 safelyVisitChild(_body, visitor); 5110 safelyVisitChild(_body, visitor);
5584 } 5111 }
5585 } 5112 }
5586 5113
5587 /** 5114 /**
5588 * The abstract class `FormalParameter` defines the behavior of objects represen ting a 5115 * The abstract class `FormalParameter` defines the behavior of objects represen ting a
5589 * parameter to a function. 5116 * parameter to a function.
5590 * 5117 *
5591 * <pre> 5118 * <pre>
5592 * formalParameter ::= 5119 * formalParameter ::=
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
5676 */ 5203 */
5677 class FormalParameterList extends ASTNode { 5204 class FormalParameterList extends ASTNode {
5678 /** 5205 /**
5679 * The left parenthesis. 5206 * The left parenthesis.
5680 */ 5207 */
5681 Token _leftParenthesis; 5208 Token _leftParenthesis;
5682 5209
5683 /** 5210 /**
5684 * The parameters associated with the method. 5211 * The parameters associated with the method.
5685 */ 5212 */
5686 NodeList<FormalParameter> parameters; 5213 NodeList<FormalParameter> _parameters;
5687 5214
5688 /** 5215 /**
5689 * The left square bracket ('[') or left curly brace ('{') introducing the opt ional parameters, or 5216 * The left square bracket ('[') or left curly brace ('{') introducing the opt ional parameters, or
5690 * `null` if there are no optional parameters. 5217 * `null` if there are no optional parameters.
5691 */ 5218 */
5692 Token _leftDelimiter; 5219 Token _leftDelimiter;
5693 5220
5694 /** 5221 /**
5695 * The right square bracket (']') or right curly brace ('}') introducing the o ptional parameters, 5222 * The right square bracket (']') or right curly brace ('}') introducing the o ptional parameters,
5696 * or `null` if there are no optional parameters. 5223 * or `null` if there are no optional parameters.
5697 */ 5224 */
5698 Token _rightDelimiter; 5225 Token _rightDelimiter;
5699 5226
5700 /** 5227 /**
5701 * The right parenthesis. 5228 * The right parenthesis.
5702 */ 5229 */
5703 Token _rightParenthesis; 5230 Token _rightParenthesis;
5704 5231
5705 /** 5232 /**
5706 * Initialize a newly created parameter list. 5233 * Initialize a newly created parameter list.
5707 * 5234 *
5708 * @param leftParenthesis the left parenthesis 5235 * @param leftParenthesis the left parenthesis
5709 * @param parameters the parameters associated with the method 5236 * @param parameters the parameters associated with the method
5710 * @param leftDelimiter the left delimiter introducing the optional parameters 5237 * @param leftDelimiter the left delimiter introducing the optional parameters
5711 * @param rightDelimiter the right delimiter introducing the optional paramete rs 5238 * @param rightDelimiter the right delimiter introducing the optional paramete rs
5712 * @param rightParenthesis the right parenthesis 5239 * @param rightParenthesis the right parenthesis
5713 */ 5240 */
5714 FormalParameterList.full(Token leftParenthesis, List<FormalParameter> paramete rs, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis) { 5241 FormalParameterList(Token leftParenthesis, List<FormalParameter> parameters, T oken leftDelimiter, Token rightDelimiter, Token rightParenthesis) {
5715 this.parameters = new NodeList<FormalParameter>(this); 5242 this._parameters = new NodeList<FormalParameter>(this);
5716 this._leftParenthesis = leftParenthesis; 5243 this._leftParenthesis = leftParenthesis;
5717 this.parameters.addAll(parameters); 5244 this._parameters.addAll(parameters);
5718 this._leftDelimiter = leftDelimiter; 5245 this._leftDelimiter = leftDelimiter;
5719 this._rightDelimiter = rightDelimiter; 5246 this._rightDelimiter = rightDelimiter;
5720 this._rightParenthesis = rightParenthesis; 5247 this._rightParenthesis = rightParenthesis;
5721 } 5248 }
5722 5249
5723 /**
5724 * Initialize a newly created parameter list.
5725 *
5726 * @param leftParenthesis the left parenthesis
5727 * @param parameters the parameters associated with the method
5728 * @param leftDelimiter the left delimiter introducing the optional parameters
5729 * @param rightDelimiter the right delimiter introducing the optional paramete rs
5730 * @param rightParenthesis the right parenthesis
5731 */
5732 FormalParameterList({Token leftParenthesis, List<FormalParameter> parameters, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis}) : this.full( leftParenthesis, parameters, leftDelimiter, rightDelimiter, rightParenthesis);
5733
5734 accept(ASTVisitor visitor) => visitor.visitFormalParameterList(this); 5250 accept(ASTVisitor visitor) => visitor.visitFormalParameterList(this);
5735 5251
5736 Token get beginToken => _leftParenthesis; 5252 Token get beginToken => _leftParenthesis;
5737 5253
5738 Token get endToken => _rightParenthesis; 5254 Token get endToken => _rightParenthesis;
5739 5255
5740 /** 5256 /**
5741 * Return the left square bracket ('[') or left curly brace ('{') introducing the optional 5257 * Return the left square bracket ('[') or left curly brace ('{') introducing the optional
5742 * parameters, or `null` if there are no optional parameters. 5258 * parameters, or `null` if there are no optional parameters.
5743 * 5259 *
5744 * @return the left square bracket ('[') or left curly brace ('{') introducing the optional 5260 * @return the left square bracket ('[') or left curly brace ('{') introducing the optional
5745 * parameters 5261 * parameters
5746 */ 5262 */
5747 Token get leftDelimiter => _leftDelimiter; 5263 Token get leftDelimiter => _leftDelimiter;
5748 5264
5749 /** 5265 /**
5750 * Return the left parenthesis. 5266 * Return the left parenthesis.
5751 * 5267 *
5752 * @return the left parenthesis 5268 * @return the left parenthesis
5753 */ 5269 */
5754 Token get leftParenthesis => _leftParenthesis; 5270 Token get leftParenthesis => _leftParenthesis;
5755 5271
5756 /** 5272 /**
5757 * Return an array containing the elements representing the parameters in this list. The array 5273 * Return an array containing the elements representing the parameters in this list. The array
5758 * will contain `null`s if the parameters in this list have not been resolved. 5274 * will contain `null`s if the parameters in this list have not been resolved.
5759 * 5275 *
5760 * @return the elements representing the parameters in this list 5276 * @return the elements representing the parameters in this list
5761 */ 5277 */
5762 List<ParameterElement> get parameterElements { 5278 List<ParameterElement> get parameterElements {
5763 int count = parameters.length; 5279 int count = _parameters.length;
5764 List<ParameterElement> types = new List<ParameterElement>(count); 5280 List<ParameterElement> types = new List<ParameterElement>(count);
5765 for (int i = 0; i < count; i++) { 5281 for (int i = 0; i < count; i++) {
5766 types[i] = parameters[i].element; 5282 types[i] = _parameters[i].element;
5767 } 5283 }
5768 return types; 5284 return types;
5769 } 5285 }
5770 5286
5771 /** 5287 /**
5288 * Return the parameters associated with the method.
5289 *
5290 * @return the parameters associated with the method
5291 */
5292 NodeList<FormalParameter> get parameters => _parameters;
5293
5294 /**
5772 * Return the right square bracket (']') or right curly brace ('}') introducin g the optional 5295 * Return the right square bracket (']') or right curly brace ('}') introducin g the optional
5773 * parameters, or `null` if there are no optional parameters. 5296 * parameters, or `null` if there are no optional parameters.
5774 * 5297 *
5775 * @return the right square bracket (']') or right curly brace ('}') introduci ng the optional 5298 * @return the right square bracket (']') or right curly brace ('}') introduci ng the optional
5776 * parameters 5299 * parameters
5777 */ 5300 */
5778 Token get rightDelimiter => _rightDelimiter; 5301 Token get rightDelimiter => _rightDelimiter;
5779 5302
5780 /** 5303 /**
5781 * Return the right parenthesis. 5304 * Return the right parenthesis.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
5816 /** 5339 /**
5817 * Set the right parenthesis to the given token. 5340 * Set the right parenthesis to the given token.
5818 * 5341 *
5819 * @param parenthesis the right parenthesis 5342 * @param parenthesis the right parenthesis
5820 */ 5343 */
5821 void set rightParenthesis(Token parenthesis) { 5344 void set rightParenthesis(Token parenthesis) {
5822 _rightParenthesis = parenthesis; 5345 _rightParenthesis = parenthesis;
5823 } 5346 }
5824 5347
5825 void visitChildren(ASTVisitor visitor) { 5348 void visitChildren(ASTVisitor visitor) {
5826 parameters.accept(visitor); 5349 _parameters.accept(visitor);
5827 } 5350 }
5828 } 5351 }
5829 5352
5830 /** 5353 /**
5831 * The abstract class `FunctionBody` defines the behavior common to objects repr esenting the 5354 * The abstract class `FunctionBody` defines the behavior common to objects repr esenting the
5832 * body of a function or method. 5355 * body of a function or method.
5833 * 5356 *
5834 * <pre> 5357 * <pre>
5835 * functionBody ::= 5358 * functionBody ::=
5836 * [BlockFunctionBody] 5359 * [BlockFunctionBody]
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
5889 * Initialize a newly created function declaration. 5412 * Initialize a newly created function declaration.
5890 * 5413 *
5891 * @param comment the documentation comment associated with this function 5414 * @param comment the documentation comment associated with this function
5892 * @param metadata the annotations associated with this function 5415 * @param metadata the annotations associated with this function
5893 * @param externalKeyword the token representing the 'external' keyword 5416 * @param externalKeyword the token representing the 'external' keyword
5894 * @param returnType the return type of the function 5417 * @param returnType the return type of the function
5895 * @param propertyKeyword the token representing the 'get' or 'set' keyword 5418 * @param propertyKeyword the token representing the 'get' or 'set' keyword
5896 * @param name the name of the function 5419 * @param name the name of the function
5897 * @param functionExpression the function expression being wrapped 5420 * @param functionExpression the function expression being wrapped
5898 */ 5421 */
5899 FunctionDeclaration.full(Comment comment, List<Annotation> metadata, Token ext ernalKeyword, TypeName returnType, Token propertyKeyword, SimpleIdentifier name, FunctionExpression functionExpression) : super.full(comment, metadata) { 5422 FunctionDeclaration(Comment comment, List<Annotation> metadata, this.externalK eyword, TypeName returnType, this.propertyKeyword, SimpleIdentifier name, Functi onExpression functionExpression) : super(comment, metadata) {
5900 this.externalKeyword = externalKeyword;
5901 this._returnType = becomeParentOf(returnType); 5423 this._returnType = becomeParentOf(returnType);
5902 this.propertyKeyword = propertyKeyword;
5903 this._name = becomeParentOf(name); 5424 this._name = becomeParentOf(name);
5904 this._functionExpression = becomeParentOf(functionExpression); 5425 this._functionExpression = becomeParentOf(functionExpression);
5905 } 5426 }
5906 5427
5907 /**
5908 * Initialize a newly created function declaration.
5909 *
5910 * @param comment the documentation comment associated with this function
5911 * @param metadata the annotations associated with this function
5912 * @param externalKeyword the token representing the 'external' keyword
5913 * @param returnType the return type of the function
5914 * @param propertyKeyword the token representing the 'get' or 'set' keyword
5915 * @param name the name of the function
5916 * @param functionExpression the function expression being wrapped
5917 */
5918 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);
5919
5920 accept(ASTVisitor visitor) => visitor.visitFunctionDeclaration(this); 5428 accept(ASTVisitor visitor) => visitor.visitFunctionDeclaration(this);
5921 5429
5922 ExecutableElement get element => _name != null ? (_name.staticElement as Execu tableElement) : null; 5430 ExecutableElement get element => _name != null ? (_name.staticElement as Execu tableElement) : null;
5923 5431
5924 Token get endToken => _functionExpression.endToken; 5432 Token get endToken => _functionExpression.endToken;
5925 5433
5926 /** 5434 /**
5927 * Return the function expression being wrapped. 5435 * Return the function expression being wrapped.
5928 * 5436 *
5929 * @return the function expression being wrapped 5437 * @return the function expression being wrapped
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
6010 /** 5518 /**
6011 * Instances of the class `FunctionDeclarationStatement` wrap a [FunctionDeclara tion 5519 * Instances of the class `FunctionDeclarationStatement` wrap a [FunctionDeclara tion
6012 ] as a statement. 5520 ] as a statement.
6013 * 5521 *
6014 * @coverage dart.engine.ast 5522 * @coverage dart.engine.ast
6015 */ 5523 */
6016 class FunctionDeclarationStatement extends Statement { 5524 class FunctionDeclarationStatement extends Statement {
6017 /** 5525 /**
6018 * The function declaration being wrapped. 5526 * The function declaration being wrapped.
6019 */ 5527 */
6020 FunctionDeclaration functionDeclaration; 5528 FunctionDeclaration _functionDeclaration;
6021 5529
6022 /** 5530 /**
6023 * Initialize a newly created function declaration statement. 5531 * Initialize a newly created function declaration statement.
6024 * 5532 *
6025 * @param functionDeclaration the the function declaration being wrapped 5533 * @param functionDeclaration the the function declaration being wrapped
6026 */ 5534 */
6027 FunctionDeclarationStatement.full(FunctionDeclaration functionDeclaration) { 5535 FunctionDeclarationStatement(FunctionDeclaration functionDeclaration) {
6028 this.functionDeclaration = becomeParentOf(functionDeclaration); 5536 this._functionDeclaration = becomeParentOf(functionDeclaration);
6029 } 5537 }
6030 5538
6031 /**
6032 * Initialize a newly created function declaration statement.
6033 *
6034 * @param functionDeclaration the the function declaration being wrapped
6035 */
6036 FunctionDeclarationStatement({FunctionDeclaration functionDeclaration}) : this .full(functionDeclaration);
6037
6038 accept(ASTVisitor visitor) => visitor.visitFunctionDeclarationStatement(this); 5539 accept(ASTVisitor visitor) => visitor.visitFunctionDeclarationStatement(this);
6039 5540
6040 Token get beginToken => functionDeclaration.beginToken; 5541 Token get beginToken => _functionDeclaration.beginToken;
6041 5542
6042 Token get endToken => functionDeclaration.endToken; 5543 Token get endToken => _functionDeclaration.endToken;
5544
5545 /**
5546 * Return the function declaration being wrapped.
5547 *
5548 * @return the function declaration being wrapped
5549 */
5550 FunctionDeclaration get functionDeclaration => _functionDeclaration;
6043 5551
6044 /** 5552 /**
6045 * Set the function declaration being wrapped to the given function declaratio n. 5553 * Set the function declaration being wrapped to the given function declaratio n.
6046 * 5554 *
6047 * @param functionDeclaration the function declaration being wrapped 5555 * @param functionDeclaration the function declaration being wrapped
6048 */ 5556 */
6049 void set functionExpression(FunctionDeclaration functionDeclaration) { 5557 void set functionExpression(FunctionDeclaration functionDeclaration) {
6050 this.functionDeclaration = becomeParentOf(functionDeclaration); 5558 this._functionDeclaration = becomeParentOf(functionDeclaration);
6051 } 5559 }
6052 5560
6053 void visitChildren(ASTVisitor visitor) { 5561 void visitChildren(ASTVisitor visitor) {
6054 safelyVisitChild(functionDeclaration, visitor); 5562 safelyVisitChild(_functionDeclaration, visitor);
6055 } 5563 }
6056 } 5564 }
6057 5565
6058 /** 5566 /**
6059 * Instances of the class `FunctionExpression` represent a function expression. 5567 * Instances of the class `FunctionExpression` represent a function expression.
6060 * 5568 *
6061 * <pre> 5569 * <pre>
6062 * functionExpression ::= 5570 * functionExpression ::=
6063 * [FormalParameterList] [FunctionBody] 5571 * [FormalParameterList] [FunctionBody]
6064 * </pre> 5572 * </pre>
(...skipping 16 matching lines...) Expand all
6081 * resolved. 5589 * resolved.
6082 */ 5590 */
6083 ExecutableElement element; 5591 ExecutableElement element;
6084 5592
6085 /** 5593 /**
6086 * Initialize a newly created function declaration. 5594 * Initialize a newly created function declaration.
6087 * 5595 *
6088 * @param parameters the parameters associated with the function 5596 * @param parameters the parameters associated with the function
6089 * @param body the body of the function 5597 * @param body the body of the function
6090 */ 5598 */
6091 FunctionExpression.full(FormalParameterList parameters, FunctionBody body) { 5599 FunctionExpression(FormalParameterList parameters, FunctionBody body) {
6092 this._parameters = becomeParentOf(parameters); 5600 this._parameters = becomeParentOf(parameters);
6093 this._body = becomeParentOf(body); 5601 this._body = becomeParentOf(body);
6094 } 5602 }
6095 5603
6096 /**
6097 * Initialize a newly created function declaration.
6098 *
6099 * @param parameters the parameters associated with the function
6100 * @param body the body of the function
6101 */
6102 FunctionExpression({FormalParameterList parameters, FunctionBody body}) : this .full(parameters, body);
6103
6104 accept(ASTVisitor visitor) => visitor.visitFunctionExpression(this); 5604 accept(ASTVisitor visitor) => visitor.visitFunctionExpression(this);
6105 5605
6106 Token get beginToken { 5606 Token get beginToken {
6107 if (_parameters != null) { 5607 if (_parameters != null) {
6108 return _parameters.beginToken; 5608 return _parameters.beginToken;
6109 } else if (_body != null) { 5609 } else if (_body != null) {
6110 return _body.beginToken; 5610 return _body.beginToken;
6111 } 5611 }
6112 throw new IllegalStateException("Non-external functions must have a body"); 5612 throw new IllegalStateException("Non-external functions must have a body");
6113 } 5613 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
6197 * `null` if the AST structure has not been resolved or the function could not be resolved. 5697 * `null` if the AST structure has not been resolved or the function could not be resolved.
6198 */ 5698 */
6199 ExecutableElement _propagatedElement; 5699 ExecutableElement _propagatedElement;
6200 5700
6201 /** 5701 /**
6202 * Initialize a newly created function expression invocation. 5702 * Initialize a newly created function expression invocation.
6203 * 5703 *
6204 * @param function the expression producing the function being invoked 5704 * @param function the expression producing the function being invoked
6205 * @param argumentList the list of arguments to the method 5705 * @param argumentList the list of arguments to the method
6206 */ 5706 */
6207 FunctionExpressionInvocation.full(Expression function, ArgumentList argumentLi st) { 5707 FunctionExpressionInvocation(Expression function, ArgumentList argumentList) {
6208 this._function = becomeParentOf(function); 5708 this._function = becomeParentOf(function);
6209 this._argumentList = becomeParentOf(argumentList); 5709 this._argumentList = becomeParentOf(argumentList);
6210 } 5710 }
6211 5711
6212 /**
6213 * Initialize a newly created function expression invocation.
6214 *
6215 * @param function the expression producing the function being invoked
6216 * @param argumentList the list of arguments to the method
6217 */
6218 FunctionExpressionInvocation({Expression function, ArgumentList argumentList}) : this.full(function, argumentList);
6219
6220 accept(ASTVisitor visitor) => visitor.visitFunctionExpressionInvocation(this); 5712 accept(ASTVisitor visitor) => visitor.visitFunctionExpressionInvocation(this);
6221 5713
6222 /** 5714 /**
6223 * Return the list of arguments to the method. 5715 * Return the list of arguments to the method.
6224 * 5716 *
6225 * @return the list of arguments to the method 5717 * @return the list of arguments to the method
6226 */ 5718 */
6227 ArgumentList get argumentList => _argumentList; 5719 ArgumentList get argumentList => _argumentList;
6228 5720
6229 Token get beginToken => _function.beginToken; 5721 Token get beginToken => _function.beginToken;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
6340 * 5832 *
6341 * @param comment the documentation comment associated with this type alias 5833 * @param comment the documentation comment associated with this type alias
6342 * @param metadata the annotations associated with this type alias 5834 * @param metadata the annotations associated with this type alias
6343 * @param keyword the token representing the 'typedef' keyword 5835 * @param keyword the token representing the 'typedef' keyword
6344 * @param returnType the name of the return type of the function type being de fined 5836 * @param returnType the name of the return type of the function type being de fined
6345 * @param name the name of the type being declared 5837 * @param name the name of the type being declared
6346 * @param typeParameters the type parameters for the type 5838 * @param typeParameters the type parameters for the type
6347 * @param parameters the parameters associated with the function 5839 * @param parameters the parameters associated with the function
6348 * @param semicolon the semicolon terminating the declaration 5840 * @param semicolon the semicolon terminating the declaration
6349 */ 5841 */
6350 FunctionTypeAlias.full(Comment comment, List<Annotation> metadata, Token keywo rd, TypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters , FormalParameterList parameters, Token semicolon) : super.full(comment, metadat a, keyword, semicolon) { 5842 FunctionTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, T ypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters, For malParameterList parameters, Token semicolon) : super(comment, metadata, keyword , semicolon) {
6351 this._returnType = becomeParentOf(returnType); 5843 this._returnType = becomeParentOf(returnType);
6352 this._name = becomeParentOf(name); 5844 this._name = becomeParentOf(name);
6353 this._typeParameters = becomeParentOf(typeParameters); 5845 this._typeParameters = becomeParentOf(typeParameters);
6354 this._parameters = becomeParentOf(parameters); 5846 this._parameters = becomeParentOf(parameters);
6355 } 5847 }
6356 5848
6357 /**
6358 * Initialize a newly created function type alias.
6359 *
6360 * @param comment the documentation comment associated with this type alias
6361 * @param metadata the annotations associated with this type alias
6362 * @param keyword the token representing the 'typedef' keyword
6363 * @param returnType the name of the return type of the function type being de fined
6364 * @param name the name of the type being declared
6365 * @param typeParameters the type parameters for the type
6366 * @param parameters the parameters associated with the function
6367 * @param semicolon the semicolon terminating the declaration
6368 */
6369 FunctionTypeAlias({Comment comment, List<Annotation> metadata, Token keyword, TypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters, Fo rmalParameterList parameters, Token semicolon}) : this.full(comment, metadata, k eyword, returnType, name, typeParameters, parameters, semicolon);
6370
6371 accept(ASTVisitor visitor) => visitor.visitFunctionTypeAlias(this); 5849 accept(ASTVisitor visitor) => visitor.visitFunctionTypeAlias(this);
6372 5850
6373 FunctionTypeAliasElement get element => _name != null ? (_name.staticElement a s FunctionTypeAliasElement) : null; 5851 FunctionTypeAliasElement get element => _name != null ? (_name.staticElement a s FunctionTypeAliasElement) : null;
6374 5852
6375 /** 5853 /**
6376 * Return the name of the function type being declared. 5854 * Return the name of the function type being declared.
6377 * 5855 *
6378 * @return the name of the function type being declared 5856 * @return the name of the function type being declared
6379 */ 5857 */
6380 SimpleIdentifier get name => _name; 5858 SimpleIdentifier get name => _name;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
6472 /** 5950 /**
6473 * Initialize a newly created formal parameter. 5951 * Initialize a newly created formal parameter.
6474 * 5952 *
6475 * @param comment the documentation comment associated with this parameter 5953 * @param comment the documentation comment associated with this parameter
6476 * @param metadata the annotations associated with this parameter 5954 * @param metadata the annotations associated with this parameter
6477 * @param returnType the return type of the function, or `null` if the functio n does not 5955 * @param returnType the return type of the function, or `null` if the functio n does not
6478 * have a return type 5956 * have a return type
6479 * @param identifier the name of the function-typed parameter 5957 * @param identifier the name of the function-typed parameter
6480 * @param parameters the parameters of the function-typed parameter 5958 * @param parameters the parameters of the function-typed parameter
6481 */ 5959 */
6482 FunctionTypedFormalParameter.full(Comment comment, List<Annotation> metadata, TypeName returnType, SimpleIdentifier identifier, FormalParameterList parameters ) : super.full(comment, metadata, identifier) { 5960 FunctionTypedFormalParameter(Comment comment, List<Annotation> metadata, TypeN ame returnType, SimpleIdentifier identifier, FormalParameterList parameters) : s uper(comment, metadata, identifier) {
6483 this._returnType = becomeParentOf(returnType); 5961 this._returnType = becomeParentOf(returnType);
6484 this._parameters = becomeParentOf(parameters); 5962 this._parameters = becomeParentOf(parameters);
6485 } 5963 }
6486 5964
6487 /**
6488 * Initialize a newly created formal parameter.
6489 *
6490 * @param comment the documentation comment associated with this parameter
6491 * @param metadata the annotations associated with this parameter
6492 * @param returnType the return type of the function, or `null` if the functio n does not
6493 * have a return type
6494 * @param identifier the name of the function-typed parameter
6495 * @param parameters the parameters of the function-typed parameter
6496 */
6497 FunctionTypedFormalParameter({Comment comment, List<Annotation> metadata, Type Name returnType, SimpleIdentifier identifier, FormalParameterList parameters}) : this.full(comment, metadata, returnType, identifier, parameters);
6498
6499 accept(ASTVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this); 5965 accept(ASTVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this);
6500 5966
6501 Token get beginToken { 5967 Token get beginToken {
6502 if (_returnType != null) { 5968 if (_returnType != null) {
6503 return _returnType.beginToken; 5969 return _returnType.beginToken;
6504 } 5970 }
6505 return identifier.beginToken; 5971 return identifier.beginToken;
6506 } 5972 }
6507 5973
6508 Token get endToken => _parameters.endToken; 5974 Token get endToken => _parameters.endToken;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
6560 * hideCombinator ::= 6026 * hideCombinator ::=
6561 * 'hide' [SimpleIdentifier] (',' [SimpleIdentifier])* 6027 * 'hide' [SimpleIdentifier] (',' [SimpleIdentifier])*
6562 * </pre> 6028 * </pre>
6563 * 6029 *
6564 * @coverage dart.engine.ast 6030 * @coverage dart.engine.ast
6565 */ 6031 */
6566 class HideCombinator extends Combinator { 6032 class HideCombinator extends Combinator {
6567 /** 6033 /**
6568 * The list of names from the library that are hidden by this combinator. 6034 * The list of names from the library that are hidden by this combinator.
6569 */ 6035 */
6570 NodeList<SimpleIdentifier> hiddenNames; 6036 NodeList<SimpleIdentifier> _hiddenNames;
6571 6037
6572 /** 6038 /**
6573 * Initialize a newly created import show combinator. 6039 * Initialize a newly created import show combinator.
6574 * 6040 *
6575 * @param keyword the comma introducing the combinator 6041 * @param keyword the comma introducing the combinator
6576 * @param hiddenNames the list of names from the library that are hidden by th is combinator 6042 * @param hiddenNames the list of names from the library that are hidden by th is combinator
6577 */ 6043 */
6578 HideCombinator.full(Token keyword, List<SimpleIdentifier> hiddenNames) : super .full(keyword) { 6044 HideCombinator(Token keyword, List<SimpleIdentifier> hiddenNames) : super(keyw ord) {
6579 this.hiddenNames = new NodeList<SimpleIdentifier>(this); 6045 this._hiddenNames = new NodeList<SimpleIdentifier>(this);
6580 this.hiddenNames.addAll(hiddenNames); 6046 this._hiddenNames.addAll(hiddenNames);
6581 } 6047 }
6582 6048
6583 /**
6584 * Initialize a newly created import show combinator.
6585 *
6586 * @param keyword the comma introducing the combinator
6587 * @param hiddenNames the list of names from the library that are hidden by th is combinator
6588 */
6589 HideCombinator({Token keyword, List<SimpleIdentifier> hiddenNames}) : this.ful l(keyword, hiddenNames);
6590
6591 accept(ASTVisitor visitor) => visitor.visitHideCombinator(this); 6049 accept(ASTVisitor visitor) => visitor.visitHideCombinator(this);
6592 6050
6593 Token get endToken => hiddenNames.endToken; 6051 Token get endToken => _hiddenNames.endToken;
6052
6053 /**
6054 * Return the list of names from the library that are hidden by this combinato r.
6055 *
6056 * @return the list of names from the library that are hidden by this combinat or
6057 */
6058 NodeList<SimpleIdentifier> get hiddenNames => _hiddenNames;
6594 6059
6595 void visitChildren(ASTVisitor visitor) { 6060 void visitChildren(ASTVisitor visitor) {
6596 hiddenNames.accept(visitor); 6061 _hiddenNames.accept(visitor);
6597 } 6062 }
6598 } 6063 }
6599 6064
6600 /** 6065 /**
6601 * The abstract class `Identifier` defines the behavior common to nodes that rep resent an 6066 * The abstract class `Identifier` defines the behavior common to nodes that rep resent an
6602 * identifier. 6067 * identifier.
6603 * 6068 *
6604 * <pre> 6069 * <pre>
6605 * identifier ::= 6070 * identifier ::=
6606 * [SimpleIdentifier] 6071 * [SimpleIdentifier]
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
6710 * Initialize a newly created if statement. 6175 * Initialize a newly created if statement.
6711 * 6176 *
6712 * @param ifKeyword the token representing the 'if' keyword 6177 * @param ifKeyword the token representing the 'if' keyword
6713 * @param leftParenthesis the left parenthesis 6178 * @param leftParenthesis the left parenthesis
6714 * @param condition the condition used to determine which of the statements is executed next 6179 * @param condition the condition used to determine which of the statements is executed next
6715 * @param rightParenthesis the right parenthesis 6180 * @param rightParenthesis the right parenthesis
6716 * @param thenStatement the statement that is executed if the condition evalua tes to `true` 6181 * @param thenStatement the statement that is executed if the condition evalua tes to `true`
6717 * @param elseKeyword the token representing the 'else' keyword 6182 * @param elseKeyword the token representing the 'else' keyword
6718 * @param elseStatement the statement that is executed if the condition evalua tes to `false` 6183 * @param elseStatement the statement that is executed if the condition evalua tes to `false`
6719 */ 6184 */
6720 IfStatement.full(Token ifKeyword, Token leftParenthesis, Expression condition, Token rightParenthesis, Statement thenStatement, Token elseKeyword, Statement e lseStatement) { 6185 IfStatement(this.ifKeyword, this.leftParenthesis, Expression condition, this.r ightParenthesis, Statement thenStatement, this.elseKeyword, Statement elseStatem ent) {
6721 this.ifKeyword = ifKeyword;
6722 this.leftParenthesis = leftParenthesis;
6723 this._condition = becomeParentOf(condition); 6186 this._condition = becomeParentOf(condition);
6724 this.rightParenthesis = rightParenthesis;
6725 this._thenStatement = becomeParentOf(thenStatement); 6187 this._thenStatement = becomeParentOf(thenStatement);
6726 this.elseKeyword = elseKeyword;
6727 this._elseStatement = becomeParentOf(elseStatement); 6188 this._elseStatement = becomeParentOf(elseStatement);
6728 } 6189 }
6729 6190
6730 /**
6731 * Initialize a newly created if statement.
6732 *
6733 * @param ifKeyword the token representing the 'if' keyword
6734 * @param leftParenthesis the left parenthesis
6735 * @param condition the condition used to determine which of the statements is executed next
6736 * @param rightParenthesis the right parenthesis
6737 * @param thenStatement the statement that is executed if the condition evalua tes to `true`
6738 * @param elseKeyword the token representing the 'else' keyword
6739 * @param elseStatement the statement that is executed if the condition evalua tes to `false`
6740 */
6741 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);
6742
6743 accept(ASTVisitor visitor) => visitor.visitIfStatement(this); 6191 accept(ASTVisitor visitor) => visitor.visitIfStatement(this);
6744 6192
6745 Token get beginToken => ifKeyword; 6193 Token get beginToken => ifKeyword;
6746 6194
6747 /** 6195 /**
6748 * Return the condition used to determine which of the statements is executed next. 6196 * Return the condition used to determine which of the statements is executed next.
6749 * 6197 *
6750 * @return the condition used to determine which statement is executed next 6198 * @return the condition used to determine which statement is executed next
6751 */ 6199 */
6752 Expression get condition => _condition; 6200 Expression get condition => _condition;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
6823 */ 6271 */
6824 class ImplementsClause extends ASTNode { 6272 class ImplementsClause extends ASTNode {
6825 /** 6273 /**
6826 * The token representing the 'implements' keyword. 6274 * The token representing the 'implements' keyword.
6827 */ 6275 */
6828 Token keyword; 6276 Token keyword;
6829 6277
6830 /** 6278 /**
6831 * The interfaces that are being implemented. 6279 * The interfaces that are being implemented.
6832 */ 6280 */
6833 NodeList<TypeName> interfaces; 6281 NodeList<TypeName> _interfaces;
6834 6282
6835 /** 6283 /**
6836 * Initialize a newly created implements clause. 6284 * Initialize a newly created implements clause.
6837 * 6285 *
6838 * @param keyword the token representing the 'implements' keyword 6286 * @param keyword the token representing the 'implements' keyword
6839 * @param interfaces the interfaces that are being implemented 6287 * @param interfaces the interfaces that are being implemented
6840 */ 6288 */
6841 ImplementsClause.full(Token keyword, List<TypeName> interfaces) { 6289 ImplementsClause(this.keyword, List<TypeName> interfaces) {
6842 this.interfaces = new NodeList<TypeName>(this); 6290 this._interfaces = new NodeList<TypeName>(this);
6843 this.keyword = keyword; 6291 this._interfaces.addAll(interfaces);
6844 this.interfaces.addAll(interfaces);
6845 } 6292 }
6846 6293
6847 /**
6848 * Initialize a newly created implements clause.
6849 *
6850 * @param keyword the token representing the 'implements' keyword
6851 * @param interfaces the interfaces that are being implemented
6852 */
6853 ImplementsClause({Token keyword, List<TypeName> interfaces}) : this.full(keywo rd, interfaces);
6854
6855 accept(ASTVisitor visitor) => visitor.visitImplementsClause(this); 6294 accept(ASTVisitor visitor) => visitor.visitImplementsClause(this);
6856 6295
6857 Token get beginToken => keyword; 6296 Token get beginToken => keyword;
6858 6297
6859 Token get endToken => interfaces.endToken; 6298 Token get endToken => _interfaces.endToken;
6299
6300 /**
6301 * Return the list of the interfaces that are being implemented.
6302 *
6303 * @return the list of the interfaces that are being implemented
6304 */
6305 NodeList<TypeName> get interfaces => _interfaces;
6860 6306
6861 void visitChildren(ASTVisitor visitor) { 6307 void visitChildren(ASTVisitor visitor) {
6862 interfaces.accept(visitor); 6308 _interfaces.accept(visitor);
6863 } 6309 }
6864 } 6310 }
6865 6311
6866 /** 6312 /**
6867 * Instances of the class `ImportDirective` represent an import directive. 6313 * Instances of the class `ImportDirective` represent an import directive.
6868 * 6314 *
6869 * <pre> 6315 * <pre>
6870 * importDirective ::= 6316 * importDirective ::=
6871 * [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* '; ' 6317 * [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* '; '
6872 * </pre> 6318 * </pre>
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
6970 * 6416 *
6971 * @param comment the documentation comment associated with this directive 6417 * @param comment the documentation comment associated with this directive
6972 * @param metadata the annotations associated with the directive 6418 * @param metadata the annotations associated with the directive
6973 * @param keyword the token representing the 'import' keyword 6419 * @param keyword the token representing the 'import' keyword
6974 * @param libraryUri the URI of the library being imported 6420 * @param libraryUri the URI of the library being imported
6975 * @param asToken the token representing the 'as' token 6421 * @param asToken the token representing the 'as' token
6976 * @param prefix the prefix to be used with the imported names 6422 * @param prefix the prefix to be used with the imported names
6977 * @param combinators the combinators used to control how names are imported 6423 * @param combinators the combinators used to control how names are imported
6978 * @param semicolon the semicolon terminating the directive 6424 * @param semicolon the semicolon terminating the directive
6979 */ 6425 */
6980 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) { 6426 ImportDirective(Comment comment, List<Annotation> metadata, Token keyword, Str ingLiteral libraryUri, this.asToken, SimpleIdentifier prefix, List<Combinator> c ombinators, Token semicolon) : super(comment, metadata, keyword, libraryUri, com binators, semicolon) {
6981 this.asToken = asToken;
6982 this._prefix = becomeParentOf(prefix); 6427 this._prefix = becomeParentOf(prefix);
6983 } 6428 }
6984 6429
6985 /**
6986 * Initialize a newly created import directive.
6987 *
6988 * @param comment the documentation comment associated with this directive
6989 * @param metadata the annotations associated with the directive
6990 * @param keyword the token representing the 'import' keyword
6991 * @param libraryUri the URI of the library being imported
6992 * @param asToken the token representing the 'as' token
6993 * @param prefix the prefix to be used with the imported names
6994 * @param combinators the combinators used to control how names are imported
6995 * @param semicolon the semicolon terminating the directive
6996 */
6997 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);
6998
6999 accept(ASTVisitor visitor) => visitor.visitImportDirective(this); 6430 accept(ASTVisitor visitor) => visitor.visitImportDirective(this);
7000 6431
7001 ImportElement get element => super.element as ImportElement; 6432 ImportElement get element => super.element as ImportElement;
7002 6433
7003 /** 6434 /**
7004 * Return the prefix to be used with the imported names, or `null` if the impo rted names are 6435 * Return the prefix to be used with the imported names, or `null` if the impo rted names are
7005 * not prefixed. 6436 * not prefixed.
7006 * 6437 *
7007 * @return the prefix to be used with the imported names 6438 * @return the prefix to be used with the imported names
7008 */ 6439 */
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
7092 AuxiliaryElements auxiliaryElements = null; 6523 AuxiliaryElements auxiliaryElements = null;
7093 6524
7094 /** 6525 /**
7095 * Initialize a newly created index expression. 6526 * Initialize a newly created index expression.
7096 * 6527 *
7097 * @param target the expression used to compute the object being indexed 6528 * @param target the expression used to compute the object being indexed
7098 * @param leftBracket the left square bracket 6529 * @param leftBracket the left square bracket
7099 * @param index the expression used to compute the index 6530 * @param index the expression used to compute the index
7100 * @param rightBracket the right square bracket 6531 * @param rightBracket the right square bracket
7101 */ 6532 */
7102 IndexExpression.forTarget_full(Expression target, Token leftBracket, Expressio n index, Token rightBracket) { 6533 IndexExpression.forTarget(Expression target, Token leftBracket, Expression ind ex, Token rightBracket) {
7103 this._target = becomeParentOf(target); 6534 this._target = becomeParentOf(target);
7104 this._leftBracket = leftBracket; 6535 this._leftBracket = leftBracket;
7105 this._index = becomeParentOf(index); 6536 this._index = becomeParentOf(index);
7106 this._rightBracket = rightBracket; 6537 this._rightBracket = rightBracket;
7107 } 6538 }
7108 6539
7109 /** 6540 /**
7110 * Initialize a newly created index expression. 6541 * Initialize a newly created index expression.
7111 * 6542 *
7112 * @param target the expression used to compute the object being indexed
7113 * @param leftBracket the left square bracket
7114 * @param index the expression used to compute the index
7115 * @param rightBracket the right square bracket
7116 */
7117 IndexExpression.forTarget({Expression target, Token leftBracket, Expression in dex, Token rightBracket}) : this.forTarget_full(target, leftBracket, index, righ tBracket);
7118
7119 /**
7120 * Initialize a newly created index expression.
7121 *
7122 * @param period the period ("..") before a cascaded index expression 6543 * @param period the period ("..") before a cascaded index expression
7123 * @param leftBracket the left square bracket 6544 * @param leftBracket the left square bracket
7124 * @param index the expression used to compute the index 6545 * @param index the expression used to compute the index
7125 * @param rightBracket the right square bracket 6546 * @param rightBracket the right square bracket
7126 */ 6547 */
7127 IndexExpression.forCascade_full(Token period, Token leftBracket, Expression in dex, Token rightBracket) { 6548 IndexExpression.forCascade(this.period, Token leftBracket, Expression index, T oken rightBracket) {
7128 this.period = period;
7129 this._leftBracket = leftBracket; 6549 this._leftBracket = leftBracket;
7130 this._index = becomeParentOf(index); 6550 this._index = becomeParentOf(index);
7131 this._rightBracket = rightBracket; 6551 this._rightBracket = rightBracket;
7132 } 6552 }
7133 6553
7134 /**
7135 * Initialize a newly created index expression.
7136 *
7137 * @param period the period ("..") before a cascaded index expression
7138 * @param leftBracket the left square bracket
7139 * @param index the expression used to compute the index
7140 * @param rightBracket the right square bracket
7141 */
7142 IndexExpression.forCascade({Token period, Token leftBracket, Expression index, Token rightBracket}) : this.forCascade_full(period, leftBracket, index, rightBr acket);
7143
7144 accept(ASTVisitor visitor) => visitor.visitIndexExpression(this); 6554 accept(ASTVisitor visitor) => visitor.visitIndexExpression(this);
7145 6555
7146 Token get beginToken { 6556 Token get beginToken {
7147 if (_target != null) { 6557 if (_target != null) {
7148 return _target.beginToken; 6558 return _target.beginToken;
7149 } 6559 }
7150 return period; 6560 return period;
7151 } 6561 }
7152 6562
7153 /** 6563 /**
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
7433 */ 6843 */
7434 ConstructorElement staticElement; 6844 ConstructorElement staticElement;
7435 6845
7436 /** 6846 /**
7437 * Initialize a newly created instance creation expression. 6847 * Initialize a newly created instance creation expression.
7438 * 6848 *
7439 * @param keyword the keyword used to indicate how an object should be created 6849 * @param keyword the keyword used to indicate how an object should be created
7440 * @param constructorName the name of the constructor to be invoked 6850 * @param constructorName the name of the constructor to be invoked
7441 * @param argumentList the list of arguments to the constructor 6851 * @param argumentList the list of arguments to the constructor
7442 */ 6852 */
7443 InstanceCreationExpression.full(Token keyword, ConstructorName constructorName , ArgumentList argumentList) { 6853 InstanceCreationExpression(this.keyword, ConstructorName constructorName, Argu mentList argumentList) {
7444 this.keyword = keyword;
7445 this.constructorName = becomeParentOf(constructorName); 6854 this.constructorName = becomeParentOf(constructorName);
7446 this._argumentList = becomeParentOf(argumentList); 6855 this._argumentList = becomeParentOf(argumentList);
7447 } 6856 }
7448 6857
7449 /**
7450 * Initialize a newly created instance creation expression.
7451 *
7452 * @param keyword the keyword used to indicate how an object should be created
7453 * @param constructorName the name of the constructor to be invoked
7454 * @param argumentList the list of arguments to the constructor
7455 */
7456 InstanceCreationExpression({Token keyword, ConstructorName constructorName, Ar gumentList argumentList}) : this.full(keyword, constructorName, argumentList);
7457
7458 accept(ASTVisitor visitor) => visitor.visitInstanceCreationExpression(this); 6858 accept(ASTVisitor visitor) => visitor.visitInstanceCreationExpression(this);
7459 6859
7460 /** 6860 /**
7461 * Return the list of arguments to the constructor. 6861 * Return the list of arguments to the constructor.
7462 * 6862 *
7463 * @return the list of arguments to the constructor 6863 * @return the list of arguments to the constructor
7464 */ 6864 */
7465 ArgumentList get argumentList => _argumentList; 6865 ArgumentList get argumentList => _argumentList;
7466 6866
7467 Token get beginToken => keyword; 6867 Token get beginToken => keyword;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
7520 * The value of the literal. 6920 * The value of the literal.
7521 */ 6921 */
7522 int value = 0; 6922 int value = 0;
7523 6923
7524 /** 6924 /**
7525 * Initialize a newly created integer literal. 6925 * Initialize a newly created integer literal.
7526 * 6926 *
7527 * @param literal the token representing the literal 6927 * @param literal the token representing the literal
7528 * @param value the value of the literal 6928 * @param value the value of the literal
7529 */ 6929 */
7530 IntegerLiteral.full(Token literal, int value) { 6930 IntegerLiteral(this.literal, this.value);
7531 this.literal = literal;
7532 this.value = value;
7533 }
7534
7535 /**
7536 * Initialize a newly created integer literal.
7537 *
7538 * @param literal the token representing the literal
7539 * @param value the value of the literal
7540 */
7541 IntegerLiteral({Token literal, int value}) : this.full(literal, value);
7542 6931
7543 accept(ASTVisitor visitor) => visitor.visitIntegerLiteral(this); 6932 accept(ASTVisitor visitor) => visitor.visitIntegerLiteral(this);
7544 6933
7545 Token get beginToken => literal; 6934 Token get beginToken => literal;
7546 6935
7547 Token get endToken => literal; 6936 Token get endToken => literal;
7548 6937
7549 void visitChildren(ASTVisitor visitor) { 6938 void visitChildren(ASTVisitor visitor) {
7550 } 6939 }
7551 } 6940 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
7594 */ 6983 */
7595 Token rightBracket; 6984 Token rightBracket;
7596 6985
7597 /** 6986 /**
7598 * Initialize a newly created interpolation expression. 6987 * Initialize a newly created interpolation expression.
7599 * 6988 *
7600 * @param leftBracket the left curly bracket 6989 * @param leftBracket the left curly bracket
7601 * @param expression the expression to be evaluated for the value to be conver ted into a string 6990 * @param expression the expression to be evaluated for the value to be conver ted into a string
7602 * @param rightBracket the right curly bracket 6991 * @param rightBracket the right curly bracket
7603 */ 6992 */
7604 InterpolationExpression.full(Token leftBracket, Expression expression, Token r ightBracket) { 6993 InterpolationExpression(this.leftBracket, Expression expression, this.rightBra cket) {
7605 this.leftBracket = leftBracket;
7606 this._expression = becomeParentOf(expression); 6994 this._expression = becomeParentOf(expression);
7607 this.rightBracket = rightBracket;
7608 } 6995 }
7609 6996
7610 /**
7611 * Initialize a newly created interpolation expression.
7612 *
7613 * @param leftBracket the left curly bracket
7614 * @param expression the expression to be evaluated for the value to be conver ted into a string
7615 * @param rightBracket the right curly bracket
7616 */
7617 InterpolationExpression({Token leftBracket, Expression expression, Token right Bracket}) : this.full(leftBracket, expression, rightBracket);
7618
7619 accept(ASTVisitor visitor) => visitor.visitInterpolationExpression(this); 6997 accept(ASTVisitor visitor) => visitor.visitInterpolationExpression(this);
7620 6998
7621 Token get beginToken => leftBracket; 6999 Token get beginToken => leftBracket;
7622 7000
7623 Token get endToken { 7001 Token get endToken {
7624 if (rightBracket != null) { 7002 if (rightBracket != null) {
7625 return rightBracket; 7003 return rightBracket;
7626 } 7004 }
7627 return _expression.endToken; 7005 return _expression.endToken;
7628 } 7006 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
7670 * The value of the literal. 7048 * The value of the literal.
7671 */ 7049 */
7672 String _value; 7050 String _value;
7673 7051
7674 /** 7052 /**
7675 * Initialize a newly created string of characters that are part of a string i nterpolation. 7053 * Initialize a newly created string of characters that are part of a string i nterpolation.
7676 * 7054 *
7677 * @param the characters that will be added to the string 7055 * @param the characters that will be added to the string
7678 * @param value the value of the literal 7056 * @param value the value of the literal
7679 */ 7057 */
7680 InterpolationString.full(Token contents, String value) { 7058 InterpolationString(Token contents, String value) {
7681 this._contents = contents; 7059 this._contents = contents;
7682 this._value = value; 7060 this._value = value;
7683 } 7061 }
7684 7062
7685 /**
7686 * Initialize a newly created string of characters that are part of a string i nterpolation.
7687 *
7688 * @param the characters that will be added to the string
7689 * @param value the value of the literal
7690 */
7691 InterpolationString({Token contents, String value}) : this.full(contents, valu e);
7692
7693 accept(ASTVisitor visitor) => visitor.visitInterpolationString(this); 7063 accept(ASTVisitor visitor) => visitor.visitInterpolationString(this);
7694 7064
7695 Token get beginToken => _contents; 7065 Token get beginToken => _contents;
7696 7066
7697 /** 7067 /**
7698 * Return the characters that will be added to the string. 7068 * Return the characters that will be added to the string.
7699 * 7069 *
7700 * @return the characters that will be added to the string 7070 * @return the characters that will be added to the string
7701 */ 7071 */
7702 Token get contents => _contents; 7072 Token get contents => _contents;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
7764 TypeName _type; 7134 TypeName _type;
7765 7135
7766 /** 7136 /**
7767 * Initialize a newly created is expression. 7137 * Initialize a newly created is expression.
7768 * 7138 *
7769 * @param expression the expression used to compute the value whose type is be ing tested 7139 * @param expression the expression used to compute the value whose type is be ing tested
7770 * @param isOperator the is operator 7140 * @param isOperator the is operator
7771 * @param notOperator the not operator, or `null` if the sense of the test is not negated 7141 * @param notOperator the not operator, or `null` if the sense of the test is not negated
7772 * @param type the name of the type being tested for 7142 * @param type the name of the type being tested for
7773 */ 7143 */
7774 IsExpression.full(Expression expression, Token isOperator, Token notOperator, TypeName type) { 7144 IsExpression(Expression expression, this.isOperator, this.notOperator, TypeNam e type) {
7775 this._expression = becomeParentOf(expression); 7145 this._expression = becomeParentOf(expression);
7776 this.isOperator = isOperator;
7777 this.notOperator = notOperator;
7778 this._type = becomeParentOf(type); 7146 this._type = becomeParentOf(type);
7779 } 7147 }
7780 7148
7781 /**
7782 * Initialize a newly created is expression.
7783 *
7784 * @param expression the expression used to compute the value whose type is be ing tested
7785 * @param isOperator the is operator
7786 * @param notOperator the not operator, or `null` if the sense of the test is not negated
7787 * @param type the name of the type being tested for
7788 */
7789 IsExpression({Expression expression, Token isOperator, Token notOperator, Type Name type}) : this.full(expression, isOperator, notOperator, type);
7790
7791 accept(ASTVisitor visitor) => visitor.visitIsExpression(this); 7149 accept(ASTVisitor visitor) => visitor.visitIsExpression(this);
7792 7150
7793 Token get beginToken => _expression.beginToken; 7151 Token get beginToken => _expression.beginToken;
7794 7152
7795 Token get endToken => _type.endToken; 7153 Token get endToken => _type.endToken;
7796 7154
7797 /** 7155 /**
7798 * Return the expression used to compute the value whose type is being tested. 7156 * Return the expression used to compute the value whose type is being tested.
7799 * 7157 *
7800 * @return the expression used to compute the value whose type is being tested 7158 * @return the expression used to compute the value whose type is being tested
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
7855 * The colon that separates the label from the statement. 7213 * The colon that separates the label from the statement.
7856 */ 7214 */
7857 Token colon; 7215 Token colon;
7858 7216
7859 /** 7217 /**
7860 * Initialize a newly created label. 7218 * Initialize a newly created label.
7861 * 7219 *
7862 * @param label the label being applied 7220 * @param label the label being applied
7863 * @param colon the colon that separates the label from whatever follows 7221 * @param colon the colon that separates the label from whatever follows
7864 */ 7222 */
7865 Label.full(SimpleIdentifier label, Token colon) { 7223 Label(SimpleIdentifier label, this.colon) {
7866 this._label = becomeParentOf(label); 7224 this._label = becomeParentOf(label);
7867 this.colon = colon;
7868 } 7225 }
7869 7226
7870 /**
7871 * Initialize a newly created label.
7872 *
7873 * @param label the label being applied
7874 * @param colon the colon that separates the label from whatever follows
7875 */
7876 Label({SimpleIdentifier label, Token colon}) : this.full(label, colon);
7877
7878 accept(ASTVisitor visitor) => visitor.visitLabel(this); 7227 accept(ASTVisitor visitor) => visitor.visitLabel(this);
7879 7228
7880 Token get beginToken => _label.beginToken; 7229 Token get beginToken => _label.beginToken;
7881 7230
7882 Token get endToken => colon; 7231 Token get endToken => colon;
7883 7232
7884 /** 7233 /**
7885 * Return the label being associated with the statement. 7234 * Return the label being associated with the statement.
7886 * 7235 *
7887 * @return the label being associated with the statement 7236 * @return the label being associated with the statement
(...skipping 22 matching lines...) Expand all
7910 * labeledStatement ::= 7259 * labeledStatement ::=
7911 * [Label]+ [Statement] 7260 * [Label]+ [Statement]
7912 * </pre> 7261 * </pre>
7913 * 7262 *
7914 * @coverage dart.engine.ast 7263 * @coverage dart.engine.ast
7915 */ 7264 */
7916 class LabeledStatement extends Statement { 7265 class LabeledStatement extends Statement {
7917 /** 7266 /**
7918 * The labels being associated with the statement. 7267 * The labels being associated with the statement.
7919 */ 7268 */
7920 NodeList<Label> labels; 7269 NodeList<Label> _labels;
7921 7270
7922 /** 7271 /**
7923 * The statement with which the labels are being associated. 7272 * The statement with which the labels are being associated.
7924 */ 7273 */
7925 Statement _statement; 7274 Statement _statement;
7926 7275
7927 /** 7276 /**
7928 * Initialize a newly created labeled statement. 7277 * Initialize a newly created labeled statement.
7929 * 7278 *
7930 * @param labels the labels being associated with the statement 7279 * @param labels the labels being associated with the statement
7931 * @param statement the statement with which the labels are being associated 7280 * @param statement the statement with which the labels are being associated
7932 */ 7281 */
7933 LabeledStatement.full(List<Label> labels, Statement statement) { 7282 LabeledStatement(List<Label> labels, Statement statement) {
7934 this.labels = new NodeList<Label>(this); 7283 this._labels = new NodeList<Label>(this);
7935 this.labels.addAll(labels); 7284 this._labels.addAll(labels);
7936 this._statement = becomeParentOf(statement); 7285 this._statement = becomeParentOf(statement);
7937 } 7286 }
7938 7287
7939 /**
7940 * Initialize a newly created labeled statement.
7941 *
7942 * @param labels the labels being associated with the statement
7943 * @param statement the statement with which the labels are being associated
7944 */
7945 LabeledStatement({List<Label> labels, Statement statement}) : this.full(labels , statement);
7946
7947 accept(ASTVisitor visitor) => visitor.visitLabeledStatement(this); 7288 accept(ASTVisitor visitor) => visitor.visitLabeledStatement(this);
7948 7289
7949 Token get beginToken { 7290 Token get beginToken {
7950 if (!labels.isEmpty) { 7291 if (!_labels.isEmpty) {
7951 return labels.beginToken; 7292 return _labels.beginToken;
7952 } 7293 }
7953 return _statement.beginToken; 7294 return _statement.beginToken;
7954 } 7295 }
7955 7296
7956 Token get endToken => _statement.endToken; 7297 Token get endToken => _statement.endToken;
7957 7298
7958 /** 7299 /**
7300 * Return the labels being associated with the statement.
7301 *
7302 * @return the labels being associated with the statement
7303 */
7304 NodeList<Label> get labels => _labels;
7305
7306 /**
7959 * Return the statement with which the labels are being associated. 7307 * Return the statement with which the labels are being associated.
7960 * 7308 *
7961 * @return the statement with which the labels are being associated 7309 * @return the statement with which the labels are being associated
7962 */ 7310 */
7963 Statement get statement => _statement; 7311 Statement get statement => _statement;
7964 7312
7965 /** 7313 /**
7966 * Set the statement with which the labels are being associated to the given s tatement. 7314 * Set the statement with which the labels are being associated to the given s tatement.
7967 * 7315 *
7968 * @param statement the statement with which the labels are being associated 7316 * @param statement the statement with which the labels are being associated
7969 */ 7317 */
7970 void set statement(Statement statement) { 7318 void set statement(Statement statement) {
7971 this._statement = becomeParentOf(statement); 7319 this._statement = becomeParentOf(statement);
7972 } 7320 }
7973 7321
7974 void visitChildren(ASTVisitor visitor) { 7322 void visitChildren(ASTVisitor visitor) {
7975 labels.accept(visitor); 7323 _labels.accept(visitor);
7976 safelyVisitChild(_statement, visitor); 7324 safelyVisitChild(_statement, visitor);
7977 } 7325 }
7978 } 7326 }
7979 7327
7980 /** 7328 /**
7981 * Instances of the class `LibraryDirective` represent a library directive. 7329 * Instances of the class `LibraryDirective` represent a library directive.
7982 * 7330 *
7983 * <pre> 7331 * <pre>
7984 * libraryDirective ::= 7332 * libraryDirective ::=
7985 * [Annotation] 'library' [Identifier] ';' 7333 * [Annotation] 'library' [Identifier] ';'
(...skipping 19 matching lines...) Expand all
8005 7353
8006 /** 7354 /**
8007 * Initialize a newly created library directive. 7355 * Initialize a newly created library directive.
8008 * 7356 *
8009 * @param comment the documentation comment associated with this directive 7357 * @param comment the documentation comment associated with this directive
8010 * @param metadata the annotations associated with the directive 7358 * @param metadata the annotations associated with the directive
8011 * @param libraryToken the token representing the 'library' token 7359 * @param libraryToken the token representing the 'library' token
8012 * @param name the name of the library being defined 7360 * @param name the name of the library being defined
8013 * @param semicolon the semicolon terminating the directive 7361 * @param semicolon the semicolon terminating the directive
8014 */ 7362 */
8015 LibraryDirective.full(Comment comment, List<Annotation> metadata, Token librar yToken, LibraryIdentifier name, Token semicolon) : super.full(comment, metadata) { 7363 LibraryDirective(Comment comment, List<Annotation> metadata, this.libraryToken , LibraryIdentifier name, this.semicolon) : super(comment, metadata) {
8016 this.libraryToken = libraryToken;
8017 this._name = becomeParentOf(name); 7364 this._name = becomeParentOf(name);
8018 this.semicolon = semicolon;
8019 } 7365 }
8020 7366
8021 /**
8022 * Initialize a newly created library directive.
8023 *
8024 * @param comment the documentation comment associated with this directive
8025 * @param metadata the annotations associated with the directive
8026 * @param libraryToken the token representing the 'library' token
8027 * @param name the name of the library being defined
8028 * @param semicolon the semicolon terminating the directive
8029 */
8030 LibraryDirective({Comment comment, List<Annotation> metadata, Token libraryTok en, LibraryIdentifier name, Token semicolon}) : this.full(comment, metadata, lib raryToken, name, semicolon);
8031
8032 accept(ASTVisitor visitor) => visitor.visitLibraryDirective(this); 7367 accept(ASTVisitor visitor) => visitor.visitLibraryDirective(this);
8033 7368
8034 Token get endToken => semicolon; 7369 Token get endToken => semicolon;
8035 7370
8036 Token get keyword => libraryToken; 7371 Token get keyword => libraryToken;
8037 7372
8038 /** 7373 /**
8039 * Return the name of the library being defined. 7374 * Return the name of the library being defined.
8040 * 7375 *
8041 * @return the name of the library being defined 7376 * @return the name of the library being defined
(...skipping 24 matching lines...) Expand all
8066 * libraryIdentifier ::= 7401 * libraryIdentifier ::=
8067 * [SimpleIdentifier] ('.' [SimpleIdentifier])* 7402 * [SimpleIdentifier] ('.' [SimpleIdentifier])*
8068 * </pre> 7403 * </pre>
8069 * 7404 *
8070 * @coverage dart.engine.ast 7405 * @coverage dart.engine.ast
8071 */ 7406 */
8072 class LibraryIdentifier extends Identifier { 7407 class LibraryIdentifier extends Identifier {
8073 /** 7408 /**
8074 * The components of the identifier. 7409 * The components of the identifier.
8075 */ 7410 */
8076 NodeList<SimpleIdentifier> components; 7411 NodeList<SimpleIdentifier> _components;
8077 7412
8078 /** 7413 /**
8079 * Initialize a newly created prefixed identifier. 7414 * Initialize a newly created prefixed identifier.
8080 * 7415 *
8081 * @param components the components of the identifier 7416 * @param components the components of the identifier
8082 */ 7417 */
8083 LibraryIdentifier.full(List<SimpleIdentifier> components) { 7418 LibraryIdentifier(List<SimpleIdentifier> components) {
8084 this.components = new NodeList<SimpleIdentifier>(this); 7419 this._components = new NodeList<SimpleIdentifier>(this);
8085 this.components.addAll(components); 7420 this._components.addAll(components);
8086 } 7421 }
8087 7422
8088 /**
8089 * Initialize a newly created prefixed identifier.
8090 *
8091 * @param components the components of the identifier
8092 */
8093 LibraryIdentifier({List<SimpleIdentifier> components}) : this.full(components) ;
8094
8095 accept(ASTVisitor visitor) => visitor.visitLibraryIdentifier(this); 7423 accept(ASTVisitor visitor) => visitor.visitLibraryIdentifier(this);
8096 7424
8097 Token get beginToken => components.beginToken; 7425 Token get beginToken => _components.beginToken;
8098 7426
8099 Element get bestElement => staticElement; 7427 Element get bestElement => staticElement;
8100 7428
8101 Token get endToken => components.endToken; 7429 /**
7430 * Return the components of the identifier.
7431 *
7432 * @return the components of the identifier
7433 */
7434 NodeList<SimpleIdentifier> get components => _components;
7435
7436 Token get endToken => _components.endToken;
8102 7437
8103 String get name { 7438 String get name {
8104 JavaStringBuilder builder = new JavaStringBuilder(); 7439 JavaStringBuilder builder = new JavaStringBuilder();
8105 bool needsPeriod = false; 7440 bool needsPeriod = false;
8106 for (SimpleIdentifier identifier in components) { 7441 for (SimpleIdentifier identifier in _components) {
8107 if (needsPeriod) { 7442 if (needsPeriod) {
8108 builder.append("."); 7443 builder.append(".");
8109 } else { 7444 } else {
8110 needsPeriod = true; 7445 needsPeriod = true;
8111 } 7446 }
8112 builder.append(identifier.name); 7447 builder.append(identifier.name);
8113 } 7448 }
8114 return builder.toString(); 7449 return builder.toString();
8115 } 7450 }
8116 7451
8117 int get precedence => 15; 7452 int get precedence => 15;
8118 7453
8119 Element get propagatedElement => null; 7454 Element get propagatedElement => null;
8120 7455
8121 Element get staticElement => null; 7456 Element get staticElement => null;
8122 7457
8123 void visitChildren(ASTVisitor visitor) { 7458 void visitChildren(ASTVisitor visitor) {
8124 components.accept(visitor); 7459 _components.accept(visitor);
8125 } 7460 }
8126 } 7461 }
8127 7462
8128 /** 7463 /**
8129 * Instances of the class `ListLiteral` represent a list literal. 7464 * Instances of the class `ListLiteral` represent a list literal.
8130 * 7465 *
8131 * <pre> 7466 * <pre>
8132 * listLiteral ::= 7467 * listLiteral ::=
8133 * 'const'? ('<' [TypeName] '>')? '[' ([Expression] ','?)? ']' 7468 * 'const'? ('<' [TypeName] '>')? '[' ([Expression] ','?)? ']'
8134 * </pre> 7469 * </pre>
8135 * 7470 *
8136 * @coverage dart.engine.ast 7471 * @coverage dart.engine.ast
8137 */ 7472 */
8138 class ListLiteral extends TypedLiteral { 7473 class ListLiteral extends TypedLiteral {
8139 /** 7474 /**
8140 * The left square bracket. 7475 * The left square bracket.
8141 */ 7476 */
8142 Token _leftBracket; 7477 Token _leftBracket;
8143 7478
8144 /** 7479 /**
8145 * The expressions used to compute the elements of the list. 7480 * The expressions used to compute the elements of the list.
8146 */ 7481 */
8147 NodeList<Expression> elements; 7482 NodeList<Expression> _elements;
8148 7483
8149 /** 7484 /**
8150 * The right square bracket. 7485 * The right square bracket.
8151 */ 7486 */
8152 Token _rightBracket; 7487 Token _rightBracket;
8153 7488
8154 /** 7489 /**
8155 * Initialize a newly created list literal. 7490 * Initialize a newly created list literal.
8156 *
8157 * @param constKeyword the token representing the 'const' keyword
8158 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
8159 * arguments were declared
8160 * @param leftBracket the left square bracket
8161 * @param elements the expressions used to compute the elements of the list
8162 * @param rightBracket the right square bracket
8163 */
8164 ListLiteral.full(Token constKeyword, TypeArgumentList typeArguments, Token lef tBracket, List<Expression> elements, Token rightBracket) : super.full(constKeywo rd, typeArguments) {
8165 this.elements = new NodeList<Expression>(this);
8166 this._leftBracket = leftBracket;
8167 this.elements.addAll(elements);
8168 this._rightBracket = rightBracket;
8169 }
8170
8171 /**
8172 * Initialize a newly created list literal.
8173 * 7491 *
8174 * @param constKeyword the token representing the 'const' keyword 7492 * @param constKeyword the token representing the 'const' keyword
8175 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 7493 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
8176 * arguments were declared 7494 * arguments were declared
8177 * @param leftBracket the left square bracket 7495 * @param leftBracket the left square bracket
8178 * @param elements the expressions used to compute the elements of the list 7496 * @param elements the expressions used to compute the elements of the list
8179 * @param rightBracket the right square bracket 7497 * @param rightBracket the right square bracket
8180 */ 7498 */
8181 ListLiteral({Token constKeyword, TypeArgumentList typeArguments, Token leftBra cket, List<Expression> elements, Token rightBracket}) : this.full(constKeyword, typeArguments, leftBracket, elements, rightBracket); 7499 ListLiteral(Token constKeyword, TypeArgumentList typeArguments, Token leftBrac ket, List<Expression> elements, Token rightBracket) : super(constKeyword, typeAr guments) {
7500 this._elements = new NodeList<Expression>(this);
7501 this._leftBracket = leftBracket;
7502 this._elements.addAll(elements);
7503 this._rightBracket = rightBracket;
7504 }
8182 7505
8183 accept(ASTVisitor visitor) => visitor.visitListLiteral(this); 7506 accept(ASTVisitor visitor) => visitor.visitListLiteral(this);
8184 7507
8185 Token get beginToken { 7508 Token get beginToken {
8186 Token token = constKeyword; 7509 Token token = constKeyword;
8187 if (token != null) { 7510 if (token != null) {
8188 return token; 7511 return token;
8189 } 7512 }
8190 TypeArgumentList typeArguments = this.typeArguments; 7513 TypeArgumentList typeArguments = this.typeArguments;
8191 if (typeArguments != null) { 7514 if (typeArguments != null) {
8192 return typeArguments.beginToken; 7515 return typeArguments.beginToken;
8193 } 7516 }
8194 return _leftBracket; 7517 return _leftBracket;
8195 } 7518 }
8196 7519
7520 /**
7521 * Return the expressions used to compute the elements of the list.
7522 *
7523 * @return the expressions used to compute the elements of the list
7524 */
7525 NodeList<Expression> get elements => _elements;
7526
8197 Token get endToken => _rightBracket; 7527 Token get endToken => _rightBracket;
8198 7528
8199 /** 7529 /**
8200 * Return the left square bracket. 7530 * Return the left square bracket.
8201 * 7531 *
8202 * @return the left square bracket 7532 * @return the left square bracket
8203 */ 7533 */
8204 Token get leftBracket => _leftBracket; 7534 Token get leftBracket => _leftBracket;
8205 7535
8206 /** 7536 /**
(...skipping 16 matching lines...) Expand all
8223 * Set the right square bracket to the given token. 7553 * Set the right square bracket to the given token.
8224 * 7554 *
8225 * @param bracket the right square bracket 7555 * @param bracket the right square bracket
8226 */ 7556 */
8227 void set rightBracket(Token bracket) { 7557 void set rightBracket(Token bracket) {
8228 _rightBracket = bracket; 7558 _rightBracket = bracket;
8229 } 7559 }
8230 7560
8231 void visitChildren(ASTVisitor visitor) { 7561 void visitChildren(ASTVisitor visitor) {
8232 super.visitChildren(visitor); 7562 super.visitChildren(visitor);
8233 elements.accept(visitor); 7563 _elements.accept(visitor);
8234 } 7564 }
8235 } 7565 }
8236 7566
8237 /** 7567 /**
8238 * The abstract class `Literal` defines the behavior common to nodes that repres ent a literal 7568 * The abstract class `Literal` defines the behavior common to nodes that repres ent a literal
8239 * expression. 7569 * expression.
8240 * 7570 *
8241 * <pre> 7571 * <pre>
8242 * literal ::= 7572 * literal ::=
8243 * [BooleanLiteral] 7573 * [BooleanLiteral]
(...skipping 23 matching lines...) Expand all
8267 */ 7597 */
8268 class MapLiteral extends TypedLiteral { 7598 class MapLiteral extends TypedLiteral {
8269 /** 7599 /**
8270 * The left curly bracket. 7600 * The left curly bracket.
8271 */ 7601 */
8272 Token _leftBracket; 7602 Token _leftBracket;
8273 7603
8274 /** 7604 /**
8275 * The entries in the map. 7605 * The entries in the map.
8276 */ 7606 */
8277 NodeList<MapLiteralEntry> entries; 7607 NodeList<MapLiteralEntry> _entries;
8278 7608
8279 /** 7609 /**
8280 * The right curly bracket. 7610 * The right curly bracket.
8281 */ 7611 */
8282 Token _rightBracket; 7612 Token _rightBracket;
8283 7613
8284 /** 7614 /**
8285 * Initialize a newly created map literal. 7615 * Initialize a newly created map literal.
8286 * 7616 *
8287 * @param constKeyword the token representing the 'const' keyword 7617 * @param constKeyword the token representing the 'const' keyword
8288 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 7618 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
8289 * arguments were declared 7619 * arguments were declared
8290 * @param leftBracket the left curly bracket 7620 * @param leftBracket the left curly bracket
8291 * @param entries the entries in the map 7621 * @param entries the entries in the map
8292 * @param rightBracket the right curly bracket 7622 * @param rightBracket the right curly bracket
8293 */ 7623 */
8294 MapLiteral.full(Token constKeyword, TypeArgumentList typeArguments, Token left Bracket, List<MapLiteralEntry> entries, Token rightBracket) : super.full(constKe yword, typeArguments) { 7624 MapLiteral(Token constKeyword, TypeArgumentList typeArguments, Token leftBrack et, List<MapLiteralEntry> entries, Token rightBracket) : super(constKeyword, typ eArguments) {
8295 this.entries = new NodeList<MapLiteralEntry>(this); 7625 this._entries = new NodeList<MapLiteralEntry>(this);
8296 this._leftBracket = leftBracket; 7626 this._leftBracket = leftBracket;
8297 this.entries.addAll(entries); 7627 this._entries.addAll(entries);
8298 this._rightBracket = rightBracket; 7628 this._rightBracket = rightBracket;
8299 } 7629 }
8300 7630
8301 /**
8302 * Initialize a newly created map literal.
8303 *
8304 * @param constKeyword the token representing the 'const' keyword
8305 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
8306 * arguments were declared
8307 * @param leftBracket the left curly bracket
8308 * @param entries the entries in the map
8309 * @param rightBracket the right curly bracket
8310 */
8311 MapLiteral({Token constKeyword, TypeArgumentList typeArguments, Token leftBrac ket, List<MapLiteralEntry> entries, Token rightBracket}) : this.full(constKeywor d, typeArguments, leftBracket, entries, rightBracket);
8312
8313 accept(ASTVisitor visitor) => visitor.visitMapLiteral(this); 7631 accept(ASTVisitor visitor) => visitor.visitMapLiteral(this);
8314 7632
8315 Token get beginToken { 7633 Token get beginToken {
8316 Token token = constKeyword; 7634 Token token = constKeyword;
8317 if (token != null) { 7635 if (token != null) {
8318 return token; 7636 return token;
8319 } 7637 }
8320 TypeArgumentList typeArguments = this.typeArguments; 7638 TypeArgumentList typeArguments = this.typeArguments;
8321 if (typeArguments != null) { 7639 if (typeArguments != null) {
8322 return typeArguments.beginToken; 7640 return typeArguments.beginToken;
8323 } 7641 }
8324 return _leftBracket; 7642 return _leftBracket;
8325 } 7643 }
8326 7644
8327 Token get endToken => _rightBracket; 7645 Token get endToken => _rightBracket;
8328 7646
8329 /** 7647 /**
7648 * Return the entries in the map.
7649 *
7650 * @return the entries in the map
7651 */
7652 NodeList<MapLiteralEntry> get entries => _entries;
7653
7654 /**
8330 * Return the left curly bracket. 7655 * Return the left curly bracket.
8331 * 7656 *
8332 * @return the left curly bracket 7657 * @return the left curly bracket
8333 */ 7658 */
8334 Token get leftBracket => _leftBracket; 7659 Token get leftBracket => _leftBracket;
8335 7660
8336 /** 7661 /**
8337 * Return the right curly bracket. 7662 * Return the right curly bracket.
8338 * 7663 *
8339 * @return the right curly bracket 7664 * @return the right curly bracket
(...skipping 13 matching lines...) Expand all
8353 * Set the right curly bracket to the given token. 7678 * Set the right curly bracket to the given token.
8354 * 7679 *
8355 * @param bracket the right curly bracket 7680 * @param bracket the right curly bracket
8356 */ 7681 */
8357 void set rightBracket(Token bracket) { 7682 void set rightBracket(Token bracket) {
8358 _rightBracket = bracket; 7683 _rightBracket = bracket;
8359 } 7684 }
8360 7685
8361 void visitChildren(ASTVisitor visitor) { 7686 void visitChildren(ASTVisitor visitor) {
8362 super.visitChildren(visitor); 7687 super.visitChildren(visitor);
8363 entries.accept(visitor); 7688 _entries.accept(visitor);
8364 } 7689 }
8365 } 7690 }
8366 7691
8367 /** 7692 /**
8368 * Instances of the class `MapLiteralEntry` represent a single key/value pair in a map 7693 * Instances of the class `MapLiteralEntry` represent a single key/value pair in a map
8369 * literal. 7694 * literal.
8370 * 7695 *
8371 * <pre> 7696 * <pre>
8372 * mapLiteralEntry ::= 7697 * mapLiteralEntry ::=
8373 * [Expression] ':' [Expression] 7698 * [Expression] ':' [Expression]
(...skipping 17 matching lines...) Expand all
8391 */ 7716 */
8392 Expression _value; 7717 Expression _value;
8393 7718
8394 /** 7719 /**
8395 * Initialize a newly created map literal entry. 7720 * Initialize a newly created map literal entry.
8396 * 7721 *
8397 * @param key the expression computing the key with which the value will be as sociated 7722 * @param key the expression computing the key with which the value will be as sociated
8398 * @param separator the colon that separates the key from the value 7723 * @param separator the colon that separates the key from the value
8399 * @param value the expression computing the value that will be associated wit h the key 7724 * @param value the expression computing the value that will be associated wit h the key
8400 */ 7725 */
8401 MapLiteralEntry.full(Expression key, Token separator, Expression value) { 7726 MapLiteralEntry(Expression key, this.separator, Expression value) {
8402 this._key = becomeParentOf(key); 7727 this._key = becomeParentOf(key);
8403 this.separator = separator;
8404 this._value = becomeParentOf(value); 7728 this._value = becomeParentOf(value);
8405 } 7729 }
8406 7730
8407 /**
8408 * Initialize a newly created map literal entry.
8409 *
8410 * @param key the expression computing the key with which the value will be as sociated
8411 * @param separator the colon that separates the key from the value
8412 * @param value the expression computing the value that will be associated wit h the key
8413 */
8414 MapLiteralEntry({Expression key, Token separator, Expression value}) : this.fu ll(key, separator, value);
8415
8416 accept(ASTVisitor visitor) => visitor.visitMapLiteralEntry(this); 7731 accept(ASTVisitor visitor) => visitor.visitMapLiteralEntry(this);
8417 7732
8418 Token get beginToken => _key.beginToken; 7733 Token get beginToken => _key.beginToken;
8419 7734
8420 Token get endToken => _value.endToken; 7735 Token get endToken => _value.endToken;
8421 7736
8422 /** 7737 /**
8423 * Return the expression computing the key with which the value will be associ ated. 7738 * Return the expression computing the key with which the value will be associ ated.
8424 * 7739 *
8425 * @return the expression computing the key with which the value will be assoc iated 7740 * @return the expression computing the key with which the value will be assoc iated
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
8529 * @param metadata the annotations associated with this method 7844 * @param metadata the annotations associated with this method
8530 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword 7845 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword
8531 * @param returnType the return type of the method 7846 * @param returnType the return type of the method
8532 * @param propertyKeyword the token representing the 'get' or 'set' keyword 7847 * @param propertyKeyword the token representing the 'get' or 'set' keyword
8533 * @param operatorKeyword the token representing the 'operator' keyword 7848 * @param operatorKeyword the token representing the 'operator' keyword
8534 * @param name the name of the method 7849 * @param name the name of the method
8535 * @param parameters the parameters associated with the method, or `null` if t his method 7850 * @param parameters the parameters associated with the method, or `null` if t his method
8536 * declares a getter 7851 * declares a getter
8537 * @param body the body of the method 7852 * @param body the body of the method
8538 */ 7853 */
8539 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) { 7854 MethodDeclaration(Comment comment, List<Annotation> metadata, this.externalKey word, this.modifierKeyword, TypeName returnType, this.propertyKeyword, this.oper atorKeyword, SimpleIdentifier name, FormalParameterList parameters, FunctionBody body) : super(comment, metadata) {
8540 this.externalKeyword = externalKeyword;
8541 this.modifierKeyword = modifierKeyword;
8542 this._returnType = becomeParentOf(returnType); 7855 this._returnType = becomeParentOf(returnType);
8543 this.propertyKeyword = propertyKeyword;
8544 this.operatorKeyword = operatorKeyword;
8545 this._name = becomeParentOf(name); 7856 this._name = becomeParentOf(name);
8546 this._parameters = becomeParentOf(parameters); 7857 this._parameters = becomeParentOf(parameters);
8547 this._body = becomeParentOf(body); 7858 this._body = becomeParentOf(body);
8548 } 7859 }
8549 7860
8550 /**
8551 * Initialize a newly created method declaration.
8552 *
8553 * @param externalKeyword the token for the 'external' keyword
8554 * @param comment the documentation comment associated with this method
8555 * @param metadata the annotations associated with this method
8556 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword
8557 * @param returnType the return type of the method
8558 * @param propertyKeyword the token representing the 'get' or 'set' keyword
8559 * @param operatorKeyword the token representing the 'operator' keyword
8560 * @param name the name of the method
8561 * @param parameters the parameters associated with the method, or `null` if t his method
8562 * declares a getter
8563 * @param body the body of the method
8564 */
8565 MethodDeclaration({Comment comment, List<Annotation> metadata, Token externalK eyword, Token modifierKeyword, TypeName returnType, Token propertyKeyword, Token operatorKeyword, SimpleIdentifier name, FormalParameterList parameters, Functio nBody body}) : this.full(comment, metadata, externalKeyword, modifierKeyword, re turnType, propertyKeyword, operatorKeyword, name, parameters, body);
8566
8567 accept(ASTVisitor visitor) => visitor.visitMethodDeclaration(this); 7861 accept(ASTVisitor visitor) => visitor.visitMethodDeclaration(this);
8568 7862
8569 /** 7863 /**
8570 * Return the body of the method. 7864 * Return the body of the method.
8571 * 7865 *
8572 * @return the body of the method 7866 * @return the body of the method
8573 */ 7867 */
8574 FunctionBody get body => _body; 7868 FunctionBody get body => _body;
8575 7869
8576 /** 7870 /**
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
8738 ArgumentList _argumentList; 8032 ArgumentList _argumentList;
8739 8033
8740 /** 8034 /**
8741 * Initialize a newly created method invocation. 8035 * Initialize a newly created method invocation.
8742 * 8036 *
8743 * @param target the expression producing the object on which the method is de fined 8037 * @param target the expression producing the object on which the method is de fined
8744 * @param period the period that separates the target from the method name 8038 * @param period the period that separates the target from the method name
8745 * @param methodName the name of the method being invoked 8039 * @param methodName the name of the method being invoked
8746 * @param argumentList the list of arguments to the method 8040 * @param argumentList the list of arguments to the method
8747 */ 8041 */
8748 MethodInvocation.full(Expression target, Token period, SimpleIdentifier method Name, ArgumentList argumentList) { 8042 MethodInvocation(Expression target, this.period, SimpleIdentifier methodName, ArgumentList argumentList) {
8749 this._target = becomeParentOf(target); 8043 this._target = becomeParentOf(target);
8750 this.period = period;
8751 this._methodName = becomeParentOf(methodName); 8044 this._methodName = becomeParentOf(methodName);
8752 this._argumentList = becomeParentOf(argumentList); 8045 this._argumentList = becomeParentOf(argumentList);
8753 } 8046 }
8754 8047
8755 /**
8756 * Initialize a newly created method invocation.
8757 *
8758 * @param target the expression producing the object on which the method is de fined
8759 * @param period the period that separates the target from the method name
8760 * @param methodName the name of the method being invoked
8761 * @param argumentList the list of arguments to the method
8762 */
8763 MethodInvocation({Expression target, Token period, SimpleIdentifier methodName , ArgumentList argumentList}) : this.full(target, period, methodName, argumentLi st);
8764
8765 accept(ASTVisitor visitor) => visitor.visitMethodInvocation(this); 8048 accept(ASTVisitor visitor) => visitor.visitMethodInvocation(this);
8766 8049
8767 /** 8050 /**
8768 * Return the list of arguments to the method. 8051 * Return the list of arguments to the method.
8769 * 8052 *
8770 * @return the list of arguments to the method 8053 * @return the list of arguments to the method
8771 */ 8054 */
8772 ArgumentList get argumentList => _argumentList; 8055 ArgumentList get argumentList => _argumentList;
8773 8056
8774 Token get beginToken { 8057 Token get beginToken {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
8888 * The expression with which the name is associated. 8171 * The expression with which the name is associated.
8889 */ 8172 */
8890 Expression _expression; 8173 Expression _expression;
8891 8174
8892 /** 8175 /**
8893 * Initialize a newly created named expression. 8176 * Initialize a newly created named expression.
8894 * 8177 *
8895 * @param name the name associated with the expression 8178 * @param name the name associated with the expression
8896 * @param expression the expression with which the name is associated 8179 * @param expression the expression with which the name is associated
8897 */ 8180 */
8898 NamedExpression.full(Label name, Expression expression) { 8181 NamedExpression(Label name, Expression expression) {
8899 this._name = becomeParentOf(name); 8182 this._name = becomeParentOf(name);
8900 this._expression = becomeParentOf(expression); 8183 this._expression = becomeParentOf(expression);
8901 } 8184 }
8902 8185
8903 /**
8904 * Initialize a newly created named expression.
8905 *
8906 * @param name the name associated with the expression
8907 * @param expression the expression with which the name is associated
8908 */
8909 NamedExpression({Label name, Expression expression}) : this.full(name, express ion);
8910
8911 accept(ASTVisitor visitor) => visitor.visitNamedExpression(this); 8186 accept(ASTVisitor visitor) => visitor.visitNamedExpression(this);
8912 8187
8913 Token get beginToken => _name.beginToken; 8188 Token get beginToken => _name.beginToken;
8914 8189
8915 /** 8190 /**
8916 * Return the element representing the parameter being named by this expressio n, or `null` 8191 * Return the element representing the parameter being named by this expressio n, or `null`
8917 * if the AST structure has not been resolved or if there is no parameter with the same name as 8192 * if the AST structure has not been resolved or if there is no parameter with the same name as
8918 * this expression. 8193 * this expression.
8919 * 8194 *
8920 * @return the element representing the parameter being named by this expressi on 8195 * @return the element representing the parameter being named by this expressi on
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
8978 * [ExportDirective] 8253 * [ExportDirective]
8979 * | [ImportDirective] 8254 * | [ImportDirective]
8980 * </pre> 8255 * </pre>
8981 * 8256 *
8982 * @coverage dart.engine.ast 8257 * @coverage dart.engine.ast
8983 */ 8258 */
8984 abstract class NamespaceDirective extends UriBasedDirective { 8259 abstract class NamespaceDirective extends UriBasedDirective {
8985 /** 8260 /**
8986 * The token representing the 'import' or 'export' keyword. 8261 * The token representing the 'import' or 'export' keyword.
8987 */ 8262 */
8988 Token _keyword; 8263 Token keyword;
8989 8264
8990 /** 8265 /**
8991 * The combinators used to control which names are imported or exported. 8266 * The combinators used to control which names are imported or exported.
8992 */ 8267 */
8993 NodeList<Combinator> combinators; 8268 NodeList<Combinator> _combinators;
8994 8269
8995 /** 8270 /**
8996 * The semicolon terminating the directive. 8271 * The semicolon terminating the directive.
8997 */ 8272 */
8998 Token semicolon; 8273 Token semicolon;
8999 8274
9000 /** 8275 /**
9001 * Initialize a newly created namespace directive. 8276 * Initialize a newly created namespace directive.
9002 * 8277 *
9003 * @param comment the documentation comment associated with this directive 8278 * @param comment the documentation comment associated with this directive
9004 * @param metadata the annotations associated with the directive 8279 * @param metadata the annotations associated with the directive
9005 * @param keyword the token representing the 'import' or 'export' keyword 8280 * @param keyword the token representing the 'import' or 'export' keyword
9006 * @param libraryUri the URI of the library being imported or exported 8281 * @param libraryUri the URI of the library being imported or exported
9007 * @param combinators the combinators used to control which names are imported or exported 8282 * @param combinators the combinators used to control which names are imported or exported
9008 * @param semicolon the semicolon terminating the directive 8283 * @param semicolon the semicolon terminating the directive
9009 */ 8284 */
9010 NamespaceDirective.full(Comment comment, List<Annotation> metadata, Token keyw ord, StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) : super.full(comment, metadata, libraryUri) { 8285 NamespaceDirective(Comment comment, List<Annotation> metadata, this.keyword, S tringLiteral libraryUri, List<Combinator> combinators, this.semicolon) : super(c omment, metadata, libraryUri) {
9011 this.combinators = new NodeList<Combinator>(this); 8286 this._combinators = new NodeList<Combinator>(this);
9012 this._keyword = keyword; 8287 this._combinators.addAll(combinators);
9013 this.combinators.addAll(combinators);
9014 this.semicolon = semicolon;
9015 } 8288 }
9016 8289
9017 /** 8290 /**
9018 * Initialize a newly created namespace directive. 8291 * Return the combinators used to control how names are imported or exported.
9019 * 8292 *
9020 * @param comment the documentation comment associated with this directive 8293 * @return the combinators used to control how names are imported or exported
9021 * @param metadata the annotations associated with the directive
9022 * @param keyword the token representing the 'import' or 'export' keyword
9023 * @param libraryUri the URI of the library being imported or exported
9024 * @param combinators the combinators used to control which names are imported or exported
9025 * @param semicolon the semicolon terminating the directive
9026 */ 8294 */
9027 NamespaceDirective({Comment comment, List<Annotation> metadata, Token keyword, StringLiteral libraryUri, List<Combinator> combinators, Token semicolon}) : thi s.full(comment, metadata, keyword, libraryUri, combinators, semicolon); 8295 NodeList<Combinator> get combinators => _combinators;
9028 8296
9029 Token get endToken => semicolon; 8297 Token get endToken => semicolon;
9030 8298
9031 Token get keyword => _keyword;
9032
9033 LibraryElement get uriElement; 8299 LibraryElement get uriElement;
9034 8300
9035 /** 8301 Token get firstTokenAfterCommentAndMetadata => keyword;
9036 * Set the token representing the 'import' or 'export' keyword to the given to ken.
9037 *
9038 * @param exportToken the token representing the 'import' or 'export' keyword
9039 */
9040 void set keyword(Token exportToken) {
9041 this._keyword = exportToken;
9042 }
9043
9044 Token get firstTokenAfterCommentAndMetadata => _keyword;
9045 } 8302 }
9046 8303
9047 /** 8304 /**
9048 * Instances of the class `NativeClause` represent the "native" clause in an cla ss 8305 * Instances of the class `NativeClause` represent the "native" clause in an cla ss
9049 * declaration. 8306 * declaration.
9050 * 8307 *
9051 * <pre> 8308 * <pre>
9052 * nativeClause ::= 8309 * nativeClause ::=
9053 * 'native' [StringLiteral] 8310 * 'native' [StringLiteral]
9054 * </pre> 8311 * </pre>
(...skipping 10 matching lines...) Expand all
9065 * The name of the native object that implements the class. 8322 * The name of the native object that implements the class.
9066 */ 8323 */
9067 StringLiteral name; 8324 StringLiteral name;
9068 8325
9069 /** 8326 /**
9070 * Initialize a newly created native clause. 8327 * Initialize a newly created native clause.
9071 * 8328 *
9072 * @param keyword the token representing the 'native' keyword 8329 * @param keyword the token representing the 'native' keyword
9073 * @param name the name of the native object that implements the class. 8330 * @param name the name of the native object that implements the class.
9074 */ 8331 */
9075 NativeClause.full(Token keyword, StringLiteral name) { 8332 NativeClause(this.keyword, this.name);
9076 this.keyword = keyword;
9077 this.name = name;
9078 }
9079
9080 /**
9081 * Initialize a newly created native clause.
9082 *
9083 * @param keyword the token representing the 'native' keyword
9084 * @param name the name of the native object that implements the class.
9085 */
9086 NativeClause({Token keyword, StringLiteral name}) : this.full(keyword, name);
9087 8333
9088 accept(ASTVisitor visitor) => visitor.visitNativeClause(this); 8334 accept(ASTVisitor visitor) => visitor.visitNativeClause(this);
9089 8335
9090 Token get beginToken => keyword; 8336 Token get beginToken => keyword;
9091 8337
9092 Token get endToken => name.endToken; 8338 Token get endToken => name.endToken;
9093 8339
9094 void visitChildren(ASTVisitor visitor) { 8340 void visitChildren(ASTVisitor visitor) {
9095 safelyVisitChild(name, visitor); 8341 safelyVisitChild(name, visitor);
9096 } 8342 }
9097 } 8343 }
9098 8344
9099 /** 8345 /**
9100 * Instances of the class `NativeFunctionBody` represent a function body that co nsists of a 8346 * Instances of the class `NativeFunctionBody` represent a function body that co nsists of a
9101 * native keyword followed by a string literal. 8347 * native keyword followed by a string literal.
9102 * 8348 *
9103 * <pre> 8349 * <pre>
9104 * nativeFunctionBody ::= 8350 * nativeFunctionBody ::=
9105 * 'native' [SimpleStringLiteral] ';' 8351 * 'native' [SimpleStringLiteral] ';'
9106 * </pre> 8352 * </pre>
9107 * 8353 *
9108 * @coverage dart.engine.ast 8354 * @coverage dart.engine.ast
9109 */ 8355 */
9110 class NativeFunctionBody extends FunctionBody { 8356 class NativeFunctionBody extends FunctionBody {
9111 /** 8357 /**
9112 * The token representing 'native' that marks the start of the function body. 8358 * The token representing 'native' that marks the start of the function body.
9113 */ 8359 */
9114 Token nativeToken; 8360 final Token nativeToken;
9115 8361
9116 /** 8362 /**
9117 * The string literal, after the 'native' token. 8363 * The string literal, after the 'native' token.
9118 */ 8364 */
9119 StringLiteral stringLiteral; 8365 StringLiteral _stringLiteral;
9120 8366
9121 /** 8367 /**
9122 * The token representing the semicolon that marks the end of the function bod y. 8368 * The token representing the semicolon that marks the end of the function bod y.
9123 */ 8369 */
9124 Token semicolon; 8370 final Token semicolon;
9125 8371
9126 /** 8372 /**
9127 * Initialize a newly created function body consisting of the 'native' token, a string literal, 8373 * Initialize a newly created function body consisting of the 'native' token, a string literal,
9128 * and a semicolon. 8374 * and a semicolon.
9129 * 8375 *
9130 * @param nativeToken the token representing 'native' that marks the start of the function body 8376 * @param nativeToken the token representing 'native' that marks the start of the function body
9131 * @param stringLiteral the string literal 8377 * @param stringLiteral the string literal
9132 * @param semicolon the token representing the semicolon that marks the end of the function body 8378 * @param semicolon the token representing the semicolon that marks the end of the function body
9133 */ 8379 */
9134 NativeFunctionBody.full(Token nativeToken, StringLiteral stringLiteral, Token semicolon) { 8380 NativeFunctionBody(this.nativeToken, StringLiteral stringLiteral, this.semicol on) {
9135 this.nativeToken = nativeToken; 8381 this._stringLiteral = becomeParentOf(stringLiteral);
9136 this.stringLiteral = becomeParentOf(stringLiteral);
9137 this.semicolon = semicolon;
9138 } 8382 }
9139 8383
9140 /**
9141 * Initialize a newly created function body consisting of the 'native' token, a string literal,
9142 * and a semicolon.
9143 *
9144 * @param nativeToken the token representing 'native' that marks the start of the function body
9145 * @param stringLiteral the string literal
9146 * @param semicolon the token representing the semicolon that marks the end of the function body
9147 */
9148 NativeFunctionBody({Token nativeToken, StringLiteral stringLiteral, Token semi colon}) : this.full(nativeToken, stringLiteral, semicolon);
9149
9150 accept(ASTVisitor visitor) => visitor.visitNativeFunctionBody(this); 8384 accept(ASTVisitor visitor) => visitor.visitNativeFunctionBody(this);
9151 8385
9152 Token get beginToken => nativeToken; 8386 Token get beginToken => nativeToken;
9153 8387
9154 Token get endToken => semicolon; 8388 Token get endToken => semicolon;
9155 8389
8390 /**
8391 * Return the string literal representing the string after the 'native' token.
8392 *
8393 * @return the string literal representing the string after the 'native' token
8394 */
8395 StringLiteral get stringLiteral => _stringLiteral;
8396
9156 void visitChildren(ASTVisitor visitor) { 8397 void visitChildren(ASTVisitor visitor) {
9157 safelyVisitChild(stringLiteral, visitor); 8398 safelyVisitChild(_stringLiteral, visitor);
9158 } 8399 }
9159 } 8400 }
9160 8401
9161 /** 8402 /**
9162 * The abstract class `NormalFormalParameter` defines the behavior common to for mal parameters 8403 * The abstract class `NormalFormalParameter` defines the behavior common to for mal parameters
9163 * that are required (are not optional). 8404 * that are required (are not optional).
9164 * 8405 *
9165 * <pre> 8406 * <pre>
9166 * normalFormalParameter ::= 8407 * normalFormalParameter ::=
9167 * [FunctionTypedFormalParameter] 8408 * [FunctionTypedFormalParameter]
9168 * | [FieldFormalParameter] 8409 * | [FieldFormalParameter]
9169 * | [SimpleFormalParameter] 8410 * | [SimpleFormalParameter]
9170 * </pre> 8411 * </pre>
9171 * 8412 *
9172 * @coverage dart.engine.ast 8413 * @coverage dart.engine.ast
9173 */ 8414 */
9174 abstract class NormalFormalParameter extends FormalParameter { 8415 abstract class NormalFormalParameter extends FormalParameter {
9175 /** 8416 /**
9176 * The documentation comment associated with this parameter, or `null` if this parameter 8417 * The documentation comment associated with this parameter, or `null` if this parameter
9177 * does not have a documentation comment associated with it. 8418 * does not have a documentation comment associated with it.
9178 */ 8419 */
9179 Comment _comment; 8420 Comment _comment;
9180 8421
9181 /** 8422 /**
9182 * The annotations associated with this parameter. 8423 * The annotations associated with this parameter.
9183 */ 8424 */
9184 NodeList<Annotation> metadata; 8425 NodeList<Annotation> _metadata;
9185 8426
9186 /** 8427 /**
9187 * The name of the parameter being declared. 8428 * The name of the parameter being declared.
9188 */ 8429 */
9189 SimpleIdentifier _identifier; 8430 SimpleIdentifier _identifier;
9190 8431
9191 /** 8432 /**
9192 * Initialize a newly created formal parameter. 8433 * Initialize a newly created formal parameter.
9193 * 8434 *
9194 * @param comment the documentation comment associated with this parameter 8435 * @param comment the documentation comment associated with this parameter
9195 * @param metadata the annotations associated with this parameter 8436 * @param metadata the annotations associated with this parameter
9196 * @param identifier the name of the parameter being declared 8437 * @param identifier the name of the parameter being declared
9197 */ 8438 */
9198 NormalFormalParameter.full(Comment comment, List<Annotation> metadata, SimpleI dentifier identifier) { 8439 NormalFormalParameter(Comment comment, List<Annotation> metadata, SimpleIdenti fier identifier) {
9199 this.metadata = new NodeList<Annotation>(this); 8440 this._metadata = new NodeList<Annotation>(this);
9200 this._comment = becomeParentOf(comment); 8441 this._comment = becomeParentOf(comment);
9201 this.metadata.addAll(metadata); 8442 this._metadata.addAll(metadata);
9202 this._identifier = becomeParentOf(identifier); 8443 this._identifier = becomeParentOf(identifier);
9203 } 8444 }
9204 8445
9205 /** 8446 /**
9206 * Initialize a newly created formal parameter.
9207 *
9208 * @param comment the documentation comment associated with this parameter
9209 * @param metadata the annotations associated with this parameter
9210 * @param identifier the name of the parameter being declared
9211 */
9212 NormalFormalParameter({Comment comment, List<Annotation> metadata, SimpleIdent ifier identifier}) : this.full(comment, metadata, identifier);
9213
9214 /**
9215 * Return the documentation comment associated with this parameter, or `null` if this 8447 * Return the documentation comment associated with this parameter, or `null` if this
9216 * parameter does not have a documentation comment associated with it. 8448 * parameter does not have a documentation comment associated with it.
9217 * 8449 *
9218 * @return the documentation comment associated with this parameter 8450 * @return the documentation comment associated with this parameter
9219 */ 8451 */
9220 Comment get documentationComment => _comment; 8452 Comment get documentationComment => _comment;
9221 8453
9222 SimpleIdentifier get identifier => _identifier; 8454 SimpleIdentifier get identifier => _identifier;
9223 8455
9224 ParameterKind get kind { 8456 ParameterKind get kind {
9225 ASTNode parent = this.parent; 8457 ASTNode parent = this.parent;
9226 if (parent is DefaultFormalParameter) { 8458 if (parent is DefaultFormalParameter) {
9227 return (parent as DefaultFormalParameter).kind; 8459 return (parent as DefaultFormalParameter).kind;
9228 } 8460 }
9229 return ParameterKind.REQUIRED; 8461 return ParameterKind.REQUIRED;
9230 } 8462 }
9231 8463
9232 /** 8464 /**
8465 * Return the annotations associated with this parameter.
8466 *
8467 * @return the annotations associated with this parameter
8468 */
8469 NodeList<Annotation> get metadata => _metadata;
8470
8471 /**
9233 * Set the documentation comment associated with this parameter to the given c omment 8472 * Set the documentation comment associated with this parameter to the given c omment
9234 * 8473 *
9235 * @param comment the documentation comment to be associated with this paramet er 8474 * @param comment the documentation comment to be associated with this paramet er
9236 */ 8475 */
9237 void set documentationComment(Comment comment) { 8476 void set documentationComment(Comment comment) {
9238 this._comment = becomeParentOf(comment); 8477 this._comment = becomeParentOf(comment);
9239 } 8478 }
9240 8479
9241 /** 8480 /**
9242 * Set the name of the parameter being declared to the given identifier. 8481 * Set the name of the parameter being declared to the given identifier.
9243 * 8482 *
9244 * @param identifier the name of the parameter being declared 8483 * @param identifier the name of the parameter being declared
9245 */ 8484 */
9246 void set identifier(SimpleIdentifier identifier) { 8485 void set identifier(SimpleIdentifier identifier) {
9247 this._identifier = becomeParentOf(identifier); 8486 this._identifier = becomeParentOf(identifier);
9248 } 8487 }
9249 8488
9250 void visitChildren(ASTVisitor visitor) { 8489 void visitChildren(ASTVisitor visitor) {
9251 if (commentIsBeforeAnnotations()) { 8490 if (commentIsBeforeAnnotations()) {
9252 safelyVisitChild(_comment, visitor); 8491 safelyVisitChild(_comment, visitor);
9253 metadata.accept(visitor); 8492 _metadata.accept(visitor);
9254 } else { 8493 } else {
9255 for (ASTNode child in sortedCommentAndAnnotations) { 8494 for (ASTNode child in sortedCommentAndAnnotations) {
9256 child.accept(visitor); 8495 child.accept(visitor);
9257 } 8496 }
9258 } 8497 }
9259 } 8498 }
9260 8499
9261 /** 8500 /**
9262 * Return `true` if the comment is lexically before any annotations. 8501 * Return `true` if the comment is lexically before any annotations.
9263 * 8502 *
9264 * @return `true` if the comment is lexically before any annotations 8503 * @return `true` if the comment is lexically before any annotations
9265 */ 8504 */
9266 bool commentIsBeforeAnnotations() { 8505 bool commentIsBeforeAnnotations() {
9267 if (_comment == null || metadata.isEmpty) { 8506 if (_comment == null || _metadata.isEmpty) {
9268 return true; 8507 return true;
9269 } 8508 }
9270 Annotation firstAnnotation = metadata[0]; 8509 Annotation firstAnnotation = _metadata[0];
9271 return _comment.offset < firstAnnotation.offset; 8510 return _comment.offset < firstAnnotation.offset;
9272 } 8511 }
9273 8512
9274 /** 8513 /**
9275 * Return an array containing the comment and annotations associated with this parameter, sorted 8514 * Return an array containing the comment and annotations associated with this parameter, sorted
9276 * in lexical order. 8515 * in lexical order.
9277 * 8516 *
9278 * @return the comment and annotations associated with this parameter in the o rder in which they 8517 * @return the comment and annotations associated with this parameter in the o rder in which they
9279 * appeared in the original source 8518 * appeared in the original source
9280 */ 8519 */
9281 List<ASTNode> get sortedCommentAndAnnotations { 8520 List<ASTNode> get sortedCommentAndAnnotations {
9282 List<ASTNode> childList = new List<ASTNode>(); 8521 List<ASTNode> childList = new List<ASTNode>();
9283 childList.add(_comment); 8522 childList.add(_comment);
9284 childList.addAll(metadata); 8523 childList.addAll(_metadata);
9285 List<ASTNode> children = new List.from(childList); 8524 List<ASTNode> children = new List.from(childList);
9286 children.sort(ASTNode.LEXICAL_ORDER); 8525 children.sort(ASTNode.LEXICAL_ORDER);
9287 return children; 8526 return children;
9288 } 8527 }
9289 } 8528 }
9290 8529
9291 /** 8530 /**
9292 * Instances of the class `NullLiteral` represent a null literal expression. 8531 * Instances of the class `NullLiteral` represent a null literal expression.
9293 * 8532 *
9294 * <pre> 8533 * <pre>
9295 * nullLiteral ::= 8534 * nullLiteral ::=
9296 * 'null' 8535 * 'null'
9297 * </pre> 8536 * </pre>
9298 * 8537 *
9299 * @coverage dart.engine.ast 8538 * @coverage dart.engine.ast
9300 */ 8539 */
9301 class NullLiteral extends Literal { 8540 class NullLiteral extends Literal {
9302 /** 8541 /**
9303 * The token representing the literal. 8542 * The token representing the literal.
9304 */ 8543 */
9305 Token literal; 8544 Token literal;
9306 8545
9307 /** 8546 /**
9308 * Initialize a newly created null literal. 8547 * Initialize a newly created null literal.
9309 * 8548 *
9310 * @param token the token representing the literal 8549 * @param token the token representing the literal
9311 */ 8550 */
9312 NullLiteral.full(Token token) { 8551 NullLiteral(Token token) {
9313 this.literal = token; 8552 this.literal = token;
9314 } 8553 }
9315 8554
9316 /**
9317 * Initialize a newly created null literal.
9318 *
9319 * @param token the token representing the literal
9320 */
9321 NullLiteral({Token token}) : this.full(token);
9322
9323 accept(ASTVisitor visitor) => visitor.visitNullLiteral(this); 8555 accept(ASTVisitor visitor) => visitor.visitNullLiteral(this);
9324 8556
9325 Token get beginToken => literal; 8557 Token get beginToken => literal;
9326 8558
9327 Token get endToken => literal; 8559 Token get endToken => literal;
9328 8560
9329 void visitChildren(ASTVisitor visitor) { 8561 void visitChildren(ASTVisitor visitor) {
9330 } 8562 }
9331 } 8563 }
9332 8564
(...skipping 23 matching lines...) Expand all
9356 */ 8588 */
9357 Token _rightParenthesis; 8589 Token _rightParenthesis;
9358 8590
9359 /** 8591 /**
9360 * Initialize a newly created parenthesized expression. 8592 * Initialize a newly created parenthesized expression.
9361 * 8593 *
9362 * @param leftParenthesis the left parenthesis 8594 * @param leftParenthesis the left parenthesis
9363 * @param expression the expression within the parentheses 8595 * @param expression the expression within the parentheses
9364 * @param rightParenthesis the right parenthesis 8596 * @param rightParenthesis the right parenthesis
9365 */ 8597 */
9366 ParenthesizedExpression.full(Token leftParenthesis, Expression expression, Tok en rightParenthesis) { 8598 ParenthesizedExpression(Token leftParenthesis, Expression expression, Token ri ghtParenthesis) {
9367 this._leftParenthesis = leftParenthesis; 8599 this._leftParenthesis = leftParenthesis;
9368 this._expression = becomeParentOf(expression); 8600 this._expression = becomeParentOf(expression);
9369 this._rightParenthesis = rightParenthesis; 8601 this._rightParenthesis = rightParenthesis;
9370 } 8602 }
9371 8603
9372 /**
9373 * Initialize a newly created parenthesized expression.
9374 *
9375 * @param leftParenthesis the left parenthesis
9376 * @param expression the expression within the parentheses
9377 * @param rightParenthesis the right parenthesis
9378 */
9379 ParenthesizedExpression({Token leftParenthesis, Expression expression, Token r ightParenthesis}) : this.full(leftParenthesis, expression, rightParenthesis);
9380
9381 accept(ASTVisitor visitor) => visitor.visitParenthesizedExpression(this); 8604 accept(ASTVisitor visitor) => visitor.visitParenthesizedExpression(this);
9382 8605
9383 Token get beginToken => _leftParenthesis; 8606 Token get beginToken => _leftParenthesis;
9384 8607
9385 Token get endToken => _rightParenthesis; 8608 Token get endToken => _rightParenthesis;
9386 8609
9387 /** 8610 /**
9388 * Return the expression within the parentheses. 8611 * Return the expression within the parentheses.
9389 * 8612 *
9390 * @return the expression within the parentheses 8613 * @return the expression within the parentheses
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
9462 8685
9463 /** 8686 /**
9464 * Initialize a newly created part directive. 8687 * Initialize a newly created part directive.
9465 * 8688 *
9466 * @param comment the documentation comment associated with this directive 8689 * @param comment the documentation comment associated with this directive
9467 * @param metadata the annotations associated with the directive 8690 * @param metadata the annotations associated with the directive
9468 * @param partToken the token representing the 'part' token 8691 * @param partToken the token representing the 'part' token
9469 * @param partUri the URI of the part being included 8692 * @param partUri the URI of the part being included
9470 * @param semicolon the semicolon terminating the directive 8693 * @param semicolon the semicolon terminating the directive
9471 */ 8694 */
9472 PartDirective.full(Comment comment, List<Annotation> metadata, Token partToken , StringLiteral partUri, Token semicolon) : super.full(comment, metadata, partUr i) { 8695 PartDirective(Comment comment, List<Annotation> metadata, this.partToken, Stri ngLiteral partUri, this.semicolon) : super(comment, metadata, partUri);
9473 this.partToken = partToken;
9474 this.semicolon = semicolon;
9475 }
9476
9477 /**
9478 * Initialize a newly created part directive.
9479 *
9480 * @param comment the documentation comment associated with this directive
9481 * @param metadata the annotations associated with the directive
9482 * @param partToken the token representing the 'part' token
9483 * @param partUri the URI of the part being included
9484 * @param semicolon the semicolon terminating the directive
9485 */
9486 PartDirective({Comment comment, List<Annotation> metadata, Token partToken, St ringLiteral partUri, Token semicolon}) : this.full(comment, metadata, partToken, partUri, semicolon);
9487 8696
9488 accept(ASTVisitor visitor) => visitor.visitPartDirective(this); 8697 accept(ASTVisitor visitor) => visitor.visitPartDirective(this);
9489 8698
9490 Token get endToken => semicolon; 8699 Token get endToken => semicolon;
9491 8700
9492 Token get keyword => partToken; 8701 Token get keyword => partToken;
9493 8702
9494 CompilationUnitElement get uriElement => element as CompilationUnitElement; 8703 CompilationUnitElement get uriElement => element as CompilationUnitElement;
9495 8704
9496 Token get firstTokenAfterCommentAndMetadata => partToken; 8705 Token get firstTokenAfterCommentAndMetadata => partToken;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
9530 /** 8739 /**
9531 * Initialize a newly created part-of directive. 8740 * Initialize a newly created part-of directive.
9532 * 8741 *
9533 * @param comment the documentation comment associated with this directive 8742 * @param comment the documentation comment associated with this directive
9534 * @param metadata the annotations associated with the directive 8743 * @param metadata the annotations associated with the directive
9535 * @param partToken the token representing the 'part' token 8744 * @param partToken the token representing the 'part' token
9536 * @param ofToken the token representing the 'of' token 8745 * @param ofToken the token representing the 'of' token
9537 * @param libraryName the name of the library that the containing compilation unit is part of 8746 * @param libraryName the name of the library that the containing compilation unit is part of
9538 * @param semicolon the semicolon terminating the directive 8747 * @param semicolon the semicolon terminating the directive
9539 */ 8748 */
9540 PartOfDirective.full(Comment comment, List<Annotation> metadata, Token partTok en, Token ofToken, LibraryIdentifier libraryName, Token semicolon) : super.full( comment, metadata) { 8749 PartOfDirective(Comment comment, List<Annotation> metadata, this.partToken, th is.ofToken, LibraryIdentifier libraryName, this.semicolon) : super(comment, meta data) {
9541 this.partToken = partToken;
9542 this.ofToken = ofToken;
9543 this._libraryName = becomeParentOf(libraryName); 8750 this._libraryName = becomeParentOf(libraryName);
9544 this.semicolon = semicolon;
9545 } 8751 }
9546 8752
9547 /**
9548 * Initialize a newly created part-of directive.
9549 *
9550 * @param comment the documentation comment associated with this directive
9551 * @param metadata the annotations associated with the directive
9552 * @param partToken the token representing the 'part' token
9553 * @param ofToken the token representing the 'of' token
9554 * @param libraryName the name of the library that the containing compilation unit is part of
9555 * @param semicolon the semicolon terminating the directive
9556 */
9557 PartOfDirective({Comment comment, List<Annotation> metadata, Token partToken, Token ofToken, LibraryIdentifier libraryName, Token semicolon}) : this.full(comm ent, metadata, partToken, ofToken, libraryName, semicolon);
9558
9559 accept(ASTVisitor visitor) => visitor.visitPartOfDirective(this); 8753 accept(ASTVisitor visitor) => visitor.visitPartOfDirective(this);
9560 8754
9561 Token get endToken => semicolon; 8755 Token get endToken => semicolon;
9562 8756
9563 Token get keyword => partToken; 8757 Token get keyword => partToken;
9564 8758
9565 /** 8759 /**
9566 * Return the name of the library that the containing compilation unit is part of. 8760 * Return the name of the library that the containing compilation unit is part of.
9567 * 8761 *
9568 * @return the name of the library that the containing compilation unit is par t of 8762 * @return the name of the library that the containing compilation unit is par t of
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
9620 * or if the operator could not be resolved. 8814 * or if the operator could not be resolved.
9621 */ 8815 */
9622 MethodElement _staticElement; 8816 MethodElement _staticElement;
9623 8817
9624 /** 8818 /**
9625 * Initialize a newly created postfix expression. 8819 * Initialize a newly created postfix expression.
9626 * 8820 *
9627 * @param operand the expression computing the operand for the operator 8821 * @param operand the expression computing the operand for the operator
9628 * @param operator the postfix operator being applied to the operand 8822 * @param operator the postfix operator being applied to the operand
9629 */ 8823 */
9630 PostfixExpression.full(Expression operand, Token operator) { 8824 PostfixExpression(Expression operand, this.operator) {
9631 this._operand = becomeParentOf(operand); 8825 this._operand = becomeParentOf(operand);
9632 this.operator = operator;
9633 } 8826 }
9634 8827
9635 /**
9636 * Initialize a newly created postfix expression.
9637 *
9638 * @param operand the expression computing the operand for the operator
9639 * @param operator the postfix operator being applied to the operand
9640 */
9641 PostfixExpression({Expression operand, Token operator}) : this.full(operand, o perator);
9642
9643 accept(ASTVisitor visitor) => visitor.visitPostfixExpression(this); 8828 accept(ASTVisitor visitor) => visitor.visitPostfixExpression(this);
9644 8829
9645 Token get beginToken => _operand.beginToken; 8830 Token get beginToken => _operand.beginToken;
9646 8831
9647 /** 8832 /**
9648 * Return the best element available for this operator. If resolution was able to find a better 8833 * Return the best element available for this operator. If resolution was able to find a better
9649 * element based on type propagation, that element will be returned. Otherwise , the element found 8834 * element based on type propagation, that element will be returned. Otherwise , the element found
9650 * using the result of static analysis will be returned. If resolution has not been performed, 8835 * using the result of static analysis will be returned. If resolution has not been performed,
9651 * then `null` will be returned. 8836 * then `null` will be returned.
9652 * 8837 *
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
9801 * or if the operator could not be resolved. 8986 * or if the operator could not be resolved.
9802 */ 8987 */
9803 MethodElement _propagatedElement; 8988 MethodElement _propagatedElement;
9804 8989
9805 /** 8990 /**
9806 * Initialize a newly created prefix expression. 8991 * Initialize a newly created prefix expression.
9807 * 8992 *
9808 * @param operator the prefix operator being applied to the operand 8993 * @param operator the prefix operator being applied to the operand
9809 * @param operand the expression computing the operand for the operator 8994 * @param operand the expression computing the operand for the operator
9810 */ 8995 */
9811 PrefixExpression.full(Token operator, Expression operand) { 8996 PrefixExpression(this.operator, Expression operand) {
9812 this.operator = operator;
9813 this._operand = becomeParentOf(operand); 8997 this._operand = becomeParentOf(operand);
9814 } 8998 }
9815 8999
9816 /**
9817 * Initialize a newly created prefix expression.
9818 *
9819 * @param operator the prefix operator being applied to the operand
9820 * @param operand the expression computing the operand for the operator
9821 */
9822 PrefixExpression({Token operator, Expression operand}) : this.full(operator, o perand);
9823
9824 accept(ASTVisitor visitor) => visitor.visitPrefixExpression(this); 9000 accept(ASTVisitor visitor) => visitor.visitPrefixExpression(this);
9825 9001
9826 Token get beginToken => operator; 9002 Token get beginToken => operator;
9827 9003
9828 /** 9004 /**
9829 * Return the best element available for this operator. If resolution was able to find a better 9005 * Return the best element available for this operator. If resolution was able to find a better
9830 * element based on type propagation, that element will be returned. Otherwise , the element found 9006 * element based on type propagation, that element will be returned. Otherwise , the element found
9831 * using the result of static analysis will be returned. If resolution has not been performed, 9007 * using the result of static analysis will be returned. If resolution has not been performed,
9832 * then `null` will be returned. 9008 * then `null` will be returned.
9833 * 9009 *
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
9976 */ 9152 */
9977 SimpleIdentifier _identifier; 9153 SimpleIdentifier _identifier;
9978 9154
9979 /** 9155 /**
9980 * Initialize a newly created prefixed identifier. 9156 * Initialize a newly created prefixed identifier.
9981 * 9157 *
9982 * @param prefix the identifier being prefixed 9158 * @param prefix the identifier being prefixed
9983 * @param period the period used to separate the prefix from the identifier 9159 * @param period the period used to separate the prefix from the identifier
9984 * @param identifier the prefix associated with the library in which the ident ifier is defined 9160 * @param identifier the prefix associated with the library in which the ident ifier is defined
9985 */ 9161 */
9986 PrefixedIdentifier.full(SimpleIdentifier prefix, Token period, SimpleIdentifie r identifier) { 9162 PrefixedIdentifier(SimpleIdentifier prefix, this.period, SimpleIdentifier iden tifier) {
9987 this._prefix = becomeParentOf(prefix); 9163 this._prefix = becomeParentOf(prefix);
9988 this.period = period;
9989 this._identifier = becomeParentOf(identifier); 9164 this._identifier = becomeParentOf(identifier);
9990 } 9165 }
9991 9166
9992 /**
9993 * Initialize a newly created prefixed identifier.
9994 *
9995 * @param prefix the identifier being prefixed
9996 * @param period the period used to separate the prefix from the identifier
9997 * @param identifier the prefix associated with the library in which the ident ifier is defined
9998 */
9999 PrefixedIdentifier({SimpleIdentifier prefix, Token period, SimpleIdentifier id entifier}) : this.full(prefix, period, identifier);
10000
10001 accept(ASTVisitor visitor) => visitor.visitPrefixedIdentifier(this); 9167 accept(ASTVisitor visitor) => visitor.visitPrefixedIdentifier(this);
10002 9168
10003 Token get beginToken => _prefix.beginToken; 9169 Token get beginToken => _prefix.beginToken;
10004 9170
10005 Element get bestElement { 9171 Element get bestElement {
10006 if (_identifier == null) { 9172 if (_identifier == null) {
10007 return null; 9173 return null;
10008 } 9174 }
10009 return _identifier.bestElement; 9175 return _identifier.bestElement;
10010 } 9176 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
10098 */ 9264 */
10099 SimpleIdentifier _propertyName; 9265 SimpleIdentifier _propertyName;
10100 9266
10101 /** 9267 /**
10102 * Initialize a newly created property access expression. 9268 * Initialize a newly created property access expression.
10103 * 9269 *
10104 * @param target the expression computing the object defining the property bei ng accessed 9270 * @param target the expression computing the object defining the property bei ng accessed
10105 * @param operator the property access operator 9271 * @param operator the property access operator
10106 * @param propertyName the name of the property being accessed 9272 * @param propertyName the name of the property being accessed
10107 */ 9273 */
10108 PropertyAccess.full(Expression target, Token operator, SimpleIdentifier proper tyName) { 9274 PropertyAccess(Expression target, this.operator, SimpleIdentifier propertyName ) {
10109 this._target = becomeParentOf(target); 9275 this._target = becomeParentOf(target);
10110 this.operator = operator;
10111 this._propertyName = becomeParentOf(propertyName); 9276 this._propertyName = becomeParentOf(propertyName);
10112 } 9277 }
10113 9278
10114 /**
10115 * Initialize a newly created property access expression.
10116 *
10117 * @param target the expression computing the object defining the property bei ng accessed
10118 * @param operator the property access operator
10119 * @param propertyName the name of the property being accessed
10120 */
10121 PropertyAccess({Expression target, Token operator, SimpleIdentifier propertyNa me}) : this.full(target, operator, propertyName);
10122
10123 accept(ASTVisitor visitor) => visitor.visitPropertyAccess(this); 9279 accept(ASTVisitor visitor) => visitor.visitPropertyAccess(this);
10124 9280
10125 Token get beginToken { 9281 Token get beginToken {
10126 if (_target != null) { 9282 if (_target != null) {
10127 return _target.beginToken; 9283 return _target.beginToken;
10128 } 9284 }
10129 return operator; 9285 return operator;
10130 } 9286 }
10131 9287
10132 Token get endToken => _propertyName.endToken; 9288 Token get endToken => _propertyName.endToken;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
10250 9406
10251 /** 9407 /**
10252 * Initialize a newly created redirecting invocation to invoke the constructor with the given name 9408 * Initialize a newly created redirecting invocation to invoke the constructor with the given name
10253 * with the given arguments. 9409 * with the given arguments.
10254 * 9410 *
10255 * @param keyword the token for the 'this' keyword 9411 * @param keyword the token for the 'this' keyword
10256 * @param period the token for the period before the name of the constructor t hat is being invoked 9412 * @param period the token for the period before the name of the constructor t hat is being invoked
10257 * @param constructorName the name of the constructor that is being invoked 9413 * @param constructorName the name of the constructor that is being invoked
10258 * @param argumentList the list of arguments to the constructor 9414 * @param argumentList the list of arguments to the constructor
10259 */ 9415 */
10260 RedirectingConstructorInvocation.full(Token keyword, Token period, SimpleIdent ifier constructorName, ArgumentList argumentList) { 9416 RedirectingConstructorInvocation(this.keyword, this.period, SimpleIdentifier c onstructorName, ArgumentList argumentList) {
10261 this.keyword = keyword;
10262 this.period = period;
10263 this._constructorName = becomeParentOf(constructorName); 9417 this._constructorName = becomeParentOf(constructorName);
10264 this._argumentList = becomeParentOf(argumentList); 9418 this._argumentList = becomeParentOf(argumentList);
10265 } 9419 }
10266 9420
10267 /**
10268 * Initialize a newly created redirecting invocation to invoke the constructor with the given name
10269 * with the given arguments.
10270 *
10271 * @param keyword the token for the 'this' keyword
10272 * @param period the token for the period before the name of the constructor t hat is being invoked
10273 * @param constructorName the name of the constructor that is being invoked
10274 * @param argumentList the list of arguments to the constructor
10275 */
10276 RedirectingConstructorInvocation({Token keyword, Token period, SimpleIdentifie r constructorName, ArgumentList argumentList}) : this.full(keyword, period, cons tructorName, argumentList);
10277
10278 accept(ASTVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th is); 9421 accept(ASTVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th is);
10279 9422
10280 /** 9423 /**
10281 * Return the list of arguments to the constructor. 9424 * Return the list of arguments to the constructor.
10282 * 9425 *
10283 * @return the list of arguments to the constructor 9426 * @return the list of arguments to the constructor
10284 */ 9427 */
10285 ArgumentList get argumentList => _argumentList; 9428 ArgumentList get argumentList => _argumentList;
10286 9429
10287 Token get beginToken => keyword; 9430 Token get beginToken => keyword;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
10334 /** 9477 /**
10335 * The token representing the 'rethrow' keyword. 9478 * The token representing the 'rethrow' keyword.
10336 */ 9479 */
10337 Token keyword; 9480 Token keyword;
10338 9481
10339 /** 9482 /**
10340 * Initialize a newly created rethrow expression. 9483 * Initialize a newly created rethrow expression.
10341 * 9484 *
10342 * @param keyword the token representing the 'rethrow' keyword 9485 * @param keyword the token representing the 'rethrow' keyword
10343 */ 9486 */
10344 RethrowExpression.full(Token keyword) { 9487 RethrowExpression(this.keyword);
10345 this.keyword = keyword;
10346 }
10347
10348 /**
10349 * Initialize a newly created rethrow expression.
10350 *
10351 * @param keyword the token representing the 'rethrow' keyword
10352 */
10353 RethrowExpression({Token keyword}) : this.full(keyword);
10354 9488
10355 accept(ASTVisitor visitor) => visitor.visitRethrowExpression(this); 9489 accept(ASTVisitor visitor) => visitor.visitRethrowExpression(this);
10356 9490
10357 Token get beginToken => keyword; 9491 Token get beginToken => keyword;
10358 9492
10359 Token get endToken => keyword; 9493 Token get endToken => keyword;
10360 9494
10361 int get precedence => 0; 9495 int get precedence => 0;
10362 9496
10363 void visitChildren(ASTVisitor visitor) { 9497 void visitChildren(ASTVisitor visitor) {
(...skipping 27 matching lines...) Expand all
10391 */ 9525 */
10392 Token semicolon; 9526 Token semicolon;
10393 9527
10394 /** 9528 /**
10395 * Initialize a newly created return statement. 9529 * Initialize a newly created return statement.
10396 * 9530 *
10397 * @param keyword the token representing the 'return' keyword 9531 * @param keyword the token representing the 'return' keyword
10398 * @param expression the expression computing the value to be returned 9532 * @param expression the expression computing the value to be returned
10399 * @param semicolon the semicolon terminating the statement 9533 * @param semicolon the semicolon terminating the statement
10400 */ 9534 */
10401 ReturnStatement.full(Token keyword, Expression expression, Token semicolon) { 9535 ReturnStatement(this.keyword, Expression expression, this.semicolon) {
10402 this.keyword = keyword;
10403 this._expression = becomeParentOf(expression); 9536 this._expression = becomeParentOf(expression);
10404 this.semicolon = semicolon;
10405 } 9537 }
10406 9538
10407 /**
10408 * Initialize a newly created return statement.
10409 *
10410 * @param keyword the token representing the 'return' keyword
10411 * @param expression the expression computing the value to be returned
10412 * @param semicolon the semicolon terminating the statement
10413 */
10414 ReturnStatement({Token keyword, Expression expression, Token semicolon}) : thi s.full(keyword, expression, semicolon);
10415
10416 accept(ASTVisitor visitor) => visitor.visitReturnStatement(this); 9539 accept(ASTVisitor visitor) => visitor.visitReturnStatement(this);
10417 9540
10418 Token get beginToken => keyword; 9541 Token get beginToken => keyword;
10419 9542
10420 Token get endToken => semicolon; 9543 Token get endToken => semicolon;
10421 9544
10422 /** 9545 /**
10423 * Return the expression computing the value to be returned, or `null` if no e xplicit value 9546 * Return the expression computing the value to be returned, or `null` if no e xplicit value
10424 * was provided. 9547 * was provided.
10425 * 9548 *
(...skipping 30 matching lines...) Expand all
10456 /** 9579 /**
10457 * The token representing this script tag. 9580 * The token representing this script tag.
10458 */ 9581 */
10459 Token scriptTag; 9582 Token scriptTag;
10460 9583
10461 /** 9584 /**
10462 * Initialize a newly created script tag. 9585 * Initialize a newly created script tag.
10463 * 9586 *
10464 * @param scriptTag the token representing this script tag 9587 * @param scriptTag the token representing this script tag
10465 */ 9588 */
10466 ScriptTag.full(Token scriptTag) { 9589 ScriptTag(this.scriptTag);
10467 this.scriptTag = scriptTag;
10468 }
10469
10470 /**
10471 * Initialize a newly created script tag.
10472 *
10473 * @param scriptTag the token representing this script tag
10474 */
10475 ScriptTag({Token scriptTag}) : this.full(scriptTag);
10476 9590
10477 accept(ASTVisitor visitor) => visitor.visitScriptTag(this); 9591 accept(ASTVisitor visitor) => visitor.visitScriptTag(this);
10478 9592
10479 Token get beginToken => scriptTag; 9593 Token get beginToken => scriptTag;
10480 9594
10481 Token get endToken => scriptTag; 9595 Token get endToken => scriptTag;
10482 9596
10483 void visitChildren(ASTVisitor visitor) { 9597 void visitChildren(ASTVisitor visitor) {
10484 } 9598 }
10485 } 9599 }
10486 9600
10487 /** 9601 /**
10488 * Instances of the class `ShowCombinator` represent a combinator that restricts the names 9602 * Instances of the class `ShowCombinator` represent a combinator that restricts the names
10489 * being imported to those in a given list. 9603 * being imported to those in a given list.
10490 * 9604 *
10491 * <pre> 9605 * <pre>
10492 * showCombinator ::= 9606 * showCombinator ::=
10493 * 'show' [SimpleIdentifier] (',' [SimpleIdentifier])* 9607 * 'show' [SimpleIdentifier] (',' [SimpleIdentifier])*
10494 * </pre> 9608 * </pre>
10495 * 9609 *
10496 * @coverage dart.engine.ast 9610 * @coverage dart.engine.ast
10497 */ 9611 */
10498 class ShowCombinator extends Combinator { 9612 class ShowCombinator extends Combinator {
10499 /** 9613 /**
10500 * The list of names from the library that are made visible by this combinator . 9614 * The list of names from the library that are made visible by this combinator .
10501 */ 9615 */
10502 NodeList<SimpleIdentifier> shownNames; 9616 NodeList<SimpleIdentifier> _shownNames;
10503 9617
10504 /** 9618 /**
10505 * Initialize a newly created import show combinator. 9619 * Initialize a newly created import show combinator.
10506 * 9620 *
10507 * @param keyword the comma introducing the combinator 9621 * @param keyword the comma introducing the combinator
10508 * @param shownNames the list of names from the library that are made visible by this combinator 9622 * @param shownNames the list of names from the library that are made visible by this combinator
10509 */ 9623 */
10510 ShowCombinator.full(Token keyword, List<SimpleIdentifier> shownNames) : super. full(keyword) { 9624 ShowCombinator(Token keyword, List<SimpleIdentifier> shownNames) : super(keywo rd) {
10511 this.shownNames = new NodeList<SimpleIdentifier>(this); 9625 this._shownNames = new NodeList<SimpleIdentifier>(this);
10512 this.shownNames.addAll(shownNames); 9626 this._shownNames.addAll(shownNames);
10513 } 9627 }
10514 9628
10515 /**
10516 * Initialize a newly created import show combinator.
10517 *
10518 * @param keyword the comma introducing the combinator
10519 * @param shownNames the list of names from the library that are made visible by this combinator
10520 */
10521 ShowCombinator({Token keyword, List<SimpleIdentifier> shownNames}) : this.full (keyword, shownNames);
10522
10523 accept(ASTVisitor visitor) => visitor.visitShowCombinator(this); 9629 accept(ASTVisitor visitor) => visitor.visitShowCombinator(this);
10524 9630
10525 Token get endToken => shownNames.endToken; 9631 Token get endToken => _shownNames.endToken;
9632
9633 /**
9634 * Return the list of names from the library that are made visible by this com binator.
9635 *
9636 * @return the list of names from the library that are made visible by this co mbinator
9637 */
9638 NodeList<SimpleIdentifier> get shownNames => _shownNames;
10526 9639
10527 void visitChildren(ASTVisitor visitor) { 9640 void visitChildren(ASTVisitor visitor) {
10528 shownNames.accept(visitor); 9641 _shownNames.accept(visitor);
10529 } 9642 }
10530 } 9643 }
10531 9644
10532 /** 9645 /**
10533 * Instances of the class `SimpleFormalParameter` represent a simple formal para meter. 9646 * Instances of the class `SimpleFormalParameter` represent a simple formal para meter.
10534 * 9647 *
10535 * <pre> 9648 * <pre>
10536 * simpleFormalParameter ::= 9649 * simpleFormalParameter ::=
10537 * ('final' [TypeName] | 'var' | [TypeName])? [SimpleIdentifier] 9650 * ('final' [TypeName] | 'var' | [TypeName])? [SimpleIdentifier]
10538 * </pre> 9651 * </pre>
(...skipping 15 matching lines...) Expand all
10554 9667
10555 /** 9668 /**
10556 * Initialize a newly created formal parameter. 9669 * Initialize a newly created formal parameter.
10557 * 9670 *
10558 * @param comment the documentation comment associated with this parameter 9671 * @param comment the documentation comment associated with this parameter
10559 * @param metadata the annotations associated with this parameter 9672 * @param metadata the annotations associated with this parameter
10560 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 9673 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
10561 * @param type the name of the declared type of the parameter 9674 * @param type the name of the declared type of the parameter
10562 * @param identifier the name of the parameter being declared 9675 * @param identifier the name of the parameter being declared
10563 */ 9676 */
10564 SimpleFormalParameter.full(Comment comment, List<Annotation> metadata, Token k eyword, TypeName type, SimpleIdentifier identifier) : super.full(comment, metada ta, identifier) { 9677 SimpleFormalParameter(Comment comment, List<Annotation> metadata, this.keyword , TypeName type, SimpleIdentifier identifier) : super(comment, metadata, identif ier) {
10565 this.keyword = keyword;
10566 this._type = becomeParentOf(type); 9678 this._type = becomeParentOf(type);
10567 } 9679 }
10568 9680
10569 /**
10570 * Initialize a newly created formal parameter.
10571 *
10572 * @param comment the documentation comment associated with this parameter
10573 * @param metadata the annotations associated with this parameter
10574 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
10575 * @param type the name of the declared type of the parameter
10576 * @param identifier the name of the parameter being declared
10577 */
10578 SimpleFormalParameter({Comment comment, List<Annotation> metadata, Token keywo rd, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, keyword, type, identifier);
10579
10580 accept(ASTVisitor visitor) => visitor.visitSimpleFormalParameter(this); 9681 accept(ASTVisitor visitor) => visitor.visitSimpleFormalParameter(this);
10581 9682
10582 Token get beginToken { 9683 Token get beginToken {
10583 if (keyword != null) { 9684 if (keyword != null) {
10584 return keyword; 9685 return keyword;
10585 } else if (_type != null) { 9686 } else if (_type != null) {
10586 return _type.beginToken; 9687 return _type.beginToken;
10587 } 9688 }
10588 return identifier.beginToken; 9689 return identifier.beginToken;
10589 } 9690 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
10656 * be set to hold onto the static and propagated information. The auxiliary el ement will hold onto 9757 * be set to hold onto the static and propagated information. The auxiliary el ement will hold onto
10657 * the elements from the getter context. 9758 * the elements from the getter context.
10658 */ 9759 */
10659 AuxiliaryElements auxiliaryElements = null; 9760 AuxiliaryElements auxiliaryElements = null;
10660 9761
10661 /** 9762 /**
10662 * Initialize a newly created identifier. 9763 * Initialize a newly created identifier.
10663 * 9764 *
10664 * @param token the token representing the identifier 9765 * @param token the token representing the identifier
10665 */ 9766 */
10666 SimpleIdentifier.full(Token token) { 9767 SimpleIdentifier(this.token);
10667 this.token = token;
10668 }
10669
10670 /**
10671 * Initialize a newly created identifier.
10672 *
10673 * @param token the token representing the identifier
10674 */
10675 SimpleIdentifier({Token token}) : this.full(token);
10676 9768
10677 accept(ASTVisitor visitor) => visitor.visitSimpleIdentifier(this); 9769 accept(ASTVisitor visitor) => visitor.visitSimpleIdentifier(this);
10678 9770
10679 Token get beginToken => token; 9771 Token get beginToken => token;
10680 9772
10681 Element get bestElement { 9773 Element get bestElement {
10682 if (_propagatedElement == null) { 9774 if (_propagatedElement == null) {
10683 return _staticElement; 9775 return _staticElement;
10684 } 9776 }
10685 return _propagatedElement; 9777 return _propagatedElement;
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
10915 */ 10007 */
10916 Token literal; 10008 Token literal;
10917 10009
10918 /** 10010 /**
10919 * The value of the literal. 10011 * The value of the literal.
10920 */ 10012 */
10921 String _value; 10013 String _value;
10922 10014
10923 /** 10015 /**
10924 * Initialize a newly created simple string literal. 10016 * Initialize a newly created simple string literal.
10925 *
10926 * @param literal the token representing the literal
10927 * @param value the value of the literal
10928 */
10929 SimpleStringLiteral.full(Token literal, String value) {
10930 this.literal = literal;
10931 this._value = StringUtilities.intern(value);
10932 }
10933
10934 /**
10935 * Initialize a newly created simple string literal.
10936 * 10017 *
10937 * @param literal the token representing the literal 10018 * @param literal the token representing the literal
10938 * @param value the value of the literal 10019 * @param value the value of the literal
10939 */ 10020 */
10940 SimpleStringLiteral({Token literal, String value}) : this.full(literal, value) ; 10021 SimpleStringLiteral(this.literal, String value) {
10022 this._value = StringUtilities.intern(value);
10023 }
10941 10024
10942 accept(ASTVisitor visitor) => visitor.visitSimpleStringLiteral(this); 10025 accept(ASTVisitor visitor) => visitor.visitSimpleStringLiteral(this);
10943 10026
10944 Token get beginToken => literal; 10027 Token get beginToken => literal;
10945 10028
10946 Token get endToken => literal; 10029 Token get endToken => literal;
10947 10030
10948 /** 10031 /**
10949 * Return the value of the literal. 10032 * Return the value of the literal.
10950 * 10033 *
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
11025 * ''' [InterpolationElement]* ''' 10108 * ''' [InterpolationElement]* '''
11026 * | '"' [InterpolationElement]* '"' 10109 * | '"' [InterpolationElement]* '"'
11027 * </pre> 10110 * </pre>
11028 * 10111 *
11029 * @coverage dart.engine.ast 10112 * @coverage dart.engine.ast
11030 */ 10113 */
11031 class StringInterpolation extends StringLiteral { 10114 class StringInterpolation extends StringLiteral {
11032 /** 10115 /**
11033 * The elements that will be composed to produce the resulting string. 10116 * The elements that will be composed to produce the resulting string.
11034 */ 10117 */
11035 NodeList<InterpolationElement> elements; 10118 NodeList<InterpolationElement> _elements;
11036 10119
11037 /** 10120 /**
11038 * Initialize a newly created string interpolation expression. 10121 * Initialize a newly created string interpolation expression.
11039 * 10122 *
11040 * @param elements the elements that will be composed to produce the resulting string 10123 * @param elements the elements that will be composed to produce the resulting string
11041 */ 10124 */
11042 StringInterpolation.full(List<InterpolationElement> elements) { 10125 StringInterpolation(List<InterpolationElement> elements) {
11043 this.elements = new NodeList<InterpolationElement>(this); 10126 this._elements = new NodeList<InterpolationElement>(this);
11044 this.elements.addAll(elements); 10127 this._elements.addAll(elements);
11045 } 10128 }
11046 10129
11047 /**
11048 * Initialize a newly created string interpolation expression.
11049 *
11050 * @param elements the elements that will be composed to produce the resulting string
11051 */
11052 StringInterpolation({List<InterpolationElement> elements}) : this.full(element s);
11053
11054 accept(ASTVisitor visitor) => visitor.visitStringInterpolation(this); 10130 accept(ASTVisitor visitor) => visitor.visitStringInterpolation(this);
11055 10131
11056 Token get beginToken => elements.beginToken; 10132 Token get beginToken => _elements.beginToken;
11057 10133
11058 Token get endToken => elements.endToken; 10134 /**
10135 * Return the elements that will be composed to produce the resulting string.
10136 *
10137 * @return the elements that will be composed to produce the resulting string
10138 */
10139 NodeList<InterpolationElement> get elements => _elements;
10140
10141 Token get endToken => _elements.endToken;
11059 10142
11060 void visitChildren(ASTVisitor visitor) { 10143 void visitChildren(ASTVisitor visitor) {
11061 elements.accept(visitor); 10144 _elements.accept(visitor);
11062 } 10145 }
11063 10146
11064 void appendStringValue(JavaStringBuilder builder) { 10147 void appendStringValue(JavaStringBuilder builder) {
11065 throw new IllegalArgumentException(); 10148 throw new IllegalArgumentException();
11066 } 10149 }
11067 } 10150 }
11068 10151
11069 /** 10152 /**
11070 * Instances of the class `StringLiteral` represent a string literal expression. 10153 * Instances of the class `StringLiteral` represent a string literal expression.
11071 * 10154 *
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
11147 10230
11148 /** 10231 /**
11149 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given 10232 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given
11150 * name with the given arguments. 10233 * name with the given arguments.
11151 * 10234 *
11152 * @param keyword the token for the 'super' keyword 10235 * @param keyword the token for the 'super' keyword
11153 * @param period the token for the period before the name of the constructor t hat is being invoked 10236 * @param period the token for the period before the name of the constructor t hat is being invoked
11154 * @param constructorName the name of the constructor that is being invoked 10237 * @param constructorName the name of the constructor that is being invoked
11155 * @param argumentList the list of arguments to the constructor 10238 * @param argumentList the list of arguments to the constructor
11156 */ 10239 */
11157 SuperConstructorInvocation.full(Token keyword, Token period, SimpleIdentifier constructorName, ArgumentList argumentList) { 10240 SuperConstructorInvocation(this.keyword, this.period, SimpleIdentifier constru ctorName, ArgumentList argumentList) {
11158 this.keyword = keyword;
11159 this.period = period;
11160 this._constructorName = becomeParentOf(constructorName); 10241 this._constructorName = becomeParentOf(constructorName);
11161 this._argumentList = becomeParentOf(argumentList); 10242 this._argumentList = becomeParentOf(argumentList);
11162 } 10243 }
11163 10244
11164 /**
11165 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given
11166 * name with the given arguments.
11167 *
11168 * @param keyword the token for the 'super' keyword
11169 * @param period the token for the period before the name of the constructor t hat is being invoked
11170 * @param constructorName the name of the constructor that is being invoked
11171 * @param argumentList the list of arguments to the constructor
11172 */
11173 SuperConstructorInvocation({Token keyword, Token period, SimpleIdentifier cons tructorName, ArgumentList argumentList}) : this.full(keyword, period, constructo rName, argumentList);
11174
11175 accept(ASTVisitor visitor) => visitor.visitSuperConstructorInvocation(this); 10245 accept(ASTVisitor visitor) => visitor.visitSuperConstructorInvocation(this);
11176 10246
11177 /** 10247 /**
11178 * Return the list of arguments to the constructor. 10248 * Return the list of arguments to the constructor.
11179 * 10249 *
11180 * @return the list of arguments to the constructor 10250 * @return the list of arguments to the constructor
11181 */ 10251 */
11182 ArgumentList get argumentList => _argumentList; 10252 ArgumentList get argumentList => _argumentList;
11183 10253
11184 Token get beginToken => keyword; 10254 Token get beginToken => keyword;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
11231 /** 10301 /**
11232 * The token representing the keyword. 10302 * The token representing the keyword.
11233 */ 10303 */
11234 Token keyword; 10304 Token keyword;
11235 10305
11236 /** 10306 /**
11237 * Initialize a newly created super expression. 10307 * Initialize a newly created super expression.
11238 * 10308 *
11239 * @param keyword the token representing the keyword 10309 * @param keyword the token representing the keyword
11240 */ 10310 */
11241 SuperExpression.full(Token keyword) { 10311 SuperExpression(this.keyword);
11242 this.keyword = keyword;
11243 }
11244
11245 /**
11246 * Initialize a newly created super expression.
11247 *
11248 * @param keyword the token representing the keyword
11249 */
11250 SuperExpression({Token keyword}) : this.full(keyword);
11251 10312
11252 accept(ASTVisitor visitor) => visitor.visitSuperExpression(this); 10313 accept(ASTVisitor visitor) => visitor.visitSuperExpression(this);
11253 10314
11254 Token get beginToken => keyword; 10315 Token get beginToken => keyword;
11255 10316
11256 Token get endToken => keyword; 10317 Token get endToken => keyword;
11257 10318
11258 int get precedence => 16; 10319 int get precedence => 16;
11259 10320
11260 void visitChildren(ASTVisitor visitor) { 10321 void visitChildren(ASTVisitor visitor) {
(...skipping 18 matching lines...) Expand all
11279 10340
11280 /** 10341 /**
11281 * Initialize a newly created switch case. 10342 * Initialize a newly created switch case.
11282 * 10343 *
11283 * @param labels the labels associated with the switch member 10344 * @param labels the labels associated with the switch member
11284 * @param keyword the token representing the 'case' or 'default' keyword 10345 * @param keyword the token representing the 'case' or 'default' keyword
11285 * @param expression the expression controlling whether the statements will be executed 10346 * @param expression the expression controlling whether the statements will be executed
11286 * @param colon the colon separating the keyword or the expression from the st atements 10347 * @param colon the colon separating the keyword or the expression from the st atements
11287 * @param statements the statements that will be executed if this switch membe r is selected 10348 * @param statements the statements that will be executed if this switch membe r is selected
11288 */ 10349 */
11289 SwitchCase.full(List<Label> labels, Token keyword, Expression expression, Toke n colon, List<Statement> statements) : super.full(labels, keyword, colon, statem ents) { 10350 SwitchCase(List<Label> labels, Token keyword, Expression expression, Token col on, List<Statement> statements) : super(labels, keyword, colon, statements) {
11290 this._expression = becomeParentOf(expression); 10351 this._expression = becomeParentOf(expression);
11291 } 10352 }
11292 10353
11293 /**
11294 * Initialize a newly created switch case.
11295 *
11296 * @param labels the labels associated with the switch member
11297 * @param keyword the token representing the 'case' or 'default' keyword
11298 * @param expression the expression controlling whether the statements will be executed
11299 * @param colon the colon separating the keyword or the expression from the st atements
11300 * @param statements the statements that will be executed if this switch membe r is selected
11301 */
11302 SwitchCase({List<Label> labels, Token keyword, Expression expression, Token co lon, List<Statement> statements}) : this.full(labels, keyword, expression, colon , statements);
11303
11304 accept(ASTVisitor visitor) => visitor.visitSwitchCase(this); 10354 accept(ASTVisitor visitor) => visitor.visitSwitchCase(this);
11305 10355
11306 /** 10356 /**
11307 * Return the expression controlling whether the statements will be executed. 10357 * Return the expression controlling whether the statements will be executed.
11308 * 10358 *
11309 * @return the expression controlling whether the statements will be executed 10359 * @return the expression controlling whether the statements will be executed
11310 */ 10360 */
11311 Expression get expression => _expression; 10361 Expression get expression => _expression;
11312 10362
11313 /** 10363 /**
(...skipping 24 matching lines...) Expand all
11338 */ 10388 */
11339 class SwitchDefault extends SwitchMember { 10389 class SwitchDefault extends SwitchMember {
11340 /** 10390 /**
11341 * Initialize a newly created switch default. 10391 * Initialize a newly created switch default.
11342 * 10392 *
11343 * @param labels the labels associated with the switch member 10393 * @param labels the labels associated with the switch member
11344 * @param keyword the token representing the 'case' or 'default' keyword 10394 * @param keyword the token representing the 'case' or 'default' keyword
11345 * @param colon the colon separating the keyword or the expression from the st atements 10395 * @param colon the colon separating the keyword or the expression from the st atements
11346 * @param statements the statements that will be executed if this switch membe r is selected 10396 * @param statements the statements that will be executed if this switch membe r is selected
11347 */ 10397 */
11348 SwitchDefault.full(List<Label> labels, Token keyword, Token colon, List<Statem ent> statements) : super.full(labels, keyword, colon, statements); 10398 SwitchDefault(List<Label> labels, Token keyword, Token colon, List<Statement> statements) : super(labels, keyword, colon, statements);
11349
11350 /**
11351 * Initialize a newly created switch default.
11352 *
11353 * @param labels the labels associated with the switch member
11354 * @param keyword the token representing the 'case' or 'default' keyword
11355 * @param colon the colon separating the keyword or the expression from the st atements
11356 * @param statements the statements that will be executed if this switch membe r is selected
11357 */
11358 SwitchDefault({List<Label> labels, Token keyword, Token colon, List<Statement> statements}) : this.full(labels, keyword, colon, statements);
11359 10399
11360 accept(ASTVisitor visitor) => visitor.visitSwitchDefault(this); 10400 accept(ASTVisitor visitor) => visitor.visitSwitchDefault(this);
11361 10401
11362 void visitChildren(ASTVisitor visitor) { 10402 void visitChildren(ASTVisitor visitor) {
11363 labels.accept(visitor); 10403 labels.accept(visitor);
11364 statements.accept(visitor); 10404 statements.accept(visitor);
11365 } 10405 }
11366 } 10406 }
11367 10407
11368 /** 10408 /**
11369 * The abstract class `SwitchMember` defines the behavior common to objects repr esenting 10409 * The abstract class `SwitchMember` defines the behavior common to objects repr esenting
11370 * elements within a switch statement. 10410 * elements within a switch statement.
11371 * 10411 *
11372 * <pre> 10412 * <pre>
11373 * switchMember ::= 10413 * switchMember ::=
11374 * switchCase 10414 * switchCase
11375 * | switchDefault 10415 * | switchDefault
11376 * </pre> 10416 * </pre>
11377 * 10417 *
11378 * @coverage dart.engine.ast 10418 * @coverage dart.engine.ast
11379 */ 10419 */
11380 abstract class SwitchMember extends ASTNode { 10420 abstract class SwitchMember extends ASTNode {
11381 /** 10421 /**
11382 * The labels associated with the switch member. 10422 * The labels associated with the switch member.
11383 */ 10423 */
11384 NodeList<Label> labels; 10424 NodeList<Label> _labels;
11385 10425
11386 /** 10426 /**
11387 * The token representing the 'case' or 'default' keyword. 10427 * The token representing the 'case' or 'default' keyword.
11388 */ 10428 */
11389 Token keyword; 10429 Token keyword;
11390 10430
11391 /** 10431 /**
11392 * The colon separating the keyword or the expression from the statements. 10432 * The colon separating the keyword or the expression from the statements.
11393 */ 10433 */
11394 Token colon; 10434 Token colon;
11395 10435
11396 /** 10436 /**
11397 * The statements that will be executed if this switch member is selected. 10437 * The statements that will be executed if this switch member is selected.
11398 */ 10438 */
11399 NodeList<Statement> statements; 10439 NodeList<Statement> _statements;
11400 10440
11401 /** 10441 /**
11402 * Initialize a newly created switch member. 10442 * Initialize a newly created switch member.
11403 * 10443 *
11404 * @param labels the labels associated with the switch member 10444 * @param labels the labels associated with the switch member
11405 * @param keyword the token representing the 'case' or 'default' keyword 10445 * @param keyword the token representing the 'case' or 'default' keyword
11406 * @param colon the colon separating the keyword or the expression from the st atements 10446 * @param colon the colon separating the keyword or the expression from the st atements
11407 * @param statements the statements that will be executed if this switch membe r is selected 10447 * @param statements the statements that will be executed if this switch membe r is selected
11408 */ 10448 */
11409 SwitchMember.full(List<Label> labels, Token keyword, Token colon, List<Stateme nt> statements) { 10449 SwitchMember(List<Label> labels, this.keyword, this.colon, List<Statement> sta tements) {
11410 this.labels = new NodeList<Label>(this); 10450 this._labels = new NodeList<Label>(this);
11411 this.statements = new NodeList<Statement>(this); 10451 this._statements = new NodeList<Statement>(this);
11412 this.labels.addAll(labels); 10452 this._labels.addAll(labels);
11413 this.keyword = keyword; 10453 this._statements.addAll(statements);
11414 this.colon = colon;
11415 this.statements.addAll(statements);
11416 } 10454 }
11417 10455
11418 /**
11419 * Initialize a newly created switch member.
11420 *
11421 * @param labels the labels associated with the switch member
11422 * @param keyword the token representing the 'case' or 'default' keyword
11423 * @param colon the colon separating the keyword or the expression from the st atements
11424 * @param statements the statements that will be executed if this switch membe r is selected
11425 */
11426 SwitchMember({List<Label> labels, Token keyword, Token colon, List<Statement> statements}) : this.full(labels, keyword, colon, statements);
11427
11428 Token get beginToken { 10456 Token get beginToken {
11429 if (!labels.isEmpty) { 10457 if (!_labels.isEmpty) {
11430 return labels.beginToken; 10458 return _labels.beginToken;
11431 } 10459 }
11432 return keyword; 10460 return keyword;
11433 } 10461 }
11434 10462
11435 Token get endToken { 10463 Token get endToken {
11436 if (!statements.isEmpty) { 10464 if (!_statements.isEmpty) {
11437 return statements.endToken; 10465 return _statements.endToken;
11438 } 10466 }
11439 return colon; 10467 return colon;
11440 } 10468 }
10469
10470 /**
10471 * Return the labels associated with the switch member.
10472 *
10473 * @return the labels associated with the switch member
10474 */
10475 NodeList<Label> get labels => _labels;
10476
10477 /**
10478 * Return the statements that will be executed if this switch member is select ed.
10479 *
10480 * @return the statements that will be executed if this switch member is selec ted
10481 */
10482 NodeList<Statement> get statements => _statements;
11441 } 10483 }
11442 10484
11443 /** 10485 /**
11444 * Instances of the class `SwitchStatement` represent a switch statement. 10486 * Instances of the class `SwitchStatement` represent a switch statement.
11445 * 10487 *
11446 * <pre> 10488 * <pre>
11447 * switchStatement ::= 10489 * switchStatement ::=
11448 * 'switch' '(' [Expression] ')' '{' [SwitchCase]* [SwitchDefault]? '}' 10490 * 'switch' '(' [Expression] ')' '{' [SwitchCase]* [SwitchDefault]? '}'
11449 * </pre> 10491 * </pre>
11450 * 10492 *
(...skipping 21 matching lines...) Expand all
11472 Token rightParenthesis; 10514 Token rightParenthesis;
11473 10515
11474 /** 10516 /**
11475 * The left curly bracket. 10517 * The left curly bracket.
11476 */ 10518 */
11477 Token leftBracket; 10519 Token leftBracket;
11478 10520
11479 /** 10521 /**
11480 * The switch members that can be selected by the expression. 10522 * The switch members that can be selected by the expression.
11481 */ 10523 */
11482 NodeList<SwitchMember> members; 10524 NodeList<SwitchMember> _members;
11483 10525
11484 /** 10526 /**
11485 * The right curly bracket. 10527 * The right curly bracket.
11486 */ 10528 */
11487 Token rightBracket; 10529 Token rightBracket;
11488 10530
11489 /** 10531 /**
11490 * Initialize a newly created switch statement. 10532 * Initialize a newly created switch statement.
11491 * 10533 *
11492 * @param keyword the token representing the 'switch' keyword 10534 * @param keyword the token representing the 'switch' keyword
11493 * @param leftParenthesis the left parenthesis 10535 * @param leftParenthesis the left parenthesis
11494 * @param expression the expression used to determine which of the switch memb ers will be selected 10536 * @param expression the expression used to determine which of the switch memb ers will be selected
11495 * @param rightParenthesis the right parenthesis 10537 * @param rightParenthesis the right parenthesis
11496 * @param leftBracket the left curly bracket 10538 * @param leftBracket the left curly bracket
11497 * @param members the switch members that can be selected by the expression 10539 * @param members the switch members that can be selected by the expression
11498 * @param rightBracket the right curly bracket 10540 * @param rightBracket the right curly bracket
11499 */ 10541 */
11500 SwitchStatement.full(Token keyword, Token leftParenthesis, Expression expressi on, Token rightParenthesis, Token leftBracket, List<SwitchMember> members, Token rightBracket) { 10542 SwitchStatement(this.keyword, this.leftParenthesis, Expression expression, thi s.rightParenthesis, this.leftBracket, List<SwitchMember> members, this.rightBrac ket) {
11501 this.members = new NodeList<SwitchMember>(this); 10543 this._members = new NodeList<SwitchMember>(this);
11502 this.keyword = keyword;
11503 this.leftParenthesis = leftParenthesis;
11504 this._expression = becomeParentOf(expression); 10544 this._expression = becomeParentOf(expression);
11505 this.rightParenthesis = rightParenthesis; 10545 this._members.addAll(members);
11506 this.leftBracket = leftBracket;
11507 this.members.addAll(members);
11508 this.rightBracket = rightBracket;
11509 } 10546 }
11510 10547
11511 /**
11512 * Initialize a newly created switch statement.
11513 *
11514 * @param keyword the token representing the 'switch' keyword
11515 * @param leftParenthesis the left parenthesis
11516 * @param expression the expression used to determine which of the switch memb ers will be selected
11517 * @param rightParenthesis the right parenthesis
11518 * @param leftBracket the left curly bracket
11519 * @param members the switch members that can be selected by the expression
11520 * @param rightBracket the right curly bracket
11521 */
11522 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);
11523
11524 accept(ASTVisitor visitor) => visitor.visitSwitchStatement(this); 10548 accept(ASTVisitor visitor) => visitor.visitSwitchStatement(this);
11525 10549
11526 Token get beginToken => keyword; 10550 Token get beginToken => keyword;
11527 10551
11528 Token get endToken => rightBracket; 10552 Token get endToken => rightBracket;
11529 10553
11530 /** 10554 /**
11531 * Return the expression used to determine which of the switch members will be selected. 10555 * Return the expression used to determine which of the switch members will be selected.
11532 * 10556 *
11533 * @return the expression used to determine which of the switch members will b e selected 10557 * @return the expression used to determine which of the switch members will b e selected
11534 */ 10558 */
11535 Expression get expression => _expression; 10559 Expression get expression => _expression;
11536 10560
11537 /** 10561 /**
10562 * Return the switch members that can be selected by the expression.
10563 *
10564 * @return the switch members that can be selected by the expression
10565 */
10566 NodeList<SwitchMember> get members => _members;
10567
10568 /**
11538 * Set the expression used to determine which of the switch members will be se lected to the given 10569 * Set the expression used to determine which of the switch members will be se lected to the given
11539 * expression. 10570 * expression.
11540 * 10571 *
11541 * @param expression the expression used to determine which of the switch memb ers will be selected 10572 * @param expression the expression used to determine which of the switch memb ers will be selected
11542 */ 10573 */
11543 void set expression(Expression expression) { 10574 void set expression(Expression expression) {
11544 this._expression = becomeParentOf(expression); 10575 this._expression = becomeParentOf(expression);
11545 } 10576 }
11546 10577
11547 void visitChildren(ASTVisitor visitor) { 10578 void visitChildren(ASTVisitor visitor) {
11548 safelyVisitChild(_expression, visitor); 10579 safelyVisitChild(_expression, visitor);
11549 members.accept(visitor); 10580 _members.accept(visitor);
11550 } 10581 }
11551 } 10582 }
11552 10583
11553 /** 10584 /**
11554 * Instances of the class `SymbolLiteral` represent a symbol literal expression. 10585 * Instances of the class `SymbolLiteral` represent a symbol literal expression.
11555 * 10586 *
11556 * <pre> 10587 * <pre>
11557 * symbolLiteral ::= 10588 * symbolLiteral ::=
11558 * '#' (operator | (identifier ('.' identifier)*)) 10589 * '#' (operator | (identifier ('.' identifier)*))
11559 * </pre> 10590 * </pre>
11560 * 10591 *
11561 * @coverage dart.engine.ast 10592 * @coverage dart.engine.ast
11562 */ 10593 */
11563 class SymbolLiteral extends Literal { 10594 class SymbolLiteral extends Literal {
11564 /** 10595 /**
11565 * The token introducing the literal. 10596 * The token introducing the literal.
11566 */ 10597 */
11567 Token poundSign; 10598 Token poundSign;
11568 10599
11569 /** 10600 /**
11570 * The components of the literal. 10601 * The components of the literal.
11571 */ 10602 */
11572 List<Token> components; 10603 final List<Token> components;
11573 10604
11574 /** 10605 /**
11575 * Initialize a newly created symbol literal. 10606 * Initialize a newly created symbol literal.
11576 *
11577 * @param poundSign the token introducing the literal
11578 * @param components the components of the literal
11579 */
11580 SymbolLiteral.full(Token poundSign, List<Token> components) {
11581 this.poundSign = poundSign;
11582 this.components = components;
11583 }
11584
11585 /**
11586 * Initialize a newly created symbol literal.
11587 * 10607 *
11588 * @param poundSign the token introducing the literal 10608 * @param poundSign the token introducing the literal
11589 * @param components the components of the literal 10609 * @param components the components of the literal
11590 */ 10610 */
11591 SymbolLiteral({Token poundSign, List<Token> components}) : this.full(poundSign , components); 10611 SymbolLiteral(this.poundSign, this.components);
11592 10612
11593 accept(ASTVisitor visitor) => visitor.visitSymbolLiteral(this); 10613 accept(ASTVisitor visitor) => visitor.visitSymbolLiteral(this);
11594 10614
11595 Token get beginToken => poundSign; 10615 Token get beginToken => poundSign;
11596 10616
11597 Token get endToken => components[components.length - 1]; 10617 Token get endToken => components[components.length - 1];
11598 10618
11599 void visitChildren(ASTVisitor visitor) { 10619 void visitChildren(ASTVisitor visitor) {
11600 } 10620 }
11601 } 10621 }
(...skipping 12 matching lines...) Expand all
11614 /** 10634 /**
11615 * The token representing the keyword. 10635 * The token representing the keyword.
11616 */ 10636 */
11617 Token keyword; 10637 Token keyword;
11618 10638
11619 /** 10639 /**
11620 * Initialize a newly created this expression. 10640 * Initialize a newly created this expression.
11621 * 10641 *
11622 * @param keyword the token representing the keyword 10642 * @param keyword the token representing the keyword
11623 */ 10643 */
11624 ThisExpression.full(Token keyword) { 10644 ThisExpression(this.keyword);
11625 this.keyword = keyword;
11626 }
11627
11628 /**
11629 * Initialize a newly created this expression.
11630 *
11631 * @param keyword the token representing the keyword
11632 */
11633 ThisExpression({Token keyword}) : this.full(keyword);
11634 10645
11635 accept(ASTVisitor visitor) => visitor.visitThisExpression(this); 10646 accept(ASTVisitor visitor) => visitor.visitThisExpression(this);
11636 10647
11637 Token get beginToken => keyword; 10648 Token get beginToken => keyword;
11638 10649
11639 Token get endToken => keyword; 10650 Token get endToken => keyword;
11640 10651
11641 int get precedence => 16; 10652 int get precedence => 16;
11642 10653
11643 void visitChildren(ASTVisitor visitor) { 10654 void visitChildren(ASTVisitor visitor) {
(...skipping 20 matching lines...) Expand all
11664 * The expression computing the exception to be thrown. 10675 * The expression computing the exception to be thrown.
11665 */ 10676 */
11666 Expression _expression; 10677 Expression _expression;
11667 10678
11668 /** 10679 /**
11669 * Initialize a newly created throw expression. 10680 * Initialize a newly created throw expression.
11670 * 10681 *
11671 * @param keyword the token representing the 'throw' keyword 10682 * @param keyword the token representing the 'throw' keyword
11672 * @param expression the expression computing the exception to be thrown 10683 * @param expression the expression computing the exception to be thrown
11673 */ 10684 */
11674 ThrowExpression.full(Token keyword, Expression expression) { 10685 ThrowExpression(this.keyword, Expression expression) {
11675 this.keyword = keyword;
11676 this._expression = becomeParentOf(expression); 10686 this._expression = becomeParentOf(expression);
11677 } 10687 }
11678 10688
11679 /**
11680 * Initialize a newly created throw expression.
11681 *
11682 * @param keyword the token representing the 'throw' keyword
11683 * @param expression the expression computing the exception to be thrown
11684 */
11685 ThrowExpression({Token keyword, Expression expression}) : this.full(keyword, e xpression);
11686
11687 accept(ASTVisitor visitor) => visitor.visitThrowExpression(this); 10689 accept(ASTVisitor visitor) => visitor.visitThrowExpression(this);
11688 10690
11689 Token get beginToken => keyword; 10691 Token get beginToken => keyword;
11690 10692
11691 Token get endToken { 10693 Token get endToken {
11692 if (_expression != null) { 10694 if (_expression != null) {
11693 return _expression.endToken; 10695 return _expression.endToken;
11694 } 10696 }
11695 return keyword; 10697 return keyword;
11696 } 10698 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
11742 Token semicolon; 10744 Token semicolon;
11743 10745
11744 /** 10746 /**
11745 * Initialize a newly created top-level variable declaration. 10747 * Initialize a newly created top-level variable declaration.
11746 * 10748 *
11747 * @param comment the documentation comment associated with this variable 10749 * @param comment the documentation comment associated with this variable
11748 * @param metadata the annotations associated with this variable 10750 * @param metadata the annotations associated with this variable
11749 * @param variableList the top-level variables being declared 10751 * @param variableList the top-level variables being declared
11750 * @param semicolon the semicolon terminating the declaration 10752 * @param semicolon the semicolon terminating the declaration
11751 */ 10753 */
11752 TopLevelVariableDeclaration.full(Comment comment, List<Annotation> metadata, V ariableDeclarationList variableList, Token semicolon) : super.full(comment, meta data) { 10754 TopLevelVariableDeclaration(Comment comment, List<Annotation> metadata, Variab leDeclarationList variableList, this.semicolon) : super(comment, metadata) {
11753 this._variableList = becomeParentOf(variableList); 10755 this._variableList = becomeParentOf(variableList);
11754 this.semicolon = semicolon;
11755 } 10756 }
11756 10757
11757 /**
11758 * Initialize a newly created top-level variable declaration.
11759 *
11760 * @param comment the documentation comment associated with this variable
11761 * @param metadata the annotations associated with this variable
11762 * @param variableList the top-level variables being declared
11763 * @param semicolon the semicolon terminating the declaration
11764 */
11765 TopLevelVariableDeclaration({Comment comment, List<Annotation> metadata, Varia bleDeclarationList variableList, Token semicolon}) : this.full(comment, metadata , variableList, semicolon);
11766
11767 accept(ASTVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this); 10758 accept(ASTVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this);
11768 10759
11769 Element get element => null; 10760 Element get element => null;
11770 10761
11771 Token get endToken => semicolon; 10762 Token get endToken => semicolon;
11772 10763
11773 /** 10764 /**
11774 * Return the top-level variables being declared. 10765 * Return the top-level variables being declared.
11775 * 10766 *
11776 * @return the top-level variables being declared 10767 * @return the top-level variables being declared
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
11814 Token tryKeyword; 10805 Token tryKeyword;
11815 10806
11816 /** 10807 /**
11817 * The body of the statement. 10808 * The body of the statement.
11818 */ 10809 */
11819 Block _body; 10810 Block _body;
11820 10811
11821 /** 10812 /**
11822 * The catch clauses contained in the try statement. 10813 * The catch clauses contained in the try statement.
11823 */ 10814 */
11824 NodeList<CatchClause> catchClauses; 10815 NodeList<CatchClause> _catchClauses;
11825 10816
11826 /** 10817 /**
11827 * The token representing the 'finally' keyword, or `null` if the statement do es not contain 10818 * The token representing the 'finally' keyword, or `null` if the statement do es not contain
11828 * a finally clause. 10819 * a finally clause.
11829 */ 10820 */
11830 Token finallyKeyword; 10821 Token finallyKeyword;
11831 10822
11832 /** 10823 /**
11833 * The finally block contained in the try statement, or `null` if the statemen t does not 10824 * The finally block contained in the try statement, or `null` if the statemen t does not
11834 * contain a finally clause. 10825 * contain a finally clause.
11835 */ 10826 */
11836 Block _finallyBlock; 10827 Block _finallyBlock;
11837 10828
11838 /** 10829 /**
11839 * Initialize a newly created try statement. 10830 * Initialize a newly created try statement.
11840 * 10831 *
11841 * @param tryKeyword the token representing the 'try' keyword 10832 * @param tryKeyword the token representing the 'try' keyword
11842 * @param body the body of the statement 10833 * @param body the body of the statement
11843 * @param catchClauses the catch clauses contained in the try statement 10834 * @param catchClauses the catch clauses contained in the try statement
11844 * @param finallyKeyword the token representing the 'finally' keyword 10835 * @param finallyKeyword the token representing the 'finally' keyword
11845 * @param finallyBlock the finally block contained in the try statement 10836 * @param finallyBlock the finally block contained in the try statement
11846 */ 10837 */
11847 TryStatement.full(Token tryKeyword, Block body, List<CatchClause> catchClauses , Token finallyKeyword, Block finallyBlock) { 10838 TryStatement(this.tryKeyword, Block body, List<CatchClause> catchClauses, this .finallyKeyword, Block finallyBlock) {
11848 this.catchClauses = new NodeList<CatchClause>(this); 10839 this._catchClauses = new NodeList<CatchClause>(this);
11849 this.tryKeyword = tryKeyword;
11850 this._body = becomeParentOf(body); 10840 this._body = becomeParentOf(body);
11851 this.catchClauses.addAll(catchClauses); 10841 this._catchClauses.addAll(catchClauses);
11852 this.finallyKeyword = finallyKeyword;
11853 this._finallyBlock = becomeParentOf(finallyBlock); 10842 this._finallyBlock = becomeParentOf(finallyBlock);
11854 } 10843 }
11855 10844
11856 /**
11857 * Initialize a newly created try statement.
11858 *
11859 * @param tryKeyword the token representing the 'try' keyword
11860 * @param body the body of the statement
11861 * @param catchClauses the catch clauses contained in the try statement
11862 * @param finallyKeyword the token representing the 'finally' keyword
11863 * @param finallyBlock the finally block contained in the try statement
11864 */
11865 TryStatement({Token tryKeyword, Block body, List<CatchClause> catchClauses, To ken finallyKeyword, Block finallyBlock}) : this.full(tryKeyword, body, catchClau ses, finallyKeyword, finallyBlock);
11866
11867 accept(ASTVisitor visitor) => visitor.visitTryStatement(this); 10845 accept(ASTVisitor visitor) => visitor.visitTryStatement(this);
11868 10846
11869 Token get beginToken => tryKeyword; 10847 Token get beginToken => tryKeyword;
11870 10848
11871 /** 10849 /**
11872 * Return the body of the statement. 10850 * Return the body of the statement.
11873 * 10851 *
11874 * @return the body of the statement 10852 * @return the body of the statement
11875 */ 10853 */
11876 Block get body => _body; 10854 Block get body => _body;
11877 10855
10856 /**
10857 * Return the catch clauses contained in the try statement.
10858 *
10859 * @return the catch clauses contained in the try statement
10860 */
10861 NodeList<CatchClause> get catchClauses => _catchClauses;
10862
11878 Token get endToken { 10863 Token get endToken {
11879 if (_finallyBlock != null) { 10864 if (_finallyBlock != null) {
11880 return _finallyBlock.endToken; 10865 return _finallyBlock.endToken;
11881 } else if (finallyKeyword != null) { 10866 } else if (finallyKeyword != null) {
11882 return finallyKeyword; 10867 return finallyKeyword;
11883 } else if (!catchClauses.isEmpty) { 10868 } else if (!_catchClauses.isEmpty) {
11884 return catchClauses.endToken; 10869 return _catchClauses.endToken;
11885 } 10870 }
11886 return _body.endToken; 10871 return _body.endToken;
11887 } 10872 }
11888 10873
11889 /** 10874 /**
11890 * Return the finally block contained in the try statement, or `null` if the s tatement does 10875 * Return the finally block contained in the try statement, or `null` if the s tatement does
11891 * not contain a finally clause. 10876 * not contain a finally clause.
11892 * 10877 *
11893 * @return the finally block contained in the try statement 10878 * @return the finally block contained in the try statement
11894 */ 10879 */
(...skipping 12 matching lines...) Expand all
11907 * Set the finally block contained in the try statement to the given block. 10892 * Set the finally block contained in the try statement to the given block.
11908 * 10893 *
11909 * @param block the finally block contained in the try statement 10894 * @param block the finally block contained in the try statement
11910 */ 10895 */
11911 void set finallyBlock(Block block) { 10896 void set finallyBlock(Block block) {
11912 _finallyBlock = becomeParentOf(block); 10897 _finallyBlock = becomeParentOf(block);
11913 } 10898 }
11914 10899
11915 void visitChildren(ASTVisitor visitor) { 10900 void visitChildren(ASTVisitor visitor) {
11916 safelyVisitChild(_body, visitor); 10901 safelyVisitChild(_body, visitor);
11917 catchClauses.accept(visitor); 10902 _catchClauses.accept(visitor);
11918 safelyVisitChild(_finallyBlock, visitor); 10903 safelyVisitChild(_finallyBlock, visitor);
11919 } 10904 }
11920 } 10905 }
11921 10906
11922 /** 10907 /**
11923 * The abstract class `TypeAlias` defines the behavior common to declarations of type aliases. 10908 * The abstract class `TypeAlias` defines the behavior common to declarations of type aliases.
11924 * 10909 *
11925 * <pre> 10910 * <pre>
11926 * typeAlias ::= 10911 * typeAlias ::=
11927 * 'typedef' typeAliasBody 10912 * 'typedef' typeAliasBody
(...skipping 17 matching lines...) Expand all
11945 Token semicolon; 10930 Token semicolon;
11946 10931
11947 /** 10932 /**
11948 * Initialize a newly created type alias. 10933 * Initialize a newly created type alias.
11949 * 10934 *
11950 * @param comment the documentation comment associated with this type alias 10935 * @param comment the documentation comment associated with this type alias
11951 * @param metadata the annotations associated with this type alias 10936 * @param metadata the annotations associated with this type alias
11952 * @param keyword the token representing the 'typedef' keyword 10937 * @param keyword the token representing the 'typedef' keyword
11953 * @param semicolon the semicolon terminating the declaration 10938 * @param semicolon the semicolon terminating the declaration
11954 */ 10939 */
11955 TypeAlias.full(Comment comment, List<Annotation> metadata, Token keyword, Toke n semicolon) : super.full(comment, metadata) { 10940 TypeAlias(Comment comment, List<Annotation> metadata, this.keyword, this.semic olon) : super(comment, metadata);
11956 this.keyword = keyword;
11957 this.semicolon = semicolon;
11958 }
11959
11960 /**
11961 * Initialize a newly created type alias.
11962 *
11963 * @param comment the documentation comment associated with this type alias
11964 * @param metadata the annotations associated with this type alias
11965 * @param keyword the token representing the 'typedef' keyword
11966 * @param semicolon the semicolon terminating the declaration
11967 */
11968 TypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Token se micolon}) : this.full(comment, metadata, keyword, semicolon);
11969 10941
11970 Token get endToken => semicolon; 10942 Token get endToken => semicolon;
11971 10943
11972 Token get firstTokenAfterCommentAndMetadata => keyword; 10944 Token get firstTokenAfterCommentAndMetadata => keyword;
11973 } 10945 }
11974 10946
11975 /** 10947 /**
11976 * Instances of the class `TypeArgumentList` represent a list of type arguments. 10948 * Instances of the class `TypeArgumentList` represent a list of type arguments.
11977 * 10949 *
11978 * <pre> 10950 * <pre>
11979 * typeArguments ::= 10951 * typeArguments ::=
11980 * '<' typeName (',' typeName)* '>' 10952 * '<' typeName (',' typeName)* '>'
11981 * </pre> 10953 * </pre>
11982 * 10954 *
11983 * @coverage dart.engine.ast 10955 * @coverage dart.engine.ast
11984 */ 10956 */
11985 class TypeArgumentList extends ASTNode { 10957 class TypeArgumentList extends ASTNode {
11986 /** 10958 /**
11987 * The left bracket. 10959 * The left bracket.
11988 */ 10960 */
11989 Token leftBracket; 10961 Token leftBracket;
11990 10962
11991 /** 10963 /**
11992 * The type arguments associated with the type. 10964 * The type arguments associated with the type.
11993 */ 10965 */
11994 NodeList<TypeName> arguments; 10966 NodeList<TypeName> _arguments;
11995 10967
11996 /** 10968 /**
11997 * The right bracket. 10969 * The right bracket.
11998 */ 10970 */
11999 Token rightBracket; 10971 Token rightBracket;
12000 10972
12001 /** 10973 /**
12002 * Initialize a newly created list of type arguments. 10974 * Initialize a newly created list of type arguments.
12003 * 10975 *
12004 * @param leftBracket the left bracket 10976 * @param leftBracket the left bracket
12005 * @param arguments the type arguments associated with the type 10977 * @param arguments the type arguments associated with the type
12006 * @param rightBracket the right bracket 10978 * @param rightBracket the right bracket
12007 */ 10979 */
12008 TypeArgumentList.full(Token leftBracket, List<TypeName> arguments, Token right Bracket) { 10980 TypeArgumentList(this.leftBracket, List<TypeName> arguments, this.rightBracket ) {
12009 this.arguments = new NodeList<TypeName>(this); 10981 this._arguments = new NodeList<TypeName>(this);
12010 this.leftBracket = leftBracket; 10982 this._arguments.addAll(arguments);
12011 this.arguments.addAll(arguments);
12012 this.rightBracket = rightBracket;
12013 } 10983 }
12014 10984
10985 accept(ASTVisitor visitor) => visitor.visitTypeArgumentList(this);
10986
12015 /** 10987 /**
12016 * Initialize a newly created list of type arguments. 10988 * Return the type arguments associated with the type.
12017 * 10989 *
12018 * @param leftBracket the left bracket 10990 * @return the type arguments associated with the type
12019 * @param arguments the type arguments associated with the type
12020 * @param rightBracket the right bracket
12021 */ 10991 */
12022 TypeArgumentList({Token leftBracket, List<TypeName> arguments, Token rightBrac ket}) : this.full(leftBracket, arguments, rightBracket); 10992 NodeList<TypeName> get arguments => _arguments;
12023
12024 accept(ASTVisitor visitor) => visitor.visitTypeArgumentList(this);
12025 10993
12026 Token get beginToken => leftBracket; 10994 Token get beginToken => leftBracket;
12027 10995
12028 Token get endToken => rightBracket; 10996 Token get endToken => rightBracket;
12029 10997
12030 void visitChildren(ASTVisitor visitor) { 10998 void visitChildren(ASTVisitor visitor) {
12031 arguments.accept(visitor); 10999 _arguments.accept(visitor);
12032 } 11000 }
12033 } 11001 }
12034 11002
12035 /** 11003 /**
12036 * Instances of the class `TypeName` represent the name of a type, which can opt ionally 11004 * Instances of the class `TypeName` represent the name of a type, which can opt ionally
12037 * include type arguments. 11005 * include type arguments.
12038 * 11006 *
12039 * <pre> 11007 * <pre>
12040 * typeName ::= 11008 * typeName ::=
12041 * [Identifier] typeArguments? 11009 * [Identifier] typeArguments?
(...skipping 17 matching lines...) Expand all
12059 */ 11027 */
12060 Type2 type; 11028 Type2 type;
12061 11029
12062 /** 11030 /**
12063 * Initialize a newly created type name. 11031 * Initialize a newly created type name.
12064 * 11032 *
12065 * @param name the name of the type 11033 * @param name the name of the type
12066 * @param typeArguments the type arguments associated with the type, or `null` if there are 11034 * @param typeArguments the type arguments associated with the type, or `null` if there are
12067 * no type arguments 11035 * no type arguments
12068 */ 11036 */
12069 TypeName.full(Identifier name, TypeArgumentList typeArguments) { 11037 TypeName(Identifier name, TypeArgumentList typeArguments) {
12070 this._name = becomeParentOf(name); 11038 this._name = becomeParentOf(name);
12071 this._typeArguments = becomeParentOf(typeArguments); 11039 this._typeArguments = becomeParentOf(typeArguments);
12072 } 11040 }
12073 11041
12074 /**
12075 * Initialize a newly created type name.
12076 *
12077 * @param name the name of the type
12078 * @param typeArguments the type arguments associated with the type, or `null` if there are
12079 * no type arguments
12080 */
12081 TypeName({Identifier name, TypeArgumentList typeArguments}) : this.full(name, typeArguments);
12082
12083 accept(ASTVisitor visitor) => visitor.visitTypeName(this); 11042 accept(ASTVisitor visitor) => visitor.visitTypeName(this);
12084 11043
12085 Token get beginToken => _name.beginToken; 11044 Token get beginToken => _name.beginToken;
12086 11045
12087 Token get endToken { 11046 Token get endToken {
12088 if (_typeArguments != null) { 11047 if (_typeArguments != null) {
12089 return _typeArguments.endToken; 11048 return _typeArguments.endToken;
12090 } 11049 }
12091 return _name.endToken; 11050 return _name.endToken;
12092 } 11051 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
12162 11121
12163 /** 11122 /**
12164 * Initialize a newly created type parameter. 11123 * Initialize a newly created type parameter.
12165 * 11124 *
12166 * @param comment the documentation comment associated with the type parameter 11125 * @param comment the documentation comment associated with the type parameter
12167 * @param metadata the annotations associated with the type parameter 11126 * @param metadata the annotations associated with the type parameter
12168 * @param name the name of the type parameter 11127 * @param name the name of the type parameter
12169 * @param keyword the token representing the 'extends' keyword 11128 * @param keyword the token representing the 'extends' keyword
12170 * @param bound the name of the upper bound for legal arguments 11129 * @param bound the name of the upper bound for legal arguments
12171 */ 11130 */
12172 TypeParameter.full(Comment comment, List<Annotation> metadata, SimpleIdentifie r name, Token keyword, TypeName bound) : super.full(comment, metadata) { 11131 TypeParameter(Comment comment, List<Annotation> metadata, SimpleIdentifier nam e, this.keyword, TypeName bound) : super(comment, metadata) {
12173 this._name = becomeParentOf(name); 11132 this._name = becomeParentOf(name);
12174 this.keyword = keyword;
12175 this._bound = becomeParentOf(bound); 11133 this._bound = becomeParentOf(bound);
12176 } 11134 }
12177 11135
12178 /**
12179 * Initialize a newly created type parameter.
12180 *
12181 * @param comment the documentation comment associated with the type parameter
12182 * @param metadata the annotations associated with the type parameter
12183 * @param name the name of the type parameter
12184 * @param keyword the token representing the 'extends' keyword
12185 * @param bound the name of the upper bound for legal arguments
12186 */
12187 TypeParameter({Comment comment, List<Annotation> metadata, SimpleIdentifier na me, Token keyword, TypeName bound}) : this.full(comment, metadata, name, keyword , bound);
12188
12189 accept(ASTVisitor visitor) => visitor.visitTypeParameter(this); 11136 accept(ASTVisitor visitor) => visitor.visitTypeParameter(this);
12190 11137
12191 /** 11138 /**
12192 * Return the name of the upper bound for legal arguments, or `null` if there was no 11139 * Return the name of the upper bound for legal arguments, or `null` if there was no
12193 * explicit upper bound. 11140 * explicit upper bound.
12194 * 11141 *
12195 * @return the name of the upper bound for legal arguments 11142 * @return the name of the upper bound for legal arguments
12196 */ 11143 */
12197 TypeName get bound => _bound; 11144 TypeName get bound => _bound;
12198 11145
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
12246 * typeParameterList ::= 11193 * typeParameterList ::=
12247 * '<' [TypeParameter] (',' [TypeParameter])* '>' 11194 * '<' [TypeParameter] (',' [TypeParameter])* '>'
12248 * </pre> 11195 * </pre>
12249 * 11196 *
12250 * @coverage dart.engine.ast 11197 * @coverage dart.engine.ast
12251 */ 11198 */
12252 class TypeParameterList extends ASTNode { 11199 class TypeParameterList extends ASTNode {
12253 /** 11200 /**
12254 * The left angle bracket. 11201 * The left angle bracket.
12255 */ 11202 */
12256 Token leftBracket; 11203 final Token leftBracket;
12257 11204
12258 /** 11205 /**
12259 * The type parameters in the list. 11206 * The type parameters in the list.
12260 */ 11207 */
12261 NodeList<TypeParameter> typeParameters; 11208 NodeList<TypeParameter> _typeParameters;
12262 11209
12263 /** 11210 /**
12264 * The right angle bracket. 11211 * The right angle bracket.
12265 */ 11212 */
12266 Token rightBracket; 11213 final Token rightBracket;
12267 11214
12268 /** 11215 /**
12269 * Initialize a newly created list of type parameters. 11216 * Initialize a newly created list of type parameters.
12270 * 11217 *
12271 * @param leftBracket the left angle bracket 11218 * @param leftBracket the left angle bracket
12272 * @param typeParameters the type parameters in the list 11219 * @param typeParameters the type parameters in the list
12273 * @param rightBracket the right angle bracket 11220 * @param rightBracket the right angle bracket
12274 */ 11221 */
12275 TypeParameterList.full(Token leftBracket, List<TypeParameter> typeParameters, Token rightBracket) { 11222 TypeParameterList(this.leftBracket, List<TypeParameter> typeParameters, this.r ightBracket) {
12276 this.typeParameters = new NodeList<TypeParameter>(this); 11223 this._typeParameters = new NodeList<TypeParameter>(this);
12277 this.leftBracket = leftBracket; 11224 this._typeParameters.addAll(typeParameters);
12278 this.typeParameters.addAll(typeParameters);
12279 this.rightBracket = rightBracket;
12280 } 11225 }
12281 11226
12282 /**
12283 * Initialize a newly created list of type parameters.
12284 *
12285 * @param leftBracket the left angle bracket
12286 * @param typeParameters the type parameters in the list
12287 * @param rightBracket the right angle bracket
12288 */
12289 TypeParameterList({Token leftBracket, List<TypeParameter> typeParameters, Toke n rightBracket}) : this.full(leftBracket, typeParameters, rightBracket);
12290
12291 accept(ASTVisitor visitor) => visitor.visitTypeParameterList(this); 11227 accept(ASTVisitor visitor) => visitor.visitTypeParameterList(this);
12292 11228
12293 Token get beginToken => leftBracket; 11229 Token get beginToken => leftBracket;
12294 11230
12295 Token get endToken => rightBracket; 11231 Token get endToken => rightBracket;
12296 11232
11233 /**
11234 * Return the type parameters for the type.
11235 *
11236 * @return the type parameters for the type
11237 */
11238 NodeList<TypeParameter> get typeParameters => _typeParameters;
11239
12297 void visitChildren(ASTVisitor visitor) { 11240 void visitChildren(ASTVisitor visitor) {
12298 typeParameters.accept(visitor); 11241 _typeParameters.accept(visitor);
12299 } 11242 }
12300 } 11243 }
12301 11244
12302 /** 11245 /**
12303 * The abstract class `TypedLiteral` defines the behavior common to literals tha t have a type 11246 * The abstract class `TypedLiteral` defines the behavior common to literals tha t have a type
12304 * associated with them. 11247 * associated with them.
12305 * 11248 *
12306 * <pre> 11249 * <pre>
12307 * listLiteral ::= 11250 * listLiteral ::=
12308 * [ListLiteral] 11251 * [ListLiteral]
(...skipping 14 matching lines...) Expand all
12323 */ 11266 */
12324 TypeArgumentList typeArguments; 11267 TypeArgumentList typeArguments;
12325 11268
12326 /** 11269 /**
12327 * Initialize a newly created typed literal. 11270 * Initialize a newly created typed literal.
12328 * 11271 *
12329 * @param constKeyword the token representing the 'const' keyword 11272 * @param constKeyword the token representing the 'const' keyword
12330 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 11273 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
12331 * arguments were declared 11274 * arguments were declared
12332 */ 11275 */
12333 TypedLiteral.full(Token constKeyword, TypeArgumentList typeArguments) { 11276 TypedLiteral(this.constKeyword, TypeArgumentList typeArguments) {
12334 this.constKeyword = constKeyword;
12335 this.typeArguments = becomeParentOf(typeArguments); 11277 this.typeArguments = becomeParentOf(typeArguments);
12336 } 11278 }
12337 11279
12338 /**
12339 * Initialize a newly created typed literal.
12340 *
12341 * @param constKeyword the token representing the 'const' keyword
12342 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
12343 * arguments were declared
12344 */
12345 TypedLiteral({Token constKeyword, TypeArgumentList typeArguments}) : this.full (constKeyword, typeArguments);
12346
12347 void visitChildren(ASTVisitor visitor) { 11280 void visitChildren(ASTVisitor visitor) {
12348 safelyVisitChild(typeArguments, visitor); 11281 safelyVisitChild(typeArguments, visitor);
12349 } 11282 }
12350 } 11283 }
12351 11284
12352 /** 11285 /**
12353 * The abstract class `UriBasedDirective` defines the behavior common to nodes t hat represent 11286 * The abstract class `UriBasedDirective` defines the behavior common to nodes t hat represent
12354 * a directive that references a URI. 11287 * a directive that references a URI.
12355 * 11288 *
12356 * <pre> 11289 * <pre>
(...skipping 11 matching lines...) Expand all
12368 */ 11301 */
12369 StringLiteral _uri; 11302 StringLiteral _uri;
12370 11303
12371 /** 11304 /**
12372 * Initialize a newly create URI-based directive. 11305 * Initialize a newly create URI-based directive.
12373 * 11306 *
12374 * @param comment the documentation comment associated with this directive 11307 * @param comment the documentation comment associated with this directive
12375 * @param metadata the annotations associated with the directive 11308 * @param metadata the annotations associated with the directive
12376 * @param uri the URI referenced by this directive 11309 * @param uri the URI referenced by this directive
12377 */ 11310 */
12378 UriBasedDirective.full(Comment comment, List<Annotation> metadata, StringLiter al uri) : super.full(comment, metadata) { 11311 UriBasedDirective(Comment comment, List<Annotation> metadata, StringLiteral ur i) : super(comment, metadata) {
12379 this._uri = becomeParentOf(uri); 11312 this._uri = becomeParentOf(uri);
12380 } 11313 }
12381 11314
12382 /** 11315 /**
12383 * Initialize a newly create URI-based directive.
12384 *
12385 * @param comment the documentation comment associated with this directive
12386 * @param metadata the annotations associated with the directive
12387 * @param uri the URI referenced by this directive
12388 */
12389 UriBasedDirective({Comment comment, List<Annotation> metadata, StringLiteral u ri}) : this.full(comment, metadata, uri);
12390
12391 /**
12392 * Return the URI referenced by this directive. 11316 * Return the URI referenced by this directive.
12393 * 11317 *
12394 * @return the URI referenced by this directive 11318 * @return the URI referenced by this directive
12395 */ 11319 */
12396 StringLiteral get uri => _uri; 11320 StringLiteral get uri => _uri;
12397 11321
12398 /** 11322 /**
12399 * Return the element associated with the URI of this directive, or `null` if the AST 11323 * Return the element associated with the URI of this directive, or `null` if the AST
12400 * structure has not been resolved or if this URI could not be resolved. Examp les of the latter 11324 * structure has not been resolved or if this URI could not be resolved. Examp les of the latter
12401 * case include a directive that contains an invalid URL or a URL that does no t exist. 11325 * case include a directive that contains an invalid URL or a URL that does no t exist.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
12451 11375
12452 /** 11376 /**
12453 * Initialize a newly created variable declaration. 11377 * Initialize a newly created variable declaration.
12454 * 11378 *
12455 * @param comment the documentation comment associated with this declaration 11379 * @param comment the documentation comment associated with this declaration
12456 * @param metadata the annotations associated with this member 11380 * @param metadata the annotations associated with this member
12457 * @param name the name of the variable being declared 11381 * @param name the name of the variable being declared
12458 * @param equals the equal sign separating the variable name from the initial value 11382 * @param equals the equal sign separating the variable name from the initial value
12459 * @param initializer the expression used to compute the initial value for the variable 11383 * @param initializer the expression used to compute the initial value for the variable
12460 */ 11384 */
12461 VariableDeclaration.full(Comment comment, List<Annotation> metadata, SimpleIde ntifier name, Token equals, Expression initializer) : super.full(comment, metada ta) { 11385 VariableDeclaration(Comment comment, List<Annotation> metadata, SimpleIdentifi er name, this.equals, Expression initializer) : super(comment, metadata) {
12462 this._name = becomeParentOf(name); 11386 this._name = becomeParentOf(name);
12463 this.equals = equals;
12464 this._initializer = becomeParentOf(initializer); 11387 this._initializer = becomeParentOf(initializer);
12465 } 11388 }
12466 11389
12467 /**
12468 * Initialize a newly created variable declaration.
12469 *
12470 * @param comment the documentation comment associated with this declaration
12471 * @param metadata the annotations associated with this member
12472 * @param name the name of the variable being declared
12473 * @param equals the equal sign separating the variable name from the initial value
12474 * @param initializer the expression used to compute the initial value for the variable
12475 */
12476 VariableDeclaration({Comment comment, List<Annotation> metadata, SimpleIdentif ier name, Token equals, Expression initializer}) : this.full(comment, metadata, name, equals, initializer);
12477
12478 accept(ASTVisitor visitor) => visitor.visitVariableDeclaration(this); 11390 accept(ASTVisitor visitor) => visitor.visitVariableDeclaration(this);
12479 11391
12480 /** 11392 /**
12481 * This overridden implementation of getDocumentationComment() looks in the gr andparent node for 11393 * This overridden implementation of getDocumentationComment() looks in the gr andparent node for
12482 * dartdoc comments if no documentation is specifically available on the node. 11394 * dartdoc comments if no documentation is specifically available on the node.
12483 */ 11395 */
12484 Comment get documentationComment { 11396 Comment get documentationComment {
12485 Comment comment = super.documentationComment; 11397 Comment comment = super.documentationComment;
12486 if (comment == null) { 11398 if (comment == null) {
12487 if (parent != null && parent.parent != null) { 11399 if (parent != null && parent.parent != null) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
12592 Token keyword; 11504 Token keyword;
12593 11505
12594 /** 11506 /**
12595 * The type of the variables being declared, or `null` if no type was provided . 11507 * The type of the variables being declared, or `null` if no type was provided .
12596 */ 11508 */
12597 TypeName _type; 11509 TypeName _type;
12598 11510
12599 /** 11511 /**
12600 * A list containing the individual variables being declared. 11512 * A list containing the individual variables being declared.
12601 */ 11513 */
12602 NodeList<VariableDeclaration> variables; 11514 NodeList<VariableDeclaration> _variables;
12603 11515
12604 /** 11516 /**
12605 * Initialize a newly created variable declaration list. 11517 * Initialize a newly created variable declaration list.
12606 * 11518 *
12607 * @param comment the documentation comment associated with this declaration l ist 11519 * @param comment the documentation comment associated with this declaration l ist
12608 * @param metadata the annotations associated with this declaration list 11520 * @param metadata the annotations associated with this declaration list
12609 * @param keyword the token representing the 'final', 'const' or 'var' keyword 11521 * @param keyword the token representing the 'final', 'const' or 'var' keyword
12610 * @param type the type of the variables being declared 11522 * @param type the type of the variables being declared
12611 * @param variables a list containing the individual variables being declared 11523 * @param variables a list containing the individual variables being declared
12612 */ 11524 */
12613 VariableDeclarationList.full(Comment comment, List<Annotation> metadata, Token keyword, TypeName type, List<VariableDeclaration> variables) : super.full(comme nt, metadata) { 11525 VariableDeclarationList(Comment comment, List<Annotation> metadata, this.keywo rd, TypeName type, List<VariableDeclaration> variables) : super(comment, metadat a) {
12614 this.variables = new NodeList<VariableDeclaration>(this); 11526 this._variables = new NodeList<VariableDeclaration>(this);
12615 this.keyword = keyword;
12616 this._type = becomeParentOf(type); 11527 this._type = becomeParentOf(type);
12617 this.variables.addAll(variables); 11528 this._variables.addAll(variables);
12618 } 11529 }
12619 11530
12620 /**
12621 * Initialize a newly created variable declaration list.
12622 *
12623 * @param comment the documentation comment associated with this declaration l ist
12624 * @param metadata the annotations associated with this declaration list
12625 * @param keyword the token representing the 'final', 'const' or 'var' keyword
12626 * @param type the type of the variables being declared
12627 * @param variables a list containing the individual variables being declared
12628 */
12629 VariableDeclarationList({Comment comment, List<Annotation> metadata, Token key word, TypeName type, List<VariableDeclaration> variables}) : this.full(comment, metadata, keyword, type, variables);
12630
12631 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this); 11531 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this);
12632 11532
12633 Token get endToken => variables.endToken; 11533 Token get endToken => _variables.endToken;
12634 11534
12635 /** 11535 /**
12636 * Return the type of the variables being declared, or `null` if no type was p rovided. 11536 * Return the type of the variables being declared, or `null` if no type was p rovided.
12637 * 11537 *
12638 * @return the type of the variables being declared 11538 * @return the type of the variables being declared
12639 */ 11539 */
12640 TypeName get type => _type; 11540 TypeName get type => _type;
12641 11541
12642 /** 11542 /**
11543 * Return a list containing the individual variables being declared.
11544 *
11545 * @return a list containing the individual variables being declared
11546 */
11547 NodeList<VariableDeclaration> get variables => _variables;
11548
11549 /**
12643 * Return `true` if the variables in this list were declared with the 'const' modifier. 11550 * Return `true` if the variables in this list were declared with the 'const' modifier.
12644 * 11551 *
12645 * @return `true` if the variables in this list were declared with the 'const' modifier 11552 * @return `true` if the variables in this list were declared with the 'const' modifier
12646 */ 11553 */
12647 bool get isConst => keyword is KeywordToken && identical((keyword as KeywordTo ken).keyword, Keyword.CONST); 11554 bool get isConst => keyword is KeywordToken && identical((keyword as KeywordTo ken).keyword, Keyword.CONST);
12648 11555
12649 /** 11556 /**
12650 * Return `true` if the variables in this list were declared with the 'final' modifier. 11557 * Return `true` if the variables in this list were declared with the 'final' modifier.
12651 * Variables that are declared with the 'const' modifier will return `false` e ven though 11558 * Variables that are declared with the 'const' modifier will return `false` e ven though
12652 * they are implicitly final. 11559 * they are implicitly final.
12653 * 11560 *
12654 * @return `true` if the variables in this list were declared with the 'final' modifier 11561 * @return `true` if the variables in this list were declared with the 'final' modifier
12655 */ 11562 */
12656 bool get isFinal => keyword is KeywordToken && identical((keyword as KeywordTo ken).keyword, Keyword.FINAL); 11563 bool get isFinal => keyword is KeywordToken && identical((keyword as KeywordTo ken).keyword, Keyword.FINAL);
12657 11564
12658 /** 11565 /**
12659 * Set the type of the variables being declared to the given type name. 11566 * Set the type of the variables being declared to the given type name.
12660 * 11567 *
12661 * @param typeName the type of the variables being declared 11568 * @param typeName the type of the variables being declared
12662 */ 11569 */
12663 void set type(TypeName typeName) { 11570 void set type(TypeName typeName) {
12664 _type = becomeParentOf(typeName); 11571 _type = becomeParentOf(typeName);
12665 } 11572 }
12666 11573
12667 void visitChildren(ASTVisitor visitor) { 11574 void visitChildren(ASTVisitor visitor) {
12668 safelyVisitChild(_type, visitor); 11575 safelyVisitChild(_type, visitor);
12669 variables.accept(visitor); 11576 _variables.accept(visitor);
12670 } 11577 }
12671 11578
12672 Token get firstTokenAfterCommentAndMetadata { 11579 Token get firstTokenAfterCommentAndMetadata {
12673 if (keyword != null) { 11580 if (keyword != null) {
12674 return keyword; 11581 return keyword;
12675 } else if (_type != null) { 11582 } else if (_type != null) {
12676 return _type.beginToken; 11583 return _type.beginToken;
12677 } 11584 }
12678 return variables.beginToken; 11585 return _variables.beginToken;
12679 } 11586 }
12680 } 11587 }
12681 11588
12682 /** 11589 /**
12683 * Instances of the class `VariableDeclarationStatement` represent a list of var iables that 11590 * Instances of the class `VariableDeclarationStatement` represent a list of var iables that
12684 * are being declared in a context where a statement is required. 11591 * are being declared in a context where a statement is required.
12685 * 11592 *
12686 * <pre> 11593 * <pre>
12687 * variableDeclarationStatement ::= 11594 * variableDeclarationStatement ::=
12688 * [VariableDeclarationList] ';' 11595 * [VariableDeclarationList] ';'
(...skipping 11 matching lines...) Expand all
12700 * The semicolon terminating the statement. 11607 * The semicolon terminating the statement.
12701 */ 11608 */
12702 Token semicolon; 11609 Token semicolon;
12703 11610
12704 /** 11611 /**
12705 * Initialize a newly created variable declaration statement. 11612 * Initialize a newly created variable declaration statement.
12706 * 11613 *
12707 * @param variableList the fields being declared 11614 * @param variableList the fields being declared
12708 * @param semicolon the semicolon terminating the statement 11615 * @param semicolon the semicolon terminating the statement
12709 */ 11616 */
12710 VariableDeclarationStatement.full(VariableDeclarationList variableList, Token semicolon) { 11617 VariableDeclarationStatement(VariableDeclarationList variableList, this.semico lon) {
12711 this._variableList = becomeParentOf(variableList); 11618 this._variableList = becomeParentOf(variableList);
12712 this.semicolon = semicolon;
12713 } 11619 }
12714 11620
12715 /**
12716 * Initialize a newly created variable declaration statement.
12717 *
12718 * @param variableList the fields being declared
12719 * @param semicolon the semicolon terminating the statement
12720 */
12721 VariableDeclarationStatement({VariableDeclarationList variableList, Token semi colon}) : this.full(variableList, semicolon);
12722
12723 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationStatement(this); 11621 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationStatement(this);
12724 11622
12725 Token get beginToken => _variableList.beginToken; 11623 Token get beginToken => _variableList.beginToken;
12726 11624
12727 Token get endToken => semicolon; 11625 Token get endToken => semicolon;
12728 11626
12729 /** 11627 /**
12730 * Return the variables being declared. 11628 * Return the variables being declared.
12731 * 11629 *
12732 * @return the variables being declared 11630 * @return the variables being declared
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
12785 11683
12786 /** 11684 /**
12787 * Initialize a newly created while statement. 11685 * Initialize a newly created while statement.
12788 * 11686 *
12789 * @param keyword the token representing the 'while' keyword 11687 * @param keyword the token representing the 'while' keyword
12790 * @param leftParenthesis the left parenthesis 11688 * @param leftParenthesis the left parenthesis
12791 * @param condition the expression used to determine whether to execute the bo dy of the loop 11689 * @param condition the expression used to determine whether to execute the bo dy of the loop
12792 * @param rightParenthesis the right parenthesis 11690 * @param rightParenthesis the right parenthesis
12793 * @param body the body of the loop 11691 * @param body the body of the loop
12794 */ 11692 */
12795 WhileStatement.full(Token keyword, Token leftParenthesis, Expression condition , Token rightParenthesis, Statement body) { 11693 WhileStatement(this.keyword, this.leftParenthesis, Expression condition, this. rightParenthesis, Statement body) {
12796 this.keyword = keyword;
12797 this.leftParenthesis = leftParenthesis;
12798 this._condition = becomeParentOf(condition); 11694 this._condition = becomeParentOf(condition);
12799 this.rightParenthesis = rightParenthesis;
12800 this._body = becomeParentOf(body); 11695 this._body = becomeParentOf(body);
12801 } 11696 }
12802 11697
12803 /**
12804 * Initialize a newly created while statement.
12805 *
12806 * @param keyword the token representing the 'while' keyword
12807 * @param leftParenthesis the left parenthesis
12808 * @param condition the expression used to determine whether to execute the bo dy of the loop
12809 * @param rightParenthesis the right parenthesis
12810 * @param body the body of the loop
12811 */
12812 WhileStatement({Token keyword, Token leftParenthesis, Expression condition, To ken rightParenthesis, Statement body}) : this.full(keyword, leftParenthesis, con dition, rightParenthesis, body);
12813
12814 accept(ASTVisitor visitor) => visitor.visitWhileStatement(this); 11698 accept(ASTVisitor visitor) => visitor.visitWhileStatement(this);
12815 11699
12816 Token get beginToken => keyword; 11700 Token get beginToken => keyword;
12817 11701
12818 /** 11702 /**
12819 * Return the body of the loop. 11703 * Return the body of the loop.
12820 * 11704 *
12821 * @return the body of the loop 11705 * @return the body of the loop
12822 */ 11706 */
12823 Statement get body => _body; 11707 Statement get body => _body;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
12863 * withClause ::= 11747 * withClause ::=
12864 * 'with' [TypeName] (',' [TypeName])* 11748 * 'with' [TypeName] (',' [TypeName])*
12865 * </pre> 11749 * </pre>
12866 * 11750 *
12867 * @coverage dart.engine.ast 11751 * @coverage dart.engine.ast
12868 */ 11752 */
12869 class WithClause extends ASTNode { 11753 class WithClause extends ASTNode {
12870 /** 11754 /**
12871 * The token representing the 'with' keyword. 11755 * The token representing the 'with' keyword.
12872 */ 11756 */
12873 Token withKeyword; 11757 Token _withKeyword;
12874 11758
12875 /** 11759 /**
12876 * The names of the mixins that were specified. 11760 * The names of the mixins that were specified.
12877 */ 11761 */
12878 NodeList<TypeName> mixinTypes; 11762 NodeList<TypeName> _mixinTypes;
12879 11763
12880 /** 11764 /**
12881 * Initialize a newly created with clause. 11765 * Initialize a newly created with clause.
12882 * 11766 *
12883 * @param withKeyword the token representing the 'with' keyword 11767 * @param withKeyword the token representing the 'with' keyword
12884 * @param mixinTypes the names of the mixins that were specified 11768 * @param mixinTypes the names of the mixins that were specified
12885 */ 11769 */
12886 WithClause.full(Token withKeyword, List<TypeName> mixinTypes) { 11770 WithClause(Token withKeyword, List<TypeName> mixinTypes) {
12887 this.mixinTypes = new NodeList<TypeName>(this); 11771 this._mixinTypes = new NodeList<TypeName>(this);
12888 this.withKeyword = withKeyword; 11772 this._withKeyword = withKeyword;
12889 this.mixinTypes.addAll(mixinTypes); 11773 this._mixinTypes.addAll(mixinTypes);
12890 } 11774 }
12891 11775
12892 /**
12893 * Initialize a newly created with clause.
12894 *
12895 * @param withKeyword the token representing the 'with' keyword
12896 * @param mixinTypes the names of the mixins that were specified
12897 */
12898 WithClause({Token withKeyword, List<TypeName> mixinTypes}) : this.full(withKey word, mixinTypes);
12899
12900 accept(ASTVisitor visitor) => visitor.visitWithClause(this); 11776 accept(ASTVisitor visitor) => visitor.visitWithClause(this);
12901 11777
12902 Token get beginToken => withKeyword; 11778 Token get beginToken => _withKeyword;
12903 11779
12904 Token get endToken => mixinTypes.endToken; 11780 Token get endToken => _mixinTypes.endToken;
11781
11782 /**
11783 * Return the names of the mixins that were specified.
11784 *
11785 * @return the names of the mixins that were specified
11786 */
11787 NodeList<TypeName> get mixinTypes => _mixinTypes;
11788
11789 /**
11790 * Return the token representing the 'with' keyword.
11791 *
11792 * @return the token representing the 'with' keyword
11793 */
11794 Token get withKeyword => _withKeyword;
12905 11795
12906 /** 11796 /**
12907 * Set the token representing the 'with' keyword to the given token. 11797 * Set the token representing the 'with' keyword to the given token.
12908 * 11798 *
12909 * @param withKeyword the token representing the 'with' keyword 11799 * @param withKeyword the token representing the 'with' keyword
12910 */ 11800 */
12911 void set mixinKeyword(Token withKeyword) { 11801 void set mixinKeyword(Token withKeyword) {
12912 this.withKeyword = withKeyword; 11802 this._withKeyword = withKeyword;
12913 } 11803 }
12914 11804
12915 void visitChildren(ASTVisitor visitor) { 11805 void visitChildren(ASTVisitor visitor) {
12916 mixinTypes.accept(visitor); 11806 _mixinTypes.accept(visitor);
12917 } 11807 }
12918 } 11808 }
12919 11809
12920 /** 11810 /**
12921 * Instances of the class `BreadthFirstVisitor` implement an AST visitor that wi ll recursively 11811 * Instances of the class `BreadthFirstVisitor` implement an AST visitor that wi ll recursively
12922 * visit all of the nodes in an AST structure, similar to [GeneralizingASTVisito r]. This 11812 * visit all of the nodes in an AST structure, similar to [GeneralizingASTVisito r]. This
12923 * visitor uses a breadth-first ordering rather than the depth-first ordering of 11813 * visitor uses a breadth-first ordering rather than the depth-first ordering of
12924 * [GeneralizingASTVisitor]. 11814 * [GeneralizingASTVisitor].
12925 * 11815 *
12926 * Subclasses that override a visit method must either invoke the overridden vis it method or 11816 * Subclasses that override a visit method must either invoke the overridden vis it method or
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
13684 12574
13685 /** 12575 /**
13686 * The end offset of the range used to identify the node. 12576 * The end offset of the range used to identify the node.
13687 */ 12577 */
13688 int _endOffset = 0; 12578 int _endOffset = 0;
13689 12579
13690 /** 12580 /**
13691 * The element that was found that corresponds to the given source range, or ` null` if there 12581 * The element that was found that corresponds to the given source range, or ` null` if there
13692 * is no such element. 12582 * is no such element.
13693 */ 12583 */
13694 ASTNode foundNode; 12584 ASTNode _foundNode;
13695 12585
13696 /** 12586 /**
13697 * Initialize a newly created locator to locate one or more [ASTNode] by locat ing 12587 * Initialize a newly created locator to locate one or more [ASTNode] by locat ing
13698 * the node within an AST structure that corresponds to the given offset in th e source. 12588 * the node within an AST structure that corresponds to the given offset in th e source.
13699 * 12589 *
13700 * @param offset the offset used to identify the node 12590 * @param offset the offset used to identify the node
13701 */ 12591 */
13702 NodeLocator.con1(int offset) : this.con2(offset, offset); 12592 NodeLocator.con1(int offset) : this.con2(offset, offset);
13703 12593
13704 /** 12594 /**
13705 * Initialize a newly created locator to locate one or more [ASTNode] by locat ing 12595 * Initialize a newly created locator to locate one or more [ASTNode] by locat ing
13706 * the node within an AST structure that corresponds to the given range of cha racters in the 12596 * the node within an AST structure that corresponds to the given range of cha racters in the
13707 * source. 12597 * source.
13708 * 12598 *
13709 * @param start the start offset of the range used to identify the node 12599 * @param start the start offset of the range used to identify the node
13710 * @param end the end offset of the range used to identify the node 12600 * @param end the end offset of the range used to identify the node
13711 */ 12601 */
13712 NodeLocator.con2(int start, int end) { 12602 NodeLocator.con2(int start, int end) {
13713 this._startOffset = start; 12603 this._startOffset = start;
13714 this._endOffset = end; 12604 this._endOffset = end;
13715 } 12605 }
13716 12606
13717 /** 12607 /**
12608 * Return the node that was found that corresponds to the given source range, or `null` if
12609 * there is no such node.
12610 *
12611 * @return the node that was found
12612 */
12613 ASTNode get foundNode => _foundNode;
12614
12615 /**
13718 * 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 12616 * 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
13719 * no element was found. 12617 * no element was found.
13720 * 12618 *
13721 * @param node the AST node within which to search 12619 * @param node the AST node within which to search
13722 * @return the element that was found 12620 * @return the element that was found
13723 */ 12621 */
13724 ASTNode searchWithin(ASTNode node) { 12622 ASTNode searchWithin(ASTNode node) {
13725 if (node == null) { 12623 if (node == null) {
13726 return null; 12624 return null;
13727 } 12625 }
13728 try { 12626 try {
13729 node.accept(this); 12627 node.accept(this);
13730 } on NodeLocator_NodeFoundException catch (exception) { 12628 } on NodeLocator_NodeFoundException catch (exception) {
13731 } on JavaException catch (exception) { 12629 } on JavaException catch (exception) {
13732 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a t offset (${_startOffset} - ${_endOffset})", exception); 12630 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a t offset (${_startOffset} - ${_endOffset})", exception);
13733 return null; 12631 return null;
13734 } 12632 }
13735 return foundNode; 12633 return _foundNode;
13736 } 12634 }
13737 12635
13738 Object visitNode(ASTNode node) { 12636 Object visitNode(ASTNode node) {
13739 int start = node.offset; 12637 int start = node.offset;
13740 int end = start + node.length; 12638 int end = start + node.length;
13741 if (end < _startOffset) { 12639 if (end < _startOffset) {
13742 return null; 12640 return null;
13743 } 12641 }
13744 if (start > _endOffset) { 12642 if (start > _endOffset) {
13745 return null; 12643 return null;
13746 } 12644 }
13747 try { 12645 try {
13748 node.visitChildren(this); 12646 node.visitChildren(this);
13749 } on NodeLocator_NodeFoundException catch (exception) { 12647 } on NodeLocator_NodeFoundException catch (exception) {
13750 throw exception; 12648 throw exception;
13751 } on JavaException catch (exception) { 12649 } on JavaException catch (exception) {
13752 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra versing an AST structure.", exception); 12650 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra versing an AST structure.", exception);
13753 } 12651 }
13754 if (start <= _startOffset && _endOffset <= end) { 12652 if (start <= _startOffset && _endOffset <= end) {
13755 foundNode = node; 12653 _foundNode = node;
13756 throw new NodeLocator_NodeFoundException(); 12654 throw new NodeLocator_NodeFoundException();
13757 } 12655 }
13758 return null; 12656 return null;
13759 } 12657 }
13760 } 12658 }
13761 12659
13762 /** 12660 /**
13763 * Instances of the class `NodeFoundException` are used to cancel visiting after a node has 12661 * Instances of the class `NodeFoundException` are used to cancel visiting after a node has
13764 * been found. 12662 * been found.
13765 */ 12663 */
(...skipping 1935 matching lines...) Expand 10 before | Expand all | Expand 10 after
15701 14599
15702 R visitWithClause(WithClause node) => visitNode(node); 14600 R visitWithClause(WithClause node) => visitNode(node);
15703 } 14601 }
15704 14602
15705 /** 14603 /**
15706 * Instances of the class `ASTCloner` implement an object that will clone any AS T structure 14604 * Instances of the class `ASTCloner` implement an object that will clone any AS T structure
15707 * that it visits. The cloner will only clone the structure, it will not preserv e any resolution 14605 * that it visits. The cloner will only clone the structure, it will not preserv e any resolution
15708 * results or properties associated with the nodes. 14606 * results or properties associated with the nodes.
15709 */ 14607 */
15710 class ASTCloner implements ASTVisitor<ASTNode> { 14608 class ASTCloner implements ASTVisitor<ASTNode> {
15711 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs.full(clone3(node.strings)); 14609 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs(clone3(node.strings));
15712 14610
15713 Annotation visitAnnotation(Annotation node) => new Annotation.full(node.atSign , clone2(node.name), node.period, clone2(node.constructorName), clone2(node.argu ments)); 14611 Annotation visitAnnotation(Annotation node) => new Annotation(node.atSign, clo ne2(node.name), node.period, clone2(node.constructorName), clone2(node.arguments ));
15714 14612
15715 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) => new ArgumentDefinitionTest.full(node.question, clone2(node.identifier)); 14613 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) => new ArgumentDefinitionTest(node.question, clone2(node.identifier));
15716 14614
15717 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList.full(nod e.leftParenthesis, clone3(node.arguments), node.rightParenthesis); 14615 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(node.lef tParenthesis, clone3(node.arguments), node.rightParenthesis);
15718 14616
15719 AsExpression visitAsExpression(AsExpression node) => new AsExpression.full(clo ne2(node.expression), node.asOperator, clone2(node.type)); 14617 AsExpression visitAsExpression(AsExpression node) => new AsExpression(clone2(n ode.expression), node.asOperator, clone2(node.type));
15720 14618
15721 ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement.full (node.keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthes is, node.semicolon); 14619 ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement(node .keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthesis, n ode.semicolon);
15722 14620
15723 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => n ew AssignmentExpression.full(clone2(node.leftHandSide), node.operator, clone2(no de.rightHandSide)); 14621 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => n ew AssignmentExpression(clone2(node.leftHandSide), node.operator, clone2(node.ri ghtHandSide));
15724 14622
15725 BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExp ression.full(clone2(node.leftOperand), node.operator, clone2(node.rightOperand)) ; 14623 BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExp ression(clone2(node.leftOperand), node.operator, clone2(node.rightOperand));
15726 14624
15727 Block visitBlock(Block node) => new Block.full(node.leftBracket, clone3(node.s tatements), node.rightBracket); 14625 Block visitBlock(Block node) => new Block(node.leftBracket, clone3(node.statem ents), node.rightBracket);
15728 14626
15729 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody.full(clone2(node.block)); 14627 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody(clone2(node.block));
15730 14628
15731 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral. full(node.literal, node.value); 14629 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral( node.literal, node.value);
15732 14630
15733 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement. full(node.keyword, clone2(node.label), node.semicolon); 14631 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( node.keyword, clone2(node.label), node.semicolon);
15734 14632
15735 CascadeExpression visitCascadeExpression(CascadeExpression node) => new Cascad eExpression.full(clone2(node.target), clone3(node.cascadeSections)); 14633 CascadeExpression visitCascadeExpression(CascadeExpression node) => new Cascad eExpression(clone2(node.target), clone3(node.cascadeSections));
15736 14634
15737 CatchClause visitCatchClause(CatchClause node) => new CatchClause.full(node.on Keyword, clone2(node.exceptionType), node.catchKeyword, node.leftParenthesis, cl one2(node.exceptionParameter), node.comma, clone2(node.stackTraceParameter), nod e.rightParenthesis, clone2(node.body)); 14635 CatchClause visitCatchClause(CatchClause node) => new CatchClause(node.onKeywo rd, clone2(node.exceptionType), node.catchKeyword, node.leftParenthesis, clone2( node.exceptionParameter), node.comma, clone2(node.stackTraceParameter), node.rig htParenthesis, clone2(node.body));
15738 14636
15739 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { 14637 ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
15740 ClassDeclaration copy = new ClassDeclaration.full(clone2(node.documentationC omment), clone3(node.metadata), node.abstractKeyword, node.classKeyword, clone2( node.name), clone2(node.typeParameters), clone2(node.extendsClause), clone2(node .withClause), clone2(node.implementsClause), node.leftBracket, clone3(node.membe rs), node.rightBracket); 14638 ClassDeclaration copy = new ClassDeclaration(clone2(node.documentationCommen t), clone3(node.metadata), node.abstractKeyword, node.classKeyword, clone2(node. name), clone2(node.typeParameters), clone2(node.extendsClause), clone2(node.with Clause), clone2(node.implementsClause), node.leftBracket, clone3(node.members), node.rightBracket);
15741 copy.nativeClause = clone2(node.nativeClause); 14639 copy.nativeClause = clone2(node.nativeClause);
15742 return copy; 14640 return copy;
15743 } 14641 }
15744 14642
15745 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias. full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clo ne2(node.name), clone2(node.typeParameters), node.equals, node.abstractKeyword, clone2(node.superclass), clone2(node.withClause), clone2(node.implementsClause), node.semicolon); 14643 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias( clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(n ode.name), clone2(node.typeParameters), node.equals, node.abstractKeyword, clone 2(node.superclass), clone2(node.withClause), clone2(node.implementsClause), node .semicolon);
15746 14644
15747 Comment visitComment(Comment node) { 14645 Comment visitComment(Comment node) {
15748 if (node.isDocumentation) { 14646 if (node.isDocumentation) {
15749 return Comment.createDocumentationComment2(node.tokens, clone3(node.refere nces)); 14647 return Comment.createDocumentationComment2(node.tokens, clone3(node.refere nces));
15750 } else if (node.isBlock) { 14648 } else if (node.isBlock) {
15751 return Comment.createBlockComment(node.tokens); 14649 return Comment.createBlockComment(node.tokens);
15752 } 14650 }
15753 return Comment.createEndOfLineComment(node.tokens); 14651 return Comment.createEndOfLineComment(node.tokens);
15754 } 14652 }
15755 14653
15756 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference.full(node.newKeyword, clone2(node.identifier)); 14654 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference(node.newKeyword, clone2(node.identifier));
15757 14655
15758 CompilationUnit visitCompilationUnit(CompilationUnit node) { 14656 CompilationUnit visitCompilationUnit(CompilationUnit node) {
15759 CompilationUnit clone = new CompilationUnit.full(node.beginToken, clone2(nod e.scriptTag), clone3(node.directives), clone3(node.declarations), node.endToken) ; 14657 CompilationUnit clone = new CompilationUnit(node.beginToken, clone2(node.scr iptTag), clone3(node.directives), clone3(node.declarations), node.endToken);
15760 clone.lineInfo = node.lineInfo; 14658 clone.lineInfo = node.lineInfo;
15761 return clone; 14659 return clone;
15762 } 14660 }
15763 14661
15764 ConditionalExpression visitConditionalExpression(ConditionalExpression node) = > new ConditionalExpression.full(clone2(node.condition), node.question, clone2(n ode.thenExpression), node.colon, clone2(node.elseExpression)); 14662 ConditionalExpression visitConditionalExpression(ConditionalExpression node) = > new ConditionalExpression(clone2(node.condition), node.question, clone2(node.t henExpression), node.colon, clone2(node.elseExpression));
15765 14663
15766 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node ) => new ConstructorDeclaration.full(clone2(node.documentationComment), clone3(n ode.metadata), node.externalKeyword, node.constKeyword, node.factoryKeyword, clo ne2(node.returnType), node.period, clone2(node.name), clone2(node.parameters), n ode.separator, clone3(node.initializers), clone2(node.redirectedConstructor), cl one2(node.body)); 14664 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node ) => new ConstructorDeclaration(clone2(node.documentationComment), clone3(node.m etadata), node.externalKeyword, node.constKeyword, node.factoryKeyword, clone2(n ode.returnType), node.period, clone2(node.name), clone2(node.parameters), node.s eparator, clone3(node.initializers), clone2(node.redirectedConstructor), clone2( node.body));
15767 14665
15768 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI nitializer node) => new ConstructorFieldInitializer.full(node.keyword, node.peri od, clone2(node.fieldName), node.equals, clone2(node.expression)); 14666 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI nitializer node) => new ConstructorFieldInitializer(node.keyword, node.period, c lone2(node.fieldName), node.equals, clone2(node.expression));
15769 14667
15770 ConstructorName visitConstructorName(ConstructorName node) => new ConstructorN ame.full(clone2(node.type), node.period, clone2(node.name)); 14668 ConstructorName visitConstructorName(ConstructorName node) => new ConstructorN ame(clone2(node.type), node.period, clone2(node.name));
15771 14669
15772 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin ueStatement.full(node.keyword, clone2(node.label), node.semicolon); 14670 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin ueStatement(node.keyword, clone2(node.label), node.semicolon);
15773 14671
15774 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec laredIdentifier.full(clone2(node.documentationComment), clone3(node.metadata), n ode.keyword, clone2(node.type), clone2(node.identifier)); 14672 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec laredIdentifier(clone2(node.documentationComment), clone3(node.metadata), node.k eyword, clone2(node.type), clone2(node.identifier));
15775 14673
15776 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node ) => new DefaultFormalParameter.full(clone2(node.parameter), node.kind, node.sep arator, clone2(node.defaultValue)); 14674 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node ) => new DefaultFormalParameter(clone2(node.parameter), node.kind, node.separato r, clone2(node.defaultValue));
15777 14675
15778 DoStatement visitDoStatement(DoStatement node) => new DoStatement.full(node.do Keyword, clone2(node.body), node.whileKeyword, node.leftParenthesis, clone2(node .condition), node.rightParenthesis, node.semicolon); 14676 DoStatement visitDoStatement(DoStatement node) => new DoStatement(node.doKeywo rd, clone2(node.body), node.whileKeyword, node.leftParenthesis, clone2(node.cond ition), node.rightParenthesis, node.semicolon);
15779 14677
15780 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => new DoubleLiteral.full (node.literal, node.value); 14678 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => new DoubleLiteral(node .literal, node.value);
15781 14679
15782 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF unctionBody.full(node.semicolon); 14680 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF unctionBody(node.semicolon);
15783 14681
15784 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement. full(node.semicolon); 14682 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement( node.semicolon);
15785 14683
15786 ExportDirective visitExportDirective(ExportDirective node) => new ExportDirect ive.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.uri), clone3(node.combinators), node.semicolon); 14684 ExportDirective visitExportDirective(ExportDirective node) => new ExportDirect ive(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clon e2(node.uri), clone3(node.combinators), node.semicolon);
15787 14685
15788 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody.full(node.functionDefinition, clone2(node.expres sion), node.semicolon); 14686 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody(node.functionDefinition, clone2(node.expression) , node.semicolon);
15789 14687
15790 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement.full(clone2(node.expression), node.semicolon); 14688 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement(clone2(node.expression), node.semicolon);
15791 14689
15792 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause.full (node.keyword, clone2(node.superclass)); 14690 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(node .keyword, clone2(node.superclass));
15793 14691
15794 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration.full(clone2(node.documentationComment), clone3(node.metadata), node.stat icKeyword, clone2(node.fields), node.semicolon); 14692 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration(clone2(node.documentationComment), clone3(node.metadata), node.staticKey word, clone2(node.fields), node.semicolon);
15795 14693
15796 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter.full(clone2(node.documentationComment), clone3(node.meta data), node.keyword, clone2(node.type), node.thisToken, node.period, clone2(node .identifier), clone2(node.parameters)); 14694 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter(clone2(node.documentationComment), clone3(node.metadata) , node.keyword, clone2(node.type), node.thisToken, node.period, clone2(node.iden tifier), clone2(node.parameters));
15797 14695
15798 ForEachStatement visitForEachStatement(ForEachStatement node) { 14696 ForEachStatement visitForEachStatement(ForEachStatement node) {
15799 DeclaredIdentifier loopVariable = node.loopVariable; 14697 DeclaredIdentifier loopVariable = node.loopVariable;
15800 if (loopVariable == null) { 14698 if (loopVariable == null) {
15801 return new ForEachStatement.con2_full(node.forKeyword, node.leftParenthesi s, clone2(node.identifier), node.inKeyword, clone2(node.iterator), node.rightPar enthesis, clone2(node.body)); 14699 return new ForEachStatement.con2(node.forKeyword, node.leftParenthesis, cl one2(node.identifier), node.inKeyword, clone2(node.iterator), node.rightParenthe sis, clone2(node.body));
15802 } 14700 }
15803 return new ForEachStatement.con1_full(node.forKeyword, node.leftParenthesis, clone2(loopVariable), node.inKeyword, clone2(node.iterator), node.rightParenthe sis, clone2(node.body)); 14701 return new ForEachStatement.con1(node.forKeyword, node.leftParenthesis, clon e2(loopVariable), node.inKeyword, clone2(node.iterator), node.rightParenthesis, clone2(node.body));
15804 } 14702 }
15805 14703
15806 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList.full(node.leftParenthesis, clone3(node.parameters), node.lef tDelimiter, node.rightDelimiter, node.rightParenthesis); 14704 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList(node.leftParenthesis, clone3(node.parameters), node.leftDeli miter, node.rightDelimiter, node.rightParenthesis);
15807 14705
15808 ForStatement visitForStatement(ForStatement node) => new ForStatement.full(nod e.forKeyword, node.leftParenthesis, clone2(node.variables), clone2(node.initiali zation), node.leftSeparator, clone2(node.condition), node.rightSeparator, clone3 (node.updaters), node.rightParenthesis, clone2(node.body)); 14706 ForStatement visitForStatement(ForStatement node) => new ForStatement(node.for Keyword, node.leftParenthesis, clone2(node.variables), clone2(node.initializatio n), node.leftSeparator, clone2(node.condition), node.rightSeparator, clone3(node .updaters), node.rightParenthesis, clone2(node.body));
15809 14707
15810 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration.full(clone2(node.documentationComment), clone3(node.metadata ), node.externalKeyword, clone2(node.returnType), node.propertyKeyword, clone2(n ode.name), clone2(node.functionExpression)); 14708 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration(clone2(node.documentationComment), clone3(node.metadata), no de.externalKeyword, clone2(node.returnType), node.propertyKeyword, clone2(node.n ame), clone2(node.functionExpression));
15811 14709
15812 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara tionStatement node) => new FunctionDeclarationStatement.full(clone2(node.functio nDeclaration)); 14710 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara tionStatement node) => new FunctionDeclarationStatement(clone2(node.functionDecl aration));
15813 14711
15814 FunctionExpression visitFunctionExpression(FunctionExpression node) => new Fun ctionExpression.full(clone2(node.parameters), clone2(node.body)); 14712 FunctionExpression visitFunctionExpression(FunctionExpression node) => new Fun ctionExpression(clone2(node.parameters), clone2(node.body));
15815 14713
15816 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress ionInvocation node) => new FunctionExpressionInvocation.full(clone2(node.functio n), clone2(node.argumentList)); 14714 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress ionInvocation node) => new FunctionExpressionInvocation(clone2(node.function), c lone2(node.argumentList));
15817 14715
15818 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi onTypeAlias.full(clone2(node.documentationComment), clone3(node.metadata), node. keyword, clone2(node.returnType), clone2(node.name), clone2(node.typeParameters) , clone2(node.parameters), node.semicolon); 14716 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi onTypeAlias(clone2(node.documentationComment), clone3(node.metadata), node.keywo rd, clone2(node.returnType), clone2(node.name), clone2(node.typeParameters), clo ne2(node.parameters), node.semicolon);
15819 14717
15820 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo rmalParameter node) => new FunctionTypedFormalParameter.full(clone2(node.documen tationComment), clone3(node.metadata), clone2(node.returnType), clone2(node.iden tifier), clone2(node.parameters)); 14718 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo rmalParameter node) => new FunctionTypedFormalParameter(clone2(node.documentatio nComment), clone3(node.metadata), clone2(node.returnType), clone2(node.identifie r), clone2(node.parameters));
15821 14719
15822 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator. full(node.keyword, clone3(node.hiddenNames)); 14720 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( node.keyword, clone3(node.hiddenNames));
15823 14721
15824 IfStatement visitIfStatement(IfStatement node) => new IfStatement.full(node.if Keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthesis, cl one2(node.thenStatement), node.elseKeyword, clone2(node.elseStatement)); 14722 IfStatement visitIfStatement(IfStatement node) => new IfStatement(node.ifKeywo rd, node.leftParenthesis, clone2(node.condition), node.rightParenthesis, clone2( node.thenStatement), node.elseKeyword, clone2(node.elseStatement));
15825 14723
15826 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement sClause.full(node.keyword, clone3(node.interfaces)); 14724 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement sClause(node.keyword, clone3(node.interfaces));
15827 14725
15828 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect ive.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.uri), node.asToken, clone2(node.prefix), clone3(node.combinators), node.semicolon); 14726 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect ive(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clon e2(node.uri), node.asToken, clone2(node.prefix), clone3(node.combinators), node. semicolon);
15829 14727
15830 IndexExpression visitIndexExpression(IndexExpression node) { 14728 IndexExpression visitIndexExpression(IndexExpression node) {
15831 Token period = node.period; 14729 Token period = node.period;
15832 if (period == null) { 14730 if (period == null) {
15833 return new IndexExpression.forTarget_full(clone2(node.target), node.leftBr acket, clone2(node.index), node.rightBracket); 14731 return new IndexExpression.forTarget(clone2(node.target), node.leftBracket , clone2(node.index), node.rightBracket);
15834 } else { 14732 } else {
15835 return new IndexExpression.forCascade_full(period, node.leftBracket, clone 2(node.index), node.rightBracket); 14733 return new IndexExpression.forCascade(period, node.leftBracket, clone2(nod e.index), node.rightBracket);
15836 } 14734 }
15837 } 14735 }
15838 14736
15839 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp ression node) => new InstanceCreationExpression.full(node.keyword, clone2(node.c onstructorName), clone2(node.argumentList)); 14737 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp ression node) => new InstanceCreationExpression(node.keyword, clone2(node.constr uctorName), clone2(node.argumentList));
15840 14738
15841 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => new IntegerLiteral. full(node.literal, node.value); 14739 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => new IntegerLiteral( node.literal, node.value);
15842 14740
15843 InterpolationExpression visitInterpolationExpression(InterpolationExpression n ode) => new InterpolationExpression.full(node.leftBracket, clone2(node.expressio n), node.rightBracket); 14741 InterpolationExpression visitInterpolationExpression(InterpolationExpression n ode) => new InterpolationExpression(node.leftBracket, clone2(node.expression), n ode.rightBracket);
15844 14742
15845 InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString.full(node.contents, node.value); 14743 InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString(node.contents, node.value);
15846 14744
15847 IsExpression visitIsExpression(IsExpression node) => new IsExpression.full(clo ne2(node.expression), node.isOperator, node.notOperator, clone2(node.type)); 14745 IsExpression visitIsExpression(IsExpression node) => new IsExpression(clone2(n ode.expression), node.isOperator, node.notOperator, clone2(node.type));
15848 14746
15849 Label visitLabel(Label node) => new Label.full(clone2(node.label), node.colon) ; 14747 Label visitLabel(Label node) => new Label(clone2(node.label), node.colon);
15850 14748
15851 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt atement.full(clone3(node.labels), clone2(node.statement)); 14749 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt atement(clone3(node.labels), clone2(node.statement));
15852 14750
15853 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi rective.full(clone2(node.documentationComment), clone3(node.metadata), node.libr aryToken, clone2(node.name), node.semicolon); 14751 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi rective(clone2(node.documentationComment), clone3(node.metadata), node.libraryTo ken, clone2(node.name), node.semicolon);
15854 14752
15855 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => new Librar yIdentifier.full(clone3(node.components)); 14753 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => new Librar yIdentifier(clone3(node.components));
15856 14754
15857 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral.full(node.co nstKeyword, clone2(node.typeArguments), node.leftBracket, clone3(node.elements), node.rightBracket); 14755 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral(node.constKe yword, clone2(node.typeArguments), node.leftBracket, clone3(node.elements), node .rightBracket);
15858 14756
15859 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral.full(node.constK eyword, clone2(node.typeArguments), node.leftBracket, clone3(node.entries), node .rightBracket); 14757 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral(node.constKeywor d, clone2(node.typeArguments), node.leftBracket, clone3(node.entries), node.righ tBracket);
15860 14758
15861 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn try.full(clone2(node.key), node.separator, clone2(node.value)); 14759 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn try(clone2(node.key), node.separator, clone2(node.value));
15862 14760
15863 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method Declaration.full(clone2(node.documentationComment), clone3(node.metadata), node. externalKeyword, node.modifierKeyword, clone2(node.returnType), node.propertyKey word, node.operatorKeyword, clone2(node.name), clone2(node.parameters), clone2(n ode.body)); 14761 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method Declaration(clone2(node.documentationComment), clone3(node.metadata), node.exter nalKeyword, node.modifierKeyword, clone2(node.returnType), node.propertyKeyword, node.operatorKeyword, clone2(node.name), clone2(node.parameters), clone2(node.b ody));
15864 14762
15865 MethodInvocation visitMethodInvocation(MethodInvocation node) => new MethodInv ocation.full(clone2(node.target), node.period, clone2(node.methodName), clone2(n ode.argumentList)); 14763 MethodInvocation visitMethodInvocation(MethodInvocation node) => new MethodInv ocation(clone2(node.target), node.period, clone2(node.methodName), clone2(node.a rgumentList));
15866 14764
15867 NamedExpression visitNamedExpression(NamedExpression node) => new NamedExpress ion.full(clone2(node.name), clone2(node.expression)); 14765 NamedExpression visitNamedExpression(NamedExpression node) => new NamedExpress ion(clone2(node.name), clone2(node.expression));
15868 14766
15869 ASTNode visitNativeClause(NativeClause node) => new NativeClause.full(node.key word, clone2(node.name)); 14767 ASTNode visitNativeClause(NativeClause node) => new NativeClause(node.keyword, clone2(node.name));
15870 14768
15871 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat iveFunctionBody.full(node.nativeToken, clone2(node.stringLiteral), node.semicolo n); 14769 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat iveFunctionBody(node.nativeToken, clone2(node.stringLiteral), node.semicolon);
15872 14770
15873 NullLiteral visitNullLiteral(NullLiteral node) => new NullLiteral.full(node.li teral); 14771 NullLiteral visitNullLiteral(NullLiteral node) => new NullLiteral(node.literal );
15874 14772
15875 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n ode) => new ParenthesizedExpression.full(node.leftParenthesis, clone2(node.expre ssion), node.rightParenthesis); 14773 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n ode) => new ParenthesizedExpression(node.leftParenthesis, clone2(node.expression ), node.rightParenthesis);
15876 14774
15877 PartDirective visitPartDirective(PartDirective node) => new PartDirective.full (clone2(node.documentationComment), clone3(node.metadata), node.partToken, clone 2(node.uri), node.semicolon); 14775 PartDirective visitPartDirective(PartDirective node) => new PartDirective(clon e2(node.documentationComment), clone3(node.metadata), node.partToken, clone2(nod e.uri), node.semicolon);
15878 14776
15879 PartOfDirective visitPartOfDirective(PartOfDirective node) => new PartOfDirect ive.full(clone2(node.documentationComment), clone3(node.metadata), node.partToke n, node.ofToken, clone2(node.libraryName), node.semicolon); 14777 PartOfDirective visitPartOfDirective(PartOfDirective node) => new PartOfDirect ive(clone2(node.documentationComment), clone3(node.metadata), node.partToken, no de.ofToken, clone2(node.libraryName), node.semicolon);
15880 14778
15881 PostfixExpression visitPostfixExpression(PostfixExpression node) => new Postfi xExpression.full(clone2(node.operand), node.operator); 14779 PostfixExpression visitPostfixExpression(PostfixExpression node) => new Postfi xExpression(clone2(node.operand), node.operator);
15882 14780
15883 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => new Pre fixedIdentifier.full(clone2(node.prefix), node.period, clone2(node.identifier)); 14781 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => new Pre fixedIdentifier(clone2(node.prefix), node.period, clone2(node.identifier));
15884 14782
15885 PrefixExpression visitPrefixExpression(PrefixExpression node) => new PrefixExp ression.full(node.operator, clone2(node.operand)); 14783 PrefixExpression visitPrefixExpression(PrefixExpression node) => new PrefixExp ression(node.operator, clone2(node.operand));
15886 14784
15887 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess. full(clone2(node.target), node.operator, clone2(node.propertyName)); 14785 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess( clone2(node.target), node.operator, clone2(node.propertyName));
15888 14786
15889 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec tingConstructorInvocation node) => new RedirectingConstructorInvocation.full(nod e.keyword, node.period, clone2(node.constructorName), clone2(node.argumentList)) ; 14787 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec tingConstructorInvocation node) => new RedirectingConstructorInvocation(node.key word, node.period, clone2(node.constructorName), clone2(node.argumentList));
15890 14788
15891 RethrowExpression visitRethrowExpression(RethrowExpression node) => new Rethro wExpression.full(node.keyword); 14789 RethrowExpression visitRethrowExpression(RethrowExpression node) => new Rethro wExpression(node.keyword);
15892 14790
15893 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent.full(node.keyword, clone2(node.expression), node.semicolon); 14791 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent(node.keyword, clone2(node.expression), node.semicolon);
15894 14792
15895 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag.full(node.scriptTag) ; 14793 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag(node.scriptTag);
15896 14794
15897 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator. full(node.keyword, clone3(node.shownNames)); 14795 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( node.keyword, clone3(node.shownNames));
15898 14796
15899 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter.full(clone2(node.documentationComment), clone3(node. metadata), node.keyword, clone2(node.type), clone2(node.identifier)); 14797 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter(clone2(node.documentationComment), clone3(node.metad ata), node.keyword, clone2(node.type), clone2(node.identifier));
15900 14798
15901 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => new SimpleIde ntifier.full(node.token); 14799 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => new SimpleIde ntifier(node.token);
15902 14800
15903 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => new SimpleStringLiteral.full(node.literal, node.value); 14801 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => new SimpleStringLiteral(node.literal, node.value);
15904 14802
15905 StringInterpolation visitStringInterpolation(StringInterpolation node) => new StringInterpolation.full(clone3(node.elements)); 14803 StringInterpolation visitStringInterpolation(StringInterpolation node) => new StringInterpolation(clone3(node.elements));
15906 14804
15907 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv ocation node) => new SuperConstructorInvocation.full(node.keyword, node.period, clone2(node.constructorName), clone2(node.argumentList)); 14805 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv ocation node) => new SuperConstructorInvocation(node.keyword, node.period, clone 2(node.constructorName), clone2(node.argumentList));
15908 14806
15909 SuperExpression visitSuperExpression(SuperExpression node) => new SuperExpress ion.full(node.keyword); 14807 SuperExpression visitSuperExpression(SuperExpression node) => new SuperExpress ion(node.keyword);
15910 14808
15911 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase.full(clone3(node .labels), node.keyword, clone2(node.expression), node.colon, clone3(node.stateme nts)); 14809 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(clone3(node.labe ls), node.keyword, clone2(node.expression), node.colon, clone3(node.statements)) ;
15912 14810
15913 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault.full (clone3(node.labels), node.keyword, node.colon, clone3(node.statements)); 14811 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(clon e3(node.labels), node.keyword, node.colon, clone3(node.statements));
15914 14812
15915 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem ent.full(node.keyword, node.leftParenthesis, clone2(node.expression), node.right Parenthesis, node.leftBracket, clone3(node.members), node.rightBracket); 14813 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem ent(node.keyword, node.leftParenthesis, clone2(node.expression), node.rightParen thesis, node.leftBracket, clone3(node.members), node.rightBracket);
15916 14814
15917 ASTNode visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral.full(node. poundSign, node.components); 14815 ASTNode visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral(node.pound Sign, node.components);
15918 14816
15919 ThisExpression visitThisExpression(ThisExpression node) => new ThisExpression. full(node.keyword); 14817 ThisExpression visitThisExpression(ThisExpression node) => new ThisExpression( node.keyword);
15920 14818
15921 ThrowExpression visitThrowExpression(ThrowExpression node) => new ThrowExpress ion.full(node.keyword, clone2(node.expression)); 14819 ThrowExpression visitThrowExpression(ThrowExpression node) => new ThrowExpress ion(node.keyword, clone2(node.expression));
15922 14820
15923 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD eclaration node) => new TopLevelVariableDeclaration.full(clone2(node.documentati onComment), clone3(node.metadata), clone2(node.variables), node.semicolon); 14821 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD eclaration node) => new TopLevelVariableDeclaration(clone2(node.documentationCom ment), clone3(node.metadata), clone2(node.variables), node.semicolon);
15924 14822
15925 TryStatement visitTryStatement(TryStatement node) => new TryStatement.full(nod e.tryKeyword, clone2(node.body), clone3(node.catchClauses), node.finallyKeyword, clone2(node.finallyBlock)); 14823 TryStatement visitTryStatement(TryStatement node) => new TryStatement(node.try Keyword, clone2(node.body), clone3(node.catchClauses), node.finallyKeyword, clon e2(node.finallyBlock));
15926 14824
15927 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum entList.full(node.leftBracket, clone3(node.arguments), node.rightBracket); 14825 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum entList(node.leftBracket, clone3(node.arguments), node.rightBracket);
15928 14826
15929 TypeName visitTypeName(TypeName node) => new TypeName.full(clone2(node.name), clone2(node.typeArguments)); 14827 TypeName visitTypeName(TypeName node) => new TypeName(clone2(node.name), clone 2(node.typeArguments));
15930 14828
15931 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter.full (clone2(node.documentationComment), clone3(node.metadata), clone2(node.name), no de.keyword, clone2(node.bound)); 14829 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(clon e2(node.documentationComment), clone3(node.metadata), clone2(node.name), node.ke yword, clone2(node.bound));
15932 14830
15933 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa rameterList.full(node.leftBracket, clone3(node.typeParameters), node.rightBracke t); 14831 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa rameterList(node.leftBracket, clone3(node.typeParameters), node.rightBracket);
15934 14832
15935 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration.full(null, clone3(node.metadata), clone2(node.name), node.eq uals, clone2(node.initializer)); 14833 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration(null, clone3(node.metadata), clone2(node.name), node.equals, clone2(node.initializer));
15936 14834
15937 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n ode) => new VariableDeclarationList.full(null, clone3(node.metadata), node.keywo rd, clone2(node.type), clone3(node.variables)); 14835 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n ode) => new VariableDeclarationList(null, clone3(node.metadata), node.keyword, c lone2(node.type), clone3(node.variables));
15938 14836
15939 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement.full(clone2(node.variabl es), node.semicolon); 14837 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement(clone2(node.variables), node.semicolon);
15940 14838
15941 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement. full(node.keyword, node.leftParenthesis, clone2(node.condition), node.rightParen thesis, clone2(node.body)); 14839 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( node.keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthesi s, clone2(node.body));
15942 14840
15943 WithClause visitWithClause(WithClause node) => new WithClause.full(node.withKe yword, clone3(node.mixinTypes)); 14841 WithClause visitWithClause(WithClause node) => new WithClause(node.withKeyword , clone3(node.mixinTypes));
15944 14842
15945 ASTNode clone2(ASTNode node) { 14843 ASTNode clone2(ASTNode node) {
15946 if (node == null) { 14844 if (node == null) {
15947 return null; 14845 return null;
15948 } 14846 }
15949 return node.accept(this) as ASTNode; 14847 return node.accept(this) as ASTNode;
15950 } 14848 }
15951 14849
15952 List clone3(NodeList nodes) { 14850 List clone3(NodeList nodes) {
15953 int count = nodes.length; 14851 int count = nodes.length;
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
16611 * @param oldNode the node to be replaced 15509 * @param oldNode the node to be replaced
16612 * @param newNode the replacement node 15510 * @param newNode the replacement node
16613 * @param tokenMap a mapping of old tokens to new tokens (not `null`) 15511 * @param tokenMap a mapping of old tokens to new tokens (not `null`)
16614 */ 15512 */
16615 IncrementalASTCloner(ASTNode oldNode, ASTNode newNode, TokenMap tokenMap) { 15513 IncrementalASTCloner(ASTNode oldNode, ASTNode newNode, TokenMap tokenMap) {
16616 this._oldNode = oldNode; 15514 this._oldNode = oldNode;
16617 this._newNode = newNode; 15515 this._newNode = newNode;
16618 this._tokenMap = tokenMap; 15516 this._tokenMap = tokenMap;
16619 } 15517 }
16620 15518
16621 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs.full(clone5(node.strings)); 15519 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs(clone5(node.strings));
16622 15520
16623 Annotation visitAnnotation(Annotation node) { 15521 Annotation visitAnnotation(Annotation node) {
16624 Annotation copy = new Annotation.full(map(node.atSign), clone4(node.name), m ap(node.period), clone4(node.constructorName), clone4(node.arguments)); 15522 Annotation copy = new Annotation(map(node.atSign), clone4(node.name), map(no de.period), clone4(node.constructorName), clone4(node.arguments));
16625 copy.element = node.element; 15523 copy.element = node.element;
16626 return copy; 15524 return copy;
16627 } 15525 }
16628 15526
16629 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) { 15527 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) {
16630 ArgumentDefinitionTest copy = new ArgumentDefinitionTest.full(map(node.quest ion), clone4(node.identifier)); 15528 ArgumentDefinitionTest copy = new ArgumentDefinitionTest(map(node.question), clone4(node.identifier));
16631 copy.propagatedType = node.propagatedType; 15529 copy.propagatedType = node.propagatedType;
16632 copy.staticType = node.staticType; 15530 copy.staticType = node.staticType;
16633 return copy; 15531 return copy;
16634 } 15532 }
16635 15533
16636 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList.full(map (node.leftParenthesis), clone5(node.arguments), map(node.rightParenthesis)); 15534 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(map(node .leftParenthesis), clone5(node.arguments), map(node.rightParenthesis));
16637 15535
16638 AsExpression visitAsExpression(AsExpression node) { 15536 AsExpression visitAsExpression(AsExpression node) {
16639 AsExpression copy = new AsExpression.full(clone4(node.expression), map(node. asOperator), clone4(node.type)); 15537 AsExpression copy = new AsExpression(clone4(node.expression), map(node.asOpe rator), clone4(node.type));
16640 copy.propagatedType = node.propagatedType; 15538 copy.propagatedType = node.propagatedType;
16641 copy.staticType = node.staticType; 15539 copy.staticType = node.staticType;
16642 return copy; 15540 return copy;
16643 } 15541 }
16644 15542
16645 ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement.full (map(node.keyword), map(node.leftParenthesis), clone4(node.condition), map(node. rightParenthesis), map(node.semicolon)); 15543 ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement(map( node.keyword), map(node.leftParenthesis), clone4(node.condition), map(node.right Parenthesis), map(node.semicolon));
16646 15544
16647 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) { 15545 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) {
16648 AssignmentExpression copy = new AssignmentExpression.full(clone4(node.leftHa ndSide), map(node.operator), clone4(node.rightHandSide)); 15546 AssignmentExpression copy = new AssignmentExpression(clone4(node.leftHandSid e), map(node.operator), clone4(node.rightHandSide));
16649 copy.propagatedElement = node.propagatedElement; 15547 copy.propagatedElement = node.propagatedElement;
16650 copy.propagatedType = node.propagatedType; 15548 copy.propagatedType = node.propagatedType;
16651 copy.staticElement = node.staticElement; 15549 copy.staticElement = node.staticElement;
16652 copy.staticType = node.staticType; 15550 copy.staticType = node.staticType;
16653 return copy; 15551 return copy;
16654 } 15552 }
16655 15553
16656 BinaryExpression visitBinaryExpression(BinaryExpression node) { 15554 BinaryExpression visitBinaryExpression(BinaryExpression node) {
16657 BinaryExpression copy = new BinaryExpression.full(clone4(node.leftOperand), map(node.operator), clone4(node.rightOperand)); 15555 BinaryExpression copy = new BinaryExpression(clone4(node.leftOperand), map(n ode.operator), clone4(node.rightOperand));
16658 copy.propagatedElement = node.propagatedElement; 15556 copy.propagatedElement = node.propagatedElement;
16659 copy.propagatedType = node.propagatedType; 15557 copy.propagatedType = node.propagatedType;
16660 copy.staticElement = node.staticElement; 15558 copy.staticElement = node.staticElement;
16661 copy.staticType = node.staticType; 15559 copy.staticType = node.staticType;
16662 return copy; 15560 return copy;
16663 } 15561 }
16664 15562
16665 Block visitBlock(Block node) => new Block.full(map(node.leftBracket), clone5(n ode.statements), map(node.rightBracket)); 15563 Block visitBlock(Block node) => new Block(map(node.leftBracket), clone5(node.s tatements), map(node.rightBracket));
16666 15564
16667 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody.full(clone4(node.block)); 15565 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody(clone4(node.block));
16668 15566
16669 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) { 15567 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) {
16670 BooleanLiteral copy = new BooleanLiteral.full(map(node.literal), node.value) ; 15568 BooleanLiteral copy = new BooleanLiteral(map(node.literal), node.value);
16671 copy.propagatedType = node.propagatedType; 15569 copy.propagatedType = node.propagatedType;
16672 copy.staticType = node.staticType; 15570 copy.staticType = node.staticType;
16673 return copy; 15571 return copy;
16674 } 15572 }
16675 15573
16676 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement. full(map(node.keyword), clone4(node.label), map(node.semicolon)); 15574 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( map(node.keyword), clone4(node.label), map(node.semicolon));
16677 15575
16678 CascadeExpression visitCascadeExpression(CascadeExpression node) { 15576 CascadeExpression visitCascadeExpression(CascadeExpression node) {
16679 CascadeExpression copy = new CascadeExpression.full(clone4(node.target), clo ne5(node.cascadeSections)); 15577 CascadeExpression copy = new CascadeExpression(clone4(node.target), clone5(n ode.cascadeSections));
16680 copy.propagatedType = node.propagatedType; 15578 copy.propagatedType = node.propagatedType;
16681 copy.staticType = node.staticType; 15579 copy.staticType = node.staticType;
16682 return copy; 15580 return copy;
16683 } 15581 }
16684 15582
16685 CatchClause visitCatchClause(CatchClause node) => new CatchClause.full(map(nod e.onKeyword), clone4(node.exceptionType), map(node.catchKeyword), map(node.leftP arenthesis), clone4(node.exceptionParameter), map(node.comma), clone4(node.stack TraceParameter), map(node.rightParenthesis), clone4(node.body)); 15583 CatchClause visitCatchClause(CatchClause node) => new CatchClause(map(node.onK eyword), clone4(node.exceptionType), map(node.catchKeyword), map(node.leftParent hesis), clone4(node.exceptionParameter), map(node.comma), clone4(node.stackTrace Parameter), map(node.rightParenthesis), clone4(node.body));
16686 15584
16687 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { 15585 ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
16688 ClassDeclaration copy = new ClassDeclaration.full(clone4(node.documentationC omment), clone5(node.metadata), map(node.abstractKeyword), map(node.classKeyword ), clone4(node.name), clone4(node.typeParameters), clone4(node.extendsClause), c lone4(node.withClause), clone4(node.implementsClause), map(node.leftBracket), cl one5(node.members), map(node.rightBracket)); 15586 ClassDeclaration copy = new ClassDeclaration(clone4(node.documentationCommen t), clone5(node.metadata), map(node.abstractKeyword), map(node.classKeyword), cl one4(node.name), clone4(node.typeParameters), clone4(node.extendsClause), clone4 (node.withClause), clone4(node.implementsClause), map(node.leftBracket), clone5( node.members), map(node.rightBracket));
16689 copy.nativeClause = clone4(node.nativeClause); 15587 copy.nativeClause = clone4(node.nativeClause);
16690 return copy; 15588 return copy;
16691 } 15589 }
16692 15590
16693 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias. full(clone4(node.documentationComment), clone5(node.metadata), map(node.keyword) , clone4(node.name), clone4(node.typeParameters), map(node.equals), map(node.abs tractKeyword), clone4(node.superclass), clone4(node.withClause), clone4(node.imp lementsClause), map(node.semicolon)); 15591 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias( clone4(node.documentationComment), clone5(node.metadata), map(node.keyword), clo ne4(node.name), clone4(node.typeParameters), map(node.equals), map(node.abstract Keyword), clone4(node.superclass), clone4(node.withClause), clone4(node.implemen tsClause), map(node.semicolon));
16694 15592
16695 Comment visitComment(Comment node) { 15593 Comment visitComment(Comment node) {
16696 if (node.isDocumentation) { 15594 if (node.isDocumentation) {
16697 return Comment.createDocumentationComment2(map2(node.tokens), clone5(node. references)); 15595 return Comment.createDocumentationComment2(map2(node.tokens), clone5(node. references));
16698 } else if (node.isBlock) { 15596 } else if (node.isBlock) {
16699 return Comment.createBlockComment(map2(node.tokens)); 15597 return Comment.createBlockComment(map2(node.tokens));
16700 } 15598 }
16701 return Comment.createEndOfLineComment(map2(node.tokens)); 15599 return Comment.createEndOfLineComment(map2(node.tokens));
16702 } 15600 }
16703 15601
16704 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference.full(map(node.newKeyword), clone4(node.identifier)); 15602 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference(map(node.newKeyword), clone4(node.identifier));
16705 15603
16706 CompilationUnit visitCompilationUnit(CompilationUnit node) { 15604 CompilationUnit visitCompilationUnit(CompilationUnit node) {
16707 CompilationUnit copy = new CompilationUnit.full(map(node.beginToken), clone4 (node.scriptTag), clone5(node.directives), clone5(node.declarations), map(node.e ndToken)); 15605 CompilationUnit copy = new CompilationUnit(map(node.beginToken), clone4(node .scriptTag), clone5(node.directives), clone5(node.declarations), map(node.endTok en));
16708 copy.lineInfo = node.lineInfo; 15606 copy.lineInfo = node.lineInfo;
16709 copy.element = node.element; 15607 copy.element = node.element;
16710 return copy; 15608 return copy;
16711 } 15609 }
16712 15610
16713 ConditionalExpression visitConditionalExpression(ConditionalExpression node) { 15611 ConditionalExpression visitConditionalExpression(ConditionalExpression node) {
16714 ConditionalExpression copy = new ConditionalExpression.full(clone4(node.cond ition), map(node.question), clone4(node.thenExpression), map(node.colon), clone4 (node.elseExpression)); 15612 ConditionalExpression copy = new ConditionalExpression(clone4(node.condition ), map(node.question), clone4(node.thenExpression), map(node.colon), clone4(node .elseExpression));
16715 copy.propagatedType = node.propagatedType; 15613 copy.propagatedType = node.propagatedType;
16716 copy.staticType = node.staticType; 15614 copy.staticType = node.staticType;
16717 return copy; 15615 return copy;
16718 } 15616 }
16719 15617
16720 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node ) { 15618 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node ) {
16721 ConstructorDeclaration copy = new ConstructorDeclaration.full(clone4(node.do cumentationComment), clone5(node.metadata), map(node.externalKeyword), map(node. constKeyword), map(node.factoryKeyword), clone4(node.returnType), map(node.perio d), clone4(node.name), clone4(node.parameters), map(node.separator), clone5(node .initializers), clone4(node.redirectedConstructor), clone4(node.body)); 15619 ConstructorDeclaration copy = new ConstructorDeclaration(clone4(node.documen tationComment), clone5(node.metadata), map(node.externalKeyword), map(node.const Keyword), map(node.factoryKeyword), clone4(node.returnType), map(node.period), c lone4(node.name), clone4(node.parameters), map(node.separator), clone5(node.init ializers), clone4(node.redirectedConstructor), clone4(node.body));
16722 copy.element = node.element; 15620 copy.element = node.element;
16723 return copy; 15621 return copy;
16724 } 15622 }
16725 15623
16726 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI nitializer node) => new ConstructorFieldInitializer.full(map(node.keyword), map( node.period), clone4(node.fieldName), map(node.equals), clone4(node.expression)) ; 15624 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI nitializer node) => new ConstructorFieldInitializer(map(node.keyword), map(node. period), clone4(node.fieldName), map(node.equals), clone4(node.expression));
16727 15625
16728 ConstructorName visitConstructorName(ConstructorName node) { 15626 ConstructorName visitConstructorName(ConstructorName node) {
16729 ConstructorName copy = new ConstructorName.full(clone4(node.type), map(node. period), clone4(node.name)); 15627 ConstructorName copy = new ConstructorName(clone4(node.type), map(node.perio d), clone4(node.name));
16730 copy.staticElement = node.staticElement; 15628 copy.staticElement = node.staticElement;
16731 return copy; 15629 return copy;
16732 } 15630 }
16733 15631
16734 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin ueStatement.full(map(node.keyword), clone4(node.label), map(node.semicolon)); 15632 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin ueStatement(map(node.keyword), clone4(node.label), map(node.semicolon));
16735 15633
16736 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec laredIdentifier.full(clone4(node.documentationComment), clone5(node.metadata), m ap(node.keyword), clone4(node.type), clone4(node.identifier)); 15634 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec laredIdentifier(clone4(node.documentationComment), clone5(node.metadata), map(no de.keyword), clone4(node.type), clone4(node.identifier));
16737 15635
16738 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node ) => new DefaultFormalParameter.full(clone4(node.parameter), node.kind, map(node .separator), clone4(node.defaultValue)); 15636 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node ) => new DefaultFormalParameter(clone4(node.parameter), node.kind, map(node.sepa rator), clone4(node.defaultValue));
16739 15637
16740 DoStatement visitDoStatement(DoStatement node) => new DoStatement.full(map(nod e.doKeyword), clone4(node.body), map(node.whileKeyword), map(node.leftParenthesi s), clone4(node.condition), map(node.rightParenthesis), map(node.semicolon)); 15638 DoStatement visitDoStatement(DoStatement node) => new DoStatement(map(node.doK eyword), clone4(node.body), map(node.whileKeyword), map(node.leftParenthesis), c lone4(node.condition), map(node.rightParenthesis), map(node.semicolon));
16741 15639
16742 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) { 15640 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) {
16743 DoubleLiteral copy = new DoubleLiteral.full(map(node.literal), node.value); 15641 DoubleLiteral copy = new DoubleLiteral(map(node.literal), node.value);
16744 copy.propagatedType = node.propagatedType; 15642 copy.propagatedType = node.propagatedType;
16745 copy.staticType = node.staticType; 15643 copy.staticType = node.staticType;
16746 return copy; 15644 return copy;
16747 } 15645 }
16748 15646
16749 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF unctionBody.full(map(node.semicolon)); 15647 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF unctionBody(map(node.semicolon));
16750 15648
16751 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement. full(map(node.semicolon)); 15649 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement( map(node.semicolon));
16752 15650
16753 ExportDirective visitExportDirective(ExportDirective node) { 15651 ExportDirective visitExportDirective(ExportDirective node) {
16754 ExportDirective copy = new ExportDirective.full(clone4(node.documentationCom ment), clone5(node.metadata), map(node.keyword), clone4(node.uri), clone5(node.c ombinators), map(node.semicolon)); 15652 ExportDirective copy = new ExportDirective(clone4(node.documentationComment) , clone5(node.metadata), map(node.keyword), clone4(node.uri), clone5(node.combin ators), map(node.semicolon));
16755 copy.element = node.element; 15653 copy.element = node.element;
16756 return copy; 15654 return copy;
16757 } 15655 }
16758 15656
16759 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody.full(map(node.functionDefinition), clone4(node.e xpression), map(node.semicolon)); 15657 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody(map(node.functionDefinition), clone4(node.expres sion), map(node.semicolon));
16760 15658
16761 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement.full(clone4(node.expression), map(node.semicolon)); 15659 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement(clone4(node.expression), map(node.semicolon));
16762 15660
16763 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause.full (map(node.keyword), clone4(node.superclass)); 15661 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(map( node.keyword), clone4(node.superclass));
16764 15662
16765 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration.full(clone4(node.documentationComment), clone5(node.metadata), map(node. staticKeyword), clone4(node.fields), map(node.semicolon)); 15663 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration(clone4(node.documentationComment), clone5(node.metadata), map(node.stati cKeyword), clone4(node.fields), map(node.semicolon));
16766 15664
16767 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter.full(clone4(node.documentationComment), clone5(node.meta data), map(node.keyword), clone4(node.type), map(node.thisToken), map(node.perio d), clone4(node.identifier), clone4(node.parameters)); 15665 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter(clone4(node.documentationComment), clone5(node.metadata) , map(node.keyword), clone4(node.type), map(node.thisToken), map(node.period), c lone4(node.identifier), clone4(node.parameters));
16768 15666
16769 ForEachStatement visitForEachStatement(ForEachStatement node) { 15667 ForEachStatement visitForEachStatement(ForEachStatement node) {
16770 DeclaredIdentifier loopVariable = node.loopVariable; 15668 DeclaredIdentifier loopVariable = node.loopVariable;
16771 if (loopVariable == null) { 15669 if (loopVariable == null) {
16772 return new ForEachStatement.con2_full(map(node.forKeyword), map(node.leftP arenthesis), clone4(node.identifier), map(node.inKeyword), clone4(node.iterator) , map(node.rightParenthesis), clone4(node.body)); 15670 return new ForEachStatement.con2(map(node.forKeyword), map(node.leftParent hesis), clone4(node.identifier), map(node.inKeyword), clone4(node.iterator), map (node.rightParenthesis), clone4(node.body));
16773 } 15671 }
16774 return new ForEachStatement.con1_full(map(node.forKeyword), map(node.leftPar enthesis), clone4(loopVariable), map(node.inKeyword), clone4(node.iterator), map (node.rightParenthesis), clone4(node.body)); 15672 return new ForEachStatement.con1(map(node.forKeyword), map(node.leftParenthe sis), clone4(loopVariable), map(node.inKeyword), clone4(node.iterator), map(node .rightParenthesis), clone4(node.body));
16775 } 15673 }
16776 15674
16777 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList.full(map(node.leftParenthesis), clone5(node.parameters), map (node.leftDelimiter), map(node.rightDelimiter), map(node.rightParenthesis)); 15675 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList(map(node.leftParenthesis), clone5(node.parameters), map(node .leftDelimiter), map(node.rightDelimiter), map(node.rightParenthesis));
16778 15676
16779 ForStatement visitForStatement(ForStatement node) => new ForStatement.full(map (node.forKeyword), map(node.leftParenthesis), clone4(node.variables), clone4(nod e.initialization), map(node.leftSeparator), clone4(node.condition), map(node.rig htSeparator), clone5(node.updaters), map(node.rightParenthesis), clone4(node.bod y)); 15677 ForStatement visitForStatement(ForStatement node) => new ForStatement(map(node .forKeyword), map(node.leftParenthesis), clone4(node.variables), clone4(node.ini tialization), map(node.leftSeparator), clone4(node.condition), map(node.rightSep arator), clone5(node.updaters), map(node.rightParenthesis), clone4(node.body));
16780 15678
16781 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration.full(clone4(node.documentationComment), clone5(node.metadata ), map(node.externalKeyword), clone4(node.returnType), map(node.propertyKeyword) , clone4(node.name), clone4(node.functionExpression)); 15679 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration(clone4(node.documentationComment), clone5(node.metadata), ma p(node.externalKeyword), clone4(node.returnType), map(node.propertyKeyword), clo ne4(node.name), clone4(node.functionExpression));
16782 15680
16783 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara tionStatement node) => new FunctionDeclarationStatement.full(clone4(node.functio nDeclaration)); 15681 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara tionStatement node) => new FunctionDeclarationStatement(clone4(node.functionDecl aration));
16784 15682
16785 FunctionExpression visitFunctionExpression(FunctionExpression node) { 15683 FunctionExpression visitFunctionExpression(FunctionExpression node) {
16786 FunctionExpression copy = new FunctionExpression.full(clone4(node.parameters ), clone4(node.body)); 15684 FunctionExpression copy = new FunctionExpression(clone4(node.parameters), cl one4(node.body));
16787 copy.element = node.element; 15685 copy.element = node.element;
16788 copy.propagatedType = node.propagatedType; 15686 copy.propagatedType = node.propagatedType;
16789 copy.staticType = node.staticType; 15687 copy.staticType = node.staticType;
16790 return copy; 15688 return copy;
16791 } 15689 }
16792 15690
16793 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress ionInvocation node) { 15691 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress ionInvocation node) {
16794 FunctionExpressionInvocation copy = new FunctionExpressionInvocation.full(cl one4(node.function), clone4(node.argumentList)); 15692 FunctionExpressionInvocation copy = new FunctionExpressionInvocation(clone4( node.function), clone4(node.argumentList));
16795 copy.propagatedElement = node.propagatedElement; 15693 copy.propagatedElement = node.propagatedElement;
16796 copy.propagatedType = node.propagatedType; 15694 copy.propagatedType = node.propagatedType;
16797 copy.staticElement = node.staticElement; 15695 copy.staticElement = node.staticElement;
16798 copy.staticType = node.staticType; 15696 copy.staticType = node.staticType;
16799 return copy; 15697 return copy;
16800 } 15698 }
16801 15699
16802 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi onTypeAlias.full(clone4(node.documentationComment), clone5(node.metadata), map(n ode.keyword), clone4(node.returnType), clone4(node.name), clone4(node.typeParame ters), clone4(node.parameters), map(node.semicolon)); 15700 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi onTypeAlias(clone4(node.documentationComment), clone5(node.metadata), map(node.k eyword), clone4(node.returnType), clone4(node.name), clone4(node.typeParameters) , clone4(node.parameters), map(node.semicolon));
16803 15701
16804 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo rmalParameter node) => new FunctionTypedFormalParameter.full(clone4(node.documen tationComment), clone5(node.metadata), clone4(node.returnType), clone4(node.iden tifier), clone4(node.parameters)); 15702 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo rmalParameter node) => new FunctionTypedFormalParameter(clone4(node.documentatio nComment), clone5(node.metadata), clone4(node.returnType), clone4(node.identifie r), clone4(node.parameters));
16805 15703
16806 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator. full(map(node.keyword), clone5(node.hiddenNames)); 15704 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( map(node.keyword), clone5(node.hiddenNames));
16807 15705
16808 IfStatement visitIfStatement(IfStatement node) => new IfStatement.full(map(nod e.ifKeyword), map(node.leftParenthesis), clone4(node.condition), map(node.rightP arenthesis), clone4(node.thenStatement), map(node.elseKeyword), clone4(node.else Statement)); 15706 IfStatement visitIfStatement(IfStatement node) => new IfStatement(map(node.ifK eyword), map(node.leftParenthesis), clone4(node.condition), map(node.rightParent hesis), clone4(node.thenStatement), map(node.elseKeyword), clone4(node.elseState ment));
16809 15707
16810 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement sClause.full(map(node.keyword), clone5(node.interfaces)); 15708 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement sClause(map(node.keyword), clone5(node.interfaces));
16811 15709
16812 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect ive.full(clone4(node.documentationComment), clone5(node.metadata), map(node.keyw ord), clone4(node.uri), map(node.asToken), clone4(node.prefix), clone5(node.comb inators), map(node.semicolon)); 15710 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect ive(clone4(node.documentationComment), clone5(node.metadata), map(node.keyword), clone4(node.uri), map(node.asToken), clone4(node.prefix), clone5(node.combinato rs), map(node.semicolon));
16813 15711
16814 IndexExpression visitIndexExpression(IndexExpression node) { 15712 IndexExpression visitIndexExpression(IndexExpression node) {
16815 Token period = map(node.period); 15713 Token period = map(node.period);
16816 IndexExpression copy; 15714 IndexExpression copy;
16817 if (period == null) { 15715 if (period == null) {
16818 copy = new IndexExpression.forTarget_full(clone4(node.target), map(node.le ftBracket), clone4(node.index), map(node.rightBracket)); 15716 copy = new IndexExpression.forTarget(clone4(node.target), map(node.leftBra cket), clone4(node.index), map(node.rightBracket));
16819 } else { 15717 } else {
16820 copy = new IndexExpression.forCascade_full(period, map(node.leftBracket), clone4(node.index), map(node.rightBracket)); 15718 copy = new IndexExpression.forCascade(period, map(node.leftBracket), clone 4(node.index), map(node.rightBracket));
16821 } 15719 }
16822 copy.auxiliaryElements = node.auxiliaryElements; 15720 copy.auxiliaryElements = node.auxiliaryElements;
16823 copy.propagatedElement = node.propagatedElement; 15721 copy.propagatedElement = node.propagatedElement;
16824 copy.propagatedType = node.propagatedType; 15722 copy.propagatedType = node.propagatedType;
16825 copy.staticElement = node.staticElement; 15723 copy.staticElement = node.staticElement;
16826 copy.staticType = node.staticType; 15724 copy.staticType = node.staticType;
16827 return copy; 15725 return copy;
16828 } 15726 }
16829 15727
16830 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp ression node) { 15728 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp ression node) {
16831 InstanceCreationExpression copy = new InstanceCreationExpression.full(map(no de.keyword), clone4(node.constructorName), clone4(node.argumentList)); 15729 InstanceCreationExpression copy = new InstanceCreationExpression(map(node.ke yword), clone4(node.constructorName), clone4(node.argumentList));
16832 copy.propagatedType = node.propagatedType; 15730 copy.propagatedType = node.propagatedType;
16833 copy.staticElement = node.staticElement; 15731 copy.staticElement = node.staticElement;
16834 copy.staticType = node.staticType; 15732 copy.staticType = node.staticType;
16835 return copy; 15733 return copy;
16836 } 15734 }
16837 15735
16838 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) { 15736 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) {
16839 IntegerLiteral copy = new IntegerLiteral.full(map(node.literal), node.value) ; 15737 IntegerLiteral copy = new IntegerLiteral(map(node.literal), node.value);
16840 copy.propagatedType = node.propagatedType; 15738 copy.propagatedType = node.propagatedType;
16841 copy.staticType = node.staticType; 15739 copy.staticType = node.staticType;
16842 return copy; 15740 return copy;
16843 } 15741 }
16844 15742
16845 InterpolationExpression visitInterpolationExpression(InterpolationExpression n ode) => new InterpolationExpression.full(map(node.leftBracket), clone4(node.expr ession), map(node.rightBracket)); 15743 InterpolationExpression visitInterpolationExpression(InterpolationExpression n ode) => new InterpolationExpression(map(node.leftBracket), clone4(node.expressio n), map(node.rightBracket));
16846 15744
16847 InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString.full(map(node.contents), node.value); 15745 InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString(map(node.contents), node.value);
16848 15746
16849 IsExpression visitIsExpression(IsExpression node) { 15747 IsExpression visitIsExpression(IsExpression node) {
16850 IsExpression copy = new IsExpression.full(clone4(node.expression), map(node. isOperator), map(node.notOperator), clone4(node.type)); 15748 IsExpression copy = new IsExpression(clone4(node.expression), map(node.isOpe rator), map(node.notOperator), clone4(node.type));
16851 copy.propagatedType = node.propagatedType; 15749 copy.propagatedType = node.propagatedType;
16852 copy.staticType = node.staticType; 15750 copy.staticType = node.staticType;
16853 return copy; 15751 return copy;
16854 } 15752 }
16855 15753
16856 Label visitLabel(Label node) => new Label.full(clone4(node.label), map(node.co lon)); 15754 Label visitLabel(Label node) => new Label(clone4(node.label), map(node.colon)) ;
16857 15755
16858 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt atement.full(clone5(node.labels), clone4(node.statement)); 15756 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt atement(clone5(node.labels), clone4(node.statement));
16859 15757
16860 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi rective.full(clone4(node.documentationComment), clone5(node.metadata), map(node. libraryToken), clone4(node.name), map(node.semicolon)); 15758 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi rective(clone4(node.documentationComment), clone5(node.metadata), map(node.libra ryToken), clone4(node.name), map(node.semicolon));
16861 15759
16862 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) { 15760 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) {
16863 LibraryIdentifier copy = new LibraryIdentifier.full(clone5(node.components)) ; 15761 LibraryIdentifier copy = new LibraryIdentifier(clone5(node.components));
16864 copy.propagatedType = node.propagatedType; 15762 copy.propagatedType = node.propagatedType;
16865 copy.staticType = node.staticType; 15763 copy.staticType = node.staticType;
16866 return copy; 15764 return copy;
16867 } 15765 }
16868 15766
16869 ListLiteral visitListLiteral(ListLiteral node) { 15767 ListLiteral visitListLiteral(ListLiteral node) {
16870 ListLiteral copy = new ListLiteral.full(map(node.constKeyword), clone4(node. typeArguments), map(node.leftBracket), clone5(node.elements), map(node.rightBrac ket)); 15768 ListLiteral copy = new ListLiteral(map(node.constKeyword), clone4(node.typeA rguments), map(node.leftBracket), clone5(node.elements), map(node.rightBracket)) ;
16871 copy.propagatedType = node.propagatedType; 15769 copy.propagatedType = node.propagatedType;
16872 copy.staticType = node.staticType; 15770 copy.staticType = node.staticType;
16873 return copy; 15771 return copy;
16874 } 15772 }
16875 15773
16876 MapLiteral visitMapLiteral(MapLiteral node) { 15774 MapLiteral visitMapLiteral(MapLiteral node) {
16877 MapLiteral copy = new MapLiteral.full(map(node.constKeyword), clone4(node.ty peArguments), map(node.leftBracket), clone5(node.entries), map(node.rightBracket )); 15775 MapLiteral copy = new MapLiteral(map(node.constKeyword), clone4(node.typeArg uments), map(node.leftBracket), clone5(node.entries), map(node.rightBracket));
16878 copy.propagatedType = node.propagatedType; 15776 copy.propagatedType = node.propagatedType;
16879 copy.staticType = node.staticType; 15777 copy.staticType = node.staticType;
16880 return copy; 15778 return copy;
16881 } 15779 }
16882 15780
16883 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn try.full(clone4(node.key), map(node.separator), clone4(node.value)); 15781 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn try(clone4(node.key), map(node.separator), clone4(node.value));
16884 15782
16885 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method Declaration.full(clone4(node.documentationComment), clone5(node.metadata), map(n ode.externalKeyword), map(node.modifierKeyword), clone4(node.returnType), map(no de.propertyKeyword), map(node.operatorKeyword), clone4(node.name), clone4(node.p arameters), clone4(node.body)); 15783 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method Declaration(clone4(node.documentationComment), clone5(node.metadata), map(node.e xternalKeyword), map(node.modifierKeyword), clone4(node.returnType), map(node.pr opertyKeyword), map(node.operatorKeyword), clone4(node.name), clone4(node.parame ters), clone4(node.body));
16886 15784
16887 MethodInvocation visitMethodInvocation(MethodInvocation node) { 15785 MethodInvocation visitMethodInvocation(MethodInvocation node) {
16888 MethodInvocation copy = new MethodInvocation.full(clone4(node.target), map(n ode.period), clone4(node.methodName), clone4(node.argumentList)); 15786 MethodInvocation copy = new MethodInvocation(clone4(node.target), map(node.p eriod), clone4(node.methodName), clone4(node.argumentList));
16889 copy.propagatedType = node.propagatedType; 15787 copy.propagatedType = node.propagatedType;
16890 copy.staticType = node.staticType; 15788 copy.staticType = node.staticType;
16891 return copy; 15789 return copy;
16892 } 15790 }
16893 15791
16894 NamedExpression visitNamedExpression(NamedExpression node) { 15792 NamedExpression visitNamedExpression(NamedExpression node) {
16895 NamedExpression copy = new NamedExpression.full(clone4(node.name), clone4(no de.expression)); 15793 NamedExpression copy = new NamedExpression(clone4(node.name), clone4(node.ex pression));
16896 copy.propagatedType = node.propagatedType; 15794 copy.propagatedType = node.propagatedType;
16897 copy.staticType = node.staticType; 15795 copy.staticType = node.staticType;
16898 return copy; 15796 return copy;
16899 } 15797 }
16900 15798
16901 ASTNode visitNativeClause(NativeClause node) => new NativeClause.full(map(node .keyword), clone4(node.name)); 15799 ASTNode visitNativeClause(NativeClause node) => new NativeClause(map(node.keyw ord), clone4(node.name));
16902 15800
16903 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat iveFunctionBody.full(map(node.nativeToken), clone4(node.stringLiteral), map(node .semicolon)); 15801 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat iveFunctionBody(map(node.nativeToken), clone4(node.stringLiteral), map(node.semi colon));
16904 15802
16905 NullLiteral visitNullLiteral(NullLiteral node) { 15803 NullLiteral visitNullLiteral(NullLiteral node) {
16906 NullLiteral copy = new NullLiteral.full(map(node.literal)); 15804 NullLiteral copy = new NullLiteral(map(node.literal));
16907 copy.propagatedType = node.propagatedType; 15805 copy.propagatedType = node.propagatedType;
16908 copy.staticType = node.staticType; 15806 copy.staticType = node.staticType;
16909 return copy; 15807 return copy;
16910 } 15808 }
16911 15809
16912 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n ode) { 15810 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n ode) {
16913 ParenthesizedExpression copy = new ParenthesizedExpression.full(map(node.lef tParenthesis), clone4(node.expression), map(node.rightParenthesis)); 15811 ParenthesizedExpression copy = new ParenthesizedExpression(map(node.leftPare nthesis), clone4(node.expression), map(node.rightParenthesis));
16914 copy.propagatedType = node.propagatedType; 15812 copy.propagatedType = node.propagatedType;
16915 copy.staticType = node.staticType; 15813 copy.staticType = node.staticType;
16916 return copy; 15814 return copy;
16917 } 15815 }
16918 15816
16919 PartDirective visitPartDirective(PartDirective node) { 15817 PartDirective visitPartDirective(PartDirective node) {
16920 PartDirective copy = new PartDirective.full(clone4(node.documentationComment ), clone5(node.metadata), map(node.partToken), clone4(node.uri), map(node.semico lon)); 15818 PartDirective copy = new PartDirective(clone4(node.documentationComment), cl one5(node.metadata), map(node.partToken), clone4(node.uri), map(node.semicolon)) ;
16921 copy.element = node.element; 15819 copy.element = node.element;
16922 return copy; 15820 return copy;
16923 } 15821 }
16924 15822
16925 PartOfDirective visitPartOfDirective(PartOfDirective node) { 15823 PartOfDirective visitPartOfDirective(PartOfDirective node) {
16926 PartOfDirective copy = new PartOfDirective.full(clone4(node.documentationCom ment), clone5(node.metadata), map(node.partToken), map(node.ofToken), clone4(nod e.libraryName), map(node.semicolon)); 15824 PartOfDirective copy = new PartOfDirective(clone4(node.documentationComment) , clone5(node.metadata), map(node.partToken), map(node.ofToken), clone4(node.lib raryName), map(node.semicolon));
16927 copy.element = node.element; 15825 copy.element = node.element;
16928 return copy; 15826 return copy;
16929 } 15827 }
16930 15828
16931 PostfixExpression visitPostfixExpression(PostfixExpression node) { 15829 PostfixExpression visitPostfixExpression(PostfixExpression node) {
16932 PostfixExpression copy = new PostfixExpression.full(clone4(node.operand), ma p(node.operator)); 15830 PostfixExpression copy = new PostfixExpression(clone4(node.operand), map(nod e.operator));
16933 copy.propagatedElement = node.propagatedElement; 15831 copy.propagatedElement = node.propagatedElement;
16934 copy.propagatedType = node.propagatedType; 15832 copy.propagatedType = node.propagatedType;
16935 copy.staticElement = node.staticElement; 15833 copy.staticElement = node.staticElement;
16936 copy.staticType = node.staticType; 15834 copy.staticType = node.staticType;
16937 return copy; 15835 return copy;
16938 } 15836 }
16939 15837
16940 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) { 15838 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) {
16941 PrefixedIdentifier copy = new PrefixedIdentifier.full(clone4(node.prefix), m ap(node.period), clone4(node.identifier)); 15839 PrefixedIdentifier copy = new PrefixedIdentifier(clone4(node.prefix), map(no de.period), clone4(node.identifier));
16942 copy.propagatedType = node.propagatedType; 15840 copy.propagatedType = node.propagatedType;
16943 copy.staticType = node.staticType; 15841 copy.staticType = node.staticType;
16944 return copy; 15842 return copy;
16945 } 15843 }
16946 15844
16947 PrefixExpression visitPrefixExpression(PrefixExpression node) { 15845 PrefixExpression visitPrefixExpression(PrefixExpression node) {
16948 PrefixExpression copy = new PrefixExpression.full(map(node.operator), clone4 (node.operand)); 15846 PrefixExpression copy = new PrefixExpression(map(node.operator), clone4(node .operand));
16949 copy.propagatedElement = node.propagatedElement; 15847 copy.propagatedElement = node.propagatedElement;
16950 copy.propagatedType = node.propagatedType; 15848 copy.propagatedType = node.propagatedType;
16951 copy.staticElement = node.staticElement; 15849 copy.staticElement = node.staticElement;
16952 copy.staticType = node.staticType; 15850 copy.staticType = node.staticType;
16953 return copy; 15851 return copy;
16954 } 15852 }
16955 15853
16956 PropertyAccess visitPropertyAccess(PropertyAccess node) { 15854 PropertyAccess visitPropertyAccess(PropertyAccess node) {
16957 PropertyAccess copy = new PropertyAccess.full(clone4(node.target), map(node. operator), clone4(node.propertyName)); 15855 PropertyAccess copy = new PropertyAccess(clone4(node.target), map(node.opera tor), clone4(node.propertyName));
16958 copy.propagatedType = node.propagatedType; 15856 copy.propagatedType = node.propagatedType;
16959 copy.staticType = node.staticType; 15857 copy.staticType = node.staticType;
16960 return copy; 15858 return copy;
16961 } 15859 }
16962 15860
16963 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec tingConstructorInvocation node) { 15861 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec tingConstructorInvocation node) {
16964 RedirectingConstructorInvocation copy = new RedirectingConstructorInvocation .full(map(node.keyword), map(node.period), clone4(node.constructorName), clone4( node.argumentList)); 15862 RedirectingConstructorInvocation copy = new RedirectingConstructorInvocation (map(node.keyword), map(node.period), clone4(node.constructorName), clone4(node. argumentList));
16965 copy.staticElement = node.staticElement; 15863 copy.staticElement = node.staticElement;
16966 return copy; 15864 return copy;
16967 } 15865 }
16968 15866
16969 RethrowExpression visitRethrowExpression(RethrowExpression node) { 15867 RethrowExpression visitRethrowExpression(RethrowExpression node) {
16970 RethrowExpression copy = new RethrowExpression.full(map(node.keyword)); 15868 RethrowExpression copy = new RethrowExpression(map(node.keyword));
16971 copy.propagatedType = node.propagatedType; 15869 copy.propagatedType = node.propagatedType;
16972 copy.staticType = node.staticType; 15870 copy.staticType = node.staticType;
16973 return copy; 15871 return copy;
16974 } 15872 }
16975 15873
16976 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent.full(map(node.keyword), clone4(node.expression), map(node.semicolon)); 15874 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent(map(node.keyword), clone4(node.expression), map(node.semicolon));
16977 15875
16978 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag.full(map(node.script Tag)); 15876 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag(map(node.scriptTag)) ;
16979 15877
16980 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator. full(map(node.keyword), clone5(node.shownNames)); 15878 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( map(node.keyword), clone5(node.shownNames));
16981 15879
16982 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter.full(clone4(node.documentationComment), clone5(node. metadata), map(node.keyword), clone4(node.type), clone4(node.identifier)); 15880 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter(clone4(node.documentationComment), clone5(node.metad ata), map(node.keyword), clone4(node.type), clone4(node.identifier));
16983 15881
16984 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) { 15882 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
16985 SimpleIdentifier copy = new SimpleIdentifier.full(map(node.token)); 15883 Token mappedToken = map(node.token);
15884 if (mappedToken == null) {
15885 mappedToken = node.token;
15886 }
15887 SimpleIdentifier copy = new SimpleIdentifier(mappedToken);
16986 copy.auxiliaryElements = node.auxiliaryElements; 15888 copy.auxiliaryElements = node.auxiliaryElements;
16987 copy.propagatedElement = node.propagatedElement; 15889 copy.propagatedElement = node.propagatedElement;
16988 copy.propagatedType = node.propagatedType; 15890 copy.propagatedType = node.propagatedType;
16989 copy.staticElement = node.staticElement; 15891 copy.staticElement = node.staticElement;
16990 copy.staticType = node.staticType; 15892 copy.staticType = node.staticType;
16991 return copy; 15893 return copy;
16992 } 15894 }
16993 15895
16994 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) { 15896 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) {
16995 SimpleStringLiteral copy = new SimpleStringLiteral.full(map(node.literal), n ode.value); 15897 SimpleStringLiteral copy = new SimpleStringLiteral(map(node.literal), node.v alue);
16996 copy.propagatedType = node.propagatedType; 15898 copy.propagatedType = node.propagatedType;
16997 copy.staticType = node.staticType; 15899 copy.staticType = node.staticType;
16998 return copy; 15900 return copy;
16999 } 15901 }
17000 15902
17001 StringInterpolation visitStringInterpolation(StringInterpolation node) { 15903 StringInterpolation visitStringInterpolation(StringInterpolation node) {
17002 StringInterpolation copy = new StringInterpolation.full(clone5(node.elements )); 15904 StringInterpolation copy = new StringInterpolation(clone5(node.elements));
17003 copy.propagatedType = node.propagatedType; 15905 copy.propagatedType = node.propagatedType;
17004 copy.staticType = node.staticType; 15906 copy.staticType = node.staticType;
17005 return copy; 15907 return copy;
17006 } 15908 }
17007 15909
17008 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv ocation node) { 15910 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv ocation node) {
17009 SuperConstructorInvocation copy = new SuperConstructorInvocation.full(map(no de.keyword), map(node.period), clone4(node.constructorName), clone4(node.argumen tList)); 15911 SuperConstructorInvocation copy = new SuperConstructorInvocation(map(node.ke yword), map(node.period), clone4(node.constructorName), clone4(node.argumentList ));
17010 copy.staticElement = node.staticElement; 15912 copy.staticElement = node.staticElement;
17011 return copy; 15913 return copy;
17012 } 15914 }
17013 15915
17014 SuperExpression visitSuperExpression(SuperExpression node) { 15916 SuperExpression visitSuperExpression(SuperExpression node) {
17015 SuperExpression copy = new SuperExpression.full(map(node.keyword)); 15917 SuperExpression copy = new SuperExpression(map(node.keyword));
17016 copy.propagatedType = node.propagatedType; 15918 copy.propagatedType = node.propagatedType;
17017 copy.staticType = node.staticType; 15919 copy.staticType = node.staticType;
17018 return copy; 15920 return copy;
17019 } 15921 }
17020 15922
17021 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase.full(clone5(node .labels), map(node.keyword), clone4(node.expression), map(node.colon), clone5(no de.statements)); 15923 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(clone5(node.labe ls), map(node.keyword), clone4(node.expression), map(node.colon), clone5(node.st atements));
17022 15924
17023 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault.full (clone5(node.labels), map(node.keyword), map(node.colon), clone5(node.statements )); 15925 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(clon e5(node.labels), map(node.keyword), map(node.colon), clone5(node.statements));
17024 15926
17025 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem ent.full(map(node.keyword), map(node.leftParenthesis), clone4(node.expression), map(node.rightParenthesis), map(node.leftBracket), clone5(node.members), map(nod e.rightBracket)); 15927 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem ent(map(node.keyword), map(node.leftParenthesis), clone4(node.expression), map(n ode.rightParenthesis), map(node.leftBracket), clone5(node.members), map(node.rig htBracket));
17026 15928
17027 ASTNode visitSymbolLiteral(SymbolLiteral node) { 15929 ASTNode visitSymbolLiteral(SymbolLiteral node) {
17028 SymbolLiteral copy = new SymbolLiteral.full(map(node.poundSign), map2(node.c omponents)); 15930 SymbolLiteral copy = new SymbolLiteral(map(node.poundSign), map2(node.compon ents));
17029 copy.propagatedType = node.propagatedType; 15931 copy.propagatedType = node.propagatedType;
17030 copy.staticType = node.staticType; 15932 copy.staticType = node.staticType;
17031 return copy; 15933 return copy;
17032 } 15934 }
17033 15935
17034 ThisExpression visitThisExpression(ThisExpression node) { 15936 ThisExpression visitThisExpression(ThisExpression node) {
17035 ThisExpression copy = new ThisExpression.full(map(node.keyword)); 15937 ThisExpression copy = new ThisExpression(map(node.keyword));
17036 copy.propagatedType = node.propagatedType; 15938 copy.propagatedType = node.propagatedType;
17037 copy.staticType = node.staticType; 15939 copy.staticType = node.staticType;
17038 return copy; 15940 return copy;
17039 } 15941 }
17040 15942
17041 ThrowExpression visitThrowExpression(ThrowExpression node) { 15943 ThrowExpression visitThrowExpression(ThrowExpression node) {
17042 ThrowExpression copy = new ThrowExpression.full(map(node.keyword), clone4(no de.expression)); 15944 ThrowExpression copy = new ThrowExpression(map(node.keyword), clone4(node.ex pression));
17043 copy.propagatedType = node.propagatedType; 15945 copy.propagatedType = node.propagatedType;
17044 copy.staticType = node.staticType; 15946 copy.staticType = node.staticType;
17045 return copy; 15947 return copy;
17046 } 15948 }
17047 15949
17048 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD eclaration node) => new TopLevelVariableDeclaration.full(clone4(node.documentati onComment), clone5(node.metadata), clone4(node.variables), map(node.semicolon)); 15950 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD eclaration node) => new TopLevelVariableDeclaration(clone4(node.documentationCom ment), clone5(node.metadata), clone4(node.variables), map(node.semicolon));
17049 15951
17050 TryStatement visitTryStatement(TryStatement node) => new TryStatement.full(map (node.tryKeyword), clone4(node.body), clone5(node.catchClauses), map(node.finall yKeyword), clone4(node.finallyBlock)); 15952 TryStatement visitTryStatement(TryStatement node) => new TryStatement(map(node .tryKeyword), clone4(node.body), clone5(node.catchClauses), map(node.finallyKeyw ord), clone4(node.finallyBlock));
17051 15953
17052 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum entList.full(map(node.leftBracket), clone5(node.arguments), map(node.rightBracke t)); 15954 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum entList(map(node.leftBracket), clone5(node.arguments), map(node.rightBracket));
17053 15955
17054 TypeName visitTypeName(TypeName node) { 15956 TypeName visitTypeName(TypeName node) {
17055 TypeName copy = new TypeName.full(clone4(node.name), clone4(node.typeArgumen ts)); 15957 TypeName copy = new TypeName(clone4(node.name), clone4(node.typeArguments));
17056 copy.type = node.type; 15958 copy.type = node.type;
17057 return copy; 15959 return copy;
17058 } 15960 }
17059 15961
17060 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter.full (clone4(node.documentationComment), clone5(node.metadata), clone4(node.name), ma p(node.keyword), clone4(node.bound)); 15962 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(clon e4(node.documentationComment), clone5(node.metadata), clone4(node.name), map(nod e.keyword), clone4(node.bound));
17061 15963
17062 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa rameterList.full(map(node.leftBracket), clone5(node.typeParameters), map(node.ri ghtBracket)); 15964 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa rameterList(map(node.leftBracket), clone5(node.typeParameters), map(node.rightBr acket));
17063 15965
17064 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration.full(null, clone5(node.metadata), clone4(node.name), map(nod e.equals), clone4(node.initializer)); 15966 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration(null, clone5(node.metadata), clone4(node.name), map(node.equ als), clone4(node.initializer));
17065 15967
17066 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n ode) => new VariableDeclarationList.full(null, clone5(node.metadata), map(node.k eyword), clone4(node.type), clone5(node.variables)); 15968 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n ode) => new VariableDeclarationList(null, clone5(node.metadata), map(node.keywor d), clone4(node.type), clone5(node.variables));
17067 15969
17068 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement.full(clone4(node.variabl es), map(node.semicolon)); 15970 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement(clone4(node.variables), map(node.semicolon));
17069 15971
17070 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement. full(map(node.keyword), map(node.leftParenthesis), clone4(node.condition), map(n ode.rightParenthesis), clone4(node.body)); 15972 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( map(node.keyword), map(node.leftParenthesis), clone4(node.condition), map(node.r ightParenthesis), clone4(node.body));
17071 15973
17072 WithClause visitWithClause(WithClause node) => new WithClause.full(map(node.wi thKeyword), clone5(node.mixinTypes)); 15974 WithClause visitWithClause(WithClause node) => new WithClause(map(node.withKey word), clone5(node.mixinTypes));
17073 15975
17074 ASTNode clone4(ASTNode node) { 15976 ASTNode clone4(ASTNode node) {
17075 if (node == null) { 15977 if (node == null) {
17076 return null; 15978 return null;
17077 } 15979 }
17078 if (identical(node, _oldNode)) { 15980 if (identical(node, _oldNode)) {
17079 return _newNode as ASTNode; 15981 return _newNode as ASTNode;
17080 } 15982 }
17081 return node.accept(this) as ASTNode; 15983 return node.accept(this) as ASTNode;
17082 } 15984 }
(...skipping 26 matching lines...) Expand all
17109 * Traverse the AST from initial child node to successive parents, building a co llection of local 16011 * Traverse the AST from initial child node to successive parents, building a co llection of local
17110 * variable and parameter names visible to the initial child node. In case of na me shadowing, the 16012 * variable and parameter names visible to the initial child node. In case of na me shadowing, the
17111 * first name seen is the most specific one so names are not redefined. 16013 * first name seen is the most specific one so names are not redefined.
17112 * 16014 *
17113 * Completion test code coverage is 95%. The two basic blocks that are not execu ted cannot be 16015 * Completion test code coverage is 95%. The two basic blocks that are not execu ted cannot be
17114 * executed. They are included for future reference. 16016 * executed. They are included for future reference.
17115 * 16017 *
17116 * @coverage com.google.dart.engine.services.completion 16018 * @coverage com.google.dart.engine.services.completion
17117 */ 16019 */
17118 class ScopedNameFinder extends GeneralizingASTVisitor<Object> { 16020 class ScopedNameFinder extends GeneralizingASTVisitor<Object> {
17119 Declaration declaration; 16021 Declaration _declarationNode;
17120 16022
17121 ASTNode _immediateChild; 16023 ASTNode _immediateChild;
17122 16024
17123 final Map<String, SimpleIdentifier> locals = new Map<String, SimpleIdentifier> (); 16025 Map<String, SimpleIdentifier> _locals = new Map<String, SimpleIdentifier>();
17124 16026
17125 int _position = 0; 16027 int _position = 0;
17126 16028
17127 bool _referenceIsWithinLocalFunction = false; 16029 bool _referenceIsWithinLocalFunction = false;
17128 16030
17129 ScopedNameFinder(int position) { 16031 ScopedNameFinder(int position) {
17130 this._position = position; 16032 this._position = position;
17131 } 16033 }
17132 16034
16035 Declaration get declaration => _declarationNode;
16036
16037 Map<String, SimpleIdentifier> get locals => _locals;
16038
17133 Object visitBlock(Block node) { 16039 Object visitBlock(Block node) {
17134 checkStatements(node.statements); 16040 checkStatements(node.statements);
17135 return super.visitBlock(node); 16041 return super.visitBlock(node);
17136 } 16042 }
17137 16043
17138 Object visitCatchClause(CatchClause node) { 16044 Object visitCatchClause(CatchClause node) {
17139 addToScope(node.exceptionParameter); 16045 addToScope(node.exceptionParameter);
17140 addToScope(node.stackTraceParameter); 16046 addToScope(node.stackTraceParameter);
17141 return super.visitCatchClause(node); 16047 return super.visitCatchClause(node);
17142 } 16048 }
17143 16049
17144 Object visitConstructorDeclaration(ConstructorDeclaration node) { 16050 Object visitConstructorDeclaration(ConstructorDeclaration node) {
17145 if (_immediateChild != node.parameters) { 16051 if (_immediateChild != node.parameters) {
17146 addParameters(node.parameters.parameters); 16052 addParameters(node.parameters.parameters);
17147 } 16053 }
17148 declaration = node; 16054 _declarationNode = node;
17149 return null; 16055 return null;
17150 } 16056 }
17151 16057
17152 Object visitFieldDeclaration(FieldDeclaration node) { 16058 Object visitFieldDeclaration(FieldDeclaration node) {
17153 declaration = node; 16059 _declarationNode = node;
17154 return null; 16060 return null;
17155 } 16061 }
17156 16062
17157 Object visitForEachStatement(ForEachStatement node) { 16063 Object visitForEachStatement(ForEachStatement node) {
17158 DeclaredIdentifier loopVariable = node.loopVariable; 16064 DeclaredIdentifier loopVariable = node.loopVariable;
17159 if (loopVariable != null) { 16065 if (loopVariable != null) {
17160 addToScope(loopVariable.identifier); 16066 addToScope(loopVariable.identifier);
17161 } 16067 }
17162 return super.visitForEachStatement(node); 16068 return super.visitForEachStatement(node);
17163 } 16069 }
17164 16070
17165 Object visitForStatement(ForStatement node) { 16071 Object visitForStatement(ForStatement node) {
17166 if (_immediateChild != node.variables && node.variables != null) { 16072 if (_immediateChild != node.variables && node.variables != null) {
17167 addVariables(node.variables.variables); 16073 addVariables(node.variables.variables);
17168 } 16074 }
17169 return super.visitForStatement(node); 16075 return super.visitForStatement(node);
17170 } 16076 }
17171 16077
17172 Object visitFunctionDeclaration(FunctionDeclaration node) { 16078 Object visitFunctionDeclaration(FunctionDeclaration node) {
17173 if (node.parent is! FunctionDeclarationStatement) { 16079 if (node.parent is! FunctionDeclarationStatement) {
17174 declaration = node; 16080 _declarationNode = node;
17175 return null; 16081 return null;
17176 } 16082 }
17177 return super.visitFunctionDeclaration(node); 16083 return super.visitFunctionDeclaration(node);
17178 } 16084 }
17179 16085
17180 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { 16086 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
17181 _referenceIsWithinLocalFunction = true; 16087 _referenceIsWithinLocalFunction = true;
17182 return super.visitFunctionDeclarationStatement(node); 16088 return super.visitFunctionDeclarationStatement(node);
17183 } 16089 }
17184 16090
17185 Object visitFunctionExpression(FunctionExpression node) { 16091 Object visitFunctionExpression(FunctionExpression node) {
17186 if (node.parameters != null && _immediateChild != node.parameters) { 16092 if (node.parameters != null && _immediateChild != node.parameters) {
17187 addParameters(node.parameters.parameters); 16093 addParameters(node.parameters.parameters);
17188 } 16094 }
17189 return super.visitFunctionExpression(node); 16095 return super.visitFunctionExpression(node);
17190 } 16096 }
17191 16097
17192 Object visitMethodDeclaration(MethodDeclaration node) { 16098 Object visitMethodDeclaration(MethodDeclaration node) {
17193 declaration = node; 16099 _declarationNode = node;
17194 if (node.parameters == null) { 16100 if (node.parameters == null) {
17195 return null; 16101 return null;
17196 } 16102 }
17197 if (_immediateChild != node.parameters) { 16103 if (_immediateChild != node.parameters) {
17198 addParameters(node.parameters.parameters); 16104 addParameters(node.parameters.parameters);
17199 } 16105 }
17200 return null; 16106 return null;
17201 } 16107 }
17202 16108
17203 Object visitNode(ASTNode node) { 16109 Object visitNode(ASTNode node) {
17204 _immediateChild = node; 16110 _immediateChild = node;
17205 ASTNode parent = node.parent; 16111 ASTNode parent = node.parent;
17206 if (parent != null) { 16112 if (parent != null) {
17207 parent.accept(this); 16113 parent.accept(this);
17208 } 16114 }
17209 return null; 16115 return null;
17210 } 16116 }
17211 16117
17212 Object visitSwitchMember(SwitchMember node) { 16118 Object visitSwitchMember(SwitchMember node) {
17213 checkStatements(node.statements); 16119 checkStatements(node.statements);
17214 return super.visitSwitchMember(node); 16120 return super.visitSwitchMember(node);
17215 } 16121 }
17216 16122
17217 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { 16123 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
17218 declaration = node; 16124 _declarationNode = node;
17219 return null; 16125 return null;
17220 } 16126 }
17221 16127
17222 Object visitTypeAlias(TypeAlias node) { 16128 Object visitTypeAlias(TypeAlias node) {
17223 declaration = node; 16129 _declarationNode = node;
17224 return null; 16130 return null;
17225 } 16131 }
17226 16132
17227 void addParameters(NodeList<FormalParameter> vars) { 16133 void addParameters(NodeList<FormalParameter> vars) {
17228 for (FormalParameter var2 in vars) { 16134 for (FormalParameter var2 in vars) {
17229 addToScope(var2.identifier); 16135 addToScope(var2.identifier);
17230 } 16136 }
17231 } 16137 }
17232 16138
17233 void addToScope(SimpleIdentifier identifier) { 16139 void addToScope(SimpleIdentifier identifier) {
17234 if (identifier != null && isInRange(identifier)) { 16140 if (identifier != null && isInRange(identifier)) {
17235 String name = identifier.name; 16141 String name = identifier.name;
17236 if (!locals.containsKey(name)) { 16142 if (!_locals.containsKey(name)) {
17237 locals[name] = identifier; 16143 _locals[name] = identifier;
17238 } 16144 }
17239 } 16145 }
17240 } 16146 }
17241 16147
17242 void addVariables(NodeList<VariableDeclaration> vars) { 16148 void addVariables(NodeList<VariableDeclaration> vars) {
17243 for (VariableDeclaration var2 in vars) { 16149 for (VariableDeclaration var2 in vars) {
17244 addToScope(var2.name); 16150 addToScope(var2.name);
17245 } 16151 }
17246 } 16152 }
17247 16153
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
17382 } 16288 }
17383 void operator[]=(int index, E node) { 16289 void operator[]=(int index, E node) {
17384 if (index < 0 || index >= _elements.length) { 16290 if (index < 0 || index >= _elements.length) {
17385 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); 16291 throw new RangeError("Index: ${index}, Size: ${_elements.length}");
17386 } 16292 }
17387 owner.becomeParentOf(node); 16293 owner.becomeParentOf(node);
17388 _elements[index] = node; 16294 _elements[index] = node;
17389 } 16295 }
17390 int get length => _elements.length; 16296 int get length => _elements.length;
17391 } 16297 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698