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

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

Issue 2539243002: Transition analyzer and analysis_server to new astFactory; remove old AST factory methods. (Closed)
Patch Set: Update CHANGELOG Created 4 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Defines the AST model. The AST (Abstract Syntax Tree) model describes the 6 * Defines the AST model. The AST (Abstract Syntax Tree) model describes the
7 * syntactic (as opposed to semantic) structure of Dart code. The semantic 7 * syntactic (as opposed to semantic) structure of Dart code. The semantic
8 * structure of the code is modeled by the 8 * structure of the code is modeled by the
9 * [element model](../element/element.dart). 9 * [element model](../element/element.dart).
10 * 10 *
(...skipping 22 matching lines...) Expand all
33 * When an AST is resolved, the identifiers in the AST will be associated with 33 * When an AST is resolved, the identifiers in the AST will be associated with
34 * the elements that they refer to and every expression in the AST will have a 34 * the elements that they refer to and every expression in the AST will have a
35 * type associated with it. 35 * type associated with it.
36 */ 36 */
37 library analyzer.dart.ast.ast; 37 library analyzer.dart.ast.ast;
38 38
39 import 'package:analyzer/dart/ast/syntactic_entity.dart'; 39 import 'package:analyzer/dart/ast/syntactic_entity.dart';
40 import 'package:analyzer/dart/ast/token.dart'; 40 import 'package:analyzer/dart/ast/token.dart';
41 import 'package:analyzer/dart/element/element.dart'; 41 import 'package:analyzer/dart/element/element.dart';
42 import 'package:analyzer/dart/element/type.dart'; 42 import 'package:analyzer/dart/element/type.dart';
43 import 'package:analyzer/src/dart/ast/ast.dart';
44 import 'package:analyzer/src/dart/element/element.dart' show AuxiliaryElements; 43 import 'package:analyzer/src/dart/element/element.dart' show AuxiliaryElements;
45 import 'package:analyzer/src/generated/java_engine.dart'; 44 import 'package:analyzer/src/generated/java_engine.dart';
46 import 'package:analyzer/src/generated/source.dart' show LineInfo, Source; 45 import 'package:analyzer/src/generated/source.dart' show LineInfo, Source;
47 import 'package:analyzer/src/generated/utilities_dart.dart'; 46 import 'package:analyzer/src/generated/utilities_dart.dart';
48 47
49 /** 48 /**
50 * Two or more string literals that are implicitly concatenated because of being 49 * Two or more string literals that are implicitly concatenated because of being
51 * adjacent (separated only by whitespace). 50 * adjacent (separated only by whitespace).
52 * 51 *
53 * While the grammar only allows adjacent strings when all of the strings are of 52 * While the grammar only allows adjacent strings when all of the strings are of
54 * the same kind (single line or multi-line), this class doesn't enforce that 53 * the same kind (single line or multi-line), this class doesn't enforce that
55 * restriction. 54 * restriction.
56 * 55 *
57 * adjacentStrings ::= 56 * adjacentStrings ::=
58 * [StringLiteral] [StringLiteral]+ 57 * [StringLiteral] [StringLiteral]+
59 * 58 *
60 * Clients may not extend, implement or mix-in this class. 59 * Clients may not extend, implement or mix-in this class.
61 */ 60 */
62 abstract class AdjacentStrings extends StringLiteral { 61 abstract class AdjacentStrings extends StringLiteral {
63 /** 62 /**
64 * Initialize a newly created list of adjacent strings. To be syntactically
65 * valid, the list of [strings] must contain at least two elements.
66 */
67 factory AdjacentStrings(List<StringLiteral> strings) = AdjacentStringsImpl;
68
69 /**
70 * Return the strings that are implicitly concatenated. 63 * Return the strings that are implicitly concatenated.
71 */ 64 */
72 NodeList<StringLiteral> get strings; 65 NodeList<StringLiteral> get strings;
73 } 66 }
74 67
75 /** 68 /**
76 * An AST node that can be annotated with both a documentation comment and a 69 * An AST node that can be annotated with both a documentation comment and a
77 * list of annotations. 70 * list of annotations.
78 * 71 *
79 * Clients may not extend, implement or mix-in this class. 72 * Clients may not extend, implement or mix-in this class.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 * metadata ::= 107 * metadata ::=
115 * annotation* 108 * annotation*
116 * 109 *
117 * annotation ::= 110 * annotation ::=
118 * '@' [Identifier] ('.' [SimpleIdentifier])? [ArgumentList]? 111 * '@' [Identifier] ('.' [SimpleIdentifier])? [ArgumentList]?
119 * 112 *
120 * Clients may not extend, implement or mix-in this class. 113 * Clients may not extend, implement or mix-in this class.
121 */ 114 */
122 abstract class Annotation extends AstNode { 115 abstract class Annotation extends AstNode {
123 /** 116 /**
124 * Initialize a newly created annotation. Both the [period] and the
125 * [constructorName] can be `null` if the annotation is not referencing a
126 * named constructor. The [arguments] can be `null` if the annotation is not
127 * referencing a constructor.
128 */
129 factory Annotation(Token atSign, Identifier name, Token period,
130 SimpleIdentifier constructorName, ArgumentList arguments) =>
131 new AnnotationImpl(atSign, name, period, constructorName, arguments);
132
133 /**
134 * Return the arguments to the constructor being invoked, or `null` if this 117 * Return the arguments to the constructor being invoked, or `null` if this
135 * annotation is not the invocation of a constructor. 118 * annotation is not the invocation of a constructor.
136 */ 119 */
137 ArgumentList get arguments; 120 ArgumentList get arguments;
138 121
139 /** 122 /**
140 * Set the arguments to the constructor being invoked to the given [arguments] . 123 * Set the arguments to the constructor being invoked to the given [arguments] .
141 */ 124 */
142 void set arguments(ArgumentList arguments); 125 void set arguments(ArgumentList arguments);
143 126
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 * '(' arguments? ')' 200 * '(' arguments? ')'
218 * 201 *
219 * arguments ::= 202 * arguments ::=
220 * [NamedExpression] (',' [NamedExpression])* 203 * [NamedExpression] (',' [NamedExpression])*
221 * | [Expression] (',' [Expression])* (',' [NamedExpression])* 204 * | [Expression] (',' [Expression])* (',' [NamedExpression])*
222 * 205 *
223 * Clients may not extend, implement or mix-in this class. 206 * Clients may not extend, implement or mix-in this class.
224 */ 207 */
225 abstract class ArgumentList extends AstNode { 208 abstract class ArgumentList extends AstNode {
226 /** 209 /**
227 * Initialize a newly created list of arguments. The list of [arguments] can
228 * be `null` if there are no arguments.
229 */
230 factory ArgumentList(Token leftParenthesis, List<Expression> arguments,
231 Token rightParenthesis) = ArgumentListImpl;
232
233 /**
234 * Return the expressions producing the values of the arguments. Although the 210 * Return the expressions producing the values of the arguments. Although the
235 * language requires that positional arguments appear before named arguments, 211 * language requires that positional arguments appear before named arguments,
236 * this class allows them to be intermixed. 212 * this class allows them to be intermixed.
237 */ 213 */
238 NodeList<Expression> get arguments; 214 NodeList<Expression> get arguments;
239 215
240 /** 216 /**
241 * Set the parameter elements corresponding to each of the arguments in this 217 * Set the parameter elements corresponding to each of the arguments in this
242 * list to the given list of [parameters]. The list of parameters must be the 218 * list to the given list of [parameters]. The list of parameters must be the
243 * same length as the number of arguments, but can contain `null` entries if a 219 * same length as the number of arguments, but can contain `null` entries if a
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 /** 253 /**
278 * An as expression. 254 * An as expression.
279 * 255 *
280 * asExpression ::= 256 * asExpression ::=
281 * [Expression] 'as' [TypeName] 257 * [Expression] 'as' [TypeName]
282 * 258 *
283 * Clients may not extend, implement or mix-in this class. 259 * Clients may not extend, implement or mix-in this class.
284 */ 260 */
285 abstract class AsExpression extends Expression { 261 abstract class AsExpression extends Expression {
286 /** 262 /**
287 * Initialize a newly created as expression.
288 */
289 factory AsExpression(
290 Expression expression, Token asOperator, TypeName type) =>
291 new AsExpressionImpl(expression, asOperator, type);
292
293 /**
294 * Return the 'as' operator. 263 * Return the 'as' operator.
295 */ 264 */
296 Token get asOperator; 265 Token get asOperator;
297 266
298 /** 267 /**
299 * Set the 'as' operator to the given [token]. 268 * Set the 'as' operator to the given [token].
300 */ 269 */
301 void set asOperator(Token token); 270 void set asOperator(Token token);
302 271
303 /** 272 /**
(...skipping 19 matching lines...) Expand all
323 } 292 }
324 293
325 /** 294 /**
326 * An assert in the initializer list of a constructor. 295 * An assert in the initializer list of a constructor.
327 * 296 *
328 * assertInitializer ::= 297 * assertInitializer ::=
329 * 'assert' '(' [Expression] (',' [Expression])? ')' 298 * 'assert' '(' [Expression] (',' [Expression])? ')'
330 * 299 *
331 * Clients may not extend, implement or mix-in this class. 300 * Clients may not extend, implement or mix-in this class.
332 */ 301 */
333 abstract class AssertInitializer implements Assertion, ConstructorInitializer { 302 abstract class AssertInitializer implements Assertion, ConstructorInitializer {}
334 /**
335 * Initialize a newly created assert initializer. The [comma] and [message]
336 * can be `null` if there is no message.
337 */
338 factory AssertInitializer(
339 Token assertKeyword,
340 Token leftParenthesis,
341 Expression condition,
342 Token comma,
343 Expression message,
344 Token rightParenthesis) =>
345 new AssertInitializerImpl(assertKeyword, leftParenthesis, condition,
346 comma, message, rightParenthesis);
347 }
348 303
349 /** 304 /**
350 * An assertion, either in a block or in the initializer list of a constructor. 305 * An assertion, either in a block or in the initializer list of a constructor.
351 * 306 *
352 * Clients may not extend, implement or mix-in this class. 307 * Clients may not extend, implement or mix-in this class.
353 */ 308 */
354 abstract class Assertion implements AstNode { 309 abstract class Assertion implements AstNode {
355 /** 310 /**
356 * Return the token representing the 'assert' keyword. 311 * Return the token representing the 'assert' keyword.
357 */ 312 */
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 /** 376 /**
422 * An assert statement. 377 * An assert statement.
423 * 378 *
424 * assertStatement ::= 379 * assertStatement ::=
425 * 'assert' '(' [Expression] (',' [Expression])? ')' ';' 380 * 'assert' '(' [Expression] (',' [Expression])? ')' ';'
426 * 381 *
427 * Clients may not extend, implement or mix-in this class. 382 * Clients may not extend, implement or mix-in this class.
428 */ 383 */
429 abstract class AssertStatement implements Assertion, Statement { 384 abstract class AssertStatement implements Assertion, Statement {
430 /** 385 /**
431 * Initialize a newly created assert statement. The [comma] and [message] can
432 * be `null` if there is no message.
433 */
434 factory AssertStatement(
435 Token assertKeyword,
436 Token leftParenthesis,
437 Expression condition,
438 Token comma,
439 Expression message,
440 Token rightParenthesis,
441 Token semicolon) =>
442 new AssertStatementImpl(assertKeyword, leftParenthesis, condition, comma,
443 message, rightParenthesis, semicolon);
444
445 /**
446 * Return the semicolon terminating the statement. 386 * Return the semicolon terminating the statement.
447 */ 387 */
448 Token get semicolon; 388 Token get semicolon;
449 389
450 /** 390 /**
451 * Set the semicolon terminating the statement to the given [token]. 391 * Set the semicolon terminating the statement to the given [token].
452 */ 392 */
453 void set semicolon(Token token); 393 void set semicolon(Token token);
454 } 394 }
455 395
456 /** 396 /**
457 * An assignment expression. 397 * An assignment expression.
458 * 398 *
459 * assignmentExpression ::= 399 * assignmentExpression ::=
460 * [Expression] operator [Expression] 400 * [Expression] operator [Expression]
461 * 401 *
462 * Clients may not extend, implement or mix-in this class. 402 * Clients may not extend, implement or mix-in this class.
463 */ 403 */
464 abstract class AssignmentExpression extends Expression 404 abstract class AssignmentExpression extends Expression
465 implements MethodReferenceExpression { 405 implements MethodReferenceExpression {
466 /** 406 /**
467 * Initialize a newly created assignment expression.
468 */
469 factory AssignmentExpression(
470 Expression leftHandSide, Token operator, Expression rightHandSide) =>
471 new AssignmentExpressionImpl(leftHandSide, operator, rightHandSide);
472
473 /**
474 * Return the expression used to compute the left hand side. 407 * Return the expression used to compute the left hand side.
475 */ 408 */
476 Expression get leftHandSide; 409 Expression get leftHandSide;
477 410
478 /** 411 /**
479 * Return the expression used to compute the left hand side. 412 * Return the expression used to compute the left hand side.
480 */ 413 */
481 void set leftHandSide(Expression expression); 414 void set leftHandSide(Expression expression);
482 415
483 /** 416 /**
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 /** 782 /**
850 * An await expression. 783 * An await expression.
851 * 784 *
852 * awaitExpression ::= 785 * awaitExpression ::=
853 * 'await' [Expression] 786 * 'await' [Expression]
854 * 787 *
855 * Clients may not extend, implement or mix-in this class. 788 * Clients may not extend, implement or mix-in this class.
856 */ 789 */
857 abstract class AwaitExpression extends Expression { 790 abstract class AwaitExpression extends Expression {
858 /** 791 /**
859 * Initialize a newly created await expression.
860 */
861 factory AwaitExpression(Token awaitKeyword, Expression expression) =>
862 new AwaitExpressionImpl(awaitKeyword, expression);
863
864 /**
865 * Return the 'await' keyword. 792 * Return the 'await' keyword.
866 */ 793 */
867 Token get awaitKeyword; 794 Token get awaitKeyword;
868 795
869 /** 796 /**
870 * Set the 'await' keyword to the given [token]. 797 * Set the 'await' keyword to the given [token].
871 */ 798 */
872 void set awaitKeyword(Token token); 799 void set awaitKeyword(Token token);
873 800
874 /** 801 /**
(...skipping 11 matching lines...) Expand all
886 * A binary (infix) expression. 813 * A binary (infix) expression.
887 * 814 *
888 * binaryExpression ::= 815 * binaryExpression ::=
889 * [Expression] [Token] [Expression] 816 * [Expression] [Token] [Expression]
890 * 817 *
891 * Clients may not extend, implement or mix-in this class. 818 * Clients may not extend, implement or mix-in this class.
892 */ 819 */
893 abstract class BinaryExpression extends Expression 820 abstract class BinaryExpression extends Expression
894 implements MethodReferenceExpression { 821 implements MethodReferenceExpression {
895 /** 822 /**
896 * Initialize a newly created binary expression.
897 */
898 factory BinaryExpression(
899 Expression leftOperand, Token operator, Expression rightOperand) =>
900 new BinaryExpressionImpl(leftOperand, operator, rightOperand);
901
902 /**
903 * Return the expression used to compute the left operand. 823 * Return the expression used to compute the left operand.
904 */ 824 */
905 Expression get leftOperand; 825 Expression get leftOperand;
906 826
907 /** 827 /**
908 * Set the expression used to compute the left operand to the given 828 * Set the expression used to compute the left operand to the given
909 * [expression]. 829 * [expression].
910 */ 830 */
911 void set leftOperand(Expression expression); 831 void set leftOperand(Expression expression);
912 832
(...skipping 22 matching lines...) Expand all
935 /** 855 /**
936 * A sequence of statements. 856 * A sequence of statements.
937 * 857 *
938 * block ::= 858 * block ::=
939 * '{' statement* '}' 859 * '{' statement* '}'
940 * 860 *
941 * Clients may not extend, implement or mix-in this class. 861 * Clients may not extend, implement or mix-in this class.
942 */ 862 */
943 abstract class Block extends Statement { 863 abstract class Block extends Statement {
944 /** 864 /**
945 * Initialize a newly created block of code.
946 */
947 factory Block(
948 Token leftBracket, List<Statement> statements, Token rightBracket) =>
949 new BlockImpl(leftBracket, statements, rightBracket);
950
951 /**
952 * Return the left curly bracket. 865 * Return the left curly bracket.
953 */ 866 */
954 Token get leftBracket; 867 Token get leftBracket;
955 868
956 /** 869 /**
957 * Set the left curly bracket to the given [token]. 870 * Set the left curly bracket to the given [token].
958 */ 871 */
959 void set leftBracket(Token token); 872 void set leftBracket(Token token);
960 873
961 /** 874 /**
(...skipping 15 matching lines...) Expand all
977 /** 890 /**
978 * A function body that consists of a block of statements. 891 * A function body that consists of a block of statements.
979 * 892 *
980 * blockFunctionBody ::= 893 * blockFunctionBody ::=
981 * ('async' | 'async' '*' | 'sync' '*')? [Block] 894 * ('async' | 'async' '*' | 'sync' '*')? [Block]
982 * 895 *
983 * Clients may not extend, implement or mix-in this class. 896 * Clients may not extend, implement or mix-in this class.
984 */ 897 */
985 abstract class BlockFunctionBody extends FunctionBody { 898 abstract class BlockFunctionBody extends FunctionBody {
986 /** 899 /**
987 * Initialize a newly created function body consisting of a block of
988 * statements. The [keyword] can be `null` if there is no keyword specified
989 * for the block. The [star] can be `null` if there is no star following the
990 * keyword (and must be `null` if there is no keyword).
991 */
992 factory BlockFunctionBody(Token keyword, Token star, Block block) =>
993 new BlockFunctionBodyImpl(keyword, star, block);
994
995 /**
996 * Return the block representing the body of the function. 900 * Return the block representing the body of the function.
997 */ 901 */
998 Block get block; 902 Block get block;
999 903
1000 /** 904 /**
1001 * Set the block representing the body of the function to the given [block]. 905 * Set the block representing the body of the function to the given [block].
1002 */ 906 */
1003 void set block(Block block); 907 void set block(Block block);
1004 908
1005 /** 909 /**
(...skipping 10 matching lines...) Expand all
1016 /** 920 /**
1017 * A boolean literal expression. 921 * A boolean literal expression.
1018 * 922 *
1019 * booleanLiteral ::= 923 * booleanLiteral ::=
1020 * 'false' | 'true' 924 * 'false' | 'true'
1021 * 925 *
1022 * Clients may not extend, implement or mix-in this class. 926 * Clients may not extend, implement or mix-in this class.
1023 */ 927 */
1024 abstract class BooleanLiteral extends Literal { 928 abstract class BooleanLiteral extends Literal {
1025 /** 929 /**
1026 * Initialize a newly created boolean literal.
1027 */
1028 factory BooleanLiteral(Token literal, bool value) = BooleanLiteralImpl;
1029
1030 /**
1031 * Return the token representing the literal. 930 * Return the token representing the literal.
1032 */ 931 */
1033 Token get literal; 932 Token get literal;
1034 933
1035 /** 934 /**
1036 * Set the token representing the literal to the given [token]. 935 * Set the token representing the literal to the given [token].
1037 */ 936 */
1038 void set literal(Token token); 937 void set literal(Token token);
1039 938
1040 /** 939 /**
1041 * Return the value of the literal. 940 * Return the value of the literal.
1042 */ 941 */
1043 bool get value; 942 bool get value;
1044 } 943 }
1045 944
1046 /** 945 /**
1047 * A break statement. 946 * A break statement.
1048 * 947 *
1049 * breakStatement ::= 948 * breakStatement ::=
1050 * 'break' [SimpleIdentifier]? ';' 949 * 'break' [SimpleIdentifier]? ';'
1051 * 950 *
1052 * Clients may not extend, implement or mix-in this class. 951 * Clients may not extend, implement or mix-in this class.
1053 */ 952 */
1054 abstract class BreakStatement extends Statement { 953 abstract class BreakStatement extends Statement {
1055 /** 954 /**
1056 * Initialize a newly created break statement. The [label] can be `null` if
1057 * there is no label associated with the statement.
1058 */
1059 factory BreakStatement(
1060 Token breakKeyword, SimpleIdentifier label, Token semicolon) =>
1061 new BreakStatementImpl(breakKeyword, label, semicolon);
1062
1063 /**
1064 * Return the token representing the 'break' keyword. 955 * Return the token representing the 'break' keyword.
1065 */ 956 */
1066 Token get breakKeyword; 957 Token get breakKeyword;
1067 958
1068 /** 959 /**
1069 * Set the token representing the 'break' keyword to the given [token]. 960 * Set the token representing the 'break' keyword to the given [token].
1070 */ 961 */
1071 void set breakKeyword(Token token); 962 void set breakKeyword(Token token);
1072 963
1073 /** 964 /**
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 * (assignmentOperator expressionWithoutCascade)? 1013 * (assignmentOperator expressionWithoutCascade)?
1123 * 1014 *
1124 * cascadeSelector ::= 1015 * cascadeSelector ::=
1125 * '[ ' expression '] ' 1016 * '[ ' expression '] '
1126 * | identifier 1017 * | identifier
1127 * 1018 *
1128 * Clients may not extend, implement or mix-in this class. 1019 * Clients may not extend, implement or mix-in this class.
1129 */ 1020 */
1130 abstract class CascadeExpression extends Expression { 1021 abstract class CascadeExpression extends Expression {
1131 /** 1022 /**
1132 * Initialize a newly created cascade expression. The list of
1133 * [cascadeSections] must contain at least one element.
1134 */
1135 factory CascadeExpression(
1136 Expression target, List<Expression> cascadeSections) =>
1137 new CascadeExpressionImpl(target, cascadeSections);
1138
1139 /**
1140 * Return the cascade sections sharing the common target. 1023 * Return the cascade sections sharing the common target.
1141 */ 1024 */
1142 NodeList<Expression> get cascadeSections; 1025 NodeList<Expression> get cascadeSections;
1143 1026
1144 /** 1027 /**
1145 * Return the target of the cascade sections. 1028 * Return the target of the cascade sections.
1146 */ 1029 */
1147 Expression get target; 1030 Expression get target;
1148 1031
1149 /** 1032 /**
1150 * Set the target of the cascade sections to the given [target]. 1033 * Set the target of the cascade sections to the given [target].
1151 */ 1034 */
1152 void set target(Expression target); 1035 void set target(Expression target);
1153 } 1036 }
1154 1037
1155 /** 1038 /**
1156 * A catch clause within a try statement. 1039 * A catch clause within a try statement.
1157 * 1040 *
1158 * onPart ::= 1041 * onPart ::=
1159 * catchPart [Block] 1042 * catchPart [Block]
1160 * | 'on' type catchPart? [Block] 1043 * | 'on' type catchPart? [Block]
1161 * 1044 *
1162 * catchPart ::= 1045 * catchPart ::=
1163 * 'catch' '(' [SimpleIdentifier] (',' [SimpleIdentifier])? ')' 1046 * 'catch' '(' [SimpleIdentifier] (',' [SimpleIdentifier])? ')'
1164 * 1047 *
1165 * Clients may not extend, implement or mix-in this class. 1048 * Clients may not extend, implement or mix-in this class.
1166 */ 1049 */
1167 abstract class CatchClause extends AstNode { 1050 abstract class CatchClause extends AstNode {
1168 /** 1051 /**
1169 * Initialize a newly created catch clause. The [onKeyword] and
1170 * [exceptionType] can be `null` if the clause will catch all exceptions. The
1171 * [comma] and [stackTraceParameter] can be `null` if the stack trace
1172 * parameter is not defined.
1173 */
1174 factory CatchClause(
1175 Token onKeyword,
1176 TypeName exceptionType,
1177 Token catchKeyword,
1178 Token leftParenthesis,
1179 SimpleIdentifier exceptionParameter,
1180 Token comma,
1181 SimpleIdentifier stackTraceParameter,
1182 Token rightParenthesis,
1183 Block body) =>
1184 new CatchClauseImpl(
1185 onKeyword,
1186 exceptionType,
1187 catchKeyword,
1188 leftParenthesis,
1189 exceptionParameter,
1190 comma,
1191 stackTraceParameter,
1192 rightParenthesis,
1193 body);
1194
1195 /**
1196 * Return the body of the catch block. 1052 * Return the body of the catch block.
1197 */ 1053 */
1198 Block get body; 1054 Block get body;
1199 1055
1200 /** 1056 /**
1201 * Set the body of the catch block to the given [block]. 1057 * Set the body of the catch block to the given [block].
1202 */ 1058 */
1203 void set body(Block block); 1059 void set body(Block block);
1204 1060
1205 /** 1061 /**
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 * classDeclaration ::= 1155 * classDeclaration ::=
1300 * 'abstract'? 'class' [SimpleIdentifier] [TypeParameterList]? 1156 * 'abstract'? 'class' [SimpleIdentifier] [TypeParameterList]?
1301 * ([ExtendsClause] [WithClause]?)? 1157 * ([ExtendsClause] [WithClause]?)?
1302 * [ImplementsClause]? 1158 * [ImplementsClause]?
1303 * '{' [ClassMember]* '}' 1159 * '{' [ClassMember]* '}'
1304 * 1160 *
1305 * Clients may not extend, implement or mix-in this class. 1161 * Clients may not extend, implement or mix-in this class.
1306 */ 1162 */
1307 abstract class ClassDeclaration extends NamedCompilationUnitMember { 1163 abstract class ClassDeclaration extends NamedCompilationUnitMember {
1308 /** 1164 /**
1309 * Initialize a newly created class declaration. Either or both of the
1310 * [comment] and [metadata] can be `null` if the class does not have the
1311 * corresponding attribute. The [abstractKeyword] can be `null` if the class
1312 * is not abstract. The [typeParameters] can be `null` if the class does not
1313 * have any type parameters. Any or all of the [extendsClause], [withClause],
1314 * and [implementsClause] can be `null` if the class does not have the
1315 * corresponding clause. The list of [members] can be `null` if the class does
1316 * not have any members.
1317 */
1318 factory ClassDeclaration(
1319 Comment comment,
1320 List<Annotation> metadata,
1321 Token abstractKeyword,
1322 Token classKeyword,
1323 SimpleIdentifier name,
1324 TypeParameterList typeParameters,
1325 ExtendsClause extendsClause,
1326 WithClause withClause,
1327 ImplementsClause implementsClause,
1328 Token leftBracket,
1329 List<ClassMember> members,
1330 Token rightBracket) =>
1331 new ClassDeclarationImpl(
1332 comment,
1333 metadata,
1334 abstractKeyword,
1335 classKeyword,
1336 name,
1337 typeParameters,
1338 extendsClause,
1339 withClause,
1340 implementsClause,
1341 leftBracket,
1342 members,
1343 rightBracket);
1344
1345 /**
1346 * Return the 'abstract' keyword, or `null` if the keyword was absent. 1165 * Return the 'abstract' keyword, or `null` if the keyword was absent.
1347 */ 1166 */
1348 Token get abstractKeyword; 1167 Token get abstractKeyword;
1349 1168
1350 /** 1169 /**
1351 * Set the 'abstract' keyword to the given [token]. 1170 * Set the 'abstract' keyword to the given [token].
1352 */ 1171 */
1353 void set abstractKeyword(Token token); 1172 void set abstractKeyword(Token token);
1354 1173
1355 /** 1174 /**
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 * classTypeAlias ::= 1302 * classTypeAlias ::=
1484 * [SimpleIdentifier] [TypeParameterList]? '=' 'abstract'? mixinApplicati on 1303 * [SimpleIdentifier] [TypeParameterList]? '=' 'abstract'? mixinApplicati on
1485 * 1304 *
1486 * mixinApplication ::= 1305 * mixinApplication ::=
1487 * [TypeName] [WithClause] [ImplementsClause]? ';' 1306 * [TypeName] [WithClause] [ImplementsClause]? ';'
1488 * 1307 *
1489 * Clients may not extend, implement or mix-in this class. 1308 * Clients may not extend, implement or mix-in this class.
1490 */ 1309 */
1491 abstract class ClassTypeAlias extends TypeAlias { 1310 abstract class ClassTypeAlias extends TypeAlias {
1492 /** 1311 /**
1493 * Initialize a newly created class type alias. Either or both of the
1494 * [comment] and [metadata] can be `null` if the class type alias does not
1495 * have the corresponding attribute. The [typeParameters] can be `null` if the
1496 * class does not have any type parameters. The [abstractKeyword] can be
1497 * `null` if the class is not abstract. The [implementsClause] can be `null`
1498 * if the class does not implement any interfaces.
1499 */
1500 factory ClassTypeAlias(
1501 Comment comment,
1502 List<Annotation> metadata,
1503 Token keyword,
1504 SimpleIdentifier name,
1505 TypeParameterList typeParameters,
1506 Token equals,
1507 Token abstractKeyword,
1508 TypeName superclass,
1509 WithClause withClause,
1510 ImplementsClause implementsClause,
1511 Token semicolon) =>
1512 new ClassTypeAliasImpl(
1513 comment,
1514 metadata,
1515 keyword,
1516 name,
1517 typeParameters,
1518 equals,
1519 abstractKeyword,
1520 superclass,
1521 withClause,
1522 implementsClause,
1523 semicolon);
1524
1525 /**
1526 * Return the token for the 'abstract' keyword, or `null` if this is not 1312 * Return the token for the 'abstract' keyword, or `null` if this is not
1527 * defining an abstract class. 1313 * defining an abstract class.
1528 */ 1314 */
1529 Token get abstractKeyword; 1315 Token get abstractKeyword;
1530 1316
1531 /** 1317 /**
1532 * Set the token for the 'abstract' keyword to the given [token]. 1318 * Set the token for the 'abstract' keyword to the given [token].
1533 */ 1319 */
1534 void set abstractKeyword(Token token); 1320 void set abstractKeyword(Token token);
1535 1321
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 * '/ *' CHARACTER* '&#42;/' 1417 * '/ *' CHARACTER* '&#42;/'
1632 * 1418 *
1633 * documentationComment ::= 1419 * documentationComment ::=
1634 * '/ **' (CHARACTER | [CommentReference])* '&#42;/' 1420 * '/ **' (CHARACTER | [CommentReference])* '&#42;/'
1635 * | ('///' (CHARACTER - EOL)* EOL)+ 1421 * | ('///' (CHARACTER - EOL)* EOL)+
1636 * 1422 *
1637 * Clients may not extend, implement or mix-in this class. 1423 * Clients may not extend, implement or mix-in this class.
1638 */ 1424 */
1639 abstract class Comment extends AstNode { 1425 abstract class Comment extends AstNode {
1640 /** 1426 /**
1641 * Initialize a newly created comment. The list of [tokens] must contain at
1642 * least one token. The [type] is the type of the comment. The list of
1643 * [references] can be empty if the comment does not contain any embedded
1644 * references.
1645 */
1646 factory Comment(List<Token> tokens, CommentType type,
1647 List<CommentReference> references) = CommentImpl;
1648
1649 /**
1650 * Return `true` if this is a block comment. 1427 * Return `true` if this is a block comment.
1651 */ 1428 */
1652 bool get isBlock; 1429 bool get isBlock;
1653 1430
1654 /** 1431 /**
1655 * Return `true` if this is a documentation comment. 1432 * Return `true` if this is a documentation comment.
1656 */ 1433 */
1657 bool get isDocumentation; 1434 bool get isDocumentation;
1658 1435
1659 /** 1436 /**
1660 * Return `true` if this is an end-of-line comment. 1437 * Return `true` if this is an end-of-line comment.
1661 */ 1438 */
1662 bool get isEndOfLine; 1439 bool get isEndOfLine;
1663 1440
1664 /** 1441 /**
1665 * Return the references embedded within the documentation comment. 1442 * Return the references embedded within the documentation comment.
1666 */ 1443 */
1667 NodeList<CommentReference> get references; 1444 NodeList<CommentReference> get references;
1668 1445
1669 /** 1446 /**
1670 * Return the tokens representing the comment. 1447 * Return the tokens representing the comment.
1671 */ 1448 */
1672 List<Token> get tokens; 1449 List<Token> get tokens;
1673
1674 /**
1675 * Create a block comment consisting of the given [tokens].
1676 */
1677 static Comment createBlockComment(List<Token> tokens) =>
1678 CommentImpl.createBlockComment(tokens);
1679
1680 /**
1681 * Create a documentation comment consisting of the given [tokens].
1682 */
1683 static Comment createDocumentationComment(List<Token> tokens) =>
1684 CommentImpl.createDocumentationComment(tokens);
1685
1686 /**
1687 * Create a documentation comment consisting of the given [tokens] and having
1688 * the given [references] embedded within it.
1689 */
1690 static Comment createDocumentationCommentWithReferences(
1691 List<Token> tokens, List<CommentReference> references) =>
1692 CommentImpl.createDocumentationCommentWithReferences(tokens, references);
1693
1694 /**
1695 * Create an end-of-line comment consisting of the given [tokens].
1696 */
1697 static Comment createEndOfLineComment(List<Token> tokens) =>
1698 CommentImpl.createEndOfLineComment(tokens);
1699 } 1450 }
1700 1451
1701 /** 1452 /**
1702 * A reference to a Dart element that is found within a documentation comment. 1453 * A reference to a Dart element that is found within a documentation comment.
1703 * 1454 *
1704 * commentReference ::= 1455 * commentReference ::=
1705 * '[' 'new'? [Identifier] ']' 1456 * '[' 'new'? [Identifier] ']'
1706 * 1457 *
1707 * Clients may not extend, implement or mix-in this class. 1458 * Clients may not extend, implement or mix-in this class.
1708 */ 1459 */
1709 abstract class CommentReference extends AstNode { 1460 abstract class CommentReference extends AstNode {
1710 /** 1461 /**
1711 * Initialize a newly created reference to a Dart element. The [newKeyword]
1712 * can be `null` if the reference is not to a constructor.
1713 */
1714 factory CommentReference(Token newKeyword, Identifier identifier) =>
1715 new CommentReferenceImpl(newKeyword, identifier);
1716
1717 /**
1718 * Return the identifier being referenced. 1462 * Return the identifier being referenced.
1719 */ 1463 */
1720 Identifier get identifier; 1464 Identifier get identifier;
1721 1465
1722 /** 1466 /**
1723 * Set the identifier being referenced to the given [identifier]. 1467 * Set the identifier being referenced to the given [identifier].
1724 */ 1468 */
1725 void set identifier(Identifier identifier); 1469 void set identifier(Identifier identifier);
1726 1470
1727 /** 1471 /**
(...skipping 28 matching lines...) Expand all
1756 * [ImportDirective] 1500 * [ImportDirective]
1757 * | [ExportDirective] 1501 * | [ExportDirective]
1758 * 1502 *
1759 * declarations ::= 1503 * declarations ::=
1760 * [CompilationUnitMember]* 1504 * [CompilationUnitMember]*
1761 * 1505 *
1762 * Clients may not extend, implement or mix-in this class. 1506 * Clients may not extend, implement or mix-in this class.
1763 */ 1507 */
1764 abstract class CompilationUnit extends AstNode { 1508 abstract class CompilationUnit extends AstNode {
1765 /** 1509 /**
1766 * Initialize a newly created compilation unit to have the given directives
1767 * and declarations. The [scriptTag] can be `null` if there is no script tag
1768 * in the compilation unit. The list of [directives] can be `null` if there
1769 * are no directives in the compilation unit. The list of [declarations] can
1770 * be `null` if there are no declarations in the compilation unit.
1771 */
1772 factory CompilationUnit(
1773 Token beginToken,
1774 ScriptTag scriptTag,
1775 List<Directive> directives,
1776 List<CompilationUnitMember> declarations,
1777 Token endToken) =>
1778 new CompilationUnitImpl(
1779 beginToken, scriptTag, directives, declarations, endToken);
1780
1781 /**
1782 * Set the first token included in this node's source range to the given 1510 * Set the first token included in this node's source range to the given
1783 * [token]. 1511 * [token].
1784 */ 1512 */
1785 void set beginToken(Token token); 1513 void set beginToken(Token token);
1786 1514
1787 /** 1515 /**
1788 * Return the declarations contained in this compilation unit. 1516 * Return the declarations contained in this compilation unit.
1789 */ 1517 */
1790 NodeList<CompilationUnitMember> get declarations; 1518 NodeList<CompilationUnitMember> get declarations;
1791 1519
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1860 /** 1588 /**
1861 * A conditional expression. 1589 * A conditional expression.
1862 * 1590 *
1863 * conditionalExpression ::= 1591 * conditionalExpression ::=
1864 * [Expression] '?' [Expression] ':' [Expression] 1592 * [Expression] '?' [Expression] ':' [Expression]
1865 * 1593 *
1866 * Clients may not extend, implement or mix-in this class. 1594 * Clients may not extend, implement or mix-in this class.
1867 */ 1595 */
1868 abstract class ConditionalExpression extends Expression { 1596 abstract class ConditionalExpression extends Expression {
1869 /** 1597 /**
1870 * Initialize a newly created conditional expression.
1871 */
1872 factory ConditionalExpression(Expression condition, Token question,
1873 Expression thenExpression, Token colon, Expression elseExpression) =>
1874 new ConditionalExpressionImpl(
1875 condition, question, thenExpression, colon, elseExpression);
1876
1877 /**
1878 * Return the token used to separate the then expression from the else 1598 * Return the token used to separate the then expression from the else
1879 * expression. 1599 * expression.
1880 */ 1600 */
1881 Token get colon; 1601 Token get colon;
1882 1602
1883 /** 1603 /**
1884 * Set the token used to separate the then expression from the else expression 1604 * Set the token used to separate the then expression from the else expression
1885 * to the given [token]. 1605 * to the given [token].
1886 */ 1606 */
1887 void set colon(Token token); 1607 void set colon(Token token);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1943 * test ::= 1663 * test ::=
1944 * dottedName ('==' stringLiteral)? 1664 * dottedName ('==' stringLiteral)?
1945 * 1665 *
1946 * dottedName ::= 1666 * dottedName ::=
1947 * identifier ('.' identifier)* 1667 * identifier ('.' identifier)*
1948 * 1668 *
1949 * Clients may not extend, implement or mix-in this class. 1669 * Clients may not extend, implement or mix-in this class.
1950 */ 1670 */
1951 abstract class Configuration extends AstNode { 1671 abstract class Configuration extends AstNode {
1952 /** 1672 /**
1953 * Initialize a newly created configuration.
1954 */
1955 factory Configuration(
1956 Token ifKeyword,
1957 Token leftParenthesis,
1958 DottedName name,
1959 Token equalToken,
1960 StringLiteral value,
1961 Token rightParenthesis,
1962 StringLiteral libraryUri) =>
1963 new ConfigurationImpl(ifKeyword, leftParenthesis, name, equalToken, value,
1964 rightParenthesis, libraryUri);
1965
1966 /**
1967 * Return the token for the equal operator, or `null` if the condition does 1673 * Return the token for the equal operator, or `null` if the condition does
1968 * not include an equality test. 1674 * not include an equality test.
1969 */ 1675 */
1970 Token get equalToken; 1676 Token get equalToken;
1971 1677
1972 /** 1678 /**
1973 * Set the token for the equal operator to the given [token]. 1679 * Set the token for the equal operator to the given [token].
1974 */ 1680 */
1975 void set equalToken(Token token); 1681 void set equalToken(Token token);
1976 1682
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
2083 * factoryName ::= 1789 * factoryName ::=
2084 * [Identifier] ('.' [SimpleIdentifier])? 1790 * [Identifier] ('.' [SimpleIdentifier])?
2085 * 1791 *
2086 * initializerList ::= 1792 * initializerList ::=
2087 * ':' [ConstructorInitializer] (',' [ConstructorInitializer])* 1793 * ':' [ConstructorInitializer] (',' [ConstructorInitializer])*
2088 * 1794 *
2089 * Clients may not extend, implement or mix-in this class. 1795 * Clients may not extend, implement or mix-in this class.
2090 */ 1796 */
2091 abstract class ConstructorDeclaration extends ClassMember { 1797 abstract class ConstructorDeclaration extends ClassMember {
2092 /** 1798 /**
2093 * Initialize a newly created constructor declaration. The [externalKeyword]
2094 * can be `null` if the constructor is not external. Either or both of the
2095 * [comment] and [metadata] can be `null` if the constructor does not have the
2096 * corresponding attribute. The [constKeyword] can be `null` if the
2097 * constructor cannot be used to create a constant. The [factoryKeyword] can
2098 * be `null` if the constructor is not a factory. The [period] and [name] can
2099 * both be `null` if the constructor is not a named constructor. The
2100 * [separator] can be `null` if the constructor does not have any initializers
2101 * and does not redirect to a different constructor. The list of
2102 * [initializers] can be `null` if the constructor does not have any
2103 * initializers. The [redirectedConstructor] can be `null` if the constructor
2104 * does not redirect to a different constructor. The [body] can be `null` if
2105 * the constructor does not have a body.
2106 */
2107 factory ConstructorDeclaration(
2108 Comment comment,
2109 List<Annotation> metadata,
2110 Token externalKeyword,
2111 Token constKeyword,
2112 Token factoryKeyword,
2113 Identifier returnType,
2114 Token period,
2115 SimpleIdentifier name,
2116 FormalParameterList parameters,
2117 Token separator,
2118 List<ConstructorInitializer> initializers,
2119 ConstructorName redirectedConstructor,
2120 FunctionBody body) =>
2121 new ConstructorDeclarationImpl(
2122 comment,
2123 metadata,
2124 externalKeyword,
2125 constKeyword,
2126 factoryKeyword,
2127 returnType,
2128 period,
2129 name,
2130 parameters,
2131 separator,
2132 initializers,
2133 redirectedConstructor,
2134 body);
2135
2136 /**
2137 * Return the body of the constructor, or `null` if the constructor does not 1799 * Return the body of the constructor, or `null` if the constructor does not
2138 * have a body. 1800 * have a body.
2139 */ 1801 */
2140 FunctionBody get body; 1802 FunctionBody get body;
2141 1803
2142 /** 1804 /**
2143 * Set the body of the constructor to the given [functionBody]. 1805 * Set the body of the constructor to the given [functionBody].
2144 */ 1806 */
2145 void set body(FunctionBody functionBody); 1807 void set body(FunctionBody functionBody);
2146 1808
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2264 /** 1926 /**
2265 * The initialization of a field within a constructor's initialization list. 1927 * The initialization of a field within a constructor's initialization list.
2266 * 1928 *
2267 * fieldInitializer ::= 1929 * fieldInitializer ::=
2268 * ('this' '.')? [SimpleIdentifier] '=' [Expression] 1930 * ('this' '.')? [SimpleIdentifier] '=' [Expression]
2269 * 1931 *
2270 * Clients may not extend, implement or mix-in this class. 1932 * Clients may not extend, implement or mix-in this class.
2271 */ 1933 */
2272 abstract class ConstructorFieldInitializer extends ConstructorInitializer { 1934 abstract class ConstructorFieldInitializer extends ConstructorInitializer {
2273 /** 1935 /**
2274 * Initialize a newly created field initializer to initialize the field with
2275 * the given name to the value of the given expression. The [thisKeyword] and
2276 * [period] can be `null` if the 'this' keyword was not specified.
2277 */
2278 factory ConstructorFieldInitializer(Token thisKeyword, Token period,
2279 SimpleIdentifier fieldName, Token equals, Expression expression) =>
2280 new ConstructorFieldInitializerImpl(
2281 thisKeyword, period, fieldName, equals, expression);
2282
2283 /**
2284 * Return the token for the equal sign between the field name and the 1936 * Return the token for the equal sign between the field name and the
2285 * expression. 1937 * expression.
2286 */ 1938 */
2287 Token get equals; 1939 Token get equals;
2288 1940
2289 /** 1941 /**
2290 * Set the token for the equal sign between the field name and the 1942 * Set the token for the equal sign between the field name and the
2291 * expression to the given [token]. 1943 * expression to the given [token].
2292 */ 1944 */
2293 void set equals(Token token); 1945 void set equals(Token token);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2353 * The name of a constructor. 2005 * The name of a constructor.
2354 * 2006 *
2355 * constructorName ::= 2007 * constructorName ::=
2356 * type ('.' identifier)? 2008 * type ('.' identifier)?
2357 * 2009 *
2358 * Clients may not extend, implement or mix-in this class. 2010 * Clients may not extend, implement or mix-in this class.
2359 */ 2011 */
2360 abstract class ConstructorName extends AstNode 2012 abstract class ConstructorName extends AstNode
2361 implements ConstructorReferenceNode { 2013 implements ConstructorReferenceNode {
2362 /** 2014 /**
2363 * Initialize a newly created constructor name. The [period] and [name] can be
2364 * `null` if the constructor being named is the unnamed constructor.
2365 */
2366 factory ConstructorName(TypeName type, Token period, SimpleIdentifier name) =>
2367 new ConstructorNameImpl(type, period, name);
2368
2369 /**
2370 * Return the name of the constructor, or `null` if the specified constructor 2015 * Return the name of the constructor, or `null` if the specified constructor
2371 * is the unnamed constructor. 2016 * is the unnamed constructor.
2372 */ 2017 */
2373 SimpleIdentifier get name; 2018 SimpleIdentifier get name;
2374 2019
2375 /** 2020 /**
2376 * Set the name of the constructor to the given [name]. 2021 * Set the name of the constructor to the given [name].
2377 */ 2022 */
2378 void set name(SimpleIdentifier name); 2023 void set name(SimpleIdentifier name);
2379 2024
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
2423 /** 2068 /**
2424 * A continue statement. 2069 * A continue statement.
2425 * 2070 *
2426 * continueStatement ::= 2071 * continueStatement ::=
2427 * 'continue' [SimpleIdentifier]? ';' 2072 * 'continue' [SimpleIdentifier]? ';'
2428 * 2073 *
2429 * Clients may not extend, implement or mix-in this class. 2074 * Clients may not extend, implement or mix-in this class.
2430 */ 2075 */
2431 abstract class ContinueStatement extends Statement { 2076 abstract class ContinueStatement extends Statement {
2432 /** 2077 /**
2433 * Initialize a newly created continue statement. The [label] can be `null` if
2434 * there is no label associated with the statement.
2435 */
2436 factory ContinueStatement(
2437 Token continueKeyword, SimpleIdentifier label, Token semicolon) =>
2438 new ContinueStatementImpl(continueKeyword, label, semicolon);
2439
2440 /**
2441 * Return the token representing the 'continue' keyword. 2078 * Return the token representing the 'continue' keyword.
2442 */ 2079 */
2443 Token get continueKeyword; 2080 Token get continueKeyword;
2444 2081
2445 /** 2082 /**
2446 * Set the token representing the 'continue' keyword to the given [token]. 2083 * Set the token representing the 'continue' keyword to the given [token].
2447 */ 2084 */
2448 void set continueKeyword(Token token); 2085 void set continueKeyword(Token token);
2449 2086
2450 /** 2087 /**
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2502 2139
2503 /** 2140 /**
2504 * The declaration of a single identifier. 2141 * The declaration of a single identifier.
2505 * 2142 *
2506 * declaredIdentifier ::= 2143 * declaredIdentifier ::=
2507 * [Annotation] finalConstVarOrType [SimpleIdentifier] 2144 * [Annotation] finalConstVarOrType [SimpleIdentifier]
2508 * 2145 *
2509 * Clients may not extend, implement or mix-in this class. 2146 * Clients may not extend, implement or mix-in this class.
2510 */ 2147 */
2511 abstract class DeclaredIdentifier extends Declaration { 2148 abstract class DeclaredIdentifier extends Declaration {
2512 /**
2513 * Initialize a newly created formal parameter. Either or both of the
2514 * [comment] and [metadata] can be `null` if the declaration does not have the
2515 * corresponding attribute. The [keyword] can be `null` if a type name is
2516 * given. The [type] must be `null` if the keyword is 'var'.
2517 */
2518 factory DeclaredIdentifier(Comment comment, List<Annotation> metadata,
2519 Token keyword, TypeName type, SimpleIdentifier identifier) =>
2520 new DeclaredIdentifierImpl(comment, metadata, keyword, type, identifier);
2521
2522 @override 2149 @override
2523 LocalVariableElement get element; 2150 LocalVariableElement get element;
2524 2151
2525 /** 2152 /**
2526 * Return the name of the variable being declared. 2153 * Return the name of the variable being declared.
2527 */ 2154 */
2528 SimpleIdentifier get identifier; 2155 SimpleIdentifier get identifier;
2529 2156
2530 /** 2157 /**
2531 * Set the name of the variable being declared to the given [identifier]. 2158 * Set the name of the variable being declared to the given [identifier].
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
2576 * defaultFormalParameter ::= 2203 * defaultFormalParameter ::=
2577 * [NormalFormalParameter] ('=' [Expression])? 2204 * [NormalFormalParameter] ('=' [Expression])?
2578 * 2205 *
2579 * defaultNamedParameter ::= 2206 * defaultNamedParameter ::=
2580 * [NormalFormalParameter] (':' [Expression])? 2207 * [NormalFormalParameter] (':' [Expression])?
2581 * 2208 *
2582 * Clients may not extend, implement or mix-in this class. 2209 * Clients may not extend, implement or mix-in this class.
2583 */ 2210 */
2584 abstract class DefaultFormalParameter extends FormalParameter { 2211 abstract class DefaultFormalParameter extends FormalParameter {
2585 /** 2212 /**
2586 * Initialize a newly created default formal parameter. The [separator] and
2587 * [defaultValue] can be `null` if there is no default value.
2588 */
2589 factory DefaultFormalParameter(NormalFormalParameter parameter,
2590 ParameterKind kind, Token separator, Expression defaultValue) =>
2591 new DefaultFormalParameterImpl(parameter, kind, separator, defaultValue);
2592
2593 /**
2594 * Return the expression computing the default value for the parameter, or 2213 * Return the expression computing the default value for the parameter, or
2595 * `null` if there is no default value. 2214 * `null` if there is no default value.
2596 */ 2215 */
2597 Expression get defaultValue; 2216 Expression get defaultValue;
2598 2217
2599 /** 2218 /**
2600 * Set the expression computing the default value for the parameter to the 2219 * Set the expression computing the default value for the parameter to the
2601 * given [expression]. 2220 * given [expression].
2602 */ 2221 */
2603 void set defaultValue(Expression expression); 2222 void set defaultValue(Expression expression);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
2665 /** 2284 /**
2666 * A do statement. 2285 * A do statement.
2667 * 2286 *
2668 * doStatement ::= 2287 * doStatement ::=
2669 * 'do' [Statement] 'while' '(' [Expression] ')' ';' 2288 * 'do' [Statement] 'while' '(' [Expression] ')' ';'
2670 * 2289 *
2671 * Clients may not extend, implement or mix-in this class. 2290 * Clients may not extend, implement or mix-in this class.
2672 */ 2291 */
2673 abstract class DoStatement extends Statement { 2292 abstract class DoStatement extends Statement {
2674 /** 2293 /**
2675 * Initialize a newly created do loop.
2676 */
2677 factory DoStatement(
2678 Token doKeyword,
2679 Statement body,
2680 Token whileKeyword,
2681 Token leftParenthesis,
2682 Expression condition,
2683 Token rightParenthesis,
2684 Token semicolon) =>
2685 new DoStatementImpl(doKeyword, body, whileKeyword, leftParenthesis,
2686 condition, rightParenthesis, semicolon);
2687
2688 /**
2689 * Return the body of the loop. 2294 * Return the body of the loop.
2690 */ 2295 */
2691 Statement get body; 2296 Statement get body;
2692 2297
2693 /** 2298 /**
2694 * Set the body of the loop to the given [statement]. 2299 * Set the body of the loop to the given [statement].
2695 */ 2300 */
2696 void set body(Statement statement); 2301 void set body(Statement statement);
2697 2302
2698 /** 2303 /**
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
2760 /** 2365 /**
2761 * A dotted name, used in a configuration within an import or export directive. 2366 * A dotted name, used in a configuration within an import or export directive.
2762 * 2367 *
2763 * dottedName ::= 2368 * dottedName ::=
2764 * [SimpleIdentifier] ('.' [SimpleIdentifier])* 2369 * [SimpleIdentifier] ('.' [SimpleIdentifier])*
2765 * 2370 *
2766 * Clients may not extend, implement or mix-in this class. 2371 * Clients may not extend, implement or mix-in this class.
2767 */ 2372 */
2768 abstract class DottedName extends AstNode { 2373 abstract class DottedName extends AstNode {
2769 /** 2374 /**
2770 * Initialize a newly created dotted name.
2771 */
2772 factory DottedName(List<SimpleIdentifier> components) = DottedNameImpl;
2773
2774 /**
2775 * Return the components of the identifier. 2375 * Return the components of the identifier.
2776 */ 2376 */
2777 NodeList<SimpleIdentifier> get components; 2377 NodeList<SimpleIdentifier> get components;
2778 } 2378 }
2779 2379
2780 /** 2380 /**
2781 * A floating point literal expression. 2381 * A floating point literal expression.
2782 * 2382 *
2783 * doubleLiteral ::= 2383 * doubleLiteral ::=
2784 * decimalDigit+ ('.' decimalDigit*)? exponent? 2384 * decimalDigit+ ('.' decimalDigit*)? exponent?
2785 * | '.' decimalDigit+ exponent? 2385 * | '.' decimalDigit+ exponent?
2786 * 2386 *
2787 * exponent ::= 2387 * exponent ::=
2788 * ('e' | 'E') ('+' | '-')? decimalDigit+ 2388 * ('e' | 'E') ('+' | '-')? decimalDigit+
2789 * 2389 *
2790 * Clients may not extend, implement or mix-in this class. 2390 * Clients may not extend, implement or mix-in this class.
2791 */ 2391 */
2792 abstract class DoubleLiteral extends Literal { 2392 abstract class DoubleLiteral extends Literal {
2793 /** 2393 /**
2794 * Initialize a newly created floating point literal.
2795 */
2796 factory DoubleLiteral(Token literal, double value) = DoubleLiteralImpl;
2797
2798 /**
2799 * Return the token representing the literal. 2394 * Return the token representing the literal.
2800 */ 2395 */
2801 Token get literal; 2396 Token get literal;
2802 2397
2803 /** 2398 /**
2804 * Set the token representing the literal to the given [token]. 2399 * Set the token representing the literal to the given [token].
2805 */ 2400 */
2806 void set literal(Token token); 2401 void set literal(Token token);
2807 2402
2808 /** 2403 /**
(...skipping 11 matching lines...) Expand all
2820 * An empty function body, which can only appear in constructors or abstract 2415 * An empty function body, which can only appear in constructors or abstract
2821 * methods. 2416 * methods.
2822 * 2417 *
2823 * emptyFunctionBody ::= 2418 * emptyFunctionBody ::=
2824 * ';' 2419 * ';'
2825 * 2420 *
2826 * Clients may not extend, implement or mix-in this class. 2421 * Clients may not extend, implement or mix-in this class.
2827 */ 2422 */
2828 abstract class EmptyFunctionBody extends FunctionBody { 2423 abstract class EmptyFunctionBody extends FunctionBody {
2829 /** 2424 /**
2830 * Initialize a newly created function body.
2831 */
2832 factory EmptyFunctionBody(Token semicolon) = EmptyFunctionBodyImpl;
2833
2834 /**
2835 * Return the token representing the semicolon that marks the end of the 2425 * Return the token representing the semicolon that marks the end of the
2836 * function body. 2426 * function body.
2837 */ 2427 */
2838 Token get semicolon; 2428 Token get semicolon;
2839 2429
2840 /** 2430 /**
2841 * Set the token representing the semicolon that marks the end of the 2431 * Set the token representing the semicolon that marks the end of the
2842 * function body to the given [token]. 2432 * function body to the given [token].
2843 */ 2433 */
2844 void set semicolon(Token token); 2434 void set semicolon(Token token);
2845 } 2435 }
2846 2436
2847 /** 2437 /**
2848 * An empty statement. 2438 * An empty statement.
2849 * 2439 *
2850 * emptyStatement ::= 2440 * emptyStatement ::=
2851 * ';' 2441 * ';'
2852 * 2442 *
2853 * Clients may not extend, implement or mix-in this class. 2443 * Clients may not extend, implement or mix-in this class.
2854 */ 2444 */
2855 abstract class EmptyStatement extends Statement { 2445 abstract class EmptyStatement extends Statement {
2856 /** 2446 /**
2857 * Initialize a newly created empty statement.
2858 */
2859 factory EmptyStatement(Token semicolon) = EmptyStatementImpl;
2860
2861 /**
2862 * Return the semicolon terminating the statement. 2447 * Return the semicolon terminating the statement.
2863 */ 2448 */
2864 Token get semicolon; 2449 Token get semicolon;
2865 2450
2866 /** 2451 /**
2867 * Set the semicolon terminating the statement to the given [token]. 2452 * Set the semicolon terminating the statement to the given [token].
2868 */ 2453 */
2869 void set semicolon(Token token); 2454 void set semicolon(Token token);
2870 } 2455 }
2871 2456
2872 /** 2457 /**
2873 * The declaration of an enum constant. 2458 * The declaration of an enum constant.
2874 * 2459 *
2875 * Clients may not extend, implement or mix-in this class. 2460 * Clients may not extend, implement or mix-in this class.
2876 */ 2461 */
2877 abstract class EnumConstantDeclaration extends Declaration { 2462 abstract class EnumConstantDeclaration extends Declaration {
2878 /** 2463 /**
2879 * Initialize a newly created enum constant declaration. Either or both of the
2880 * [comment] and [metadata] can be `null` if the constant does not have the
2881 * corresponding attribute. (Technically, enum constants cannot have metadata,
2882 * but we allow it for consistency.)
2883 */
2884 factory EnumConstantDeclaration(
2885 Comment comment, List<Annotation> metadata, SimpleIdentifier name) =>
2886 new EnumConstantDeclarationImpl(comment, metadata, name);
2887
2888 /**
2889 * Return the name of the constant. 2464 * Return the name of the constant.
2890 */ 2465 */
2891 SimpleIdentifier get name; 2466 SimpleIdentifier get name;
2892 2467
2893 /** 2468 /**
2894 * Set the name of the constant to the given [name]. 2469 * Set the name of the constant to the given [name].
2895 */ 2470 */
2896 void set name(SimpleIdentifier name); 2471 void set name(SimpleIdentifier name);
2897 } 2472 }
2898 2473
2899 /** 2474 /**
2900 * The declaration of an enumeration. 2475 * The declaration of an enumeration.
2901 * 2476 *
2902 * enumType ::= 2477 * enumType ::=
2903 * metadata 'enum' [SimpleIdentifier] '{' [SimpleIdentifier] (',' [Simple Identifier])* (',')? '}' 2478 * metadata 'enum' [SimpleIdentifier] '{' [SimpleIdentifier] (',' [Simple Identifier])* (',')? '}'
2904 * 2479 *
2905 * Clients may not extend, implement or mix-in this class. 2480 * Clients may not extend, implement or mix-in this class.
2906 */ 2481 */
2907 abstract class EnumDeclaration extends NamedCompilationUnitMember { 2482 abstract class EnumDeclaration extends NamedCompilationUnitMember {
2908 /** 2483 /**
2909 * Initialize a newly created enumeration declaration. Either or both of the
2910 * [comment] and [metadata] can be `null` if the declaration does not have the
2911 * corresponding attribute. The list of [constants] must contain at least one
2912 * value.
2913 */
2914 factory EnumDeclaration(
2915 Comment comment,
2916 List<Annotation> metadata,
2917 Token enumKeyword,
2918 SimpleIdentifier name,
2919 Token leftBracket,
2920 List<EnumConstantDeclaration> constants,
2921 Token rightBracket) =>
2922 new EnumDeclarationImpl(comment, metadata, enumKeyword, name, leftBracket,
2923 constants, rightBracket);
2924
2925 /**
2926 * Return the enumeration constants being declared. 2484 * Return the enumeration constants being declared.
2927 */ 2485 */
2928 NodeList<EnumConstantDeclaration> get constants; 2486 NodeList<EnumConstantDeclaration> get constants;
2929 2487
2930 @override 2488 @override
2931 ClassElement get element; 2489 ClassElement get element;
2932 2490
2933 /** 2491 /**
2934 * Return the 'enum' keyword. 2492 * Return the 'enum' keyword.
2935 */ 2493 */
(...skipping 26 matching lines...) Expand all
2962 } 2520 }
2963 2521
2964 /** 2522 /**
2965 * An export directive. 2523 * An export directive.
2966 * 2524 *
2967 * exportDirective ::= 2525 * exportDirective ::=
2968 * [Annotation] 'export' [StringLiteral] [Combinator]* ';' 2526 * [Annotation] 'export' [StringLiteral] [Combinator]* ';'
2969 * 2527 *
2970 * Clients may not extend, implement or mix-in this class. 2528 * Clients may not extend, implement or mix-in this class.
2971 */ 2529 */
2972 abstract class ExportDirective extends NamespaceDirective { 2530 abstract class ExportDirective extends NamespaceDirective {}
2973 /**
2974 * Initialize a newly created export directive. Either or both of the
2975 * [comment] and [metadata] can be `null` if the directive does not have the
2976 * corresponding attribute. The list of [combinators] can be `null` if there
2977 * are no combinators.
2978 */
2979 factory ExportDirective(
2980 Comment comment,
2981 List<Annotation> metadata,
2982 Token keyword,
2983 StringLiteral libraryUri,
2984 List<Configuration> configurations,
2985 List<Combinator> combinators,
2986 Token semicolon) =>
2987 new ExportDirectiveImpl(comment, metadata, keyword, libraryUri,
2988 configurations, combinators, semicolon);
2989 }
2990 2531
2991 /** 2532 /**
2992 * A node that represents an expression. 2533 * A node that represents an expression.
2993 * 2534 *
2994 * expression ::= 2535 * expression ::=
2995 * [AssignmentExpression] 2536 * [AssignmentExpression]
2996 * | [ConditionalExpression] cascadeSection* 2537 * | [ConditionalExpression] cascadeSection*
2997 * | [ThrowExpression] 2538 * | [ThrowExpression]
2998 * 2539 *
2999 * Clients may not extend, implement or mix-in this class. 2540 * Clients may not extend, implement or mix-in this class.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
3092 /** 2633 /**
3093 * A function body consisting of a single expression. 2634 * A function body consisting of a single expression.
3094 * 2635 *
3095 * expressionFunctionBody ::= 2636 * expressionFunctionBody ::=
3096 * 'async'? '=>' [Expression] ';' 2637 * 'async'? '=>' [Expression] ';'
3097 * 2638 *
3098 * Clients may not extend, implement or mix-in this class. 2639 * Clients may not extend, implement or mix-in this class.
3099 */ 2640 */
3100 abstract class ExpressionFunctionBody extends FunctionBody { 2641 abstract class ExpressionFunctionBody extends FunctionBody {
3101 /** 2642 /**
3102 * Initialize a newly created function body consisting of a block of
3103 * statements. The [keyword] can be `null` if the function body is not an
3104 * async function body.
3105 */
3106 factory ExpressionFunctionBody(Token keyword, Token functionDefinition,
3107 Expression expression, Token semicolon) =>
3108 new ExpressionFunctionBodyImpl(
3109 keyword, functionDefinition, expression, semicolon);
3110
3111 /**
3112 * Return the expression representing the body of the function. 2643 * Return the expression representing the body of the function.
3113 */ 2644 */
3114 Expression get expression; 2645 Expression get expression;
3115 2646
3116 /** 2647 /**
3117 * Set the expression representing the body of the function to the given 2648 * Set the expression representing the body of the function to the given
3118 * [expression]. 2649 * [expression].
3119 */ 2650 */
3120 void set expression(Expression expression); 2651 void set expression(Expression expression);
3121 2652
(...skipping 28 matching lines...) Expand all
3150 /** 2681 /**
3151 * An expression used as a statement. 2682 * An expression used as a statement.
3152 * 2683 *
3153 * expressionStatement ::= 2684 * expressionStatement ::=
3154 * [Expression]? ';' 2685 * [Expression]? ';'
3155 * 2686 *
3156 * Clients may not extend, implement or mix-in this class. 2687 * Clients may not extend, implement or mix-in this class.
3157 */ 2688 */
3158 abstract class ExpressionStatement extends Statement { 2689 abstract class ExpressionStatement extends Statement {
3159 /** 2690 /**
3160 * Initialize a newly created expression statement.
3161 */
3162 factory ExpressionStatement(Expression expression, Token semicolon) =>
3163 new ExpressionStatementImpl(expression, semicolon);
3164
3165 /**
3166 * Return the expression that comprises the statement. 2691 * Return the expression that comprises the statement.
3167 */ 2692 */
3168 Expression get expression; 2693 Expression get expression;
3169 2694
3170 /** 2695 /**
3171 * Set the expression that comprises the statement to the given [expression]. 2696 * Set the expression that comprises the statement to the given [expression].
3172 */ 2697 */
3173 void set expression(Expression expression); 2698 void set expression(Expression expression);
3174 2699
3175 /** 2700 /**
(...skipping 11 matching lines...) Expand all
3187 /** 2712 /**
3188 * The "extends" clause in a class declaration. 2713 * The "extends" clause in a class declaration.
3189 * 2714 *
3190 * extendsClause ::= 2715 * extendsClause ::=
3191 * 'extends' [TypeName] 2716 * 'extends' [TypeName]
3192 * 2717 *
3193 * Clients may not extend, implement or mix-in this class. 2718 * Clients may not extend, implement or mix-in this class.
3194 */ 2719 */
3195 abstract class ExtendsClause extends AstNode { 2720 abstract class ExtendsClause extends AstNode {
3196 /** 2721 /**
3197 * Initialize a newly created extends clause.
3198 */
3199 factory ExtendsClause(Token extendsKeyword, TypeName superclass) =>
3200 new ExtendsClauseImpl(extendsKeyword, superclass);
3201
3202 /**
3203 * Return the token representing the 'extends' keyword. 2722 * Return the token representing the 'extends' keyword.
3204 */ 2723 */
3205 Token get extendsKeyword; 2724 Token get extendsKeyword;
3206 2725
3207 /** 2726 /**
3208 * Set the token representing the 'extends' keyword to the given [token]. 2727 * Set the token representing the 'extends' keyword to the given [token].
3209 */ 2728 */
3210 void set extendsKeyword(Token token); 2729 void set extendsKeyword(Token token);
3211 2730
3212 /** 2731 /**
(...skipping 10 matching lines...) Expand all
3223 /** 2742 /**
3224 * The declaration of one or more fields of the same type. 2743 * The declaration of one or more fields of the same type.
3225 * 2744 *
3226 * fieldDeclaration ::= 2745 * fieldDeclaration ::=
3227 * 'static'? [VariableDeclarationList] ';' 2746 * 'static'? [VariableDeclarationList] ';'
3228 * 2747 *
3229 * Clients may not extend, implement or mix-in this class. 2748 * Clients may not extend, implement or mix-in this class.
3230 */ 2749 */
3231 abstract class FieldDeclaration extends ClassMember { 2750 abstract class FieldDeclaration extends ClassMember {
3232 /** 2751 /**
3233 * Initialize a newly created field declaration. Either or both of the
3234 * [comment] and [metadata] can be `null` if the declaration does not have the
3235 * corresponding attribute. The [staticKeyword] can be `null` if the field is
3236 * not a static field.
3237 */
3238 factory FieldDeclaration(
3239 Comment comment,
3240 List<Annotation> metadata,
3241 Token staticKeyword,
3242 VariableDeclarationList fieldList,
3243 Token semicolon) =>
3244 new FieldDeclarationImpl(
3245 comment, metadata, staticKeyword, fieldList, semicolon);
3246
3247 /**
3248 * Return the fields being declared. 2752 * Return the fields being declared.
3249 */ 2753 */
3250 VariableDeclarationList get fields; 2754 VariableDeclarationList get fields;
3251 2755
3252 /** 2756 /**
3253 * Set the fields being declared to the given list of [fields]. 2757 * Set the fields being declared to the given list of [fields].
3254 */ 2758 */
3255 void set fields(VariableDeclarationList fields); 2759 void set fields(VariableDeclarationList fields);
3256 2760
3257 /** 2761 /**
(...skipping 27 matching lines...) Expand all
3285 * A field formal parameter. 2789 * A field formal parameter.
3286 * 2790 *
3287 * fieldFormalParameter ::= 2791 * fieldFormalParameter ::=
3288 * ('final' [TypeName] | 'const' [TypeName] | 'var' | [TypeName])? 2792 * ('final' [TypeName] | 'const' [TypeName] | 'var' | [TypeName])?
3289 * 'this' '.' [SimpleIdentifier] ([TypeParameterList]? [FormalParameterLi st])? 2793 * 'this' '.' [SimpleIdentifier] ([TypeParameterList]? [FormalParameterLi st])?
3290 * 2794 *
3291 * Clients may not extend, implement or mix-in this class. 2795 * Clients may not extend, implement or mix-in this class.
3292 */ 2796 */
3293 abstract class FieldFormalParameter extends NormalFormalParameter { 2797 abstract class FieldFormalParameter extends NormalFormalParameter {
3294 /** 2798 /**
3295 * Initialize a newly created formal parameter. Either or both of the
3296 * [comment] and [metadata] can be `null` if the parameter does not have the
3297 * corresponding attribute. The [keyword] can be `null` if there is a type.
3298 * The [type] must be `null` if the keyword is 'var'. The [thisKeyword] and
3299 * [period] can be `null` if the keyword 'this' was not provided. The
3300 * [parameters] can be `null` if this is not a function-typed field formal
3301 * parameter.
3302 */
3303 factory FieldFormalParameter(
3304 Comment comment,
3305 List<Annotation> metadata,
3306 Token keyword,
3307 TypeName type,
3308 Token thisKeyword,
3309 Token period,
3310 SimpleIdentifier identifier,
3311 TypeParameterList typeParameters,
3312 FormalParameterList parameters) =>
3313 new FieldFormalParameterImpl(comment, metadata, keyword, type,
3314 thisKeyword, period, identifier, typeParameters, parameters);
3315
3316 /**
3317 * Return the token representing either the 'final', 'const' or 'var' keyword, 2799 * Return the token representing either the 'final', 'const' or 'var' keyword,
3318 * or `null` if no keyword was used. 2800 * or `null` if no keyword was used.
3319 */ 2801 */
3320 Token get keyword; 2802 Token get keyword;
3321 2803
3322 /** 2804 /**
3323 * Set the token representing either the 'final', 'const' or 'var' keyword to 2805 * Set the token representing either the 'final', 'const' or 'var' keyword to
3324 * the given [token]. 2806 * the given [token].
3325 */ 2807 */
3326 void set keyword(Token token); 2808 void set keyword(Token token);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
3387 * A for-each statement. 2869 * A for-each statement.
3388 * 2870 *
3389 * forEachStatement ::= 2871 * forEachStatement ::=
3390 * 'await'? 'for' '(' [DeclaredIdentifier] 'in' [Expression] ')' [Block] 2872 * 'await'? 'for' '(' [DeclaredIdentifier] 'in' [Expression] ')' [Block]
3391 * | 'await'? 'for' '(' [SimpleIdentifier] 'in' [Expression] ')' [Block] 2873 * | 'await'? 'for' '(' [SimpleIdentifier] 'in' [Expression] ')' [Block]
3392 * 2874 *
3393 * Clients may not extend, implement or mix-in this class. 2875 * Clients may not extend, implement or mix-in this class.
3394 */ 2876 */
3395 abstract class ForEachStatement extends Statement { 2877 abstract class ForEachStatement extends Statement {
3396 /** 2878 /**
3397 * Initialize a newly created for-each statement whose loop control variable
3398 * is declared internally (in the for-loop part). The [awaitKeyword] can be
3399 * `null` if this is not an asynchronous for loop.
3400 */
3401 factory ForEachStatement.withDeclaration(
3402 Token awaitKeyword,
3403 Token forKeyword,
3404 Token leftParenthesis,
3405 DeclaredIdentifier loopVariable,
3406 Token inKeyword,
3407 Expression iterator,
3408 Token rightParenthesis,
3409 Statement body) =>
3410 new ForEachStatementImpl.withDeclaration(
3411 awaitKeyword,
3412 forKeyword,
3413 leftParenthesis,
3414 loopVariable,
3415 inKeyword,
3416 iterator,
3417 rightParenthesis,
3418 body);
3419
3420 /**
3421 * Initialize a newly created for-each statement whose loop control variable
3422 * is declared outside the for loop. The [awaitKeyword] can be `null` if this
3423 * is not an asynchronous for loop.
3424 */
3425 factory ForEachStatement.withReference(
3426 Token awaitKeyword,
3427 Token forKeyword,
3428 Token leftParenthesis,
3429 SimpleIdentifier identifier,
3430 Token inKeyword,
3431 Expression iterator,
3432 Token rightParenthesis,
3433 Statement body) =>
3434 new ForEachStatementImpl.withReference(
3435 awaitKeyword,
3436 forKeyword,
3437 leftParenthesis,
3438 identifier,
3439 inKeyword,
3440 iterator,
3441 rightParenthesis,
3442 body);
3443
3444 /**
3445 * Return the token representing the 'await' keyword, or `null` if there is no 2879 * Return the token representing the 'await' keyword, or `null` if there is no
3446 * 'await' keyword. 2880 * 'await' keyword.
3447 */ 2881 */
3448 Token get awaitKeyword; 2882 Token get awaitKeyword;
3449 2883
3450 /** 2884 /**
3451 * Set the token representing the 'await' keyword to the given [token]. 2885 * Set the token representing the 'await' keyword to the given [token].
3452 */ 2886 */
3453 void set awaitKeyword(Token token); 2887 void set awaitKeyword(Token token);
3454 2888
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
3605 * optionalPositionalFormalParameters ::= 3039 * optionalPositionalFormalParameters ::=
3606 * '[' [DefaultFormalParameter] (',' [DefaultFormalParameter])* ']' 3040 * '[' [DefaultFormalParameter] (',' [DefaultFormalParameter])* ']'
3607 * 3041 *
3608 * namedFormalParameters ::= 3042 * namedFormalParameters ::=
3609 * '{' [DefaultFormalParameter] (',' [DefaultFormalParameter])* '}' 3043 * '{' [DefaultFormalParameter] (',' [DefaultFormalParameter])* '}'
3610 * 3044 *
3611 * Clients may not extend, implement or mix-in this class. 3045 * Clients may not extend, implement or mix-in this class.
3612 */ 3046 */
3613 abstract class FormalParameterList extends AstNode { 3047 abstract class FormalParameterList extends AstNode {
3614 /** 3048 /**
3615 * Initialize a newly created parameter list. The list of [parameters] can be
3616 * `null` if there are no parameters. The [leftDelimiter] and [rightDelimiter]
3617 * can be `null` if there are no optional parameters.
3618 */
3619 factory FormalParameterList(
3620 Token leftParenthesis,
3621 List<FormalParameter> parameters,
3622 Token leftDelimiter,
3623 Token rightDelimiter,
3624 Token rightParenthesis) = FormalParameterListImpl;
3625
3626 /**
3627 * Return the left square bracket ('[') or left curly brace ('{') introducing 3049 * Return the left square bracket ('[') or left curly brace ('{') introducing
3628 * the optional parameters, or `null` if there are no optional parameters. 3050 * the optional parameters, or `null` if there are no optional parameters.
3629 */ 3051 */
3630 Token get leftDelimiter; 3052 Token get leftDelimiter;
3631 3053
3632 /** 3054 /**
3633 * Set the left square bracket ('[') or left curly brace ('{') introducing 3055 * Set the left square bracket ('[') or left curly brace ('{') introducing
3634 * the optional parameters to the given [token]. 3056 * the optional parameters to the given [token].
3635 */ 3057 */
3636 void set leftDelimiter(Token token); 3058 void set leftDelimiter(Token token);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
3690 * forInitializerStatement ';' [Expression]? ';' [Expression]? 3112 * forInitializerStatement ';' [Expression]? ';' [Expression]?
3691 * 3113 *
3692 * forInitializerStatement ::= 3114 * forInitializerStatement ::=
3693 * [DefaultFormalParameter] 3115 * [DefaultFormalParameter]
3694 * | [Expression]? 3116 * | [Expression]?
3695 * 3117 *
3696 * Clients may not extend, implement or mix-in this class. 3118 * Clients may not extend, implement or mix-in this class.
3697 */ 3119 */
3698 abstract class ForStatement extends Statement { 3120 abstract class ForStatement extends Statement {
3699 /** 3121 /**
3700 * Initialize a newly created for statement. Either the [variableList] or the
3701 * [initialization] must be `null`. Either the [condition] and the list of
3702 * [updaters] can be `null` if the loop does not have the corresponding
3703 * attribute.
3704 */
3705 factory ForStatement(
3706 Token forKeyword,
3707 Token leftParenthesis,
3708 VariableDeclarationList variableList,
3709 Expression initialization,
3710 Token leftSeparator,
3711 Expression condition,
3712 Token rightSeparator,
3713 List<Expression> updaters,
3714 Token rightParenthesis,
3715 Statement body) =>
3716 new ForStatementImpl(
3717 forKeyword,
3718 leftParenthesis,
3719 variableList,
3720 initialization,
3721 leftSeparator,
3722 condition,
3723 rightSeparator,
3724 updaters,
3725 rightParenthesis,
3726 body);
3727
3728 /**
3729 * Return the body of the loop. 3122 * Return the body of the loop.
3730 */ 3123 */
3731 Statement get body; 3124 Statement get body;
3732 3125
3733 /** 3126 /**
3734 * Set the body of the loop to the given [statement]. 3127 * Set the body of the loop to the given [statement].
3735 */ 3128 */
3736 void set body(Statement statement); 3129 void set body(Statement statement);
3737 3130
3738 /** 3131 /**
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
3898 * functionDeclaration ::= 3291 * functionDeclaration ::=
3899 * 'external' functionSignature 3292 * 'external' functionSignature
3900 * | functionSignature [FunctionBody] 3293 * | functionSignature [FunctionBody]
3901 * 3294 *
3902 * functionSignature ::= 3295 * functionSignature ::=
3903 * [Type]? ('get' | 'set')? [SimpleIdentifier] [FormalParameterList] 3296 * [Type]? ('get' | 'set')? [SimpleIdentifier] [FormalParameterList]
3904 * 3297 *
3905 * Clients may not extend, implement or mix-in this class. 3298 * Clients may not extend, implement or mix-in this class.
3906 */ 3299 */
3907 abstract class FunctionDeclaration extends NamedCompilationUnitMember { 3300 abstract class FunctionDeclaration extends NamedCompilationUnitMember {
3908 /**
3909 * Initialize a newly created function declaration. Either or both of the
3910 * [comment] and [metadata] can be `null` if the function does not have the
3911 * corresponding attribute. The [externalKeyword] can be `null` if the
3912 * function is not an external function. The [returnType] can be `null` if no
3913 * return type was specified. The [propertyKeyword] can be `null` if the
3914 * function is neither a getter or a setter.
3915 */
3916 factory FunctionDeclaration(
3917 Comment comment,
3918 List<Annotation> metadata,
3919 Token externalKeyword,
3920 TypeName returnType,
3921 Token propertyKeyword,
3922 SimpleIdentifier name,
3923 FunctionExpression functionExpression) =>
3924 new FunctionDeclarationImpl(comment, metadata, externalKeyword,
3925 returnType, propertyKeyword, name, functionExpression);
3926
3927 @override 3301 @override
3928 ExecutableElement get element; 3302 ExecutableElement get element;
3929 3303
3930 /** 3304 /**
3931 * Return the token representing the 'external' keyword, or `null` if this is 3305 * Return the token representing the 'external' keyword, or `null` if this is
3932 * not an external function. 3306 * not an external function.
3933 */ 3307 */
3934 Token get externalKeyword; 3308 Token get externalKeyword;
3935 3309
3936 /** 3310 /**
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
3982 void set returnType(TypeName returnType); 3356 void set returnType(TypeName returnType);
3983 } 3357 }
3984 3358
3985 /** 3359 /**
3986 * A [FunctionDeclaration] used as a statement. 3360 * A [FunctionDeclaration] used as a statement.
3987 * 3361 *
3988 * Clients may not extend, implement or mix-in this class. 3362 * Clients may not extend, implement or mix-in this class.
3989 */ 3363 */
3990 abstract class FunctionDeclarationStatement extends Statement { 3364 abstract class FunctionDeclarationStatement extends Statement {
3991 /** 3365 /**
3992 * Initialize a newly created function declaration statement.
3993 */
3994 factory FunctionDeclarationStatement(
3995 FunctionDeclaration functionDeclaration) =
3996 FunctionDeclarationStatementImpl;
3997
3998 /**
3999 * Return the function declaration being wrapped. 3366 * Return the function declaration being wrapped.
4000 */ 3367 */
4001 FunctionDeclaration get functionDeclaration; 3368 FunctionDeclaration get functionDeclaration;
4002 3369
4003 /** 3370 /**
4004 * Set the function declaration being wrapped to the given 3371 * Set the function declaration being wrapped to the given
4005 * [functionDeclaration]. 3372 * [functionDeclaration].
4006 */ 3373 */
4007 void set functionDeclaration(FunctionDeclaration functionDeclaration); 3374 void set functionDeclaration(FunctionDeclaration functionDeclaration);
4008 } 3375 }
4009 3376
4010 /** 3377 /**
4011 * A function expression. 3378 * A function expression.
4012 * 3379 *
4013 * functionExpression ::= 3380 * functionExpression ::=
4014 * [TypeParameterList]? [FormalParameterList] [FunctionBody] 3381 * [TypeParameterList]? [FormalParameterList] [FunctionBody]
4015 * 3382 *
4016 * Clients may not extend, implement or mix-in this class. 3383 * Clients may not extend, implement or mix-in this class.
4017 */ 3384 */
4018 abstract class FunctionExpression extends Expression { 3385 abstract class FunctionExpression extends Expression {
4019 /** 3386 /**
4020 * Initialize a newly created function declaration.
4021 */
4022 factory FunctionExpression(TypeParameterList typeParameters,
4023 FormalParameterList parameters, FunctionBody body) =>
4024 new FunctionExpressionImpl(typeParameters, parameters, body);
4025
4026 /**
4027 * Return the body of the function, or `null` if this is an external function. 3387 * Return the body of the function, or `null` if this is an external function.
4028 */ 3388 */
4029 FunctionBody get body; 3389 FunctionBody get body;
4030 3390
4031 /** 3391 /**
4032 * Set the body of the function to the given [functionBody]. 3392 * Set the body of the function to the given [functionBody].
4033 */ 3393 */
4034 void set body(FunctionBody functionBody); 3394 void set body(FunctionBody functionBody);
4035 3395
4036 /** 3396 /**
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
4074 * [MethodInvocation] nodes. Invocations of getters and setters are represented 3434 * [MethodInvocation] nodes. Invocations of getters and setters are represented
4075 * by either [PrefixedIdentifier] or [PropertyAccess] nodes. 3435 * by either [PrefixedIdentifier] or [PropertyAccess] nodes.
4076 * 3436 *
4077 * functionExpressionInvocation ::= 3437 * functionExpressionInvocation ::=
4078 * [Expression] [TypeArgumentList]? [ArgumentList] 3438 * [Expression] [TypeArgumentList]? [ArgumentList]
4079 * 3439 *
4080 * Clients may not extend, implement or mix-in this class. 3440 * Clients may not extend, implement or mix-in this class.
4081 */ 3441 */
4082 abstract class FunctionExpressionInvocation extends InvocationExpression { 3442 abstract class FunctionExpressionInvocation extends InvocationExpression {
4083 /** 3443 /**
4084 * Initialize a newly created function expression invocation.
4085 */
4086 factory FunctionExpressionInvocation(Expression function,
4087 TypeArgumentList typeArguments, ArgumentList argumentList) =>
4088 new FunctionExpressionInvocationImpl(
4089 function, typeArguments, argumentList);
4090
4091 /**
4092 * Set the list of arguments to the method to the given [argumentList]. 3444 * Set the list of arguments to the method to the given [argumentList].
4093 */ 3445 */
4094 void set argumentList(ArgumentList argumentList); 3446 void set argumentList(ArgumentList argumentList);
4095 3447
4096 /** 3448 /**
4097 * Return the best element available for the function being invoked. If 3449 * Return the best element available for the function being invoked. If
4098 * resolution was able to find a better element based on type propagation, 3450 * resolution was able to find a better element based on type propagation,
4099 * that element will be returned. Otherwise, the element found using the 3451 * that element will be returned. Otherwise, the element found using the
4100 * result of static analysis will be returned. If resolution has not been 3452 * result of static analysis will be returned. If resolution has not been
4101 * performed, then `null` will be returned. 3453 * performed, then `null` will be returned.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
4153 * functionTypeAlias ::= 3505 * functionTypeAlias ::=
4154 * functionPrefix [TypeParameterList]? [FormalParameterList] ';' 3506 * functionPrefix [TypeParameterList]? [FormalParameterList] ';'
4155 * 3507 *
4156 * functionPrefix ::= 3508 * functionPrefix ::=
4157 * [TypeName]? [SimpleIdentifier] 3509 * [TypeName]? [SimpleIdentifier]
4158 * 3510 *
4159 * Clients may not extend, implement or mix-in this class. 3511 * Clients may not extend, implement or mix-in this class.
4160 */ 3512 */
4161 abstract class FunctionTypeAlias extends TypeAlias { 3513 abstract class FunctionTypeAlias extends TypeAlias {
4162 /** 3514 /**
4163 * Initialize a newly created function type alias. Either or both of the
4164 * [comment] and [metadata] can be `null` if the function does not have the
4165 * corresponding attribute. The [returnType] can be `null` if no return type
4166 * was specified. The [typeParameters] can be `null` if the function has no
4167 * type parameters.
4168 */
4169 factory FunctionTypeAlias(
4170 Comment comment,
4171 List<Annotation> metadata,
4172 Token keyword,
4173 TypeName returnType,
4174 SimpleIdentifier name,
4175 TypeParameterList typeParameters,
4176 FormalParameterList parameters,
4177 Token semicolon) =>
4178 new FunctionTypeAliasImpl(comment, metadata, keyword, returnType, name,
4179 typeParameters, parameters, semicolon);
4180
4181 /**
4182 * Return the parameters associated with the function type. 3515 * Return the parameters associated with the function type.
4183 */ 3516 */
4184 FormalParameterList get parameters; 3517 FormalParameterList get parameters;
4185 3518
4186 /** 3519 /**
4187 * Set the parameters associated with the function type to the given list of 3520 * Set the parameters associated with the function type to the given list of
4188 * [parameters]. 3521 * [parameters].
4189 */ 3522 */
4190 void set parameters(FormalParameterList parameters); 3523 void set parameters(FormalParameterList parameters);
4191 3524
(...skipping 25 matching lines...) Expand all
4217 /** 3550 /**
4218 * A function-typed formal parameter. 3551 * A function-typed formal parameter.
4219 * 3552 *
4220 * functionSignature ::= 3553 * functionSignature ::=
4221 * [TypeName]? [SimpleIdentifier] [TypeParameterList]? [FormalParameterLi st] 3554 * [TypeName]? [SimpleIdentifier] [TypeParameterList]? [FormalParameterLi st]
4222 * 3555 *
4223 * Clients may not extend, implement or mix-in this class. 3556 * Clients may not extend, implement or mix-in this class.
4224 */ 3557 */
4225 abstract class FunctionTypedFormalParameter extends NormalFormalParameter { 3558 abstract class FunctionTypedFormalParameter extends NormalFormalParameter {
4226 /** 3559 /**
4227 * Initialize a newly created formal parameter. Either or both of the
4228 * [comment] and [metadata] can be `null` if the parameter does not have the
4229 * corresponding attribute. The [returnType] can be `null` if no return type
4230 * was specified.
4231 */
4232 factory FunctionTypedFormalParameter(
4233 Comment comment,
4234 List<Annotation> metadata,
4235 TypeName returnType,
4236 SimpleIdentifier identifier,
4237 TypeParameterList typeParameters,
4238 FormalParameterList parameters,
4239 {Token question: null}) =>
4240 new FunctionTypedFormalParameterImpl(comment, metadata, returnType,
4241 identifier, typeParameters, parameters, question);
4242
4243 /**
4244 * Return the parameters of the function-typed parameter. 3560 * Return the parameters of the function-typed parameter.
4245 */ 3561 */
4246 FormalParameterList get parameters; 3562 FormalParameterList get parameters;
4247 3563
4248 /** 3564 /**
4249 * Set the parameters of the function-typed parameter to the given 3565 * Set the parameters of the function-typed parameter to the given
4250 * [parameters]. 3566 * [parameters].
4251 */ 3567 */
4252 void set parameters(FormalParameterList parameters); 3568 void set parameters(FormalParameterList parameters);
4253 3569
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
4291 * A combinator that restricts the names being imported to those that are not in 3607 * A combinator that restricts the names being imported to those that are not in
4292 * a given list. 3608 * a given list.
4293 * 3609 *
4294 * hideCombinator ::= 3610 * hideCombinator ::=
4295 * 'hide' [SimpleIdentifier] (',' [SimpleIdentifier])* 3611 * 'hide' [SimpleIdentifier] (',' [SimpleIdentifier])*
4296 * 3612 *
4297 * Clients may not extend, implement or mix-in this class. 3613 * Clients may not extend, implement or mix-in this class.
4298 */ 3614 */
4299 abstract class HideCombinator extends Combinator { 3615 abstract class HideCombinator extends Combinator {
4300 /** 3616 /**
4301 * Initialize a newly created import show combinator.
4302 */
4303 factory HideCombinator(Token keyword, List<SimpleIdentifier> hiddenNames) =
4304 HideCombinatorImpl;
4305
4306 /**
4307 * Return the list of names from the library that are hidden by this 3617 * Return the list of names from the library that are hidden by this
4308 * combinator. 3618 * combinator.
4309 */ 3619 */
4310 NodeList<SimpleIdentifier> get hiddenNames; 3620 NodeList<SimpleIdentifier> get hiddenNames;
4311 } 3621 }
4312 3622
4313 /** 3623 /**
4314 * A node that represents an identifier. 3624 * A node that represents an identifier.
4315 * 3625 *
4316 * identifier ::= 3626 * identifier ::=
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
4361 /** 3671 /**
4362 * An if statement. 3672 * An if statement.
4363 * 3673 *
4364 * ifStatement ::= 3674 * ifStatement ::=
4365 * 'if' '(' [Expression] ')' [Statement] ('else' [Statement])? 3675 * 'if' '(' [Expression] ')' [Statement] ('else' [Statement])?
4366 * 3676 *
4367 * Clients may not extend, implement or mix-in this class. 3677 * Clients may not extend, implement or mix-in this class.
4368 */ 3678 */
4369 abstract class IfStatement extends Statement { 3679 abstract class IfStatement extends Statement {
4370 /** 3680 /**
4371 * Initialize a newly created if statement. The [elseKeyword] and
4372 * [elseStatement] can be `null` if there is no else clause.
4373 */
4374 factory IfStatement(
4375 Token ifKeyword,
4376 Token leftParenthesis,
4377 Expression condition,
4378 Token rightParenthesis,
4379 Statement thenStatement,
4380 Token elseKeyword,
4381 Statement elseStatement) =>
4382 new IfStatementImpl(ifKeyword, leftParenthesis, condition,
4383 rightParenthesis, thenStatement, elseKeyword, elseStatement);
4384
4385 /**
4386 * Return the condition used to determine which of the statements is executed 3681 * Return the condition used to determine which of the statements is executed
4387 * next. 3682 * next.
4388 */ 3683 */
4389 Expression get condition; 3684 Expression get condition;
4390 3685
4391 /** 3686 /**
4392 * Set the condition used to determine which of the statements is executed 3687 * Set the condition used to determine which of the statements is executed
4393 * next to the given [expression]. 3688 * next to the given [expression].
4394 */ 3689 */
4395 void set condition(Expression expression); 3690 void set condition(Expression expression);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
4462 /** 3757 /**
4463 * The "implements" clause in an class declaration. 3758 * The "implements" clause in an class declaration.
4464 * 3759 *
4465 * implementsClause ::= 3760 * implementsClause ::=
4466 * 'implements' [TypeName] (',' [TypeName])* 3761 * 'implements' [TypeName] (',' [TypeName])*
4467 * 3762 *
4468 * Clients may not extend, implement or mix-in this class. 3763 * Clients may not extend, implement or mix-in this class.
4469 */ 3764 */
4470 abstract class ImplementsClause extends AstNode { 3765 abstract class ImplementsClause extends AstNode {
4471 /** 3766 /**
4472 * Initialize a newly created implements clause.
4473 */
4474 factory ImplementsClause(Token implementsKeyword, List<TypeName> interfaces) =
4475 ImplementsClauseImpl;
4476
4477 /**
4478 * Return the token representing the 'implements' keyword. 3767 * Return the token representing the 'implements' keyword.
4479 */ 3768 */
4480 Token get implementsKeyword; 3769 Token get implementsKeyword;
4481 3770
4482 /** 3771 /**
4483 * Set the token representing the 'implements' keyword to the given [token]. 3772 * Set the token representing the 'implements' keyword to the given [token].
4484 */ 3773 */
4485 void set implementsKeyword(Token token); 3774 void set implementsKeyword(Token token);
4486 3775
4487 /** 3776 /**
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
4598 } 3887 }
4599 // next ensure that the lists are equivalent 3888 // next ensure that the lists are equivalent
4600 if (!allHides1.toSet().containsAll(allHides2)) { 3889 if (!allHides1.toSet().containsAll(allHides2)) {
4601 return -1; 3890 return -1;
4602 } 3891 }
4603 if (!allShows1.toSet().containsAll(allShows2)) { 3892 if (!allShows1.toSet().containsAll(allShows2)) {
4604 return -1; 3893 return -1;
4605 } 3894 }
4606 return 0; 3895 return 0;
4607 }; 3896 };
4608
4609 /**
4610 * Initialize a newly created import directive. Either or both of the
4611 * [comment] and [metadata] can be `null` if the function does not have the
4612 * corresponding attribute. The [deferredKeyword] can be `null` if the import
4613 * is not deferred. The [asKeyword] and [prefix] can be `null` if the import
4614 * does not specify a prefix. The list of [combinators] can be `null` if there
4615 * are no combinators.
4616 */
4617 factory ImportDirective(
4618 Comment comment,
4619 List<Annotation> metadata,
4620 Token keyword,
4621 StringLiteral libraryUri,
4622 List<Configuration> configurations,
4623 Token deferredKeyword,
4624 Token asKeyword,
4625 SimpleIdentifier prefix,
4626 List<Combinator> combinators,
4627 Token semicolon) =>
4628 new ImportDirectiveImpl(
4629 comment,
4630 metadata,
4631 keyword,
4632 libraryUri,
4633 configurations,
4634 deferredKeyword,
4635 asKeyword,
4636 prefix,
4637 combinators,
4638 semicolon);
4639
4640 /** 3897 /**
4641 * Return the token representing the 'as' keyword, or `null` if the imported 3898 * Return the token representing the 'as' keyword, or `null` if the imported
4642 * names are not prefixed. 3899 * names are not prefixed.
4643 */ 3900 */
4644 Token get asKeyword; 3901 Token get asKeyword;
4645 3902
4646 /** 3903 /**
4647 * Set the token representing the 'as' keyword to the given [token]. 3904 * Set the token representing the 'as' keyword to the given [token].
4648 */ 3905 */
4649 void set asKeyword(Token token); 3906 void set asKeyword(Token token);
(...skipping 25 matching lines...) Expand all
4675 * An index expression. 3932 * An index expression.
4676 * 3933 *
4677 * indexExpression ::= 3934 * indexExpression ::=
4678 * [Expression] '[' [Expression] ']' 3935 * [Expression] '[' [Expression] ']'
4679 * 3936 *
4680 * Clients may not extend, implement or mix-in this class. 3937 * Clients may not extend, implement or mix-in this class.
4681 */ 3938 */
4682 abstract class IndexExpression extends Expression 3939 abstract class IndexExpression extends Expression
4683 implements MethodReferenceExpression { 3940 implements MethodReferenceExpression {
4684 /** 3941 /**
4685 * Initialize a newly created index expression.
4686 */
4687 factory IndexExpression.forCascade(Token period, Token leftBracket,
4688 Expression index, Token rightBracket) =>
4689 new IndexExpressionImpl.forCascade(
4690 period, leftBracket, index, rightBracket);
4691
4692 /**
4693 * Initialize a newly created index expression.
4694 */
4695 factory IndexExpression.forTarget(Expression target, Token leftBracket,
4696 Expression index, Token rightBracket) =>
4697 new IndexExpressionImpl.forTarget(
4698 target, leftBracket, index, rightBracket);
4699
4700 /**
4701 * Return the auxiliary elements associated with this identifier, or `null` if 3942 * Return the auxiliary elements associated with this identifier, or `null` if
4702 * this identifier is not in both a getter and setter context. The auxiliary 3943 * this identifier is not in both a getter and setter context. The auxiliary
4703 * elements hold the static and propagated elements associated with the getter 3944 * elements hold the static and propagated elements associated with the getter
4704 * context. 3945 * context.
4705 */ 3946 */
4706 // TODO(brianwilkerson) Replace this API. 3947 // TODO(brianwilkerson) Replace this API.
4707 AuxiliaryElements get auxiliaryElements; 3948 AuxiliaryElements get auxiliaryElements;
4708 3949
4709 /** 3950 /**
4710 * Set the auxiliary elements associated with this identifier to the given 3951 * Set the auxiliary elements associated with this identifier to the given
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
4809 * An instance creation expression. 4050 * An instance creation expression.
4810 * 4051 *
4811 * newExpression ::= 4052 * newExpression ::=
4812 * ('new' | 'const') [TypeName] ('.' [SimpleIdentifier])? [ArgumentList] 4053 * ('new' | 'const') [TypeName] ('.' [SimpleIdentifier])? [ArgumentList]
4813 * 4054 *
4814 * Clients may not extend, implement or mix-in this class. 4055 * Clients may not extend, implement or mix-in this class.
4815 */ 4056 */
4816 abstract class InstanceCreationExpression extends Expression 4057 abstract class InstanceCreationExpression extends Expression
4817 implements ConstructorReferenceNode { 4058 implements ConstructorReferenceNode {
4818 /** 4059 /**
4819 * Initialize a newly created instance creation expression.
4820 */
4821 factory InstanceCreationExpression(Token keyword,
4822 ConstructorName constructorName, ArgumentList argumentList) =>
4823 new InstanceCreationExpressionImpl(
4824 keyword, constructorName, argumentList);
4825
4826 /**
4827 * Return the list of arguments to the constructor. 4060 * Return the list of arguments to the constructor.
4828 */ 4061 */
4829 ArgumentList get argumentList; 4062 ArgumentList get argumentList;
4830 4063
4831 /** 4064 /**
4832 * Set the list of arguments to the constructor to the given [argumentList]. 4065 * Set the list of arguments to the constructor to the given [argumentList].
4833 */ 4066 */
4834 void set argumentList(ArgumentList argumentList); 4067 void set argumentList(ArgumentList argumentList);
4835 4068
4836 /** 4069 /**
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
4873 * decimalDigit+ 4106 * decimalDigit+
4874 * 4107 *
4875 * hexadecimalIntegerLiteral ::= 4108 * hexadecimalIntegerLiteral ::=
4876 * '0x' hexadecimalDigit+ 4109 * '0x' hexadecimalDigit+
4877 * | '0X' hexadecimalDigit+ 4110 * | '0X' hexadecimalDigit+
4878 * 4111 *
4879 * Clients may not extend, implement or mix-in this class. 4112 * Clients may not extend, implement or mix-in this class.
4880 */ 4113 */
4881 abstract class IntegerLiteral extends Literal { 4114 abstract class IntegerLiteral extends Literal {
4882 /** 4115 /**
4883 * Initialize a newly created integer literal.
4884 */
4885 factory IntegerLiteral(Token literal, int value) = IntegerLiteralImpl;
4886
4887 /**
4888 * Return the token representing the literal. 4116 * Return the token representing the literal.
4889 */ 4117 */
4890 Token get literal; 4118 Token get literal;
4891 4119
4892 /** 4120 /**
4893 * Set the token representing the literal to the given [token]. 4121 * Set the token representing the literal to the given [token].
4894 */ 4122 */
4895 void set literal(Token token); 4123 void set literal(Token token);
4896 4124
4897 /** 4125 /**
(...skipping 22 matching lines...) Expand all
4920 * An expression embedded in a string interpolation. 4148 * An expression embedded in a string interpolation.
4921 * 4149 *
4922 * interpolationExpression ::= 4150 * interpolationExpression ::=
4923 * '$' [SimpleIdentifier] 4151 * '$' [SimpleIdentifier]
4924 * | '$' '{' [Expression] '}' 4152 * | '$' '{' [Expression] '}'
4925 * 4153 *
4926 * Clients may not extend, implement or mix-in this class. 4154 * Clients may not extend, implement or mix-in this class.
4927 */ 4155 */
4928 abstract class InterpolationExpression extends InterpolationElement { 4156 abstract class InterpolationExpression extends InterpolationElement {
4929 /** 4157 /**
4930 * Initialize a newly created interpolation expression.
4931 */
4932 factory InterpolationExpression(
4933 Token leftBracket, Expression expression, Token rightBracket) =>
4934 new InterpolationExpressionImpl(leftBracket, expression, rightBracket);
4935
4936 /**
4937 * Return the expression to be evaluated for the value to be converted into a 4158 * Return the expression to be evaluated for the value to be converted into a
4938 * string. 4159 * string.
4939 */ 4160 */
4940 Expression get expression; 4161 Expression get expression;
4941 4162
4942 /** 4163 /**
4943 * Set the expression to be evaluated for the value to be converted into a 4164 * Set the expression to be evaluated for the value to be converted into a
4944 * string to the given [expression]. 4165 * string to the given [expression].
4945 */ 4166 */
4946 void set expression(Expression expression); 4167 void set expression(Expression expression);
(...skipping 27 matching lines...) Expand all
4974 /** 4195 /**
4975 * A non-empty substring of an interpolated string. 4196 * A non-empty substring of an interpolated string.
4976 * 4197 *
4977 * interpolationString ::= 4198 * interpolationString ::=
4978 * characters 4199 * characters
4979 * 4200 *
4980 * Clients may not extend, implement or mix-in this class. 4201 * Clients may not extend, implement or mix-in this class.
4981 */ 4202 */
4982 abstract class InterpolationString extends InterpolationElement { 4203 abstract class InterpolationString extends InterpolationElement {
4983 /** 4204 /**
4984 * Initialize a newly created string of characters that are part of a string
4985 * interpolation.
4986 */
4987 factory InterpolationString(Token contents, String value) =
4988 InterpolationStringImpl;
4989
4990 /**
4991 * Return the characters that will be added to the string. 4205 * Return the characters that will be added to the string.
4992 */ 4206 */
4993 Token get contents; 4207 Token get contents;
4994 4208
4995 /** 4209 /**
4996 * Set the characters that will be added to the string to the given [token]. 4210 * Set the characters that will be added to the string to the given [token].
4997 */ 4211 */
4998 void set contents(Token token); 4212 void set contents(Token token);
4999 4213
5000 /** 4214 /**
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
5088 /** 4302 /**
5089 * An is expression. 4303 * An is expression.
5090 * 4304 *
5091 * isExpression ::= 4305 * isExpression ::=
5092 * [Expression] 'is' '!'? [TypeName] 4306 * [Expression] 'is' '!'? [TypeName]
5093 * 4307 *
5094 * Clients may not extend, implement or mix-in this class. 4308 * Clients may not extend, implement or mix-in this class.
5095 */ 4309 */
5096 abstract class IsExpression extends Expression { 4310 abstract class IsExpression extends Expression {
5097 /** 4311 /**
5098 * Initialize a newly created is expression. The [notOperator] can be `null`
5099 * if the sense of the test is not negated.
5100 */
5101 factory IsExpression(Expression expression, Token isOperator,
5102 Token notOperator, TypeName type) =>
5103 new IsExpressionImpl(expression, isOperator, notOperator, type);
5104
5105 /**
5106 * Return the expression used to compute the value whose type is being tested. 4312 * Return the expression used to compute the value whose type is being tested.
5107 */ 4313 */
5108 Expression get expression; 4314 Expression get expression;
5109 4315
5110 /** 4316 /**
5111 * Set the expression used to compute the value whose type is being tested to 4317 * Set the expression used to compute the value whose type is being tested to
5112 * the given [expression]. 4318 * the given [expression].
5113 */ 4319 */
5114 void set expression(Expression expression); 4320 void set expression(Expression expression);
5115 4321
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
5147 /** 4353 /**
5148 * A label on either a [LabeledStatement] or a [NamedExpression]. 4354 * A label on either a [LabeledStatement] or a [NamedExpression].
5149 * 4355 *
5150 * label ::= 4356 * label ::=
5151 * [SimpleIdentifier] ':' 4357 * [SimpleIdentifier] ':'
5152 * 4358 *
5153 * Clients may not extend, implement or mix-in this class. 4359 * Clients may not extend, implement or mix-in this class.
5154 */ 4360 */
5155 abstract class Label extends AstNode { 4361 abstract class Label extends AstNode {
5156 /** 4362 /**
5157 * Initialize a newly created label.
5158 */
5159 factory Label(SimpleIdentifier label, Token colon) =>
5160 new LabelImpl(label, colon);
5161
5162 /**
5163 * Return the colon that separates the label from the statement. 4363 * Return the colon that separates the label from the statement.
5164 */ 4364 */
5165 Token get colon; 4365 Token get colon;
5166 4366
5167 /** 4367 /**
5168 * Set the colon that separates the label from the statement to the given 4368 * Set the colon that separates the label from the statement to the given
5169 * [token]. 4369 * [token].
5170 */ 4370 */
5171 void set colon(Token token); 4371 void set colon(Token token);
5172 4372
(...skipping 11 matching lines...) Expand all
5184 /** 4384 /**
5185 * A statement that has a label associated with them. 4385 * A statement that has a label associated with them.
5186 * 4386 *
5187 * labeledStatement ::= 4387 * labeledStatement ::=
5188 * [Label]+ [Statement] 4388 * [Label]+ [Statement]
5189 * 4389 *
5190 * Clients may not extend, implement or mix-in this class. 4390 * Clients may not extend, implement or mix-in this class.
5191 */ 4391 */
5192 abstract class LabeledStatement extends Statement { 4392 abstract class LabeledStatement extends Statement {
5193 /** 4393 /**
5194 * Initialize a newly created labeled statement.
5195 */
5196 factory LabeledStatement(List<Label> labels, Statement statement) =>
5197 new LabeledStatementImpl(labels, statement);
5198
5199 /**
5200 * Return the labels being associated with the statement. 4394 * Return the labels being associated with the statement.
5201 */ 4395 */
5202 NodeList<Label> get labels; 4396 NodeList<Label> get labels;
5203 4397
5204 /** 4398 /**
5205 * Return the statement with which the labels are being associated. 4399 * Return the statement with which the labels are being associated.
5206 */ 4400 */
5207 Statement get statement; 4401 Statement get statement;
5208 4402
5209 /** 4403 /**
5210 * Set the statement with which the labels are being associated to the given 4404 * Set the statement with which the labels are being associated to the given
5211 * [statement]. 4405 * [statement].
5212 */ 4406 */
5213 void set statement(Statement statement); 4407 void set statement(Statement statement);
5214 } 4408 }
5215 4409
5216 /** 4410 /**
5217 * A library directive. 4411 * A library directive.
5218 * 4412 *
5219 * libraryDirective ::= 4413 * libraryDirective ::=
5220 * [Annotation] 'library' [Identifier] ';' 4414 * [Annotation] 'library' [Identifier] ';'
5221 * 4415 *
5222 * Clients may not extend, implement or mix-in this class. 4416 * Clients may not extend, implement or mix-in this class.
5223 */ 4417 */
5224 abstract class LibraryDirective extends Directive { 4418 abstract class LibraryDirective extends Directive {
5225 /** 4419 /**
5226 * Initialize a newly created library directive. Either or both of the
5227 * [comment] and [metadata] can be `null` if the directive does not have the
5228 * corresponding attribute.
5229 */
5230 factory LibraryDirective(Comment comment, List<Annotation> metadata,
5231 Token libraryKeyword, LibraryIdentifier name, Token semicolon) =>
5232 new LibraryDirectiveImpl(
5233 comment, metadata, libraryKeyword, name, semicolon);
5234
5235 /**
5236 * Return the token representing the 'library' keyword. 4420 * Return the token representing the 'library' keyword.
5237 */ 4421 */
5238 Token get libraryKeyword; 4422 Token get libraryKeyword;
5239 4423
5240 /** 4424 /**
5241 * Set the token representing the 'library' keyword to the given [token]. 4425 * Set the token representing the 'library' keyword to the given [token].
5242 */ 4426 */
5243 void set libraryKeyword(Token token); 4427 void set libraryKeyword(Token token);
5244 4428
5245 /** 4429 /**
(...skipping 20 matching lines...) Expand all
5266 /** 4450 /**
5267 * The identifier for a library. 4451 * The identifier for a library.
5268 * 4452 *
5269 * libraryIdentifier ::= 4453 * libraryIdentifier ::=
5270 * [SimpleIdentifier] ('.' [SimpleIdentifier])* 4454 * [SimpleIdentifier] ('.' [SimpleIdentifier])*
5271 * 4455 *
5272 * Clients may not extend, implement or mix-in this class. 4456 * Clients may not extend, implement or mix-in this class.
5273 */ 4457 */
5274 abstract class LibraryIdentifier extends Identifier { 4458 abstract class LibraryIdentifier extends Identifier {
5275 /** 4459 /**
5276 * Initialize a newly created prefixed identifier.
5277 */
5278 factory LibraryIdentifier(List<SimpleIdentifier> components) =
5279 LibraryIdentifierImpl;
5280
5281 /**
5282 * Return the components of the identifier. 4460 * Return the components of the identifier.
5283 */ 4461 */
5284 NodeList<SimpleIdentifier> get components; 4462 NodeList<SimpleIdentifier> get components;
5285 } 4463 }
5286 4464
5287 /** 4465 /**
5288 * A list literal. 4466 * A list literal.
5289 * 4467 *
5290 * listLiteral ::= 4468 * listLiteral ::=
5291 * 'const'? ('<' [TypeName] '>')? '[' ([Expression] ','?)? ']' 4469 * 'const'? ('<' [TypeName] '>')? '[' ([Expression] ','?)? ']'
5292 * 4470 *
5293 * Clients may not extend, implement or mix-in this class. 4471 * Clients may not extend, implement or mix-in this class.
5294 */ 4472 */
5295 abstract class ListLiteral extends TypedLiteral { 4473 abstract class ListLiteral extends TypedLiteral {
5296 /** 4474 /**
5297 * Initialize a newly created list literal. The [constKeyword] can be `null`
5298 * if the literal is not a constant. The [typeArguments] can be `null` if no
5299 * type arguments were declared. The list of [elements] can be `null` if the
5300 * list is empty.
5301 */
5302 factory ListLiteral(
5303 Token constKeyword,
5304 TypeArgumentList typeArguments,
5305 Token leftBracket,
5306 List<Expression> elements,
5307 Token rightBracket) = ListLiteralImpl;
5308
5309 /**
5310 * Return the expressions used to compute the elements of the list. 4475 * Return the expressions used to compute the elements of the list.
5311 */ 4476 */
5312 NodeList<Expression> get elements; 4477 NodeList<Expression> get elements;
5313 4478
5314 /** 4479 /**
5315 * Return the left square bracket. 4480 * Return the left square bracket.
5316 */ 4481 */
5317 Token get leftBracket; 4482 Token get leftBracket;
5318 4483
5319 /** 4484 /**
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
5352 * A literal map. 4517 * A literal map.
5353 * 4518 *
5354 * mapLiteral ::= 4519 * mapLiteral ::=
5355 * 'const'? ('<' [TypeName] (',' [TypeName])* '>')? 4520 * 'const'? ('<' [TypeName] (',' [TypeName])* '>')?
5356 * '{' ([MapLiteralEntry] (',' [MapLiteralEntry])* ','?)? '}' 4521 * '{' ([MapLiteralEntry] (',' [MapLiteralEntry])* ','?)? '}'
5357 * 4522 *
5358 * Clients may not extend, implement or mix-in this class. 4523 * Clients may not extend, implement or mix-in this class.
5359 */ 4524 */
5360 abstract class MapLiteral extends TypedLiteral { 4525 abstract class MapLiteral extends TypedLiteral {
5361 /** 4526 /**
5362 * Initialize a newly created map literal. The [constKeyword] can be `null` if
5363 * the literal is not a constant. The [typeArguments] can be `null` if no type
5364 * arguments were declared. The [entries] can be `null` if the map is empty.
5365 */
5366 factory MapLiteral(
5367 Token constKeyword,
5368 TypeArgumentList typeArguments,
5369 Token leftBracket,
5370 List<MapLiteralEntry> entries,
5371 Token rightBracket) = MapLiteralImpl;
5372
5373 /**
5374 * Return the entries in the map. 4527 * Return the entries in the map.
5375 */ 4528 */
5376 NodeList<MapLiteralEntry> get entries; 4529 NodeList<MapLiteralEntry> get entries;
5377 4530
5378 /** 4531 /**
5379 * Return the left curly bracket. 4532 * Return the left curly bracket.
5380 */ 4533 */
5381 Token get leftBracket; 4534 Token get leftBracket;
5382 4535
5383 /** 4536 /**
(...skipping 15 matching lines...) Expand all
5399 /** 4552 /**
5400 * A single key/value pair in a map literal. 4553 * A single key/value pair in a map literal.
5401 * 4554 *
5402 * mapLiteralEntry ::= 4555 * mapLiteralEntry ::=
5403 * [Expression] ':' [Expression] 4556 * [Expression] ':' [Expression]
5404 * 4557 *
5405 * Clients may not extend, implement or mix-in this class. 4558 * Clients may not extend, implement or mix-in this class.
5406 */ 4559 */
5407 abstract class MapLiteralEntry extends AstNode { 4560 abstract class MapLiteralEntry extends AstNode {
5408 /** 4561 /**
5409 * Initialize a newly created map literal entry.
5410 */
5411 factory MapLiteralEntry(Expression key, Token separator, Expression value) =>
5412 new MapLiteralEntryImpl(key, separator, value);
5413
5414 /**
5415 * Return the expression computing the key with which the value will be 4562 * Return the expression computing the key with which the value will be
5416 * associated. 4563 * associated.
5417 */ 4564 */
5418 Expression get key; 4565 Expression get key;
5419 4566
5420 /** 4567 /**
5421 * Set the expression computing the key with which the value will be 4568 * Set the expression computing the key with which the value will be
5422 * associated to the given [string]. 4569 * associated to the given [string].
5423 */ 4570 */
5424 void set key(Expression string); 4571 void set key(Expression string);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
5457 * methodName [TypeParameterList] [FormalParameterList] 4604 * methodName [TypeParameterList] [FormalParameterList]
5458 * 4605 *
5459 * methodName ::= 4606 * methodName ::=
5460 * [SimpleIdentifier] 4607 * [SimpleIdentifier]
5461 * | 'operator' [SimpleIdentifier] 4608 * | 'operator' [SimpleIdentifier]
5462 * 4609 *
5463 * Clients may not extend, implement or mix-in this class. 4610 * Clients may not extend, implement or mix-in this class.
5464 */ 4611 */
5465 abstract class MethodDeclaration extends ClassMember { 4612 abstract class MethodDeclaration extends ClassMember {
5466 /** 4613 /**
5467 * Initialize a newly created method declaration. Either or both of the
5468 * [comment] and [metadata] can be `null` if the declaration does not have the
5469 * corresponding attribute. The [externalKeyword] can be `null` if the method
5470 * is not external. The [modifierKeyword] can be `null` if the method is
5471 * neither abstract nor static. The [returnType] can be `null` if no return
5472 * type was specified. The [propertyKeyword] can be `null` if the method is
5473 * neither a getter or a setter. The [operatorKeyword] can be `null` if the
5474 * method does not implement an operator. The [parameters] must be `null` if
5475 * this method declares a getter.
5476 */
5477 factory MethodDeclaration(
5478 Comment comment,
5479 List<Annotation> metadata,
5480 Token externalKeyword,
5481 Token modifierKeyword,
5482 TypeName returnType,
5483 Token propertyKeyword,
5484 Token operatorKeyword,
5485 SimpleIdentifier name,
5486 TypeParameterList typeParameters,
5487 FormalParameterList parameters,
5488 FunctionBody body) =>
5489 new MethodDeclarationImpl(
5490 comment,
5491 metadata,
5492 externalKeyword,
5493 modifierKeyword,
5494 returnType,
5495 propertyKeyword,
5496 operatorKeyword,
5497 name,
5498 typeParameters,
5499 parameters,
5500 body);
5501
5502 /**
5503 * Return the body of the method. 4614 * Return the body of the method.
5504 */ 4615 */
5505 FunctionBody get body; 4616 FunctionBody get body;
5506 4617
5507 /** 4618 /**
5508 * Set the body of the method to the given [functionBody]. 4619 * Set the body of the method to the given [functionBody].
5509 */ 4620 */
5510 void set body(FunctionBody functionBody); 4621 void set body(FunctionBody functionBody);
5511 4622
5512 @override 4623 @override
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
5634 * [FunctionExpressionInvocation] nodes. Invocations of getters and setters are 4745 * [FunctionExpressionInvocation] nodes. Invocations of getters and setters are
5635 * represented by either [PrefixedIdentifier] or [PropertyAccess] nodes. 4746 * represented by either [PrefixedIdentifier] or [PropertyAccess] nodes.
5636 * 4747 *
5637 * methodInvocation ::= 4748 * methodInvocation ::=
5638 * ([Expression] '.')? [SimpleIdentifier] [TypeArgumentList]? [ArgumentLi st] 4749 * ([Expression] '.')? [SimpleIdentifier] [TypeArgumentList]? [ArgumentLi st]
5639 * 4750 *
5640 * Clients may not extend, implement or mix-in this class. 4751 * Clients may not extend, implement or mix-in this class.
5641 */ 4752 */
5642 abstract class MethodInvocation extends InvocationExpression { 4753 abstract class MethodInvocation extends InvocationExpression {
5643 /** 4754 /**
5644 * Initialize a newly created method invocation. The [target] and [operator]
5645 * can be `null` if there is no target.
5646 */
5647 factory MethodInvocation(
5648 Expression target,
5649 Token operator,
5650 SimpleIdentifier methodName,
5651 TypeArgumentList typeArguments,
5652 ArgumentList argumentList) =>
5653 new MethodInvocationImpl(
5654 target, operator, methodName, typeArguments, argumentList);
5655
5656 /**
5657 * Set the list of arguments to the method to the given [argumentList]. 4755 * Set the list of arguments to the method to the given [argumentList].
5658 */ 4756 */
5659 void set argumentList(ArgumentList argumentList); 4757 void set argumentList(ArgumentList argumentList);
5660 4758
5661 /** 4759 /**
5662 * Return `true` if this expression is cascaded. If it is, then the target of 4760 * Return `true` if this expression is cascaded. If it is, then the target of
5663 * this expression is not stored locally but is stored in the nearest ancestor 4761 * this expression is not stored locally but is stored in the nearest ancestor
5664 * that is a [CascadeExpression]. 4762 * that is a [CascadeExpression].
5665 */ 4763 */
5666 bool get isCascaded; 4764 bool get isCascaded;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
5787 * An expression that has a name associated with it. They are used in method 4885 * An expression that has a name associated with it. They are used in method
5788 * invocations when there are named parameters. 4886 * invocations when there are named parameters.
5789 * 4887 *
5790 * namedExpression ::= 4888 * namedExpression ::=
5791 * [Label] [Expression] 4889 * [Label] [Expression]
5792 * 4890 *
5793 * Clients may not extend, implement or mix-in this class. 4891 * Clients may not extend, implement or mix-in this class.
5794 */ 4892 */
5795 abstract class NamedExpression extends Expression { 4893 abstract class NamedExpression extends Expression {
5796 /** 4894 /**
5797 * Initialize a newly created named expression..
5798 */
5799 factory NamedExpression(Label name, Expression expression) =>
5800 new NamedExpressionImpl(name, expression);
5801
5802 /**
5803 * Return the element representing the parameter being named by this 4895 * Return the element representing the parameter being named by this
5804 * expression, or `null` if the AST structure has not been resolved or if 4896 * expression, or `null` if the AST structure has not been resolved or if
5805 * there is no parameter with the same name as this expression. 4897 * there is no parameter with the same name as this expression.
5806 */ 4898 */
5807 ParameterElement get element; 4899 ParameterElement get element;
5808 4900
5809 /** 4901 /**
5810 * Return the expression with which the name is associated. 4902 * Return the expression with which the name is associated.
5811 */ 4903 */
5812 Expression get expression; 4904 Expression get expression;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
5885 /** 4977 /**
5886 * The "native" clause in an class declaration. 4978 * The "native" clause in an class declaration.
5887 * 4979 *
5888 * nativeClause ::= 4980 * nativeClause ::=
5889 * 'native' [StringLiteral] 4981 * 'native' [StringLiteral]
5890 * 4982 *
5891 * Clients may not extend, implement or mix-in this class. 4983 * Clients may not extend, implement or mix-in this class.
5892 */ 4984 */
5893 abstract class NativeClause extends AstNode { 4985 abstract class NativeClause extends AstNode {
5894 /** 4986 /**
5895 * Initialize a newly created native clause.
5896 */
5897 factory NativeClause(Token nativeKeyword, StringLiteral name) =>
5898 new NativeClauseImpl(nativeKeyword, name);
5899
5900 /**
5901 * Return the name of the native object that implements the class. 4987 * Return the name of the native object that implements the class.
5902 */ 4988 */
5903 StringLiteral get name; 4989 StringLiteral get name;
5904 4990
5905 /** 4991 /**
5906 * Set the name of the native object that implements the class to the given 4992 * Set the name of the native object that implements the class to the given
5907 * [name]. 4993 * [name].
5908 */ 4994 */
5909 void set name(StringLiteral name); 4995 void set name(StringLiteral name);
5910 4996
(...skipping 12 matching lines...) Expand all
5923 * A function body that consists of a native keyword followed by a string 5009 * A function body that consists of a native keyword followed by a string
5924 * literal. 5010 * literal.
5925 * 5011 *
5926 * nativeFunctionBody ::= 5012 * nativeFunctionBody ::=
5927 * 'native' [SimpleStringLiteral] ';' 5013 * 'native' [SimpleStringLiteral] ';'
5928 * 5014 *
5929 * Clients may not extend, implement or mix-in this class. 5015 * Clients may not extend, implement or mix-in this class.
5930 */ 5016 */
5931 abstract class NativeFunctionBody extends FunctionBody { 5017 abstract class NativeFunctionBody extends FunctionBody {
5932 /** 5018 /**
5933 * Initialize a newly created function body consisting of the 'native' token,
5934 * a string literal, and a semicolon.
5935 */
5936 factory NativeFunctionBody(
5937 Token nativeKeyword, StringLiteral stringLiteral, Token semicolon) =>
5938 new NativeFunctionBodyImpl(nativeKeyword, stringLiteral, semicolon);
5939
5940 /**
5941 * Return the token representing 'native' that marks the start of the function 5019 * Return the token representing 'native' that marks the start of the function
5942 * body. 5020 * body.
5943 */ 5021 */
5944 Token get nativeKeyword; 5022 Token get nativeKeyword;
5945 5023
5946 /** 5024 /**
5947 * Set the token representing 'native' that marks the start of the function 5025 * Set the token representing 'native' that marks the start of the function
5948 * body to the given [token]. 5026 * body to the given [token].
5949 */ 5027 */
5950 void set nativeKeyword(Token token); 5028 void set nativeKeyword(Token token);
(...skipping 22 matching lines...) Expand all
5973 void set stringLiteral(StringLiteral stringLiteral); 5051 void set stringLiteral(StringLiteral stringLiteral);
5974 } 5052 }
5975 5053
5976 /** 5054 /**
5977 * A list of AST nodes that have a common parent. 5055 * A list of AST nodes that have a common parent.
5978 * 5056 *
5979 * Clients may not extend, implement or mix-in this class. 5057 * Clients may not extend, implement or mix-in this class.
5980 */ 5058 */
5981 abstract class NodeList<E extends AstNode> implements List<E> { 5059 abstract class NodeList<E extends AstNode> implements List<E> {
5982 /** 5060 /**
5983 * Initialize a newly created list of nodes such that all of the nodes that
5984 * are added to the list will have their parent set to the given [owner]. The
5985 * list will initially be populated with the given [elements].
5986 */
5987 factory NodeList(AstNode owner, [List<E> elements]) =>
5988 new NodeListImpl<E>(owner as AstNodeImpl, elements);
5989
5990 /**
5991 * Return the first token included in this node list's source range, or `null` 5061 * Return the first token included in this node list's source range, or `null`
5992 * if the list is empty. 5062 * if the list is empty.
5993 */ 5063 */
5994 Token get beginToken; 5064 Token get beginToken;
5995 5065
5996 /** 5066 /**
5997 * Return the last token included in this node list's source range, or `null` 5067 * Return the last token included in this node list's source range, or `null`
5998 * if the list is empty. 5068 * if the list is empty.
5999 */ 5069 */
6000 Token get endToken; 5070 Token get endToken;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
6074 /** 5144 /**
6075 * A null literal expression. 5145 * A null literal expression.
6076 * 5146 *
6077 * nullLiteral ::= 5147 * nullLiteral ::=
6078 * 'null' 5148 * 'null'
6079 * 5149 *
6080 * Clients may not extend, implement or mix-in this class. 5150 * Clients may not extend, implement or mix-in this class.
6081 */ 5151 */
6082 abstract class NullLiteral extends Literal { 5152 abstract class NullLiteral extends Literal {
6083 /** 5153 /**
6084 * Initialize a newly created null literal.
6085 */
6086 factory NullLiteral(Token literal) = NullLiteralImpl;
6087
6088 /**
6089 * Return the token representing the literal. 5154 * Return the token representing the literal.
6090 */ 5155 */
6091 Token get literal; 5156 Token get literal;
6092 5157
6093 /** 5158 /**
6094 * Set the token representing the literal to the given [token]. 5159 * Set the token representing the literal to the given [token].
6095 */ 5160 */
6096 void set literal(Token token); 5161 void set literal(Token token);
6097 } 5162 }
6098 5163
6099 /** 5164 /**
6100 * A parenthesized expression. 5165 * A parenthesized expression.
6101 * 5166 *
6102 * parenthesizedExpression ::= 5167 * parenthesizedExpression ::=
6103 * '(' [Expression] ')' 5168 * '(' [Expression] ')'
6104 * 5169 *
6105 * Clients may not extend, implement or mix-in this class. 5170 * Clients may not extend, implement or mix-in this class.
6106 */ 5171 */
6107 abstract class ParenthesizedExpression extends Expression { 5172 abstract class ParenthesizedExpression extends Expression {
6108 /** 5173 /**
6109 * Initialize a newly created parenthesized expression.
6110 */
6111 factory ParenthesizedExpression(Token leftParenthesis, Expression expression,
6112 Token rightParenthesis) =>
6113 new ParenthesizedExpressionImpl(
6114 leftParenthesis, expression, rightParenthesis);
6115
6116 /**
6117 * Return the expression within the parentheses. 5174 * Return the expression within the parentheses.
6118 */ 5175 */
6119 Expression get expression; 5176 Expression get expression;
6120 5177
6121 /** 5178 /**
6122 * Set the expression within the parentheses to the given [expression]. 5179 * Set the expression within the parentheses to the given [expression].
6123 */ 5180 */
6124 void set expression(Expression expression); 5181 void set expression(Expression expression);
6125 5182
6126 /** 5183 /**
(...skipping 20 matching lines...) Expand all
6147 /** 5204 /**
6148 * A part directive. 5205 * A part directive.
6149 * 5206 *
6150 * partDirective ::= 5207 * partDirective ::=
6151 * [Annotation] 'part' [StringLiteral] ';' 5208 * [Annotation] 'part' [StringLiteral] ';'
6152 * 5209 *
6153 * Clients may not extend, implement or mix-in this class. 5210 * Clients may not extend, implement or mix-in this class.
6154 */ 5211 */
6155 abstract class PartDirective extends UriBasedDirective { 5212 abstract class PartDirective extends UriBasedDirective {
6156 /** 5213 /**
6157 * Initialize a newly created part directive. Either or both of the [comment]
6158 * and [metadata] can be `null` if the directive does not have the
6159 * corresponding attribute.
6160 */
6161 factory PartDirective(
6162 Comment comment,
6163 List<Annotation> metadata,
6164 Token partKeyword,
6165 StringLiteral partUri,
6166 Token semicolon) = PartDirectiveImpl;
6167
6168 /**
6169 * Return the token representing the 'part' keyword. 5214 * Return the token representing the 'part' keyword.
6170 */ 5215 */
6171 Token get partKeyword; 5216 Token get partKeyword;
6172 5217
6173 /** 5218 /**
6174 * Set the token representing the 'part' keyword to the given [token]. 5219 * Set the token representing the 'part' keyword to the given [token].
6175 */ 5220 */
6176 void set partKeyword(Token token); 5221 void set partKeyword(Token token);
6177 5222
6178 /** 5223 /**
(...skipping 10 matching lines...) Expand all
6189 /** 5234 /**
6190 * A part-of directive. 5235 * A part-of directive.
6191 * 5236 *
6192 * partOfDirective ::= 5237 * partOfDirective ::=
6193 * [Annotation] 'part' 'of' [Identifier] ';' 5238 * [Annotation] 'part' 'of' [Identifier] ';'
6194 * 5239 *
6195 * Clients may not extend, implement or mix-in this class. 5240 * Clients may not extend, implement or mix-in this class.
6196 */ 5241 */
6197 abstract class PartOfDirective extends Directive { 5242 abstract class PartOfDirective extends Directive {
6198 /** 5243 /**
6199 * Initialize a newly created part-of directive. Either or both of the
6200 * [comment] and [metadata] can be `null` if the directive does not have the
6201 * corresponding attribute. Only one of the [uri] and [libraryName] should be
6202 * provided.
6203 */
6204 factory PartOfDirective(
6205 Comment comment,
6206 List<Annotation> metadata,
6207 Token partKeyword,
6208 Token ofKeyword,
6209 StringLiteral uri,
6210 LibraryIdentifier libraryName,
6211 Token semicolon) =>
6212 new PartOfDirectiveImpl(comment, metadata, partKeyword, ofKeyword, uri,
6213 libraryName, semicolon);
6214
6215 /**
6216 * Return the name of the library that the containing compilation unit is part 5244 * Return the name of the library that the containing compilation unit is part
6217 * of. 5245 * of.
6218 */ 5246 */
6219 LibraryIdentifier get libraryName; 5247 LibraryIdentifier get libraryName;
6220 5248
6221 /** 5249 /**
6222 * Set the name of the library that the containing compilation unit is part of 5250 * Set the name of the library that the containing compilation unit is part of
6223 * to the given [libraryName]. 5251 * to the given [libraryName].
6224 */ 5252 */
6225 void set libraryName(LibraryIdentifier libraryName); 5253 void set libraryName(LibraryIdentifier libraryName);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
6273 * A postfix unary expression. 5301 * A postfix unary expression.
6274 * 5302 *
6275 * postfixExpression ::= 5303 * postfixExpression ::=
6276 * [Expression] [Token] 5304 * [Expression] [Token]
6277 * 5305 *
6278 * Clients may not extend, implement or mix-in this class. 5306 * Clients may not extend, implement or mix-in this class.
6279 */ 5307 */
6280 abstract class PostfixExpression extends Expression 5308 abstract class PostfixExpression extends Expression
6281 implements MethodReferenceExpression { 5309 implements MethodReferenceExpression {
6282 /** 5310 /**
6283 * Initialize a newly created postfix expression.
6284 */
6285 factory PostfixExpression(Expression operand, Token operator) =>
6286 new PostfixExpressionImpl(operand, operator);
6287
6288 /**
6289 * Return the expression computing the operand for the operator. 5311 * Return the expression computing the operand for the operator.
6290 */ 5312 */
6291 Expression get operand; 5313 Expression get operand;
6292 5314
6293 /** 5315 /**
6294 * Set the expression computing the operand for the operator to the given 5316 * Set the expression computing the operand for the operator to the given
6295 * [expression]. 5317 * [expression].
6296 */ 5318 */
6297 void set operand(Expression expression); 5319 void set operand(Expression expression);
6298 5320
(...skipping 12 matching lines...) Expand all
6311 * An identifier that is prefixed or an access to an object property where the 5333 * An identifier that is prefixed or an access to an object property where the
6312 * target of the property access is a simple identifier. 5334 * target of the property access is a simple identifier.
6313 * 5335 *
6314 * prefixedIdentifier ::= 5336 * prefixedIdentifier ::=
6315 * [SimpleIdentifier] '.' [SimpleIdentifier] 5337 * [SimpleIdentifier] '.' [SimpleIdentifier]
6316 * 5338 *
6317 * Clients may not extend, implement or mix-in this class. 5339 * Clients may not extend, implement or mix-in this class.
6318 */ 5340 */
6319 abstract class PrefixedIdentifier extends Identifier { 5341 abstract class PrefixedIdentifier extends Identifier {
6320 /** 5342 /**
6321 * Initialize a newly created prefixed identifier.
6322 */
6323 factory PrefixedIdentifier(
6324 SimpleIdentifier prefix, Token period, SimpleIdentifier identifier) =>
6325 new PrefixedIdentifierImpl(prefix, period, identifier);
6326
6327 /**
6328 * Return the identifier being prefixed. 5343 * Return the identifier being prefixed.
6329 */ 5344 */
6330 SimpleIdentifier get identifier; 5345 SimpleIdentifier get identifier;
6331 5346
6332 /** 5347 /**
6333 * Set the identifier being prefixed to the given [identifier]. 5348 * Set the identifier being prefixed to the given [identifier].
6334 */ 5349 */
6335 void set identifier(SimpleIdentifier identifier); 5350 void set identifier(SimpleIdentifier identifier);
6336 5351
6337 /** 5352 /**
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
6371 * A prefix unary expression. 5386 * A prefix unary expression.
6372 * 5387 *
6373 * prefixExpression ::= 5388 * prefixExpression ::=
6374 * [Token] [Expression] 5389 * [Token] [Expression]
6375 * 5390 *
6376 * Clients may not extend, implement or mix-in this class. 5391 * Clients may not extend, implement or mix-in this class.
6377 */ 5392 */
6378 abstract class PrefixExpression extends Expression 5393 abstract class PrefixExpression extends Expression
6379 implements MethodReferenceExpression { 5394 implements MethodReferenceExpression {
6380 /** 5395 /**
6381 * Initialize a newly created prefix expression.
6382 */
6383 factory PrefixExpression(Token operator, Expression operand) =>
6384 new PrefixExpressionImpl(operator, operand);
6385
6386 /**
6387 * Return the expression computing the operand for the operator. 5396 * Return the expression computing the operand for the operator.
6388 */ 5397 */
6389 Expression get operand; 5398 Expression get operand;
6390 5399
6391 /** 5400 /**
6392 * Set the expression computing the operand for the operator to the given 5401 * Set the expression computing the operand for the operator to the given
6393 * [expression]. 5402 * [expression].
6394 */ 5403 */
6395 void set operand(Expression expression); 5404 void set operand(Expression expression);
6396 5405
(...skipping 15 matching lines...) Expand all
6412 * as [PrefixedIdentifier] nodes in cases where the target is also a simple 5421 * as [PrefixedIdentifier] nodes in cases where the target is also a simple
6413 * identifier. 5422 * identifier.
6414 * 5423 *
6415 * propertyAccess ::= 5424 * propertyAccess ::=
6416 * [Expression] '.' [SimpleIdentifier] 5425 * [Expression] '.' [SimpleIdentifier]
6417 * 5426 *
6418 * Clients may not extend, implement or mix-in this class. 5427 * Clients may not extend, implement or mix-in this class.
6419 */ 5428 */
6420 abstract class PropertyAccess extends Expression { 5429 abstract class PropertyAccess extends Expression {
6421 /** 5430 /**
6422 * Initialize a newly created property access expression.
6423 */
6424 factory PropertyAccess(
6425 Expression target, Token operator, SimpleIdentifier propertyName) =>
6426 new PropertyAccessImpl(target, operator, propertyName);
6427
6428 /**
6429 * Return `true` if this expression is cascaded. If it is, then the target of 5431 * Return `true` if this expression is cascaded. If it is, then the target of
6430 * this expression is not stored locally but is stored in the nearest ancestor 5432 * this expression is not stored locally but is stored in the nearest ancestor
6431 * that is a [CascadeExpression]. 5433 * that is a [CascadeExpression].
6432 */ 5434 */
6433 bool get isCascaded; 5435 bool get isCascaded;
6434 5436
6435 /** 5437 /**
6436 * Return the property access operator. 5438 * Return the property access operator.
6437 */ 5439 */
6438 Token get operator; 5440 Token get operator;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
6481 * initialization list. 5483 * initialization list.
6482 * 5484 *
6483 * redirectingConstructorInvocation ::= 5485 * redirectingConstructorInvocation ::=
6484 * 'this' ('.' identifier)? arguments 5486 * 'this' ('.' identifier)? arguments
6485 * 5487 *
6486 * Clients may not extend, implement or mix-in this class. 5488 * Clients may not extend, implement or mix-in this class.
6487 */ 5489 */
6488 abstract class RedirectingConstructorInvocation extends ConstructorInitializer 5490 abstract class RedirectingConstructorInvocation extends ConstructorInitializer
6489 implements ConstructorReferenceNode { 5491 implements ConstructorReferenceNode {
6490 /** 5492 /**
6491 * Initialize a newly created redirecting invocation to invoke the constructor
6492 * with the given name with the given arguments. The [constructorName] can be
6493 * `null` if the constructor being invoked is the unnamed constructor.
6494 */
6495 factory RedirectingConstructorInvocation(Token thisKeyword, Token period,
6496 SimpleIdentifier constructorName, ArgumentList argumentList) =>
6497 new RedirectingConstructorInvocationImpl(
6498 thisKeyword, period, constructorName, argumentList);
6499
6500 /**
6501 * Return the list of arguments to the constructor. 5493 * Return the list of arguments to the constructor.
6502 */ 5494 */
6503 ArgumentList get argumentList; 5495 ArgumentList get argumentList;
6504 5496
6505 /** 5497 /**
6506 * Set the list of arguments to the constructor to the given [argumentList]. 5498 * Set the list of arguments to the constructor to the given [argumentList].
6507 */ 5499 */
6508 void set argumentList(ArgumentList argumentList); 5500 void set argumentList(ArgumentList argumentList);
6509 5501
6510 /** 5502 /**
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
6545 /** 5537 /**
6546 * A rethrow expression. 5538 * A rethrow expression.
6547 * 5539 *
6548 * rethrowExpression ::= 5540 * rethrowExpression ::=
6549 * 'rethrow' 5541 * 'rethrow'
6550 * 5542 *
6551 * Clients may not extend, implement or mix-in this class. 5543 * Clients may not extend, implement or mix-in this class.
6552 */ 5544 */
6553 abstract class RethrowExpression extends Expression { 5545 abstract class RethrowExpression extends Expression {
6554 /** 5546 /**
6555 * Initialize a newly created rethrow expression.
6556 */
6557 factory RethrowExpression(Token rethrowKeyword) = RethrowExpressionImpl;
6558
6559 /**
6560 * Return the token representing the 'rethrow' keyword. 5547 * Return the token representing the 'rethrow' keyword.
6561 */ 5548 */
6562 Token get rethrowKeyword; 5549 Token get rethrowKeyword;
6563 5550
6564 /** 5551 /**
6565 * Set the token representing the 'rethrow' keyword to the given [token]. 5552 * Set the token representing the 'rethrow' keyword to the given [token].
6566 */ 5553 */
6567 void set rethrowKeyword(Token token); 5554 void set rethrowKeyword(Token token);
6568 } 5555 }
6569 5556
6570 /** 5557 /**
6571 * A return statement. 5558 * A return statement.
6572 * 5559 *
6573 * returnStatement ::= 5560 * returnStatement ::=
6574 * 'return' [Expression]? ';' 5561 * 'return' [Expression]? ';'
6575 * 5562 *
6576 * Clients may not extend, implement or mix-in this class. 5563 * Clients may not extend, implement or mix-in this class.
6577 */ 5564 */
6578 abstract class ReturnStatement extends Statement { 5565 abstract class ReturnStatement extends Statement {
6579 /** 5566 /**
6580 * Initialize a newly created return statement. The [expression] can be `null`
6581 * if no explicit value was provided.
6582 */
6583 factory ReturnStatement(
6584 Token returnKeyword, Expression expression, Token semicolon) =>
6585 new ReturnStatementImpl(returnKeyword, expression, semicolon);
6586
6587 /**
6588 * Return the expression computing the value to be returned, or `null` if no 5567 * Return the expression computing the value to be returned, or `null` if no
6589 * explicit value was provided. 5568 * explicit value was provided.
6590 */ 5569 */
6591 Expression get expression; 5570 Expression get expression;
6592 5571
6593 /** 5572 /**
6594 * Set the expression computing the value to be returned to the given 5573 * Set the expression computing the value to be returned to the given
6595 * [expression]. 5574 * [expression].
6596 */ 5575 */
6597 void set expression(Expression expression); 5576 void set expression(Expression expression);
(...skipping 22 matching lines...) Expand all
6620 /** 5599 /**
6621 * A script tag that can optionally occur at the beginning of a compilation unit . 5600 * A script tag that can optionally occur at the beginning of a compilation unit .
6622 * 5601 *
6623 * scriptTag ::= 5602 * scriptTag ::=
6624 * '#!' (~NEWLINE)* NEWLINE 5603 * '#!' (~NEWLINE)* NEWLINE
6625 * 5604 *
6626 * Clients may not extend, implement or mix-in this class. 5605 * Clients may not extend, implement or mix-in this class.
6627 */ 5606 */
6628 abstract class ScriptTag extends AstNode { 5607 abstract class ScriptTag extends AstNode {
6629 /** 5608 /**
6630 * Initialize a newly created script tag.
6631 */
6632 factory ScriptTag(Token scriptTag) = ScriptTagImpl;
6633
6634 /**
6635 * Return the token representing this script tag. 5609 * Return the token representing this script tag.
6636 */ 5610 */
6637 Token get scriptTag; 5611 Token get scriptTag;
6638 5612
6639 /** 5613 /**
6640 * Set the token representing this script tag to the given [token]. 5614 * Set the token representing this script tag to the given [token].
6641 */ 5615 */
6642 void set scriptTag(Token token); 5616 void set scriptTag(Token token);
6643 } 5617 }
6644 5618
6645 /** 5619 /**
6646 * A combinator that restricts the names being imported to those in a given list . 5620 * A combinator that restricts the names being imported to those in a given list .
6647 * 5621 *
6648 * showCombinator ::= 5622 * showCombinator ::=
6649 * 'show' [SimpleIdentifier] (',' [SimpleIdentifier])* 5623 * 'show' [SimpleIdentifier] (',' [SimpleIdentifier])*
6650 * 5624 *
6651 * Clients may not extend, implement or mix-in this class. 5625 * Clients may not extend, implement or mix-in this class.
6652 */ 5626 */
6653 abstract class ShowCombinator extends Combinator { 5627 abstract class ShowCombinator extends Combinator {
6654 /** 5628 /**
6655 * Initialize a newly created import show combinator.
6656 */
6657 factory ShowCombinator(Token keyword, List<SimpleIdentifier> shownNames) =
6658 ShowCombinatorImpl;
6659
6660 /**
6661 * Return the list of names from the library that are made visible by this 5629 * Return the list of names from the library that are made visible by this
6662 * combinator. 5630 * combinator.
6663 */ 5631 */
6664 NodeList<SimpleIdentifier> get shownNames; 5632 NodeList<SimpleIdentifier> get shownNames;
6665 } 5633 }
6666 5634
6667 /** 5635 /**
6668 * A simple formal parameter. 5636 * A simple formal parameter.
6669 * 5637 *
6670 * simpleFormalParameter ::= 5638 * simpleFormalParameter ::=
6671 * ('final' [TypeName] | 'var' | [TypeName])? [SimpleIdentifier] 5639 * ('final' [TypeName] | 'var' | [TypeName])? [SimpleIdentifier]
6672 * 5640 *
6673 * Clients may not extend, implement or mix-in this class. 5641 * Clients may not extend, implement or mix-in this class.
6674 */ 5642 */
6675 abstract class SimpleFormalParameter extends NormalFormalParameter { 5643 abstract class SimpleFormalParameter extends NormalFormalParameter {
6676 /** 5644 /**
6677 * Initialize a newly created formal parameter. Either or both of the
6678 * [comment] and [metadata] can be `null` if the parameter does not have the
6679 * corresponding attribute. The [keyword] can be `null` if a type was
6680 * specified. The [type] must be `null` if the keyword is 'var'.
6681 */
6682 factory SimpleFormalParameter(Comment comment, List<Annotation> metadata,
6683 Token keyword, TypeName type, SimpleIdentifier identifier) =>
6684 new SimpleFormalParameterImpl(
6685 comment, metadata, keyword, type, identifier);
6686
6687 /**
6688 * Return the token representing either the 'final', 'const' or 'var' keyword, 5645 * Return the token representing either the 'final', 'const' or 'var' keyword,
6689 * or `null` if no keyword was used. 5646 * or `null` if no keyword was used.
6690 */ 5647 */
6691 Token get keyword; 5648 Token get keyword;
6692 5649
6693 /** 5650 /**
6694 * Set the token representing either the 'final', 'const' or 'var' keyword to 5651 * Set the token representing either the 'final', 'const' or 'var' keyword to
6695 * the given [token]. 5652 * the given [token].
6696 */ 5653 */
6697 void set keyword(Token token); 5654 void set keyword(Token token);
(...skipping 17 matching lines...) Expand all
6715 * initialCharacter internalCharacter* 5672 * initialCharacter internalCharacter*
6716 * 5673 *
6717 * initialCharacter ::= '_' | '$' | letter 5674 * initialCharacter ::= '_' | '$' | letter
6718 * 5675 *
6719 * internalCharacter ::= '_' | '$' | letter | digit 5676 * internalCharacter ::= '_' | '$' | letter | digit
6720 * 5677 *
6721 * Clients may not extend, implement or mix-in this class. 5678 * Clients may not extend, implement or mix-in this class.
6722 */ 5679 */
6723 abstract class SimpleIdentifier extends Identifier { 5680 abstract class SimpleIdentifier extends Identifier {
6724 /** 5681 /**
6725 * Initialize a newly created identifier.
6726 */
6727 factory SimpleIdentifier(Token token, {bool isDeclaration: false}) {
6728 if (isDeclaration) {
6729 return new DeclaredSimpleIdentifier(token);
6730 }
6731 return new SimpleIdentifierImpl(token);
6732 }
6733
6734 /**
6735 * Return the auxiliary elements associated with this identifier, or `null` if 5682 * Return the auxiliary elements associated with this identifier, or `null` if
6736 * this identifier is not in both a getter and setter context. The auxiliary 5683 * this identifier is not in both a getter and setter context. The auxiliary
6737 * elements hold the static and propagated elements associated with the getter 5684 * elements hold the static and propagated elements associated with the getter
6738 * context. 5685 * context.
6739 */ 5686 */
6740 // TODO(brianwilkerson) Replace this API. 5687 // TODO(brianwilkerson) Replace this API.
6741 AuxiliaryElements get auxiliaryElements; 5688 AuxiliaryElements get auxiliaryElements;
6742 5689
6743 /** 5690 /**
6744 * Set the auxiliary elements associated with this identifier to the given 5691 * Set the auxiliary elements associated with this identifier to the given
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
6822 * | '"""' characters '"""' 5769 * | '"""' characters '"""'
6823 * 5770 *
6824 * singleLineStringLiteral ::= 5771 * singleLineStringLiteral ::=
6825 * "'" characters "'" 5772 * "'" characters "'"
6826 * | '"' characters '"' 5773 * | '"' characters '"'
6827 * 5774 *
6828 * Clients may not extend, implement or mix-in this class. 5775 * Clients may not extend, implement or mix-in this class.
6829 */ 5776 */
6830 abstract class SimpleStringLiteral extends SingleStringLiteral { 5777 abstract class SimpleStringLiteral extends SingleStringLiteral {
6831 /** 5778 /**
6832 * Initialize a newly created simple string literal.
6833 */
6834 factory SimpleStringLiteral(Token literal, String value) =
6835 SimpleStringLiteralImpl;
6836
6837 /**
6838 * Return the token representing the literal. 5779 * Return the token representing the literal.
6839 */ 5780 */
6840 Token get literal; 5781 Token get literal;
6841 5782
6842 /** 5783 /**
6843 * Set the token representing the literal to the given [token]. 5784 * Set the token representing the literal to the given [token].
6844 */ 5785 */
6845 void set literal(Token token); 5786 void set literal(Token token);
6846 5787
6847 /** 5788 /**
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
6926 * A string interpolation literal. 5867 * A string interpolation literal.
6927 * 5868 *
6928 * stringInterpolation ::= 5869 * stringInterpolation ::=
6929 * ''' [InterpolationElement]* ''' 5870 * ''' [InterpolationElement]* '''
6930 * | '"' [InterpolationElement]* '"' 5871 * | '"' [InterpolationElement]* '"'
6931 * 5872 *
6932 * Clients may not extend, implement or mix-in this class. 5873 * Clients may not extend, implement or mix-in this class.
6933 */ 5874 */
6934 abstract class StringInterpolation extends SingleStringLiteral { 5875 abstract class StringInterpolation extends SingleStringLiteral {
6935 /** 5876 /**
6936 * Initialize a newly created string interpolation expression.
6937 */
6938 factory StringInterpolation(List<InterpolationElement> elements) =
6939 StringInterpolationImpl;
6940
6941 /**
6942 * Return the elements that will be composed to produce the resulting string. 5877 * Return the elements that will be composed to produce the resulting string.
6943 */ 5878 */
6944 NodeList<InterpolationElement> get elements; 5879 NodeList<InterpolationElement> get elements;
6945 } 5880 }
6946 5881
6947 /** 5882 /**
6948 * A string literal expression. 5883 * A string literal expression.
6949 * 5884 *
6950 * stringLiteral ::= 5885 * stringLiteral ::=
6951 * [SimpleStringLiteral] 5886 * [SimpleStringLiteral]
(...skipping 15 matching lines...) Expand all
6967 * initialization list. 5902 * initialization list.
6968 * 5903 *
6969 * superInvocation ::= 5904 * superInvocation ::=
6970 * 'super' ('.' [SimpleIdentifier])? [ArgumentList] 5905 * 'super' ('.' [SimpleIdentifier])? [ArgumentList]
6971 * 5906 *
6972 * Clients may not extend, implement or mix-in this class. 5907 * Clients may not extend, implement or mix-in this class.
6973 */ 5908 */
6974 abstract class SuperConstructorInvocation extends ConstructorInitializer 5909 abstract class SuperConstructorInvocation extends ConstructorInitializer
6975 implements ConstructorReferenceNode { 5910 implements ConstructorReferenceNode {
6976 /** 5911 /**
6977 * Initialize a newly created super invocation to invoke the inherited
6978 * constructor with the given name with the given arguments. The [period] and
6979 * [constructorName] can be `null` if the constructor being invoked is the
6980 * unnamed constructor.
6981 */
6982 factory SuperConstructorInvocation(Token superKeyword, Token period,
6983 SimpleIdentifier constructorName, ArgumentList argumentList) =>
6984 new SuperConstructorInvocationImpl(
6985 superKeyword, period, constructorName, argumentList);
6986
6987 /**
6988 * Return the list of arguments to the constructor. 5912 * Return the list of arguments to the constructor.
6989 */ 5913 */
6990 ArgumentList get argumentList; 5914 ArgumentList get argumentList;
6991 5915
6992 /** 5916 /**
6993 * Set the list of arguments to the constructor to the given [argumentList]. 5917 * Set the list of arguments to the constructor to the given [argumentList].
6994 */ 5918 */
6995 void set argumentList(ArgumentList argumentList); 5919 void set argumentList(ArgumentList argumentList);
6996 5920
6997 /** 5921 /**
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
7032 /** 5956 /**
7033 * A super expression. 5957 * A super expression.
7034 * 5958 *
7035 * superExpression ::= 5959 * superExpression ::=
7036 * 'super' 5960 * 'super'
7037 * 5961 *
7038 * Clients may not extend, implement or mix-in this class. 5962 * Clients may not extend, implement or mix-in this class.
7039 */ 5963 */
7040 abstract class SuperExpression extends Expression { 5964 abstract class SuperExpression extends Expression {
7041 /** 5965 /**
7042 * Initialize a newly created super expression.
7043 */
7044 factory SuperExpression(Token superKeyword) = SuperExpressionImpl;
7045
7046 /**
7047 * Return the token representing the 'super' keyword. 5966 * Return the token representing the 'super' keyword.
7048 */ 5967 */
7049 Token get superKeyword; 5968 Token get superKeyword;
7050 5969
7051 /** 5970 /**
7052 * Set the token representing the 'super' keyword to the given [token]. 5971 * Set the token representing the 'super' keyword to the given [token].
7053 */ 5972 */
7054 void set superKeyword(Token token); 5973 void set superKeyword(Token token);
7055 } 5974 }
7056 5975
7057 /** 5976 /**
7058 * A case in a switch statement. 5977 * A case in a switch statement.
7059 * 5978 *
7060 * switchCase ::= 5979 * switchCase ::=
7061 * [SimpleIdentifier]* 'case' [Expression] ':' [Statement]* 5980 * [SimpleIdentifier]* 'case' [Expression] ':' [Statement]*
7062 * 5981 *
7063 * Clients may not extend, implement or mix-in this class. 5982 * Clients may not extend, implement or mix-in this class.
7064 */ 5983 */
7065 abstract class SwitchCase extends SwitchMember { 5984 abstract class SwitchCase extends SwitchMember {
7066 /** 5985 /**
7067 * Initialize a newly created switch case. The list of [labels] can be `null`
7068 * if there are no labels.
7069 */
7070 factory SwitchCase(List<Label> labels, Token keyword, Expression expression,
7071 Token colon, List<Statement> statements) =>
7072 new SwitchCaseImpl(labels, keyword, expression, colon, statements);
7073
7074 /**
7075 * Return the expression controlling whether the statements will be executed. 5986 * Return the expression controlling whether the statements will be executed.
7076 */ 5987 */
7077 Expression get expression; 5988 Expression get expression;
7078 5989
7079 /** 5990 /**
7080 * Set the expression controlling whether the statements will be executed to 5991 * Set the expression controlling whether the statements will be executed to
7081 * the given [expression]. 5992 * the given [expression].
7082 */ 5993 */
7083 void set expression(Expression expression); 5994 void set expression(Expression expression);
7084 } 5995 }
7085 5996
7086 /** 5997 /**
7087 * The default case in a switch statement. 5998 * The default case in a switch statement.
7088 * 5999 *
7089 * switchDefault ::= 6000 * switchDefault ::=
7090 * [SimpleIdentifier]* 'default' ':' [Statement]* 6001 * [SimpleIdentifier]* 'default' ':' [Statement]*
7091 * 6002 *
7092 * Clients may not extend, implement or mix-in this class. 6003 * Clients may not extend, implement or mix-in this class.
7093 */ 6004 */
7094 abstract class SwitchDefault extends SwitchMember { 6005 abstract class SwitchDefault extends SwitchMember {}
7095 /**
7096 * Initialize a newly created switch default. The list of [labels] can be
7097 * `null` if there are no labels.
7098 */
7099 factory SwitchDefault(List<Label> labels, Token keyword, Token colon,
7100 List<Statement> statements) = SwitchDefaultImpl;
7101 }
7102 6006
7103 /** 6007 /**
7104 * An element within a switch statement. 6008 * An element within a switch statement.
7105 * 6009 *
7106 * switchMember ::= 6010 * switchMember ::=
7107 * switchCase 6011 * switchCase
7108 * | switchDefault 6012 * | switchDefault
7109 * 6013 *
7110 * Clients may not extend, implement or mix-in this class. 6014 * Clients may not extend, implement or mix-in this class.
7111 */ 6015 */
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
7148 /** 6052 /**
7149 * A switch statement. 6053 * A switch statement.
7150 * 6054 *
7151 * switchStatement ::= 6055 * switchStatement ::=
7152 * 'switch' '(' [Expression] ')' '{' [SwitchCase]* [SwitchDefault]? '}' 6056 * 'switch' '(' [Expression] ')' '{' [SwitchCase]* [SwitchDefault]? '}'
7153 * 6057 *
7154 * Clients may not extend, implement or mix-in this class. 6058 * Clients may not extend, implement or mix-in this class.
7155 */ 6059 */
7156 abstract class SwitchStatement extends Statement { 6060 abstract class SwitchStatement extends Statement {
7157 /** 6061 /**
7158 * Initialize a newly created switch statement. The list of [members] can be
7159 * `null` if there are no switch members.
7160 */
7161 factory SwitchStatement(
7162 Token switchKeyword,
7163 Token leftParenthesis,
7164 Expression expression,
7165 Token rightParenthesis,
7166 Token leftBracket,
7167 List<SwitchMember> members,
7168 Token rightBracket) =>
7169 new SwitchStatementImpl(switchKeyword, leftParenthesis, expression,
7170 rightParenthesis, leftBracket, members, rightBracket);
7171
7172 /**
7173 * Return the expression used to determine which of the switch members will be 6062 * Return the expression used to determine which of the switch members will be
7174 * selected. 6063 * selected.
7175 */ 6064 */
7176 Expression get expression; 6065 Expression get expression;
7177 6066
7178 /** 6067 /**
7179 * Set the expression used to determine which of the switch members will be 6068 * Set the expression used to determine which of the switch members will be
7180 * selected to the given [expression]. 6069 * selected to the given [expression].
7181 */ 6070 */
7182 void set expression(Expression expression); 6071 void set expression(Expression expression);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
7240 /** 6129 /**
7241 * A symbol literal expression. 6130 * A symbol literal expression.
7242 * 6131 *
7243 * symbolLiteral ::= 6132 * symbolLiteral ::=
7244 * '#' (operator | (identifier ('.' identifier)*)) 6133 * '#' (operator | (identifier ('.' identifier)*))
7245 * 6134 *
7246 * Clients may not extend, implement or mix-in this class. 6135 * Clients may not extend, implement or mix-in this class.
7247 */ 6136 */
7248 abstract class SymbolLiteral extends Literal { 6137 abstract class SymbolLiteral extends Literal {
7249 /** 6138 /**
7250 * Initialize a newly created symbol literal.
7251 */
7252 factory SymbolLiteral(Token poundSign, List<Token> components) =
7253 SymbolLiteralImpl;
7254
7255 /**
7256 * Return the components of the literal. 6139 * Return the components of the literal.
7257 */ 6140 */
7258 List<Token> get components; 6141 List<Token> get components;
7259 6142
7260 /** 6143 /**
7261 * Return the token introducing the literal. 6144 * Return the token introducing the literal.
7262 */ 6145 */
7263 Token get poundSign; 6146 Token get poundSign;
7264 6147
7265 /** 6148 /**
7266 * Set the token introducing the literal to the given [token]. 6149 * Set the token introducing the literal to the given [token].
7267 */ 6150 */
7268 void set poundSign(Token token); 6151 void set poundSign(Token token);
7269 } 6152 }
7270 6153
7271 /** 6154 /**
7272 * A this expression. 6155 * A this expression.
7273 * 6156 *
7274 * thisExpression ::= 6157 * thisExpression ::=
7275 * 'this' 6158 * 'this'
7276 * 6159 *
7277 * Clients may not extend, implement or mix-in this class. 6160 * Clients may not extend, implement or mix-in this class.
7278 */ 6161 */
7279 abstract class ThisExpression extends Expression { 6162 abstract class ThisExpression extends Expression {
7280 /** 6163 /**
7281 * Initialize a newly created this expression.
7282 */
7283 factory ThisExpression(Token thisKeyword) = ThisExpressionImpl;
7284
7285 /**
7286 * Return the token representing the 'this' keyword. 6164 * Return the token representing the 'this' keyword.
7287 */ 6165 */
7288 Token get thisKeyword; 6166 Token get thisKeyword;
7289 6167
7290 /** 6168 /**
7291 * Set the token representing the 'this' keyword to the given [token]. 6169 * Set the token representing the 'this' keyword to the given [token].
7292 */ 6170 */
7293 void set thisKeyword(Token token); 6171 void set thisKeyword(Token token);
7294 } 6172 }
7295 6173
7296 /** 6174 /**
7297 * A throw expression. 6175 * A throw expression.
7298 * 6176 *
7299 * throwExpression ::= 6177 * throwExpression ::=
7300 * 'throw' [Expression] 6178 * 'throw' [Expression]
7301 * 6179 *
7302 * Clients may not extend, implement or mix-in this class. 6180 * Clients may not extend, implement or mix-in this class.
7303 */ 6181 */
7304 abstract class ThrowExpression extends Expression { 6182 abstract class ThrowExpression extends Expression {
7305 /** 6183 /**
7306 * Initialize a newly created throw expression.
7307 */
7308 factory ThrowExpression(Token throwKeyword, Expression expression) =>
7309 new ThrowExpressionImpl(throwKeyword, expression);
7310
7311 /**
7312 * Return the expression computing the exception to be thrown. 6184 * Return the expression computing the exception to be thrown.
7313 */ 6185 */
7314 Expression get expression; 6186 Expression get expression;
7315 6187
7316 /** 6188 /**
7317 * Set the expression computing the exception to be thrown to the given 6189 * Set the expression computing the exception to be thrown to the given
7318 * [expression]. 6190 * [expression].
7319 */ 6191 */
7320 void set expression(Expression expression); 6192 void set expression(Expression expression);
7321 6193
(...skipping 12 matching lines...) Expand all
7334 * The declaration of one or more top-level variables of the same type. 6206 * The declaration of one or more top-level variables of the same type.
7335 * 6207 *
7336 * topLevelVariableDeclaration ::= 6208 * topLevelVariableDeclaration ::=
7337 * ('final' | 'const') type? staticFinalDeclarationList ';' 6209 * ('final' | 'const') type? staticFinalDeclarationList ';'
7338 * | variableDeclaration ';' 6210 * | variableDeclaration ';'
7339 * 6211 *
7340 * Clients may not extend, implement or mix-in this class. 6212 * Clients may not extend, implement or mix-in this class.
7341 */ 6213 */
7342 abstract class TopLevelVariableDeclaration extends CompilationUnitMember { 6214 abstract class TopLevelVariableDeclaration extends CompilationUnitMember {
7343 /** 6215 /**
7344 * Initialize a newly created top-level variable declaration. Either or both
7345 * of the [comment] and [metadata] can be `null` if the variable does not have
7346 * the corresponding attribute.
7347 */
7348 factory TopLevelVariableDeclaration(
7349 Comment comment,
7350 List<Annotation> metadata,
7351 VariableDeclarationList variableList,
7352 Token semicolon) =>
7353 new TopLevelVariableDeclarationImpl(
7354 comment, metadata, variableList, semicolon);
7355
7356 /**
7357 * Return the semicolon terminating the declaration. 6216 * Return the semicolon terminating the declaration.
7358 */ 6217 */
7359 Token get semicolon; 6218 Token get semicolon;
7360 6219
7361 /** 6220 /**
7362 * Set the semicolon terminating the declaration to the given [token]. 6221 * Set the semicolon terminating the declaration to the given [token].
7363 */ 6222 */
7364 void set semicolon(Token token); 6223 void set semicolon(Token token);
7365 6224
7366 /** 6225 /**
(...skipping 14 matching lines...) Expand all
7381 * tryStatement ::= 6240 * tryStatement ::=
7382 * 'try' [Block] ([CatchClause]+ finallyClause? | finallyClause) 6241 * 'try' [Block] ([CatchClause]+ finallyClause? | finallyClause)
7383 * 6242 *
7384 * finallyClause ::= 6243 * finallyClause ::=
7385 * 'finally' [Block] 6244 * 'finally' [Block]
7386 * 6245 *
7387 * Clients may not extend, implement or mix-in this class. 6246 * Clients may not extend, implement or mix-in this class.
7388 */ 6247 */
7389 abstract class TryStatement extends Statement { 6248 abstract class TryStatement extends Statement {
7390 /** 6249 /**
7391 * Initialize a newly created try statement. The list of [catchClauses] can be
7392 * `null` if there are no catch clauses. The [finallyKeyword] and
7393 * [finallyBlock] can be `null` if there is no finally clause.
7394 */
7395 factory TryStatement(
7396 Token tryKeyword,
7397 Block body,
7398 List<CatchClause> catchClauses,
7399 Token finallyKeyword,
7400 Block finallyBlock) =>
7401 new TryStatementImpl(
7402 tryKeyword, body, catchClauses, finallyKeyword, finallyBlock);
7403
7404 /**
7405 * Return the body of the statement. 6250 * Return the body of the statement.
7406 */ 6251 */
7407 Block get body; 6252 Block get body;
7408 6253
7409 /** 6254 /**
7410 * Set the body of the statement to the given [block]. 6255 * Set the body of the statement to the given [block].
7411 */ 6256 */
7412 void set body(Block block); 6257 void set body(Block block);
7413 6258
7414 /** 6259 /**
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
7486 /** 6331 /**
7487 * A list of type arguments. 6332 * A list of type arguments.
7488 * 6333 *
7489 * typeArguments ::= 6334 * typeArguments ::=
7490 * '<' typeName (',' typeName)* '>' 6335 * '<' typeName (',' typeName)* '>'
7491 * 6336 *
7492 * Clients may not extend, implement or mix-in this class. 6337 * Clients may not extend, implement or mix-in this class.
7493 */ 6338 */
7494 abstract class TypeArgumentList extends AstNode { 6339 abstract class TypeArgumentList extends AstNode {
7495 /** 6340 /**
7496 * Initialize a newly created list of type arguments.
7497 */
7498 factory TypeArgumentList(
7499 Token leftBracket, List<TypeName> arguments, Token rightBracket) =
7500 TypeArgumentListImpl;
7501
7502 /**
7503 * Return the type arguments associated with the type. 6341 * Return the type arguments associated with the type.
7504 */ 6342 */
7505 NodeList<TypeName> get arguments; 6343 NodeList<TypeName> get arguments;
7506 6344
7507 /** 6345 /**
7508 * Return the left bracket. 6346 * Return the left bracket.
7509 */ 6347 */
7510 Token get leftBracket; 6348 Token get leftBracket;
7511 6349
7512 /** 6350 /**
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
7562 /** 6400 /**
7563 * The name of a type, which can optionally include type arguments. 6401 * The name of a type, which can optionally include type arguments.
7564 * 6402 *
7565 * typeName ::= 6403 * typeName ::=
7566 * [Identifier] typeArguments? 6404 * [Identifier] typeArguments?
7567 * 6405 *
7568 * Clients may not extend, implement or mix-in this class. 6406 * Clients may not extend, implement or mix-in this class.
7569 */ 6407 */
7570 abstract class TypeName extends AstNode { 6408 abstract class TypeName extends AstNode {
7571 /** 6409 /**
7572 * Initialize a newly created type name. The [typeArguments] can be `null` if
7573 * there are no type arguments.
7574 */
7575 factory TypeName(Identifier name, TypeArgumentList typeArguments,
7576 {Token question: null}) =>
7577 new TypeNameImpl(name, typeArguments, question);
7578
7579 /**
7580 * Return `true` if this type is a deferred type. 6410 * Return `true` if this type is a deferred type.
7581 * 6411 *
7582 * 15.1 Static Types: A type <i>T</i> is deferred iff it is of the form 6412 * 15.1 Static Types: A type <i>T</i> is deferred iff it is of the form
7583 * </i>p.T</i> where <i>p</i> is a deferred prefix. 6413 * </i>p.T</i> where <i>p</i> is a deferred prefix.
7584 */ 6414 */
7585 bool get isDeferred; 6415 bool get isDeferred;
7586 6416
7587 /** 6417 /**
7588 * Return the name of the type. 6418 * Return the name of the type.
7589 */ 6419 */
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
7633 /** 6463 /**
7634 * A type parameter. 6464 * A type parameter.
7635 * 6465 *
7636 * typeParameter ::= 6466 * typeParameter ::=
7637 * [SimpleIdentifier] ('extends' [TypeName])? 6467 * [SimpleIdentifier] ('extends' [TypeName])?
7638 * 6468 *
7639 * Clients may not extend, implement or mix-in this class. 6469 * Clients may not extend, implement or mix-in this class.
7640 */ 6470 */
7641 abstract class TypeParameter extends Declaration { 6471 abstract class TypeParameter extends Declaration {
7642 /** 6472 /**
7643 * Initialize a newly created type parameter. Either or both of the [comment]
7644 * and [metadata] can be `null` if the parameter does not have the
7645 * corresponding attribute. The [extendsKeyword] and [bound] can be `null` if
7646 * the parameter does not have an upper bound.
7647 */
7648 factory TypeParameter(Comment comment, List<Annotation> metadata,
7649 SimpleIdentifier name, Token extendsKeyword, TypeName bound) =>
7650 new TypeParameterImpl(comment, metadata, name, extendsKeyword, bound);
7651
7652 /**
7653 * Return the name of the upper bound for legal arguments, or `null` if there 6473 * Return the name of the upper bound for legal arguments, or `null` if there
7654 * is no explicit upper bound. 6474 * is no explicit upper bound.
7655 */ 6475 */
7656 TypeName get bound; 6476 TypeName get bound;
7657 6477
7658 /** 6478 /**
7659 * Set the name of the upper bound for legal arguments to the given 6479 * Set the name of the upper bound for legal arguments to the given
7660 * [typeName]. 6480 * [typeName].
7661 */ 6481 */
7662 void set bound(TypeName typeName); 6482 void set bound(TypeName typeName);
(...skipping 23 matching lines...) Expand all
7686 /** 6506 /**
7687 * Type parameters within a declaration. 6507 * Type parameters within a declaration.
7688 * 6508 *
7689 * typeParameterList ::= 6509 * typeParameterList ::=
7690 * '<' [TypeParameter] (',' [TypeParameter])* '>' 6510 * '<' [TypeParameter] (',' [TypeParameter])* '>'
7691 * 6511 *
7692 * Clients may not extend, implement or mix-in this class. 6512 * Clients may not extend, implement or mix-in this class.
7693 */ 6513 */
7694 abstract class TypeParameterList extends AstNode { 6514 abstract class TypeParameterList extends AstNode {
7695 /** 6515 /**
7696 * Initialize a newly created list of type parameters.
7697 */
7698 factory TypeParameterList(
7699 Token leftBracket,
7700 List<TypeParameter> typeParameters,
7701 Token rightBracket) = TypeParameterListImpl;
7702
7703 /**
7704 * Return the left angle bracket. 6516 * Return the left angle bracket.
7705 */ 6517 */
7706 Token get leftBracket; 6518 Token get leftBracket;
7707 6519
7708 /** 6520 /**
7709 * Return the right angle bracket. 6521 * Return the right angle bracket.
7710 */ 6522 */
7711 Token get rightBracket; 6523 Token get rightBracket;
7712 6524
7713 /** 6525 /**
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
7786 * [SimpleIdentifier] ('=' [Expression])? 6598 * [SimpleIdentifier] ('=' [Expression])?
7787 * 6599 *
7788 * TODO(paulberry): the grammar does not allow metadata to be associated with 6600 * TODO(paulberry): the grammar does not allow metadata to be associated with
7789 * a VariableDeclaration, and currently we don't record comments for it either. 6601 * a VariableDeclaration, and currently we don't record comments for it either.
7790 * Consider changing the class hierarchy so that [VariableDeclaration] does not 6602 * Consider changing the class hierarchy so that [VariableDeclaration] does not
7791 * extend [Declaration]. 6603 * extend [Declaration].
7792 * 6604 *
7793 * Clients may not extend, implement or mix-in this class. 6605 * Clients may not extend, implement or mix-in this class.
7794 */ 6606 */
7795 abstract class VariableDeclaration extends Declaration { 6607 abstract class VariableDeclaration extends Declaration {
7796 /**
7797 * Initialize a newly created variable declaration. The [equals] and
7798 * [initializer] can be `null` if there is no initializer.
7799 */
7800 factory VariableDeclaration(
7801 SimpleIdentifier name, Token equals, Expression initializer) =>
7802 new VariableDeclarationImpl(name, equals, initializer);
7803
7804 @override 6608 @override
7805 VariableElement get element; 6609 VariableElement get element;
7806 6610
7807 /** 6611 /**
7808 * Return the equal sign separating the variable name from the initial value, 6612 * Return the equal sign separating the variable name from the initial value,
7809 * or `null` if the initial value was not specified. 6613 * or `null` if the initial value was not specified.
7810 */ 6614 */
7811 Token get equals; 6615 Token get equals;
7812 6616
7813 /** 6617 /**
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
7860 * finalConstVarOrType ::= 6664 * finalConstVarOrType ::=
7861 * | 'final' [TypeName]? 6665 * | 'final' [TypeName]?
7862 * | 'const' [TypeName]? 6666 * | 'const' [TypeName]?
7863 * | 'var' 6667 * | 'var'
7864 * | [TypeName] 6668 * | [TypeName]
7865 * 6669 *
7866 * Clients may not extend, implement or mix-in this class. 6670 * Clients may not extend, implement or mix-in this class.
7867 */ 6671 */
7868 abstract class VariableDeclarationList extends AnnotatedNode { 6672 abstract class VariableDeclarationList extends AnnotatedNode {
7869 /** 6673 /**
7870 * Initialize a newly created variable declaration list. Either or both of the
7871 * [comment] and [metadata] can be `null` if the variable list does not have
7872 * the corresponding attribute. The [keyword] can be `null` if a type was
7873 * specified. The [type] must be `null` if the keyword is 'var'.
7874 */
7875 factory VariableDeclarationList(Comment comment, List<Annotation> metadata,
7876 Token keyword, TypeName type, List<VariableDeclaration> variables) =>
7877 new VariableDeclarationListImpl(
7878 comment, metadata, keyword, type, variables);
7879
7880 /**
7881 * Return `true` if the variables in this list were declared with the 'const' 6674 * Return `true` if the variables in this list were declared with the 'const'
7882 * modifier. 6675 * modifier.
7883 */ 6676 */
7884 bool get isConst; 6677 bool get isConst;
7885 6678
7886 /** 6679 /**
7887 * Return `true` if the variables in this list were declared with the 'final' 6680 * Return `true` if the variables in this list were declared with the 'final'
7888 * modifier. Variables that are declared with the 'const' modifier will return 6681 * modifier. Variables that are declared with the 'const' modifier will return
7889 * `false` even though they are implicitly final. (In other words, this is a 6682 * `false` even though they are implicitly final. (In other words, this is a
7890 * syntactic check rather than a semantic check.) 6683 * syntactic check rather than a semantic check.)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
7924 * A list of variables that are being declared in a context where a statement is 6717 * A list of variables that are being declared in a context where a statement is
7925 * required. 6718 * required.
7926 * 6719 *
7927 * variableDeclarationStatement ::= 6720 * variableDeclarationStatement ::=
7928 * [VariableDeclarationList] ';' 6721 * [VariableDeclarationList] ';'
7929 * 6722 *
7930 * Clients may not extend, implement or mix-in this class. 6723 * Clients may not extend, implement or mix-in this class.
7931 */ 6724 */
7932 abstract class VariableDeclarationStatement extends Statement { 6725 abstract class VariableDeclarationStatement extends Statement {
7933 /** 6726 /**
7934 * Initialize a newly created variable declaration statement.
7935 */
7936 factory VariableDeclarationStatement(
7937 VariableDeclarationList variableList, Token semicolon) =>
7938 new VariableDeclarationStatementImpl(variableList, semicolon);
7939
7940 /**
7941 * Return the semicolon terminating the statement. 6727 * Return the semicolon terminating the statement.
7942 */ 6728 */
7943 Token get semicolon; 6729 Token get semicolon;
7944 6730
7945 /** 6731 /**
7946 * Set the semicolon terminating the statement to the given [token]. 6732 * Set the semicolon terminating the statement to the given [token].
7947 */ 6733 */
7948 void set semicolon(Token token); 6734 void set semicolon(Token token);
7949 6735
7950 /** 6736 /**
(...skipping 10 matching lines...) Expand all
7961 /** 6747 /**
7962 * A while statement. 6748 * A while statement.
7963 * 6749 *
7964 * whileStatement ::= 6750 * whileStatement ::=
7965 * 'while' '(' [Expression] ')' [Statement] 6751 * 'while' '(' [Expression] ')' [Statement]
7966 * 6752 *
7967 * Clients may not extend, implement or mix-in this class. 6753 * Clients may not extend, implement or mix-in this class.
7968 */ 6754 */
7969 abstract class WhileStatement extends Statement { 6755 abstract class WhileStatement extends Statement {
7970 /** 6756 /**
7971 * Initialize a newly created while statement.
7972 */
7973 factory WhileStatement(Token whileKeyword, Token leftParenthesis,
7974 Expression condition, Token rightParenthesis, Statement body) =>
7975 new WhileStatementImpl(
7976 whileKeyword, leftParenthesis, condition, rightParenthesis, body);
7977
7978 /**
7979 * Return the body of the loop. 6757 * Return the body of the loop.
7980 */ 6758 */
7981 Statement get body; 6759 Statement get body;
7982 6760
7983 /** 6761 /**
7984 * Set the body of the loop to the given [statement]. 6762 * Set the body of the loop to the given [statement].
7985 */ 6763 */
7986 void set body(Statement statement); 6764 void set body(Statement statement);
7987 6765
7988 /** 6766 /**
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
8031 /** 6809 /**
8032 * The with clause in a class declaration. 6810 * The with clause in a class declaration.
8033 * 6811 *
8034 * withClause ::= 6812 * withClause ::=
8035 * 'with' [TypeName] (',' [TypeName])* 6813 * 'with' [TypeName] (',' [TypeName])*
8036 * 6814 *
8037 * Clients may not extend, implement or mix-in this class. 6815 * Clients may not extend, implement or mix-in this class.
8038 */ 6816 */
8039 abstract class WithClause extends AstNode { 6817 abstract class WithClause extends AstNode {
8040 /** 6818 /**
8041 * Initialize a newly created with clause.
8042 */
8043 factory WithClause(Token withKeyword, List<TypeName> mixinTypes) =
8044 WithClauseImpl;
8045
8046 /**
8047 * Return the names of the mixins that were specified. 6819 * Return the names of the mixins that were specified.
8048 */ 6820 */
8049 NodeList<TypeName> get mixinTypes; 6821 NodeList<TypeName> get mixinTypes;
8050 6822
8051 /** 6823 /**
8052 * Return the token representing the 'with' keyword. 6824 * Return the token representing the 'with' keyword.
8053 */ 6825 */
8054 Token get withKeyword; 6826 Token get withKeyword;
8055 6827
8056 /** 6828 /**
8057 * Set the token representing the 'with' keyword to the given [token]. 6829 * Set the token representing the 'with' keyword to the given [token].
8058 */ 6830 */
8059 void set withKeyword(Token token); 6831 void set withKeyword(Token token);
8060 } 6832 }
8061 6833
8062 /** 6834 /**
8063 * A yield statement. 6835 * A yield statement.
8064 * 6836 *
8065 * yieldStatement ::= 6837 * yieldStatement ::=
8066 * 'yield' '*'? [Expression] ‘;’ 6838 * 'yield' '*'? [Expression] ‘;’
8067 * 6839 *
8068 * Clients may not extend, implement or mix-in this class. 6840 * Clients may not extend, implement or mix-in this class.
8069 */ 6841 */
8070 abstract class YieldStatement extends Statement { 6842 abstract class YieldStatement extends Statement {
8071 /** 6843 /**
8072 * Initialize a newly created yield expression. The [star] can be `null` if no
8073 * star was provided.
8074 */
8075 factory YieldStatement(Token yieldKeyword, Token star, Expression expression,
8076 Token semicolon) =>
8077 new YieldStatementImpl(yieldKeyword, star, expression, semicolon);
8078
8079 /**
8080 * Return the expression whose value will be yielded. 6844 * Return the expression whose value will be yielded.
8081 */ 6845 */
8082 Expression get expression; 6846 Expression get expression;
8083 6847
8084 /** 6848 /**
8085 * Set the expression whose value will be yielded to the given [expression]. 6849 * Set the expression whose value will be yielded to the given [expression].
8086 */ 6850 */
8087 void set expression(Expression expression); 6851 void set expression(Expression expression);
8088 6852
8089 /** 6853 /**
(...skipping 19 matching lines...) Expand all
8109 /** 6873 /**
8110 * Return the 'yield' keyword. 6874 * Return the 'yield' keyword.
8111 */ 6875 */
8112 Token get yieldKeyword; 6876 Token get yieldKeyword;
8113 6877
8114 /** 6878 /**
8115 * Return the 'yield' keyword to the given [token]. 6879 * Return the 'yield' keyword to the given [token].
8116 */ 6880 */
8117 void set yieldKeyword(Token token); 6881 void set yieldKeyword(Token token);
8118 } 6882 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698