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

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: 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.full(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 /** 500 /**
501 * Initialize a newly created list of adjacent strings. 501 * Initialize a newly created list of adjacent strings.
502 * 502 *
503 * @param strings the strings that are implicitly concatenated 503 * @param strings the strings that are implicitly concatenated
504 */ 504 */
505 AdjacentStrings({List<StringLiteral> strings}) : this.full(strings); 505 AdjacentStrings({List<StringLiteral> strings}) : this.full(strings);
Brian Wilkerson 2013/12/10 14:57:41 I never noticed this before, but why are we genera
scheglov 2013/12/10 18:21:09 At one point I thought that it is nice to provide
506 506
507 accept(ASTVisitor visitor) => visitor.visitAdjacentStrings(this); 507 accept(ASTVisitor visitor) => visitor.visitAdjacentStrings(this);
508 508
509 Token get beginToken => strings.beginToken; 509 Token get beginToken => _strings.beginToken;
510 510
511 Token get endToken => strings.endToken; 511 Token get endToken => _strings.endToken;
512
513 /**
514 * Return the strings that are implicitly concatenated.
515 *
516 * @return the strings that are implicitly concatenated
517 */
518 NodeList<StringLiteral> get strings => _strings;
Brian Wilkerson 2013/12/10 14:57:41 Does this mean that what we were generating before
scheglov 2013/12/10 18:21:09 It was generated wrongly before. In Java property
512 519
513 void visitChildren(ASTVisitor visitor) { 520 void visitChildren(ASTVisitor visitor) {
514 strings.accept(visitor); 521 _strings.accept(visitor);
515 } 522 }
516 523
517 void appendStringValue(JavaStringBuilder builder) { 524 void appendStringValue(JavaStringBuilder builder) {
518 for (StringLiteral stringLiteral in strings) { 525 for (StringLiteral stringLiteral in strings) {
519 stringLiteral.appendStringValue(builder); 526 stringLiteral.appendStringValue(builder);
520 } 527 }
521 } 528 }
522 } 529 }
523 530
524 /** 531 /**
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 * @param atSign the at sign that introduced the annotation 722 * @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 723 * @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 724 * the field that is being referenced
718 * @param period the period before the constructor name, or `null` if this ann otation is not 725 * @param period the period before the constructor name, or `null` if this ann otation is not
719 * the invocation of a named constructor 726 * the invocation of a named constructor
720 * @param constructorName the name of the constructor being invoked, or `null` if this 727 * @param constructorName the name of the constructor being invoked, or `null` if this
721 * annotation is not the invocation of a named constructor 728 * annotation is not the invocation of a named constructor
722 * @param arguments the arguments to the constructor being invoked, or `null` if this 729 * @param arguments the arguments to the constructor being invoked, or `null` if this
723 * annotation is not the invocation of a constructor 730 * annotation is not the invocation of a constructor
724 */ 731 */
725 Annotation.full(Token atSign, Identifier name, Token period, SimpleIdentifier constructorName, ArgumentList arguments) { 732 Annotation.full(this.atSign, Identifier name, this.period, SimpleIdentifier co nstructorName, ArgumentList arguments) {
726 this.atSign = atSign;
727 this._name = becomeParentOf(name); 733 this._name = becomeParentOf(name);
728 this.period = period;
729 this._constructorName = becomeParentOf(constructorName); 734 this._constructorName = becomeParentOf(constructorName);
730 this._arguments = becomeParentOf(arguments); 735 this._arguments = becomeParentOf(arguments);
731 } 736 }
732 737
733 /** 738 /**
734 * Initialize a newly created annotation. 739 * Initialize a newly created annotation.
735 * 740 *
736 * @param atSign the at sign that introduced the annotation 741 * @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 742 * @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 743 * the field that is being referenced
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 * The identifier representing the argument being tested. 867 * The identifier representing the argument being tested.
863 */ 868 */
864 SimpleIdentifier _identifier; 869 SimpleIdentifier _identifier;
865 870
866 /** 871 /**
867 * Initialize a newly created argument definition test. 872 * Initialize a newly created argument definition test.
868 * 873 *
869 * @param question the token representing the question mark 874 * @param question the token representing the question mark
870 * @param identifier the identifier representing the argument being tested 875 * @param identifier the identifier representing the argument being tested
871 */ 876 */
872 ArgumentDefinitionTest.full(Token question, SimpleIdentifier identifier) { 877 ArgumentDefinitionTest.full(this.question, SimpleIdentifier identifier) {
873 this.question = question;
874 this._identifier = becomeParentOf(identifier); 878 this._identifier = becomeParentOf(identifier);
875 } 879 }
876 880
877 /** 881 /**
878 * Initialize a newly created argument definition test. 882 * Initialize a newly created argument definition test.
879 * 883 *
880 * @param question the token representing the question mark 884 * @param question the token representing the question mark
881 * @param identifier the identifier representing the argument being tested 885 * @param identifier the identifier representing the argument being tested
882 */ 886 */
883 ArgumentDefinitionTest({Token question, SimpleIdentifier identifier}) : this.f ull(question, identifier); 887 ArgumentDefinitionTest({Token question, SimpleIdentifier identifier}) : this.f ull(question, identifier);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 */ 932 */
929 class ArgumentList extends ASTNode { 933 class ArgumentList extends ASTNode {
930 /** 934 /**
931 * The left parenthesis. 935 * The left parenthesis.
932 */ 936 */
933 Token _leftParenthesis; 937 Token _leftParenthesis;
934 938
935 /** 939 /**
936 * The expressions producing the values of the arguments. 940 * The expressions producing the values of the arguments.
937 */ 941 */
938 NodeList<Expression> arguments; 942 NodeList<Expression> _arguments;
939 943
940 /** 944 /**
941 * The right parenthesis. 945 * The right parenthesis.
942 */ 946 */
943 Token _rightParenthesis; 947 Token _rightParenthesis;
944 948
945 /** 949 /**
946 * An array containing the elements representing the parameters corresponding to each of the 950 * 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 951 * 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 952 * method being invoked could not be determined based on static type informati on. The array must
(...skipping 12 matching lines...) Expand all
961 List<ParameterElement> _correspondingPropagatedParameters; 965 List<ParameterElement> _correspondingPropagatedParameters;
962 966
963 /** 967 /**
964 * Initialize a newly created list of arguments. 968 * Initialize a newly created list of arguments.
965 * 969 *
966 * @param leftParenthesis the left parenthesis 970 * @param leftParenthesis the left parenthesis
967 * @param arguments the expressions producing the values of the arguments 971 * @param arguments the expressions producing the values of the arguments
968 * @param rightParenthesis the right parenthesis 972 * @param rightParenthesis the right parenthesis
969 */ 973 */
970 ArgumentList.full(Token leftParenthesis, List<Expression> arguments, Token rig htParenthesis) { 974 ArgumentList.full(Token leftParenthesis, List<Expression> arguments, Token rig htParenthesis) {
971 this.arguments = new NodeList<Expression>(this); 975 this._arguments = new NodeList<Expression>(this);
972 this._leftParenthesis = leftParenthesis; 976 this._leftParenthesis = leftParenthesis;
973 this.arguments.addAll(arguments); 977 this._arguments.addAll(arguments);
974 this._rightParenthesis = rightParenthesis; 978 this._rightParenthesis = rightParenthesis;
975 } 979 }
976 980
977 /** 981 /**
978 * Initialize a newly created list of arguments. 982 * Initialize a newly created list of arguments.
979 * 983 *
980 * @param leftParenthesis the left parenthesis 984 * @param leftParenthesis the left parenthesis
981 * @param arguments the expressions producing the values of the arguments 985 * @param arguments the expressions producing the values of the arguments
982 * @param rightParenthesis the right parenthesis 986 * @param rightParenthesis the right parenthesis
983 */ 987 */
984 ArgumentList({Token leftParenthesis, List<Expression> arguments, Token rightPa renthesis}) : this.full(leftParenthesis, arguments, rightParenthesis); 988 ArgumentList({Token leftParenthesis, List<Expression> arguments, Token rightPa renthesis}) : this.full(leftParenthesis, arguments, rightParenthesis);
985 989
986 accept(ASTVisitor visitor) => visitor.visitArgumentList(this); 990 accept(ASTVisitor visitor) => visitor.visitArgumentList(this);
987 991
992 /**
993 * Return the expressions producing the values of the arguments. Although the language requires
994 * that positional arguments appear before named arguments, this class allows them to be
995 * intermixed.
996 *
997 * @return the expressions producing the values of the arguments
998 */
999 NodeList<Expression> get arguments => _arguments;
1000
988 Token get beginToken => _leftParenthesis; 1001 Token get beginToken => _leftParenthesis;
989 1002
990 Token get endToken => _rightParenthesis; 1003 Token get endToken => _rightParenthesis;
991 1004
992 /** 1005 /**
993 * Return the left parenthesis. 1006 * Return the left parenthesis.
994 * 1007 *
995 * @return the left parenthesis 1008 * @return the left parenthesis
996 */ 1009 */
997 Token get leftParenthesis => _leftParenthesis; 1010 Token get leftParenthesis => _leftParenthesis;
998 1011
999 /** 1012 /**
1000 * Return the right parenthesis. 1013 * Return the right parenthesis.
1001 * 1014 *
1002 * @return the right parenthesis 1015 * @return the right parenthesis
1003 */ 1016 */
1004 Token get rightParenthesis => _rightParenthesis; 1017 Token get rightParenthesis => _rightParenthesis;
1005 1018
1006 /** 1019 /**
1007 * Set the parameter elements corresponding to each of the arguments in this l ist to the given 1020 * 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 1021 * 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 1022 * arguments, but can contain `null` entries if a given argument does not corr espond to a
1010 * formal parameter. 1023 * formal parameter.
1011 * 1024 *
1012 * @param parameters the parameter elements corresponding to the arguments 1025 * @param parameters the parameter elements corresponding to the arguments
1013 */ 1026 */
1014 void set correspondingPropagatedParameters(List<ParameterElement> parameters) { 1027 void set correspondingPropagatedParameters(List<ParameterElement> parameters) {
1015 if (parameters.length != arguments.length) { 1028 if (parameters.length != _arguments.length) {
1016 throw new IllegalArgumentException("Expected ${arguments.length} parameter s, not ${parameters.length}"); 1029 throw new IllegalArgumentException("Expected ${_arguments.length} paramete rs, not ${parameters.length}");
1017 } 1030 }
1018 _correspondingPropagatedParameters = parameters; 1031 _correspondingPropagatedParameters = parameters;
1019 } 1032 }
1020 1033
1021 /** 1034 /**
1022 * Set the parameter elements corresponding to each of the arguments in this l ist to the given 1035 * 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 1036 * 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 1037 * arguments, but can contain `null` entries if a given argument does not corr espond to a
1025 * formal parameter. 1038 * formal parameter.
1026 * 1039 *
1027 * @param parameters the parameter elements corresponding to the arguments 1040 * @param parameters the parameter elements corresponding to the arguments
1028 */ 1041 */
1029 void set correspondingStaticParameters(List<ParameterElement> parameters) { 1042 void set correspondingStaticParameters(List<ParameterElement> parameters) {
1030 if (parameters.length != arguments.length) { 1043 if (parameters.length != _arguments.length) {
1031 throw new IllegalArgumentException("Expected ${arguments.length} parameter s, not ${parameters.length}"); 1044 throw new IllegalArgumentException("Expected ${_arguments.length} paramete rs, not ${parameters.length}");
1032 } 1045 }
1033 _correspondingStaticParameters = parameters; 1046 _correspondingStaticParameters = parameters;
1034 } 1047 }
1035 1048
1036 /** 1049 /**
1037 * Set the left parenthesis to the given token. 1050 * Set the left parenthesis to the given token.
1038 * 1051 *
1039 * @param parenthesis the left parenthesis 1052 * @param parenthesis the left parenthesis
1040 */ 1053 */
1041 void set leftParenthesis(Token parenthesis) { 1054 void set leftParenthesis(Token parenthesis) {
1042 _leftParenthesis = parenthesis; 1055 _leftParenthesis = parenthesis;
1043 } 1056 }
1044 1057
1045 /** 1058 /**
1046 * Set the right parenthesis to the given token. 1059 * Set the right parenthesis to the given token.
1047 * 1060 *
1048 * @param parenthesis the right parenthesis 1061 * @param parenthesis the right parenthesis
1049 */ 1062 */
1050 void set rightParenthesis(Token parenthesis) { 1063 void set rightParenthesis(Token parenthesis) {
1051 _rightParenthesis = parenthesis; 1064 _rightParenthesis = parenthesis;
1052 } 1065 }
1053 1066
1054 void visitChildren(ASTVisitor visitor) { 1067 void visitChildren(ASTVisitor visitor) {
1055 arguments.accept(visitor); 1068 _arguments.accept(visitor);
1056 } 1069 }
1057 1070
1058 /** 1071 /**
1059 * If the given expression is a child of this list, and the AST structure has been resolved, and 1072 * 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 1073 * 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 1074 * 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. 1075 * element representing the parameter to which the value of the given expressi on will be bound.
1063 * Otherwise, return `null`. 1076 * Otherwise, return `null`.
1064 * 1077 *
1065 * This method is only intended to be used by [Expression#getPropagatedParamet erElement]. 1078 * This method is only intended to be used by [Expression#getPropagatedParamet erElement].
1066 * 1079 *
1067 * @param expression the expression corresponding to the parameter to be retur ned 1080 * @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 1081 * @return the parameter element representing the parameter to which the value of the expression
1069 * will be bound 1082 * will be bound
1070 */ 1083 */
1071 ParameterElement getPropagatedParameterElementFor(Expression expression) { 1084 ParameterElement getPropagatedParameterElementFor(Expression expression) {
1072 if (_correspondingPropagatedParameters == null) { 1085 if (_correspondingPropagatedParameters == null) {
1073 return null; 1086 return null;
1074 } 1087 }
1075 int index = arguments.indexOf(expression); 1088 int index = _arguments.indexOf(expression);
1076 if (index < 0) { 1089 if (index < 0) {
1077 return null; 1090 return null;
1078 } 1091 }
1079 return _correspondingPropagatedParameters[index]; 1092 return _correspondingPropagatedParameters[index];
1080 } 1093 }
1081 1094
1082 /** 1095 /**
1083 * If the given expression is a child of this list, and the AST structure has been resolved, and 1096 * 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 1097 * 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 1098 * 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. 1099 * element representing the parameter to which the value of the given expressi on will be bound.
1087 * Otherwise, return `null`. 1100 * Otherwise, return `null`.
1088 * 1101 *
1089 * This method is only intended to be used by [Expression#getStaticParameterEl ement]. 1102 * This method is only intended to be used by [Expression#getStaticParameterEl ement].
1090 * 1103 *
1091 * @param expression the expression corresponding to the parameter to be retur ned 1104 * @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 1105 * @return the parameter element representing the parameter to which the value of the expression
1093 * will be bound 1106 * will be bound
1094 */ 1107 */
1095 ParameterElement getStaticParameterElementFor(Expression expression) { 1108 ParameterElement getStaticParameterElementFor(Expression expression) {
1096 if (_correspondingStaticParameters == null) { 1109 if (_correspondingStaticParameters == null) {
1097 return null; 1110 return null;
1098 } 1111 }
1099 int index = arguments.indexOf(expression); 1112 int index = _arguments.indexOf(expression);
1100 if (index < 0) { 1113 if (index < 0) {
1101 return null; 1114 return null;
1102 } 1115 }
1103 return _correspondingStaticParameters[index]; 1116 return _correspondingStaticParameters[index];
1104 } 1117 }
1105 } 1118 }
1106 1119
1107 /** 1120 /**
1108 * Instances of the class `AsExpression` represent an 'as' expression. 1121 * Instances of the class `AsExpression` represent an 'as' expression.
1109 * 1122 *
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 1249
1237 /** 1250 /**
1238 * Initialize a newly created assert statement. 1251 * Initialize a newly created assert statement.
1239 * 1252 *
1240 * @param keyword the token representing the 'assert' keyword 1253 * @param keyword the token representing the 'assert' keyword
1241 * @param leftParenthesis the left parenthesis 1254 * @param leftParenthesis the left parenthesis
1242 * @param condition the condition that is being asserted to be `true` 1255 * @param condition the condition that is being asserted to be `true`
1243 * @param rightParenthesis the right parenthesis 1256 * @param rightParenthesis the right parenthesis
1244 * @param semicolon the semicolon terminating the statement 1257 * @param semicolon the semicolon terminating the statement
1245 */ 1258 */
1246 AssertStatement.full(Token keyword, Token leftParenthesis, Expression conditio n, Token rightParenthesis, Token semicolon) { 1259 AssertStatement.full(this.keyword, this.leftParenthesis, Expression condition, this.rightParenthesis, this.semicolon) {
1247 this.keyword = keyword;
1248 this.leftParenthesis = leftParenthesis;
1249 this._condition = becomeParentOf(condition); 1260 this._condition = becomeParentOf(condition);
1250 this.rightParenthesis = rightParenthesis;
1251 this.semicolon = semicolon;
1252 } 1261 }
1253 1262
1254 /** 1263 /**
1255 * Initialize a newly created assert statement. 1264 * Initialize a newly created assert statement.
1256 * 1265 *
1257 * @param keyword the token representing the 'assert' keyword 1266 * @param keyword the token representing the 'assert' keyword
1258 * @param leftParenthesis the left parenthesis 1267 * @param leftParenthesis the left parenthesis
1259 * @param condition the condition that is being asserted to be `true` 1268 * @param condition the condition that is being asserted to be `true`
1260 * @param rightParenthesis the right parenthesis 1269 * @param rightParenthesis the right parenthesis
1261 * @param semicolon the semicolon terminating the statement 1270 * @param semicolon the semicolon terminating the statement
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 */ 1338 */
1330 MethodElement _propagatedElement; 1339 MethodElement _propagatedElement;
1331 1340
1332 /** 1341 /**
1333 * Initialize a newly created assignment expression. 1342 * Initialize a newly created assignment expression.
1334 * 1343 *
1335 * @param leftHandSide the expression used to compute the left hand side 1344 * @param leftHandSide the expression used to compute the left hand side
1336 * @param operator the assignment operator being applied 1345 * @param operator the assignment operator being applied
1337 * @param rightHandSide the expression used to compute the right hand side 1346 * @param rightHandSide the expression used to compute the right hand side
1338 */ 1347 */
1339 AssignmentExpression.full(Expression leftHandSide, Token operator, Expression rightHandSide) { 1348 AssignmentExpression.full(Expression leftHandSide, this.operator, Expression r ightHandSide) {
1340 this._leftHandSide = becomeParentOf(leftHandSide); 1349 this._leftHandSide = becomeParentOf(leftHandSide);
1341 this.operator = operator;
1342 this._rightHandSide = becomeParentOf(rightHandSide); 1350 this._rightHandSide = becomeParentOf(rightHandSide);
1343 } 1351 }
1344 1352
1345 /** 1353 /**
1346 * Initialize a newly created assignment expression. 1354 * Initialize a newly created assignment expression.
1347 * 1355 *
1348 * @param leftHandSide the expression used to compute the left hand side 1356 * @param leftHandSide the expression used to compute the left hand side
1349 * @param operator the assignment operator being applied 1357 * @param operator the assignment operator being applied
1350 * @param rightHandSide the expression used to compute the right hand side 1358 * @param rightHandSide the expression used to compute the right hand side
1351 */ 1359 */
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 */ 1543 */
1536 MethodElement _propagatedElement; 1544 MethodElement _propagatedElement;
1537 1545
1538 /** 1546 /**
1539 * Initialize a newly created binary expression. 1547 * Initialize a newly created binary expression.
1540 * 1548 *
1541 * @param leftOperand the expression used to compute the left operand 1549 * @param leftOperand the expression used to compute the left operand
1542 * @param operator the binary operator being applied 1550 * @param operator the binary operator being applied
1543 * @param rightOperand the expression used to compute the right operand 1551 * @param rightOperand the expression used to compute the right operand
1544 */ 1552 */
1545 BinaryExpression.full(Expression leftOperand, Token operator, Expression right Operand) { 1553 BinaryExpression.full(Expression leftOperand, this.operator, Expression rightO perand) {
1546 this._leftOperand = becomeParentOf(leftOperand); 1554 this._leftOperand = becomeParentOf(leftOperand);
1547 this.operator = operator;
1548 this._rightOperand = becomeParentOf(rightOperand); 1555 this._rightOperand = becomeParentOf(rightOperand);
1549 } 1556 }
1550 1557
1551 /** 1558 /**
1552 * Initialize a newly created binary expression. 1559 * Initialize a newly created binary expression.
1553 * 1560 *
1554 * @param leftOperand the expression used to compute the left operand 1561 * @param leftOperand the expression used to compute the left operand
1555 * @param operator the binary operator being applied 1562 * @param operator the binary operator being applied
1556 * @param rightOperand the expression used to compute the right operand 1563 * @param rightOperand the expression used to compute the right operand
1557 */ 1564 */
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1713 */ 1720 */
1714 class Block extends Statement { 1721 class Block extends Statement {
1715 /** 1722 /**
1716 * The left curly bracket. 1723 * The left curly bracket.
1717 */ 1724 */
1718 Token leftBracket; 1725 Token leftBracket;
1719 1726
1720 /** 1727 /**
1721 * The statements contained in the block. 1728 * The statements contained in the block.
1722 */ 1729 */
1723 NodeList<Statement> statements; 1730 NodeList<Statement> _statements;
1724 1731
1725 /** 1732 /**
1726 * The right curly bracket. 1733 * The right curly bracket.
1727 */ 1734 */
1728 Token rightBracket; 1735 Token rightBracket;
1729 1736
1730 /** 1737 /**
1731 * Initialize a newly created block of code. 1738 * Initialize a newly created block of code.
1732 * 1739 *
1733 * @param leftBracket the left curly bracket 1740 * @param leftBracket the left curly bracket
1734 * @param statements the statements contained in the block 1741 * @param statements the statements contained in the block
1735 * @param rightBracket the right curly bracket 1742 * @param rightBracket the right curly bracket
1736 */ 1743 */
1737 Block.full(Token leftBracket, List<Statement> statements, Token rightBracket) { 1744 Block.full(this.leftBracket, List<Statement> statements, this.rightBracket) {
1738 this.statements = new NodeList<Statement>(this); 1745 this._statements = new NodeList<Statement>(this);
1739 this.leftBracket = leftBracket; 1746 this._statements.addAll(statements);
1740 this.statements.addAll(statements);
1741 this.rightBracket = rightBracket;
1742 } 1747 }
1743 1748
1744 /** 1749 /**
1745 * Initialize a newly created block of code. 1750 * Initialize a newly created block of code.
1746 * 1751 *
1747 * @param leftBracket the left curly bracket 1752 * @param leftBracket the left curly bracket
1748 * @param statements the statements contained in the block 1753 * @param statements the statements contained in the block
1749 * @param rightBracket the right curly bracket 1754 * @param rightBracket the right curly bracket
1750 */ 1755 */
1751 Block({Token leftBracket, List<Statement> statements, Token rightBracket}) : t his.full(leftBracket, statements, rightBracket); 1756 Block({Token leftBracket, List<Statement> statements, Token rightBracket}) : t his.full(leftBracket, statements, rightBracket);
1752 1757
1753 accept(ASTVisitor visitor) => visitor.visitBlock(this); 1758 accept(ASTVisitor visitor) => visitor.visitBlock(this);
1754 1759
1755 Token get beginToken => leftBracket; 1760 Token get beginToken => leftBracket;
1756 1761
1757 Token get endToken => rightBracket; 1762 Token get endToken => rightBracket;
1758 1763
1764 /**
1765 * Return the statements contained in the block.
1766 *
1767 * @return the statements contained in the block
1768 */
1769 NodeList<Statement> get statements => _statements;
1770
1759 void visitChildren(ASTVisitor visitor) { 1771 void visitChildren(ASTVisitor visitor) {
1760 statements.accept(visitor); 1772 _statements.accept(visitor);
1761 } 1773 }
1762 } 1774 }
1763 1775
1764 /** 1776 /**
1765 * Instances of the class `BlockFunctionBody` represent a function body that con sists of a 1777 * Instances of the class `BlockFunctionBody` represent a function body that con sists of a
1766 * block of statements. 1778 * block of statements.
1767 * 1779 *
1768 * <pre> 1780 * <pre>
1769 * blockFunctionBody ::= 1781 * blockFunctionBody ::=
1770 * [Block] 1782 * [Block]
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1841 * The value of the literal. 1853 * The value of the literal.
1842 */ 1854 */
1843 bool value = false; 1855 bool value = false;
1844 1856
1845 /** 1857 /**
1846 * Initialize a newly created boolean literal. 1858 * Initialize a newly created boolean literal.
1847 * 1859 *
1848 * @param literal the token representing the literal 1860 * @param literal the token representing the literal
1849 * @param value the value of the literal 1861 * @param value the value of the literal
1850 */ 1862 */
1851 BooleanLiteral.full(Token literal, bool value) { 1863 BooleanLiteral.full(this.literal, this.value);
1852 this.literal = literal;
1853 this.value = value;
1854 }
1855 1864
1856 /** 1865 /**
1857 * Initialize a newly created boolean literal. 1866 * Initialize a newly created boolean literal.
1858 * 1867 *
1859 * @param literal the token representing the literal 1868 * @param literal the token representing the literal
1860 * @param value the value of the literal 1869 * @param value the value of the literal
1861 */ 1870 */
1862 BooleanLiteral({Token literal, bool value}) : this.full(literal, value); 1871 BooleanLiteral({Token literal, bool value}) : this.full(literal, value);
1863 1872
1864 accept(ASTVisitor visitor) => visitor.visitBooleanLiteral(this); 1873 accept(ASTVisitor visitor) => visitor.visitBooleanLiteral(this);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1899 */ 1908 */
1900 Token semicolon; 1909 Token semicolon;
1901 1910
1902 /** 1911 /**
1903 * Initialize a newly created break statement. 1912 * Initialize a newly created break statement.
1904 * 1913 *
1905 * @param keyword the token representing the 'break' keyword 1914 * @param keyword the token representing the 'break' keyword
1906 * @param label the label associated with the statement 1915 * @param label the label associated with the statement
1907 * @param semicolon the semicolon terminating the statement 1916 * @param semicolon the semicolon terminating the statement
1908 */ 1917 */
1909 BreakStatement.full(Token keyword, SimpleIdentifier label, Token semicolon) { 1918 BreakStatement.full(this.keyword, SimpleIdentifier label, this.semicolon) {
1910 this.keyword = keyword;
1911 this._label = becomeParentOf(label); 1919 this._label = becomeParentOf(label);
1912 this.semicolon = semicolon;
1913 } 1920 }
1914 1921
1915 /** 1922 /**
1916 * Initialize a newly created break statement. 1923 * Initialize a newly created break statement.
1917 * 1924 *
1918 * @param keyword the token representing the 'break' keyword 1925 * @param keyword the token representing the 'break' keyword
1919 * @param label the label associated with the statement 1926 * @param label the label associated with the statement
1920 * @param semicolon the semicolon terminating the statement 1927 * @param semicolon the semicolon terminating the statement
1921 */ 1928 */
1922 BreakStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : thi s.full(keyword, label, semicolon); 1929 BreakStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : thi s.full(keyword, label, semicolon);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1970 */ 1977 */
1971 class CascadeExpression extends Expression { 1978 class CascadeExpression extends Expression {
1972 /** 1979 /**
1973 * The target of the cascade sections. 1980 * The target of the cascade sections.
1974 */ 1981 */
1975 Expression _target; 1982 Expression _target;
1976 1983
1977 /** 1984 /**
1978 * The cascade sections sharing the common target. 1985 * The cascade sections sharing the common target.
1979 */ 1986 */
1980 NodeList<Expression> cascadeSections; 1987 NodeList<Expression> _cascadeSections;
1981 1988
1982 /** 1989 /**
1983 * Initialize a newly created cascade expression. 1990 * Initialize a newly created cascade expression.
1984 * 1991 *
1985 * @param target the target of the cascade sections 1992 * @param target the target of the cascade sections
1986 * @param cascadeSections the cascade sections sharing the common target 1993 * @param cascadeSections the cascade sections sharing the common target
1987 */ 1994 */
1988 CascadeExpression.full(Expression target, List<Expression> cascadeSections) { 1995 CascadeExpression.full(Expression target, List<Expression> cascadeSections) {
1989 this.cascadeSections = new NodeList<Expression>(this); 1996 this._cascadeSections = new NodeList<Expression>(this);
1990 this._target = becomeParentOf(target); 1997 this._target = becomeParentOf(target);
1991 this.cascadeSections.addAll(cascadeSections); 1998 this._cascadeSections.addAll(cascadeSections);
1992 } 1999 }
1993 2000
1994 /** 2001 /**
1995 * Initialize a newly created cascade expression. 2002 * Initialize a newly created cascade expression.
1996 * 2003 *
1997 * @param target the target of the cascade sections 2004 * @param target the target of the cascade sections
1998 * @param cascadeSections the cascade sections sharing the common target 2005 * @param cascadeSections the cascade sections sharing the common target
1999 */ 2006 */
2000 CascadeExpression({Expression target, List<Expression> cascadeSections}) : thi s.full(target, cascadeSections); 2007 CascadeExpression({Expression target, List<Expression> cascadeSections}) : thi s.full(target, cascadeSections);
2001 2008
2002 accept(ASTVisitor visitor) => visitor.visitCascadeExpression(this); 2009 accept(ASTVisitor visitor) => visitor.visitCascadeExpression(this);
2003 2010
2004 Token get beginToken => _target.beginToken; 2011 Token get beginToken => _target.beginToken;
2005 2012
2006 Token get endToken => cascadeSections.endToken; 2013 /**
2014 * Return the cascade sections sharing the common target.
2015 *
2016 * @return the cascade sections sharing the common target
2017 */
2018 NodeList<Expression> get cascadeSections => _cascadeSections;
2019
2020 Token get endToken => _cascadeSections.endToken;
2007 2021
2008 int get precedence => 2; 2022 int get precedence => 2;
2009 2023
2010 /** 2024 /**
2011 * Return the target of the cascade sections. 2025 * Return the target of the cascade sections.
2012 * 2026 *
2013 * @return the target of the cascade sections 2027 * @return the target of the cascade sections
2014 */ 2028 */
2015 Expression get target => _target; 2029 Expression get target => _target;
2016 2030
2017 /** 2031 /**
2018 * Set the target of the cascade sections to the given expression. 2032 * Set the target of the cascade sections to the given expression.
2019 * 2033 *
2020 * @param target the target of the cascade sections 2034 * @param target the target of the cascade sections
2021 */ 2035 */
2022 void set target(Expression target) { 2036 void set target(Expression target) {
2023 this._target = becomeParentOf(target); 2037 this._target = becomeParentOf(target);
2024 } 2038 }
2025 2039
2026 void visitChildren(ASTVisitor visitor) { 2040 void visitChildren(ASTVisitor visitor) {
2027 safelyVisitChild(_target, visitor); 2041 safelyVisitChild(_target, visitor);
2028 cascadeSections.accept(visitor); 2042 _cascadeSections.accept(visitor);
2029 } 2043 }
2030 } 2044 }
2031 2045
2032 /** 2046 /**
2033 * Instances of the class `CatchClause` represent a catch clause within a try st atement. 2047 * Instances of the class `CatchClause` represent a catch clause within a try st atement.
2034 * 2048 *
2035 * <pre> 2049 * <pre>
2036 * onPart ::= 2050 * onPart ::=
2037 * catchPart [Block] 2051 * catchPart [Block]
2038 * | 'on' type catchPart? [Block] 2052 * | '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 2112 * @param onKeyword the token representing the 'on' keyword
2099 * @param exceptionType the type of exceptions caught by this catch clause 2113 * @param exceptionType the type of exceptions caught by this catch clause
2100 * @param leftParenthesis the left parenthesis 2114 * @param leftParenthesis the left parenthesis
2101 * @param exceptionParameter the parameter whose value will be the exception t hat was thrown 2115 * @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 2116 * @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 2117 * @param stackTraceParameter the parameter whose value will be the stack trac e associated with
2104 * the exception 2118 * the exception
2105 * @param rightParenthesis the right parenthesis 2119 * @param rightParenthesis the right parenthesis
2106 * @param body the body of the catch block 2120 * @param body the body of the catch block
2107 */ 2121 */
2108 CatchClause.full(Token onKeyword, TypeName exceptionType, Token catchKeyword, Token leftParenthesis, SimpleIdentifier exceptionParameter, Token comma, SimpleI dentifier stackTraceParameter, Token rightParenthesis, Block body) { 2122 CatchClause.full(this.onKeyword, TypeName exceptionType, this.catchKeyword, To ken leftParenthesis, SimpleIdentifier exceptionParameter, this.comma, SimpleIden tifier stackTraceParameter, Token rightParenthesis, Block body) {
2109 this.onKeyword = onKeyword;
2110 this.exceptionType = becomeParentOf(exceptionType); 2123 this.exceptionType = becomeParentOf(exceptionType);
2111 this.catchKeyword = catchKeyword;
2112 this._leftParenthesis = leftParenthesis; 2124 this._leftParenthesis = leftParenthesis;
2113 this._exceptionParameter = becomeParentOf(exceptionParameter); 2125 this._exceptionParameter = becomeParentOf(exceptionParameter);
2114 this.comma = comma;
2115 this._stackTraceParameter = becomeParentOf(stackTraceParameter); 2126 this._stackTraceParameter = becomeParentOf(stackTraceParameter);
2116 this._rightParenthesis = rightParenthesis; 2127 this._rightParenthesis = rightParenthesis;
2117 this._body = becomeParentOf(body); 2128 this._body = becomeParentOf(body);
2118 } 2129 }
2119 2130
2120 /** 2131 /**
2121 * Initialize a newly created catch clause. 2132 * Initialize a newly created catch clause.
2122 * 2133 *
2123 * @param onKeyword the token representing the 'on' keyword 2134 * @param onKeyword the token representing the 'on' keyword
2124 * @param exceptionType the type of exceptions caught by this catch clause 2135 * @param exceptionType the type of exceptions caught by this catch clause
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2291 NativeClause nativeClause; 2302 NativeClause nativeClause;
2292 2303
2293 /** 2304 /**
2294 * The left curly bracket. 2305 * The left curly bracket.
2295 */ 2306 */
2296 Token leftBracket; 2307 Token leftBracket;
2297 2308
2298 /** 2309 /**
2299 * The members defined by the class. 2310 * The members defined by the class.
2300 */ 2311 */
2301 NodeList<ClassMember> members; 2312 NodeList<ClassMember> _members;
2302 2313
2303 /** 2314 /**
2304 * The right curly bracket. 2315 * The right curly bracket.
2305 */ 2316 */
2306 Token rightBracket; 2317 Token rightBracket;
2307 2318
2308 /** 2319 /**
2309 * Initialize a newly created class declaration. 2320 * Initialize a newly created class declaration.
2310 * 2321 *
2311 * @param comment the documentation comment associated with this class 2322 * @param comment the documentation comment associated with this class
2312 * @param metadata the annotations associated with this class 2323 * @param metadata the annotations associated with this class
2313 * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was absent 2324 * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was absent
2314 * @param classKeyword the token representing the 'class' keyword 2325 * @param classKeyword the token representing the 'class' keyword
2315 * @param name the name of the class being declared 2326 * @param name the name of the class being declared
2316 * @param typeParameters the type parameters for the class 2327 * @param typeParameters the type parameters for the class
2317 * @param extendsClause the extends clause for the class 2328 * @param extendsClause the extends clause for the class
2318 * @param withClause the with clause for the class 2329 * @param withClause the with clause for the class
2319 * @param implementsClause the implements clause for the class 2330 * @param implementsClause the implements clause for the class
2320 * @param leftBracket the left curly bracket 2331 * @param leftBracket the left curly bracket
2321 * @param members the members defined by the class 2332 * @param members the members defined by the class
2322 * @param rightBracket the right curly bracket 2333 * @param rightBracket the right curly bracket
2323 */ 2334 */
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) { 2335 ClassDeclaration.full(Comment comment, List<Annotation> metadata, this.abstrac tKeyword, this.classKeyword, SimpleIdentifier name, TypeParameterList typeParame ters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause imple mentsClause, this.leftBracket, List<ClassMember> members, this.rightBracket) : s uper.full(comment, metadata) {
2325 this.members = new NodeList<ClassMember>(this); 2336 this._members = new NodeList<ClassMember>(this);
2326 this.abstractKeyword = abstractKeyword;
2327 this.classKeyword = classKeyword;
2328 this._name = becomeParentOf(name); 2337 this._name = becomeParentOf(name);
2329 this.typeParameters = becomeParentOf(typeParameters); 2338 this.typeParameters = becomeParentOf(typeParameters);
2330 this._extendsClause = becomeParentOf(extendsClause); 2339 this._extendsClause = becomeParentOf(extendsClause);
2331 this._withClause = becomeParentOf(withClause); 2340 this._withClause = becomeParentOf(withClause);
2332 this._implementsClause = becomeParentOf(implementsClause); 2341 this._implementsClause = becomeParentOf(implementsClause);
2333 this.leftBracket = leftBracket; 2342 this._members.addAll(members);
2334 this.members.addAll(members);
2335 this.rightBracket = rightBracket;
2336 } 2343 }
2337 2344
2338 /** 2345 /**
2339 * Initialize a newly created class declaration. 2346 * Initialize a newly created class declaration.
2340 * 2347 *
2341 * @param comment the documentation comment associated with this class 2348 * @param comment the documentation comment associated with this class
2342 * @param metadata the annotations associated with this class 2349 * @param metadata the annotations associated with this class
2343 * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was absent 2350 * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was absent
2344 * @param classKeyword the token representing the 'class' keyword 2351 * @param classKeyword the token representing the 'class' keyword
2345 * @param name the name of the class being declared 2352 * @param name the name of the class being declared
(...skipping 23 matching lines...) Expand all
2369 2376
2370 /** 2377 /**
2371 * Return the implements clause for the class, or `null` if the class does not implement any 2378 * Return the implements clause for the class, or `null` if the class does not implement any
2372 * interfaces. 2379 * interfaces.
2373 * 2380 *
2374 * @return the implements clause for the class 2381 * @return the implements clause for the class
2375 */ 2382 */
2376 ImplementsClause get implementsClause => _implementsClause; 2383 ImplementsClause get implementsClause => _implementsClause;
2377 2384
2378 /** 2385 /**
2386 * Return the members defined by the class.
2387 *
2388 * @return the members defined by the class
2389 */
2390 NodeList<ClassMember> get members => _members;
2391
2392 /**
2379 * Return the name of the class being declared. 2393 * Return the name of the class being declared.
2380 * 2394 *
2381 * @return the name of the class being declared 2395 * @return the name of the class being declared
2382 */ 2396 */
2383 SimpleIdentifier get name => _name; 2397 SimpleIdentifier get name => _name;
2384 2398
2385 /** 2399 /**
2386 * Return the with clause for the class, or `null` if the class does not have a with clause. 2400 * Return the with clause for the class, or `null` if the class does not have a with clause.
2387 * 2401 *
2388 * @return the with clause for the class 2402 * @return the with clause for the class
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 * @param keyword the token representing the 'typedef' keyword 2541 * @param keyword the token representing the 'typedef' keyword
2528 * @param name the name of the class being declared 2542 * @param name the name of the class being declared
2529 * @param typeParameters the type parameters for the class 2543 * @param typeParameters the type parameters for the class
2530 * @param equals the token for the '=' separating the name from the definition 2544 * @param equals the token for the '=' separating the name from the definition
2531 * @param abstractKeyword the token for the 'abstract' keyword 2545 * @param abstractKeyword the token for the 'abstract' keyword
2532 * @param superclass the name of the superclass of the class being declared 2546 * @param superclass the name of the superclass of the class being declared
2533 * @param withClause the with clause for this class 2547 * @param withClause the with clause for this class
2534 * @param implementsClause the implements clause for this class 2548 * @param implementsClause the implements clause for this class
2535 * @param semicolon the semicolon terminating the declaration 2549 * @param semicolon the semicolon terminating the declaration
2536 */ 2550 */
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) { 2551 ClassTypeAlias.full(Comment comment, List<Annotation> metadata, Token keyword, SimpleIdentifier name, TypeParameterList typeParameters, this.equals, this.abst ractKeyword, TypeName superclass, WithClause withClause, ImplementsClause implem entsClause, Token semicolon) : super.full(comment, metadata, keyword, semicolon) {
2538 this._name = becomeParentOf(name); 2552 this._name = becomeParentOf(name);
2539 this._typeParameters = becomeParentOf(typeParameters); 2553 this._typeParameters = becomeParentOf(typeParameters);
2540 this.equals = equals;
2541 this.abstractKeyword = abstractKeyword;
2542 this._superclass = becomeParentOf(superclass); 2554 this._superclass = becomeParentOf(superclass);
2543 this._withClause = becomeParentOf(withClause); 2555 this._withClause = becomeParentOf(withClause);
2544 this._implementsClause = becomeParentOf(implementsClause); 2556 this._implementsClause = becomeParentOf(implementsClause);
2545 } 2557 }
2546 2558
2547 /** 2559 /**
2548 * Initialize a newly created class type alias. 2560 * Initialize a newly created class type alias.
2549 * 2561 *
2550 * @param comment the documentation comment associated with this type alias 2562 * @param comment the documentation comment associated with this type alias
2551 * @param metadata the annotations associated with this type alias 2563 * @param metadata the annotations associated with this type alias
(...skipping 121 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. 2685 * The keyword specifying what kind of processing is to be done on the importe d names.
2674 */ 2686 */
2675 Token keyword; 2687 Token keyword;
2676 2688
2677 /** 2689 /**
2678 * Initialize a newly created import combinator. 2690 * Initialize a newly created import combinator.
2679 * 2691 *
2680 * @param keyword the keyword specifying what kind of processing is to be done on the imported 2692 * @param keyword the keyword specifying what kind of processing is to be done on the imported
2681 * names 2693 * names
2682 */ 2694 */
2683 Combinator.full(Token keyword) { 2695 Combinator.full(this.keyword);
2684 this.keyword = keyword;
2685 }
2686 2696
2687 /** 2697 /**
2688 * Initialize a newly created import combinator. 2698 * Initialize a newly created import combinator.
2689 * 2699 *
2690 * @param keyword the keyword specifying what kind of processing is to be done on the imported 2700 * @param keyword the keyword specifying what kind of processing is to be done on the imported
2691 * names 2701 * names
2692 */ 2702 */
2693 Combinator({Token keyword}) : this.full(keyword); 2703 Combinator({Token keyword}) : this.full(keyword);
2694 2704
2695 Token get beginToken => keyword; 2705 Token get beginToken => keyword;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2747 * Create an end-of-line comment. 2757 * Create an end-of-line comment.
2748 * 2758 *
2749 * @param tokens the tokens representing the comment 2759 * @param tokens the tokens representing the comment
2750 * @return the end-of-line comment that was created 2760 * @return the end-of-line comment that was created
2751 */ 2761 */
2752 static Comment createEndOfLineComment(List<Token> tokens) => new Comment.full( tokens, CommentType.END_OF_LINE, null); 2762 static Comment createEndOfLineComment(List<Token> tokens) => new Comment.full( tokens, CommentType.END_OF_LINE, null);
2753 2763
2754 /** 2764 /**
2755 * The tokens representing the comment. 2765 * The tokens representing the comment.
2756 */ 2766 */
2757 List<Token> tokens; 2767 final List<Token> tokens;
2758 2768
2759 /** 2769 /**
2760 * The type of the comment. 2770 * The type of the comment.
2761 */ 2771 */
2762 CommentType _type; 2772 CommentType _type;
2763 2773
2764 /** 2774 /**
2765 * The references embedded within the documentation comment. This list will be empty unless this 2775 * 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. 2776 * is a documentation comment that has references embedded within it.
2767 */ 2777 */
2768 NodeList<CommentReference> references; 2778 NodeList<CommentReference> _references;
2769 2779
2770 /** 2780 /**
2771 * Initialize a newly created comment. 2781 * Initialize a newly created comment.
2772 * 2782 *
2773 * @param tokens the tokens representing the comment 2783 * @param tokens the tokens representing the comment
2774 * @param type the type of the comment 2784 * @param type the type of the comment
2775 * @param references the references embedded within the documentation comment 2785 * @param references the references embedded within the documentation comment
2776 */ 2786 */
2777 Comment.full(List<Token> tokens, CommentType type, List<CommentReference> refe rences) { 2787 Comment.full(this.tokens, CommentType type, List<CommentReference> references) {
2778 this.references = new NodeList<CommentReference>(this); 2788 this._references = new NodeList<CommentReference>(this);
2779 this.tokens = tokens;
2780 this._type = type; 2789 this._type = type;
2781 this.references.addAll(references); 2790 this._references.addAll(references);
2782 } 2791 }
2783 2792
2784 /** 2793 /**
2785 * Initialize a newly created comment. 2794 * Initialize a newly created comment.
2786 * 2795 *
2787 * @param tokens the tokens representing the comment 2796 * @param tokens the tokens representing the comment
2788 * @param type the type of the comment 2797 * @param type the type of the comment
2789 * @param references the references embedded within the documentation comment 2798 * @param references the references embedded within the documentation comment
2790 */ 2799 */
2791 Comment({List<Token> tokens, CommentType type, List<CommentReference> referenc es}) : this.full(tokens, type, references); 2800 Comment({List<Token> tokens, CommentType type, List<CommentReference> referenc es}) : this.full(tokens, type, references);
2792 2801
2793 accept(ASTVisitor visitor) => visitor.visitComment(this); 2802 accept(ASTVisitor visitor) => visitor.visitComment(this);
2794 2803
2795 Token get beginToken => tokens[0]; 2804 Token get beginToken => tokens[0];
2796 2805
2797 Token get endToken => tokens[tokens.length - 1]; 2806 Token get endToken => tokens[tokens.length - 1];
2798 2807
2799 /** 2808 /**
2809 * Return the references embedded within the documentation comment.
2810 *
2811 * @return the references embedded within the documentation comment
2812 */
2813 NodeList<CommentReference> get references => _references;
2814
2815 /**
2800 * Return `true` if this is a block comment. 2816 * Return `true` if this is a block comment.
2801 * 2817 *
2802 * @return `true` if this is a block comment 2818 * @return `true` if this is a block comment
2803 */ 2819 */
2804 bool get isBlock => identical(_type, CommentType.BLOCK); 2820 bool get isBlock => identical(_type, CommentType.BLOCK);
2805 2821
2806 /** 2822 /**
2807 * Return `true` if this is a documentation comment. 2823 * Return `true` if this is a documentation comment.
2808 * 2824 *
2809 * @return `true` if this is a documentation comment 2825 * @return `true` if this is a documentation comment
2810 */ 2826 */
2811 bool get isDocumentation => identical(_type, CommentType.DOCUMENTATION); 2827 bool get isDocumentation => identical(_type, CommentType.DOCUMENTATION);
2812 2828
2813 /** 2829 /**
2814 * Return `true` if this is an end-of-line comment. 2830 * Return `true` if this is an end-of-line comment.
2815 * 2831 *
2816 * @return `true` if this is an end-of-line comment 2832 * @return `true` if this is an end-of-line comment
2817 */ 2833 */
2818 bool get isEndOfLine => identical(_type, CommentType.END_OF_LINE); 2834 bool get isEndOfLine => identical(_type, CommentType.END_OF_LINE);
2819 2835
2820 void visitChildren(ASTVisitor visitor) { 2836 void visitChildren(ASTVisitor visitor) {
2821 references.accept(visitor); 2837 _references.accept(visitor);
2822 } 2838 }
2823 } 2839 }
2824 2840
2825 /** 2841 /**
2826 * The enumeration `CommentType` encodes all the different types of comments tha t are 2842 * The enumeration `CommentType` encodes all the different types of comments tha t are
2827 * recognized by the parser. 2843 * recognized by the parser.
2828 */ 2844 */
2829 class CommentType extends Enum<CommentType> { 2845 class CommentType extends Enum<CommentType> {
2830 /** 2846 /**
2831 * An end-of-line comment. 2847 * An end-of-line comment.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2868 * The identifier being referenced. 2884 * The identifier being referenced.
2869 */ 2885 */
2870 Identifier _identifier; 2886 Identifier _identifier;
2871 2887
2872 /** 2888 /**
2873 * Initialize a newly created reference to a Dart element. 2889 * Initialize a newly created reference to a Dart element.
2874 * 2890 *
2875 * @param newKeyword the token representing the 'new' keyword 2891 * @param newKeyword the token representing the 'new' keyword
2876 * @param identifier the identifier being referenced 2892 * @param identifier the identifier being referenced
2877 */ 2893 */
2878 CommentReference.full(Token newKeyword, Identifier identifier) { 2894 CommentReference.full(this.newKeyword, Identifier identifier) {
2879 this.newKeyword = newKeyword;
2880 this._identifier = becomeParentOf(identifier); 2895 this._identifier = becomeParentOf(identifier);
2881 } 2896 }
2882 2897
2883 /** 2898 /**
2884 * Initialize a newly created reference to a Dart element. 2899 * Initialize a newly created reference to a Dart element.
2885 * 2900 *
2886 * @param newKeyword the token representing the 'new' keyword 2901 * @param newKeyword the token representing the 'new' keyword
2887 * @param identifier the identifier being referenced 2902 * @param identifier the identifier being referenced
2888 */ 2903 */
2889 CommentReference({Token newKeyword, Identifier identifier}) : this.full(newKey word, identifier); 2904 CommentReference({Token newKeyword, Identifier identifier}) : this.full(newKey word, identifier);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
2938 * declarations ::= 2953 * declarations ::=
2939 * [CompilationUnitMember]* 2954 * [CompilationUnitMember]*
2940 * </pre> 2955 * </pre>
2941 * 2956 *
2942 * @coverage dart.engine.ast 2957 * @coverage dart.engine.ast
2943 */ 2958 */
2944 class CompilationUnit extends ASTNode { 2959 class CompilationUnit extends ASTNode {
2945 /** 2960 /**
2946 * The first token in the token stream that was parsed to form this compilatio n unit. 2961 * The first token in the token stream that was parsed to form this compilatio n unit.
2947 */ 2962 */
2948 Token _beginToken; 2963 final Token beginToken;
2949 2964
2950 /** 2965 /**
2951 * The script tag at the beginning of the compilation unit, or `null` if there is no script 2966 * The script tag at the beginning of the compilation unit, or `null` if there is no script
2952 * tag in this compilation unit. 2967 * tag in this compilation unit.
2953 */ 2968 */
2954 ScriptTag _scriptTag; 2969 ScriptTag _scriptTag;
2955 2970
2956 /** 2971 /**
2957 * The directives contained in this compilation unit. 2972 * The directives contained in this compilation unit.
2958 */ 2973 */
2959 NodeList<Directive> directives; 2974 NodeList<Directive> _directives;
2960 2975
2961 /** 2976 /**
2962 * The declarations contained in this compilation unit. 2977 * The declarations contained in this compilation unit.
2963 */ 2978 */
2964 NodeList<CompilationUnitMember> declarations; 2979 NodeList<CompilationUnitMember> _declarations;
2965 2980
2966 /** 2981 /**
2967 * The last token in the token stream that was parsed to form this compilation unit. This token 2982 * 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]. 2983 * should always have a type of [TokenType.EOF].
2969 */ 2984 */
2970 Token _endToken; 2985 final Token endToken;
2971 2986
2972 /** 2987 /**
2973 * The element associated with this compilation unit, or `null` if the AST str ucture has not 2988 * The element associated with this compilation unit, or `null` if the AST str ucture has not
2974 * been resolved. 2989 * been resolved.
2975 */ 2990 */
2976 CompilationUnitElement element; 2991 CompilationUnitElement element;
2977 2992
2978 /** 2993 /**
2979 * The line information for this compilation unit. 2994 * The line information for this compilation unit.
2980 */ 2995 */
2981 LineInfo lineInfo; 2996 LineInfo lineInfo;
2982 2997
2983 /** 2998 /**
2984 * Initialize a newly created compilation unit to have the given directives an d declarations. 2999 * Initialize a newly created compilation unit to have the given directives an d declarations.
2985 * 3000 *
2986 * @param beginToken the first token in the token stream 3001 * @param beginToken the first token in the token stream
2987 * @param scriptTag the script tag at the beginning of the compilation unit 3002 * @param scriptTag the script tag at the beginning of the compilation unit
2988 * @param directives the directives contained in this compilation unit 3003 * @param directives the directives contained in this compilation unit
2989 * @param declarations the declarations contained in this compilation unit 3004 * @param declarations the declarations contained in this compilation unit
2990 * @param endToken the last token in the token stream 3005 * @param endToken the last token in the token stream
2991 */ 3006 */
2992 CompilationUnit.full(Token beginToken, ScriptTag scriptTag, List<Directive> di rectives, List<CompilationUnitMember> declarations, Token endToken) { 3007 CompilationUnit.full(this.beginToken, ScriptTag scriptTag, List<Directive> dir ectives, List<CompilationUnitMember> declarations, this.endToken) {
2993 this.directives = new NodeList<Directive>(this); 3008 this._directives = new NodeList<Directive>(this);
2994 this.declarations = new NodeList<CompilationUnitMember>(this); 3009 this._declarations = new NodeList<CompilationUnitMember>(this);
2995 this._beginToken = beginToken;
2996 this._scriptTag = becomeParentOf(scriptTag); 3010 this._scriptTag = becomeParentOf(scriptTag);
2997 this.directives.addAll(directives); 3011 this._directives.addAll(directives);
2998 this.declarations.addAll(declarations); 3012 this._declarations.addAll(declarations);
2999 this._endToken = endToken;
3000 } 3013 }
3001 3014
3002 /** 3015 /**
3003 * Initialize a newly created compilation unit to have the given directives an d declarations. 3016 * Initialize a newly created compilation unit to have the given directives an d declarations.
3004 * 3017 *
3005 * @param beginToken the first token in the token stream 3018 * @param beginToken the first token in the token stream
3006 * @param scriptTag the script tag at the beginning of the compilation unit 3019 * @param scriptTag the script tag at the beginning of the compilation unit
3007 * @param directives the directives contained in this compilation unit 3020 * @param directives the directives contained in this compilation unit
3008 * @param declarations the declarations contained in this compilation unit 3021 * @param declarations the declarations contained in this compilation unit
3009 * @param endToken the last token in the token stream 3022 * @param endToken the last token in the token stream
3010 */ 3023 */
3011 CompilationUnit({Token beginToken, ScriptTag scriptTag, List<Directive> direct ives, List<CompilationUnitMember> declarations, Token endToken}) : this.full(beg inToken, scriptTag, directives, declarations, endToken); 3024 CompilationUnit({Token beginToken, ScriptTag scriptTag, List<Directive> direct ives, List<CompilationUnitMember> declarations, Token endToken}) : this.full(beg inToken, scriptTag, directives, declarations, endToken);
3012 3025
3013 accept(ASTVisitor visitor) => visitor.visitCompilationUnit(this); 3026 accept(ASTVisitor visitor) => visitor.visitCompilationUnit(this);
3014 3027
3015 Token get beginToken => _beginToken; 3028 /**
3029 * Return the declarations contained in this compilation unit.
3030 *
3031 * @return the declarations contained in this compilation unit
3032 */
3033 NodeList<CompilationUnitMember> get declarations => _declarations;
3016 3034
3017 Token get endToken => _endToken; 3035 /**
3036 * Return the directives contained in this compilation unit.
3037 *
3038 * @return the directives contained in this compilation unit
3039 */
3040 NodeList<Directive> get directives => _directives;
3018 3041
3019 int get length { 3042 int get length {
3020 Token endToken = this.endToken; 3043 Token endToken = this.endToken;
3021 if (endToken == null) { 3044 if (endToken == null) {
3022 return 0; 3045 return 0;
3023 } 3046 }
3024 return endToken.offset + endToken.length; 3047 return endToken.offset + endToken.length;
3025 } 3048 }
3026 3049
3027 int get offset => 0; 3050 int get offset => 0;
(...skipping 11 matching lines...) Expand all
3039 * 3062 *
3040 * @param scriptTag the script tag at the beginning of the compilation unit 3063 * @param scriptTag the script tag at the beginning of the compilation unit
3041 */ 3064 */
3042 void set scriptTag(ScriptTag scriptTag) { 3065 void set scriptTag(ScriptTag scriptTag) {
3043 this._scriptTag = becomeParentOf(scriptTag); 3066 this._scriptTag = becomeParentOf(scriptTag);
3044 } 3067 }
3045 3068
3046 void visitChildren(ASTVisitor visitor) { 3069 void visitChildren(ASTVisitor visitor) {
3047 safelyVisitChild(_scriptTag, visitor); 3070 safelyVisitChild(_scriptTag, visitor);
3048 if (directivesAreBeforeDeclarations()) { 3071 if (directivesAreBeforeDeclarations()) {
3049 directives.accept(visitor); 3072 _directives.accept(visitor);
3050 declarations.accept(visitor); 3073 _declarations.accept(visitor);
3051 } else { 3074 } else {
3052 for (ASTNode child in sortedDirectivesAndDeclarations) { 3075 for (ASTNode child in sortedDirectivesAndDeclarations) {
3053 child.accept(visitor); 3076 child.accept(visitor);
3054 } 3077 }
3055 } 3078 }
3056 } 3079 }
3057 3080
3058 /** 3081 /**
3059 * Return `true` if all of the directives are lexically before any declaration s. 3082 * Return `true` if all of the directives are lexically before any declaration s.
3060 * 3083 *
3061 * @return `true` if all of the directives are lexically before any declaratio ns 3084 * @return `true` if all of the directives are lexically before any declaratio ns
3062 */ 3085 */
3063 bool directivesAreBeforeDeclarations() { 3086 bool directivesAreBeforeDeclarations() {
3064 if (directives.isEmpty || declarations.isEmpty) { 3087 if (_directives.isEmpty || _declarations.isEmpty) {
3065 return true; 3088 return true;
3066 } 3089 }
3067 Directive lastDirective = directives[directives.length - 1]; 3090 Directive lastDirective = _directives[_directives.length - 1];
3068 CompilationUnitMember firstDeclaration = declarations[0]; 3091 CompilationUnitMember firstDeclaration = _declarations[0];
3069 return lastDirective.offset < firstDeclaration.offset; 3092 return lastDirective.offset < firstDeclaration.offset;
3070 } 3093 }
3071 3094
3072 /** 3095 /**
3073 * Return an array containing all of the directives and declarations in this c ompilation unit, 3096 * Return an array containing all of the directives and declarations in this c ompilation unit,
3074 * sorted in lexical order. 3097 * sorted in lexical order.
3075 * 3098 *
3076 * @return the directives and declarations in this compilation unit in the ord er in which they 3099 * @return the directives and declarations in this compilation unit in the ord er in which they
3077 * appeared in the original source 3100 * appeared in the original source
3078 */ 3101 */
3079 List<ASTNode> get sortedDirectivesAndDeclarations { 3102 List<ASTNode> get sortedDirectivesAndDeclarations {
3080 List<ASTNode> childList = new List<ASTNode>(); 3103 List<ASTNode> childList = new List<ASTNode>();
3081 childList.addAll(directives); 3104 childList.addAll(_directives);
3082 childList.addAll(declarations); 3105 childList.addAll(_declarations);
3083 List<ASTNode> children = new List.from(childList); 3106 List<ASTNode> children = new List.from(childList);
3084 children.sort(ASTNode.LEXICAL_ORDER); 3107 children.sort(ASTNode.LEXICAL_ORDER);
3085 return children; 3108 return children;
3086 } 3109 }
3087 } 3110 }
3088 3111
3089 /** 3112 /**
3090 * Instances of the class `CompilationUnitMember` defines the behavior common to nodes that 3113 * Instances of the class `CompilationUnitMember` defines the behavior common to nodes that
3091 * declare a name within the scope of a compilation unit. 3114 * declare a name within the scope of a compilation unit.
3092 * 3115 *
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
3160 * Initialize a newly created conditional expression. 3183 * Initialize a newly created conditional expression.
3161 * 3184 *
3162 * @param condition the condition used to determine which expression is execut ed next 3185 * @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 3186 * @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 3187 * @param thenExpression the expression that is executed if the condition eval uates to
3165 * `true` 3188 * `true`
3166 * @param colon the token used to separate the then expression from the else e xpression 3189 * @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 3190 * @param elseExpression the expression that is executed if the condition eval uates to
3168 * `false` 3191 * `false`
3169 */ 3192 */
3170 ConditionalExpression.full(Expression condition, Token question, Expression th enExpression, Token colon, Expression elseExpression) { 3193 ConditionalExpression.full(Expression condition, this.question, Expression the nExpression, this.colon, Expression elseExpression) {
3171 this._condition = becomeParentOf(condition); 3194 this._condition = becomeParentOf(condition);
3172 this.question = question;
3173 this._thenExpression = becomeParentOf(thenExpression); 3195 this._thenExpression = becomeParentOf(thenExpression);
3174 this.colon = colon;
3175 this._elseExpression = becomeParentOf(elseExpression); 3196 this._elseExpression = becomeParentOf(elseExpression);
3176 } 3197 }
3177 3198
3178 /** 3199 /**
3179 * Initialize a newly created conditional expression. 3200 * Initialize a newly created conditional expression.
3180 * 3201 *
3181 * @param condition the condition used to determine which expression is execut ed next 3202 * @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 3203 * @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 3204 * @param thenExpression the expression that is executed if the condition eval uates to
3184 * `true` 3205 * `true`
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
3321 3342
3322 /** 3343 /**
3323 * The token for the separator (colon or equals) before the initializer list o r redirection, or 3344 * The token for the separator (colon or equals) before the initializer list o r redirection, or
3324 * `null` if there are no initializers. 3345 * `null` if there are no initializers.
3325 */ 3346 */
3326 Token separator; 3347 Token separator;
3327 3348
3328 /** 3349 /**
3329 * The initializers associated with the constructor. 3350 * The initializers associated with the constructor.
3330 */ 3351 */
3331 NodeList<ConstructorInitializer> initializers; 3352 NodeList<ConstructorInitializer> _initializers;
3332 3353
3333 /** 3354 /**
3334 * The name of the constructor to which this constructor will be redirected, o r `null` if 3355 * The name of the constructor to which this constructor will be redirected, o r `null` if
3335 * this is not a redirecting factory constructor. 3356 * this is not a redirecting factory constructor.
3336 */ 3357 */
3337 ConstructorName _redirectedConstructor; 3358 ConstructorName _redirectedConstructor;
3338 3359
3339 /** 3360 /**
3340 * The body of the constructor, or `null` if the constructor does not have a b ody. 3361 * The body of the constructor, or `null` if the constructor does not have a b ody.
3341 */ 3362 */
3342 FunctionBody _body; 3363 FunctionBody _body;
3343 3364
3344 /** 3365 /**
3345 * The element associated with this constructor, or `null` if the AST structur e has not been 3366 * 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. 3367 * resolved or if this constructor could not be resolved.
3347 */ 3368 */
3348 ConstructorElement _element; 3369 ConstructorElement element;
3349 3370
3350 /** 3371 /**
3351 * Initialize a newly created constructor declaration. 3372 * Initialize a newly created constructor declaration.
3352 * 3373 *
3353 * @param externalKeyword the token for the 'external' keyword 3374 * @param externalKeyword the token for the 'external' keyword
3354 * @param comment the documentation comment associated with this constructor 3375 * @param comment the documentation comment associated with this constructor
3355 * @param metadata the annotations associated with this constructor 3376 * @param metadata the annotations associated with this constructor
3356 * @param constKeyword the token for the 'const' keyword 3377 * @param constKeyword the token for the 'const' keyword
3357 * @param factoryKeyword the token for the 'factory' keyword 3378 * @param factoryKeyword the token for the 'factory' keyword
3358 * @param returnType the return type of the constructor 3379 * @param returnType the return type of the constructor
3359 * @param period the token for the period before the constructor name 3380 * @param period the token for the period before the constructor name
3360 * @param name the name of the constructor 3381 * @param name the name of the constructor
3361 * @param parameters the parameters associated with the constructor 3382 * @param parameters the parameters associated with the constructor
3362 * @param separator the token for the colon or equals before the initializers 3383 * @param separator the token for the colon or equals before the initializers
3363 * @param initializers the initializers associated with the constructor 3384 * @param initializers the initializers associated with the constructor
3364 * @param redirectedConstructor the name of the constructor to which this cons tructor will be 3385 * @param redirectedConstructor the name of the constructor to which this cons tructor will be
3365 * redirected 3386 * redirected
3366 * @param body the body of the constructor 3387 * @param body the body of the constructor
3367 */ 3388 */
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) { 3389 ConstructorDeclaration.full(Comment comment, List<Annotation> metadata, this.e xternalKeyword, this.constKeyword, this.factoryKeyword, Identifier returnType, t his.period, SimpleIdentifier name, FormalParameterList parameters, this.separato r, List<ConstructorInitializer> initializers, ConstructorName redirectedConstruc tor, FunctionBody body) : super.full(comment, metadata) {
3369 this.initializers = new NodeList<ConstructorInitializer>(this); 3390 this._initializers = new NodeList<ConstructorInitializer>(this);
3370 this.externalKeyword = externalKeyword;
3371 this.constKeyword = constKeyword;
3372 this.factoryKeyword = factoryKeyword;
3373 this._returnType = becomeParentOf(returnType); 3391 this._returnType = becomeParentOf(returnType);
3374 this.period = period;
3375 this._name = becomeParentOf(name); 3392 this._name = becomeParentOf(name);
3376 this._parameters = becomeParentOf(parameters); 3393 this._parameters = becomeParentOf(parameters);
3377 this.separator = separator; 3394 this._initializers.addAll(initializers);
3378 this.initializers.addAll(initializers);
3379 this._redirectedConstructor = becomeParentOf(redirectedConstructor); 3395 this._redirectedConstructor = becomeParentOf(redirectedConstructor);
3380 this._body = becomeParentOf(body); 3396 this._body = becomeParentOf(body);
3381 } 3397 }
3382 3398
3383 /** 3399 /**
3384 * Initialize a newly created constructor declaration. 3400 * Initialize a newly created constructor declaration.
3385 * 3401 *
3386 * @param externalKeyword the token for the 'external' keyword 3402 * @param externalKeyword the token for the 'external' keyword
3387 * @param comment the documentation comment associated with this constructor 3403 * @param comment the documentation comment associated with this constructor
3388 * @param metadata the annotations associated with this constructor 3404 * @param metadata the annotations associated with this constructor
(...skipping 13 matching lines...) Expand all
3402 3418
3403 accept(ASTVisitor visitor) => visitor.visitConstructorDeclaration(this); 3419 accept(ASTVisitor visitor) => visitor.visitConstructorDeclaration(this);
3404 3420
3405 /** 3421 /**
3406 * Return the body of the constructor, or `null` if the constructor does not h ave a body. 3422 * Return the body of the constructor, or `null` if the constructor does not h ave a body.
3407 * 3423 *
3408 * @return the body of the constructor 3424 * @return the body of the constructor
3409 */ 3425 */
3410 FunctionBody get body => _body; 3426 FunctionBody get body => _body;
3411 3427
3412 ConstructorElement get element => _element;
3413
3414 Token get endToken { 3428 Token get endToken {
3415 if (_body != null) { 3429 if (_body != null) {
3416 return _body.endToken; 3430 return _body.endToken;
3417 } else if (!initializers.isEmpty) { 3431 } else if (!_initializers.isEmpty) {
3418 return initializers.endToken; 3432 return _initializers.endToken;
3419 } 3433 }
3420 return _parameters.endToken; 3434 return _parameters.endToken;
3421 } 3435 }
3422 3436
3423 /** 3437 /**
3438 * Return the initializers associated with the constructor.
3439 *
3440 * @return the initializers associated with the constructor
3441 */
3442 NodeList<ConstructorInitializer> get initializers => _initializers;
3443
3444 /**
3424 * Return the name of the constructor, or `null` if the constructor being decl ared is 3445 * Return the name of the constructor, or `null` if the constructor being decl ared is
3425 * unnamed. 3446 * unnamed.
3426 * 3447 *
3427 * @return the name of the constructor 3448 * @return the name of the constructor
3428 */ 3449 */
3429 SimpleIdentifier get name => _name; 3450 SimpleIdentifier get name => _name;
3430 3451
3431 /** 3452 /**
3432 * Return the parameters associated with the constructor. 3453 * Return the parameters associated with the constructor.
3433 * 3454 *
(...skipping 21 matching lines...) Expand all
3455 /** 3476 /**
3456 * Set the body of the constructor to the given function body. 3477 * Set the body of the constructor to the given function body.
3457 * 3478 *
3458 * @param functionBody the body of the constructor 3479 * @param functionBody the body of the constructor
3459 */ 3480 */
3460 void set body(FunctionBody functionBody) { 3481 void set body(FunctionBody functionBody) {
3461 _body = becomeParentOf(functionBody); 3482 _body = becomeParentOf(functionBody);
3462 } 3483 }
3463 3484
3464 /** 3485 /**
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. 3486 * Set the name of the constructor to the given identifier.
3475 * 3487 *
3476 * @param identifier the name of the constructor 3488 * @param identifier the name of the constructor
3477 */ 3489 */
3478 void set name(SimpleIdentifier identifier) { 3490 void set name(SimpleIdentifier identifier) {
3479 _name = becomeParentOf(identifier); 3491 _name = becomeParentOf(identifier);
3480 } 3492 }
3481 3493
3482 /** 3494 /**
3483 * Set the parameters associated with the constructor to the given list of par ameters. 3495 * Set the parameters associated with the constructor to the given list of par ameters.
(...skipping 22 matching lines...) Expand all
3506 */ 3518 */
3507 void set returnType(Identifier typeName) { 3519 void set returnType(Identifier typeName) {
3508 _returnType = becomeParentOf(typeName); 3520 _returnType = becomeParentOf(typeName);
3509 } 3521 }
3510 3522
3511 void visitChildren(ASTVisitor visitor) { 3523 void visitChildren(ASTVisitor visitor) {
3512 super.visitChildren(visitor); 3524 super.visitChildren(visitor);
3513 safelyVisitChild(_returnType, visitor); 3525 safelyVisitChild(_returnType, visitor);
3514 safelyVisitChild(_name, visitor); 3526 safelyVisitChild(_name, visitor);
3515 safelyVisitChild(_parameters, visitor); 3527 safelyVisitChild(_parameters, visitor);
3516 initializers.accept(visitor); 3528 _initializers.accept(visitor);
3517 safelyVisitChild(_redirectedConstructor, visitor); 3529 safelyVisitChild(_redirectedConstructor, visitor);
3518 safelyVisitChild(_body, visitor); 3530 safelyVisitChild(_body, visitor);
3519 } 3531 }
3520 3532
3521 Token get firstTokenAfterCommentAndMetadata { 3533 Token get firstTokenAfterCommentAndMetadata {
3522 Token leftMost = this.leftMost([externalKeyword, constKeyword, factoryKeywor d]); 3534 Token leftMost = this.leftMost([externalKeyword, constKeyword, factoryKeywor d]);
3523 if (leftMost != null) { 3535 if (leftMost != null) {
3524 return leftMost; 3536 return leftMost;
3525 } 3537 }
3526 return _returnType.beginToken; 3538 return _returnType.beginToken;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
3586 /** 3598 /**
3587 * Initialize a newly created field initializer to initialize the field with t he given name to the 3599 * Initialize a newly created field initializer to initialize the field with t he given name to the
3588 * value of the given expression. 3600 * value of the given expression.
3589 * 3601 *
3590 * @param keyword the token for the 'this' keyword 3602 * @param keyword the token for the 'this' keyword
3591 * @param period the token for the period after the 'this' keyword 3603 * @param period the token for the period after the 'this' keyword
3592 * @param fieldName the name of the field being initialized 3604 * @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 3605 * @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 3606 * @param expression the expression computing the value to which the field wil l be initialized
3595 */ 3607 */
3596 ConstructorFieldInitializer.full(Token keyword, Token period, SimpleIdentifier fieldName, Token equals, Expression expression) { 3608 ConstructorFieldInitializer.full(this.keyword, this.period, SimpleIdentifier f ieldName, this.equals, Expression expression) {
3597 this.keyword = keyword;
3598 this.period = period;
3599 this._fieldName = becomeParentOf(fieldName); 3609 this._fieldName = becomeParentOf(fieldName);
3600 this.equals = equals;
3601 this._expression = becomeParentOf(expression); 3610 this._expression = becomeParentOf(expression);
3602 } 3611 }
3603 3612
3604 /** 3613 /**
3605 * Initialize a newly created field initializer to initialize the field with t he given name to the 3614 * Initialize a newly created field initializer to initialize the field with t he given name to the
3606 * value of the given expression. 3615 * value of the given expression.
3607 * 3616 *
3608 * @param keyword the token for the 'this' keyword 3617 * @param keyword the token for the 'this' keyword
3609 * @param period the token for the period after the 'this' keyword 3618 * @param period the token for the period after the 'this' keyword
3610 * @param fieldName the name of the field being initialized 3619 * @param fieldName the name of the field being initialized
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
3713 */ 3722 */
3714 ConstructorElement _staticElement; 3723 ConstructorElement _staticElement;
3715 3724
3716 /** 3725 /**
3717 * Initialize a newly created constructor name. 3726 * Initialize a newly created constructor name.
3718 * 3727 *
3719 * @param type the name of the type defining the constructor 3728 * @param type the name of the type defining the constructor
3720 * @param period the token for the period before the constructor name 3729 * @param period the token for the period before the constructor name
3721 * @param name the name of the constructor 3730 * @param name the name of the constructor
3722 */ 3731 */
3723 ConstructorName.full(TypeName type, Token period, SimpleIdentifier name) { 3732 ConstructorName.full(TypeName type, this.period, SimpleIdentifier name) {
3724 this._type = becomeParentOf(type); 3733 this._type = becomeParentOf(type);
3725 this.period = period;
3726 this._name = becomeParentOf(name); 3734 this._name = becomeParentOf(name);
3727 } 3735 }
3728 3736
3729 /** 3737 /**
3730 * Initialize a newly created constructor name. 3738 * Initialize a newly created constructor name.
3731 * 3739 *
3732 * @param type the name of the type defining the constructor 3740 * @param type the name of the type defining the constructor
3733 * @param period the token for the period before the constructor name 3741 * @param period the token for the period before the constructor name
3734 * @param name the name of the constructor 3742 * @param name the name of the constructor
3735 */ 3743 */
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
3830 */ 3838 */
3831 Token semicolon; 3839 Token semicolon;
3832 3840
3833 /** 3841 /**
3834 * Initialize a newly created continue statement. 3842 * Initialize a newly created continue statement.
3835 * 3843 *
3836 * @param keyword the token representing the 'continue' keyword 3844 * @param keyword the token representing the 'continue' keyword
3837 * @param label the label associated with the statement 3845 * @param label the label associated with the statement
3838 * @param semicolon the semicolon terminating the statement 3846 * @param semicolon the semicolon terminating the statement
3839 */ 3847 */
3840 ContinueStatement.full(Token keyword, SimpleIdentifier label, Token semicolon) { 3848 ContinueStatement.full(this.keyword, SimpleIdentifier label, this.semicolon) {
3841 this.keyword = keyword;
3842 this._label = becomeParentOf(label); 3849 this._label = becomeParentOf(label);
3843 this.semicolon = semicolon;
3844 } 3850 }
3845 3851
3846 /** 3852 /**
3847 * Initialize a newly created continue statement. 3853 * Initialize a newly created continue statement.
3848 * 3854 *
3849 * @param keyword the token representing the 'continue' keyword 3855 * @param keyword the token representing the 'continue' keyword
3850 * @param label the label associated with the statement 3856 * @param label the label associated with the statement
3851 * @param semicolon the semicolon terminating the statement 3857 * @param semicolon the semicolon terminating the statement
3852 */ 3858 */
3853 ContinueStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : this.full(keyword, label, semicolon); 3859 ContinueStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : this.full(keyword, label, semicolon);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
3931 3937
3932 /** 3938 /**
3933 * The name of the declared type of the parameter, or `null` if the parameter does not have 3939 * The name of the declared type of the parameter, or `null` if the parameter does not have
3934 * a declared type. 3940 * a declared type.
3935 */ 3941 */
3936 TypeName _type; 3942 TypeName _type;
3937 3943
3938 /** 3944 /**
3939 * The name of the variable being declared. 3945 * The name of the variable being declared.
3940 */ 3946 */
3941 SimpleIdentifier identifier; 3947 SimpleIdentifier _identifier;
3942 3948
3943 /** 3949 /**
3944 * Initialize a newly created formal parameter. 3950 * Initialize a newly created formal parameter.
3945 * 3951 *
3946 * @param comment the documentation comment associated with this parameter 3952 * @param comment the documentation comment associated with this parameter
3947 * @param metadata the annotations associated with this parameter 3953 * @param metadata the annotations associated with this parameter
3948 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 3954 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
3949 * @param type the name of the declared type of the parameter 3955 * @param type the name of the declared type of the parameter
3950 * @param identifier the name of the parameter being declared 3956 * @param identifier the name of the parameter being declared
3951 */ 3957 */
3952 DeclaredIdentifier.full(Comment comment, List<Annotation> metadata, Token keyw ord, TypeName type, SimpleIdentifier identifier) : super.full(comment, metadata) { 3958 DeclaredIdentifier.full(Comment comment, List<Annotation> metadata, this.keywo rd, TypeName type, SimpleIdentifier identifier) : super.full(comment, metadata) {
3953 this.keyword = keyword;
3954 this._type = becomeParentOf(type); 3959 this._type = becomeParentOf(type);
3955 this.identifier = becomeParentOf(identifier); 3960 this._identifier = becomeParentOf(identifier);
3956 } 3961 }
3957 3962
3958 /** 3963 /**
3959 * Initialize a newly created formal parameter. 3964 * Initialize a newly created formal parameter.
3960 * 3965 *
3961 * @param comment the documentation comment associated with this parameter 3966 * @param comment the documentation comment associated with this parameter
3962 * @param metadata the annotations associated with this parameter 3967 * @param metadata the annotations associated with this parameter
3963 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 3968 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
3964 * @param type the name of the declared type of the parameter 3969 * @param type the name of the declared type of the parameter
3965 * @param identifier the name of the parameter being declared 3970 * @param identifier the name of the parameter being declared
3966 */ 3971 */
3967 DeclaredIdentifier({Comment comment, List<Annotation> metadata, Token keyword, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, key word, type, identifier); 3972 DeclaredIdentifier({Comment comment, List<Annotation> metadata, Token keyword, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, key word, type, identifier);
3968 3973
3969 accept(ASTVisitor visitor) => visitor.visitDeclaredIdentifier(this); 3974 accept(ASTVisitor visitor) => visitor.visitDeclaredIdentifier(this);
3970 3975
3971 LocalVariableElement get element { 3976 LocalVariableElement get element {
3972 SimpleIdentifier identifier = this.identifier; 3977 SimpleIdentifier identifier = this.identifier;
3973 if (identifier == null) { 3978 if (identifier == null) {
3974 return null; 3979 return null;
3975 } 3980 }
3976 return identifier.staticElement as LocalVariableElement; 3981 return identifier.staticElement as LocalVariableElement;
3977 } 3982 }
3978 3983
3979 Token get endToken => identifier.endToken; 3984 Token get endToken => _identifier.endToken;
3985
3986 /**
3987 * Return the name of the variable being declared.
3988 *
3989 * @return the name of the variable being declared
3990 */
3991 SimpleIdentifier get identifier => _identifier;
3980 3992
3981 /** 3993 /**
3982 * Return the name of the declared type of the parameter, or `null` if the par ameter does 3994 * Return the name of the declared type of the parameter, or `null` if the par ameter does
3983 * not have a declared type. 3995 * not have a declared type.
3984 * 3996 *
3985 * @return the name of the declared type of the parameter 3997 * @return the name of the declared type of the parameter
3986 */ 3998 */
3987 TypeName get type => _type; 3999 TypeName get type => _type;
3988 4000
3989 /** 4001 /**
(...skipping 17 matching lines...) Expand all
4007 * 4019 *
4008 * @param typeName the name of the declared type of the parameter 4020 * @param typeName the name of the declared type of the parameter
4009 */ 4021 */
4010 void set type(TypeName typeName) { 4022 void set type(TypeName typeName) {
4011 _type = becomeParentOf(typeName); 4023 _type = becomeParentOf(typeName);
4012 } 4024 }
4013 4025
4014 void visitChildren(ASTVisitor visitor) { 4026 void visitChildren(ASTVisitor visitor) {
4015 super.visitChildren(visitor); 4027 super.visitChildren(visitor);
4016 safelyVisitChild(_type, visitor); 4028 safelyVisitChild(_type, visitor);
4017 safelyVisitChild(identifier, visitor); 4029 safelyVisitChild(_identifier, visitor);
4018 } 4030 }
4019 4031
4020 Token get firstTokenAfterCommentAndMetadata { 4032 Token get firstTokenAfterCommentAndMetadata {
4021 if (keyword != null) { 4033 if (keyword != null) {
4022 return keyword; 4034 return keyword;
4023 } else if (_type != null) { 4035 } else if (_type != null) {
4024 return _type.beginToken; 4036 return _type.beginToken;
4025 } 4037 }
4026 return identifier.beginToken; 4038 return _identifier.beginToken;
4027 } 4039 }
4028 } 4040 }
4029 4041
4030 /** 4042 /**
4031 * Instances of the class `DefaultFormalParameter` represent a formal parameter with a default 4043 * 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 4044 * value. There are two kinds of parameters that are both represented by this cl ass: named formal
4033 * parameters and positional formal parameters. 4045 * parameters and positional formal parameters.
4034 * 4046 *
4035 * <pre> 4047 * <pre>
4036 * defaultFormalParameter ::= 4048 * defaultFormalParameter ::=
4037 * [NormalFormalParameter] ('=' [Expression])? 4049 * [NormalFormalParameter] ('=' [Expression])?
4038 * 4050 *
4039 * defaultNamedParameter ::= 4051 * defaultNamedParameter ::=
4040 * [NormalFormalParameter] (':' [Expression])? 4052 * [NormalFormalParameter] (':' [Expression])?
4041 * </pre> 4053 * </pre>
4042 * 4054 *
4043 * @coverage dart.engine.ast 4055 * @coverage dart.engine.ast
4044 */ 4056 */
4045 class DefaultFormalParameter extends FormalParameter { 4057 class DefaultFormalParameter extends FormalParameter {
4046 /** 4058 /**
4047 * The formal parameter with which the default value is associated. 4059 * The formal parameter with which the default value is associated.
4048 */ 4060 */
4049 NormalFormalParameter _parameter; 4061 NormalFormalParameter _parameter;
4050 4062
4051 /** 4063 /**
4052 * The kind of this parameter. 4064 * The kind of this parameter.
4053 */ 4065 */
4054 ParameterKind _kind; 4066 ParameterKind kind;
4055 4067
4056 /** 4068 /**
4057 * The token separating the parameter from the default value, or `null` if the re is no 4069 * The token separating the parameter from the default value, or `null` if the re is no
4058 * default value. 4070 * default value.
4059 */ 4071 */
4060 Token separator; 4072 Token separator;
4061 4073
4062 /** 4074 /**
4063 * The expression computing the default value for the parameter, or `null` if there is no 4075 * The expression computing the default value for the parameter, or `null` if there is no
4064 * default value. 4076 * default value.
4065 */ 4077 */
4066 Expression _defaultValue; 4078 Expression _defaultValue;
4067 4079
4068 /** 4080 /**
4069 * Initialize a newly created default formal parameter. 4081 * Initialize a newly created default formal parameter.
4070 * 4082 *
4071 * @param parameter the formal parameter with which the default value is assoc iated 4083 * @param parameter the formal parameter with which the default value is assoc iated
4072 * @param kind the kind of this parameter 4084 * @param kind the kind of this parameter
4073 * @param separator the token separating the parameter from the default value 4085 * @param separator the token separating the parameter from the default value
4074 * @param defaultValue the expression computing the default value for the para meter 4086 * @param defaultValue the expression computing the default value for the para meter
4075 */ 4087 */
4076 DefaultFormalParameter.full(NormalFormalParameter parameter, ParameterKind kin d, Token separator, Expression defaultValue) { 4088 DefaultFormalParameter.full(NormalFormalParameter parameter, this.kind, this.s eparator, Expression defaultValue) {
4077 this._parameter = becomeParentOf(parameter); 4089 this._parameter = becomeParentOf(parameter);
4078 this._kind = kind;
4079 this.separator = separator;
4080 this._defaultValue = becomeParentOf(defaultValue); 4090 this._defaultValue = becomeParentOf(defaultValue);
4081 } 4091 }
4082 4092
4083 /** 4093 /**
4084 * Initialize a newly created default formal parameter. 4094 * Initialize a newly created default formal parameter.
4085 * 4095 *
4086 * @param parameter the formal parameter with which the default value is assoc iated 4096 * @param parameter the formal parameter with which the default value is assoc iated
4087 * @param kind the kind of this parameter 4097 * @param kind the kind of this parameter
4088 * @param separator the token separating the parameter from the default value 4098 * @param separator the token separating the parameter from the default value
4089 * @param defaultValue the expression computing the default value for the para meter 4099 * @param defaultValue the expression computing the default value for the para meter
(...skipping 14 matching lines...) Expand all
4104 4114
4105 Token get endToken { 4115 Token get endToken {
4106 if (_defaultValue != null) { 4116 if (_defaultValue != null) {
4107 return _defaultValue.endToken; 4117 return _defaultValue.endToken;
4108 } 4118 }
4109 return _parameter.endToken; 4119 return _parameter.endToken;
4110 } 4120 }
4111 4121
4112 SimpleIdentifier get identifier => _parameter.identifier; 4122 SimpleIdentifier get identifier => _parameter.identifier;
4113 4123
4114 ParameterKind get kind => _kind;
4115
4116 /** 4124 /**
4117 * Return the formal parameter with which the default value is associated. 4125 * Return the formal parameter with which the default value is associated.
4118 * 4126 *
4119 * @return the formal parameter with which the default value is associated 4127 * @return the formal parameter with which the default value is associated
4120 */ 4128 */
4121 NormalFormalParameter get parameter => _parameter; 4129 NormalFormalParameter get parameter => _parameter;
4122 4130
4123 bool get isConst => _parameter != null && _parameter.isConst; 4131 bool get isConst => _parameter != null && _parameter.isConst;
4124 4132
4125 bool get isFinal => _parameter != null && _parameter.isFinal; 4133 bool get isFinal => _parameter != null && _parameter.isFinal;
4126 4134
4127 /** 4135 /**
4128 * Set the expression computing the default value for the parameter to the giv en expression. 4136 * Set the expression computing the default value for the parameter to the giv en expression.
4129 * 4137 *
4130 * @param expression the expression computing the default value for the parame ter 4138 * @param expression the expression computing the default value for the parame ter
4131 */ 4139 */
4132 void set defaultValue(Expression expression) { 4140 void set defaultValue(Expression expression) {
4133 _defaultValue = becomeParentOf(expression); 4141 _defaultValue = becomeParentOf(expression);
4134 } 4142 }
4135 4143
4136 /** 4144 /**
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. 4145 * Set the formal parameter with which the default value is associated to the given parameter.
4147 * 4146 *
4148 * @param formalParameter the formal parameter with which the default value is associated 4147 * @param formalParameter the formal parameter with which the default value is associated
4149 */ 4148 */
4150 void set parameter(NormalFormalParameter formalParameter) { 4149 void set parameter(NormalFormalParameter formalParameter) {
4151 _parameter = becomeParentOf(formalParameter); 4150 _parameter = becomeParentOf(formalParameter);
4152 } 4151 }
4153 4152
4154 void visitChildren(ASTVisitor visitor) { 4153 void visitChildren(ASTVisitor visitor) {
4155 safelyVisitChild(_parameter, visitor); 4154 safelyVisitChild(_parameter, visitor);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
4272 * Initialize a newly created do loop. 4271 * Initialize a newly created do loop.
4273 * 4272 *
4274 * @param doKeyword the token representing the 'do' keyword 4273 * @param doKeyword the token representing the 'do' keyword
4275 * @param body the body of the loop 4274 * @param body the body of the loop
4276 * @param whileKeyword the token representing the 'while' keyword 4275 * @param whileKeyword the token representing the 'while' keyword
4277 * @param leftParenthesis the left parenthesis 4276 * @param leftParenthesis the left parenthesis
4278 * @param condition the condition that determines when the loop will terminate 4277 * @param condition the condition that determines when the loop will terminate
4279 * @param rightParenthesis the right parenthesis 4278 * @param rightParenthesis the right parenthesis
4280 * @param semicolon the semicolon terminating the statement 4279 * @param semicolon the semicolon terminating the statement
4281 */ 4280 */
4282 DoStatement.full(Token doKeyword, Statement body, Token whileKeyword, Token le ftParenthesis, Expression condition, Token rightParenthesis, Token semicolon) { 4281 DoStatement.full(this.doKeyword, Statement body, this.whileKeyword, Token left Parenthesis, Expression condition, Token rightParenthesis, this.semicolon) {
4283 this.doKeyword = doKeyword;
4284 this._body = becomeParentOf(body); 4282 this._body = becomeParentOf(body);
4285 this.whileKeyword = whileKeyword;
4286 this._leftParenthesis = leftParenthesis; 4283 this._leftParenthesis = leftParenthesis;
4287 this._condition = becomeParentOf(condition); 4284 this._condition = becomeParentOf(condition);
4288 this._rightParenthesis = rightParenthesis; 4285 this._rightParenthesis = rightParenthesis;
4289 this.semicolon = semicolon;
4290 } 4286 }
4291 4287
4292 /** 4288 /**
4293 * Initialize a newly created do loop. 4289 * Initialize a newly created do loop.
4294 * 4290 *
4295 * @param doKeyword the token representing the 'do' keyword 4291 * @param doKeyword the token representing the 'do' keyword
4296 * @param body the body of the loop 4292 * @param body the body of the loop
4297 * @param whileKeyword the token representing the 'while' keyword 4293 * @param whileKeyword the token representing the 'while' keyword
4298 * @param leftParenthesis the left parenthesis 4294 * @param leftParenthesis the left parenthesis
4299 * @param condition the condition that determines when the loop will terminate 4295 * @param condition the condition that determines when the loop will terminate
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
4402 * The value of the literal. 4398 * The value of the literal.
4403 */ 4399 */
4404 double value = 0.0; 4400 double value = 0.0;
4405 4401
4406 /** 4402 /**
4407 * Initialize a newly created floating point literal. 4403 * Initialize a newly created floating point literal.
4408 * 4404 *
4409 * @param literal the token representing the literal 4405 * @param literal the token representing the literal
4410 * @param value the value of the literal 4406 * @param value the value of the literal
4411 */ 4407 */
4412 DoubleLiteral.full(Token literal, double value) { 4408 DoubleLiteral.full(this.literal, this.value);
4413 this.literal = literal;
4414 this.value = value;
4415 }
4416 4409
4417 /** 4410 /**
4418 * Initialize a newly created floating point literal. 4411 * Initialize a newly created floating point literal.
4419 * 4412 *
4420 * @param literal the token representing the literal 4413 * @param literal the token representing the literal
4421 * @param value the value of the literal 4414 * @param value the value of the literal
4422 */ 4415 */
4423 DoubleLiteral({Token literal, double value}) : this.full(literal, value); 4416 DoubleLiteral({Token literal, double value}) : this.full(literal, value);
4424 4417
4425 accept(ASTVisitor visitor) => visitor.visitDoubleLiteral(this); 4418 accept(ASTVisitor visitor) => visitor.visitDoubleLiteral(this);
(...skipping 21 matching lines...) Expand all
4447 /** 4440 /**
4448 * The token representing the semicolon that marks the end of the function bod y. 4441 * The token representing the semicolon that marks the end of the function bod y.
4449 */ 4442 */
4450 Token semicolon; 4443 Token semicolon;
4451 4444
4452 /** 4445 /**
4453 * Initialize a newly created function body. 4446 * Initialize a newly created function body.
4454 * 4447 *
4455 * @param semicolon the token representing the semicolon that marks the end of the function body 4448 * @param semicolon the token representing the semicolon that marks the end of the function body
4456 */ 4449 */
4457 EmptyFunctionBody.full(Token semicolon) { 4450 EmptyFunctionBody.full(this.semicolon);
4458 this.semicolon = semicolon;
4459 }
4460 4451
4461 /** 4452 /**
4462 * Initialize a newly created function body. 4453 * Initialize a newly created function body.
4463 * 4454 *
4464 * @param semicolon the token representing the semicolon that marks the end of the function body 4455 * @param semicolon the token representing the semicolon that marks the end of the function body
4465 */ 4456 */
4466 EmptyFunctionBody({Token semicolon}) : this.full(semicolon); 4457 EmptyFunctionBody({Token semicolon}) : this.full(semicolon);
4467 4458
4468 accept(ASTVisitor visitor) => visitor.visitEmptyFunctionBody(this); 4459 accept(ASTVisitor visitor) => visitor.visitEmptyFunctionBody(this);
4469 4460
(...skipping 19 matching lines...) Expand all
4489 /** 4480 /**
4490 * The semicolon terminating the statement. 4481 * The semicolon terminating the statement.
4491 */ 4482 */
4492 Token semicolon; 4483 Token semicolon;
4493 4484
4494 /** 4485 /**
4495 * Initialize a newly created empty statement. 4486 * Initialize a newly created empty statement.
4496 * 4487 *
4497 * @param semicolon the semicolon terminating the statement 4488 * @param semicolon the semicolon terminating the statement
4498 */ 4489 */
4499 EmptyStatement.full(Token semicolon) { 4490 EmptyStatement.full(this.semicolon);
4500 this.semicolon = semicolon;
4501 }
4502 4491
4503 /** 4492 /**
4504 * Initialize a newly created empty statement. 4493 * Initialize a newly created empty statement.
4505 * 4494 *
4506 * @param semicolon the semicolon terminating the statement 4495 * @param semicolon the semicolon terminating the statement
4507 */ 4496 */
4508 EmptyStatement({Token semicolon}) : this.full(semicolon); 4497 EmptyStatement({Token semicolon}) : this.full(semicolon);
4509 4498
4510 accept(ASTVisitor visitor) => visitor.visitEmptyStatement(this); 4499 accept(ASTVisitor visitor) => visitor.visitEmptyStatement(this);
4511 4500
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
4763 Token semicolon; 4752 Token semicolon;
4764 4753
4765 /** 4754 /**
4766 * Initialize a newly created function body consisting of a block of statement s. 4755 * Initialize a newly created function body consisting of a block of statement s.
4767 * 4756 *
4768 * @param functionDefinition the token introducing the expression that represe nts the body of the 4757 * @param functionDefinition the token introducing the expression that represe nts the body of the
4769 * function 4758 * function
4770 * @param expression the expression representing the body of the function 4759 * @param expression the expression representing the body of the function
4771 * @param semicolon the semicolon terminating the statement 4760 * @param semicolon the semicolon terminating the statement
4772 */ 4761 */
4773 ExpressionFunctionBody.full(Token functionDefinition, Expression expression, T oken semicolon) { 4762 ExpressionFunctionBody.full(this.functionDefinition, Expression expression, th is.semicolon) {
4774 this.functionDefinition = functionDefinition;
4775 this._expression = becomeParentOf(expression); 4763 this._expression = becomeParentOf(expression);
4776 this.semicolon = semicolon;
4777 } 4764 }
4778 4765
4779 /** 4766 /**
4780 * Initialize a newly created function body consisting of a block of statement s. 4767 * Initialize a newly created function body consisting of a block of statement s.
4781 * 4768 *
4782 * @param functionDefinition the token introducing the expression that represe nts the body of the 4769 * @param functionDefinition the token introducing the expression that represe nts the body of the
4783 * function 4770 * function
4784 * @param expression the expression representing the body of the function 4771 * @param expression the expression representing the body of the function
4785 * @param semicolon the semicolon terminating the statement 4772 * @param semicolon the semicolon terminating the statement
4786 */ 4773 */
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
4839 * expression and therefore isn't followed by a semicolon. 4826 * expression and therefore isn't followed by a semicolon.
4840 */ 4827 */
4841 Token semicolon; 4828 Token semicolon;
4842 4829
4843 /** 4830 /**
4844 * Initialize a newly created expression statement. 4831 * Initialize a newly created expression statement.
4845 * 4832 *
4846 * @param expression the expression that comprises the statement 4833 * @param expression the expression that comprises the statement
4847 * @param semicolon the semicolon terminating the statement 4834 * @param semicolon the semicolon terminating the statement
4848 */ 4835 */
4849 ExpressionStatement.full(Expression expression, Token semicolon) { 4836 ExpressionStatement.full(Expression expression, this.semicolon) {
4850 this._expression = becomeParentOf(expression); 4837 this._expression = becomeParentOf(expression);
4851 this.semicolon = semicolon;
4852 } 4838 }
4853 4839
4854 /** 4840 /**
4855 * Initialize a newly created expression statement. 4841 * Initialize a newly created expression statement.
4856 * 4842 *
4857 * @param expression the expression that comprises the statement 4843 * @param expression the expression that comprises the statement
4858 * @param semicolon the semicolon terminating the statement 4844 * @param semicolon the semicolon terminating the statement
4859 */ 4845 */
4860 ExpressionStatement({Expression expression, Token semicolon}) : this.full(expr ession, semicolon); 4846 ExpressionStatement({Expression expression, Token semicolon}) : this.full(expr ession, semicolon);
4861 4847
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
4914 * The name of the class that is being extended. 4900 * The name of the class that is being extended.
4915 */ 4901 */
4916 TypeName _superclass; 4902 TypeName _superclass;
4917 4903
4918 /** 4904 /**
4919 * Initialize a newly created extends clause. 4905 * Initialize a newly created extends clause.
4920 * 4906 *
4921 * @param keyword the token representing the 'extends' keyword 4907 * @param keyword the token representing the 'extends' keyword
4922 * @param superclass the name of the class that is being extended 4908 * @param superclass the name of the class that is being extended
4923 */ 4909 */
4924 ExtendsClause.full(Token keyword, TypeName superclass) { 4910 ExtendsClause.full(this.keyword, TypeName superclass) {
4925 this.keyword = keyword;
4926 this._superclass = becomeParentOf(superclass); 4911 this._superclass = becomeParentOf(superclass);
4927 } 4912 }
4928 4913
4929 /** 4914 /**
4930 * Initialize a newly created extends clause. 4915 * Initialize a newly created extends clause.
4931 * 4916 *
4932 * @param keyword the token representing the 'extends' keyword 4917 * @param keyword the token representing the 'extends' keyword
4933 * @param superclass the name of the class that is being extended 4918 * @param superclass the name of the class that is being extended
4934 */ 4919 */
4935 ExtendsClause({Token keyword, TypeName superclass}) : this.full(keyword, super class); 4920 ExtendsClause({Token keyword, TypeName superclass}) : this.full(keyword, super class);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
4990 4975
4991 /** 4976 /**
4992 * Initialize a newly created field declaration. 4977 * Initialize a newly created field declaration.
4993 * 4978 *
4994 * @param comment the documentation comment associated with this field 4979 * @param comment the documentation comment associated with this field
4995 * @param metadata the annotations associated with this field 4980 * @param metadata the annotations associated with this field
4996 * @param staticKeyword the token representing the 'static' keyword 4981 * @param staticKeyword the token representing the 'static' keyword
4997 * @param fieldList the fields being declared 4982 * @param fieldList the fields being declared
4998 * @param semicolon the semicolon terminating the declaration 4983 * @param semicolon the semicolon terminating the declaration
4999 */ 4984 */
5000 FieldDeclaration.full(Comment comment, List<Annotation> metadata, Token static Keyword, VariableDeclarationList fieldList, Token semicolon) : super.full(commen t, metadata) { 4985 FieldDeclaration.full(Comment comment, List<Annotation> metadata, this.staticK eyword, VariableDeclarationList fieldList, this.semicolon) : super.full(comment, metadata) {
5001 this.staticKeyword = staticKeyword;
5002 this._fieldList = becomeParentOf(fieldList); 4986 this._fieldList = becomeParentOf(fieldList);
5003 this.semicolon = semicolon;
5004 } 4987 }
5005 4988
5006 /** 4989 /**
5007 * Initialize a newly created field declaration. 4990 * Initialize a newly created field declaration.
5008 * 4991 *
5009 * @param comment the documentation comment associated with this field 4992 * @param comment the documentation comment associated with this field
5010 * @param metadata the annotations associated with this field 4993 * @param metadata the annotations associated with this field
5011 * @param staticKeyword the token representing the 'static' keyword 4994 * @param staticKeyword the token representing the 'static' keyword
5012 * @param fieldList the fields being declared 4995 * @param fieldList the fields being declared
5013 * @param semicolon the semicolon terminating the declaration 4996 * @param semicolon the semicolon terminating the declaration
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
5101 * @param comment the documentation comment associated with this parameter 5084 * @param comment the documentation comment associated with this parameter
5102 * @param metadata the annotations associated with this parameter 5085 * @param metadata the annotations associated with this parameter
5103 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 5086 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
5104 * @param type the name of the declared type of the parameter 5087 * @param type the name of the declared type of the parameter
5105 * @param thisToken the token representing the 'this' keyword 5088 * @param thisToken the token representing the 'this' keyword
5106 * @param period the token representing the period 5089 * @param period the token representing the period
5107 * @param identifier the name of the parameter being declared 5090 * @param identifier the name of the parameter being declared
5108 * @param parameters the parameters of the function-typed parameter, or `null` if this is 5091 * @param parameters the parameters of the function-typed parameter, or `null` if this is
5109 * not a function-typed field formal parameter 5092 * not a function-typed field formal parameter
5110 */ 5093 */
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) { 5094 FieldFormalParameter.full(Comment comment, List<Annotation> metadata, this.key word, TypeName type, this.thisToken, this.period, SimpleIdentifier identifier, F ormalParameterList parameters) : super.full(comment, metadata, identifier) {
5112 this.keyword = keyword;
5113 this._type = becomeParentOf(type); 5095 this._type = becomeParentOf(type);
5114 this.thisToken = thisToken;
5115 this.period = period;
5116 this._parameters = becomeParentOf(parameters); 5096 this._parameters = becomeParentOf(parameters);
5117 } 5097 }
5118 5098
5119 /** 5099 /**
5120 * Initialize a newly created formal parameter. 5100 * Initialize a newly created formal parameter.
5121 * 5101 *
5122 * @param comment the documentation comment associated with this parameter 5102 * @param comment the documentation comment associated with this parameter
5123 * @param metadata the annotations associated with this parameter 5103 * @param metadata the annotations associated with this parameter
5124 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 5104 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
5125 * @param type the name of the declared type of the parameter 5105 * @param type the name of the declared type of the parameter
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
5247 /** 5227 /**
5248 * Initialize a newly created for-each statement. 5228 * Initialize a newly created for-each statement.
5249 * 5229 *
5250 * @param forKeyword the token representing the 'for' keyword 5230 * @param forKeyword the token representing the 'for' keyword
5251 * @param leftParenthesis the left parenthesis 5231 * @param leftParenthesis the left parenthesis
5252 * @param loopVariable the declaration of the loop variable 5232 * @param loopVariable the declaration of the loop variable
5253 * @param iterator the expression evaluated to produce the iterator 5233 * @param iterator the expression evaluated to produce the iterator
5254 * @param rightParenthesis the right parenthesis 5234 * @param rightParenthesis the right parenthesis
5255 * @param body the body of the loop 5235 * @param body the body of the loop
5256 */ 5236 */
5257 ForEachStatement.con1_full(Token forKeyword, Token leftParenthesis, DeclaredId entifier loopVariable, Token inKeyword, Expression iterator, Token rightParenthe sis, Statement body) { 5237 ForEachStatement.con1_full(this.forKeyword, this.leftParenthesis, DeclaredIden tifier loopVariable, this.inKeyword, Expression iterator, this.rightParenthesis, Statement body) {
5258 this.forKeyword = forKeyword;
5259 this.leftParenthesis = leftParenthesis;
5260 this._loopVariable = becomeParentOf(loopVariable); 5238 this._loopVariable = becomeParentOf(loopVariable);
5261 this.inKeyword = inKeyword;
5262 this._iterator = becomeParentOf(iterator); 5239 this._iterator = becomeParentOf(iterator);
5263 this.rightParenthesis = rightParenthesis;
5264 this._body = becomeParentOf(body); 5240 this._body = becomeParentOf(body);
5265 } 5241 }
5266 5242
5267 /** 5243 /**
5268 * Initialize a newly created for-each statement. 5244 * Initialize a newly created for-each statement.
5269 * 5245 *
5270 * @param forKeyword the token representing the 'for' keyword 5246 * @param forKeyword the token representing the 'for' keyword
5271 * @param leftParenthesis the left parenthesis 5247 * @param leftParenthesis the left parenthesis
5272 * @param loopVariable the declaration of the loop variable 5248 * @param loopVariable the declaration of the loop variable
5273 * @param iterator the expression evaluated to produce the iterator 5249 * @param iterator the expression evaluated to produce the iterator
5274 * @param rightParenthesis the right parenthesis 5250 * @param rightParenthesis the right parenthesis
5275 * @param body the body of the loop 5251 * @param body the body of the loop
5276 */ 5252 */
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); 5253 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 5254
5279 /** 5255 /**
5280 * Initialize a newly created for-each statement. 5256 * Initialize a newly created for-each statement.
5281 * 5257 *
5282 * @param forKeyword the token representing the 'for' keyword 5258 * @param forKeyword the token representing the 'for' keyword
5283 * @param leftParenthesis the left parenthesis 5259 * @param leftParenthesis the left parenthesis
5284 * @param identifier the loop variable 5260 * @param identifier the loop variable
5285 * @param iterator the expression evaluated to produce the iterator 5261 * @param iterator the expression evaluated to produce the iterator
5286 * @param rightParenthesis the right parenthesis 5262 * @param rightParenthesis the right parenthesis
5287 * @param body the body of the loop 5263 * @param body the body of the loop
5288 */ 5264 */
5289 ForEachStatement.con2_full(Token forKeyword, Token leftParenthesis, SimpleIden tifier identifier, Token inKeyword, Expression iterator, Token rightParenthesis, Statement body) { 5265 ForEachStatement.con2_full(this.forKeyword, this.leftParenthesis, SimpleIdenti fier identifier, this.inKeyword, Expression iterator, this.rightParenthesis, Sta tement body) {
5290 this.forKeyword = forKeyword;
5291 this.leftParenthesis = leftParenthesis;
5292 this._identifier = becomeParentOf(identifier); 5266 this._identifier = becomeParentOf(identifier);
5293 this.inKeyword = inKeyword;
5294 this._iterator = becomeParentOf(iterator); 5267 this._iterator = becomeParentOf(iterator);
5295 this.rightParenthesis = rightParenthesis;
5296 this._body = becomeParentOf(body); 5268 this._body = becomeParentOf(body);
5297 } 5269 }
5298 5270
5299 /** 5271 /**
5300 * Initialize a newly created for-each statement. 5272 * Initialize a newly created for-each statement.
5301 * 5273 *
5302 * @param forKeyword the token representing the 'for' keyword 5274 * @param forKeyword the token representing the 'for' keyword
5303 * @param leftParenthesis the left parenthesis 5275 * @param leftParenthesis the left parenthesis
5304 * @param identifier the loop variable 5276 * @param identifier the loop variable
5305 * @param iterator the expression evaluated to produce the iterator 5277 * @param iterator the expression evaluated to produce the iterator
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
5441 Expression _condition; 5413 Expression _condition;
5442 5414
5443 /** 5415 /**
5444 * The semicolon separating the condition and the updater. 5416 * The semicolon separating the condition and the updater.
5445 */ 5417 */
5446 Token rightSeparator; 5418 Token rightSeparator;
5447 5419
5448 /** 5420 /**
5449 * The list of expressions run after each execution of the loop body. 5421 * The list of expressions run after each execution of the loop body.
5450 */ 5422 */
5451 NodeList<Expression> updaters; 5423 NodeList<Expression> _updaters;
5452 5424
5453 /** 5425 /**
5454 * The right parenthesis. 5426 * The right parenthesis.
5455 */ 5427 */
5456 Token rightParenthesis; 5428 Token rightParenthesis;
5457 5429
5458 /** 5430 /**
5459 * The body of the loop. 5431 * The body of the loop.
5460 */ 5432 */
5461 Statement _body; 5433 Statement _body;
5462 5434
5463 /** 5435 /**
5464 * Initialize a newly created for statement. 5436 * Initialize a newly created for statement.
5465 * 5437 *
5466 * @param forKeyword the token representing the 'for' keyword 5438 * @param forKeyword the token representing the 'for' keyword
5467 * @param leftParenthesis the left parenthesis 5439 * @param leftParenthesis the left parenthesis
5468 * @param variableList the declaration of the loop variables 5440 * @param variableList the declaration of the loop variables
5469 * @param initialization the initialization expression 5441 * @param initialization the initialization expression
5470 * @param leftSeparator the semicolon separating the initializer and the condi tion 5442 * @param leftSeparator the semicolon separating the initializer and the condi tion
5471 * @param condition the condition used to determine when to terminate the loop 5443 * @param condition the condition used to determine when to terminate the loop
5472 * @param rightSeparator the semicolon separating the condition and the update r 5444 * @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 5445 * @param updaters the list of expressions run after each execution of the loo p body
5474 * @param rightParenthesis the right parenthesis 5446 * @param rightParenthesis the right parenthesis
5475 * @param body the body of the loop 5447 * @param body the body of the loop
5476 */ 5448 */
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) { 5449 ForStatement.full(this.forKeyword, this.leftParenthesis, VariableDeclarationLi st variableList, Expression initialization, this.leftSeparator, Expression condi tion, this.rightSeparator, List<Expression> updaters, this.rightParenthesis, Sta tement body) {
5478 this.updaters = new NodeList<Expression>(this); 5450 this._updaters = new NodeList<Expression>(this);
5479 this.forKeyword = forKeyword;
5480 this.leftParenthesis = leftParenthesis;
5481 this._variableList = becomeParentOf(variableList); 5451 this._variableList = becomeParentOf(variableList);
5482 this._initialization = becomeParentOf(initialization); 5452 this._initialization = becomeParentOf(initialization);
5483 this.leftSeparator = leftSeparator;
5484 this._condition = becomeParentOf(condition); 5453 this._condition = becomeParentOf(condition);
5485 this.rightSeparator = rightSeparator; 5454 this._updaters.addAll(updaters);
5486 this.updaters.addAll(updaters);
5487 this.rightParenthesis = rightParenthesis;
5488 this._body = becomeParentOf(body); 5455 this._body = becomeParentOf(body);
5489 } 5456 }
5490 5457
5491 /** 5458 /**
5492 * Initialize a newly created for statement. 5459 * Initialize a newly created for statement.
5493 * 5460 *
5494 * @param forKeyword the token representing the 'for' keyword 5461 * @param forKeyword the token representing the 'for' keyword
5495 * @param leftParenthesis the left parenthesis 5462 * @param leftParenthesis the left parenthesis
5496 * @param variableList the declaration of the loop variables 5463 * @param variableList the declaration of the loop variables
5497 * @param initialization the initialization expression 5464 * @param initialization the initialization expression
(...skipping 28 matching lines...) Expand all
5526 Token get endToken => _body.endToken; 5493 Token get endToken => _body.endToken;
5527 5494
5528 /** 5495 /**
5529 * Return the initialization expression, or `null` if there is no initializati on expression. 5496 * Return the initialization expression, or `null` if there is no initializati on expression.
5530 * 5497 *
5531 * @return the initialization expression 5498 * @return the initialization expression
5532 */ 5499 */
5533 Expression get initialization => _initialization; 5500 Expression get initialization => _initialization;
5534 5501
5535 /** 5502 /**
5503 * Return the list of expressions run after each execution of the loop body.
5504 *
5505 * @return the list of expressions run after each execution of the loop body
5506 */
5507 NodeList<Expression> get updaters => _updaters;
5508
5509 /**
5536 * Return the declaration of the loop variables, or `null` if there are no var iables. 5510 * Return the declaration of the loop variables, or `null` if there are no var iables.
5537 * 5511 *
5538 * @return the declaration of the loop variables, or `null` if there are no va riables 5512 * @return the declaration of the loop variables, or `null` if there are no va riables
5539 */ 5513 */
5540 VariableDeclarationList get variables => _variableList; 5514 VariableDeclarationList get variables => _variableList;
5541 5515
5542 /** 5516 /**
5543 * Set the body of the loop to the given statement. 5517 * Set the body of the loop to the given statement.
5544 * 5518 *
5545 * @param body the body of the loop 5519 * @param body the body of the loop
(...skipping 26 matching lines...) Expand all
5572 * @param variableList the declaration of the loop variables 5546 * @param variableList the declaration of the loop variables
5573 */ 5547 */
5574 void set variables(VariableDeclarationList variableList) { 5548 void set variables(VariableDeclarationList variableList) {
5575 variableList = becomeParentOf(variableList); 5549 variableList = becomeParentOf(variableList);
5576 } 5550 }
5577 5551
5578 void visitChildren(ASTVisitor visitor) { 5552 void visitChildren(ASTVisitor visitor) {
5579 safelyVisitChild(_variableList, visitor); 5553 safelyVisitChild(_variableList, visitor);
5580 safelyVisitChild(_initialization, visitor); 5554 safelyVisitChild(_initialization, visitor);
5581 safelyVisitChild(_condition, visitor); 5555 safelyVisitChild(_condition, visitor);
5582 updaters.accept(visitor); 5556 _updaters.accept(visitor);
5583 safelyVisitChild(_body, visitor); 5557 safelyVisitChild(_body, visitor);
5584 } 5558 }
5585 } 5559 }
5586 5560
5587 /** 5561 /**
5588 * The abstract class `FormalParameter` defines the behavior of objects represen ting a 5562 * The abstract class `FormalParameter` defines the behavior of objects represen ting a
5589 * parameter to a function. 5563 * parameter to a function.
5590 * 5564 *
5591 * <pre> 5565 * <pre>
5592 * formalParameter ::= 5566 * formalParameter ::=
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
5676 */ 5650 */
5677 class FormalParameterList extends ASTNode { 5651 class FormalParameterList extends ASTNode {
5678 /** 5652 /**
5679 * The left parenthesis. 5653 * The left parenthesis.
5680 */ 5654 */
5681 Token _leftParenthesis; 5655 Token _leftParenthesis;
5682 5656
5683 /** 5657 /**
5684 * The parameters associated with the method. 5658 * The parameters associated with the method.
5685 */ 5659 */
5686 NodeList<FormalParameter> parameters; 5660 NodeList<FormalParameter> _parameters;
5687 5661
5688 /** 5662 /**
5689 * The left square bracket ('[') or left curly brace ('{') introducing the opt ional parameters, or 5663 * The left square bracket ('[') or left curly brace ('{') introducing the opt ional parameters, or
5690 * `null` if there are no optional parameters. 5664 * `null` if there are no optional parameters.
5691 */ 5665 */
5692 Token _leftDelimiter; 5666 Token _leftDelimiter;
5693 5667
5694 /** 5668 /**
5695 * The right square bracket (']') or right curly brace ('}') introducing the o ptional parameters, 5669 * The right square bracket (']') or right curly brace ('}') introducing the o ptional parameters,
5696 * or `null` if there are no optional parameters. 5670 * or `null` if there are no optional parameters.
5697 */ 5671 */
5698 Token _rightDelimiter; 5672 Token _rightDelimiter;
5699 5673
5700 /** 5674 /**
5701 * The right parenthesis. 5675 * The right parenthesis.
5702 */ 5676 */
5703 Token _rightParenthesis; 5677 Token _rightParenthesis;
5704 5678
5705 /** 5679 /**
5706 * Initialize a newly created parameter list. 5680 * Initialize a newly created parameter list.
5707 * 5681 *
5708 * @param leftParenthesis the left parenthesis 5682 * @param leftParenthesis the left parenthesis
5709 * @param parameters the parameters associated with the method 5683 * @param parameters the parameters associated with the method
5710 * @param leftDelimiter the left delimiter introducing the optional parameters 5684 * @param leftDelimiter the left delimiter introducing the optional parameters
5711 * @param rightDelimiter the right delimiter introducing the optional paramete rs 5685 * @param rightDelimiter the right delimiter introducing the optional paramete rs
5712 * @param rightParenthesis the right parenthesis 5686 * @param rightParenthesis the right parenthesis
5713 */ 5687 */
5714 FormalParameterList.full(Token leftParenthesis, List<FormalParameter> paramete rs, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis) { 5688 FormalParameterList.full(Token leftParenthesis, List<FormalParameter> paramete rs, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis) {
5715 this.parameters = new NodeList<FormalParameter>(this); 5689 this._parameters = new NodeList<FormalParameter>(this);
5716 this._leftParenthesis = leftParenthesis; 5690 this._leftParenthesis = leftParenthesis;
5717 this.parameters.addAll(parameters); 5691 this._parameters.addAll(parameters);
5718 this._leftDelimiter = leftDelimiter; 5692 this._leftDelimiter = leftDelimiter;
5719 this._rightDelimiter = rightDelimiter; 5693 this._rightDelimiter = rightDelimiter;
5720 this._rightParenthesis = rightParenthesis; 5694 this._rightParenthesis = rightParenthesis;
5721 } 5695 }
5722 5696
5723 /** 5697 /**
5724 * Initialize a newly created parameter list. 5698 * Initialize a newly created parameter list.
5725 * 5699 *
5726 * @param leftParenthesis the left parenthesis 5700 * @param leftParenthesis the left parenthesis
5727 * @param parameters the parameters associated with the method 5701 * @param parameters the parameters associated with the method
(...skipping 25 matching lines...) Expand all
5753 */ 5727 */
5754 Token get leftParenthesis => _leftParenthesis; 5728 Token get leftParenthesis => _leftParenthesis;
5755 5729
5756 /** 5730 /**
5757 * Return an array containing the elements representing the parameters in this list. The array 5731 * 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. 5732 * will contain `null`s if the parameters in this list have not been resolved.
5759 * 5733 *
5760 * @return the elements representing the parameters in this list 5734 * @return the elements representing the parameters in this list
5761 */ 5735 */
5762 List<ParameterElement> get parameterElements { 5736 List<ParameterElement> get parameterElements {
5763 int count = parameters.length; 5737 int count = _parameters.length;
5764 List<ParameterElement> types = new List<ParameterElement>(count); 5738 List<ParameterElement> types = new List<ParameterElement>(count);
5765 for (int i = 0; i < count; i++) { 5739 for (int i = 0; i < count; i++) {
5766 types[i] = parameters[i].element; 5740 types[i] = _parameters[i].element;
5767 } 5741 }
5768 return types; 5742 return types;
5769 } 5743 }
5770 5744
5771 /** 5745 /**
5746 * Return the parameters associated with the method.
5747 *
5748 * @return the parameters associated with the method
5749 */
5750 NodeList<FormalParameter> get parameters => _parameters;
5751
5752 /**
5772 * Return the right square bracket (']') or right curly brace ('}') introducin g the optional 5753 * Return the right square bracket (']') or right curly brace ('}') introducin g the optional
5773 * parameters, or `null` if there are no optional parameters. 5754 * parameters, or `null` if there are no optional parameters.
5774 * 5755 *
5775 * @return the right square bracket (']') or right curly brace ('}') introduci ng the optional 5756 * @return the right square bracket (']') or right curly brace ('}') introduci ng the optional
5776 * parameters 5757 * parameters
5777 */ 5758 */
5778 Token get rightDelimiter => _rightDelimiter; 5759 Token get rightDelimiter => _rightDelimiter;
5779 5760
5780 /** 5761 /**
5781 * Return the right parenthesis. 5762 * Return the right parenthesis.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
5816 /** 5797 /**
5817 * Set the right parenthesis to the given token. 5798 * Set the right parenthesis to the given token.
5818 * 5799 *
5819 * @param parenthesis the right parenthesis 5800 * @param parenthesis the right parenthesis
5820 */ 5801 */
5821 void set rightParenthesis(Token parenthesis) { 5802 void set rightParenthesis(Token parenthesis) {
5822 _rightParenthesis = parenthesis; 5803 _rightParenthesis = parenthesis;
5823 } 5804 }
5824 5805
5825 void visitChildren(ASTVisitor visitor) { 5806 void visitChildren(ASTVisitor visitor) {
5826 parameters.accept(visitor); 5807 _parameters.accept(visitor);
5827 } 5808 }
5828 } 5809 }
5829 5810
5830 /** 5811 /**
5831 * The abstract class `FunctionBody` defines the behavior common to objects repr esenting the 5812 * The abstract class `FunctionBody` defines the behavior common to objects repr esenting the
5832 * body of a function or method. 5813 * body of a function or method.
5833 * 5814 *
5834 * <pre> 5815 * <pre>
5835 * functionBody ::= 5816 * functionBody ::=
5836 * [BlockFunctionBody] 5817 * [BlockFunctionBody]
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
5889 * Initialize a newly created function declaration. 5870 * Initialize a newly created function declaration.
5890 * 5871 *
5891 * @param comment the documentation comment associated with this function 5872 * @param comment the documentation comment associated with this function
5892 * @param metadata the annotations associated with this function 5873 * @param metadata the annotations associated with this function
5893 * @param externalKeyword the token representing the 'external' keyword 5874 * @param externalKeyword the token representing the 'external' keyword
5894 * @param returnType the return type of the function 5875 * @param returnType the return type of the function
5895 * @param propertyKeyword the token representing the 'get' or 'set' keyword 5876 * @param propertyKeyword the token representing the 'get' or 'set' keyword
5896 * @param name the name of the function 5877 * @param name the name of the function
5897 * @param functionExpression the function expression being wrapped 5878 * @param functionExpression the function expression being wrapped
5898 */ 5879 */
5899 FunctionDeclaration.full(Comment comment, List<Annotation> metadata, Token ext ernalKeyword, TypeName returnType, Token propertyKeyword, SimpleIdentifier name, FunctionExpression functionExpression) : super.full(comment, metadata) { 5880 FunctionDeclaration.full(Comment comment, List<Annotation> metadata, this.exte rnalKeyword, TypeName returnType, this.propertyKeyword, SimpleIdentifier name, F unctionExpression functionExpression) : super.full(comment, metadata) {
5900 this.externalKeyword = externalKeyword;
5901 this._returnType = becomeParentOf(returnType); 5881 this._returnType = becomeParentOf(returnType);
5902 this.propertyKeyword = propertyKeyword;
5903 this._name = becomeParentOf(name); 5882 this._name = becomeParentOf(name);
5904 this._functionExpression = becomeParentOf(functionExpression); 5883 this._functionExpression = becomeParentOf(functionExpression);
5905 } 5884 }
5906 5885
5907 /** 5886 /**
5908 * Initialize a newly created function declaration. 5887 * Initialize a newly created function declaration.
5909 * 5888 *
5910 * @param comment the documentation comment associated with this function 5889 * @param comment the documentation comment associated with this function
5911 * @param metadata the annotations associated with this function 5890 * @param metadata the annotations associated with this function
5912 * @param externalKeyword the token representing the 'external' keyword 5891 * @param externalKeyword the token representing the 'external' keyword
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
6010 /** 5989 /**
6011 * Instances of the class `FunctionDeclarationStatement` wrap a [FunctionDeclara tion 5990 * Instances of the class `FunctionDeclarationStatement` wrap a [FunctionDeclara tion
6012 ] as a statement. 5991 ] as a statement.
6013 * 5992 *
6014 * @coverage dart.engine.ast 5993 * @coverage dart.engine.ast
6015 */ 5994 */
6016 class FunctionDeclarationStatement extends Statement { 5995 class FunctionDeclarationStatement extends Statement {
6017 /** 5996 /**
6018 * The function declaration being wrapped. 5997 * The function declaration being wrapped.
6019 */ 5998 */
6020 FunctionDeclaration functionDeclaration; 5999 FunctionDeclaration _functionDeclaration;
6021 6000
6022 /** 6001 /**
6023 * Initialize a newly created function declaration statement. 6002 * Initialize a newly created function declaration statement.
6024 * 6003 *
6025 * @param functionDeclaration the the function declaration being wrapped 6004 * @param functionDeclaration the the function declaration being wrapped
6026 */ 6005 */
6027 FunctionDeclarationStatement.full(FunctionDeclaration functionDeclaration) { 6006 FunctionDeclarationStatement.full(FunctionDeclaration functionDeclaration) {
6028 this.functionDeclaration = becomeParentOf(functionDeclaration); 6007 this._functionDeclaration = becomeParentOf(functionDeclaration);
6029 } 6008 }
6030 6009
6031 /** 6010 /**
6032 * Initialize a newly created function declaration statement. 6011 * Initialize a newly created function declaration statement.
6033 * 6012 *
6034 * @param functionDeclaration the the function declaration being wrapped 6013 * @param functionDeclaration the the function declaration being wrapped
6035 */ 6014 */
6036 FunctionDeclarationStatement({FunctionDeclaration functionDeclaration}) : this .full(functionDeclaration); 6015 FunctionDeclarationStatement({FunctionDeclaration functionDeclaration}) : this .full(functionDeclaration);
6037 6016
6038 accept(ASTVisitor visitor) => visitor.visitFunctionDeclarationStatement(this); 6017 accept(ASTVisitor visitor) => visitor.visitFunctionDeclarationStatement(this);
6039 6018
6040 Token get beginToken => functionDeclaration.beginToken; 6019 Token get beginToken => _functionDeclaration.beginToken;
6041 6020
6042 Token get endToken => functionDeclaration.endToken; 6021 Token get endToken => _functionDeclaration.endToken;
6022
6023 /**
6024 * Return the function declaration being wrapped.
6025 *
6026 * @return the function declaration being wrapped
6027 */
6028 FunctionDeclaration get functionDeclaration => _functionDeclaration;
6043 6029
6044 /** 6030 /**
6045 * Set the function declaration being wrapped to the given function declaratio n. 6031 * Set the function declaration being wrapped to the given function declaratio n.
6046 * 6032 *
6047 * @param functionDeclaration the function declaration being wrapped 6033 * @param functionDeclaration the function declaration being wrapped
6048 */ 6034 */
6049 void set functionExpression(FunctionDeclaration functionDeclaration) { 6035 void set functionExpression(FunctionDeclaration functionDeclaration) {
6050 this.functionDeclaration = becomeParentOf(functionDeclaration); 6036 this._functionDeclaration = becomeParentOf(functionDeclaration);
6051 } 6037 }
6052 6038
6053 void visitChildren(ASTVisitor visitor) { 6039 void visitChildren(ASTVisitor visitor) {
6054 safelyVisitChild(functionDeclaration, visitor); 6040 safelyVisitChild(_functionDeclaration, visitor);
6055 } 6041 }
6056 } 6042 }
6057 6043
6058 /** 6044 /**
6059 * Instances of the class `FunctionExpression` represent a function expression. 6045 * Instances of the class `FunctionExpression` represent a function expression.
6060 * 6046 *
6061 * <pre> 6047 * <pre>
6062 * functionExpression ::= 6048 * functionExpression ::=
6063 * [FormalParameterList] [FunctionBody] 6049 * [FormalParameterList] [FunctionBody]
6064 * </pre> 6050 * </pre>
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
6560 * hideCombinator ::= 6546 * hideCombinator ::=
6561 * 'hide' [SimpleIdentifier] (',' [SimpleIdentifier])* 6547 * 'hide' [SimpleIdentifier] (',' [SimpleIdentifier])*
6562 * </pre> 6548 * </pre>
6563 * 6549 *
6564 * @coverage dart.engine.ast 6550 * @coverage dart.engine.ast
6565 */ 6551 */
6566 class HideCombinator extends Combinator { 6552 class HideCombinator extends Combinator {
6567 /** 6553 /**
6568 * The list of names from the library that are hidden by this combinator. 6554 * The list of names from the library that are hidden by this combinator.
6569 */ 6555 */
6570 NodeList<SimpleIdentifier> hiddenNames; 6556 NodeList<SimpleIdentifier> _hiddenNames;
6571 6557
6572 /** 6558 /**
6573 * Initialize a newly created import show combinator. 6559 * Initialize a newly created import show combinator.
6574 * 6560 *
6575 * @param keyword the comma introducing the combinator 6561 * @param keyword the comma introducing the combinator
6576 * @param hiddenNames the list of names from the library that are hidden by th is combinator 6562 * @param hiddenNames the list of names from the library that are hidden by th is combinator
6577 */ 6563 */
6578 HideCombinator.full(Token keyword, List<SimpleIdentifier> hiddenNames) : super .full(keyword) { 6564 HideCombinator.full(Token keyword, List<SimpleIdentifier> hiddenNames) : super .full(keyword) {
6579 this.hiddenNames = new NodeList<SimpleIdentifier>(this); 6565 this._hiddenNames = new NodeList<SimpleIdentifier>(this);
6580 this.hiddenNames.addAll(hiddenNames); 6566 this._hiddenNames.addAll(hiddenNames);
6581 } 6567 }
6582 6568
6583 /** 6569 /**
6584 * Initialize a newly created import show combinator. 6570 * Initialize a newly created import show combinator.
6585 * 6571 *
6586 * @param keyword the comma introducing the combinator 6572 * @param keyword the comma introducing the combinator
6587 * @param hiddenNames the list of names from the library that are hidden by th is combinator 6573 * @param hiddenNames the list of names from the library that are hidden by th is combinator
6588 */ 6574 */
6589 HideCombinator({Token keyword, List<SimpleIdentifier> hiddenNames}) : this.ful l(keyword, hiddenNames); 6575 HideCombinator({Token keyword, List<SimpleIdentifier> hiddenNames}) : this.ful l(keyword, hiddenNames);
6590 6576
6591 accept(ASTVisitor visitor) => visitor.visitHideCombinator(this); 6577 accept(ASTVisitor visitor) => visitor.visitHideCombinator(this);
6592 6578
6593 Token get endToken => hiddenNames.endToken; 6579 Token get endToken => _hiddenNames.endToken;
6580
6581 /**
6582 * Return the list of names from the library that are hidden by this combinato r.
6583 *
6584 * @return the list of names from the library that are hidden by this combinat or
6585 */
6586 NodeList<SimpleIdentifier> get hiddenNames => _hiddenNames;
6594 6587
6595 void visitChildren(ASTVisitor visitor) { 6588 void visitChildren(ASTVisitor visitor) {
6596 hiddenNames.accept(visitor); 6589 _hiddenNames.accept(visitor);
6597 } 6590 }
6598 } 6591 }
6599 6592
6600 /** 6593 /**
6601 * The abstract class `Identifier` defines the behavior common to nodes that rep resent an 6594 * The abstract class `Identifier` defines the behavior common to nodes that rep resent an
6602 * identifier. 6595 * identifier.
6603 * 6596 *
6604 * <pre> 6597 * <pre>
6605 * identifier ::= 6598 * identifier ::=
6606 * [SimpleIdentifier] 6599 * [SimpleIdentifier]
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
6710 * Initialize a newly created if statement. 6703 * Initialize a newly created if statement.
6711 * 6704 *
6712 * @param ifKeyword the token representing the 'if' keyword 6705 * @param ifKeyword the token representing the 'if' keyword
6713 * @param leftParenthesis the left parenthesis 6706 * @param leftParenthesis the left parenthesis
6714 * @param condition the condition used to determine which of the statements is executed next 6707 * @param condition the condition used to determine which of the statements is executed next
6715 * @param rightParenthesis the right parenthesis 6708 * @param rightParenthesis the right parenthesis
6716 * @param thenStatement the statement that is executed if the condition evalua tes to `true` 6709 * @param thenStatement the statement that is executed if the condition evalua tes to `true`
6717 * @param elseKeyword the token representing the 'else' keyword 6710 * @param elseKeyword the token representing the 'else' keyword
6718 * @param elseStatement the statement that is executed if the condition evalua tes to `false` 6711 * @param elseStatement the statement that is executed if the condition evalua tes to `false`
6719 */ 6712 */
6720 IfStatement.full(Token ifKeyword, Token leftParenthesis, Expression condition, Token rightParenthesis, Statement thenStatement, Token elseKeyword, Statement e lseStatement) { 6713 IfStatement.full(this.ifKeyword, this.leftParenthesis, Expression condition, t his.rightParenthesis, Statement thenStatement, this.elseKeyword, Statement elseS tatement) {
6721 this.ifKeyword = ifKeyword;
6722 this.leftParenthesis = leftParenthesis;
6723 this._condition = becomeParentOf(condition); 6714 this._condition = becomeParentOf(condition);
6724 this.rightParenthesis = rightParenthesis;
6725 this._thenStatement = becomeParentOf(thenStatement); 6715 this._thenStatement = becomeParentOf(thenStatement);
6726 this.elseKeyword = elseKeyword;
6727 this._elseStatement = becomeParentOf(elseStatement); 6716 this._elseStatement = becomeParentOf(elseStatement);
6728 } 6717 }
6729 6718
6730 /** 6719 /**
6731 * Initialize a newly created if statement. 6720 * Initialize a newly created if statement.
6732 * 6721 *
6733 * @param ifKeyword the token representing the 'if' keyword 6722 * @param ifKeyword the token representing the 'if' keyword
6734 * @param leftParenthesis the left parenthesis 6723 * @param leftParenthesis the left parenthesis
6735 * @param condition the condition used to determine which of the statements is executed next 6724 * @param condition the condition used to determine which of the statements is executed next
6736 * @param rightParenthesis the right parenthesis 6725 * @param rightParenthesis the right parenthesis
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
6823 */ 6812 */
6824 class ImplementsClause extends ASTNode { 6813 class ImplementsClause extends ASTNode {
6825 /** 6814 /**
6826 * The token representing the 'implements' keyword. 6815 * The token representing the 'implements' keyword.
6827 */ 6816 */
6828 Token keyword; 6817 Token keyword;
6829 6818
6830 /** 6819 /**
6831 * The interfaces that are being implemented. 6820 * The interfaces that are being implemented.
6832 */ 6821 */
6833 NodeList<TypeName> interfaces; 6822 NodeList<TypeName> _interfaces;
6834 6823
6835 /** 6824 /**
6836 * Initialize a newly created implements clause. 6825 * Initialize a newly created implements clause.
6837 * 6826 *
6838 * @param keyword the token representing the 'implements' keyword 6827 * @param keyword the token representing the 'implements' keyword
6839 * @param interfaces the interfaces that are being implemented 6828 * @param interfaces the interfaces that are being implemented
6840 */ 6829 */
6841 ImplementsClause.full(Token keyword, List<TypeName> interfaces) { 6830 ImplementsClause.full(this.keyword, List<TypeName> interfaces) {
6842 this.interfaces = new NodeList<TypeName>(this); 6831 this._interfaces = new NodeList<TypeName>(this);
6843 this.keyword = keyword; 6832 this._interfaces.addAll(interfaces);
6844 this.interfaces.addAll(interfaces);
6845 } 6833 }
6846 6834
6847 /** 6835 /**
6848 * Initialize a newly created implements clause. 6836 * Initialize a newly created implements clause.
6849 * 6837 *
6850 * @param keyword the token representing the 'implements' keyword 6838 * @param keyword the token representing the 'implements' keyword
6851 * @param interfaces the interfaces that are being implemented 6839 * @param interfaces the interfaces that are being implemented
6852 */ 6840 */
6853 ImplementsClause({Token keyword, List<TypeName> interfaces}) : this.full(keywo rd, interfaces); 6841 ImplementsClause({Token keyword, List<TypeName> interfaces}) : this.full(keywo rd, interfaces);
6854 6842
6855 accept(ASTVisitor visitor) => visitor.visitImplementsClause(this); 6843 accept(ASTVisitor visitor) => visitor.visitImplementsClause(this);
6856 6844
6857 Token get beginToken => keyword; 6845 Token get beginToken => keyword;
6858 6846
6859 Token get endToken => interfaces.endToken; 6847 Token get endToken => _interfaces.endToken;
6848
6849 /**
6850 * Return the list of the interfaces that are being implemented.
6851 *
6852 * @return the list of the interfaces that are being implemented
6853 */
6854 NodeList<TypeName> get interfaces => _interfaces;
6860 6855
6861 void visitChildren(ASTVisitor visitor) { 6856 void visitChildren(ASTVisitor visitor) {
6862 interfaces.accept(visitor); 6857 _interfaces.accept(visitor);
6863 } 6858 }
6864 } 6859 }
6865 6860
6866 /** 6861 /**
6867 * Instances of the class `ImportDirective` represent an import directive. 6862 * Instances of the class `ImportDirective` represent an import directive.
6868 * 6863 *
6869 * <pre> 6864 * <pre>
6870 * importDirective ::= 6865 * importDirective ::=
6871 * [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* '; ' 6866 * [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* '; '
6872 * </pre> 6867 * </pre>
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
6970 * 6965 *
6971 * @param comment the documentation comment associated with this directive 6966 * @param comment the documentation comment associated with this directive
6972 * @param metadata the annotations associated with the directive 6967 * @param metadata the annotations associated with the directive
6973 * @param keyword the token representing the 'import' keyword 6968 * @param keyword the token representing the 'import' keyword
6974 * @param libraryUri the URI of the library being imported 6969 * @param libraryUri the URI of the library being imported
6975 * @param asToken the token representing the 'as' token 6970 * @param asToken the token representing the 'as' token
6976 * @param prefix the prefix to be used with the imported names 6971 * @param prefix the prefix to be used with the imported names
6977 * @param combinators the combinators used to control how names are imported 6972 * @param combinators the combinators used to control how names are imported
6978 * @param semicolon the semicolon terminating the directive 6973 * @param semicolon the semicolon terminating the directive
6979 */ 6974 */
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) { 6975 ImportDirective.full(Comment comment, List<Annotation> metadata, Token keyword , StringLiteral libraryUri, this.asToken, SimpleIdentifier prefix, List<Combinat or> combinators, Token semicolon) : super.full(comment, metadata, keyword, libra ryUri, combinators, semicolon) {
6981 this.asToken = asToken;
6982 this._prefix = becomeParentOf(prefix); 6976 this._prefix = becomeParentOf(prefix);
6983 } 6977 }
6984 6978
6985 /** 6979 /**
6986 * Initialize a newly created import directive. 6980 * Initialize a newly created import directive.
6987 * 6981 *
6988 * @param comment the documentation comment associated with this directive 6982 * @param comment the documentation comment associated with this directive
6989 * @param metadata the annotations associated with the directive 6983 * @param metadata the annotations associated with the directive
6990 * @param keyword the token representing the 'import' keyword 6984 * @param keyword the token representing the 'import' keyword
6991 * @param libraryUri the URI of the library being imported 6985 * @param libraryUri the URI of the library being imported
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
7117 IndexExpression.forTarget({Expression target, Token leftBracket, Expression in dex, Token rightBracket}) : this.forTarget_full(target, leftBracket, index, righ tBracket); 7111 IndexExpression.forTarget({Expression target, Token leftBracket, Expression in dex, Token rightBracket}) : this.forTarget_full(target, leftBracket, index, righ tBracket);
7118 7112
7119 /** 7113 /**
7120 * Initialize a newly created index expression. 7114 * Initialize a newly created index expression.
7121 * 7115 *
7122 * @param period the period ("..") before a cascaded index expression 7116 * @param period the period ("..") before a cascaded index expression
7123 * @param leftBracket the left square bracket 7117 * @param leftBracket the left square bracket
7124 * @param index the expression used to compute the index 7118 * @param index the expression used to compute the index
7125 * @param rightBracket the right square bracket 7119 * @param rightBracket the right square bracket
7126 */ 7120 */
7127 IndexExpression.forCascade_full(Token period, Token leftBracket, Expression in dex, Token rightBracket) { 7121 IndexExpression.forCascade_full(this.period, Token leftBracket, Expression ind ex, Token rightBracket) {
7128 this.period = period;
7129 this._leftBracket = leftBracket; 7122 this._leftBracket = leftBracket;
7130 this._index = becomeParentOf(index); 7123 this._index = becomeParentOf(index);
7131 this._rightBracket = rightBracket; 7124 this._rightBracket = rightBracket;
7132 } 7125 }
7133 7126
7134 /** 7127 /**
7135 * Initialize a newly created index expression. 7128 * Initialize a newly created index expression.
7136 * 7129 *
7137 * @param period the period ("..") before a cascaded index expression 7130 * @param period the period ("..") before a cascaded index expression
7138 * @param leftBracket the left square bracket 7131 * @param leftBracket the left square bracket
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
7433 */ 7426 */
7434 ConstructorElement staticElement; 7427 ConstructorElement staticElement;
7435 7428
7436 /** 7429 /**
7437 * Initialize a newly created instance creation expression. 7430 * Initialize a newly created instance creation expression.
7438 * 7431 *
7439 * @param keyword the keyword used to indicate how an object should be created 7432 * @param keyword the keyword used to indicate how an object should be created
7440 * @param constructorName the name of the constructor to be invoked 7433 * @param constructorName the name of the constructor to be invoked
7441 * @param argumentList the list of arguments to the constructor 7434 * @param argumentList the list of arguments to the constructor
7442 */ 7435 */
7443 InstanceCreationExpression.full(Token keyword, ConstructorName constructorName , ArgumentList argumentList) { 7436 InstanceCreationExpression.full(this.keyword, ConstructorName constructorName, ArgumentList argumentList) {
7444 this.keyword = keyword;
7445 this.constructorName = becomeParentOf(constructorName); 7437 this.constructorName = becomeParentOf(constructorName);
7446 this._argumentList = becomeParentOf(argumentList); 7438 this._argumentList = becomeParentOf(argumentList);
7447 } 7439 }
7448 7440
7449 /** 7441 /**
7450 * Initialize a newly created instance creation expression. 7442 * Initialize a newly created instance creation expression.
7451 * 7443 *
7452 * @param keyword the keyword used to indicate how an object should be created 7444 * @param keyword the keyword used to indicate how an object should be created
7453 * @param constructorName the name of the constructor to be invoked 7445 * @param constructorName the name of the constructor to be invoked
7454 * @param argumentList the list of arguments to the constructor 7446 * @param argumentList the list of arguments to the constructor
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
7520 * The value of the literal. 7512 * The value of the literal.
7521 */ 7513 */
7522 int value = 0; 7514 int value = 0;
7523 7515
7524 /** 7516 /**
7525 * Initialize a newly created integer literal. 7517 * Initialize a newly created integer literal.
7526 * 7518 *
7527 * @param literal the token representing the literal 7519 * @param literal the token representing the literal
7528 * @param value the value of the literal 7520 * @param value the value of the literal
7529 */ 7521 */
7530 IntegerLiteral.full(Token literal, int value) { 7522 IntegerLiteral.full(this.literal, this.value);
7531 this.literal = literal;
7532 this.value = value;
7533 }
7534 7523
7535 /** 7524 /**
7536 * Initialize a newly created integer literal. 7525 * Initialize a newly created integer literal.
7537 * 7526 *
7538 * @param literal the token representing the literal 7527 * @param literal the token representing the literal
7539 * @param value the value of the literal 7528 * @param value the value of the literal
7540 */ 7529 */
7541 IntegerLiteral({Token literal, int value}) : this.full(literal, value); 7530 IntegerLiteral({Token literal, int value}) : this.full(literal, value);
7542 7531
7543 accept(ASTVisitor visitor) => visitor.visitIntegerLiteral(this); 7532 accept(ASTVisitor visitor) => visitor.visitIntegerLiteral(this);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
7594 */ 7583 */
7595 Token rightBracket; 7584 Token rightBracket;
7596 7585
7597 /** 7586 /**
7598 * Initialize a newly created interpolation expression. 7587 * Initialize a newly created interpolation expression.
7599 * 7588 *
7600 * @param leftBracket the left curly bracket 7589 * @param leftBracket the left curly bracket
7601 * @param expression the expression to be evaluated for the value to be conver ted into a string 7590 * @param expression the expression to be evaluated for the value to be conver ted into a string
7602 * @param rightBracket the right curly bracket 7591 * @param rightBracket the right curly bracket
7603 */ 7592 */
7604 InterpolationExpression.full(Token leftBracket, Expression expression, Token r ightBracket) { 7593 InterpolationExpression.full(this.leftBracket, Expression expression, this.rig htBracket) {
7605 this.leftBracket = leftBracket;
7606 this._expression = becomeParentOf(expression); 7594 this._expression = becomeParentOf(expression);
7607 this.rightBracket = rightBracket;
7608 } 7595 }
7609 7596
7610 /** 7597 /**
7611 * Initialize a newly created interpolation expression. 7598 * Initialize a newly created interpolation expression.
7612 * 7599 *
7613 * @param leftBracket the left curly bracket 7600 * @param leftBracket the left curly bracket
7614 * @param expression the expression to be evaluated for the value to be conver ted into a string 7601 * @param expression the expression to be evaluated for the value to be conver ted into a string
7615 * @param rightBracket the right curly bracket 7602 * @param rightBracket the right curly bracket
7616 */ 7603 */
7617 InterpolationExpression({Token leftBracket, Expression expression, Token right Bracket}) : this.full(leftBracket, expression, rightBracket); 7604 InterpolationExpression({Token leftBracket, Expression expression, Token right Bracket}) : this.full(leftBracket, expression, rightBracket);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
7764 TypeName _type; 7751 TypeName _type;
7765 7752
7766 /** 7753 /**
7767 * Initialize a newly created is expression. 7754 * Initialize a newly created is expression.
7768 * 7755 *
7769 * @param expression the expression used to compute the value whose type is be ing tested 7756 * @param expression the expression used to compute the value whose type is be ing tested
7770 * @param isOperator the is operator 7757 * @param isOperator the is operator
7771 * @param notOperator the not operator, or `null` if the sense of the test is not negated 7758 * @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 7759 * @param type the name of the type being tested for
7773 */ 7760 */
7774 IsExpression.full(Expression expression, Token isOperator, Token notOperator, TypeName type) { 7761 IsExpression.full(Expression expression, this.isOperator, this.notOperator, Ty peName type) {
7775 this._expression = becomeParentOf(expression); 7762 this._expression = becomeParentOf(expression);
7776 this.isOperator = isOperator;
7777 this.notOperator = notOperator;
7778 this._type = becomeParentOf(type); 7763 this._type = becomeParentOf(type);
7779 } 7764 }
7780 7765
7781 /** 7766 /**
7782 * Initialize a newly created is expression. 7767 * Initialize a newly created is expression.
7783 * 7768 *
7784 * @param expression the expression used to compute the value whose type is be ing tested 7769 * @param expression the expression used to compute the value whose type is be ing tested
7785 * @param isOperator the is operator 7770 * @param isOperator the is operator
7786 * @param notOperator the not operator, or `null` if the sense of the test is not negated 7771 * @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 7772 * @param type the name of the type being tested for
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
7855 * The colon that separates the label from the statement. 7840 * The colon that separates the label from the statement.
7856 */ 7841 */
7857 Token colon; 7842 Token colon;
7858 7843
7859 /** 7844 /**
7860 * Initialize a newly created label. 7845 * Initialize a newly created label.
7861 * 7846 *
7862 * @param label the label being applied 7847 * @param label the label being applied
7863 * @param colon the colon that separates the label from whatever follows 7848 * @param colon the colon that separates the label from whatever follows
7864 */ 7849 */
7865 Label.full(SimpleIdentifier label, Token colon) { 7850 Label.full(SimpleIdentifier label, this.colon) {
7866 this._label = becomeParentOf(label); 7851 this._label = becomeParentOf(label);
7867 this.colon = colon;
7868 } 7852 }
7869 7853
7870 /** 7854 /**
7871 * Initialize a newly created label. 7855 * Initialize a newly created label.
7872 * 7856 *
7873 * @param label the label being applied 7857 * @param label the label being applied
7874 * @param colon the colon that separates the label from whatever follows 7858 * @param colon the colon that separates the label from whatever follows
7875 */ 7859 */
7876 Label({SimpleIdentifier label, Token colon}) : this.full(label, colon); 7860 Label({SimpleIdentifier label, Token colon}) : this.full(label, colon);
7877 7861
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
7910 * labeledStatement ::= 7894 * labeledStatement ::=
7911 * [Label]+ [Statement] 7895 * [Label]+ [Statement]
7912 * </pre> 7896 * </pre>
7913 * 7897 *
7914 * @coverage dart.engine.ast 7898 * @coverage dart.engine.ast
7915 */ 7899 */
7916 class LabeledStatement extends Statement { 7900 class LabeledStatement extends Statement {
7917 /** 7901 /**
7918 * The labels being associated with the statement. 7902 * The labels being associated with the statement.
7919 */ 7903 */
7920 NodeList<Label> labels; 7904 NodeList<Label> _labels;
7921 7905
7922 /** 7906 /**
7923 * The statement with which the labels are being associated. 7907 * The statement with which the labels are being associated.
7924 */ 7908 */
7925 Statement _statement; 7909 Statement _statement;
7926 7910
7927 /** 7911 /**
7928 * Initialize a newly created labeled statement. 7912 * Initialize a newly created labeled statement.
7929 * 7913 *
7930 * @param labels the labels being associated with the statement 7914 * @param labels the labels being associated with the statement
7931 * @param statement the statement with which the labels are being associated 7915 * @param statement the statement with which the labels are being associated
7932 */ 7916 */
7933 LabeledStatement.full(List<Label> labels, Statement statement) { 7917 LabeledStatement.full(List<Label> labels, Statement statement) {
7934 this.labels = new NodeList<Label>(this); 7918 this._labels = new NodeList<Label>(this);
7935 this.labels.addAll(labels); 7919 this._labels.addAll(labels);
7936 this._statement = becomeParentOf(statement); 7920 this._statement = becomeParentOf(statement);
7937 } 7921 }
7938 7922
7939 /** 7923 /**
7940 * Initialize a newly created labeled statement. 7924 * Initialize a newly created labeled statement.
7941 * 7925 *
7942 * @param labels the labels being associated with the statement 7926 * @param labels the labels being associated with the statement
7943 * @param statement the statement with which the labels are being associated 7927 * @param statement the statement with which the labels are being associated
7944 */ 7928 */
7945 LabeledStatement({List<Label> labels, Statement statement}) : this.full(labels , statement); 7929 LabeledStatement({List<Label> labels, Statement statement}) : this.full(labels , statement);
7946 7930
7947 accept(ASTVisitor visitor) => visitor.visitLabeledStatement(this); 7931 accept(ASTVisitor visitor) => visitor.visitLabeledStatement(this);
7948 7932
7949 Token get beginToken { 7933 Token get beginToken {
7950 if (!labels.isEmpty) { 7934 if (!_labels.isEmpty) {
7951 return labels.beginToken; 7935 return _labels.beginToken;
7952 } 7936 }
7953 return _statement.beginToken; 7937 return _statement.beginToken;
7954 } 7938 }
7955 7939
7956 Token get endToken => _statement.endToken; 7940 Token get endToken => _statement.endToken;
7957 7941
7958 /** 7942 /**
7943 * Return the labels being associated with the statement.
7944 *
7945 * @return the labels being associated with the statement
7946 */
7947 NodeList<Label> get labels => _labels;
7948
7949 /**
7959 * Return the statement with which the labels are being associated. 7950 * Return the statement with which the labels are being associated.
7960 * 7951 *
7961 * @return the statement with which the labels are being associated 7952 * @return the statement with which the labels are being associated
7962 */ 7953 */
7963 Statement get statement => _statement; 7954 Statement get statement => _statement;
7964 7955
7965 /** 7956 /**
7966 * Set the statement with which the labels are being associated to the given s tatement. 7957 * Set the statement with which the labels are being associated to the given s tatement.
7967 * 7958 *
7968 * @param statement the statement with which the labels are being associated 7959 * @param statement the statement with which the labels are being associated
7969 */ 7960 */
7970 void set statement(Statement statement) { 7961 void set statement(Statement statement) {
7971 this._statement = becomeParentOf(statement); 7962 this._statement = becomeParentOf(statement);
7972 } 7963 }
7973 7964
7974 void visitChildren(ASTVisitor visitor) { 7965 void visitChildren(ASTVisitor visitor) {
7975 labels.accept(visitor); 7966 _labels.accept(visitor);
7976 safelyVisitChild(_statement, visitor); 7967 safelyVisitChild(_statement, visitor);
7977 } 7968 }
7978 } 7969 }
7979 7970
7980 /** 7971 /**
7981 * Instances of the class `LibraryDirective` represent a library directive. 7972 * Instances of the class `LibraryDirective` represent a library directive.
7982 * 7973 *
7983 * <pre> 7974 * <pre>
7984 * libraryDirective ::= 7975 * libraryDirective ::=
7985 * [Annotation] 'library' [Identifier] ';' 7976 * [Annotation] 'library' [Identifier] ';'
(...skipping 19 matching lines...) Expand all
8005 7996
8006 /** 7997 /**
8007 * Initialize a newly created library directive. 7998 * Initialize a newly created library directive.
8008 * 7999 *
8009 * @param comment the documentation comment associated with this directive 8000 * @param comment the documentation comment associated with this directive
8010 * @param metadata the annotations associated with the directive 8001 * @param metadata the annotations associated with the directive
8011 * @param libraryToken the token representing the 'library' token 8002 * @param libraryToken the token representing the 'library' token
8012 * @param name the name of the library being defined 8003 * @param name the name of the library being defined
8013 * @param semicolon the semicolon terminating the directive 8004 * @param semicolon the semicolon terminating the directive
8014 */ 8005 */
8015 LibraryDirective.full(Comment comment, List<Annotation> metadata, Token librar yToken, LibraryIdentifier name, Token semicolon) : super.full(comment, metadata) { 8006 LibraryDirective.full(Comment comment, List<Annotation> metadata, this.library Token, LibraryIdentifier name, this.semicolon) : super.full(comment, metadata) {
8016 this.libraryToken = libraryToken;
8017 this._name = becomeParentOf(name); 8007 this._name = becomeParentOf(name);
8018 this.semicolon = semicolon;
8019 } 8008 }
8020 8009
8021 /** 8010 /**
8022 * Initialize a newly created library directive. 8011 * Initialize a newly created library directive.
8023 * 8012 *
8024 * @param comment the documentation comment associated with this directive 8013 * @param comment the documentation comment associated with this directive
8025 * @param metadata the annotations associated with the directive 8014 * @param metadata the annotations associated with the directive
8026 * @param libraryToken the token representing the 'library' token 8015 * @param libraryToken the token representing the 'library' token
8027 * @param name the name of the library being defined 8016 * @param name the name of the library being defined
8028 * @param semicolon the semicolon terminating the directive 8017 * @param semicolon the semicolon terminating the directive
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
8066 * libraryIdentifier ::= 8055 * libraryIdentifier ::=
8067 * [SimpleIdentifier] ('.' [SimpleIdentifier])* 8056 * [SimpleIdentifier] ('.' [SimpleIdentifier])*
8068 * </pre> 8057 * </pre>
8069 * 8058 *
8070 * @coverage dart.engine.ast 8059 * @coverage dart.engine.ast
8071 */ 8060 */
8072 class LibraryIdentifier extends Identifier { 8061 class LibraryIdentifier extends Identifier {
8073 /** 8062 /**
8074 * The components of the identifier. 8063 * The components of the identifier.
8075 */ 8064 */
8076 NodeList<SimpleIdentifier> components; 8065 NodeList<SimpleIdentifier> _components;
8077 8066
8078 /** 8067 /**
8079 * Initialize a newly created prefixed identifier. 8068 * Initialize a newly created prefixed identifier.
8080 * 8069 *
8081 * @param components the components of the identifier 8070 * @param components the components of the identifier
8082 */ 8071 */
8083 LibraryIdentifier.full(List<SimpleIdentifier> components) { 8072 LibraryIdentifier.full(List<SimpleIdentifier> components) {
8084 this.components = new NodeList<SimpleIdentifier>(this); 8073 this._components = new NodeList<SimpleIdentifier>(this);
8085 this.components.addAll(components); 8074 this._components.addAll(components);
8086 } 8075 }
8087 8076
8088 /** 8077 /**
8089 * Initialize a newly created prefixed identifier. 8078 * Initialize a newly created prefixed identifier.
8090 * 8079 *
8091 * @param components the components of the identifier 8080 * @param components the components of the identifier
8092 */ 8081 */
8093 LibraryIdentifier({List<SimpleIdentifier> components}) : this.full(components) ; 8082 LibraryIdentifier({List<SimpleIdentifier> components}) : this.full(components) ;
8094 8083
8095 accept(ASTVisitor visitor) => visitor.visitLibraryIdentifier(this); 8084 accept(ASTVisitor visitor) => visitor.visitLibraryIdentifier(this);
8096 8085
8097 Token get beginToken => components.beginToken; 8086 Token get beginToken => _components.beginToken;
8098 8087
8099 Element get bestElement => staticElement; 8088 Element get bestElement => staticElement;
8100 8089
8101 Token get endToken => components.endToken; 8090 /**
8091 * Return the components of the identifier.
8092 *
8093 * @return the components of the identifier
8094 */
8095 NodeList<SimpleIdentifier> get components => _components;
8096
8097 Token get endToken => _components.endToken;
8102 8098
8103 String get name { 8099 String get name {
8104 JavaStringBuilder builder = new JavaStringBuilder(); 8100 JavaStringBuilder builder = new JavaStringBuilder();
8105 bool needsPeriod = false; 8101 bool needsPeriod = false;
8106 for (SimpleIdentifier identifier in components) { 8102 for (SimpleIdentifier identifier in _components) {
8107 if (needsPeriod) { 8103 if (needsPeriod) {
8108 builder.append("."); 8104 builder.append(".");
8109 } else { 8105 } else {
8110 needsPeriod = true; 8106 needsPeriod = true;
8111 } 8107 }
8112 builder.append(identifier.name); 8108 builder.append(identifier.name);
8113 } 8109 }
8114 return builder.toString(); 8110 return builder.toString();
8115 } 8111 }
8116 8112
8117 int get precedence => 15; 8113 int get precedence => 15;
8118 8114
8119 Element get propagatedElement => null; 8115 Element get propagatedElement => null;
8120 8116
8121 Element get staticElement => null; 8117 Element get staticElement => null;
8122 8118
8123 void visitChildren(ASTVisitor visitor) { 8119 void visitChildren(ASTVisitor visitor) {
8124 components.accept(visitor); 8120 _components.accept(visitor);
8125 } 8121 }
8126 } 8122 }
8127 8123
8128 /** 8124 /**
8129 * Instances of the class `ListLiteral` represent a list literal. 8125 * Instances of the class `ListLiteral` represent a list literal.
8130 * 8126 *
8131 * <pre> 8127 * <pre>
8132 * listLiteral ::= 8128 * listLiteral ::=
8133 * 'const'? ('<' [TypeName] '>')? '[' ([Expression] ','?)? ']' 8129 * 'const'? ('<' [TypeName] '>')? '[' ([Expression] ','?)? ']'
8134 * </pre> 8130 * </pre>
8135 * 8131 *
8136 * @coverage dart.engine.ast 8132 * @coverage dart.engine.ast
8137 */ 8133 */
8138 class ListLiteral extends TypedLiteral { 8134 class ListLiteral extends TypedLiteral {
8139 /** 8135 /**
8140 * The left square bracket. 8136 * The left square bracket.
8141 */ 8137 */
8142 Token _leftBracket; 8138 Token _leftBracket;
8143 8139
8144 /** 8140 /**
8145 * The expressions used to compute the elements of the list. 8141 * The expressions used to compute the elements of the list.
8146 */ 8142 */
8147 NodeList<Expression> elements; 8143 NodeList<Expression> _elements;
8148 8144
8149 /** 8145 /**
8150 * The right square bracket. 8146 * The right square bracket.
8151 */ 8147 */
8152 Token _rightBracket; 8148 Token _rightBracket;
8153 8149
8154 /** 8150 /**
8155 * Initialize a newly created list literal. 8151 * Initialize a newly created list literal.
8156 * 8152 *
8157 * @param constKeyword the token representing the 'const' keyword 8153 * @param constKeyword the token representing the 'const' keyword
8158 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 8154 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
8159 * arguments were declared 8155 * arguments were declared
8160 * @param leftBracket the left square bracket 8156 * @param leftBracket the left square bracket
8161 * @param elements the expressions used to compute the elements of the list 8157 * @param elements the expressions used to compute the elements of the list
8162 * @param rightBracket the right square bracket 8158 * @param rightBracket the right square bracket
8163 */ 8159 */
8164 ListLiteral.full(Token constKeyword, TypeArgumentList typeArguments, Token lef tBracket, List<Expression> elements, Token rightBracket) : super.full(constKeywo rd, typeArguments) { 8160 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); 8161 this._elements = new NodeList<Expression>(this);
8166 this._leftBracket = leftBracket; 8162 this._leftBracket = leftBracket;
8167 this.elements.addAll(elements); 8163 this._elements.addAll(elements);
8168 this._rightBracket = rightBracket; 8164 this._rightBracket = rightBracket;
8169 } 8165 }
8170 8166
8171 /** 8167 /**
8172 * Initialize a newly created list literal. 8168 * Initialize a newly created list literal.
8173 * 8169 *
8174 * @param constKeyword the token representing the 'const' keyword 8170 * @param constKeyword the token representing the 'const' keyword
8175 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 8171 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
8176 * arguments were declared 8172 * arguments were declared
8177 * @param leftBracket the left square bracket 8173 * @param leftBracket the left square bracket
8178 * @param elements the expressions used to compute the elements of the list 8174 * @param elements the expressions used to compute the elements of the list
8179 * @param rightBracket the right square bracket 8175 * @param rightBracket the right square bracket
8180 */ 8176 */
8181 ListLiteral({Token constKeyword, TypeArgumentList typeArguments, Token leftBra cket, List<Expression> elements, Token rightBracket}) : this.full(constKeyword, typeArguments, leftBracket, elements, rightBracket); 8177 ListLiteral({Token constKeyword, TypeArgumentList typeArguments, Token leftBra cket, List<Expression> elements, Token rightBracket}) : this.full(constKeyword, typeArguments, leftBracket, elements, rightBracket);
8182 8178
8183 accept(ASTVisitor visitor) => visitor.visitListLiteral(this); 8179 accept(ASTVisitor visitor) => visitor.visitListLiteral(this);
8184 8180
8185 Token get beginToken { 8181 Token get beginToken {
8186 Token token = constKeyword; 8182 Token token = constKeyword;
8187 if (token != null) { 8183 if (token != null) {
8188 return token; 8184 return token;
8189 } 8185 }
8190 TypeArgumentList typeArguments = this.typeArguments; 8186 TypeArgumentList typeArguments = this.typeArguments;
8191 if (typeArguments != null) { 8187 if (typeArguments != null) {
8192 return typeArguments.beginToken; 8188 return typeArguments.beginToken;
8193 } 8189 }
8194 return _leftBracket; 8190 return _leftBracket;
8195 } 8191 }
8196 8192
8193 /**
8194 * Return the expressions used to compute the elements of the list.
8195 *
8196 * @return the expressions used to compute the elements of the list
8197 */
8198 NodeList<Expression> get elements => _elements;
8199
8197 Token get endToken => _rightBracket; 8200 Token get endToken => _rightBracket;
8198 8201
8199 /** 8202 /**
8200 * Return the left square bracket. 8203 * Return the left square bracket.
8201 * 8204 *
8202 * @return the left square bracket 8205 * @return the left square bracket
8203 */ 8206 */
8204 Token get leftBracket => _leftBracket; 8207 Token get leftBracket => _leftBracket;
8205 8208
8206 /** 8209 /**
(...skipping 16 matching lines...) Expand all
8223 * Set the right square bracket to the given token. 8226 * Set the right square bracket to the given token.
8224 * 8227 *
8225 * @param bracket the right square bracket 8228 * @param bracket the right square bracket
8226 */ 8229 */
8227 void set rightBracket(Token bracket) { 8230 void set rightBracket(Token bracket) {
8228 _rightBracket = bracket; 8231 _rightBracket = bracket;
8229 } 8232 }
8230 8233
8231 void visitChildren(ASTVisitor visitor) { 8234 void visitChildren(ASTVisitor visitor) {
8232 super.visitChildren(visitor); 8235 super.visitChildren(visitor);
8233 elements.accept(visitor); 8236 _elements.accept(visitor);
8234 } 8237 }
8235 } 8238 }
8236 8239
8237 /** 8240 /**
8238 * The abstract class `Literal` defines the behavior common to nodes that repres ent a literal 8241 * The abstract class `Literal` defines the behavior common to nodes that repres ent a literal
8239 * expression. 8242 * expression.
8240 * 8243 *
8241 * <pre> 8244 * <pre>
8242 * literal ::= 8245 * literal ::=
8243 * [BooleanLiteral] 8246 * [BooleanLiteral]
(...skipping 23 matching lines...) Expand all
8267 */ 8270 */
8268 class MapLiteral extends TypedLiteral { 8271 class MapLiteral extends TypedLiteral {
8269 /** 8272 /**
8270 * The left curly bracket. 8273 * The left curly bracket.
8271 */ 8274 */
8272 Token _leftBracket; 8275 Token _leftBracket;
8273 8276
8274 /** 8277 /**
8275 * The entries in the map. 8278 * The entries in the map.
8276 */ 8279 */
8277 NodeList<MapLiteralEntry> entries; 8280 NodeList<MapLiteralEntry> _entries;
8278 8281
8279 /** 8282 /**
8280 * The right curly bracket. 8283 * The right curly bracket.
8281 */ 8284 */
8282 Token _rightBracket; 8285 Token _rightBracket;
8283 8286
8284 /** 8287 /**
8285 * Initialize a newly created map literal. 8288 * Initialize a newly created map literal.
8286 * 8289 *
8287 * @param constKeyword the token representing the 'const' keyword 8290 * @param constKeyword the token representing the 'const' keyword
8288 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 8291 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
8289 * arguments were declared 8292 * arguments were declared
8290 * @param leftBracket the left curly bracket 8293 * @param leftBracket the left curly bracket
8291 * @param entries the entries in the map 8294 * @param entries the entries in the map
8292 * @param rightBracket the right curly bracket 8295 * @param rightBracket the right curly bracket
8293 */ 8296 */
8294 MapLiteral.full(Token constKeyword, TypeArgumentList typeArguments, Token left Bracket, List<MapLiteralEntry> entries, Token rightBracket) : super.full(constKe yword, typeArguments) { 8297 MapLiteral.full(Token constKeyword, TypeArgumentList typeArguments, Token left Bracket, List<MapLiteralEntry> entries, Token rightBracket) : super.full(constKe yword, typeArguments) {
8295 this.entries = new NodeList<MapLiteralEntry>(this); 8298 this._entries = new NodeList<MapLiteralEntry>(this);
8296 this._leftBracket = leftBracket; 8299 this._leftBracket = leftBracket;
8297 this.entries.addAll(entries); 8300 this._entries.addAll(entries);
8298 this._rightBracket = rightBracket; 8301 this._rightBracket = rightBracket;
8299 } 8302 }
8300 8303
8301 /** 8304 /**
8302 * Initialize a newly created map literal. 8305 * Initialize a newly created map literal.
8303 * 8306 *
8304 * @param constKeyword the token representing the 'const' keyword 8307 * @param constKeyword the token representing the 'const' keyword
8305 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 8308 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
8306 * arguments were declared 8309 * arguments were declared
8307 * @param leftBracket the left curly bracket 8310 * @param leftBracket the left curly bracket
(...skipping 12 matching lines...) Expand all
8320 TypeArgumentList typeArguments = this.typeArguments; 8323 TypeArgumentList typeArguments = this.typeArguments;
8321 if (typeArguments != null) { 8324 if (typeArguments != null) {
8322 return typeArguments.beginToken; 8325 return typeArguments.beginToken;
8323 } 8326 }
8324 return _leftBracket; 8327 return _leftBracket;
8325 } 8328 }
8326 8329
8327 Token get endToken => _rightBracket; 8330 Token get endToken => _rightBracket;
8328 8331
8329 /** 8332 /**
8333 * Return the entries in the map.
8334 *
8335 * @return the entries in the map
8336 */
8337 NodeList<MapLiteralEntry> get entries => _entries;
8338
8339 /**
8330 * Return the left curly bracket. 8340 * Return the left curly bracket.
8331 * 8341 *
8332 * @return the left curly bracket 8342 * @return the left curly bracket
8333 */ 8343 */
8334 Token get leftBracket => _leftBracket; 8344 Token get leftBracket => _leftBracket;
8335 8345
8336 /** 8346 /**
8337 * Return the right curly bracket. 8347 * Return the right curly bracket.
8338 * 8348 *
8339 * @return the right curly bracket 8349 * @return the right curly bracket
(...skipping 13 matching lines...) Expand all
8353 * Set the right curly bracket to the given token. 8363 * Set the right curly bracket to the given token.
8354 * 8364 *
8355 * @param bracket the right curly bracket 8365 * @param bracket the right curly bracket
8356 */ 8366 */
8357 void set rightBracket(Token bracket) { 8367 void set rightBracket(Token bracket) {
8358 _rightBracket = bracket; 8368 _rightBracket = bracket;
8359 } 8369 }
8360 8370
8361 void visitChildren(ASTVisitor visitor) { 8371 void visitChildren(ASTVisitor visitor) {
8362 super.visitChildren(visitor); 8372 super.visitChildren(visitor);
8363 entries.accept(visitor); 8373 _entries.accept(visitor);
8364 } 8374 }
8365 } 8375 }
8366 8376
8367 /** 8377 /**
8368 * Instances of the class `MapLiteralEntry` represent a single key/value pair in a map 8378 * Instances of the class `MapLiteralEntry` represent a single key/value pair in a map
8369 * literal. 8379 * literal.
8370 * 8380 *
8371 * <pre> 8381 * <pre>
8372 * mapLiteralEntry ::= 8382 * mapLiteralEntry ::=
8373 * [Expression] ':' [Expression] 8383 * [Expression] ':' [Expression]
(...skipping 17 matching lines...) Expand all
8391 */ 8401 */
8392 Expression _value; 8402 Expression _value;
8393 8403
8394 /** 8404 /**
8395 * Initialize a newly created map literal entry. 8405 * Initialize a newly created map literal entry.
8396 * 8406 *
8397 * @param key the expression computing the key with which the value will be as sociated 8407 * @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 8408 * @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 8409 * @param value the expression computing the value that will be associated wit h the key
8400 */ 8410 */
8401 MapLiteralEntry.full(Expression key, Token separator, Expression value) { 8411 MapLiteralEntry.full(Expression key, this.separator, Expression value) {
8402 this._key = becomeParentOf(key); 8412 this._key = becomeParentOf(key);
8403 this.separator = separator;
8404 this._value = becomeParentOf(value); 8413 this._value = becomeParentOf(value);
8405 } 8414 }
8406 8415
8407 /** 8416 /**
8408 * Initialize a newly created map literal entry. 8417 * Initialize a newly created map literal entry.
8409 * 8418 *
8410 * @param key the expression computing the key with which the value will be as sociated 8419 * @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 8420 * @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 8421 * @param value the expression computing the value that will be associated wit h the key
8413 */ 8422 */
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
8529 * @param metadata the annotations associated with this method 8538 * @param metadata the annotations associated with this method
8530 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword 8539 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword
8531 * @param returnType the return type of the method 8540 * @param returnType the return type of the method
8532 * @param propertyKeyword the token representing the 'get' or 'set' keyword 8541 * @param propertyKeyword the token representing the 'get' or 'set' keyword
8533 * @param operatorKeyword the token representing the 'operator' keyword 8542 * @param operatorKeyword the token representing the 'operator' keyword
8534 * @param name the name of the method 8543 * @param name the name of the method
8535 * @param parameters the parameters associated with the method, or `null` if t his method 8544 * @param parameters the parameters associated with the method, or `null` if t his method
8536 * declares a getter 8545 * declares a getter
8537 * @param body the body of the method 8546 * @param body the body of the method
8538 */ 8547 */
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) { 8548 MethodDeclaration.full(Comment comment, List<Annotation> metadata, this.extern alKeyword, this.modifierKeyword, TypeName returnType, this.propertyKeyword, this .operatorKeyword, SimpleIdentifier name, FormalParameterList parameters, Functio nBody body) : super.full(comment, metadata) {
8540 this.externalKeyword = externalKeyword;
8541 this.modifierKeyword = modifierKeyword;
8542 this._returnType = becomeParentOf(returnType); 8549 this._returnType = becomeParentOf(returnType);
8543 this.propertyKeyword = propertyKeyword;
8544 this.operatorKeyword = operatorKeyword;
8545 this._name = becomeParentOf(name); 8550 this._name = becomeParentOf(name);
8546 this._parameters = becomeParentOf(parameters); 8551 this._parameters = becomeParentOf(parameters);
8547 this._body = becomeParentOf(body); 8552 this._body = becomeParentOf(body);
8548 } 8553 }
8549 8554
8550 /** 8555 /**
8551 * Initialize a newly created method declaration. 8556 * Initialize a newly created method declaration.
8552 * 8557 *
8553 * @param externalKeyword the token for the 'external' keyword 8558 * @param externalKeyword the token for the 'external' keyword
8554 * @param comment the documentation comment associated with this method 8559 * @param comment the documentation comment associated with this method
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
8738 ArgumentList _argumentList; 8743 ArgumentList _argumentList;
8739 8744
8740 /** 8745 /**
8741 * Initialize a newly created method invocation. 8746 * Initialize a newly created method invocation.
8742 * 8747 *
8743 * @param target the expression producing the object on which the method is de fined 8748 * @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 8749 * @param period the period that separates the target from the method name
8745 * @param methodName the name of the method being invoked 8750 * @param methodName the name of the method being invoked
8746 * @param argumentList the list of arguments to the method 8751 * @param argumentList the list of arguments to the method
8747 */ 8752 */
8748 MethodInvocation.full(Expression target, Token period, SimpleIdentifier method Name, ArgumentList argumentList) { 8753 MethodInvocation.full(Expression target, this.period, SimpleIdentifier methodN ame, ArgumentList argumentList) {
8749 this._target = becomeParentOf(target); 8754 this._target = becomeParentOf(target);
8750 this.period = period;
8751 this._methodName = becomeParentOf(methodName); 8755 this._methodName = becomeParentOf(methodName);
8752 this._argumentList = becomeParentOf(argumentList); 8756 this._argumentList = becomeParentOf(argumentList);
8753 } 8757 }
8754 8758
8755 /** 8759 /**
8756 * Initialize a newly created method invocation. 8760 * Initialize a newly created method invocation.
8757 * 8761 *
8758 * @param target the expression producing the object on which the method is de fined 8762 * @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 8763 * @param period the period that separates the target from the method name
8760 * @param methodName the name of the method being invoked 8764 * @param methodName the name of the method being invoked
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
8978 * [ExportDirective] 8982 * [ExportDirective]
8979 * | [ImportDirective] 8983 * | [ImportDirective]
8980 * </pre> 8984 * </pre>
8981 * 8985 *
8982 * @coverage dart.engine.ast 8986 * @coverage dart.engine.ast
8983 */ 8987 */
8984 abstract class NamespaceDirective extends UriBasedDirective { 8988 abstract class NamespaceDirective extends UriBasedDirective {
8985 /** 8989 /**
8986 * The token representing the 'import' or 'export' keyword. 8990 * The token representing the 'import' or 'export' keyword.
8987 */ 8991 */
8988 Token _keyword; 8992 Token keyword;
8989 8993
8990 /** 8994 /**
8991 * The combinators used to control which names are imported or exported. 8995 * The combinators used to control which names are imported or exported.
8992 */ 8996 */
8993 NodeList<Combinator> combinators; 8997 NodeList<Combinator> _combinators;
8994 8998
8995 /** 8999 /**
8996 * The semicolon terminating the directive. 9000 * The semicolon terminating the directive.
8997 */ 9001 */
8998 Token semicolon; 9002 Token semicolon;
8999 9003
9000 /** 9004 /**
9001 * Initialize a newly created namespace directive. 9005 * Initialize a newly created namespace directive.
9002 * 9006 *
9003 * @param comment the documentation comment associated with this directive 9007 * @param comment the documentation comment associated with this directive
9004 * @param metadata the annotations associated with the directive 9008 * @param metadata the annotations associated with the directive
9005 * @param keyword the token representing the 'import' or 'export' keyword 9009 * @param keyword the token representing the 'import' or 'export' keyword
9006 * @param libraryUri the URI of the library being imported or exported 9010 * @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 9011 * @param combinators the combinators used to control which names are imported or exported
9008 * @param semicolon the semicolon terminating the directive 9012 * @param semicolon the semicolon terminating the directive
9009 */ 9013 */
9010 NamespaceDirective.full(Comment comment, List<Annotation> metadata, Token keyw ord, StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) : super.full(comment, metadata, libraryUri) { 9014 NamespaceDirective.full(Comment comment, List<Annotation> metadata, this.keywo rd, StringLiteral libraryUri, List<Combinator> combinators, this.semicolon) : su per.full(comment, metadata, libraryUri) {
9011 this.combinators = new NodeList<Combinator>(this); 9015 this._combinators = new NodeList<Combinator>(this);
9012 this._keyword = keyword; 9016 this._combinators.addAll(combinators);
9013 this.combinators.addAll(combinators);
9014 this.semicolon = semicolon;
9015 } 9017 }
9016 9018
9017 /** 9019 /**
9018 * Initialize a newly created namespace directive. 9020 * Initialize a newly created namespace directive.
9019 * 9021 *
9020 * @param comment the documentation comment associated with this directive 9022 * @param comment the documentation comment associated with this directive
9021 * @param metadata the annotations associated with the directive 9023 * @param metadata the annotations associated with the directive
9022 * @param keyword the token representing the 'import' or 'export' keyword 9024 * @param keyword the token representing the 'import' or 'export' keyword
9023 * @param libraryUri the URI of the library being imported or exported 9025 * @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 9026 * @param combinators the combinators used to control which names are imported or exported
9025 * @param semicolon the semicolon terminating the directive 9027 * @param semicolon the semicolon terminating the directive
9026 */ 9028 */
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); 9029 NamespaceDirective({Comment comment, List<Annotation> metadata, Token keyword, StringLiteral libraryUri, List<Combinator> combinators, Token semicolon}) : thi s.full(comment, metadata, keyword, libraryUri, combinators, semicolon);
9028 9030
9031 /**
9032 * Return the combinators used to control how names are imported or exported.
9033 *
9034 * @return the combinators used to control how names are imported or exported
9035 */
9036 NodeList<Combinator> get combinators => _combinators;
9037
9029 Token get endToken => semicolon; 9038 Token get endToken => semicolon;
9030 9039
9031 Token get keyword => _keyword;
9032
9033 LibraryElement get uriElement; 9040 LibraryElement get uriElement;
9034 9041
9035 /** 9042 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 } 9043 }
9046 9044
9047 /** 9045 /**
9048 * Instances of the class `NativeClause` represent the "native" clause in an cla ss 9046 * Instances of the class `NativeClause` represent the "native" clause in an cla ss
9049 * declaration. 9047 * declaration.
9050 * 9048 *
9051 * <pre> 9049 * <pre>
9052 * nativeClause ::= 9050 * nativeClause ::=
9053 * 'native' [StringLiteral] 9051 * 'native' [StringLiteral]
9054 * </pre> 9052 * </pre>
(...skipping 10 matching lines...) Expand all
9065 * The name of the native object that implements the class. 9063 * The name of the native object that implements the class.
9066 */ 9064 */
9067 StringLiteral name; 9065 StringLiteral name;
9068 9066
9069 /** 9067 /**
9070 * Initialize a newly created native clause. 9068 * Initialize a newly created native clause.
9071 * 9069 *
9072 * @param keyword the token representing the 'native' keyword 9070 * @param keyword the token representing the 'native' keyword
9073 * @param name the name of the native object that implements the class. 9071 * @param name the name of the native object that implements the class.
9074 */ 9072 */
9075 NativeClause.full(Token keyword, StringLiteral name) { 9073 NativeClause.full(this.keyword, this.name);
9076 this.keyword = keyword;
9077 this.name = name;
9078 }
9079 9074
9080 /** 9075 /**
9081 * Initialize a newly created native clause. 9076 * Initialize a newly created native clause.
9082 * 9077 *
9083 * @param keyword the token representing the 'native' keyword 9078 * @param keyword the token representing the 'native' keyword
9084 * @param name the name of the native object that implements the class. 9079 * @param name the name of the native object that implements the class.
9085 */ 9080 */
9086 NativeClause({Token keyword, StringLiteral name}) : this.full(keyword, name); 9081 NativeClause({Token keyword, StringLiteral name}) : this.full(keyword, name);
9087 9082
9088 accept(ASTVisitor visitor) => visitor.visitNativeClause(this); 9083 accept(ASTVisitor visitor) => visitor.visitNativeClause(this);
(...skipping 15 matching lines...) Expand all
9104 * nativeFunctionBody ::= 9099 * nativeFunctionBody ::=
9105 * 'native' [SimpleStringLiteral] ';' 9100 * 'native' [SimpleStringLiteral] ';'
9106 * </pre> 9101 * </pre>
9107 * 9102 *
9108 * @coverage dart.engine.ast 9103 * @coverage dart.engine.ast
9109 */ 9104 */
9110 class NativeFunctionBody extends FunctionBody { 9105 class NativeFunctionBody extends FunctionBody {
9111 /** 9106 /**
9112 * The token representing 'native' that marks the start of the function body. 9107 * The token representing 'native' that marks the start of the function body.
9113 */ 9108 */
9114 Token nativeToken; 9109 final Token nativeToken;
9115 9110
9116 /** 9111 /**
9117 * The string literal, after the 'native' token. 9112 * The string literal, after the 'native' token.
9118 */ 9113 */
9119 StringLiteral stringLiteral; 9114 StringLiteral _stringLiteral;
9120 9115
9121 /** 9116 /**
9122 * The token representing the semicolon that marks the end of the function bod y. 9117 * The token representing the semicolon that marks the end of the function bod y.
9123 */ 9118 */
9124 Token semicolon; 9119 final Token semicolon;
9125 9120
9126 /** 9121 /**
9127 * Initialize a newly created function body consisting of the 'native' token, a string literal, 9122 * Initialize a newly created function body consisting of the 'native' token, a string literal,
9128 * and a semicolon. 9123 * and a semicolon.
9129 * 9124 *
9130 * @param nativeToken the token representing 'native' that marks the start of the function body 9125 * @param nativeToken the token representing 'native' that marks the start of the function body
9131 * @param stringLiteral the string literal 9126 * @param stringLiteral the string literal
9132 * @param semicolon the token representing the semicolon that marks the end of the function body 9127 * @param semicolon the token representing the semicolon that marks the end of the function body
9133 */ 9128 */
9134 NativeFunctionBody.full(Token nativeToken, StringLiteral stringLiteral, Token semicolon) { 9129 NativeFunctionBody.full(this.nativeToken, StringLiteral stringLiteral, this.se micolon) {
9135 this.nativeToken = nativeToken; 9130 this._stringLiteral = becomeParentOf(stringLiteral);
9136 this.stringLiteral = becomeParentOf(stringLiteral);
9137 this.semicolon = semicolon;
9138 } 9131 }
9139 9132
9140 /** 9133 /**
9141 * Initialize a newly created function body consisting of the 'native' token, a string literal, 9134 * Initialize a newly created function body consisting of the 'native' token, a string literal,
9142 * and a semicolon. 9135 * and a semicolon.
9143 * 9136 *
9144 * @param nativeToken the token representing 'native' that marks the start of the function body 9137 * @param nativeToken the token representing 'native' that marks the start of the function body
9145 * @param stringLiteral the string literal 9138 * @param stringLiteral the string literal
9146 * @param semicolon the token representing the semicolon that marks the end of the function body 9139 * @param semicolon the token representing the semicolon that marks the end of the function body
9147 */ 9140 */
9148 NativeFunctionBody({Token nativeToken, StringLiteral stringLiteral, Token semi colon}) : this.full(nativeToken, stringLiteral, semicolon); 9141 NativeFunctionBody({Token nativeToken, StringLiteral stringLiteral, Token semi colon}) : this.full(nativeToken, stringLiteral, semicolon);
9149 9142
9150 accept(ASTVisitor visitor) => visitor.visitNativeFunctionBody(this); 9143 accept(ASTVisitor visitor) => visitor.visitNativeFunctionBody(this);
9151 9144
9152 Token get beginToken => nativeToken; 9145 Token get beginToken => nativeToken;
9153 9146
9154 Token get endToken => semicolon; 9147 Token get endToken => semicolon;
9155 9148
9149 /**
9150 * Return the string literal representing the string after the 'native' token.
9151 *
9152 * @return the string literal representing the string after the 'native' token
9153 */
9154 StringLiteral get stringLiteral => _stringLiteral;
9155
9156 void visitChildren(ASTVisitor visitor) { 9156 void visitChildren(ASTVisitor visitor) {
9157 safelyVisitChild(stringLiteral, visitor); 9157 safelyVisitChild(_stringLiteral, visitor);
9158 } 9158 }
9159 } 9159 }
9160 9160
9161 /** 9161 /**
9162 * The abstract class `NormalFormalParameter` defines the behavior common to for mal parameters 9162 * The abstract class `NormalFormalParameter` defines the behavior common to for mal parameters
9163 * that are required (are not optional). 9163 * that are required (are not optional).
9164 * 9164 *
9165 * <pre> 9165 * <pre>
9166 * normalFormalParameter ::= 9166 * normalFormalParameter ::=
9167 * [FunctionTypedFormalParameter] 9167 * [FunctionTypedFormalParameter]
9168 * | [FieldFormalParameter] 9168 * | [FieldFormalParameter]
9169 * | [SimpleFormalParameter] 9169 * | [SimpleFormalParameter]
9170 * </pre> 9170 * </pre>
9171 * 9171 *
9172 * @coverage dart.engine.ast 9172 * @coverage dart.engine.ast
9173 */ 9173 */
9174 abstract class NormalFormalParameter extends FormalParameter { 9174 abstract class NormalFormalParameter extends FormalParameter {
9175 /** 9175 /**
9176 * The documentation comment associated with this parameter, or `null` if this parameter 9176 * The documentation comment associated with this parameter, or `null` if this parameter
9177 * does not have a documentation comment associated with it. 9177 * does not have a documentation comment associated with it.
9178 */ 9178 */
9179 Comment _comment; 9179 Comment _comment;
9180 9180
9181 /** 9181 /**
9182 * The annotations associated with this parameter. 9182 * The annotations associated with this parameter.
9183 */ 9183 */
9184 NodeList<Annotation> metadata; 9184 NodeList<Annotation> _metadata;
9185 9185
9186 /** 9186 /**
9187 * The name of the parameter being declared. 9187 * The name of the parameter being declared.
9188 */ 9188 */
9189 SimpleIdentifier _identifier; 9189 SimpleIdentifier _identifier;
9190 9190
9191 /** 9191 /**
9192 * Initialize a newly created formal parameter. 9192 * Initialize a newly created formal parameter.
9193 * 9193 *
9194 * @param comment the documentation comment associated with this parameter 9194 * @param comment the documentation comment associated with this parameter
9195 * @param metadata the annotations associated with this parameter 9195 * @param metadata the annotations associated with this parameter
9196 * @param identifier the name of the parameter being declared 9196 * @param identifier the name of the parameter being declared
9197 */ 9197 */
9198 NormalFormalParameter.full(Comment comment, List<Annotation> metadata, SimpleI dentifier identifier) { 9198 NormalFormalParameter.full(Comment comment, List<Annotation> metadata, SimpleI dentifier identifier) {
9199 this.metadata = new NodeList<Annotation>(this); 9199 this._metadata = new NodeList<Annotation>(this);
9200 this._comment = becomeParentOf(comment); 9200 this._comment = becomeParentOf(comment);
9201 this.metadata.addAll(metadata); 9201 this._metadata.addAll(metadata);
9202 this._identifier = becomeParentOf(identifier); 9202 this._identifier = becomeParentOf(identifier);
9203 } 9203 }
9204 9204
9205 /** 9205 /**
9206 * Initialize a newly created formal parameter. 9206 * Initialize a newly created formal parameter.
9207 * 9207 *
9208 * @param comment the documentation comment associated with this parameter 9208 * @param comment the documentation comment associated with this parameter
9209 * @param metadata the annotations associated with this parameter 9209 * @param metadata the annotations associated with this parameter
9210 * @param identifier the name of the parameter being declared 9210 * @param identifier the name of the parameter being declared
9211 */ 9211 */
(...skipping 11 matching lines...) Expand all
9223 9223
9224 ParameterKind get kind { 9224 ParameterKind get kind {
9225 ASTNode parent = this.parent; 9225 ASTNode parent = this.parent;
9226 if (parent is DefaultFormalParameter) { 9226 if (parent is DefaultFormalParameter) {
9227 return (parent as DefaultFormalParameter).kind; 9227 return (parent as DefaultFormalParameter).kind;
9228 } 9228 }
9229 return ParameterKind.REQUIRED; 9229 return ParameterKind.REQUIRED;
9230 } 9230 }
9231 9231
9232 /** 9232 /**
9233 * Return the annotations associated with this parameter.
9234 *
9235 * @return the annotations associated with this parameter
9236 */
9237 NodeList<Annotation> get metadata => _metadata;
9238
9239 /**
9233 * Set the documentation comment associated with this parameter to the given c omment 9240 * Set the documentation comment associated with this parameter to the given c omment
9234 * 9241 *
9235 * @param comment the documentation comment to be associated with this paramet er 9242 * @param comment the documentation comment to be associated with this paramet er
9236 */ 9243 */
9237 void set documentationComment(Comment comment) { 9244 void set documentationComment(Comment comment) {
9238 this._comment = becomeParentOf(comment); 9245 this._comment = becomeParentOf(comment);
9239 } 9246 }
9240 9247
9241 /** 9248 /**
9242 * Set the name of the parameter being declared to the given identifier. 9249 * Set the name of the parameter being declared to the given identifier.
9243 * 9250 *
9244 * @param identifier the name of the parameter being declared 9251 * @param identifier the name of the parameter being declared
9245 */ 9252 */
9246 void set identifier(SimpleIdentifier identifier) { 9253 void set identifier(SimpleIdentifier identifier) {
9247 this._identifier = becomeParentOf(identifier); 9254 this._identifier = becomeParentOf(identifier);
9248 } 9255 }
9249 9256
9250 void visitChildren(ASTVisitor visitor) { 9257 void visitChildren(ASTVisitor visitor) {
9251 if (commentIsBeforeAnnotations()) { 9258 if (commentIsBeforeAnnotations()) {
9252 safelyVisitChild(_comment, visitor); 9259 safelyVisitChild(_comment, visitor);
9253 metadata.accept(visitor); 9260 _metadata.accept(visitor);
9254 } else { 9261 } else {
9255 for (ASTNode child in sortedCommentAndAnnotations) { 9262 for (ASTNode child in sortedCommentAndAnnotations) {
9256 child.accept(visitor); 9263 child.accept(visitor);
9257 } 9264 }
9258 } 9265 }
9259 } 9266 }
9260 9267
9261 /** 9268 /**
9262 * Return `true` if the comment is lexically before any annotations. 9269 * Return `true` if the comment is lexically before any annotations.
9263 * 9270 *
9264 * @return `true` if the comment is lexically before any annotations 9271 * @return `true` if the comment is lexically before any annotations
9265 */ 9272 */
9266 bool commentIsBeforeAnnotations() { 9273 bool commentIsBeforeAnnotations() {
9267 if (_comment == null || metadata.isEmpty) { 9274 if (_comment == null || _metadata.isEmpty) {
9268 return true; 9275 return true;
9269 } 9276 }
9270 Annotation firstAnnotation = metadata[0]; 9277 Annotation firstAnnotation = _metadata[0];
9271 return _comment.offset < firstAnnotation.offset; 9278 return _comment.offset < firstAnnotation.offset;
9272 } 9279 }
9273 9280
9274 /** 9281 /**
9275 * Return an array containing the comment and annotations associated with this parameter, sorted 9282 * Return an array containing the comment and annotations associated with this parameter, sorted
9276 * in lexical order. 9283 * in lexical order.
9277 * 9284 *
9278 * @return the comment and annotations associated with this parameter in the o rder in which they 9285 * @return the comment and annotations associated with this parameter in the o rder in which they
9279 * appeared in the original source 9286 * appeared in the original source
9280 */ 9287 */
9281 List<ASTNode> get sortedCommentAndAnnotations { 9288 List<ASTNode> get sortedCommentAndAnnotations {
9282 List<ASTNode> childList = new List<ASTNode>(); 9289 List<ASTNode> childList = new List<ASTNode>();
9283 childList.add(_comment); 9290 childList.add(_comment);
9284 childList.addAll(metadata); 9291 childList.addAll(_metadata);
9285 List<ASTNode> children = new List.from(childList); 9292 List<ASTNode> children = new List.from(childList);
9286 children.sort(ASTNode.LEXICAL_ORDER); 9293 children.sort(ASTNode.LEXICAL_ORDER);
9287 return children; 9294 return children;
9288 } 9295 }
9289 } 9296 }
9290 9297
9291 /** 9298 /**
9292 * Instances of the class `NullLiteral` represent a null literal expression. 9299 * Instances of the class `NullLiteral` represent a null literal expression.
9293 * 9300 *
9294 * <pre> 9301 * <pre>
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
9462 9469
9463 /** 9470 /**
9464 * Initialize a newly created part directive. 9471 * Initialize a newly created part directive.
9465 * 9472 *
9466 * @param comment the documentation comment associated with this directive 9473 * @param comment the documentation comment associated with this directive
9467 * @param metadata the annotations associated with the directive 9474 * @param metadata the annotations associated with the directive
9468 * @param partToken the token representing the 'part' token 9475 * @param partToken the token representing the 'part' token
9469 * @param partUri the URI of the part being included 9476 * @param partUri the URI of the part being included
9470 * @param semicolon the semicolon terminating the directive 9477 * @param semicolon the semicolon terminating the directive
9471 */ 9478 */
9472 PartDirective.full(Comment comment, List<Annotation> metadata, Token partToken , StringLiteral partUri, Token semicolon) : super.full(comment, metadata, partUr i) { 9479 PartDirective.full(Comment comment, List<Annotation> metadata, this.partToken, StringLiteral partUri, this.semicolon) : super.full(comment, metadata, partUri) ;
9473 this.partToken = partToken;
9474 this.semicolon = semicolon;
9475 }
9476 9480
9477 /** 9481 /**
9478 * Initialize a newly created part directive. 9482 * Initialize a newly created part directive.
9479 * 9483 *
9480 * @param comment the documentation comment associated with this directive 9484 * @param comment the documentation comment associated with this directive
9481 * @param metadata the annotations associated with the directive 9485 * @param metadata the annotations associated with the directive
9482 * @param partToken the token representing the 'part' token 9486 * @param partToken the token representing the 'part' token
9483 * @param partUri the URI of the part being included 9487 * @param partUri the URI of the part being included
9484 * @param semicolon the semicolon terminating the directive 9488 * @param semicolon the semicolon terminating the directive
9485 */ 9489 */
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
9530 /** 9534 /**
9531 * Initialize a newly created part-of directive. 9535 * Initialize a newly created part-of directive.
9532 * 9536 *
9533 * @param comment the documentation comment associated with this directive 9537 * @param comment the documentation comment associated with this directive
9534 * @param metadata the annotations associated with the directive 9538 * @param metadata the annotations associated with the directive
9535 * @param partToken the token representing the 'part' token 9539 * @param partToken the token representing the 'part' token
9536 * @param ofToken the token representing the 'of' token 9540 * @param ofToken the token representing the 'of' token
9537 * @param libraryName the name of the library that the containing compilation unit is part of 9541 * @param libraryName the name of the library that the containing compilation unit is part of
9538 * @param semicolon the semicolon terminating the directive 9542 * @param semicolon the semicolon terminating the directive
9539 */ 9543 */
9540 PartOfDirective.full(Comment comment, List<Annotation> metadata, Token partTok en, Token ofToken, LibraryIdentifier libraryName, Token semicolon) : super.full( comment, metadata) { 9544 PartOfDirective.full(Comment comment, List<Annotation> metadata, this.partToke n, this.ofToken, LibraryIdentifier libraryName, this.semicolon) : super.full(com ment, metadata) {
9541 this.partToken = partToken;
9542 this.ofToken = ofToken;
9543 this._libraryName = becomeParentOf(libraryName); 9545 this._libraryName = becomeParentOf(libraryName);
9544 this.semicolon = semicolon;
9545 } 9546 }
9546 9547
9547 /** 9548 /**
9548 * Initialize a newly created part-of directive. 9549 * Initialize a newly created part-of directive.
9549 * 9550 *
9550 * @param comment the documentation comment associated with this directive 9551 * @param comment the documentation comment associated with this directive
9551 * @param metadata the annotations associated with the directive 9552 * @param metadata the annotations associated with the directive
9552 * @param partToken the token representing the 'part' token 9553 * @param partToken the token representing the 'part' token
9553 * @param ofToken the token representing the 'of' token 9554 * @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 libraryName the name of the library that the containing compilation unit is part of
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
9620 * or if the operator could not be resolved. 9621 * or if the operator could not be resolved.
9621 */ 9622 */
9622 MethodElement _staticElement; 9623 MethodElement _staticElement;
9623 9624
9624 /** 9625 /**
9625 * Initialize a newly created postfix expression. 9626 * Initialize a newly created postfix expression.
9626 * 9627 *
9627 * @param operand the expression computing the operand for the operator 9628 * @param operand the expression computing the operand for the operator
9628 * @param operator the postfix operator being applied to the operand 9629 * @param operator the postfix operator being applied to the operand
9629 */ 9630 */
9630 PostfixExpression.full(Expression operand, Token operator) { 9631 PostfixExpression.full(Expression operand, this.operator) {
9631 this._operand = becomeParentOf(operand); 9632 this._operand = becomeParentOf(operand);
9632 this.operator = operator;
9633 } 9633 }
9634 9634
9635 /** 9635 /**
9636 * Initialize a newly created postfix expression. 9636 * Initialize a newly created postfix expression.
9637 * 9637 *
9638 * @param operand the expression computing the operand for the operator 9638 * @param operand the expression computing the operand for the operator
9639 * @param operator the postfix operator being applied to the operand 9639 * @param operator the postfix operator being applied to the operand
9640 */ 9640 */
9641 PostfixExpression({Expression operand, Token operator}) : this.full(operand, o perator); 9641 PostfixExpression({Expression operand, Token operator}) : this.full(operand, o perator);
9642 9642
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
9801 * or if the operator could not be resolved. 9801 * or if the operator could not be resolved.
9802 */ 9802 */
9803 MethodElement _propagatedElement; 9803 MethodElement _propagatedElement;
9804 9804
9805 /** 9805 /**
9806 * Initialize a newly created prefix expression. 9806 * Initialize a newly created prefix expression.
9807 * 9807 *
9808 * @param operator the prefix operator being applied to the operand 9808 * @param operator the prefix operator being applied to the operand
9809 * @param operand the expression computing the operand for the operator 9809 * @param operand the expression computing the operand for the operator
9810 */ 9810 */
9811 PrefixExpression.full(Token operator, Expression operand) { 9811 PrefixExpression.full(this.operator, Expression operand) {
9812 this.operator = operator;
9813 this._operand = becomeParentOf(operand); 9812 this._operand = becomeParentOf(operand);
9814 } 9813 }
9815 9814
9816 /** 9815 /**
9817 * Initialize a newly created prefix expression. 9816 * Initialize a newly created prefix expression.
9818 * 9817 *
9819 * @param operator the prefix operator being applied to the operand 9818 * @param operator the prefix operator being applied to the operand
9820 * @param operand the expression computing the operand for the operator 9819 * @param operand the expression computing the operand for the operator
9821 */ 9820 */
9822 PrefixExpression({Token operator, Expression operand}) : this.full(operator, o perand); 9821 PrefixExpression({Token operator, Expression operand}) : this.full(operator, o perand);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
9976 */ 9975 */
9977 SimpleIdentifier _identifier; 9976 SimpleIdentifier _identifier;
9978 9977
9979 /** 9978 /**
9980 * Initialize a newly created prefixed identifier. 9979 * Initialize a newly created prefixed identifier.
9981 * 9980 *
9982 * @param prefix the identifier being prefixed 9981 * @param prefix the identifier being prefixed
9983 * @param period the period used to separate the prefix from the identifier 9982 * @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 9983 * @param identifier the prefix associated with the library in which the ident ifier is defined
9985 */ 9984 */
9986 PrefixedIdentifier.full(SimpleIdentifier prefix, Token period, SimpleIdentifie r identifier) { 9985 PrefixedIdentifier.full(SimpleIdentifier prefix, this.period, SimpleIdentifier identifier) {
9987 this._prefix = becomeParentOf(prefix); 9986 this._prefix = becomeParentOf(prefix);
9988 this.period = period;
9989 this._identifier = becomeParentOf(identifier); 9987 this._identifier = becomeParentOf(identifier);
9990 } 9988 }
9991 9989
9992 /** 9990 /**
9993 * Initialize a newly created prefixed identifier. 9991 * Initialize a newly created prefixed identifier.
9994 * 9992 *
9995 * @param prefix the identifier being prefixed 9993 * @param prefix the identifier being prefixed
9996 * @param period the period used to separate the prefix from the identifier 9994 * @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 9995 * @param identifier the prefix associated with the library in which the ident ifier is defined
9998 */ 9996 */
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
10098 */ 10096 */
10099 SimpleIdentifier _propertyName; 10097 SimpleIdentifier _propertyName;
10100 10098
10101 /** 10099 /**
10102 * Initialize a newly created property access expression. 10100 * Initialize a newly created property access expression.
10103 * 10101 *
10104 * @param target the expression computing the object defining the property bei ng accessed 10102 * @param target the expression computing the object defining the property bei ng accessed
10105 * @param operator the property access operator 10103 * @param operator the property access operator
10106 * @param propertyName the name of the property being accessed 10104 * @param propertyName the name of the property being accessed
10107 */ 10105 */
10108 PropertyAccess.full(Expression target, Token operator, SimpleIdentifier proper tyName) { 10106 PropertyAccess.full(Expression target, this.operator, SimpleIdentifier propert yName) {
10109 this._target = becomeParentOf(target); 10107 this._target = becomeParentOf(target);
10110 this.operator = operator;
10111 this._propertyName = becomeParentOf(propertyName); 10108 this._propertyName = becomeParentOf(propertyName);
10112 } 10109 }
10113 10110
10114 /** 10111 /**
10115 * Initialize a newly created property access expression. 10112 * Initialize a newly created property access expression.
10116 * 10113 *
10117 * @param target the expression computing the object defining the property bei ng accessed 10114 * @param target the expression computing the object defining the property bei ng accessed
10118 * @param operator the property access operator 10115 * @param operator the property access operator
10119 * @param propertyName the name of the property being accessed 10116 * @param propertyName the name of the property being accessed
10120 */ 10117 */
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
10250 10247
10251 /** 10248 /**
10252 * Initialize a newly created redirecting invocation to invoke the constructor with the given name 10249 * Initialize a newly created redirecting invocation to invoke the constructor with the given name
10253 * with the given arguments. 10250 * with the given arguments.
10254 * 10251 *
10255 * @param keyword the token for the 'this' keyword 10252 * @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 10253 * @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 10254 * @param constructorName the name of the constructor that is being invoked
10258 * @param argumentList the list of arguments to the constructor 10255 * @param argumentList the list of arguments to the constructor
10259 */ 10256 */
10260 RedirectingConstructorInvocation.full(Token keyword, Token period, SimpleIdent ifier constructorName, ArgumentList argumentList) { 10257 RedirectingConstructorInvocation.full(this.keyword, this.period, SimpleIdentif ier constructorName, ArgumentList argumentList) {
10261 this.keyword = keyword;
10262 this.period = period;
10263 this._constructorName = becomeParentOf(constructorName); 10258 this._constructorName = becomeParentOf(constructorName);
10264 this._argumentList = becomeParentOf(argumentList); 10259 this._argumentList = becomeParentOf(argumentList);
10265 } 10260 }
10266 10261
10267 /** 10262 /**
10268 * Initialize a newly created redirecting invocation to invoke the constructor with the given name 10263 * Initialize a newly created redirecting invocation to invoke the constructor with the given name
10269 * with the given arguments. 10264 * with the given arguments.
10270 * 10265 *
10271 * @param keyword the token for the 'this' keyword 10266 * @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 10267 * @param period the token for the period before the name of the constructor t hat is being invoked
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
10334 /** 10329 /**
10335 * The token representing the 'rethrow' keyword. 10330 * The token representing the 'rethrow' keyword.
10336 */ 10331 */
10337 Token keyword; 10332 Token keyword;
10338 10333
10339 /** 10334 /**
10340 * Initialize a newly created rethrow expression. 10335 * Initialize a newly created rethrow expression.
10341 * 10336 *
10342 * @param keyword the token representing the 'rethrow' keyword 10337 * @param keyword the token representing the 'rethrow' keyword
10343 */ 10338 */
10344 RethrowExpression.full(Token keyword) { 10339 RethrowExpression.full(this.keyword);
10345 this.keyword = keyword;
10346 }
10347 10340
10348 /** 10341 /**
10349 * Initialize a newly created rethrow expression. 10342 * Initialize a newly created rethrow expression.
10350 * 10343 *
10351 * @param keyword the token representing the 'rethrow' keyword 10344 * @param keyword the token representing the 'rethrow' keyword
10352 */ 10345 */
10353 RethrowExpression({Token keyword}) : this.full(keyword); 10346 RethrowExpression({Token keyword}) : this.full(keyword);
10354 10347
10355 accept(ASTVisitor visitor) => visitor.visitRethrowExpression(this); 10348 accept(ASTVisitor visitor) => visitor.visitRethrowExpression(this);
10356 10349
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
10391 */ 10384 */
10392 Token semicolon; 10385 Token semicolon;
10393 10386
10394 /** 10387 /**
10395 * Initialize a newly created return statement. 10388 * Initialize a newly created return statement.
10396 * 10389 *
10397 * @param keyword the token representing the 'return' keyword 10390 * @param keyword the token representing the 'return' keyword
10398 * @param expression the expression computing the value to be returned 10391 * @param expression the expression computing the value to be returned
10399 * @param semicolon the semicolon terminating the statement 10392 * @param semicolon the semicolon terminating the statement
10400 */ 10393 */
10401 ReturnStatement.full(Token keyword, Expression expression, Token semicolon) { 10394 ReturnStatement.full(this.keyword, Expression expression, this.semicolon) {
10402 this.keyword = keyword;
10403 this._expression = becomeParentOf(expression); 10395 this._expression = becomeParentOf(expression);
10404 this.semicolon = semicolon;
10405 } 10396 }
10406 10397
10407 /** 10398 /**
10408 * Initialize a newly created return statement. 10399 * Initialize a newly created return statement.
10409 * 10400 *
10410 * @param keyword the token representing the 'return' keyword 10401 * @param keyword the token representing the 'return' keyword
10411 * @param expression the expression computing the value to be returned 10402 * @param expression the expression computing the value to be returned
10412 * @param semicolon the semicolon terminating the statement 10403 * @param semicolon the semicolon terminating the statement
10413 */ 10404 */
10414 ReturnStatement({Token keyword, Expression expression, Token semicolon}) : thi s.full(keyword, expression, semicolon); 10405 ReturnStatement({Token keyword, Expression expression, Token semicolon}) : thi s.full(keyword, expression, semicolon);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
10456 /** 10447 /**
10457 * The token representing this script tag. 10448 * The token representing this script tag.
10458 */ 10449 */
10459 Token scriptTag; 10450 Token scriptTag;
10460 10451
10461 /** 10452 /**
10462 * Initialize a newly created script tag. 10453 * Initialize a newly created script tag.
10463 * 10454 *
10464 * @param scriptTag the token representing this script tag 10455 * @param scriptTag the token representing this script tag
10465 */ 10456 */
10466 ScriptTag.full(Token scriptTag) { 10457 ScriptTag.full(this.scriptTag);
10467 this.scriptTag = scriptTag;
10468 }
10469 10458
10470 /** 10459 /**
10471 * Initialize a newly created script tag. 10460 * Initialize a newly created script tag.
10472 * 10461 *
10473 * @param scriptTag the token representing this script tag 10462 * @param scriptTag the token representing this script tag
10474 */ 10463 */
10475 ScriptTag({Token scriptTag}) : this.full(scriptTag); 10464 ScriptTag({Token scriptTag}) : this.full(scriptTag);
10476 10465
10477 accept(ASTVisitor visitor) => visitor.visitScriptTag(this); 10466 accept(ASTVisitor visitor) => visitor.visitScriptTag(this);
10478 10467
(...skipping 13 matching lines...) Expand all
10492 * showCombinator ::= 10481 * showCombinator ::=
10493 * 'show' [SimpleIdentifier] (',' [SimpleIdentifier])* 10482 * 'show' [SimpleIdentifier] (',' [SimpleIdentifier])*
10494 * </pre> 10483 * </pre>
10495 * 10484 *
10496 * @coverage dart.engine.ast 10485 * @coverage dart.engine.ast
10497 */ 10486 */
10498 class ShowCombinator extends Combinator { 10487 class ShowCombinator extends Combinator {
10499 /** 10488 /**
10500 * The list of names from the library that are made visible by this combinator . 10489 * The list of names from the library that are made visible by this combinator .
10501 */ 10490 */
10502 NodeList<SimpleIdentifier> shownNames; 10491 NodeList<SimpleIdentifier> _shownNames;
10503 10492
10504 /** 10493 /**
10505 * Initialize a newly created import show combinator. 10494 * Initialize a newly created import show combinator.
10506 * 10495 *
10507 * @param keyword the comma introducing the combinator 10496 * @param keyword the comma introducing the combinator
10508 * @param shownNames the list of names from the library that are made visible by this combinator 10497 * @param shownNames the list of names from the library that are made visible by this combinator
10509 */ 10498 */
10510 ShowCombinator.full(Token keyword, List<SimpleIdentifier> shownNames) : super. full(keyword) { 10499 ShowCombinator.full(Token keyword, List<SimpleIdentifier> shownNames) : super. full(keyword) {
10511 this.shownNames = new NodeList<SimpleIdentifier>(this); 10500 this._shownNames = new NodeList<SimpleIdentifier>(this);
10512 this.shownNames.addAll(shownNames); 10501 this._shownNames.addAll(shownNames);
10513 } 10502 }
10514 10503
10515 /** 10504 /**
10516 * Initialize a newly created import show combinator. 10505 * Initialize a newly created import show combinator.
10517 * 10506 *
10518 * @param keyword the comma introducing the combinator 10507 * @param keyword the comma introducing the combinator
10519 * @param shownNames the list of names from the library that are made visible by this combinator 10508 * @param shownNames the list of names from the library that are made visible by this combinator
10520 */ 10509 */
10521 ShowCombinator({Token keyword, List<SimpleIdentifier> shownNames}) : this.full (keyword, shownNames); 10510 ShowCombinator({Token keyword, List<SimpleIdentifier> shownNames}) : this.full (keyword, shownNames);
10522 10511
10523 accept(ASTVisitor visitor) => visitor.visitShowCombinator(this); 10512 accept(ASTVisitor visitor) => visitor.visitShowCombinator(this);
10524 10513
10525 Token get endToken => shownNames.endToken; 10514 Token get endToken => _shownNames.endToken;
10515
10516 /**
10517 * Return the list of names from the library that are made visible by this com binator.
10518 *
10519 * @return the list of names from the library that are made visible by this co mbinator
10520 */
10521 NodeList<SimpleIdentifier> get shownNames => _shownNames;
10526 10522
10527 void visitChildren(ASTVisitor visitor) { 10523 void visitChildren(ASTVisitor visitor) {
10528 shownNames.accept(visitor); 10524 _shownNames.accept(visitor);
10529 } 10525 }
10530 } 10526 }
10531 10527
10532 /** 10528 /**
10533 * Instances of the class `SimpleFormalParameter` represent a simple formal para meter. 10529 * Instances of the class `SimpleFormalParameter` represent a simple formal para meter.
10534 * 10530 *
10535 * <pre> 10531 * <pre>
10536 * simpleFormalParameter ::= 10532 * simpleFormalParameter ::=
10537 * ('final' [TypeName] | 'var' | [TypeName])? [SimpleIdentifier] 10533 * ('final' [TypeName] | 'var' | [TypeName])? [SimpleIdentifier]
10538 * </pre> 10534 * </pre>
(...skipping 15 matching lines...) Expand all
10554 10550
10555 /** 10551 /**
10556 * Initialize a newly created formal parameter. 10552 * Initialize a newly created formal parameter.
10557 * 10553 *
10558 * @param comment the documentation comment associated with this parameter 10554 * @param comment the documentation comment associated with this parameter
10559 * @param metadata the annotations associated with this parameter 10555 * @param metadata the annotations associated with this parameter
10560 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 10556 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
10561 * @param type the name of the declared type of the parameter 10557 * @param type the name of the declared type of the parameter
10562 * @param identifier the name of the parameter being declared 10558 * @param identifier the name of the parameter being declared
10563 */ 10559 */
10564 SimpleFormalParameter.full(Comment comment, List<Annotation> metadata, Token k eyword, TypeName type, SimpleIdentifier identifier) : super.full(comment, metada ta, identifier) { 10560 SimpleFormalParameter.full(Comment comment, List<Annotation> metadata, this.ke yword, TypeName type, SimpleIdentifier identifier) : super.full(comment, metadat a, identifier) {
10565 this.keyword = keyword;
10566 this._type = becomeParentOf(type); 10561 this._type = becomeParentOf(type);
10567 } 10562 }
10568 10563
10569 /** 10564 /**
10570 * Initialize a newly created formal parameter. 10565 * Initialize a newly created formal parameter.
10571 * 10566 *
10572 * @param comment the documentation comment associated with this parameter 10567 * @param comment the documentation comment associated with this parameter
10573 * @param metadata the annotations associated with this parameter 10568 * @param metadata the annotations associated with this parameter
10574 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 10569 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
10575 * @param type the name of the declared type of the parameter 10570 * @param type the name of the declared type of the parameter
(...skipping 80 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 10651 * be set to hold onto the static and propagated information. The auxiliary el ement will hold onto
10657 * the elements from the getter context. 10652 * the elements from the getter context.
10658 */ 10653 */
10659 AuxiliaryElements auxiliaryElements = null; 10654 AuxiliaryElements auxiliaryElements = null;
10660 10655
10661 /** 10656 /**
10662 * Initialize a newly created identifier. 10657 * Initialize a newly created identifier.
10663 * 10658 *
10664 * @param token the token representing the identifier 10659 * @param token the token representing the identifier
10665 */ 10660 */
10666 SimpleIdentifier.full(Token token) { 10661 SimpleIdentifier.full(this.token);
10667 this.token = token;
10668 }
10669 10662
10670 /** 10663 /**
10671 * Initialize a newly created identifier. 10664 * Initialize a newly created identifier.
10672 * 10665 *
10673 * @param token the token representing the identifier 10666 * @param token the token representing the identifier
10674 */ 10667 */
10675 SimpleIdentifier({Token token}) : this.full(token); 10668 SimpleIdentifier({Token token}) : this.full(token);
10676 10669
10677 accept(ASTVisitor visitor) => visitor.visitSimpleIdentifier(this); 10670 accept(ASTVisitor visitor) => visitor.visitSimpleIdentifier(this);
10678 10671
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
10919 * The value of the literal. 10912 * The value of the literal.
10920 */ 10913 */
10921 String _value; 10914 String _value;
10922 10915
10923 /** 10916 /**
10924 * Initialize a newly created simple string literal. 10917 * Initialize a newly created simple string literal.
10925 * 10918 *
10926 * @param literal the token representing the literal 10919 * @param literal the token representing the literal
10927 * @param value the value of the literal 10920 * @param value the value of the literal
10928 */ 10921 */
10929 SimpleStringLiteral.full(Token literal, String value) { 10922 SimpleStringLiteral.full(this.literal, String value) {
10930 this.literal = literal;
10931 this._value = StringUtilities.intern(value); 10923 this._value = StringUtilities.intern(value);
10932 } 10924 }
10933 10925
10934 /** 10926 /**
10935 * Initialize a newly created simple string literal. 10927 * Initialize a newly created simple string literal.
10936 * 10928 *
10937 * @param literal the token representing the literal 10929 * @param literal the token representing the literal
10938 * @param value the value of the literal 10930 * @param value the value of the literal
10939 */ 10931 */
10940 SimpleStringLiteral({Token literal, String value}) : this.full(literal, value) ; 10932 SimpleStringLiteral({Token literal, String value}) : this.full(literal, value) ;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
11025 * ''' [InterpolationElement]* ''' 11017 * ''' [InterpolationElement]* '''
11026 * | '"' [InterpolationElement]* '"' 11018 * | '"' [InterpolationElement]* '"'
11027 * </pre> 11019 * </pre>
11028 * 11020 *
11029 * @coverage dart.engine.ast 11021 * @coverage dart.engine.ast
11030 */ 11022 */
11031 class StringInterpolation extends StringLiteral { 11023 class StringInterpolation extends StringLiteral {
11032 /** 11024 /**
11033 * The elements that will be composed to produce the resulting string. 11025 * The elements that will be composed to produce the resulting string.
11034 */ 11026 */
11035 NodeList<InterpolationElement> elements; 11027 NodeList<InterpolationElement> _elements;
11036 11028
11037 /** 11029 /**
11038 * Initialize a newly created string interpolation expression. 11030 * Initialize a newly created string interpolation expression.
11039 * 11031 *
11040 * @param elements the elements that will be composed to produce the resulting string 11032 * @param elements the elements that will be composed to produce the resulting string
11041 */ 11033 */
11042 StringInterpolation.full(List<InterpolationElement> elements) { 11034 StringInterpolation.full(List<InterpolationElement> elements) {
11043 this.elements = new NodeList<InterpolationElement>(this); 11035 this._elements = new NodeList<InterpolationElement>(this);
11044 this.elements.addAll(elements); 11036 this._elements.addAll(elements);
11045 } 11037 }
11046 11038
11047 /** 11039 /**
11048 * Initialize a newly created string interpolation expression. 11040 * Initialize a newly created string interpolation expression.
11049 * 11041 *
11050 * @param elements the elements that will be composed to produce the resulting string 11042 * @param elements the elements that will be composed to produce the resulting string
11051 */ 11043 */
11052 StringInterpolation({List<InterpolationElement> elements}) : this.full(element s); 11044 StringInterpolation({List<InterpolationElement> elements}) : this.full(element s);
11053 11045
11054 accept(ASTVisitor visitor) => visitor.visitStringInterpolation(this); 11046 accept(ASTVisitor visitor) => visitor.visitStringInterpolation(this);
11055 11047
11056 Token get beginToken => elements.beginToken; 11048 Token get beginToken => _elements.beginToken;
11057 11049
11058 Token get endToken => elements.endToken; 11050 /**
11051 * Return the elements that will be composed to produce the resulting string.
11052 *
11053 * @return the elements that will be composed to produce the resulting string
11054 */
11055 NodeList<InterpolationElement> get elements => _elements;
11056
11057 Token get endToken => _elements.endToken;
11059 11058
11060 void visitChildren(ASTVisitor visitor) { 11059 void visitChildren(ASTVisitor visitor) {
11061 elements.accept(visitor); 11060 _elements.accept(visitor);
11062 } 11061 }
11063 11062
11064 void appendStringValue(JavaStringBuilder builder) { 11063 void appendStringValue(JavaStringBuilder builder) {
11065 throw new IllegalArgumentException(); 11064 throw new IllegalArgumentException();
11066 } 11065 }
11067 } 11066 }
11068 11067
11069 /** 11068 /**
11070 * Instances of the class `StringLiteral` represent a string literal expression. 11069 * Instances of the class `StringLiteral` represent a string literal expression.
11071 * 11070 *
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
11147 11146
11148 /** 11147 /**
11149 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given 11148 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given
11150 * name with the given arguments. 11149 * name with the given arguments.
11151 * 11150 *
11152 * @param keyword the token for the 'super' keyword 11151 * @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 11152 * @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 11153 * @param constructorName the name of the constructor that is being invoked
11155 * @param argumentList the list of arguments to the constructor 11154 * @param argumentList the list of arguments to the constructor
11156 */ 11155 */
11157 SuperConstructorInvocation.full(Token keyword, Token period, SimpleIdentifier constructorName, ArgumentList argumentList) { 11156 SuperConstructorInvocation.full(this.keyword, this.period, SimpleIdentifier co nstructorName, ArgumentList argumentList) {
11158 this.keyword = keyword;
11159 this.period = period;
11160 this._constructorName = becomeParentOf(constructorName); 11157 this._constructorName = becomeParentOf(constructorName);
11161 this._argumentList = becomeParentOf(argumentList); 11158 this._argumentList = becomeParentOf(argumentList);
11162 } 11159 }
11163 11160
11164 /** 11161 /**
11165 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given 11162 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given
11166 * name with the given arguments. 11163 * name with the given arguments.
11167 * 11164 *
11168 * @param keyword the token for the 'super' keyword 11165 * @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 11166 * @param period the token for the period before the name of the constructor t hat is being invoked
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
11231 /** 11228 /**
11232 * The token representing the keyword. 11229 * The token representing the keyword.
11233 */ 11230 */
11234 Token keyword; 11231 Token keyword;
11235 11232
11236 /** 11233 /**
11237 * Initialize a newly created super expression. 11234 * Initialize a newly created super expression.
11238 * 11235 *
11239 * @param keyword the token representing the keyword 11236 * @param keyword the token representing the keyword
11240 */ 11237 */
11241 SuperExpression.full(Token keyword) { 11238 SuperExpression.full(this.keyword);
11242 this.keyword = keyword;
11243 }
11244 11239
11245 /** 11240 /**
11246 * Initialize a newly created super expression. 11241 * Initialize a newly created super expression.
11247 * 11242 *
11248 * @param keyword the token representing the keyword 11243 * @param keyword the token representing the keyword
11249 */ 11244 */
11250 SuperExpression({Token keyword}) : this.full(keyword); 11245 SuperExpression({Token keyword}) : this.full(keyword);
11251 11246
11252 accept(ASTVisitor visitor) => visitor.visitSuperExpression(this); 11247 accept(ASTVisitor visitor) => visitor.visitSuperExpression(this);
11253 11248
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
11374 * switchCase 11369 * switchCase
11375 * | switchDefault 11370 * | switchDefault
11376 * </pre> 11371 * </pre>
11377 * 11372 *
11378 * @coverage dart.engine.ast 11373 * @coverage dart.engine.ast
11379 */ 11374 */
11380 abstract class SwitchMember extends ASTNode { 11375 abstract class SwitchMember extends ASTNode {
11381 /** 11376 /**
11382 * The labels associated with the switch member. 11377 * The labels associated with the switch member.
11383 */ 11378 */
11384 NodeList<Label> labels; 11379 NodeList<Label> _labels;
11385 11380
11386 /** 11381 /**
11387 * The token representing the 'case' or 'default' keyword. 11382 * The token representing the 'case' or 'default' keyword.
11388 */ 11383 */
11389 Token keyword; 11384 Token keyword;
11390 11385
11391 /** 11386 /**
11392 * The colon separating the keyword or the expression from the statements. 11387 * The colon separating the keyword or the expression from the statements.
11393 */ 11388 */
11394 Token colon; 11389 Token colon;
11395 11390
11396 /** 11391 /**
11397 * The statements that will be executed if this switch member is selected. 11392 * The statements that will be executed if this switch member is selected.
11398 */ 11393 */
11399 NodeList<Statement> statements; 11394 NodeList<Statement> _statements;
11400 11395
11401 /** 11396 /**
11402 * Initialize a newly created switch member. 11397 * Initialize a newly created switch member.
11403 * 11398 *
11404 * @param labels the labels associated with the switch member 11399 * @param labels the labels associated with the switch member
11405 * @param keyword the token representing the 'case' or 'default' keyword 11400 * @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 11401 * @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 11402 * @param statements the statements that will be executed if this switch membe r is selected
11408 */ 11403 */
11409 SwitchMember.full(List<Label> labels, Token keyword, Token colon, List<Stateme nt> statements) { 11404 SwitchMember.full(List<Label> labels, this.keyword, this.colon, List<Statement > statements) {
11410 this.labels = new NodeList<Label>(this); 11405 this._labels = new NodeList<Label>(this);
11411 this.statements = new NodeList<Statement>(this); 11406 this._statements = new NodeList<Statement>(this);
11412 this.labels.addAll(labels); 11407 this._labels.addAll(labels);
11413 this.keyword = keyword; 11408 this._statements.addAll(statements);
11414 this.colon = colon;
11415 this.statements.addAll(statements);
11416 } 11409 }
11417 11410
11418 /** 11411 /**
11419 * Initialize a newly created switch member. 11412 * Initialize a newly created switch member.
11420 * 11413 *
11421 * @param labels the labels associated with the switch member 11414 * @param labels the labels associated with the switch member
11422 * @param keyword the token representing the 'case' or 'default' keyword 11415 * @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 11416 * @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 11417 * @param statements the statements that will be executed if this switch membe r is selected
11425 */ 11418 */
11426 SwitchMember({List<Label> labels, Token keyword, Token colon, List<Statement> statements}) : this.full(labels, keyword, colon, statements); 11419 SwitchMember({List<Label> labels, Token keyword, Token colon, List<Statement> statements}) : this.full(labels, keyword, colon, statements);
11427 11420
11428 Token get beginToken { 11421 Token get beginToken {
11429 if (!labels.isEmpty) { 11422 if (!_labels.isEmpty) {
11430 return labels.beginToken; 11423 return _labels.beginToken;
11431 } 11424 }
11432 return keyword; 11425 return keyword;
11433 } 11426 }
11434 11427
11435 Token get endToken { 11428 Token get endToken {
11436 if (!statements.isEmpty) { 11429 if (!_statements.isEmpty) {
11437 return statements.endToken; 11430 return _statements.endToken;
11438 } 11431 }
11439 return colon; 11432 return colon;
11440 } 11433 }
11434
11435 /**
11436 * Return the labels associated with the switch member.
11437 *
11438 * @return the labels associated with the switch member
11439 */
11440 NodeList<Label> get labels => _labels;
11441
11442 /**
11443 * Return the statements that will be executed if this switch member is select ed.
11444 *
11445 * @return the statements that will be executed if this switch member is selec ted
11446 */
11447 NodeList<Statement> get statements => _statements;
11441 } 11448 }
11442 11449
11443 /** 11450 /**
11444 * Instances of the class `SwitchStatement` represent a switch statement. 11451 * Instances of the class `SwitchStatement` represent a switch statement.
11445 * 11452 *
11446 * <pre> 11453 * <pre>
11447 * switchStatement ::= 11454 * switchStatement ::=
11448 * 'switch' '(' [Expression] ')' '{' [SwitchCase]* [SwitchDefault]? '}' 11455 * 'switch' '(' [Expression] ')' '{' [SwitchCase]* [SwitchDefault]? '}'
11449 * </pre> 11456 * </pre>
11450 * 11457 *
(...skipping 21 matching lines...) Expand all
11472 Token rightParenthesis; 11479 Token rightParenthesis;
11473 11480
11474 /** 11481 /**
11475 * The left curly bracket. 11482 * The left curly bracket.
11476 */ 11483 */
11477 Token leftBracket; 11484 Token leftBracket;
11478 11485
11479 /** 11486 /**
11480 * The switch members that can be selected by the expression. 11487 * The switch members that can be selected by the expression.
11481 */ 11488 */
11482 NodeList<SwitchMember> members; 11489 NodeList<SwitchMember> _members;
11483 11490
11484 /** 11491 /**
11485 * The right curly bracket. 11492 * The right curly bracket.
11486 */ 11493 */
11487 Token rightBracket; 11494 Token rightBracket;
11488 11495
11489 /** 11496 /**
11490 * Initialize a newly created switch statement. 11497 * Initialize a newly created switch statement.
11491 * 11498 *
11492 * @param keyword the token representing the 'switch' keyword 11499 * @param keyword the token representing the 'switch' keyword
11493 * @param leftParenthesis the left parenthesis 11500 * @param leftParenthesis the left parenthesis
11494 * @param expression the expression used to determine which of the switch memb ers will be selected 11501 * @param expression the expression used to determine which of the switch memb ers will be selected
11495 * @param rightParenthesis the right parenthesis 11502 * @param rightParenthesis the right parenthesis
11496 * @param leftBracket the left curly bracket 11503 * @param leftBracket the left curly bracket
11497 * @param members the switch members that can be selected by the expression 11504 * @param members the switch members that can be selected by the expression
11498 * @param rightBracket the right curly bracket 11505 * @param rightBracket the right curly bracket
11499 */ 11506 */
11500 SwitchStatement.full(Token keyword, Token leftParenthesis, Expression expressi on, Token rightParenthesis, Token leftBracket, List<SwitchMember> members, Token rightBracket) { 11507 SwitchStatement.full(this.keyword, this.leftParenthesis, Expression expression , this.rightParenthesis, this.leftBracket, List<SwitchMember> members, this.righ tBracket) {
11501 this.members = new NodeList<SwitchMember>(this); 11508 this._members = new NodeList<SwitchMember>(this);
11502 this.keyword = keyword;
11503 this.leftParenthesis = leftParenthesis;
11504 this._expression = becomeParentOf(expression); 11509 this._expression = becomeParentOf(expression);
11505 this.rightParenthesis = rightParenthesis; 11510 this._members.addAll(members);
11506 this.leftBracket = leftBracket;
11507 this.members.addAll(members);
11508 this.rightBracket = rightBracket;
11509 } 11511 }
11510 11512
11511 /** 11513 /**
11512 * Initialize a newly created switch statement. 11514 * Initialize a newly created switch statement.
11513 * 11515 *
11514 * @param keyword the token representing the 'switch' keyword 11516 * @param keyword the token representing the 'switch' keyword
11515 * @param leftParenthesis the left parenthesis 11517 * @param leftParenthesis the left parenthesis
11516 * @param expression the expression used to determine which of the switch memb ers will be selected 11518 * @param expression the expression used to determine which of the switch memb ers will be selected
11517 * @param rightParenthesis the right parenthesis 11519 * @param rightParenthesis the right parenthesis
11518 * @param leftBracket the left curly bracket 11520 * @param leftBracket the left curly bracket
11519 * @param members the switch members that can be selected by the expression 11521 * @param members the switch members that can be selected by the expression
11520 * @param rightBracket the right curly bracket 11522 * @param rightBracket the right curly bracket
11521 */ 11523 */
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); 11524 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 11525
11524 accept(ASTVisitor visitor) => visitor.visitSwitchStatement(this); 11526 accept(ASTVisitor visitor) => visitor.visitSwitchStatement(this);
11525 11527
11526 Token get beginToken => keyword; 11528 Token get beginToken => keyword;
11527 11529
11528 Token get endToken => rightBracket; 11530 Token get endToken => rightBracket;
11529 11531
11530 /** 11532 /**
11531 * Return the expression used to determine which of the switch members will be selected. 11533 * Return the expression used to determine which of the switch members will be selected.
11532 * 11534 *
11533 * @return the expression used to determine which of the switch members will b e selected 11535 * @return the expression used to determine which of the switch members will b e selected
11534 */ 11536 */
11535 Expression get expression => _expression; 11537 Expression get expression => _expression;
11536 11538
11537 /** 11539 /**
11540 * Return the switch members that can be selected by the expression.
11541 *
11542 * @return the switch members that can be selected by the expression
11543 */
11544 NodeList<SwitchMember> get members => _members;
11545
11546 /**
11538 * Set the expression used to determine which of the switch members will be se lected to the given 11547 * Set the expression used to determine which of the switch members will be se lected to the given
11539 * expression. 11548 * expression.
11540 * 11549 *
11541 * @param expression the expression used to determine which of the switch memb ers will be selected 11550 * @param expression the expression used to determine which of the switch memb ers will be selected
11542 */ 11551 */
11543 void set expression(Expression expression) { 11552 void set expression(Expression expression) {
11544 this._expression = becomeParentOf(expression); 11553 this._expression = becomeParentOf(expression);
11545 } 11554 }
11546 11555
11547 void visitChildren(ASTVisitor visitor) { 11556 void visitChildren(ASTVisitor visitor) {
11548 safelyVisitChild(_expression, visitor); 11557 safelyVisitChild(_expression, visitor);
11549 members.accept(visitor); 11558 _members.accept(visitor);
11550 } 11559 }
11551 } 11560 }
11552 11561
11553 /** 11562 /**
11554 * Instances of the class `SymbolLiteral` represent a symbol literal expression. 11563 * Instances of the class `SymbolLiteral` represent a symbol literal expression.
11555 * 11564 *
11556 * <pre> 11565 * <pre>
11557 * symbolLiteral ::= 11566 * symbolLiteral ::=
11558 * '#' (operator | (identifier ('.' identifier)*)) 11567 * '#' (operator | (identifier ('.' identifier)*))
11559 * </pre> 11568 * </pre>
11560 * 11569 *
11561 * @coverage dart.engine.ast 11570 * @coverage dart.engine.ast
11562 */ 11571 */
11563 class SymbolLiteral extends Literal { 11572 class SymbolLiteral extends Literal {
11564 /** 11573 /**
11565 * The token introducing the literal. 11574 * The token introducing the literal.
11566 */ 11575 */
11567 Token poundSign; 11576 Token poundSign;
11568 11577
11569 /** 11578 /**
11570 * The components of the literal. 11579 * The components of the literal.
11571 */ 11580 */
11572 List<Token> components; 11581 final List<Token> components;
11573 11582
11574 /** 11583 /**
11575 * Initialize a newly created symbol literal. 11584 * Initialize a newly created symbol literal.
11576 * 11585 *
11577 * @param poundSign the token introducing the literal 11586 * @param poundSign the token introducing the literal
11578 * @param components the components of the literal 11587 * @param components the components of the literal
11579 */ 11588 */
11580 SymbolLiteral.full(Token poundSign, List<Token> components) { 11589 SymbolLiteral.full(this.poundSign, this.components);
11581 this.poundSign = poundSign;
11582 this.components = components;
11583 }
11584 11590
11585 /** 11591 /**
11586 * Initialize a newly created symbol literal. 11592 * Initialize a newly created symbol literal.
11587 * 11593 *
11588 * @param poundSign the token introducing the literal 11594 * @param poundSign the token introducing the literal
11589 * @param components the components of the literal 11595 * @param components the components of the literal
11590 */ 11596 */
11591 SymbolLiteral({Token poundSign, List<Token> components}) : this.full(poundSign , components); 11597 SymbolLiteral({Token poundSign, List<Token> components}) : this.full(poundSign , components);
11592 11598
11593 accept(ASTVisitor visitor) => visitor.visitSymbolLiteral(this); 11599 accept(ASTVisitor visitor) => visitor.visitSymbolLiteral(this);
(...skipping 20 matching lines...) Expand all
11614 /** 11620 /**
11615 * The token representing the keyword. 11621 * The token representing the keyword.
11616 */ 11622 */
11617 Token keyword; 11623 Token keyword;
11618 11624
11619 /** 11625 /**
11620 * Initialize a newly created this expression. 11626 * Initialize a newly created this expression.
11621 * 11627 *
11622 * @param keyword the token representing the keyword 11628 * @param keyword the token representing the keyword
11623 */ 11629 */
11624 ThisExpression.full(Token keyword) { 11630 ThisExpression.full(this.keyword);
11625 this.keyword = keyword;
11626 }
11627 11631
11628 /** 11632 /**
11629 * Initialize a newly created this expression. 11633 * Initialize a newly created this expression.
11630 * 11634 *
11631 * @param keyword the token representing the keyword 11635 * @param keyword the token representing the keyword
11632 */ 11636 */
11633 ThisExpression({Token keyword}) : this.full(keyword); 11637 ThisExpression({Token keyword}) : this.full(keyword);
11634 11638
11635 accept(ASTVisitor visitor) => visitor.visitThisExpression(this); 11639 accept(ASTVisitor visitor) => visitor.visitThisExpression(this);
11636 11640
(...skipping 27 matching lines...) Expand all
11664 * The expression computing the exception to be thrown. 11668 * The expression computing the exception to be thrown.
11665 */ 11669 */
11666 Expression _expression; 11670 Expression _expression;
11667 11671
11668 /** 11672 /**
11669 * Initialize a newly created throw expression. 11673 * Initialize a newly created throw expression.
11670 * 11674 *
11671 * @param keyword the token representing the 'throw' keyword 11675 * @param keyword the token representing the 'throw' keyword
11672 * @param expression the expression computing the exception to be thrown 11676 * @param expression the expression computing the exception to be thrown
11673 */ 11677 */
11674 ThrowExpression.full(Token keyword, Expression expression) { 11678 ThrowExpression.full(this.keyword, Expression expression) {
11675 this.keyword = keyword;
11676 this._expression = becomeParentOf(expression); 11679 this._expression = becomeParentOf(expression);
11677 } 11680 }
11678 11681
11679 /** 11682 /**
11680 * Initialize a newly created throw expression. 11683 * Initialize a newly created throw expression.
11681 * 11684 *
11682 * @param keyword the token representing the 'throw' keyword 11685 * @param keyword the token representing the 'throw' keyword
11683 * @param expression the expression computing the exception to be thrown 11686 * @param expression the expression computing the exception to be thrown
11684 */ 11687 */
11685 ThrowExpression({Token keyword, Expression expression}) : this.full(keyword, e xpression); 11688 ThrowExpression({Token keyword, Expression expression}) : this.full(keyword, e xpression);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
11742 Token semicolon; 11745 Token semicolon;
11743 11746
11744 /** 11747 /**
11745 * Initialize a newly created top-level variable declaration. 11748 * Initialize a newly created top-level variable declaration.
11746 * 11749 *
11747 * @param comment the documentation comment associated with this variable 11750 * @param comment the documentation comment associated with this variable
11748 * @param metadata the annotations associated with this variable 11751 * @param metadata the annotations associated with this variable
11749 * @param variableList the top-level variables being declared 11752 * @param variableList the top-level variables being declared
11750 * @param semicolon the semicolon terminating the declaration 11753 * @param semicolon the semicolon terminating the declaration
11751 */ 11754 */
11752 TopLevelVariableDeclaration.full(Comment comment, List<Annotation> metadata, V ariableDeclarationList variableList, Token semicolon) : super.full(comment, meta data) { 11755 TopLevelVariableDeclaration.full(Comment comment, List<Annotation> metadata, V ariableDeclarationList variableList, this.semicolon) : super.full(comment, metad ata) {
11753 this._variableList = becomeParentOf(variableList); 11756 this._variableList = becomeParentOf(variableList);
11754 this.semicolon = semicolon;
11755 } 11757 }
11756 11758
11757 /** 11759 /**
11758 * Initialize a newly created top-level variable declaration. 11760 * Initialize a newly created top-level variable declaration.
11759 * 11761 *
11760 * @param comment the documentation comment associated with this variable 11762 * @param comment the documentation comment associated with this variable
11761 * @param metadata the annotations associated with this variable 11763 * @param metadata the annotations associated with this variable
11762 * @param variableList the top-level variables being declared 11764 * @param variableList the top-level variables being declared
11763 * @param semicolon the semicolon terminating the declaration 11765 * @param semicolon the semicolon terminating the declaration
11764 */ 11766 */
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
11814 Token tryKeyword; 11816 Token tryKeyword;
11815 11817
11816 /** 11818 /**
11817 * The body of the statement. 11819 * The body of the statement.
11818 */ 11820 */
11819 Block _body; 11821 Block _body;
11820 11822
11821 /** 11823 /**
11822 * The catch clauses contained in the try statement. 11824 * The catch clauses contained in the try statement.
11823 */ 11825 */
11824 NodeList<CatchClause> catchClauses; 11826 NodeList<CatchClause> _catchClauses;
11825 11827
11826 /** 11828 /**
11827 * The token representing the 'finally' keyword, or `null` if the statement do es not contain 11829 * The token representing the 'finally' keyword, or `null` if the statement do es not contain
11828 * a finally clause. 11830 * a finally clause.
11829 */ 11831 */
11830 Token finallyKeyword; 11832 Token finallyKeyword;
11831 11833
11832 /** 11834 /**
11833 * The finally block contained in the try statement, or `null` if the statemen t does not 11835 * The finally block contained in the try statement, or `null` if the statemen t does not
11834 * contain a finally clause. 11836 * contain a finally clause.
11835 */ 11837 */
11836 Block _finallyBlock; 11838 Block _finallyBlock;
11837 11839
11838 /** 11840 /**
11839 * Initialize a newly created try statement. 11841 * Initialize a newly created try statement.
11840 * 11842 *
11841 * @param tryKeyword the token representing the 'try' keyword 11843 * @param tryKeyword the token representing the 'try' keyword
11842 * @param body the body of the statement 11844 * @param body the body of the statement
11843 * @param catchClauses the catch clauses contained in the try statement 11845 * @param catchClauses the catch clauses contained in the try statement
11844 * @param finallyKeyword the token representing the 'finally' keyword 11846 * @param finallyKeyword the token representing the 'finally' keyword
11845 * @param finallyBlock the finally block contained in the try statement 11847 * @param finallyBlock the finally block contained in the try statement
11846 */ 11848 */
11847 TryStatement.full(Token tryKeyword, Block body, List<CatchClause> catchClauses , Token finallyKeyword, Block finallyBlock) { 11849 TryStatement.full(this.tryKeyword, Block body, List<CatchClause> catchClauses, this.finallyKeyword, Block finallyBlock) {
11848 this.catchClauses = new NodeList<CatchClause>(this); 11850 this._catchClauses = new NodeList<CatchClause>(this);
11849 this.tryKeyword = tryKeyword;
11850 this._body = becomeParentOf(body); 11851 this._body = becomeParentOf(body);
11851 this.catchClauses.addAll(catchClauses); 11852 this._catchClauses.addAll(catchClauses);
11852 this.finallyKeyword = finallyKeyword;
11853 this._finallyBlock = becomeParentOf(finallyBlock); 11853 this._finallyBlock = becomeParentOf(finallyBlock);
11854 } 11854 }
11855 11855
11856 /** 11856 /**
11857 * Initialize a newly created try statement. 11857 * Initialize a newly created try statement.
11858 * 11858 *
11859 * @param tryKeyword the token representing the 'try' keyword 11859 * @param tryKeyword the token representing the 'try' keyword
11860 * @param body the body of the statement 11860 * @param body the body of the statement
11861 * @param catchClauses the catch clauses contained in the try statement 11861 * @param catchClauses the catch clauses contained in the try statement
11862 * @param finallyKeyword the token representing the 'finally' keyword 11862 * @param finallyKeyword the token representing the 'finally' keyword
11863 * @param finallyBlock the finally block contained in the try statement 11863 * @param finallyBlock the finally block contained in the try statement
11864 */ 11864 */
11865 TryStatement({Token tryKeyword, Block body, List<CatchClause> catchClauses, To ken finallyKeyword, Block finallyBlock}) : this.full(tryKeyword, body, catchClau ses, finallyKeyword, finallyBlock); 11865 TryStatement({Token tryKeyword, Block body, List<CatchClause> catchClauses, To ken finallyKeyword, Block finallyBlock}) : this.full(tryKeyword, body, catchClau ses, finallyKeyword, finallyBlock);
11866 11866
11867 accept(ASTVisitor visitor) => visitor.visitTryStatement(this); 11867 accept(ASTVisitor visitor) => visitor.visitTryStatement(this);
11868 11868
11869 Token get beginToken => tryKeyword; 11869 Token get beginToken => tryKeyword;
11870 11870
11871 /** 11871 /**
11872 * Return the body of the statement. 11872 * Return the body of the statement.
11873 * 11873 *
11874 * @return the body of the statement 11874 * @return the body of the statement
11875 */ 11875 */
11876 Block get body => _body; 11876 Block get body => _body;
11877 11877
11878 /**
11879 * Return the catch clauses contained in the try statement.
11880 *
11881 * @return the catch clauses contained in the try statement
11882 */
11883 NodeList<CatchClause> get catchClauses => _catchClauses;
11884
11878 Token get endToken { 11885 Token get endToken {
11879 if (_finallyBlock != null) { 11886 if (_finallyBlock != null) {
11880 return _finallyBlock.endToken; 11887 return _finallyBlock.endToken;
11881 } else if (finallyKeyword != null) { 11888 } else if (finallyKeyword != null) {
11882 return finallyKeyword; 11889 return finallyKeyword;
11883 } else if (!catchClauses.isEmpty) { 11890 } else if (!_catchClauses.isEmpty) {
11884 return catchClauses.endToken; 11891 return _catchClauses.endToken;
11885 } 11892 }
11886 return _body.endToken; 11893 return _body.endToken;
11887 } 11894 }
11888 11895
11889 /** 11896 /**
11890 * Return the finally block contained in the try statement, or `null` if the s tatement does 11897 * Return the finally block contained in the try statement, or `null` if the s tatement does
11891 * not contain a finally clause. 11898 * not contain a finally clause.
11892 * 11899 *
11893 * @return the finally block contained in the try statement 11900 * @return the finally block contained in the try statement
11894 */ 11901 */
(...skipping 12 matching lines...) Expand all
11907 * Set the finally block contained in the try statement to the given block. 11914 * Set the finally block contained in the try statement to the given block.
11908 * 11915 *
11909 * @param block the finally block contained in the try statement 11916 * @param block the finally block contained in the try statement
11910 */ 11917 */
11911 void set finallyBlock(Block block) { 11918 void set finallyBlock(Block block) {
11912 _finallyBlock = becomeParentOf(block); 11919 _finallyBlock = becomeParentOf(block);
11913 } 11920 }
11914 11921
11915 void visitChildren(ASTVisitor visitor) { 11922 void visitChildren(ASTVisitor visitor) {
11916 safelyVisitChild(_body, visitor); 11923 safelyVisitChild(_body, visitor);
11917 catchClauses.accept(visitor); 11924 _catchClauses.accept(visitor);
11918 safelyVisitChild(_finallyBlock, visitor); 11925 safelyVisitChild(_finallyBlock, visitor);
11919 } 11926 }
11920 } 11927 }
11921 11928
11922 /** 11929 /**
11923 * The abstract class `TypeAlias` defines the behavior common to declarations of type aliases. 11930 * The abstract class `TypeAlias` defines the behavior common to declarations of type aliases.
11924 * 11931 *
11925 * <pre> 11932 * <pre>
11926 * typeAlias ::= 11933 * typeAlias ::=
11927 * 'typedef' typeAliasBody 11934 * 'typedef' typeAliasBody
(...skipping 17 matching lines...) Expand all
11945 Token semicolon; 11952 Token semicolon;
11946 11953
11947 /** 11954 /**
11948 * Initialize a newly created type alias. 11955 * Initialize a newly created type alias.
11949 * 11956 *
11950 * @param comment the documentation comment associated with this type alias 11957 * @param comment the documentation comment associated with this type alias
11951 * @param metadata the annotations associated with this type alias 11958 * @param metadata the annotations associated with this type alias
11952 * @param keyword the token representing the 'typedef' keyword 11959 * @param keyword the token representing the 'typedef' keyword
11953 * @param semicolon the semicolon terminating the declaration 11960 * @param semicolon the semicolon terminating the declaration
11954 */ 11961 */
11955 TypeAlias.full(Comment comment, List<Annotation> metadata, Token keyword, Toke n semicolon) : super.full(comment, metadata) { 11962 TypeAlias.full(Comment comment, List<Annotation> metadata, this.keyword, this. semicolon) : super.full(comment, metadata);
11956 this.keyword = keyword;
11957 this.semicolon = semicolon;
11958 }
11959 11963
11960 /** 11964 /**
11961 * Initialize a newly created type alias. 11965 * Initialize a newly created type alias.
11962 * 11966 *
11963 * @param comment the documentation comment associated with this type alias 11967 * @param comment the documentation comment associated with this type alias
11964 * @param metadata the annotations associated with this type alias 11968 * @param metadata the annotations associated with this type alias
11965 * @param keyword the token representing the 'typedef' keyword 11969 * @param keyword the token representing the 'typedef' keyword
11966 * @param semicolon the semicolon terminating the declaration 11970 * @param semicolon the semicolon terminating the declaration
11967 */ 11971 */
11968 TypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Token se micolon}) : this.full(comment, metadata, keyword, semicolon); 11972 TypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Token se micolon}) : this.full(comment, metadata, keyword, semicolon);
(...skipping 15 matching lines...) Expand all
11984 */ 11988 */
11985 class TypeArgumentList extends ASTNode { 11989 class TypeArgumentList extends ASTNode {
11986 /** 11990 /**
11987 * The left bracket. 11991 * The left bracket.
11988 */ 11992 */
11989 Token leftBracket; 11993 Token leftBracket;
11990 11994
11991 /** 11995 /**
11992 * The type arguments associated with the type. 11996 * The type arguments associated with the type.
11993 */ 11997 */
11994 NodeList<TypeName> arguments; 11998 NodeList<TypeName> _arguments;
11995 11999
11996 /** 12000 /**
11997 * The right bracket. 12001 * The right bracket.
11998 */ 12002 */
11999 Token rightBracket; 12003 Token rightBracket;
12000 12004
12001 /** 12005 /**
12002 * Initialize a newly created list of type arguments. 12006 * Initialize a newly created list of type arguments.
12003 * 12007 *
12004 * @param leftBracket the left bracket 12008 * @param leftBracket the left bracket
12005 * @param arguments the type arguments associated with the type 12009 * @param arguments the type arguments associated with the type
12006 * @param rightBracket the right bracket 12010 * @param rightBracket the right bracket
12007 */ 12011 */
12008 TypeArgumentList.full(Token leftBracket, List<TypeName> arguments, Token right Bracket) { 12012 TypeArgumentList.full(this.leftBracket, List<TypeName> arguments, this.rightBr acket) {
12009 this.arguments = new NodeList<TypeName>(this); 12013 this._arguments = new NodeList<TypeName>(this);
12010 this.leftBracket = leftBracket; 12014 this._arguments.addAll(arguments);
12011 this.arguments.addAll(arguments);
12012 this.rightBracket = rightBracket;
12013 } 12015 }
12014 12016
12015 /** 12017 /**
12016 * Initialize a newly created list of type arguments. 12018 * Initialize a newly created list of type arguments.
12017 * 12019 *
12018 * @param leftBracket the left bracket 12020 * @param leftBracket the left bracket
12019 * @param arguments the type arguments associated with the type 12021 * @param arguments the type arguments associated with the type
12020 * @param rightBracket the right bracket 12022 * @param rightBracket the right bracket
12021 */ 12023 */
12022 TypeArgumentList({Token leftBracket, List<TypeName> arguments, Token rightBrac ket}) : this.full(leftBracket, arguments, rightBracket); 12024 TypeArgumentList({Token leftBracket, List<TypeName> arguments, Token rightBrac ket}) : this.full(leftBracket, arguments, rightBracket);
12023 12025
12024 accept(ASTVisitor visitor) => visitor.visitTypeArgumentList(this); 12026 accept(ASTVisitor visitor) => visitor.visitTypeArgumentList(this);
12025 12027
12028 /**
12029 * Return the type arguments associated with the type.
12030 *
12031 * @return the type arguments associated with the type
12032 */
12033 NodeList<TypeName> get arguments => _arguments;
12034
12026 Token get beginToken => leftBracket; 12035 Token get beginToken => leftBracket;
12027 12036
12028 Token get endToken => rightBracket; 12037 Token get endToken => rightBracket;
12029 12038
12030 void visitChildren(ASTVisitor visitor) { 12039 void visitChildren(ASTVisitor visitor) {
12031 arguments.accept(visitor); 12040 _arguments.accept(visitor);
12032 } 12041 }
12033 } 12042 }
12034 12043
12035 /** 12044 /**
12036 * Instances of the class `TypeName` represent the name of a type, which can opt ionally 12045 * Instances of the class `TypeName` represent the name of a type, which can opt ionally
12037 * include type arguments. 12046 * include type arguments.
12038 * 12047 *
12039 * <pre> 12048 * <pre>
12040 * typeName ::= 12049 * typeName ::=
12041 * [Identifier] typeArguments? 12050 * [Identifier] typeArguments?
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
12162 12171
12163 /** 12172 /**
12164 * Initialize a newly created type parameter. 12173 * Initialize a newly created type parameter.
12165 * 12174 *
12166 * @param comment the documentation comment associated with the type parameter 12175 * @param comment the documentation comment associated with the type parameter
12167 * @param metadata the annotations associated with the type parameter 12176 * @param metadata the annotations associated with the type parameter
12168 * @param name the name of the type parameter 12177 * @param name the name of the type parameter
12169 * @param keyword the token representing the 'extends' keyword 12178 * @param keyword the token representing the 'extends' keyword
12170 * @param bound the name of the upper bound for legal arguments 12179 * @param bound the name of the upper bound for legal arguments
12171 */ 12180 */
12172 TypeParameter.full(Comment comment, List<Annotation> metadata, SimpleIdentifie r name, Token keyword, TypeName bound) : super.full(comment, metadata) { 12181 TypeParameter.full(Comment comment, List<Annotation> metadata, SimpleIdentifie r name, this.keyword, TypeName bound) : super.full(comment, metadata) {
12173 this._name = becomeParentOf(name); 12182 this._name = becomeParentOf(name);
12174 this.keyword = keyword;
12175 this._bound = becomeParentOf(bound); 12183 this._bound = becomeParentOf(bound);
12176 } 12184 }
12177 12185
12178 /** 12186 /**
12179 * Initialize a newly created type parameter. 12187 * Initialize a newly created type parameter.
12180 * 12188 *
12181 * @param comment the documentation comment associated with the type parameter 12189 * @param comment the documentation comment associated with the type parameter
12182 * @param metadata the annotations associated with the type parameter 12190 * @param metadata the annotations associated with the type parameter
12183 * @param name the name of the type parameter 12191 * @param name the name of the type parameter
12184 * @param keyword the token representing the 'extends' keyword 12192 * @param keyword the token representing the 'extends' keyword
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
12246 * typeParameterList ::= 12254 * typeParameterList ::=
12247 * '<' [TypeParameter] (',' [TypeParameter])* '>' 12255 * '<' [TypeParameter] (',' [TypeParameter])* '>'
12248 * </pre> 12256 * </pre>
12249 * 12257 *
12250 * @coverage dart.engine.ast 12258 * @coverage dart.engine.ast
12251 */ 12259 */
12252 class TypeParameterList extends ASTNode { 12260 class TypeParameterList extends ASTNode {
12253 /** 12261 /**
12254 * The left angle bracket. 12262 * The left angle bracket.
12255 */ 12263 */
12256 Token leftBracket; 12264 final Token leftBracket;
12257 12265
12258 /** 12266 /**
12259 * The type parameters in the list. 12267 * The type parameters in the list.
12260 */ 12268 */
12261 NodeList<TypeParameter> typeParameters; 12269 NodeList<TypeParameter> _typeParameters;
12262 12270
12263 /** 12271 /**
12264 * The right angle bracket. 12272 * The right angle bracket.
12265 */ 12273 */
12266 Token rightBracket; 12274 final Token rightBracket;
12267 12275
12268 /** 12276 /**
12269 * Initialize a newly created list of type parameters. 12277 * Initialize a newly created list of type parameters.
12270 * 12278 *
12271 * @param leftBracket the left angle bracket 12279 * @param leftBracket the left angle bracket
12272 * @param typeParameters the type parameters in the list 12280 * @param typeParameters the type parameters in the list
12273 * @param rightBracket the right angle bracket 12281 * @param rightBracket the right angle bracket
12274 */ 12282 */
12275 TypeParameterList.full(Token leftBracket, List<TypeParameter> typeParameters, Token rightBracket) { 12283 TypeParameterList.full(this.leftBracket, List<TypeParameter> typeParameters, t his.rightBracket) {
12276 this.typeParameters = new NodeList<TypeParameter>(this); 12284 this._typeParameters = new NodeList<TypeParameter>(this);
12277 this.leftBracket = leftBracket; 12285 this._typeParameters.addAll(typeParameters);
12278 this.typeParameters.addAll(typeParameters);
12279 this.rightBracket = rightBracket;
12280 } 12286 }
12281 12287
12282 /** 12288 /**
12283 * Initialize a newly created list of type parameters. 12289 * Initialize a newly created list of type parameters.
12284 * 12290 *
12285 * @param leftBracket the left angle bracket 12291 * @param leftBracket the left angle bracket
12286 * @param typeParameters the type parameters in the list 12292 * @param typeParameters the type parameters in the list
12287 * @param rightBracket the right angle bracket 12293 * @param rightBracket the right angle bracket
12288 */ 12294 */
12289 TypeParameterList({Token leftBracket, List<TypeParameter> typeParameters, Toke n rightBracket}) : this.full(leftBracket, typeParameters, rightBracket); 12295 TypeParameterList({Token leftBracket, List<TypeParameter> typeParameters, Toke n rightBracket}) : this.full(leftBracket, typeParameters, rightBracket);
12290 12296
12291 accept(ASTVisitor visitor) => visitor.visitTypeParameterList(this); 12297 accept(ASTVisitor visitor) => visitor.visitTypeParameterList(this);
12292 12298
12293 Token get beginToken => leftBracket; 12299 Token get beginToken => leftBracket;
12294 12300
12295 Token get endToken => rightBracket; 12301 Token get endToken => rightBracket;
12296 12302
12303 /**
12304 * Return the type parameters for the type.
12305 *
12306 * @return the type parameters for the type
12307 */
12308 NodeList<TypeParameter> get typeParameters => _typeParameters;
12309
12297 void visitChildren(ASTVisitor visitor) { 12310 void visitChildren(ASTVisitor visitor) {
12298 typeParameters.accept(visitor); 12311 _typeParameters.accept(visitor);
12299 } 12312 }
12300 } 12313 }
12301 12314
12302 /** 12315 /**
12303 * The abstract class `TypedLiteral` defines the behavior common to literals tha t have a type 12316 * The abstract class `TypedLiteral` defines the behavior common to literals tha t have a type
12304 * associated with them. 12317 * associated with them.
12305 * 12318 *
12306 * <pre> 12319 * <pre>
12307 * listLiteral ::= 12320 * listLiteral ::=
12308 * [ListLiteral] 12321 * [ListLiteral]
(...skipping 14 matching lines...) Expand all
12323 */ 12336 */
12324 TypeArgumentList typeArguments; 12337 TypeArgumentList typeArguments;
12325 12338
12326 /** 12339 /**
12327 * Initialize a newly created typed literal. 12340 * Initialize a newly created typed literal.
12328 * 12341 *
12329 * @param constKeyword the token representing the 'const' keyword 12342 * @param constKeyword the token representing the 'const' keyword
12330 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 12343 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
12331 * arguments were declared 12344 * arguments were declared
12332 */ 12345 */
12333 TypedLiteral.full(Token constKeyword, TypeArgumentList typeArguments) { 12346 TypedLiteral.full(this.constKeyword, TypeArgumentList typeArguments) {
12334 this.constKeyword = constKeyword;
12335 this.typeArguments = becomeParentOf(typeArguments); 12347 this.typeArguments = becomeParentOf(typeArguments);
12336 } 12348 }
12337 12349
12338 /** 12350 /**
12339 * Initialize a newly created typed literal. 12351 * Initialize a newly created typed literal.
12340 * 12352 *
12341 * @param constKeyword the token representing the 'const' keyword 12353 * @param constKeyword the token representing the 'const' keyword
12342 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type 12354 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
12343 * arguments were declared 12355 * arguments were declared
12344 */ 12356 */
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
12451 12463
12452 /** 12464 /**
12453 * Initialize a newly created variable declaration. 12465 * Initialize a newly created variable declaration.
12454 * 12466 *
12455 * @param comment the documentation comment associated with this declaration 12467 * @param comment the documentation comment associated with this declaration
12456 * @param metadata the annotations associated with this member 12468 * @param metadata the annotations associated with this member
12457 * @param name the name of the variable being declared 12469 * @param name the name of the variable being declared
12458 * @param equals the equal sign separating the variable name from the initial value 12470 * @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 12471 * @param initializer the expression used to compute the initial value for the variable
12460 */ 12472 */
12461 VariableDeclaration.full(Comment comment, List<Annotation> metadata, SimpleIde ntifier name, Token equals, Expression initializer) : super.full(comment, metada ta) { 12473 VariableDeclaration.full(Comment comment, List<Annotation> metadata, SimpleIde ntifier name, this.equals, Expression initializer) : super.full(comment, metadat a) {
12462 this._name = becomeParentOf(name); 12474 this._name = becomeParentOf(name);
12463 this.equals = equals;
12464 this._initializer = becomeParentOf(initializer); 12475 this._initializer = becomeParentOf(initializer);
12465 } 12476 }
12466 12477
12467 /** 12478 /**
12468 * Initialize a newly created variable declaration. 12479 * Initialize a newly created variable declaration.
12469 * 12480 *
12470 * @param comment the documentation comment associated with this declaration 12481 * @param comment the documentation comment associated with this declaration
12471 * @param metadata the annotations associated with this member 12482 * @param metadata the annotations associated with this member
12472 * @param name the name of the variable being declared 12483 * @param name the name of the variable being declared
12473 * @param equals the equal sign separating the variable name from the initial value 12484 * @param equals the equal sign separating the variable name from the initial value
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
12592 Token keyword; 12603 Token keyword;
12593 12604
12594 /** 12605 /**
12595 * The type of the variables being declared, or `null` if no type was provided . 12606 * The type of the variables being declared, or `null` if no type was provided .
12596 */ 12607 */
12597 TypeName _type; 12608 TypeName _type;
12598 12609
12599 /** 12610 /**
12600 * A list containing the individual variables being declared. 12611 * A list containing the individual variables being declared.
12601 */ 12612 */
12602 NodeList<VariableDeclaration> variables; 12613 NodeList<VariableDeclaration> _variables;
12603 12614
12604 /** 12615 /**
12605 * Initialize a newly created variable declaration list. 12616 * Initialize a newly created variable declaration list.
12606 * 12617 *
12607 * @param comment the documentation comment associated with this declaration l ist 12618 * @param comment the documentation comment associated with this declaration l ist
12608 * @param metadata the annotations associated with this declaration list 12619 * @param metadata the annotations associated with this declaration list
12609 * @param keyword the token representing the 'final', 'const' or 'var' keyword 12620 * @param keyword the token representing the 'final', 'const' or 'var' keyword
12610 * @param type the type of the variables being declared 12621 * @param type the type of the variables being declared
12611 * @param variables a list containing the individual variables being declared 12622 * @param variables a list containing the individual variables being declared
12612 */ 12623 */
12613 VariableDeclarationList.full(Comment comment, List<Annotation> metadata, Token keyword, TypeName type, List<VariableDeclaration> variables) : super.full(comme nt, metadata) { 12624 VariableDeclarationList.full(Comment comment, List<Annotation> metadata, this. keyword, TypeName type, List<VariableDeclaration> variables) : super.full(commen t, metadata) {
12614 this.variables = new NodeList<VariableDeclaration>(this); 12625 this._variables = new NodeList<VariableDeclaration>(this);
12615 this.keyword = keyword;
12616 this._type = becomeParentOf(type); 12626 this._type = becomeParentOf(type);
12617 this.variables.addAll(variables); 12627 this._variables.addAll(variables);
12618 } 12628 }
12619 12629
12620 /** 12630 /**
12621 * Initialize a newly created variable declaration list. 12631 * Initialize a newly created variable declaration list.
12622 * 12632 *
12623 * @param comment the documentation comment associated with this declaration l ist 12633 * @param comment the documentation comment associated with this declaration l ist
12624 * @param metadata the annotations associated with this declaration list 12634 * @param metadata the annotations associated with this declaration list
12625 * @param keyword the token representing the 'final', 'const' or 'var' keyword 12635 * @param keyword the token representing the 'final', 'const' or 'var' keyword
12626 * @param type the type of the variables being declared 12636 * @param type the type of the variables being declared
12627 * @param variables a list containing the individual variables being declared 12637 * @param variables a list containing the individual variables being declared
12628 */ 12638 */
12629 VariableDeclarationList({Comment comment, List<Annotation> metadata, Token key word, TypeName type, List<VariableDeclaration> variables}) : this.full(comment, metadata, keyword, type, variables); 12639 VariableDeclarationList({Comment comment, List<Annotation> metadata, Token key word, TypeName type, List<VariableDeclaration> variables}) : this.full(comment, metadata, keyword, type, variables);
12630 12640
12631 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this); 12641 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this);
12632 12642
12633 Token get endToken => variables.endToken; 12643 Token get endToken => _variables.endToken;
12634 12644
12635 /** 12645 /**
12636 * Return the type of the variables being declared, or `null` if no type was p rovided. 12646 * Return the type of the variables being declared, or `null` if no type was p rovided.
12637 * 12647 *
12638 * @return the type of the variables being declared 12648 * @return the type of the variables being declared
12639 */ 12649 */
12640 TypeName get type => _type; 12650 TypeName get type => _type;
12641 12651
12642 /** 12652 /**
12653 * Return a list containing the individual variables being declared.
12654 *
12655 * @return a list containing the individual variables being declared
12656 */
12657 NodeList<VariableDeclaration> get variables => _variables;
12658
12659 /**
12643 * Return `true` if the variables in this list were declared with the 'const' modifier. 12660 * Return `true` if the variables in this list were declared with the 'const' modifier.
12644 * 12661 *
12645 * @return `true` if the variables in this list were declared with the 'const' modifier 12662 * @return `true` if the variables in this list were declared with the 'const' modifier
12646 */ 12663 */
12647 bool get isConst => keyword is KeywordToken && identical((keyword as KeywordTo ken).keyword, Keyword.CONST); 12664 bool get isConst => keyword is KeywordToken && identical((keyword as KeywordTo ken).keyword, Keyword.CONST);
12648 12665
12649 /** 12666 /**
12650 * Return `true` if the variables in this list were declared with the 'final' modifier. 12667 * 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 12668 * Variables that are declared with the 'const' modifier will return `false` e ven though
12652 * they are implicitly final. 12669 * they are implicitly final.
12653 * 12670 *
12654 * @return `true` if the variables in this list were declared with the 'final' modifier 12671 * @return `true` if the variables in this list were declared with the 'final' modifier
12655 */ 12672 */
12656 bool get isFinal => keyword is KeywordToken && identical((keyword as KeywordTo ken).keyword, Keyword.FINAL); 12673 bool get isFinal => keyword is KeywordToken && identical((keyword as KeywordTo ken).keyword, Keyword.FINAL);
12657 12674
12658 /** 12675 /**
12659 * Set the type of the variables being declared to the given type name. 12676 * Set the type of the variables being declared to the given type name.
12660 * 12677 *
12661 * @param typeName the type of the variables being declared 12678 * @param typeName the type of the variables being declared
12662 */ 12679 */
12663 void set type(TypeName typeName) { 12680 void set type(TypeName typeName) {
12664 _type = becomeParentOf(typeName); 12681 _type = becomeParentOf(typeName);
12665 } 12682 }
12666 12683
12667 void visitChildren(ASTVisitor visitor) { 12684 void visitChildren(ASTVisitor visitor) {
12668 safelyVisitChild(_type, visitor); 12685 safelyVisitChild(_type, visitor);
12669 variables.accept(visitor); 12686 _variables.accept(visitor);
12670 } 12687 }
12671 12688
12672 Token get firstTokenAfterCommentAndMetadata { 12689 Token get firstTokenAfterCommentAndMetadata {
12673 if (keyword != null) { 12690 if (keyword != null) {
12674 return keyword; 12691 return keyword;
12675 } else if (_type != null) { 12692 } else if (_type != null) {
12676 return _type.beginToken; 12693 return _type.beginToken;
12677 } 12694 }
12678 return variables.beginToken; 12695 return _variables.beginToken;
12679 } 12696 }
12680 } 12697 }
12681 12698
12682 /** 12699 /**
12683 * Instances of the class `VariableDeclarationStatement` represent a list of var iables that 12700 * Instances of the class `VariableDeclarationStatement` represent a list of var iables that
12684 * are being declared in a context where a statement is required. 12701 * are being declared in a context where a statement is required.
12685 * 12702 *
12686 * <pre> 12703 * <pre>
12687 * variableDeclarationStatement ::= 12704 * variableDeclarationStatement ::=
12688 * [VariableDeclarationList] ';' 12705 * [VariableDeclarationList] ';'
(...skipping 11 matching lines...) Expand all
12700 * The semicolon terminating the statement. 12717 * The semicolon terminating the statement.
12701 */ 12718 */
12702 Token semicolon; 12719 Token semicolon;
12703 12720
12704 /** 12721 /**
12705 * Initialize a newly created variable declaration statement. 12722 * Initialize a newly created variable declaration statement.
12706 * 12723 *
12707 * @param variableList the fields being declared 12724 * @param variableList the fields being declared
12708 * @param semicolon the semicolon terminating the statement 12725 * @param semicolon the semicolon terminating the statement
12709 */ 12726 */
12710 VariableDeclarationStatement.full(VariableDeclarationList variableList, Token semicolon) { 12727 VariableDeclarationStatement.full(VariableDeclarationList variableList, this.s emicolon) {
12711 this._variableList = becomeParentOf(variableList); 12728 this._variableList = becomeParentOf(variableList);
12712 this.semicolon = semicolon;
12713 } 12729 }
12714 12730
12715 /** 12731 /**
12716 * Initialize a newly created variable declaration statement. 12732 * Initialize a newly created variable declaration statement.
12717 * 12733 *
12718 * @param variableList the fields being declared 12734 * @param variableList the fields being declared
12719 * @param semicolon the semicolon terminating the statement 12735 * @param semicolon the semicolon terminating the statement
12720 */ 12736 */
12721 VariableDeclarationStatement({VariableDeclarationList variableList, Token semi colon}) : this.full(variableList, semicolon); 12737 VariableDeclarationStatement({VariableDeclarationList variableList, Token semi colon}) : this.full(variableList, semicolon);
12722 12738
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
12785 12801
12786 /** 12802 /**
12787 * Initialize a newly created while statement. 12803 * Initialize a newly created while statement.
12788 * 12804 *
12789 * @param keyword the token representing the 'while' keyword 12805 * @param keyword the token representing the 'while' keyword
12790 * @param leftParenthesis the left parenthesis 12806 * @param leftParenthesis the left parenthesis
12791 * @param condition the expression used to determine whether to execute the bo dy of the loop 12807 * @param condition the expression used to determine whether to execute the bo dy of the loop
12792 * @param rightParenthesis the right parenthesis 12808 * @param rightParenthesis the right parenthesis
12793 * @param body the body of the loop 12809 * @param body the body of the loop
12794 */ 12810 */
12795 WhileStatement.full(Token keyword, Token leftParenthesis, Expression condition , Token rightParenthesis, Statement body) { 12811 WhileStatement.full(this.keyword, this.leftParenthesis, Expression condition, this.rightParenthesis, Statement body) {
12796 this.keyword = keyword;
12797 this.leftParenthesis = leftParenthesis;
12798 this._condition = becomeParentOf(condition); 12812 this._condition = becomeParentOf(condition);
12799 this.rightParenthesis = rightParenthesis;
12800 this._body = becomeParentOf(body); 12813 this._body = becomeParentOf(body);
12801 } 12814 }
12802 12815
12803 /** 12816 /**
12804 * Initialize a newly created while statement. 12817 * Initialize a newly created while statement.
12805 * 12818 *
12806 * @param keyword the token representing the 'while' keyword 12819 * @param keyword the token representing the 'while' keyword
12807 * @param leftParenthesis the left parenthesis 12820 * @param leftParenthesis the left parenthesis
12808 * @param condition the expression used to determine whether to execute the bo dy of the loop 12821 * @param condition the expression used to determine whether to execute the bo dy of the loop
12809 * @param rightParenthesis the right parenthesis 12822 * @param rightParenthesis the right parenthesis
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
12863 * withClause ::= 12876 * withClause ::=
12864 * 'with' [TypeName] (',' [TypeName])* 12877 * 'with' [TypeName] (',' [TypeName])*
12865 * </pre> 12878 * </pre>
12866 * 12879 *
12867 * @coverage dart.engine.ast 12880 * @coverage dart.engine.ast
12868 */ 12881 */
12869 class WithClause extends ASTNode { 12882 class WithClause extends ASTNode {
12870 /** 12883 /**
12871 * The token representing the 'with' keyword. 12884 * The token representing the 'with' keyword.
12872 */ 12885 */
12873 Token withKeyword; 12886 Token _withKeyword;
12874 12887
12875 /** 12888 /**
12876 * The names of the mixins that were specified. 12889 * The names of the mixins that were specified.
12877 */ 12890 */
12878 NodeList<TypeName> mixinTypes; 12891 NodeList<TypeName> _mixinTypes;
12879 12892
12880 /** 12893 /**
12881 * Initialize a newly created with clause. 12894 * Initialize a newly created with clause.
12882 * 12895 *
12883 * @param withKeyword the token representing the 'with' keyword 12896 * @param withKeyword the token representing the 'with' keyword
12884 * @param mixinTypes the names of the mixins that were specified 12897 * @param mixinTypes the names of the mixins that were specified
12885 */ 12898 */
12886 WithClause.full(Token withKeyword, List<TypeName> mixinTypes) { 12899 WithClause.full(Token withKeyword, List<TypeName> mixinTypes) {
12887 this.mixinTypes = new NodeList<TypeName>(this); 12900 this._mixinTypes = new NodeList<TypeName>(this);
12888 this.withKeyword = withKeyword; 12901 this._withKeyword = withKeyword;
12889 this.mixinTypes.addAll(mixinTypes); 12902 this._mixinTypes.addAll(mixinTypes);
12890 } 12903 }
12891 12904
12892 /** 12905 /**
12893 * Initialize a newly created with clause. 12906 * Initialize a newly created with clause.
12894 * 12907 *
12895 * @param withKeyword the token representing the 'with' keyword 12908 * @param withKeyword the token representing the 'with' keyword
12896 * @param mixinTypes the names of the mixins that were specified 12909 * @param mixinTypes the names of the mixins that were specified
12897 */ 12910 */
12898 WithClause({Token withKeyword, List<TypeName> mixinTypes}) : this.full(withKey word, mixinTypes); 12911 WithClause({Token withKeyword, List<TypeName> mixinTypes}) : this.full(withKey word, mixinTypes);
12899 12912
12900 accept(ASTVisitor visitor) => visitor.visitWithClause(this); 12913 accept(ASTVisitor visitor) => visitor.visitWithClause(this);
12901 12914
12902 Token get beginToken => withKeyword; 12915 Token get beginToken => _withKeyword;
12903 12916
12904 Token get endToken => mixinTypes.endToken; 12917 Token get endToken => _mixinTypes.endToken;
12918
12919 /**
12920 * Return the names of the mixins that were specified.
12921 *
12922 * @return the names of the mixins that were specified
12923 */
12924 NodeList<TypeName> get mixinTypes => _mixinTypes;
12925
12926 /**
12927 * Return the token representing the 'with' keyword.
12928 *
12929 * @return the token representing the 'with' keyword
12930 */
12931 Token get withKeyword => _withKeyword;
12905 12932
12906 /** 12933 /**
12907 * Set the token representing the 'with' keyword to the given token. 12934 * Set the token representing the 'with' keyword to the given token.
12908 * 12935 *
12909 * @param withKeyword the token representing the 'with' keyword 12936 * @param withKeyword the token representing the 'with' keyword
12910 */ 12937 */
12911 void set mixinKeyword(Token withKeyword) { 12938 void set mixinKeyword(Token withKeyword) {
12912 this.withKeyword = withKeyword; 12939 this._withKeyword = withKeyword;
12913 } 12940 }
12914 12941
12915 void visitChildren(ASTVisitor visitor) { 12942 void visitChildren(ASTVisitor visitor) {
12916 mixinTypes.accept(visitor); 12943 _mixinTypes.accept(visitor);
12917 } 12944 }
12918 } 12945 }
12919 12946
12920 /** 12947 /**
12921 * Instances of the class `BreadthFirstVisitor` implement an AST visitor that wi ll recursively 12948 * 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 12949 * 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 12950 * visitor uses a breadth-first ordering rather than the depth-first ordering of
12924 * [GeneralizingASTVisitor]. 12951 * [GeneralizingASTVisitor].
12925 * 12952 *
12926 * Subclasses that override a visit method must either invoke the overridden vis it method or 12953 * 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 13711
13685 /** 13712 /**
13686 * The end offset of the range used to identify the node. 13713 * The end offset of the range used to identify the node.
13687 */ 13714 */
13688 int _endOffset = 0; 13715 int _endOffset = 0;
13689 13716
13690 /** 13717 /**
13691 * The element that was found that corresponds to the given source range, or ` null` if there 13718 * The element that was found that corresponds to the given source range, or ` null` if there
13692 * is no such element. 13719 * is no such element.
13693 */ 13720 */
13694 ASTNode foundNode; 13721 ASTNode _foundNode;
13695 13722
13696 /** 13723 /**
13697 * Initialize a newly created locator to locate one or more [ASTNode] by locat ing 13724 * 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. 13725 * the node within an AST structure that corresponds to the given offset in th e source.
13699 * 13726 *
13700 * @param offset the offset used to identify the node 13727 * @param offset the offset used to identify the node
13701 */ 13728 */
13702 NodeLocator.con1(int offset) : this.con2(offset, offset); 13729 NodeLocator.con1(int offset) : this.con2(offset, offset);
13703 13730
13704 /** 13731 /**
13705 * Initialize a newly created locator to locate one or more [ASTNode] by locat ing 13732 * 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 13733 * the node within an AST structure that corresponds to the given range of cha racters in the
13707 * source. 13734 * source.
13708 * 13735 *
13709 * @param start the start offset of the range used to identify the node 13736 * @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 13737 * @param end the end offset of the range used to identify the node
13711 */ 13738 */
13712 NodeLocator.con2(int start, int end) { 13739 NodeLocator.con2(int start, int end) {
13713 this._startOffset = start; 13740 this._startOffset = start;
13714 this._endOffset = end; 13741 this._endOffset = end;
13715 } 13742 }
13716 13743
13717 /** 13744 /**
13745 * Return the node that was found that corresponds to the given source range, or `null` if
13746 * there is no such node.
13747 *
13748 * @return the node that was found
13749 */
13750 ASTNode get foundNode => _foundNode;
13751
13752 /**
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 13753 * 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. 13754 * no element was found.
13720 * 13755 *
13721 * @param node the AST node within which to search 13756 * @param node the AST node within which to search
13722 * @return the element that was found 13757 * @return the element that was found
13723 */ 13758 */
13724 ASTNode searchWithin(ASTNode node) { 13759 ASTNode searchWithin(ASTNode node) {
13725 if (node == null) { 13760 if (node == null) {
13726 return null; 13761 return null;
13727 } 13762 }
13728 try { 13763 try {
13729 node.accept(this); 13764 node.accept(this);
13730 } on NodeLocator_NodeFoundException catch (exception) { 13765 } on NodeLocator_NodeFoundException catch (exception) {
13731 } on JavaException catch (exception) { 13766 } on JavaException catch (exception) {
13732 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a t offset (${_startOffset} - ${_endOffset})", exception); 13767 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a t offset (${_startOffset} - ${_endOffset})", exception);
13733 return null; 13768 return null;
13734 } 13769 }
13735 return foundNode; 13770 return _foundNode;
13736 } 13771 }
13737 13772
13738 Object visitNode(ASTNode node) { 13773 Object visitNode(ASTNode node) {
13739 int start = node.offset; 13774 int start = node.offset;
13740 int end = start + node.length; 13775 int end = start + node.length;
13741 if (end < _startOffset) { 13776 if (end < _startOffset) {
13742 return null; 13777 return null;
13743 } 13778 }
13744 if (start > _endOffset) { 13779 if (start > _endOffset) {
13745 return null; 13780 return null;
13746 } 13781 }
13747 try { 13782 try {
13748 node.visitChildren(this); 13783 node.visitChildren(this);
13749 } on NodeLocator_NodeFoundException catch (exception) { 13784 } on NodeLocator_NodeFoundException catch (exception) {
13750 throw exception; 13785 throw exception;
13751 } on JavaException catch (exception) { 13786 } on JavaException catch (exception) {
13752 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra versing an AST structure.", exception); 13787 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra versing an AST structure.", exception);
13753 } 13788 }
13754 if (start <= _startOffset && _endOffset <= end) { 13789 if (start <= _startOffset && _endOffset <= end) {
13755 foundNode = node; 13790 _foundNode = node;
13756 throw new NodeLocator_NodeFoundException(); 13791 throw new NodeLocator_NodeFoundException();
13757 } 13792 }
13758 return null; 13793 return null;
13759 } 13794 }
13760 } 13795 }
13761 13796
13762 /** 13797 /**
13763 * Instances of the class `NodeFoundException` are used to cancel visiting after a node has 13798 * Instances of the class `NodeFoundException` are used to cancel visiting after a node has
13764 * been found. 13799 * been found.
13765 */ 13800 */
(...skipping 3209 matching lines...) Expand 10 before | Expand all | Expand 10 after
16975 17010
16976 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent.full(map(node.keyword), clone4(node.expression), map(node.semicolon)); 17011 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent.full(map(node.keyword), clone4(node.expression), map(node.semicolon));
16977 17012
16978 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag.full(map(node.script Tag)); 17013 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag.full(map(node.script Tag));
16979 17014
16980 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator. full(map(node.keyword), clone5(node.shownNames)); 17015 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator. full(map(node.keyword), clone5(node.shownNames));
16981 17016
16982 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter.full(clone4(node.documentationComment), clone5(node. metadata), map(node.keyword), clone4(node.type), clone4(node.identifier)); 17017 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter.full(clone4(node.documentationComment), clone5(node. metadata), map(node.keyword), clone4(node.type), clone4(node.identifier));
16983 17018
16984 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) { 17019 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
16985 SimpleIdentifier copy = new SimpleIdentifier.full(map(node.token)); 17020 Token mappedToken = map(node.token);
17021 if (mappedToken == null) {
17022 mappedToken = node.token;
17023 }
17024 SimpleIdentifier copy = new SimpleIdentifier.full(mappedToken);
16986 copy.auxiliaryElements = node.auxiliaryElements; 17025 copy.auxiliaryElements = node.auxiliaryElements;
16987 copy.propagatedElement = node.propagatedElement; 17026 copy.propagatedElement = node.propagatedElement;
16988 copy.propagatedType = node.propagatedType; 17027 copy.propagatedType = node.propagatedType;
16989 copy.staticElement = node.staticElement; 17028 copy.staticElement = node.staticElement;
16990 copy.staticType = node.staticType; 17029 copy.staticType = node.staticType;
16991 return copy; 17030 return copy;
16992 } 17031 }
16993 17032
16994 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) { 17033 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) {
16995 SimpleStringLiteral copy = new SimpleStringLiteral.full(map(node.literal), n ode.value); 17034 SimpleStringLiteral copy = new SimpleStringLiteral.full(map(node.literal), n ode.value);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
17109 * Traverse the AST from initial child node to successive parents, building a co llection of local 17148 * 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 17149 * 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. 17150 * first name seen is the most specific one so names are not redefined.
17112 * 17151 *
17113 * Completion test code coverage is 95%. The two basic blocks that are not execu ted cannot be 17152 * 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. 17153 * executed. They are included for future reference.
17115 * 17154 *
17116 * @coverage com.google.dart.engine.services.completion 17155 * @coverage com.google.dart.engine.services.completion
17117 */ 17156 */
17118 class ScopedNameFinder extends GeneralizingASTVisitor<Object> { 17157 class ScopedNameFinder extends GeneralizingASTVisitor<Object> {
17119 Declaration declaration; 17158 Declaration _declarationNode;
17120 17159
17121 ASTNode _immediateChild; 17160 ASTNode _immediateChild;
17122 17161
17123 final Map<String, SimpleIdentifier> locals = new Map<String, SimpleIdentifier> (); 17162 Map<String, SimpleIdentifier> _locals = new Map<String, SimpleIdentifier>();
17124 17163
17125 int _position = 0; 17164 int _position = 0;
17126 17165
17127 bool _referenceIsWithinLocalFunction = false; 17166 bool _referenceIsWithinLocalFunction = false;
17128 17167
17129 ScopedNameFinder(int position) { 17168 ScopedNameFinder(int position) {
17130 this._position = position; 17169 this._position = position;
17131 } 17170 }
17132 17171
17172 Declaration get declaration => _declarationNode;
17173
17174 Map<String, SimpleIdentifier> get locals => _locals;
17175
17133 Object visitBlock(Block node) { 17176 Object visitBlock(Block node) {
17134 checkStatements(node.statements); 17177 checkStatements(node.statements);
17135 return super.visitBlock(node); 17178 return super.visitBlock(node);
17136 } 17179 }
17137 17180
17138 Object visitCatchClause(CatchClause node) { 17181 Object visitCatchClause(CatchClause node) {
17139 addToScope(node.exceptionParameter); 17182 addToScope(node.exceptionParameter);
17140 addToScope(node.stackTraceParameter); 17183 addToScope(node.stackTraceParameter);
17141 return super.visitCatchClause(node); 17184 return super.visitCatchClause(node);
17142 } 17185 }
17143 17186
17144 Object visitConstructorDeclaration(ConstructorDeclaration node) { 17187 Object visitConstructorDeclaration(ConstructorDeclaration node) {
17145 if (_immediateChild != node.parameters) { 17188 if (_immediateChild != node.parameters) {
17146 addParameters(node.parameters.parameters); 17189 addParameters(node.parameters.parameters);
17147 } 17190 }
17148 declaration = node; 17191 _declarationNode = node;
17149 return null; 17192 return null;
17150 } 17193 }
17151 17194
17152 Object visitFieldDeclaration(FieldDeclaration node) { 17195 Object visitFieldDeclaration(FieldDeclaration node) {
17153 declaration = node; 17196 _declarationNode = node;
17154 return null; 17197 return null;
17155 } 17198 }
17156 17199
17157 Object visitForEachStatement(ForEachStatement node) { 17200 Object visitForEachStatement(ForEachStatement node) {
17158 DeclaredIdentifier loopVariable = node.loopVariable; 17201 DeclaredIdentifier loopVariable = node.loopVariable;
17159 if (loopVariable != null) { 17202 if (loopVariable != null) {
17160 addToScope(loopVariable.identifier); 17203 addToScope(loopVariable.identifier);
17161 } 17204 }
17162 return super.visitForEachStatement(node); 17205 return super.visitForEachStatement(node);
17163 } 17206 }
17164 17207
17165 Object visitForStatement(ForStatement node) { 17208 Object visitForStatement(ForStatement node) {
17166 if (_immediateChild != node.variables && node.variables != null) { 17209 if (_immediateChild != node.variables && node.variables != null) {
17167 addVariables(node.variables.variables); 17210 addVariables(node.variables.variables);
17168 } 17211 }
17169 return super.visitForStatement(node); 17212 return super.visitForStatement(node);
17170 } 17213 }
17171 17214
17172 Object visitFunctionDeclaration(FunctionDeclaration node) { 17215 Object visitFunctionDeclaration(FunctionDeclaration node) {
17173 if (node.parent is! FunctionDeclarationStatement) { 17216 if (node.parent is! FunctionDeclarationStatement) {
17174 declaration = node; 17217 _declarationNode = node;
17175 return null; 17218 return null;
17176 } 17219 }
17177 return super.visitFunctionDeclaration(node); 17220 return super.visitFunctionDeclaration(node);
17178 } 17221 }
17179 17222
17180 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { 17223 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
17181 _referenceIsWithinLocalFunction = true; 17224 _referenceIsWithinLocalFunction = true;
17182 return super.visitFunctionDeclarationStatement(node); 17225 return super.visitFunctionDeclarationStatement(node);
17183 } 17226 }
17184 17227
17185 Object visitFunctionExpression(FunctionExpression node) { 17228 Object visitFunctionExpression(FunctionExpression node) {
17186 if (node.parameters != null && _immediateChild != node.parameters) { 17229 if (node.parameters != null && _immediateChild != node.parameters) {
17187 addParameters(node.parameters.parameters); 17230 addParameters(node.parameters.parameters);
17188 } 17231 }
17189 return super.visitFunctionExpression(node); 17232 return super.visitFunctionExpression(node);
17190 } 17233 }
17191 17234
17192 Object visitMethodDeclaration(MethodDeclaration node) { 17235 Object visitMethodDeclaration(MethodDeclaration node) {
17193 declaration = node; 17236 _declarationNode = node;
17194 if (node.parameters == null) { 17237 if (node.parameters == null) {
17195 return null; 17238 return null;
17196 } 17239 }
17197 if (_immediateChild != node.parameters) { 17240 if (_immediateChild != node.parameters) {
17198 addParameters(node.parameters.parameters); 17241 addParameters(node.parameters.parameters);
17199 } 17242 }
17200 return null; 17243 return null;
17201 } 17244 }
17202 17245
17203 Object visitNode(ASTNode node) { 17246 Object visitNode(ASTNode node) {
17204 _immediateChild = node; 17247 _immediateChild = node;
17205 ASTNode parent = node.parent; 17248 ASTNode parent = node.parent;
17206 if (parent != null) { 17249 if (parent != null) {
17207 parent.accept(this); 17250 parent.accept(this);
17208 } 17251 }
17209 return null; 17252 return null;
17210 } 17253 }
17211 17254
17212 Object visitSwitchMember(SwitchMember node) { 17255 Object visitSwitchMember(SwitchMember node) {
17213 checkStatements(node.statements); 17256 checkStatements(node.statements);
17214 return super.visitSwitchMember(node); 17257 return super.visitSwitchMember(node);
17215 } 17258 }
17216 17259
17217 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { 17260 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
17218 declaration = node; 17261 _declarationNode = node;
17219 return null; 17262 return null;
17220 } 17263 }
17221 17264
17222 Object visitTypeAlias(TypeAlias node) { 17265 Object visitTypeAlias(TypeAlias node) {
17223 declaration = node; 17266 _declarationNode = node;
17224 return null; 17267 return null;
17225 } 17268 }
17226 17269
17227 void addParameters(NodeList<FormalParameter> vars) { 17270 void addParameters(NodeList<FormalParameter> vars) {
17228 for (FormalParameter var2 in vars) { 17271 for (FormalParameter var2 in vars) {
17229 addToScope(var2.identifier); 17272 addToScope(var2.identifier);
17230 } 17273 }
17231 } 17274 }
17232 17275
17233 void addToScope(SimpleIdentifier identifier) { 17276 void addToScope(SimpleIdentifier identifier) {
17234 if (identifier != null && isInRange(identifier)) { 17277 if (identifier != null && isInRange(identifier)) {
17235 String name = identifier.name; 17278 String name = identifier.name;
17236 if (!locals.containsKey(name)) { 17279 if (!_locals.containsKey(name)) {
17237 locals[name] = identifier; 17280 _locals[name] = identifier;
17238 } 17281 }
17239 } 17282 }
17240 } 17283 }
17241 17284
17242 void addVariables(NodeList<VariableDeclaration> vars) { 17285 void addVariables(NodeList<VariableDeclaration> vars) {
17243 for (VariableDeclaration var2 in vars) { 17286 for (VariableDeclaration var2 in vars) {
17244 addToScope(var2.name); 17287 addToScope(var2.name);
17245 } 17288 }
17246 } 17289 }
17247 17290
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
17382 } 17425 }
17383 void operator[]=(int index, E node) { 17426 void operator[]=(int index, E node) {
17384 if (index < 0 || index >= _elements.length) { 17427 if (index < 0 || index >= _elements.length) {
17385 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); 17428 throw new RangeError("Index: ${index}, Size: ${_elements.length}");
17386 } 17429 }
17387 owner.becomeParentOf(node); 17430 owner.becomeParentOf(node);
17388 _elements[index] = node; 17431 _elements[index] = node;
17389 } 17432 }
17390 int get length => _elements.length; 17433 int get length => _elements.length;
17391 } 17434 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698