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