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

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

Issue 17249003: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 library engine.ast; 3 library engine.ast;
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'java_core.dart'; 5 import 'java_core.dart';
6 import 'java_engine.dart'; 6 import 'java_engine.dart';
7 import 'error.dart'; 7 import 'error.dart';
8 import 'source.dart' show LineInfo; 8 import 'source.dart' show LineInfo;
9 import 'scanner.dart'; 9 import 'scanner.dart';
10 import 'engine.dart' show AnalysisEngine; 10 import 'engine.dart' show AnalysisEngine;
11 import 'utilities_dart.dart'; 11 import 'utilities_dart.dart';
12 import 'element.dart'; 12 import 'element.dart';
13 /** 13 /**
14 * The abstract class {@code ASTNode} defines the behavior common to all nodes i n the AST structure 14 * The abstract class `ASTNode` defines the behavior common to all nodes in the AST structure
15 * for a Dart program. 15 * for a Dart program.
16 * @coverage dart.engine.ast 16 * @coverage dart.engine.ast
17 */ 17 */
18 abstract class ASTNode { 18 abstract class ASTNode {
19 19
20 /** 20 /**
21 * The parent of the node, or {@code null} if the node is the root of an AST s tructure. 21 * The parent of the node, or `null` if the node is the root of an AST structu re.
22 */ 22 */
23 ASTNode _parent; 23 ASTNode _parent;
24 24
25 /** 25 /**
26 * A table mapping the names of properties to their values, or {@code null} if this node does not 26 * A table mapping the names of properties to their values, or `null` if this node does not
27 * have any properties associated with it. 27 * have any properties associated with it.
28 */ 28 */
29 Map<String, Object> _propertyMap; 29 Map<String, Object> _propertyMap;
30 30
31 /** 31 /**
32 * A comparator that can be used to sort AST nodes in lexical order. In other words,{@code compare} will return a negative value if the offset of the first no de is less than the 32 * A comparator that can be used to sort AST nodes in lexical order. In other words,`compare` will return a negative value if the offset of the first node is less than the
33 * offset of the second node, zero (0) if the nodes have the same offset, and a positive value if 33 * offset of the second node, zero (0) if the nodes have the same offset, and a positive value if
34 * if the offset of the first node is greater than the offset of the second no de. 34 * if the offset of the first node is greater than the offset of the second no de.
35 */ 35 */
36 static Comparator<ASTNode> LEXICAL_ORDER = (ASTNode first, ASTNode second) => second.offset - first.offset; 36 static Comparator<ASTNode> LEXICAL_ORDER = (ASTNode first, ASTNode second) => second.offset - first.offset;
37 37
38 /** 38 /**
39 * Use the given visitor to visit this node. 39 * Use the given visitor to visit this node.
40 * @param visitor the visitor that will visit this node 40 * @param visitor the visitor that will visit this node
41 * @return the value returned by the visitor as a result of visiting this node 41 * @return the value returned by the visitor as a result of visiting this node
42 */ 42 */
43 accept(ASTVisitor visitor); 43 accept(ASTVisitor visitor);
44 44
45 /** 45 /**
46 * @return the {@link ASTNode} of given {@link Class} which is {@link ASTNode} itself, or one of 46 * @return the [ASTNode] of given [Class] which is [ASTNode] itself, or one of
47 * its parents. 47 * its parents.
48 */ 48 */
49 ASTNode getAncestor(Type enclosingClass) { 49 ASTNode getAncestor(Type enclosingClass) {
50 ASTNode node = this; 50 ASTNode node = this;
51 while (node != null && !isInstanceOf(node, enclosingClass)) { 51 while (node != null && !isInstanceOf(node, enclosingClass)) {
52 node = node.parent; 52 node = node.parent;
53 } 53 }
54 ; 54 ;
55 return node as ASTNode; 55 return node as ASTNode;
56 } 56 }
57 57
58 /** 58 /**
59 * Return the first token included in this node's source range. 59 * Return the first token included in this node's source range.
60 * @return the first token included in this node's source range 60 * @return the first token included in this node's source range
61 */ 61 */
62 Token get beginToken; 62 Token get beginToken;
63 63
64 /** 64 /**
65 * Return the offset of the character immediately following the last character of this node's 65 * Return the offset of the character immediately following the last character of this node's
66 * source range. This is equivalent to {@code node.getOffset() + node.getLengt h()}. For a 66 * source range. This is equivalent to `node.getOffset() + node.getLength()`. For a
67 * compilation unit this will be equal to the length of the unit's source. For synthetic nodes 67 * compilation unit this will be equal to the length of the unit's source. For synthetic nodes
68 * this will be equivalent to the node's offset (because the length is zero (0 ) by definition). 68 * this will be equivalent to the node's offset (because the length is zero (0 ) by definition).
69 * @return the offset of the character just past the node's source range 69 * @return the offset of the character just past the node's source range
70 */ 70 */
71 int get end => offset + length; 71 int get end => offset + length;
72 72
73 /** 73 /**
74 * Return the last token included in this node's source range. 74 * Return the last token included in this node's source range.
75 * @return the last token included in this node's source range 75 * @return the last token included in this node's source range
76 */ 76 */
(...skipping 20 matching lines...) Expand all
97 */ 97 */
98 int get offset { 98 int get offset {
99 Token beginToken = this.beginToken; 99 Token beginToken = this.beginToken;
100 if (beginToken == null) { 100 if (beginToken == null) {
101 return -1; 101 return -1;
102 } 102 }
103 return beginToken.offset; 103 return beginToken.offset;
104 } 104 }
105 105
106 /** 106 /**
107 * Return this node's parent node, or {@code null} if this node is the root of an AST structure. 107 * Return this node's parent node, or `null` if this node is the root of an AS T structure.
108 * <p> 108 *
109 * Note that the relationship between an AST node and its parent node may chan ge over the lifetime 109 * Note that the relationship between an AST node and its parent node may chan ge over the lifetime
110 * of a node. 110 * of a node.
111 * @return the parent of this node, or {@code null} if none 111 * @return the parent of this node, or `null` if none
112 */ 112 */
113 ASTNode get parent => _parent; 113 ASTNode get parent => _parent;
114 114
115 /** 115 /**
116 * Return the value of the property with the given name, or {@code null} if th is node does not 116 * Return the value of the property with the given name, or `null` if this nod e does not
117 * have a property with the given name. 117 * have a property with the given name.
118 * @return the value of the property with the given name 118 * @return the value of the property with the given name
119 */ 119 */
120 Object getProperty(String propertyName) { 120 Object getProperty(String propertyName) {
121 if (_propertyMap == null) { 121 if (_propertyMap == null) {
122 return null; 122 return null;
123 } 123 }
124 return _propertyMap[propertyName]; 124 return _propertyMap[propertyName];
125 } 125 }
126 126
127 /** 127 /**
128 * Return the node at the root of this node's AST structure. Note that this me thod's performance 128 * Return the node at the root of this node's AST structure. Note that this me thod's performance
129 * is linear with respect to the depth of the node in the AST structure (O(dep th)). 129 * is linear with respect to the depth of the node in the AST structure (O(dep th)).
130 * @return the node at the root of this node's AST structure 130 * @return the node at the root of this node's AST structure
131 */ 131 */
132 ASTNode get root { 132 ASTNode get root {
133 ASTNode root = this; 133 ASTNode root = this;
134 ASTNode parent = this.parent; 134 ASTNode parent = this.parent;
135 while (parent != null) { 135 while (parent != null) {
136 root = parent; 136 root = parent;
137 parent = root.parent; 137 parent = root.parent;
138 } 138 }
139 return root; 139 return root;
140 } 140 }
141 141
142 /** 142 /**
143 * Return {@code true} if this node is a synthetic node. A synthetic node is a node that was 143 * Return `true` if this node is a synthetic node. A synthetic node is a node that was
144 * introduced by the parser in order to recover from an error in the code. Syn thetic nodes always 144 * introduced by the parser in order to recover from an error in the code. Syn thetic nodes always
145 * have a length of zero ({@code 0}). 145 * have a length of zero (`0`).
146 * @return {@code true} if this node is a synthetic node 146 * @return `true` if this node is a synthetic node
147 */ 147 */
148 bool isSynthetic() => false; 148 bool isSynthetic() => false;
149 149
150 /** 150 /**
151 * Set the value of the property with the given name to the given value. If th e value is{@code null}, the property will effectively be removed. 151 * Set the value of the property with the given name to the given value. If th e value is`null`, the property will effectively be removed.
152 * @param propertyName the name of the property whose value is to be set 152 * @param propertyName the name of the property whose value is to be set
153 * @param propertyValue the new value of the property 153 * @param propertyValue the new value of the property
154 */ 154 */
155 void setProperty(String propertyName, Object propertyValue) { 155 void setProperty(String propertyName, Object propertyValue) {
156 if (propertyValue == null) { 156 if (propertyValue == null) {
157 if (_propertyMap != null) { 157 if (_propertyMap != null) {
158 _propertyMap.remove(propertyName); 158 _propertyMap.remove(propertyName);
159 if (_propertyMap.isEmpty) { 159 if (_propertyMap.isEmpty) {
160 _propertyMap = null; 160 _propertyMap = null;
161 } 161 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 */ 194 */
195 ASTNode becomeParentOf(ASTNode child) { 195 ASTNode becomeParentOf(ASTNode child) {
196 if (child != null) { 196 if (child != null) {
197 ASTNode node = child; 197 ASTNode node = child;
198 node.parent = this; 198 node.parent = this;
199 } 199 }
200 return child; 200 return child;
201 } 201 }
202 202
203 /** 203 /**
204 * If the given child is not {@code null}, use the given visitor to visit it. 204 * If the given child is not `null`, use the given visitor to visit it.
205 * @param child the child to be visited 205 * @param child the child to be visited
206 * @param visitor the visitor that will be used to visit the child 206 * @param visitor the visitor that will be used to visit the child
207 */ 207 */
208 void safelyVisitChild(ASTNode child, ASTVisitor<Object> visitor) { 208 void safelyVisitChild(ASTNode child, ASTVisitor<Object> visitor) {
209 if (child != null) { 209 if (child != null) {
210 child.accept(visitor); 210 child.accept(visitor);
211 } 211 }
212 } 212 }
213 213
214 /** 214 /**
215 * Set the parent of this node to the given node. 215 * Set the parent of this node to the given node.
216 * @param newParent the node that is to be made the parent of this node 216 * @param newParent the node that is to be made the parent of this node
217 */ 217 */
218 void set parent(ASTNode newParent) { 218 void set parent(ASTNode newParent) {
219 _parent = newParent; 219 _parent = newParent;
220 } 220 }
221 static int _hashCodeGenerator = 0; 221 static int _hashCodeGenerator = 0;
222 final int hashCode = ++_hashCodeGenerator; 222 final int hashCode = ++_hashCodeGenerator;
223 } 223 }
224 /** 224 /**
225 * The interface {@code ASTVisitor} defines the behavior of objects that can be used to visit an AST 225 * The interface `ASTVisitor` defines the behavior of objects that can be used t o visit an AST
226 * structure. 226 * structure.
227 * @coverage dart.engine.ast 227 * @coverage dart.engine.ast
228 */ 228 */
229 abstract class ASTVisitor<R> { 229 abstract class ASTVisitor<R> {
230 R visitAdjacentStrings(AdjacentStrings node); 230 R visitAdjacentStrings(AdjacentStrings node);
231 R visitAnnotation(Annotation node); 231 R visitAnnotation(Annotation node);
232 R visitArgumentDefinitionTest(ArgumentDefinitionTest node); 232 R visitArgumentDefinitionTest(ArgumentDefinitionTest node);
233 R visitArgumentList(ArgumentList node); 233 R visitArgumentList(ArgumentList node);
234 R visitAsExpression(AsExpression node); 234 R visitAsExpression(AsExpression node);
235 R visitAssertStatement(AssertStatement assertStatement); 235 R visitAssertStatement(AssertStatement assertStatement);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 R visitTypeName(TypeName node); 323 R visitTypeName(TypeName node);
324 R visitTypeParameter(TypeParameter node); 324 R visitTypeParameter(TypeParameter node);
325 R visitTypeParameterList(TypeParameterList node); 325 R visitTypeParameterList(TypeParameterList node);
326 R visitVariableDeclaration(VariableDeclaration node); 326 R visitVariableDeclaration(VariableDeclaration node);
327 R visitVariableDeclarationList(VariableDeclarationList node); 327 R visitVariableDeclarationList(VariableDeclarationList node);
328 R visitVariableDeclarationStatement(VariableDeclarationStatement node); 328 R visitVariableDeclarationStatement(VariableDeclarationStatement node);
329 R visitWhileStatement(WhileStatement node); 329 R visitWhileStatement(WhileStatement node);
330 R visitWithClause(WithClause node); 330 R visitWithClause(WithClause node);
331 } 331 }
332 /** 332 /**
333 * Instances of the class {@code AdjacentStrings} represents two or more string literals that are 333 * Instances of the class `AdjacentStrings` represents two or more string litera ls that are
334 * implicitly concatenated because of being adjacent (separated only by whitespa ce). 334 * implicitly concatenated because of being adjacent (separated only by whitespa ce).
335 * <p> 335 *
336 * While the grammar only allows adjacent strings when all of the strings are of the same kind 336 * While the grammar only allows adjacent strings when all of the strings are of the same kind
337 * (single line or multi-line), this class doesn't enforce that restriction. 337 * (single line or multi-line), this class doesn't enforce that restriction.
338 * <pre> 338 * <pre>
339 * adjacentStrings ::={@link StringLiteral string} {@link StringLiteral string}+ 339 * adjacentStrings ::=[StringLiteral string] [StringLiteral string]+
340 * </pre> 340 * </pre>
341 * @coverage dart.engine.ast 341 * @coverage dart.engine.ast
342 */ 342 */
343 class AdjacentStrings extends StringLiteral { 343 class AdjacentStrings extends StringLiteral {
344 344
345 /** 345 /**
346 * The strings that are implicitly concatenated. 346 * The strings that are implicitly concatenated.
347 */ 347 */
348 NodeList<StringLiteral> _strings; 348 NodeList<StringLiteral> _strings;
349 349
(...skipping 23 matching lines...) Expand all
373 void visitChildren(ASTVisitor<Object> visitor) { 373 void visitChildren(ASTVisitor<Object> visitor) {
374 _strings.accept(visitor); 374 _strings.accept(visitor);
375 } 375 }
376 void appendStringValue(JavaStringBuilder builder) { 376 void appendStringValue(JavaStringBuilder builder) {
377 for (StringLiteral stringLiteral in strings) { 377 for (StringLiteral stringLiteral in strings) {
378 stringLiteral.appendStringValue(builder); 378 stringLiteral.appendStringValue(builder);
379 } 379 }
380 } 380 }
381 } 381 }
382 /** 382 /**
383 * The abstract class {@code AnnotatedNode} defines the behavior of nodes that c an be annotated with 383 * The abstract class `AnnotatedNode` defines the behavior of nodes that can be annotated with
384 * both a comment and metadata. 384 * both a comment and metadata.
385 * @coverage dart.engine.ast 385 * @coverage dart.engine.ast
386 */ 386 */
387 abstract class AnnotatedNode extends ASTNode { 387 abstract class AnnotatedNode extends ASTNode {
388 388
389 /** 389 /**
390 * The documentation comment associated with this node, or {@code null} if thi s node does not have 390 * The documentation comment associated with this node, or `null` if this node does not have
391 * a documentation comment associated with it. 391 * a documentation comment associated with it.
392 */ 392 */
393 Comment _comment; 393 Comment _comment;
394 394
395 /** 395 /**
396 * The annotations associated with this node. 396 * The annotations associated with this node.
397 */ 397 */
398 NodeList<Annotation> _metadata; 398 NodeList<Annotation> _metadata;
399 399
400 /** 400 /**
(...skipping 25 matching lines...) Expand all
426 } 426 }
427 Token commentToken = _comment.beginToken; 427 Token commentToken = _comment.beginToken;
428 Token metadataToken = _metadata.beginToken; 428 Token metadataToken = _metadata.beginToken;
429 if (commentToken.offset < metadataToken.offset) { 429 if (commentToken.offset < metadataToken.offset) {
430 return commentToken; 430 return commentToken;
431 } 431 }
432 return metadataToken; 432 return metadataToken;
433 } 433 }
434 434
435 /** 435 /**
436 * Return the documentation comment associated with this node, or {@code null} if this node does 436 * Return the documentation comment associated with this node, or `null` if th is node does
437 * not have a documentation comment associated with it. 437 * not have a documentation comment associated with it.
438 * @return the documentation comment associated with this node 438 * @return the documentation comment associated with this node
439 */ 439 */
440 Comment get documentationComment => _comment; 440 Comment get documentationComment => _comment;
441 441
442 /** 442 /**
443 * Return the annotations associated with this node. 443 * Return the annotations associated with this node.
444 * @return the annotations associated with this node 444 * @return the annotations associated with this node
445 */ 445 */
446 NodeList<Annotation> get metadata => _metadata; 446 NodeList<Annotation> get metadata => _metadata;
(...skipping 25 matching lines...) Expand all
472 } 472 }
473 } 473 }
474 474
475 /** 475 /**
476 * Return the first token following the comment and metadata. 476 * Return the first token following the comment and metadata.
477 * @return the first token following the comment and metadata 477 * @return the first token following the comment and metadata
478 */ 478 */
479 Token get firstTokenAfterCommentAndMetadata; 479 Token get firstTokenAfterCommentAndMetadata;
480 480
481 /** 481 /**
482 * Return {@code true} if the comment is lexically before any annotations. 482 * Return `true` if the comment is lexically before any annotations.
483 * @return {@code true} if the comment is lexically before any annotations 483 * @return `true` if the comment is lexically before any annotations
484 */ 484 */
485 bool commentIsBeforeAnnotations() { 485 bool commentIsBeforeAnnotations() {
486 if (_comment == null || _metadata.isEmpty) { 486 if (_comment == null || _metadata.isEmpty) {
487 return true; 487 return true;
488 } 488 }
489 Annotation firstAnnotation = _metadata[0]; 489 Annotation firstAnnotation = _metadata[0];
490 return _comment.offset < firstAnnotation.offset; 490 return _comment.offset < firstAnnotation.offset;
491 } 491 }
492 492
493 /** 493 /**
494 * Return an array containing the comment and annotations associated with this node, sorted in 494 * Return an array containing the comment and annotations associated with this node, sorted in
495 * lexical order. 495 * lexical order.
496 * @return the comment and annotations associated with this node in the order in which they 496 * @return the comment and annotations associated with this node in the order in which they
497 * appeared in the original source 497 * appeared in the original source
498 */ 498 */
499 List<ASTNode> get sortedCommentAndAnnotations { 499 List<ASTNode> get sortedCommentAndAnnotations {
500 List<ASTNode> childList = new List<ASTNode>(); 500 List<ASTNode> childList = new List<ASTNode>();
501 childList.add(_comment); 501 childList.add(_comment);
502 childList.addAll(_metadata); 502 childList.addAll(_metadata);
503 List<ASTNode> children = new List.from(childList); 503 List<ASTNode> children = new List.from(childList);
504 children.sort(ASTNode.LEXICAL_ORDER); 504 children.sort(ASTNode.LEXICAL_ORDER);
505 return children; 505 return children;
506 } 506 }
507 } 507 }
508 /** 508 /**
509 * Instances of the class {@code Annotation} represent an annotation that can be associated with an 509 * Instances of the class `Annotation` represent an annotation that can be assoc iated with an
510 * AST node. 510 * AST node.
511 * <pre> 511 * <pre>
512 * metadata ::= 512 * metadata ::=
513 * annotation 513 * annotation
514 * annotation ::= 514 * annotation ::=
515 * '@' {@link Identifier qualified} ('.' {@link SimpleIdentifier identifier})? { @link ArgumentList arguments}? 515 * '@' [Identifier qualified] ('.' [SimpleIdentifier identifier])? [ArgumentList arguments]?
516 * </pre> 516 * </pre>
517 * @coverage dart.engine.ast 517 * @coverage dart.engine.ast
518 */ 518 */
519 class Annotation extends ASTNode { 519 class Annotation extends ASTNode {
520 520
521 /** 521 /**
522 * The at sign that introduced the annotation. 522 * The at sign that introduced the annotation.
523 */ 523 */
524 Token _atSign; 524 Token _atSign;
525 525
526 /** 526 /**
527 * The name of the class defining the constructor that is being invoked or the name of the field 527 * The name of the class defining the constructor that is being invoked or the name of the field
528 * that is being referenced. 528 * that is being referenced.
529 */ 529 */
530 Identifier _name; 530 Identifier _name;
531 531
532 /** 532 /**
533 * The period before the constructor name, or {@code null} if this annotation is not the 533 * The period before the constructor name, or `null` if this annotation is not the
534 * invocation of a named constructor. 534 * invocation of a named constructor.
535 */ 535 */
536 Token _period; 536 Token _period;
537 537
538 /** 538 /**
539 * The name of the constructor being invoked, or {@code null} if this annotati on is not the 539 * The name of the constructor being invoked, or `null` if this annotation is not the
540 * invocation of a named constructor. 540 * invocation of a named constructor.
541 */ 541 */
542 SimpleIdentifier _constructorName; 542 SimpleIdentifier _constructorName;
543 543
544 /** 544 /**
545 * The arguments to the constructor being invoked, or {@code null} if this ann otation is not the 545 * The arguments to the constructor being invoked, or `null` if this annotatio n is not the
546 * invocation of a constructor. 546 * invocation of a constructor.
547 */ 547 */
548 ArgumentList _arguments; 548 ArgumentList _arguments;
549 549
550 /** 550 /**
551 * Initialize a newly created annotation. 551 * Initialize a newly created annotation.
552 * @param atSign the at sign that introduced the annotation 552 * @param atSign the at sign that introduced the annotation
553 * @param name the name of the class defining the constructor that is being in voked or the name of 553 * @param name the name of the class defining the constructor that is being in voked or the name of
554 * the field that is being referenced 554 * the field that is being referenced
555 * @param period the period before the constructor name, or {@code null} if th is annotation is not 555 * @param period the period before the constructor name, or `null` if this ann otation is not
556 * the invocation of a named constructor 556 * the invocation of a named constructor
557 * @param constructorName the name of the constructor being invoked, or {@code null} if this 557 * @param constructorName the name of the constructor being invoked, or `null` if this
558 * annotation is not the invocation of a named constructor 558 * annotation is not the invocation of a named constructor
559 * @param arguments the arguments to the constructor being invoked, or {@code null} if this 559 * @param arguments the arguments to the constructor being invoked, or `null` if this
560 * annotation is not the invocation of a constructor 560 * annotation is not the invocation of a constructor
561 */ 561 */
562 Annotation.full(Token atSign, Identifier name, Token period, SimpleIdentifier constructorName, ArgumentList arguments) { 562 Annotation.full(Token atSign, Identifier name, Token period, SimpleIdentifier constructorName, ArgumentList arguments) {
563 this._atSign = atSign; 563 this._atSign = atSign;
564 this._name = becomeParentOf(name); 564 this._name = becomeParentOf(name);
565 this._period = period; 565 this._period = period;
566 this._constructorName = becomeParentOf(constructorName); 566 this._constructorName = becomeParentOf(constructorName);
567 this._arguments = becomeParentOf(arguments); 567 this._arguments = becomeParentOf(arguments);
568 } 568 }
569 569
570 /** 570 /**
571 * Initialize a newly created annotation. 571 * Initialize a newly created annotation.
572 * @param atSign the at sign that introduced the annotation 572 * @param atSign the at sign that introduced the annotation
573 * @param name the name of the class defining the constructor that is being in voked or the name of 573 * @param name the name of the class defining the constructor that is being in voked or the name of
574 * the field that is being referenced 574 * the field that is being referenced
575 * @param period the period before the constructor name, or {@code null} if th is annotation is not 575 * @param period the period before the constructor name, or `null` if this ann otation is not
576 * the invocation of a named constructor 576 * the invocation of a named constructor
577 * @param constructorName the name of the constructor being invoked, or {@code null} if this 577 * @param constructorName the name of the constructor being invoked, or `null` if this
578 * annotation is not the invocation of a named constructor 578 * annotation is not the invocation of a named constructor
579 * @param arguments the arguments to the constructor being invoked, or {@code null} if this 579 * @param arguments the arguments to the constructor being invoked, or `null` if this
580 * annotation is not the invocation of a constructor 580 * annotation is not the invocation of a constructor
581 */ 581 */
582 Annotation({Token atSign, Identifier name, Token period, SimpleIdentifier cons tructorName, ArgumentList arguments}) : this.full(atSign, name, period, construc torName, arguments); 582 Annotation({Token atSign, Identifier name, Token period, SimpleIdentifier cons tructorName, ArgumentList arguments}) : this.full(atSign, name, period, construc torName, arguments);
583 accept(ASTVisitor visitor) => visitor.visitAnnotation(this); 583 accept(ASTVisitor visitor) => visitor.visitAnnotation(this);
584 584
585 /** 585 /**
586 * Return the arguments to the constructor being invoked, or {@code null} if t his annotation is 586 * Return the arguments to the constructor being invoked, or `null` if this an notation is
587 * not the invocation of a constructor. 587 * not the invocation of a constructor.
588 * @return the arguments to the constructor being invoked 588 * @return the arguments to the constructor being invoked
589 */ 589 */
590 ArgumentList get arguments => _arguments; 590 ArgumentList get arguments => _arguments;
591 591
592 /** 592 /**
593 * Return the at sign that introduced the annotation. 593 * Return the at sign that introduced the annotation.
594 * @return the at sign that introduced the annotation 594 * @return the at sign that introduced the annotation
595 */ 595 */
596 Token get atSign => _atSign; 596 Token get atSign => _atSign;
597 Token get beginToken => _atSign; 597 Token get beginToken => _atSign;
598 598
599 /** 599 /**
600 * Return the name of the constructor being invoked, or {@code null} if this a nnotation is not the 600 * Return the name of the constructor being invoked, or `null` if this annotat ion is not the
601 * invocation of a named constructor. 601 * invocation of a named constructor.
602 * @return the name of the constructor being invoked 602 * @return the name of the constructor being invoked
603 */ 603 */
604 SimpleIdentifier get constructorName => _constructorName; 604 SimpleIdentifier get constructorName => _constructorName;
605 605
606 /** 606 /**
607 * Return the element associated with this annotation, or {@code null} if the AST structure has 607 * Return the element associated with this annotation, or `null` if the AST st ructure has
608 * not been resolved or if this annotation could not be resolved. 608 * not been resolved or if this annotation could not be resolved.
609 * @return the element associated with this annotation 609 * @return the element associated with this annotation
610 */ 610 */
611 Element get element { 611 Element get element {
612 if (_constructorName != null) { 612 if (_constructorName != null) {
613 return _constructorName.element; 613 return _constructorName.element;
614 } else if (_name != null) { 614 } else if (_name != null) {
615 return _name.element; 615 return _name.element;
616 } 616 }
617 return null; 617 return null;
618 } 618 }
619 Token get endToken { 619 Token get endToken {
620 if (_arguments != null) { 620 if (_arguments != null) {
621 return _arguments.endToken; 621 return _arguments.endToken;
622 } else if (_constructorName != null) { 622 } else if (_constructorName != null) {
623 return _constructorName.endToken; 623 return _constructorName.endToken;
624 } 624 }
625 return _name.endToken; 625 return _name.endToken;
626 } 626 }
627 627
628 /** 628 /**
629 * Return the name of the class defining the constructor that is being invoked or the name of the 629 * Return the name of the class defining the constructor that is being invoked or the name of the
630 * field that is being referenced. 630 * field that is being referenced.
631 * @return the name of the constructor being invoked or the name of the field being referenced 631 * @return the name of the constructor being invoked or the name of the field being referenced
632 */ 632 */
633 Identifier get name => _name; 633 Identifier get name => _name;
634 634
635 /** 635 /**
636 * Return the period before the constructor name, or {@code null} if this anno tation is not the 636 * Return the period before the constructor name, or `null` if this annotation is not the
637 * invocation of a named constructor. 637 * invocation of a named constructor.
638 * @return the period before the constructor name 638 * @return the period before the constructor name
639 */ 639 */
640 Token get period => _period; 640 Token get period => _period;
641 641
642 /** 642 /**
643 * Set the arguments to the constructor being invoked to the given arguments. 643 * Set the arguments to the constructor being invoked to the given arguments.
644 * @param arguments the arguments to the constructor being invoked 644 * @param arguments the arguments to the constructor being invoked
645 */ 645 */
646 void set arguments(ArgumentList arguments2) { 646 void set arguments(ArgumentList arguments2) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 void set period(Token period2) { 679 void set period(Token period2) {
680 this._period = period2; 680 this._period = period2;
681 } 681 }
682 void visitChildren(ASTVisitor<Object> visitor) { 682 void visitChildren(ASTVisitor<Object> visitor) {
683 safelyVisitChild(_name, visitor); 683 safelyVisitChild(_name, visitor);
684 safelyVisitChild(_constructorName, visitor); 684 safelyVisitChild(_constructorName, visitor);
685 safelyVisitChild(_arguments, visitor); 685 safelyVisitChild(_arguments, visitor);
686 } 686 }
687 } 687 }
688 /** 688 /**
689 * Instances of the class {@code ArgumentDefinitionTest} represent an argument d efinition test. 689 * Instances of the class `ArgumentDefinitionTest` represent an argument definit ion test.
690 * <pre> 690 * <pre>
691 * argumentDefinitionTest ::= 691 * argumentDefinitionTest ::=
692 * '?' {@link SimpleIdentifier identifier}</pre> 692 * '?' [SimpleIdentifier identifier]</pre>
693 * @coverage dart.engine.ast 693 * @coverage dart.engine.ast
694 */ 694 */
695 class ArgumentDefinitionTest extends Expression { 695 class ArgumentDefinitionTest extends Expression {
696 696
697 /** 697 /**
698 * The token representing the question mark. 698 * The token representing the question mark.
699 */ 699 */
700 Token _question; 700 Token _question;
701 701
702 /** 702 /**
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 * @param question the token representing the question mark 749 * @param question the token representing the question mark
750 */ 750 */
751 void set question(Token question2) { 751 void set question(Token question2) {
752 this._question = question2; 752 this._question = question2;
753 } 753 }
754 void visitChildren(ASTVisitor<Object> visitor) { 754 void visitChildren(ASTVisitor<Object> visitor) {
755 safelyVisitChild(_identifier, visitor); 755 safelyVisitChild(_identifier, visitor);
756 } 756 }
757 } 757 }
758 /** 758 /**
759 * Instances of the class {@code ArgumentList} represent a list of arguments in the invocation of a 759 * Instances of the class `ArgumentList` represent a list of arguments in the in vocation of a
760 * executable element: a function, method, or constructor. 760 * executable element: a function, method, or constructor.
761 * <pre> 761 * <pre>
762 * argumentList ::= 762 * argumentList ::=
763 * '(' arguments? ')' 763 * '(' arguments? ')'
764 * arguments ::={@link NamedExpression namedArgument} (',' {@link NamedExpressio n namedArgument}) 764 * arguments ::=[NamedExpression namedArgument] (',' [NamedExpression namedArgum ent])
765 * | {@link Expression expressionList} (',' {@link NamedExpression namedArgument }) 765 * | [Expression expressionList] (',' [NamedExpression namedArgument])
766 * </pre> 766 * </pre>
767 * @coverage dart.engine.ast 767 * @coverage dart.engine.ast
768 */ 768 */
769 class ArgumentList extends ASTNode { 769 class ArgumentList extends ASTNode {
770 770
771 /** 771 /**
772 * The left parenthesis. 772 * The left parenthesis.
773 */ 773 */
774 Token _leftParenthesis; 774 Token _leftParenthesis;
775 775
776 /** 776 /**
777 * The expressions producing the values of the arguments. 777 * The expressions producing the values of the arguments.
778 */ 778 */
779 NodeList<Expression> _arguments; 779 NodeList<Expression> _arguments;
780 780
781 /** 781 /**
782 * The right parenthesis. 782 * The right parenthesis.
783 */ 783 */
784 Token _rightParenthesis; 784 Token _rightParenthesis;
785 785
786 /** 786 /**
787 * An array containing the elements representing the parameters corresponding to each of the 787 * An array containing the elements representing the parameters corresponding to each of the
788 * arguments in this list, or {@code null} if the AST has not been resolved or if the function or 788 * arguments in this list, or `null` if the AST has not been resolved or if th e function or
789 * method being invoked could not be determined based on static type informati on. The array must 789 * method being invoked could not be determined based on static type informati on. The array must
790 * be the same length as the number of arguments, but can contain {@code null} entries if a given 790 * be the same length as the number of arguments, but can contain `null` entri es if a given
791 * argument does not correspond to a formal parameter. 791 * argument does not correspond to a formal parameter.
792 */ 792 */
793 List<ParameterElement> _correspondingStaticParameters; 793 List<ParameterElement> _correspondingStaticParameters;
794 794
795 /** 795 /**
796 * An array containing the elements representing the parameters corresponding to each of the 796 * An array containing the elements representing the parameters corresponding to each of the
797 * arguments in this list, or {@code null} if the AST has not been resolved or if the function or 797 * arguments in this list, or `null` if the AST has not been resolved or if th e function or
798 * method being invoked could not be determined based on propagated type infor mation. The array 798 * method being invoked could not be determined based on propagated type infor mation. The array
799 * must be the same length as the number of arguments, but can contain {@code null} entries if a 799 * must be the same length as the number of arguments, but can contain `null` entries if a
800 * given argument does not correspond to a formal parameter. 800 * given argument does not correspond to a formal parameter.
801 */ 801 */
802 List<ParameterElement> _correspondingPropagatedParameters; 802 List<ParameterElement> _correspondingPropagatedParameters;
803 803
804 /** 804 /**
805 * Initialize a newly created list of arguments. 805 * Initialize a newly created list of arguments.
806 * @param leftParenthesis the left parenthesis 806 * @param leftParenthesis the left parenthesis
807 * @param arguments the expressions producing the values of the arguments 807 * @param arguments the expressions producing the values of the arguments
808 * @param rightParenthesis the right parenthesis 808 * @param rightParenthesis the right parenthesis
809 */ 809 */
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 841
842 /** 842 /**
843 * Return the right parenthesis. 843 * Return the right parenthesis.
844 * @return the right parenthesis 844 * @return the right parenthesis
845 */ 845 */
846 Token get rightParenthesis => _rightParenthesis; 846 Token get rightParenthesis => _rightParenthesis;
847 847
848 /** 848 /**
849 * Set the parameter elements corresponding to each of the arguments in this l ist to the given 849 * Set the parameter elements corresponding to each of the arguments in this l ist to the given
850 * array of parameters. The array of parameters must be the same length as the number of 850 * array of parameters. The array of parameters must be the same length as the number of
851 * arguments, but can contain {@code null} entries if a given argument does no t correspond to a 851 * arguments, but can contain `null` entries if a given argument does not corr espond to a
852 * formal parameter. 852 * formal parameter.
853 * @param parameters the parameter elements corresponding to the arguments 853 * @param parameters the parameter elements corresponding to the arguments
854 */ 854 */
855 void set correspondingParameters(List<ParameterElement> parameters) { 855 void set correspondingParameters(List<ParameterElement> parameters) {
856 if (parameters.length != _arguments.length) { 856 if (parameters.length != _arguments.length) {
857 throw new IllegalArgumentException("Expected ${_arguments.length} paramete rs, not ${parameters.length}"); 857 throw new IllegalArgumentException("Expected ${_arguments.length} paramete rs, not ${parameters.length}");
858 } 858 }
859 _correspondingPropagatedParameters = parameters; 859 _correspondingPropagatedParameters = parameters;
860 } 860 }
861 861
862 /** 862 /**
863 * Set the parameter elements corresponding to each of the arguments in this l ist to the given 863 * Set the parameter elements corresponding to each of the arguments in this l ist to the given
864 * array of parameters. The array of parameters must be the same length as the number of 864 * array of parameters. The array of parameters must be the same length as the number of
865 * arguments, but can contain {@code null} entries if a given argument does no t correspond to a 865 * arguments, but can contain `null` entries if a given argument does not corr espond to a
866 * formal parameter. 866 * formal parameter.
867 * @param parameters the parameter elements corresponding to the arguments 867 * @param parameters the parameter elements corresponding to the arguments
868 */ 868 */
869 void set correspondingStaticParameters(List<ParameterElement> parameters) { 869 void set correspondingStaticParameters(List<ParameterElement> parameters) {
870 if (parameters.length != _arguments.length) { 870 if (parameters.length != _arguments.length) {
871 throw new IllegalArgumentException("Expected ${_arguments.length} paramete rs, not ${parameters.length}"); 871 throw new IllegalArgumentException("Expected ${_arguments.length} paramete rs, not ${parameters.length}");
872 } 872 }
873 _correspondingStaticParameters = parameters; 873 _correspondingStaticParameters = parameters;
874 } 874 }
875 875
(...skipping 14 matching lines...) Expand all
890 } 890 }
891 void visitChildren(ASTVisitor<Object> visitor) { 891 void visitChildren(ASTVisitor<Object> visitor) {
892 _arguments.accept(visitor); 892 _arguments.accept(visitor);
893 } 893 }
894 894
895 /** 895 /**
896 * If the given expression is a child of this list, and the AST structure has been resolved, and 896 * If the given expression is a child of this list, and the AST structure has been resolved, and
897 * the function being invoked is known based on propagated type information, a nd the expression 897 * the function being invoked is known based on propagated type information, a nd the expression
898 * corresponds to one of the parameters of the function being invoked, then re turn the parameter 898 * corresponds to one of the parameters of the function being invoked, then re turn the parameter
899 * element representing the parameter to which the value of the given expressi on will be bound. 899 * element representing the parameter to which the value of the given expressi on will be bound.
900 * Otherwise, return {@code null}. 900 * Otherwise, return `null`.
901 * <p> 901 *
902 * This method is only intended to be used by {@link Expression#getParameterEl ement()}. 902 * This method is only intended to be used by [Expression#getParameterElement] .
903 * @param expression the expression corresponding to the parameter to be retur ned 903 * @param expression the expression corresponding to the parameter to be retur ned
904 * @return the parameter element representing the parameter to which the value of the expression 904 * @return the parameter element representing the parameter to which the value of the expression
905 * will be bound 905 * will be bound
906 */ 906 */
907 ParameterElement getPropagatedParameterElementFor(Expression expression) { 907 ParameterElement getPropagatedParameterElementFor(Expression expression) {
908 if (_correspondingPropagatedParameters == null) { 908 if (_correspondingPropagatedParameters == null) {
909 return null; 909 return null;
910 } 910 }
911 int index = _arguments.indexOf(expression); 911 int index = _arguments.indexOf(expression);
912 if (index < 0) { 912 if (index < 0) {
913 return null; 913 return null;
914 } 914 }
915 return _correspondingPropagatedParameters[index]; 915 return _correspondingPropagatedParameters[index];
916 } 916 }
917 917
918 /** 918 /**
919 * If the given expression is a child of this list, and the AST structure has been resolved, and 919 * If the given expression is a child of this list, and the AST structure has been resolved, and
920 * the function being invoked is known based on static type information, and t he expression 920 * the function being invoked is known based on static type information, and t he expression
921 * corresponds to one of the parameters of the function being invoked, then re turn the parameter 921 * corresponds to one of the parameters of the function being invoked, then re turn the parameter
922 * element representing the parameter to which the value of the given expressi on will be bound. 922 * element representing the parameter to which the value of the given expressi on will be bound.
923 * Otherwise, return {@code null}. 923 * Otherwise, return `null`.
924 * <p> 924 *
925 * This method is only intended to be used by {@link Expression#getStaticParam eterElement()}. 925 * This method is only intended to be used by [Expression#getStaticParameterEl ement].
926 * @param expression the expression corresponding to the parameter to be retur ned 926 * @param expression the expression corresponding to the parameter to be retur ned
927 * @return the parameter element representing the parameter to which the value of the expression 927 * @return the parameter element representing the parameter to which the value of the expression
928 * will be bound 928 * will be bound
929 */ 929 */
930 ParameterElement getStaticParameterElementFor(Expression expression) { 930 ParameterElement getStaticParameterElementFor(Expression expression) {
931 if (_correspondingStaticParameters == null) { 931 if (_correspondingStaticParameters == null) {
932 return null; 932 return null;
933 } 933 }
934 int index = _arguments.indexOf(expression); 934 int index = _arguments.indexOf(expression);
935 if (index < 0) { 935 if (index < 0) {
936 return null; 936 return null;
937 } 937 }
938 return _correspondingStaticParameters[index]; 938 return _correspondingStaticParameters[index];
939 } 939 }
940 } 940 }
941 /** 941 /**
942 * Instances of the class {@code AsExpression} represent an 'as' expression. 942 * Instances of the class `AsExpression` represent an 'as' expression.
943 * <pre> 943 * <pre>
944 * asExpression ::={@link Expression expression} 'as' {@link TypeName type}</pre > 944 * asExpression ::=[Expression expression] 'as' [TypeName type]</pre>
945 * @coverage dart.engine.ast 945 * @coverage dart.engine.ast
946 */ 946 */
947 class AsExpression extends Expression { 947 class AsExpression extends Expression {
948 948
949 /** 949 /**
950 * The expression used to compute the value being cast. 950 * The expression used to compute the value being cast.
951 */ 951 */
952 Expression _expression; 952 Expression _expression;
953 953
954 /** 954 /**
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 */ 1024 */
1025 void set type(TypeName name) { 1025 void set type(TypeName name) {
1026 this._type = becomeParentOf(name); 1026 this._type = becomeParentOf(name);
1027 } 1027 }
1028 void visitChildren(ASTVisitor<Object> visitor) { 1028 void visitChildren(ASTVisitor<Object> visitor) {
1029 safelyVisitChild(_expression, visitor); 1029 safelyVisitChild(_expression, visitor);
1030 safelyVisitChild(_type, visitor); 1030 safelyVisitChild(_type, visitor);
1031 } 1031 }
1032 } 1032 }
1033 /** 1033 /**
1034 * Instances of the class {@code AssertStatement} represent an assert statement. 1034 * Instances of the class `AssertStatement` represent an assert statement.
1035 * <pre> 1035 * <pre>
1036 * assertStatement ::= 1036 * assertStatement ::=
1037 * 'assert' '(' {@link Expression conditionalExpression} ')' ';' 1037 * 'assert' '(' [Expression conditionalExpression] ')' ';'
1038 * </pre> 1038 * </pre>
1039 * @coverage dart.engine.ast 1039 * @coverage dart.engine.ast
1040 */ 1040 */
1041 class AssertStatement extends Statement { 1041 class AssertStatement extends Statement {
1042 1042
1043 /** 1043 /**
1044 * The token representing the 'assert' keyword. 1044 * The token representing the 'assert' keyword.
1045 */ 1045 */
1046 Token _keyword; 1046 Token _keyword;
1047 1047
1048 /** 1048 /**
1049 * The left parenthesis. 1049 * The left parenthesis.
1050 */ 1050 */
1051 Token _leftParenthesis; 1051 Token _leftParenthesis;
1052 1052
1053 /** 1053 /**
1054 * The condition that is being asserted to be {@code true}. 1054 * The condition that is being asserted to be `true`.
1055 */ 1055 */
1056 Expression _condition; 1056 Expression _condition;
1057 1057
1058 /** 1058 /**
1059 * The right parenthesis. 1059 * The right parenthesis.
1060 */ 1060 */
1061 Token _rightParenthesis; 1061 Token _rightParenthesis;
1062 1062
1063 /** 1063 /**
1064 * The semicolon terminating the statement. 1064 * The semicolon terminating the statement.
1065 */ 1065 */
1066 Token _semicolon; 1066 Token _semicolon;
1067 1067
1068 /** 1068 /**
1069 * Initialize a newly created assert statement. 1069 * Initialize a newly created assert statement.
1070 * @param keyword the token representing the 'assert' keyword 1070 * @param keyword the token representing the 'assert' keyword
1071 * @param leftParenthesis the left parenthesis 1071 * @param leftParenthesis the left parenthesis
1072 * @param condition the condition that is being asserted to be {@code true} 1072 * @param condition the condition that is being asserted to be `true`
1073 * @param rightParenthesis the right parenthesis 1073 * @param rightParenthesis the right parenthesis
1074 * @param semicolon the semicolon terminating the statement 1074 * @param semicolon the semicolon terminating the statement
1075 */ 1075 */
1076 AssertStatement.full(Token keyword, Token leftParenthesis, Expression conditio n, Token rightParenthesis, Token semicolon) { 1076 AssertStatement.full(Token keyword, Token leftParenthesis, Expression conditio n, Token rightParenthesis, Token semicolon) {
1077 this._keyword = keyword; 1077 this._keyword = keyword;
1078 this._leftParenthesis = leftParenthesis; 1078 this._leftParenthesis = leftParenthesis;
1079 this._condition = becomeParentOf(condition); 1079 this._condition = becomeParentOf(condition);
1080 this._rightParenthesis = rightParenthesis; 1080 this._rightParenthesis = rightParenthesis;
1081 this._semicolon = semicolon; 1081 this._semicolon = semicolon;
1082 } 1082 }
1083 1083
1084 /** 1084 /**
1085 * Initialize a newly created assert statement. 1085 * Initialize a newly created assert statement.
1086 * @param keyword the token representing the 'assert' keyword 1086 * @param keyword the token representing the 'assert' keyword
1087 * @param leftParenthesis the left parenthesis 1087 * @param leftParenthesis the left parenthesis
1088 * @param condition the condition that is being asserted to be {@code true} 1088 * @param condition the condition that is being asserted to be `true`
1089 * @param rightParenthesis the right parenthesis 1089 * @param rightParenthesis the right parenthesis
1090 * @param semicolon the semicolon terminating the statement 1090 * @param semicolon the semicolon terminating the statement
1091 */ 1091 */
1092 AssertStatement({Token keyword, Token leftParenthesis, Expression condition, T oken rightParenthesis, Token semicolon}) : this.full(keyword, leftParenthesis, c ondition, rightParenthesis, semicolon); 1092 AssertStatement({Token keyword, Token leftParenthesis, Expression condition, T oken rightParenthesis, Token semicolon}) : this.full(keyword, leftParenthesis, c ondition, rightParenthesis, semicolon);
1093 accept(ASTVisitor visitor) => visitor.visitAssertStatement(this); 1093 accept(ASTVisitor visitor) => visitor.visitAssertStatement(this);
1094 Token get beginToken => _keyword; 1094 Token get beginToken => _keyword;
1095 1095
1096 /** 1096 /**
1097 * Return the condition that is being asserted to be {@code true}. 1097 * Return the condition that is being asserted to be `true`.
1098 * @return the condition that is being asserted to be {@code true} 1098 * @return the condition that is being asserted to be `true`
1099 */ 1099 */
1100 Expression get condition => _condition; 1100 Expression get condition => _condition;
1101 Token get endToken => _semicolon; 1101 Token get endToken => _semicolon;
1102 1102
1103 /** 1103 /**
1104 * Return the token representing the 'assert' keyword. 1104 * Return the token representing the 'assert' keyword.
1105 * @return the token representing the 'assert' keyword 1105 * @return the token representing the 'assert' keyword
1106 */ 1106 */
1107 Token get keyword => _keyword; 1107 Token get keyword => _keyword;
1108 1108
1109 /** 1109 /**
1110 * Return the left parenthesis. 1110 * Return the left parenthesis.
1111 * @return the left parenthesis 1111 * @return the left parenthesis
1112 */ 1112 */
1113 Token get leftParenthesis => _leftParenthesis; 1113 Token get leftParenthesis => _leftParenthesis;
1114 1114
1115 /** 1115 /**
1116 * Return the right parenthesis. 1116 * Return the right parenthesis.
1117 * @return the right parenthesis 1117 * @return the right parenthesis
1118 */ 1118 */
1119 Token get rightParenthesis => _rightParenthesis; 1119 Token get rightParenthesis => _rightParenthesis;
1120 1120
1121 /** 1121 /**
1122 * Return the semicolon terminating the statement. 1122 * Return the semicolon terminating the statement.
1123 * @return the semicolon terminating the statement 1123 * @return the semicolon terminating the statement
1124 */ 1124 */
1125 Token get semicolon => _semicolon; 1125 Token get semicolon => _semicolon;
1126 1126
1127 /** 1127 /**
1128 * Set the condition that is being asserted to be {@code true} to the given ex pression. 1128 * Set the condition that is being asserted to be `true` to the given expressi on.
1129 * @param the condition that is being asserted to be {@code true} 1129 * @param the condition that is being asserted to be `true`
1130 */ 1130 */
1131 void set condition(Expression condition2) { 1131 void set condition(Expression condition2) {
1132 this._condition = becomeParentOf(condition2); 1132 this._condition = becomeParentOf(condition2);
1133 } 1133 }
1134 1134
1135 /** 1135 /**
1136 * Set the token representing the 'assert' keyword to the given token. 1136 * Set the token representing the 'assert' keyword to the given token.
1137 * @param keyword the token representing the 'assert' keyword 1137 * @param keyword the token representing the 'assert' keyword
1138 */ 1138 */
1139 void set keyword(Token keyword2) { 1139 void set keyword(Token keyword2) {
(...skipping 21 matching lines...) Expand all
1161 * @param semicolon the semicolon terminating the statement 1161 * @param semicolon the semicolon terminating the statement
1162 */ 1162 */
1163 void set semicolon(Token semicolon2) { 1163 void set semicolon(Token semicolon2) {
1164 this._semicolon = semicolon2; 1164 this._semicolon = semicolon2;
1165 } 1165 }
1166 void visitChildren(ASTVisitor<Object> visitor) { 1166 void visitChildren(ASTVisitor<Object> visitor) {
1167 safelyVisitChild(_condition, visitor); 1167 safelyVisitChild(_condition, visitor);
1168 } 1168 }
1169 } 1169 }
1170 /** 1170 /**
1171 * Instances of the class {@code AssignmentExpression} represent an assignment e xpression. 1171 * Instances of the class `AssignmentExpression` represent an assignment express ion.
1172 * <pre> 1172 * <pre>
1173 * assignmentExpression ::={@link Expression leftHandSide} {@link Token operator } {@link Expression rightHandSide}</pre> 1173 * assignmentExpression ::=[Expression leftHandSide] [Token operator] [Expressio n rightHandSide]</pre>
1174 * @coverage dart.engine.ast 1174 * @coverage dart.engine.ast
1175 */ 1175 */
1176 class AssignmentExpression extends Expression { 1176 class AssignmentExpression extends Expression {
1177 1177
1178 /** 1178 /**
1179 * The expression used to compute the left hand side. 1179 * The expression used to compute the left hand side.
1180 */ 1180 */
1181 Expression _leftHandSide; 1181 Expression _leftHandSide;
1182 1182
1183 /** 1183 /**
1184 * The assignment operator being applied. 1184 * The assignment operator being applied.
1185 */ 1185 */
1186 Token _operator; 1186 Token _operator;
1187 1187
1188 /** 1188 /**
1189 * The expression used to compute the right hand side. 1189 * The expression used to compute the right hand side.
1190 */ 1190 */
1191 Expression _rightHandSide; 1191 Expression _rightHandSide;
1192 1192
1193 /** 1193 /**
1194 * The element associated with the operator based on the static type of the le ft-hand-side, or{@code null} if the AST structure has not been resolved, if the operator is not a compound 1194 * The element associated with the operator based on the static type of the le ft-hand-side, or`null` if the AST structure has not been resolved, if the operat or is not a compound
1195 * operator, or if the operator could not be resolved. 1195 * operator, or if the operator could not be resolved.
1196 */ 1196 */
1197 MethodElement _staticElement; 1197 MethodElement _staticElement;
1198 1198
1199 /** 1199 /**
1200 * The element associated with the operator based on the propagated type of th e left-hand-side, or{@code null} if the AST structure has not been resolved, if the operator is not a compound 1200 * The element associated with the operator based on the propagated type of th e left-hand-side, or`null` if the AST structure has not been resolved, if the op erator is not a compound
1201 * operator, or if the operator could not be resolved. 1201 * operator, or if the operator could not be resolved.
1202 */ 1202 */
1203 MethodElement _propagatedElement; 1203 MethodElement _propagatedElement;
1204 1204
1205 /** 1205 /**
1206 * Initialize a newly created assignment expression. 1206 * Initialize a newly created assignment expression.
1207 * @param leftHandSide the expression used to compute the left hand side 1207 * @param leftHandSide the expression used to compute the left hand side
1208 * @param operator the assignment operator being applied 1208 * @param operator the assignment operator being applied
1209 * @param rightHandSide the expression used to compute the right hand side 1209 * @param rightHandSide the expression used to compute the right hand side
1210 */ 1210 */
1211 AssignmentExpression.full(Expression leftHandSide, Token operator, Expression rightHandSide) { 1211 AssignmentExpression.full(Expression leftHandSide, Token operator, Expression rightHandSide) {
1212 this._leftHandSide = becomeParentOf(leftHandSide); 1212 this._leftHandSide = becomeParentOf(leftHandSide);
1213 this._operator = operator; 1213 this._operator = operator;
1214 this._rightHandSide = becomeParentOf(rightHandSide); 1214 this._rightHandSide = becomeParentOf(rightHandSide);
1215 } 1215 }
1216 1216
1217 /** 1217 /**
1218 * Initialize a newly created assignment expression. 1218 * Initialize a newly created assignment expression.
1219 * @param leftHandSide the expression used to compute the left hand side 1219 * @param leftHandSide the expression used to compute the left hand side
1220 * @param operator the assignment operator being applied 1220 * @param operator the assignment operator being applied
1221 * @param rightHandSide the expression used to compute the right hand side 1221 * @param rightHandSide the expression used to compute the right hand side
1222 */ 1222 */
1223 AssignmentExpression({Expression leftHandSide, Token operator, Expression righ tHandSide}) : this.full(leftHandSide, operator, rightHandSide); 1223 AssignmentExpression({Expression leftHandSide, Token operator, Expression righ tHandSide}) : this.full(leftHandSide, operator, rightHandSide);
1224 accept(ASTVisitor visitor) => visitor.visitAssignmentExpression(this); 1224 accept(ASTVisitor visitor) => visitor.visitAssignmentExpression(this);
1225 Token get beginToken => _leftHandSide.beginToken; 1225 Token get beginToken => _leftHandSide.beginToken;
1226 1226
1227 /** 1227 /**
1228 * Return the element associated with the operator based on the propagated typ e of the 1228 * Return the element associated with the operator based on the propagated typ e of the
1229 * left-hand-side, or {@code null} if the AST structure has not been resolved, if the operator is 1229 * left-hand-side, or `null` if the AST structure has not been resolved, if th e operator is
1230 * not a compound operator, or if the operator could not be resolved. One exam ple of the latter 1230 * not a compound operator, or if the operator could not be resolved. One exam ple of the latter
1231 * case is an operator that is not defined for the type of the left-hand opera nd. 1231 * case is an operator that is not defined for the type of the left-hand opera nd.
1232 * @return the element associated with the operator 1232 * @return the element associated with the operator
1233 */ 1233 */
1234 MethodElement get element => _propagatedElement; 1234 MethodElement get element => _propagatedElement;
1235 Token get endToken => _rightHandSide.endToken; 1235 Token get endToken => _rightHandSide.endToken;
1236 1236
1237 /** 1237 /**
1238 * Set the expression used to compute the left hand side to the given expressi on. 1238 * Set the expression used to compute the left hand side to the given expressi on.
1239 * @return the expression used to compute the left hand side 1239 * @return the expression used to compute the left hand side
1240 */ 1240 */
1241 Expression get leftHandSide => _leftHandSide; 1241 Expression get leftHandSide => _leftHandSide;
1242 1242
1243 /** 1243 /**
1244 * Return the assignment operator being applied. 1244 * Return the assignment operator being applied.
1245 * @return the assignment operator being applied 1245 * @return the assignment operator being applied
1246 */ 1246 */
1247 Token get operator => _operator; 1247 Token get operator => _operator;
1248 1248
1249 /** 1249 /**
1250 * Return the expression used to compute the right hand side. 1250 * Return the expression used to compute the right hand side.
1251 * @return the expression used to compute the right hand side 1251 * @return the expression used to compute the right hand side
1252 */ 1252 */
1253 Expression get rightHandSide => _rightHandSide; 1253 Expression get rightHandSide => _rightHandSide;
1254 1254
1255 /** 1255 /**
1256 * Return the element associated with the operator based on the static type of the left-hand-side, 1256 * Return the element associated with the operator based on the static type of the left-hand-side,
1257 * or {@code null} if the AST structure has not been resolved, if the operator is not a compound 1257 * or `null` if the AST structure has not been resolved, if the operator is no t a compound
1258 * operator, or if the operator could not be resolved. One example of the latt er case is an 1258 * operator, or if the operator could not be resolved. One example of the latt er case is an
1259 * operator that is not defined for the type of the left-hand operand. 1259 * operator that is not defined for the type of the left-hand operand.
1260 * @return the element associated with the operator 1260 * @return the element associated with the operator
1261 */ 1261 */
1262 MethodElement get staticElement => _staticElement; 1262 MethodElement get staticElement => _staticElement;
1263 1263
1264 /** 1264 /**
1265 * Set the element associated with the operator based on the propagated type o f the left-hand-side 1265 * Set the element associated with the operator based on the propagated type o f the left-hand-side
1266 * to the given element. 1266 * to the given element.
1267 * @param element the element to be associated with the operator 1267 * @param element the element to be associated with the operator
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 */ 1301 */
1302 void set staticElement(MethodElement element) { 1302 void set staticElement(MethodElement element) {
1303 _staticElement = element; 1303 _staticElement = element;
1304 } 1304 }
1305 void visitChildren(ASTVisitor<Object> visitor) { 1305 void visitChildren(ASTVisitor<Object> visitor) {
1306 safelyVisitChild(_leftHandSide, visitor); 1306 safelyVisitChild(_leftHandSide, visitor);
1307 safelyVisitChild(_rightHandSide, visitor); 1307 safelyVisitChild(_rightHandSide, visitor);
1308 } 1308 }
1309 } 1309 }
1310 /** 1310 /**
1311 * Instances of the class {@code BinaryExpression} represent a binary (infix) ex pression. 1311 * Instances of the class `BinaryExpression` represent a binary (infix) expressi on.
1312 * <pre> 1312 * <pre>
1313 * binaryExpression ::={@link Expression leftOperand} {@link Token operator} {@l ink Expression rightOperand}</pre> 1313 * binaryExpression ::=[Expression leftOperand] [Token operator] [Expression rig htOperand]</pre>
1314 * @coverage dart.engine.ast 1314 * @coverage dart.engine.ast
1315 */ 1315 */
1316 class BinaryExpression extends Expression { 1316 class BinaryExpression extends Expression {
1317 1317
1318 /** 1318 /**
1319 * The expression used to compute the left operand. 1319 * The expression used to compute the left operand.
1320 */ 1320 */
1321 Expression _leftOperand; 1321 Expression _leftOperand;
1322 1322
1323 /** 1323 /**
1324 * The binary operator being applied. 1324 * The binary operator being applied.
1325 */ 1325 */
1326 Token _operator; 1326 Token _operator;
1327 1327
1328 /** 1328 /**
1329 * The expression used to compute the right operand. 1329 * The expression used to compute the right operand.
1330 */ 1330 */
1331 Expression _rightOperand; 1331 Expression _rightOperand;
1332 1332
1333 /** 1333 /**
1334 * The element associated with the operator based on the static type of the le ft operand, or{@code null} if the AST structure has not been resolved, if the op erator is not user definable, 1334 * The element associated with the operator based on the static type of the le ft operand, or`null` if the AST structure has not been resolved, if the operator is not user definable,
1335 * or if the operator could not be resolved. 1335 * or if the operator could not be resolved.
1336 */ 1336 */
1337 MethodElement _staticElement; 1337 MethodElement _staticElement;
1338 1338
1339 /** 1339 /**
1340 * The element associated with the operator based on the propagated type of th e left operand, or{@code null} if the AST structure has not been resolved, if th e operator is not user definable, 1340 * The element associated with the operator based on the propagated type of th e left operand, or`null` if the AST structure has not been resolved, if the oper ator is not user definable,
1341 * or if the operator could not be resolved. 1341 * or if the operator could not be resolved.
1342 */ 1342 */
1343 MethodElement _propagatedElement; 1343 MethodElement _propagatedElement;
1344 1344
1345 /** 1345 /**
1346 * Initialize a newly created binary expression. 1346 * Initialize a newly created binary expression.
1347 * @param leftOperand the expression used to compute the left operand 1347 * @param leftOperand the expression used to compute the left operand
1348 * @param operator the binary operator being applied 1348 * @param operator the binary operator being applied
1349 * @param rightOperand the expression used to compute the right operand 1349 * @param rightOperand the expression used to compute the right operand
1350 */ 1350 */
1351 BinaryExpression.full(Expression leftOperand, Token operator, Expression right Operand) { 1351 BinaryExpression.full(Expression leftOperand, Token operator, Expression right Operand) {
1352 this._leftOperand = becomeParentOf(leftOperand); 1352 this._leftOperand = becomeParentOf(leftOperand);
1353 this._operator = operator; 1353 this._operator = operator;
1354 this._rightOperand = becomeParentOf(rightOperand); 1354 this._rightOperand = becomeParentOf(rightOperand);
1355 } 1355 }
1356 1356
1357 /** 1357 /**
1358 * Initialize a newly created binary expression. 1358 * Initialize a newly created binary expression.
1359 * @param leftOperand the expression used to compute the left operand 1359 * @param leftOperand the expression used to compute the left operand
1360 * @param operator the binary operator being applied 1360 * @param operator the binary operator being applied
1361 * @param rightOperand the expression used to compute the right operand 1361 * @param rightOperand the expression used to compute the right operand
1362 */ 1362 */
1363 BinaryExpression({Expression leftOperand, Token operator, Expression rightOper and}) : this.full(leftOperand, operator, rightOperand); 1363 BinaryExpression({Expression leftOperand, Token operator, Expression rightOper and}) : this.full(leftOperand, operator, rightOperand);
1364 accept(ASTVisitor visitor) => visitor.visitBinaryExpression(this); 1364 accept(ASTVisitor visitor) => visitor.visitBinaryExpression(this);
1365 Token get beginToken => _leftOperand.beginToken; 1365 Token get beginToken => _leftOperand.beginToken;
1366 1366
1367 /** 1367 /**
1368 * Return the element associated with the operator based on the propagated typ e of the left 1368 * Return the element associated with the operator based on the propagated typ e of the left
1369 * operand, or {@code null} if the AST structure has not been resolved, if the operator is not 1369 * operand, or `null` if the AST structure has not been resolved, if the opera tor is not
1370 * user definable, or if the operator could not be resolved. One example of th e latter case is an 1370 * user definable, or if the operator could not be resolved. One example of th e latter case is an
1371 * operator that is not defined for the type of the left-hand operand. 1371 * operator that is not defined for the type of the left-hand operand.
1372 * @return the element associated with the operator 1372 * @return the element associated with the operator
1373 */ 1373 */
1374 MethodElement get element => _propagatedElement; 1374 MethodElement get element => _propagatedElement;
1375 Token get endToken => _rightOperand.endToken; 1375 Token get endToken => _rightOperand.endToken;
1376 1376
1377 /** 1377 /**
1378 * Return the expression used to compute the left operand. 1378 * Return the expression used to compute the left operand.
1379 * @return the expression used to compute the left operand 1379 * @return the expression used to compute the left operand
1380 */ 1380 */
1381 Expression get leftOperand => _leftOperand; 1381 Expression get leftOperand => _leftOperand;
1382 1382
1383 /** 1383 /**
1384 * Return the binary operator being applied. 1384 * Return the binary operator being applied.
1385 * @return the binary operator being applied 1385 * @return the binary operator being applied
1386 */ 1386 */
1387 Token get operator => _operator; 1387 Token get operator => _operator;
1388 1388
1389 /** 1389 /**
1390 * Return the expression used to compute the right operand. 1390 * Return the expression used to compute the right operand.
1391 * @return the expression used to compute the right operand 1391 * @return the expression used to compute the right operand
1392 */ 1392 */
1393 Expression get rightOperand => _rightOperand; 1393 Expression get rightOperand => _rightOperand;
1394 1394
1395 /** 1395 /**
1396 * Return the element associated with the operator based on the static type of the left operand, 1396 * Return the element associated with the operator based on the static type of the left operand,
1397 * or {@code null} if the AST structure has not been resolved, if the operator is not user 1397 * or `null` if the AST structure has not been resolved, if the operator is no t user
1398 * definable, or if the operator could not be resolved. One example of the lat ter case is an 1398 * definable, or if the operator could not be resolved. One example of the lat ter case is an
1399 * operator that is not defined for the type of the left operand. 1399 * operator that is not defined for the type of the left operand.
1400 * @return the element associated with the operator 1400 * @return the element associated with the operator
1401 */ 1401 */
1402 MethodElement get staticElement => _staticElement; 1402 MethodElement get staticElement => _staticElement;
1403 1403
1404 /** 1404 /**
1405 * Set the element associated with the operator based on the propagated type o f the left operand 1405 * Set the element associated with the operator based on the propagated type o f the left operand
1406 * to the given element. 1406 * to the given element.
1407 * @param element the element to be associated with the operator 1407 * @param element the element to be associated with the operator
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 _staticElement = element; 1443 _staticElement = element;
1444 } 1444 }
1445 void visitChildren(ASTVisitor<Object> visitor) { 1445 void visitChildren(ASTVisitor<Object> visitor) {
1446 safelyVisitChild(_leftOperand, visitor); 1446 safelyVisitChild(_leftOperand, visitor);
1447 safelyVisitChild(_rightOperand, visitor); 1447 safelyVisitChild(_rightOperand, visitor);
1448 } 1448 }
1449 1449
1450 /** 1450 /**
1451 * If the AST structure has been resolved, and the function being invoked is k nown based on 1451 * If the AST structure has been resolved, and the function being invoked is k nown based on
1452 * propagated type information, then return the parameter element representing the parameter to 1452 * propagated type information, then return the parameter element representing the parameter to
1453 * which the value of the right operand will be bound. Otherwise, return {@cod e null}. 1453 * which the value of the right operand will be bound. Otherwise, return `null `.
1454 * <p> 1454 *
1455 * This method is only intended to be used by {@link Expression#getParameterEl ement()}. 1455 * This method is only intended to be used by [Expression#getParameterElement] .
1456 * @return the parameter element representing the parameter to which the value of the right 1456 * @return the parameter element representing the parameter to which the value of the right
1457 * operand will be bound 1457 * operand will be bound
1458 */ 1458 */
1459 ParameterElement get propagatedParameterElementForRightOperand { 1459 ParameterElement get propagatedParameterElementForRightOperand {
1460 if (_propagatedElement == null) { 1460 if (_propagatedElement == null) {
1461 return null; 1461 return null;
1462 } 1462 }
1463 List<ParameterElement> parameters = _propagatedElement.parameters; 1463 List<ParameterElement> parameters = _propagatedElement.parameters;
1464 if (parameters.length < 1) { 1464 if (parameters.length < 1) {
1465 return null; 1465 return null;
1466 } 1466 }
1467 return parameters[0]; 1467 return parameters[0];
1468 } 1468 }
1469 1469
1470 /** 1470 /**
1471 * If the AST structure has been resolved, and the function being invoked is k nown based on static 1471 * If the AST structure has been resolved, and the function being invoked is k nown based on static
1472 * type information, then return the parameter element representing the parame ter to which the 1472 * type information, then return the parameter element representing the parame ter to which the
1473 * value of the right operand will be bound. Otherwise, return {@code null}. 1473 * value of the right operand will be bound. Otherwise, return `null`.
1474 * <p> 1474 *
1475 * This method is only intended to be used by {@link Expression#getStaticParam eterElement()}. 1475 * This method is only intended to be used by [Expression#getStaticParameterEl ement].
1476 * @return the parameter element representing the parameter to which the value of the right 1476 * @return the parameter element representing the parameter to which the value of the right
1477 * operand will be bound 1477 * operand will be bound
1478 */ 1478 */
1479 ParameterElement get staticParameterElementForRightOperand { 1479 ParameterElement get staticParameterElementForRightOperand {
1480 if (_staticElement == null) { 1480 if (_staticElement == null) {
1481 return null; 1481 return null;
1482 } 1482 }
1483 List<ParameterElement> parameters = _staticElement.parameters; 1483 List<ParameterElement> parameters = _staticElement.parameters;
1484 if (parameters.length < 1) { 1484 if (parameters.length < 1) {
1485 return null; 1485 return null;
1486 } 1486 }
1487 return parameters[0]; 1487 return parameters[0];
1488 } 1488 }
1489 } 1489 }
1490 /** 1490 /**
1491 * Instances of the class {@code Block} represent a sequence of statements. 1491 * Instances of the class `Block` represent a sequence of statements.
1492 * <pre> 1492 * <pre>
1493 * block ::= 1493 * block ::=
1494 * '{' statement* '}' 1494 * '{' statement* '}'
1495 * </pre> 1495 * </pre>
1496 * @coverage dart.engine.ast 1496 * @coverage dart.engine.ast
1497 */ 1497 */
1498 class Block extends Statement { 1498 class Block extends Statement {
1499 1499
1500 /** 1500 /**
1501 * The left curly bracket. 1501 * The left curly bracket.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 * @param rightBracket the right curly bracket 1567 * @param rightBracket the right curly bracket
1568 */ 1568 */
1569 void set rightBracket(Token rightBracket2) { 1569 void set rightBracket(Token rightBracket2) {
1570 this._rightBracket = rightBracket2; 1570 this._rightBracket = rightBracket2;
1571 } 1571 }
1572 void visitChildren(ASTVisitor<Object> visitor) { 1572 void visitChildren(ASTVisitor<Object> visitor) {
1573 _statements.accept(visitor); 1573 _statements.accept(visitor);
1574 } 1574 }
1575 } 1575 }
1576 /** 1576 /**
1577 * Instances of the class {@code BlockFunctionBody} represent a function body th at consists of a 1577 * Instances of the class `BlockFunctionBody` represent a function body that con sists of a
1578 * block of statements. 1578 * block of statements.
1579 * <pre> 1579 * <pre>
1580 * blockFunctionBody ::={@link Block block}</pre> 1580 * blockFunctionBody ::=[Block block]</pre>
1581 * @coverage dart.engine.ast 1581 * @coverage dart.engine.ast
1582 */ 1582 */
1583 class BlockFunctionBody extends FunctionBody { 1583 class BlockFunctionBody extends FunctionBody {
1584 1584
1585 /** 1585 /**
1586 * The block representing the body of the function. 1586 * The block representing the body of the function.
1587 */ 1587 */
1588 Block _block; 1588 Block _block;
1589 1589
1590 /** 1590 /**
(...skipping 24 matching lines...) Expand all
1615 * @param block the block representing the body of the function 1615 * @param block the block representing the body of the function
1616 */ 1616 */
1617 void set block(Block block2) { 1617 void set block(Block block2) {
1618 this._block = becomeParentOf(block2); 1618 this._block = becomeParentOf(block2);
1619 } 1619 }
1620 void visitChildren(ASTVisitor<Object> visitor) { 1620 void visitChildren(ASTVisitor<Object> visitor) {
1621 safelyVisitChild(_block, visitor); 1621 safelyVisitChild(_block, visitor);
1622 } 1622 }
1623 } 1623 }
1624 /** 1624 /**
1625 * Instances of the class {@code BooleanLiteral} represent a boolean literal exp ression. 1625 * Instances of the class `BooleanLiteral` represent a boolean literal expressio n.
1626 * <pre> 1626 * <pre>
1627 * booleanLiteral ::= 1627 * booleanLiteral ::=
1628 * 'false' | 'true' 1628 * 'false' | 'true'
1629 * </pre> 1629 * </pre>
1630 * @coverage dart.engine.ast 1630 * @coverage dart.engine.ast
1631 */ 1631 */
1632 class BooleanLiteral extends Literal { 1632 class BooleanLiteral extends Literal {
1633 1633
1634 /** 1634 /**
1635 * The token representing the literal. 1635 * The token representing the literal.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1686 * Set the value of the literal to the given value. 1686 * Set the value of the literal to the given value.
1687 * @param value the value of the literal 1687 * @param value the value of the literal
1688 */ 1688 */
1689 void set value(bool value2) { 1689 void set value(bool value2) {
1690 this._value = value2; 1690 this._value = value2;
1691 } 1691 }
1692 void visitChildren(ASTVisitor<Object> visitor) { 1692 void visitChildren(ASTVisitor<Object> visitor) {
1693 } 1693 }
1694 } 1694 }
1695 /** 1695 /**
1696 * Instances of the class {@code BreakStatement} represent a break statement. 1696 * Instances of the class `BreakStatement` represent a break statement.
1697 * <pre> 1697 * <pre>
1698 * breakStatement ::= 1698 * breakStatement ::=
1699 * 'break' {@link SimpleIdentifier label}? ';' 1699 * 'break' [SimpleIdentifier label]? ';'
1700 * </pre> 1700 * </pre>
1701 * @coverage dart.engine.ast 1701 * @coverage dart.engine.ast
1702 */ 1702 */
1703 class BreakStatement extends Statement { 1703 class BreakStatement extends Statement {
1704 1704
1705 /** 1705 /**
1706 * The token representing the 'break' keyword. 1706 * The token representing the 'break' keyword.
1707 */ 1707 */
1708 Token _keyword; 1708 Token _keyword;
1709 1709
1710 /** 1710 /**
1711 * The label associated with the statement, or {@code null} if there is no lab el. 1711 * The label associated with the statement, or `null` if there is no label.
1712 */ 1712 */
1713 SimpleIdentifier _label; 1713 SimpleIdentifier _label;
1714 1714
1715 /** 1715 /**
1716 * The semicolon terminating the statement. 1716 * The semicolon terminating the statement.
1717 */ 1717 */
1718 Token _semicolon; 1718 Token _semicolon;
1719 1719
1720 /** 1720 /**
1721 * Initialize a newly created break statement. 1721 * Initialize a newly created break statement.
(...skipping 18 matching lines...) Expand all
1740 Token get beginToken => _keyword; 1740 Token get beginToken => _keyword;
1741 Token get endToken => _semicolon; 1741 Token get endToken => _semicolon;
1742 1742
1743 /** 1743 /**
1744 * Return the token representing the 'break' keyword. 1744 * Return the token representing the 'break' keyword.
1745 * @return the token representing the 'break' keyword 1745 * @return the token representing the 'break' keyword
1746 */ 1746 */
1747 Token get keyword => _keyword; 1747 Token get keyword => _keyword;
1748 1748
1749 /** 1749 /**
1750 * Return the label associated with the statement, or {@code null} if there is no label. 1750 * Return the label associated with the statement, or `null` if there is no la bel.
1751 * @return the label associated with the statement 1751 * @return the label associated with the statement
1752 */ 1752 */
1753 SimpleIdentifier get label => _label; 1753 SimpleIdentifier get label => _label;
1754 1754
1755 /** 1755 /**
1756 * Return the semicolon terminating the statement. 1756 * Return the semicolon terminating the statement.
1757 * @return the semicolon terminating the statement 1757 * @return the semicolon terminating the statement
1758 */ 1758 */
1759 Token get semicolon => _semicolon; 1759 Token get semicolon => _semicolon;
1760 1760
(...skipping 18 matching lines...) Expand all
1779 * @param semicolon the semicolon terminating the statement 1779 * @param semicolon the semicolon terminating the statement
1780 */ 1780 */
1781 void set semicolon(Token semicolon2) { 1781 void set semicolon(Token semicolon2) {
1782 this._semicolon = semicolon2; 1782 this._semicolon = semicolon2;
1783 } 1783 }
1784 void visitChildren(ASTVisitor<Object> visitor) { 1784 void visitChildren(ASTVisitor<Object> visitor) {
1785 safelyVisitChild(_label, visitor); 1785 safelyVisitChild(_label, visitor);
1786 } 1786 }
1787 } 1787 }
1788 /** 1788 /**
1789 * Instances of the class {@code CascadeExpression} represent a sequence of casc aded expressions: 1789 * Instances of the class `CascadeExpression` represent a sequence of cascaded e xpressions:
1790 * expressions that share a common target. There are three kinds of expressions that can be used in 1790 * expressions that share a common target. There are three kinds of expressions that can be used in
1791 * a cascade expression: {@link IndexExpression}, {@link MethodInvocation} and{@ link PropertyAccess}. 1791 * a cascade expression: [IndexExpression], [MethodInvocation] and[PropertyAcces s].
1792 * <pre> 1792 * <pre>
1793 * cascadeExpression ::={@link Expression conditionalExpression} cascadeSection 1793 * cascadeExpression ::=[Expression conditionalExpression] cascadeSection
1794 * cascadeSection ::= 1794 * cascadeSection ::=
1795 * '..' (cascadeSelector arguments*) (assignableSelector arguments*)* (assignme ntOperator expressionWithoutCascade)? 1795 * '..' (cascadeSelector arguments*) (assignableSelector arguments*)* (assignme ntOperator expressionWithoutCascade)?
1796 * cascadeSelector ::= 1796 * cascadeSelector ::=
1797 * '\[ ' expression '\] ' 1797 * '\[ ' expression '\] '
1798 * | identifier 1798 * | identifier
1799 * </pre> 1799 * </pre>
1800 * @coverage dart.engine.ast 1800 * @coverage dart.engine.ast
1801 */ 1801 */
1802 class CascadeExpression extends Expression { 1802 class CascadeExpression extends Expression {
1803 1803
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1850 */ 1850 */
1851 void set target(Expression target2) { 1851 void set target(Expression target2) {
1852 this._target = becomeParentOf(target2); 1852 this._target = becomeParentOf(target2);
1853 } 1853 }
1854 void visitChildren(ASTVisitor<Object> visitor) { 1854 void visitChildren(ASTVisitor<Object> visitor) {
1855 safelyVisitChild(_target, visitor); 1855 safelyVisitChild(_target, visitor);
1856 _cascadeSections.accept(visitor); 1856 _cascadeSections.accept(visitor);
1857 } 1857 }
1858 } 1858 }
1859 /** 1859 /**
1860 * Instances of the class {@code CatchClause} represent a catch clause within a try statement. 1860 * Instances of the class `CatchClause` represent a catch clause within a try st atement.
1861 * <pre> 1861 * <pre>
1862 * onPart ::= 1862 * onPart ::=
1863 * catchPart {@link Block block}| 'on' type catchPart? {@link Block block}catchP art ::= 1863 * catchPart [Block block]| 'on' type catchPart? [Block block]catchPart ::=
1864 * 'catch' '(' {@link SimpleIdentifier exceptionParameter} (',' {@link SimpleIde ntifier stackTraceParameter})? ')' 1864 * 'catch' '(' [SimpleIdentifier exceptionParameter] (',' [SimpleIdentifier stac kTraceParameter])? ')'
1865 * </pre> 1865 * </pre>
1866 * @coverage dart.engine.ast 1866 * @coverage dart.engine.ast
1867 */ 1867 */
1868 class CatchClause extends ASTNode { 1868 class CatchClause extends ASTNode {
1869 1869
1870 /** 1870 /**
1871 * The token representing the 'on' keyword, or {@code null} if there is no 'on ' keyword. 1871 * The token representing the 'on' keyword, or `null` if there is no 'on' keyw ord.
1872 */ 1872 */
1873 Token _onKeyword; 1873 Token _onKeyword;
1874 1874
1875 /** 1875 /**
1876 * The type of exceptions caught by this catch clause, or {@code null} if this catch clause 1876 * The type of exceptions caught by this catch clause, or `null` if this catch clause
1877 * catches every type of exception. 1877 * catches every type of exception.
1878 */ 1878 */
1879 TypeName _exceptionType; 1879 TypeName _exceptionType;
1880 1880
1881 /** 1881 /**
1882 * The token representing the 'catch' keyword, or {@code null} if there is no 'catch' keyword. 1882 * The token representing the 'catch' keyword, or `null` if there is no 'catch ' keyword.
1883 */ 1883 */
1884 Token _catchKeyword; 1884 Token _catchKeyword;
1885 1885
1886 /** 1886 /**
1887 * The left parenthesis. 1887 * The left parenthesis.
1888 */ 1888 */
1889 Token _leftParenthesis; 1889 Token _leftParenthesis;
1890 1890
1891 /** 1891 /**
1892 * The parameter whose value will be the exception that was thrown. 1892 * The parameter whose value will be the exception that was thrown.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 return _catchKeyword; 1958 return _catchKeyword;
1959 } 1959 }
1960 1960
1961 /** 1961 /**
1962 * Return the body of the catch block. 1962 * Return the body of the catch block.
1963 * @return the body of the catch block 1963 * @return the body of the catch block
1964 */ 1964 */
1965 Block get body => _body; 1965 Block get body => _body;
1966 1966
1967 /** 1967 /**
1968 * Return the token representing the 'catch' keyword, or {@code null} if there is no 'catch' 1968 * Return the token representing the 'catch' keyword, or `null` if there is no 'catch'
1969 * keyword. 1969 * keyword.
1970 * @return the token representing the 'catch' keyword 1970 * @return the token representing the 'catch' keyword
1971 */ 1971 */
1972 Token get catchKeyword => _catchKeyword; 1972 Token get catchKeyword => _catchKeyword;
1973 1973
1974 /** 1974 /**
1975 * Return the comma. 1975 * Return the comma.
1976 * @return the comma 1976 * @return the comma
1977 */ 1977 */
1978 Token get comma => _comma; 1978 Token get comma => _comma;
1979 Token get endToken => _body.endToken; 1979 Token get endToken => _body.endToken;
1980 1980
1981 /** 1981 /**
1982 * Return the parameter whose value will be the exception that was thrown. 1982 * Return the parameter whose value will be the exception that was thrown.
1983 * @return the parameter whose value will be the exception that was thrown 1983 * @return the parameter whose value will be the exception that was thrown
1984 */ 1984 */
1985 SimpleIdentifier get exceptionParameter => _exceptionParameter; 1985 SimpleIdentifier get exceptionParameter => _exceptionParameter;
1986 1986
1987 /** 1987 /**
1988 * Return the type of exceptions caught by this catch clause, or {@code null} if this catch clause 1988 * Return the type of exceptions caught by this catch clause, or `null` if thi s catch clause
1989 * catches every type of exception. 1989 * catches every type of exception.
1990 * @return the type of exceptions caught by this catch clause 1990 * @return the type of exceptions caught by this catch clause
1991 */ 1991 */
1992 TypeName get exceptionType => _exceptionType; 1992 TypeName get exceptionType => _exceptionType;
1993 1993
1994 /** 1994 /**
1995 * Return the left parenthesis. 1995 * Return the left parenthesis.
1996 * @return the left parenthesis 1996 * @return the left parenthesis
1997 */ 1997 */
1998 Token get leftParenthesis => _leftParenthesis; 1998 Token get leftParenthesis => _leftParenthesis;
1999 1999
2000 /** 2000 /**
2001 * Return the token representing the 'on' keyword, or {@code null} if there is no 'on' keyword. 2001 * Return the token representing the 'on' keyword, or `null` if there is no 'o n' keyword.
2002 * @return the token representing the 'on' keyword 2002 * @return the token representing the 'on' keyword
2003 */ 2003 */
2004 Token get onKeyword => _onKeyword; 2004 Token get onKeyword => _onKeyword;
2005 2005
2006 /** 2006 /**
2007 * Return the right parenthesis. 2007 * Return the right parenthesis.
2008 * @return the right parenthesis 2008 * @return the right parenthesis
2009 */ 2009 */
2010 Token get rightParenthesis => _rightParenthesis; 2010 Token get rightParenthesis => _rightParenthesis;
2011 2011
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
2089 _stackTraceParameter = becomeParentOf(parameter); 2089 _stackTraceParameter = becomeParentOf(parameter);
2090 } 2090 }
2091 void visitChildren(ASTVisitor<Object> visitor) { 2091 void visitChildren(ASTVisitor<Object> visitor) {
2092 safelyVisitChild(_exceptionType, visitor); 2092 safelyVisitChild(_exceptionType, visitor);
2093 safelyVisitChild(_exceptionParameter, visitor); 2093 safelyVisitChild(_exceptionParameter, visitor);
2094 safelyVisitChild(_stackTraceParameter, visitor); 2094 safelyVisitChild(_stackTraceParameter, visitor);
2095 safelyVisitChild(_body, visitor); 2095 safelyVisitChild(_body, visitor);
2096 } 2096 }
2097 } 2097 }
2098 /** 2098 /**
2099 * Instances of the class {@code ClassDeclaration} represent the declaration of a class. 2099 * Instances of the class `ClassDeclaration` represent the declaration of a clas s.
2100 * <pre> 2100 * <pre>
2101 * classDeclaration ::= 2101 * classDeclaration ::=
2102 * 'abstract'? 'class' {@link SimpleIdentifier name} {@link TypeParameterList ty peParameterList}? 2102 * 'abstract'? 'class' [SimpleIdentifier name] [TypeParameterList typeParameterL ist]?
2103 * ({@link ExtendsClause extendsClause} {@link WithClause withClause}?)?{@link I mplementsClause implementsClause}? 2103 * ([ExtendsClause extendsClause] [WithClause withClause]?)?[ImplementsClause im plementsClause]?
2104 * '{' {@link ClassMember classMember}* '}' 2104 * '{' [ClassMember classMember]* '}'
2105 * </pre> 2105 * </pre>
2106 * @coverage dart.engine.ast 2106 * @coverage dart.engine.ast
2107 */ 2107 */
2108 class ClassDeclaration extends CompilationUnitMember { 2108 class ClassDeclaration extends CompilationUnitMember {
2109 2109
2110 /** 2110 /**
2111 * The 'abstract' keyword, or {@code null} if the keyword was absent. 2111 * The 'abstract' keyword, or `null` if the keyword was absent.
2112 */ 2112 */
2113 Token _abstractKeyword; 2113 Token _abstractKeyword;
2114 2114
2115 /** 2115 /**
2116 * The token representing the 'class' keyword. 2116 * The token representing the 'class' keyword.
2117 */ 2117 */
2118 Token _classKeyword; 2118 Token _classKeyword;
2119 2119
2120 /** 2120 /**
2121 * The name of the class being declared. 2121 * The name of the class being declared.
2122 */ 2122 */
2123 SimpleIdentifier _name; 2123 SimpleIdentifier _name;
2124 2124
2125 /** 2125 /**
2126 * The type parameters for the class, or {@code null} if the class does not ha ve any type 2126 * The type parameters for the class, or `null` if the class does not have any type
2127 * parameters. 2127 * parameters.
2128 */ 2128 */
2129 TypeParameterList _typeParameters; 2129 TypeParameterList _typeParameters;
2130 2130
2131 /** 2131 /**
2132 * The extends clause for the class, or {@code null} if the class does not ext end any other class. 2132 * The extends clause for the class, or `null` if the class does not extend an y other class.
2133 */ 2133 */
2134 ExtendsClause _extendsClause; 2134 ExtendsClause _extendsClause;
2135 2135
2136 /** 2136 /**
2137 * The with clause for the class, or {@code null} if the class does not have a with clause. 2137 * The with clause for the class, or `null` if the class does not have a with clause.
2138 */ 2138 */
2139 WithClause _withClause; 2139 WithClause _withClause;
2140 2140
2141 /** 2141 /**
2142 * The implements clause for the class, or {@code null} if the class does not implement any 2142 * The implements clause for the class, or `null` if the class does not implem ent any
2143 * interfaces. 2143 * interfaces.
2144 */ 2144 */
2145 ImplementsClause _implementsClause; 2145 ImplementsClause _implementsClause;
2146 2146
2147 /** 2147 /**
2148 * The left curly bracket. 2148 * The left curly bracket.
2149 */ 2149 */
2150 Token _leftBracket; 2150 Token _leftBracket;
2151 2151
2152 /** 2152 /**
2153 * The members defined by the class. 2153 * The members defined by the class.
2154 */ 2154 */
2155 NodeList<ClassMember> _members; 2155 NodeList<ClassMember> _members;
2156 2156
2157 /** 2157 /**
2158 * The right curly bracket. 2158 * The right curly bracket.
2159 */ 2159 */
2160 Token _rightBracket; 2160 Token _rightBracket;
2161 2161
2162 /** 2162 /**
2163 * Initialize a newly created class declaration. 2163 * Initialize a newly created class declaration.
2164 * @param comment the documentation comment associated with this class 2164 * @param comment the documentation comment associated with this class
2165 * @param metadata the annotations associated with this class 2165 * @param metadata the annotations associated with this class
2166 * @param abstractKeyword the 'abstract' keyword, or {@code null} if the keywo rd was absent 2166 * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was absent
2167 * @param classKeyword the token representing the 'class' keyword 2167 * @param classKeyword the token representing the 'class' keyword
2168 * @param name the name of the class being declared 2168 * @param name the name of the class being declared
2169 * @param typeParameters the type parameters for the class 2169 * @param typeParameters the type parameters for the class
2170 * @param extendsClause the extends clause for the class 2170 * @param extendsClause the extends clause for the class
2171 * @param withClause the with clause for the class 2171 * @param withClause the with clause for the class
2172 * @param implementsClause the implements clause for the class 2172 * @param implementsClause the implements clause for the class
2173 * @param leftBracket the left curly bracket 2173 * @param leftBracket the left curly bracket
2174 * @param members the members defined by the class 2174 * @param members the members defined by the class
2175 * @param rightBracket the right curly bracket 2175 * @param rightBracket the right curly bracket
2176 */ 2176 */
2177 ClassDeclaration.full(Comment comment, List<Annotation> metadata, Token abstra ctKeyword, Token classKeyword, SimpleIdentifier name, TypeParameterList typePara meters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause imp lementsClause, Token leftBracket, List<ClassMember> members, Token rightBracket) : super.full(comment, metadata) { 2177 ClassDeclaration.full(Comment comment, List<Annotation> metadata, Token abstra ctKeyword, Token classKeyword, SimpleIdentifier name, TypeParameterList typePara meters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause imp lementsClause, Token leftBracket, List<ClassMember> members, Token rightBracket) : super.full(comment, metadata) {
2178 this._members = new NodeList<ClassMember>(this); 2178 this._members = new NodeList<ClassMember>(this);
2179 this._abstractKeyword = abstractKeyword; 2179 this._abstractKeyword = abstractKeyword;
2180 this._classKeyword = classKeyword; 2180 this._classKeyword = classKeyword;
2181 this._name = becomeParentOf(name); 2181 this._name = becomeParentOf(name);
2182 this._typeParameters = becomeParentOf(typeParameters); 2182 this._typeParameters = becomeParentOf(typeParameters);
2183 this._extendsClause = becomeParentOf(extendsClause); 2183 this._extendsClause = becomeParentOf(extendsClause);
2184 this._withClause = becomeParentOf(withClause); 2184 this._withClause = becomeParentOf(withClause);
2185 this._implementsClause = becomeParentOf(implementsClause); 2185 this._implementsClause = becomeParentOf(implementsClause);
2186 this._leftBracket = leftBracket; 2186 this._leftBracket = leftBracket;
2187 this._members.addAll(members); 2187 this._members.addAll(members);
2188 this._rightBracket = rightBracket; 2188 this._rightBracket = rightBracket;
2189 } 2189 }
2190 2190
2191 /** 2191 /**
2192 * Initialize a newly created class declaration. 2192 * Initialize a newly created class declaration.
2193 * @param comment the documentation comment associated with this class 2193 * @param comment the documentation comment associated with this class
2194 * @param metadata the annotations associated with this class 2194 * @param metadata the annotations associated with this class
2195 * @param abstractKeyword the 'abstract' keyword, or {@code null} if the keywo rd was absent 2195 * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was absent
2196 * @param classKeyword the token representing the 'class' keyword 2196 * @param classKeyword the token representing the 'class' keyword
2197 * @param name the name of the class being declared 2197 * @param name the name of the class being declared
2198 * @param typeParameters the type parameters for the class 2198 * @param typeParameters the type parameters for the class
2199 * @param extendsClause the extends clause for the class 2199 * @param extendsClause the extends clause for the class
2200 * @param withClause the with clause for the class 2200 * @param withClause the with clause for the class
2201 * @param implementsClause the implements clause for the class 2201 * @param implementsClause the implements clause for the class
2202 * @param leftBracket the left curly bracket 2202 * @param leftBracket the left curly bracket
2203 * @param members the members defined by the class 2203 * @param members the members defined by the class
2204 * @param rightBracket the right curly bracket 2204 * @param rightBracket the right curly bracket
2205 */ 2205 */
2206 ClassDeclaration({Comment comment, List<Annotation> metadata, Token abstractKe yword, Token classKeyword, SimpleIdentifier name, TypeParameterList typeParamete rs, ExtendsClause extendsClause, WithClause withClause, ImplementsClause impleme ntsClause, Token leftBracket, List<ClassMember> members, Token rightBracket}) : this.full(comment, metadata, abstractKeyword, classKeyword, name, typeParameters , extendsClause, withClause, implementsClause, leftBracket, members, rightBracke t); 2206 ClassDeclaration({Comment comment, List<Annotation> metadata, Token abstractKe yword, Token classKeyword, SimpleIdentifier name, TypeParameterList typeParamete rs, ExtendsClause extendsClause, WithClause withClause, ImplementsClause impleme ntsClause, Token leftBracket, List<ClassMember> members, Token rightBracket}) : this.full(comment, metadata, abstractKeyword, classKeyword, name, typeParameters , extendsClause, withClause, implementsClause, leftBracket, members, rightBracke t);
2207 accept(ASTVisitor visitor) => visitor.visitClassDeclaration(this); 2207 accept(ASTVisitor visitor) => visitor.visitClassDeclaration(this);
2208 2208
2209 /** 2209 /**
2210 * Return the 'abstract' keyword, or {@code null} if the keyword was absent. 2210 * Return the 'abstract' keyword, or `null` if the keyword was absent.
2211 * @return the 'abstract' keyword 2211 * @return the 'abstract' keyword
2212 */ 2212 */
2213 Token get abstractKeyword => _abstractKeyword; 2213 Token get abstractKeyword => _abstractKeyword;
2214 2214
2215 /** 2215 /**
2216 * Return the token representing the 'class' keyword. 2216 * Return the token representing the 'class' keyword.
2217 * @return the token representing the 'class' keyword 2217 * @return the token representing the 'class' keyword
2218 */ 2218 */
2219 Token get classKeyword => _classKeyword; 2219 Token get classKeyword => _classKeyword;
2220 ClassElement get element => _name != null ? (_name.element as ClassElement) : null; 2220 ClassElement get element => _name != null ? (_name.element as ClassElement) : null;
2221 Token get endToken => _rightBracket; 2221 Token get endToken => _rightBracket;
2222 2222
2223 /** 2223 /**
2224 * Return the extends clause for this class, or {@code null} if the class does not extend any 2224 * Return the extends clause for this class, or `null` if the class does not e xtend any
2225 * other class. 2225 * other class.
2226 * @return the extends clause for this class 2226 * @return the extends clause for this class
2227 */ 2227 */
2228 ExtendsClause get extendsClause => _extendsClause; 2228 ExtendsClause get extendsClause => _extendsClause;
2229 2229
2230 /** 2230 /**
2231 * Return the implements clause for the class, or {@code null} if the class do es not implement any 2231 * Return the implements clause for the class, or `null` if the class does not implement any
2232 * interfaces. 2232 * interfaces.
2233 * @return the implements clause for the class 2233 * @return the implements clause for the class
2234 */ 2234 */
2235 ImplementsClause get implementsClause => _implementsClause; 2235 ImplementsClause get implementsClause => _implementsClause;
2236 2236
2237 /** 2237 /**
2238 * Return the left curly bracket. 2238 * Return the left curly bracket.
2239 * @return the left curly bracket 2239 * @return the left curly bracket
2240 */ 2240 */
2241 Token get leftBracket => _leftBracket; 2241 Token get leftBracket => _leftBracket;
(...skipping 10 matching lines...) Expand all
2252 */ 2252 */
2253 SimpleIdentifier get name => _name; 2253 SimpleIdentifier get name => _name;
2254 2254
2255 /** 2255 /**
2256 * Return the right curly bracket. 2256 * Return the right curly bracket.
2257 * @return the right curly bracket 2257 * @return the right curly bracket
2258 */ 2258 */
2259 Token get rightBracket => _rightBracket; 2259 Token get rightBracket => _rightBracket;
2260 2260
2261 /** 2261 /**
2262 * Return the type parameters for the class, or {@code null} if the class does not have any type 2262 * Return the type parameters for the class, or `null` if the class does not h ave any type
2263 * parameters. 2263 * parameters.
2264 * @return the type parameters for the class 2264 * @return the type parameters for the class
2265 */ 2265 */
2266 TypeParameterList get typeParameters => _typeParameters; 2266 TypeParameterList get typeParameters => _typeParameters;
2267 2267
2268 /** 2268 /**
2269 * Return the with clause for the class, or {@code null} if the class does not have a with clause. 2269 * Return the with clause for the class, or `null` if the class does not have a with clause.
2270 * @return the with clause for the class 2270 * @return the with clause for the class
2271 */ 2271 */
2272 WithClause get withClause => _withClause; 2272 WithClause get withClause => _withClause;
2273 2273
2274 /** 2274 /**
2275 * Set the 'abstract' keyword to the given keyword. 2275 * Set the 'abstract' keyword to the given keyword.
2276 * @param abstractKeyword the 'abstract' keyword 2276 * @param abstractKeyword the 'abstract' keyword
2277 */ 2277 */
2278 void set abstractKeyword(Token abstractKeyword2) { 2278 void set abstractKeyword(Token abstractKeyword2) {
2279 this._abstractKeyword = abstractKeyword2; 2279 this._abstractKeyword = abstractKeyword2;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
2352 members.accept(visitor); 2352 members.accept(visitor);
2353 } 2353 }
2354 Token get firstTokenAfterCommentAndMetadata { 2354 Token get firstTokenAfterCommentAndMetadata {
2355 if (_abstractKeyword != null) { 2355 if (_abstractKeyword != null) {
2356 return _abstractKeyword; 2356 return _abstractKeyword;
2357 } 2357 }
2358 return _classKeyword; 2358 return _classKeyword;
2359 } 2359 }
2360 } 2360 }
2361 /** 2361 /**
2362 * The abstract class {@code ClassMember} defines the behavior common to nodes t hat declare a name 2362 * The abstract class `ClassMember` defines the behavior common to nodes that de clare a name
2363 * within the scope of a class. 2363 * within the scope of a class.
2364 * @coverage dart.engine.ast 2364 * @coverage dart.engine.ast
2365 */ 2365 */
2366 abstract class ClassMember extends Declaration { 2366 abstract class ClassMember extends Declaration {
2367 2367
2368 /** 2368 /**
2369 * Initialize a newly created member of a class. 2369 * Initialize a newly created member of a class.
2370 * @param comment the documentation comment associated with this member 2370 * @param comment the documentation comment associated with this member
2371 * @param metadata the annotations associated with this member 2371 * @param metadata the annotations associated with this member
2372 */ 2372 */
2373 ClassMember.full(Comment comment, List<Annotation> metadata) : super.full(comm ent, metadata) { 2373 ClassMember.full(Comment comment, List<Annotation> metadata) : super.full(comm ent, metadata) {
2374 } 2374 }
2375 2375
2376 /** 2376 /**
2377 * Initialize a newly created member of a class. 2377 * Initialize a newly created member of a class.
2378 * @param comment the documentation comment associated with this member 2378 * @param comment the documentation comment associated with this member
2379 * @param metadata the annotations associated with this member 2379 * @param metadata the annotations associated with this member
2380 */ 2380 */
2381 ClassMember({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata); 2381 ClassMember({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata);
2382 } 2382 }
2383 /** 2383 /**
2384 * Instances of the class {@code ClassTypeAlias} represent a class type alias. 2384 * Instances of the class `ClassTypeAlias` represent a class type alias.
2385 * <pre> 2385 * <pre>
2386 * classTypeAlias ::={@link SimpleIdentifier identifier} {@link TypeParameterLis t typeParameters}? '=' 'abstract'? mixinApplication 2386 * classTypeAlias ::=[SimpleIdentifier identifier] [TypeParameterList typeParame ters]? '=' 'abstract'? mixinApplication
2387 * mixinApplication ::={@link TypeName superclass} {@link WithClause withClause} {@link ImplementsClause implementsClause}? ';' 2387 * mixinApplication ::=[TypeName superclass] [WithClause withClause] [Implements Clause implementsClause]? ';'
2388 * </pre> 2388 * </pre>
2389 * @coverage dart.engine.ast 2389 * @coverage dart.engine.ast
2390 */ 2390 */
2391 class ClassTypeAlias extends TypeAlias { 2391 class ClassTypeAlias extends TypeAlias {
2392 2392
2393 /** 2393 /**
2394 * The name of the class being declared. 2394 * The name of the class being declared.
2395 */ 2395 */
2396 SimpleIdentifier _name; 2396 SimpleIdentifier _name;
2397 2397
2398 /** 2398 /**
2399 * The type parameters for the class, or {@code null} if the class does not ha ve any type 2399 * The type parameters for the class, or `null` if the class does not have any type
2400 * parameters. 2400 * parameters.
2401 */ 2401 */
2402 TypeParameterList _typeParameters; 2402 TypeParameterList _typeParameters;
2403 2403
2404 /** 2404 /**
2405 * The token for the '=' separating the name from the definition. 2405 * The token for the '=' separating the name from the definition.
2406 */ 2406 */
2407 Token _equals; 2407 Token _equals;
2408 2408
2409 /** 2409 /**
2410 * The token for the 'abstract' keyword, or {@code null} if this is not defini ng an abstract 2410 * The token for the 'abstract' keyword, or `null` if this is not defining an abstract
2411 * class. 2411 * class.
2412 */ 2412 */
2413 Token _abstractKeyword; 2413 Token _abstractKeyword;
2414 2414
2415 /** 2415 /**
2416 * The name of the superclass of the class being declared. 2416 * The name of the superclass of the class being declared.
2417 */ 2417 */
2418 TypeName _superclass; 2418 TypeName _superclass;
2419 2419
2420 /** 2420 /**
2421 * The with clause for this class. 2421 * The with clause for this class.
2422 */ 2422 */
2423 WithClause _withClause; 2423 WithClause _withClause;
2424 2424
2425 /** 2425 /**
2426 * The implements clause for this class, or {@code null} if there is no implem ents clause. 2426 * The implements clause for this class, or `null` if there is no implements c lause.
2427 */ 2427 */
2428 ImplementsClause _implementsClause; 2428 ImplementsClause _implementsClause;
2429 2429
2430 /** 2430 /**
2431 * Initialize a newly created class type alias. 2431 * Initialize a newly created class type alias.
2432 * @param comment the documentation comment associated with this type alias 2432 * @param comment the documentation comment associated with this type alias
2433 * @param metadata the annotations associated with this type alias 2433 * @param metadata the annotations associated with this type alias
2434 * @param keyword the token representing the 'typedef' keyword 2434 * @param keyword the token representing the 'typedef' keyword
2435 * @param name the name of the class being declared 2435 * @param name the name of the class being declared
2436 * @param typeParameters the type parameters for the class 2436 * @param typeParameters the type parameters for the class
(...skipping 25 matching lines...) Expand all
2462 * @param abstractKeyword the token for the 'abstract' keyword 2462 * @param abstractKeyword the token for the 'abstract' keyword
2463 * @param superclass the name of the superclass of the class being declared 2463 * @param superclass the name of the superclass of the class being declared
2464 * @param withClause the with clause for this class 2464 * @param withClause the with clause for this class
2465 * @param implementsClause the implements clause for this class 2465 * @param implementsClause the implements clause for this class
2466 * @param semicolon the semicolon terminating the declaration 2466 * @param semicolon the semicolon terminating the declaration
2467 */ 2467 */
2468 ClassTypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Sim pleIdentifier name, TypeParameterList typeParameters, Token equals, Token abstra ctKeyword, TypeName superclass, WithClause withClause, ImplementsClause implemen tsClause, Token semicolon}) : this.full(comment, metadata, keyword, name, typePa rameters, equals, abstractKeyword, superclass, withClause, implementsClause, sem icolon); 2468 ClassTypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Sim pleIdentifier name, TypeParameterList typeParameters, Token equals, Token abstra ctKeyword, TypeName superclass, WithClause withClause, ImplementsClause implemen tsClause, Token semicolon}) : this.full(comment, metadata, keyword, name, typePa rameters, equals, abstractKeyword, superclass, withClause, implementsClause, sem icolon);
2469 accept(ASTVisitor visitor) => visitor.visitClassTypeAlias(this); 2469 accept(ASTVisitor visitor) => visitor.visitClassTypeAlias(this);
2470 2470
2471 /** 2471 /**
2472 * Return the token for the 'abstract' keyword, or {@code null} if this is not defining an 2472 * Return the token for the 'abstract' keyword, or `null` if this is not defin ing an
2473 * abstract class. 2473 * abstract class.
2474 * @return the token for the 'abstract' keyword 2474 * @return the token for the 'abstract' keyword
2475 */ 2475 */
2476 Token get abstractKeyword => _abstractKeyword; 2476 Token get abstractKeyword => _abstractKeyword;
2477 ClassElement get element => _name != null ? (_name.element as ClassElement) : null; 2477 ClassElement get element => _name != null ? (_name.element as ClassElement) : null;
2478 2478
2479 /** 2479 /**
2480 * Return the token for the '=' separating the name from the definition. 2480 * Return the token for the '=' separating the name from the definition.
2481 * @return the token for the '=' separating the name from the definition 2481 * @return the token for the '=' separating the name from the definition
2482 */ 2482 */
2483 Token get equals => _equals; 2483 Token get equals => _equals;
2484 2484
2485 /** 2485 /**
2486 * Return the implements clause for this class, or {@code null} if there is no implements clause. 2486 * Return the implements clause for this class, or `null` if there is no imple ments clause.
2487 * @return the implements clause for this class 2487 * @return the implements clause for this class
2488 */ 2488 */
2489 ImplementsClause get implementsClause => _implementsClause; 2489 ImplementsClause get implementsClause => _implementsClause;
2490 2490
2491 /** 2491 /**
2492 * Return the name of the class being declared. 2492 * Return the name of the class being declared.
2493 * @return the name of the class being declared 2493 * @return the name of the class being declared
2494 */ 2494 */
2495 SimpleIdentifier get name => _name; 2495 SimpleIdentifier get name => _name;
2496 2496
2497 /** 2497 /**
2498 * Return the name of the superclass of the class being declared. 2498 * Return the name of the superclass of the class being declared.
2499 * @return the name of the superclass of the class being declared 2499 * @return the name of the superclass of the class being declared
2500 */ 2500 */
2501 TypeName get superclass => _superclass; 2501 TypeName get superclass => _superclass;
2502 2502
2503 /** 2503 /**
2504 * Return the type parameters for the class, or {@code null} if the class does not have any type 2504 * Return the type parameters for the class, or `null` if the class does not h ave any type
2505 * parameters. 2505 * parameters.
2506 * @return the type parameters for the class 2506 * @return the type parameters for the class
2507 */ 2507 */
2508 TypeParameterList get typeParameters => _typeParameters; 2508 TypeParameterList get typeParameters => _typeParameters;
2509 2509
2510 /** 2510 /**
2511 * Return the with clause for this class. 2511 * Return the with clause for this class.
2512 * @return the with clause for this class 2512 * @return the with clause for this class
2513 */ 2513 */
2514 WithClause get withClause => _withClause; 2514 WithClause get withClause => _withClause;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
2571 void visitChildren(ASTVisitor<Object> visitor) { 2571 void visitChildren(ASTVisitor<Object> visitor) {
2572 super.visitChildren(visitor); 2572 super.visitChildren(visitor);
2573 safelyVisitChild(_name, visitor); 2573 safelyVisitChild(_name, visitor);
2574 safelyVisitChild(_typeParameters, visitor); 2574 safelyVisitChild(_typeParameters, visitor);
2575 safelyVisitChild(_superclass, visitor); 2575 safelyVisitChild(_superclass, visitor);
2576 safelyVisitChild(_withClause, visitor); 2576 safelyVisitChild(_withClause, visitor);
2577 safelyVisitChild(_implementsClause, visitor); 2577 safelyVisitChild(_implementsClause, visitor);
2578 } 2578 }
2579 } 2579 }
2580 /** 2580 /**
2581 * Instances of the class {@code Combinator} represent the combinator associated with an import 2581 * Instances of the class `Combinator` represent the combinator associated with an import
2582 * directive. 2582 * directive.
2583 * <pre> 2583 * <pre>
2584 * combinator ::={@link HideCombinator hideCombinator}| {@link ShowCombinator sh owCombinator}</pre> 2584 * combinator ::=[HideCombinator hideCombinator]| [ShowCombinator showCombinator ]</pre>
2585 * @coverage dart.engine.ast 2585 * @coverage dart.engine.ast
2586 */ 2586 */
2587 abstract class Combinator extends ASTNode { 2587 abstract class Combinator extends ASTNode {
2588 2588
2589 /** 2589 /**
2590 * The keyword specifying what kind of processing is to be done on the importe d names. 2590 * The keyword specifying what kind of processing is to be done on the importe d names.
2591 */ 2591 */
2592 Token _keyword; 2592 Token _keyword;
2593 2593
2594 /** 2594 /**
(...skipping 23 matching lines...) Expand all
2618 * Set the keyword specifying what kind of processing is to be done on the imp orted names to the 2618 * Set the keyword specifying what kind of processing is to be done on the imp orted names to the
2619 * given token. 2619 * given token.
2620 * @param keyword the keyword specifying what kind of processing is to be done on the imported 2620 * @param keyword the keyword specifying what kind of processing is to be done on the imported
2621 * names 2621 * names
2622 */ 2622 */
2623 void set keyword(Token keyword2) { 2623 void set keyword(Token keyword2) {
2624 this._keyword = keyword2; 2624 this._keyword = keyword2;
2625 } 2625 }
2626 } 2626 }
2627 /** 2627 /**
2628 * Instances of the class {@code Comment} represent a comment within the source code. 2628 * Instances of the class `Comment` represent a comment within the source code.
2629 * <pre> 2629 * <pre>
2630 * comment ::= 2630 * comment ::=
2631 * endOfLineComment 2631 * endOfLineComment
2632 * | blockComment 2632 * | blockComment
2633 * | documentationComment 2633 * | documentationComment
2634 * endOfLineComment ::= 2634 * endOfLineComment ::=
2635 * '//' (CHARACTER - EOL)* EOL 2635 * '//' (CHARACTER - EOL)* EOL
2636 * blockComment ::= 2636 * blockComment ::=
2637 * '/ *' CHARACTER* '&#42;/' 2637 * '/ *' CHARACTER* '&#42;/'
2638 * documentationComment ::= 2638 * documentationComment ::=
2639 * '/ **' (CHARACTER | {@link CommentReference commentReference})* '&#42;/' 2639 * '/ **' (CHARACTER | [CommentReference commentReference])* '&#42;/'
2640 * | ('///' (CHARACTER - EOL)* EOL)+ 2640 * | ('///' (CHARACTER - EOL)* EOL)+
2641 * </pre> 2641 * </pre>
2642 * @coverage dart.engine.ast 2642 * @coverage dart.engine.ast
2643 */ 2643 */
2644 class Comment extends ASTNode { 2644 class Comment extends ASTNode {
2645 2645
2646 /** 2646 /**
2647 * Create a block comment. 2647 * Create a block comment.
2648 * @param tokens the tokens representing the comment 2648 * @param tokens the tokens representing the comment
2649 * @return the block comment that was created 2649 * @return the block comment that was created
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
2718 */ 2718 */
2719 NodeList<CommentReference> get references => _references; 2719 NodeList<CommentReference> get references => _references;
2720 2720
2721 /** 2721 /**
2722 * Return the tokens representing the comment. 2722 * Return the tokens representing the comment.
2723 * @return the tokens representing the comment 2723 * @return the tokens representing the comment
2724 */ 2724 */
2725 List<Token> get tokens => _tokens; 2725 List<Token> get tokens => _tokens;
2726 2726
2727 /** 2727 /**
2728 * Return {@code true} if this is a block comment. 2728 * Return `true` if this is a block comment.
2729 * @return {@code true} if this is a block comment 2729 * @return `true` if this is a block comment
2730 */ 2730 */
2731 bool isBlock() => identical(_type, CommentType.BLOCK); 2731 bool isBlock() => identical(_type, CommentType.BLOCK);
2732 2732
2733 /** 2733 /**
2734 * Return {@code true} if this is a documentation comment. 2734 * Return `true` if this is a documentation comment.
2735 * @return {@code true} if this is a documentation comment 2735 * @return `true` if this is a documentation comment
2736 */ 2736 */
2737 bool isDocumentation() => identical(_type, CommentType.DOCUMENTATION); 2737 bool isDocumentation() => identical(_type, CommentType.DOCUMENTATION);
2738 2738
2739 /** 2739 /**
2740 * Return {@code true} if this is an end-of-line comment. 2740 * Return `true` if this is an end-of-line comment.
2741 * @return {@code true} if this is an end-of-line comment 2741 * @return `true` if this is an end-of-line comment
2742 */ 2742 */
2743 bool isEndOfLine() => identical(_type, CommentType.END_OF_LINE); 2743 bool isEndOfLine() => identical(_type, CommentType.END_OF_LINE);
2744 void visitChildren(ASTVisitor<Object> visitor) { 2744 void visitChildren(ASTVisitor<Object> visitor) {
2745 _references.accept(visitor); 2745 _references.accept(visitor);
2746 } 2746 }
2747 } 2747 }
2748 /** 2748 /**
2749 * The enumeration {@code CommentType} encodes all the different types of commen ts that are 2749 * The enumeration `CommentType` encodes all the different types of comments tha t are
2750 * recognized by the parser. 2750 * recognized by the parser.
2751 */ 2751 */
2752 class CommentType implements Comparable<CommentType> { 2752 class CommentType implements Comparable<CommentType> {
2753 2753
2754 /** 2754 /**
2755 * An end-of-line comment. 2755 * An end-of-line comment.
2756 */ 2756 */
2757 static final CommentType END_OF_LINE = new CommentType('END_OF_LINE', 0); 2757 static final CommentType END_OF_LINE = new CommentType('END_OF_LINE', 0);
2758 2758
2759 /** 2759 /**
(...skipping 12 matching lines...) Expand all
2772 2772
2773 /// The position in the enum declaration. 2773 /// The position in the enum declaration.
2774 final int ordinal; 2774 final int ordinal;
2775 CommentType(this.name, this.ordinal) { 2775 CommentType(this.name, this.ordinal) {
2776 } 2776 }
2777 int compareTo(CommentType other) => ordinal - other.ordinal; 2777 int compareTo(CommentType other) => ordinal - other.ordinal;
2778 int get hashCode => ordinal; 2778 int get hashCode => ordinal;
2779 String toString() => name; 2779 String toString() => name;
2780 } 2780 }
2781 /** 2781 /**
2782 * Instances of the class {@code CommentReference} represent a reference to a Da rt element that is 2782 * Instances of the class `CommentReference` represent a reference to a Dart ele ment that is
2783 * found within a documentation comment. 2783 * found within a documentation comment.
2784 * <pre> 2784 * <pre>
2785 * commentReference ::= 2785 * commentReference ::=
2786 * '\[' 'new'? {@link Identifier identifier} '\]' 2786 * '\[' 'new'? [Identifier identifier] '\]'
2787 * </pre> 2787 * </pre>
2788 * @coverage dart.engine.ast 2788 * @coverage dart.engine.ast
2789 */ 2789 */
2790 class CommentReference extends ASTNode { 2790 class CommentReference extends ASTNode {
2791 2791
2792 /** 2792 /**
2793 * The token representing the 'new' keyword, or {@code null} if there was no ' new' keyword. 2793 * The token representing the 'new' keyword, or `null` if there was no 'new' k eyword.
2794 */ 2794 */
2795 Token _newKeyword; 2795 Token _newKeyword;
2796 2796
2797 /** 2797 /**
2798 * The identifier being referenced. 2798 * The identifier being referenced.
2799 */ 2799 */
2800 Identifier _identifier; 2800 Identifier _identifier;
2801 2801
2802 /** 2802 /**
2803 * Initialize a newly created reference to a Dart element. 2803 * Initialize a newly created reference to a Dart element.
(...skipping 15 matching lines...) Expand all
2819 Token get beginToken => _identifier.beginToken; 2819 Token get beginToken => _identifier.beginToken;
2820 Token get endToken => _identifier.endToken; 2820 Token get endToken => _identifier.endToken;
2821 2821
2822 /** 2822 /**
2823 * Return the identifier being referenced. 2823 * Return the identifier being referenced.
2824 * @return the identifier being referenced 2824 * @return the identifier being referenced
2825 */ 2825 */
2826 Identifier get identifier => _identifier; 2826 Identifier get identifier => _identifier;
2827 2827
2828 /** 2828 /**
2829 * Return the token representing the 'new' keyword, or {@code null} if there w as no 'new' keyword. 2829 * Return the token representing the 'new' keyword, or `null` if there was no 'new' keyword.
2830 * @return the token representing the 'new' keyword 2830 * @return the token representing the 'new' keyword
2831 */ 2831 */
2832 Token get newKeyword => _newKeyword; 2832 Token get newKeyword => _newKeyword;
2833 2833
2834 /** 2834 /**
2835 * Set the identifier being referenced to the given identifier. 2835 * Set the identifier being referenced to the given identifier.
2836 * @param identifier the identifier being referenced 2836 * @param identifier the identifier being referenced
2837 */ 2837 */
2838 void set identifier(Identifier identifier2) { 2838 void set identifier(Identifier identifier2) {
2839 identifier2 = becomeParentOf(identifier2); 2839 identifier2 = becomeParentOf(identifier2);
2840 } 2840 }
2841 2841
2842 /** 2842 /**
2843 * Set the token representing the 'new' keyword to the given token. 2843 * Set the token representing the 'new' keyword to the given token.
2844 * @param newKeyword the token representing the 'new' keyword 2844 * @param newKeyword the token representing the 'new' keyword
2845 */ 2845 */
2846 void set newKeyword(Token newKeyword2) { 2846 void set newKeyword(Token newKeyword2) {
2847 this._newKeyword = newKeyword2; 2847 this._newKeyword = newKeyword2;
2848 } 2848 }
2849 void visitChildren(ASTVisitor<Object> visitor) { 2849 void visitChildren(ASTVisitor<Object> visitor) {
2850 safelyVisitChild(_identifier, visitor); 2850 safelyVisitChild(_identifier, visitor);
2851 } 2851 }
2852 } 2852 }
2853 /** 2853 /**
2854 * Instances of the class {@code CompilationUnit} represent a compilation unit. 2854 * Instances of the class `CompilationUnit` represent a compilation unit.
2855 * <p> 2855 *
2856 * While the grammar restricts the order of the directives and declarations with in a compilation 2856 * While the grammar restricts the order of the directives and declarations with in a compilation
2857 * unit, this class does not enforce those restrictions. In particular, the chil dren of a 2857 * unit, this class does not enforce those restrictions. In particular, the chil dren of a
2858 * compilation unit will be visited in lexical order even if lexical order does not conform to the 2858 * compilation unit will be visited in lexical order even if lexical order does not conform to the
2859 * restrictions of the grammar. 2859 * restrictions of the grammar.
2860 * <pre> 2860 * <pre>
2861 * compilationUnit ::= 2861 * compilationUnit ::=
2862 * directives declarations 2862 * directives declarations
2863 * directives ::={@link ScriptTag scriptTag}? {@link LibraryDirective libraryDir ective}? namespaceDirective* {@link PartDirective partDirective}| {@link PartOfD irective partOfDirective}namespaceDirective ::={@link ImportDirective importDire ctive}| {@link ExportDirective exportDirective}declarations ::={@link Compilatio nUnitMember compilationUnitMember}</pre> 2863 * directives ::=[ScriptTag scriptTag]? [LibraryDirective libraryDirective]? nam espaceDirective* [PartDirective partDirective]| [PartOfDirective partOfDirective ]namespaceDirective ::=[ImportDirective importDirective]| [ExportDirective expor tDirective]declarations ::=[CompilationUnitMember compilationUnitMember]</pre>
2864 * @coverage dart.engine.ast 2864 * @coverage dart.engine.ast
2865 */ 2865 */
2866 class CompilationUnit extends ASTNode { 2866 class CompilationUnit extends ASTNode {
2867 2867
2868 /** 2868 /**
2869 * The first token in the token stream that was parsed to form this compilatio n unit. 2869 * The first token in the token stream that was parsed to form this compilatio n unit.
2870 */ 2870 */
2871 Token _beginToken; 2871 Token _beginToken;
2872 2872
2873 /** 2873 /**
2874 * The script tag at the beginning of the compilation unit, or {@code null} if there is no script 2874 * The script tag at the beginning of the compilation unit, or `null` if there is no script
2875 * tag in this compilation unit. 2875 * tag in this compilation unit.
2876 */ 2876 */
2877 ScriptTag _scriptTag; 2877 ScriptTag _scriptTag;
2878 2878
2879 /** 2879 /**
2880 * The directives contained in this compilation unit. 2880 * The directives contained in this compilation unit.
2881 */ 2881 */
2882 NodeList<Directive> _directives; 2882 NodeList<Directive> _directives;
2883 2883
2884 /** 2884 /**
2885 * The declarations contained in this compilation unit. 2885 * The declarations contained in this compilation unit.
2886 */ 2886 */
2887 NodeList<CompilationUnitMember> _declarations; 2887 NodeList<CompilationUnitMember> _declarations;
2888 2888
2889 /** 2889 /**
2890 * The last token in the token stream that was parsed to form this compilation unit. This token 2890 * The last token in the token stream that was parsed to form this compilation unit. This token
2891 * should always have a type of {@link TokenType.EOF}. 2891 * should always have a type of [TokenType.EOF].
2892 */ 2892 */
2893 Token _endToken; 2893 Token _endToken;
2894 2894
2895 /** 2895 /**
2896 * The element associated with this compilation unit, or {@code null} if the A ST structure has not 2896 * The element associated with this compilation unit, or `null` if the AST str ucture has not
2897 * been resolved. 2897 * been resolved.
2898 */ 2898 */
2899 CompilationUnitElement _element; 2899 CompilationUnitElement _element;
2900 2900
2901 /** 2901 /**
2902 * The {@link LineInfo} for this {@link CompilationUnit}. 2902 * The [LineInfo] for this [CompilationUnit].
2903 */ 2903 */
2904 LineInfo _lineInfo; 2904 LineInfo _lineInfo;
2905 2905
2906 /** 2906 /**
2907 * The parsing errors encountered when the receiver was parsed. 2907 * The parsing errors encountered when the receiver was parsed.
2908 */ 2908 */
2909 List<AnalysisError> _parsingErrors = AnalysisError.NO_ERRORS; 2909 List<AnalysisError> _parsingErrors = AnalysisError.NO_ERRORS;
2910 2910
2911 /** 2911 /**
2912 * The resolution errors encountered when the receiver was resolved. 2912 * The resolution errors encountered when the receiver was resolved.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2949 */ 2949 */
2950 NodeList<CompilationUnitMember> get declarations => _declarations; 2950 NodeList<CompilationUnitMember> get declarations => _declarations;
2951 2951
2952 /** 2952 /**
2953 * Return the directives contained in this compilation unit. 2953 * Return the directives contained in this compilation unit.
2954 * @return the directives contained in this compilation unit 2954 * @return the directives contained in this compilation unit
2955 */ 2955 */
2956 NodeList<Directive> get directives => _directives; 2956 NodeList<Directive> get directives => _directives;
2957 2957
2958 /** 2958 /**
2959 * Return the element associated with this compilation unit, or {@code null} i f the AST structure 2959 * Return the element associated with this compilation unit, or `null` if the AST structure
2960 * has not been resolved. 2960 * has not been resolved.
2961 * @return the element associated with this compilation unit 2961 * @return the element associated with this compilation unit
2962 */ 2962 */
2963 CompilationUnitElement get element => _element; 2963 CompilationUnitElement get element => _element;
2964 Token get endToken => _endToken; 2964 Token get endToken => _endToken;
2965 2965
2966 /** 2966 /**
2967 * Return an array containing all of the errors associated with the receiver. If the receiver has 2967 * Return an array containing all of the errors associated with the receiver. If the receiver has
2968 * not been resolved, then return {@code null}. 2968 * not been resolved, then return `null`.
2969 * @return an array of errors (contains no {@code null}s) or {@code null} if t he receiver has not 2969 * @return an array of errors (contains no `null`s) or `null` if the receiver has not
2970 * been resolved 2970 * been resolved
2971 */ 2971 */
2972 List<AnalysisError> get errors { 2972 List<AnalysisError> get errors {
2973 List<AnalysisError> parserErrors = parsingErrors; 2973 List<AnalysisError> parserErrors = parsingErrors;
2974 List<AnalysisError> resolverErrors = resolutionErrors; 2974 List<AnalysisError> resolverErrors = resolutionErrors;
2975 if (resolverErrors.length == 0) { 2975 if (resolverErrors.length == 0) {
2976 return parserErrors; 2976 return parserErrors;
2977 } else if (parserErrors.length == 0) { 2977 } else if (parserErrors.length == 0) {
2978 return resolverErrors; 2978 return resolverErrors;
2979 } else { 2979 } else {
2980 List<AnalysisError> allErrors = new List<AnalysisError>(parserErrors.lengt h + resolverErrors.length); 2980 List<AnalysisError> allErrors = new List<AnalysisError>(parserErrors.lengt h + resolverErrors.length);
2981 JavaSystem.arraycopy(parserErrors, 0, allErrors, 0, parserErrors.length); 2981 JavaSystem.arraycopy(parserErrors, 0, allErrors, 0, parserErrors.length);
2982 JavaSystem.arraycopy(resolverErrors, 0, allErrors, parserErrors.length, re solverErrors.length); 2982 JavaSystem.arraycopy(resolverErrors, 0, allErrors, parserErrors.length, re solverErrors.length);
2983 return allErrors; 2983 return allErrors;
2984 } 2984 }
2985 } 2985 }
2986 int get length { 2986 int get length {
2987 Token endToken = this.endToken; 2987 Token endToken = this.endToken;
2988 if (endToken == null) { 2988 if (endToken == null) {
2989 return 0; 2989 return 0;
2990 } 2990 }
2991 return endToken.offset + endToken.length; 2991 return endToken.offset + endToken.length;
2992 } 2992 }
2993 2993
2994 /** 2994 /**
2995 * Get the {@link LineInfo} object for this compilation unit. 2995 * Get the [LineInfo] object for this compilation unit.
2996 * @return the associated {@link LineInfo} 2996 * @return the associated [LineInfo]
2997 */ 2997 */
2998 LineInfo get lineInfo => _lineInfo; 2998 LineInfo get lineInfo => _lineInfo;
2999 int get offset => 0; 2999 int get offset => 0;
3000 3000
3001 /** 3001 /**
3002 * Return an array containing all of the parsing errors associated with the re ceiver. 3002 * Return an array containing all of the parsing errors associated with the re ceiver.
3003 * @return an array of errors (not {@code null}, contains no {@code null}s). 3003 * @return an array of errors (not `null`, contains no `null`s).
3004 */ 3004 */
3005 List<AnalysisError> get parsingErrors => _parsingErrors; 3005 List<AnalysisError> get parsingErrors => _parsingErrors;
3006 3006
3007 /** 3007 /**
3008 * Return an array containing all of the resolution errors associated with the receiver. If the 3008 * Return an array containing all of the resolution errors associated with the receiver. If the
3009 * receiver has not been resolved, then return {@code null}. 3009 * receiver has not been resolved, then return `null`.
3010 * @return an array of errors (contains no {@code null}s) or {@code null} if t he receiver has not 3010 * @return an array of errors (contains no `null`s) or `null` if the receiver has not
3011 * been resolved 3011 * been resolved
3012 */ 3012 */
3013 List<AnalysisError> get resolutionErrors => _resolutionErrors; 3013 List<AnalysisError> get resolutionErrors => _resolutionErrors;
3014 3014
3015 /** 3015 /**
3016 * Return the script tag at the beginning of the compilation unit, or {@code n ull} if there is no 3016 * Return the script tag at the beginning of the compilation unit, or `null` i f there is no
3017 * script tag in this compilation unit. 3017 * script tag in this compilation unit.
3018 * @return the script tag at the beginning of the compilation unit 3018 * @return the script tag at the beginning of the compilation unit
3019 */ 3019 */
3020 ScriptTag get scriptTag => _scriptTag; 3020 ScriptTag get scriptTag => _scriptTag;
3021 3021
3022 /** 3022 /**
3023 * Set the element associated with this compilation unit to the given element. 3023 * Set the element associated with this compilation unit to the given element.
3024 * @param element the element associated with this compilation unit 3024 * @param element the element associated with this compilation unit
3025 */ 3025 */
3026 void set element(CompilationUnitElement element2) { 3026 void set element(CompilationUnitElement element2) {
3027 this._element = element2; 3027 this._element = element2;
3028 } 3028 }
3029 3029
3030 /** 3030 /**
3031 * Set the {@link LineInfo} object for this compilation unit. 3031 * Set the [LineInfo] object for this compilation unit.
3032 * @param errors LineInfo to associate with this compilation unit 3032 * @param errors LineInfo to associate with this compilation unit
3033 */ 3033 */
3034 void set lineInfo(LineInfo lineInfo2) { 3034 void set lineInfo(LineInfo lineInfo2) {
3035 this._lineInfo = lineInfo2; 3035 this._lineInfo = lineInfo2;
3036 } 3036 }
3037 3037
3038 /** 3038 /**
3039 * Called to cache the parsing errors when the unit is parsed. 3039 * Called to cache the parsing errors when the unit is parsed.
3040 * @param errors an array of parsing errors, if {@code null} is passed, the er ror array is set to 3040 * @param errors an array of parsing errors, if `null` is passed, the error ar ray is set to
3041 * an empty array, {@link AnalysisError#NO_ERRORS} 3041 * an empty array, [AnalysisError#NO_ERRORS]
3042 */ 3042 */
3043 void set parsingErrors(List<AnalysisError> errors) { 3043 void set parsingErrors(List<AnalysisError> errors) {
3044 _parsingErrors = errors == null ? AnalysisError.NO_ERRORS : errors; 3044 _parsingErrors = errors == null ? AnalysisError.NO_ERRORS : errors;
3045 } 3045 }
3046 3046
3047 /** 3047 /**
3048 * Called to cache the resolution errors when the unit is resolved. 3048 * Called to cache the resolution errors when the unit is resolved.
3049 * @param errors an array of resolution errors, if {@code null} is passed, the error array is set 3049 * @param errors an array of resolution errors, if `null` is passed, the error array is set
3050 * to an empty array, {@link AnalysisError#NO_ERRORS} 3050 * to an empty array, [AnalysisError#NO_ERRORS]
3051 */ 3051 */
3052 void set resolutionErrors(List<AnalysisError> errors) { 3052 void set resolutionErrors(List<AnalysisError> errors) {
3053 _resolutionErrors = errors == null ? AnalysisError.NO_ERRORS : errors; 3053 _resolutionErrors = errors == null ? AnalysisError.NO_ERRORS : errors;
3054 } 3054 }
3055 3055
3056 /** 3056 /**
3057 * Set the script tag at the beginning of the compilation unit to the given sc ript tag. 3057 * Set the script tag at the beginning of the compilation unit to the given sc ript tag.
3058 * @param scriptTag the script tag at the beginning of the compilation unit 3058 * @param scriptTag the script tag at the beginning of the compilation unit
3059 */ 3059 */
3060 void set scriptTag(ScriptTag scriptTag2) { 3060 void set scriptTag(ScriptTag scriptTag2) {
3061 this._scriptTag = becomeParentOf(scriptTag2); 3061 this._scriptTag = becomeParentOf(scriptTag2);
3062 } 3062 }
3063 void visitChildren(ASTVisitor<Object> visitor) { 3063 void visitChildren(ASTVisitor<Object> visitor) {
3064 safelyVisitChild(_scriptTag, visitor); 3064 safelyVisitChild(_scriptTag, visitor);
3065 if (directivesAreBeforeDeclarations()) { 3065 if (directivesAreBeforeDeclarations()) {
3066 _directives.accept(visitor); 3066 _directives.accept(visitor);
3067 _declarations.accept(visitor); 3067 _declarations.accept(visitor);
3068 } else { 3068 } else {
3069 for (ASTNode child in sortedDirectivesAndDeclarations) { 3069 for (ASTNode child in sortedDirectivesAndDeclarations) {
3070 child.accept(visitor); 3070 child.accept(visitor);
3071 } 3071 }
3072 } 3072 }
3073 } 3073 }
3074 3074
3075 /** 3075 /**
3076 * Return {@code true} if all of the directives are lexically before any decla rations. 3076 * Return `true` if all of the directives are lexically before any declaration s.
3077 * @return {@code true} if all of the directives are lexically before any decl arations 3077 * @return `true` if all of the directives are lexically before any declaratio ns
3078 */ 3078 */
3079 bool directivesAreBeforeDeclarations() { 3079 bool directivesAreBeforeDeclarations() {
3080 if (_directives.isEmpty || _declarations.isEmpty) { 3080 if (_directives.isEmpty || _declarations.isEmpty) {
3081 return true; 3081 return true;
3082 } 3082 }
3083 Directive lastDirective = _directives[_directives.length - 1]; 3083 Directive lastDirective = _directives[_directives.length - 1];
3084 CompilationUnitMember firstDeclaration = _declarations[0]; 3084 CompilationUnitMember firstDeclaration = _declarations[0];
3085 return lastDirective.offset < firstDeclaration.offset; 3085 return lastDirective.offset < firstDeclaration.offset;
3086 } 3086 }
3087 3087
3088 /** 3088 /**
3089 * Return an array containing all of the directives and declarations in this c ompilation unit, 3089 * Return an array containing all of the directives and declarations in this c ompilation unit,
3090 * sorted in lexical order. 3090 * sorted in lexical order.
3091 * @return the directives and declarations in this compilation unit in the ord er in which they 3091 * @return the directives and declarations in this compilation unit in the ord er in which they
3092 * appeared in the original source 3092 * appeared in the original source
3093 */ 3093 */
3094 List<ASTNode> get sortedDirectivesAndDeclarations { 3094 List<ASTNode> get sortedDirectivesAndDeclarations {
3095 List<ASTNode> childList = new List<ASTNode>(); 3095 List<ASTNode> childList = new List<ASTNode>();
3096 childList.addAll(_directives); 3096 childList.addAll(_directives);
3097 childList.addAll(_declarations); 3097 childList.addAll(_declarations);
3098 List<ASTNode> children = new List.from(childList); 3098 List<ASTNode> children = new List.from(childList);
3099 children.sort(ASTNode.LEXICAL_ORDER); 3099 children.sort(ASTNode.LEXICAL_ORDER);
3100 return children; 3100 return children;
3101 } 3101 }
3102 } 3102 }
3103 /** 3103 /**
3104 * Instances of the class {@code CompilationUnitMember} defines the behavior com mon to nodes that 3104 * Instances of the class `CompilationUnitMember` defines the behavior common to nodes that
3105 * declare a name within the scope of a compilation unit. 3105 * declare a name within the scope of a compilation unit.
3106 * <pre> 3106 * <pre>
3107 * compilationUnitMember ::={@link ClassDeclaration classDeclaration}| {@link Ty peAlias typeAlias}| {@link FunctionDeclaration functionDeclaration}| {@link Meth odDeclaration getOrSetDeclaration}| {@link VariableDeclaration constantsDeclarat ion}| {@link VariableDeclaration variablesDeclaration}</pre> 3107 * compilationUnitMember ::=[ClassDeclaration classDeclaration]| [TypeAlias type Alias]| [FunctionDeclaration functionDeclaration]| [MethodDeclaration getOrSetDe claration]| [VariableDeclaration constantsDeclaration]| [VariableDeclaration var iablesDeclaration]</pre>
3108 * @coverage dart.engine.ast 3108 * @coverage dart.engine.ast
3109 */ 3109 */
3110 abstract class CompilationUnitMember extends Declaration { 3110 abstract class CompilationUnitMember extends Declaration {
3111 3111
3112 /** 3112 /**
3113 * Initialize a newly created generic compilation unit member. 3113 * Initialize a newly created generic compilation unit member.
3114 * @param comment the documentation comment associated with this member 3114 * @param comment the documentation comment associated with this member
3115 * @param metadata the annotations associated with this member 3115 * @param metadata the annotations associated with this member
3116 */ 3116 */
3117 CompilationUnitMember.full(Comment comment, List<Annotation> metadata) : super .full(comment, metadata) { 3117 CompilationUnitMember.full(Comment comment, List<Annotation> metadata) : super .full(comment, metadata) {
3118 } 3118 }
3119 3119
3120 /** 3120 /**
3121 * Initialize a newly created generic compilation unit member. 3121 * Initialize a newly created generic compilation unit member.
3122 * @param comment the documentation comment associated with this member 3122 * @param comment the documentation comment associated with this member
3123 * @param metadata the annotations associated with this member 3123 * @param metadata the annotations associated with this member
3124 */ 3124 */
3125 CompilationUnitMember({Comment comment, List<Annotation> metadata}) : this.ful l(comment, metadata); 3125 CompilationUnitMember({Comment comment, List<Annotation> metadata}) : this.ful l(comment, metadata);
3126 } 3126 }
3127 /** 3127 /**
3128 * Instances of the class {@code ConditionalExpression} represent a conditional expression. 3128 * Instances of the class `ConditionalExpression` represent a conditional expres sion.
3129 * <pre> 3129 * <pre>
3130 * conditionalExpression ::={@link Expression condition} '?' {@link Expression t henExpression} ':' {@link Expression elseExpression}</pre> 3130 * conditionalExpression ::=[Expression condition] '?' [Expression thenExpressio n] ':' [Expression elseExpression]</pre>
3131 * @coverage dart.engine.ast 3131 * @coverage dart.engine.ast
3132 */ 3132 */
3133 class ConditionalExpression extends Expression { 3133 class ConditionalExpression extends Expression {
3134 3134
3135 /** 3135 /**
3136 * The condition used to determine which of the expressions is executed next. 3136 * The condition used to determine which of the expressions is executed next.
3137 */ 3137 */
3138 Expression _condition; 3138 Expression _condition;
3139 3139
3140 /** 3140 /**
3141 * The token used to separate the condition from the then expression. 3141 * The token used to separate the condition from the then expression.
3142 */ 3142 */
3143 Token _question; 3143 Token _question;
3144 3144
3145 /** 3145 /**
3146 * The expression that is executed if the condition evaluates to {@code true}. 3146 * The expression that is executed if the condition evaluates to `true`.
3147 */ 3147 */
3148 Expression _thenExpression; 3148 Expression _thenExpression;
3149 3149
3150 /** 3150 /**
3151 * The token used to separate the then expression from the else expression. 3151 * The token used to separate the then expression from the else expression.
3152 */ 3152 */
3153 Token _colon; 3153 Token _colon;
3154 3154
3155 /** 3155 /**
3156 * The expression that is executed if the condition evaluates to {@code false} . 3156 * The expression that is executed if the condition evaluates to `false`.
3157 */ 3157 */
3158 Expression _elseExpression; 3158 Expression _elseExpression;
3159 3159
3160 /** 3160 /**
3161 * Initialize a newly created conditional expression. 3161 * Initialize a newly created conditional expression.
3162 * @param condition the condition used to determine which expression is execut ed next 3162 * @param condition the condition used to determine which expression is execut ed next
3163 * @param question the token used to separate the condition from the then expr ession 3163 * @param question the token used to separate the condition from the then expr ession
3164 * @param thenExpression the expression that is executed if the condition eval uates to{@code true} 3164 * @param thenExpression the expression that is executed if the condition eval uates to`true`
3165 * @param colon the token used to separate the then expression from the else e xpression 3165 * @param colon the token used to separate the then expression from the else e xpression
3166 * @param elseExpression the expression that is executed if the condition eval uates to{@code false} 3166 * @param elseExpression the expression that is executed if the condition eval uates to`false`
3167 */ 3167 */
3168 ConditionalExpression.full(Expression condition, Token question, Expression th enExpression, Token colon, Expression elseExpression) { 3168 ConditionalExpression.full(Expression condition, Token question, Expression th enExpression, Token colon, Expression elseExpression) {
3169 this._condition = becomeParentOf(condition); 3169 this._condition = becomeParentOf(condition);
3170 this._question = question; 3170 this._question = question;
3171 this._thenExpression = becomeParentOf(thenExpression); 3171 this._thenExpression = becomeParentOf(thenExpression);
3172 this._colon = colon; 3172 this._colon = colon;
3173 this._elseExpression = becomeParentOf(elseExpression); 3173 this._elseExpression = becomeParentOf(elseExpression);
3174 } 3174 }
3175 3175
3176 /** 3176 /**
3177 * Initialize a newly created conditional expression. 3177 * Initialize a newly created conditional expression.
3178 * @param condition the condition used to determine which expression is execut ed next 3178 * @param condition the condition used to determine which expression is execut ed next
3179 * @param question the token used to separate the condition from the then expr ession 3179 * @param question the token used to separate the condition from the then expr ession
3180 * @param thenExpression the expression that is executed if the condition eval uates to{@code true} 3180 * @param thenExpression the expression that is executed if the condition eval uates to`true`
3181 * @param colon the token used to separate the then expression from the else e xpression 3181 * @param colon the token used to separate the then expression from the else e xpression
3182 * @param elseExpression the expression that is executed if the condition eval uates to{@code false} 3182 * @param elseExpression the expression that is executed if the condition eval uates to`false`
3183 */ 3183 */
3184 ConditionalExpression({Expression condition, Token question, Expression thenEx pression, Token colon, Expression elseExpression}) : this.full(condition, questi on, thenExpression, colon, elseExpression); 3184 ConditionalExpression({Expression condition, Token question, Expression thenEx pression, Token colon, Expression elseExpression}) : this.full(condition, questi on, thenExpression, colon, elseExpression);
3185 accept(ASTVisitor visitor) => visitor.visitConditionalExpression(this); 3185 accept(ASTVisitor visitor) => visitor.visitConditionalExpression(this);
3186 Token get beginToken => _condition.beginToken; 3186 Token get beginToken => _condition.beginToken;
3187 3187
3188 /** 3188 /**
3189 * Return the token used to separate the then expression from the else express ion. 3189 * Return the token used to separate the then expression from the else express ion.
3190 * @return the token used to separate the then expression from the else expres sion 3190 * @return the token used to separate the then expression from the else expres sion
3191 */ 3191 */
3192 Token get colon => _colon; 3192 Token get colon => _colon;
3193 3193
3194 /** 3194 /**
3195 * Return the condition used to determine which of the expressions is executed next. 3195 * Return the condition used to determine which of the expressions is executed next.
3196 * @return the condition used to determine which expression is executed next 3196 * @return the condition used to determine which expression is executed next
3197 */ 3197 */
3198 Expression get condition => _condition; 3198 Expression get condition => _condition;
3199 3199
3200 /** 3200 /**
3201 * Return the expression that is executed if the condition evaluates to {@code false}. 3201 * Return the expression that is executed if the condition evaluates to `false `.
3202 * @return the expression that is executed if the condition evaluates to {@cod e false} 3202 * @return the expression that is executed if the condition evaluates to `fals e`
3203 */ 3203 */
3204 Expression get elseExpression => _elseExpression; 3204 Expression get elseExpression => _elseExpression;
3205 Token get endToken => _elseExpression.endToken; 3205 Token get endToken => _elseExpression.endToken;
3206 3206
3207 /** 3207 /**
3208 * Return the token used to separate the condition from the then expression. 3208 * Return the token used to separate the condition from the then expression.
3209 * @return the token used to separate the condition from the then expression 3209 * @return the token used to separate the condition from the then expression
3210 */ 3210 */
3211 Token get question => _question; 3211 Token get question => _question;
3212 3212
3213 /** 3213 /**
3214 * Return the expression that is executed if the condition evaluates to {@code true}. 3214 * Return the expression that is executed if the condition evaluates to `true` .
3215 * @return the expression that is executed if the condition evaluates to {@cod e true} 3215 * @return the expression that is executed if the condition evaluates to `true `
3216 */ 3216 */
3217 Expression get thenExpression => _thenExpression; 3217 Expression get thenExpression => _thenExpression;
3218 3218
3219 /** 3219 /**
3220 * Set the token used to separate the then expression from the else expression to the given token. 3220 * Set the token used to separate the then expression from the else expression to the given token.
3221 * @param colon the token used to separate the then expression from the else e xpression 3221 * @param colon the token used to separate the then expression from the else e xpression
3222 */ 3222 */
3223 void set colon(Token colon2) { 3223 void set colon(Token colon2) {
3224 this._colon = colon2; 3224 this._colon = colon2;
3225 } 3225 }
3226 3226
3227 /** 3227 /**
3228 * Set the condition used to determine which of the expressions is executed ne xt to the given 3228 * Set the condition used to determine which of the expressions is executed ne xt to the given
3229 * expression. 3229 * expression.
3230 * @param expression the condition used to determine which expression is execu ted next 3230 * @param expression the condition used to determine which expression is execu ted next
3231 */ 3231 */
3232 void set condition(Expression expression) { 3232 void set condition(Expression expression) {
3233 _condition = becomeParentOf(expression); 3233 _condition = becomeParentOf(expression);
3234 } 3234 }
3235 3235
3236 /** 3236 /**
3237 * Set the expression that is executed if the condition evaluates to {@code fa lse} to the given 3237 * Set the expression that is executed if the condition evaluates to `false` t o the given
3238 * expression. 3238 * expression.
3239 * @param expression the expression that is executed if the condition evaluate s to {@code false} 3239 * @param expression the expression that is executed if the condition evaluate s to `false`
3240 */ 3240 */
3241 void set elseExpression(Expression expression) { 3241 void set elseExpression(Expression expression) {
3242 _elseExpression = becomeParentOf(expression); 3242 _elseExpression = becomeParentOf(expression);
3243 } 3243 }
3244 3244
3245 /** 3245 /**
3246 * Set the token used to separate the condition from the then expression to th e given token. 3246 * Set the token used to separate the condition from the then expression to th e given token.
3247 * @param question the token used to separate the condition from the then expr ession 3247 * @param question the token used to separate the condition from the then expr ession
3248 */ 3248 */
3249 void set question(Token question2) { 3249 void set question(Token question2) {
3250 this._question = question2; 3250 this._question = question2;
3251 } 3251 }
3252 3252
3253 /** 3253 /**
3254 * Set the expression that is executed if the condition evaluates to {@code tr ue} to the given 3254 * Set the expression that is executed if the condition evaluates to `true` to the given
3255 * expression. 3255 * expression.
3256 * @param expression the expression that is executed if the condition evaluate s to {@code true} 3256 * @param expression the expression that is executed if the condition evaluate s to `true`
3257 */ 3257 */
3258 void set thenExpression(Expression expression) { 3258 void set thenExpression(Expression expression) {
3259 _thenExpression = becomeParentOf(expression); 3259 _thenExpression = becomeParentOf(expression);
3260 } 3260 }
3261 void visitChildren(ASTVisitor<Object> visitor) { 3261 void visitChildren(ASTVisitor<Object> visitor) {
3262 safelyVisitChild(_condition, visitor); 3262 safelyVisitChild(_condition, visitor);
3263 safelyVisitChild(_thenExpression, visitor); 3263 safelyVisitChild(_thenExpression, visitor);
3264 safelyVisitChild(_elseExpression, visitor); 3264 safelyVisitChild(_elseExpression, visitor);
3265 } 3265 }
3266 } 3266 }
3267 /** 3267 /**
3268 * Instances of the class {@code ConstructorDeclaration} represent a constructor declaration. 3268 * Instances of the class `ConstructorDeclaration` represent a constructor decla ration.
3269 * <pre> 3269 * <pre>
3270 * constructorDeclaration ::= 3270 * constructorDeclaration ::=
3271 * constructorSignature {@link FunctionBody body}? 3271 * constructorSignature [FunctionBody body]?
3272 * | constructorName formalParameterList ':' 'this' ('.' {@link SimpleIdentifier name})? arguments 3272 * | constructorName formalParameterList ':' 'this' ('.' [SimpleIdentifier name] )? arguments
3273 * constructorSignature ::= 3273 * constructorSignature ::=
3274 * 'external'? constructorName formalParameterList initializerList? 3274 * 'external'? constructorName formalParameterList initializerList?
3275 * | 'external'? 'factory' factoryName formalParameterList initializerList? 3275 * | 'external'? 'factory' factoryName formalParameterList initializerList?
3276 * | 'external'? 'const' constructorName formalParameterList initializerList? 3276 * | 'external'? 'const' constructorName formalParameterList initializerList?
3277 * constructorName ::={@link SimpleIdentifier returnType} ('.' {@link SimpleIden tifier name})? 3277 * constructorName ::=[SimpleIdentifier returnType] ('.' [SimpleIdentifier name] )?
3278 * factoryName ::={@link Identifier returnType} ('.' {@link SimpleIdentifier nam e})? 3278 * factoryName ::=[Identifier returnType] ('.' [SimpleIdentifier name])?
3279 * initializerList ::= 3279 * initializerList ::=
3280 * ':' {@link ConstructorInitializer initializer} (',' {@link ConstructorInitial izer initializer}) 3280 * ':' [ConstructorInitializer initializer] (',' [ConstructorInitializer initial izer])
3281 * </pre> 3281 * </pre>
3282 * @coverage dart.engine.ast 3282 * @coverage dart.engine.ast
3283 */ 3283 */
3284 class ConstructorDeclaration extends ClassMember { 3284 class ConstructorDeclaration extends ClassMember {
3285 3285
3286 /** 3286 /**
3287 * The token for the 'external' keyword, or {@code null} if the constructor is not external. 3287 * The token for the 'external' keyword, or `null` if the constructor is not e xternal.
3288 */ 3288 */
3289 Token _externalKeyword; 3289 Token _externalKeyword;
3290 3290
3291 /** 3291 /**
3292 * The token for the 'const' keyword, or {@code null} if the constructor is no t a const 3292 * The token for the 'const' keyword, or `null` if the constructor is not a co nst
3293 * constructor. 3293 * constructor.
3294 */ 3294 */
3295 Token _constKeyword; 3295 Token _constKeyword;
3296 3296
3297 /** 3297 /**
3298 * The token for the 'factory' keyword, or {@code null} if the constructor is not a factory 3298 * The token for the 'factory' keyword, or `null` if the constructor is not a factory
3299 * constructor. 3299 * constructor.
3300 */ 3300 */
3301 Token _factoryKeyword; 3301 Token _factoryKeyword;
3302 3302
3303 /** 3303 /**
3304 * The type of object being created. This can be different than the type in wh ich the constructor 3304 * The type of object being created. This can be different than the type in wh ich the constructor
3305 * is being declared if the constructor is the implementation of a factory con structor. 3305 * is being declared if the constructor is the implementation of a factory con structor.
3306 */ 3306 */
3307 Identifier _returnType; 3307 Identifier _returnType;
3308 3308
3309 /** 3309 /**
3310 * The token for the period before the constructor name, or {@code null} if th e constructor being 3310 * The token for the period before the constructor name, or `null` if the cons tructor being
3311 * declared is unnamed. 3311 * declared is unnamed.
3312 */ 3312 */
3313 Token _period; 3313 Token _period;
3314 3314
3315 /** 3315 /**
3316 * The name of the constructor, or {@code null} if the constructor being decla red is unnamed. 3316 * The name of the constructor, or `null` if the constructor being declared is unnamed.
3317 */ 3317 */
3318 SimpleIdentifier _name; 3318 SimpleIdentifier _name;
3319 3319
3320 /** 3320 /**
3321 * The element associated with this constructor, or {@code null} if the AST st ructure has not been 3321 * The element associated with this constructor, or `null` if the AST structur e has not been
3322 * resolved or if this constructor could not be resolved. 3322 * resolved or if this constructor could not be resolved.
3323 */ 3323 */
3324 ConstructorElement _element; 3324 ConstructorElement _element;
3325 3325
3326 /** 3326 /**
3327 * The parameters associated with the constructor. 3327 * The parameters associated with the constructor.
3328 */ 3328 */
3329 FormalParameterList _parameters; 3329 FormalParameterList _parameters;
3330 3330
3331 /** 3331 /**
3332 * The token for the separator (colon or equals) before the initializers, or { @code null} if there 3332 * The token for the separator (colon or equals) before the initializers, or ` null` if there
3333 * are no initializers. 3333 * are no initializers.
3334 */ 3334 */
3335 Token _separator; 3335 Token _separator;
3336 3336
3337 /** 3337 /**
3338 * The initializers associated with the constructor. 3338 * The initializers associated with the constructor.
3339 */ 3339 */
3340 NodeList<ConstructorInitializer> _initializers; 3340 NodeList<ConstructorInitializer> _initializers;
3341 3341
3342 /** 3342 /**
3343 * The name of the constructor to which this constructor will be redirected, o r {@code null} if 3343 * The name of the constructor to which this constructor will be redirected, o r `null` if
3344 * this is not a redirecting factory constructor. 3344 * this is not a redirecting factory constructor.
3345 */ 3345 */
3346 ConstructorName _redirectedConstructor; 3346 ConstructorName _redirectedConstructor;
3347 3347
3348 /** 3348 /**
3349 * The body of the constructor, or {@code null} if the constructor does not ha ve a body. 3349 * The body of the constructor, or `null` if the constructor does not have a b ody.
3350 */ 3350 */
3351 FunctionBody _body; 3351 FunctionBody _body;
3352 3352
3353 /** 3353 /**
3354 * Initialize a newly created constructor declaration. 3354 * Initialize a newly created constructor declaration.
3355 * @param externalKeyword the token for the 'external' keyword 3355 * @param externalKeyword the token for the 'external' keyword
3356 * @param comment the documentation comment associated with this constructor 3356 * @param comment the documentation comment associated with this constructor
3357 * @param metadata the annotations associated with this constructor 3357 * @param metadata the annotations associated with this constructor
3358 * @param constKeyword the token for the 'const' keyword 3358 * @param constKeyword the token for the 'const' keyword
3359 * @param factoryKeyword the token for the 'factory' keyword 3359 * @param factoryKeyword the token for the 'factory' keyword
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
3396 * @param separator the token for the colon or equals before the initializers 3396 * @param separator the token for the colon or equals before the initializers
3397 * @param initializers the initializers associated with the constructor 3397 * @param initializers the initializers associated with the constructor
3398 * @param redirectedConstructor the name of the constructor to which this cons tructor will be 3398 * @param redirectedConstructor the name of the constructor to which this cons tructor will be
3399 * redirected 3399 * redirected
3400 * @param body the body of the constructor 3400 * @param body the body of the constructor
3401 */ 3401 */
3402 ConstructorDeclaration({Comment comment, List<Annotation> metadata, Token exte rnalKeyword, Token constKeyword, Token factoryKeyword, Identifier returnType, To ken period, SimpleIdentifier name, FormalParameterList parameters, Token separat or, List<ConstructorInitializer> initializers, ConstructorName redirectedConstru ctor, FunctionBody body}) : this.full(comment, metadata, externalKeyword, constK eyword, factoryKeyword, returnType, period, name, parameters, separator, initial izers, redirectedConstructor, body); 3402 ConstructorDeclaration({Comment comment, List<Annotation> metadata, Token exte rnalKeyword, Token constKeyword, Token factoryKeyword, Identifier returnType, To ken period, SimpleIdentifier name, FormalParameterList parameters, Token separat or, List<ConstructorInitializer> initializers, ConstructorName redirectedConstru ctor, FunctionBody body}) : this.full(comment, metadata, externalKeyword, constK eyword, factoryKeyword, returnType, period, name, parameters, separator, initial izers, redirectedConstructor, body);
3403 accept(ASTVisitor visitor) => visitor.visitConstructorDeclaration(this); 3403 accept(ASTVisitor visitor) => visitor.visitConstructorDeclaration(this);
3404 3404
3405 /** 3405 /**
3406 * Return the body of the constructor, or {@code null} if the constructor does not have a body. 3406 * Return the body of the constructor, or `null` if the constructor does not h ave a body.
3407 * @return the body of the constructor 3407 * @return the body of the constructor
3408 */ 3408 */
3409 FunctionBody get body => _body; 3409 FunctionBody get body => _body;
3410 3410
3411 /** 3411 /**
3412 * Return the token for the 'const' keyword. 3412 * Return the token for the 'const' keyword.
3413 * @return the token for the 'const' keyword 3413 * @return the token for the 'const' keyword
3414 */ 3414 */
3415 Token get constKeyword => _constKeyword; 3415 Token get constKeyword => _constKeyword;
3416 ConstructorElement get element => _element; 3416 ConstructorElement get element => _element;
3417 Token get endToken { 3417 Token get endToken {
3418 if (_body != null) { 3418 if (_body != null) {
3419 return _body.endToken; 3419 return _body.endToken;
3420 } else if (!_initializers.isEmpty) { 3420 } else if (!_initializers.isEmpty) {
3421 return _initializers.endToken; 3421 return _initializers.endToken;
3422 } 3422 }
3423 return _parameters.endToken; 3423 return _parameters.endToken;
3424 } 3424 }
3425 3425
3426 /** 3426 /**
3427 * Return the token for the 'external' keyword, or {@code null} if the constru ctor is not 3427 * Return the token for the 'external' keyword, or `null` if the constructor i s not
3428 * external. 3428 * external.
3429 * @return the token for the 'external' keyword 3429 * @return the token for the 'external' keyword
3430 */ 3430 */
3431 Token get externalKeyword => _externalKeyword; 3431 Token get externalKeyword => _externalKeyword;
3432 3432
3433 /** 3433 /**
3434 * Return the token for the 'factory' keyword. 3434 * Return the token for the 'factory' keyword.
3435 * @return the token for the 'factory' keyword 3435 * @return the token for the 'factory' keyword
3436 */ 3436 */
3437 Token get factoryKeyword => _factoryKeyword; 3437 Token get factoryKeyword => _factoryKeyword;
3438 3438
3439 /** 3439 /**
3440 * Return the initializers associated with the constructor. 3440 * Return the initializers associated with the constructor.
3441 * @return the initializers associated with the constructor 3441 * @return the initializers associated with the constructor
3442 */ 3442 */
3443 NodeList<ConstructorInitializer> get initializers => _initializers; 3443 NodeList<ConstructorInitializer> get initializers => _initializers;
3444 3444
3445 /** 3445 /**
3446 * Return the name of the constructor, or {@code null} if the constructor bein g declared is 3446 * Return the name of the constructor, or `null` if the constructor being decl ared is
3447 * unnamed. 3447 * unnamed.
3448 * @return the name of the constructor 3448 * @return the name of the constructor
3449 */ 3449 */
3450 SimpleIdentifier get name => _name; 3450 SimpleIdentifier get name => _name;
3451 3451
3452 /** 3452 /**
3453 * Return the parameters associated with the constructor. 3453 * Return the parameters associated with the constructor.
3454 * @return the parameters associated with the constructor 3454 * @return the parameters associated with the constructor
3455 */ 3455 */
3456 FormalParameterList get parameters => _parameters; 3456 FormalParameterList get parameters => _parameters;
3457 3457
3458 /** 3458 /**
3459 * Return the token for the period before the constructor name, or {@code null } if the constructor 3459 * Return the token for the period before the constructor name, or `null` if t he constructor
3460 * being declared is unnamed. 3460 * being declared is unnamed.
3461 * @return the token for the period before the constructor name 3461 * @return the token for the period before the constructor name
3462 */ 3462 */
3463 Token get period => _period; 3463 Token get period => _period;
3464 3464
3465 /** 3465 /**
3466 * Return the name of the constructor to which this constructor will be redire cted, or{@code null} if this is not a redirecting factory constructor. 3466 * Return the name of the constructor to which this constructor will be redire cted, or`null` if this is not a redirecting factory constructor.
3467 * @return the name of the constructor to which this constructor will be redir ected 3467 * @return the name of the constructor to which this constructor will be redir ected
3468 */ 3468 */
3469 ConstructorName get redirectedConstructor => _redirectedConstructor; 3469 ConstructorName get redirectedConstructor => _redirectedConstructor;
3470 3470
3471 /** 3471 /**
3472 * Return the type of object being created. This can be different than the typ e in which the 3472 * Return the type of object being created. This can be different than the typ e in which the
3473 * constructor is being declared if the constructor is the implementation of a factory 3473 * constructor is being declared if the constructor is the implementation of a factory
3474 * constructor. 3474 * constructor.
3475 * @return the type of object being created 3475 * @return the type of object being created
3476 */ 3476 */
3477 Identifier get returnType => _returnType; 3477 Identifier get returnType => _returnType;
3478 3478
3479 /** 3479 /**
3480 * Return the token for the separator (colon or equals) before the initializer s, or {@code null}if there are no initializers. 3480 * Return the token for the separator (colon or equals) before the initializer s, or `null`if there are no initializers.
3481 * @return the token for the separator (colon or equals) before the initialize rs 3481 * @return the token for the separator (colon or equals) before the initialize rs
3482 */ 3482 */
3483 Token get separator => _separator; 3483 Token get separator => _separator;
3484 3484
3485 /** 3485 /**
3486 * Set the body of the constructor to the given function body. 3486 * Set the body of the constructor to the given function body.
3487 * @param functionBody the body of the constructor 3487 * @param functionBody the body of the constructor
3488 */ 3488 */
3489 void set body(FunctionBody functionBody) { 3489 void set body(FunctionBody functionBody) {
3490 _body = becomeParentOf(functionBody); 3490 _body = becomeParentOf(functionBody);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
3582 } 3582 }
3583 Token get firstTokenAfterCommentAndMetadata { 3583 Token get firstTokenAfterCommentAndMetadata {
3584 Token leftMost2 = leftMost([_externalKeyword, _constKeyword, _factoryKeyword ]); 3584 Token leftMost2 = leftMost([_externalKeyword, _constKeyword, _factoryKeyword ]);
3585 if (leftMost2 != null) { 3585 if (leftMost2 != null) {
3586 return leftMost2; 3586 return leftMost2;
3587 } 3587 }
3588 return _returnType.beginToken; 3588 return _returnType.beginToken;
3589 } 3589 }
3590 3590
3591 /** 3591 /**
3592 * Return the left-most of the given tokens, or {@code null} if there are no t okens given or if 3592 * Return the left-most of the given tokens, or `null` if there are no tokens given or if
3593 * all of the given tokens are {@code null}. 3593 * all of the given tokens are `null`.
3594 * @param tokens the tokens being compared to find the left-most token 3594 * @param tokens the tokens being compared to find the left-most token
3595 * @return the left-most of the given tokens 3595 * @return the left-most of the given tokens
3596 */ 3596 */
3597 Token leftMost(List<Token> tokens) { 3597 Token leftMost(List<Token> tokens) {
3598 Token leftMost = null; 3598 Token leftMost = null;
3599 int offset = 2147483647; 3599 int offset = 2147483647;
3600 for (Token token in tokens) { 3600 for (Token token in tokens) {
3601 if (token != null && token.offset < offset) { 3601 if (token != null && token.offset < offset) {
3602 leftMost = token; 3602 leftMost = token;
3603 } 3603 }
3604 } 3604 }
3605 return leftMost; 3605 return leftMost;
3606 } 3606 }
3607 } 3607 }
3608 /** 3608 /**
3609 * Instances of the class {@code ConstructorFieldInitializer} represent the init ialization of a 3609 * Instances of the class `ConstructorFieldInitializer` represent the initializa tion of a
3610 * field within a constructor's initialization list. 3610 * field within a constructor's initialization list.
3611 * <pre> 3611 * <pre>
3612 * fieldInitializer ::= 3612 * fieldInitializer ::=
3613 * ('this' '.')? {@link SimpleIdentifier fieldName} '=' {@link Expression condit ionalExpression cascadeSection*}</pre> 3613 * ('this' '.')? [SimpleIdentifier fieldName] '=' [Expression conditionalExpress ion cascadeSection*]</pre>
3614 * @coverage dart.engine.ast 3614 * @coverage dart.engine.ast
3615 */ 3615 */
3616 class ConstructorFieldInitializer extends ConstructorInitializer { 3616 class ConstructorFieldInitializer extends ConstructorInitializer {
3617 3617
3618 /** 3618 /**
3619 * The token for the 'this' keyword, or {@code null} if there is no 'this' key word. 3619 * The token for the 'this' keyword, or `null` if there is no 'this' keyword.
3620 */ 3620 */
3621 Token _keyword; 3621 Token _keyword;
3622 3622
3623 /** 3623 /**
3624 * The token for the period after the 'this' keyword, or {@code null} if there is no 'this' 3624 * The token for the period after the 'this' keyword, or `null` if there is no 'this'
3625 * keyword. 3625 * keyword.
3626 */ 3626 */
3627 Token _period; 3627 Token _period;
3628 3628
3629 /** 3629 /**
3630 * The name of the field being initialized. 3630 * The name of the field being initialized.
3631 */ 3631 */
3632 SimpleIdentifier _fieldName; 3632 SimpleIdentifier _fieldName;
3633 3633
3634 /** 3634 /**
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
3689 */ 3689 */
3690 Expression get expression => _expression; 3690 Expression get expression => _expression;
3691 3691
3692 /** 3692 /**
3693 * Return the name of the field being initialized. 3693 * Return the name of the field being initialized.
3694 * @return the name of the field being initialized 3694 * @return the name of the field being initialized
3695 */ 3695 */
3696 SimpleIdentifier get fieldName => _fieldName; 3696 SimpleIdentifier get fieldName => _fieldName;
3697 3697
3698 /** 3698 /**
3699 * Return the token for the 'this' keyword, or {@code null} if there is no 'th is' keyword. 3699 * Return the token for the 'this' keyword, or `null` if there is no 'this' ke yword.
3700 * @return the token for the 'this' keyword 3700 * @return the token for the 'this' keyword
3701 */ 3701 */
3702 Token get keyword => _keyword; 3702 Token get keyword => _keyword;
3703 3703
3704 /** 3704 /**
3705 * Return the token for the period after the 'this' keyword, or {@code null} i f there is no 'this' 3705 * Return the token for the period after the 'this' keyword, or `null` if ther e is no 'this'
3706 * keyword. 3706 * keyword.
3707 * @return the token for the period after the 'this' keyword 3707 * @return the token for the period after the 'this' keyword
3708 */ 3708 */
3709 Token get period => _period; 3709 Token get period => _period;
3710 3710
3711 /** 3711 /**
3712 * Set the token for the equal sign between the field name and the expression to the given token. 3712 * Set the token for the equal sign between the field name and the expression to the given token.
3713 * @param equals the token for the equal sign between the field name and the e xpression 3713 * @param equals the token for the equal sign between the field name and the e xpression
3714 */ 3714 */
3715 void set equals(Token equals2) { 3715 void set equals(Token equals2) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
3747 */ 3747 */
3748 void set period(Token period2) { 3748 void set period(Token period2) {
3749 this._period = period2; 3749 this._period = period2;
3750 } 3750 }
3751 void visitChildren(ASTVisitor<Object> visitor) { 3751 void visitChildren(ASTVisitor<Object> visitor) {
3752 safelyVisitChild(_fieldName, visitor); 3752 safelyVisitChild(_fieldName, visitor);
3753 safelyVisitChild(_expression, visitor); 3753 safelyVisitChild(_expression, visitor);
3754 } 3754 }
3755 } 3755 }
3756 /** 3756 /**
3757 * Instances of the class {@code ConstructorInitializer} defines the behavior of nodes that can 3757 * Instances of the class `ConstructorInitializer` defines the behavior of nodes that can
3758 * occur in the initializer list of a constructor declaration. 3758 * occur in the initializer list of a constructor declaration.
3759 * <pre> 3759 * <pre>
3760 * constructorInitializer ::={@link SuperConstructorInvocation superInvocation}| {@link ConstructorFieldInitializer fieldInitializer}</pre> 3760 * constructorInitializer ::=[SuperConstructorInvocation superInvocation]| [Cons tructorFieldInitializer fieldInitializer]</pre>
3761 * @coverage dart.engine.ast 3761 * @coverage dart.engine.ast
3762 */ 3762 */
3763 abstract class ConstructorInitializer extends ASTNode { 3763 abstract class ConstructorInitializer extends ASTNode {
3764 } 3764 }
3765 /** 3765 /**
3766 * Instances of the class {@code ConstructorName} represent the name of the cons tructor. 3766 * Instances of the class `ConstructorName` represent the name of the constructo r.
3767 * <pre> 3767 * <pre>
3768 * constructorName: 3768 * constructorName:
3769 * type ('.' identifier)? 3769 * type ('.' identifier)?
3770 * </pre> 3770 * </pre>
3771 * @coverage dart.engine.ast 3771 * @coverage dart.engine.ast
3772 */ 3772 */
3773 class ConstructorName extends ASTNode { 3773 class ConstructorName extends ASTNode {
3774 3774
3775 /** 3775 /**
3776 * The name of the type defining the constructor. 3776 * The name of the type defining the constructor.
3777 */ 3777 */
3778 TypeName _type; 3778 TypeName _type;
3779 3779
3780 /** 3780 /**
3781 * The token for the period before the constructor name, or {@code null} if th e specified 3781 * The token for the period before the constructor name, or `null` if the spec ified
3782 * constructor is the unnamed constructor. 3782 * constructor is the unnamed constructor.
3783 */ 3783 */
3784 Token _period; 3784 Token _period;
3785 3785
3786 /** 3786 /**
3787 * The name of the constructor, or {@code null} if the specified constructor i s the unnamed 3787 * The name of the constructor, or `null` if the specified constructor is the unnamed
3788 * constructor. 3788 * constructor.
3789 */ 3789 */
3790 SimpleIdentifier _name; 3790 SimpleIdentifier _name;
3791 3791
3792 /** 3792 /**
3793 * The element associated with this constructor name based on static type info rmation, or{@code null} if the AST structure has not been resolved or if this co nstructor name could not 3793 * The element associated with this constructor name based on static type info rmation, or`null` if the AST structure has not been resolved or if this construc tor name could not
3794 * be resolved. 3794 * be resolved.
3795 */ 3795 */
3796 ConstructorElement _staticElement; 3796 ConstructorElement _staticElement;
3797 3797
3798 /** 3798 /**
3799 * The element associated with this constructor name based on propagated type information, or{@code null} if the AST structure has not been resolved or if thi s constructor name could not 3799 * The element associated with this constructor name based on propagated type information, or`null` if the AST structure has not been resolved or if this cons tructor name could not
3800 * be resolved. 3800 * be resolved.
3801 */ 3801 */
3802 ConstructorElement _propagatedElement; 3802 ConstructorElement _propagatedElement;
3803 3803
3804 /** 3804 /**
3805 * Initialize a newly created constructor name. 3805 * Initialize a newly created constructor name.
3806 * @param type the name of the type defining the constructor 3806 * @param type the name of the type defining the constructor
3807 * @param period the token for the period before the constructor name 3807 * @param period the token for the period before the constructor name
3808 * @param name the name of the constructor 3808 * @param name the name of the constructor
3809 */ 3809 */
3810 ConstructorName.full(TypeName type, Token period, SimpleIdentifier name) { 3810 ConstructorName.full(TypeName type, Token period, SimpleIdentifier name) {
3811 this._type = becomeParentOf(type); 3811 this._type = becomeParentOf(type);
3812 this._period = period; 3812 this._period = period;
3813 this._name = becomeParentOf(name); 3813 this._name = becomeParentOf(name);
3814 } 3814 }
3815 3815
3816 /** 3816 /**
3817 * Initialize a newly created constructor name. 3817 * Initialize a newly created constructor name.
3818 * @param type the name of the type defining the constructor 3818 * @param type the name of the type defining the constructor
3819 * @param period the token for the period before the constructor name 3819 * @param period the token for the period before the constructor name
3820 * @param name the name of the constructor 3820 * @param name the name of the constructor
3821 */ 3821 */
3822 ConstructorName({TypeName type, Token period, SimpleIdentifier name}) : this.f ull(type, period, name); 3822 ConstructorName({TypeName type, Token period, SimpleIdentifier name}) : this.f ull(type, period, name);
3823 accept(ASTVisitor visitor) => visitor.visitConstructorName(this); 3823 accept(ASTVisitor visitor) => visitor.visitConstructorName(this);
3824 Token get beginToken => _type.beginToken; 3824 Token get beginToken => _type.beginToken;
3825 3825
3826 /** 3826 /**
3827 * Return the element associated with this constructor name based on propagate d type information, 3827 * Return the element associated with this constructor name based on propagate d type information,
3828 * or {@code null} if the AST structure has not been resolved or if this const ructor name could 3828 * or `null` if the AST structure has not been resolved or if this constructor name could
3829 * not be resolved. 3829 * not be resolved.
3830 * @return the element associated with this constructor name 3830 * @return the element associated with this constructor name
3831 */ 3831 */
3832 ConstructorElement get element => _propagatedElement; 3832 ConstructorElement get element => _propagatedElement;
3833 Token get endToken { 3833 Token get endToken {
3834 if (_name != null) { 3834 if (_name != null) {
3835 return _name.endToken; 3835 return _name.endToken;
3836 } 3836 }
3837 return _type.endToken; 3837 return _type.endToken;
3838 } 3838 }
3839 3839
3840 /** 3840 /**
3841 * Return the name of the constructor, or {@code null} if the specified constr uctor is the unnamed 3841 * Return the name of the constructor, or `null` if the specified constructor is the unnamed
3842 * constructor. 3842 * constructor.
3843 * @return the name of the constructor 3843 * @return the name of the constructor
3844 */ 3844 */
3845 SimpleIdentifier get name => _name; 3845 SimpleIdentifier get name => _name;
3846 3846
3847 /** 3847 /**
3848 * Return the token for the period before the constructor name, or {@code null } if the specified 3848 * Return the token for the period before the constructor name, or `null` if t he specified
3849 * constructor is the unnamed constructor. 3849 * constructor is the unnamed constructor.
3850 * @return the token for the period before the constructor name 3850 * @return the token for the period before the constructor name
3851 */ 3851 */
3852 Token get period => _period; 3852 Token get period => _period;
3853 3853
3854 /** 3854 /**
3855 * Return the element associated with this constructor name based on static ty pe information, or{@code null} if the AST structure has not been resolved or if this constructor name could not 3855 * Return the element associated with this constructor name based on static ty pe information, or`null` if the AST structure has not been resolved or if this c onstructor name could not
3856 * be resolved. 3856 * be resolved.
3857 * @return the element associated with this constructor name 3857 * @return the element associated with this constructor name
3858 */ 3858 */
3859 ConstructorElement get staticElement => _staticElement; 3859 ConstructorElement get staticElement => _staticElement;
3860 3860
3861 /** 3861 /**
3862 * Return the name of the type defining the constructor. 3862 * Return the name of the type defining the constructor.
3863 * @return the name of the type defining the constructor 3863 * @return the name of the type defining the constructor
3864 */ 3864 */
3865 TypeName get type => _type; 3865 TypeName get type => _type;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
3904 */ 3904 */
3905 void set type(TypeName type2) { 3905 void set type(TypeName type2) {
3906 this._type = becomeParentOf(type2); 3906 this._type = becomeParentOf(type2);
3907 } 3907 }
3908 void visitChildren(ASTVisitor<Object> visitor) { 3908 void visitChildren(ASTVisitor<Object> visitor) {
3909 safelyVisitChild(_type, visitor); 3909 safelyVisitChild(_type, visitor);
3910 safelyVisitChild(_name, visitor); 3910 safelyVisitChild(_name, visitor);
3911 } 3911 }
3912 } 3912 }
3913 /** 3913 /**
3914 * Instances of the class {@code ContinueStatement} represent a continue stateme nt. 3914 * Instances of the class `ContinueStatement` represent a continue statement.
3915 * <pre> 3915 * <pre>
3916 * continueStatement ::= 3916 * continueStatement ::=
3917 * 'continue' {@link SimpleIdentifier label}? ';' 3917 * 'continue' [SimpleIdentifier label]? ';'
3918 * </pre> 3918 * </pre>
3919 * @coverage dart.engine.ast 3919 * @coverage dart.engine.ast
3920 */ 3920 */
3921 class ContinueStatement extends Statement { 3921 class ContinueStatement extends Statement {
3922 3922
3923 /** 3923 /**
3924 * The token representing the 'continue' keyword. 3924 * The token representing the 'continue' keyword.
3925 */ 3925 */
3926 Token _keyword; 3926 Token _keyword;
3927 3927
3928 /** 3928 /**
3929 * The label associated with the statement, or {@code null} if there is no lab el. 3929 * The label associated with the statement, or `null` if there is no label.
3930 */ 3930 */
3931 SimpleIdentifier _label; 3931 SimpleIdentifier _label;
3932 3932
3933 /** 3933 /**
3934 * The semicolon terminating the statement. 3934 * The semicolon terminating the statement.
3935 */ 3935 */
3936 Token _semicolon; 3936 Token _semicolon;
3937 3937
3938 /** 3938 /**
3939 * Initialize a newly created continue statement. 3939 * Initialize a newly created continue statement.
(...skipping 18 matching lines...) Expand all
3958 Token get beginToken => _keyword; 3958 Token get beginToken => _keyword;
3959 Token get endToken => _semicolon; 3959 Token get endToken => _semicolon;
3960 3960
3961 /** 3961 /**
3962 * Return the token representing the 'continue' keyword. 3962 * Return the token representing the 'continue' keyword.
3963 * @return the token representing the 'continue' keyword 3963 * @return the token representing the 'continue' keyword
3964 */ 3964 */
3965 Token get keyword => _keyword; 3965 Token get keyword => _keyword;
3966 3966
3967 /** 3967 /**
3968 * Return the label associated with the statement, or {@code null} if there is no label. 3968 * Return the label associated with the statement, or `null` if there is no la bel.
3969 * @return the label associated with the statement 3969 * @return the label associated with the statement
3970 */ 3970 */
3971 SimpleIdentifier get label => _label; 3971 SimpleIdentifier get label => _label;
3972 3972
3973 /** 3973 /**
3974 * Return the semicolon terminating the statement. 3974 * Return the semicolon terminating the statement.
3975 * @return the semicolon terminating the statement 3975 * @return the semicolon terminating the statement
3976 */ 3976 */
3977 Token get semicolon => _semicolon; 3977 Token get semicolon => _semicolon;
3978 3978
(...skipping 18 matching lines...) Expand all
3997 * @param semicolon the semicolon terminating the statement 3997 * @param semicolon the semicolon terminating the statement
3998 */ 3998 */
3999 void set semicolon(Token semicolon2) { 3999 void set semicolon(Token semicolon2) {
4000 this._semicolon = semicolon2; 4000 this._semicolon = semicolon2;
4001 } 4001 }
4002 void visitChildren(ASTVisitor<Object> visitor) { 4002 void visitChildren(ASTVisitor<Object> visitor) {
4003 safelyVisitChild(_label, visitor); 4003 safelyVisitChild(_label, visitor);
4004 } 4004 }
4005 } 4005 }
4006 /** 4006 /**
4007 * The abstract class {@code Declaration} defines the behavior common to nodes t hat represent the 4007 * The abstract class `Declaration` defines the behavior common to nodes that re present the
4008 * declaration of a name. Each declared name is visible within a name scope. 4008 * declaration of a name. Each declared name is visible within a name scope.
4009 * @coverage dart.engine.ast 4009 * @coverage dart.engine.ast
4010 */ 4010 */
4011 abstract class Declaration extends AnnotatedNode { 4011 abstract class Declaration extends AnnotatedNode {
4012 4012
4013 /** 4013 /**
4014 * Initialize a newly created declaration. 4014 * Initialize a newly created declaration.
4015 * @param comment the documentation comment associated with this declaration 4015 * @param comment the documentation comment associated with this declaration
4016 * @param metadata the annotations associated with this declaration 4016 * @param metadata the annotations associated with this declaration
4017 */ 4017 */
4018 Declaration.full(Comment comment, List<Annotation> metadata) : super.full(comm ent, metadata) { 4018 Declaration.full(Comment comment, List<Annotation> metadata) : super.full(comm ent, metadata) {
4019 } 4019 }
4020 4020
4021 /** 4021 /**
4022 * Initialize a newly created declaration. 4022 * Initialize a newly created declaration.
4023 * @param comment the documentation comment associated with this declaration 4023 * @param comment the documentation comment associated with this declaration
4024 * @param metadata the annotations associated with this declaration 4024 * @param metadata the annotations associated with this declaration
4025 */ 4025 */
4026 Declaration({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata); 4026 Declaration({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata);
4027 4027
4028 /** 4028 /**
4029 * Return the element associated with this declaration, or {@code null} if eit her this node 4029 * Return the element associated with this declaration, or `null` if either th is node
4030 * corresponds to a list of declarations or if the AST structure has not been resolved. 4030 * corresponds to a list of declarations or if the AST structure has not been resolved.
4031 * @return the element associated with this declaration 4031 * @return the element associated with this declaration
4032 */ 4032 */
4033 Element get element; 4033 Element get element;
4034 } 4034 }
4035 /** 4035 /**
4036 * Instances of the class {@code DeclaredIdentifier} represent the declaration o f a single 4036 * Instances of the class `DeclaredIdentifier` represent the declaration of a si ngle
4037 * identifier. 4037 * identifier.
4038 * <pre> 4038 * <pre>
4039 * declaredIdentifier ::= 4039 * declaredIdentifier ::=
4040 * ({@link Annotation metadata} finalConstVarOrType {@link SimpleIdentifier iden tifier}</pre> 4040 * ([Annotation metadata] finalConstVarOrType [SimpleIdentifier identifier]</pre >
4041 * @coverage dart.engine.ast 4041 * @coverage dart.engine.ast
4042 */ 4042 */
4043 class DeclaredIdentifier extends Declaration { 4043 class DeclaredIdentifier extends Declaration {
4044 4044
4045 /** 4045 /**
4046 * The token representing either the 'final', 'const' or 'var' keyword, or {@c ode null} if no 4046 * The token representing either the 'final', 'const' or 'var' keyword, or `nu ll` if no
4047 * keyword was used. 4047 * keyword was used.
4048 */ 4048 */
4049 Token _keyword; 4049 Token _keyword;
4050 4050
4051 /** 4051 /**
4052 * The name of the declared type of the parameter, or {@code null} if the para meter does not have 4052 * The name of the declared type of the parameter, or `null` if the parameter does not have
4053 * a declared type. 4053 * a declared type.
4054 */ 4054 */
4055 TypeName _type; 4055 TypeName _type;
4056 4056
4057 /** 4057 /**
4058 * The name of the variable being declared. 4058 * The name of the variable being declared.
4059 */ 4059 */
4060 SimpleIdentifier _identifier; 4060 SimpleIdentifier _identifier;
4061 4061
4062 /** 4062 /**
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
4098 */ 4098 */
4099 SimpleIdentifier get identifier => _identifier; 4099 SimpleIdentifier get identifier => _identifier;
4100 4100
4101 /** 4101 /**
4102 * Return the token representing either the 'final', 'const' or 'var' keyword. 4102 * Return the token representing either the 'final', 'const' or 'var' keyword.
4103 * @return the token representing either the 'final', 'const' or 'var' keyword 4103 * @return the token representing either the 'final', 'const' or 'var' keyword
4104 */ 4104 */
4105 Token get keyword => _keyword; 4105 Token get keyword => _keyword;
4106 4106
4107 /** 4107 /**
4108 * Return the name of the declared type of the parameter, or {@code null} if t he parameter does 4108 * Return the name of the declared type of the parameter, or `null` if the par ameter does
4109 * not have a declared type. 4109 * not have a declared type.
4110 * @return the name of the declared type of the parameter 4110 * @return the name of the declared type of the parameter
4111 */ 4111 */
4112 TypeName get type => _type; 4112 TypeName get type => _type;
4113 4113
4114 /** 4114 /**
4115 * Return {@code true} if this variable was declared with the 'const' modifier . 4115 * Return `true` if this variable was declared with the 'const' modifier.
4116 * @return {@code true} if this variable was declared with the 'const' modifie r 4116 * @return `true` if this variable was declared with the 'const' modifier
4117 */ 4117 */
4118 bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.CONST); 4118 bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.CONST);
4119 4119
4120 /** 4120 /**
4121 * Return {@code true} if this variable was declared with the 'final' modifier . Variables that are 4121 * Return `true` if this variable was declared with the 'final' modifier. Vari ables that are
4122 * declared with the 'const' modifier will return {@code false} even though th ey are implicitly 4122 * declared with the 'const' modifier will return `false` even though they are implicitly
4123 * final. 4123 * final.
4124 * @return {@code true} if this variable was declared with the 'final' modifie r 4124 * @return `true` if this variable was declared with the 'final' modifier
4125 */ 4125 */
4126 bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.FINAL); 4126 bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.FINAL);
4127 4127
4128 /** 4128 /**
4129 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token. 4129 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
4130 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 4130 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
4131 */ 4131 */
4132 void set keyword(Token keyword2) { 4132 void set keyword(Token keyword2) {
4133 this._keyword = keyword2; 4133 this._keyword = keyword2;
4134 } 4134 }
(...skipping 13 matching lines...) Expand all
4148 Token get firstTokenAfterCommentAndMetadata { 4148 Token get firstTokenAfterCommentAndMetadata {
4149 if (_keyword != null) { 4149 if (_keyword != null) {
4150 return _keyword; 4150 return _keyword;
4151 } else if (_type != null) { 4151 } else if (_type != null) {
4152 return _type.beginToken; 4152 return _type.beginToken;
4153 } 4153 }
4154 return _identifier.beginToken; 4154 return _identifier.beginToken;
4155 } 4155 }
4156 } 4156 }
4157 /** 4157 /**
4158 * Instances of the class {@code DefaultFormalParameter} represent a formal para meter with a default 4158 * Instances of the class `DefaultFormalParameter` represent a formal parameter with a default
4159 * value. There are two kinds of parameters that are both represented by this cl ass: named formal 4159 * value. There are two kinds of parameters that are both represented by this cl ass: named formal
4160 * parameters and positional formal parameters. 4160 * parameters and positional formal parameters.
4161 * <pre> 4161 * <pre>
4162 * defaultFormalParameter ::={@link NormalFormalParameter normalFormalParameter} ('=' {@link Expression defaultValue})? 4162 * defaultFormalParameter ::=[NormalFormalParameter normalFormalParameter] ('=' [Expression defaultValue])?
4163 * defaultNamedParameter ::={@link NormalFormalParameter normalFormalParameter} (':' {@link Expression defaultValue})? 4163 * defaultNamedParameter ::=[NormalFormalParameter normalFormalParameter] (':' [ Expression defaultValue])?
4164 * </pre> 4164 * </pre>
4165 * @coverage dart.engine.ast 4165 * @coverage dart.engine.ast
4166 */ 4166 */
4167 class DefaultFormalParameter extends FormalParameter { 4167 class DefaultFormalParameter extends FormalParameter {
4168 4168
4169 /** 4169 /**
4170 * The formal parameter with which the default value is associated. 4170 * The formal parameter with which the default value is associated.
4171 */ 4171 */
4172 NormalFormalParameter _parameter; 4172 NormalFormalParameter _parameter;
4173 4173
4174 /** 4174 /**
4175 * The kind of this parameter. 4175 * The kind of this parameter.
4176 */ 4176 */
4177 ParameterKind _kind; 4177 ParameterKind _kind;
4178 4178
4179 /** 4179 /**
4180 * The token separating the parameter from the default value, or {@code null} if there is no 4180 * The token separating the parameter from the default value, or `null` if the re is no
4181 * default value. 4181 * default value.
4182 */ 4182 */
4183 Token _separator; 4183 Token _separator;
4184 4184
4185 /** 4185 /**
4186 * The expression computing the default value for the parameter, or {@code nul l} if there is no 4186 * The expression computing the default value for the parameter, or `null` if there is no
4187 * default value. 4187 * default value.
4188 */ 4188 */
4189 Expression _defaultValue; 4189 Expression _defaultValue;
4190 4190
4191 /** 4191 /**
4192 * Initialize a newly created default formal parameter. 4192 * Initialize a newly created default formal parameter.
4193 * @param parameter the formal parameter with which the default value is assoc iated 4193 * @param parameter the formal parameter with which the default value is assoc iated
4194 * @param kind the kind of this parameter 4194 * @param kind the kind of this parameter
4195 * @param separator the token separating the parameter from the default value 4195 * @param separator the token separating the parameter from the default value
4196 * @param defaultValue the expression computing the default value for the para meter 4196 * @param defaultValue the expression computing the default value for the para meter
(...skipping 10 matching lines...) Expand all
4207 * @param parameter the formal parameter with which the default value is assoc iated 4207 * @param parameter the formal parameter with which the default value is assoc iated
4208 * @param kind the kind of this parameter 4208 * @param kind the kind of this parameter
4209 * @param separator the token separating the parameter from the default value 4209 * @param separator the token separating the parameter from the default value
4210 * @param defaultValue the expression computing the default value for the para meter 4210 * @param defaultValue the expression computing the default value for the para meter
4211 */ 4211 */
4212 DefaultFormalParameter({NormalFormalParameter parameter, ParameterKind kind, T oken separator, Expression defaultValue}) : this.full(parameter, kind, separator , defaultValue); 4212 DefaultFormalParameter({NormalFormalParameter parameter, ParameterKind kind, T oken separator, Expression defaultValue}) : this.full(parameter, kind, separator , defaultValue);
4213 accept(ASTVisitor visitor) => visitor.visitDefaultFormalParameter(this); 4213 accept(ASTVisitor visitor) => visitor.visitDefaultFormalParameter(this);
4214 Token get beginToken => _parameter.beginToken; 4214 Token get beginToken => _parameter.beginToken;
4215 4215
4216 /** 4216 /**
4217 * Return the expression computing the default value for the parameter, or {@c ode null} if there 4217 * Return the expression computing the default value for the parameter, or `nu ll` if there
4218 * is no default value. 4218 * is no default value.
4219 * @return the expression computing the default value for the parameter 4219 * @return the expression computing the default value for the parameter
4220 */ 4220 */
4221 Expression get defaultValue => _defaultValue; 4221 Expression get defaultValue => _defaultValue;
4222 Token get endToken { 4222 Token get endToken {
4223 if (_defaultValue != null) { 4223 if (_defaultValue != null) {
4224 return _defaultValue.endToken; 4224 return _defaultValue.endToken;
4225 } 4225 }
4226 return _parameter.endToken; 4226 return _parameter.endToken;
4227 } 4227 }
4228 SimpleIdentifier get identifier => _parameter.identifier; 4228 SimpleIdentifier get identifier => _parameter.identifier;
4229 ParameterKind get kind => _kind; 4229 ParameterKind get kind => _kind;
4230 4230
4231 /** 4231 /**
4232 * Return the formal parameter with which the default value is associated. 4232 * Return the formal parameter with which the default value is associated.
4233 * @return the formal parameter with which the default value is associated 4233 * @return the formal parameter with which the default value is associated
4234 */ 4234 */
4235 NormalFormalParameter get parameter => _parameter; 4235 NormalFormalParameter get parameter => _parameter;
4236 4236
4237 /** 4237 /**
4238 * Return the token separating the parameter from the default value, or {@code null} if there is 4238 * Return the token separating the parameter from the default value, or `null` if there is
4239 * no default value. 4239 * no default value.
4240 * @return the token separating the parameter from the default value 4240 * @return the token separating the parameter from the default value
4241 */ 4241 */
4242 Token get separator => _separator; 4242 Token get separator => _separator;
4243 4243
4244 /** 4244 /**
4245 * Return {@code true} if this parameter was declared with the 'const' modifie r. 4245 * Return `true` if this parameter was declared with the 'const' modifier.
4246 * @return {@code true} if this parameter was declared with the 'const' modifi er 4246 * @return `true` if this parameter was declared with the 'const' modifier
4247 */ 4247 */
4248 bool isConst() => _parameter != null && _parameter.isConst(); 4248 bool isConst() => _parameter != null && _parameter.isConst();
4249 4249
4250 /** 4250 /**
4251 * Return {@code true} if this parameter was declared with the 'final' modifie r. Parameters that 4251 * Return `true` if this parameter was declared with the 'final' modifier. Par ameters that
4252 * are declared with the 'const' modifier will return {@code false} even thoug h they are 4252 * are declared with the 'const' modifier will return `false` even though they are
4253 * implicitly final. 4253 * implicitly final.
4254 * @return {@code true} if this parameter was declared with the 'final' modifi er 4254 * @return `true` if this parameter was declared with the 'final' modifier
4255 */ 4255 */
4256 bool isFinal() => _parameter != null && _parameter.isFinal(); 4256 bool isFinal() => _parameter != null && _parameter.isFinal();
4257 4257
4258 /** 4258 /**
4259 * Set the expression computing the default value for the parameter to the giv en expression. 4259 * Set the expression computing the default value for the parameter to the giv en expression.
4260 * @param expression the expression computing the default value for the parame ter 4260 * @param expression the expression computing the default value for the parame ter
4261 */ 4261 */
4262 void set defaultValue(Expression expression) { 4262 void set defaultValue(Expression expression) {
4263 _defaultValue = becomeParentOf(expression); 4263 _defaultValue = becomeParentOf(expression);
4264 } 4264 }
(...skipping 20 matching lines...) Expand all
4285 */ 4285 */
4286 void set separator(Token separator2) { 4286 void set separator(Token separator2) {
4287 this._separator = separator2; 4287 this._separator = separator2;
4288 } 4288 }
4289 void visitChildren(ASTVisitor<Object> visitor) { 4289 void visitChildren(ASTVisitor<Object> visitor) {
4290 safelyVisitChild(_parameter, visitor); 4290 safelyVisitChild(_parameter, visitor);
4291 safelyVisitChild(_defaultValue, visitor); 4291 safelyVisitChild(_defaultValue, visitor);
4292 } 4292 }
4293 } 4293 }
4294 /** 4294 /**
4295 * The abstract class {@code Directive} defines the behavior common to nodes tha t represent a 4295 * The abstract class `Directive` defines the behavior common to nodes that repr esent a
4296 * directive. 4296 * directive.
4297 * <pre> 4297 * <pre>
4298 * directive ::={@link ExportDirective exportDirective}| {@link ImportDirective importDirective}| {@link LibraryDirective libraryDirective}| {@link PartDirectiv e partDirective}| {@link PartOfDirective partOfDirective}</pre> 4298 * directive ::=[ExportDirective exportDirective]| [ImportDirective importDirect ive]| [LibraryDirective libraryDirective]| [PartDirective partDirective]| [PartO fDirective partOfDirective]</pre>
4299 * @coverage dart.engine.ast 4299 * @coverage dart.engine.ast
4300 */ 4300 */
4301 abstract class Directive extends AnnotatedNode { 4301 abstract class Directive extends AnnotatedNode {
4302 4302
4303 /** 4303 /**
4304 * The element associated with this directive, or {@code null} if the AST stru cture has not been 4304 * The element associated with this directive, or `null` if the AST structure has not been
4305 * resolved or if this directive could not be resolved. 4305 * resolved or if this directive could not be resolved.
4306 */ 4306 */
4307 Element _element; 4307 Element _element;
4308 4308
4309 /** 4309 /**
4310 * Initialize a newly create directive. 4310 * Initialize a newly create directive.
4311 * @param comment the documentation comment associated with this directive 4311 * @param comment the documentation comment associated with this directive
4312 * @param metadata the annotations associated with the directive 4312 * @param metadata the annotations associated with the directive
4313 */ 4313 */
4314 Directive.full(Comment comment, List<Annotation> metadata) : super.full(commen t, metadata) { 4314 Directive.full(Comment comment, List<Annotation> metadata) : super.full(commen t, metadata) {
4315 } 4315 }
4316 4316
4317 /** 4317 /**
4318 * Initialize a newly create directive. 4318 * Initialize a newly create directive.
4319 * @param comment the documentation comment associated with this directive 4319 * @param comment the documentation comment associated with this directive
4320 * @param metadata the annotations associated with the directive 4320 * @param metadata the annotations associated with the directive
4321 */ 4321 */
4322 Directive({Comment comment, List<Annotation> metadata}) : this.full(comment, m etadata); 4322 Directive({Comment comment, List<Annotation> metadata}) : this.full(comment, m etadata);
4323 4323
4324 /** 4324 /**
4325 * Return the element associated with this directive, or {@code null} if the A ST structure has not 4325 * Return the element associated with this directive, or `null` if the AST str ucture has not
4326 * been resolved or if this directive could not be resolved. Examples of the l atter case include a 4326 * been resolved or if this directive could not be resolved. Examples of the l atter case include a
4327 * directive that contains an invalid URL or a URL that does not exist. 4327 * directive that contains an invalid URL or a URL that does not exist.
4328 * @return the element associated with this directive 4328 * @return the element associated with this directive
4329 */ 4329 */
4330 Element get element => _element; 4330 Element get element => _element;
4331 4331
4332 /** 4332 /**
4333 * Return the token representing the keyword that introduces this directive (' import', 'export', 4333 * Return the token representing the keyword that introduces this directive (' import', 'export',
4334 * 'library' or 'part'). 4334 * 'library' or 'part').
4335 * @return the token representing the keyword that introduces this directive 4335 * @return the token representing the keyword that introduces this directive
4336 */ 4336 */
4337 Token get keyword; 4337 Token get keyword;
4338 4338
4339 /** 4339 /**
4340 * Set the element associated with this directive to the given element. 4340 * Set the element associated with this directive to the given element.
4341 * @param element the element associated with this directive 4341 * @param element the element associated with this directive
4342 */ 4342 */
4343 void set element(Element element2) { 4343 void set element(Element element2) {
4344 this._element = element2; 4344 this._element = element2;
4345 } 4345 }
4346 } 4346 }
4347 /** 4347 /**
4348 * Instances of the class {@code DoStatement} represent a do statement. 4348 * Instances of the class `DoStatement` represent a do statement.
4349 * <pre> 4349 * <pre>
4350 * doStatement ::= 4350 * doStatement ::=
4351 * 'do' {@link Statement body} 'while' '(' {@link Expression condition} ')' ';' 4351 * 'do' [Statement body] 'while' '(' [Expression condition] ')' ';'
4352 * </pre> 4352 * </pre>
4353 * @coverage dart.engine.ast 4353 * @coverage dart.engine.ast
4354 */ 4354 */
4355 class DoStatement extends Statement { 4355 class DoStatement extends Statement {
4356 4356
4357 /** 4357 /**
4358 * The token representing the 'do' keyword. 4358 * The token representing the 'do' keyword.
4359 */ 4359 */
4360 Token _doKeyword; 4360 Token _doKeyword;
4361 4361
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
4520 */ 4520 */
4521 void set whileKeyword(Token whileKeyword2) { 4521 void set whileKeyword(Token whileKeyword2) {
4522 this._whileKeyword = whileKeyword2; 4522 this._whileKeyword = whileKeyword2;
4523 } 4523 }
4524 void visitChildren(ASTVisitor<Object> visitor) { 4524 void visitChildren(ASTVisitor<Object> visitor) {
4525 safelyVisitChild(_body, visitor); 4525 safelyVisitChild(_body, visitor);
4526 safelyVisitChild(_condition, visitor); 4526 safelyVisitChild(_condition, visitor);
4527 } 4527 }
4528 } 4528 }
4529 /** 4529 /**
4530 * Instances of the class {@code DoubleLiteral} represent a floating point liter al expression. 4530 * Instances of the class `DoubleLiteral` represent a floating point literal exp ression.
4531 * <pre> 4531 * <pre>
4532 * doubleLiteral ::= 4532 * doubleLiteral ::=
4533 * decimalDigit+ ('.' decimalDigit*)? exponent? 4533 * decimalDigit+ ('.' decimalDigit*)? exponent?
4534 * | '.' decimalDigit+ exponent? 4534 * | '.' decimalDigit+ exponent?
4535 * exponent ::= 4535 * exponent ::=
4536 * ('e' | 'E') ('+' | '-')? decimalDigit+ 4536 * ('e' | 'E') ('+' | '-')? decimalDigit+
4537 * </pre> 4537 * </pre>
4538 * @coverage dart.engine.ast 4538 * @coverage dart.engine.ast
4539 */ 4539 */
4540 class DoubleLiteral extends Literal { 4540 class DoubleLiteral extends Literal {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
4593 * Set the value of the literal to the given value. 4593 * Set the value of the literal to the given value.
4594 * @param value the value of the literal 4594 * @param value the value of the literal
4595 */ 4595 */
4596 void set value(double value2) { 4596 void set value(double value2) {
4597 this._value = value2; 4597 this._value = value2;
4598 } 4598 }
4599 void visitChildren(ASTVisitor<Object> visitor) { 4599 void visitChildren(ASTVisitor<Object> visitor) {
4600 } 4600 }
4601 } 4601 }
4602 /** 4602 /**
4603 * Instances of the class {@code EmptyFunctionBody} represent an empty function body, which can only 4603 * Instances of the class `EmptyFunctionBody` represent an empty function body, which can only
4604 * appear in constructors or abstract methods. 4604 * appear in constructors or abstract methods.
4605 * <pre> 4605 * <pre>
4606 * emptyFunctionBody ::= 4606 * emptyFunctionBody ::=
4607 * ';' 4607 * ';'
4608 * </pre> 4608 * </pre>
4609 * @coverage dart.engine.ast 4609 * @coverage dart.engine.ast
4610 */ 4610 */
4611 class EmptyFunctionBody extends FunctionBody { 4611 class EmptyFunctionBody extends FunctionBody {
4612 4612
4613 /** 4613 /**
(...skipping 29 matching lines...) Expand all
4643 * token. 4643 * token.
4644 * @param semicolon the token representing the semicolon that marks the end of the function body 4644 * @param semicolon the token representing the semicolon that marks the end of the function body
4645 */ 4645 */
4646 void set semicolon(Token semicolon2) { 4646 void set semicolon(Token semicolon2) {
4647 this._semicolon = semicolon2; 4647 this._semicolon = semicolon2;
4648 } 4648 }
4649 void visitChildren(ASTVisitor<Object> visitor) { 4649 void visitChildren(ASTVisitor<Object> visitor) {
4650 } 4650 }
4651 } 4651 }
4652 /** 4652 /**
4653 * Instances of the class {@code EmptyStatement} represent an empty statement. 4653 * Instances of the class `EmptyStatement` represent an empty statement.
4654 * <pre> 4654 * <pre>
4655 * emptyStatement ::= 4655 * emptyStatement ::=
4656 * ';' 4656 * ';'
4657 * </pre> 4657 * </pre>
4658 * @coverage dart.engine.ast 4658 * @coverage dart.engine.ast
4659 */ 4659 */
4660 class EmptyStatement extends Statement { 4660 class EmptyStatement extends Statement {
4661 4661
4662 /** 4662 /**
4663 * The semicolon terminating the statement. 4663 * The semicolon terminating the statement.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
4701 * Ephemeral identifiers are created as needed to mimic the presence of an empty identifier. 4701 * Ephemeral identifiers are created as needed to mimic the presence of an empty identifier.
4702 * @coverage dart.engine.ast 4702 * @coverage dart.engine.ast
4703 */ 4703 */
4704 class EphemeralIdentifier extends SimpleIdentifier { 4704 class EphemeralIdentifier extends SimpleIdentifier {
4705 EphemeralIdentifier.full(ASTNode parent, int location) : super.full(new Token( TokenType.IDENTIFIER, location)) { 4705 EphemeralIdentifier.full(ASTNode parent, int location) : super.full(new Token( TokenType.IDENTIFIER, location)) {
4706 parent.becomeParentOf(this); 4706 parent.becomeParentOf(this);
4707 } 4707 }
4708 EphemeralIdentifier({ASTNode parent, int location}) : this.full(parent, locati on); 4708 EphemeralIdentifier({ASTNode parent, int location}) : this.full(parent, locati on);
4709 } 4709 }
4710 /** 4710 /**
4711 * Instances of the class {@code ExportDirective} represent an export directive. 4711 * Instances of the class `ExportDirective` represent an export directive.
4712 * <pre> 4712 * <pre>
4713 * exportDirective ::={@link Annotation metadata} 'export' {@link StringLiteral libraryUri} {@link Combinator combinator}* ';' 4713 * exportDirective ::=[Annotation metadata] 'export' [StringLiteral libraryUri] [Combinator combinator]* ';'
4714 * </pre> 4714 * </pre>
4715 * @coverage dart.engine.ast 4715 * @coverage dart.engine.ast
4716 */ 4716 */
4717 class ExportDirective extends NamespaceDirective { 4717 class ExportDirective extends NamespaceDirective {
4718 4718
4719 /** 4719 /**
4720 * Initialize a newly created export directive. 4720 * Initialize a newly created export directive.
4721 * @param comment the documentation comment associated with this directive 4721 * @param comment the documentation comment associated with this directive
4722 * @param metadata the annotations associated with the directive 4722 * @param metadata the annotations associated with the directive
4723 * @param keyword the token representing the 'export' keyword 4723 * @param keyword the token representing the 'export' keyword
(...skipping 21 matching lines...) Expand all
4745 return ((element as ExportElement)).exportedLibrary; 4745 return ((element as ExportElement)).exportedLibrary;
4746 } 4746 }
4747 return null; 4747 return null;
4748 } 4748 }
4749 void visitChildren(ASTVisitor<Object> visitor) { 4749 void visitChildren(ASTVisitor<Object> visitor) {
4750 super.visitChildren(visitor); 4750 super.visitChildren(visitor);
4751 combinators.accept(visitor); 4751 combinators.accept(visitor);
4752 } 4752 }
4753 } 4753 }
4754 /** 4754 /**
4755 * Instances of the class {@code Expression} defines the behavior common to node s that represent an 4755 * Instances of the class `Expression` defines the behavior common to nodes that represent an
4756 * expression. 4756 * expression.
4757 * <pre> 4757 * <pre>
4758 * expression ::={@link AssignmentExpression assignmentExpression}| {@link Condi tionalExpression conditionalExpression} cascadeSection 4758 * expression ::=[AssignmentExpression assignmentExpression]| [ConditionalExpres sion conditionalExpression] cascadeSection
4759 * | {@link ThrowExpression throwExpression}</pre> 4759 * | [ThrowExpression throwExpression]</pre>
4760 * @coverage dart.engine.ast 4760 * @coverage dart.engine.ast
4761 */ 4761 */
4762 abstract class Expression extends ASTNode { 4762 abstract class Expression extends ASTNode {
4763 4763
4764 /** 4764 /**
4765 * The static type of this expression, or {@code null} if the AST structure ha s not been resolved. 4765 * The static type of this expression, or `null` if the AST structure has not been resolved.
4766 */ 4766 */
4767 Type2 _staticType; 4767 Type2 _staticType;
4768 4768
4769 /** 4769 /**
4770 * The propagated type of this expression, or {@code null} if type propagation has not been 4770 * The propagated type of this expression, or `null` if type propagation has n ot been
4771 * performed on the AST structure. 4771 * performed on the AST structure.
4772 */ 4772 */
4773 Type2 _propagatedType; 4773 Type2 _propagatedType;
4774 4774
4775 /** 4775 /**
4776 * If this expression is an argument to an invocation, and the AST structure h as been resolved, 4776 * If this expression is an argument to an invocation, and the AST structure h as been resolved,
4777 * and the function being invoked is known based on propagated type informatio n, and this 4777 * and the function being invoked is known based on propagated type informatio n, and this
4778 * expression corresponds to one of the parameters of the function being invok ed, then return the 4778 * expression corresponds to one of the parameters of the function being invok ed, then return the
4779 * parameter element representing the parameter to which the value of this exp ression will be 4779 * parameter element representing the parameter to which the value of this exp ression will be
4780 * bound. Otherwise, return {@code null}. 4780 * bound. Otherwise, return `null`.
4781 * @return the parameter element representing the parameter to which the value of this expression 4781 * @return the parameter element representing the parameter to which the value of this expression
4782 * will be bound 4782 * will be bound
4783 */ 4783 */
4784 ParameterElement get parameterElement { 4784 ParameterElement get parameterElement {
4785 ASTNode parent = this.parent; 4785 ASTNode parent = this.parent;
4786 if (parent is ArgumentList) { 4786 if (parent is ArgumentList) {
4787 return ((parent as ArgumentList)).getPropagatedParameterElementFor(this); 4787 return ((parent as ArgumentList)).getPropagatedParameterElementFor(this);
4788 } else if (parent is IndexExpression) { 4788 } else if (parent is IndexExpression) {
4789 IndexExpression indexExpression = parent as IndexExpression; 4789 IndexExpression indexExpression = parent as IndexExpression;
4790 if (identical(indexExpression.index, this)) { 4790 if (identical(indexExpression.index, this)) {
4791 return indexExpression.propagatedParameterElementForIndex; 4791 return indexExpression.propagatedParameterElementForIndex;
4792 } 4792 }
4793 } else if (parent is BinaryExpression) { 4793 } else if (parent is BinaryExpression) {
4794 BinaryExpression binaryExpression = parent as BinaryExpression; 4794 BinaryExpression binaryExpression = parent as BinaryExpression;
4795 if (identical(binaryExpression.rightOperand, this)) { 4795 if (identical(binaryExpression.rightOperand, this)) {
4796 return binaryExpression.propagatedParameterElementForRightOperand; 4796 return binaryExpression.propagatedParameterElementForRightOperand;
4797 } 4797 }
4798 } else if (parent is PrefixExpression) { 4798 } else if (parent is PrefixExpression) {
4799 return ((parent as PrefixExpression)).propagatedParameterElementForOperand ; 4799 return ((parent as PrefixExpression)).propagatedParameterElementForOperand ;
4800 } else if (parent is PostfixExpression) { 4800 } else if (parent is PostfixExpression) {
4801 return ((parent as PostfixExpression)).propagatedParameterElementForOperan d; 4801 return ((parent as PostfixExpression)).propagatedParameterElementForOperan d;
4802 } 4802 }
4803 return null; 4803 return null;
4804 } 4804 }
4805 4805
4806 /** 4806 /**
4807 * Return the propagated type of this expression, or {@code null} if type prop agation has not been 4807 * Return the propagated type of this expression, or `null` if type propagatio n has not been
4808 * performed on the AST structure. 4808 * performed on the AST structure.
4809 * @return the propagated type of this expression 4809 * @return the propagated type of this expression
4810 */ 4810 */
4811 Type2 get propagatedType => _propagatedType; 4811 Type2 get propagatedType => _propagatedType;
4812 4812
4813 /** 4813 /**
4814 * If this expression is an argument to an invocation, and the AST structure h as been resolved, 4814 * If this expression is an argument to an invocation, and the AST structure h as been resolved,
4815 * and the function being invoked is known based on static type information, a nd this expression 4815 * and the function being invoked is known based on static type information, a nd this expression
4816 * corresponds to one of the parameters of the function being invoked, then re turn the parameter 4816 * corresponds to one of the parameters of the function being invoked, then re turn the parameter
4817 * element representing the parameter to which the value of this expression wi ll be bound. 4817 * element representing the parameter to which the value of this expression wi ll be bound.
4818 * Otherwise, return {@code null}. 4818 * Otherwise, return `null`.
4819 * @return the parameter element representing the parameter to which the value of this expression 4819 * @return the parameter element representing the parameter to which the value of this expression
4820 * will be bound 4820 * will be bound
4821 */ 4821 */
4822 ParameterElement get staticParameterElement { 4822 ParameterElement get staticParameterElement {
4823 ASTNode parent = this.parent; 4823 ASTNode parent = this.parent;
4824 if (parent is ArgumentList) { 4824 if (parent is ArgumentList) {
4825 return ((parent as ArgumentList)).getStaticParameterElementFor(this); 4825 return ((parent as ArgumentList)).getStaticParameterElementFor(this);
4826 } else if (parent is IndexExpression) { 4826 } else if (parent is IndexExpression) {
4827 IndexExpression indexExpression = parent as IndexExpression; 4827 IndexExpression indexExpression = parent as IndexExpression;
4828 if (identical(indexExpression.index, this)) { 4828 if (identical(indexExpression.index, this)) {
4829 return indexExpression.staticParameterElementForIndex; 4829 return indexExpression.staticParameterElementForIndex;
4830 } 4830 }
4831 } else if (parent is BinaryExpression) { 4831 } else if (parent is BinaryExpression) {
4832 BinaryExpression binaryExpression = parent as BinaryExpression; 4832 BinaryExpression binaryExpression = parent as BinaryExpression;
4833 if (identical(binaryExpression.rightOperand, this)) { 4833 if (identical(binaryExpression.rightOperand, this)) {
4834 return binaryExpression.staticParameterElementForRightOperand; 4834 return binaryExpression.staticParameterElementForRightOperand;
4835 } 4835 }
4836 } else if (parent is PrefixExpression) { 4836 } else if (parent is PrefixExpression) {
4837 return ((parent as PrefixExpression)).staticParameterElementForOperand; 4837 return ((parent as PrefixExpression)).staticParameterElementForOperand;
4838 } else if (parent is PostfixExpression) { 4838 } else if (parent is PostfixExpression) {
4839 return ((parent as PostfixExpression)).staticParameterElementForOperand; 4839 return ((parent as PostfixExpression)).staticParameterElementForOperand;
4840 } 4840 }
4841 return null; 4841 return null;
4842 } 4842 }
4843 4843
4844 /** 4844 /**
4845 * Return the static type of this expression, or {@code null} if the AST struc ture has not been 4845 * Return the static type of this expression, or `null` if the AST structure h as not been
4846 * resolved. 4846 * resolved.
4847 * @return the static type of this expression 4847 * @return the static type of this expression
4848 */ 4848 */
4849 Type2 get staticType => _staticType; 4849 Type2 get staticType => _staticType;
4850 4850
4851 /** 4851 /**
4852 * Return {@code true} if this expression is syntactically valid for the LHS o f an{@link AssignmentExpression assignment expression}. 4852 * Return `true` if this expression is syntactically valid for the LHS of an[A ssignmentExpression assignment expression].
4853 * @return {@code true} if this expression matches the {@code assignableExpres sion} production 4853 * @return `true` if this expression matches the `assignableExpression` produc tion
4854 */ 4854 */
4855 bool isAssignable() => false; 4855 bool isAssignable() => false;
4856 4856
4857 /** 4857 /**
4858 * Set the propagated type of this expression to the given type. 4858 * Set the propagated type of this expression to the given type.
4859 * @param propagatedType the propagated type of this expression 4859 * @param propagatedType the propagated type of this expression
4860 */ 4860 */
4861 void set propagatedType(Type2 propagatedType2) { 4861 void set propagatedType(Type2 propagatedType2) {
4862 this._propagatedType = propagatedType2; 4862 this._propagatedType = propagatedType2;
4863 } 4863 }
4864 4864
4865 /** 4865 /**
4866 * Set the static type of this expression to the given type. 4866 * Set the static type of this expression to the given type.
4867 * @param staticType the static type of this expression 4867 * @param staticType the static type of this expression
4868 */ 4868 */
4869 void set staticType(Type2 staticType2) { 4869 void set staticType(Type2 staticType2) {
4870 this._staticType = staticType2; 4870 this._staticType = staticType2;
4871 } 4871 }
4872 } 4872 }
4873 /** 4873 /**
4874 * Instances of the class {@code ExpressionFunctionBody} represent a function bo dy consisting of a 4874 * Instances of the class `ExpressionFunctionBody` represent a function body con sisting of a
4875 * single expression. 4875 * single expression.
4876 * <pre> 4876 * <pre>
4877 * expressionFunctionBody ::= 4877 * expressionFunctionBody ::=
4878 * '=>' {@link Expression expression} ';' 4878 * '=>' [Expression expression] ';'
4879 * </pre> 4879 * </pre>
4880 * @coverage dart.engine.ast 4880 * @coverage dart.engine.ast
4881 */ 4881 */
4882 class ExpressionFunctionBody extends FunctionBody { 4882 class ExpressionFunctionBody extends FunctionBody {
4883 4883
4884 /** 4884 /**
4885 * The token introducing the expression that represents the body of the functi on. 4885 * The token introducing the expression that represents the body of the functi on.
4886 */ 4886 */
4887 Token _functionDefinition; 4887 Token _functionDefinition;
4888 4888
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
4966 * @param semicolon the semicolon terminating the statement 4966 * @param semicolon the semicolon terminating the statement
4967 */ 4967 */
4968 void set semicolon(Token semicolon2) { 4968 void set semicolon(Token semicolon2) {
4969 this._semicolon = semicolon2; 4969 this._semicolon = semicolon2;
4970 } 4970 }
4971 void visitChildren(ASTVisitor<Object> visitor) { 4971 void visitChildren(ASTVisitor<Object> visitor) {
4972 safelyVisitChild(_expression, visitor); 4972 safelyVisitChild(_expression, visitor);
4973 } 4973 }
4974 } 4974 }
4975 /** 4975 /**
4976 * Instances of the class {@code ExpressionStatement} wrap an expression as a st atement. 4976 * Instances of the class `ExpressionStatement` wrap an expression as a statemen t.
4977 * <pre> 4977 * <pre>
4978 * expressionStatement ::={@link Expression expression}? ';' 4978 * expressionStatement ::=[Expression expression]? ';'
4979 * </pre> 4979 * </pre>
4980 * @coverage dart.engine.ast 4980 * @coverage dart.engine.ast
4981 */ 4981 */
4982 class ExpressionStatement extends Statement { 4982 class ExpressionStatement extends Statement {
4983 4983
4984 /** 4984 /**
4985 * The expression that comprises the statement. 4985 * The expression that comprises the statement.
4986 */ 4986 */
4987 Expression _expression; 4987 Expression _expression;
4988 4988
4989 /** 4989 /**
4990 * The semicolon terminating the statement, or {@code null} if the expression is a function 4990 * The semicolon terminating the statement, or `null` if the expression is a f unction
4991 * expression and isn't followed by a semicolon. 4991 * expression and isn't followed by a semicolon.
4992 */ 4992 */
4993 Token _semicolon; 4993 Token _semicolon;
4994 4994
4995 /** 4995 /**
4996 * Initialize a newly created expression statement. 4996 * Initialize a newly created expression statement.
4997 * @param expression the expression that comprises the statement 4997 * @param expression the expression that comprises the statement
4998 * @param semicolon the semicolon terminating the statement 4998 * @param semicolon the semicolon terminating the statement
4999 */ 4999 */
5000 ExpressionStatement.full(Expression expression, Token semicolon) { 5000 ExpressionStatement.full(Expression expression, Token semicolon) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
5043 * @param semicolon the semicolon terminating the statement 5043 * @param semicolon the semicolon terminating the statement
5044 */ 5044 */
5045 void set semicolon(Token semicolon2) { 5045 void set semicolon(Token semicolon2) {
5046 this._semicolon = semicolon2; 5046 this._semicolon = semicolon2;
5047 } 5047 }
5048 void visitChildren(ASTVisitor<Object> visitor) { 5048 void visitChildren(ASTVisitor<Object> visitor) {
5049 safelyVisitChild(_expression, visitor); 5049 safelyVisitChild(_expression, visitor);
5050 } 5050 }
5051 } 5051 }
5052 /** 5052 /**
5053 * Instances of the class {@code ExtendsClause} represent the "extends" clause i n a class 5053 * Instances of the class `ExtendsClause` represent the "extends" clause in a cl ass
5054 * declaration. 5054 * declaration.
5055 * <pre> 5055 * <pre>
5056 * extendsClause ::= 5056 * extendsClause ::=
5057 * 'extends' {@link TypeName superclass}</pre> 5057 * 'extends' [TypeName superclass]</pre>
5058 * @coverage dart.engine.ast 5058 * @coverage dart.engine.ast
5059 */ 5059 */
5060 class ExtendsClause extends ASTNode { 5060 class ExtendsClause extends ASTNode {
5061 5061
5062 /** 5062 /**
5063 * The token representing the 'extends' keyword. 5063 * The token representing the 'extends' keyword.
5064 */ 5064 */
5065 Token _keyword; 5065 Token _keyword;
5066 5066
5067 /** 5067 /**
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
5114 * @param name the name of the class that is being extended 5114 * @param name the name of the class that is being extended
5115 */ 5115 */
5116 void set superclass(TypeName name) { 5116 void set superclass(TypeName name) {
5117 _superclass = becomeParentOf(name); 5117 _superclass = becomeParentOf(name);
5118 } 5118 }
5119 void visitChildren(ASTVisitor<Object> visitor) { 5119 void visitChildren(ASTVisitor<Object> visitor) {
5120 safelyVisitChild(_superclass, visitor); 5120 safelyVisitChild(_superclass, visitor);
5121 } 5121 }
5122 } 5122 }
5123 /** 5123 /**
5124 * Instances of the class {@code FieldDeclaration} represent the declaration of one or more fields 5124 * Instances of the class `FieldDeclaration` represent the declaration of one or more fields
5125 * of the same type. 5125 * of the same type.
5126 * <pre> 5126 * <pre>
5127 * fieldDeclaration ::= 5127 * fieldDeclaration ::=
5128 * 'static'? {@link VariableDeclarationList fieldList} ';' 5128 * 'static'? [VariableDeclarationList fieldList] ';'
5129 * </pre> 5129 * </pre>
5130 * @coverage dart.engine.ast 5130 * @coverage dart.engine.ast
5131 */ 5131 */
5132 class FieldDeclaration extends ClassMember { 5132 class FieldDeclaration extends ClassMember {
5133 5133
5134 /** 5134 /**
5135 * The token representing the 'static' keyword, or {@code null} if the fields are not static. 5135 * The token representing the 'static' keyword, or `null` if the fields are no t static.
5136 */ 5136 */
5137 Token _keyword; 5137 Token _keyword;
5138 5138
5139 /** 5139 /**
5140 * The fields being declared. 5140 * The fields being declared.
5141 */ 5141 */
5142 VariableDeclarationList _fieldList; 5142 VariableDeclarationList _fieldList;
5143 5143
5144 /** 5144 /**
5145 * The semicolon terminating the declaration. 5145 * The semicolon terminating the declaration.
(...skipping 27 matching lines...) Expand all
5173 Element get element => null; 5173 Element get element => null;
5174 Token get endToken => _semicolon; 5174 Token get endToken => _semicolon;
5175 5175
5176 /** 5176 /**
5177 * Return the fields being declared. 5177 * Return the fields being declared.
5178 * @return the fields being declared 5178 * @return the fields being declared
5179 */ 5179 */
5180 VariableDeclarationList get fields => _fieldList; 5180 VariableDeclarationList get fields => _fieldList;
5181 5181
5182 /** 5182 /**
5183 * Return the token representing the 'static' keyword, or {@code null} if the fields are not 5183 * Return the token representing the 'static' keyword, or `null` if the fields are not
5184 * static. 5184 * static.
5185 * @return the token representing the 'static' keyword 5185 * @return the token representing the 'static' keyword
5186 */ 5186 */
5187 Token get keyword => _keyword; 5187 Token get keyword => _keyword;
5188 5188
5189 /** 5189 /**
5190 * Return the semicolon terminating the declaration. 5190 * Return the semicolon terminating the declaration.
5191 * @return the semicolon terminating the declaration 5191 * @return the semicolon terminating the declaration
5192 */ 5192 */
5193 Token get semicolon => _semicolon; 5193 Token get semicolon => _semicolon;
5194 5194
5195 /** 5195 /**
5196 * Return {@code true} if the fields are static. 5196 * Return `true` if the fields are static.
5197 * @return {@code true} if the fields are declared to be static 5197 * @return `true` if the fields are declared to be static
5198 */ 5198 */
5199 bool isStatic() => _keyword != null; 5199 bool isStatic() => _keyword != null;
5200 5200
5201 /** 5201 /**
5202 * Set the fields being declared to the given list of variables. 5202 * Set the fields being declared to the given list of variables.
5203 * @param fieldList the fields being declared 5203 * @param fieldList the fields being declared
5204 */ 5204 */
5205 void set fields(VariableDeclarationList fieldList) { 5205 void set fields(VariableDeclarationList fieldList) {
5206 fieldList = becomeParentOf(fieldList); 5206 fieldList = becomeParentOf(fieldList);
5207 } 5207 }
(...skipping 18 matching lines...) Expand all
5226 safelyVisitChild(_fieldList, visitor); 5226 safelyVisitChild(_fieldList, visitor);
5227 } 5227 }
5228 Token get firstTokenAfterCommentAndMetadata { 5228 Token get firstTokenAfterCommentAndMetadata {
5229 if (_keyword != null) { 5229 if (_keyword != null) {
5230 return _keyword; 5230 return _keyword;
5231 } 5231 }
5232 return _fieldList.beginToken; 5232 return _fieldList.beginToken;
5233 } 5233 }
5234 } 5234 }
5235 /** 5235 /**
5236 * Instances of the class {@code FieldFormalParameter} represent a field formal parameter. 5236 * Instances of the class `FieldFormalParameter` represent a field formal parame ter.
5237 * <pre> 5237 * <pre>
5238 * fieldFormalParameter ::= 5238 * fieldFormalParameter ::=
5239 * ('final' {@link TypeName type} | 'const' {@link TypeName type} | 'var' | {@li nk TypeName type})? 'this' '.' {@link SimpleIdentifier identifier}</pre> 5239 * ('final' [TypeName type] | 'const' [TypeName type] | 'var' | [TypeName type]) ? 'this' '.' [SimpleIdentifier identifier]</pre>
5240 * @coverage dart.engine.ast 5240 * @coverage dart.engine.ast
5241 */ 5241 */
5242 class FieldFormalParameter extends NormalFormalParameter { 5242 class FieldFormalParameter extends NormalFormalParameter {
5243 5243
5244 /** 5244 /**
5245 * The token representing either the 'final', 'const' or 'var' keyword, or {@c ode null} if no 5245 * The token representing either the 'final', 'const' or 'var' keyword, or `nu ll` if no
5246 * keyword was used. 5246 * keyword was used.
5247 */ 5247 */
5248 Token _keyword; 5248 Token _keyword;
5249 5249
5250 /** 5250 /**
5251 * The name of the declared type of the parameter, or {@code null} if the para meter does not have 5251 * The name of the declared type of the parameter, or `null` if the parameter does not have
5252 * a declared type. 5252 * a declared type.
5253 */ 5253 */
5254 TypeName _type; 5254 TypeName _type;
5255 5255
5256 /** 5256 /**
5257 * The token representing the 'this' keyword. 5257 * The token representing the 'this' keyword.
5258 */ 5258 */
5259 Token _thisToken; 5259 Token _thisToken;
5260 5260
5261 /** 5261 /**
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
5314 */ 5314 */
5315 Token get period => _period; 5315 Token get period => _period;
5316 5316
5317 /** 5317 /**
5318 * Return the token representing the 'this' keyword. 5318 * Return the token representing the 'this' keyword.
5319 * @return the token representing the 'this' keyword 5319 * @return the token representing the 'this' keyword
5320 */ 5320 */
5321 Token get thisToken => _thisToken; 5321 Token get thisToken => _thisToken;
5322 5322
5323 /** 5323 /**
5324 * Return the name of the declared type of the parameter, or {@code null} if t he parameter does 5324 * Return the name of the declared type of the parameter, or `null` if the par ameter does
5325 * not have a declared type. 5325 * not have a declared type.
5326 * @return the name of the declared type of the parameter 5326 * @return the name of the declared type of the parameter
5327 */ 5327 */
5328 TypeName get type => _type; 5328 TypeName get type => _type;
5329 bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.CONST); 5329 bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.CONST);
5330 bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.FINAL); 5330 bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.FINAL);
5331 5331
5332 /** 5332 /**
5333 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token. 5333 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
5334 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 5334 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
(...skipping 25 matching lines...) Expand all
5360 void set type(TypeName typeName) { 5360 void set type(TypeName typeName) {
5361 _type = becomeParentOf(typeName); 5361 _type = becomeParentOf(typeName);
5362 } 5362 }
5363 void visitChildren(ASTVisitor<Object> visitor) { 5363 void visitChildren(ASTVisitor<Object> visitor) {
5364 super.visitChildren(visitor); 5364 super.visitChildren(visitor);
5365 safelyVisitChild(_type, visitor); 5365 safelyVisitChild(_type, visitor);
5366 safelyVisitChild(identifier, visitor); 5366 safelyVisitChild(identifier, visitor);
5367 } 5367 }
5368 } 5368 }
5369 /** 5369 /**
5370 * Instances of the class {@code ForEachStatement} represent a for-each statemen t. 5370 * Instances of the class `ForEachStatement` represent a for-each statement.
5371 * <pre> 5371 * <pre>
5372 * forEachStatement ::= 5372 * forEachStatement ::=
5373 * 'for' '(' {@link SimpleFormalParameter loopParameter} 'in' {@link Expression iterator} ')' {@link Block body}</pre> 5373 * 'for' '(' [SimpleFormalParameter loopParameter] 'in' [Expression iterator] ') ' [Block body]</pre>
5374 * @coverage dart.engine.ast 5374 * @coverage dart.engine.ast
5375 */ 5375 */
5376 class ForEachStatement extends Statement { 5376 class ForEachStatement extends Statement {
5377 5377
5378 /** 5378 /**
5379 * The token representing the 'for' keyword. 5379 * The token representing the 'for' keyword.
5380 */ 5380 */
5381 Token _forKeyword; 5381 Token _forKeyword;
5382 5382
5383 /** 5383 /**
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
5540 void set rightParenthesis(Token rightParenthesis2) { 5540 void set rightParenthesis(Token rightParenthesis2) {
5541 this._rightParenthesis = rightParenthesis2; 5541 this._rightParenthesis = rightParenthesis2;
5542 } 5542 }
5543 void visitChildren(ASTVisitor<Object> visitor) { 5543 void visitChildren(ASTVisitor<Object> visitor) {
5544 safelyVisitChild(_loopVariable, visitor); 5544 safelyVisitChild(_loopVariable, visitor);
5545 safelyVisitChild(_iterator, visitor); 5545 safelyVisitChild(_iterator, visitor);
5546 safelyVisitChild(_body, visitor); 5546 safelyVisitChild(_body, visitor);
5547 } 5547 }
5548 } 5548 }
5549 /** 5549 /**
5550 * Instances of the class {@code ForStatement} represent a for statement. 5550 * Instances of the class `ForStatement` represent a for statement.
5551 * <pre> 5551 * <pre>
5552 * forStatement ::= 5552 * forStatement ::=
5553 * 'for' '(' forLoopParts ')' {@link Statement statement}forLoopParts ::= 5553 * 'for' '(' forLoopParts ')' [Statement statement]forLoopParts ::=
5554 * forInitializerStatement ';' {@link Expression expression}? ';' {@link Express ion expressionList}? 5554 * forInitializerStatement ';' [Expression expression]? ';' [Expression expressi onList]?
5555 * forInitializerStatement ::={@link DefaultFormalParameter initializedVariableD eclaration}| {@link Expression expression}? 5555 * forInitializerStatement ::=[DefaultFormalParameter initializedVariableDeclara tion]| [Expression expression]?
5556 * </pre> 5556 * </pre>
5557 * @coverage dart.engine.ast 5557 * @coverage dart.engine.ast
5558 */ 5558 */
5559 class ForStatement extends Statement { 5559 class ForStatement extends Statement {
5560 5560
5561 /** 5561 /**
5562 * The token representing the 'for' keyword. 5562 * The token representing the 'for' keyword.
5563 */ 5563 */
5564 Token _forKeyword; 5564 Token _forKeyword;
5565 5565
5566 /** 5566 /**
5567 * The left parenthesis. 5567 * The left parenthesis.
5568 */ 5568 */
5569 Token _leftParenthesis; 5569 Token _leftParenthesis;
5570 5570
5571 /** 5571 /**
5572 * The declaration of the loop variables, or {@code null} if there are no vari ables. Note that a 5572 * The declaration of the loop variables, or `null` if there are no variables. Note that a
5573 * for statement cannot have both a variable list and an initialization expres sion, but can 5573 * for statement cannot have both a variable list and an initialization expres sion, but can
5574 * validly have neither. 5574 * validly have neither.
5575 */ 5575 */
5576 VariableDeclarationList _variableList; 5576 VariableDeclarationList _variableList;
5577 5577
5578 /** 5578 /**
5579 * The initialization expression, or {@code null} if there is no initializatio n expression. Note 5579 * The initialization expression, or `null` if there is no initialization expr ession. Note
5580 * that a for statement cannot have both a variable list and an initialization expression, but can 5580 * that a for statement cannot have both a variable list and an initialization expression, but can
5581 * validly have neither. 5581 * validly have neither.
5582 */ 5582 */
5583 Expression _initialization; 5583 Expression _initialization;
5584 5584
5585 /** 5585 /**
5586 * The semicolon separating the initializer and the condition. 5586 * The semicolon separating the initializer and the condition.
5587 */ 5587 */
5588 Token _leftSeparator; 5588 Token _leftSeparator;
5589 5589
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
5669 Expression get condition => _condition; 5669 Expression get condition => _condition;
5670 Token get endToken => _body.endToken; 5670 Token get endToken => _body.endToken;
5671 5671
5672 /** 5672 /**
5673 * Return the token representing the 'for' keyword. 5673 * Return the token representing the 'for' keyword.
5674 * @return the token representing the 'for' keyword 5674 * @return the token representing the 'for' keyword
5675 */ 5675 */
5676 Token get forKeyword => _forKeyword; 5676 Token get forKeyword => _forKeyword;
5677 5677
5678 /** 5678 /**
5679 * Return the initialization expression, or {@code null} if there is no initia lization expression. 5679 * Return the initialization expression, or `null` if there is no initializati on expression.
5680 * @return the initialization expression 5680 * @return the initialization expression
5681 */ 5681 */
5682 Expression get initialization => _initialization; 5682 Expression get initialization => _initialization;
5683 5683
5684 /** 5684 /**
5685 * Return the left parenthesis. 5685 * Return the left parenthesis.
5686 * @return the left parenthesis 5686 * @return the left parenthesis
5687 */ 5687 */
5688 Token get leftParenthesis => _leftParenthesis; 5688 Token get leftParenthesis => _leftParenthesis;
5689 5689
(...skipping 15 matching lines...) Expand all
5705 */ 5705 */
5706 Token get rightSeparator => _rightSeparator; 5706 Token get rightSeparator => _rightSeparator;
5707 5707
5708 /** 5708 /**
5709 * Return the list of expressions run after each execution of the loop body. 5709 * Return the list of expressions run after each execution of the loop body.
5710 * @return the list of expressions run after each execution of the loop body 5710 * @return the list of expressions run after each execution of the loop body
5711 */ 5711 */
5712 NodeList<Expression> get updaters => _updaters; 5712 NodeList<Expression> get updaters => _updaters;
5713 5713
5714 /** 5714 /**
5715 * Return the declaration of the loop variables, or {@code null} if there are no variables. 5715 * Return the declaration of the loop variables, or `null` if there are no var iables.
5716 * @return the declaration of the loop variables, or {@code null} if there are no variables 5716 * @return the declaration of the loop variables, or `null` if there are no va riables
5717 */ 5717 */
5718 VariableDeclarationList get variables => _variableList; 5718 VariableDeclarationList get variables => _variableList;
5719 5719
5720 /** 5720 /**
5721 * Set the body of the loop to the given statement. 5721 * Set the body of the loop to the given statement.
5722 * @param body the body of the loop 5722 * @param body the body of the loop
5723 */ 5723 */
5724 void set body(Statement body2) { 5724 void set body(Statement body2) {
5725 this._body = becomeParentOf(body2); 5725 this._body = becomeParentOf(body2);
5726 } 5726 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
5790 } 5790 }
5791 void visitChildren(ASTVisitor<Object> visitor) { 5791 void visitChildren(ASTVisitor<Object> visitor) {
5792 safelyVisitChild(_variableList, visitor); 5792 safelyVisitChild(_variableList, visitor);
5793 safelyVisitChild(_initialization, visitor); 5793 safelyVisitChild(_initialization, visitor);
5794 safelyVisitChild(_condition, visitor); 5794 safelyVisitChild(_condition, visitor);
5795 _updaters.accept(visitor); 5795 _updaters.accept(visitor);
5796 safelyVisitChild(_body, visitor); 5796 safelyVisitChild(_body, visitor);
5797 } 5797 }
5798 } 5798 }
5799 /** 5799 /**
5800 * The abstract class {@code FormalParameter} defines the behavior of objects re presenting a 5800 * The abstract class `FormalParameter` defines the behavior of objects represen ting a
5801 * parameter to a function. 5801 * parameter to a function.
5802 * <pre> 5802 * <pre>
5803 * formalParameter ::={@link NormalFormalParameter normalFormalParameter}| {@lin k DefaultFormalParameter namedFormalParameter}| {@link DefaultFormalParameter op tionalFormalParameter}</pre> 5803 * formalParameter ::=[NormalFormalParameter normalFormalParameter]| [DefaultFor malParameter namedFormalParameter]| [DefaultFormalParameter optionalFormalParame ter]</pre>
5804 * @coverage dart.engine.ast 5804 * @coverage dart.engine.ast
5805 */ 5805 */
5806 abstract class FormalParameter extends ASTNode { 5806 abstract class FormalParameter extends ASTNode {
5807 5807
5808 /** 5808 /**
5809 * Return the element representing this parameter, or {@code null} if this par ameter has not been 5809 * Return the element representing this parameter, or `null` if this parameter has not been
5810 * resolved. 5810 * resolved.
5811 * @return the element representing this parameter 5811 * @return the element representing this parameter
5812 */ 5812 */
5813 ParameterElement get element { 5813 ParameterElement get element {
5814 SimpleIdentifier identifier = this.identifier; 5814 SimpleIdentifier identifier = this.identifier;
5815 if (identifier == null) { 5815 if (identifier == null) {
5816 return null; 5816 return null;
5817 } 5817 }
5818 return identifier.element as ParameterElement; 5818 return identifier.element as ParameterElement;
5819 } 5819 }
5820 5820
5821 /** 5821 /**
5822 * Return the name of the parameter being declared. 5822 * Return the name of the parameter being declared.
5823 * @return the name of the parameter being declared 5823 * @return the name of the parameter being declared
5824 */ 5824 */
5825 SimpleIdentifier get identifier; 5825 SimpleIdentifier get identifier;
5826 5826
5827 /** 5827 /**
5828 * Return the kind of this parameter. 5828 * Return the kind of this parameter.
5829 * @return the kind of this parameter 5829 * @return the kind of this parameter
5830 */ 5830 */
5831 ParameterKind get kind; 5831 ParameterKind get kind;
5832 } 5832 }
5833 /** 5833 /**
5834 * Instances of the class {@code FormalParameterList} represent the formal param eter list of a 5834 * Instances of the class `FormalParameterList` represent the formal parameter l ist of a
5835 * method declaration, function declaration, or function type alias. 5835 * method declaration, function declaration, or function type alias.
5836 * <p> 5836 *
5837 * While the grammar requires all optional formal parameters to follow all of th e normal formal 5837 * While the grammar requires all optional formal parameters to follow all of th e normal formal
5838 * parameters and at most one grouping of optional formal parameters, this class does not enforce 5838 * parameters and at most one grouping of optional formal parameters, this class does not enforce
5839 * those constraints. All parameters are flattened into a single list, which can have any or all 5839 * those constraints. All parameters are flattened into a single list, which can have any or all
5840 * kinds of parameters (normal, named, and positional) in any order. 5840 * kinds of parameters (normal, named, and positional) in any order.
5841 * <pre> 5841 * <pre>
5842 * formalParameterList ::= 5842 * formalParameterList ::=
5843 * '(' ')' 5843 * '(' ')'
5844 * | '(' normalFormalParameters (',' optionalFormalParameters)? ')' 5844 * | '(' normalFormalParameters (',' optionalFormalParameters)? ')'
5845 * | '(' optionalFormalParameters ')' 5845 * | '(' optionalFormalParameters ')'
5846 * normalFormalParameters ::={@link NormalFormalParameter normalFormalParameter} (',' {@link NormalFormalParameter normalFormalParameter}) 5846 * normalFormalParameters ::=[NormalFormalParameter normalFormalParameter] (',' [NormalFormalParameter normalFormalParameter])
5847 * optionalFormalParameters ::= 5847 * optionalFormalParameters ::=
5848 * optionalPositionalFormalParameters 5848 * optionalPositionalFormalParameters
5849 * | namedFormalParameters 5849 * | namedFormalParameters
5850 * optionalPositionalFormalParameters ::= 5850 * optionalPositionalFormalParameters ::=
5851 * '\[' {@link DefaultFormalParameter positionalFormalParameter} (',' {@link Def aultFormalParameter positionalFormalParameter})* '\]' 5851 * '\[' [DefaultFormalParameter positionalFormalParameter] (',' [DefaultFormalPa rameter positionalFormalParameter])* '\]'
5852 * namedFormalParameters ::= 5852 * namedFormalParameters ::=
5853 * '{' {@link DefaultFormalParameter namedFormalParameter} (',' {@link DefaultFo rmalParameter namedFormalParameter})* '}' 5853 * '{' [DefaultFormalParameter namedFormalParameter] (',' [DefaultFormalParamete r namedFormalParameter])* '}'
5854 * </pre> 5854 * </pre>
5855 * @coverage dart.engine.ast 5855 * @coverage dart.engine.ast
5856 */ 5856 */
5857 class FormalParameterList extends ASTNode { 5857 class FormalParameterList extends ASTNode {
5858 5858
5859 /** 5859 /**
5860 * The left parenthesis. 5860 * The left parenthesis.
5861 */ 5861 */
5862 Token _leftParenthesis; 5862 Token _leftParenthesis;
5863 5863
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
5905 * @param leftDelimiter the left delimiter introducing the optional parameters 5905 * @param leftDelimiter the left delimiter introducing the optional parameters
5906 * @param rightDelimiter the right delimiter introducing the optional paramete rs 5906 * @param rightDelimiter the right delimiter introducing the optional paramete rs
5907 * @param rightParenthesis the right parenthesis 5907 * @param rightParenthesis the right parenthesis
5908 */ 5908 */
5909 FormalParameterList({Token leftParenthesis, List<FormalParameter> parameters, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis}) : this.full( leftParenthesis, parameters, leftDelimiter, rightDelimiter, rightParenthesis); 5909 FormalParameterList({Token leftParenthesis, List<FormalParameter> parameters, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis}) : this.full( leftParenthesis, parameters, leftDelimiter, rightDelimiter, rightParenthesis);
5910 accept(ASTVisitor visitor) => visitor.visitFormalParameterList(this); 5910 accept(ASTVisitor visitor) => visitor.visitFormalParameterList(this);
5911 Token get beginToken => _leftParenthesis; 5911 Token get beginToken => _leftParenthesis;
5912 5912
5913 /** 5913 /**
5914 * Return an array containing the elements representing the parameters in this list. The array 5914 * Return an array containing the elements representing the parameters in this list. The array
5915 * will contain {@code null}s if the parameters in this list have not been res olved. 5915 * will contain `null`s if the parameters in this list have not been resolved.
5916 * @return the elements representing the parameters in this list 5916 * @return the elements representing the parameters in this list
5917 */ 5917 */
5918 List<ParameterElement> get elements { 5918 List<ParameterElement> get elements {
5919 int count = _parameters.length; 5919 int count = _parameters.length;
5920 List<ParameterElement> types = new List<ParameterElement>(count); 5920 List<ParameterElement> types = new List<ParameterElement>(count);
5921 for (int i = 0; i < count; i++) { 5921 for (int i = 0; i < count; i++) {
5922 types[i] = _parameters[i].element; 5922 types[i] = _parameters[i].element;
5923 } 5923 }
5924 return types; 5924 return types;
5925 } 5925 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
5990 * @param parenthesis the right parenthesis 5990 * @param parenthesis the right parenthesis
5991 */ 5991 */
5992 void set rightParenthesis(Token parenthesis) { 5992 void set rightParenthesis(Token parenthesis) {
5993 _rightParenthesis = parenthesis; 5993 _rightParenthesis = parenthesis;
5994 } 5994 }
5995 void visitChildren(ASTVisitor<Object> visitor) { 5995 void visitChildren(ASTVisitor<Object> visitor) {
5996 _parameters.accept(visitor); 5996 _parameters.accept(visitor);
5997 } 5997 }
5998 } 5998 }
5999 /** 5999 /**
6000 * The abstract class {@code FunctionBody} defines the behavior common to object s representing the 6000 * The abstract class `FunctionBody` defines the behavior common to objects repr esenting the
6001 * body of a function or method. 6001 * body of a function or method.
6002 * <pre> 6002 * <pre>
6003 * functionBody ::={@link BlockFunctionBody blockFunctionBody}| {@link EmptyFunc tionBody emptyFunctionBody}| {@link ExpressionFunctionBody expressionFunctionBod y}</pre> 6003 * functionBody ::=[BlockFunctionBody blockFunctionBody]| [EmptyFunctionBody emp tyFunctionBody]| [ExpressionFunctionBody expressionFunctionBody]</pre>
6004 * @coverage dart.engine.ast 6004 * @coverage dart.engine.ast
6005 */ 6005 */
6006 abstract class FunctionBody extends ASTNode { 6006 abstract class FunctionBody extends ASTNode {
6007 } 6007 }
6008 /** 6008 /**
6009 * Instances of the class {@code FunctionDeclaration} wrap a {@link FunctionExpr ession function 6009 * Instances of the class `FunctionDeclaration` wrap a [FunctionExpression funct ion
6010 * expression} as a top-level declaration. 6010 * expression] as a top-level declaration.
6011 * <pre> 6011 * <pre>
6012 * functionDeclaration ::= 6012 * functionDeclaration ::=
6013 * 'external' functionSignature 6013 * 'external' functionSignature
6014 * | functionSignature {@link FunctionBody functionBody}functionSignature ::={@l ink Type returnType}? ('get' | 'set')? {@link SimpleIdentifier functionName} {@l ink FormalParameterList formalParameterList}</pre> 6014 * | functionSignature [FunctionBody functionBody]functionSignature ::=[Type ret urnType]? ('get' | 'set')? [SimpleIdentifier functionName] [FormalParameterList formalParameterList]</pre>
6015 * @coverage dart.engine.ast 6015 * @coverage dart.engine.ast
6016 */ 6016 */
6017 class FunctionDeclaration extends CompilationUnitMember { 6017 class FunctionDeclaration extends CompilationUnitMember {
6018 6018
6019 /** 6019 /**
6020 * The token representing the 'external' keyword, or {@code null} if this is n ot an external 6020 * The token representing the 'external' keyword, or `null` if this is not an external
6021 * function. 6021 * function.
6022 */ 6022 */
6023 Token _externalKeyword; 6023 Token _externalKeyword;
6024 6024
6025 /** 6025 /**
6026 * The return type of the function, or {@code null} if no return type was decl ared. 6026 * The return type of the function, or `null` if no return type was declared.
6027 */ 6027 */
6028 TypeName _returnType; 6028 TypeName _returnType;
6029 6029
6030 /** 6030 /**
6031 * The token representing the 'get' or 'set' keyword, or {@code null} if this is a function 6031 * The token representing the 'get' or 'set' keyword, or `null` if this is a f unction
6032 * declaration rather than a property declaration. 6032 * declaration rather than a property declaration.
6033 */ 6033 */
6034 Token _propertyKeyword; 6034 Token _propertyKeyword;
6035 6035
6036 /** 6036 /**
6037 * The name of the function, or {@code null} if the function is not named. 6037 * The name of the function, or `null` if the function is not named.
6038 */ 6038 */
6039 SimpleIdentifier _name; 6039 SimpleIdentifier _name;
6040 6040
6041 /** 6041 /**
6042 * The function expression being wrapped. 6042 * The function expression being wrapped.
6043 */ 6043 */
6044 FunctionExpression _functionExpression; 6044 FunctionExpression _functionExpression;
6045 6045
6046 /** 6046 /**
6047 * Initialize a newly created function declaration. 6047 * Initialize a newly created function declaration.
(...skipping 22 matching lines...) Expand all
6070 * @param propertyKeyword the token representing the 'get' or 'set' keyword 6070 * @param propertyKeyword the token representing the 'get' or 'set' keyword
6071 * @param name the name of the function 6071 * @param name the name of the function
6072 * @param functionExpression the function expression being wrapped 6072 * @param functionExpression the function expression being wrapped
6073 */ 6073 */
6074 FunctionDeclaration({Comment comment, List<Annotation> metadata, Token externa lKeyword, TypeName returnType, Token propertyKeyword, SimpleIdentifier name, Fun ctionExpression functionExpression}) : this.full(comment, metadata, externalKeyw ord, returnType, propertyKeyword, name, functionExpression); 6074 FunctionDeclaration({Comment comment, List<Annotation> metadata, Token externa lKeyword, TypeName returnType, Token propertyKeyword, SimpleIdentifier name, Fun ctionExpression functionExpression}) : this.full(comment, metadata, externalKeyw ord, returnType, propertyKeyword, name, functionExpression);
6075 accept(ASTVisitor visitor) => visitor.visitFunctionDeclaration(this); 6075 accept(ASTVisitor visitor) => visitor.visitFunctionDeclaration(this);
6076 ExecutableElement get element => _name != null ? (_name.element as ExecutableE lement) : null; 6076 ExecutableElement get element => _name != null ? (_name.element as ExecutableE lement) : null;
6077 Token get endToken => _functionExpression.endToken; 6077 Token get endToken => _functionExpression.endToken;
6078 6078
6079 /** 6079 /**
6080 * Return the token representing the 'external' keyword, or {@code null} if th is is not an 6080 * Return the token representing the 'external' keyword, or `null` if this is not an
6081 * external function. 6081 * external function.
6082 * @return the token representing the 'external' keyword 6082 * @return the token representing the 'external' keyword
6083 */ 6083 */
6084 Token get externalKeyword => _externalKeyword; 6084 Token get externalKeyword => _externalKeyword;
6085 6085
6086 /** 6086 /**
6087 * Return the function expression being wrapped. 6087 * Return the function expression being wrapped.
6088 * @return the function expression being wrapped 6088 * @return the function expression being wrapped
6089 */ 6089 */
6090 FunctionExpression get functionExpression => _functionExpression; 6090 FunctionExpression get functionExpression => _functionExpression;
6091 6091
6092 /** 6092 /**
6093 * Return the name of the function, or {@code null} if the function is not nam ed. 6093 * Return the name of the function, or `null` if the function is not named.
6094 * @return the name of the function 6094 * @return the name of the function
6095 */ 6095 */
6096 SimpleIdentifier get name => _name; 6096 SimpleIdentifier get name => _name;
6097 6097
6098 /** 6098 /**
6099 * Return the token representing the 'get' or 'set' keyword, or {@code null} i f this is a function 6099 * Return the token representing the 'get' or 'set' keyword, or `null` if this is a function
6100 * declaration rather than a property declaration. 6100 * declaration rather than a property declaration.
6101 * @return the token representing the 'get' or 'set' keyword 6101 * @return the token representing the 'get' or 'set' keyword
6102 */ 6102 */
6103 Token get propertyKeyword => _propertyKeyword; 6103 Token get propertyKeyword => _propertyKeyword;
6104 6104
6105 /** 6105 /**
6106 * Return the return type of the function, or {@code null} if no return type w as declared. 6106 * Return the return type of the function, or `null` if no return type was dec lared.
6107 * @return the return type of the function 6107 * @return the return type of the function
6108 */ 6108 */
6109 TypeName get returnType => _returnType; 6109 TypeName get returnType => _returnType;
6110 6110
6111 /** 6111 /**
6112 * Return {@code true} if this function declares a getter. 6112 * Return `true` if this function declares a getter.
6113 * @return {@code true} if this function declares a getter 6113 * @return `true` if this function declares a getter
6114 */ 6114 */
6115 bool isGetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET); 6115 bool isGetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET);
6116 6116
6117 /** 6117 /**
6118 * Return {@code true} if this function declares a setter. 6118 * Return `true` if this function declares a setter.
6119 * @return {@code true} if this function declares a setter 6119 * @return `true` if this function declares a setter
6120 */ 6120 */
6121 bool isSetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET); 6121 bool isSetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET);
6122 6122
6123 /** 6123 /**
6124 * Set the token representing the 'external' keyword to the given token. 6124 * Set the token representing the 'external' keyword to the given token.
6125 * @param externalKeyword the token representing the 'external' keyword 6125 * @param externalKeyword the token representing the 'external' keyword
6126 */ 6126 */
6127 void set externalKeyword(Token externalKeyword2) { 6127 void set externalKeyword(Token externalKeyword2) {
6128 this._externalKeyword = externalKeyword2; 6128 this._externalKeyword = externalKeyword2;
6129 } 6129 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
6173 return _returnType.beginToken; 6173 return _returnType.beginToken;
6174 } else if (_propertyKeyword != null) { 6174 } else if (_propertyKeyword != null) {
6175 return _propertyKeyword; 6175 return _propertyKeyword;
6176 } else if (_name != null) { 6176 } else if (_name != null) {
6177 return _name.beginToken; 6177 return _name.beginToken;
6178 } 6178 }
6179 return _functionExpression.beginToken; 6179 return _functionExpression.beginToken;
6180 } 6180 }
6181 } 6181 }
6182 /** 6182 /**
6183 * Instances of the class {@code FunctionDeclarationStatement} wrap a {@link Fun ctionDeclarationfunction declaration} as a statement. 6183 * Instances of the class `FunctionDeclarationStatement` wrap a [FunctionDeclara tionfunction declaration] as a statement.
6184 * @coverage dart.engine.ast 6184 * @coverage dart.engine.ast
6185 */ 6185 */
6186 class FunctionDeclarationStatement extends Statement { 6186 class FunctionDeclarationStatement extends Statement {
6187 6187
6188 /** 6188 /**
6189 * The function declaration being wrapped. 6189 * The function declaration being wrapped.
6190 */ 6190 */
6191 FunctionDeclaration _functionDeclaration; 6191 FunctionDeclaration _functionDeclaration;
6192 6192
6193 /** 6193 /**
(...skipping 24 matching lines...) Expand all
6218 * @param functionDeclaration the function declaration being wrapped 6218 * @param functionDeclaration the function declaration being wrapped
6219 */ 6219 */
6220 void set functionExpression(FunctionDeclaration functionDeclaration2) { 6220 void set functionExpression(FunctionDeclaration functionDeclaration2) {
6221 this._functionDeclaration = becomeParentOf(functionDeclaration2); 6221 this._functionDeclaration = becomeParentOf(functionDeclaration2);
6222 } 6222 }
6223 void visitChildren(ASTVisitor<Object> visitor) { 6223 void visitChildren(ASTVisitor<Object> visitor) {
6224 safelyVisitChild(_functionDeclaration, visitor); 6224 safelyVisitChild(_functionDeclaration, visitor);
6225 } 6225 }
6226 } 6226 }
6227 /** 6227 /**
6228 * Instances of the class {@code FunctionExpression} represent a function expres sion. 6228 * Instances of the class `FunctionExpression` represent a function expression.
6229 * <pre> 6229 * <pre>
6230 * functionExpression ::={@link FormalParameterList formalParameterList} {@link FunctionBody functionBody}</pre> 6230 * functionExpression ::=[FormalParameterList formalParameterList] [FunctionBody functionBody]</pre>
6231 * @coverage dart.engine.ast 6231 * @coverage dart.engine.ast
6232 */ 6232 */
6233 class FunctionExpression extends Expression { 6233 class FunctionExpression extends Expression {
6234 6234
6235 /** 6235 /**
6236 * The parameters associated with the function. 6236 * The parameters associated with the function.
6237 */ 6237 */
6238 FormalParameterList _parameters; 6238 FormalParameterList _parameters;
6239 6239
6240 /** 6240 /**
6241 * The body of the function, or {@code null} if this is an external function. 6241 * The body of the function, or `null` if this is an external function.
6242 */ 6242 */
6243 FunctionBody _body; 6243 FunctionBody _body;
6244 6244
6245 /** 6245 /**
6246 * The element associated with the function, or {@code null} if the AST struct ure has not been 6246 * The element associated with the function, or `null` if the AST structure ha s not been
6247 * resolved. 6247 * resolved.
6248 */ 6248 */
6249 ExecutableElement _element; 6249 ExecutableElement _element;
6250 6250
6251 /** 6251 /**
6252 * Initialize a newly created function declaration. 6252 * Initialize a newly created function declaration.
6253 * @param parameters the parameters associated with the function 6253 * @param parameters the parameters associated with the function
6254 * @param body the body of the function 6254 * @param body the body of the function
6255 */ 6255 */
6256 FunctionExpression.full(FormalParameterList parameters, FunctionBody body) { 6256 FunctionExpression.full(FormalParameterList parameters, FunctionBody body) {
(...skipping 11 matching lines...) Expand all
6268 Token get beginToken { 6268 Token get beginToken {
6269 if (_parameters != null) { 6269 if (_parameters != null) {
6270 return _parameters.beginToken; 6270 return _parameters.beginToken;
6271 } else if (_body != null) { 6271 } else if (_body != null) {
6272 return _body.beginToken; 6272 return _body.beginToken;
6273 } 6273 }
6274 throw new IllegalStateException("Non-external functions must have a body"); 6274 throw new IllegalStateException("Non-external functions must have a body");
6275 } 6275 }
6276 6276
6277 /** 6277 /**
6278 * Return the body of the function, or {@code null} if this is an external fun ction. 6278 * Return the body of the function, or `null` if this is an external function.
6279 * @return the body of the function 6279 * @return the body of the function
6280 */ 6280 */
6281 FunctionBody get body => _body; 6281 FunctionBody get body => _body;
6282 6282
6283 /** 6283 /**
6284 * Return the element associated with this function, or {@code null} if the AS T structure has not 6284 * Return the element associated with this function, or `null` if the AST stru cture has not
6285 * been resolved. 6285 * been resolved.
6286 * @return the element associated with this function 6286 * @return the element associated with this function
6287 */ 6287 */
6288 ExecutableElement get element => _element; 6288 ExecutableElement get element => _element;
6289 Token get endToken { 6289 Token get endToken {
6290 if (_body != null) { 6290 if (_body != null) {
6291 return _body.endToken; 6291 return _body.endToken;
6292 } else if (_parameters != null) { 6292 } else if (_parameters != null) {
6293 return _parameters.endToken; 6293 return _parameters.endToken;
6294 } 6294 }
(...skipping 28 matching lines...) Expand all
6323 */ 6323 */
6324 void set parameters(FormalParameterList parameters2) { 6324 void set parameters(FormalParameterList parameters2) {
6325 this._parameters = becomeParentOf(parameters2); 6325 this._parameters = becomeParentOf(parameters2);
6326 } 6326 }
6327 void visitChildren(ASTVisitor<Object> visitor) { 6327 void visitChildren(ASTVisitor<Object> visitor) {
6328 safelyVisitChild(_parameters, visitor); 6328 safelyVisitChild(_parameters, visitor);
6329 safelyVisitChild(_body, visitor); 6329 safelyVisitChild(_body, visitor);
6330 } 6330 }
6331 } 6331 }
6332 /** 6332 /**
6333 * Instances of the class {@code FunctionExpressionInvocation} represent the inv ocation of a 6333 * Instances of the class `FunctionExpressionInvocation` represent the invocatio n of a
6334 * function resulting from evaluating an expression. Invocations of methods and other forms of 6334 * function resulting from evaluating an expression. Invocations of methods and other forms of
6335 * functions are represented by {@link MethodInvocation method invocation} nodes . Invocations of 6335 * functions are represented by [MethodInvocation method invocation] nodes. Invo cations of
6336 * getters and setters are represented by either {@link PrefixedIdentifier prefi xed identifier} or{@link PropertyAccess property access} nodes. 6336 * getters and setters are represented by either [PrefixedIdentifier prefixed id entifier] or[PropertyAccess property access] nodes.
6337 * <pre> 6337 * <pre>
6338 * functionExpressionInvoction ::={@link Expression function} {@link ArgumentLis t argumentList}</pre> 6338 * functionExpressionInvoction ::=[Expression function] [ArgumentList argumentLi st]</pre>
6339 * @coverage dart.engine.ast 6339 * @coverage dart.engine.ast
6340 */ 6340 */
6341 class FunctionExpressionInvocation extends Expression { 6341 class FunctionExpressionInvocation extends Expression {
6342 6342
6343 /** 6343 /**
6344 * The expression producing the function being invoked. 6344 * The expression producing the function being invoked.
6345 */ 6345 */
6346 Expression _function; 6346 Expression _function;
6347 6347
6348 /** 6348 /**
6349 * The list of arguments to the function. 6349 * The list of arguments to the function.
6350 */ 6350 */
6351 ArgumentList _argumentList; 6351 ArgumentList _argumentList;
6352 6352
6353 /** 6353 /**
6354 * The element associated with the function being invoked based on static type information, or{@code null} if the AST structure has not been resolved or the f unction could not be resolved. 6354 * The element associated with the function being invoked based on static type information, or`null` if the AST structure has not been resolved or the functio n could not be resolved.
6355 */ 6355 */
6356 ExecutableElement _staticElement; 6356 ExecutableElement _staticElement;
6357 6357
6358 /** 6358 /**
6359 * The element associated with the function being invoked based on propagated type information, or{@code null} if the AST structure has not been resolved or t he function could not be resolved. 6359 * The element associated with the function being invoked based on propagated type information, or`null` if the AST structure has not been resolved or the fun ction could not be resolved.
6360 */ 6360 */
6361 ExecutableElement _propagatedElement; 6361 ExecutableElement _propagatedElement;
6362 6362
6363 /** 6363 /**
6364 * Initialize a newly created function expression invocation. 6364 * Initialize a newly created function expression invocation.
6365 * @param function the expression producing the function being invoked 6365 * @param function the expression producing the function being invoked
6366 * @param argumentList the list of arguments to the method 6366 * @param argumentList the list of arguments to the method
6367 */ 6367 */
6368 FunctionExpressionInvocation.full(Expression function, ArgumentList argumentLi st) { 6368 FunctionExpressionInvocation.full(Expression function, ArgumentList argumentLi st) {
6369 this._function = becomeParentOf(function); 6369 this._function = becomeParentOf(function);
(...skipping 10 matching lines...) Expand all
6380 6380
6381 /** 6381 /**
6382 * Return the list of arguments to the method. 6382 * Return the list of arguments to the method.
6383 * @return the list of arguments to the method 6383 * @return the list of arguments to the method
6384 */ 6384 */
6385 ArgumentList get argumentList => _argumentList; 6385 ArgumentList get argumentList => _argumentList;
6386 Token get beginToken => _function.beginToken; 6386 Token get beginToken => _function.beginToken;
6387 6387
6388 /** 6388 /**
6389 * Return the element associated with the function being invoked based on prop agated type 6389 * Return the element associated with the function being invoked based on prop agated type
6390 * information, or {@code null} if the AST structure has not been resolved or the function could 6390 * information, or `null` if the AST structure has not been resolved or the fu nction could
6391 * not be resolved. One common example of the latter case is an expression who se value can change 6391 * not be resolved. One common example of the latter case is an expression who se value can change
6392 * over time. 6392 * over time.
6393 * @return the element associated with the function being invoked 6393 * @return the element associated with the function being invoked
6394 */ 6394 */
6395 ExecutableElement get element => _propagatedElement; 6395 ExecutableElement get element => _propagatedElement;
6396 Token get endToken => _argumentList.endToken; 6396 Token get endToken => _argumentList.endToken;
6397 6397
6398 /** 6398 /**
6399 * Return the expression producing the function being invoked. 6399 * Return the expression producing the function being invoked.
6400 * @return the expression producing the function being invoked 6400 * @return the expression producing the function being invoked
6401 */ 6401 */
6402 Expression get function => _function; 6402 Expression get function => _function;
6403 6403
6404 /** 6404 /**
6405 * Return the element associated with the function being invoked based on stat ic type information, 6405 * Return the element associated with the function being invoked based on stat ic type information,
6406 * or {@code null} if the AST structure has not been resolved or the function could not be 6406 * or `null` if the AST structure has not been resolved or the function could not be
6407 * resolved. One common example of the latter case is an expression whose valu e can change over 6407 * resolved. One common example of the latter case is an expression whose valu e can change over
6408 * time. 6408 * time.
6409 * @return the element associated with the function 6409 * @return the element associated with the function
6410 */ 6410 */
6411 ExecutableElement get staticElement => _staticElement; 6411 ExecutableElement get staticElement => _staticElement;
6412 6412
6413 /** 6413 /**
6414 * Set the list of arguments to the method to the given list. 6414 * Set the list of arguments to the method to the given list.
6415 * @param argumentList the list of arguments to the method 6415 * @param argumentList the list of arguments to the method
6416 */ 6416 */
(...skipping 25 matching lines...) Expand all
6442 */ 6442 */
6443 void set staticElement(ExecutableElement element) { 6443 void set staticElement(ExecutableElement element) {
6444 this._staticElement = element; 6444 this._staticElement = element;
6445 } 6445 }
6446 void visitChildren(ASTVisitor<Object> visitor) { 6446 void visitChildren(ASTVisitor<Object> visitor) {
6447 safelyVisitChild(_function, visitor); 6447 safelyVisitChild(_function, visitor);
6448 safelyVisitChild(_argumentList, visitor); 6448 safelyVisitChild(_argumentList, visitor);
6449 } 6449 }
6450 } 6450 }
6451 /** 6451 /**
6452 * Instances of the class {@code FunctionTypeAlias} represent a function type al ias. 6452 * Instances of the class `FunctionTypeAlias` represent a function type alias.
6453 * <pre> 6453 * <pre>
6454 * functionTypeAlias ::= 6454 * functionTypeAlias ::=
6455 * functionPrefix {@link TypeParameterList typeParameterList}? {@link FormalPara meterList formalParameterList} ';' 6455 * functionPrefix [TypeParameterList typeParameterList]? [FormalParameterList fo rmalParameterList] ';'
6456 * functionPrefix ::={@link TypeName returnType}? {@link SimpleIdentifier name}< /pre> 6456 * functionPrefix ::=[TypeName returnType]? [SimpleIdentifier name]</pre>
6457 * @coverage dart.engine.ast 6457 * @coverage dart.engine.ast
6458 */ 6458 */
6459 class FunctionTypeAlias extends TypeAlias { 6459 class FunctionTypeAlias extends TypeAlias {
6460 6460
6461 /** 6461 /**
6462 * The name of the return type of the function type being defined, or {@code n ull} if no return 6462 * The name of the return type of the function type being defined, or `null` i f no return
6463 * type was given. 6463 * type was given.
6464 */ 6464 */
6465 TypeName _returnType; 6465 TypeName _returnType;
6466 6466
6467 /** 6467 /**
6468 * The name of the function type being declared. 6468 * The name of the function type being declared.
6469 */ 6469 */
6470 SimpleIdentifier _name; 6470 SimpleIdentifier _name;
6471 6471
6472 /** 6472 /**
6473 * The type parameters for the function type, or {@code null} if the function type does not have 6473 * The type parameters for the function type, or `null` if the function type d oes not have
6474 * any type parameters. 6474 * any type parameters.
6475 */ 6475 */
6476 TypeParameterList _typeParameters; 6476 TypeParameterList _typeParameters;
6477 6477
6478 /** 6478 /**
6479 * The parameters associated with the function type. 6479 * The parameters associated with the function type.
6480 */ 6480 */
6481 FormalParameterList _parameters; 6481 FormalParameterList _parameters;
6482 6482
6483 /** 6483 /**
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
6519 */ 6519 */
6520 SimpleIdentifier get name => _name; 6520 SimpleIdentifier get name => _name;
6521 6521
6522 /** 6522 /**
6523 * Return the parameters associated with the function type. 6523 * Return the parameters associated with the function type.
6524 * @return the parameters associated with the function type 6524 * @return the parameters associated with the function type
6525 */ 6525 */
6526 FormalParameterList get parameters => _parameters; 6526 FormalParameterList get parameters => _parameters;
6527 6527
6528 /** 6528 /**
6529 * Return the name of the return type of the function type being defined, or { @code null} if no 6529 * Return the name of the return type of the function type being defined, or ` null` if no
6530 * return type was given. 6530 * return type was given.
6531 * @return the name of the return type of the function type being defined 6531 * @return the name of the return type of the function type being defined
6532 */ 6532 */
6533 TypeName get returnType => _returnType; 6533 TypeName get returnType => _returnType;
6534 6534
6535 /** 6535 /**
6536 * Return the type parameters for the function type, or {@code null} if the fu nction type does not 6536 * Return the type parameters for the function type, or `null` if the function type does not
6537 * have any type parameters. 6537 * have any type parameters.
6538 * @return the type parameters for the function type 6538 * @return the type parameters for the function type
6539 */ 6539 */
6540 TypeParameterList get typeParameters => _typeParameters; 6540 TypeParameterList get typeParameters => _typeParameters;
6541 6541
6542 /** 6542 /**
6543 * Set the name of the function type being declared to the given identifier. 6543 * Set the name of the function type being declared to the given identifier.
6544 * @param name the name of the function type being declared 6544 * @param name the name of the function type being declared
6545 */ 6545 */
6546 void set name(SimpleIdentifier name2) { 6546 void set name(SimpleIdentifier name2) {
(...skipping 25 matching lines...) Expand all
6572 } 6572 }
6573 void visitChildren(ASTVisitor<Object> visitor) { 6573 void visitChildren(ASTVisitor<Object> visitor) {
6574 super.visitChildren(visitor); 6574 super.visitChildren(visitor);
6575 safelyVisitChild(_returnType, visitor); 6575 safelyVisitChild(_returnType, visitor);
6576 safelyVisitChild(_name, visitor); 6576 safelyVisitChild(_name, visitor);
6577 safelyVisitChild(_typeParameters, visitor); 6577 safelyVisitChild(_typeParameters, visitor);
6578 safelyVisitChild(_parameters, visitor); 6578 safelyVisitChild(_parameters, visitor);
6579 } 6579 }
6580 } 6580 }
6581 /** 6581 /**
6582 * Instances of the class {@code FunctionTypedFormalParameter} represent a funct ion-typed formal 6582 * Instances of the class `FunctionTypedFormalParameter` represent a function-ty ped formal
6583 * parameter. 6583 * parameter.
6584 * <pre> 6584 * <pre>
6585 * functionSignature ::={@link TypeName returnType}? {@link SimpleIdentifier ide ntifier} {@link FormalParameterList formalParameterList}</pre> 6585 * functionSignature ::=[TypeName returnType]? [SimpleIdentifier identifier] [Fo rmalParameterList formalParameterList]</pre>
6586 * @coverage dart.engine.ast 6586 * @coverage dart.engine.ast
6587 */ 6587 */
6588 class FunctionTypedFormalParameter extends NormalFormalParameter { 6588 class FunctionTypedFormalParameter extends NormalFormalParameter {
6589 6589
6590 /** 6590 /**
6591 * The return type of the function, or {@code null} if the function does not h ave a return type. 6591 * The return type of the function, or `null` if the function does not have a return type.
6592 */ 6592 */
6593 TypeName _returnType; 6593 TypeName _returnType;
6594 6594
6595 /** 6595 /**
6596 * The parameters of the function-typed parameter. 6596 * The parameters of the function-typed parameter.
6597 */ 6597 */
6598 FormalParameterList _parameters; 6598 FormalParameterList _parameters;
6599 6599
6600 /** 6600 /**
6601 * Initialize a newly created formal parameter. 6601 * Initialize a newly created formal parameter.
6602 * @param comment the documentation comment associated with this parameter 6602 * @param comment the documentation comment associated with this parameter
6603 * @param metadata the annotations associated with this parameter 6603 * @param metadata the annotations associated with this parameter
6604 * @param returnType the return type of the function, or {@code null} if the f unction does not 6604 * @param returnType the return type of the function, or `null` if the functio n does not
6605 * have a return type 6605 * have a return type
6606 * @param identifier the name of the function-typed parameter 6606 * @param identifier the name of the function-typed parameter
6607 * @param parameters the parameters of the function-typed parameter 6607 * @param parameters the parameters of the function-typed parameter
6608 */ 6608 */
6609 FunctionTypedFormalParameter.full(Comment comment, List<Annotation> metadata, TypeName returnType, SimpleIdentifier identifier, FormalParameterList parameters ) : super.full(comment, metadata, identifier) { 6609 FunctionTypedFormalParameter.full(Comment comment, List<Annotation> metadata, TypeName returnType, SimpleIdentifier identifier, FormalParameterList parameters ) : super.full(comment, metadata, identifier) {
6610 this._returnType = becomeParentOf(returnType); 6610 this._returnType = becomeParentOf(returnType);
6611 this._parameters = becomeParentOf(parameters); 6611 this._parameters = becomeParentOf(parameters);
6612 } 6612 }
6613 6613
6614 /** 6614 /**
6615 * Initialize a newly created formal parameter. 6615 * Initialize a newly created formal parameter.
6616 * @param comment the documentation comment associated with this parameter 6616 * @param comment the documentation comment associated with this parameter
6617 * @param metadata the annotations associated with this parameter 6617 * @param metadata the annotations associated with this parameter
6618 * @param returnType the return type of the function, or {@code null} if the f unction does not 6618 * @param returnType the return type of the function, or `null` if the functio n does not
6619 * have a return type 6619 * have a return type
6620 * @param identifier the name of the function-typed parameter 6620 * @param identifier the name of the function-typed parameter
6621 * @param parameters the parameters of the function-typed parameter 6621 * @param parameters the parameters of the function-typed parameter
6622 */ 6622 */
6623 FunctionTypedFormalParameter({Comment comment, List<Annotation> metadata, Type Name returnType, SimpleIdentifier identifier, FormalParameterList parameters}) : this.full(comment, metadata, returnType, identifier, parameters); 6623 FunctionTypedFormalParameter({Comment comment, List<Annotation> metadata, Type Name returnType, SimpleIdentifier identifier, FormalParameterList parameters}) : this.full(comment, metadata, returnType, identifier, parameters);
6624 accept(ASTVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this); 6624 accept(ASTVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this);
6625 Token get beginToken { 6625 Token get beginToken {
6626 if (_returnType != null) { 6626 if (_returnType != null) {
6627 return _returnType.beginToken; 6627 return _returnType.beginToken;
6628 } 6628 }
6629 return identifier.beginToken; 6629 return identifier.beginToken;
6630 } 6630 }
6631 Token get endToken => _parameters.endToken; 6631 Token get endToken => _parameters.endToken;
6632 6632
6633 /** 6633 /**
6634 * Return the parameters of the function-typed parameter. 6634 * Return the parameters of the function-typed parameter.
6635 * @return the parameters of the function-typed parameter 6635 * @return the parameters of the function-typed parameter
6636 */ 6636 */
6637 FormalParameterList get parameters => _parameters; 6637 FormalParameterList get parameters => _parameters;
6638 6638
6639 /** 6639 /**
6640 * Return the return type of the function, or {@code null} if the function doe s not have a return 6640 * Return the return type of the function, or `null` if the function does not have a return
6641 * type. 6641 * type.
6642 * @return the return type of the function 6642 * @return the return type of the function
6643 */ 6643 */
6644 TypeName get returnType => _returnType; 6644 TypeName get returnType => _returnType;
6645 bool isConst() => false; 6645 bool isConst() => false;
6646 bool isFinal() => false; 6646 bool isFinal() => false;
6647 6647
6648 /** 6648 /**
6649 * Set the parameters of the function-typed parameter to the given parameters. 6649 * Set the parameters of the function-typed parameter to the given parameters.
6650 * @param parameters the parameters of the function-typed parameter 6650 * @param parameters the parameters of the function-typed parameter
(...skipping 10 matching lines...) Expand all
6661 this._returnType = becomeParentOf(returnType2); 6661 this._returnType = becomeParentOf(returnType2);
6662 } 6662 }
6663 void visitChildren(ASTVisitor<Object> visitor) { 6663 void visitChildren(ASTVisitor<Object> visitor) {
6664 super.visitChildren(visitor); 6664 super.visitChildren(visitor);
6665 safelyVisitChild(_returnType, visitor); 6665 safelyVisitChild(_returnType, visitor);
6666 safelyVisitChild(identifier, visitor); 6666 safelyVisitChild(identifier, visitor);
6667 safelyVisitChild(_parameters, visitor); 6667 safelyVisitChild(_parameters, visitor);
6668 } 6668 }
6669 } 6669 }
6670 /** 6670 /**
6671 * Instances of the class {@code HideCombinator} represent a combinator that res tricts the names 6671 * Instances of the class `HideCombinator` represent a combinator that restricts the names
6672 * being imported to those that are not in a given list. 6672 * being imported to those that are not in a given list.
6673 * <pre> 6673 * <pre>
6674 * hideCombinator ::= 6674 * hideCombinator ::=
6675 * 'hide' {@link SimpleIdentifier identifier} (',' {@link SimpleIdentifier ident ifier}) 6675 * 'hide' [SimpleIdentifier identifier] (',' [SimpleIdentifier identifier])
6676 * </pre> 6676 * </pre>
6677 * @coverage dart.engine.ast 6677 * @coverage dart.engine.ast
6678 */ 6678 */
6679 class HideCombinator extends Combinator { 6679 class HideCombinator extends Combinator {
6680 6680
6681 /** 6681 /**
6682 * The list of names from the library that are hidden by this combinator. 6682 * The list of names from the library that are hidden by this combinator.
6683 */ 6683 */
6684 NodeList<SimpleIdentifier> _hiddenNames; 6684 NodeList<SimpleIdentifier> _hiddenNames;
6685 6685
(...skipping 19 matching lines...) Expand all
6705 /** 6705 /**
6706 * Return the list of names from the library that are hidden by this combinato r. 6706 * Return the list of names from the library that are hidden by this combinato r.
6707 * @return the list of names from the library that are hidden by this combinat or 6707 * @return the list of names from the library that are hidden by this combinat or
6708 */ 6708 */
6709 NodeList<SimpleIdentifier> get hiddenNames => _hiddenNames; 6709 NodeList<SimpleIdentifier> get hiddenNames => _hiddenNames;
6710 void visitChildren(ASTVisitor<Object> visitor) { 6710 void visitChildren(ASTVisitor<Object> visitor) {
6711 _hiddenNames.accept(visitor); 6711 _hiddenNames.accept(visitor);
6712 } 6712 }
6713 } 6713 }
6714 /** 6714 /**
6715 * The abstract class {@code Identifier} defines the behavior common to nodes th at represent an 6715 * The abstract class `Identifier` defines the behavior common to nodes that rep resent an
6716 * identifier. 6716 * identifier.
6717 * <pre> 6717 * <pre>
6718 * identifier ::={@link SimpleIdentifier simpleIdentifier}| {@link PrefixedIdent ifier prefixedIdentifier}</pre> 6718 * identifier ::=[SimpleIdentifier simpleIdentifier]| [PrefixedIdentifier prefix edIdentifier]</pre>
6719 * @coverage dart.engine.ast 6719 * @coverage dart.engine.ast
6720 */ 6720 */
6721 abstract class Identifier extends Expression { 6721 abstract class Identifier extends Expression {
6722 6722
6723 /** 6723 /**
6724 * Return {@code true} if the given name is visible only within the library in which it is 6724 * Return `true` if the given name is visible only within the library in which it is
6725 * declared. 6725 * declared.
6726 * @param name the name being tested 6726 * @param name the name being tested
6727 * @return {@code true} if the given name is private 6727 * @return `true` if the given name is private
6728 */ 6728 */
6729 static bool isPrivateName(String name) => name.startsWith("_"); 6729 static bool isPrivateName(String name) => name.startsWith("_");
6730 6730
6731 /** 6731 /**
6732 * Return the element associated with this identifier based on propagated type information, or{@code null} if the AST structure has not been resolved or if th is identifier could not be 6732 * Return the element associated with this identifier based on propagated type information, or`null` if the AST structure has not been resolved or if this ide ntifier could not be
6733 * resolved. One example of the latter case is an identifier that is not defin ed within the scope 6733 * resolved. One example of the latter case is an identifier that is not defin ed within the scope
6734 * in which it appears. 6734 * in which it appears.
6735 * @return the element associated with this identifier 6735 * @return the element associated with this identifier
6736 */ 6736 */
6737 Element get element; 6737 Element get element;
6738 6738
6739 /** 6739 /**
6740 * Return the lexical representation of the identifier. 6740 * Return the lexical representation of the identifier.
6741 * @return the lexical representation of the identifier 6741 * @return the lexical representation of the identifier
6742 */ 6742 */
6743 String get name; 6743 String get name;
6744 6744
6745 /** 6745 /**
6746 * Return the element associated with this identifier based on static type inf ormation, or{@code null} if the AST structure has not been resolved or if this i dentifier could not be 6746 * Return the element associated with this identifier based on static type inf ormation, or`null` if the AST structure has not been resolved or if this identif ier could not be
6747 * resolved. One example of the latter case is an identifier that is not defin ed within the scope 6747 * resolved. One example of the latter case is an identifier that is not defin ed within the scope
6748 * in which it appears 6748 * in which it appears
6749 * @return the element associated with the operator 6749 * @return the element associated with the operator
6750 */ 6750 */
6751 Element get staticElement; 6751 Element get staticElement;
6752 bool isAssignable() => true; 6752 bool isAssignable() => true;
6753 } 6753 }
6754 /** 6754 /**
6755 * Instances of the class {@code IfStatement} represent an if statement. 6755 * Instances of the class `IfStatement` represent an if statement.
6756 * <pre> 6756 * <pre>
6757 * ifStatement ::= 6757 * ifStatement ::=
6758 * 'if' '(' {@link Expression expression} ')' {@link Statement thenStatement} (' else' {@link Statement elseStatement})? 6758 * 'if' '(' [Expression expression] ')' [Statement thenStatement] ('else' [State ment elseStatement])?
6759 * </pre> 6759 * </pre>
6760 * @coverage dart.engine.ast 6760 * @coverage dart.engine.ast
6761 */ 6761 */
6762 class IfStatement extends Statement { 6762 class IfStatement extends Statement {
6763 6763
6764 /** 6764 /**
6765 * The token representing the 'if' keyword. 6765 * The token representing the 'if' keyword.
6766 */ 6766 */
6767 Token _ifKeyword; 6767 Token _ifKeyword;
6768 6768
6769 /** 6769 /**
6770 * The left parenthesis. 6770 * The left parenthesis.
6771 */ 6771 */
6772 Token _leftParenthesis; 6772 Token _leftParenthesis;
6773 6773
6774 /** 6774 /**
6775 * The condition used to determine which of the statements is executed next. 6775 * The condition used to determine which of the statements is executed next.
6776 */ 6776 */
6777 Expression _condition; 6777 Expression _condition;
6778 6778
6779 /** 6779 /**
6780 * The right parenthesis. 6780 * The right parenthesis.
6781 */ 6781 */
6782 Token _rightParenthesis; 6782 Token _rightParenthesis;
6783 6783
6784 /** 6784 /**
6785 * The statement that is executed if the condition evaluates to {@code true}. 6785 * The statement that is executed if the condition evaluates to `true`.
6786 */ 6786 */
6787 Statement _thenStatement; 6787 Statement _thenStatement;
6788 6788
6789 /** 6789 /**
6790 * The token representing the 'else' keyword. 6790 * The token representing the 'else' keyword.
6791 */ 6791 */
6792 Token _elseKeyword; 6792 Token _elseKeyword;
6793 6793
6794 /** 6794 /**
6795 * The statement that is executed if the condition evaluates to {@code false}, or {@code null} if 6795 * The statement that is executed if the condition evaluates to `false`, or `n ull` if
6796 * there is no else statement. 6796 * there is no else statement.
6797 */ 6797 */
6798 Statement _elseStatement; 6798 Statement _elseStatement;
6799 6799
6800 /** 6800 /**
6801 * Initialize a newly created if statement. 6801 * Initialize a newly created if statement.
6802 * @param ifKeyword the token representing the 'if' keyword 6802 * @param ifKeyword the token representing the 'if' keyword
6803 * @param leftParenthesis the left parenthesis 6803 * @param leftParenthesis the left parenthesis
6804 * @param condition the condition used to determine which of the statements is executed next 6804 * @param condition the condition used to determine which of the statements is executed next
6805 * @param rightParenthesis the right parenthesis 6805 * @param rightParenthesis the right parenthesis
6806 * @param thenStatement the statement that is executed if the condition evalua tes to {@code true} 6806 * @param thenStatement the statement that is executed if the condition evalua tes to `true`
6807 * @param elseKeyword the token representing the 'else' keyword 6807 * @param elseKeyword the token representing the 'else' keyword
6808 * @param elseStatement the statement that is executed if the condition evalua tes to {@code false} 6808 * @param elseStatement the statement that is executed if the condition evalua tes to `false`
6809 */ 6809 */
6810 IfStatement.full(Token ifKeyword, Token leftParenthesis, Expression condition, Token rightParenthesis, Statement thenStatement, Token elseKeyword, Statement e lseStatement) { 6810 IfStatement.full(Token ifKeyword, Token leftParenthesis, Expression condition, Token rightParenthesis, Statement thenStatement, Token elseKeyword, Statement e lseStatement) {
6811 this._ifKeyword = ifKeyword; 6811 this._ifKeyword = ifKeyword;
6812 this._leftParenthesis = leftParenthesis; 6812 this._leftParenthesis = leftParenthesis;
6813 this._condition = becomeParentOf(condition); 6813 this._condition = becomeParentOf(condition);
6814 this._rightParenthesis = rightParenthesis; 6814 this._rightParenthesis = rightParenthesis;
6815 this._thenStatement = becomeParentOf(thenStatement); 6815 this._thenStatement = becomeParentOf(thenStatement);
6816 this._elseKeyword = elseKeyword; 6816 this._elseKeyword = elseKeyword;
6817 this._elseStatement = becomeParentOf(elseStatement); 6817 this._elseStatement = becomeParentOf(elseStatement);
6818 } 6818 }
6819 6819
6820 /** 6820 /**
6821 * Initialize a newly created if statement. 6821 * Initialize a newly created if statement.
6822 * @param ifKeyword the token representing the 'if' keyword 6822 * @param ifKeyword the token representing the 'if' keyword
6823 * @param leftParenthesis the left parenthesis 6823 * @param leftParenthesis the left parenthesis
6824 * @param condition the condition used to determine which of the statements is executed next 6824 * @param condition the condition used to determine which of the statements is executed next
6825 * @param rightParenthesis the right parenthesis 6825 * @param rightParenthesis the right parenthesis
6826 * @param thenStatement the statement that is executed if the condition evalua tes to {@code true} 6826 * @param thenStatement the statement that is executed if the condition evalua tes to `true`
6827 * @param elseKeyword the token representing the 'else' keyword 6827 * @param elseKeyword the token representing the 'else' keyword
6828 * @param elseStatement the statement that is executed if the condition evalua tes to {@code false} 6828 * @param elseStatement the statement that is executed if the condition evalua tes to `false`
6829 */ 6829 */
6830 IfStatement({Token ifKeyword, Token leftParenthesis, Expression condition, Tok en rightParenthesis, Statement thenStatement, Token elseKeyword, Statement elseS tatement}) : this.full(ifKeyword, leftParenthesis, condition, rightParenthesis, thenStatement, elseKeyword, elseStatement); 6830 IfStatement({Token ifKeyword, Token leftParenthesis, Expression condition, Tok en rightParenthesis, Statement thenStatement, Token elseKeyword, Statement elseS tatement}) : this.full(ifKeyword, leftParenthesis, condition, rightParenthesis, thenStatement, elseKeyword, elseStatement);
6831 accept(ASTVisitor visitor) => visitor.visitIfStatement(this); 6831 accept(ASTVisitor visitor) => visitor.visitIfStatement(this);
6832 Token get beginToken => _ifKeyword; 6832 Token get beginToken => _ifKeyword;
6833 6833
6834 /** 6834 /**
6835 * Return the condition used to determine which of the statements is executed next. 6835 * Return the condition used to determine which of the statements is executed next.
6836 * @return the condition used to determine which statement is executed next 6836 * @return the condition used to determine which statement is executed next
6837 */ 6837 */
6838 Expression get condition => _condition; 6838 Expression get condition => _condition;
6839 6839
6840 /** 6840 /**
6841 * Return the token representing the 'else' keyword. 6841 * Return the token representing the 'else' keyword.
6842 * @return the token representing the 'else' keyword 6842 * @return the token representing the 'else' keyword
6843 */ 6843 */
6844 Token get elseKeyword => _elseKeyword; 6844 Token get elseKeyword => _elseKeyword;
6845 6845
6846 /** 6846 /**
6847 * Return the statement that is executed if the condition evaluates to {@code false}, or{@code null} if there is no else statement. 6847 * Return the statement that is executed if the condition evaluates to `false` , or`null` if there is no else statement.
6848 * @return the statement that is executed if the condition evaluates to {@code false} 6848 * @return the statement that is executed if the condition evaluates to `false `
6849 */ 6849 */
6850 Statement get elseStatement => _elseStatement; 6850 Statement get elseStatement => _elseStatement;
6851 Token get endToken { 6851 Token get endToken {
6852 if (_elseStatement != null) { 6852 if (_elseStatement != null) {
6853 return _elseStatement.endToken; 6853 return _elseStatement.endToken;
6854 } 6854 }
6855 return _thenStatement.endToken; 6855 return _thenStatement.endToken;
6856 } 6856 }
6857 6857
6858 /** 6858 /**
6859 * Return the token representing the 'if' keyword. 6859 * Return the token representing the 'if' keyword.
6860 * @return the token representing the 'if' keyword 6860 * @return the token representing the 'if' keyword
6861 */ 6861 */
6862 Token get ifKeyword => _ifKeyword; 6862 Token get ifKeyword => _ifKeyword;
6863 6863
6864 /** 6864 /**
6865 * Return the left parenthesis. 6865 * Return the left parenthesis.
6866 * @return the left parenthesis 6866 * @return the left parenthesis
6867 */ 6867 */
6868 Token get leftParenthesis => _leftParenthesis; 6868 Token get leftParenthesis => _leftParenthesis;
6869 6869
6870 /** 6870 /**
6871 * Return the right parenthesis. 6871 * Return the right parenthesis.
6872 * @return the right parenthesis 6872 * @return the right parenthesis
6873 */ 6873 */
6874 Token get rightParenthesis => _rightParenthesis; 6874 Token get rightParenthesis => _rightParenthesis;
6875 6875
6876 /** 6876 /**
6877 * Return the statement that is executed if the condition evaluates to {@code true}. 6877 * Return the statement that is executed if the condition evaluates to `true`.
6878 * @return the statement that is executed if the condition evaluates to {@code true} 6878 * @return the statement that is executed if the condition evaluates to `true`
6879 */ 6879 */
6880 Statement get thenStatement => _thenStatement; 6880 Statement get thenStatement => _thenStatement;
6881 6881
6882 /** 6882 /**
6883 * Set the condition used to determine which of the statements is executed nex t to the given 6883 * Set the condition used to determine which of the statements is executed nex t to the given
6884 * expression. 6884 * expression.
6885 * @param expression the condition used to determine which statement is execut ed next 6885 * @param expression the condition used to determine which statement is execut ed next
6886 */ 6886 */
6887 void set condition(Expression expression) { 6887 void set condition(Expression expression) {
6888 _condition = becomeParentOf(expression); 6888 _condition = becomeParentOf(expression);
6889 } 6889 }
6890 6890
6891 /** 6891 /**
6892 * Set the token representing the 'else' keyword to the given token. 6892 * Set the token representing the 'else' keyword to the given token.
6893 * @param elseKeyword the token representing the 'else' keyword 6893 * @param elseKeyword the token representing the 'else' keyword
6894 */ 6894 */
6895 void set elseKeyword(Token elseKeyword2) { 6895 void set elseKeyword(Token elseKeyword2) {
6896 this._elseKeyword = elseKeyword2; 6896 this._elseKeyword = elseKeyword2;
6897 } 6897 }
6898 6898
6899 /** 6899 /**
6900 * Set the statement that is executed if the condition evaluates to {@code fal se} to the given 6900 * Set the statement that is executed if the condition evaluates to `false` to the given
6901 * statement. 6901 * statement.
6902 * @param statement the statement that is executed if the condition evaluates to {@code false} 6902 * @param statement the statement that is executed if the condition evaluates to `false`
6903 */ 6903 */
6904 void set elseStatement(Statement statement) { 6904 void set elseStatement(Statement statement) {
6905 _elseStatement = becomeParentOf(statement); 6905 _elseStatement = becomeParentOf(statement);
6906 } 6906 }
6907 6907
6908 /** 6908 /**
6909 * Set the token representing the 'if' keyword to the given token. 6909 * Set the token representing the 'if' keyword to the given token.
6910 * @param ifKeyword the token representing the 'if' keyword 6910 * @param ifKeyword the token representing the 'if' keyword
6911 */ 6911 */
6912 void set ifKeyword(Token ifKeyword2) { 6912 void set ifKeyword(Token ifKeyword2) {
(...skipping 10 matching lines...) Expand all
6923 6923
6924 /** 6924 /**
6925 * Set the right parenthesis to the given token. 6925 * Set the right parenthesis to the given token.
6926 * @param rightParenthesis the right parenthesis 6926 * @param rightParenthesis the right parenthesis
6927 */ 6927 */
6928 void set rightParenthesis(Token rightParenthesis2) { 6928 void set rightParenthesis(Token rightParenthesis2) {
6929 this._rightParenthesis = rightParenthesis2; 6929 this._rightParenthesis = rightParenthesis2;
6930 } 6930 }
6931 6931
6932 /** 6932 /**
6933 * Set the statement that is executed if the condition evaluates to {@code tru e} to the given 6933 * Set the statement that is executed if the condition evaluates to `true` to the given
6934 * statement. 6934 * statement.
6935 * @param statement the statement that is executed if the condition evaluates to {@code true} 6935 * @param statement the statement that is executed if the condition evaluates to `true`
6936 */ 6936 */
6937 void set thenStatement(Statement statement) { 6937 void set thenStatement(Statement statement) {
6938 _thenStatement = becomeParentOf(statement); 6938 _thenStatement = becomeParentOf(statement);
6939 } 6939 }
6940 void visitChildren(ASTVisitor<Object> visitor) { 6940 void visitChildren(ASTVisitor<Object> visitor) {
6941 safelyVisitChild(_condition, visitor); 6941 safelyVisitChild(_condition, visitor);
6942 safelyVisitChild(_thenStatement, visitor); 6942 safelyVisitChild(_thenStatement, visitor);
6943 safelyVisitChild(_elseStatement, visitor); 6943 safelyVisitChild(_elseStatement, visitor);
6944 } 6944 }
6945 } 6945 }
6946 /** 6946 /**
6947 * Instances of the class {@code ImplementsClause} represent the "implements" cl ause in an class 6947 * Instances of the class `ImplementsClause` represent the "implements" clause i n an class
6948 * declaration. 6948 * declaration.
6949 * <pre> 6949 * <pre>
6950 * implementsClause ::= 6950 * implementsClause ::=
6951 * 'implements' {@link TypeName superclass} (',' {@link TypeName superclass}) 6951 * 'implements' [TypeName superclass] (',' [TypeName superclass])
6952 * </pre> 6952 * </pre>
6953 * @coverage dart.engine.ast 6953 * @coverage dart.engine.ast
6954 */ 6954 */
6955 class ImplementsClause extends ASTNode { 6955 class ImplementsClause extends ASTNode {
6956 6956
6957 /** 6957 /**
6958 * The token representing the 'implements' keyword. 6958 * The token representing the 'implements' keyword.
6959 */ 6959 */
6960 Token _keyword; 6960 Token _keyword;
6961 6961
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
7002 * @param keyword the token representing the 'implements' keyword 7002 * @param keyword the token representing the 'implements' keyword
7003 */ 7003 */
7004 void set keyword(Token keyword2) { 7004 void set keyword(Token keyword2) {
7005 this._keyword = keyword2; 7005 this._keyword = keyword2;
7006 } 7006 }
7007 void visitChildren(ASTVisitor<Object> visitor) { 7007 void visitChildren(ASTVisitor<Object> visitor) {
7008 _interfaces.accept(visitor); 7008 _interfaces.accept(visitor);
7009 } 7009 }
7010 } 7010 }
7011 /** 7011 /**
7012 * Instances of the class {@code ImportDirective} represent an import directive. 7012 * Instances of the class `ImportDirective` represent an import directive.
7013 * <pre> 7013 * <pre>
7014 * importDirective ::={@link Annotation metadata} 'import' {@link StringLiteral libraryUri} ('as' identifier)? {@link Combinator combinator}* ';' 7014 * importDirective ::=[Annotation metadata] 'import' [StringLiteral libraryUri] ('as' identifier)? [Combinator combinator]* ';'
7015 * </pre> 7015 * </pre>
7016 * @coverage dart.engine.ast 7016 * @coverage dart.engine.ast
7017 */ 7017 */
7018 class ImportDirective extends NamespaceDirective { 7018 class ImportDirective extends NamespaceDirective {
7019 7019
7020 /** 7020 /**
7021 * The token representing the 'as' token, or {@code null} if the imported name s are not prefixed. 7021 * The token representing the 'as' token, or `null` if the imported names are not prefixed.
7022 */ 7022 */
7023 Token _asToken; 7023 Token _asToken;
7024 7024
7025 /** 7025 /**
7026 * The prefix to be used with the imported names, or {@code null} if the impor ted names are not 7026 * The prefix to be used with the imported names, or `null` if the imported na mes are not
7027 * prefixed. 7027 * prefixed.
7028 */ 7028 */
7029 SimpleIdentifier _prefix; 7029 SimpleIdentifier _prefix;
7030 7030
7031 /** 7031 /**
7032 * Initialize a newly created import directive. 7032 * Initialize a newly created import directive.
7033 * @param comment the documentation comment associated with this directive 7033 * @param comment the documentation comment associated with this directive
7034 * @param metadata the annotations associated with the directive 7034 * @param metadata the annotations associated with the directive
7035 * @param keyword the token representing the 'import' keyword 7035 * @param keyword the token representing the 'import' keyword
7036 * @param libraryUri the URI of the library being imported 7036 * @param libraryUri the URI of the library being imported
(...skipping 15 matching lines...) Expand all
7052 * @param libraryUri the URI of the library being imported 7052 * @param libraryUri the URI of the library being imported
7053 * @param asToken the token representing the 'as' token 7053 * @param asToken the token representing the 'as' token
7054 * @param prefix the prefix to be used with the imported names 7054 * @param prefix the prefix to be used with the imported names
7055 * @param combinators the combinators used to control how names are imported 7055 * @param combinators the combinators used to control how names are imported
7056 * @param semicolon the semicolon terminating the directive 7056 * @param semicolon the semicolon terminating the directive
7057 */ 7057 */
7058 ImportDirective({Comment comment, List<Annotation> metadata, Token keyword, St ringLiteral libraryUri, Token asToken, SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon}) : this.full(comment, metadata, keyword, libraryU ri, asToken, prefix, combinators, semicolon); 7058 ImportDirective({Comment comment, List<Annotation> metadata, Token keyword, St ringLiteral libraryUri, Token asToken, SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon}) : this.full(comment, metadata, keyword, libraryU ri, asToken, prefix, combinators, semicolon);
7059 accept(ASTVisitor visitor) => visitor.visitImportDirective(this); 7059 accept(ASTVisitor visitor) => visitor.visitImportDirective(this);
7060 7060
7061 /** 7061 /**
7062 * Return the token representing the 'as' token, or {@code null} if the import ed names are not 7062 * Return the token representing the 'as' token, or `null` if the imported nam es are not
7063 * prefixed. 7063 * prefixed.
7064 * @return the token representing the 'as' token 7064 * @return the token representing the 'as' token
7065 */ 7065 */
7066 Token get asToken => _asToken; 7066 Token get asToken => _asToken;
7067 7067
7068 /** 7068 /**
7069 * Return the prefix to be used with the imported names, or {@code null} if th e imported names are 7069 * Return the prefix to be used with the imported names, or `null` if the impo rted names are
7070 * not prefixed. 7070 * not prefixed.
7071 * @return the prefix to be used with the imported names 7071 * @return the prefix to be used with the imported names
7072 */ 7072 */
7073 SimpleIdentifier get prefix => _prefix; 7073 SimpleIdentifier get prefix => _prefix;
7074 LibraryElement get uriElement { 7074 LibraryElement get uriElement {
7075 Element element = this.element; 7075 Element element = this.element;
7076 if (element is ImportElement) { 7076 if (element is ImportElement) {
7077 return ((element as ImportElement)).importedLibrary; 7077 return ((element as ImportElement)).importedLibrary;
7078 } 7078 }
7079 return null; 7079 return null;
(...skipping 14 matching lines...) Expand all
7094 void set prefix(SimpleIdentifier prefix2) { 7094 void set prefix(SimpleIdentifier prefix2) {
7095 this._prefix = becomeParentOf(prefix2); 7095 this._prefix = becomeParentOf(prefix2);
7096 } 7096 }
7097 void visitChildren(ASTVisitor<Object> visitor) { 7097 void visitChildren(ASTVisitor<Object> visitor) {
7098 super.visitChildren(visitor); 7098 super.visitChildren(visitor);
7099 safelyVisitChild(_prefix, visitor); 7099 safelyVisitChild(_prefix, visitor);
7100 combinators.accept(visitor); 7100 combinators.accept(visitor);
7101 } 7101 }
7102 } 7102 }
7103 /** 7103 /**
7104 * Instances of the class {@code IndexExpression} represent an index expression. 7104 * Instances of the class `IndexExpression` represent an index expression.
7105 * <pre> 7105 * <pre>
7106 * indexExpression ::={@link Expression target} '\[' {@link Expression index} '\ ]' 7106 * indexExpression ::=[Expression target] '\[' [Expression index] '\]'
7107 * </pre> 7107 * </pre>
7108 * @coverage dart.engine.ast 7108 * @coverage dart.engine.ast
7109 */ 7109 */
7110 class IndexExpression extends Expression { 7110 class IndexExpression extends Expression {
7111 7111
7112 /** 7112 /**
7113 * The expression used to compute the object being indexed, or {@code null} if this index 7113 * The expression used to compute the object being indexed, or `null` if this index
7114 * expression is part of a cascade expression. 7114 * expression is part of a cascade expression.
7115 */ 7115 */
7116 Expression _target; 7116 Expression _target;
7117 7117
7118 /** 7118 /**
7119 * The period ("..") before a cascaded index expression, or {@code null} if th is index expression 7119 * The period ("..") before a cascaded index expression, or `null` if this ind ex expression
7120 * is not part of a cascade expression. 7120 * is not part of a cascade expression.
7121 */ 7121 */
7122 Token _period; 7122 Token _period;
7123 7123
7124 /** 7124 /**
7125 * The left square bracket. 7125 * The left square bracket.
7126 */ 7126 */
7127 Token _leftBracket; 7127 Token _leftBracket;
7128 7128
7129 /** 7129 /**
7130 * The expression used to compute the index. 7130 * The expression used to compute the index.
7131 */ 7131 */
7132 Expression _index; 7132 Expression _index;
7133 7133
7134 /** 7134 /**
7135 * The right square bracket. 7135 * The right square bracket.
7136 */ 7136 */
7137 Token _rightBracket; 7137 Token _rightBracket;
7138 7138
7139 /** 7139 /**
7140 * The element associated with the operator based on the static type of the ta rget, or{@code null} if the AST structure has not been resolved or if the operat or could not be 7140 * The element associated with the operator based on the static type of the ta rget, or`null` if the AST structure has not been resolved or if the operator cou ld not be
7141 * resolved. 7141 * resolved.
7142 */ 7142 */
7143 MethodElement _staticElement; 7143 MethodElement _staticElement;
7144 7144
7145 /** 7145 /**
7146 * The element associated with the operator based on the propagated type of th e target, or{@code null} if the AST structure has not been resolved or if the op erator could not be 7146 * The element associated with the operator based on the propagated type of th e target, or`null` if the AST structure has not been resolved or if the operator could not be
7147 * resolved. 7147 * resolved.
7148 */ 7148 */
7149 MethodElement _propagatedElement; 7149 MethodElement _propagatedElement;
7150 7150
7151 /** 7151 /**
7152 * Initialize a newly created index expression. 7152 * Initialize a newly created index expression.
7153 * @param target the expression used to compute the object being indexed 7153 * @param target the expression used to compute the object being indexed
7154 * @param leftBracket the left square bracket 7154 * @param leftBracket the left square bracket
7155 * @param index the expression used to compute the index 7155 * @param index the expression used to compute the index
7156 * @param rightBracket the right square bracket 7156 * @param rightBracket the right square bracket
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
7195 IndexExpression.forCascade({Token period2, Token leftBracket2, Expression inde x2, Token rightBracket2}) : this.forCascade_full(period2, leftBracket2, index2, rightBracket2); 7195 IndexExpression.forCascade({Token period2, Token leftBracket2, Expression inde x2, Token rightBracket2}) : this.forCascade_full(period2, leftBracket2, index2, rightBracket2);
7196 _jtd_constructor_59_impl(Token period2, Token leftBracket2, Expression index2, Token rightBracket2) { 7196 _jtd_constructor_59_impl(Token period2, Token leftBracket2, Expression index2, Token rightBracket2) {
7197 this._period = period2; 7197 this._period = period2;
7198 this._leftBracket = leftBracket2; 7198 this._leftBracket = leftBracket2;
7199 this._index = becomeParentOf(index2); 7199 this._index = becomeParentOf(index2);
7200 this._rightBracket = rightBracket2; 7200 this._rightBracket = rightBracket2;
7201 } 7201 }
7202 accept(ASTVisitor visitor) => visitor.visitIndexExpression(this); 7202 accept(ASTVisitor visitor) => visitor.visitIndexExpression(this);
7203 7203
7204 /** 7204 /**
7205 * Return the expression used to compute the object being indexed, or {@code n ull} if this index 7205 * Return the expression used to compute the object being indexed, or `null` i f this index
7206 * expression is part of a cascade expression. 7206 * expression is part of a cascade expression.
7207 * @return the expression used to compute the object being indexed 7207 * @return the expression used to compute the object being indexed
7208 * @see #getRealTarget() 7208 * @see #getRealTarget()
7209 */ 7209 */
7210 Expression get array => _target; 7210 Expression get array => _target;
7211 Token get beginToken { 7211 Token get beginToken {
7212 if (_target != null) { 7212 if (_target != null) {
7213 return _target.beginToken; 7213 return _target.beginToken;
7214 } 7214 }
7215 return _period; 7215 return _period;
7216 } 7216 }
7217 7217
7218 /** 7218 /**
7219 * Return the element associated with the operator based on the propagated typ e of the target, or{@code null} if the AST structure has not been resolved or if the operator could not be 7219 * Return the element associated with the operator based on the propagated typ e of the target, or`null` if the AST structure has not been resolved or if the o perator could not be
7220 * resolved. One example of the latter case is an operator that is not defined for the type of the 7220 * resolved. One example of the latter case is an operator that is not defined for the type of the
7221 * target. 7221 * target.
7222 * @return the element associated with this operator 7222 * @return the element associated with this operator
7223 */ 7223 */
7224 MethodElement get element => _propagatedElement; 7224 MethodElement get element => _propagatedElement;
7225 Token get endToken => _rightBracket; 7225 Token get endToken => _rightBracket;
7226 7226
7227 /** 7227 /**
7228 * Return the expression used to compute the index. 7228 * Return the expression used to compute the index.
7229 * @return the expression used to compute the index 7229 * @return the expression used to compute the index
7230 */ 7230 */
7231 Expression get index => _index; 7231 Expression get index => _index;
7232 7232
7233 /** 7233 /**
7234 * Return the left square bracket. 7234 * Return the left square bracket.
7235 * @return the left square bracket 7235 * @return the left square bracket
7236 */ 7236 */
7237 Token get leftBracket => _leftBracket; 7237 Token get leftBracket => _leftBracket;
7238 7238
7239 /** 7239 /**
7240 * Return the period ("..") before a cascaded index expression, or {@code null } if this index 7240 * Return the period ("..") before a cascaded index expression, or `null` if t his index
7241 * expression is not part of a cascade expression. 7241 * expression is not part of a cascade expression.
7242 * @return the period ("..") before a cascaded index expression 7242 * @return the period ("..") before a cascaded index expression
7243 */ 7243 */
7244 Token get period => _period; 7244 Token get period => _period;
7245 7245
7246 /** 7246 /**
7247 * Return the expression used to compute the object being indexed. If this ind ex expression is not 7247 * Return the expression used to compute the object being indexed. If this ind ex expression is not
7248 * part of a cascade expression, then this is the same as {@link #getArray()}. If this index 7248 * part of a cascade expression, then this is the same as [getArray]. If this index
7249 * expression is part of a cascade expression, then the target expression stor ed with the cascade 7249 * expression is part of a cascade expression, then the target expression stor ed with the cascade
7250 * expression is returned. 7250 * expression is returned.
7251 * @return the expression used to compute the object being indexed 7251 * @return the expression used to compute the object being indexed
7252 * @see #getArray() 7252 * @see #getArray()
7253 */ 7253 */
7254 Expression get realTarget { 7254 Expression get realTarget {
7255 if (isCascaded()) { 7255 if (isCascaded()) {
7256 ASTNode ancestor = parent; 7256 ASTNode ancestor = parent;
7257 while (ancestor is! CascadeExpression) { 7257 while (ancestor is! CascadeExpression) {
7258 if (ancestor == null) { 7258 if (ancestor == null) {
7259 return _target; 7259 return _target;
7260 } 7260 }
7261 ancestor = ancestor.parent; 7261 ancestor = ancestor.parent;
7262 } 7262 }
7263 return ((ancestor as CascadeExpression)).target; 7263 return ((ancestor as CascadeExpression)).target;
7264 } 7264 }
7265 return _target; 7265 return _target;
7266 } 7266 }
7267 7267
7268 /** 7268 /**
7269 * Return the right square bracket. 7269 * Return the right square bracket.
7270 * @return the right square bracket 7270 * @return the right square bracket
7271 */ 7271 */
7272 Token get rightBracket => _rightBracket; 7272 Token get rightBracket => _rightBracket;
7273 7273
7274 /** 7274 /**
7275 * Return the element associated with the operator based on the static type of the target, or{@code null} if the AST structure has not been resolved or if the operator could not be 7275 * Return the element associated with the operator based on the static type of the target, or`null` if the AST structure has not been resolved or if the opera tor could not be
7276 * resolved. One example of the latter case is an operator that is not defined for the type of the 7276 * resolved. One example of the latter case is an operator that is not defined for the type of the
7277 * target. 7277 * target.
7278 * @return the element associated with the operator 7278 * @return the element associated with the operator
7279 */ 7279 */
7280 MethodElement get staticElement => _staticElement; 7280 MethodElement get staticElement => _staticElement;
7281 7281
7282 /** 7282 /**
7283 * Return {@code true} if this expression is computing a right-hand value. 7283 * Return `true` if this expression is computing a right-hand value.
7284 * <p> 7284 *
7285 * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are 7285 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar e
7286 * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node. 7286 * they mutually exclusive. In other words, it is possible for both methods to return `true`when invoked on the same node.
7287 * @return {@code true} if this expression is in a context where the operator '\[\]' will be invoked 7287 * @return `true` if this expression is in a context where the operator '\[\]' will be invoked
7288 */ 7288 */
7289 bool inGetterContext() { 7289 bool inGetterContext() {
7290 ASTNode parent = this.parent; 7290 ASTNode parent = this.parent;
7291 if (parent is AssignmentExpression) { 7291 if (parent is AssignmentExpression) {
7292 AssignmentExpression assignment = parent as AssignmentExpression; 7292 AssignmentExpression assignment = parent as AssignmentExpression;
7293 if (identical(assignment.leftHandSide, this) && identical(assignment.opera tor.type, TokenType.EQ)) { 7293 if (identical(assignment.leftHandSide, this) && identical(assignment.opera tor.type, TokenType.EQ)) {
7294 return false; 7294 return false;
7295 } 7295 }
7296 } 7296 }
7297 return true; 7297 return true;
7298 } 7298 }
7299 7299
7300 /** 7300 /**
7301 * Return {@code true} if this expression is computing a left-hand value. 7301 * Return `true` if this expression is computing a left-hand value.
7302 * <p> 7302 *
7303 * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are 7303 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar e
7304 * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node. 7304 * they mutually exclusive. In other words, it is possible for both methods to return `true`when invoked on the same node.
7305 * @return {@code true} if this expression is in a context where the operator '\[\]=' will be 7305 * @return `true` if this expression is in a context where the operator '\[\]= ' will be
7306 * invoked 7306 * invoked
7307 */ 7307 */
7308 bool inSetterContext() { 7308 bool inSetterContext() {
7309 ASTNode parent = this.parent; 7309 ASTNode parent = this.parent;
7310 if (parent is PrefixExpression) { 7310 if (parent is PrefixExpression) {
7311 return ((parent as PrefixExpression)).operator.type.isIncrementOperator(); 7311 return ((parent as PrefixExpression)).operator.type.isIncrementOperator();
7312 } else if (parent is PostfixExpression) { 7312 } else if (parent is PostfixExpression) {
7313 return true; 7313 return true;
7314 } else if (parent is AssignmentExpression) { 7314 } else if (parent is AssignmentExpression) {
7315 return identical(((parent as AssignmentExpression)).leftHandSide, this); 7315 return identical(((parent as AssignmentExpression)).leftHandSide, this);
7316 } 7316 }
7317 return false; 7317 return false;
7318 } 7318 }
7319 bool isAssignable() => true; 7319 bool isAssignable() => true;
7320 7320
7321 /** 7321 /**
7322 * Return {@code true} if this expression is cascaded. If it is, then the targ et of this 7322 * Return `true` if this expression is cascaded. If it is, then the target of this
7323 * expression is not stored locally but is stored in the nearest ancestor that is a{@link CascadeExpression}. 7323 * expression is not stored locally but is stored in the nearest ancestor that is a[CascadeExpression].
7324 * @return {@code true} if this expression is cascaded 7324 * @return `true` if this expression is cascaded
7325 */ 7325 */
7326 bool isCascaded() => _period != null; 7326 bool isCascaded() => _period != null;
7327 7327
7328 /** 7328 /**
7329 * Set the expression used to compute the object being indexed to the given ex pression. 7329 * Set the expression used to compute the object being indexed to the given ex pression.
7330 * @param expression the expression used to compute the object being indexed 7330 * @param expression the expression used to compute the object being indexed
7331 */ 7331 */
7332 void set array(Expression expression) { 7332 void set array(Expression expression) {
7333 _target = becomeParentOf(expression); 7333 _target = becomeParentOf(expression);
7334 } 7334 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
7383 _staticElement = element; 7383 _staticElement = element;
7384 } 7384 }
7385 void visitChildren(ASTVisitor<Object> visitor) { 7385 void visitChildren(ASTVisitor<Object> visitor) {
7386 safelyVisitChild(_target, visitor); 7386 safelyVisitChild(_target, visitor);
7387 safelyVisitChild(_index, visitor); 7387 safelyVisitChild(_index, visitor);
7388 } 7388 }
7389 7389
7390 /** 7390 /**
7391 * If the AST structure has been resolved, and the function being invoked is k nown based on 7391 * If the AST structure has been resolved, and the function being invoked is k nown based on
7392 * propagated type information, then return the parameter element representing the parameter to 7392 * propagated type information, then return the parameter element representing the parameter to
7393 * which the value of the index expression will be bound. Otherwise, return {@ code null}. 7393 * which the value of the index expression will be bound. Otherwise, return `n ull`.
7394 * <p> 7394 *
7395 * This method is only intended to be used by {@link Expression#getParameterEl ement()}. 7395 * This method is only intended to be used by [Expression#getParameterElement] .
7396 * @return the parameter element representing the parameter to which the value of the index 7396 * @return the parameter element representing the parameter to which the value of the index
7397 * expression will be bound 7397 * expression will be bound
7398 */ 7398 */
7399 ParameterElement get propagatedParameterElementForIndex { 7399 ParameterElement get propagatedParameterElementForIndex {
7400 if (_propagatedElement == null) { 7400 if (_propagatedElement == null) {
7401 return null; 7401 return null;
7402 } 7402 }
7403 List<ParameterElement> parameters = _propagatedElement.parameters; 7403 List<ParameterElement> parameters = _propagatedElement.parameters;
7404 if (parameters.length < 1) { 7404 if (parameters.length < 1) {
7405 return null; 7405 return null;
7406 } 7406 }
7407 return parameters[0]; 7407 return parameters[0];
7408 } 7408 }
7409 7409
7410 /** 7410 /**
7411 * If the AST structure has been resolved, and the function being invoked is k nown based on static 7411 * If the AST structure has been resolved, and the function being invoked is k nown based on static
7412 * type information, then return the parameter element representing the parame ter to which the 7412 * type information, then return the parameter element representing the parame ter to which the
7413 * value of the index expression will be bound. Otherwise, return {@code null} . 7413 * value of the index expression will be bound. Otherwise, return `null`.
7414 * <p> 7414 *
7415 * This method is only intended to be used by {@link Expression#getStaticParam eterElement()}. 7415 * This method is only intended to be used by [Expression#getStaticParameterEl ement].
7416 * @return the parameter element representing the parameter to which the value of the index 7416 * @return the parameter element representing the parameter to which the value of the index
7417 * expression will be bound 7417 * expression will be bound
7418 */ 7418 */
7419 ParameterElement get staticParameterElementForIndex { 7419 ParameterElement get staticParameterElementForIndex {
7420 if (_staticElement == null) { 7420 if (_staticElement == null) {
7421 return null; 7421 return null;
7422 } 7422 }
7423 List<ParameterElement> parameters = _staticElement.parameters; 7423 List<ParameterElement> parameters = _staticElement.parameters;
7424 if (parameters.length < 1) { 7424 if (parameters.length < 1) {
7425 return null; 7425 return null;
7426 } 7426 }
7427 return parameters[0]; 7427 return parameters[0];
7428 } 7428 }
7429 } 7429 }
7430 /** 7430 /**
7431 * Instances of the class {@code InstanceCreationExpression} represent an instan ce creation 7431 * Instances of the class `InstanceCreationExpression` represent an instance cre ation
7432 * expression. 7432 * expression.
7433 * <pre> 7433 * <pre>
7434 * newExpression ::= 7434 * newExpression ::=
7435 * ('new' | 'const') {@link TypeName type} ('.' {@link SimpleIdentifier identifi er})? {@link ArgumentList argumentList}</pre> 7435 * ('new' | 'const') [TypeName type] ('.' [SimpleIdentifier identifier])? [Argum entList argumentList]</pre>
7436 * @coverage dart.engine.ast 7436 * @coverage dart.engine.ast
7437 */ 7437 */
7438 class InstanceCreationExpression extends Expression { 7438 class InstanceCreationExpression extends Expression {
7439 7439
7440 /** 7440 /**
7441 * The keyword used to indicate how an object should be created. 7441 * The keyword used to indicate how an object should be created.
7442 */ 7442 */
7443 Token _keyword; 7443 Token _keyword;
7444 7444
7445 /** 7445 /**
7446 * The name of the constructor to be invoked. 7446 * The name of the constructor to be invoked.
7447 */ 7447 */
7448 ConstructorName _constructorName; 7448 ConstructorName _constructorName;
7449 7449
7450 /** 7450 /**
7451 * The list of arguments to the constructor. 7451 * The list of arguments to the constructor.
7452 */ 7452 */
7453 ArgumentList _argumentList; 7453 ArgumentList _argumentList;
7454 7454
7455 /** 7455 /**
7456 * The element associated with the constructor based on static type informatio n, or {@code null}if the AST structure has not been resolved or if the construct or could not be resolved. 7456 * The element associated with the constructor based on static type informatio n, or `null`if the AST structure has not been resolved or if the constructor cou ld not be resolved.
7457 */ 7457 */
7458 ConstructorElement _staticElement; 7458 ConstructorElement _staticElement;
7459 7459
7460 /** 7460 /**
7461 * The element associated with the constructor based on propagated type inform ation, or{@code null} if the AST structure has not been resolved or if the const ructor could not be 7461 * The element associated with the constructor based on propagated type inform ation, or`null` if the AST structure has not been resolved or if the constructor could not be
7462 * resolved. 7462 * resolved.
7463 */ 7463 */
7464 ConstructorElement _propagatedElement; 7464 ConstructorElement _propagatedElement;
7465 7465
7466 /** 7466 /**
7467 * Initialize a newly created instance creation expression. 7467 * Initialize a newly created instance creation expression.
7468 * @param keyword the keyword used to indicate how an object should be created 7468 * @param keyword the keyword used to indicate how an object should be created
7469 * @param constructorName the name of the constructor to be invoked 7469 * @param constructorName the name of the constructor to be invoked
7470 * @param argumentList the list of arguments to the constructor 7470 * @param argumentList the list of arguments to the constructor
7471 */ 7471 */
(...skipping 19 matching lines...) Expand all
7491 ArgumentList get argumentList => _argumentList; 7491 ArgumentList get argumentList => _argumentList;
7492 Token get beginToken => _keyword; 7492 Token get beginToken => _keyword;
7493 7493
7494 /** 7494 /**
7495 * Return the name of the constructor to be invoked. 7495 * Return the name of the constructor to be invoked.
7496 * @return the name of the constructor to be invoked 7496 * @return the name of the constructor to be invoked
7497 */ 7497 */
7498 ConstructorName get constructorName => _constructorName; 7498 ConstructorName get constructorName => _constructorName;
7499 7499
7500 /** 7500 /**
7501 * Return the element associated with the constructor based on propagated type information, or{@code null} if the AST structure has not been resolved or if th e constructor could not be 7501 * Return the element associated with the constructor based on propagated type information, or`null` if the AST structure has not been resolved or if the cons tructor could not be
7502 * resolved. 7502 * resolved.
7503 * @return the element associated with the constructor 7503 * @return the element associated with the constructor
7504 */ 7504 */
7505 ConstructorElement get element => _propagatedElement; 7505 ConstructorElement get element => _propagatedElement;
7506 Token get endToken => _argumentList.endToken; 7506 Token get endToken => _argumentList.endToken;
7507 7507
7508 /** 7508 /**
7509 * Return the keyword used to indicate how an object should be created. 7509 * Return the keyword used to indicate how an object should be created.
7510 * @return the keyword used to indicate how an object should be created 7510 * @return the keyword used to indicate how an object should be created
7511 */ 7511 */
7512 Token get keyword => _keyword; 7512 Token get keyword => _keyword;
7513 7513
7514 /** 7514 /**
7515 * Return the element associated with the constructor based on static type inf ormation, or{@code null} if the AST structure has not been resolved or if the co nstructor could not be 7515 * Return the element associated with the constructor based on static type inf ormation, or`null` if the AST structure has not been resolved or if the construc tor could not be
7516 * resolved. 7516 * resolved.
7517 * @return the element associated with the constructor 7517 * @return the element associated with the constructor
7518 */ 7518 */
7519 ConstructorElement get staticElement => _staticElement; 7519 ConstructorElement get staticElement => _staticElement;
7520 7520
7521 /** 7521 /**
7522 * Return {@code true} if this creation expression is used to invoke a constan t constructor. 7522 * Return `true` if this creation expression is used to invoke a constant cons tructor.
7523 * @return {@code true} if this creation expression is used to invoke a consta nt constructor 7523 * @return `true` if this creation expression is used to invoke a constant con structor
7524 */ 7524 */
7525 bool isConst() => _keyword is KeywordToken && identical(((_keyword as KeywordT oken)).keyword, Keyword.CONST); 7525 bool isConst() => _keyword is KeywordToken && identical(((_keyword as KeywordT oken)).keyword, Keyword.CONST);
7526 7526
7527 /** 7527 /**
7528 * Set the list of arguments to the constructor to the given list. 7528 * Set the list of arguments to the constructor to the given list.
7529 * @param argumentList the list of arguments to the constructor 7529 * @param argumentList the list of arguments to the constructor
7530 */ 7530 */
7531 void set argumentList(ArgumentList argumentList2) { 7531 void set argumentList(ArgumentList argumentList2) {
7532 this._argumentList = becomeParentOf(argumentList2); 7532 this._argumentList = becomeParentOf(argumentList2);
7533 } 7533 }
(...skipping 30 matching lines...) Expand all
7564 */ 7564 */
7565 void set staticElement(ConstructorElement element) { 7565 void set staticElement(ConstructorElement element) {
7566 this._staticElement = element; 7566 this._staticElement = element;
7567 } 7567 }
7568 void visitChildren(ASTVisitor<Object> visitor) { 7568 void visitChildren(ASTVisitor<Object> visitor) {
7569 safelyVisitChild(_constructorName, visitor); 7569 safelyVisitChild(_constructorName, visitor);
7570 safelyVisitChild(_argumentList, visitor); 7570 safelyVisitChild(_argumentList, visitor);
7571 } 7571 }
7572 } 7572 }
7573 /** 7573 /**
7574 * Instances of the class {@code IntegerLiteral} represent an integer literal ex pression. 7574 * Instances of the class `IntegerLiteral` represent an integer literal expressi on.
7575 * <pre> 7575 * <pre>
7576 * integerLiteral ::= 7576 * integerLiteral ::=
7577 * decimalIntegerLiteral 7577 * decimalIntegerLiteral
7578 * | hexidecimalIntegerLiteral 7578 * | hexidecimalIntegerLiteral
7579 * decimalIntegerLiteral ::= 7579 * decimalIntegerLiteral ::=
7580 * decimalDigit+ 7580 * decimalDigit+
7581 * hexidecimalIntegerLiteral ::= 7581 * hexidecimalIntegerLiteral ::=
7582 * '0x' hexidecimalDigit+ 7582 * '0x' hexidecimalDigit+
7583 * | '0X' hexidecimalDigit+ 7583 * | '0X' hexidecimalDigit+
7584 * </pre> 7584 * </pre>
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
7640 * Set the value of the literal to the given value. 7640 * Set the value of the literal to the given value.
7641 * @param value the value of the literal 7641 * @param value the value of the literal
7642 */ 7642 */
7643 void set value(int value2) { 7643 void set value(int value2) {
7644 this._value = value2; 7644 this._value = value2;
7645 } 7645 }
7646 void visitChildren(ASTVisitor<Object> visitor) { 7646 void visitChildren(ASTVisitor<Object> visitor) {
7647 } 7647 }
7648 } 7648 }
7649 /** 7649 /**
7650 * The abstract class {@code InterpolationElement} defines the behavior common t o elements within a{@link StringInterpolation string interpolation}. 7650 * The abstract class `InterpolationElement` defines the behavior common to elem ents within a[StringInterpolation string interpolation].
7651 * <pre> 7651 * <pre>
7652 * interpolationElement ::={@link InterpolationExpression interpolationExpressio n}| {@link InterpolationString interpolationString}</pre> 7652 * interpolationElement ::=[InterpolationExpression interpolationExpression]| [I nterpolationString interpolationString]</pre>
7653 * @coverage dart.engine.ast 7653 * @coverage dart.engine.ast
7654 */ 7654 */
7655 abstract class InterpolationElement extends ASTNode { 7655 abstract class InterpolationElement extends ASTNode {
7656 } 7656 }
7657 /** 7657 /**
7658 * Instances of the class {@code InterpolationExpression} represent an expressio n embedded in a 7658 * Instances of the class `InterpolationExpression` represent an expression embe dded in a
7659 * string interpolation. 7659 * string interpolation.
7660 * <pre> 7660 * <pre>
7661 * interpolationExpression ::= 7661 * interpolationExpression ::=
7662 * '$' {@link SimpleIdentifier identifier}| '$' '{' {@link Expression expression } '}' 7662 * '$' [SimpleIdentifier identifier]| '$' '{' [Expression expression] '}'
7663 * </pre> 7663 * </pre>
7664 * @coverage dart.engine.ast 7664 * @coverage dart.engine.ast
7665 */ 7665 */
7666 class InterpolationExpression extends InterpolationElement { 7666 class InterpolationExpression extends InterpolationElement {
7667 7667
7668 /** 7668 /**
7669 * The token used to introduce the interpolation expression; either '$' if the expression is a 7669 * The token used to introduce the interpolation expression; either '$' if the expression is a
7670 * simple identifier or '${' if the expression is a full expression. 7670 * simple identifier or '${' if the expression is a full expression.
7671 */ 7671 */
7672 Token _leftBracket; 7672 Token _leftBracket;
7673 7673
7674 /** 7674 /**
7675 * The expression to be evaluated for the value to be converted into a string. 7675 * The expression to be evaluated for the value to be converted into a string.
7676 */ 7676 */
7677 Expression _expression; 7677 Expression _expression;
7678 7678
7679 /** 7679 /**
7680 * The right curly bracket, or {@code null} if the expression is an identifier without brackets. 7680 * The right curly bracket, or `null` if the expression is an identifier witho ut brackets.
7681 */ 7681 */
7682 Token _rightBracket; 7682 Token _rightBracket;
7683 7683
7684 /** 7684 /**
7685 * Initialize a newly created interpolation expression. 7685 * Initialize a newly created interpolation expression.
7686 * @param leftBracket the left curly bracket 7686 * @param leftBracket the left curly bracket
7687 * @param expression the expression to be evaluated for the value to be conver ted into a string 7687 * @param expression the expression to be evaluated for the value to be conver ted into a string
7688 * @param rightBracket the right curly bracket 7688 * @param rightBracket the right curly bracket
7689 */ 7689 */
7690 InterpolationExpression.full(Token leftBracket, Expression expression, Token r ightBracket) { 7690 InterpolationExpression.full(Token leftBracket, Expression expression, Token r ightBracket) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
7749 * @param rightBracket the right curly bracket 7749 * @param rightBracket the right curly bracket
7750 */ 7750 */
7751 void set rightBracket(Token rightBracket2) { 7751 void set rightBracket(Token rightBracket2) {
7752 this._rightBracket = rightBracket2; 7752 this._rightBracket = rightBracket2;
7753 } 7753 }
7754 void visitChildren(ASTVisitor<Object> visitor) { 7754 void visitChildren(ASTVisitor<Object> visitor) {
7755 safelyVisitChild(_expression, visitor); 7755 safelyVisitChild(_expression, visitor);
7756 } 7756 }
7757 } 7757 }
7758 /** 7758 /**
7759 * Instances of the class {@code InterpolationString} represent a non-empty subs tring of an 7759 * Instances of the class `InterpolationString` represent a non-empty substring of an
7760 * interpolated string. 7760 * interpolated string.
7761 * <pre> 7761 * <pre>
7762 * interpolationString ::= 7762 * interpolationString ::=
7763 * characters 7763 * characters
7764 * </pre> 7764 * </pre>
7765 * @coverage dart.engine.ast 7765 * @coverage dart.engine.ast
7766 */ 7766 */
7767 class InterpolationString extends InterpolationElement { 7767 class InterpolationString extends InterpolationElement {
7768 7768
7769 /** 7769 /**
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
7820 * Set the value of the literal to the given string. 7820 * Set the value of the literal to the given string.
7821 * @param string the value of the literal 7821 * @param string the value of the literal
7822 */ 7822 */
7823 void set value(String string) { 7823 void set value(String string) {
7824 _value = string; 7824 _value = string;
7825 } 7825 }
7826 void visitChildren(ASTVisitor<Object> visitor) { 7826 void visitChildren(ASTVisitor<Object> visitor) {
7827 } 7827 }
7828 } 7828 }
7829 /** 7829 /**
7830 * Instances of the class {@code IsExpression} represent an is expression. 7830 * Instances of the class `IsExpression` represent an is expression.
7831 * <pre> 7831 * <pre>
7832 * isExpression ::={@link Expression expression} 'is' '!'? {@link TypeName type} </pre> 7832 * isExpression ::=[Expression expression] 'is' '!'? [TypeName type]</pre>
7833 * @coverage dart.engine.ast 7833 * @coverage dart.engine.ast
7834 */ 7834 */
7835 class IsExpression extends Expression { 7835 class IsExpression extends Expression {
7836 7836
7837 /** 7837 /**
7838 * The expression used to compute the value whose type is being tested. 7838 * The expression used to compute the value whose type is being tested.
7839 */ 7839 */
7840 Expression _expression; 7840 Expression _expression;
7841 7841
7842 /** 7842 /**
7843 * The is operator. 7843 * The is operator.
7844 */ 7844 */
7845 Token _isOperator; 7845 Token _isOperator;
7846 7846
7847 /** 7847 /**
7848 * The not operator, or {@code null} if the sense of the test is not negated. 7848 * The not operator, or `null` if the sense of the test is not negated.
7849 */ 7849 */
7850 Token _notOperator; 7850 Token _notOperator;
7851 7851
7852 /** 7852 /**
7853 * The name of the type being tested for. 7853 * The name of the type being tested for.
7854 */ 7854 */
7855 TypeName _type; 7855 TypeName _type;
7856 7856
7857 /** 7857 /**
7858 * Initialize a newly created is expression. 7858 * Initialize a newly created is expression.
7859 * @param expression the expression used to compute the value whose type is be ing tested 7859 * @param expression the expression used to compute the value whose type is be ing tested
7860 * @param isOperator the is operator 7860 * @param isOperator the is operator
7861 * @param notOperator the not operator, or {@code null} if the sense of the te st is not negated 7861 * @param notOperator the not operator, or `null` if the sense of the test is not negated
7862 * @param type the name of the type being tested for 7862 * @param type the name of the type being tested for
7863 */ 7863 */
7864 IsExpression.full(Expression expression, Token isOperator, Token notOperator, TypeName type) { 7864 IsExpression.full(Expression expression, Token isOperator, Token notOperator, TypeName type) {
7865 this._expression = becomeParentOf(expression); 7865 this._expression = becomeParentOf(expression);
7866 this._isOperator = isOperator; 7866 this._isOperator = isOperator;
7867 this._notOperator = notOperator; 7867 this._notOperator = notOperator;
7868 this._type = becomeParentOf(type); 7868 this._type = becomeParentOf(type);
7869 } 7869 }
7870 7870
7871 /** 7871 /**
7872 * Initialize a newly created is expression. 7872 * Initialize a newly created is expression.
7873 * @param expression the expression used to compute the value whose type is be ing tested 7873 * @param expression the expression used to compute the value whose type is be ing tested
7874 * @param isOperator the is operator 7874 * @param isOperator the is operator
7875 * @param notOperator the not operator, or {@code null} if the sense of the te st is not negated 7875 * @param notOperator the not operator, or `null` if the sense of the test is not negated
7876 * @param type the name of the type being tested for 7876 * @param type the name of the type being tested for
7877 */ 7877 */
7878 IsExpression({Expression expression, Token isOperator, Token notOperator, Type Name type}) : this.full(expression, isOperator, notOperator, type); 7878 IsExpression({Expression expression, Token isOperator, Token notOperator, Type Name type}) : this.full(expression, isOperator, notOperator, type);
7879 accept(ASTVisitor visitor) => visitor.visitIsExpression(this); 7879 accept(ASTVisitor visitor) => visitor.visitIsExpression(this);
7880 Token get beginToken => _expression.beginToken; 7880 Token get beginToken => _expression.beginToken;
7881 Token get endToken => _type.endToken; 7881 Token get endToken => _type.endToken;
7882 7882
7883 /** 7883 /**
7884 * Return the expression used to compute the value whose type is being tested. 7884 * Return the expression used to compute the value whose type is being tested.
7885 * @return the expression used to compute the value whose type is being tested 7885 * @return the expression used to compute the value whose type is being tested
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
7935 */ 7935 */
7936 void set type(TypeName name) { 7936 void set type(TypeName name) {
7937 this._type = becomeParentOf(name); 7937 this._type = becomeParentOf(name);
7938 } 7938 }
7939 void visitChildren(ASTVisitor<Object> visitor) { 7939 void visitChildren(ASTVisitor<Object> visitor) {
7940 safelyVisitChild(_expression, visitor); 7940 safelyVisitChild(_expression, visitor);
7941 safelyVisitChild(_type, visitor); 7941 safelyVisitChild(_type, visitor);
7942 } 7942 }
7943 } 7943 }
7944 /** 7944 /**
7945 * Instances of the class {@code Label} represent a label. 7945 * Instances of the class `Label` represent a label.
7946 * <pre> 7946 * <pre>
7947 * label ::={@link SimpleIdentifier label} ':' 7947 * label ::=[SimpleIdentifier label] ':'
7948 * </pre> 7948 * </pre>
7949 * @coverage dart.engine.ast 7949 * @coverage dart.engine.ast
7950 */ 7950 */
7951 class Label extends ASTNode { 7951 class Label extends ASTNode {
7952 7952
7953 /** 7953 /**
7954 * The label being associated with the statement. 7954 * The label being associated with the statement.
7955 */ 7955 */
7956 SimpleIdentifier _label; 7956 SimpleIdentifier _label;
7957 7957
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
8005 * @param label the label being associated with the statement 8005 * @param label the label being associated with the statement
8006 */ 8006 */
8007 void set label(SimpleIdentifier label2) { 8007 void set label(SimpleIdentifier label2) {
8008 this._label = becomeParentOf(label2); 8008 this._label = becomeParentOf(label2);
8009 } 8009 }
8010 void visitChildren(ASTVisitor<Object> visitor) { 8010 void visitChildren(ASTVisitor<Object> visitor) {
8011 safelyVisitChild(_label, visitor); 8011 safelyVisitChild(_label, visitor);
8012 } 8012 }
8013 } 8013 }
8014 /** 8014 /**
8015 * Instances of the class {@code LabeledStatement} represent a statement that ha s a label associated 8015 * Instances of the class `LabeledStatement` represent a statement that has a la bel associated
8016 * with them. 8016 * with them.
8017 * <pre> 8017 * <pre>
8018 * labeledStatement ::={@link Label label}+ {@link Statement statement}</pre> 8018 * labeledStatement ::=[Label label]+ [Statement statement]</pre>
8019 * @coverage dart.engine.ast 8019 * @coverage dart.engine.ast
8020 */ 8020 */
8021 class LabeledStatement extends Statement { 8021 class LabeledStatement extends Statement {
8022 8022
8023 /** 8023 /**
8024 * The labels being associated with the statement. 8024 * The labels being associated with the statement.
8025 */ 8025 */
8026 NodeList<Label> _labels; 8026 NodeList<Label> _labels;
8027 8027
8028 /** 8028 /**
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
8074 */ 8074 */
8075 void set statement(Statement statement2) { 8075 void set statement(Statement statement2) {
8076 this._statement = becomeParentOf(statement2); 8076 this._statement = becomeParentOf(statement2);
8077 } 8077 }
8078 void visitChildren(ASTVisitor<Object> visitor) { 8078 void visitChildren(ASTVisitor<Object> visitor) {
8079 _labels.accept(visitor); 8079 _labels.accept(visitor);
8080 safelyVisitChild(_statement, visitor); 8080 safelyVisitChild(_statement, visitor);
8081 } 8081 }
8082 } 8082 }
8083 /** 8083 /**
8084 * Instances of the class {@code LibraryDirective} represent a library directive . 8084 * Instances of the class `LibraryDirective` represent a library directive.
8085 * <pre> 8085 * <pre>
8086 * libraryDirective ::={@link Annotation metadata} 'library' {@link Identifier n ame} ';' 8086 * libraryDirective ::=[Annotation metadata] 'library' [Identifier name] ';'
8087 * </pre> 8087 * </pre>
8088 * @coverage dart.engine.ast 8088 * @coverage dart.engine.ast
8089 */ 8089 */
8090 class LibraryDirective extends Directive { 8090 class LibraryDirective extends Directive {
8091 8091
8092 /** 8092 /**
8093 * The token representing the 'library' token. 8093 * The token representing the 'library' token.
8094 */ 8094 */
8095 Token _libraryToken; 8095 Token _libraryToken;
8096 8096
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
8172 void set semicolon(Token semicolon2) { 8172 void set semicolon(Token semicolon2) {
8173 this._semicolon = semicolon2; 8173 this._semicolon = semicolon2;
8174 } 8174 }
8175 void visitChildren(ASTVisitor<Object> visitor) { 8175 void visitChildren(ASTVisitor<Object> visitor) {
8176 super.visitChildren(visitor); 8176 super.visitChildren(visitor);
8177 safelyVisitChild(_name, visitor); 8177 safelyVisitChild(_name, visitor);
8178 } 8178 }
8179 Token get firstTokenAfterCommentAndMetadata => _libraryToken; 8179 Token get firstTokenAfterCommentAndMetadata => _libraryToken;
8180 } 8180 }
8181 /** 8181 /**
8182 * Instances of the class {@code LibraryIdentifier} represent the identifier for a library. 8182 * Instances of the class `LibraryIdentifier` represent the identifier for a lib rary.
8183 * <pre> 8183 * <pre>
8184 * libraryIdentifier ::={@link SimpleIdentifier component} ('.' {@link SimpleIde ntifier component}) 8184 * libraryIdentifier ::=[SimpleIdentifier component] ('.' [SimpleIdentifier comp onent])
8185 * </pre> 8185 * </pre>
8186 * @coverage dart.engine.ast 8186 * @coverage dart.engine.ast
8187 */ 8187 */
8188 class LibraryIdentifier extends Identifier { 8188 class LibraryIdentifier extends Identifier {
8189 8189
8190 /** 8190 /**
8191 * The components of the identifier. 8191 * The components of the identifier.
8192 */ 8192 */
8193 NodeList<SimpleIdentifier> _components; 8193 NodeList<SimpleIdentifier> _components;
8194 8194
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
8228 builder.append(identifier.name); 8228 builder.append(identifier.name);
8229 } 8229 }
8230 return builder.toString(); 8230 return builder.toString();
8231 } 8231 }
8232 Element get staticElement => null; 8232 Element get staticElement => null;
8233 void visitChildren(ASTVisitor<Object> visitor) { 8233 void visitChildren(ASTVisitor<Object> visitor) {
8234 _components.accept(visitor); 8234 _components.accept(visitor);
8235 } 8235 }
8236 } 8236 }
8237 /** 8237 /**
8238 * Instances of the class {@code ListLiteral} represent a list literal. 8238 * Instances of the class `ListLiteral` represent a list literal.
8239 * <pre> 8239 * <pre>
8240 * listLiteral ::= 8240 * listLiteral ::=
8241 * 'const'? ('<' {@link TypeName type} '>')? '\[' ({@link Expression expressionL ist} ','?)? '\]' 8241 * 'const'? ('<' [TypeName type] '>')? '\[' ([Expression expressionList] ','?)? '\]'
8242 * </pre> 8242 * </pre>
8243 * @coverage dart.engine.ast 8243 * @coverage dart.engine.ast
8244 */ 8244 */
8245 class ListLiteral extends TypedLiteral { 8245 class ListLiteral extends TypedLiteral {
8246 8246
8247 /** 8247 /**
8248 * The left square bracket. 8248 * The left square bracket.
8249 */ 8249 */
8250 Token _leftBracket; 8250 Token _leftBracket;
8251 8251
8252 /** 8252 /**
8253 * The expressions used to compute the elements of the list. 8253 * The expressions used to compute the elements of the list.
8254 */ 8254 */
8255 NodeList<Expression> _elements; 8255 NodeList<Expression> _elements;
8256 8256
8257 /** 8257 /**
8258 * The right square bracket. 8258 * The right square bracket.
8259 */ 8259 */
8260 Token _rightBracket; 8260 Token _rightBracket;
8261 8261
8262 /** 8262 /**
8263 * Initialize a newly created list literal. 8263 * Initialize a newly created list literal.
8264 * @param modifier the const modifier associated with this literal 8264 * @param modifier the const modifier associated with this literal
8265 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type 8265 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
8266 * arguments were declared 8266 * arguments were declared
8267 * @param leftBracket the left square bracket 8267 * @param leftBracket the left square bracket
8268 * @param elements the expressions used to compute the elements of the list 8268 * @param elements the expressions used to compute the elements of the list
8269 * @param rightBracket the right square bracket 8269 * @param rightBracket the right square bracket
8270 */ 8270 */
8271 ListLiteral.full(Token modifier, TypeArgumentList typeArguments, Token leftBra cket, List<Expression> elements, Token rightBracket) : super.full(modifier, type Arguments) { 8271 ListLiteral.full(Token modifier, TypeArgumentList typeArguments, Token leftBra cket, List<Expression> elements, Token rightBracket) : super.full(modifier, type Arguments) {
8272 this._elements = new NodeList<Expression>(this); 8272 this._elements = new NodeList<Expression>(this);
8273 this._leftBracket = leftBracket; 8273 this._leftBracket = leftBracket;
8274 this._elements.addAll(elements); 8274 this._elements.addAll(elements);
8275 this._rightBracket = rightBracket; 8275 this._rightBracket = rightBracket;
8276 } 8276 }
8277 8277
8278 /** 8278 /**
8279 * Initialize a newly created list literal. 8279 * Initialize a newly created list literal.
8280 * @param modifier the const modifier associated with this literal 8280 * @param modifier the const modifier associated with this literal
8281 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type 8281 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
8282 * arguments were declared 8282 * arguments were declared
8283 * @param leftBracket the left square bracket 8283 * @param leftBracket the left square bracket
8284 * @param elements the expressions used to compute the elements of the list 8284 * @param elements the expressions used to compute the elements of the list
8285 * @param rightBracket the right square bracket 8285 * @param rightBracket the right square bracket
8286 */ 8286 */
8287 ListLiteral({Token modifier, TypeArgumentList typeArguments, Token leftBracket , List<Expression> elements, Token rightBracket}) : this.full(modifier, typeArgu ments, leftBracket, elements, rightBracket); 8287 ListLiteral({Token modifier, TypeArgumentList typeArguments, Token leftBracket , List<Expression> elements, Token rightBracket}) : this.full(modifier, typeArgu ments, leftBracket, elements, rightBracket);
8288 accept(ASTVisitor visitor) => visitor.visitListLiteral(this); 8288 accept(ASTVisitor visitor) => visitor.visitListLiteral(this);
8289 Token get beginToken { 8289 Token get beginToken {
8290 Token token = modifier; 8290 Token token = modifier;
8291 if (token != null) { 8291 if (token != null) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
8331 */ 8331 */
8332 void set rightBracket(Token bracket) { 8332 void set rightBracket(Token bracket) {
8333 _rightBracket = bracket; 8333 _rightBracket = bracket;
8334 } 8334 }
8335 void visitChildren(ASTVisitor<Object> visitor) { 8335 void visitChildren(ASTVisitor<Object> visitor) {
8336 super.visitChildren(visitor); 8336 super.visitChildren(visitor);
8337 _elements.accept(visitor); 8337 _elements.accept(visitor);
8338 } 8338 }
8339 } 8339 }
8340 /** 8340 /**
8341 * The abstract class {@code Literal} defines the behavior common to nodes that represent a literal 8341 * The abstract class `Literal` defines the behavior common to nodes that repres ent a literal
8342 * expression. 8342 * expression.
8343 * <pre> 8343 * <pre>
8344 * literal ::={@link BooleanLiteral booleanLiteral}| {@link DoubleLiteral double Literal}| {@link IntegerLiteral integerLiteral}| {@link ListLiteral listLiteral} | {@link MapLiteral mapLiteral}| {@link NullLiteral nullLiteral}| {@link StringL iteral stringLiteral}</pre> 8344 * literal ::=[BooleanLiteral booleanLiteral]| [DoubleLiteral doubleLiteral]| [I ntegerLiteral integerLiteral]| [ListLiteral listLiteral]| [MapLiteral mapLiteral ]| [NullLiteral nullLiteral]| [StringLiteral stringLiteral]</pre>
8345 * @coverage dart.engine.ast 8345 * @coverage dart.engine.ast
8346 */ 8346 */
8347 abstract class Literal extends Expression { 8347 abstract class Literal extends Expression {
8348 } 8348 }
8349 /** 8349 /**
8350 * Instances of the class {@code MapLiteral} represent a literal map. 8350 * Instances of the class `MapLiteral` represent a literal map.
8351 * <pre> 8351 * <pre>
8352 * mapLiteral ::= 8352 * mapLiteral ::=
8353 * 'const'? ('<' {@link TypeName type} (',' {@link TypeName type})* '>')? '{' ({ @link MapLiteralEntry entry} (',' {@link MapLiteralEntry entry})* ','?)? '}' 8353 * 'const'? ('<' [TypeName type] (',' [TypeName type])* '>')? '{' ([MapLiteralEn try entry] (',' [MapLiteralEntry entry])* ','?)? '}'
8354 * </pre> 8354 * </pre>
8355 * @coverage dart.engine.ast 8355 * @coverage dart.engine.ast
8356 */ 8356 */
8357 class MapLiteral extends TypedLiteral { 8357 class MapLiteral extends TypedLiteral {
8358 8358
8359 /** 8359 /**
8360 * The left curly bracket. 8360 * The left curly bracket.
8361 */ 8361 */
8362 Token _leftBracket; 8362 Token _leftBracket;
8363 8363
8364 /** 8364 /**
8365 * The entries in the map. 8365 * The entries in the map.
8366 */ 8366 */
8367 NodeList<MapLiteralEntry> _entries; 8367 NodeList<MapLiteralEntry> _entries;
8368 8368
8369 /** 8369 /**
8370 * The right curly bracket. 8370 * The right curly bracket.
8371 */ 8371 */
8372 Token _rightBracket; 8372 Token _rightBracket;
8373 8373
8374 /** 8374 /**
8375 * Initialize a newly created map literal. 8375 * Initialize a newly created map literal.
8376 * @param modifier the const modifier associated with this literal 8376 * @param modifier the const modifier associated with this literal
8377 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type 8377 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
8378 * arguments were declared 8378 * arguments were declared
8379 * @param leftBracket the left curly bracket 8379 * @param leftBracket the left curly bracket
8380 * @param entries the entries in the map 8380 * @param entries the entries in the map
8381 * @param rightBracket the right curly bracket 8381 * @param rightBracket the right curly bracket
8382 */ 8382 */
8383 MapLiteral.full(Token modifier, TypeArgumentList typeArguments, Token leftBrac ket, List<MapLiteralEntry> entries, Token rightBracket) : super.full(modifier, t ypeArguments) { 8383 MapLiteral.full(Token modifier, TypeArgumentList typeArguments, Token leftBrac ket, List<MapLiteralEntry> entries, Token rightBracket) : super.full(modifier, t ypeArguments) {
8384 this._entries = new NodeList<MapLiteralEntry>(this); 8384 this._entries = new NodeList<MapLiteralEntry>(this);
8385 this._leftBracket = leftBracket; 8385 this._leftBracket = leftBracket;
8386 this._entries.addAll(entries); 8386 this._entries.addAll(entries);
8387 this._rightBracket = rightBracket; 8387 this._rightBracket = rightBracket;
8388 } 8388 }
8389 8389
8390 /** 8390 /**
8391 * Initialize a newly created map literal. 8391 * Initialize a newly created map literal.
8392 * @param modifier the const modifier associated with this literal 8392 * @param modifier the const modifier associated with this literal
8393 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type 8393 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
8394 * arguments were declared 8394 * arguments were declared
8395 * @param leftBracket the left curly bracket 8395 * @param leftBracket the left curly bracket
8396 * @param entries the entries in the map 8396 * @param entries the entries in the map
8397 * @param rightBracket the right curly bracket 8397 * @param rightBracket the right curly bracket
8398 */ 8398 */
8399 MapLiteral({Token modifier, TypeArgumentList typeArguments, Token leftBracket, List<MapLiteralEntry> entries, Token rightBracket}) : this.full(modifier, typeA rguments, leftBracket, entries, rightBracket); 8399 MapLiteral({Token modifier, TypeArgumentList typeArguments, Token leftBracket, List<MapLiteralEntry> entries, Token rightBracket}) : this.full(modifier, typeA rguments, leftBracket, entries, rightBracket);
8400 accept(ASTVisitor visitor) => visitor.visitMapLiteral(this); 8400 accept(ASTVisitor visitor) => visitor.visitMapLiteral(this);
8401 Token get beginToken { 8401 Token get beginToken {
8402 Token token = modifier; 8402 Token token = modifier;
8403 if (token != null) { 8403 if (token != null) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
8443 */ 8443 */
8444 void set rightBracket(Token bracket) { 8444 void set rightBracket(Token bracket) {
8445 _rightBracket = bracket; 8445 _rightBracket = bracket;
8446 } 8446 }
8447 void visitChildren(ASTVisitor<Object> visitor) { 8447 void visitChildren(ASTVisitor<Object> visitor) {
8448 super.visitChildren(visitor); 8448 super.visitChildren(visitor);
8449 _entries.accept(visitor); 8449 _entries.accept(visitor);
8450 } 8450 }
8451 } 8451 }
8452 /** 8452 /**
8453 * Instances of the class {@code MapLiteralEntry} represent a single key/value p air in a map 8453 * Instances of the class `MapLiteralEntry` represent a single key/value pair in a map
8454 * literal. 8454 * literal.
8455 * <pre> 8455 * <pre>
8456 * mapLiteralEntry ::={@link Expression key} ':' {@link Expression value}</pre> 8456 * mapLiteralEntry ::=[Expression key] ':' [Expression value]</pre>
8457 * @coverage dart.engine.ast 8457 * @coverage dart.engine.ast
8458 */ 8458 */
8459 class MapLiteralEntry extends ASTNode { 8459 class MapLiteralEntry extends ASTNode {
8460 8460
8461 /** 8461 /**
8462 * The expression computing the key with which the value will be associated. 8462 * The expression computing the key with which the value will be associated.
8463 */ 8463 */
8464 Expression _key; 8464 Expression _key;
8465 8465
8466 /** 8466 /**
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
8538 */ 8538 */
8539 void set value(Expression expression) { 8539 void set value(Expression expression) {
8540 _value = becomeParentOf(expression); 8540 _value = becomeParentOf(expression);
8541 } 8541 }
8542 void visitChildren(ASTVisitor<Object> visitor) { 8542 void visitChildren(ASTVisitor<Object> visitor) {
8543 safelyVisitChild(_key, visitor); 8543 safelyVisitChild(_key, visitor);
8544 safelyVisitChild(_value, visitor); 8544 safelyVisitChild(_value, visitor);
8545 } 8545 }
8546 } 8546 }
8547 /** 8547 /**
8548 * Instances of the class {@code MethodDeclaration} represent a method declarati on. 8548 * Instances of the class `MethodDeclaration` represent a method declaration.
8549 * <pre> 8549 * <pre>
8550 * methodDeclaration ::= 8550 * methodDeclaration ::=
8551 * methodSignature {@link FunctionBody body}methodSignature ::= 8551 * methodSignature [FunctionBody body]methodSignature ::=
8552 * 'external'? ('abstract' | 'static')? {@link Type returnType}? ('get' | 'set') ? methodName{@link FormalParameterList formalParameterList}methodName ::={@link SimpleIdentifier name}| 'operator' {@link SimpleIdentifier operator}</pre> 8552 * 'external'? ('abstract' | 'static')? [Type returnType]? ('get' | 'set')? meth odName[FormalParameterList formalParameterList]methodName ::=[SimpleIdentifier n ame]| 'operator' [SimpleIdentifier operator]</pre>
8553 * @coverage dart.engine.ast 8553 * @coverage dart.engine.ast
8554 */ 8554 */
8555 class MethodDeclaration extends ClassMember { 8555 class MethodDeclaration extends ClassMember {
8556 8556
8557 /** 8557 /**
8558 * The token for the 'external' keyword, or {@code null} if the constructor is not external. 8558 * The token for the 'external' keyword, or `null` if the constructor is not e xternal.
8559 */ 8559 */
8560 Token _externalKeyword; 8560 Token _externalKeyword;
8561 8561
8562 /** 8562 /**
8563 * The token representing the 'abstract' or 'static' keyword, or {@code null} if neither modifier 8563 * The token representing the 'abstract' or 'static' keyword, or `null` if nei ther modifier
8564 * was specified. 8564 * was specified.
8565 */ 8565 */
8566 Token _modifierKeyword; 8566 Token _modifierKeyword;
8567 8567
8568 /** 8568 /**
8569 * The return type of the method, or {@code null} if no return type was declar ed. 8569 * The return type of the method, or `null` if no return type was declared.
8570 */ 8570 */
8571 TypeName _returnType; 8571 TypeName _returnType;
8572 8572
8573 /** 8573 /**
8574 * The token representing the 'get' or 'set' keyword, or {@code null} if this is a method 8574 * The token representing the 'get' or 'set' keyword, or `null` if this is a m ethod
8575 * declaration rather than a property declaration. 8575 * declaration rather than a property declaration.
8576 */ 8576 */
8577 Token _propertyKeyword; 8577 Token _propertyKeyword;
8578 8578
8579 /** 8579 /**
8580 * The token representing the 'operator' keyword, or {@code null} if this meth od does not declare 8580 * The token representing the 'operator' keyword, or `null` if this method doe s not declare
8581 * an operator. 8581 * an operator.
8582 */ 8582 */
8583 Token _operatorKeyword; 8583 Token _operatorKeyword;
8584 8584
8585 /** 8585 /**
8586 * The name of the method. 8586 * The name of the method.
8587 */ 8587 */
8588 SimpleIdentifier _name; 8588 SimpleIdentifier _name;
8589 8589
8590 /** 8590 /**
8591 * The parameters associated with the method, or {@code null} if this method d eclares a getter. 8591 * The parameters associated with the method, or `null` if this method declare s a getter.
8592 */ 8592 */
8593 FormalParameterList _parameters; 8593 FormalParameterList _parameters;
8594 8594
8595 /** 8595 /**
8596 * The body of the method. 8596 * The body of the method.
8597 */ 8597 */
8598 FunctionBody _body; 8598 FunctionBody _body;
8599 8599
8600 /** 8600 /**
8601 * Initialize a newly created method declaration. 8601 * Initialize a newly created method declaration.
8602 * @param externalKeyword the token for the 'external' keyword 8602 * @param externalKeyword the token for the 'external' keyword
8603 * @param comment the documentation comment associated with this method 8603 * @param comment the documentation comment associated with this method
8604 * @param metadata the annotations associated with this method 8604 * @param metadata the annotations associated with this method
8605 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword 8605 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword
8606 * @param returnType the return type of the method 8606 * @param returnType the return type of the method
8607 * @param propertyKeyword the token representing the 'get' or 'set' keyword 8607 * @param propertyKeyword the token representing the 'get' or 'set' keyword
8608 * @param operatorKeyword the token representing the 'operator' keyword 8608 * @param operatorKeyword the token representing the 'operator' keyword
8609 * @param name the name of the method 8609 * @param name the name of the method
8610 * @param parameters the parameters associated with the method, or {@code null } if this method 8610 * @param parameters the parameters associated with the method, or `null` if t his method
8611 * declares a getter 8611 * declares a getter
8612 * @param body the body of the method 8612 * @param body the body of the method
8613 */ 8613 */
8614 MethodDeclaration.full(Comment comment, List<Annotation> metadata, Token exter nalKeyword, Token modifierKeyword, TypeName returnType, Token propertyKeyword, T oken operatorKeyword, SimpleIdentifier name, FormalParameterList parameters, Fun ctionBody body) : super.full(comment, metadata) { 8614 MethodDeclaration.full(Comment comment, List<Annotation> metadata, Token exter nalKeyword, Token modifierKeyword, TypeName returnType, Token propertyKeyword, T oken operatorKeyword, SimpleIdentifier name, FormalParameterList parameters, Fun ctionBody body) : super.full(comment, metadata) {
8615 this._externalKeyword = externalKeyword; 8615 this._externalKeyword = externalKeyword;
8616 this._modifierKeyword = modifierKeyword; 8616 this._modifierKeyword = modifierKeyword;
8617 this._returnType = becomeParentOf(returnType); 8617 this._returnType = becomeParentOf(returnType);
8618 this._propertyKeyword = propertyKeyword; 8618 this._propertyKeyword = propertyKeyword;
8619 this._operatorKeyword = operatorKeyword; 8619 this._operatorKeyword = operatorKeyword;
8620 this._name = becomeParentOf(name); 8620 this._name = becomeParentOf(name);
8621 this._parameters = becomeParentOf(parameters); 8621 this._parameters = becomeParentOf(parameters);
8622 this._body = becomeParentOf(body); 8622 this._body = becomeParentOf(body);
8623 } 8623 }
8624 8624
8625 /** 8625 /**
8626 * Initialize a newly created method declaration. 8626 * Initialize a newly created method declaration.
8627 * @param externalKeyword the token for the 'external' keyword 8627 * @param externalKeyword the token for the 'external' keyword
8628 * @param comment the documentation comment associated with this method 8628 * @param comment the documentation comment associated with this method
8629 * @param metadata the annotations associated with this method 8629 * @param metadata the annotations associated with this method
8630 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword 8630 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword
8631 * @param returnType the return type of the method 8631 * @param returnType the return type of the method
8632 * @param propertyKeyword the token representing the 'get' or 'set' keyword 8632 * @param propertyKeyword the token representing the 'get' or 'set' keyword
8633 * @param operatorKeyword the token representing the 'operator' keyword 8633 * @param operatorKeyword the token representing the 'operator' keyword
8634 * @param name the name of the method 8634 * @param name the name of the method
8635 * @param parameters the parameters associated with the method, or {@code null } if this method 8635 * @param parameters the parameters associated with the method, or `null` if t his method
8636 * declares a getter 8636 * declares a getter
8637 * @param body the body of the method 8637 * @param body the body of the method
8638 */ 8638 */
8639 MethodDeclaration({Comment comment, List<Annotation> metadata, Token externalK eyword, Token modifierKeyword, TypeName returnType, Token propertyKeyword, Token operatorKeyword, SimpleIdentifier name, FormalParameterList parameters, Functio nBody body}) : this.full(comment, metadata, externalKeyword, modifierKeyword, re turnType, propertyKeyword, operatorKeyword, name, parameters, body); 8639 MethodDeclaration({Comment comment, List<Annotation> metadata, Token externalK eyword, Token modifierKeyword, TypeName returnType, Token propertyKeyword, Token operatorKeyword, SimpleIdentifier name, FormalParameterList parameters, Functio nBody body}) : this.full(comment, metadata, externalKeyword, modifierKeyword, re turnType, propertyKeyword, operatorKeyword, name, parameters, body);
8640 accept(ASTVisitor visitor) => visitor.visitMethodDeclaration(this); 8640 accept(ASTVisitor visitor) => visitor.visitMethodDeclaration(this);
8641 8641
8642 /** 8642 /**
8643 * Return the body of the method. 8643 * Return the body of the method.
8644 * @return the body of the method 8644 * @return the body of the method
8645 */ 8645 */
8646 FunctionBody get body => _body; 8646 FunctionBody get body => _body;
8647 8647
8648 /** 8648 /**
8649 * Return the element associated with this method, or {@code null} if the AST structure has not 8649 * Return the element associated with this method, or `null` if the AST struct ure has not
8650 * been resolved. The element can either be a {@link MethodElement}, if this r epresents the 8650 * been resolved. The element can either be a [MethodElement], if this represe nts the
8651 * declaration of a normal method, or a {@link PropertyAccessorElement} if thi s represents the 8651 * declaration of a normal method, or a [PropertyAccessorElement] if this repr esents the
8652 * declaration of either a getter or a setter. 8652 * declaration of either a getter or a setter.
8653 * @return the element associated with this method 8653 * @return the element associated with this method
8654 */ 8654 */
8655 ExecutableElement get element => _name != null ? (_name.element as ExecutableE lement) : null; 8655 ExecutableElement get element => _name != null ? (_name.element as ExecutableE lement) : null;
8656 Token get endToken => _body.endToken; 8656 Token get endToken => _body.endToken;
8657 8657
8658 /** 8658 /**
8659 * Return the token for the 'external' keyword, or {@code null} if the constru ctor is not 8659 * Return the token for the 'external' keyword, or `null` if the constructor i s not
8660 * external. 8660 * external.
8661 * @return the token for the 'external' keyword 8661 * @return the token for the 'external' keyword
8662 */ 8662 */
8663 Token get externalKeyword => _externalKeyword; 8663 Token get externalKeyword => _externalKeyword;
8664 8664
8665 /** 8665 /**
8666 * Return the token representing the 'abstract' or 'static' keyword, or {@code null} if neither 8666 * Return the token representing the 'abstract' or 'static' keyword, or `null` if neither
8667 * modifier was specified. 8667 * modifier was specified.
8668 * @return the token representing the 'abstract' or 'static' keyword 8668 * @return the token representing the 'abstract' or 'static' keyword
8669 */ 8669 */
8670 Token get modifierKeyword => _modifierKeyword; 8670 Token get modifierKeyword => _modifierKeyword;
8671 8671
8672 /** 8672 /**
8673 * Return the name of the method. 8673 * Return the name of the method.
8674 * @return the name of the method 8674 * @return the name of the method
8675 */ 8675 */
8676 SimpleIdentifier get name => _name; 8676 SimpleIdentifier get name => _name;
8677 8677
8678 /** 8678 /**
8679 * Return the token representing the 'operator' keyword, or {@code null} if th is method does not 8679 * Return the token representing the 'operator' keyword, or `null` if this met hod does not
8680 * declare an operator. 8680 * declare an operator.
8681 * @return the token representing the 'operator' keyword 8681 * @return the token representing the 'operator' keyword
8682 */ 8682 */
8683 Token get operatorKeyword => _operatorKeyword; 8683 Token get operatorKeyword => _operatorKeyword;
8684 8684
8685 /** 8685 /**
8686 * Return the parameters associated with the method, or {@code null} if this m ethod declares a 8686 * Return the parameters associated with the method, or `null` if this method declares a
8687 * getter. 8687 * getter.
8688 * @return the parameters associated with the method 8688 * @return the parameters associated with the method
8689 */ 8689 */
8690 FormalParameterList get parameters => _parameters; 8690 FormalParameterList get parameters => _parameters;
8691 8691
8692 /** 8692 /**
8693 * Return the token representing the 'get' or 'set' keyword, or {@code null} i f this is a method 8693 * Return the token representing the 'get' or 'set' keyword, or `null` if this is a method
8694 * declaration rather than a property declaration. 8694 * declaration rather than a property declaration.
8695 * @return the token representing the 'get' or 'set' keyword 8695 * @return the token representing the 'get' or 'set' keyword
8696 */ 8696 */
8697 Token get propertyKeyword => _propertyKeyword; 8697 Token get propertyKeyword => _propertyKeyword;
8698 8698
8699 /** 8699 /**
8700 * Return the return type of the method, or {@code null} if no return type was declared. 8700 * Return the return type of the method, or `null` if no return type was decla red.
8701 * @return the return type of the method 8701 * @return the return type of the method
8702 */ 8702 */
8703 TypeName get returnType => _returnType; 8703 TypeName get returnType => _returnType;
8704 8704
8705 /** 8705 /**
8706 * Return {@code true} if this method is declared to be an abstract method. 8706 * Return `true` if this method is declared to be an abstract method.
8707 * @return {@code true} if this method is declared to be an abstract method 8707 * @return `true` if this method is declared to be an abstract method
8708 */ 8708 */
8709 bool isAbstract() => _externalKeyword == null && (_body is EmptyFunctionBody); 8709 bool isAbstract() => _externalKeyword == null && (_body is EmptyFunctionBody);
8710 8710
8711 /** 8711 /**
8712 * Return {@code true} if this method declares a getter. 8712 * Return `true` if this method declares a getter.
8713 * @return {@code true} if this method declares a getter 8713 * @return `true` if this method declares a getter
8714 */ 8714 */
8715 bool isGetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET); 8715 bool isGetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET);
8716 8716
8717 /** 8717 /**
8718 * Return {@code true} if this method declares an operator. 8718 * Return `true` if this method declares an operator.
8719 * @return {@code true} if this method declares an operator 8719 * @return `true` if this method declares an operator
8720 */ 8720 */
8721 bool isOperator() => _operatorKeyword != null; 8721 bool isOperator() => _operatorKeyword != null;
8722 8722
8723 /** 8723 /**
8724 * Return {@code true} if this method declares a setter. 8724 * Return `true` if this method declares a setter.
8725 * @return {@code true} if this method declares a setter 8725 * @return `true` if this method declares a setter
8726 */ 8726 */
8727 bool isSetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET); 8727 bool isSetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET);
8728 8728
8729 /** 8729 /**
8730 * Return {@code true} if this method is declared to be a static method. 8730 * Return `true` if this method is declared to be a static method.
8731 * @return {@code true} if this method is declared to be a static method 8731 * @return `true` if this method is declared to be a static method
8732 */ 8732 */
8733 bool isStatic() => _modifierKeyword != null && identical(((_modifierKeyword as KeywordToken)).keyword, Keyword.STATIC); 8733 bool isStatic() => _modifierKeyword != null && identical(((_modifierKeyword as KeywordToken)).keyword, Keyword.STATIC);
8734 8734
8735 /** 8735 /**
8736 * Set the body of the method to the given function body. 8736 * Set the body of the method to the given function body.
8737 * @param functionBody the body of the method 8737 * @param functionBody the body of the method
8738 */ 8738 */
8739 void set body(FunctionBody functionBody) { 8739 void set body(FunctionBody functionBody) {
8740 _body = becomeParentOf(functionBody); 8740 _body = becomeParentOf(functionBody);
8741 } 8741 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
8809 return _returnType.beginToken; 8809 return _returnType.beginToken;
8810 } else if (_propertyKeyword != null) { 8810 } else if (_propertyKeyword != null) {
8811 return _propertyKeyword; 8811 return _propertyKeyword;
8812 } else if (_operatorKeyword != null) { 8812 } else if (_operatorKeyword != null) {
8813 return _operatorKeyword; 8813 return _operatorKeyword;
8814 } 8814 }
8815 return _name.beginToken; 8815 return _name.beginToken;
8816 } 8816 }
8817 } 8817 }
8818 /** 8818 /**
8819 * Instances of the class {@code MethodInvocation} represent the invocation of e ither a function or 8819 * Instances of the class `MethodInvocation` represent the invocation of either a function or
8820 * a method. Invocations of functions resulting from evaluating an expression ar e represented by{@link FunctionExpressionInvocation function expression invocati on} nodes. Invocations of getters 8820 * a method. Invocations of functions resulting from evaluating an expression ar e represented by[FunctionExpressionInvocation function expression invocation] no des. Invocations of getters
8821 * and setters are represented by either {@link PrefixedIdentifier prefixed iden tifier} or{@link PropertyAccess property access} nodes. 8821 * and setters are represented by either [PrefixedIdentifier prefixed identifier ] or[PropertyAccess property access] nodes.
8822 * <pre> 8822 * <pre>
8823 * methodInvoction ::= 8823 * methodInvoction ::=
8824 * ({@link Expression target} '.')? {@link SimpleIdentifier methodName} {@link A rgumentList argumentList}</pre> 8824 * ([Expression target] '.')? [SimpleIdentifier methodName] [ArgumentList argume ntList]</pre>
8825 * @coverage dart.engine.ast 8825 * @coverage dart.engine.ast
8826 */ 8826 */
8827 class MethodInvocation extends Expression { 8827 class MethodInvocation extends Expression {
8828 8828
8829 /** 8829 /**
8830 * The expression producing the object on which the method is defined, or {@co de null} if there is 8830 * The expression producing the object on which the method is defined, or `nul l` if there is
8831 * no target (that is, the target is implicitly {@code this}). 8831 * no target (that is, the target is implicitly `this`).
8832 */ 8832 */
8833 Expression _target; 8833 Expression _target;
8834 8834
8835 /** 8835 /**
8836 * The period that separates the target from the method name, or {@code null} if there is no 8836 * The period that separates the target from the method name, or `null` if the re is no
8837 * target. 8837 * target.
8838 */ 8838 */
8839 Token _period; 8839 Token _period;
8840 8840
8841 /** 8841 /**
8842 * The name of the method being invoked. 8842 * The name of the method being invoked.
8843 */ 8843 */
8844 SimpleIdentifier _methodName; 8844 SimpleIdentifier _methodName;
8845 8845
8846 /** 8846 /**
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
8887 } 8887 }
8888 Token get endToken => _argumentList.endToken; 8888 Token get endToken => _argumentList.endToken;
8889 8889
8890 /** 8890 /**
8891 * Return the name of the method being invoked. 8891 * Return the name of the method being invoked.
8892 * @return the name of the method being invoked 8892 * @return the name of the method being invoked
8893 */ 8893 */
8894 SimpleIdentifier get methodName => _methodName; 8894 SimpleIdentifier get methodName => _methodName;
8895 8895
8896 /** 8896 /**
8897 * Return the period that separates the target from the method name, or {@code null} if there is 8897 * Return the period that separates the target from the method name, or `null` if there is
8898 * no target. 8898 * no target.
8899 * @return the period that separates the target from the method name 8899 * @return the period that separates the target from the method name
8900 */ 8900 */
8901 Token get period => _period; 8901 Token get period => _period;
8902 8902
8903 /** 8903 /**
8904 * Return the expression used to compute the receiver of the invocation. If th is invocation is not 8904 * Return the expression used to compute the receiver of the invocation. If th is invocation is not
8905 * part of a cascade expression, then this is the same as {@link #getTarget()} . If this invocation 8905 * part of a cascade expression, then this is the same as [getTarget]. If this invocation
8906 * is part of a cascade expression, then the target stored with the cascade ex pression is 8906 * is part of a cascade expression, then the target stored with the cascade ex pression is
8907 * returned. 8907 * returned.
8908 * @return the expression used to compute the receiver of the invocation 8908 * @return the expression used to compute the receiver of the invocation
8909 * @see #getTarget() 8909 * @see #getTarget()
8910 */ 8910 */
8911 Expression get realTarget { 8911 Expression get realTarget {
8912 if (isCascaded()) { 8912 if (isCascaded()) {
8913 ASTNode ancestor = parent; 8913 ASTNode ancestor = parent;
8914 while (ancestor is! CascadeExpression) { 8914 while (ancestor is! CascadeExpression) {
8915 if (ancestor == null) { 8915 if (ancestor == null) {
8916 return _target; 8916 return _target;
8917 } 8917 }
8918 ancestor = ancestor.parent; 8918 ancestor = ancestor.parent;
8919 } 8919 }
8920 return ((ancestor as CascadeExpression)).target; 8920 return ((ancestor as CascadeExpression)).target;
8921 } 8921 }
8922 return _target; 8922 return _target;
8923 } 8923 }
8924 8924
8925 /** 8925 /**
8926 * Return the expression producing the object on which the method is defined, or {@code null} if 8926 * Return the expression producing the object on which the method is defined, or `null` if
8927 * there is no target (that is, the target is implicitly {@code this}) or if t his method 8927 * there is no target (that is, the target is implicitly `this`) or if this me thod
8928 * invocation is part of a cascade expression. 8928 * invocation is part of a cascade expression.
8929 * @return the expression producing the object on which the method is defined 8929 * @return the expression producing the object on which the method is defined
8930 * @see #getRealTarget() 8930 * @see #getRealTarget()
8931 */ 8931 */
8932 Expression get target => _target; 8932 Expression get target => _target;
8933 8933
8934 /** 8934 /**
8935 * Return {@code true} if this expression is cascaded. If it is, then the targ et of this 8935 * Return `true` if this expression is cascaded. If it is, then the target of this
8936 * expression is not stored locally but is stored in the nearest ancestor that is a{@link CascadeExpression}. 8936 * expression is not stored locally but is stored in the nearest ancestor that is a[CascadeExpression].
8937 * @return {@code true} if this expression is cascaded 8937 * @return `true` if this expression is cascaded
8938 */ 8938 */
8939 bool isCascaded() => _period != null && identical(_period.type, TokenType.PERI OD_PERIOD); 8939 bool isCascaded() => _period != null && identical(_period.type, TokenType.PERI OD_PERIOD);
8940 8940
8941 /** 8941 /**
8942 * Set the list of arguments to the method to the given list. 8942 * Set the list of arguments to the method to the given list.
8943 * @param argumentList the list of arguments to the method 8943 * @param argumentList the list of arguments to the method
8944 */ 8944 */
8945 void set argumentList(ArgumentList argumentList2) { 8945 void set argumentList(ArgumentList argumentList2) {
8946 this._argumentList = becomeParentOf(argumentList2); 8946 this._argumentList = becomeParentOf(argumentList2);
8947 } 8947 }
(...skipping 21 matching lines...) Expand all
8969 void set target(Expression expression) { 8969 void set target(Expression expression) {
8970 _target = becomeParentOf(expression); 8970 _target = becomeParentOf(expression);
8971 } 8971 }
8972 void visitChildren(ASTVisitor<Object> visitor) { 8972 void visitChildren(ASTVisitor<Object> visitor) {
8973 safelyVisitChild(_target, visitor); 8973 safelyVisitChild(_target, visitor);
8974 safelyVisitChild(_methodName, visitor); 8974 safelyVisitChild(_methodName, visitor);
8975 safelyVisitChild(_argumentList, visitor); 8975 safelyVisitChild(_argumentList, visitor);
8976 } 8976 }
8977 } 8977 }
8978 /** 8978 /**
8979 * Instances of the class {@code NamedExpression} represent an expression that h as a name associated 8979 * Instances of the class `NamedExpression` represent an expression that has a n ame associated
8980 * with it. They are used in method invocations when there are named parameters. 8980 * with it. They are used in method invocations when there are named parameters.
8981 * <pre> 8981 * <pre>
8982 * namedExpression ::={@link Label name} {@link Expression expression}</pre> 8982 * namedExpression ::=[Label name] [Expression expression]</pre>
8983 * @coverage dart.engine.ast 8983 * @coverage dart.engine.ast
8984 */ 8984 */
8985 class NamedExpression extends Expression { 8985 class NamedExpression extends Expression {
8986 8986
8987 /** 8987 /**
8988 * The name associated with the expression. 8988 * The name associated with the expression.
8989 */ 8989 */
8990 Label _name; 8990 Label _name;
8991 8991
8992 /** 8992 /**
(...skipping 14 matching lines...) Expand all
9007 /** 9007 /**
9008 * Initialize a newly created named expression. 9008 * Initialize a newly created named expression.
9009 * @param name the name associated with the expression 9009 * @param name the name associated with the expression
9010 * @param expression the expression with which the name is associated 9010 * @param expression the expression with which the name is associated
9011 */ 9011 */
9012 NamedExpression({Label name, Expression expression}) : this.full(name, express ion); 9012 NamedExpression({Label name, Expression expression}) : this.full(name, express ion);
9013 accept(ASTVisitor visitor) => visitor.visitNamedExpression(this); 9013 accept(ASTVisitor visitor) => visitor.visitNamedExpression(this);
9014 Token get beginToken => _name.beginToken; 9014 Token get beginToken => _name.beginToken;
9015 9015
9016 /** 9016 /**
9017 * Return the element representing the parameter being named by this expressio n, or {@code null}if the AST structure has not been resolved or if there is no p arameter with the same name as 9017 * Return the element representing the parameter being named by this expressio n, or `null`if the AST structure has not been resolved or if there is no paramet er with the same name as
9018 * this expression. 9018 * this expression.
9019 * @return the element representing the parameter being named by this expressi on 9019 * @return the element representing the parameter being named by this expressi on
9020 */ 9020 */
9021 ParameterElement get element { 9021 ParameterElement get element {
9022 Element element = _name.label.element; 9022 Element element = _name.label.element;
9023 if (element is ParameterElement) { 9023 if (element is ParameterElement) {
9024 return element as ParameterElement; 9024 return element as ParameterElement;
9025 } 9025 }
9026 return null; 9026 return null;
9027 } 9027 }
(...skipping 25 matching lines...) Expand all
9053 */ 9053 */
9054 void set name(Label identifier) { 9054 void set name(Label identifier) {
9055 _name = becomeParentOf(identifier); 9055 _name = becomeParentOf(identifier);
9056 } 9056 }
9057 void visitChildren(ASTVisitor<Object> visitor) { 9057 void visitChildren(ASTVisitor<Object> visitor) {
9058 safelyVisitChild(_name, visitor); 9058 safelyVisitChild(_name, visitor);
9059 safelyVisitChild(_expression, visitor); 9059 safelyVisitChild(_expression, visitor);
9060 } 9060 }
9061 } 9061 }
9062 /** 9062 /**
9063 * The abstract class {@code NamespaceDirective} defines the behavior common to nodes that represent 9063 * The abstract class `NamespaceDirective` defines the behavior common to nodes that represent
9064 * a directive that impacts the namespace of a library. 9064 * a directive that impacts the namespace of a library.
9065 * <pre> 9065 * <pre>
9066 * directive ::={@link ExportDirective exportDirective}| {@link ImportDirective importDirective}</pre> 9066 * directive ::=[ExportDirective exportDirective]| [ImportDirective importDirect ive]</pre>
9067 * @coverage dart.engine.ast 9067 * @coverage dart.engine.ast
9068 */ 9068 */
9069 abstract class NamespaceDirective extends UriBasedDirective { 9069 abstract class NamespaceDirective extends UriBasedDirective {
9070 9070
9071 /** 9071 /**
9072 * The token representing the 'import' or 'export' keyword. 9072 * The token representing the 'import' or 'export' keyword.
9073 */ 9073 */
9074 Token _keyword; 9074 Token _keyword;
9075 9075
9076 /** 9076 /**
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
9136 /** 9136 /**
9137 * Set the semicolon terminating the directive to the given token. 9137 * Set the semicolon terminating the directive to the given token.
9138 * @param semicolon the semicolon terminating the directive 9138 * @param semicolon the semicolon terminating the directive
9139 */ 9139 */
9140 void set semicolon(Token semicolon2) { 9140 void set semicolon(Token semicolon2) {
9141 this._semicolon = semicolon2; 9141 this._semicolon = semicolon2;
9142 } 9142 }
9143 Token get firstTokenAfterCommentAndMetadata => _keyword; 9143 Token get firstTokenAfterCommentAndMetadata => _keyword;
9144 } 9144 }
9145 /** 9145 /**
9146 * Instances of the class {@code NativeFunctionBody} represent a function body t hat consists of a 9146 * Instances of the class `NativeFunctionBody` represent a function body that co nsists of a
9147 * native keyword followed by a string literal. 9147 * native keyword followed by a string literal.
9148 * <pre> 9148 * <pre>
9149 * nativeFunctionBody ::= 9149 * nativeFunctionBody ::=
9150 * 'native' {@link SimpleStringLiteral simpleStringLiteral} ';' 9150 * 'native' [SimpleStringLiteral simpleStringLiteral] ';'
9151 * </pre> 9151 * </pre>
9152 * @coverage dart.engine.ast 9152 * @coverage dart.engine.ast
9153 */ 9153 */
9154 class NativeFunctionBody extends FunctionBody { 9154 class NativeFunctionBody extends FunctionBody {
9155 9155
9156 /** 9156 /**
9157 * The token representing 'native' that marks the start of the function body. 9157 * The token representing 'native' that marks the start of the function body.
9158 */ 9158 */
9159 Token _nativeToken; 9159 Token _nativeToken;
9160 9160
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
9208 /** 9208 /**
9209 * Return the string literal representing the string after the 'native' token. 9209 * Return the string literal representing the string after the 'native' token.
9210 * @return the string literal representing the string after the 'native' token 9210 * @return the string literal representing the string after the 'native' token
9211 */ 9211 */
9212 StringLiteral get stringLiteral => _stringLiteral; 9212 StringLiteral get stringLiteral => _stringLiteral;
9213 void visitChildren(ASTVisitor<Object> visitor) { 9213 void visitChildren(ASTVisitor<Object> visitor) {
9214 safelyVisitChild(_stringLiteral, visitor); 9214 safelyVisitChild(_stringLiteral, visitor);
9215 } 9215 }
9216 } 9216 }
9217 /** 9217 /**
9218 * The abstract class {@code NormalFormalParameter} defines the behavior common to formal parameters 9218 * The abstract class `NormalFormalParameter` defines the behavior common to for mal parameters
9219 * that are required (are not optional). 9219 * that are required (are not optional).
9220 * <pre> 9220 * <pre>
9221 * normalFormalParameter ::={@link FunctionTypedFormalParameter functionSignatur e}| {@link FieldFormalParameter fieldFormalParameter}| {@link SimpleFormalParame ter simpleFormalParameter}</pre> 9221 * normalFormalParameter ::=[FunctionTypedFormalParameter functionSignature]| [F ieldFormalParameter fieldFormalParameter]| [SimpleFormalParameter simpleFormalPa rameter]</pre>
9222 * @coverage dart.engine.ast 9222 * @coverage dart.engine.ast
9223 */ 9223 */
9224 abstract class NormalFormalParameter extends FormalParameter { 9224 abstract class NormalFormalParameter extends FormalParameter {
9225 9225
9226 /** 9226 /**
9227 * The documentation comment associated with this parameter, or {@code null} i f this parameter 9227 * The documentation comment associated with this parameter, or `null` if this parameter
9228 * does not have a documentation comment associated with it. 9228 * does not have a documentation comment associated with it.
9229 */ 9229 */
9230 Comment _comment; 9230 Comment _comment;
9231 9231
9232 /** 9232 /**
9233 * The annotations associated with this parameter. 9233 * The annotations associated with this parameter.
9234 */ 9234 */
9235 NodeList<Annotation> _metadata; 9235 NodeList<Annotation> _metadata;
9236 9236
9237 /** 9237 /**
(...skipping 16 matching lines...) Expand all
9254 9254
9255 /** 9255 /**
9256 * Initialize a newly created formal parameter. 9256 * Initialize a newly created formal parameter.
9257 * @param comment the documentation comment associated with this parameter 9257 * @param comment the documentation comment associated with this parameter
9258 * @param metadata the annotations associated with this parameter 9258 * @param metadata the annotations associated with this parameter
9259 * @param identifier the name of the parameter being declared 9259 * @param identifier the name of the parameter being declared
9260 */ 9260 */
9261 NormalFormalParameter({Comment comment, List<Annotation> metadata, SimpleIdent ifier identifier}) : this.full(comment, metadata, identifier); 9261 NormalFormalParameter({Comment comment, List<Annotation> metadata, SimpleIdent ifier identifier}) : this.full(comment, metadata, identifier);
9262 9262
9263 /** 9263 /**
9264 * Return the documentation comment associated with this parameter, or {@code null} if this 9264 * Return the documentation comment associated with this parameter, or `null` if this
9265 * parameter does not have a documentation comment associated with it. 9265 * parameter does not have a documentation comment associated with it.
9266 * @return the documentation comment associated with this parameter 9266 * @return the documentation comment associated with this parameter
9267 */ 9267 */
9268 Comment get documentationComment => _comment; 9268 Comment get documentationComment => _comment;
9269 SimpleIdentifier get identifier => _identifier; 9269 SimpleIdentifier get identifier => _identifier;
9270 ParameterKind get kind { 9270 ParameterKind get kind {
9271 ASTNode parent = this.parent; 9271 ASTNode parent = this.parent;
9272 if (parent is DefaultFormalParameter) { 9272 if (parent is DefaultFormalParameter) {
9273 return ((parent as DefaultFormalParameter)).kind; 9273 return ((parent as DefaultFormalParameter)).kind;
9274 } 9274 }
9275 return ParameterKind.REQUIRED; 9275 return ParameterKind.REQUIRED;
9276 } 9276 }
9277 9277
9278 /** 9278 /**
9279 * Return the annotations associated with this parameter. 9279 * Return the annotations associated with this parameter.
9280 * @return the annotations associated with this parameter 9280 * @return the annotations associated with this parameter
9281 */ 9281 */
9282 NodeList<Annotation> get metadata => _metadata; 9282 NodeList<Annotation> get metadata => _metadata;
9283 9283
9284 /** 9284 /**
9285 * Return {@code true} if this parameter was declared with the 'const' modifie r. 9285 * Return `true` if this parameter was declared with the 'const' modifier.
9286 * @return {@code true} if this parameter was declared with the 'const' modifi er 9286 * @return `true` if this parameter was declared with the 'const' modifier
9287 */ 9287 */
9288 bool isConst(); 9288 bool isConst();
9289 9289
9290 /** 9290 /**
9291 * Return {@code true} if this parameter was declared with the 'final' modifie r. Parameters that 9291 * Return `true` if this parameter was declared with the 'final' modifier. Par ameters that
9292 * are declared with the 'const' modifier will return {@code false} even thoug h they are 9292 * are declared with the 'const' modifier will return `false` even though they are
9293 * implicitly final. 9293 * implicitly final.
9294 * @return {@code true} if this parameter was declared with the 'final' modifi er 9294 * @return `true` if this parameter was declared with the 'final' modifier
9295 */ 9295 */
9296 bool isFinal(); 9296 bool isFinal();
9297 9297
9298 /** 9298 /**
9299 * Set the documentation comment associated with this parameter to the given c omment 9299 * Set the documentation comment associated with this parameter to the given c omment
9300 * @param comment the documentation comment to be associated with this paramet er 9300 * @param comment the documentation comment to be associated with this paramet er
9301 */ 9301 */
9302 void set documentationComment(Comment comment2) { 9302 void set documentationComment(Comment comment2) {
9303 this._comment = becomeParentOf(comment2); 9303 this._comment = becomeParentOf(comment2);
9304 } 9304 }
(...skipping 10 matching lines...) Expand all
9315 safelyVisitChild(_comment, visitor); 9315 safelyVisitChild(_comment, visitor);
9316 _metadata.accept(visitor); 9316 _metadata.accept(visitor);
9317 } else { 9317 } else {
9318 for (ASTNode child in sortedCommentAndAnnotations) { 9318 for (ASTNode child in sortedCommentAndAnnotations) {
9319 child.accept(visitor); 9319 child.accept(visitor);
9320 } 9320 }
9321 } 9321 }
9322 } 9322 }
9323 9323
9324 /** 9324 /**
9325 * Return {@code true} if the comment is lexically before any annotations. 9325 * Return `true` if the comment is lexically before any annotations.
9326 * @return {@code true} if the comment is lexically before any annotations 9326 * @return `true` if the comment is lexically before any annotations
9327 */ 9327 */
9328 bool commentIsBeforeAnnotations() { 9328 bool commentIsBeforeAnnotations() {
9329 if (_comment == null || _metadata.isEmpty) { 9329 if (_comment == null || _metadata.isEmpty) {
9330 return true; 9330 return true;
9331 } 9331 }
9332 Annotation firstAnnotation = _metadata[0]; 9332 Annotation firstAnnotation = _metadata[0];
9333 return _comment.offset < firstAnnotation.offset; 9333 return _comment.offset < firstAnnotation.offset;
9334 } 9334 }
9335 9335
9336 /** 9336 /**
9337 * Return an array containing the comment and annotations associated with this parameter, sorted 9337 * Return an array containing the comment and annotations associated with this parameter, sorted
9338 * in lexical order. 9338 * in lexical order.
9339 * @return the comment and annotations associated with this parameter in the o rder in which they 9339 * @return the comment and annotations associated with this parameter in the o rder in which they
9340 * appeared in the original source 9340 * appeared in the original source
9341 */ 9341 */
9342 List<ASTNode> get sortedCommentAndAnnotations { 9342 List<ASTNode> get sortedCommentAndAnnotations {
9343 List<ASTNode> childList = new List<ASTNode>(); 9343 List<ASTNode> childList = new List<ASTNode>();
9344 childList.add(_comment); 9344 childList.add(_comment);
9345 childList.addAll(_metadata); 9345 childList.addAll(_metadata);
9346 List<ASTNode> children = new List.from(childList); 9346 List<ASTNode> children = new List.from(childList);
9347 children.sort(ASTNode.LEXICAL_ORDER); 9347 children.sort(ASTNode.LEXICAL_ORDER);
9348 return children; 9348 return children;
9349 } 9349 }
9350 } 9350 }
9351 /** 9351 /**
9352 * Instances of the class {@code NullLiteral} represent a null literal expressio n. 9352 * Instances of the class `NullLiteral` represent a null literal expression.
9353 * <pre> 9353 * <pre>
9354 * nullLiteral ::= 9354 * nullLiteral ::=
9355 * 'null' 9355 * 'null'
9356 * </pre> 9356 * </pre>
9357 * @coverage dart.engine.ast 9357 * @coverage dart.engine.ast
9358 */ 9358 */
9359 class NullLiteral extends Literal { 9359 class NullLiteral extends Literal {
9360 9360
9361 /** 9361 /**
9362 * The token representing the literal. 9362 * The token representing the literal.
(...skipping 27 matching lines...) Expand all
9390 * Set the token representing the literal to the given token. 9390 * Set the token representing the literal to the given token.
9391 * @param literal the token representing the literal 9391 * @param literal the token representing the literal
9392 */ 9392 */
9393 void set literal(Token literal2) { 9393 void set literal(Token literal2) {
9394 this._literal = literal2; 9394 this._literal = literal2;
9395 } 9395 }
9396 void visitChildren(ASTVisitor<Object> visitor) { 9396 void visitChildren(ASTVisitor<Object> visitor) {
9397 } 9397 }
9398 } 9398 }
9399 /** 9399 /**
9400 * Instances of the class {@code ParenthesizedExpression} represent a parenthesi zed expression. 9400 * Instances of the class `ParenthesizedExpression` represent a parenthesized ex pression.
9401 * <pre> 9401 * <pre>
9402 * parenthesizedExpression ::= 9402 * parenthesizedExpression ::=
9403 * '(' {@link Expression expression} ')' 9403 * '(' [Expression expression] ')'
9404 * </pre> 9404 * </pre>
9405 * @coverage dart.engine.ast 9405 * @coverage dart.engine.ast
9406 */ 9406 */
9407 class ParenthesizedExpression extends Expression { 9407 class ParenthesizedExpression extends Expression {
9408 9408
9409 /** 9409 /**
9410 * The left parenthesis. 9410 * The left parenthesis.
9411 */ 9411 */
9412 Token _leftParenthesis; 9412 Token _leftParenthesis;
9413 9413
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
9483 * @param parenthesis the right parenthesis 9483 * @param parenthesis the right parenthesis
9484 */ 9484 */
9485 void set rightParenthesis(Token parenthesis) { 9485 void set rightParenthesis(Token parenthesis) {
9486 _rightParenthesis = parenthesis; 9486 _rightParenthesis = parenthesis;
9487 } 9487 }
9488 void visitChildren(ASTVisitor<Object> visitor) { 9488 void visitChildren(ASTVisitor<Object> visitor) {
9489 safelyVisitChild(_expression, visitor); 9489 safelyVisitChild(_expression, visitor);
9490 } 9490 }
9491 } 9491 }
9492 /** 9492 /**
9493 * Instances of the class {@code PartDirective} represent a part directive. 9493 * Instances of the class `PartDirective` represent a part directive.
9494 * <pre> 9494 * <pre>
9495 * partDirective ::={@link Annotation metadata} 'part' {@link StringLiteral part Uri} ';' 9495 * partDirective ::=[Annotation metadata] 'part' [StringLiteral partUri] ';'
9496 * </pre> 9496 * </pre>
9497 * @coverage dart.engine.ast 9497 * @coverage dart.engine.ast
9498 */ 9498 */
9499 class PartDirective extends UriBasedDirective { 9499 class PartDirective extends UriBasedDirective {
9500 9500
9501 /** 9501 /**
9502 * The token representing the 'part' token. 9502 * The token representing the 'part' token.
9503 */ 9503 */
9504 Token _partToken; 9504 Token _partToken;
9505 9505
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
9558 /** 9558 /**
9559 * Set the semicolon terminating the directive to the given token. 9559 * Set the semicolon terminating the directive to the given token.
9560 * @param semicolon the semicolon terminating the directive 9560 * @param semicolon the semicolon terminating the directive
9561 */ 9561 */
9562 void set semicolon(Token semicolon2) { 9562 void set semicolon(Token semicolon2) {
9563 this._semicolon = semicolon2; 9563 this._semicolon = semicolon2;
9564 } 9564 }
9565 Token get firstTokenAfterCommentAndMetadata => _partToken; 9565 Token get firstTokenAfterCommentAndMetadata => _partToken;
9566 } 9566 }
9567 /** 9567 /**
9568 * Instances of the class {@code PartOfDirective} represent a part-of directive. 9568 * Instances of the class `PartOfDirective` represent a part-of directive.
9569 * <pre> 9569 * <pre>
9570 * partOfDirective ::={@link Annotation metadata} 'part' 'of' {@link Identifier libraryName} ';' 9570 * partOfDirective ::=[Annotation metadata] 'part' 'of' [Identifier libraryName] ';'
9571 * </pre> 9571 * </pre>
9572 * @coverage dart.engine.ast 9572 * @coverage dart.engine.ast
9573 */ 9573 */
9574 class PartOfDirective extends Directive { 9574 class PartOfDirective extends Directive {
9575 9575
9576 /** 9576 /**
9577 * The token representing the 'part' token. 9577 * The token representing the 'part' token.
9578 */ 9578 */
9579 Token _partToken; 9579 Token _partToken;
9580 9580
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
9678 void set semicolon(Token semicolon2) { 9678 void set semicolon(Token semicolon2) {
9679 this._semicolon = semicolon2; 9679 this._semicolon = semicolon2;
9680 } 9680 }
9681 void visitChildren(ASTVisitor<Object> visitor) { 9681 void visitChildren(ASTVisitor<Object> visitor) {
9682 super.visitChildren(visitor); 9682 super.visitChildren(visitor);
9683 safelyVisitChild(_libraryName, visitor); 9683 safelyVisitChild(_libraryName, visitor);
9684 } 9684 }
9685 Token get firstTokenAfterCommentAndMetadata => _partToken; 9685 Token get firstTokenAfterCommentAndMetadata => _partToken;
9686 } 9686 }
9687 /** 9687 /**
9688 * Instances of the class {@code PostfixExpression} represent a postfix unary ex pression. 9688 * Instances of the class `PostfixExpression` represent a postfix unary expressi on.
9689 * <pre> 9689 * <pre>
9690 * postfixExpression ::={@link Expression operand} {@link Token operator}</pre> 9690 * postfixExpression ::=[Expression operand] [Token operator]</pre>
9691 * @coverage dart.engine.ast 9691 * @coverage dart.engine.ast
9692 */ 9692 */
9693 class PostfixExpression extends Expression { 9693 class PostfixExpression extends Expression {
9694 9694
9695 /** 9695 /**
9696 * The expression computing the operand for the operator. 9696 * The expression computing the operand for the operator.
9697 */ 9697 */
9698 Expression _operand; 9698 Expression _operand;
9699 9699
9700 /** 9700 /**
9701 * The postfix operator being applied to the operand. 9701 * The postfix operator being applied to the operand.
9702 */ 9702 */
9703 Token _operator; 9703 Token _operator;
9704 9704
9705 /** 9705 /**
9706 * The element associated with this the operator based on the propagated type of the operand, or{@code null} if the AST structure has not been resolved, if th e operator is not user definable, 9706 * The element associated with this the operator based on the propagated type of the operand, or`null` if the AST structure has not been resolved, if the oper ator is not user definable,
9707 * or if the operator could not be resolved. 9707 * or if the operator could not be resolved.
9708 */ 9708 */
9709 MethodElement _propagatedElement; 9709 MethodElement _propagatedElement;
9710 9710
9711 /** 9711 /**
9712 * The element associated with the operator based on the static type of the op erand, or{@code null} if the AST structure has not been resolved, if the operato r is not user definable, 9712 * The element associated with the operator based on the static type of the op erand, or`null` if the AST structure has not been resolved, if the operator is n ot user definable,
9713 * or if the operator could not be resolved. 9713 * or if the operator could not be resolved.
9714 */ 9714 */
9715 MethodElement _staticElement; 9715 MethodElement _staticElement;
9716 9716
9717 /** 9717 /**
9718 * Initialize a newly created postfix expression. 9718 * Initialize a newly created postfix expression.
9719 * @param operand the expression computing the operand for the operator 9719 * @param operand the expression computing the operand for the operator
9720 * @param operator the postfix operator being applied to the operand 9720 * @param operator the postfix operator being applied to the operand
9721 */ 9721 */
9722 PostfixExpression.full(Expression operand, Token operator) { 9722 PostfixExpression.full(Expression operand, Token operator) {
9723 this._operand = becomeParentOf(operand); 9723 this._operand = becomeParentOf(operand);
9724 this._operator = operator; 9724 this._operator = operator;
9725 } 9725 }
9726 9726
9727 /** 9727 /**
9728 * Initialize a newly created postfix expression. 9728 * Initialize a newly created postfix expression.
9729 * @param operand the expression computing the operand for the operator 9729 * @param operand the expression computing the operand for the operator
9730 * @param operator the postfix operator being applied to the operand 9730 * @param operator the postfix operator being applied to the operand
9731 */ 9731 */
9732 PostfixExpression({Expression operand, Token operator}) : this.full(operand, o perator); 9732 PostfixExpression({Expression operand, Token operator}) : this.full(operand, o perator);
9733 accept(ASTVisitor visitor) => visitor.visitPostfixExpression(this); 9733 accept(ASTVisitor visitor) => visitor.visitPostfixExpression(this);
9734 Token get beginToken => _operand.beginToken; 9734 Token get beginToken => _operand.beginToken;
9735 9735
9736 /** 9736 /**
9737 * Return the element associated with the operator based on the propagated typ e of the operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable, 9737 * Return the element associated with the operator based on the propagated typ e of the operand, or`null` if the AST structure has not been resolved, if the op erator is not user definable,
9738 * or if the operator could not be resolved. One example of the latter case is an operator that is 9738 * or if the operator could not be resolved. One example of the latter case is an operator that is
9739 * not defined for the type of the operand. 9739 * not defined for the type of the operand.
9740 * @return the element associated with the operator 9740 * @return the element associated with the operator
9741 */ 9741 */
9742 MethodElement get element => _propagatedElement; 9742 MethodElement get element => _propagatedElement;
9743 Token get endToken => _operator; 9743 Token get endToken => _operator;
9744 9744
9745 /** 9745 /**
9746 * Return the expression computing the operand for the operator. 9746 * Return the expression computing the operand for the operator.
9747 * @return the expression computing the operand for the operator 9747 * @return the expression computing the operand for the operator
9748 */ 9748 */
9749 Expression get operand => _operand; 9749 Expression get operand => _operand;
9750 9750
9751 /** 9751 /**
9752 * Return the postfix operator being applied to the operand. 9752 * Return the postfix operator being applied to the operand.
9753 * @return the postfix operator being applied to the operand 9753 * @return the postfix operator being applied to the operand
9754 */ 9754 */
9755 Token get operator => _operator; 9755 Token get operator => _operator;
9756 9756
9757 /** 9757 /**
9758 * Return the element associated with the operator based on the static type of the operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable, 9758 * Return the element associated with the operator based on the static type of the operand, or`null` if the AST structure has not been resolved, if the operat or is not user definable,
9759 * or if the operator could not be resolved. One example of the latter case is an operator that is 9759 * or if the operator could not be resolved. One example of the latter case is an operator that is
9760 * not defined for the type of the operand. 9760 * not defined for the type of the operand.
9761 * @return the element associated with the operator 9761 * @return the element associated with the operator
9762 */ 9762 */
9763 MethodElement get staticElement => _staticElement; 9763 MethodElement get staticElement => _staticElement;
9764 9764
9765 /** 9765 /**
9766 * Set the element associated with the operator based on the propagated type o f the operand to the 9766 * Set the element associated with the operator based on the propagated type o f the operand to the
9767 * given element. 9767 * given element.
9768 * @param element the element to be associated with the operator 9768 * @param element the element to be associated with the operator
(...skipping 26 matching lines...) Expand all
9795 void set staticElement(MethodElement element) { 9795 void set staticElement(MethodElement element) {
9796 _staticElement = element; 9796 _staticElement = element;
9797 } 9797 }
9798 void visitChildren(ASTVisitor<Object> visitor) { 9798 void visitChildren(ASTVisitor<Object> visitor) {
9799 safelyVisitChild(_operand, visitor); 9799 safelyVisitChild(_operand, visitor);
9800 } 9800 }
9801 9801
9802 /** 9802 /**
9803 * If the AST structure has been resolved, and the function being invoked is k nown based on 9803 * If the AST structure has been resolved, and the function being invoked is k nown based on
9804 * propagated type information, then return the parameter element representing the parameter to 9804 * propagated type information, then return the parameter element representing the parameter to
9805 * which the value of the operand will be bound. Otherwise, return {@code null }. 9805 * which the value of the operand will be bound. Otherwise, return `null`.
9806 * <p> 9806 *
9807 * This method is only intended to be used by {@link Expression#getParameterEl ement()}. 9807 * This method is only intended to be used by [Expression#getParameterElement] .
9808 * @return the parameter element representing the parameter to which the value of the right 9808 * @return the parameter element representing the parameter to which the value of the right
9809 * operand will be bound 9809 * operand will be bound
9810 */ 9810 */
9811 ParameterElement get propagatedParameterElementForOperand { 9811 ParameterElement get propagatedParameterElementForOperand {
9812 if (_propagatedElement == null) { 9812 if (_propagatedElement == null) {
9813 return null; 9813 return null;
9814 } 9814 }
9815 List<ParameterElement> parameters = _propagatedElement.parameters; 9815 List<ParameterElement> parameters = _propagatedElement.parameters;
9816 if (parameters.length < 1) { 9816 if (parameters.length < 1) {
9817 return null; 9817 return null;
9818 } 9818 }
9819 return parameters[0]; 9819 return parameters[0];
9820 } 9820 }
9821 9821
9822 /** 9822 /**
9823 * If the AST structure has been resolved, and the function being invoked is k nown based on static 9823 * If the AST structure has been resolved, and the function being invoked is k nown based on static
9824 * type information, then return the parameter element representing the parame ter to which the 9824 * type information, then return the parameter element representing the parame ter to which the
9825 * value of the operand will be bound. Otherwise, return {@code null}. 9825 * value of the operand will be bound. Otherwise, return `null`.
9826 * <p> 9826 *
9827 * This method is only intended to be used by {@link Expression#getStaticParam eterElement()}. 9827 * This method is only intended to be used by [Expression#getStaticParameterEl ement].
9828 * @return the parameter element representing the parameter to which the value of the right 9828 * @return the parameter element representing the parameter to which the value of the right
9829 * operand will be bound 9829 * operand will be bound
9830 */ 9830 */
9831 ParameterElement get staticParameterElementForOperand { 9831 ParameterElement get staticParameterElementForOperand {
9832 if (_staticElement == null) { 9832 if (_staticElement == null) {
9833 return null; 9833 return null;
9834 } 9834 }
9835 List<ParameterElement> parameters = _staticElement.parameters; 9835 List<ParameterElement> parameters = _staticElement.parameters;
9836 if (parameters.length < 1) { 9836 if (parameters.length < 1) {
9837 return null; 9837 return null;
9838 } 9838 }
9839 return parameters[0]; 9839 return parameters[0];
9840 } 9840 }
9841 } 9841 }
9842 /** 9842 /**
9843 * Instances of the class {@code PrefixExpression} represent a prefix unary expr ession. 9843 * Instances of the class `PrefixExpression` represent a prefix unary expression .
9844 * <pre> 9844 * <pre>
9845 * prefixExpression ::={@link Token operator} {@link Expression operand}</pre> 9845 * prefixExpression ::=[Token operator] [Expression operand]</pre>
9846 * @coverage dart.engine.ast 9846 * @coverage dart.engine.ast
9847 */ 9847 */
9848 class PrefixExpression extends Expression { 9848 class PrefixExpression extends Expression {
9849 9849
9850 /** 9850 /**
9851 * The prefix operator being applied to the operand. 9851 * The prefix operator being applied to the operand.
9852 */ 9852 */
9853 Token _operator; 9853 Token _operator;
9854 9854
9855 /** 9855 /**
9856 * The expression computing the operand for the operator. 9856 * The expression computing the operand for the operator.
9857 */ 9857 */
9858 Expression _operand; 9858 Expression _operand;
9859 9859
9860 /** 9860 /**
9861 * The element associated with the operator based on the static type of the op erand, or{@code null} if the AST structure has not been resolved, if the operato r is not user definable, 9861 * The element associated with the operator based on the static type of the op erand, or`null` if the AST structure has not been resolved, if the operator is n ot user definable,
9862 * or if the operator could not be resolved. 9862 * or if the operator could not be resolved.
9863 */ 9863 */
9864 MethodElement _staticElement; 9864 MethodElement _staticElement;
9865 9865
9866 /** 9866 /**
9867 * The element associated with the operator based on the propagated type of th e operand, or{@code null} if the AST structure has not been resolved, if the ope rator is not user definable, 9867 * The element associated with the operator based on the propagated type of th e operand, or`null` if the AST structure has not been resolved, if the operator is not user definable,
9868 * or if the operator could not be resolved. 9868 * or if the operator could not be resolved.
9869 */ 9869 */
9870 MethodElement _propagatedElement; 9870 MethodElement _propagatedElement;
9871 9871
9872 /** 9872 /**
9873 * Initialize a newly created prefix expression. 9873 * Initialize a newly created prefix expression.
9874 * @param operator the prefix operator being applied to the operand 9874 * @param operator the prefix operator being applied to the operand
9875 * @param operand the expression computing the operand for the operator 9875 * @param operand the expression computing the operand for the operator
9876 */ 9876 */
9877 PrefixExpression.full(Token operator, Expression operand) { 9877 PrefixExpression.full(Token operator, Expression operand) {
9878 this._operator = operator; 9878 this._operator = operator;
9879 this._operand = becomeParentOf(operand); 9879 this._operand = becomeParentOf(operand);
9880 } 9880 }
9881 9881
9882 /** 9882 /**
9883 * Initialize a newly created prefix expression. 9883 * Initialize a newly created prefix expression.
9884 * @param operator the prefix operator being applied to the operand 9884 * @param operator the prefix operator being applied to the operand
9885 * @param operand the expression computing the operand for the operator 9885 * @param operand the expression computing the operand for the operator
9886 */ 9886 */
9887 PrefixExpression({Token operator, Expression operand}) : this.full(operator, o perand); 9887 PrefixExpression({Token operator, Expression operand}) : this.full(operator, o perand);
9888 accept(ASTVisitor visitor) => visitor.visitPrefixExpression(this); 9888 accept(ASTVisitor visitor) => visitor.visitPrefixExpression(this);
9889 Token get beginToken => _operator; 9889 Token get beginToken => _operator;
9890 9890
9891 /** 9891 /**
9892 * Return the element associated with the operator based on the propagated typ e of the operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable, 9892 * Return the element associated with the operator based on the propagated typ e of the operand, or`null` if the AST structure has not been resolved, if the op erator is not user definable,
9893 * or if the operator could not be resolved. One example of the latter case is an operator that is 9893 * or if the operator could not be resolved. One example of the latter case is an operator that is
9894 * not defined for the type of the operand. 9894 * not defined for the type of the operand.
9895 * @return the element associated with the operator 9895 * @return the element associated with the operator
9896 */ 9896 */
9897 MethodElement get element => _propagatedElement; 9897 MethodElement get element => _propagatedElement;
9898 Token get endToken => _operand.endToken; 9898 Token get endToken => _operand.endToken;
9899 9899
9900 /** 9900 /**
9901 * Return the expression computing the operand for the operator. 9901 * Return the expression computing the operand for the operator.
9902 * @return the expression computing the operand for the operator 9902 * @return the expression computing the operand for the operator
9903 */ 9903 */
9904 Expression get operand => _operand; 9904 Expression get operand => _operand;
9905 9905
9906 /** 9906 /**
9907 * Return the prefix operator being applied to the operand. 9907 * Return the prefix operator being applied to the operand.
9908 * @return the prefix operator being applied to the operand 9908 * @return the prefix operator being applied to the operand
9909 */ 9909 */
9910 Token get operator => _operator; 9910 Token get operator => _operator;
9911 9911
9912 /** 9912 /**
9913 * Return the element associated with the operator based on the static type of the operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable, 9913 * Return the element associated with the operator based on the static type of the operand, or`null` if the AST structure has not been resolved, if the operat or is not user definable,
9914 * or if the operator could not be resolved. One example of the latter case is an operator that is 9914 * or if the operator could not be resolved. One example of the latter case is an operator that is
9915 * not defined for the type of the operand. 9915 * not defined for the type of the operand.
9916 * @return the element associated with the operator 9916 * @return the element associated with the operator
9917 */ 9917 */
9918 MethodElement get staticElement => _staticElement; 9918 MethodElement get staticElement => _staticElement;
9919 9919
9920 /** 9920 /**
9921 * Set the element associated with the operator based on the propagated type o f the operand to the 9921 * Set the element associated with the operator based on the propagated type o f the operand to the
9922 * given element. 9922 * given element.
9923 * @param element the element to be associated with the operator 9923 * @param element the element to be associated with the operator
(...skipping 26 matching lines...) Expand all
9950 void set staticElement(MethodElement element) { 9950 void set staticElement(MethodElement element) {
9951 _staticElement = element; 9951 _staticElement = element;
9952 } 9952 }
9953 void visitChildren(ASTVisitor<Object> visitor) { 9953 void visitChildren(ASTVisitor<Object> visitor) {
9954 safelyVisitChild(_operand, visitor); 9954 safelyVisitChild(_operand, visitor);
9955 } 9955 }
9956 9956
9957 /** 9957 /**
9958 * If the AST structure has been resolved, and the function being invoked is k nown based on 9958 * If the AST structure has been resolved, and the function being invoked is k nown based on
9959 * propagated type information, then return the parameter element representing the parameter to 9959 * propagated type information, then return the parameter element representing the parameter to
9960 * which the value of the operand will be bound. Otherwise, return {@code null }. 9960 * which the value of the operand will be bound. Otherwise, return `null`.
9961 * <p> 9961 *
9962 * This method is only intended to be used by {@link Expression#getParameterEl ement()}. 9962 * This method is only intended to be used by [Expression#getParameterElement] .
9963 * @return the parameter element representing the parameter to which the value of the right 9963 * @return the parameter element representing the parameter to which the value of the right
9964 * operand will be bound 9964 * operand will be bound
9965 */ 9965 */
9966 ParameterElement get propagatedParameterElementForOperand { 9966 ParameterElement get propagatedParameterElementForOperand {
9967 if (_propagatedElement == null) { 9967 if (_propagatedElement == null) {
9968 return null; 9968 return null;
9969 } 9969 }
9970 List<ParameterElement> parameters = _propagatedElement.parameters; 9970 List<ParameterElement> parameters = _propagatedElement.parameters;
9971 if (parameters.length < 1) { 9971 if (parameters.length < 1) {
9972 return null; 9972 return null;
9973 } 9973 }
9974 return parameters[0]; 9974 return parameters[0];
9975 } 9975 }
9976 9976
9977 /** 9977 /**
9978 * If the AST structure has been resolved, and the function being invoked is k nown based on static 9978 * If the AST structure has been resolved, and the function being invoked is k nown based on static
9979 * type information, then return the parameter element representing the parame ter to which the 9979 * type information, then return the parameter element representing the parame ter to which the
9980 * value of the operand will be bound. Otherwise, return {@code null}. 9980 * value of the operand will be bound. Otherwise, return `null`.
9981 * <p> 9981 *
9982 * This method is only intended to be used by {@link Expression#getStaticParam eterElement()}. 9982 * This method is only intended to be used by [Expression#getStaticParameterEl ement].
9983 * @return the parameter element representing the parameter to which the value of the right 9983 * @return the parameter element representing the parameter to which the value of the right
9984 * operand will be bound 9984 * operand will be bound
9985 */ 9985 */
9986 ParameterElement get staticParameterElementForOperand { 9986 ParameterElement get staticParameterElementForOperand {
9987 if (_staticElement == null) { 9987 if (_staticElement == null) {
9988 return null; 9988 return null;
9989 } 9989 }
9990 List<ParameterElement> parameters = _staticElement.parameters; 9990 List<ParameterElement> parameters = _staticElement.parameters;
9991 if (parameters.length < 1) { 9991 if (parameters.length < 1) {
9992 return null; 9992 return null;
9993 } 9993 }
9994 return parameters[0]; 9994 return parameters[0];
9995 } 9995 }
9996 } 9996 }
9997 /** 9997 /**
9998 * Instances of the class {@code PrefixedIdentifier} represent either an identif ier that is prefixed 9998 * Instances of the class `PrefixedIdentifier` represent either an identifier th at is prefixed
9999 * or an access to an object property where the target of the property access is a simple 9999 * or an access to an object property where the target of the property access is a simple
10000 * identifier. 10000 * identifier.
10001 * <pre> 10001 * <pre>
10002 * prefixedIdentifier ::={@link SimpleIdentifier prefix} '.' {@link SimpleIdenti fier identifier}</pre> 10002 * prefixedIdentifier ::=[SimpleIdentifier prefix] '.' [SimpleIdentifier identif ier]</pre>
10003 * @coverage dart.engine.ast 10003 * @coverage dart.engine.ast
10004 */ 10004 */
10005 class PrefixedIdentifier extends Identifier { 10005 class PrefixedIdentifier extends Identifier {
10006 10006
10007 /** 10007 /**
10008 * The prefix associated with the library in which the identifier is defined. 10008 * The prefix associated with the library in which the identifier is defined.
10009 */ 10009 */
10010 SimpleIdentifier _prefix; 10010 SimpleIdentifier _prefix;
10011 10011
10012 /** 10012 /**
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
10096 */ 10096 */
10097 void set prefix(SimpleIdentifier identifier) { 10097 void set prefix(SimpleIdentifier identifier) {
10098 _prefix = becomeParentOf(identifier); 10098 _prefix = becomeParentOf(identifier);
10099 } 10099 }
10100 void visitChildren(ASTVisitor<Object> visitor) { 10100 void visitChildren(ASTVisitor<Object> visitor) {
10101 safelyVisitChild(_prefix, visitor); 10101 safelyVisitChild(_prefix, visitor);
10102 safelyVisitChild(_identifier, visitor); 10102 safelyVisitChild(_identifier, visitor);
10103 } 10103 }
10104 } 10104 }
10105 /** 10105 /**
10106 * Instances of the class {@code PropertyAccess} represent the access of a prope rty of an object. 10106 * Instances of the class `PropertyAccess` represent the access of a property of an object.
10107 * <p> 10107 *
10108 * Note, however, that accesses to properties of objects can also be represented as{@link PrefixedIdentifier prefixed identifier} nodes in cases where the targe t is also a simple 10108 * Note, however, that accesses to properties of objects can also be represented as[PrefixedIdentifier prefixed identifier] nodes in cases where the target is a lso a simple
10109 * identifier. 10109 * identifier.
10110 * <pre> 10110 * <pre>
10111 * propertyAccess ::={@link Expression target} '.' {@link SimpleIdentifier prope rtyName}</pre> 10111 * propertyAccess ::=[Expression target] '.' [SimpleIdentifier propertyName]</pr e>
10112 * @coverage dart.engine.ast 10112 * @coverage dart.engine.ast
10113 */ 10113 */
10114 class PropertyAccess extends Expression { 10114 class PropertyAccess extends Expression {
10115 10115
10116 /** 10116 /**
10117 * The expression computing the object defining the property being accessed. 10117 * The expression computing the object defining the property being accessed.
10118 */ 10118 */
10119 Expression _target; 10119 Expression _target;
10120 10120
10121 /** 10121 /**
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
10163 Token get operator => _operator; 10163 Token get operator => _operator;
10164 10164
10165 /** 10165 /**
10166 * Return the name of the property being accessed. 10166 * Return the name of the property being accessed.
10167 * @return the name of the property being accessed 10167 * @return the name of the property being accessed
10168 */ 10168 */
10169 SimpleIdentifier get propertyName => _propertyName; 10169 SimpleIdentifier get propertyName => _propertyName;
10170 10170
10171 /** 10171 /**
10172 * Return the expression used to compute the receiver of the invocation. If th is invocation is not 10172 * Return the expression used to compute the receiver of the invocation. If th is invocation is not
10173 * part of a cascade expression, then this is the same as {@link #getTarget()} . If this invocation 10173 * part of a cascade expression, then this is the same as [getTarget]. If this invocation
10174 * is part of a cascade expression, then the target stored with the cascade ex pression is 10174 * is part of a cascade expression, then the target stored with the cascade ex pression is
10175 * returned. 10175 * returned.
10176 * @return the expression used to compute the receiver of the invocation 10176 * @return the expression used to compute the receiver of the invocation
10177 * @see #getTarget() 10177 * @see #getTarget()
10178 */ 10178 */
10179 Expression get realTarget { 10179 Expression get realTarget {
10180 if (isCascaded()) { 10180 if (isCascaded()) {
10181 ASTNode ancestor = parent; 10181 ASTNode ancestor = parent;
10182 while (ancestor is! CascadeExpression) { 10182 while (ancestor is! CascadeExpression) {
10183 if (ancestor == null) { 10183 if (ancestor == null) {
10184 return _target; 10184 return _target;
10185 } 10185 }
10186 ancestor = ancestor.parent; 10186 ancestor = ancestor.parent;
10187 } 10187 }
10188 return ((ancestor as CascadeExpression)).target; 10188 return ((ancestor as CascadeExpression)).target;
10189 } 10189 }
10190 return _target; 10190 return _target;
10191 } 10191 }
10192 10192
10193 /** 10193 /**
10194 * Return the expression computing the object defining the property being acce ssed, or{@code null} if this property access is part of a cascade expression. 10194 * Return the expression computing the object defining the property being acce ssed, or`null` if this property access is part of a cascade expression.
10195 * @return the expression computing the object defining the property being acc essed 10195 * @return the expression computing the object defining the property being acc essed
10196 * @see #getRealTarget() 10196 * @see #getRealTarget()
10197 */ 10197 */
10198 Expression get target => _target; 10198 Expression get target => _target;
10199 bool isAssignable() => true; 10199 bool isAssignable() => true;
10200 10200
10201 /** 10201 /**
10202 * Return {@code true} if this expression is cascaded. If it is, then the targ et of this 10202 * Return `true` if this expression is cascaded. If it is, then the target of this
10203 * expression is not stored locally but is stored in the nearest ancestor that is a{@link CascadeExpression}. 10203 * expression is not stored locally but is stored in the nearest ancestor that is a[CascadeExpression].
10204 * @return {@code true} if this expression is cascaded 10204 * @return `true` if this expression is cascaded
10205 */ 10205 */
10206 bool isCascaded() => _operator != null && identical(_operator.type, TokenType. PERIOD_PERIOD); 10206 bool isCascaded() => _operator != null && identical(_operator.type, TokenType. PERIOD_PERIOD);
10207 10207
10208 /** 10208 /**
10209 * Set the property access operator to the given token. 10209 * Set the property access operator to the given token.
10210 * @param operator the property access operator 10210 * @param operator the property access operator
10211 */ 10211 */
10212 void set operator(Token operator2) { 10212 void set operator(Token operator2) {
10213 this._operator = operator2; 10213 this._operator = operator2;
10214 } 10214 }
(...skipping 13 matching lines...) Expand all
10228 */ 10228 */
10229 void set target(Expression expression) { 10229 void set target(Expression expression) {
10230 _target = becomeParentOf(expression); 10230 _target = becomeParentOf(expression);
10231 } 10231 }
10232 void visitChildren(ASTVisitor<Object> visitor) { 10232 void visitChildren(ASTVisitor<Object> visitor) {
10233 safelyVisitChild(_target, visitor); 10233 safelyVisitChild(_target, visitor);
10234 safelyVisitChild(_propertyName, visitor); 10234 safelyVisitChild(_propertyName, visitor);
10235 } 10235 }
10236 } 10236 }
10237 /** 10237 /**
10238 * Instances of the class {@code RedirectingConstructorInvocation} represent the invocation of a 10238 * Instances of the class `RedirectingConstructorInvocation` represent the invoc ation of a
10239 * another constructor in the same class from within a constructor's initializat ion list. 10239 * another constructor in the same class from within a constructor's initializat ion list.
10240 * <pre> 10240 * <pre>
10241 * redirectingConstructorInvocation ::= 10241 * redirectingConstructorInvocation ::=
10242 * 'this' ('.' identifier)? arguments 10242 * 'this' ('.' identifier)? arguments
10243 * </pre> 10243 * </pre>
10244 * @coverage dart.engine.ast 10244 * @coverage dart.engine.ast
10245 */ 10245 */
10246 class RedirectingConstructorInvocation extends ConstructorInitializer { 10246 class RedirectingConstructorInvocation extends ConstructorInitializer {
10247 10247
10248 /** 10248 /**
10249 * The token for the 'this' keyword. 10249 * The token for the 'this' keyword.
10250 */ 10250 */
10251 Token _keyword; 10251 Token _keyword;
10252 10252
10253 /** 10253 /**
10254 * The token for the period before the name of the constructor that is being i nvoked, or{@code null} if the unnamed constructor is being invoked. 10254 * The token for the period before the name of the constructor that is being i nvoked, or`null` if the unnamed constructor is being invoked.
10255 */ 10255 */
10256 Token _period; 10256 Token _period;
10257 10257
10258 /** 10258 /**
10259 * The name of the constructor that is being invoked, or {@code null} if the u nnamed constructor 10259 * The name of the constructor that is being invoked, or `null` if the unnamed constructor
10260 * is being invoked. 10260 * is being invoked.
10261 */ 10261 */
10262 SimpleIdentifier _constructorName; 10262 SimpleIdentifier _constructorName;
10263 10263
10264 /** 10264 /**
10265 * The list of arguments to the constructor. 10265 * The list of arguments to the constructor.
10266 */ 10266 */
10267 ArgumentList _argumentList; 10267 ArgumentList _argumentList;
10268 10268
10269 /** 10269 /**
10270 * The element associated with the constructor based on static type informatio n, or {@code null}if the AST structure has not been resolved or if the construct or could not be resolved. 10270 * The element associated with the constructor based on static type informatio n, or `null`if the AST structure has not been resolved or if the constructor cou ld not be resolved.
10271 */ 10271 */
10272 ConstructorElement _staticElement; 10272 ConstructorElement _staticElement;
10273 10273
10274 /** 10274 /**
10275 * The element associated with the constructor based on propagated type inform ation, or{@code null} if the AST structure has not been resolved or if the const ructor could not be 10275 * The element associated with the constructor based on propagated type inform ation, or`null` if the AST structure has not been resolved or if the constructor could not be
10276 * resolved. 10276 * resolved.
10277 */ 10277 */
10278 ConstructorElement _propagatedElement; 10278 ConstructorElement _propagatedElement;
10279 10279
10280 /** 10280 /**
10281 * Initialize a newly created redirecting invocation to invoke the constructor with the given name 10281 * Initialize a newly created redirecting invocation to invoke the constructor with the given name
10282 * with the given arguments. 10282 * with the given arguments.
10283 * @param keyword the token for the 'this' keyword 10283 * @param keyword the token for the 'this' keyword
10284 * @param period the token for the period before the name of the constructor t hat is being invoked 10284 * @param period the token for the period before the name of the constructor t hat is being invoked
10285 * @param constructorName the name of the constructor that is being invoked 10285 * @param constructorName the name of the constructor that is being invoked
(...skipping 18 matching lines...) Expand all
10304 accept(ASTVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th is); 10304 accept(ASTVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th is);
10305 10305
10306 /** 10306 /**
10307 * Return the list of arguments to the constructor. 10307 * Return the list of arguments to the constructor.
10308 * @return the list of arguments to the constructor 10308 * @return the list of arguments to the constructor
10309 */ 10309 */
10310 ArgumentList get argumentList => _argumentList; 10310 ArgumentList get argumentList => _argumentList;
10311 Token get beginToken => _keyword; 10311 Token get beginToken => _keyword;
10312 10312
10313 /** 10313 /**
10314 * Return the name of the constructor that is being invoked, or {@code null} i f the unnamed 10314 * Return the name of the constructor that is being invoked, or `null` if the unnamed
10315 * constructor is being invoked. 10315 * constructor is being invoked.
10316 * @return the name of the constructor that is being invoked 10316 * @return the name of the constructor that is being invoked
10317 */ 10317 */
10318 SimpleIdentifier get constructorName => _constructorName; 10318 SimpleIdentifier get constructorName => _constructorName;
10319 10319
10320 /** 10320 /**
10321 * Return the element associated with the constructor based on propagated type information, or{@code null} if the AST structure has not been resolved or if th e constructor could not be 10321 * Return the element associated with the constructor based on propagated type information, or`null` if the AST structure has not been resolved or if the cons tructor could not be
10322 * resolved. 10322 * resolved.
10323 * @return the element associated with the super constructor 10323 * @return the element associated with the super constructor
10324 */ 10324 */
10325 ConstructorElement get element => _propagatedElement; 10325 ConstructorElement get element => _propagatedElement;
10326 Token get endToken => _argumentList.endToken; 10326 Token get endToken => _argumentList.endToken;
10327 10327
10328 /** 10328 /**
10329 * Return the token for the 'this' keyword. 10329 * Return the token for the 'this' keyword.
10330 * @return the token for the 'this' keyword 10330 * @return the token for the 'this' keyword
10331 */ 10331 */
10332 Token get keyword => _keyword; 10332 Token get keyword => _keyword;
10333 10333
10334 /** 10334 /**
10335 * Return the token for the period before the name of the constructor that is being invoked, or{@code null} if the unnamed constructor is being invoked. 10335 * Return the token for the period before the name of the constructor that is being invoked, or`null` if the unnamed constructor is being invoked.
10336 * @return the token for the period before the name of the constructor that is being invoked 10336 * @return the token for the period before the name of the constructor that is being invoked
10337 */ 10337 */
10338 Token get period => _period; 10338 Token get period => _period;
10339 10339
10340 /** 10340 /**
10341 * Return the element associated with the constructor based on static type inf ormation, or{@code null} if the AST structure has not been resolved or if the co nstructor could not be 10341 * Return the element associated with the constructor based on static type inf ormation, or`null` if the AST structure has not been resolved or if the construc tor could not be
10342 * resolved. 10342 * resolved.
10343 * @return the element associated with the constructor 10343 * @return the element associated with the constructor
10344 */ 10344 */
10345 ConstructorElement get staticElement => _staticElement; 10345 ConstructorElement get staticElement => _staticElement;
10346 10346
10347 /** 10347 /**
10348 * Set the list of arguments to the constructor to the given list. 10348 * Set the list of arguments to the constructor to the given list.
10349 * @param argumentList the list of arguments to the constructor 10349 * @param argumentList the list of arguments to the constructor
10350 */ 10350 */
10351 void set argumentList(ArgumentList argumentList2) { 10351 void set argumentList(ArgumentList argumentList2) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
10393 */ 10393 */
10394 void set staticElement(ConstructorElement element) { 10394 void set staticElement(ConstructorElement element) {
10395 this._staticElement = element; 10395 this._staticElement = element;
10396 } 10396 }
10397 void visitChildren(ASTVisitor<Object> visitor) { 10397 void visitChildren(ASTVisitor<Object> visitor) {
10398 safelyVisitChild(_constructorName, visitor); 10398 safelyVisitChild(_constructorName, visitor);
10399 safelyVisitChild(_argumentList, visitor); 10399 safelyVisitChild(_argumentList, visitor);
10400 } 10400 }
10401 } 10401 }
10402 /** 10402 /**
10403 * Instances of the class {@code RethrowExpression} represent a rethrow expressi on. 10403 * Instances of the class `RethrowExpression` represent a rethrow expression.
10404 * <pre> 10404 * <pre>
10405 * rethrowExpression ::= 10405 * rethrowExpression ::=
10406 * 'rethrow' 10406 * 'rethrow'
10407 * </pre> 10407 * </pre>
10408 * @coverage dart.engine.ast 10408 * @coverage dart.engine.ast
10409 */ 10409 */
10410 class RethrowExpression extends Expression { 10410 class RethrowExpression extends Expression {
10411 10411
10412 /** 10412 /**
10413 * The token representing the 'rethrow' keyword. 10413 * The token representing the 'rethrow' keyword.
(...skipping 27 matching lines...) Expand all
10441 * Set the token representing the 'rethrow' keyword to the given token. 10441 * Set the token representing the 'rethrow' keyword to the given token.
10442 * @param keyword the token representing the 'rethrow' keyword 10442 * @param keyword the token representing the 'rethrow' keyword
10443 */ 10443 */
10444 void set keyword(Token keyword2) { 10444 void set keyword(Token keyword2) {
10445 this._keyword = keyword2; 10445 this._keyword = keyword2;
10446 } 10446 }
10447 void visitChildren(ASTVisitor<Object> visitor) { 10447 void visitChildren(ASTVisitor<Object> visitor) {
10448 } 10448 }
10449 } 10449 }
10450 /** 10450 /**
10451 * Instances of the class {@code ReturnStatement} represent a return statement. 10451 * Instances of the class `ReturnStatement` represent a return statement.
10452 * <pre> 10452 * <pre>
10453 * returnStatement ::= 10453 * returnStatement ::=
10454 * 'return' {@link Expression expression}? ';' 10454 * 'return' [Expression expression]? ';'
10455 * </pre> 10455 * </pre>
10456 * @coverage dart.engine.ast 10456 * @coverage dart.engine.ast
10457 */ 10457 */
10458 class ReturnStatement extends Statement { 10458 class ReturnStatement extends Statement {
10459 10459
10460 /** 10460 /**
10461 * The token representing the 'return' keyword. 10461 * The token representing the 'return' keyword.
10462 */ 10462 */
10463 Token _keyword; 10463 Token _keyword;
10464 10464
10465 /** 10465 /**
10466 * The expression computing the value to be returned, or {@code null} if no ex plicit value was 10466 * The expression computing the value to be returned, or `null` if no explicit value was
10467 * provided. 10467 * provided.
10468 */ 10468 */
10469 Expression _expression; 10469 Expression _expression;
10470 10470
10471 /** 10471 /**
10472 * The semicolon terminating the statement. 10472 * The semicolon terminating the statement.
10473 */ 10473 */
10474 Token _semicolon; 10474 Token _semicolon;
10475 10475
10476 /** 10476 /**
(...skipping 13 matching lines...) Expand all
10490 * @param keyword the token representing the 'return' keyword 10490 * @param keyword the token representing the 'return' keyword
10491 * @param expression the expression computing the value to be returned 10491 * @param expression the expression computing the value to be returned
10492 * @param semicolon the semicolon terminating the statement 10492 * @param semicolon the semicolon terminating the statement
10493 */ 10493 */
10494 ReturnStatement({Token keyword, Expression expression, Token semicolon}) : thi s.full(keyword, expression, semicolon); 10494 ReturnStatement({Token keyword, Expression expression, Token semicolon}) : thi s.full(keyword, expression, semicolon);
10495 accept(ASTVisitor visitor) => visitor.visitReturnStatement(this); 10495 accept(ASTVisitor visitor) => visitor.visitReturnStatement(this);
10496 Token get beginToken => _keyword; 10496 Token get beginToken => _keyword;
10497 Token get endToken => _semicolon; 10497 Token get endToken => _semicolon;
10498 10498
10499 /** 10499 /**
10500 * Return the expression computing the value to be returned, or {@code null} i f no explicit value 10500 * Return the expression computing the value to be returned, or `null` if no e xplicit value
10501 * was provided. 10501 * was provided.
10502 * @return the expression computing the value to be returned 10502 * @return the expression computing the value to be returned
10503 */ 10503 */
10504 Expression get expression => _expression; 10504 Expression get expression => _expression;
10505 10505
10506 /** 10506 /**
10507 * Return the token representing the 'return' keyword. 10507 * Return the token representing the 'return' keyword.
10508 * @return the token representing the 'return' keyword 10508 * @return the token representing the 'return' keyword
10509 */ 10509 */
10510 Token get keyword => _keyword; 10510 Token get keyword => _keyword;
(...skipping 25 matching lines...) Expand all
10536 * @param semicolon the semicolon terminating the statement 10536 * @param semicolon the semicolon terminating the statement
10537 */ 10537 */
10538 void set semicolon(Token semicolon2) { 10538 void set semicolon(Token semicolon2) {
10539 this._semicolon = semicolon2; 10539 this._semicolon = semicolon2;
10540 } 10540 }
10541 void visitChildren(ASTVisitor<Object> visitor) { 10541 void visitChildren(ASTVisitor<Object> visitor) {
10542 safelyVisitChild(_expression, visitor); 10542 safelyVisitChild(_expression, visitor);
10543 } 10543 }
10544 } 10544 }
10545 /** 10545 /**
10546 * Instances of the class {@code ScriptTag} represent the script tag that can op tionally occur at 10546 * Instances of the class `ScriptTag` represent the script tag that can optional ly occur at
10547 * the beginning of a compilation unit. 10547 * the beginning of a compilation unit.
10548 * <pre> 10548 * <pre>
10549 * scriptTag ::= 10549 * scriptTag ::=
10550 * '#!' (~NEWLINE)* NEWLINE 10550 * '#!' (~NEWLINE)* NEWLINE
10551 * </pre> 10551 * </pre>
10552 * @coverage dart.engine.ast 10552 * @coverage dart.engine.ast
10553 */ 10553 */
10554 class ScriptTag extends ASTNode { 10554 class ScriptTag extends ASTNode {
10555 10555
10556 /** 10556 /**
(...skipping 28 matching lines...) Expand all
10585 * Set the token representing this script tag to the given script tag. 10585 * Set the token representing this script tag to the given script tag.
10586 * @param scriptTag the token representing this script tag 10586 * @param scriptTag the token representing this script tag
10587 */ 10587 */
10588 void set scriptTag(Token scriptTag2) { 10588 void set scriptTag(Token scriptTag2) {
10589 this._scriptTag = scriptTag2; 10589 this._scriptTag = scriptTag2;
10590 } 10590 }
10591 void visitChildren(ASTVisitor<Object> visitor) { 10591 void visitChildren(ASTVisitor<Object> visitor) {
10592 } 10592 }
10593 } 10593 }
10594 /** 10594 /**
10595 * Instances of the class {@code ShowCombinator} represent a combinator that res tricts the names 10595 * Instances of the class `ShowCombinator` represent a combinator that restricts the names
10596 * being imported to those in a given list. 10596 * being imported to those in a given list.
10597 * <pre> 10597 * <pre>
10598 * showCombinator ::= 10598 * showCombinator ::=
10599 * 'show' {@link SimpleIdentifier identifier} (',' {@link SimpleIdentifier ident ifier}) 10599 * 'show' [SimpleIdentifier identifier] (',' [SimpleIdentifier identifier])
10600 * </pre> 10600 * </pre>
10601 * @coverage dart.engine.ast 10601 * @coverage dart.engine.ast
10602 */ 10602 */
10603 class ShowCombinator extends Combinator { 10603 class ShowCombinator extends Combinator {
10604 10604
10605 /** 10605 /**
10606 * The list of names from the library that are made visible by this combinator . 10606 * The list of names from the library that are made visible by this combinator .
10607 */ 10607 */
10608 NodeList<SimpleIdentifier> _shownNames; 10608 NodeList<SimpleIdentifier> _shownNames;
10609 10609
(...skipping 19 matching lines...) Expand all
10629 /** 10629 /**
10630 * Return the list of names from the library that are made visible by this com binator. 10630 * Return the list of names from the library that are made visible by this com binator.
10631 * @return the list of names from the library that are made visible by this co mbinator 10631 * @return the list of names from the library that are made visible by this co mbinator
10632 */ 10632 */
10633 NodeList<SimpleIdentifier> get shownNames => _shownNames; 10633 NodeList<SimpleIdentifier> get shownNames => _shownNames;
10634 void visitChildren(ASTVisitor<Object> visitor) { 10634 void visitChildren(ASTVisitor<Object> visitor) {
10635 _shownNames.accept(visitor); 10635 _shownNames.accept(visitor);
10636 } 10636 }
10637 } 10637 }
10638 /** 10638 /**
10639 * Instances of the class {@code SimpleFormalParameter} represent a simple forma l parameter. 10639 * Instances of the class `SimpleFormalParameter` represent a simple formal para meter.
10640 * <pre> 10640 * <pre>
10641 * simpleFormalParameter ::= 10641 * simpleFormalParameter ::=
10642 * ('final' {@link TypeName type} | 'var' | {@link TypeName type})? {@link Simpl eIdentifier identifier}</pre> 10642 * ('final' [TypeName type] | 'var' | [TypeName type])? [SimpleIdentifier identi fier]</pre>
10643 * @coverage dart.engine.ast 10643 * @coverage dart.engine.ast
10644 */ 10644 */
10645 class SimpleFormalParameter extends NormalFormalParameter { 10645 class SimpleFormalParameter extends NormalFormalParameter {
10646 10646
10647 /** 10647 /**
10648 * The token representing either the 'final', 'const' or 'var' keyword, or {@c ode null} if no 10648 * The token representing either the 'final', 'const' or 'var' keyword, or `nu ll` if no
10649 * keyword was used. 10649 * keyword was used.
10650 */ 10650 */
10651 Token _keyword; 10651 Token _keyword;
10652 10652
10653 /** 10653 /**
10654 * The name of the declared type of the parameter, or {@code null} if the para meter does not have 10654 * The name of the declared type of the parameter, or `null` if the parameter does not have
10655 * a declared type. 10655 * a declared type.
10656 */ 10656 */
10657 TypeName _type; 10657 TypeName _type;
10658 10658
10659 /** 10659 /**
10660 * Initialize a newly created formal parameter. 10660 * Initialize a newly created formal parameter.
10661 * @param comment the documentation comment associated with this parameter 10661 * @param comment the documentation comment associated with this parameter
10662 * @param metadata the annotations associated with this parameter 10662 * @param metadata the annotations associated with this parameter
10663 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 10663 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
10664 * @param type the name of the declared type of the parameter 10664 * @param type the name of the declared type of the parameter
(...skipping 24 matching lines...) Expand all
10689 } 10689 }
10690 Token get endToken => identifier.endToken; 10690 Token get endToken => identifier.endToken;
10691 10691
10692 /** 10692 /**
10693 * Return the token representing either the 'final', 'const' or 'var' keyword. 10693 * Return the token representing either the 'final', 'const' or 'var' keyword.
10694 * @return the token representing either the 'final', 'const' or 'var' keyword 10694 * @return the token representing either the 'final', 'const' or 'var' keyword
10695 */ 10695 */
10696 Token get keyword => _keyword; 10696 Token get keyword => _keyword;
10697 10697
10698 /** 10698 /**
10699 * Return the name of the declared type of the parameter, or {@code null} if t he parameter does 10699 * Return the name of the declared type of the parameter, or `null` if the par ameter does
10700 * not have a declared type. 10700 * not have a declared type.
10701 * @return the name of the declared type of the parameter 10701 * @return the name of the declared type of the parameter
10702 */ 10702 */
10703 TypeName get type => _type; 10703 TypeName get type => _type;
10704 bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.CONST); 10704 bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.CONST);
10705 bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.FINAL); 10705 bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.FINAL);
10706 10706
10707 /** 10707 /**
10708 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token. 10708 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
10709 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 10709 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
10710 */ 10710 */
10711 void set keyword(Token keyword2) { 10711 void set keyword(Token keyword2) {
10712 this._keyword = keyword2; 10712 this._keyword = keyword2;
10713 } 10713 }
10714 10714
10715 /** 10715 /**
10716 * Set the name of the declared type of the parameter to the given type name. 10716 * Set the name of the declared type of the parameter to the given type name.
10717 * @param typeName the name of the declared type of the parameter 10717 * @param typeName the name of the declared type of the parameter
10718 */ 10718 */
10719 void set type(TypeName typeName) { 10719 void set type(TypeName typeName) {
10720 _type = becomeParentOf(typeName); 10720 _type = becomeParentOf(typeName);
10721 } 10721 }
10722 void visitChildren(ASTVisitor<Object> visitor) { 10722 void visitChildren(ASTVisitor<Object> visitor) {
10723 super.visitChildren(visitor); 10723 super.visitChildren(visitor);
10724 safelyVisitChild(_type, visitor); 10724 safelyVisitChild(_type, visitor);
10725 safelyVisitChild(identifier, visitor); 10725 safelyVisitChild(identifier, visitor);
10726 } 10726 }
10727 } 10727 }
10728 /** 10728 /**
10729 * Instances of the class {@code SimpleIdentifier} represent a simple identifier . 10729 * Instances of the class `SimpleIdentifier` represent a simple identifier.
10730 * <pre> 10730 * <pre>
10731 * simpleIdentifier ::= 10731 * simpleIdentifier ::=
10732 * initialCharacter internalCharacter 10732 * initialCharacter internalCharacter
10733 * initialCharacter ::= '_' | '$' | letter 10733 * initialCharacter ::= '_' | '$' | letter
10734 * internalCharacter ::= '_' | '$' | letter | digit 10734 * internalCharacter ::= '_' | '$' | letter | digit
10735 * </pre> 10735 * </pre>
10736 * @coverage dart.engine.ast 10736 * @coverage dart.engine.ast
10737 */ 10737 */
10738 class SimpleIdentifier extends Identifier { 10738 class SimpleIdentifier extends Identifier {
10739 10739
10740 /** 10740 /**
10741 * The token representing the identifier. 10741 * The token representing the identifier.
10742 */ 10742 */
10743 Token _token; 10743 Token _token;
10744 10744
10745 /** 10745 /**
10746 * The element associated with this identifier based on static type informatio n, or {@code null}if the AST structure has not been resolved or if this identifi er could not be resolved. 10746 * The element associated with this identifier based on static type informatio n, or `null`if the AST structure has not been resolved or if this identifier cou ld not be resolved.
10747 */ 10747 */
10748 Element _staticElement; 10748 Element _staticElement;
10749 10749
10750 /** 10750 /**
10751 * The element associated with this identifier based on propagated type inform ation, or{@code null} if the AST structure has not been resolved or if this iden tifier could not be 10751 * The element associated with this identifier based on propagated type inform ation, or`null` if the AST structure has not been resolved or if this identifier could not be
10752 * resolved. 10752 * resolved.
10753 */ 10753 */
10754 Element _propagatedElement; 10754 Element _propagatedElement;
10755 10755
10756 /** 10756 /**
10757 * Initialize a newly created identifier. 10757 * Initialize a newly created identifier.
10758 * @param token the token representing the identifier 10758 * @param token the token representing the identifier
10759 */ 10759 */
10760 SimpleIdentifier.full(Token token) { 10760 SimpleIdentifier.full(Token token) {
10761 this._token = token; 10761 this._token = token;
(...skipping 11 matching lines...) Expand all
10773 String get name => _token.lexeme; 10773 String get name => _token.lexeme;
10774 Element get staticElement => _staticElement; 10774 Element get staticElement => _staticElement;
10775 10775
10776 /** 10776 /**
10777 * Return the token representing the identifier. 10777 * Return the token representing the identifier.
10778 * @return the token representing the identifier 10778 * @return the token representing the identifier
10779 */ 10779 */
10780 Token get token => _token; 10780 Token get token => _token;
10781 10781
10782 /** 10782 /**
10783 * Return {@code true} if this identifier is the name being declared in a decl aration. 10783 * Return `true` if this identifier is the name being declared in a declaratio n.
10784 * @return {@code true} if this identifier is the name being declared in a dec laration 10784 * @return `true` if this identifier is the name being declared in a declarati on
10785 */ 10785 */
10786 bool inDeclarationContext() { 10786 bool inDeclarationContext() {
10787 ASTNode parent = this.parent; 10787 ASTNode parent = this.parent;
10788 if (parent is CatchClause) { 10788 if (parent is CatchClause) {
10789 CatchClause clause = parent as CatchClause; 10789 CatchClause clause = parent as CatchClause;
10790 return identical(this, clause.exceptionParameter) || identical(this, claus e.stackTraceParameter); 10790 return identical(this, clause.exceptionParameter) || identical(this, claus e.stackTraceParameter);
10791 } else if (parent is ClassDeclaration) { 10791 } else if (parent is ClassDeclaration) {
10792 return identical(this, ((parent as ClassDeclaration)).name); 10792 return identical(this, ((parent as ClassDeclaration)).name);
10793 } else if (parent is ClassTypeAlias) { 10793 } else if (parent is ClassTypeAlias) {
10794 return identical(this, ((parent as ClassTypeAlias)).name); 10794 return identical(this, ((parent as ClassTypeAlias)).name);
(...skipping 11 matching lines...) Expand all
10806 return identical(this, ((parent as NormalFormalParameter)).identifier); 10806 return identical(this, ((parent as NormalFormalParameter)).identifier);
10807 } else if (parent is TypeParameter) { 10807 } else if (parent is TypeParameter) {
10808 return identical(this, ((parent as TypeParameter)).name); 10808 return identical(this, ((parent as TypeParameter)).name);
10809 } else if (parent is VariableDeclaration) { 10809 } else if (parent is VariableDeclaration) {
10810 return identical(this, ((parent as VariableDeclaration)).name); 10810 return identical(this, ((parent as VariableDeclaration)).name);
10811 } 10811 }
10812 return false; 10812 return false;
10813 } 10813 }
10814 10814
10815 /** 10815 /**
10816 * Return {@code true} if this expression is computing a right-hand value. 10816 * Return `true` if this expression is computing a right-hand value.
10817 * <p> 10817 *
10818 * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are 10818 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar e
10819 * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node. 10819 * they mutually exclusive. In other words, it is possible for both methods to return `true`when invoked on the same node.
10820 * @return {@code true} if this expression is in a context where a getter will be invoked 10820 * @return `true` if this expression is in a context where a getter will be in voked
10821 */ 10821 */
10822 bool inGetterContext() { 10822 bool inGetterContext() {
10823 ASTNode parent = this.parent; 10823 ASTNode parent = this.parent;
10824 ASTNode target = this; 10824 ASTNode target = this;
10825 if (parent is PrefixedIdentifier) { 10825 if (parent is PrefixedIdentifier) {
10826 PrefixedIdentifier prefixed = parent as PrefixedIdentifier; 10826 PrefixedIdentifier prefixed = parent as PrefixedIdentifier;
10827 if (identical(prefixed.prefix, this)) { 10827 if (identical(prefixed.prefix, this)) {
10828 return true; 10828 return true;
10829 } 10829 }
10830 parent = prefixed.parent; 10830 parent = prefixed.parent;
(...skipping 12 matching lines...) Expand all
10843 if (parent is AssignmentExpression) { 10843 if (parent is AssignmentExpression) {
10844 AssignmentExpression expr = parent as AssignmentExpression; 10844 AssignmentExpression expr = parent as AssignmentExpression;
10845 if (identical(expr.leftHandSide, target) && identical(expr.operator.type, TokenType.EQ)) { 10845 if (identical(expr.leftHandSide, target) && identical(expr.operator.type, TokenType.EQ)) {
10846 return false; 10846 return false;
10847 } 10847 }
10848 } 10848 }
10849 return true; 10849 return true;
10850 } 10850 }
10851 10851
10852 /** 10852 /**
10853 * Return {@code true} if this expression is computing a left-hand value. 10853 * Return `true` if this expression is computing a left-hand value.
10854 * <p> 10854 *
10855 * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are 10855 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar e
10856 * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node. 10856 * they mutually exclusive. In other words, it is possible for both methods to return `true`when invoked on the same node.
10857 * @return {@code true} if this expression is in a context where a setter will be invoked 10857 * @return `true` if this expression is in a context where a setter will be in voked
10858 */ 10858 */
10859 bool inSetterContext() { 10859 bool inSetterContext() {
10860 ASTNode parent = this.parent; 10860 ASTNode parent = this.parent;
10861 ASTNode target = this; 10861 ASTNode target = this;
10862 if (parent is PrefixedIdentifier) { 10862 if (parent is PrefixedIdentifier) {
10863 PrefixedIdentifier prefixed = parent as PrefixedIdentifier; 10863 PrefixedIdentifier prefixed = parent as PrefixedIdentifier;
10864 if (identical(prefixed.prefix, this)) { 10864 if (identical(prefixed.prefix, this)) {
10865 return false; 10865 return false;
10866 } 10866 }
10867 parent = prefixed.parent; 10867 parent = prefixed.parent;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
10907 * Set the token representing the identifier to the given token. 10907 * Set the token representing the identifier to the given token.
10908 * @param token the token representing the literal 10908 * @param token the token representing the literal
10909 */ 10909 */
10910 void set token(Token token2) { 10910 void set token(Token token2) {
10911 this._token = token2; 10911 this._token = token2;
10912 } 10912 }
10913 void visitChildren(ASTVisitor<Object> visitor) { 10913 void visitChildren(ASTVisitor<Object> visitor) {
10914 } 10914 }
10915 } 10915 }
10916 /** 10916 /**
10917 * Instances of the class {@code SimpleStringLiteral} represent a string literal expression that 10917 * Instances of the class `SimpleStringLiteral` represent a string literal expre ssion that
10918 * does not contain any interpolations. 10918 * does not contain any interpolations.
10919 * <pre> 10919 * <pre>
10920 * simpleStringLiteral ::= 10920 * simpleStringLiteral ::=
10921 * rawStringLiteral 10921 * rawStringLiteral
10922 * | basicStringLiteral 10922 * | basicStringLiteral
10923 * rawStringLiteral ::= 10923 * rawStringLiteral ::=
10924 * '@' basicStringLiteral 10924 * '@' basicStringLiteral
10925 * simpleStringLiteral ::= 10925 * simpleStringLiteral ::=
10926 * multiLineStringLiteral 10926 * multiLineStringLiteral
10927 * | singleLineStringLiteral 10927 * | singleLineStringLiteral
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
10972 */ 10972 */
10973 Token get literal => _literal; 10973 Token get literal => _literal;
10974 10974
10975 /** 10975 /**
10976 * Return the value of the literal. 10976 * Return the value of the literal.
10977 * @return the value of the literal 10977 * @return the value of the literal
10978 */ 10978 */
10979 String get value => _value; 10979 String get value => _value;
10980 10980
10981 /** 10981 /**
10982 * Return {@code true} if this string literal is a multi-line string. 10982 * Return `true` if this string literal is a multi-line string.
10983 * @return {@code true} if this string literal is a multi-line string 10983 * @return `true` if this string literal is a multi-line string
10984 */ 10984 */
10985 bool isMultiline() { 10985 bool isMultiline() {
10986 if (_value.length < 6) { 10986 if (_value.length < 6) {
10987 return false; 10987 return false;
10988 } 10988 }
10989 return _value.endsWith("\"\"\"") || _value.endsWith("'''"); 10989 return _value.endsWith("\"\"\"") || _value.endsWith("'''");
10990 } 10990 }
10991 10991
10992 /** 10992 /**
10993 * Return {@code true} if this string literal is a raw string. 10993 * Return `true` if this string literal is a raw string.
10994 * @return {@code true} if this string literal is a raw string 10994 * @return `true` if this string literal is a raw string
10995 */ 10995 */
10996 bool isRaw() => _value.codeUnitAt(0) == 0x40; 10996 bool isRaw() => _value.codeUnitAt(0) == 0x40;
10997 bool isSynthetic() => _literal.isSynthetic(); 10997 bool isSynthetic() => _literal.isSynthetic();
10998 10998
10999 /** 10999 /**
11000 * Set the token representing the literal to the given token. 11000 * Set the token representing the literal to the given token.
11001 * @param literal the token representing the literal 11001 * @param literal the token representing the literal
11002 */ 11002 */
11003 void set literal(Token literal2) { 11003 void set literal(Token literal2) {
11004 this._literal = literal2; 11004 this._literal = literal2;
11005 } 11005 }
11006 11006
11007 /** 11007 /**
11008 * Set the value of the literal to the given string. 11008 * Set the value of the literal to the given string.
11009 * @param string the value of the literal 11009 * @param string the value of the literal
11010 */ 11010 */
11011 void set value(String string) { 11011 void set value(String string) {
11012 _value = StringUtilities.intern(_value); 11012 _value = StringUtilities.intern(_value);
11013 } 11013 }
11014 void visitChildren(ASTVisitor<Object> visitor) { 11014 void visitChildren(ASTVisitor<Object> visitor) {
11015 } 11015 }
11016 void appendStringValue(JavaStringBuilder builder) { 11016 void appendStringValue(JavaStringBuilder builder) {
11017 builder.append(value); 11017 builder.append(value);
11018 } 11018 }
11019 } 11019 }
11020 /** 11020 /**
11021 * Instances of the class {@code Statement} defines the behavior common to nodes that represent a 11021 * Instances of the class `Statement` defines the behavior common to nodes that represent a
11022 * statement. 11022 * statement.
11023 * <pre> 11023 * <pre>
11024 * statement ::={@link Block block}| {@link VariableDeclarationStatement initial izedVariableDeclaration ';'}| {@link ForStatement forStatement}| {@link ForEachS tatement forEachStatement}| {@link WhileStatement whileStatement}| {@link DoStat ement doStatement}| {@link SwitchStatement switchStatement}| {@link IfStatement ifStatement}| {@link TryStatement tryStatement}| {@link BreakStatement breakStat ement}| {@link ContinueStatement continueStatement}| {@link ReturnStatement retu rnStatement}| {@link ExpressionStatement expressionStatement}| {@link FunctionDe clarationStatement functionSignature functionBody}</pre> 11024 * statement ::=[Block block]| [VariableDeclarationStatement initializedVariable Declaration ';']| [ForStatement forStatement]| [ForEachStatement forEachStatemen t]| [WhileStatement whileStatement]| [DoStatement doStatement]| [SwitchStatement switchStatement]| [IfStatement ifStatement]| [TryStatement tryStatement]| [Brea kStatement breakStatement]| [ContinueStatement continueStatement]| [ReturnStatem ent returnStatement]| [ExpressionStatement expressionStatement]| [FunctionDeclar ationStatement functionSignature functionBody]</pre>
11025 * @coverage dart.engine.ast 11025 * @coverage dart.engine.ast
11026 */ 11026 */
11027 abstract class Statement extends ASTNode { 11027 abstract class Statement extends ASTNode {
11028 } 11028 }
11029 /** 11029 /**
11030 * Instances of the class {@code StringInterpolation} represent a string interpo lation literal. 11030 * Instances of the class `StringInterpolation` represent a string interpolation literal.
11031 * <pre> 11031 * <pre>
11032 * stringInterpolation ::= 11032 * stringInterpolation ::=
11033 * ''' {@link InterpolationElement interpolationElement}* ''' 11033 * ''' [InterpolationElement interpolationElement]* '''
11034 * | '"' {@link InterpolationElement interpolationElement}* '"' 11034 * | '"' [InterpolationElement interpolationElement]* '"'
11035 * </pre> 11035 * </pre>
11036 * @coverage dart.engine.ast 11036 * @coverage dart.engine.ast
11037 */ 11037 */
11038 class StringInterpolation extends StringLiteral { 11038 class StringInterpolation extends StringLiteral {
11039 11039
11040 /** 11040 /**
11041 * The elements that will be composed to produce the resulting string. 11041 * The elements that will be composed to produce the resulting string.
11042 */ 11042 */
11043 NodeList<InterpolationElement> _elements; 11043 NodeList<InterpolationElement> _elements;
11044 11044
(...skipping 21 matching lines...) Expand all
11066 NodeList<InterpolationElement> get elements => _elements; 11066 NodeList<InterpolationElement> get elements => _elements;
11067 Token get endToken => _elements.endToken; 11067 Token get endToken => _elements.endToken;
11068 void visitChildren(ASTVisitor<Object> visitor) { 11068 void visitChildren(ASTVisitor<Object> visitor) {
11069 _elements.accept(visitor); 11069 _elements.accept(visitor);
11070 } 11070 }
11071 void appendStringValue(JavaStringBuilder builder) { 11071 void appendStringValue(JavaStringBuilder builder) {
11072 throw new IllegalArgumentException(); 11072 throw new IllegalArgumentException();
11073 } 11073 }
11074 } 11074 }
11075 /** 11075 /**
11076 * Instances of the class {@code StringLiteral} represent a string literal expre ssion. 11076 * Instances of the class `StringLiteral` represent a string literal expression.
11077 * <pre> 11077 * <pre>
11078 * stringLiteral ::={@link SimpleStringLiteral simpleStringLiteral}| {@link Adja centStrings adjacentStrings}| {@link StringInterpolation stringInterpolation}</p re> 11078 * stringLiteral ::=[SimpleStringLiteral simpleStringLiteral]| [AdjacentStrings adjacentStrings]| [StringInterpolation stringInterpolation]</pre>
11079 * @coverage dart.engine.ast 11079 * @coverage dart.engine.ast
11080 */ 11080 */
11081 abstract class StringLiteral extends Literal { 11081 abstract class StringLiteral extends Literal {
11082 11082
11083 /** 11083 /**
11084 * Return the value of the string literal, or {@code null} if the string is no t a constant string 11084 * Return the value of the string literal, or `null` if the string is not a co nstant string
11085 * without any string interpolation. 11085 * without any string interpolation.
11086 * @return the value of the string literal 11086 * @return the value of the string literal
11087 */ 11087 */
11088 String get stringValue { 11088 String get stringValue {
11089 JavaStringBuilder builder = new JavaStringBuilder(); 11089 JavaStringBuilder builder = new JavaStringBuilder();
11090 try { 11090 try {
11091 appendStringValue(builder); 11091 appendStringValue(builder);
11092 } on IllegalArgumentException catch (exception) { 11092 } on IllegalArgumentException catch (exception) {
11093 return null; 11093 return null;
11094 } 11094 }
11095 return builder.toString(); 11095 return builder.toString();
11096 } 11096 }
11097 11097
11098 /** 11098 /**
11099 * Append the value of the given string literal to the given string builder. 11099 * Append the value of the given string literal to the given string builder.
11100 * @param builder the builder to which the string's value is to be appended 11100 * @param builder the builder to which the string's value is to be appended
11101 * @throws IllegalArgumentException if the string is not a constant string wit hout any string 11101 * @throws IllegalArgumentException if the string is not a constant string wit hout any string
11102 * interpolation 11102 * interpolation
11103 */ 11103 */
11104 void appendStringValue(JavaStringBuilder builder); 11104 void appendStringValue(JavaStringBuilder builder);
11105 } 11105 }
11106 /** 11106 /**
11107 * Instances of the class {@code SuperConstructorInvocation} represent the invoc ation of a 11107 * Instances of the class `SuperConstructorInvocation` represent the invocation of a
11108 * superclass' constructor from within a constructor's initialization list. 11108 * superclass' constructor from within a constructor's initialization list.
11109 * <pre> 11109 * <pre>
11110 * superInvocation ::= 11110 * superInvocation ::=
11111 * 'super' ('.' {@link SimpleIdentifier name})? {@link ArgumentList argumentList }</pre> 11111 * 'super' ('.' [SimpleIdentifier name])? [ArgumentList argumentList]</pre>
11112 * @coverage dart.engine.ast 11112 * @coverage dart.engine.ast
11113 */ 11113 */
11114 class SuperConstructorInvocation extends ConstructorInitializer { 11114 class SuperConstructorInvocation extends ConstructorInitializer {
11115 11115
11116 /** 11116 /**
11117 * The token for the 'super' keyword. 11117 * The token for the 'super' keyword.
11118 */ 11118 */
11119 Token _keyword; 11119 Token _keyword;
11120 11120
11121 /** 11121 /**
11122 * The token for the period before the name of the constructor that is being i nvoked, or{@code null} if the unnamed constructor is being invoked. 11122 * The token for the period before the name of the constructor that is being i nvoked, or`null` if the unnamed constructor is being invoked.
11123 */ 11123 */
11124 Token _period; 11124 Token _period;
11125 11125
11126 /** 11126 /**
11127 * The name of the constructor that is being invoked, or {@code null} if the u nnamed constructor 11127 * The name of the constructor that is being invoked, or `null` if the unnamed constructor
11128 * is being invoked. 11128 * is being invoked.
11129 */ 11129 */
11130 SimpleIdentifier _constructorName; 11130 SimpleIdentifier _constructorName;
11131 11131
11132 /** 11132 /**
11133 * The list of arguments to the constructor. 11133 * The list of arguments to the constructor.
11134 */ 11134 */
11135 ArgumentList _argumentList; 11135 ArgumentList _argumentList;
11136 11136
11137 /** 11137 /**
11138 * The element associated with the constructor based on static type informatio n, or {@code null}if the AST structure has not been resolved or if the construct or could not be resolved. 11138 * The element associated with the constructor based on static type informatio n, or `null`if the AST structure has not been resolved or if the constructor cou ld not be resolved.
11139 */ 11139 */
11140 ConstructorElement _staticElement; 11140 ConstructorElement _staticElement;
11141 11141
11142 /** 11142 /**
11143 * The element associated with the constructor based on propagated type inform ation, or {@code null} if the AST structure has not been 11143 * The element associated with the constructor based on propagated type inform ation, or `null` if the AST structure has not been
11144 * resolved or if the constructor could not be resolved. 11144 * resolved or if the constructor could not be resolved.
11145 */ 11145 */
11146 ConstructorElement _propagatedElement; 11146 ConstructorElement _propagatedElement;
11147 11147
11148 /** 11148 /**
11149 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given 11149 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given
11150 * name with the given arguments. 11150 * name with the given arguments.
11151 * @param keyword the token for the 'super' keyword 11151 * @param keyword the token for the 'super' keyword
11152 * @param period the token for the period before the name of the constructor t hat is being invoked 11152 * @param period the token for the period before the name of the constructor t hat is being invoked
11153 * @param constructorName the name of the constructor that is being invoked 11153 * @param constructorName the name of the constructor that is being invoked
(...skipping 18 matching lines...) Expand all
11172 accept(ASTVisitor visitor) => visitor.visitSuperConstructorInvocation(this); 11172 accept(ASTVisitor visitor) => visitor.visitSuperConstructorInvocation(this);
11173 11173
11174 /** 11174 /**
11175 * Return the list of arguments to the constructor. 11175 * Return the list of arguments to the constructor.
11176 * @return the list of arguments to the constructor 11176 * @return the list of arguments to the constructor
11177 */ 11177 */
11178 ArgumentList get argumentList => _argumentList; 11178 ArgumentList get argumentList => _argumentList;
11179 Token get beginToken => _keyword; 11179 Token get beginToken => _keyword;
11180 11180
11181 /** 11181 /**
11182 * Return the name of the constructor that is being invoked, or {@code null} i f the unnamed 11182 * Return the name of the constructor that is being invoked, or `null` if the unnamed
11183 * constructor is being invoked. 11183 * constructor is being invoked.
11184 * @return the name of the constructor that is being invoked 11184 * @return the name of the constructor that is being invoked
11185 */ 11185 */
11186 SimpleIdentifier get constructorName => _constructorName; 11186 SimpleIdentifier get constructorName => _constructorName;
11187 11187
11188 /** 11188 /**
11189 * Return the element associated with the constructor based on propagated type information, or{@code null} if the AST structure has not been resolved or if th e constructor could not be 11189 * Return the element associated with the constructor based on propagated type information, or`null` if the AST structure has not been resolved or if the cons tructor could not be
11190 * resolved. 11190 * resolved.
11191 * @return the element associated with the super constructor 11191 * @return the element associated with the super constructor
11192 */ 11192 */
11193 ConstructorElement get element => _propagatedElement; 11193 ConstructorElement get element => _propagatedElement;
11194 Token get endToken => _argumentList.endToken; 11194 Token get endToken => _argumentList.endToken;
11195 11195
11196 /** 11196 /**
11197 * Return the token for the 'super' keyword. 11197 * Return the token for the 'super' keyword.
11198 * @return the token for the 'super' keyword 11198 * @return the token for the 'super' keyword
11199 */ 11199 */
11200 Token get keyword => _keyword; 11200 Token get keyword => _keyword;
11201 11201
11202 /** 11202 /**
11203 * Return the token for the period before the name of the constructor that is being invoked, or{@code null} if the unnamed constructor is being invoked. 11203 * Return the token for the period before the name of the constructor that is being invoked, or`null` if the unnamed constructor is being invoked.
11204 * @return the token for the period before the name of the constructor that is being invoked 11204 * @return the token for the period before the name of the constructor that is being invoked
11205 */ 11205 */
11206 Token get period => _period; 11206 Token get period => _period;
11207 11207
11208 /** 11208 /**
11209 * Return the element associated with the constructor based on static type inf ormation, or{@code null} if the AST structure has not been resolved or if the co nstructor could not be 11209 * Return the element associated with the constructor based on static type inf ormation, or`null` if the AST structure has not been resolved or if the construc tor could not be
11210 * resolved. 11210 * resolved.
11211 * @return the element associated with the constructor 11211 * @return the element associated with the constructor
11212 */ 11212 */
11213 ConstructorElement get staticElement => _staticElement; 11213 ConstructorElement get staticElement => _staticElement;
11214 11214
11215 /** 11215 /**
11216 * Set the list of arguments to the constructor to the given list. 11216 * Set the list of arguments to the constructor to the given list.
11217 * @param argumentList the list of arguments to the constructor 11217 * @param argumentList the list of arguments to the constructor
11218 */ 11218 */
11219 void set argumentList(ArgumentList argumentList2) { 11219 void set argumentList(ArgumentList argumentList2) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
11261 */ 11261 */
11262 void set staticElement(ConstructorElement element) { 11262 void set staticElement(ConstructorElement element) {
11263 this._staticElement = element; 11263 this._staticElement = element;
11264 } 11264 }
11265 void visitChildren(ASTVisitor<Object> visitor) { 11265 void visitChildren(ASTVisitor<Object> visitor) {
11266 safelyVisitChild(_constructorName, visitor); 11266 safelyVisitChild(_constructorName, visitor);
11267 safelyVisitChild(_argumentList, visitor); 11267 safelyVisitChild(_argumentList, visitor);
11268 } 11268 }
11269 } 11269 }
11270 /** 11270 /**
11271 * Instances of the class {@code SuperExpression} represent a super expression. 11271 * Instances of the class `SuperExpression` represent a super expression.
11272 * <pre> 11272 * <pre>
11273 * superExpression ::= 11273 * superExpression ::=
11274 * 'super' 11274 * 'super'
11275 * </pre> 11275 * </pre>
11276 * @coverage dart.engine.ast 11276 * @coverage dart.engine.ast
11277 */ 11277 */
11278 class SuperExpression extends Expression { 11278 class SuperExpression extends Expression {
11279 11279
11280 /** 11280 /**
11281 * The token representing the keyword. 11281 * The token representing the keyword.
(...skipping 27 matching lines...) Expand all
11309 * Set the token representing the keyword to the given token. 11309 * Set the token representing the keyword to the given token.
11310 * @param keyword the token representing the keyword 11310 * @param keyword the token representing the keyword
11311 */ 11311 */
11312 void set keyword(Token keyword2) { 11312 void set keyword(Token keyword2) {
11313 this._keyword = keyword2; 11313 this._keyword = keyword2;
11314 } 11314 }
11315 void visitChildren(ASTVisitor<Object> visitor) { 11315 void visitChildren(ASTVisitor<Object> visitor) {
11316 } 11316 }
11317 } 11317 }
11318 /** 11318 /**
11319 * Instances of the class {@code SwitchCase} represent the case in a switch stat ement. 11319 * Instances of the class `SwitchCase` represent the case in a switch statement.
11320 * <pre> 11320 * <pre>
11321 * switchCase ::={@link SimpleIdentifier label}* 'case' {@link Expression expres sion} ':' {@link Statement statement}</pre> 11321 * switchCase ::=[SimpleIdentifier label]* 'case' [Expression expression] ':' [S tatement statement]</pre>
11322 * @coverage dart.engine.ast 11322 * @coverage dart.engine.ast
11323 */ 11323 */
11324 class SwitchCase extends SwitchMember { 11324 class SwitchCase extends SwitchMember {
11325 11325
11326 /** 11326 /**
11327 * The expression controlling whether the statements will be executed. 11327 * The expression controlling whether the statements will be executed.
11328 */ 11328 */
11329 Expression _expression; 11329 Expression _expression;
11330 11330
11331 /** 11331 /**
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
11364 void set expression(Expression expression2) { 11364 void set expression(Expression expression2) {
11365 this._expression = becomeParentOf(expression2); 11365 this._expression = becomeParentOf(expression2);
11366 } 11366 }
11367 void visitChildren(ASTVisitor<Object> visitor) { 11367 void visitChildren(ASTVisitor<Object> visitor) {
11368 labels.accept(visitor); 11368 labels.accept(visitor);
11369 safelyVisitChild(_expression, visitor); 11369 safelyVisitChild(_expression, visitor);
11370 statements.accept(visitor); 11370 statements.accept(visitor);
11371 } 11371 }
11372 } 11372 }
11373 /** 11373 /**
11374 * Instances of the class {@code SwitchDefault} represent the default case in a switch statement. 11374 * Instances of the class `SwitchDefault` represent the default case in a switch statement.
11375 * <pre> 11375 * <pre>
11376 * switchDefault ::={@link SimpleIdentifier label}* 'default' ':' {@link Stateme nt statement}</pre> 11376 * switchDefault ::=[SimpleIdentifier label]* 'default' ':' [Statement statement ]</pre>
11377 * @coverage dart.engine.ast 11377 * @coverage dart.engine.ast
11378 */ 11378 */
11379 class SwitchDefault extends SwitchMember { 11379 class SwitchDefault extends SwitchMember {
11380 11380
11381 /** 11381 /**
11382 * Initialize a newly created switch default. 11382 * Initialize a newly created switch default.
11383 * @param labels the labels associated with the switch member 11383 * @param labels the labels associated with the switch member
11384 * @param keyword the token representing the 'case' or 'default' keyword 11384 * @param keyword the token representing the 'case' or 'default' keyword
11385 * @param colon the colon separating the keyword or the expression from the st atements 11385 * @param colon the colon separating the keyword or the expression from the st atements
11386 * @param statements the statements that will be executed if this switch membe r is selected 11386 * @param statements the statements that will be executed if this switch membe r is selected
11387 */ 11387 */
11388 SwitchDefault.full(List<Label> labels, Token keyword, Token colon, List<Statem ent> statements) : super.full(labels, keyword, colon, statements) { 11388 SwitchDefault.full(List<Label> labels, Token keyword, Token colon, List<Statem ent> statements) : super.full(labels, keyword, colon, statements) {
11389 } 11389 }
11390 11390
11391 /** 11391 /**
11392 * Initialize a newly created switch default. 11392 * Initialize a newly created switch default.
11393 * @param labels the labels associated with the switch member 11393 * @param labels the labels associated with the switch member
11394 * @param keyword the token representing the 'case' or 'default' keyword 11394 * @param keyword the token representing the 'case' or 'default' keyword
11395 * @param colon the colon separating the keyword or the expression from the st atements 11395 * @param colon the colon separating the keyword or the expression from the st atements
11396 * @param statements the statements that will be executed if this switch membe r is selected 11396 * @param statements the statements that will be executed if this switch membe r is selected
11397 */ 11397 */
11398 SwitchDefault({List<Label> labels, Token keyword, Token colon, List<Statement> statements}) : this.full(labels, keyword, colon, statements); 11398 SwitchDefault({List<Label> labels, Token keyword, Token colon, List<Statement> statements}) : this.full(labels, keyword, colon, statements);
11399 accept(ASTVisitor visitor) => visitor.visitSwitchDefault(this); 11399 accept(ASTVisitor visitor) => visitor.visitSwitchDefault(this);
11400 void visitChildren(ASTVisitor<Object> visitor) { 11400 void visitChildren(ASTVisitor<Object> visitor) {
11401 labels.accept(visitor); 11401 labels.accept(visitor);
11402 statements.accept(visitor); 11402 statements.accept(visitor);
11403 } 11403 }
11404 } 11404 }
11405 /** 11405 /**
11406 * The abstract class {@code SwitchMember} defines the behavior common to object s representing 11406 * The abstract class `SwitchMember` defines the behavior common to objects repr esenting
11407 * elements within a switch statement. 11407 * elements within a switch statement.
11408 * <pre> 11408 * <pre>
11409 * switchMember ::= 11409 * switchMember ::=
11410 * switchCase 11410 * switchCase
11411 * | switchDefault 11411 * | switchDefault
11412 * </pre> 11412 * </pre>
11413 * @coverage dart.engine.ast 11413 * @coverage dart.engine.ast
11414 */ 11414 */
11415 abstract class SwitchMember extends ASTNode { 11415 abstract class SwitchMember extends ASTNode {
11416 11416
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
11505 11505
11506 /** 11506 /**
11507 * Set the token representing the 'case' or 'default' keyword to the given tok en. 11507 * Set the token representing the 'case' or 'default' keyword to the given tok en.
11508 * @param keyword the token representing the 'case' or 'default' keyword 11508 * @param keyword the token representing the 'case' or 'default' keyword
11509 */ 11509 */
11510 void set keyword(Token keyword2) { 11510 void set keyword(Token keyword2) {
11511 this._keyword = keyword2; 11511 this._keyword = keyword2;
11512 } 11512 }
11513 } 11513 }
11514 /** 11514 /**
11515 * Instances of the class {@code SwitchStatement} represent a switch statement. 11515 * Instances of the class `SwitchStatement` represent a switch statement.
11516 * <pre> 11516 * <pre>
11517 * switchStatement ::= 11517 * switchStatement ::=
11518 * 'switch' '(' {@link Expression expression} ')' '{' {@link SwitchCase switchCa se}* {@link SwitchDefault defaultCase}? '}' 11518 * 'switch' '(' [Expression expression] ')' '{' [SwitchCase switchCase]* [Switch Default defaultCase]? '}'
11519 * </pre> 11519 * </pre>
11520 * @coverage dart.engine.ast 11520 * @coverage dart.engine.ast
11521 */ 11521 */
11522 class SwitchStatement extends Statement { 11522 class SwitchStatement extends Statement {
11523 11523
11524 /** 11524 /**
11525 * The token representing the 'switch' keyword. 11525 * The token representing the 'switch' keyword.
11526 */ 11526 */
11527 Token _keyword; 11527 Token _keyword;
11528 11528
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
11681 */ 11681 */
11682 void set rightParenthesis(Token rightParenthesis2) { 11682 void set rightParenthesis(Token rightParenthesis2) {
11683 this._rightParenthesis = rightParenthesis2; 11683 this._rightParenthesis = rightParenthesis2;
11684 } 11684 }
11685 void visitChildren(ASTVisitor<Object> visitor) { 11685 void visitChildren(ASTVisitor<Object> visitor) {
11686 safelyVisitChild(_expression, visitor); 11686 safelyVisitChild(_expression, visitor);
11687 _members.accept(visitor); 11687 _members.accept(visitor);
11688 } 11688 }
11689 } 11689 }
11690 /** 11690 /**
11691 * Instances of the class {@code ThisExpression} represent a this expression. 11691 * Instances of the class `ThisExpression` represent a this expression.
11692 * <pre> 11692 * <pre>
11693 * thisExpression ::= 11693 * thisExpression ::=
11694 * 'this' 11694 * 'this'
11695 * </pre> 11695 * </pre>
11696 * @coverage dart.engine.ast 11696 * @coverage dart.engine.ast
11697 */ 11697 */
11698 class ThisExpression extends Expression { 11698 class ThisExpression extends Expression {
11699 11699
11700 /** 11700 /**
11701 * The token representing the keyword. 11701 * The token representing the keyword.
(...skipping 27 matching lines...) Expand all
11729 * Set the token representing the keyword to the given token. 11729 * Set the token representing the keyword to the given token.
11730 * @param keyword the token representing the keyword 11730 * @param keyword the token representing the keyword
11731 */ 11731 */
11732 void set keyword(Token keyword2) { 11732 void set keyword(Token keyword2) {
11733 this._keyword = keyword2; 11733 this._keyword = keyword2;
11734 } 11734 }
11735 void visitChildren(ASTVisitor<Object> visitor) { 11735 void visitChildren(ASTVisitor<Object> visitor) {
11736 } 11736 }
11737 } 11737 }
11738 /** 11738 /**
11739 * Instances of the class {@code ThrowExpression} represent a throw expression. 11739 * Instances of the class `ThrowExpression` represent a throw expression.
11740 * <pre> 11740 * <pre>
11741 * throwExpression ::= 11741 * throwExpression ::=
11742 * 'throw' {@link Expression expression}</pre> 11742 * 'throw' [Expression expression]</pre>
11743 * @coverage dart.engine.ast 11743 * @coverage dart.engine.ast
11744 */ 11744 */
11745 class ThrowExpression extends Expression { 11745 class ThrowExpression extends Expression {
11746 11746
11747 /** 11747 /**
11748 * The token representing the 'throw' keyword. 11748 * The token representing the 'throw' keyword.
11749 */ 11749 */
11750 Token _keyword; 11750 Token _keyword;
11751 11751
11752 /** 11752 /**
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
11804 * @param keyword the token representing the 'throw' keyword 11804 * @param keyword the token representing the 'throw' keyword
11805 */ 11805 */
11806 void set keyword(Token keyword2) { 11806 void set keyword(Token keyword2) {
11807 this._keyword = keyword2; 11807 this._keyword = keyword2;
11808 } 11808 }
11809 void visitChildren(ASTVisitor<Object> visitor) { 11809 void visitChildren(ASTVisitor<Object> visitor) {
11810 safelyVisitChild(_expression, visitor); 11810 safelyVisitChild(_expression, visitor);
11811 } 11811 }
11812 } 11812 }
11813 /** 11813 /**
11814 * Instances of the class {@code TopLevelVariableDeclaration} represent the decl aration of one or 11814 * Instances of the class `TopLevelVariableDeclaration` represent the declaratio n of one or
11815 * more top-level variables of the same type. 11815 * more top-level variables of the same type.
11816 * <pre> 11816 * <pre>
11817 * topLevelVariableDeclaration ::= 11817 * topLevelVariableDeclaration ::=
11818 * ('final' | 'const') type? staticFinalDeclarationList ';' 11818 * ('final' | 'const') type? staticFinalDeclarationList ';'
11819 * | variableDeclaration ';' 11819 * | variableDeclaration ';'
11820 * </pre> 11820 * </pre>
11821 * @coverage dart.engine.ast 11821 * @coverage dart.engine.ast
11822 */ 11822 */
11823 class TopLevelVariableDeclaration extends CompilationUnitMember { 11823 class TopLevelVariableDeclaration extends CompilationUnitMember {
11824 11824
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
11883 void set variables(VariableDeclarationList variableList) { 11883 void set variables(VariableDeclarationList variableList) {
11884 variableList = becomeParentOf(variableList); 11884 variableList = becomeParentOf(variableList);
11885 } 11885 }
11886 void visitChildren(ASTVisitor<Object> visitor) { 11886 void visitChildren(ASTVisitor<Object> visitor) {
11887 super.visitChildren(visitor); 11887 super.visitChildren(visitor);
11888 safelyVisitChild(_variableList, visitor); 11888 safelyVisitChild(_variableList, visitor);
11889 } 11889 }
11890 Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken; 11890 Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken;
11891 } 11891 }
11892 /** 11892 /**
11893 * Instances of the class {@code TryStatement} represent a try statement. 11893 * Instances of the class `TryStatement` represent a try statement.
11894 * <pre> 11894 * <pre>
11895 * tryStatement ::= 11895 * tryStatement ::=
11896 * 'try' {@link Block block} ({@link CatchClause catchClause}+ finallyClause? | finallyClause) 11896 * 'try' [Block block] ([CatchClause catchClause]+ finallyClause? | finallyClaus e)
11897 * finallyClause ::= 11897 * finallyClause ::=
11898 * 'finally' {@link Block block}</pre> 11898 * 'finally' [Block block]</pre>
11899 * @coverage dart.engine.ast 11899 * @coverage dart.engine.ast
11900 */ 11900 */
11901 class TryStatement extends Statement { 11901 class TryStatement extends Statement {
11902 11902
11903 /** 11903 /**
11904 * The token representing the 'try' keyword. 11904 * The token representing the 'try' keyword.
11905 */ 11905 */
11906 Token _tryKeyword; 11906 Token _tryKeyword;
11907 11907
11908 /** 11908 /**
11909 * The body of the statement. 11909 * The body of the statement.
11910 */ 11910 */
11911 Block _body; 11911 Block _body;
11912 11912
11913 /** 11913 /**
11914 * The catch clauses contained in the try statement. 11914 * The catch clauses contained in the try statement.
11915 */ 11915 */
11916 NodeList<CatchClause> _catchClauses; 11916 NodeList<CatchClause> _catchClauses;
11917 11917
11918 /** 11918 /**
11919 * The token representing the 'finally' keyword, or {@code null} if the statem ent does not contain 11919 * The token representing the 'finally' keyword, or `null` if the statement do es not contain
11920 * a finally clause. 11920 * a finally clause.
11921 */ 11921 */
11922 Token _finallyKeyword; 11922 Token _finallyKeyword;
11923 11923
11924 /** 11924 /**
11925 * The finally clause contained in the try statement, or {@code null} if the s tatement does not 11925 * The finally clause contained in the try statement, or `null` if the stateme nt does not
11926 * contain a finally clause. 11926 * contain a finally clause.
11927 */ 11927 */
11928 Block _finallyClause; 11928 Block _finallyClause;
11929 11929
11930 /** 11930 /**
11931 * Initialize a newly created try statement. 11931 * Initialize a newly created try statement.
11932 * @param tryKeyword the token representing the 'try' keyword 11932 * @param tryKeyword the token representing the 'try' keyword
11933 * @param body the body of the statement 11933 * @param body the body of the statement
11934 * @param catchClauses the catch clauses contained in the try statement 11934 * @param catchClauses the catch clauses contained in the try statement
11935 * @param finallyKeyword the token representing the 'finally' keyword 11935 * @param finallyKeyword the token representing the 'finally' keyword
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
11972 return _finallyClause.endToken; 11972 return _finallyClause.endToken;
11973 } else if (_finallyKeyword != null) { 11973 } else if (_finallyKeyword != null) {
11974 return _finallyKeyword; 11974 return _finallyKeyword;
11975 } else if (!_catchClauses.isEmpty) { 11975 } else if (!_catchClauses.isEmpty) {
11976 return _catchClauses.endToken; 11976 return _catchClauses.endToken;
11977 } 11977 }
11978 return _body.endToken; 11978 return _body.endToken;
11979 } 11979 }
11980 11980
11981 /** 11981 /**
11982 * Return the finally clause contained in the try statement, or {@code null} i f the statement does 11982 * Return the finally clause contained in the try statement, or `null` if the statement does
11983 * not contain a finally clause. 11983 * not contain a finally clause.
11984 * @return the finally clause contained in the try statement 11984 * @return the finally clause contained in the try statement
11985 */ 11985 */
11986 Block get finallyClause => _finallyClause; 11986 Block get finallyClause => _finallyClause;
11987 11987
11988 /** 11988 /**
11989 * Return the token representing the 'finally' keyword, or {@code null} if the statement does not 11989 * Return the token representing the 'finally' keyword, or `null` if the state ment does not
11990 * contain a finally clause. 11990 * contain a finally clause.
11991 * @return the token representing the 'finally' keyword 11991 * @return the token representing the 'finally' keyword
11992 */ 11992 */
11993 Token get finallyKeyword => _finallyKeyword; 11993 Token get finallyKeyword => _finallyKeyword;
11994 11994
11995 /** 11995 /**
11996 * Return the token representing the 'try' keyword. 11996 * Return the token representing the 'try' keyword.
11997 * @return the token representing the 'try' keyword 11997 * @return the token representing the 'try' keyword
11998 */ 11998 */
11999 Token get tryKeyword => _tryKeyword; 11999 Token get tryKeyword => _tryKeyword;
(...skipping 29 matching lines...) Expand all
12029 void set tryKeyword(Token tryKeyword2) { 12029 void set tryKeyword(Token tryKeyword2) {
12030 this._tryKeyword = tryKeyword2; 12030 this._tryKeyword = tryKeyword2;
12031 } 12031 }
12032 void visitChildren(ASTVisitor<Object> visitor) { 12032 void visitChildren(ASTVisitor<Object> visitor) {
12033 safelyVisitChild(_body, visitor); 12033 safelyVisitChild(_body, visitor);
12034 _catchClauses.accept(visitor); 12034 _catchClauses.accept(visitor);
12035 safelyVisitChild(_finallyClause, visitor); 12035 safelyVisitChild(_finallyClause, visitor);
12036 } 12036 }
12037 } 12037 }
12038 /** 12038 /**
12039 * The abstract class {@code TypeAlias} defines the behavior common to declarati ons of type aliases. 12039 * The abstract class `TypeAlias` defines the behavior common to declarations of type aliases.
12040 * <pre> 12040 * <pre>
12041 * typeAlias ::= 12041 * typeAlias ::=
12042 * 'typedef' typeAliasBody 12042 * 'typedef' typeAliasBody
12043 * typeAliasBody ::= 12043 * typeAliasBody ::=
12044 * classTypeAlias 12044 * classTypeAlias
12045 * | functionTypeAlias 12045 * | functionTypeAlias
12046 * </pre> 12046 * </pre>
12047 * @coverage dart.engine.ast 12047 * @coverage dart.engine.ast
12048 */ 12048 */
12049 abstract class TypeAlias extends CompilationUnitMember { 12049 abstract class TypeAlias extends CompilationUnitMember {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
12103 /** 12103 /**
12104 * Set the semicolon terminating the declaration to the given token. 12104 * Set the semicolon terminating the declaration to the given token.
12105 * @param semicolon the semicolon terminating the declaration 12105 * @param semicolon the semicolon terminating the declaration
12106 */ 12106 */
12107 void set semicolon(Token semicolon2) { 12107 void set semicolon(Token semicolon2) {
12108 this._semicolon = semicolon2; 12108 this._semicolon = semicolon2;
12109 } 12109 }
12110 Token get firstTokenAfterCommentAndMetadata => _keyword; 12110 Token get firstTokenAfterCommentAndMetadata => _keyword;
12111 } 12111 }
12112 /** 12112 /**
12113 * Instances of the class {@code TypeArgumentList} represent a list of type argu ments. 12113 * Instances of the class `TypeArgumentList` represent a list of type arguments.
12114 * <pre> 12114 * <pre>
12115 * typeArguments ::= 12115 * typeArguments ::=
12116 * '<' typeName (',' typeName)* '>' 12116 * '<' typeName (',' typeName)* '>'
12117 * </pre> 12117 * </pre>
12118 * @coverage dart.engine.ast 12118 * @coverage dart.engine.ast
12119 */ 12119 */
12120 class TypeArgumentList extends ASTNode { 12120 class TypeArgumentList extends ASTNode {
12121 12121
12122 /** 12122 /**
12123 * The left bracket. 12123 * The left bracket.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
12189 * @param rightBracket the right bracket 12189 * @param rightBracket the right bracket
12190 */ 12190 */
12191 void set rightBracket(Token rightBracket2) { 12191 void set rightBracket(Token rightBracket2) {
12192 this._rightBracket = rightBracket2; 12192 this._rightBracket = rightBracket2;
12193 } 12193 }
12194 void visitChildren(ASTVisitor<Object> visitor) { 12194 void visitChildren(ASTVisitor<Object> visitor) {
12195 _arguments.accept(visitor); 12195 _arguments.accept(visitor);
12196 } 12196 }
12197 } 12197 }
12198 /** 12198 /**
12199 * Instances of the class {@code TypeName} represent the name of a type, which c an optionally 12199 * Instances of the class `TypeName` represent the name of a type, which can opt ionally
12200 * include type arguments. 12200 * include type arguments.
12201 * <pre> 12201 * <pre>
12202 * typeName ::={@link Identifier identifier} typeArguments? 12202 * typeName ::=[Identifier identifier] typeArguments?
12203 * </pre> 12203 * </pre>
12204 * @coverage dart.engine.ast 12204 * @coverage dart.engine.ast
12205 */ 12205 */
12206 class TypeName extends ASTNode { 12206 class TypeName extends ASTNode {
12207 12207
12208 /** 12208 /**
12209 * The name of the type. 12209 * The name of the type.
12210 */ 12210 */
12211 Identifier _name; 12211 Identifier _name;
12212 12212
12213 /** 12213 /**
12214 * The type arguments associated with the type, or {@code null} if there are n o type arguments. 12214 * The type arguments associated with the type, or `null` if there are no type arguments.
12215 */ 12215 */
12216 TypeArgumentList _typeArguments; 12216 TypeArgumentList _typeArguments;
12217 12217
12218 /** 12218 /**
12219 * The type being named, or {@code null} if the AST structure has not been res olved. 12219 * The type being named, or `null` if the AST structure has not been resolved.
12220 */ 12220 */
12221 Type2 _type; 12221 Type2 _type;
12222 12222
12223 /** 12223 /**
12224 * Initialize a newly created type name. 12224 * Initialize a newly created type name.
12225 * @param name the name of the type 12225 * @param name the name of the type
12226 * @param typeArguments the type arguments associated with the type, or {@code null} if there are 12226 * @param typeArguments the type arguments associated with the type, or `null` if there are
12227 * no type arguments 12227 * no type arguments
12228 */ 12228 */
12229 TypeName.full(Identifier name, TypeArgumentList typeArguments) { 12229 TypeName.full(Identifier name, TypeArgumentList typeArguments) {
12230 this._name = becomeParentOf(name); 12230 this._name = becomeParentOf(name);
12231 this._typeArguments = becomeParentOf(typeArguments); 12231 this._typeArguments = becomeParentOf(typeArguments);
12232 } 12232 }
12233 12233
12234 /** 12234 /**
12235 * Initialize a newly created type name. 12235 * Initialize a newly created type name.
12236 * @param name the name of the type 12236 * @param name the name of the type
12237 * @param typeArguments the type arguments associated with the type, or {@code null} if there are 12237 * @param typeArguments the type arguments associated with the type, or `null` if there are
12238 * no type arguments 12238 * no type arguments
12239 */ 12239 */
12240 TypeName({Identifier name, TypeArgumentList typeArguments}) : this.full(name, typeArguments); 12240 TypeName({Identifier name, TypeArgumentList typeArguments}) : this.full(name, typeArguments);
12241 accept(ASTVisitor visitor) => visitor.visitTypeName(this); 12241 accept(ASTVisitor visitor) => visitor.visitTypeName(this);
12242 Token get beginToken => _name.beginToken; 12242 Token get beginToken => _name.beginToken;
12243 Token get endToken { 12243 Token get endToken {
12244 if (_typeArguments != null) { 12244 if (_typeArguments != null) {
12245 return _typeArguments.endToken; 12245 return _typeArguments.endToken;
12246 } 12246 }
12247 return _name.endToken; 12247 return _name.endToken;
12248 } 12248 }
12249 12249
12250 /** 12250 /**
12251 * Return the name of the type. 12251 * Return the name of the type.
12252 * @return the name of the type 12252 * @return the name of the type
12253 */ 12253 */
12254 Identifier get name => _name; 12254 Identifier get name => _name;
12255 12255
12256 /** 12256 /**
12257 * Return the type being named, or {@code null} if the AST structure has not b een resolved. 12257 * Return the type being named, or `null` if the AST structure has not been re solved.
12258 * @return the type being named 12258 * @return the type being named
12259 */ 12259 */
12260 Type2 get type => _type; 12260 Type2 get type => _type;
12261 12261
12262 /** 12262 /**
12263 * Return the type arguments associated with the type, or {@code null} if ther e are no type 12263 * Return the type arguments associated with the type, or `null` if there are no type
12264 * arguments. 12264 * arguments.
12265 * @return the type arguments associated with the type 12265 * @return the type arguments associated with the type
12266 */ 12266 */
12267 TypeArgumentList get typeArguments => _typeArguments; 12267 TypeArgumentList get typeArguments => _typeArguments;
12268 bool isSynthetic() => _name.isSynthetic() && _typeArguments == null; 12268 bool isSynthetic() => _name.isSynthetic() && _typeArguments == null;
12269 12269
12270 /** 12270 /**
12271 * Set the name of the type to the given identifier. 12271 * Set the name of the type to the given identifier.
12272 * @param identifier the name of the type 12272 * @param identifier the name of the type
12273 */ 12273 */
(...skipping 15 matching lines...) Expand all
12289 */ 12289 */
12290 void set typeArguments(TypeArgumentList typeArguments2) { 12290 void set typeArguments(TypeArgumentList typeArguments2) {
12291 this._typeArguments = becomeParentOf(typeArguments2); 12291 this._typeArguments = becomeParentOf(typeArguments2);
12292 } 12292 }
12293 void visitChildren(ASTVisitor<Object> visitor) { 12293 void visitChildren(ASTVisitor<Object> visitor) {
12294 safelyVisitChild(_name, visitor); 12294 safelyVisitChild(_name, visitor);
12295 safelyVisitChild(_typeArguments, visitor); 12295 safelyVisitChild(_typeArguments, visitor);
12296 } 12296 }
12297 } 12297 }
12298 /** 12298 /**
12299 * Instances of the class {@code TypeParameter} represent a type parameter. 12299 * Instances of the class `TypeParameter` represent a type parameter.
12300 * <pre> 12300 * <pre>
12301 * typeParameter ::={@link SimpleIdentifier name} ('extends' {@link TypeName bou nd})? 12301 * typeParameter ::=[SimpleIdentifier name] ('extends' [TypeName bound])?
12302 * </pre> 12302 * </pre>
12303 * @coverage dart.engine.ast 12303 * @coverage dart.engine.ast
12304 */ 12304 */
12305 class TypeParameter extends Declaration { 12305 class TypeParameter extends Declaration {
12306 12306
12307 /** 12307 /**
12308 * The name of the type parameter. 12308 * The name of the type parameter.
12309 */ 12309 */
12310 SimpleIdentifier _name; 12310 SimpleIdentifier _name;
12311 12311
12312 /** 12312 /**
12313 * The token representing the 'extends' keyword, or {@code null} if there was no explicit upper 12313 * The token representing the 'extends' keyword, or `null` if there was no exp licit upper
12314 * bound. 12314 * bound.
12315 */ 12315 */
12316 Token _keyword; 12316 Token _keyword;
12317 12317
12318 /** 12318 /**
12319 * The name of the upper bound for legal arguments, or {@code null} if there w as no explicit upper 12319 * The name of the upper bound for legal arguments, or `null` if there was no explicit upper
12320 * bound. 12320 * bound.
12321 */ 12321 */
12322 TypeName _bound; 12322 TypeName _bound;
12323 12323
12324 /** 12324 /**
12325 * Initialize a newly created type parameter. 12325 * Initialize a newly created type parameter.
12326 * @param comment the documentation comment associated with the type parameter 12326 * @param comment the documentation comment associated with the type parameter
12327 * @param metadata the annotations associated with the type parameter 12327 * @param metadata the annotations associated with the type parameter
12328 * @param name the name of the type parameter 12328 * @param name the name of the type parameter
12329 * @param keyword the token representing the 'extends' keyword 12329 * @param keyword the token representing the 'extends' keyword
(...skipping 10 matching lines...) Expand all
12340 * @param comment the documentation comment associated with the type parameter 12340 * @param comment the documentation comment associated with the type parameter
12341 * @param metadata the annotations associated with the type parameter 12341 * @param metadata the annotations associated with the type parameter
12342 * @param name the name of the type parameter 12342 * @param name the name of the type parameter
12343 * @param keyword the token representing the 'extends' keyword 12343 * @param keyword the token representing the 'extends' keyword
12344 * @param bound the name of the upper bound for legal arguments 12344 * @param bound the name of the upper bound for legal arguments
12345 */ 12345 */
12346 TypeParameter({Comment comment, List<Annotation> metadata, SimpleIdentifier na me, Token keyword, TypeName bound}) : this.full(comment, metadata, name, keyword , bound); 12346 TypeParameter({Comment comment, List<Annotation> metadata, SimpleIdentifier na me, Token keyword, TypeName bound}) : this.full(comment, metadata, name, keyword , bound);
12347 accept(ASTVisitor visitor) => visitor.visitTypeParameter(this); 12347 accept(ASTVisitor visitor) => visitor.visitTypeParameter(this);
12348 12348
12349 /** 12349 /**
12350 * Return the name of the upper bound for legal arguments, or {@code null} if there was no 12350 * Return the name of the upper bound for legal arguments, or `null` if there was no
12351 * explicit upper bound. 12351 * explicit upper bound.
12352 * @return the name of the upper bound for legal arguments 12352 * @return the name of the upper bound for legal arguments
12353 */ 12353 */
12354 TypeName get bound => _bound; 12354 TypeName get bound => _bound;
12355 TypeVariableElement get element => _name != null ? (_name.element as TypeVaria bleElement) : null; 12355 TypeVariableElement get element => _name != null ? (_name.element as TypeVaria bleElement) : null;
12356 Token get endToken { 12356 Token get endToken {
12357 if (_bound == null) { 12357 if (_bound == null) {
12358 return _name.endToken; 12358 return _name.endToken;
12359 } 12359 }
12360 return _bound.endToken; 12360 return _bound.endToken;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
12396 _name = becomeParentOf(identifier); 12396 _name = becomeParentOf(identifier);
12397 } 12397 }
12398 void visitChildren(ASTVisitor<Object> visitor) { 12398 void visitChildren(ASTVisitor<Object> visitor) {
12399 super.visitChildren(visitor); 12399 super.visitChildren(visitor);
12400 safelyVisitChild(_name, visitor); 12400 safelyVisitChild(_name, visitor);
12401 safelyVisitChild(_bound, visitor); 12401 safelyVisitChild(_bound, visitor);
12402 } 12402 }
12403 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; 12403 Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
12404 } 12404 }
12405 /** 12405 /**
12406 * Instances of the class {@code TypeParameterList} represent type parameters wi thin a declaration. 12406 * Instances of the class `TypeParameterList` represent type parameters within a declaration.
12407 * <pre> 12407 * <pre>
12408 * typeParameterList ::= 12408 * typeParameterList ::=
12409 * '<' {@link TypeParameter typeParameter} (',' {@link TypeParameter typeParamet er})* '>' 12409 * '<' [TypeParameter typeParameter] (',' [TypeParameter typeParameter])* '>'
12410 * </pre> 12410 * </pre>
12411 * @coverage dart.engine.ast 12411 * @coverage dart.engine.ast
12412 */ 12412 */
12413 class TypeParameterList extends ASTNode { 12413 class TypeParameterList extends ASTNode {
12414 12414
12415 /** 12415 /**
12416 * The left angle bracket. 12416 * The left angle bracket.
12417 */ 12417 */
12418 Token _leftBracket; 12418 Token _leftBracket;
12419 12419
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
12466 /** 12466 /**
12467 * Return the type parameters for the type. 12467 * Return the type parameters for the type.
12468 * @return the type parameters for the type 12468 * @return the type parameters for the type
12469 */ 12469 */
12470 NodeList<TypeParameter> get typeParameters => _typeParameters; 12470 NodeList<TypeParameter> get typeParameters => _typeParameters;
12471 void visitChildren(ASTVisitor<Object> visitor) { 12471 void visitChildren(ASTVisitor<Object> visitor) {
12472 _typeParameters.accept(visitor); 12472 _typeParameters.accept(visitor);
12473 } 12473 }
12474 } 12474 }
12475 /** 12475 /**
12476 * The abstract class {@code TypedLiteral} defines the behavior common to litera ls that have a type 12476 * The abstract class `TypedLiteral` defines the behavior common to literals tha t have a type
12477 * associated with them. 12477 * associated with them.
12478 * <pre> 12478 * <pre>
12479 * listLiteral ::={@link ListLiteral listLiteral}| {@link MapLiteral mapLiteral} </pre> 12479 * listLiteral ::=[ListLiteral listLiteral]| [MapLiteral mapLiteral]</pre>
12480 * @coverage dart.engine.ast 12480 * @coverage dart.engine.ast
12481 */ 12481 */
12482 abstract class TypedLiteral extends Literal { 12482 abstract class TypedLiteral extends Literal {
12483 12483
12484 /** 12484 /**
12485 * The const modifier associated with this literal, or {@code null} if the lit eral is not a 12485 * The const modifier associated with this literal, or `null` if the literal i s not a
12486 * constant. 12486 * constant.
12487 */ 12487 */
12488 Token _modifier; 12488 Token _modifier;
12489 12489
12490 /** 12490 /**
12491 * The type argument associated with this literal, or {@code null} if no type arguments were 12491 * The type argument associated with this literal, or `null` if no type argume nts were
12492 * declared. 12492 * declared.
12493 */ 12493 */
12494 TypeArgumentList _typeArguments; 12494 TypeArgumentList _typeArguments;
12495 12495
12496 /** 12496 /**
12497 * Initialize a newly created typed literal. 12497 * Initialize a newly created typed literal.
12498 * @param modifier the const modifier associated with this literal 12498 * @param modifier the const modifier associated with this literal
12499 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type 12499 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
12500 * arguments were declared 12500 * arguments were declared
12501 */ 12501 */
12502 TypedLiteral.full(Token modifier, TypeArgumentList typeArguments) { 12502 TypedLiteral.full(Token modifier, TypeArgumentList typeArguments) {
12503 this._modifier = modifier; 12503 this._modifier = modifier;
12504 this._typeArguments = becomeParentOf(typeArguments); 12504 this._typeArguments = becomeParentOf(typeArguments);
12505 } 12505 }
12506 12506
12507 /** 12507 /**
12508 * Initialize a newly created typed literal. 12508 * Initialize a newly created typed literal.
12509 * @param modifier the const modifier associated with this literal 12509 * @param modifier the const modifier associated with this literal
12510 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type 12510 * @param typeArguments the type argument associated with this literal, or `nu ll` if no type
12511 * arguments were declared 12511 * arguments were declared
12512 */ 12512 */
12513 TypedLiteral({Token modifier, TypeArgumentList typeArguments}) : this.full(mod ifier, typeArguments); 12513 TypedLiteral({Token modifier, TypeArgumentList typeArguments}) : this.full(mod ifier, typeArguments);
12514 12514
12515 /** 12515 /**
12516 * Return the const modifier associated with this literal. 12516 * Return the const modifier associated with this literal.
12517 * @return the const modifier associated with this literal 12517 * @return the const modifier associated with this literal
12518 */ 12518 */
12519 Token get modifier => _modifier; 12519 Token get modifier => _modifier;
12520 12520
12521 /** 12521 /**
12522 * Return the type argument associated with this literal, or {@code null} if n o type arguments 12522 * Return the type argument associated with this literal, or `null` if no type arguments
12523 * were declared. 12523 * were declared.
12524 * @return the type argument associated with this literal 12524 * @return the type argument associated with this literal
12525 */ 12525 */
12526 TypeArgumentList get typeArguments => _typeArguments; 12526 TypeArgumentList get typeArguments => _typeArguments;
12527 12527
12528 /** 12528 /**
12529 * Set the modifiers associated with this literal to the given modifiers. 12529 * Set the modifiers associated with this literal to the given modifiers.
12530 * @param modifiers the modifiers associated with this literal 12530 * @param modifiers the modifiers associated with this literal
12531 */ 12531 */
12532 void set modifier(Token modifier2) { 12532 void set modifier(Token modifier2) {
12533 this._modifier = modifier2; 12533 this._modifier = modifier2;
12534 } 12534 }
12535 12535
12536 /** 12536 /**
12537 * Set the type argument associated with this literal to the given arguments. 12537 * Set the type argument associated with this literal to the given arguments.
12538 * @param typeArguments the type argument associated with this literal 12538 * @param typeArguments the type argument associated with this literal
12539 */ 12539 */
12540 void set typeArguments(TypeArgumentList typeArguments2) { 12540 void set typeArguments(TypeArgumentList typeArguments2) {
12541 this._typeArguments = typeArguments2; 12541 this._typeArguments = typeArguments2;
12542 } 12542 }
12543 void visitChildren(ASTVisitor<Object> visitor) { 12543 void visitChildren(ASTVisitor<Object> visitor) {
12544 safelyVisitChild(_typeArguments, visitor); 12544 safelyVisitChild(_typeArguments, visitor);
12545 } 12545 }
12546 } 12546 }
12547 /** 12547 /**
12548 * The abstract class {@code UriBasedDirective} defines the behavior common to n odes that represent 12548 * The abstract class `UriBasedDirective` defines the behavior common to nodes t hat represent
12549 * a directive that references a URI. 12549 * a directive that references a URI.
12550 * <pre> 12550 * <pre>
12551 * uriBasedDirective ::={@link ExportDirective exportDirective}| {@link ImportDi rective importDirective}| {@link PartDirective partDirective}</pre> 12551 * uriBasedDirective ::=[ExportDirective exportDirective]| [ImportDirective impo rtDirective]| [PartDirective partDirective]</pre>
12552 * @coverage dart.engine.ast 12552 * @coverage dart.engine.ast
12553 */ 12553 */
12554 abstract class UriBasedDirective extends Directive { 12554 abstract class UriBasedDirective extends Directive {
12555 12555
12556 /** 12556 /**
12557 * The URI referenced by this directive. 12557 * The URI referenced by this directive.
12558 */ 12558 */
12559 StringLiteral _uri; 12559 StringLiteral _uri;
12560 12560
12561 /** 12561 /**
(...skipping 14 matching lines...) Expand all
12576 */ 12576 */
12577 UriBasedDirective({Comment comment, List<Annotation> metadata, StringLiteral u ri}) : this.full(comment, metadata, uri); 12577 UriBasedDirective({Comment comment, List<Annotation> metadata, StringLiteral u ri}) : this.full(comment, metadata, uri);
12578 12578
12579 /** 12579 /**
12580 * Return the URI referenced by this directive. 12580 * Return the URI referenced by this directive.
12581 * @return the URI referenced by this directive 12581 * @return the URI referenced by this directive
12582 */ 12582 */
12583 StringLiteral get uri => _uri; 12583 StringLiteral get uri => _uri;
12584 12584
12585 /** 12585 /**
12586 * Return the element associated with the URI of this directive, or {@code nul l} if the AST 12586 * Return the element associated with the URI of this directive, or `null` if the AST
12587 * structure has not been resolved or if this URI could not be resolved. Examp les of the latter 12587 * structure has not been resolved or if this URI could not be resolved. Examp les of the latter
12588 * case include a directive that contains an invalid URL or a URL that does no t exist. 12588 * case include a directive that contains an invalid URL or a URL that does no t exist.
12589 * @return the element associated with this directive 12589 * @return the element associated with this directive
12590 */ 12590 */
12591 Element get uriElement; 12591 Element get uriElement;
12592 12592
12593 /** 12593 /**
12594 * Set the URI referenced by this directive to the given URI. 12594 * Set the URI referenced by this directive to the given URI.
12595 * @param uri the URI referenced by this directive 12595 * @param uri the URI referenced by this directive
12596 */ 12596 */
12597 void set uri(StringLiteral uri2) { 12597 void set uri(StringLiteral uri2) {
12598 this._uri = becomeParentOf(uri2); 12598 this._uri = becomeParentOf(uri2);
12599 } 12599 }
12600 void visitChildren(ASTVisitor<Object> visitor) { 12600 void visitChildren(ASTVisitor<Object> visitor) {
12601 super.visitChildren(visitor); 12601 super.visitChildren(visitor);
12602 safelyVisitChild(_uri, visitor); 12602 safelyVisitChild(_uri, visitor);
12603 } 12603 }
12604 } 12604 }
12605 /** 12605 /**
12606 * Instances of the class {@code VariableDeclaration} represent an identifier th at has an initial 12606 * Instances of the class `VariableDeclaration` represent an identifier that has an initial
12607 * value associated with it. Instances of this class are always children of the class{@link VariableDeclarationList}. 12607 * value associated with it. Instances of this class are always children of the class[VariableDeclarationList].
12608 * <pre> 12608 * <pre>
12609 * variableDeclaration ::={@link SimpleIdentifier identifier} ('=' {@link Expres sion initialValue})? 12609 * variableDeclaration ::=[SimpleIdentifier identifier] ('=' [Expression initial Value])?
12610 * </pre> 12610 * </pre>
12611 * @coverage dart.engine.ast 12611 * @coverage dart.engine.ast
12612 */ 12612 */
12613 class VariableDeclaration extends Declaration { 12613 class VariableDeclaration extends Declaration {
12614 12614
12615 /** 12615 /**
12616 * The name of the variable being declared. 12616 * The name of the variable being declared.
12617 */ 12617 */
12618 SimpleIdentifier _name; 12618 SimpleIdentifier _name;
12619 12619
12620 /** 12620 /**
12621 * The equal sign separating the variable name from the initial value, or {@co de null} if the 12621 * The equal sign separating the variable name from the initial value, or `nul l` if the
12622 * initial value was not specified. 12622 * initial value was not specified.
12623 */ 12623 */
12624 Token _equals; 12624 Token _equals;
12625 12625
12626 /** 12626 /**
12627 * The expression used to compute the initial value for the variable, or {@cod e null} if the 12627 * The expression used to compute the initial value for the variable, or `null ` if the
12628 * initial value was not specified. 12628 * initial value was not specified.
12629 */ 12629 */
12630 Expression _initializer; 12630 Expression _initializer;
12631 12631
12632 /** 12632 /**
12633 * Initialize a newly created variable declaration. 12633 * Initialize a newly created variable declaration.
12634 * @param comment the documentation comment associated with this declaration 12634 * @param comment the documentation comment associated with this declaration
12635 * @param metadata the annotations associated with this member 12635 * @param metadata the annotations associated with this member
12636 * @param name the name of the variable being declared 12636 * @param name the name of the variable being declared
12637 * @param equals the equal sign separating the variable name from the initial value 12637 * @param equals the equal sign separating the variable name from the initial value
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
12672 } 12672 }
12673 VariableElement get element => _name != null ? (_name.element as VariableEleme nt) : null; 12673 VariableElement get element => _name != null ? (_name.element as VariableEleme nt) : null;
12674 Token get endToken { 12674 Token get endToken {
12675 if (_initializer != null) { 12675 if (_initializer != null) {
12676 return _initializer.endToken; 12676 return _initializer.endToken;
12677 } 12677 }
12678 return _name.endToken; 12678 return _name.endToken;
12679 } 12679 }
12680 12680
12681 /** 12681 /**
12682 * Return the equal sign separating the variable name from the initial value, or {@code null} if 12682 * Return the equal sign separating the variable name from the initial value, or `null` if
12683 * the initial value was not specified. 12683 * the initial value was not specified.
12684 * @return the equal sign separating the variable name from the initial value 12684 * @return the equal sign separating the variable name from the initial value
12685 */ 12685 */
12686 Token get equals => _equals; 12686 Token get equals => _equals;
12687 12687
12688 /** 12688 /**
12689 * Return the expression used to compute the initial value for the variable, o r {@code null} if 12689 * Return the expression used to compute the initial value for the variable, o r `null` if
12690 * the initial value was not specified. 12690 * the initial value was not specified.
12691 * @return the expression used to compute the initial value for the variable 12691 * @return the expression used to compute the initial value for the variable
12692 */ 12692 */
12693 Expression get initializer => _initializer; 12693 Expression get initializer => _initializer;
12694 12694
12695 /** 12695 /**
12696 * Return the name of the variable being declared. 12696 * Return the name of the variable being declared.
12697 * @return the name of the variable being declared 12697 * @return the name of the variable being declared
12698 */ 12698 */
12699 SimpleIdentifier get name => _name; 12699 SimpleIdentifier get name => _name;
12700 12700
12701 /** 12701 /**
12702 * Return {@code true} if this variable was declared with the 'const' modifier . 12702 * Return `true` if this variable was declared with the 'const' modifier.
12703 * @return {@code true} if this variable was declared with the 'const' modifie r 12703 * @return `true` if this variable was declared with the 'const' modifier
12704 */ 12704 */
12705 bool isConst() { 12705 bool isConst() {
12706 ASTNode parent = this.parent; 12706 ASTNode parent = this.parent;
12707 return parent is VariableDeclarationList && ((parent as VariableDeclarationL ist)).isConst(); 12707 return parent is VariableDeclarationList && ((parent as VariableDeclarationL ist)).isConst();
12708 } 12708 }
12709 12709
12710 /** 12710 /**
12711 * Return {@code true} if this variable was declared with the 'final' modifier . Variables that are 12711 * Return `true` if this variable was declared with the 'final' modifier. Vari ables that are
12712 * declared with the 'const' modifier will return {@code false} even though th ey are implicitly 12712 * declared with the 'const' modifier will return `false` even though they are implicitly
12713 * final. 12713 * final.
12714 * @return {@code true} if this variable was declared with the 'final' modifie r 12714 * @return `true` if this variable was declared with the 'final' modifier
12715 */ 12715 */
12716 bool isFinal() { 12716 bool isFinal() {
12717 ASTNode parent = this.parent; 12717 ASTNode parent = this.parent;
12718 return parent is VariableDeclarationList && ((parent as VariableDeclarationL ist)).isFinal(); 12718 return parent is VariableDeclarationList && ((parent as VariableDeclarationL ist)).isFinal();
12719 } 12719 }
12720 12720
12721 /** 12721 /**
12722 * Set the equal sign separating the variable name from the initial value to t he given token. 12722 * Set the equal sign separating the variable name from the initial value to t he given token.
12723 * @param equals the equal sign separating the variable name from the initial value 12723 * @param equals the equal sign separating the variable name from the initial value
12724 */ 12724 */
(...skipping 17 matching lines...) Expand all
12742 this._name = becomeParentOf(name2); 12742 this._name = becomeParentOf(name2);
12743 } 12743 }
12744 void visitChildren(ASTVisitor<Object> visitor) { 12744 void visitChildren(ASTVisitor<Object> visitor) {
12745 super.visitChildren(visitor); 12745 super.visitChildren(visitor);
12746 safelyVisitChild(_name, visitor); 12746 safelyVisitChild(_name, visitor);
12747 safelyVisitChild(_initializer, visitor); 12747 safelyVisitChild(_initializer, visitor);
12748 } 12748 }
12749 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; 12749 Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
12750 } 12750 }
12751 /** 12751 /**
12752 * Instances of the class {@code VariableDeclarationList} represent the declarat ion of one or more 12752 * Instances of the class `VariableDeclarationList` represent the declaration of one or more
12753 * variables of the same type. 12753 * variables of the same type.
12754 * <pre> 12754 * <pre>
12755 * variableDeclarationList ::= 12755 * variableDeclarationList ::=
12756 * finalConstVarOrType {@link VariableDeclaration variableDeclaration} (',' {@li nk VariableDeclaration variableDeclaration}) 12756 * finalConstVarOrType [VariableDeclaration variableDeclaration] (',' [VariableD eclaration variableDeclaration])
12757 * finalConstVarOrType ::= 12757 * finalConstVarOrType ::=
12758 * | 'final' {@link TypeName type}? 12758 * | 'final' [TypeName type]?
12759 * | 'const' {@link TypeName type}? 12759 * | 'const' [TypeName type]?
12760 * | 'var' 12760 * | 'var'
12761 * | {@link TypeName type}</pre> 12761 * | [TypeName type]</pre>
12762 * @coverage dart.engine.ast 12762 * @coverage dart.engine.ast
12763 */ 12763 */
12764 class VariableDeclarationList extends AnnotatedNode { 12764 class VariableDeclarationList extends AnnotatedNode {
12765 12765
12766 /** 12766 /**
12767 * The token representing the 'final', 'const' or 'var' keyword, or {@code nul l} if no keyword was 12767 * The token representing the 'final', 'const' or 'var' keyword, or `null` if no keyword was
12768 * included. 12768 * included.
12769 */ 12769 */
12770 Token _keyword; 12770 Token _keyword;
12771 12771
12772 /** 12772 /**
12773 * The type of the variables being declared, or {@code null} if no type was pr ovided. 12773 * The type of the variables being declared, or `null` if no type was provided .
12774 */ 12774 */
12775 TypeName _type; 12775 TypeName _type;
12776 12776
12777 /** 12777 /**
12778 * A list containing the individual variables being declared. 12778 * A list containing the individual variables being declared.
12779 */ 12779 */
12780 NodeList<VariableDeclaration> _variables; 12780 NodeList<VariableDeclaration> _variables;
12781 12781
12782 /** 12782 /**
12783 * Initialize a newly created variable declaration list. 12783 * Initialize a newly created variable declaration list.
(...skipping 16 matching lines...) Expand all
12800 * @param metadata the annotations associated with this declaration list 12800 * @param metadata the annotations associated with this declaration list
12801 * @param keyword the token representing the 'final', 'const' or 'var' keyword 12801 * @param keyword the token representing the 'final', 'const' or 'var' keyword
12802 * @param type the type of the variables being declared 12802 * @param type the type of the variables being declared
12803 * @param variables a list containing the individual variables being declared 12803 * @param variables a list containing the individual variables being declared
12804 */ 12804 */
12805 VariableDeclarationList({Comment comment, List<Annotation> metadata, Token key word, TypeName type, List<VariableDeclaration> variables}) : this.full(comment, metadata, keyword, type, variables); 12805 VariableDeclarationList({Comment comment, List<Annotation> metadata, Token key word, TypeName type, List<VariableDeclaration> variables}) : this.full(comment, metadata, keyword, type, variables);
12806 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this); 12806 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this);
12807 Token get endToken => _variables.endToken; 12807 Token get endToken => _variables.endToken;
12808 12808
12809 /** 12809 /**
12810 * Return the token representing the 'final', 'const' or 'var' keyword, or {@c ode null} if no 12810 * Return the token representing the 'final', 'const' or 'var' keyword, or `nu ll` if no
12811 * keyword was included. 12811 * keyword was included.
12812 * @return the token representing the 'final', 'const' or 'var' keyword 12812 * @return the token representing the 'final', 'const' or 'var' keyword
12813 */ 12813 */
12814 Token get keyword => _keyword; 12814 Token get keyword => _keyword;
12815 12815
12816 /** 12816 /**
12817 * Return the type of the variables being declared, or {@code null} if no type was provided. 12817 * Return the type of the variables being declared, or `null` if no type was p rovided.
12818 * @return the type of the variables being declared 12818 * @return the type of the variables being declared
12819 */ 12819 */
12820 TypeName get type => _type; 12820 TypeName get type => _type;
12821 12821
12822 /** 12822 /**
12823 * Return a list containing the individual variables being declared. 12823 * Return a list containing the individual variables being declared.
12824 * @return a list containing the individual variables being declared 12824 * @return a list containing the individual variables being declared
12825 */ 12825 */
12826 NodeList<VariableDeclaration> get variables => _variables; 12826 NodeList<VariableDeclaration> get variables => _variables;
12827 12827
12828 /** 12828 /**
12829 * Return {@code true} if the variables in this list were declared with the 'c onst' modifier. 12829 * Return `true` if the variables in this list were declared with the 'const' modifier.
12830 * @return {@code true} if the variables in this list were declared with the ' const' modifier 12830 * @return `true` if the variables in this list were declared with the 'const' modifier
12831 */ 12831 */
12832 bool isConst() => _keyword is KeywordToken && identical(((_keyword as KeywordT oken)).keyword, Keyword.CONST); 12832 bool isConst() => _keyword is KeywordToken && identical(((_keyword as KeywordT oken)).keyword, Keyword.CONST);
12833 12833
12834 /** 12834 /**
12835 * Return {@code true} if the variables in this list were declared with the 'f inal' modifier. 12835 * Return `true` if the variables in this list were declared with the 'final' modifier.
12836 * Variables that are declared with the 'const' modifier will return {@code fa lse} even though 12836 * Variables that are declared with the 'const' modifier will return `false` e ven though
12837 * they are implicitly final. 12837 * they are implicitly final.
12838 * @return {@code true} if the variables in this list were declared with the ' final' modifier 12838 * @return `true` if the variables in this list were declared with the 'final' modifier
12839 */ 12839 */
12840 bool isFinal() => _keyword is KeywordToken && identical(((_keyword as KeywordT oken)).keyword, Keyword.FINAL); 12840 bool isFinal() => _keyword is KeywordToken && identical(((_keyword as KeywordT oken)).keyword, Keyword.FINAL);
12841 12841
12842 /** 12842 /**
12843 * Set the token representing the 'final', 'const' or 'var' keyword to the giv en token. 12843 * Set the token representing the 'final', 'const' or 'var' keyword to the giv en token.
12844 * @param keyword the token representing the 'final', 'const' or 'var' keyword 12844 * @param keyword the token representing the 'final', 'const' or 'var' keyword
12845 */ 12845 */
12846 void set keyword(Token keyword2) { 12846 void set keyword(Token keyword2) {
12847 this._keyword = keyword2; 12847 this._keyword = keyword2;
12848 } 12848 }
(...skipping 12 matching lines...) Expand all
12861 Token get firstTokenAfterCommentAndMetadata { 12861 Token get firstTokenAfterCommentAndMetadata {
12862 if (_keyword != null) { 12862 if (_keyword != null) {
12863 return _keyword; 12863 return _keyword;
12864 } else if (_type != null) { 12864 } else if (_type != null) {
12865 return _type.beginToken; 12865 return _type.beginToken;
12866 } 12866 }
12867 return _variables.beginToken; 12867 return _variables.beginToken;
12868 } 12868 }
12869 } 12869 }
12870 /** 12870 /**
12871 * Instances of the class {@code VariableDeclarationStatement} represent a list of variables that 12871 * Instances of the class `VariableDeclarationStatement` represent a list of var iables that
12872 * are being declared in a context where a statement is required. 12872 * are being declared in a context where a statement is required.
12873 * <pre> 12873 * <pre>
12874 * variableDeclarationStatement ::={@link VariableDeclarationList variableList} ';' 12874 * variableDeclarationStatement ::=[VariableDeclarationList variableList] ';'
12875 * </pre> 12875 * </pre>
12876 * @coverage dart.engine.ast 12876 * @coverage dart.engine.ast
12877 */ 12877 */
12878 class VariableDeclarationStatement extends Statement { 12878 class VariableDeclarationStatement extends Statement {
12879 12879
12880 /** 12880 /**
12881 * The variables being declared. 12881 * The variables being declared.
12882 */ 12882 */
12883 VariableDeclarationList _variableList; 12883 VariableDeclarationList _variableList;
12884 12884
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
12932 * @param variableList the variables being declared 12932 * @param variableList the variables being declared
12933 */ 12933 */
12934 void set variables(VariableDeclarationList variableList2) { 12934 void set variables(VariableDeclarationList variableList2) {
12935 this._variableList = becomeParentOf(variableList2); 12935 this._variableList = becomeParentOf(variableList2);
12936 } 12936 }
12937 void visitChildren(ASTVisitor<Object> visitor) { 12937 void visitChildren(ASTVisitor<Object> visitor) {
12938 safelyVisitChild(_variableList, visitor); 12938 safelyVisitChild(_variableList, visitor);
12939 } 12939 }
12940 } 12940 }
12941 /** 12941 /**
12942 * Instances of the class {@code WhileStatement} represent a while statement. 12942 * Instances of the class `WhileStatement` represent a while statement.
12943 * <pre> 12943 * <pre>
12944 * whileStatement ::= 12944 * whileStatement ::=
12945 * 'while' '(' {@link Expression condition} ')' {@link Statement body}</pre> 12945 * 'while' '(' [Expression condition] ')' [Statement body]</pre>
12946 * @coverage dart.engine.ast 12946 * @coverage dart.engine.ast
12947 */ 12947 */
12948 class WhileStatement extends Statement { 12948 class WhileStatement extends Statement {
12949 12949
12950 /** 12950 /**
12951 * The token representing the 'while' keyword. 12951 * The token representing the 'while' keyword.
12952 */ 12952 */
12953 Token _keyword; 12953 Token _keyword;
12954 12954
12955 /** 12955 /**
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
13070 */ 13070 */
13071 void set rightParenthesis(Token rightParenthesis2) { 13071 void set rightParenthesis(Token rightParenthesis2) {
13072 this._rightParenthesis = rightParenthesis2; 13072 this._rightParenthesis = rightParenthesis2;
13073 } 13073 }
13074 void visitChildren(ASTVisitor<Object> visitor) { 13074 void visitChildren(ASTVisitor<Object> visitor) {
13075 safelyVisitChild(_condition, visitor); 13075 safelyVisitChild(_condition, visitor);
13076 safelyVisitChild(_body, visitor); 13076 safelyVisitChild(_body, visitor);
13077 } 13077 }
13078 } 13078 }
13079 /** 13079 /**
13080 * Instances of the class {@code WithClause} represent the with clause in a clas s declaration. 13080 * Instances of the class `WithClause` represent the with clause in a class decl aration.
13081 * <pre> 13081 * <pre>
13082 * withClause ::= 13082 * withClause ::=
13083 * 'with' {@link TypeName mixin} (',' {@link TypeName mixin}) 13083 * 'with' [TypeName mixin] (',' [TypeName mixin])
13084 * </pre> 13084 * </pre>
13085 * @coverage dart.engine.ast 13085 * @coverage dart.engine.ast
13086 */ 13086 */
13087 class WithClause extends ASTNode { 13087 class WithClause extends ASTNode {
13088 13088
13089 /** 13089 /**
13090 * The token representing the 'with' keyword. 13090 * The token representing the 'with' keyword.
13091 */ 13091 */
13092 Token _withKeyword; 13092 Token _withKeyword;
13093 13093
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
13134 * @param withKeyword the token representing the 'with' keyword 13134 * @param withKeyword the token representing the 'with' keyword
13135 */ 13135 */
13136 void set mixinKeyword(Token withKeyword2) { 13136 void set mixinKeyword(Token withKeyword2) {
13137 this._withKeyword = withKeyword2; 13137 this._withKeyword = withKeyword2;
13138 } 13138 }
13139 void visitChildren(ASTVisitor<Object> visitor) { 13139 void visitChildren(ASTVisitor<Object> visitor) {
13140 _mixinTypes.accept(visitor); 13140 _mixinTypes.accept(visitor);
13141 } 13141 }
13142 } 13142 }
13143 /** 13143 /**
13144 * Instances of the class {@code BreadthFirstVisitor} implement an AST visitor t hat will recursively 13144 * Instances of the class `BreadthFirstVisitor` implement an AST visitor that wi ll recursively
13145 * visit all of the nodes in an AST structure, similar to {@link GeneralizingAST Visitor}. This 13145 * visit all of the nodes in an AST structure, similar to [GeneralizingASTVisito r]. This
13146 * visitor uses a breadth-first ordering rather than the depth-first ordering of {@link GeneralizingASTVisitor}. 13146 * visitor uses a breadth-first ordering rather than the depth-first ordering of [GeneralizingASTVisitor].
13147 * @coverage dart.engine.ast 13147 * @coverage dart.engine.ast
13148 */ 13148 */
13149 class BreadthFirstVisitor<R> extends GeneralizingASTVisitor<R> { 13149 class BreadthFirstVisitor<R> extends GeneralizingASTVisitor<R> {
13150 Queue<ASTNode> _queue = new Queue<ASTNode>(); 13150 Queue<ASTNode> _queue = new Queue<ASTNode>();
13151 GeneralizingASTVisitor<Object> _childVisitor; 13151 GeneralizingASTVisitor<Object> _childVisitor;
13152 13152
13153 /** 13153 /**
13154 * Visit all nodes in the tree starting at the given {@code root} node, in dep th-first order. 13154 * Visit all nodes in the tree starting at the given `root` node, in depth-fir st order.
13155 * @param root the root of the ASTNode tree 13155 * @param root the root of the ASTNode tree
13156 */ 13156 */
13157 void visitAllNodes(ASTNode root) { 13157 void visitAllNodes(ASTNode root) {
13158 _queue.add(root); 13158 _queue.add(root);
13159 while (!_queue.isEmpty) { 13159 while (!_queue.isEmpty) {
13160 ASTNode next = _queue.removeFirst(); 13160 ASTNode next = _queue.removeFirst();
13161 next.accept(this); 13161 next.accept(this);
13162 } 13162 }
13163 } 13163 }
13164 R visitNode(ASTNode node) { 13164 R visitNode(ASTNode node) {
13165 node.visitChildren(_childVisitor); 13165 node.visitChildren(_childVisitor);
13166 return null; 13166 return null;
13167 } 13167 }
13168 BreadthFirstVisitor() { 13168 BreadthFirstVisitor() {
13169 this._childVisitor = new GeneralizingASTVisitor_1(this); 13169 this._childVisitor = new GeneralizingASTVisitor_1(this);
13170 } 13170 }
13171 } 13171 }
13172 class GeneralizingASTVisitor_1 extends GeneralizingASTVisitor<Object> { 13172 class GeneralizingASTVisitor_1 extends GeneralizingASTVisitor<Object> {
13173 final BreadthFirstVisitor BreadthFirstVisitor_this; 13173 final BreadthFirstVisitor BreadthFirstVisitor_this;
13174 GeneralizingASTVisitor_1(this.BreadthFirstVisitor_this) : super(); 13174 GeneralizingASTVisitor_1(this.BreadthFirstVisitor_this) : super();
13175 Object visitNode(ASTNode node) { 13175 Object visitNode(ASTNode node) {
13176 BreadthFirstVisitor_this._queue.add(node); 13176 BreadthFirstVisitor_this._queue.add(node);
13177 return null; 13177 return null;
13178 } 13178 }
13179 } 13179 }
13180 /** 13180 /**
13181 * Instances of the class {@code ConstantEvaluator} evaluate constant expression s to produce their 13181 * Instances of the class `ConstantEvaluator` evaluate constant expressions to p roduce their
13182 * compile-time value. According to the Dart Language Specification: <blockquote > A constant 13182 * compile-time value. According to the Dart Language Specification: <blockquote > A constant
13183 * expression is one of the following: 13183 * expression is one of the following:
13184 * <ul> 13184 *
13185 * <li>A literal number.</li> 13185 * * A literal number.
13186 * <li>A literal boolean.</li> 13186 * * A literal boolean.
13187 * <li>A literal string where any interpolated expression is a compile-time cons tant that evaluates 13187 * * A literal string where any interpolated expression is a compile-time consta nt that evaluates
13188 * to a numeric, string or boolean value or to {@code null}.</li> 13188 * to a numeric, string or boolean value or to `null`.
13189 * <li>{@code null}.</li> 13189 * * `null`.
13190 * <li>A reference to a static constant variable.</li> 13190 * * A reference to a static constant variable.
13191 * <li>An identifier expression that denotes a constant variable, a class or a t ype variable.</li> 13191 * * An identifier expression that denotes a constant variable, a class or a typ e variable.
13192 * <li>A constant constructor invocation.</li> 13192 * * A constant constructor invocation.
13193 * <li>A constant list literal.</li> 13193 * * A constant list literal.
13194 * <li>A constant map literal.</li> 13194 * * A constant map literal.
13195 * <li>A simple or qualified identifier denoting a top-level function or a stati c method.</li> 13195 * * A simple or qualified identifier denoting a top-level function or a static method.
13196 * <li>A parenthesized expression {@code (e)} where {@code e} is a constant expr ession.</li> 13196 * * A parenthesized expression `(e)` where `e` is a constant expression.
13197 * <li>An expression of one of the forms {@code identical(e1, e2)}, {@code e1 == e2},{@code e1 != e2} where {@code e1} and {@code e2} are constant expressions t hat evaluate to a 13197 * * An expression of one of the forms `identical(e1, e2)`, `e1 == e2`,`e1 != e2 ` where `e1` and `e2` are constant expressions that evaluate to a
13198 * numeric, string or boolean value or to {@code null}.</li> 13198 * numeric, string or boolean value or to `null`.
13199 * <li>An expression of one of the forms {@code !e}, {@code e1 && e2} or {@code e1 || e2}, where{@code e}, {@code e1} and {@code e2} are constant expressions th at evaluate to a boolean value or 13199 * * An expression of one of the forms `!e`, `e1 && e2` or `e1 || e2`, where`e`, `e1` and `e2` are constant expressions that evaluate to a boolean value or
13200 * to {@code null}.</li> 13200 * to `null`.
13201 * <li>An expression of one of the forms {@code ~e}, {@code e1 ^ e2}, {@code e1 & e2},{@code e1 | e2}, {@code e1 >> e2} or {@code e1 << e2}, where {@code e}, {@ code e1} and {@code e2}are constant expressions that evaluate to an integer valu e or to {@code null}.</li> 13201 * * An expression of one of the forms `~e`, `e1 ^ e2`, `e1 & e2`,`e1 | e2`, `e1 >> e2` or `e1 << e2`, where `e`, `e1` and `e2`are constant expressions that eva luate to an integer value or to `null`.
13202 * <li>An expression of one of the forms {@code -e}, {@code e1 + e2}, {@code e1 - e2},{@code e1 * e2}, {@code e1 / e2}, {@code e1 ~/ e2}, {@code e1 > e2}, {@cod e e1 < e2},{@code e1 >= e2}, {@code e1 <= e2} or {@code e1 % e2}, where {@code e }, {@code e1} and {@code e2}are constant expressions that evaluate to a numeric value or to {@code null}.</li> 13202 * * An expression of one of the forms `-e`, `e1 + e2`, `e1 - e2`,`e1 * e2`, `e1 / e2`, `e1 ~/ e2`, `e1 > e2`, `e1 < e2`,`e1 >= e2`, `e1 <= e2` or `e1 % e2`, wh ere `e`, `e1` and `e2`are constant expressions that evaluate to a numeric value or to `null`.
13203 * </ul> 13203 *
13204 * </blockquote> The values returned by instances of this class are therefore {@ code null} and 13204 * </blockquote> The values returned by instances of this class are therefore `n ull` and
13205 * instances of the classes {@code Boolean}, {@code BigInteger}, {@code Double}, {@code String}, and{@code DartObject}. 13205 * instances of the classes `Boolean`, `BigInteger`, `Double`, `String`, and`Dar tObject`.
13206 * <p> 13206 *
13207 * In addition, this class defines several values that can be returned to indica te various 13207 * In addition, this class defines several values that can be returned to indica te various
13208 * conditions encountered during evaluation. These are documented with the stati c field that define 13208 * conditions encountered during evaluation. These are documented with the stati c field that define
13209 * those values. 13209 * those values.
13210 * @coverage dart.engine.ast 13210 * @coverage dart.engine.ast
13211 */ 13211 */
13212 class ConstantEvaluator extends GeneralizingASTVisitor<Object> { 13212 class ConstantEvaluator extends GeneralizingASTVisitor<Object> {
13213 13213
13214 /** 13214 /**
13215 * The value returned for expressions (or non-expression nodes) that are not c ompile-time constant 13215 * The value returned for expressions (or non-expression nodes) that are not c ompile-time constant
13216 * expressions. 13216 * expressions.
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
13449 Object getConstantValue(Element element) { 13449 Object getConstantValue(Element element) {
13450 if (element is FieldElement) { 13450 if (element is FieldElement) {
13451 FieldElement field = element as FieldElement; 13451 FieldElement field = element as FieldElement;
13452 if (field.isStatic() && field.isConst()) { 13452 if (field.isStatic() && field.isConst()) {
13453 } 13453 }
13454 } 13454 }
13455 return NOT_A_CONSTANT; 13455 return NOT_A_CONSTANT;
13456 } 13456 }
13457 } 13457 }
13458 /** 13458 /**
13459 * Instances of the class {@code ElementLocator} locate the {@link Element Dart model element}associated with a given {@link ASTNode AST node}. 13459 * Instances of the class `ElementLocator` locate the [Element Dart model elemen t]associated with a given [ASTNode AST node].
13460 * @coverage dart.engine.ast 13460 * @coverage dart.engine.ast
13461 */ 13461 */
13462 class ElementLocator { 13462 class ElementLocator {
13463 13463
13464 /** 13464 /**
13465 * Locate the {@link Element Dart model element} associated with the given {@l ink ASTNode AST 13465 * Locate the [Element Dart model element] associated with the given [ASTNode AST
13466 * node}. 13466 * node].
13467 * @param node the node (not {@code null}) 13467 * @param node the node (not `null`)
13468 * @return the associated element, or {@code null} if none is found 13468 * @return the associated element, or `null` if none is found
13469 */ 13469 */
13470 static Element locate(ASTNode node) { 13470 static Element locate(ASTNode node) {
13471 ElementLocator_ElementMapper mapper = new ElementLocator_ElementMapper(); 13471 ElementLocator_ElementMapper mapper = new ElementLocator_ElementMapper();
13472 return node.accept(mapper); 13472 return node.accept(mapper);
13473 } 13473 }
13474 } 13474 }
13475 /** 13475 /**
13476 * Visitor that maps nodes to elements. 13476 * Visitor that maps nodes to elements.
13477 */ 13477 */
13478 class ElementLocator_ElementMapper extends GeneralizingASTVisitor<Element> { 13478 class ElementLocator_ElementMapper extends GeneralizingASTVisitor<Element> {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
13520 Element visitStringLiteral(StringLiteral node) { 13520 Element visitStringLiteral(StringLiteral node) {
13521 ASTNode parent = node.parent; 13521 ASTNode parent = node.parent;
13522 if (parent is UriBasedDirective) { 13522 if (parent is UriBasedDirective) {
13523 return ((parent as UriBasedDirective)).uriElement; 13523 return ((parent as UriBasedDirective)).uriElement;
13524 } 13524 }
13525 return null; 13525 return null;
13526 } 13526 }
13527 Element visitVariableDeclaration(VariableDeclaration node) => node.element; 13527 Element visitVariableDeclaration(VariableDeclaration node) => node.element;
13528 } 13528 }
13529 /** 13529 /**
13530 * Instances of the class {@code GeneralizingASTVisitor} implement an AST visito r that will 13530 * Instances of the class `GeneralizingASTVisitor` implement an AST visitor that will
13531 * recursively visit all of the nodes in an AST structure (like instances of the class{@link RecursiveASTVisitor}). In addition, when a node of a specific type is visited not only 13531 * recursively visit all of the nodes in an AST structure (like instances of the class[RecursiveASTVisitor]). In addition, when a node of a specific type is vis ited not only
13532 * will the visit method for that specific type of node be invoked, but addition al methods for the 13532 * will the visit method for that specific type of node be invoked, but addition al methods for the
13533 * superclasses of that node will also be invoked. For example, using an instanc e of this class to 13533 * superclasses of that node will also be invoked. For example, using an instanc e of this class to
13534 * visit a {@link Block} will cause the method {@link #visitBlock(Block)} to be invoked but will 13534 * visit a [Block] will cause the method [visitBlock] to be invoked but will
13535 * also cause the methods {@link #visitStatement(Statement)} and {@link #visitNo de(ASTNode)} to be 13535 * also cause the methods [visitStatement] and [visitNode] to be
13536 * subsequently invoked. This allows visitors to be written that visit all state ments without 13536 * subsequently invoked. This allows visitors to be written that visit all state ments without
13537 * needing to override the visit method for each of the specific subclasses of { @link Statement}. 13537 * needing to override the visit method for each of the specific subclasses of [ Statement].
13538 * <p> 13538 *
13539 * Subclasses that override a visit method must either invoke the overridden vis it method or 13539 * Subclasses that override a visit method must either invoke the overridden vis it method or
13540 * explicitly invoke the more general visit method. Failure to do so will cause the visit methods 13540 * explicitly invoke the more general visit method. Failure to do so will cause the visit methods
13541 * for superclasses of the node to not be invoked and will cause the children of the visited node to 13541 * for superclasses of the node to not be invoked and will cause the children of the visited node to
13542 * not be visited. 13542 * not be visited.
13543 * @coverage dart.engine.ast 13543 * @coverage dart.engine.ast
13544 */ 13544 */
13545 class GeneralizingASTVisitor<R> implements ASTVisitor<R> { 13545 class GeneralizingASTVisitor<R> implements ASTVisitor<R> {
13546 R visitAdjacentStrings(AdjacentStrings node) => visitStringLiteral(node); 13546 R visitAdjacentStrings(AdjacentStrings node) => visitStringLiteral(node);
13547 R visitAnnotatedNode(AnnotatedNode node) => visitNode(node); 13547 R visitAnnotatedNode(AnnotatedNode node) => visitNode(node);
13548 R visitAnnotation(Annotation node) => visitNode(node); 13548 R visitAnnotation(Annotation node) => visitNode(node);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
13664 R visitTypeParameter(TypeParameter node) => visitNode(node); 13664 R visitTypeParameter(TypeParameter node) => visitNode(node);
13665 R visitTypeParameterList(TypeParameterList node) => visitNode(node); 13665 R visitTypeParameterList(TypeParameterList node) => visitNode(node);
13666 R visitUriBasedDirective(UriBasedDirective node) => visitDirective(node); 13666 R visitUriBasedDirective(UriBasedDirective node) => visitDirective(node);
13667 R visitVariableDeclaration(VariableDeclaration node) => visitDeclaration(node) ; 13667 R visitVariableDeclaration(VariableDeclaration node) => visitDeclaration(node) ;
13668 R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node ); 13668 R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node );
13669 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visi tStatement(node); 13669 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visi tStatement(node);
13670 R visitWhileStatement(WhileStatement node) => visitStatement(node); 13670 R visitWhileStatement(WhileStatement node) => visitStatement(node);
13671 R visitWithClause(WithClause node) => visitNode(node); 13671 R visitWithClause(WithClause node) => visitNode(node);
13672 } 13672 }
13673 /** 13673 /**
13674 * Instances of the class {@code NodeLocator} locate the {@link ASTNode AST node } associated with a 13674 * Instances of the class `NodeLocator` locate the [ASTNode AST node] associated with a
13675 * source range, given the AST structure built from the source. More specificall y, they will return 13675 * source range, given the AST structure built from the source. More specificall y, they will return
13676 * the {@link ASTNode AST node} with the shortest length whose source range comp letely encompasses 13676 * the [ASTNode AST node] with the shortest length whose source range completely encompasses
13677 * the specified range. 13677 * the specified range.
13678 * @coverage dart.engine.ast 13678 * @coverage dart.engine.ast
13679 */ 13679 */
13680 class NodeLocator extends GeneralizingASTVisitor<Object> { 13680 class NodeLocator extends GeneralizingASTVisitor<Object> {
13681 13681
13682 /** 13682 /**
13683 * The start offset of the range used to identify the node. 13683 * The start offset of the range used to identify the node.
13684 */ 13684 */
13685 int _startOffset = 0; 13685 int _startOffset = 0;
13686 13686
13687 /** 13687 /**
13688 * The end offset of the range used to identify the node. 13688 * The end offset of the range used to identify the node.
13689 */ 13689 */
13690 int _endOffset = 0; 13690 int _endOffset = 0;
13691 13691
13692 /** 13692 /**
13693 * The element that was found that corresponds to the given source range, or { @code null} if there 13693 * The element that was found that corresponds to the given source range, or ` null` if there
13694 * is no such element. 13694 * is no such element.
13695 */ 13695 */
13696 ASTNode _foundNode; 13696 ASTNode _foundNode;
13697 13697
13698 /** 13698 /**
13699 * Initialize a newly created locator to locate one or more {@link ASTNode AST nodes} by locating 13699 * Initialize a newly created locator to locate one or more [ASTNode AST nodes ] by locating
13700 * the node within an AST structure that corresponds to the given offset in th e source. 13700 * the node within an AST structure that corresponds to the given offset in th e source.
13701 * @param offset the offset used to identify the node 13701 * @param offset the offset used to identify the node
13702 */ 13702 */
13703 NodeLocator.con1(int offset) { 13703 NodeLocator.con1(int offset) {
13704 _jtd_constructor_120_impl(offset); 13704 _jtd_constructor_120_impl(offset);
13705 } 13705 }
13706 _jtd_constructor_120_impl(int offset) { 13706 _jtd_constructor_120_impl(int offset) {
13707 _jtd_constructor_121_impl(offset, offset); 13707 _jtd_constructor_121_impl(offset, offset);
13708 } 13708 }
13709 13709
13710 /** 13710 /**
13711 * Initialize a newly created locator to locate one or more {@link ASTNode AST nodes} by locating 13711 * Initialize a newly created locator to locate one or more [ASTNode AST nodes ] by locating
13712 * the node within an AST structure that corresponds to the given range of cha racters in the 13712 * the node within an AST structure that corresponds to the given range of cha racters in the
13713 * source. 13713 * source.
13714 * @param start the start offset of the range used to identify the node 13714 * @param start the start offset of the range used to identify the node
13715 * @param end the end offset of the range used to identify the node 13715 * @param end the end offset of the range used to identify the node
13716 */ 13716 */
13717 NodeLocator.con2(int start, int end) { 13717 NodeLocator.con2(int start, int end) {
13718 _jtd_constructor_121_impl(start, end); 13718 _jtd_constructor_121_impl(start, end);
13719 } 13719 }
13720 _jtd_constructor_121_impl(int start, int end) { 13720 _jtd_constructor_121_impl(int start, int end) {
13721 this._startOffset = start; 13721 this._startOffset = start;
13722 this._endOffset = end; 13722 this._endOffset = end;
13723 } 13723 }
13724 13724
13725 /** 13725 /**
13726 * Return the node that was found that corresponds to the given source range, or {@code null} if 13726 * Return the node that was found that corresponds to the given source range, or `null` if
13727 * there is no such node. 13727 * there is no such node.
13728 * @return the node that was found 13728 * @return the node that was found
13729 */ 13729 */
13730 ASTNode get foundNode => _foundNode; 13730 ASTNode get foundNode => _foundNode;
13731 13731
13732 /** 13732 /**
13733 * Search within the given AST node for an identifier representing a {@link Da rtElement Dart 13733 * Search within the given AST node for an identifier representing a [DartElem ent Dart
13734 * element} in the specified source range. Return the element that was found, or {@code null} if 13734 * element] in the specified source range. Return the element that was found, or `null` if
13735 * no element was found. 13735 * no element was found.
13736 * @param node the AST node within which to search 13736 * @param node the AST node within which to search
13737 * @return the element that was found 13737 * @return the element that was found
13738 */ 13738 */
13739 ASTNode searchWithin(ASTNode node) { 13739 ASTNode searchWithin(ASTNode node) {
13740 try { 13740 try {
13741 node.accept(this); 13741 node.accept(this);
13742 } on NodeLocator_NodeFoundException catch (exception) { 13742 } on NodeLocator_NodeFoundException catch (exception) {
13743 } catch (exception) { 13743 } catch (exception) {
13744 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a t offset (${_startOffset} - ${_endOffset})", exception); 13744 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a t offset (${_startOffset} - ${_endOffset})", exception);
(...skipping 18 matching lines...) Expand all
13763 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra versing an AST structure.", exception); 13763 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra versing an AST structure.", exception);
13764 } 13764 }
13765 if (start <= _startOffset && _endOffset <= end) { 13765 if (start <= _startOffset && _endOffset <= end) {
13766 _foundNode = node; 13766 _foundNode = node;
13767 throw new NodeLocator_NodeFoundException(); 13767 throw new NodeLocator_NodeFoundException();
13768 } 13768 }
13769 return null; 13769 return null;
13770 } 13770 }
13771 } 13771 }
13772 /** 13772 /**
13773 * Instances of the class {@code NodeFoundException} are used to cancel visiting after a node has 13773 * Instances of the class `NodeFoundException` are used to cancel visiting after a node has
13774 * been found. 13774 * been found.
13775 */ 13775 */
13776 class NodeLocator_NodeFoundException extends RuntimeException { 13776 class NodeLocator_NodeFoundException extends RuntimeException {
13777 static int _serialVersionUID = 1; 13777 static int _serialVersionUID = 1;
13778 } 13778 }
13779 /** 13779 /**
13780 * Instances of the class {@code RecursiveASTVisitor} implement an AST visitor t hat will recursively 13780 * Instances of the class `RecursiveASTVisitor` implement an AST visitor that wi ll recursively
13781 * visit all of the nodes in an AST structure. For example, using an instance of this class to visit 13781 * visit all of the nodes in an AST structure. For example, using an instance of this class to visit
13782 * a {@link Block} will also cause all of the statements in the block to be visi ted. 13782 * a [Block] will also cause all of the statements in the block to be visited.
13783 * <p> 13783 *
13784 * Subclasses that override a visit method must either invoke the overridden vis it method or must 13784 * Subclasses that override a visit method must either invoke the overridden vis it method or must
13785 * explicitly ask the visited node to visit its children. Failure to do so will cause the children 13785 * explicitly ask the visited node to visit its children. Failure to do so will cause the children
13786 * of the visited node to not be visited. 13786 * of the visited node to not be visited.
13787 * @coverage dart.engine.ast 13787 * @coverage dart.engine.ast
13788 */ 13788 */
13789 class RecursiveASTVisitor<R> implements ASTVisitor<R> { 13789 class RecursiveASTVisitor<R> implements ASTVisitor<R> {
13790 R visitAdjacentStrings(AdjacentStrings node) { 13790 R visitAdjacentStrings(AdjacentStrings node) {
13791 node.visitChildren(this); 13791 node.visitChildren(this);
13792 return null; 13792 return null;
13793 } 13793 }
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
14186 R visitWhileStatement(WhileStatement node) { 14186 R visitWhileStatement(WhileStatement node) {
14187 node.visitChildren(this); 14187 node.visitChildren(this);
14188 return null; 14188 return null;
14189 } 14189 }
14190 R visitWithClause(WithClause node) { 14190 R visitWithClause(WithClause node) {
14191 node.visitChildren(this); 14191 node.visitChildren(this);
14192 return null; 14192 return null;
14193 } 14193 }
14194 } 14194 }
14195 /** 14195 /**
14196 * Instances of the class {@code SimpleASTVisitor} implement an AST visitor that will do nothing 14196 * Instances of the class `SimpleASTVisitor` implement an AST visitor that will do nothing
14197 * when visiting an AST node. It is intended to be a superclass for classes that use the visitor 14197 * when visiting an AST node. It is intended to be a superclass for classes that use the visitor
14198 * pattern primarily as a dispatch mechanism (and hence don't need to recursivel y visit a whole 14198 * pattern primarily as a dispatch mechanism (and hence don't need to recursivel y visit a whole
14199 * structure) and that only need to visit a small number of node types. 14199 * structure) and that only need to visit a small number of node types.
14200 * @coverage dart.engine.ast 14200 * @coverage dart.engine.ast
14201 */ 14201 */
14202 class SimpleASTVisitor<R> implements ASTVisitor<R> { 14202 class SimpleASTVisitor<R> implements ASTVisitor<R> {
14203 R visitAdjacentStrings(AdjacentStrings node) => null; 14203 R visitAdjacentStrings(AdjacentStrings node) => null;
14204 R visitAnnotation(Annotation node) => null; 14204 R visitAnnotation(Annotation node) => null;
14205 R visitArgumentDefinitionTest(ArgumentDefinitionTest node) => null; 14205 R visitArgumentDefinitionTest(ArgumentDefinitionTest node) => null;
14206 R visitArgumentList(ArgumentList node) => null; 14206 R visitArgumentList(ArgumentList node) => null;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
14296 R visitTypeName(TypeName node) => null; 14296 R visitTypeName(TypeName node) => null;
14297 R visitTypeParameter(TypeParameter node) => null; 14297 R visitTypeParameter(TypeParameter node) => null;
14298 R visitTypeParameterList(TypeParameterList node) => null; 14298 R visitTypeParameterList(TypeParameterList node) => null;
14299 R visitVariableDeclaration(VariableDeclaration node) => null; 14299 R visitVariableDeclaration(VariableDeclaration node) => null;
14300 R visitVariableDeclarationList(VariableDeclarationList node) => null; 14300 R visitVariableDeclarationList(VariableDeclarationList node) => null;
14301 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => null ; 14301 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => null ;
14302 R visitWhileStatement(WhileStatement node) => null; 14302 R visitWhileStatement(WhileStatement node) => null;
14303 R visitWithClause(WithClause node) => null; 14303 R visitWithClause(WithClause node) => null;
14304 } 14304 }
14305 /** 14305 /**
14306 * Instances of the class {@code ToSourceVisitor} write a source representation of a visited AST 14306 * Instances of the class `ToSourceVisitor` write a source representation of a v isited AST
14307 * node (and all of it's children) to a writer. 14307 * node (and all of it's children) to a writer.
14308 * @coverage dart.engine.ast 14308 * @coverage dart.engine.ast
14309 */ 14309 */
14310 class ToSourceVisitor implements ASTVisitor<Object> { 14310 class ToSourceVisitor implements ASTVisitor<Object> {
14311 14311
14312 /** 14312 /**
14313 * The writer to which the source is to be written. 14313 * The writer to which the source is to be written.
14314 */ 14314 */
14315 PrintWriter _writer; 14315 PrintWriter _writer;
14316 14316
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
15010 * Safely visit the given node. 15010 * Safely visit the given node.
15011 * @param node the node to be visited 15011 * @param node the node to be visited
15012 */ 15012 */
15013 void visit(ASTNode node) { 15013 void visit(ASTNode node) {
15014 if (node != null) { 15014 if (node != null) {
15015 node.accept(this); 15015 node.accept(this);
15016 } 15016 }
15017 } 15017 }
15018 15018
15019 /** 15019 /**
15020 * Safely visit the given node, printing the suffix after the node if it is no n-{@code null}. 15020 * Safely visit the given node, printing the suffix after the node if it is no n-`null`.
15021 * @param suffix the suffix to be printed if there is a node to visit 15021 * @param suffix the suffix to be printed if there is a node to visit
15022 * @param node the node to be visited 15022 * @param node the node to be visited
15023 */ 15023 */
15024 void visit2(ASTNode node, String suffix) { 15024 void visit2(ASTNode node, String suffix) {
15025 if (node != null) { 15025 if (node != null) {
15026 node.accept(this); 15026 node.accept(this);
15027 _writer.print(suffix); 15027 _writer.print(suffix);
15028 } 15028 }
15029 } 15029 }
15030 15030
15031 /** 15031 /**
15032 * Safely visit the given node, printing the prefix before the node if it is n on-{@code null}. 15032 * Safely visit the given node, printing the prefix before the node if it is n on-`null`.
15033 * @param prefix the prefix to be printed if there is a node to visit 15033 * @param prefix the prefix to be printed if there is a node to visit
15034 * @param node the node to be visited 15034 * @param node the node to be visited
15035 */ 15035 */
15036 void visit3(String prefix, ASTNode node) { 15036 void visit3(String prefix, ASTNode node) {
15037 if (node != null) { 15037 if (node != null) {
15038 _writer.print(prefix); 15038 _writer.print(prefix);
15039 node.accept(this); 15039 node.accept(this);
15040 } 15040 }
15041 } 15041 }
15042 15042
15043 /** 15043 /**
15044 * Visit the given function body, printing the prefix before if given body is not empty. 15044 * Visit the given function body, printing the prefix before if given body is not empty.
15045 * @param prefix the prefix to be printed if there is a node to visit 15045 * @param prefix the prefix to be printed if there is a node to visit
15046 * @param body the function body to be visited 15046 * @param body the function body to be visited
15047 */ 15047 */
15048 void visit4(String prefix, FunctionBody body) { 15048 void visit4(String prefix, FunctionBody body) {
15049 if (body is! EmptyFunctionBody) { 15049 if (body is! EmptyFunctionBody) {
15050 _writer.print(prefix); 15050 _writer.print(prefix);
15051 } 15051 }
15052 visit(body); 15052 visit(body);
15053 } 15053 }
15054 15054
15055 /** 15055 /**
15056 * Safely visit the given node, printing the suffix after the node if it is no n-{@code null}. 15056 * Safely visit the given node, printing the suffix after the node if it is no n-`null`.
15057 * @param suffix the suffix to be printed if there is a node to visit 15057 * @param suffix the suffix to be printed if there is a node to visit
15058 * @param node the node to be visited 15058 * @param node the node to be visited
15059 */ 15059 */
15060 void visit5(Token token, String suffix) { 15060 void visit5(Token token, String suffix) {
15061 if (token != null) { 15061 if (token != null) {
15062 _writer.print(token.lexeme); 15062 _writer.print(token.lexeme);
15063 _writer.print(suffix); 15063 _writer.print(suffix);
15064 } 15064 }
15065 } 15065 }
15066 15066
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
15126 if (i > 0) { 15126 if (i > 0) {
15127 _writer.print(separator); 15127 _writer.print(separator);
15128 } 15128 }
15129 nodes[i].accept(this); 15129 nodes[i].accept(this);
15130 } 15130 }
15131 } 15131 }
15132 } 15132 }
15133 } 15133 }
15134 } 15134 }
15135 /** 15135 /**
15136 * Instances of the class {@code ASTCloner} implement an object that will clone any AST structure 15136 * Instances of the class `ASTCloner` implement an object that will clone any AS T structure
15137 * that it visits. The cloner will only clone the structure, it will not preserv e any resolution 15137 * that it visits. The cloner will only clone the structure, it will not preserv e any resolution
15138 * results or properties associated with the nodes. 15138 * results or properties associated with the nodes.
15139 */ 15139 */
15140 class ASTCloner implements ASTVisitor<ASTNode> { 15140 class ASTCloner implements ASTVisitor<ASTNode> {
15141 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs.full(clone3(node.strings)); 15141 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs.full(clone3(node.strings));
15142 Annotation visitAnnotation(Annotation node) => new Annotation.full(node.atSign , clone2(node.name), node.period, clone2(node.constructorName), clone2(node.argu ments)); 15142 Annotation visitAnnotation(Annotation node) => new Annotation.full(node.atSign , clone2(node.name), node.period, clone2(node.constructorName), clone2(node.argu ments));
15143 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) => new ArgumentDefinitionTest.full(node.question, clone2(node.identifier)); 15143 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) => new ArgumentDefinitionTest.full(node.question, clone2(node.identifier));
15144 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList.full(nod e.leftParenthesis, clone3(node.arguments), node.rightParenthesis); 15144 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList.full(nod e.leftParenthesis, clone3(node.arguments), node.rightParenthesis);
15145 AsExpression visitAsExpression(AsExpression node) => new AsExpression.full(clo ne2(node.expression), node.asOperator, clone2(node.type)); 15145 AsExpression visitAsExpression(AsExpression node) => new AsExpression.full(clo ne2(node.expression), node.asOperator, clone2(node.type));
15146 ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement.full (node.keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthes is, node.semicolon); 15146 ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement.full (node.keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthes is, node.semicolon);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
15270 for (ASTNode node in nodes) { 15270 for (ASTNode node in nodes) {
15271 clonedNodes.add((node.accept(this) as ASTNode)); 15271 clonedNodes.add((node.accept(this) as ASTNode));
15272 } 15272 }
15273 return clonedNodes; 15273 return clonedNodes;
15274 } 15274 }
15275 } 15275 }
15276 /** 15276 /**
15277 * Traverse the AST from initial child node to successive parents, building a co llection of local 15277 * Traverse the AST from initial child node to successive parents, building a co llection of local
15278 * variable and parameter names visible to the initial child node. In case of na me shadowing, the 15278 * variable and parameter names visible to the initial child node. In case of na me shadowing, the
15279 * first name seen is the most specific one so names are not redefined. 15279 * first name seen is the most specific one so names are not redefined.
15280 * <p> 15280 *
15281 * Completion test code coverage is 95%. The two basic blocks that are not execu ted cannot be 15281 * Completion test code coverage is 95%. The two basic blocks that are not execu ted cannot be
15282 * executed. They are included for future reference. 15282 * executed. They are included for future reference.
15283 * @coverage com.google.dart.engine.services.completion 15283 * @coverage com.google.dart.engine.services.completion
15284 */ 15284 */
15285 class ScopedNameFinder extends GeneralizingASTVisitor<Object> { 15285 class ScopedNameFinder extends GeneralizingASTVisitor<Object> {
15286 Declaration _declarationNode; 15286 Declaration _declarationNode;
15287 ASTNode _immediateChild; 15287 ASTNode _immediateChild;
15288 Map<String, SimpleIdentifier> _locals = new Map<String, SimpleIdentifier>(); 15288 Map<String, SimpleIdentifier> _locals = new Map<String, SimpleIdentifier>();
15289 int _position = 0; 15289 int _position = 0;
15290 bool _referenceIsWithinLocalFunction = false; 15290 bool _referenceIsWithinLocalFunction = false;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
15472 return elements[elements.length - 1].endToken; 15472 return elements[elements.length - 1].endToken;
15473 } 15473 }
15474 /** 15474 /**
15475 * Return the node that is the parent of each of the elements in the list. 15475 * Return the node that is the parent of each of the elements in the list.
15476 * @return the node that is the parent of each of the elements in the list 15476 * @return the node that is the parent of each of the elements in the list
15477 */ 15477 */
15478 ASTNode getOwner() { 15478 ASTNode getOwner() {
15479 return owner; 15479 return owner;
15480 } 15480 }
15481 } 15481 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/analyzer_impl.dart ('k') | pkg/analyzer_experimental/lib/src/generated/constant.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698