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

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

Issue 12253009: Fresh drop of analyzer-experimental. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 3
4 library engine.ast; 4 library engine.ast;
5 5
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'java_core.dart'; 7 import 'java_core.dart';
8 import 'java_engine.dart'; 8 import 'java_engine.dart';
9 import 'error.dart'; 9 import 'error.dart';
10 import 'scanner.dart'; 10 import 'scanner.dart';
11 import 'package:analyzer-experimental/src/generated/utilities_dart.dart'; 11 import 'engine.dart' show AnalysisEngine;
12 import 'utilities_dart.dart';
12 import 'element.dart' hide Annotation; 13 import 'element.dart' hide Annotation;
13 14
14 /** 15 /**
15 * The abstract class {@code ASTNode} defines the behavior common to all nodes i n the AST structure 16 * The abstract class {@code ASTNode} defines the behavior common to all nodes i n the AST structure
16 * for a Dart program. 17 * for a Dart program.
17 */ 18 */
18 abstract class ASTNode { 19 abstract class ASTNode {
19 /** 20 /**
20 * 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 {@code null} if the node is the root of an AST s tructure.
21 */ 22 */
22 ASTNode _parent; 23 ASTNode _parent;
23 /** 24 /**
24 * 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 25 * 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
25 * offset of the second node, zero (0) if the nodes have the same offset, and a positive value if 26 * offset of the second node, zero (0) if the nodes have the same offset, and a positive value if
26 * if the offset of the first node is greater than the offset of the second no de. 27 * if the offset of the first node is greater than the offset of the second no de.
27 */ 28 */
28 static Comparator<ASTNode> LEXICAL_ORDER = (ASTNode first, ASTNode second) => second.offset - first.offset; 29 static Comparator<ASTNode> LEXICAL_ORDER = (ASTNode first, ASTNode second) => second.offset - first.offset;
29 /** 30 /**
30 * Use the given visitor to visit this node. 31 * Use the given visitor to visit this node.
31 * @param visitor the visitor that will visit this node 32 * @param visitor the visitor that will visit this node
32 * @return the value returned by the visitor as a result of visiting this node 33 * @return the value returned by the visitor as a result of visiting this node
33 */ 34 */
34 accept(ASTVisitor visitor); 35 accept(ASTVisitor visitor);
35 /** 36 /**
37 * @return the {@link ASTNode} of given {@link Class} which is {@link ASTNode} itself, or one of
38 * its parents.
39 */
40 ASTNode getAncestor(Type enclosingClass) {
41 ASTNode node = this;
42 while (node != null && !isInstanceOf(node, enclosingClass)) {
43 node = node.parent;
44 }
45 ;
danrubel 2013/02/13 20:28:51 No idea where this extraneous semi-colon came from
46 return (node as ASTNode);
47 }
48 /**
36 * Return the first token included in this node's source range. 49 * Return the first token included in this node's source range.
37 * @return the first token included in this node's source range 50 * @return the first token included in this node's source range
38 */ 51 */
39 Token get beginToken; 52 Token get beginToken;
40 /** 53 /**
41 * Return the offset of the character immediately following the last character of this node's 54 * Return the offset of the character immediately following the last character of this node's
42 * source range. This is equivalent to {@code node.getOffset() + node.getLengt h()}. For a 55 * source range. This is equivalent to {@code node.getOffset() + node.getLengt h()}. For a
43 * compilation unit this will be equal to the length of the unit's source. For synthetic nodes 56 * compilation unit this will be equal to the length of the unit's source. For synthetic nodes
44 * this will be equivalent to the node's offset (because the length is zero (0 ) by definition). 57 * this will be equivalent to the node's offset (because the length is zero (0 ) by definition).
45 * @return the offset of the character just past the node's source range 58 * @return the offset of the character just past the node's source range
46 */ 59 */
47 int get end => offset + length; 60 int get end => offset + length;
48 /** 61 /**
49 * Return the last token included in this node's source range. 62 * Return the last token included in this node's source range.
50 * @return the last token included in this node's source range 63 * @return the last token included in this node's source range
51 */ 64 */
52 Token get endToken; 65 Token get endToken;
53 /** 66 /**
54 * Return the number of characters in the node's source range. 67 * Return the number of characters in the node's source range.
55 * @return the number of characters in the node's source range 68 * @return the number of characters in the node's source range
56 */ 69 */
57 int get length { 70 int get length {
58 Token beginToken2 = beginToken; 71 Token beginToken2 = beginToken;
59 Token endToken3 = endToken; 72 Token endToken2 = endToken;
60 if (beginToken2 == null || endToken3 == null) { 73 if (beginToken2 == null || endToken2 == null) {
61 return -1; 74 return -1;
62 } 75 }
63 return endToken3.offset + endToken3.length - beginToken2.offset; 76 return endToken2.offset + endToken2.length - beginToken2.offset;
64 } 77 }
65 /** 78 /**
66 * Return the offset from the beginning of the file to the first character in the node's source 79 * Return the offset from the beginning of the file to the first character in the node's source
67 * range. 80 * range.
68 * @return the offset from the beginning of the file to the first character in the node's source 81 * @return the offset from the beginning of the file to the first character in the node's source
69 * range 82 * range
70 */ 83 */
71 int get offset { 84 int get offset {
72 Token beginToken3 = beginToken; 85 Token beginToken3 = beginToken;
73 if (beginToken3 == null) { 86 if (beginToken3 == null) {
74 return -1; 87 return -1;
75 } 88 }
76 return beginToken.offset; 89 return beginToken.offset;
77 } 90 }
78 /** 91 /**
79 * Return this node's parent node, or {@code null} if this node is the root of an AST structure. 92 * Return this node's parent node, or {@code null} if this node is the root of an AST structure.
80 * <p> 93 * <p>
81 * Note that the relationship between an AST node and its parent node may chan ge over the lifetime 94 * Note that the relationship between an AST node and its parent node may chan ge over the lifetime
82 * of a node. 95 * of a node.
83 * @return the parent of this node, or {@code null} if none 96 * @return the parent of this node, or {@code null} if none
84 */ 97 */
85 ASTNode get parent => _parent; 98 ASTNode get parent => _parent;
86 /** 99 /**
87 * Return the node at the root of this node's AST structure. Note that this me thod's performance 100 * Return the node at the root of this node's AST structure. Note that this me thod's performance
88 * is linear with respect to the depth of the node in the AST structure (O(dep th)). 101 * is linear with respect to the depth of the node in the AST structure (O(dep th)).
89 * @return the node at the root of this node's AST structure 102 * @return the node at the root of this node's AST structure
90 */ 103 */
91 ASTNode get root { 104 ASTNode get root {
92 ASTNode root = this; 105 ASTNode root = this;
93 ASTNode parent3 = parent; 106 ASTNode parent2 = parent;
94 while (parent3 != null) { 107 while (parent2 != null) {
95 root = parent3; 108 root = parent2;
96 parent3 = root.parent; 109 parent2 = root.parent;
97 } 110 }
98 return root; 111 return root;
99 } 112 }
100 /** 113 /**
101 * Return {@code true} if this node is a synthetic node. A synthetic node is a node that was 114 * Return {@code true} if this node is a synthetic node. A synthetic node is a node that was
102 * introduced by the parser in order to recover from an error in the code. Syn thetic nodes always 115 * introduced by the parser in order to recover from an error in the code. Syn thetic nodes always
103 * have a length of zero ({@code 0}). 116 * have a length of zero ({@code 0}).
104 * @return {@code true} if this node is a synthetic node 117 * @return {@code true} if this node is a synthetic node
105 */ 118 */
106 bool isSynthetic() => false; 119 bool isSynthetic() => false;
(...skipping 15 matching lines...) Expand all
122 */ 135 */
123 void visitChildren(ASTVisitor<Object> visitor); 136 void visitChildren(ASTVisitor<Object> visitor);
124 /** 137 /**
125 * Make this node the parent of the given child node. 138 * Make this node the parent of the given child node.
126 * @param child the node that will become a child of this node 139 * @param child the node that will become a child of this node
127 * @return the node that was made a child of this node 140 * @return the node that was made a child of this node
128 */ 141 */
129 ASTNode becomeParentOf(ASTNode child) { 142 ASTNode becomeParentOf(ASTNode child) {
130 if (child != null) { 143 if (child != null) {
131 ASTNode node = child; 144 ASTNode node = child;
132 node.parent2 = this; 145 node.parent = this;
Jennifer Messerly 2013/02/13 21:36:54 yay!
133 } 146 }
134 return child; 147 return child;
135 } 148 }
136 /** 149 /**
137 * If the given child is not {@code null}, use the given visitor to visit it. 150 * If the given child is not {@code null}, use the given visitor to visit it.
138 * @param child the child to be visited 151 * @param child the child to be visited
139 * @param visitor the visitor that will be used to visit the child 152 * @param visitor the visitor that will be used to visit the child
140 */ 153 */
141 void safelyVisitChild(ASTNode child, ASTVisitor<Object> visitor) { 154 void safelyVisitChild(ASTNode child, ASTVisitor<Object> visitor) {
142 if (child != null) { 155 if (child != null) {
143 child.accept(visitor); 156 child.accept(visitor);
144 } 157 }
145 } 158 }
146 /** 159 /**
147 * Set the parent of this node to the given node. 160 * Set the parent of this node to the given node.
148 * @param newParent the node that is to be made the parent of this node 161 * @param newParent the node that is to be made the parent of this node
149 */ 162 */
150 void set parent2(ASTNode newParent) { 163 void set parent(ASTNode newParent) {
151 _parent = newParent; 164 _parent = newParent;
152 } 165 }
166 static int _hashCodeGenerator = 0;
167 final int hashCode = ++_hashCodeGenerator;
153 } 168 }
154 /** 169 /**
155 * The interface {@code ASTVisitor} defines the behavior of objects that can be used to visit an AST 170 * The interface {@code ASTVisitor} defines the behavior of objects that can be used to visit an AST
156 * structure. 171 * structure.
157 */ 172 */
158 abstract class ASTVisitor<R> { 173 abstract class ASTVisitor<R> {
159 R visitAdjacentStrings(AdjacentStrings node); 174 R visitAdjacentStrings(AdjacentStrings node);
160 R visitAnnotation(Annotation node); 175 R visitAnnotation(Annotation node);
161 R visitArgumentDefinitionTest(ArgumentDefinitionTest node); 176 R visitArgumentDefinitionTest(ArgumentDefinitionTest node);
162 R visitArgumentList(ArgumentList node); 177 R visitArgumentList(ArgumentList node);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 */ 282 */
268 class AdjacentStrings extends StringLiteral { 283 class AdjacentStrings extends StringLiteral {
269 /** 284 /**
270 * The strings that are implicitly concatenated. 285 * The strings that are implicitly concatenated.
271 */ 286 */
272 NodeList<StringLiteral> _strings; 287 NodeList<StringLiteral> _strings;
273 /** 288 /**
274 * Initialize a newly created list of adjacent strings. 289 * Initialize a newly created list of adjacent strings.
275 * @param strings the strings that are implicitly concatenated 290 * @param strings the strings that are implicitly concatenated
276 */ 291 */
277 AdjacentStrings(List<StringLiteral> strings) { 292 AdjacentStrings.full(List<StringLiteral> strings) {
278 this._strings = new NodeList<StringLiteral>(this); 293 this._strings = new NodeList<StringLiteral>(this);
279 this._strings.addAll(strings); 294 this._strings.addAll(strings);
280 } 295 }
296 /**
297 * Initialize a newly created list of adjacent strings.
298 * @param strings the strings that are implicitly concatenated
299 */
300 AdjacentStrings({List<StringLiteral> strings}) : this.full(strings);
281 accept(ASTVisitor visitor) => visitor.visitAdjacentStrings(this); 301 accept(ASTVisitor visitor) => visitor.visitAdjacentStrings(this);
282 Token get beginToken => _strings.beginToken; 302 Token get beginToken => _strings.beginToken;
283 Token get endToken => _strings.endToken; 303 Token get endToken => _strings.endToken;
284 /** 304 /**
285 * Return the strings that are implicitly concatenated. 305 * Return the strings that are implicitly concatenated.
286 * @return the strings that are implicitly concatenated 306 * @return the strings that are implicitly concatenated
287 */ 307 */
288 NodeList<StringLiteral> get strings => _strings; 308 NodeList<StringLiteral> get strings => _strings;
289 void visitChildren(ASTVisitor<Object> visitor) { 309 void visitChildren(ASTVisitor<Object> visitor) {
290 _strings.accept(visitor); 310 _strings.accept(visitor);
(...skipping 11 matching lines...) Expand all
302 Comment _comment; 322 Comment _comment;
303 /** 323 /**
304 * The annotations associated with this node. 324 * The annotations associated with this node.
305 */ 325 */
306 NodeList<Annotation> _metadata; 326 NodeList<Annotation> _metadata;
307 /** 327 /**
308 * Initialize a newly created node. 328 * Initialize a newly created node.
309 * @param comment the documentation comment associated with this node 329 * @param comment the documentation comment associated with this node
310 * @param metadata the annotations associated with this node 330 * @param metadata the annotations associated with this node
311 */ 331 */
312 AnnotatedNode(Comment comment, List<Annotation> metadata) { 332 AnnotatedNode.full(Comment comment, List<Annotation> metadata) {
313 this._metadata = new NodeList<Annotation>(this); 333 this._metadata = new NodeList<Annotation>(this);
314 this._comment = becomeParentOf(comment); 334 this._comment = becomeParentOf(comment);
315 this._metadata.addAll(metadata); 335 this._metadata.addAll(metadata);
316 } 336 }
337 /**
338 * Initialize a newly created node.
339 * @param comment the documentation comment associated with this node
340 * @param metadata the annotations associated with this node
341 */
342 AnnotatedNode({Comment comment, List<Annotation> metadata}) : this.full(commen t, metadata);
317 Token get beginToken { 343 Token get beginToken {
318 if (_comment == null) { 344 if (_comment == null) {
319 if (_metadata.isEmpty) { 345 if (_metadata.isEmpty) {
320 return firstTokenAfterCommentAndMetadata; 346 return firstTokenAfterCommentAndMetadata;
321 } else { 347 } else {
322 return _metadata.beginToken; 348 return _metadata.beginToken;
323 } 349 }
324 } else if (_metadata.isEmpty) { 350 } else if (_metadata.isEmpty) {
325 return _comment.beginToken; 351 return _comment.beginToken;
326 } 352 }
(...skipping 12 matching lines...) Expand all
339 Comment get documentationComment => _comment; 365 Comment get documentationComment => _comment;
340 /** 366 /**
341 * Return the annotations associated with this node. 367 * Return the annotations associated with this node.
342 * @return the annotations associated with this node 368 * @return the annotations associated with this node
343 */ 369 */
344 NodeList<Annotation> get metadata => _metadata; 370 NodeList<Annotation> get metadata => _metadata;
345 /** 371 /**
346 * Set the documentation comment associated with this node to the given commen t 372 * Set the documentation comment associated with this node to the given commen t
347 * @param comment the documentation comment to be associated with this node 373 * @param comment the documentation comment to be associated with this node
348 */ 374 */
349 void set documentationComment(Comment comment) { 375 void set documentationComment(Comment comment2) {
350 this._comment = becomeParentOf(comment); 376 this._comment = becomeParentOf(comment2);
351 } 377 }
352 void visitChildren(ASTVisitor<Object> visitor) { 378 void visitChildren(ASTVisitor<Object> visitor) {
353 if (commentIsBeforeAnnotations()) { 379 if (commentIsBeforeAnnotations()) {
354 safelyVisitChild(_comment, visitor); 380 safelyVisitChild(_comment, visitor);
355 _metadata.accept(visitor); 381 _metadata.accept(visitor);
356 } else { 382 } else {
357 for (ASTNode child in sortedCommentAndAnnotations) { 383 for (ASTNode child in sortedCommentAndAnnotations) {
358 child.accept(visitor); 384 child.accept(visitor);
359 } 385 }
360 } 386 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 * @param atSign the at sign that introduced the annotation 456 * @param atSign the at sign that introduced the annotation
431 * @param name the name of the class defining the constructor that is being in voked or the name of 457 * @param name the name of the class defining the constructor that is being in voked or the name of
432 * the field that is being referenced 458 * the field that is being referenced
433 * @param period the period before the constructor name, or {@code null} if th is annotation is not 459 * @param period the period before the constructor name, or {@code null} if th is annotation is not
434 * the invocation of a named constructor 460 * the invocation of a named constructor
435 * @param constructorName the name of the constructor being invoked, or {@code null} if this 461 * @param constructorName the name of the constructor being invoked, or {@code null} if this
436 * annotation is not the invocation of a named constructor 462 * annotation is not the invocation of a named constructor
437 * @param arguments the arguments to the constructor being invoked, or {@code null} if this 463 * @param arguments the arguments to the constructor being invoked, or {@code null} if this
438 * annotation is not the invocation of a constructor 464 * annotation is not the invocation of a constructor
439 */ 465 */
440 Annotation(Token atSign, Identifier name, Token period, SimpleIdentifier const ructorName, ArgumentList arguments) { 466 Annotation.full(Token atSign, Identifier name, Token period, SimpleIdentifier constructorName, ArgumentList arguments) {
441 this._atSign = atSign; 467 this._atSign = atSign;
442 this._name = becomeParentOf(name); 468 this._name = becomeParentOf(name);
443 this._period = period; 469 this._period = period;
444 this._constructorName = becomeParentOf(constructorName); 470 this._constructorName = becomeParentOf(constructorName);
445 this._arguments = becomeParentOf(arguments); 471 this._arguments = becomeParentOf(arguments);
446 } 472 }
473 /**
474 * Initialize a newly created annotation.
475 * @param atSign the at sign that introduced the annotation
476 * @param name the name of the class defining the constructor that is being in voked or the name of
477 * the field that is being referenced
478 * @param period the period before the constructor name, or {@code null} if th is annotation is not
479 * the invocation of a named constructor
480 * @param constructorName the name of the constructor being invoked, or {@code null} if this
481 * annotation is not the invocation of a named constructor
482 * @param arguments the arguments to the constructor being invoked, or {@code null} if this
483 * annotation is not the invocation of a constructor
484 */
485 Annotation({Token atSign, Identifier name, Token period, SimpleIdentifier cons tructorName, ArgumentList arguments}) : this.full(atSign, name, period, construc torName, arguments);
447 accept(ASTVisitor visitor) => visitor.visitAnnotation(this); 486 accept(ASTVisitor visitor) => visitor.visitAnnotation(this);
448 /** 487 /**
449 * Return the arguments to the constructor being invoked, or {@code null} if t his annotation is 488 * Return the arguments to the constructor being invoked, or {@code null} if t his annotation is
450 * not the invocation of a constructor. 489 * not the invocation of a constructor.
451 * @return the arguments to the constructor being invoked 490 * @return the arguments to the constructor being invoked
452 */ 491 */
453 ArgumentList get arguments => _arguments; 492 ArgumentList get arguments => _arguments;
454 /** 493 /**
455 * Return the at sign that introduced the annotation. 494 * Return the at sign that introduced the annotation.
456 * @return the at sign that introduced the annotation 495 * @return the at sign that introduced the annotation
(...skipping 23 matching lines...) Expand all
480 /** 519 /**
481 * Return the period before the constructor name, or {@code null} if this anno tation is not the 520 * Return the period before the constructor name, or {@code null} if this anno tation is not the
482 * invocation of a named constructor. 521 * invocation of a named constructor.
483 * @return the period before the constructor name 522 * @return the period before the constructor name
484 */ 523 */
485 Token get period => _period; 524 Token get period => _period;
486 /** 525 /**
487 * Set the arguments to the constructor being invoked to the given arguments. 526 * Set the arguments to the constructor being invoked to the given arguments.
488 * @param arguments the arguments to the constructor being invoked 527 * @param arguments the arguments to the constructor being invoked
489 */ 528 */
490 void set arguments2(ArgumentList arguments) { 529 void set arguments(ArgumentList arguments2) {
491 this._arguments = becomeParentOf(arguments); 530 this._arguments = becomeParentOf(arguments2);
492 } 531 }
493 /** 532 /**
494 * Set the at sign that introduced the annotation to the given token. 533 * Set the at sign that introduced the annotation to the given token.
495 * @param atSign the at sign that introduced the annotation 534 * @param atSign the at sign that introduced the annotation
496 */ 535 */
497 void set atSign2(Token atSign) { 536 void set atSign(Token atSign2) {
498 this._atSign = atSign; 537 this._atSign = atSign2;
499 } 538 }
500 /** 539 /**
501 * Set the name of the constructor being invoked to the given name. 540 * Set the name of the constructor being invoked to the given name.
502 * @param constructorName the name of the constructor being invoked 541 * @param constructorName the name of the constructor being invoked
503 */ 542 */
504 void set constructorName2(SimpleIdentifier constructorName) { 543 void set constructorName(SimpleIdentifier constructorName2) {
505 this._constructorName = becomeParentOf(constructorName); 544 this._constructorName = becomeParentOf(constructorName2);
506 } 545 }
507 /** 546 /**
508 * Set the name of the class defining the constructor that is being invoked or the name of the 547 * Set the name of the class defining the constructor that is being invoked or the name of the
509 * field that is being referenced to the given name. 548 * field that is being referenced to the given name.
510 * @param name the name of the constructor being invoked or the name of the fi eld being referenced 549 * @param name the name of the constructor being invoked or the name of the fi eld being referenced
511 */ 550 */
512 void set name2(Identifier name) { 551 void set name(Identifier name2) {
513 this._name = becomeParentOf(name); 552 this._name = becomeParentOf(name2);
514 } 553 }
515 /** 554 /**
516 * Set the period before the constructor name to the given token. 555 * Set the period before the constructor name to the given token.
517 * @param period the period before the constructor name 556 * @param period the period before the constructor name
518 */ 557 */
519 void set period2(Token period) { 558 void set period(Token period2) {
520 this._period = period; 559 this._period = period2;
521 } 560 }
522 void visitChildren(ASTVisitor<Object> visitor) { 561 void visitChildren(ASTVisitor<Object> visitor) {
523 safelyVisitChild(_name, visitor); 562 safelyVisitChild(_name, visitor);
524 safelyVisitChild(_constructorName, visitor); 563 safelyVisitChild(_constructorName, visitor);
525 safelyVisitChild(_arguments, visitor); 564 safelyVisitChild(_arguments, visitor);
526 } 565 }
527 } 566 }
528 /** 567 /**
529 * Instances of the class {@code ArgumentDefinitionTest} represent an argument d efinition test. 568 * Instances of the class {@code ArgumentDefinitionTest} represent an argument d efinition test.
530 * <pre> 569 * <pre>
531 * argumentDefinitionTest ::= 570 * argumentDefinitionTest ::=
532 * '?' {@link SimpleIdentifier identifier}</pre> 571 * '?' {@link SimpleIdentifier identifier}</pre>
533 */ 572 */
534 class ArgumentDefinitionTest extends Expression { 573 class ArgumentDefinitionTest extends Expression {
535 /** 574 /**
536 * The token representing the question mark. 575 * The token representing the question mark.
537 */ 576 */
538 Token _question; 577 Token _question;
539 /** 578 /**
540 * The identifier representing the argument being tested. 579 * The identifier representing the argument being tested.
541 */ 580 */
542 SimpleIdentifier _identifier; 581 SimpleIdentifier _identifier;
543 /** 582 /**
544 * Initialize a newly created argument definition test. 583 * Initialize a newly created argument definition test.
545 * @param question the token representing the question mark 584 * @param question the token representing the question mark
546 * @param identifier the identifier representing the argument being tested 585 * @param identifier the identifier representing the argument being tested
547 */ 586 */
548 ArgumentDefinitionTest(Token question, SimpleIdentifier identifier) { 587 ArgumentDefinitionTest.full(Token question, SimpleIdentifier identifier) {
549 this._question = question; 588 this._question = question;
550 this._identifier = becomeParentOf(identifier); 589 this._identifier = becomeParentOf(identifier);
551 } 590 }
591 /**
592 * Initialize a newly created argument definition test.
593 * @param question the token representing the question mark
594 * @param identifier the identifier representing the argument being tested
595 */
596 ArgumentDefinitionTest({Token question, SimpleIdentifier identifier}) : this.f ull(question, identifier);
552 accept(ASTVisitor visitor) => visitor.visitArgumentDefinitionTest(this); 597 accept(ASTVisitor visitor) => visitor.visitArgumentDefinitionTest(this);
553 Token get beginToken => _question; 598 Token get beginToken => _question;
554 Token get endToken => _identifier.endToken; 599 Token get endToken => _identifier.endToken;
555 /** 600 /**
556 * Return the identifier representing the argument being tested. 601 * Return the identifier representing the argument being tested.
557 * @return the identifier representing the argument being tested 602 * @return the identifier representing the argument being tested
558 */ 603 */
559 SimpleIdentifier get identifier => _identifier; 604 SimpleIdentifier get identifier => _identifier;
560 /** 605 /**
561 * Return the token representing the question mark. 606 * Return the token representing the question mark.
562 * @return the token representing the question mark 607 * @return the token representing the question mark
563 */ 608 */
564 Token get question => _question; 609 Token get question => _question;
565 /** 610 /**
566 * Set the identifier representing the argument being tested to the given iden tifier. 611 * Set the identifier representing the argument being tested to the given iden tifier.
567 * @param identifier the identifier representing the argument being tested 612 * @param identifier the identifier representing the argument being tested
568 */ 613 */
569 void set identifier2(SimpleIdentifier identifier) { 614 void set identifier(SimpleIdentifier identifier5) {
570 this._identifier = becomeParentOf(identifier); 615 this._identifier = becomeParentOf(identifier5);
571 } 616 }
572 /** 617 /**
573 * Set the token representing the question mark to the given token. 618 * Set the token representing the question mark to the given token.
574 * @param question the token representing the question mark 619 * @param question the token representing the question mark
575 */ 620 */
576 void set question2(Token question) { 621 void set question(Token question2) {
577 this._question = question; 622 this._question = question2;
578 } 623 }
579 void visitChildren(ASTVisitor<Object> visitor) { 624 void visitChildren(ASTVisitor<Object> visitor) {
580 safelyVisitChild(_identifier, visitor); 625 safelyVisitChild(_identifier, visitor);
581 } 626 }
582 } 627 }
583 /** 628 /**
584 * Instances of the class {@code ArgumentList} represent a list of arguments in the invocation of a 629 * Instances of the class {@code ArgumentList} represent a list of arguments in the invocation of a
585 * executable element: a function, method, or constructor. 630 * executable element: a function, method, or constructor.
586 * <pre> 631 * <pre>
587 * argumentList ::= 632 * argumentList ::=
(...skipping 14 matching lines...) Expand all
602 /** 647 /**
603 * The right parenthesis. 648 * The right parenthesis.
604 */ 649 */
605 Token _rightParenthesis; 650 Token _rightParenthesis;
606 /** 651 /**
607 * Initialize a newly created list of arguments. 652 * Initialize a newly created list of arguments.
608 * @param leftParenthesis the left parenthesis 653 * @param leftParenthesis the left parenthesis
609 * @param arguments the expressions producing the values of the arguments 654 * @param arguments the expressions producing the values of the arguments
610 * @param rightParenthesis the right parenthesis 655 * @param rightParenthesis the right parenthesis
611 */ 656 */
612 ArgumentList(Token leftParenthesis, List<Expression> arguments, Token rightPar enthesis) { 657 ArgumentList.full(Token leftParenthesis, List<Expression> arguments, Token rig htParenthesis) {
613 this._arguments = new NodeList<Expression>(this); 658 this._arguments = new NodeList<Expression>(this);
614 this._leftParenthesis = leftParenthesis; 659 this._leftParenthesis = leftParenthesis;
615 this._arguments.addAll(arguments); 660 this._arguments.addAll(arguments);
616 this._rightParenthesis = rightParenthesis; 661 this._rightParenthesis = rightParenthesis;
617 } 662 }
663 /**
664 * Initialize a newly created list of arguments.
665 * @param leftParenthesis the left parenthesis
666 * @param arguments the expressions producing the values of the arguments
667 * @param rightParenthesis the right parenthesis
668 */
669 ArgumentList({Token leftParenthesis, List<Expression> arguments, Token rightPa renthesis}) : this.full(leftParenthesis, arguments, rightParenthesis);
Jennifer Messerly 2013/02/13 21:36:54 nice, I liked the named args here!
618 accept(ASTVisitor visitor) => visitor.visitArgumentList(this); 670 accept(ASTVisitor visitor) => visitor.visitArgumentList(this);
619 /** 671 /**
620 * Return the expressions producing the values of the arguments. Although the language requires 672 * Return the expressions producing the values of the arguments. Although the language requires
621 * that positional arguments appear before named arguments, this class allows them to be 673 * that positional arguments appear before named arguments, this class allows them to be
622 * intermixed. 674 * intermixed.
623 * @return the expressions producing the values of the arguments 675 * @return the expressions producing the values of the arguments
624 */ 676 */
625 NodeList<Expression> get arguments => _arguments; 677 NodeList<Expression> get arguments => _arguments;
626 Token get beginToken => _leftParenthesis; 678 Token get beginToken => _leftParenthesis;
627 Token get endToken => _rightParenthesis; 679 Token get endToken => _rightParenthesis;
628 /** 680 /**
629 * Return the left parenthesis. 681 * Return the left parenthesis.
630 * @return the left parenthesis 682 * @return the left parenthesis
631 */ 683 */
632 Token get leftParenthesis => _leftParenthesis; 684 Token get leftParenthesis => _leftParenthesis;
633 /** 685 /**
634 * Return the right parenthesis. 686 * Return the right parenthesis.
635 * @return the right parenthesis 687 * @return the right parenthesis
636 */ 688 */
637 Token get rightParenthesis => _rightParenthesis; 689 Token get rightParenthesis => _rightParenthesis;
638 /** 690 /**
639 * Set the left parenthesis to the given token. 691 * Set the left parenthesis to the given token.
640 * @param parenthesis the left parenthesis 692 * @param parenthesis the left parenthesis
641 */ 693 */
642 void set leftParenthesis2(Token parenthesis) { 694 void set leftParenthesis(Token parenthesis) {
643 _leftParenthesis = parenthesis; 695 _leftParenthesis = parenthesis;
644 } 696 }
645 /** 697 /**
646 * Set the right parenthesis to the given token. 698 * Set the right parenthesis to the given token.
647 * @param parenthesis the right parenthesis 699 * @param parenthesis the right parenthesis
648 */ 700 */
649 void set rightParenthesis2(Token parenthesis) { 701 void set rightParenthesis(Token parenthesis) {
650 _rightParenthesis = parenthesis; 702 _rightParenthesis = parenthesis;
651 } 703 }
652 void visitChildren(ASTVisitor<Object> visitor) { 704 void visitChildren(ASTVisitor<Object> visitor) {
653 _arguments.accept(visitor); 705 _arguments.accept(visitor);
654 } 706 }
655 } 707 }
656 /** 708 /**
657 * Instances of the class {@code AsExpression} represent an 'as' expression. 709 * Instances of the class {@code AsExpression} represent an 'as' expression.
658 * <pre> 710 * <pre>
659 * asExpression ::={@link Expression expression} 'as' {@link TypeName type}</pre > 711 * asExpression ::={@link Expression expression} 'as' {@link TypeName type}</pre >
(...skipping 10 matching lines...) Expand all
670 /** 722 /**
671 * The name of the type being cast to. 723 * The name of the type being cast to.
672 */ 724 */
673 TypeName _type; 725 TypeName _type;
674 /** 726 /**
675 * Initialize a newly created as expression. 727 * Initialize a newly created as expression.
676 * @param expression the expression used to compute the value being cast 728 * @param expression the expression used to compute the value being cast
677 * @param isOperator the is operator 729 * @param isOperator the is operator
678 * @param type the name of the type being cast to 730 * @param type the name of the type being cast to
679 */ 731 */
680 AsExpression(Expression expression, Token isOperator, TypeName type) { 732 AsExpression.full(Expression expression, Token isOperator, TypeName type) {
681 this._expression = becomeParentOf(expression); 733 this._expression = becomeParentOf(expression);
682 this._asOperator = isOperator; 734 this._asOperator = isOperator;
683 this._type = becomeParentOf(type); 735 this._type = becomeParentOf(type);
684 } 736 }
737 /**
738 * Initialize a newly created as expression.
739 * @param expression the expression used to compute the value being cast
740 * @param isOperator the is operator
741 * @param type the name of the type being cast to
742 */
743 AsExpression({Expression expression, Token isOperator, TypeName type}) : this. full(expression, isOperator, type);
685 accept(ASTVisitor visitor) => visitor.visitAsExpression(this); 744 accept(ASTVisitor visitor) => visitor.visitAsExpression(this);
686 /** 745 /**
687 * Return the is operator being applied. 746 * Return the is operator being applied.
688 * @return the is operator being applied 747 * @return the is operator being applied
689 */ 748 */
690 Token get asOperator => _asOperator; 749 Token get asOperator => _asOperator;
691 Token get beginToken => _expression.beginToken; 750 Token get beginToken => _expression.beginToken;
692 Token get endToken => _type.endToken; 751 Token get endToken => _type.endToken;
693 /** 752 /**
694 * Return the expression used to compute the value being cast. 753 * Return the expression used to compute the value being cast.
695 * @return the expression used to compute the value being cast 754 * @return the expression used to compute the value being cast
696 */ 755 */
697 Expression get expression => _expression; 756 Expression get expression => _expression;
698 /** 757 /**
699 * Return the name of the type being cast to. 758 * Return the name of the type being cast to.
700 * @return the name of the type being cast to 759 * @return the name of the type being cast to
701 */ 760 */
702 TypeName get type => _type; 761 TypeName get type => _type;
703 /** 762 /**
704 * Set the is operator being applied to the given operator. 763 * Set the is operator being applied to the given operator.
705 * @param asOperator the is operator being applied 764 * @param asOperator the is operator being applied
706 */ 765 */
707 void set asOperator2(Token asOperator) { 766 void set asOperator(Token asOperator2) {
708 this._asOperator = asOperator; 767 this._asOperator = asOperator2;
709 } 768 }
710 /** 769 /**
711 * Set the expression used to compute the value being cast to the given expres sion. 770 * Set the expression used to compute the value being cast to the given expres sion.
712 * @param expression the expression used to compute the value being cast 771 * @param expression the expression used to compute the value being cast
713 */ 772 */
714 void set expression2(Expression expression) { 773 void set expression(Expression expression2) {
715 this._expression = becomeParentOf(expression); 774 this._expression = becomeParentOf(expression2);
716 } 775 }
717 /** 776 /**
718 * Set the name of the type being cast to to the given name. 777 * Set the name of the type being cast to to the given name.
719 * @param name the name of the type being cast to 778 * @param name the name of the type being cast to
720 */ 779 */
721 void set type2(TypeName name) { 780 void set type(TypeName name) {
722 this._type = becomeParentOf(name); 781 this._type = becomeParentOf(name);
723 } 782 }
724 void visitChildren(ASTVisitor<Object> visitor) { 783 void visitChildren(ASTVisitor<Object> visitor) {
725 safelyVisitChild(_expression, visitor); 784 safelyVisitChild(_expression, visitor);
726 safelyVisitChild(_type, visitor); 785 safelyVisitChild(_type, visitor);
727 } 786 }
728 } 787 }
729 /** 788 /**
730 * Instances of the class {@code AssertStatement} represent an assert statement. 789 * Instances of the class {@code AssertStatement} represent an assert statement.
731 * <pre> 790 * <pre>
(...skipping 23 matching lines...) Expand all
755 */ 814 */
756 Token _semicolon; 815 Token _semicolon;
757 /** 816 /**
758 * Initialize a newly created assert statement. 817 * Initialize a newly created assert statement.
759 * @param keyword the token representing the 'assert' keyword 818 * @param keyword the token representing the 'assert' keyword
760 * @param leftParenthesis the left parenthesis 819 * @param leftParenthesis the left parenthesis
761 * @param condition the condition that is being asserted to be {@code true} 820 * @param condition the condition that is being asserted to be {@code true}
762 * @param rightParenthesis the right parenthesis 821 * @param rightParenthesis the right parenthesis
763 * @param semicolon the semicolon terminating the statement 822 * @param semicolon the semicolon terminating the statement
764 */ 823 */
765 AssertStatement(Token keyword, Token leftParenthesis, Expression condition, To ken rightParenthesis, Token semicolon) { 824 AssertStatement.full(Token keyword, Token leftParenthesis, Expression conditio n, Token rightParenthesis, Token semicolon) {
766 this._keyword = keyword; 825 this._keyword = keyword;
767 this._leftParenthesis = leftParenthesis; 826 this._leftParenthesis = leftParenthesis;
768 this._condition = becomeParentOf(condition); 827 this._condition = becomeParentOf(condition);
769 this._rightParenthesis = rightParenthesis; 828 this._rightParenthesis = rightParenthesis;
770 this._semicolon = semicolon; 829 this._semicolon = semicolon;
771 } 830 }
831 /**
832 * Initialize a newly created assert statement.
833 * @param keyword the token representing the 'assert' keyword
834 * @param leftParenthesis the left parenthesis
835 * @param condition the condition that is being asserted to be {@code true}
836 * @param rightParenthesis the right parenthesis
837 * @param semicolon the semicolon terminating the statement
838 */
839 AssertStatement({Token keyword, Token leftParenthesis, Expression condition, T oken rightParenthesis, Token semicolon}) : this.full(keyword, leftParenthesis, c ondition, rightParenthesis, semicolon);
772 accept(ASTVisitor visitor) => visitor.visitAssertStatement(this); 840 accept(ASTVisitor visitor) => visitor.visitAssertStatement(this);
773 Token get beginToken => _keyword; 841 Token get beginToken => _keyword;
774 /** 842 /**
775 * Return the condition that is being asserted to be {@code true}. 843 * Return the condition that is being asserted to be {@code true}.
776 * @return the condition that is being asserted to be {@code true} 844 * @return the condition that is being asserted to be {@code true}
777 */ 845 */
778 Expression get condition => _condition; 846 Expression get condition => _condition;
779 Token get endToken => _semicolon; 847 Token get endToken => _semicolon;
780 /** 848 /**
781 * Return the token representing the 'assert' keyword. 849 * Return the token representing the 'assert' keyword.
(...skipping 12 matching lines...) Expand all
794 Token get rightParenthesis => _rightParenthesis; 862 Token get rightParenthesis => _rightParenthesis;
795 /** 863 /**
796 * Return the semicolon terminating the statement. 864 * Return the semicolon terminating the statement.
797 * @return the semicolon terminating the statement 865 * @return the semicolon terminating the statement
798 */ 866 */
799 Token get semicolon => _semicolon; 867 Token get semicolon => _semicolon;
800 /** 868 /**
801 * Set the condition that is being asserted to be {@code true} to the given ex pression. 869 * Set the condition that is being asserted to be {@code true} to the given ex pression.
802 * @param the condition that is being asserted to be {@code true} 870 * @param the condition that is being asserted to be {@code true}
803 */ 871 */
804 void set condition2(Expression condition) { 872 void set condition(Expression condition2) {
805 this._condition = becomeParentOf(condition); 873 this._condition = becomeParentOf(condition2);
806 } 874 }
807 /** 875 /**
808 * Set the token representing the 'assert' keyword to the given token. 876 * Set the token representing the 'assert' keyword to the given token.
809 * @param keyword the token representing the 'assert' keyword 877 * @param keyword the token representing the 'assert' keyword
810 */ 878 */
811 void set keyword3(Token keyword) { 879 void set keyword(Token keyword3) {
812 this._keyword = keyword; 880 this._keyword = keyword3;
813 } 881 }
814 /** 882 /**
815 * Set the left parenthesis to the given token. 883 * Set the left parenthesis to the given token.
816 * @param the left parenthesis 884 * @param the left parenthesis
817 */ 885 */
818 void set leftParenthesis3(Token leftParenthesis) { 886 void set leftParenthesis(Token leftParenthesis2) {
819 this._leftParenthesis = leftParenthesis; 887 this._leftParenthesis = leftParenthesis2;
820 } 888 }
821 /** 889 /**
822 * Set the right parenthesis to the given token. 890 * Set the right parenthesis to the given token.
823 * @param rightParenthesis the right parenthesis 891 * @param rightParenthesis the right parenthesis
824 */ 892 */
825 void set rightParenthesis3(Token rightParenthesis) { 893 void set rightParenthesis(Token rightParenthesis2) {
826 this._rightParenthesis = rightParenthesis; 894 this._rightParenthesis = rightParenthesis2;
827 } 895 }
828 /** 896 /**
829 * Set the semicolon terminating the statement to the given token. 897 * Set the semicolon terminating the statement to the given token.
830 * @param semicolon the semicolon terminating the statement 898 * @param semicolon the semicolon terminating the statement
831 */ 899 */
832 void set semicolon2(Token semicolon) { 900 void set semicolon(Token semicolon2) {
833 this._semicolon = semicolon; 901 this._semicolon = semicolon2;
834 } 902 }
835 void visitChildren(ASTVisitor<Object> visitor) { 903 void visitChildren(ASTVisitor<Object> visitor) {
836 safelyVisitChild(_condition, visitor); 904 safelyVisitChild(_condition, visitor);
837 } 905 }
838 } 906 }
839 /** 907 /**
840 * Instances of the class {@code AssignmentExpression} represent an assignment e xpression. 908 * Instances of the class {@code AssignmentExpression} represent an assignment e xpression.
841 * <pre> 909 * <pre>
842 * assignmentExpression ::={@link Expression leftHandSide} {@link Token operator } {@link Expression rightHandSide}</pre> 910 * assignmentExpression ::={@link Expression leftHandSide} {@link Token operator } {@link Expression rightHandSide}</pre>
843 */ 911 */
(...skipping 14 matching lines...) Expand all
858 * The element associated with the operator, or {@code null} if the AST struct ure has not been 926 * The element associated with the operator, or {@code null} if the AST struct ure has not been
859 * resolved, if the operator is not a compound operator, or if the operator co uld not be resolved. 927 * resolved, if the operator is not a compound operator, or if the operator co uld not be resolved.
860 */ 928 */
861 MethodElement _element; 929 MethodElement _element;
862 /** 930 /**
863 * Initialize a newly created assignment expression. 931 * Initialize a newly created assignment expression.
864 * @param leftHandSide the expression used to compute the left hand side 932 * @param leftHandSide the expression used to compute the left hand side
865 * @param operator the assignment operator being applied 933 * @param operator the assignment operator being applied
866 * @param rightHandSide the expression used to compute the right hand side 934 * @param rightHandSide the expression used to compute the right hand side
867 */ 935 */
868 AssignmentExpression(Expression leftHandSide, Token operator, Expression right HandSide) { 936 AssignmentExpression.full(Expression leftHandSide, Token operator, Expression rightHandSide) {
869 this._leftHandSide = becomeParentOf(leftHandSide); 937 this._leftHandSide = becomeParentOf(leftHandSide);
870 this._operator = operator; 938 this._operator = operator;
871 this._rightHandSide = becomeParentOf(rightHandSide); 939 this._rightHandSide = becomeParentOf(rightHandSide);
872 } 940 }
941 /**
942 * Initialize a newly created assignment expression.
943 * @param leftHandSide the expression used to compute the left hand side
944 * @param operator the assignment operator being applied
945 * @param rightHandSide the expression used to compute the right hand side
946 */
947 AssignmentExpression({Expression leftHandSide, Token operator, Expression righ tHandSide}) : this.full(leftHandSide, operator, rightHandSide);
873 accept(ASTVisitor visitor) => visitor.visitAssignmentExpression(this); 948 accept(ASTVisitor visitor) => visitor.visitAssignmentExpression(this);
874 Token get beginToken => _leftHandSide.beginToken; 949 Token get beginToken => _leftHandSide.beginToken;
875 /** 950 /**
876 * Return the element associated with the operator, or {@code null} if the AST structure has not 951 * Return the element associated with the operator, or {@code null} if the AST structure has not
877 * been resolved, if the operator is not a compound operator, or if the operat or could not be 952 * been resolved, if the operator is not a compound operator, or if the operat or could not be
878 * resolved. One example of the latter case is an operator that is not defined for the type of the 953 * resolved. One example of the latter case is an operator that is not defined for the type of the
879 * left-hand operand. 954 * left-hand operand.
880 * @return the element associated with the operator 955 * @return the element associated with the operator
881 */ 956 */
882 MethodElement get element => _element; 957 MethodElement get element => _element;
(...skipping 10 matching lines...) Expand all
893 Token get operator => _operator; 968 Token get operator => _operator;
894 /** 969 /**
895 * Return the expression used to compute the right hand side. 970 * Return the expression used to compute the right hand side.
896 * @return the expression used to compute the right hand side 971 * @return the expression used to compute the right hand side
897 */ 972 */
898 Expression get rightHandSide => _rightHandSide; 973 Expression get rightHandSide => _rightHandSide;
899 /** 974 /**
900 * Set the element associated with the operator to the given element. 975 * Set the element associated with the operator to the given element.
901 * @param element the element associated with the operator 976 * @param element the element associated with the operator
902 */ 977 */
903 void set element2(MethodElement element) { 978 void set element(MethodElement element3) {
904 this._element = element; 979 this._element = element3;
905 } 980 }
906 /** 981 /**
907 * Return the expression used to compute the left hand side. 982 * Return the expression used to compute the left hand side.
908 * @param expression the expression used to compute the left hand side 983 * @param expression the expression used to compute the left hand side
909 */ 984 */
910 void set leftHandSide2(Expression expression) { 985 void set leftHandSide(Expression expression) {
911 _leftHandSide = becomeParentOf(expression); 986 _leftHandSide = becomeParentOf(expression);
912 } 987 }
913 /** 988 /**
914 * Set the assignment operator being applied to the given operator. 989 * Set the assignment operator being applied to the given operator.
915 * @param operator the assignment operator being applied 990 * @param operator the assignment operator being applied
916 */ 991 */
917 void set operator2(Token operator) { 992 void set operator(Token operator2) {
918 this._operator = operator; 993 this._operator = operator2;
919 } 994 }
920 /** 995 /**
921 * Set the expression used to compute the left hand side to the given expressi on. 996 * Set the expression used to compute the left hand side to the given expressi on.
922 * @param expression the expression used to compute the left hand side 997 * @param expression the expression used to compute the left hand side
923 */ 998 */
924 void set rightHandSide2(Expression expression) { 999 void set rightHandSide(Expression expression) {
925 _rightHandSide = becomeParentOf(expression); 1000 _rightHandSide = becomeParentOf(expression);
926 } 1001 }
927 void visitChildren(ASTVisitor<Object> visitor) { 1002 void visitChildren(ASTVisitor<Object> visitor) {
928 safelyVisitChild(_leftHandSide, visitor); 1003 safelyVisitChild(_leftHandSide, visitor);
929 safelyVisitChild(_rightHandSide, visitor); 1004 safelyVisitChild(_rightHandSide, visitor);
930 } 1005 }
931 } 1006 }
932 /** 1007 /**
933 * Instances of the class {@code BinaryExpression} represent a binary (infix) ex pression. 1008 * Instances of the class {@code BinaryExpression} represent a binary (infix) ex pression.
934 * <pre> 1009 * <pre>
(...skipping 16 matching lines...) Expand all
951 * The element associated with the operator, or {@code null} if the AST struct ure has not been 1026 * The element associated with the operator, or {@code null} if the AST struct ure has not been
952 * resolved, if the operator is not user definable, or if the operator could n ot be resolved. 1027 * resolved, if the operator is not user definable, or if the operator could n ot be resolved.
953 */ 1028 */
954 MethodElement _element; 1029 MethodElement _element;
955 /** 1030 /**
956 * Initialize a newly created binary expression. 1031 * Initialize a newly created binary expression.
957 * @param leftOperand the expression used to compute the left operand 1032 * @param leftOperand the expression used to compute the left operand
958 * @param operator the binary operator being applied 1033 * @param operator the binary operator being applied
959 * @param rightOperand the expression used to compute the right operand 1034 * @param rightOperand the expression used to compute the right operand
960 */ 1035 */
961 BinaryExpression(Expression leftOperand, Token operator, Expression rightOpera nd) { 1036 BinaryExpression.full(Expression leftOperand, Token operator, Expression right Operand) {
962 this._leftOperand = becomeParentOf(leftOperand); 1037 this._leftOperand = becomeParentOf(leftOperand);
963 this._operator = operator; 1038 this._operator = operator;
964 this._rightOperand = becomeParentOf(rightOperand); 1039 this._rightOperand = becomeParentOf(rightOperand);
965 } 1040 }
1041 /**
1042 * Initialize a newly created binary expression.
1043 * @param leftOperand the expression used to compute the left operand
1044 * @param operator the binary operator being applied
1045 * @param rightOperand the expression used to compute the right operand
1046 */
1047 BinaryExpression({Expression leftOperand, Token operator, Expression rightOper and}) : this.full(leftOperand, operator, rightOperand);
966 accept(ASTVisitor visitor) => visitor.visitBinaryExpression(this); 1048 accept(ASTVisitor visitor) => visitor.visitBinaryExpression(this);
967 Token get beginToken => _leftOperand.beginToken; 1049 Token get beginToken => _leftOperand.beginToken;
968 /** 1050 /**
969 * Return the element associated with the operator, or {@code null} if the AST structure has not 1051 * Return the element associated with the operator, or {@code null} if the AST structure has not
970 * been resolved, if the operator is not user definable, or if the operator co uld not be resolved. 1052 * been resolved, if the operator is not user definable, or if the operator co uld not be resolved.
971 * One example of the latter case is an operator that is not defined for the t ype of the left-hand 1053 * One example of the latter case is an operator that is not defined for the t ype of the left-hand
972 * operand. 1054 * operand.
973 * @return the element associated with the operator 1055 * @return the element associated with the operator
974 */ 1056 */
975 MethodElement get element => _element; 1057 MethodElement get element => _element;
(...skipping 10 matching lines...) Expand all
986 Token get operator => _operator; 1068 Token get operator => _operator;
987 /** 1069 /**
988 * Return the expression used to compute the right operand. 1070 * Return the expression used to compute the right operand.
989 * @return the expression used to compute the right operand 1071 * @return the expression used to compute the right operand
990 */ 1072 */
991 Expression get rightOperand => _rightOperand; 1073 Expression get rightOperand => _rightOperand;
992 /** 1074 /**
993 * Set the element associated with the operator to the given element. 1075 * Set the element associated with the operator to the given element.
994 * @param element the element associated with the operator 1076 * @param element the element associated with the operator
995 */ 1077 */
996 void set element3(MethodElement element) { 1078 void set element(MethodElement element4) {
997 this._element = element; 1079 this._element = element4;
998 } 1080 }
999 /** 1081 /**
1000 * Set the expression used to compute the left operand to the given expression . 1082 * Set the expression used to compute the left operand to the given expression .
1001 * @param expression the expression used to compute the left operand 1083 * @param expression the expression used to compute the left operand
1002 */ 1084 */
1003 void set leftOperand2(Expression expression) { 1085 void set leftOperand(Expression expression) {
1004 _leftOperand = becomeParentOf(expression); 1086 _leftOperand = becomeParentOf(expression);
1005 } 1087 }
1006 /** 1088 /**
1007 * Set the binary operator being applied to the given operator. 1089 * Set the binary operator being applied to the given operator.
1008 * @return the binary operator being applied 1090 * @return the binary operator being applied
1009 */ 1091 */
1010 void set operator3(Token operator) { 1092 void set operator(Token operator3) {
1011 this._operator = operator; 1093 this._operator = operator3;
1012 } 1094 }
1013 /** 1095 /**
1014 * Set the expression used to compute the right operand to the given expressio n. 1096 * Set the expression used to compute the right operand to the given expressio n.
1015 * @param expression the expression used to compute the right operand 1097 * @param expression the expression used to compute the right operand
1016 */ 1098 */
1017 void set rightOperand2(Expression expression) { 1099 void set rightOperand(Expression expression) {
1018 _rightOperand = becomeParentOf(expression); 1100 _rightOperand = becomeParentOf(expression);
1019 } 1101 }
1020 void visitChildren(ASTVisitor<Object> visitor) { 1102 void visitChildren(ASTVisitor<Object> visitor) {
1021 safelyVisitChild(_leftOperand, visitor); 1103 safelyVisitChild(_leftOperand, visitor);
1022 safelyVisitChild(_rightOperand, visitor); 1104 safelyVisitChild(_rightOperand, visitor);
1023 } 1105 }
1024 } 1106 }
1025 /** 1107 /**
1026 * Instances of the class {@code Block} represent a sequence of statements. 1108 * Instances of the class {@code Block} represent a sequence of statements.
1027 * <pre> 1109 * <pre>
(...skipping 13 matching lines...) Expand all
1041 /** 1123 /**
1042 * The right curly bracket. 1124 * The right curly bracket.
1043 */ 1125 */
1044 Token _rightBracket; 1126 Token _rightBracket;
1045 /** 1127 /**
1046 * Initialize a newly created block of code. 1128 * Initialize a newly created block of code.
1047 * @param leftBracket the left curly bracket 1129 * @param leftBracket the left curly bracket
1048 * @param statements the statements contained in the block 1130 * @param statements the statements contained in the block
1049 * @param rightBracket the right curly bracket 1131 * @param rightBracket the right curly bracket
1050 */ 1132 */
1051 Block(Token leftBracket, List<Statement> statements, Token rightBracket) { 1133 Block.full(Token leftBracket, List<Statement> statements, Token rightBracket) {
1052 this._statements = new NodeList<Statement>(this); 1134 this._statements = new NodeList<Statement>(this);
1053 this._leftBracket = leftBracket; 1135 this._leftBracket = leftBracket;
1054 this._statements.addAll(statements); 1136 this._statements.addAll(statements);
1055 this._rightBracket = rightBracket; 1137 this._rightBracket = rightBracket;
1056 } 1138 }
1139 /**
1140 * Initialize a newly created block of code.
1141 * @param leftBracket the left curly bracket
1142 * @param statements the statements contained in the block
1143 * @param rightBracket the right curly bracket
1144 */
1145 Block({Token leftBracket, List<Statement> statements, Token rightBracket}) : t his.full(leftBracket, statements, rightBracket);
1057 accept(ASTVisitor visitor) => visitor.visitBlock(this); 1146 accept(ASTVisitor visitor) => visitor.visitBlock(this);
1058 Token get beginToken => _leftBracket; 1147 Token get beginToken => _leftBracket;
1059 Token get endToken => _rightBracket; 1148 Token get endToken => _rightBracket;
1060 /** 1149 /**
1061 * Return the left curly bracket. 1150 * Return the left curly bracket.
1062 * @return the left curly bracket 1151 * @return the left curly bracket
1063 */ 1152 */
1064 Token get leftBracket => _leftBracket; 1153 Token get leftBracket => _leftBracket;
1065 /** 1154 /**
1066 * Return the right curly bracket. 1155 * Return the right curly bracket.
1067 * @return the right curly bracket 1156 * @return the right curly bracket
1068 */ 1157 */
1069 Token get rightBracket => _rightBracket; 1158 Token get rightBracket => _rightBracket;
1070 /** 1159 /**
1071 * Return the statements contained in the block. 1160 * Return the statements contained in the block.
1072 * @return the statements contained in the block 1161 * @return the statements contained in the block
1073 */ 1162 */
1074 NodeList<Statement> get statements => _statements; 1163 NodeList<Statement> get statements => _statements;
1075 /** 1164 /**
1076 * Set the left curly bracket to the given token. 1165 * Set the left curly bracket to the given token.
1077 * @param leftBracket the left curly bracket 1166 * @param leftBracket the left curly bracket
1078 */ 1167 */
1079 void set leftBracket2(Token leftBracket) { 1168 void set leftBracket(Token leftBracket2) {
1080 this._leftBracket = leftBracket; 1169 this._leftBracket = leftBracket2;
1081 } 1170 }
1082 /** 1171 /**
1083 * Set the right curly bracket to the given token. 1172 * Set the right curly bracket to the given token.
1084 * @param rightBracket the right curly bracket 1173 * @param rightBracket the right curly bracket
1085 */ 1174 */
1086 void set rightBracket2(Token rightBracket) { 1175 void set rightBracket(Token rightBracket2) {
1087 this._rightBracket = rightBracket; 1176 this._rightBracket = rightBracket2;
1088 } 1177 }
1089 void visitChildren(ASTVisitor<Object> visitor) { 1178 void visitChildren(ASTVisitor<Object> visitor) {
1090 _statements.accept(visitor); 1179 _statements.accept(visitor);
1091 } 1180 }
1092 } 1181 }
1093 /** 1182 /**
1094 * Instances of the class {@code BlockFunctionBody} represent a function body th at consists of a 1183 * Instances of the class {@code BlockFunctionBody} represent a function body th at consists of a
1095 * block of statements. 1184 * block of statements.
1096 * <pre> 1185 * <pre>
1097 * blockFunctionBody ::={@link Block block}</pre> 1186 * blockFunctionBody ::={@link Block block}</pre>
1098 */ 1187 */
1099 class BlockFunctionBody extends FunctionBody { 1188 class BlockFunctionBody extends FunctionBody {
1100 /** 1189 /**
1101 * The block representing the body of the function. 1190 * The block representing the body of the function.
1102 */ 1191 */
1103 Block _block; 1192 Block _block;
1104 /** 1193 /**
1105 * Initialize a newly created function body consisting of a block of statement s. 1194 * Initialize a newly created function body consisting of a block of statement s.
1106 * @param block the block representing the body of the function 1195 * @param block the block representing the body of the function
1107 */ 1196 */
1108 BlockFunctionBody(Block block) { 1197 BlockFunctionBody.full(Block block) {
1109 this._block = becomeParentOf(block); 1198 this._block = becomeParentOf(block);
1110 } 1199 }
1200 /**
1201 * Initialize a newly created function body consisting of a block of statement s.
1202 * @param block the block representing the body of the function
1203 */
1204 BlockFunctionBody({Block block}) : this.full(block);
1111 accept(ASTVisitor visitor) => visitor.visitBlockFunctionBody(this); 1205 accept(ASTVisitor visitor) => visitor.visitBlockFunctionBody(this);
1112 Token get beginToken => _block.beginToken; 1206 Token get beginToken => _block.beginToken;
1113 /** 1207 /**
1114 * Return the block representing the body of the function. 1208 * Return the block representing the body of the function.
1115 * @return the block representing the body of the function 1209 * @return the block representing the body of the function
1116 */ 1210 */
1117 Block get block => _block; 1211 Block get block => _block;
1118 Token get endToken => _block.endToken; 1212 Token get endToken => _block.endToken;
1119 /** 1213 /**
1120 * Set the block representing the body of the function to the given block. 1214 * Set the block representing the body of the function to the given block.
1121 * @param block the block representing the body of the function 1215 * @param block the block representing the body of the function
1122 */ 1216 */
1123 void set block2(Block block) { 1217 void set block(Block block2) {
1124 this._block = becomeParentOf(block); 1218 this._block = becomeParentOf(block2);
1125 } 1219 }
1126 void visitChildren(ASTVisitor<Object> visitor) { 1220 void visitChildren(ASTVisitor<Object> visitor) {
1127 safelyVisitChild(_block, visitor); 1221 safelyVisitChild(_block, visitor);
1128 } 1222 }
1129 } 1223 }
1130 /** 1224 /**
1131 * Instances of the class {@code BooleanLiteral} represent a boolean literal exp ression. 1225 * Instances of the class {@code BooleanLiteral} represent a boolean literal exp ression.
1132 * <pre> 1226 * <pre>
1133 * booleanLiteral ::= 1227 * booleanLiteral ::=
1134 * 'false' | 'true' 1228 * 'false' | 'true'
1135 * </pre> 1229 * </pre>
1136 */ 1230 */
1137 class BooleanLiteral extends Literal { 1231 class BooleanLiteral extends Literal {
1138 /** 1232 /**
1139 * The token representing the literal. 1233 * The token representing the literal.
1140 */ 1234 */
1141 Token _literal; 1235 Token _literal;
1142 /** 1236 /**
1143 * The value of the literal. 1237 * The value of the literal.
1144 */ 1238 */
1145 bool _value = false; 1239 bool _value = false;
1146 /** 1240 /**
1147 * Initialize a newly created boolean literal. 1241 * Initialize a newly created boolean literal.
1148 * @param literal the token representing the literal 1242 * @param literal the token representing the literal
1149 * @param value the value of the literal 1243 * @param value the value of the literal
1150 */ 1244 */
1151 BooleanLiteral(Token literal, bool value) { 1245 BooleanLiteral.full(Token literal, bool value) {
1152 this._literal = literal; 1246 this._literal = literal;
1153 this._value = value; 1247 this._value = value;
1154 } 1248 }
1249 /**
1250 * Initialize a newly created boolean literal.
1251 * @param literal the token representing the literal
1252 * @param value the value of the literal
1253 */
1254 BooleanLiteral({Token literal, bool value}) : this.full(literal, value);
1155 accept(ASTVisitor visitor) => visitor.visitBooleanLiteral(this); 1255 accept(ASTVisitor visitor) => visitor.visitBooleanLiteral(this);
1156 Token get beginToken => _literal; 1256 Token get beginToken => _literal;
1157 Token get endToken => _literal; 1257 Token get endToken => _literal;
1158 /** 1258 /**
1159 * Return the token representing the literal. 1259 * Return the token representing the literal.
1160 * @return the token representing the literal 1260 * @return the token representing the literal
1161 */ 1261 */
1162 Token get literal => _literal; 1262 Token get literal => _literal;
1163 /** 1263 /**
1164 * Return the value of the literal. 1264 * Return the value of the literal.
1165 * @return the value of the literal 1265 * @return the value of the literal
1166 */ 1266 */
1167 bool get value => _value; 1267 bool get value => _value;
1168 bool isSynthetic() => _literal.isSynthetic(); 1268 bool isSynthetic() => _literal.isSynthetic();
1169 /** 1269 /**
1170 * Set the token representing the literal to the given token. 1270 * Set the token representing the literal to the given token.
1171 * @param literal the token representing the literal 1271 * @param literal the token representing the literal
1172 */ 1272 */
1173 void set literal2(Token literal) { 1273 void set literal(Token literal2) {
1174 this._literal = literal; 1274 this._literal = literal2;
1175 } 1275 }
1176 /** 1276 /**
1177 * Set the value of the literal to the given value. 1277 * Set the value of the literal to the given value.
1178 * @param value the value of the literal 1278 * @param value the value of the literal
1179 */ 1279 */
1180 void set value4(bool value) { 1280 void set value(bool value4) {
1181 this._value = value; 1281 this._value = value4;
1182 } 1282 }
1183 void visitChildren(ASTVisitor<Object> visitor) { 1283 void visitChildren(ASTVisitor<Object> visitor) {
1184 } 1284 }
1185 } 1285 }
1186 /** 1286 /**
1187 * Instances of the class {@code BreakStatement} represent a break statement. 1287 * Instances of the class {@code BreakStatement} represent a break statement.
1188 * <pre> 1288 * <pre>
1189 * breakStatement ::= 1289 * breakStatement ::=
1190 * 'break' {@link SimpleIdentifier label}? ';' 1290 * 'break' {@link SimpleIdentifier label}? ';'
1191 * </pre> 1291 * </pre>
(...skipping 10 matching lines...) Expand all
1202 /** 1302 /**
1203 * The semicolon terminating the statement. 1303 * The semicolon terminating the statement.
1204 */ 1304 */
1205 Token _semicolon; 1305 Token _semicolon;
1206 /** 1306 /**
1207 * Initialize a newly created break statement. 1307 * Initialize a newly created break statement.
1208 * @param keyword the token representing the 'break' keyword 1308 * @param keyword the token representing the 'break' keyword
1209 * @param label the label associated with the statement 1309 * @param label the label associated with the statement
1210 * @param semicolon the semicolon terminating the statement 1310 * @param semicolon the semicolon terminating the statement
1211 */ 1311 */
1212 BreakStatement(Token keyword, SimpleIdentifier label, Token semicolon) { 1312 BreakStatement.full(Token keyword, SimpleIdentifier label, Token semicolon) {
1213 this._keyword = keyword; 1313 this._keyword = keyword;
1214 this._label = becomeParentOf(label); 1314 this._label = becomeParentOf(label);
1215 this._semicolon = semicolon; 1315 this._semicolon = semicolon;
1216 } 1316 }
1317 /**
1318 * Initialize a newly created break statement.
1319 * @param keyword the token representing the 'break' keyword
1320 * @param label the label associated with the statement
1321 * @param semicolon the semicolon terminating the statement
1322 */
1323 BreakStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : thi s.full(keyword, label, semicolon);
1217 accept(ASTVisitor visitor) => visitor.visitBreakStatement(this); 1324 accept(ASTVisitor visitor) => visitor.visitBreakStatement(this);
1218 Token get beginToken => _keyword; 1325 Token get beginToken => _keyword;
1219 Token get endToken => _semicolon; 1326 Token get endToken => _semicolon;
1220 /** 1327 /**
1221 * Return the token representing the 'break' keyword. 1328 * Return the token representing the 'break' keyword.
1222 * @return the token representing the 'break' keyword 1329 * @return the token representing the 'break' keyword
1223 */ 1330 */
1224 Token get keyword => _keyword; 1331 Token get keyword => _keyword;
1225 /** 1332 /**
1226 * Return the label associated with the statement, or {@code null} if there is no label. 1333 * Return the label associated with the statement, or {@code null} if there is no label.
1227 * @return the label associated with the statement 1334 * @return the label associated with the statement
1228 */ 1335 */
1229 SimpleIdentifier get label => _label; 1336 SimpleIdentifier get label => _label;
1230 /** 1337 /**
1231 * Return the semicolon terminating the statement. 1338 * Return the semicolon terminating the statement.
1232 * @return the semicolon terminating the statement 1339 * @return the semicolon terminating the statement
1233 */ 1340 */
1234 Token get semicolon => _semicolon; 1341 Token get semicolon => _semicolon;
1235 /** 1342 /**
1236 * Set the token representing the 'break' keyword to the given token. 1343 * Set the token representing the 'break' keyword to the given token.
1237 * @param keyword the token representing the 'break' keyword 1344 * @param keyword the token representing the 'break' keyword
1238 */ 1345 */
1239 void set keyword4(Token keyword) { 1346 void set keyword(Token keyword4) {
1240 this._keyword = keyword; 1347 this._keyword = keyword4;
1241 } 1348 }
1242 /** 1349 /**
1243 * Set the label associated with the statement to the given identifier. 1350 * Set the label associated with the statement to the given identifier.
1244 * @param identifier the label associated with the statement 1351 * @param identifier the label associated with the statement
1245 */ 1352 */
1246 void set label2(SimpleIdentifier identifier) { 1353 void set label(SimpleIdentifier identifier) {
1247 _label = becomeParentOf(identifier); 1354 _label = becomeParentOf(identifier);
1248 } 1355 }
1249 /** 1356 /**
1250 * Set the semicolon terminating the statement to the given token. 1357 * Set the semicolon terminating the statement to the given token.
1251 * @param semicolon the semicolon terminating the statement 1358 * @param semicolon the semicolon terminating the statement
1252 */ 1359 */
1253 void set semicolon3(Token semicolon) { 1360 void set semicolon(Token semicolon3) {
1254 this._semicolon = semicolon; 1361 this._semicolon = semicolon3;
1255 } 1362 }
1256 void visitChildren(ASTVisitor<Object> visitor) { 1363 void visitChildren(ASTVisitor<Object> visitor) {
1257 safelyVisitChild(_label, visitor); 1364 safelyVisitChild(_label, visitor);
1258 } 1365 }
1259 } 1366 }
1260 /** 1367 /**
1261 * Instances of the class {@code CascadeExpression} represent a sequence of casc aded expressions: 1368 * Instances of the class {@code CascadeExpression} represent a sequence of casc aded expressions:
1262 * expressions that share a common target. There are three kinds of expressions that can be used in 1369 * expressions that share a common target. There are three kinds of expressions that can be used in
1263 * a cascade expression: {@link IndexExpression}, {@link MethodInvocation} and{@ link PropertyAccess}. 1370 * a cascade expression: {@link IndexExpression}, {@link MethodInvocation} and{@ link PropertyAccess}.
1264 * <pre> 1371 * <pre>
(...skipping 12 matching lines...) Expand all
1277 Expression _target; 1384 Expression _target;
1278 /** 1385 /**
1279 * The cascade sections sharing the common target. 1386 * The cascade sections sharing the common target.
1280 */ 1387 */
1281 NodeList<Expression> _cascadeSections; 1388 NodeList<Expression> _cascadeSections;
1282 /** 1389 /**
1283 * Initialize a newly created cascade expression. 1390 * Initialize a newly created cascade expression.
1284 * @param target the target of the cascade sections 1391 * @param target the target of the cascade sections
1285 * @param cascadeSections the cascade sections sharing the common target 1392 * @param cascadeSections the cascade sections sharing the common target
1286 */ 1393 */
1287 CascadeExpression(Expression target, List<Expression> cascadeSections) { 1394 CascadeExpression.full(Expression target, List<Expression> cascadeSections) {
1288 this._cascadeSections = new NodeList<Expression>(this); 1395 this._cascadeSections = new NodeList<Expression>(this);
1289 this._target = becomeParentOf(target); 1396 this._target = becomeParentOf(target);
1290 this._cascadeSections.addAll(cascadeSections); 1397 this._cascadeSections.addAll(cascadeSections);
1291 } 1398 }
1399 /**
1400 * Initialize a newly created cascade expression.
1401 * @param target the target of the cascade sections
1402 * @param cascadeSections the cascade sections sharing the common target
1403 */
1404 CascadeExpression({Expression target, List<Expression> cascadeSections}) : thi s.full(target, cascadeSections);
1292 accept(ASTVisitor visitor) => visitor.visitCascadeExpression(this); 1405 accept(ASTVisitor visitor) => visitor.visitCascadeExpression(this);
1293 Token get beginToken => _target.beginToken; 1406 Token get beginToken => _target.beginToken;
1294 /** 1407 /**
1295 * Return the cascade sections sharing the common target. 1408 * Return the cascade sections sharing the common target.
1296 * @return the cascade sections sharing the common target 1409 * @return the cascade sections sharing the common target
1297 */ 1410 */
1298 NodeList<Expression> get cascadeSections => _cascadeSections; 1411 NodeList<Expression> get cascadeSections => _cascadeSections;
1299 Token get endToken => _cascadeSections.endToken; 1412 Token get endToken => _cascadeSections.endToken;
1300 /** 1413 /**
1301 * Return the target of the cascade sections. 1414 * Return the target of the cascade sections.
1302 * @return the target of the cascade sections 1415 * @return the target of the cascade sections
1303 */ 1416 */
1304 Expression get target => _target; 1417 Expression get target => _target;
1305 /** 1418 /**
1306 * Set the target of the cascade sections to the given expression. 1419 * Set the target of the cascade sections to the given expression.
1307 * @param target the target of the cascade sections 1420 * @param target the target of the cascade sections
1308 */ 1421 */
1309 void set target2(Expression target) { 1422 void set target(Expression target2) {
1310 this._target = becomeParentOf(target); 1423 this._target = becomeParentOf(target2);
1311 } 1424 }
1312 void visitChildren(ASTVisitor<Object> visitor) { 1425 void visitChildren(ASTVisitor<Object> visitor) {
1313 safelyVisitChild(_target, visitor); 1426 safelyVisitChild(_target, visitor);
1314 _cascadeSections.accept(visitor); 1427 _cascadeSections.accept(visitor);
1315 } 1428 }
1316 } 1429 }
1317 /** 1430 /**
1318 * Instances of the class {@code CatchClause} represent a catch clause within a try statement. 1431 * Instances of the class {@code CatchClause} represent a catch clause within a try statement.
1319 * <pre> 1432 * <pre>
1320 * onPart ::= 1433 * onPart ::=
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 * @param onKeyword the token representing the 'on' keyword 1478 * @param onKeyword the token representing the 'on' keyword
1366 * @param exceptionType the type of exceptions caught by this catch clause 1479 * @param exceptionType the type of exceptions caught by this catch clause
1367 * @param leftParenthesis the left parenthesis 1480 * @param leftParenthesis the left parenthesis
1368 * @param exceptionParameter the parameter whose value will be the exception t hat was thrown 1481 * @param exceptionParameter the parameter whose value will be the exception t hat was thrown
1369 * @param comma the comma separating the exception parameter from the stack tr ace parameter 1482 * @param comma the comma separating the exception parameter from the stack tr ace parameter
1370 * @param stackTraceParameter the parameter whose value will be the stack trac e associated with 1483 * @param stackTraceParameter the parameter whose value will be the stack trac e associated with
1371 * the exception 1484 * the exception
1372 * @param rightParenthesis the right parenthesis 1485 * @param rightParenthesis the right parenthesis
1373 * @param body the body of the catch block 1486 * @param body the body of the catch block
1374 */ 1487 */
1375 CatchClause(Token onKeyword, TypeName exceptionType, Token catchKeyword, Token leftParenthesis, SimpleIdentifier exceptionParameter, Token comma, SimpleIdenti fier stackTraceParameter, Token rightParenthesis, Block body) { 1488 CatchClause.full(Token onKeyword, TypeName exceptionType, Token catchKeyword, Token leftParenthesis, SimpleIdentifier exceptionParameter, Token comma, SimpleI dentifier stackTraceParameter, Token rightParenthesis, Block body) {
1376 this._onKeyword = onKeyword; 1489 this._onKeyword = onKeyword;
1377 this._exceptionType = becomeParentOf(exceptionType); 1490 this._exceptionType = becomeParentOf(exceptionType);
1378 this._catchKeyword = catchKeyword; 1491 this._catchKeyword = catchKeyword;
1379 this._leftParenthesis = leftParenthesis; 1492 this._leftParenthesis = leftParenthesis;
1380 this._exceptionParameter = becomeParentOf(exceptionParameter); 1493 this._exceptionParameter = becomeParentOf(exceptionParameter);
1381 this._comma = comma; 1494 this._comma = comma;
1382 this._stackTraceParameter = becomeParentOf(stackTraceParameter); 1495 this._stackTraceParameter = becomeParentOf(stackTraceParameter);
1383 this._rightParenthesis = rightParenthesis; 1496 this._rightParenthesis = rightParenthesis;
1384 this._body = becomeParentOf(body); 1497 this._body = becomeParentOf(body);
1385 } 1498 }
1499 /**
1500 * Initialize a newly created catch clause.
1501 * @param onKeyword the token representing the 'on' keyword
1502 * @param exceptionType the type of exceptions caught by this catch clause
1503 * @param leftParenthesis the left parenthesis
1504 * @param exceptionParameter the parameter whose value will be the exception t hat was thrown
1505 * @param comma the comma separating the exception parameter from the stack tr ace parameter
1506 * @param stackTraceParameter the parameter whose value will be the stack trac e associated with
1507 * the exception
1508 * @param rightParenthesis the right parenthesis
1509 * @param body the body of the catch block
1510 */
1511 CatchClause({Token onKeyword, TypeName exceptionType, Token catchKeyword, Toke n leftParenthesis, SimpleIdentifier exceptionParameter, Token comma, SimpleIdent ifier stackTraceParameter, Token rightParenthesis, Block body}) : this.full(onKe yword, exceptionType, catchKeyword, leftParenthesis, exceptionParameter, comma, stackTraceParameter, rightParenthesis, body);
1386 accept(ASTVisitor visitor) => visitor.visitCatchClause(this); 1512 accept(ASTVisitor visitor) => visitor.visitCatchClause(this);
1387 Token get beginToken { 1513 Token get beginToken {
1388 if (_onKeyword != null) { 1514 if (_onKeyword != null) {
1389 return _onKeyword; 1515 return _onKeyword;
1390 } 1516 }
1391 return _catchKeyword; 1517 return _catchKeyword;
1392 } 1518 }
1393 /** 1519 /**
1394 * Return the body of the catch block. 1520 * Return the body of the catch block.
1395 * @return the body of the catch block 1521 * @return the body of the catch block
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 Token get rightParenthesis => _rightParenthesis; 1561 Token get rightParenthesis => _rightParenthesis;
1436 /** 1562 /**
1437 * Return the parameter whose value will be the stack trace associated with th e exception. 1563 * Return the parameter whose value will be the stack trace associated with th e exception.
1438 * @return the parameter whose value will be the stack trace associated with t he exception 1564 * @return the parameter whose value will be the stack trace associated with t he exception
1439 */ 1565 */
1440 SimpleIdentifier get stackTraceParameter => _stackTraceParameter; 1566 SimpleIdentifier get stackTraceParameter => _stackTraceParameter;
1441 /** 1567 /**
1442 * Set the body of the catch block to the given block. 1568 * Set the body of the catch block to the given block.
1443 * @param block the body of the catch block 1569 * @param block the body of the catch block
1444 */ 1570 */
1445 void set body2(Block block) { 1571 void set body(Block block) {
1446 _body = becomeParentOf(block); 1572 _body = becomeParentOf(block);
1447 } 1573 }
1448 /** 1574 /**
1449 * Set the token representing the 'catch' keyword to the given token. 1575 * Set the token representing the 'catch' keyword to the given token.
1450 * @param catchKeyword the token representing the 'catch' keyword 1576 * @param catchKeyword the token representing the 'catch' keyword
1451 */ 1577 */
1452 void set catchKeyword2(Token catchKeyword) { 1578 void set catchKeyword(Token catchKeyword2) {
1453 this._catchKeyword = catchKeyword; 1579 this._catchKeyword = catchKeyword2;
1454 } 1580 }
1455 /** 1581 /**
1456 * Set the comma to the given token. 1582 * Set the comma to the given token.
1457 * @param comma the comma 1583 * @param comma the comma
1458 */ 1584 */
1459 void set comma2(Token comma) { 1585 void set comma(Token comma2) {
1460 this._comma = comma; 1586 this._comma = comma2;
1461 } 1587 }
1462 /** 1588 /**
1463 * Set the parameter whose value will be the exception that was thrown to the given parameter. 1589 * Set the parameter whose value will be the exception that was thrown to the given parameter.
1464 * @param parameter the parameter whose value will be the exception that was t hrown 1590 * @param parameter the parameter whose value will be the exception that was t hrown
1465 */ 1591 */
1466 void set exceptionParameter2(SimpleIdentifier parameter) { 1592 void set exceptionParameter(SimpleIdentifier parameter) {
1467 _exceptionParameter = becomeParentOf(parameter); 1593 _exceptionParameter = becomeParentOf(parameter);
1468 } 1594 }
1469 /** 1595 /**
1470 * Set the type of exceptions caught by this catch clause to the given type. 1596 * Set the type of exceptions caught by this catch clause to the given type.
1471 * @param exceptionType the type of exceptions caught by this catch clause 1597 * @param exceptionType the type of exceptions caught by this catch clause
1472 */ 1598 */
1473 void set exceptionType2(TypeName exceptionType) { 1599 void set exceptionType(TypeName exceptionType2) {
1474 this._exceptionType = exceptionType; 1600 this._exceptionType = exceptionType2;
1475 } 1601 }
1476 /** 1602 /**
1477 * Set the left parenthesis to the given token. 1603 * Set the left parenthesis to the given token.
1478 * @param parenthesis the left parenthesis 1604 * @param parenthesis the left parenthesis
1479 */ 1605 */
1480 void set leftParenthesis4(Token parenthesis) { 1606 void set leftParenthesis(Token parenthesis) {
1481 _leftParenthesis = parenthesis; 1607 _leftParenthesis = parenthesis;
1482 } 1608 }
1483 /** 1609 /**
1484 * Set the token representing the 'on' keyword to the given keyword. 1610 * Set the token representing the 'on' keyword to the given keyword.
1485 * @param onKeyword the token representing the 'on' keyword 1611 * @param onKeyword the token representing the 'on' keyword
1486 */ 1612 */
1487 void set onKeyword2(Token onKeyword) { 1613 void set onKeyword(Token onKeyword2) {
1488 this._onKeyword = onKeyword; 1614 this._onKeyword = onKeyword2;
1489 } 1615 }
1490 /** 1616 /**
1491 * Set the right parenthesis to the given token. 1617 * Set the right parenthesis to the given token.
1492 * @param parenthesis the right parenthesis 1618 * @param parenthesis the right parenthesis
1493 */ 1619 */
1494 void set rightParenthesis4(Token parenthesis) { 1620 void set rightParenthesis(Token parenthesis) {
1495 _rightParenthesis = parenthesis; 1621 _rightParenthesis = parenthesis;
1496 } 1622 }
1497 /** 1623 /**
1498 * Set the parameter whose value will be the stack trace associated with the e xception to the 1624 * Set the parameter whose value will be the stack trace associated with the e xception to the
1499 * given parameter. 1625 * given parameter.
1500 * @param parameter the parameter whose value will be the stack trace associat ed with the 1626 * @param parameter the parameter whose value will be the stack trace associat ed with the
1501 * exception 1627 * exception
1502 */ 1628 */
1503 void set stackTraceParameter2(SimpleIdentifier parameter) { 1629 void set stackTraceParameter(SimpleIdentifier parameter) {
1504 _stackTraceParameter = becomeParentOf(parameter); 1630 _stackTraceParameter = becomeParentOf(parameter);
1505 } 1631 }
1506 void visitChildren(ASTVisitor<Object> visitor) { 1632 void visitChildren(ASTVisitor<Object> visitor) {
1507 safelyVisitChild(_exceptionType, visitor); 1633 safelyVisitChild(_exceptionType, visitor);
1508 safelyVisitChild(_exceptionParameter, visitor); 1634 safelyVisitChild(_exceptionParameter, visitor);
1509 safelyVisitChild(_stackTraceParameter, visitor); 1635 safelyVisitChild(_stackTraceParameter, visitor);
1510 safelyVisitChild(_body, visitor); 1636 safelyVisitChild(_body, visitor);
1511 } 1637 }
1512 } 1638 }
1513 /** 1639 /**
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 * @param classKeyword the token representing the 'class' keyword 1696 * @param classKeyword the token representing the 'class' keyword
1571 * @param name the name of the class being declared 1697 * @param name the name of the class being declared
1572 * @param typeParameters the type parameters for the class 1698 * @param typeParameters the type parameters for the class
1573 * @param extendsClause the extends clause for the class 1699 * @param extendsClause the extends clause for the class
1574 * @param withClause the with clause for the class 1700 * @param withClause the with clause for the class
1575 * @param implementsClause the implements clause for the class 1701 * @param implementsClause the implements clause for the class
1576 * @param leftBracket the left curly bracket 1702 * @param leftBracket the left curly bracket
1577 * @param members the members defined by the class 1703 * @param members the members defined by the class
1578 * @param rightBracket the right curly bracket 1704 * @param rightBracket the right curly bracket
1579 */ 1705 */
1580 ClassDeclaration(Comment comment, List<Annotation> metadata, Token abstractKey word, Token classKeyword, SimpleIdentifier name, TypeParameterList typeParameter s, ExtendsClause extendsClause, WithClause withClause, ImplementsClause implemen tsClause, Token leftBracket, List<ClassMember> members, Token rightBracket) : su per(comment, metadata) { 1706 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) {
1581 this._members = new NodeList<ClassMember>(this); 1707 this._members = new NodeList<ClassMember>(this);
1582 this._abstractKeyword = abstractKeyword; 1708 this._abstractKeyword = abstractKeyword;
1583 this._classKeyword = classKeyword; 1709 this._classKeyword = classKeyword;
1584 this._name = becomeParentOf(name); 1710 this._name = becomeParentOf(name);
1585 this._typeParameters = becomeParentOf(typeParameters); 1711 this._typeParameters = becomeParentOf(typeParameters);
1586 this._extendsClause = becomeParentOf(extendsClause); 1712 this._extendsClause = becomeParentOf(extendsClause);
1587 this._withClause = becomeParentOf(withClause); 1713 this._withClause = becomeParentOf(withClause);
1588 this._implementsClause = becomeParentOf(implementsClause); 1714 this._implementsClause = becomeParentOf(implementsClause);
1589 this._leftBracket = leftBracket; 1715 this._leftBracket = leftBracket;
1590 this._members.addAll(members); 1716 this._members.addAll(members);
1591 this._rightBracket = rightBracket; 1717 this._rightBracket = rightBracket;
1592 } 1718 }
1719 /**
1720 * Initialize a newly created class declaration.
1721 * @param comment the documentation comment associated with this class
1722 * @param metadata the annotations associated with this class
1723 * @param abstractKeyword the 'abstract' keyword, or {@code null} if the keywo rd was absent
1724 * @param classKeyword the token representing the 'class' keyword
1725 * @param name the name of the class being declared
1726 * @param typeParameters the type parameters for the class
1727 * @param extendsClause the extends clause for the class
1728 * @param withClause the with clause for the class
1729 * @param implementsClause the implements clause for the class
1730 * @param leftBracket the left curly bracket
1731 * @param members the members defined by the class
1732 * @param rightBracket the right curly bracket
1733 */
1734 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);
1593 accept(ASTVisitor visitor) => visitor.visitClassDeclaration(this); 1735 accept(ASTVisitor visitor) => visitor.visitClassDeclaration(this);
1594 /** 1736 /**
1595 * Return the 'abstract' keyword, or {@code null} if the keyword was absent. 1737 * Return the 'abstract' keyword, or {@code null} if the keyword was absent.
1596 * @return the 'abstract' keyword 1738 * @return the 'abstract' keyword
1597 */ 1739 */
1598 Token get abstractKeyword => _abstractKeyword; 1740 Token get abstractKeyword => _abstractKeyword;
1599 /** 1741 /**
1600 * Return the token representing the 'class' keyword. 1742 * Return the token representing the 'class' keyword.
1601 * @return the token representing the 'class' keyword 1743 * @return the token representing the 'class' keyword
1602 */ 1744 */
1603 Token get classKeyword => _classKeyword; 1745 Token get classKeyword => _classKeyword;
1604 /** 1746 /**
1605 * @return the {@link ClassElement} associated with this identifier, or {@code null} if the AST 1747 * @return the {@link ClassElement} associated with this identifier, or {@code null} if the AST
1606 * structure has not been resolved or if this identifier could not be resolved . 1748 * structure has not been resolved or if this identifier could not be resolved .
1607 */ 1749 */
1608 ClassElement get element => _name != null ? _name.element as ClassElement : nu ll; 1750 ClassElement get element => _name != null ? (_name.element as ClassElement) : null;
1609 Token get endToken => _rightBracket; 1751 Token get endToken => _rightBracket;
1610 /** 1752 /**
1611 * Return the extends clause for this class, or {@code null} if the class does not extend any 1753 * Return the extends clause for this class, or {@code null} if the class does not extend any
1612 * other class. 1754 * other class.
1613 * @return the extends clause for this class 1755 * @return the extends clause for this class
1614 */ 1756 */
1615 ExtendsClause get extendsClause => _extendsClause; 1757 ExtendsClause get extendsClause => _extendsClause;
1616 /** 1758 /**
1617 * Return the implements clause for the class, or {@code null} if the class do es not implement any 1759 * Return the implements clause for the class, or {@code null} if the class do es not implement any
1618 * interfaces. 1760 * interfaces.
(...skipping 28 matching lines...) Expand all
1647 TypeParameterList get typeParameters => _typeParameters; 1789 TypeParameterList get typeParameters => _typeParameters;
1648 /** 1790 /**
1649 * Return the with clause for the class, or {@code null} if the class does not have a with clause. 1791 * Return the with clause for the class, or {@code null} if the class does not have a with clause.
1650 * @return the with clause for the class 1792 * @return the with clause for the class
1651 */ 1793 */
1652 WithClause get withClause => _withClause; 1794 WithClause get withClause => _withClause;
1653 /** 1795 /**
1654 * Set the 'abstract' keyword to the given keyword. 1796 * Set the 'abstract' keyword to the given keyword.
1655 * @param abstractKeyword the 'abstract' keyword 1797 * @param abstractKeyword the 'abstract' keyword
1656 */ 1798 */
1657 void set abstractKeyword2(Token abstractKeyword) { 1799 void set abstractKeyword(Token abstractKeyword2) {
1658 this._abstractKeyword = abstractKeyword; 1800 this._abstractKeyword = abstractKeyword2;
1659 } 1801 }
1660 /** 1802 /**
1661 * Set the token representing the 'class' keyword to the given token. 1803 * Set the token representing the 'class' keyword to the given token.
1662 * @param classKeyword the token representing the 'class' keyword 1804 * @param classKeyword the token representing the 'class' keyword
1663 */ 1805 */
1664 void set classKeyword2(Token classKeyword) { 1806 void set classKeyword(Token classKeyword2) {
1665 this._classKeyword = classKeyword; 1807 this._classKeyword = classKeyword2;
1666 } 1808 }
1667 /** 1809 /**
1668 * Set the extends clause for this class to the given clause. 1810 * Set the extends clause for this class to the given clause.
1669 * @param extendsClause the extends clause for this class 1811 * @param extendsClause the extends clause for this class
1670 */ 1812 */
1671 void set extendsClause2(ExtendsClause extendsClause) { 1813 void set extendsClause(ExtendsClause extendsClause3) {
1672 this._extendsClause = becomeParentOf(extendsClause); 1814 this._extendsClause = becomeParentOf(extendsClause3);
1673 } 1815 }
1674 /** 1816 /**
1675 * Set the implements clause for the class to the given clause. 1817 * Set the implements clause for the class to the given clause.
1676 * @param implementsClause the implements clause for the class 1818 * @param implementsClause the implements clause for the class
1677 */ 1819 */
1678 void set implementsClause2(ImplementsClause implementsClause) { 1820 void set implementsClause(ImplementsClause implementsClause4) {
1679 this._implementsClause = becomeParentOf(implementsClause); 1821 this._implementsClause = becomeParentOf(implementsClause4);
1680 } 1822 }
1681 /** 1823 /**
1682 * Set the left curly bracket to the given token. 1824 * Set the left curly bracket to the given token.
1683 * @param leftBracket the left curly bracket 1825 * @param leftBracket the left curly bracket
1684 */ 1826 */
1685 void set leftBracket3(Token leftBracket) { 1827 void set leftBracket(Token leftBracket3) {
1686 this._leftBracket = leftBracket; 1828 this._leftBracket = leftBracket3;
1687 } 1829 }
1688 /** 1830 /**
1689 * Set the name of the class being declared to the given identifier. 1831 * Set the name of the class being declared to the given identifier.
1690 * @param identifier the name of the class being declared 1832 * @param identifier the name of the class being declared
1691 */ 1833 */
1692 void set name3(SimpleIdentifier identifier) { 1834 void set name(SimpleIdentifier identifier) {
1693 _name = becomeParentOf(identifier); 1835 _name = becomeParentOf(identifier);
1694 } 1836 }
1695 /** 1837 /**
1696 * Set the right curly bracket to the given token. 1838 * Set the right curly bracket to the given token.
1697 * @param rightBracket the right curly bracket 1839 * @param rightBracket the right curly bracket
1698 */ 1840 */
1699 void set rightBracket3(Token rightBracket) { 1841 void set rightBracket(Token rightBracket3) {
1700 this._rightBracket = rightBracket; 1842 this._rightBracket = rightBracket3;
1701 } 1843 }
1702 /** 1844 /**
1703 * Set the type parameters for the class to the given list of type parameters. 1845 * Set the type parameters for the class to the given list of type parameters.
1704 * @param typeParameters the type parameters for the class 1846 * @param typeParameters the type parameters for the class
1705 */ 1847 */
1706 void set typeParameters2(TypeParameterList typeParameters) { 1848 void set typeParameters(TypeParameterList typeParameters2) {
1707 this._typeParameters = typeParameters; 1849 this._typeParameters = typeParameters2;
1708 } 1850 }
1709 /** 1851 /**
1710 * Set the with clause for the class to the given clause. 1852 * Set the with clause for the class to the given clause.
1711 * @param withClause the with clause for the class 1853 * @param withClause the with clause for the class
1712 */ 1854 */
1713 void set withClause2(WithClause withClause) { 1855 void set withClause(WithClause withClause4) {
1714 this._withClause = becomeParentOf(withClause); 1856 this._withClause = becomeParentOf(withClause4);
1715 } 1857 }
1716 void visitChildren(ASTVisitor<Object> visitor) { 1858 void visitChildren(ASTVisitor<Object> visitor) {
1717 safelyVisitChild(documentationComment, visitor); 1859 safelyVisitChild(documentationComment, visitor);
1718 safelyVisitChild(_name, visitor); 1860 safelyVisitChild(_name, visitor);
1719 safelyVisitChild(_typeParameters, visitor); 1861 safelyVisitChild(_typeParameters, visitor);
1720 safelyVisitChild(_extendsClause, visitor); 1862 safelyVisitChild(_extendsClause, visitor);
1721 safelyVisitChild(_withClause, visitor); 1863 safelyVisitChild(_withClause, visitor);
1722 safelyVisitChild(_implementsClause, visitor); 1864 safelyVisitChild(_implementsClause, visitor);
1723 members.accept(visitor); 1865 members.accept(visitor);
1724 } 1866 }
1725 Token get firstTokenAfterCommentAndMetadata { 1867 Token get firstTokenAfterCommentAndMetadata {
1726 if (_abstractKeyword != null) { 1868 if (_abstractKeyword != null) {
1727 return _abstractKeyword; 1869 return _abstractKeyword;
1728 } 1870 }
1729 return _classKeyword; 1871 return _classKeyword;
1730 } 1872 }
1731 } 1873 }
1732 /** 1874 /**
1733 * The abstract class {@code ClassMember} defines the behavior common to nodes t hat declare a name 1875 * The abstract class {@code ClassMember} defines the behavior common to nodes t hat declare a name
1734 * within the scope of a class. 1876 * within the scope of a class.
1735 */ 1877 */
1736 abstract class ClassMember extends Declaration { 1878 abstract class ClassMember extends Declaration {
1737 /** 1879 /**
1738 * Initialize a newly created member of a class. 1880 * Initialize a newly created member of a class.
1739 * @param comment the documentation comment associated with this member 1881 * @param comment the documentation comment associated with this member
1740 * @param metadata the annotations associated with this member 1882 * @param metadata the annotations associated with this member
1741 */ 1883 */
1742 ClassMember(Comment comment, List<Annotation> metadata) : super(comment, metad ata) { 1884 ClassMember.full(Comment comment, List<Annotation> metadata) : super.full(comm ent, metadata) {
1743 } 1885 }
1886 /**
1887 * Initialize a newly created member of a class.
1888 * @param comment the documentation comment associated with this member
1889 * @param metadata the annotations associated with this member
1890 */
1891 ClassMember({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata);
1744 } 1892 }
1745 /** 1893 /**
1746 * Instances of the class {@code ClassTypeAlias} represent a class type alias. 1894 * Instances of the class {@code ClassTypeAlias} represent a class type alias.
1747 * <pre> 1895 * <pre>
1748 * classTypeAlias ::={@link SimpleIdentifier identifier} {@link TypeParameterLis t typeParameters}? '=' 'abstract'? mixinApplication 1896 * classTypeAlias ::={@link SimpleIdentifier identifier} {@link TypeParameterLis t typeParameters}? '=' 'abstract'? mixinApplication
1749 * mixinApplication ::={@link TypeName superclass} {@link WithClause withClause} {@link ImplementsClause implementsClause}? ';' 1897 * mixinApplication ::={@link TypeName superclass} {@link WithClause withClause} {@link ImplementsClause implementsClause}? ';'
1750 * </pre> 1898 * </pre>
1751 */ 1899 */
1752 class ClassTypeAlias extends TypeAlias { 1900 class ClassTypeAlias extends TypeAlias {
1753 /** 1901 /**
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1787 * @param keyword the token representing the 'typedef' keyword 1935 * @param keyword the token representing the 'typedef' keyword
1788 * @param name the name of the class being declared 1936 * @param name the name of the class being declared
1789 * @param typeParameters the type parameters for the class 1937 * @param typeParameters the type parameters for the class
1790 * @param equals the token for the '=' separating the name from the definition 1938 * @param equals the token for the '=' separating the name from the definition
1791 * @param abstractKeyword the token for the 'abstract' keyword 1939 * @param abstractKeyword the token for the 'abstract' keyword
1792 * @param superclass the name of the superclass of the class being declared 1940 * @param superclass the name of the superclass of the class being declared
1793 * @param withClause the with clause for this class 1941 * @param withClause the with clause for this class
1794 * @param implementsClause the implements clause for this class 1942 * @param implementsClause the implements clause for this class
1795 * @param semicolon the semicolon terminating the declaration 1943 * @param semicolon the semicolon terminating the declaration
1796 */ 1944 */
1797 ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, Simp leIdentifier name, TypeParameterList typeParameters, Token equals, Token abstrac tKeyword, TypeName superclass, WithClause withClause, ImplementsClause implement sClause, Token semicolon) : super(comment, metadata, keyword, semicolon) { 1945 ClassTypeAlias.full(Comment comment, List<Annotation> metadata, Token keyword, SimpleIdentifier name, TypeParameterList typeParameters, Token equals, Token ab stractKeyword, TypeName superclass, WithClause withClause, ImplementsClause impl ementsClause, Token semicolon) : super.full(comment, metadata, keyword, semicolo n) {
1798 this._name = becomeParentOf(name); 1946 this._name = becomeParentOf(name);
1799 this._typeParameters = becomeParentOf(typeParameters); 1947 this._typeParameters = becomeParentOf(typeParameters);
1800 this._equals = equals; 1948 this._equals = equals;
1801 this._abstractKeyword = abstractKeyword; 1949 this._abstractKeyword = abstractKeyword;
1802 this._superclass = becomeParentOf(superclass); 1950 this._superclass = becomeParentOf(superclass);
1803 this._withClause = becomeParentOf(withClause); 1951 this._withClause = becomeParentOf(withClause);
1804 this._implementsClause = becomeParentOf(implementsClause); 1952 this._implementsClause = becomeParentOf(implementsClause);
1805 } 1953 }
1954 /**
1955 * Initialize a newly created class type alias.
1956 * @param comment the documentation comment associated with this type alias
1957 * @param metadata the annotations associated with this type alias
1958 * @param keyword the token representing the 'typedef' keyword
1959 * @param name the name of the class being declared
1960 * @param typeParameters the type parameters for the class
1961 * @param equals the token for the '=' separating the name from the definition
1962 * @param abstractKeyword the token for the 'abstract' keyword
1963 * @param superclass the name of the superclass of the class being declared
1964 * @param withClause the with clause for this class
1965 * @param implementsClause the implements clause for this class
1966 * @param semicolon the semicolon terminating the declaration
1967 */
1968 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);
1806 accept(ASTVisitor visitor) => visitor.visitClassTypeAlias(this); 1969 accept(ASTVisitor visitor) => visitor.visitClassTypeAlias(this);
1807 /** 1970 /**
1808 * Return the token for the 'abstract' keyword, or {@code null} if this is not defining an 1971 * Return the token for the 'abstract' keyword, or {@code null} if this is not defining an
1809 * abstract class. 1972 * abstract class.
1810 * @return the token for the 'abstract' keyword 1973 * @return the token for the 'abstract' keyword
1811 */ 1974 */
1812 Token get abstractKeyword => _abstractKeyword; 1975 Token get abstractKeyword => _abstractKeyword;
1813 /** 1976 /**
1814 * Return the {@link ClassElement} associated with this type alias, or {@code null} if the AST 1977 * Return the {@link ClassElement} associated with this type alias, or {@code null} if the AST
1815 * structure has not been resolved. 1978 * structure has not been resolved.
1816 * @return the {@link ClassElement} associated with this type alias 1979 * @return the {@link ClassElement} associated with this type alias
1817 */ 1980 */
1818 ClassElement get element => _name != null ? _name.element as ClassElement : nu ll; 1981 ClassElement get element => _name != null ? (_name.element as ClassElement) : null;
1819 /** 1982 /**
1820 * Return the token for the '=' separating the name from the definition. 1983 * Return the token for the '=' separating the name from the definition.
1821 * @return the token for the '=' separating the name from the definition 1984 * @return the token for the '=' separating the name from the definition
1822 */ 1985 */
1823 Token get equals => _equals; 1986 Token get equals => _equals;
1824 /** 1987 /**
1825 * Return the implements clause for this class, or {@code null} if there is no implements clause. 1988 * Return the implements clause for this class, or {@code null} if there is no implements clause.
1826 * @return the implements clause for this class 1989 * @return the implements clause for this class
1827 */ 1990 */
1828 ImplementsClause get implementsClause => _implementsClause; 1991 ImplementsClause get implementsClause => _implementsClause;
(...skipping 15 matching lines...) Expand all
1844 TypeParameterList get typeParameters => _typeParameters; 2007 TypeParameterList get typeParameters => _typeParameters;
1845 /** 2008 /**
1846 * Return the with clause for this class. 2009 * Return the with clause for this class.
1847 * @return the with clause for this class 2010 * @return the with clause for this class
1848 */ 2011 */
1849 WithClause get withClause => _withClause; 2012 WithClause get withClause => _withClause;
1850 /** 2013 /**
1851 * Set the token for the 'abstract' keyword to the given token. 2014 * Set the token for the 'abstract' keyword to the given token.
1852 * @param abstractKeyword the token for the 'abstract' keyword 2015 * @param abstractKeyword the token for the 'abstract' keyword
1853 */ 2016 */
1854 void set abstractKeyword3(Token abstractKeyword) { 2017 void set abstractKeyword(Token abstractKeyword3) {
1855 this._abstractKeyword = abstractKeyword; 2018 this._abstractKeyword = abstractKeyword3;
1856 } 2019 }
1857 /** 2020 /**
1858 * Set the token for the '=' separating the name from the definition to the gi ven token. 2021 * Set the token for the '=' separating the name from the definition to the gi ven token.
1859 * @param equals the token for the '=' separating the name from the definition 2022 * @param equals the token for the '=' separating the name from the definition
1860 */ 2023 */
1861 void set equals4(Token equals) { 2024 void set equals(Token equals4) {
1862 this._equals = equals; 2025 this._equals = equals4;
1863 } 2026 }
1864 /** 2027 /**
1865 * Set the implements clause for this class to the given implements clause. 2028 * Set the implements clause for this class to the given implements clause.
1866 * @param implementsClause the implements clause for this class 2029 * @param implementsClause the implements clause for this class
1867 */ 2030 */
1868 void set implementsClause3(ImplementsClause implementsClause) { 2031 void set implementsClause(ImplementsClause implementsClause5) {
1869 this._implementsClause = becomeParentOf(implementsClause); 2032 this._implementsClause = becomeParentOf(implementsClause5);
1870 } 2033 }
1871 /** 2034 /**
1872 * Set the name of the class being declared to the given identifier. 2035 * Set the name of the class being declared to the given identifier.
1873 * @param name the name of the class being declared 2036 * @param name the name of the class being declared
1874 */ 2037 */
1875 void set name4(SimpleIdentifier name) { 2038 void set name(SimpleIdentifier name3) {
1876 this._name = becomeParentOf(name); 2039 this._name = becomeParentOf(name3);
1877 } 2040 }
1878 /** 2041 /**
1879 * Set the name of the superclass of the class being declared to the given nam e. 2042 * Set the name of the superclass of the class being declared to the given nam e.
1880 * @param superclass the name of the superclass of the class being declared 2043 * @param superclass the name of the superclass of the class being declared
1881 */ 2044 */
1882 void set superclass2(TypeName superclass) { 2045 void set superclass(TypeName superclass2) {
1883 this._superclass = becomeParentOf(superclass); 2046 this._superclass = becomeParentOf(superclass2);
1884 } 2047 }
1885 /** 2048 /**
1886 * Set the type parameters for the class to the given list of parameters. 2049 * Set the type parameters for the class to the given list of parameters.
1887 * @param typeParameters the type parameters for the class 2050 * @param typeParameters the type parameters for the class
1888 */ 2051 */
1889 void set typeParameters3(TypeParameterList typeParameters) { 2052 void set typeParameters(TypeParameterList typeParameters3) {
1890 this._typeParameters = becomeParentOf(typeParameters); 2053 this._typeParameters = becomeParentOf(typeParameters3);
1891 } 2054 }
1892 /** 2055 /**
1893 * Set the with clause for this class to the given with clause. 2056 * Set the with clause for this class to the given with clause.
1894 * @param withClause the with clause for this class 2057 * @param withClause the with clause for this class
1895 */ 2058 */
1896 void set withClause3(WithClause withClause) { 2059 void set withClause(WithClause withClause5) {
1897 this._withClause = becomeParentOf(withClause); 2060 this._withClause = becomeParentOf(withClause5);
1898 } 2061 }
1899 void visitChildren(ASTVisitor<Object> visitor) { 2062 void visitChildren(ASTVisitor<Object> visitor) {
1900 super.visitChildren(visitor); 2063 super.visitChildren(visitor);
1901 safelyVisitChild(_name, visitor); 2064 safelyVisitChild(_name, visitor);
1902 safelyVisitChild(_typeParameters, visitor); 2065 safelyVisitChild(_typeParameters, visitor);
1903 safelyVisitChild(_superclass, visitor); 2066 safelyVisitChild(_superclass, visitor);
1904 safelyVisitChild(_withClause, visitor); 2067 safelyVisitChild(_withClause, visitor);
1905 safelyVisitChild(_implementsClause, visitor); 2068 safelyVisitChild(_implementsClause, visitor);
1906 } 2069 }
1907 } 2070 }
1908 /** 2071 /**
1909 * Instances of the class {@code Combinator} represent the combinator associated with an import 2072 * Instances of the class {@code Combinator} represent the combinator associated with an import
1910 * directive. 2073 * directive.
1911 * <pre> 2074 * <pre>
1912 * combinator ::={@link HideCombinator hideCombinator}| {@link ShowCombinator sh owCombinator}</pre> 2075 * combinator ::={@link HideCombinator hideCombinator}| {@link ShowCombinator sh owCombinator}</pre>
1913 */ 2076 */
1914 abstract class Combinator extends ASTNode { 2077 abstract class Combinator extends ASTNode {
1915 /** 2078 /**
1916 * The keyword specifying what kind of processing is to be done on the importe d names. 2079 * The keyword specifying what kind of processing is to be done on the importe d names.
1917 */ 2080 */
1918 Token _keyword; 2081 Token _keyword;
1919 /** 2082 /**
1920 * Initialize a newly created import combinator. 2083 * Initialize a newly created import combinator.
1921 * @param keyword the keyword specifying what kind of processing is to be done on the imported 2084 * @param keyword the keyword specifying what kind of processing is to be done on the imported
1922 * names 2085 * names
1923 */ 2086 */
1924 Combinator(Token keyword) { 2087 Combinator.full(Token keyword) {
1925 this._keyword = keyword; 2088 this._keyword = keyword;
1926 } 2089 }
2090 /**
2091 * Initialize a newly created import combinator.
2092 * @param keyword the keyword specifying what kind of processing is to be done on the imported
2093 * names
2094 */
2095 Combinator({Token keyword}) : this.full(keyword);
1927 Token get beginToken => _keyword; 2096 Token get beginToken => _keyword;
1928 /** 2097 /**
1929 * Return the keyword specifying what kind of processing is to be done on the imported names. 2098 * Return the keyword specifying what kind of processing is to be done on the imported names.
1930 * @return the keyword specifying what kind of processing is to be done on the imported names 2099 * @return the keyword specifying what kind of processing is to be done on the imported names
1931 */ 2100 */
1932 Token get keyword => _keyword; 2101 Token get keyword => _keyword;
1933 /** 2102 /**
1934 * Set the keyword specifying what kind of processing is to be done on the imp orted names to the 2103 * Set the keyword specifying what kind of processing is to be done on the imp orted names to the
1935 * given token. 2104 * given token.
1936 * @param keyword the keyword specifying what kind of processing is to be done on the imported 2105 * @param keyword the keyword specifying what kind of processing is to be done on the imported
1937 * names 2106 * names
1938 */ 2107 */
1939 void set keyword5(Token keyword) { 2108 void set keyword(Token keyword5) {
1940 this._keyword = keyword; 2109 this._keyword = keyword5;
1941 } 2110 }
1942 } 2111 }
1943 /** 2112 /**
1944 * Instances of the class {@code Comment} represent a comment within the source code. 2113 * Instances of the class {@code Comment} represent a comment within the source code.
1945 * <pre> 2114 * <pre>
1946 * comment ::= 2115 * comment ::=
1947 * endOfLineComment 2116 * endOfLineComment
1948 * | blockComment 2117 * | blockComment
1949 * | documentationComment 2118 * | documentationComment
1950 * endOfLineComment ::= 2119 * endOfLineComment ::=
1951 * '//' (CHARACTER - EOL)* EOL 2120 * '//' (CHARACTER - EOL)* EOL
1952 * blockComment ::= 2121 * blockComment ::=
1953 * '/ *' CHARACTER* '&#42;/' 2122 * '/ *' CHARACTER* '&#42;/'
1954 * documentationComment ::= 2123 * documentationComment ::=
1955 * '/ **' (CHARACTER | {@link CommentReference commentReference})* '&#42;/' 2124 * '/ **' (CHARACTER | {@link CommentReference commentReference})* '&#42;/'
1956 * | ('///' (CHARACTER - EOL)* EOL)+ 2125 * | ('///' (CHARACTER - EOL)* EOL)+
1957 * </pre> 2126 * </pre>
1958 */ 2127 */
1959 class Comment extends ASTNode { 2128 class Comment extends ASTNode {
1960 /** 2129 /**
1961 * Create a block comment. 2130 * Create a block comment.
1962 * @param tokens the tokens representing the comment 2131 * @param tokens the tokens representing the comment
1963 * @return the block comment that was created 2132 * @return the block comment that was created
1964 */ 2133 */
1965 static Comment createBlockComment(List<Token> tokens) => new Comment(tokens, C ommentType.BLOCK, null); 2134 static Comment createBlockComment(List<Token> tokens) => new Comment.full(toke ns, CommentType.BLOCK, null);
1966 /** 2135 /**
1967 * Create a documentation comment. 2136 * Create a documentation comment.
1968 * @param tokens the tokens representing the comment 2137 * @param tokens the tokens representing the comment
1969 * @return the documentation comment that was created 2138 * @return the documentation comment that was created
1970 */ 2139 */
1971 static Comment createDocumentationComment(List<Token> tokens) => new Comment(t okens, CommentType.DOCUMENTATION, new List<CommentReference>()); 2140 static Comment createDocumentationComment(List<Token> tokens) => new Comment.f ull(tokens, CommentType.DOCUMENTATION, new List<CommentReference>());
1972 /** 2141 /**
1973 * Create a documentation comment. 2142 * Create a documentation comment.
1974 * @param tokens the tokens representing the comment 2143 * @param tokens the tokens representing the comment
1975 * @param references the references embedded within the documentation comment 2144 * @param references the references embedded within the documentation comment
1976 * @return the documentation comment that was created 2145 * @return the documentation comment that was created
1977 */ 2146 */
1978 static Comment createDocumentationComment2(List<Token> tokens, List<CommentRef erence> references) => new Comment(tokens, CommentType.DOCUMENTATION, references ); 2147 static Comment createDocumentationComment2(List<Token> tokens, List<CommentRef erence> references) => new Comment.full(tokens, CommentType.DOCUMENTATION, refer ences);
1979 /** 2148 /**
1980 * Create an end-of-line comment. 2149 * Create an end-of-line comment.
1981 * @param tokens the tokens representing the comment 2150 * @param tokens the tokens representing the comment
1982 * @return the end-of-line comment that was created 2151 * @return the end-of-line comment that was created
1983 */ 2152 */
1984 static Comment createEndOfLineComment(List<Token> tokens) => new Comment(token s, CommentType.END_OF_LINE, null); 2153 static Comment createEndOfLineComment(List<Token> tokens) => new Comment.full( tokens, CommentType.END_OF_LINE, null);
1985 /** 2154 /**
1986 * The tokens representing the comment. 2155 * The tokens representing the comment.
1987 */ 2156 */
1988 List<Token> _tokens; 2157 List<Token> _tokens;
1989 /** 2158 /**
1990 * The type of the comment. 2159 * The type of the comment.
1991 */ 2160 */
1992 CommentType _type; 2161 CommentType _type;
1993 /** 2162 /**
1994 * The references embedded within the documentation comment. This list will be empty unless this 2163 * The references embedded within the documentation comment. This list will be empty unless this
1995 * is a documentation comment that has references embedded within it. 2164 * is a documentation comment that has references embedded within it.
1996 */ 2165 */
1997 NodeList<CommentReference> _references; 2166 NodeList<CommentReference> _references;
1998 /** 2167 /**
1999 * Initialize a newly created comment. 2168 * Initialize a newly created comment.
2000 * @param tokens the tokens representing the comment 2169 * @param tokens the tokens representing the comment
2001 * @param type the type of the comment 2170 * @param type the type of the comment
2002 * @param references the references embedded within the documentation comment 2171 * @param references the references embedded within the documentation comment
2003 */ 2172 */
2004 Comment(List<Token> tokens, CommentType type, List<CommentReference> reference s) { 2173 Comment.full(List<Token> tokens, CommentType type, List<CommentReference> refe rences) {
2005 this._references = new NodeList<CommentReference>(this); 2174 this._references = new NodeList<CommentReference>(this);
2006 this._tokens = tokens; 2175 this._tokens = tokens;
2007 this._type = type; 2176 this._type = type;
2008 this._references.addAll(references); 2177 this._references.addAll(references);
2009 } 2178 }
2179 /**
2180 * Initialize a newly created comment.
2181 * @param tokens the tokens representing the comment
2182 * @param type the type of the comment
2183 * @param references the references embedded within the documentation comment
2184 */
2185 Comment({List<Token> tokens, CommentType type, List<CommentReference> referenc es}) : this.full(tokens, type, references);
2010 accept(ASTVisitor visitor) => visitor.visitComment(this); 2186 accept(ASTVisitor visitor) => visitor.visitComment(this);
2011 Token get beginToken => _tokens[0]; 2187 Token get beginToken => _tokens[0];
2012 Token get endToken => _tokens[_tokens.length - 1]; 2188 Token get endToken => _tokens[_tokens.length - 1];
2013 /** 2189 /**
2014 * Return the references embedded within the documentation comment. 2190 * Return the references embedded within the documentation comment.
2015 * @return the references embedded within the documentation comment 2191 * @return the references embedded within the documentation comment
2016 */ 2192 */
2017 NodeList<CommentReference> get references => _references; 2193 NodeList<CommentReference> get references => _references;
2018 /** 2194 /**
2019 * Return {@code true} if this is a block comment. 2195 * Return {@code true} if this is a block comment.
2020 * @return {@code true} if this is a block comment 2196 * @return {@code true} if this is a block comment
2021 */ 2197 */
2022 bool isBlock() => _type == CommentType.BLOCK; 2198 bool isBlock() => identical(_type, CommentType.BLOCK);
2023 /** 2199 /**
2024 * Return {@code true} if this is a documentation comment. 2200 * Return {@code true} if this is a documentation comment.
2025 * @return {@code true} if this is a documentation comment 2201 * @return {@code true} if this is a documentation comment
2026 */ 2202 */
2027 bool isDocumentation() => _type == CommentType.DOCUMENTATION; 2203 bool isDocumentation() => identical(_type, CommentType.DOCUMENTATION);
2028 /** 2204 /**
2029 * Return {@code true} if this is an end-of-line comment. 2205 * Return {@code true} if this is an end-of-line comment.
2030 * @return {@code true} if this is an end-of-line comment 2206 * @return {@code true} if this is an end-of-line comment
2031 */ 2207 */
2032 bool isEndOfLine() => _type == CommentType.END_OF_LINE; 2208 bool isEndOfLine() => identical(_type, CommentType.END_OF_LINE);
2033 void visitChildren(ASTVisitor<Object> visitor) { 2209 void visitChildren(ASTVisitor<Object> visitor) {
2034 _references.accept(visitor); 2210 _references.accept(visitor);
2035 } 2211 }
2036 } 2212 }
2037 /** 2213 /**
2038 * The enumeration {@code CommentType} encodes all the different types of commen ts that are 2214 * The enumeration {@code CommentType} encodes all the different types of commen ts that are
2039 * recognized by the parser. 2215 * recognized by the parser.
2040 */ 2216 */
2041 class CommentType { 2217 class CommentType {
2042 /** 2218 /**
(...skipping 30 matching lines...) Expand all
2073 Token _newKeyword; 2249 Token _newKeyword;
2074 /** 2250 /**
2075 * The identifier being referenced. 2251 * The identifier being referenced.
2076 */ 2252 */
2077 Identifier _identifier; 2253 Identifier _identifier;
2078 /** 2254 /**
2079 * Initialize a newly created reference to a Dart element. 2255 * Initialize a newly created reference to a Dart element.
2080 * @param newKeyword the token representing the 'new' keyword 2256 * @param newKeyword the token representing the 'new' keyword
2081 * @param identifier the identifier being referenced 2257 * @param identifier the identifier being referenced
2082 */ 2258 */
2083 CommentReference(Token newKeyword, Identifier identifier) { 2259 CommentReference.full(Token newKeyword, Identifier identifier) {
2084 this._newKeyword = newKeyword; 2260 this._newKeyword = newKeyword;
2085 this._identifier = becomeParentOf(identifier); 2261 this._identifier = becomeParentOf(identifier);
2086 } 2262 }
2263 /**
2264 * Initialize a newly created reference to a Dart element.
2265 * @param newKeyword the token representing the 'new' keyword
2266 * @param identifier the identifier being referenced
2267 */
2268 CommentReference({Token newKeyword, Identifier identifier}) : this.full(newKey word, identifier);
2087 accept(ASTVisitor visitor) => visitor.visitCommentReference(this); 2269 accept(ASTVisitor visitor) => visitor.visitCommentReference(this);
2088 Token get beginToken => _identifier.beginToken; 2270 Token get beginToken => _identifier.beginToken;
2089 Token get endToken => _identifier.endToken; 2271 Token get endToken => _identifier.endToken;
2090 /** 2272 /**
2091 * Return the identifier being referenced. 2273 * Return the identifier being referenced.
2092 * @return the identifier being referenced 2274 * @return the identifier being referenced
2093 */ 2275 */
2094 Identifier get identifier => _identifier; 2276 Identifier get identifier => _identifier;
2095 /** 2277 /**
2096 * Return the token representing the 'new' keyword, or {@code null} if there w as no 'new' keyword. 2278 * Return the token representing the 'new' keyword, or {@code null} if there w as no 'new' keyword.
2097 * @return the token representing the 'new' keyword 2279 * @return the token representing the 'new' keyword
2098 */ 2280 */
2099 Token get newKeyword => _newKeyword; 2281 Token get newKeyword => _newKeyword;
2100 /** 2282 /**
2101 * Set the identifier being referenced to the given identifier. 2283 * Set the identifier being referenced to the given identifier.
2102 * @param identifier the identifier being referenced 2284 * @param identifier the identifier being referenced
2103 */ 2285 */
2104 void set identifier3(Identifier identifier) { 2286 void set identifier(Identifier identifier18) {
2105 identifier = becomeParentOf(identifier); 2287 identifier18 = becomeParentOf(identifier18);
2106 } 2288 }
2107 /** 2289 /**
2108 * Set the token representing the 'new' keyword to the given token. 2290 * Set the token representing the 'new' keyword to the given token.
2109 * @param newKeyword the token representing the 'new' keyword 2291 * @param newKeyword the token representing the 'new' keyword
2110 */ 2292 */
2111 void set newKeyword2(Token newKeyword) { 2293 void set newKeyword(Token newKeyword2) {
2112 this._newKeyword = newKeyword; 2294 this._newKeyword = newKeyword2;
2113 } 2295 }
2114 void visitChildren(ASTVisitor<Object> visitor) { 2296 void visitChildren(ASTVisitor<Object> visitor) {
2115 safelyVisitChild(_identifier, visitor); 2297 safelyVisitChild(_identifier, visitor);
2116 } 2298 }
2117 } 2299 }
2118 /** 2300 /**
2119 * Instances of the class {@code CompilationUnit} represent a compilation unit. 2301 * Instances of the class {@code CompilationUnit} represent a compilation unit.
2120 * <p> 2302 * <p>
2121 * While the grammar restricts the order of the directives and declarations with in a compilation 2303 * While the grammar restricts the order of the directives and declarations with in a compilation
2122 * unit, this class does not enforce those restrictions. In particular, the chil dren of a 2304 * unit, this class does not enforce those restrictions. In particular, the chil dren of a
(...skipping 26 matching lines...) Expand all
2149 * The last token in the token stream that was parsed to form this compilation unit. This token 2331 * The last token in the token stream that was parsed to form this compilation unit. This token
2150 * should always have a type of {@link TokenType.EOF}. 2332 * should always have a type of {@link TokenType.EOF}.
2151 */ 2333 */
2152 Token _endToken; 2334 Token _endToken;
2153 /** 2335 /**
2154 * The element associated with this compilation unit, or {@code null} if the A ST structure has not 2336 * The element associated with this compilation unit, or {@code null} if the A ST structure has not
2155 * been resolved. 2337 * been resolved.
2156 */ 2338 */
2157 CompilationUnitElement _element; 2339 CompilationUnitElement _element;
2158 /** 2340 /**
2159 * The syntax errors encountered when the receiver was parsed. 2341 * The {@link LineInfo} for this {@link CompilationUnit}.
2160 */ 2342 */
2161 List<AnalysisError> _syntacticErrors; 2343 LineInfo _lineInfo;
2344 /**
2345 * The parsing errors encountered when the receiver was parsed.
2346 */
2347 List<AnalysisError> _parsingErrors = AnalysisError.NO_ERRORS;
2348 /**
2349 * The resolution errors encountered when the receiver was resolved.
2350 */
2351 List<AnalysisError> _resolutionErrors = AnalysisError.NO_ERRORS;
2162 /** 2352 /**
2163 * Initialize a newly created compilation unit to have the given directives an d declarations. 2353 * Initialize a newly created compilation unit to have the given directives an d declarations.
2164 * @param beginToken the first token in the token stream 2354 * @param beginToken the first token in the token stream
2165 * @param scriptTag the script tag at the beginning of the compilation unit 2355 * @param scriptTag the script tag at the beginning of the compilation unit
2166 * @param directives the directives contained in this compilation unit 2356 * @param directives the directives contained in this compilation unit
2167 * @param declarations the declarations contained in this compilation unit 2357 * @param declarations the declarations contained in this compilation unit
2168 * @param endToken the last token in the token stream 2358 * @param endToken the last token in the token stream
2169 */ 2359 */
2170 CompilationUnit(Token beginToken, ScriptTag scriptTag, List<Directive> directi ves, List<CompilationUnitMember> declarations, Token endToken) { 2360 CompilationUnit.full(Token beginToken, ScriptTag scriptTag, List<Directive> di rectives, List<CompilationUnitMember> declarations, Token endToken) {
2171 this._directives = new NodeList<Directive>(this); 2361 this._directives = new NodeList<Directive>(this);
2172 this._declarations = new NodeList<CompilationUnitMember>(this); 2362 this._declarations = new NodeList<CompilationUnitMember>(this);
2173 this._beginToken = beginToken; 2363 this._beginToken = beginToken;
2174 this._scriptTag = becomeParentOf(scriptTag); 2364 this._scriptTag = becomeParentOf(scriptTag);
2175 this._directives.addAll(directives); 2365 this._directives.addAll(directives);
2176 this._declarations.addAll(declarations); 2366 this._declarations.addAll(declarations);
2177 this._endToken = endToken; 2367 this._endToken = endToken;
2178 } 2368 }
2369 /**
2370 * Initialize a newly created compilation unit to have the given directives an d declarations.
2371 * @param beginToken the first token in the token stream
2372 * @param scriptTag the script tag at the beginning of the compilation unit
2373 * @param directives the directives contained in this compilation unit
2374 * @param declarations the declarations contained in this compilation unit
2375 * @param endToken the last token in the token stream
2376 */
2377 CompilationUnit({Token beginToken, ScriptTag scriptTag, List<Directive> direct ives, List<CompilationUnitMember> declarations, Token endToken}) : this.full(beg inToken, scriptTag, directives, declarations, endToken);
2179 accept(ASTVisitor visitor) => visitor.visitCompilationUnit(this); 2378 accept(ASTVisitor visitor) => visitor.visitCompilationUnit(this);
2180 Token get beginToken => _beginToken; 2379 Token get beginToken => _beginToken;
2181 /** 2380 /**
2182 * Return the declarations contained in this compilation unit. 2381 * Return the declarations contained in this compilation unit.
2183 * @return the declarations contained in this compilation unit 2382 * @return the declarations contained in this compilation unit
2184 */ 2383 */
2185 NodeList<CompilationUnitMember> get declarations => _declarations; 2384 NodeList<CompilationUnitMember> get declarations => _declarations;
2186 /** 2385 /**
2187 * Return the directives contained in this compilation unit. 2386 * Return the directives contained in this compilation unit.
2188 * @return the directives contained in this compilation unit 2387 * @return the directives contained in this compilation unit
2189 */ 2388 */
2190 NodeList<Directive> get directives => _directives; 2389 NodeList<Directive> get directives => _directives;
2191 /** 2390 /**
2192 * Return the element associated with this compilation unit, or {@code null} i f the AST structure 2391 * Return the element associated with this compilation unit, or {@code null} i f the AST structure
2193 * has not been resolved. 2392 * has not been resolved.
2194 * @return the element associated with this compilation unit 2393 * @return the element associated with this compilation unit
2195 */ 2394 */
2196 CompilationUnitElement get element => _element; 2395 CompilationUnitElement get element => _element;
2197 Token get endToken => _endToken; 2396 Token get endToken => _endToken;
2198 /** 2397 /**
2199 * Return an array containing all of the errors associated with the receiver. If the receiver has 2398 * Return an array containing all of the errors associated with the receiver. If the receiver has
2200 * not been resolved, then return {@code null}. 2399 * not been resolved, then return {@code null}.
2201 * @return an array of errors (contains no {@code null}s) or {@code null} if t he receiver has not 2400 * @return an array of errors (contains no {@code null}s) or {@code null} if t he receiver has not
2202 * been resolved 2401 * been resolved
2203 */ 2402 */
2204 List<AnalysisError> get errors { 2403 List<AnalysisError> get errors {
2205 throw new UnsupportedOperationException(); 2404 List<AnalysisError> parserErrors = parsingErrors;
2405 List<AnalysisError> resolverErrors = resolutionErrors;
2406 if (resolverErrors.length == 0) {
2407 return parserErrors;
2408 } else if (parserErrors.length == 0) {
2409 return resolverErrors;
2410 } else {
2411 List<AnalysisError> allErrors = new List<AnalysisError>.fixedLength(parser Errors.length + resolverErrors.length);
2412 System.arraycopy(parserErrors, 0, allErrors, 0, parserErrors.length);
2413 System.arraycopy(resolverErrors, 0, allErrors, parserErrors.length, resolv erErrors.length);
2414 return allErrors;
2415 }
2206 } 2416 }
2207 int get length { 2417 int get length {
2208 Token endToken4 = endToken; 2418 Token endToken3 = endToken;
2209 if (endToken4 == null) { 2419 if (endToken3 == null) {
2210 return 0; 2420 return 0;
2211 } 2421 }
2212 return endToken4.offset + endToken4.length - beginToken.offset; 2422 return endToken3.offset + endToken3.length - beginToken.offset;
2213 } 2423 }
2424 /**
2425 * Get the {@link LineInfo} object for this compilation unit.
2426 * @return the associated {@link LineInfo}
2427 */
2428 LineInfo get lineInfo => _lineInfo;
2214 int get offset { 2429 int get offset {
2215 Token beginToken4 = beginToken; 2430 Token beginToken4 = beginToken;
2216 if (beginToken4 == null) { 2431 if (beginToken4 == null) {
2217 return 0; 2432 return 0;
2218 } 2433 }
2219 return beginToken4.offset; 2434 return beginToken4.offset;
2220 } 2435 }
2221 /** 2436 /**
2437 * Return an array containing all of the parsing errors associated with the re ceiver.
2438 * @return an array of errors (not {@code null}, contains no {@code null}s).
2439 */
2440 List<AnalysisError> get parsingErrors => _parsingErrors;
2441 /**
2442 * Return an array containing all of the resolution errors associated with the receiver. If the
2443 * receiver has not been resolved, then return {@code null}.
2444 * @return an array of errors (contains no {@code null}s) or {@code null} if t he receiver has not
2445 * been resolved
2446 */
2447 List<AnalysisError> get resolutionErrors => _resolutionErrors;
2448 /**
2222 * Return the script tag at the beginning of the compilation unit, or {@code n ull} if there is no 2449 * Return the script tag at the beginning of the compilation unit, or {@code n ull} if there is no
2223 * script tag in this compilation unit. 2450 * script tag in this compilation unit.
2224 * @return the script tag at the beginning of the compilation unit 2451 * @return the script tag at the beginning of the compilation unit
2225 */ 2452 */
2226 ScriptTag get scriptTag => _scriptTag; 2453 ScriptTag get scriptTag => _scriptTag;
2227 /** 2454 /**
2228 * Return an array containing all of the semantic errors associated with the r eceiver. If the
2229 * receiver has not been resolved, then return {@code null}.
2230 * @return an array of errors (contains no {@code null}s) or {@code null} if t he receiver has not
2231 * been resolved
2232 */
2233 List<AnalysisError> get semanticErrors {
2234 throw new UnsupportedOperationException();
2235 }
2236 /**
2237 * Return an array containing all of the syntactic errors associated with the receiver.
2238 * @return an array of errors (not {@code null}, contains no {@code null}s).
2239 */
2240 List<AnalysisError> get syntacticErrors => _syntacticErrors;
2241 /**
2242 * Set the element associated with this compilation unit to the given element. 2455 * Set the element associated with this compilation unit to the given element.
2243 * @param element the element associated with this compilation unit 2456 * @param element the element associated with this compilation unit
2244 */ 2457 */
2245 void set element4(CompilationUnitElement element) { 2458 void set element(CompilationUnitElement element5) {
2246 this._element = element; 2459 this._element = element5;
2460 }
2461 /**
2462 * Set the {@link LineInfo} object for this compilation unit.
2463 * @param errors LineInfo to associate with this compilation unit
2464 */
2465 void set lineInfo(LineInfo lineInfo2) {
2466 this._lineInfo = lineInfo2;
2467 }
2468 /**
2469 * Called to cache the parsing errors when the unit is parsed.
2470 * @param errors an array of parsing errors, if <code>null</code> is passed, t he error array is
2471 * set to an empty array, {@link AnalysisError#NO_ERRORS}
2472 */
2473 void set parsingErrors(List<AnalysisError> errors) {
2474 _parsingErrors = errors == null ? AnalysisError.NO_ERRORS : errors;
2475 }
2476 /**
2477 * Called to cache the resolution errors when the unit is resolved.
2478 * @param errors an array of resolution errors, if <code>null</code> is passed , the error array is
2479 * set to an empty array, {@link AnalysisError#NO_ERRORS}
2480 */
2481 void set resolutionErrors(List<AnalysisError> errors) {
2482 _resolutionErrors = errors == null ? AnalysisError.NO_ERRORS : errors;
2247 } 2483 }
2248 /** 2484 /**
2249 * Set the script tag at the beginning of the compilation unit to the given sc ript tag. 2485 * Set the script tag at the beginning of the compilation unit to the given sc ript tag.
2250 * @param scriptTag the script tag at the beginning of the compilation unit 2486 * @param scriptTag the script tag at the beginning of the compilation unit
2251 */ 2487 */
2252 void set scriptTag2(ScriptTag scriptTag) { 2488 void set scriptTag(ScriptTag scriptTag2) {
2253 this._scriptTag = becomeParentOf(scriptTag); 2489 this._scriptTag = becomeParentOf(scriptTag2);
2254 }
2255 /**
2256 * Called by the {@link AnalysisContext} to cache the syntax errors when the u nit is parsed.
2257 * @param errors an array of syntax errors (not {@code null}, contains no {@co de null}s)
2258 */
2259 void set syntacticErrors2(List<AnalysisError> errors) {
2260 this._syntacticErrors = errors;
2261 } 2490 }
2262 void visitChildren(ASTVisitor<Object> visitor) { 2491 void visitChildren(ASTVisitor<Object> visitor) {
2263 safelyVisitChild(_scriptTag, visitor); 2492 safelyVisitChild(_scriptTag, visitor);
2264 if (directivesAreBeforeDeclarations()) { 2493 if (directivesAreBeforeDeclarations()) {
2265 _directives.accept(visitor); 2494 _directives.accept(visitor);
2266 _declarations.accept(visitor); 2495 _declarations.accept(visitor);
2267 } else { 2496 } else {
2268 for (ASTNode child in sortedDirectivesAndDeclarations) { 2497 for (ASTNode child in sortedDirectivesAndDeclarations) {
2269 child.accept(visitor); 2498 child.accept(visitor);
2270 } 2499 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2302 * declare a name within the scope of a compilation unit. 2531 * declare a name within the scope of a compilation unit.
2303 * <pre> 2532 * <pre>
2304 * compilationUnitMember ::={@link ClassDeclaration classDeclaration}| {@link Ty peAlias typeAlias}| {@link FunctionDeclaration functionDeclaration}| {@link Meth odDeclaration getOrSetDeclaration}| {@link VariableDeclaration constantsDeclarat ion}| {@link VariableDeclaration variablesDeclaration}</pre> 2533 * compilationUnitMember ::={@link ClassDeclaration classDeclaration}| {@link Ty peAlias typeAlias}| {@link FunctionDeclaration functionDeclaration}| {@link Meth odDeclaration getOrSetDeclaration}| {@link VariableDeclaration constantsDeclarat ion}| {@link VariableDeclaration variablesDeclaration}</pre>
2305 */ 2534 */
2306 abstract class CompilationUnitMember extends Declaration { 2535 abstract class CompilationUnitMember extends Declaration {
2307 /** 2536 /**
2308 * Initialize a newly created generic compilation unit member. 2537 * Initialize a newly created generic compilation unit member.
2309 * @param comment the documentation comment associated with this member 2538 * @param comment the documentation comment associated with this member
2310 * @param metadata the annotations associated with this member 2539 * @param metadata the annotations associated with this member
2311 */ 2540 */
2312 CompilationUnitMember(Comment comment, List<Annotation> metadata) : super(comm ent, metadata) { 2541 CompilationUnitMember.full(Comment comment, List<Annotation> metadata) : super .full(comment, metadata) {
2313 } 2542 }
2543 /**
2544 * Initialize a newly created generic compilation unit member.
2545 * @param comment the documentation comment associated with this member
2546 * @param metadata the annotations associated with this member
2547 */
2548 CompilationUnitMember({Comment comment, List<Annotation> metadata}) : this.ful l(comment, metadata);
2314 } 2549 }
2315 /** 2550 /**
2316 * Instances of the class {@code ConditionalExpression} represent a conditional expression. 2551 * Instances of the class {@code ConditionalExpression} represent a conditional expression.
2317 * <pre> 2552 * <pre>
2318 * conditionalExpression ::={@link Expression condition} '?' {@link Expression t henExpression} ':' {@link Expression elseExpression}</pre> 2553 * conditionalExpression ::={@link Expression condition} '?' {@link Expression t henExpression} ':' {@link Expression elseExpression}</pre>
2319 */ 2554 */
2320 class ConditionalExpression extends Expression { 2555 class ConditionalExpression extends Expression {
2321 /** 2556 /**
2322 * The condition used to determine which of the expressions is executed next. 2557 * The condition used to determine which of the expressions is executed next.
2323 */ 2558 */
(...skipping 15 matching lines...) Expand all
2339 */ 2574 */
2340 Expression _elseExpression; 2575 Expression _elseExpression;
2341 /** 2576 /**
2342 * Initialize a newly created conditional expression. 2577 * Initialize a newly created conditional expression.
2343 * @param condition the condition used to determine which expression is execut ed next 2578 * @param condition the condition used to determine which expression is execut ed next
2344 * @param question the token used to separate the condition from the then expr ession 2579 * @param question the token used to separate the condition from the then expr ession
2345 * @param thenExpression the expression that is executed if the condition eval uates to{@code true} 2580 * @param thenExpression the expression that is executed if the condition eval uates to{@code true}
2346 * @param colon the token used to separate the then expression from the else e xpression 2581 * @param colon the token used to separate the then expression from the else e xpression
2347 * @param elseExpression the expression that is executed if the condition eval uates to{@code false} 2582 * @param elseExpression the expression that is executed if the condition eval uates to{@code false}
2348 */ 2583 */
2349 ConditionalExpression(Expression condition, Token question, Expression thenExp ression, Token colon, Expression elseExpression) { 2584 ConditionalExpression.full(Expression condition, Token question, Expression th enExpression, Token colon, Expression elseExpression) {
2350 this._condition = becomeParentOf(condition); 2585 this._condition = becomeParentOf(condition);
2351 this._question = question; 2586 this._question = question;
2352 this._thenExpression = becomeParentOf(thenExpression); 2587 this._thenExpression = becomeParentOf(thenExpression);
2353 this._colon = colon; 2588 this._colon = colon;
2354 this._elseExpression = becomeParentOf(elseExpression); 2589 this._elseExpression = becomeParentOf(elseExpression);
2355 } 2590 }
2591 /**
2592 * Initialize a newly created conditional expression.
2593 * @param condition the condition used to determine which expression is execut ed next
2594 * @param question the token used to separate the condition from the then expr ession
2595 * @param thenExpression the expression that is executed if the condition eval uates to{@code true}
2596 * @param colon the token used to separate the then expression from the else e xpression
2597 * @param elseExpression the expression that is executed if the condition eval uates to{@code false}
2598 */
2599 ConditionalExpression({Expression condition, Token question, Expression thenEx pression, Token colon, Expression elseExpression}) : this.full(condition, questi on, thenExpression, colon, elseExpression);
2356 accept(ASTVisitor visitor) => visitor.visitConditionalExpression(this); 2600 accept(ASTVisitor visitor) => visitor.visitConditionalExpression(this);
2357 Token get beginToken => _condition.beginToken; 2601 Token get beginToken => _condition.beginToken;
2358 /** 2602 /**
2359 * Return the token used to separate the then expression from the else express ion. 2603 * Return the token used to separate the then expression from the else express ion.
2360 * @return the token used to separate the then expression from the else expres sion 2604 * @return the token used to separate the then expression from the else expres sion
2361 */ 2605 */
2362 Token get colon => _colon; 2606 Token get colon => _colon;
2363 /** 2607 /**
2364 * Return the condition used to determine which of the expressions is executed next. 2608 * Return the condition used to determine which of the expressions is executed next.
2365 * @return the condition used to determine which expression is executed next 2609 * @return the condition used to determine which expression is executed next
(...skipping 12 matching lines...) Expand all
2378 Token get question => _question; 2622 Token get question => _question;
2379 /** 2623 /**
2380 * Return the expression that is executed if the condition evaluates to {@code true}. 2624 * Return the expression that is executed if the condition evaluates to {@code true}.
2381 * @return the expression that is executed if the condition evaluates to {@cod e true} 2625 * @return the expression that is executed if the condition evaluates to {@cod e true}
2382 */ 2626 */
2383 Expression get thenExpression => _thenExpression; 2627 Expression get thenExpression => _thenExpression;
2384 /** 2628 /**
2385 * Set the token used to separate the then expression from the else expression to the given token. 2629 * Set the token used to separate the then expression from the else expression to the given token.
2386 * @param colon the token used to separate the then expression from the else e xpression 2630 * @param colon the token used to separate the then expression from the else e xpression
2387 */ 2631 */
2388 void set colon2(Token colon) { 2632 void set colon(Token colon2) {
2389 this._colon = colon; 2633 this._colon = colon2;
2390 } 2634 }
2391 /** 2635 /**
2392 * Set the condition used to determine which of the expressions is executed ne xt to the given 2636 * Set the condition used to determine which of the expressions is executed ne xt to the given
2393 * expression. 2637 * expression.
2394 * @param expression the condition used to determine which expression is execu ted next 2638 * @param expression the condition used to determine which expression is execu ted next
2395 */ 2639 */
2396 void set condition3(Expression expression) { 2640 void set condition(Expression expression) {
2397 _condition = becomeParentOf(expression); 2641 _condition = becomeParentOf(expression);
2398 } 2642 }
2399 /** 2643 /**
2400 * Set the expression that is executed if the condition evaluates to {@code fa lse} to the given 2644 * Set the expression that is executed if the condition evaluates to {@code fa lse} to the given
2401 * expression. 2645 * expression.
2402 * @param expression the expression that is executed if the condition evaluate s to {@code false} 2646 * @param expression the expression that is executed if the condition evaluate s to {@code false}
2403 */ 2647 */
2404 void set elseExpression2(Expression expression) { 2648 void set elseExpression(Expression expression) {
2405 _elseExpression = becomeParentOf(expression); 2649 _elseExpression = becomeParentOf(expression);
2406 } 2650 }
2407 /** 2651 /**
2408 * Set the token used to separate the condition from the then expression to th e given token. 2652 * Set the token used to separate the condition from the then expression to th e given token.
2409 * @param question the token used to separate the condition from the then expr ession 2653 * @param question the token used to separate the condition from the then expr ession
2410 */ 2654 */
2411 void set question3(Token question) { 2655 void set question(Token question3) {
2412 this._question = question; 2656 this._question = question3;
2413 } 2657 }
2414 /** 2658 /**
2415 * Set the expression that is executed if the condition evaluates to {@code tr ue} to the given 2659 * Set the expression that is executed if the condition evaluates to {@code tr ue} to the given
2416 * expression. 2660 * expression.
2417 * @param expression the expression that is executed if the condition evaluate s to {@code true} 2661 * @param expression the expression that is executed if the condition evaluate s to {@code true}
2418 */ 2662 */
2419 void set thenExpression2(Expression expression) { 2663 void set thenExpression(Expression expression) {
2420 _thenExpression = becomeParentOf(expression); 2664 _thenExpression = becomeParentOf(expression);
2421 } 2665 }
2422 void visitChildren(ASTVisitor<Object> visitor) { 2666 void visitChildren(ASTVisitor<Object> visitor) {
2423 safelyVisitChild(_condition, visitor); 2667 safelyVisitChild(_condition, visitor);
2424 safelyVisitChild(_thenExpression, visitor); 2668 safelyVisitChild(_thenExpression, visitor);
2425 safelyVisitChild(_elseExpression, visitor); 2669 safelyVisitChild(_elseExpression, visitor);
2426 } 2670 }
2427 } 2671 }
2428 /** 2672 /**
2429 * Instances of the class {@code ConstructorDeclaration} represent a constructor declaration. 2673 * Instances of the class {@code ConstructorDeclaration} represent a constructor declaration.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
2505 * @param returnType the return type of the constructor 2749 * @param returnType the return type of the constructor
2506 * @param period the token for the period before the constructor name 2750 * @param period the token for the period before the constructor name
2507 * @param name the name of the constructor 2751 * @param name the name of the constructor
2508 * @param parameters the parameters associated with the constructor 2752 * @param parameters the parameters associated with the constructor
2509 * @param separator the token for the colon or equals before the initializers 2753 * @param separator the token for the colon or equals before the initializers
2510 * @param initializers the initializers associated with the constructor 2754 * @param initializers the initializers associated with the constructor
2511 * @param redirectedConstructor the name of the constructor to which this cons tructor will be 2755 * @param redirectedConstructor the name of the constructor to which this cons tructor will be
2512 * redirected 2756 * redirected
2513 * @param body the body of the constructor 2757 * @param body the body of the constructor
2514 */ 2758 */
2515 ConstructorDeclaration(Comment comment, List<Annotation> metadata, Token exter nalKeyword, Token constKeyword, Token factoryKeyword, Identifier returnType, Tok en period, SimpleIdentifier name, FormalParameterList parameters, Token separato r, List<ConstructorInitializer> initializers, ConstructorName redirectedConstruc tor, FunctionBody body) : super(comment, metadata) { 2759 ConstructorDeclaration.full(Comment comment, List<Annotation> metadata, Token externalKeyword, Token constKeyword, Token factoryKeyword, Identifier returnType , Token period, SimpleIdentifier name, FormalParameterList parameters, Token sep arator, List<ConstructorInitializer> initializers, ConstructorName redirectedCon structor, FunctionBody body) : super.full(comment, metadata) {
2516 this._initializers = new NodeList<ConstructorInitializer>(this); 2760 this._initializers = new NodeList<ConstructorInitializer>(this);
2517 this._externalKeyword = externalKeyword; 2761 this._externalKeyword = externalKeyword;
2518 this._constKeyword = constKeyword; 2762 this._constKeyword = constKeyword;
2519 this._factoryKeyword = factoryKeyword; 2763 this._factoryKeyword = factoryKeyword;
2520 this._returnType = becomeParentOf(returnType); 2764 this._returnType = becomeParentOf(returnType);
2521 this._period = period; 2765 this._period = period;
2522 this._name = becomeParentOf(name); 2766 this._name = becomeParentOf(name);
2523 this._parameters = becomeParentOf(parameters); 2767 this._parameters = becomeParentOf(parameters);
2524 this._separator = separator; 2768 this._separator = separator;
2525 this._initializers.addAll(initializers); 2769 this._initializers.addAll(initializers);
2526 this._redirectedConstructor = becomeParentOf(redirectedConstructor); 2770 this._redirectedConstructor = becomeParentOf(redirectedConstructor);
2527 this._body = becomeParentOf(body); 2771 this._body = becomeParentOf(body);
2528 } 2772 }
2773 /**
2774 * Initialize a newly created constructor declaration.
2775 * @param externalKeyword the token for the 'external' keyword
2776 * @param comment the documentation comment associated with this constructor
2777 * @param metadata the annotations associated with this constructor
2778 * @param constKeyword the token for the 'const' keyword
2779 * @param factoryKeyword the token for the 'factory' keyword
2780 * @param returnType the return type of the constructor
2781 * @param period the token for the period before the constructor name
2782 * @param name the name of the constructor
2783 * @param parameters the parameters associated with the constructor
2784 * @param separator the token for the colon or equals before the initializers
2785 * @param initializers the initializers associated with the constructor
2786 * @param redirectedConstructor the name of the constructor to which this cons tructor will be
2787 * redirected
2788 * @param body the body of the constructor
2789 */
2790 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);
2529 accept(ASTVisitor visitor) => visitor.visitConstructorDeclaration(this); 2791 accept(ASTVisitor visitor) => visitor.visitConstructorDeclaration(this);
2530 /** 2792 /**
2531 * Return the body of the constructor, or {@code null} if the constructor does not have a body. 2793 * Return the body of the constructor, or {@code null} if the constructor does not have a body.
2532 * @return the body of the constructor 2794 * @return the body of the constructor
2533 */ 2795 */
2534 FunctionBody get body => _body; 2796 FunctionBody get body => _body;
2535 /** 2797 /**
2536 * Return the token for the 'const' keyword. 2798 * Return the token for the 'const' keyword.
2537 * @return the token for the 'const' keyword 2799 * @return the token for the 'const' keyword
2538 */ 2800 */
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2598 Identifier get returnType => _returnType; 2860 Identifier get returnType => _returnType;
2599 /** 2861 /**
2600 * Return the token for the separator (colon or equals) before the initializer s, or {@code null}if there are no initializers. 2862 * Return the token for the separator (colon or equals) before the initializer s, or {@code null}if there are no initializers.
2601 * @return the token for the separator (colon or equals) before the initialize rs 2863 * @return the token for the separator (colon or equals) before the initialize rs
2602 */ 2864 */
2603 Token get separator => _separator; 2865 Token get separator => _separator;
2604 /** 2866 /**
2605 * Set the body of the constructor to the given function body. 2867 * Set the body of the constructor to the given function body.
2606 * @param functionBody the body of the constructor 2868 * @param functionBody the body of the constructor
2607 */ 2869 */
2608 void set body3(FunctionBody functionBody) { 2870 void set body(FunctionBody functionBody) {
2609 _body = becomeParentOf(functionBody); 2871 _body = becomeParentOf(functionBody);
2610 } 2872 }
2611 /** 2873 /**
2612 * Set the token for the 'const' keyword to the given token. 2874 * Set the token for the 'const' keyword to the given token.
2613 * @param constKeyword the token for the 'const' keyword 2875 * @param constKeyword the token for the 'const' keyword
2614 */ 2876 */
2615 void set constKeyword2(Token constKeyword) { 2877 void set constKeyword(Token constKeyword2) {
2616 this._constKeyword = constKeyword; 2878 this._constKeyword = constKeyword2;
2617 } 2879 }
2618 /** 2880 /**
2619 * Set the element associated with this constructor to the given element. 2881 * Set the element associated with this constructor to the given element.
2620 * @param element the element associated with this constructor 2882 * @param element the element associated with this constructor
2621 */ 2883 */
2622 void set element5(ConstructorElement element) { 2884 void set element(ConstructorElement element6) {
2623 this._element = element; 2885 this._element = element6;
2624 } 2886 }
2625 /** 2887 /**
2626 * Set the token for the 'external' keyword to the given token. 2888 * Set the token for the 'external' keyword to the given token.
2627 * @param externalKeyword the token for the 'external' keyword 2889 * @param externalKeyword the token for the 'external' keyword
2628 */ 2890 */
2629 void set externalKeyword2(Token externalKeyword) { 2891 void set externalKeyword(Token externalKeyword2) {
2630 this._externalKeyword = externalKeyword; 2892 this._externalKeyword = externalKeyword2;
2631 } 2893 }
2632 /** 2894 /**
2633 * Set the token for the 'factory' keyword to the given token. 2895 * Set the token for the 'factory' keyword to the given token.
2634 * @param factoryKeyword the token for the 'factory' keyword 2896 * @param factoryKeyword the token for the 'factory' keyword
2635 */ 2897 */
2636 void set factoryKeyword2(Token factoryKeyword) { 2898 void set factoryKeyword(Token factoryKeyword2) {
2637 this._factoryKeyword = factoryKeyword; 2899 this._factoryKeyword = factoryKeyword2;
2638 } 2900 }
2639 /** 2901 /**
2640 * Set the name of the constructor to the given identifier. 2902 * Set the name of the constructor to the given identifier.
2641 * @param identifier the name of the constructor 2903 * @param identifier the name of the constructor
2642 */ 2904 */
2643 void set name5(SimpleIdentifier identifier) { 2905 void set name(SimpleIdentifier identifier) {
2644 _name = becomeParentOf(identifier); 2906 _name = becomeParentOf(identifier);
2645 } 2907 }
2646 /** 2908 /**
2647 * Set the parameters associated with the constructor to the given list of par ameters. 2909 * Set the parameters associated with the constructor to the given list of par ameters.
2648 * @param parameters the parameters associated with the constructor 2910 * @param parameters the parameters associated with the constructor
2649 */ 2911 */
2650 void set parameters2(FormalParameterList parameters) { 2912 void set parameters(FormalParameterList parameters2) {
2651 this._parameters = becomeParentOf(parameters); 2913 this._parameters = becomeParentOf(parameters2);
2652 } 2914 }
2653 /** 2915 /**
2654 * Set the token for the period before the constructor name to the given token . 2916 * Set the token for the period before the constructor name to the given token .
2655 * @param period the token for the period before the constructor name 2917 * @param period the token for the period before the constructor name
2656 */ 2918 */
2657 void set period3(Token period) { 2919 void set period(Token period3) {
2658 this._period = period; 2920 this._period = period3;
2659 } 2921 }
2660 /** 2922 /**
2661 * Set the name of the constructor to which this constructor will be redirecte d to the given 2923 * Set the name of the constructor to which this constructor will be redirecte d to the given
2662 * constructor name. 2924 * constructor name.
2663 * @param redirectedConstructor the name of the constructor to which this cons tructor will be 2925 * @param redirectedConstructor the name of the constructor to which this cons tructor will be
2664 * redirected 2926 * redirected
2665 */ 2927 */
2666 void set redirectedConstructor2(ConstructorName redirectedConstructor) { 2928 void set redirectedConstructor(ConstructorName redirectedConstructor2) {
2667 this._redirectedConstructor = becomeParentOf(redirectedConstructor); 2929 this._redirectedConstructor = becomeParentOf(redirectedConstructor2);
2668 } 2930 }
2669 /** 2931 /**
2670 * Set the type of object being created to the given type name. 2932 * Set the type of object being created to the given type name.
2671 * @param typeName the type of object being created 2933 * @param typeName the type of object being created
2672 */ 2934 */
2673 void set returnType2(Identifier typeName) { 2935 void set returnType(Identifier typeName) {
2674 _returnType = becomeParentOf(typeName); 2936 _returnType = becomeParentOf(typeName);
2675 } 2937 }
2676 /** 2938 /**
2677 * Set the token for the separator (colon or equals) before the initializers t o the given token. 2939 * Set the token for the separator (colon or equals) before the initializers t o the given token.
2678 * @param separator the token for the separator (colon or equals) before the i nitializers 2940 * @param separator the token for the separator (colon or equals) before the i nitializers
2679 */ 2941 */
2680 void set separator2(Token separator) { 2942 void set separator(Token separator2) {
2681 this._separator = separator; 2943 this._separator = separator2;
2682 } 2944 }
2683 void visitChildren(ASTVisitor<Object> visitor) { 2945 void visitChildren(ASTVisitor<Object> visitor) {
2684 super.visitChildren(visitor); 2946 super.visitChildren(visitor);
2685 safelyVisitChild(_returnType, visitor); 2947 safelyVisitChild(_returnType, visitor);
2686 safelyVisitChild(_name, visitor); 2948 safelyVisitChild(_name, visitor);
2687 safelyVisitChild(_parameters, visitor); 2949 safelyVisitChild(_parameters, visitor);
2688 _initializers.accept(visitor); 2950 _initializers.accept(visitor);
2689 safelyVisitChild(_body, visitor); 2951 safelyVisitChild(_body, visitor);
2690 } 2952 }
2691 Token get firstTokenAfterCommentAndMetadata { 2953 Token get firstTokenAfterCommentAndMetadata {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2743 Expression _expression; 3005 Expression _expression;
2744 /** 3006 /**
2745 * Initialize a newly created field initializer to initialize the field with t he given name to the 3007 * Initialize a newly created field initializer to initialize the field with t he given name to the
2746 * value of the given expression. 3008 * value of the given expression.
2747 * @param keyword the token for the 'this' keyword 3009 * @param keyword the token for the 'this' keyword
2748 * @param period the token for the period after the 'this' keyword 3010 * @param period the token for the period after the 'this' keyword
2749 * @param fieldName the name of the field being initialized 3011 * @param fieldName the name of the field being initialized
2750 * @param equals the token for the equal sign between the field name and the e xpression 3012 * @param equals the token for the equal sign between the field name and the e xpression
2751 * @param expression the expression computing the value to which the field wil l be initialized 3013 * @param expression the expression computing the value to which the field wil l be initialized
2752 */ 3014 */
2753 ConstructorFieldInitializer(Token keyword, Token period, SimpleIdentifier fiel dName, Token equals, Expression expression) { 3015 ConstructorFieldInitializer.full(Token keyword, Token period, SimpleIdentifier fieldName, Token equals, Expression expression) {
2754 this._keyword = keyword; 3016 this._keyword = keyword;
2755 this._period = period; 3017 this._period = period;
2756 this._fieldName = becomeParentOf(fieldName); 3018 this._fieldName = becomeParentOf(fieldName);
2757 this._equals = equals; 3019 this._equals = equals;
2758 this._expression = becomeParentOf(expression); 3020 this._expression = becomeParentOf(expression);
2759 } 3021 }
3022 /**
3023 * Initialize a newly created field initializer to initialize the field with t he given name to the
3024 * value of the given expression.
3025 * @param keyword the token for the 'this' keyword
3026 * @param period the token for the period after the 'this' keyword
3027 * @param fieldName the name of the field being initialized
3028 * @param equals the token for the equal sign between the field name and the e xpression
3029 * @param expression the expression computing the value to which the field wil l be initialized
3030 */
3031 ConstructorFieldInitializer({Token keyword, Token period, SimpleIdentifier fie ldName, Token equals, Expression expression}) : this.full(keyword, period, field Name, equals, expression);
2760 accept(ASTVisitor visitor) => visitor.visitConstructorFieldInitializer(this); 3032 accept(ASTVisitor visitor) => visitor.visitConstructorFieldInitializer(this);
2761 Token get beginToken { 3033 Token get beginToken {
2762 if (_keyword != null) { 3034 if (_keyword != null) {
2763 return _keyword; 3035 return _keyword;
2764 } 3036 }
2765 return _fieldName.beginToken; 3037 return _fieldName.beginToken;
2766 } 3038 }
2767 Token get endToken => _expression.endToken; 3039 Token get endToken => _expression.endToken;
2768 /** 3040 /**
2769 * Return the token for the equal sign between the field name and the expressi on. 3041 * Return the token for the equal sign between the field name and the expressi on.
(...skipping 18 matching lines...) Expand all
2788 /** 3060 /**
2789 * Return the token for the period after the 'this' keyword, or {@code null} i f there is no 'this' 3061 * Return the token for the period after the 'this' keyword, or {@code null} i f there is no 'this'
2790 * keyword. 3062 * keyword.
2791 * @return the token for the period after the 'this' keyword 3063 * @return the token for the period after the 'this' keyword
2792 */ 3064 */
2793 Token get period => _period; 3065 Token get period => _period;
2794 /** 3066 /**
2795 * Set the token for the equal sign between the field name and the expression to the given token. 3067 * Set the token for the equal sign between the field name and the expression to the given token.
2796 * @param equals the token for the equal sign between the field name and the e xpression 3068 * @param equals the token for the equal sign between the field name and the e xpression
2797 */ 3069 */
2798 void set equals5(Token equals) { 3070 void set equals(Token equals5) {
2799 this._equals = equals; 3071 this._equals = equals5;
2800 } 3072 }
2801 /** 3073 /**
2802 * Set the expression computing the value to which the field will be initializ ed to the given 3074 * Set the expression computing the value to which the field will be initializ ed to the given
2803 * expression. 3075 * expression.
2804 * @param expression the expression computing the value to which the field wil l be initialized 3076 * @param expression the expression computing the value to which the field wil l be initialized
2805 */ 3077 */
2806 void set expression3(Expression expression) { 3078 void set expression(Expression expression3) {
2807 this._expression = becomeParentOf(expression); 3079 this._expression = becomeParentOf(expression3);
2808 } 3080 }
2809 /** 3081 /**
2810 * Set the name of the field being initialized to the given identifier. 3082 * Set the name of the field being initialized to the given identifier.
2811 * @param identifier the name of the field being initialized 3083 * @param identifier the name of the field being initialized
2812 */ 3084 */
2813 void set fieldName2(SimpleIdentifier identifier) { 3085 void set fieldName(SimpleIdentifier identifier) {
2814 _fieldName = becomeParentOf(identifier); 3086 _fieldName = becomeParentOf(identifier);
2815 } 3087 }
2816 /** 3088 /**
2817 * Set the token for the 'this' keyword to the given token. 3089 * Set the token for the 'this' keyword to the given token.
2818 * @param keyword the token for the 'this' keyword 3090 * @param keyword the token for the 'this' keyword
2819 */ 3091 */
2820 void set keyword6(Token keyword) { 3092 void set keyword(Token keyword6) {
2821 this._keyword = keyword; 3093 this._keyword = keyword6;
2822 } 3094 }
2823 /** 3095 /**
2824 * Set the token for the period after the 'this' keyword to the given token. 3096 * Set the token for the period after the 'this' keyword to the given token.
2825 * @param period the token for the period after the 'this' keyword 3097 * @param period the token for the period after the 'this' keyword
2826 */ 3098 */
2827 void set period4(Token period) { 3099 void set period(Token period4) {
2828 this._period = period; 3100 this._period = period4;
2829 } 3101 }
2830 void visitChildren(ASTVisitor<Object> visitor) { 3102 void visitChildren(ASTVisitor<Object> visitor) {
2831 safelyVisitChild(_fieldName, visitor); 3103 safelyVisitChild(_fieldName, visitor);
2832 safelyVisitChild(_expression, visitor); 3104 safelyVisitChild(_expression, visitor);
2833 } 3105 }
2834 } 3106 }
2835 /** 3107 /**
2836 * Instances of the class {@code ConstructorInitializer} defines the behavior of nodes that can 3108 * Instances of the class {@code ConstructorInitializer} defines the behavior of nodes that can
2837 * occur in the initializer list of a constructor declaration. 3109 * occur in the initializer list of a constructor declaration.
2838 * <pre> 3110 * <pre>
(...skipping 27 matching lines...) Expand all
2866 * The element associated with this constructor name, or {@code null} if the A ST structure has not 3138 * The element associated with this constructor name, or {@code null} if the A ST structure has not
2867 * been resolved or if this constructor name could not be resolved. 3139 * been resolved or if this constructor name could not be resolved.
2868 */ 3140 */
2869 ConstructorElement _element; 3141 ConstructorElement _element;
2870 /** 3142 /**
2871 * Initialize a newly created constructor name. 3143 * Initialize a newly created constructor name.
2872 * @param type the name of the type defining the constructor 3144 * @param type the name of the type defining the constructor
2873 * @param period the token for the period before the constructor name 3145 * @param period the token for the period before the constructor name
2874 * @param name the name of the constructor 3146 * @param name the name of the constructor
2875 */ 3147 */
2876 ConstructorName(TypeName type, Token period, SimpleIdentifier name) { 3148 ConstructorName.full(TypeName type, Token period, SimpleIdentifier name) {
2877 this._type = becomeParentOf(type); 3149 this._type = becomeParentOf(type);
2878 this._period = period; 3150 this._period = period;
2879 this._name = becomeParentOf(name); 3151 this._name = becomeParentOf(name);
2880 } 3152 }
3153 /**
3154 * Initialize a newly created constructor name.
3155 * @param type the name of the type defining the constructor
3156 * @param period the token for the period before the constructor name
3157 * @param name the name of the constructor
3158 */
3159 ConstructorName({TypeName type, Token period, SimpleIdentifier name}) : this.f ull(type, period, name);
2881 accept(ASTVisitor visitor) => visitor.visitConstructorName(this); 3160 accept(ASTVisitor visitor) => visitor.visitConstructorName(this);
2882 Token get beginToken => _type.beginToken; 3161 Token get beginToken => _type.beginToken;
2883 /** 3162 /**
2884 * Return the element associated with this constructor name, or {@code null} i f the AST structure 3163 * Return the element associated with this constructor name, or {@code null} i f the AST structure
2885 * has not been resolved or if this constructor name could not be resolved. 3164 * has not been resolved or if this constructor name could not be resolved.
2886 * @return the element associated with this constructor name 3165 * @return the element associated with this constructor name
2887 */ 3166 */
2888 ConstructorElement get element => _element; 3167 ConstructorElement get element => _element;
2889 Token get endToken { 3168 Token get endToken {
2890 if (_name != null) { 3169 if (_name != null) {
(...skipping 15 matching lines...) Expand all
2906 Token get period => _period; 3185 Token get period => _period;
2907 /** 3186 /**
2908 * Return the name of the type defining the constructor. 3187 * Return the name of the type defining the constructor.
2909 * @return the name of the type defining the constructor 3188 * @return the name of the type defining the constructor
2910 */ 3189 */
2911 TypeName get type => _type; 3190 TypeName get type => _type;
2912 /** 3191 /**
2913 * Set the element associated with this constructor name to the given element. 3192 * Set the element associated with this constructor name to the given element.
2914 * @param element the element associated with this constructor name 3193 * @param element the element associated with this constructor name
2915 */ 3194 */
2916 void set element6(ConstructorElement element) { 3195 void set element(ConstructorElement element7) {
2917 this._element = element; 3196 this._element = element7;
2918 } 3197 }
2919 /** 3198 /**
2920 * Set the name of the constructor to the given name. 3199 * Set the name of the constructor to the given name.
2921 * @param name the name of the constructor 3200 * @param name the name of the constructor
2922 */ 3201 */
2923 void set name6(SimpleIdentifier name) { 3202 void set name(SimpleIdentifier name4) {
2924 this._name = becomeParentOf(name); 3203 this._name = becomeParentOf(name4);
2925 } 3204 }
2926 /** 3205 /**
2927 * Return the token for the period before the constructor name to the given to ken. 3206 * Return the token for the period before the constructor name to the given to ken.
2928 * @param period the token for the period before the constructor name 3207 * @param period the token for the period before the constructor name
2929 */ 3208 */
2930 void set period5(Token period) { 3209 void set period(Token period5) {
2931 this._period = period; 3210 this._period = period5;
2932 } 3211 }
2933 /** 3212 /**
2934 * Set the name of the type defining the constructor to the given type name. 3213 * Set the name of the type defining the constructor to the given type name.
2935 * @param type the name of the type defining the constructor 3214 * @param type the name of the type defining the constructor
2936 */ 3215 */
2937 void set type3(TypeName type) { 3216 void set type(TypeName type2) {
2938 this._type = becomeParentOf(type); 3217 this._type = becomeParentOf(type2);
2939 } 3218 }
2940 void visitChildren(ASTVisitor<Object> visitor) { 3219 void visitChildren(ASTVisitor<Object> visitor) {
2941 safelyVisitChild(_type, visitor); 3220 safelyVisitChild(_type, visitor);
2942 safelyVisitChild(_name, visitor); 3221 safelyVisitChild(_name, visitor);
2943 } 3222 }
2944 } 3223 }
2945 /** 3224 /**
2946 * Instances of the class {@code ContinueStatement} represent a continue stateme nt. 3225 * Instances of the class {@code ContinueStatement} represent a continue stateme nt.
2947 * <pre> 3226 * <pre>
2948 * continueStatement ::= 3227 * continueStatement ::=
(...skipping 12 matching lines...) Expand all
2961 /** 3240 /**
2962 * The semicolon terminating the statement. 3241 * The semicolon terminating the statement.
2963 */ 3242 */
2964 Token _semicolon; 3243 Token _semicolon;
2965 /** 3244 /**
2966 * Initialize a newly created continue statement. 3245 * Initialize a newly created continue statement.
2967 * @param keyword the token representing the 'continue' keyword 3246 * @param keyword the token representing the 'continue' keyword
2968 * @param label the label associated with the statement 3247 * @param label the label associated with the statement
2969 * @param semicolon the semicolon terminating the statement 3248 * @param semicolon the semicolon terminating the statement
2970 */ 3249 */
2971 ContinueStatement(Token keyword, SimpleIdentifier label, Token semicolon) { 3250 ContinueStatement.full(Token keyword, SimpleIdentifier label, Token semicolon) {
2972 this._keyword = keyword; 3251 this._keyword = keyword;
2973 this._label = becomeParentOf(label); 3252 this._label = becomeParentOf(label);
2974 this._semicolon = semicolon; 3253 this._semicolon = semicolon;
2975 } 3254 }
3255 /**
3256 * Initialize a newly created continue statement.
3257 * @param keyword the token representing the 'continue' keyword
3258 * @param label the label associated with the statement
3259 * @param semicolon the semicolon terminating the statement
3260 */
3261 ContinueStatement({Token keyword, SimpleIdentifier label, Token semicolon}) : this.full(keyword, label, semicolon);
2976 accept(ASTVisitor visitor) => visitor.visitContinueStatement(this); 3262 accept(ASTVisitor visitor) => visitor.visitContinueStatement(this);
2977 Token get beginToken => _keyword; 3263 Token get beginToken => _keyword;
2978 Token get endToken => _semicolon; 3264 Token get endToken => _semicolon;
2979 /** 3265 /**
2980 * Return the token representing the 'continue' keyword. 3266 * Return the token representing the 'continue' keyword.
2981 * @return the token representing the 'continue' keyword 3267 * @return the token representing the 'continue' keyword
2982 */ 3268 */
2983 Token get keyword => _keyword; 3269 Token get keyword => _keyword;
2984 /** 3270 /**
2985 * Return the label associated with the statement, or {@code null} if there is no label. 3271 * Return the label associated with the statement, or {@code null} if there is no label.
2986 * @return the label associated with the statement 3272 * @return the label associated with the statement
2987 */ 3273 */
2988 SimpleIdentifier get label => _label; 3274 SimpleIdentifier get label => _label;
2989 /** 3275 /**
2990 * Return the semicolon terminating the statement. 3276 * Return the semicolon terminating the statement.
2991 * @return the semicolon terminating the statement 3277 * @return the semicolon terminating the statement
2992 */ 3278 */
2993 Token get semicolon => _semicolon; 3279 Token get semicolon => _semicolon;
2994 /** 3280 /**
2995 * Set the token representing the 'continue' keyword to the given token. 3281 * Set the token representing the 'continue' keyword to the given token.
2996 * @param keyword the token representing the 'continue' keyword 3282 * @param keyword the token representing the 'continue' keyword
2997 */ 3283 */
2998 void set keyword7(Token keyword) { 3284 void set keyword(Token keyword7) {
2999 this._keyword = keyword; 3285 this._keyword = keyword7;
3000 } 3286 }
3001 /** 3287 /**
3002 * Set the label associated with the statement to the given label. 3288 * Set the label associated with the statement to the given label.
3003 * @param identifier the label associated with the statement 3289 * @param identifier the label associated with the statement
3004 */ 3290 */
3005 void set label3(SimpleIdentifier identifier) { 3291 void set label(SimpleIdentifier identifier) {
3006 _label = becomeParentOf(identifier); 3292 _label = becomeParentOf(identifier);
3007 } 3293 }
3008 /** 3294 /**
3009 * Set the semicolon terminating the statement to the given token. 3295 * Set the semicolon terminating the statement to the given token.
3010 * @param semicolon the semicolon terminating the statement 3296 * @param semicolon the semicolon terminating the statement
3011 */ 3297 */
3012 void set semicolon4(Token semicolon) { 3298 void set semicolon(Token semicolon4) {
3013 this._semicolon = semicolon; 3299 this._semicolon = semicolon4;
3014 } 3300 }
3015 void visitChildren(ASTVisitor<Object> visitor) { 3301 void visitChildren(ASTVisitor<Object> visitor) {
3016 safelyVisitChild(_label, visitor); 3302 safelyVisitChild(_label, visitor);
3017 } 3303 }
3018 } 3304 }
3019 /** 3305 /**
3020 * The abstract class {@code Declaration} defines the behavior common to nodes t hat represent the 3306 * The abstract class {@code Declaration} defines the behavior common to nodes t hat represent the
3021 * declaration of a name. Each declared name is visible within a name scope. 3307 * declaration of a name. Each declared name is visible within a name scope.
3022 */ 3308 */
3023 abstract class Declaration extends AnnotatedNode { 3309 abstract class Declaration extends AnnotatedNode {
3024 /** 3310 /**
3025 * Initialize a newly created declaration. 3311 * Initialize a newly created declaration.
3026 * @param comment the documentation comment associated with this declaration 3312 * @param comment the documentation comment associated with this declaration
3027 * @param metadata the annotations associated with this declaration 3313 * @param metadata the annotations associated with this declaration
3028 */ 3314 */
3029 Declaration(Comment comment, List<Annotation> metadata) : super(comment, metad ata) { 3315 Declaration.full(Comment comment, List<Annotation> metadata) : super.full(comm ent, metadata) {
3030 } 3316 }
3317 /**
3318 * Initialize a newly created declaration.
3319 * @param comment the documentation comment associated with this declaration
3320 * @param metadata the annotations associated with this declaration
3321 */
3322 Declaration({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata);
3031 } 3323 }
3032 /** 3324 /**
3033 * Instances of the class {@code DefaultFormalParameter} represent a formal para meter with a default 3325 * Instances of the class {@code DefaultFormalParameter} represent a formal para meter with a default
3034 * value. There are two kinds of parameters that are both represented by this cl ass: named formal 3326 * value. There are two kinds of parameters that are both represented by this cl ass: named formal
3035 * parameters and positional formal parameters. 3327 * parameters and positional formal parameters.
3036 * <pre> 3328 * <pre>
3037 * defaultFormalParameter ::={@link NormalFormalParameter normalFormalParameter} ('=' {@link Expression defaultValue})? 3329 * defaultFormalParameter ::={@link NormalFormalParameter normalFormalParameter} ('=' {@link Expression defaultValue})?
3038 * defaultNamedParameter ::={@link NormalFormalParameter normalFormalParameter} (':' {@link Expression defaultValue})? 3330 * defaultNamedParameter ::={@link NormalFormalParameter normalFormalParameter} (':' {@link Expression defaultValue})?
3039 * </pre> 3331 * </pre>
3040 */ 3332 */
(...skipping 16 matching lines...) Expand all
3057 * default value. 3349 * default value.
3058 */ 3350 */
3059 Expression _defaultValue; 3351 Expression _defaultValue;
3060 /** 3352 /**
3061 * Initialize a newly created default formal parameter. 3353 * Initialize a newly created default formal parameter.
3062 * @param parameter the formal parameter with which the default value is assoc iated 3354 * @param parameter the formal parameter with which the default value is assoc iated
3063 * @param kind the kind of this parameter 3355 * @param kind the kind of this parameter
3064 * @param separator the token separating the parameter from the default value 3356 * @param separator the token separating the parameter from the default value
3065 * @param defaultValue the expression computing the default value for the para meter 3357 * @param defaultValue the expression computing the default value for the para meter
3066 */ 3358 */
3067 DefaultFormalParameter(NormalFormalParameter parameter, ParameterKind kind, To ken separator, Expression defaultValue) { 3359 DefaultFormalParameter.full(NormalFormalParameter parameter, ParameterKind kin d, Token separator, Expression defaultValue) {
3068 this._parameter = becomeParentOf(parameter); 3360 this._parameter = becomeParentOf(parameter);
3069 this._kind = kind; 3361 this._kind = kind;
3070 this._separator = separator; 3362 this._separator = separator;
3071 this._defaultValue = becomeParentOf(defaultValue); 3363 this._defaultValue = becomeParentOf(defaultValue);
3072 } 3364 }
3365 /**
3366 * Initialize a newly created default formal parameter.
3367 * @param parameter the formal parameter with which the default value is assoc iated
3368 * @param kind the kind of this parameter
3369 * @param separator the token separating the parameter from the default value
3370 * @param defaultValue the expression computing the default value for the para meter
3371 */
3372 DefaultFormalParameter({NormalFormalParameter parameter, ParameterKind kind, T oken separator, Expression defaultValue}) : this.full(parameter, kind, separator , defaultValue);
3073 accept(ASTVisitor visitor) => visitor.visitDefaultFormalParameter(this); 3373 accept(ASTVisitor visitor) => visitor.visitDefaultFormalParameter(this);
3074 Token get beginToken => _parameter.beginToken; 3374 Token get beginToken => _parameter.beginToken;
3075 /** 3375 /**
3076 * Return the expression computing the default value for the parameter, or {@c ode null} if there 3376 * Return the expression computing the default value for the parameter, or {@c ode null} if there
3077 * is no default value. 3377 * is no default value.
3078 * @return the expression computing the default value for the parameter 3378 * @return the expression computing the default value for the parameter
3079 */ 3379 */
3080 Expression get defaultValue => _defaultValue; 3380 Expression get defaultValue => _defaultValue;
3081 Token get endToken { 3381 Token get endToken {
3082 if (_defaultValue != null) { 3382 if (_defaultValue != null) {
(...skipping 21 matching lines...) Expand all
3104 bool isConst() => _parameter != null && _parameter.isConst(); 3404 bool isConst() => _parameter != null && _parameter.isConst();
3105 /** 3405 /**
3106 * Return {@code true} if this parameter is a final parameter. 3406 * Return {@code true} if this parameter is a final parameter.
3107 * @return {@code true} if this parameter is a final parameter 3407 * @return {@code true} if this parameter is a final parameter
3108 */ 3408 */
3109 bool isFinal() => _parameter != null && _parameter.isFinal(); 3409 bool isFinal() => _parameter != null && _parameter.isFinal();
3110 /** 3410 /**
3111 * Set the expression computing the default value for the parameter to the giv en expression. 3411 * Set the expression computing the default value for the parameter to the giv en expression.
3112 * @param expression the expression computing the default value for the parame ter 3412 * @param expression the expression computing the default value for the parame ter
3113 */ 3413 */
3114 void set defaultValue2(Expression expression) { 3414 void set defaultValue(Expression expression) {
3115 _defaultValue = becomeParentOf(expression); 3415 _defaultValue = becomeParentOf(expression);
3116 } 3416 }
3117 /** 3417 /**
3118 * Set the kind of this parameter to the given kind. 3418 * Set the kind of this parameter to the given kind.
3119 * @param kind the kind of this parameter 3419 * @param kind the kind of this parameter
3120 */ 3420 */
3121 void set kind2(ParameterKind kind) { 3421 void set kind(ParameterKind kind2) {
3122 this._kind = kind; 3422 this._kind = kind2;
3123 } 3423 }
3124 /** 3424 /**
3125 * Set the formal parameter with which the default value is associated to the given parameter. 3425 * Set the formal parameter with which the default value is associated to the given parameter.
3126 * @param formalParameter the formal parameter with which the default value is associated 3426 * @param formalParameter the formal parameter with which the default value is associated
3127 */ 3427 */
3128 void set parameter2(NormalFormalParameter formalParameter) { 3428 void set parameter(NormalFormalParameter formalParameter) {
3129 _parameter = becomeParentOf(formalParameter); 3429 _parameter = becomeParentOf(formalParameter);
3130 } 3430 }
3131 /** 3431 /**
3132 * Set the token separating the parameter from the default value to the given token. 3432 * Set the token separating the parameter from the default value to the given token.
3133 * @param separator the token separating the parameter from the default value 3433 * @param separator the token separating the parameter from the default value
3134 */ 3434 */
3135 void set separator3(Token separator) { 3435 void set separator(Token separator3) {
3136 this._separator = separator; 3436 this._separator = separator3;
3137 } 3437 }
3138 void visitChildren(ASTVisitor<Object> visitor) { 3438 void visitChildren(ASTVisitor<Object> visitor) {
3139 safelyVisitChild(_parameter, visitor); 3439 safelyVisitChild(_parameter, visitor);
3140 safelyVisitChild(_defaultValue, visitor); 3440 safelyVisitChild(_defaultValue, visitor);
3141 } 3441 }
3142 } 3442 }
3143 /** 3443 /**
3144 * The abstract class {@code Directive} defines the behavior common to nodes tha t represent a 3444 * The abstract class {@code Directive} defines the behavior common to nodes tha t represent a
3145 * directive. 3445 * directive.
3146 * <pre> 3446 * <pre>
3147 * directive ::={@link ExportDirective exportDirective}| {@link ImportDirective importDirective}| {@link LibraryDirective libraryDirective}| {@link PartDirectiv e partDirective}| {@link PartOfDirective partOfDirective}</pre> 3447 * directive ::={@link ExportDirective exportDirective}| {@link ImportDirective importDirective}| {@link LibraryDirective libraryDirective}| {@link PartDirectiv e partDirective}| {@link PartOfDirective partOfDirective}</pre>
3148 */ 3448 */
3149 abstract class Directive extends AnnotatedNode { 3449 abstract class Directive extends AnnotatedNode {
3150 /** 3450 /**
3151 * The element associated with this directive, or {@code null} if the AST stru cture has not been 3451 * The element associated with this directive, or {@code null} if the AST stru cture has not been
3152 * resolved or if this directive could not be resolved. 3452 * resolved or if this directive could not be resolved.
3153 */ 3453 */
3154 Element _element; 3454 Element _element;
3155 /** 3455 /**
3156 * Initialize a newly create directive. 3456 * Initialize a newly create directive.
3157 * @param comment the documentation comment associated with this directive 3457 * @param comment the documentation comment associated with this directive
3158 * @param metadata the annotations associated with the directive 3458 * @param metadata the annotations associated with the directive
3159 */ 3459 */
3160 Directive(Comment comment, List<Annotation> metadata) : super(comment, metadat a) { 3460 Directive.full(Comment comment, List<Annotation> metadata) : super.full(commen t, metadata) {
3161 } 3461 }
3162 /** 3462 /**
3463 * Initialize a newly create directive.
3464 * @param comment the documentation comment associated with this directive
3465 * @param metadata the annotations associated with the directive
3466 */
3467 Directive({Comment comment, List<Annotation> metadata}) : this.full(comment, m etadata);
3468 /**
3163 * Return the element associated with this directive, or {@code null} if the A ST structure has not 3469 * Return the element associated with this directive, or {@code null} if the A ST structure has not
3164 * been resolved or if this directive could not be resolved. Examples of the l atter case include a 3470 * been resolved or if this directive could not be resolved. Examples of the l atter case include a
3165 * directive that contains an invalid URL or a URL that does not exist. 3471 * directive that contains an invalid URL or a URL that does not exist.
3166 * @return the element associated with this directive 3472 * @return the element associated with this directive
3167 */ 3473 */
3168 Element get element => _element; 3474 Element get element => _element;
3169 /** 3475 /**
3170 * Return the token representing the keyword that introduces this directive (' import', 'export', 3476 * Return the token representing the keyword that introduces this directive (' import', 'export',
3171 * 'library' or 'part'). 3477 * 'library' or 'part').
3172 * @return the token representing the keyword that introduces this directive 3478 * @return the token representing the keyword that introduces this directive
3173 */ 3479 */
3174 Token get keyword; 3480 Token get keyword;
3175 /** 3481 /**
3176 * Set the element associated with this directive to the given element. 3482 * Set the element associated with this directive to the given element.
3177 * @param element the element associated with this directive 3483 * @param element the element associated with this directive
3178 */ 3484 */
3179 void set element7(Element element) { 3485 void set element(Element element8) {
3180 this._element = element; 3486 this._element = element8;
3181 } 3487 }
3182 } 3488 }
3183 /** 3489 /**
3184 * Instances of the class {@code DoStatement} represent a do statement. 3490 * Instances of the class {@code DoStatement} represent a do statement.
3185 * <pre> 3491 * <pre>
3186 * doStatement ::= 3492 * doStatement ::=
3187 * 'do' {@link Statement body} 'while' '(' {@link Expression condition} ')' ';' 3493 * 'do' {@link Statement body} 'while' '(' {@link Expression condition} ')' ';'
3188 * </pre> 3494 * </pre>
3189 */ 3495 */
3190 class DoStatement extends Statement { 3496 class DoStatement extends Statement {
(...skipping 28 matching lines...) Expand all
3219 /** 3525 /**
3220 * Initialize a newly created do loop. 3526 * Initialize a newly created do loop.
3221 * @param doKeyword the token representing the 'do' keyword 3527 * @param doKeyword the token representing the 'do' keyword
3222 * @param body the body of the loop 3528 * @param body the body of the loop
3223 * @param whileKeyword the token representing the 'while' keyword 3529 * @param whileKeyword the token representing the 'while' keyword
3224 * @param leftParenthesis the left parenthesis 3530 * @param leftParenthesis the left parenthesis
3225 * @param condition the condition that determines when the loop will terminate 3531 * @param condition the condition that determines when the loop will terminate
3226 * @param rightParenthesis the right parenthesis 3532 * @param rightParenthesis the right parenthesis
3227 * @param semicolon the semicolon terminating the statement 3533 * @param semicolon the semicolon terminating the statement
3228 */ 3534 */
3229 DoStatement(Token doKeyword, Statement body, Token whileKeyword, Token leftPar enthesis, Expression condition, Token rightParenthesis, Token semicolon) { 3535 DoStatement.full(Token doKeyword, Statement body, Token whileKeyword, Token le ftParenthesis, Expression condition, Token rightParenthesis, Token semicolon) {
3230 this._doKeyword = doKeyword; 3536 this._doKeyword = doKeyword;
3231 this._body = becomeParentOf(body); 3537 this._body = becomeParentOf(body);
3232 this._whileKeyword = whileKeyword; 3538 this._whileKeyword = whileKeyword;
3233 this._leftParenthesis = leftParenthesis; 3539 this._leftParenthesis = leftParenthesis;
3234 this._condition = becomeParentOf(condition); 3540 this._condition = becomeParentOf(condition);
3235 this._rightParenthesis = rightParenthesis; 3541 this._rightParenthesis = rightParenthesis;
3236 this._semicolon = semicolon; 3542 this._semicolon = semicolon;
3237 } 3543 }
3544 /**
3545 * Initialize a newly created do loop.
3546 * @param doKeyword the token representing the 'do' keyword
3547 * @param body the body of the loop
3548 * @param whileKeyword the token representing the 'while' keyword
3549 * @param leftParenthesis the left parenthesis
3550 * @param condition the condition that determines when the loop will terminate
3551 * @param rightParenthesis the right parenthesis
3552 * @param semicolon the semicolon terminating the statement
3553 */
3554 DoStatement({Token doKeyword, Statement body, Token whileKeyword, Token leftPa renthesis, Expression condition, Token rightParenthesis, Token semicolon}) : thi s.full(doKeyword, body, whileKeyword, leftParenthesis, condition, rightParenthes is, semicolon);
3238 accept(ASTVisitor visitor) => visitor.visitDoStatement(this); 3555 accept(ASTVisitor visitor) => visitor.visitDoStatement(this);
3239 Token get beginToken => _doKeyword; 3556 Token get beginToken => _doKeyword;
3240 /** 3557 /**
3241 * Return the body of the loop. 3558 * Return the body of the loop.
3242 * @return the body of the loop 3559 * @return the body of the loop
3243 */ 3560 */
3244 Statement get body => _body; 3561 Statement get body => _body;
3245 /** 3562 /**
3246 * Return the condition that determines when the loop will terminate. 3563 * Return the condition that determines when the loop will terminate.
3247 * @return the condition that determines when the loop will terminate 3564 * @return the condition that determines when the loop will terminate
(...skipping 22 matching lines...) Expand all
3270 Token get semicolon => _semicolon; 3587 Token get semicolon => _semicolon;
3271 /** 3588 /**
3272 * Return the token representing the 'while' keyword. 3589 * Return the token representing the 'while' keyword.
3273 * @return the token representing the 'while' keyword 3590 * @return the token representing the 'while' keyword
3274 */ 3591 */
3275 Token get whileKeyword => _whileKeyword; 3592 Token get whileKeyword => _whileKeyword;
3276 /** 3593 /**
3277 * Set the body of the loop to the given statement. 3594 * Set the body of the loop to the given statement.
3278 * @param statement the body of the loop 3595 * @param statement the body of the loop
3279 */ 3596 */
3280 void set body4(Statement statement) { 3597 void set body(Statement statement) {
3281 _body = becomeParentOf(statement); 3598 _body = becomeParentOf(statement);
3282 } 3599 }
3283 /** 3600 /**
3284 * Set the condition that determines when the loop will terminate to the given expression. 3601 * Set the condition that determines when the loop will terminate to the given expression.
3285 * @param expression the condition that determines when the loop will terminat e 3602 * @param expression the condition that determines when the loop will terminat e
3286 */ 3603 */
3287 void set condition4(Expression expression) { 3604 void set condition(Expression expression) {
3288 _condition = becomeParentOf(expression); 3605 _condition = becomeParentOf(expression);
3289 } 3606 }
3290 /** 3607 /**
3291 * Set the token representing the 'do' keyword to the given token. 3608 * Set the token representing the 'do' keyword to the given token.
3292 * @param doKeyword the token representing the 'do' keyword 3609 * @param doKeyword the token representing the 'do' keyword
3293 */ 3610 */
3294 void set doKeyword2(Token doKeyword) { 3611 void set doKeyword(Token doKeyword2) {
3295 this._doKeyword = doKeyword; 3612 this._doKeyword = doKeyword2;
3296 } 3613 }
3297 /** 3614 /**
3298 * Set the left parenthesis to the given token. 3615 * Set the left parenthesis to the given token.
3299 * @param parenthesis the left parenthesis 3616 * @param parenthesis the left parenthesis
3300 */ 3617 */
3301 void set leftParenthesis5(Token parenthesis) { 3618 void set leftParenthesis(Token parenthesis) {
3302 _leftParenthesis = parenthesis; 3619 _leftParenthesis = parenthesis;
3303 } 3620 }
3304 /** 3621 /**
3305 * Set the right parenthesis to the given token. 3622 * Set the right parenthesis to the given token.
3306 * @param parenthesis the right parenthesis 3623 * @param parenthesis the right parenthesis
3307 */ 3624 */
3308 void set rightParenthesis5(Token parenthesis) { 3625 void set rightParenthesis(Token parenthesis) {
3309 _rightParenthesis = parenthesis; 3626 _rightParenthesis = parenthesis;
3310 } 3627 }
3311 /** 3628 /**
3312 * Set the semicolon terminating the statement to the given token. 3629 * Set the semicolon terminating the statement to the given token.
3313 * @param semicolon the semicolon terminating the statement 3630 * @param semicolon the semicolon terminating the statement
3314 */ 3631 */
3315 void set semicolon5(Token semicolon) { 3632 void set semicolon(Token semicolon5) {
3316 this._semicolon = semicolon; 3633 this._semicolon = semicolon5;
3317 } 3634 }
3318 /** 3635 /**
3319 * Set the token representing the 'while' keyword to the given token. 3636 * Set the token representing the 'while' keyword to the given token.
3320 * @param whileKeyword the token representing the 'while' keyword 3637 * @param whileKeyword the token representing the 'while' keyword
3321 */ 3638 */
3322 void set whileKeyword2(Token whileKeyword) { 3639 void set whileKeyword(Token whileKeyword2) {
3323 this._whileKeyword = whileKeyword; 3640 this._whileKeyword = whileKeyword2;
3324 } 3641 }
3325 void visitChildren(ASTVisitor<Object> visitor) { 3642 void visitChildren(ASTVisitor<Object> visitor) {
3326 safelyVisitChild(_body, visitor); 3643 safelyVisitChild(_body, visitor);
3327 safelyVisitChild(_condition, visitor); 3644 safelyVisitChild(_condition, visitor);
3328 } 3645 }
3329 } 3646 }
3330 /** 3647 /**
3331 * Instances of the class {@code DoubleLiteral} represent a floating point liter al expression. 3648 * Instances of the class {@code DoubleLiteral} represent a floating point liter al expression.
3332 * <pre> 3649 * <pre>
3333 * doubleLiteral ::= 3650 * doubleLiteral ::=
(...skipping 10 matching lines...) Expand all
3344 Token _literal; 3661 Token _literal;
3345 /** 3662 /**
3346 * The value of the literal. 3663 * The value of the literal.
3347 */ 3664 */
3348 double _value = 0.0; 3665 double _value = 0.0;
3349 /** 3666 /**
3350 * Initialize a newly created floating point literal. 3667 * Initialize a newly created floating point literal.
3351 * @param literal the token representing the literal 3668 * @param literal the token representing the literal
3352 * @param value the value of the literal 3669 * @param value the value of the literal
3353 */ 3670 */
3354 DoubleLiteral(Token literal, double value) { 3671 DoubleLiteral.full(Token literal, double value) {
3355 this._literal = literal; 3672 this._literal = literal;
3356 this._value = value; 3673 this._value = value;
3357 } 3674 }
3675 /**
3676 * Initialize a newly created floating point literal.
3677 * @param literal the token representing the literal
3678 * @param value the value of the literal
3679 */
3680 DoubleLiteral({Token literal, double value}) : this.full(literal, value);
3358 accept(ASTVisitor visitor) => visitor.visitDoubleLiteral(this); 3681 accept(ASTVisitor visitor) => visitor.visitDoubleLiteral(this);
3359 Token get beginToken => _literal; 3682 Token get beginToken => _literal;
3360 Token get endToken => _literal; 3683 Token get endToken => _literal;
3361 /** 3684 /**
3362 * Return the token representing the literal. 3685 * Return the token representing the literal.
3363 * @return the token representing the literal 3686 * @return the token representing the literal
3364 */ 3687 */
3365 Token get literal => _literal; 3688 Token get literal => _literal;
3366 /** 3689 /**
3367 * Return the value of the literal. 3690 * Return the value of the literal.
3368 * @return the value of the literal 3691 * @return the value of the literal
3369 */ 3692 */
3370 double get value => _value; 3693 double get value => _value;
3371 /** 3694 /**
3372 * Set the token representing the literal to the given token. 3695 * Set the token representing the literal to the given token.
3373 * @param literal the token representing the literal 3696 * @param literal the token representing the literal
3374 */ 3697 */
3375 void set literal3(Token literal) { 3698 void set literal(Token literal3) {
3376 this._literal = literal; 3699 this._literal = literal3;
3377 } 3700 }
3378 /** 3701 /**
3379 * Set the value of the literal to the given value. 3702 * Set the value of the literal to the given value.
3380 * @param value the value of the literal 3703 * @param value the value of the literal
3381 */ 3704 */
3382 void set value5(double value) { 3705 void set value(double value5) {
3383 this._value = value; 3706 this._value = value5;
3384 } 3707 }
3385 void visitChildren(ASTVisitor<Object> visitor) { 3708 void visitChildren(ASTVisitor<Object> visitor) {
3386 } 3709 }
3387 } 3710 }
3388 /** 3711 /**
3389 * Instances of the class {@code EmptyFunctionBody} represent an empty function body, which can only 3712 * Instances of the class {@code EmptyFunctionBody} represent an empty function body, which can only
3390 * appear in constructors or abstract methods. 3713 * appear in constructors or abstract methods.
3391 * <pre> 3714 * <pre>
3392 * emptyFunctionBody ::= 3715 * emptyFunctionBody ::=
3393 * ';' 3716 * ';'
3394 * </pre> 3717 * </pre>
3395 */ 3718 */
3396 class EmptyFunctionBody extends FunctionBody { 3719 class EmptyFunctionBody extends FunctionBody {
3397 /** 3720 /**
3398 * The token representing the semicolon that marks the end of the function bod y. 3721 * The token representing the semicolon that marks the end of the function bod y.
3399 */ 3722 */
3400 Token _semicolon; 3723 Token _semicolon;
3401 /** 3724 /**
3402 * Initialize a newly created function body. 3725 * Initialize a newly created function body.
3403 * @param semicolon the token representing the semicolon that marks the end of the function body 3726 * @param semicolon the token representing the semicolon that marks the end of the function body
3404 */ 3727 */
3405 EmptyFunctionBody(Token semicolon) { 3728 EmptyFunctionBody.full(Token semicolon) {
3406 this._semicolon = semicolon; 3729 this._semicolon = semicolon;
3407 } 3730 }
3731 /**
3732 * Initialize a newly created function body.
3733 * @param semicolon the token representing the semicolon that marks the end of the function body
3734 */
3735 EmptyFunctionBody({Token semicolon}) : this.full(semicolon);
3408 accept(ASTVisitor visitor) => visitor.visitEmptyFunctionBody(this); 3736 accept(ASTVisitor visitor) => visitor.visitEmptyFunctionBody(this);
3409 Token get beginToken => _semicolon; 3737 Token get beginToken => _semicolon;
3410 Token get endToken => _semicolon; 3738 Token get endToken => _semicolon;
3411 /** 3739 /**
3412 * Return the token representing the semicolon that marks the end of the funct ion body. 3740 * Return the token representing the semicolon that marks the end of the funct ion body.
3413 * @return the token representing the semicolon that marks the end of the func tion body 3741 * @return the token representing the semicolon that marks the end of the func tion body
3414 */ 3742 */
3415 Token get semicolon => _semicolon; 3743 Token get semicolon => _semicolon;
3416 /** 3744 /**
3417 * Set the token representing the semicolon that marks the end of the function body to the given 3745 * Set the token representing the semicolon that marks the end of the function body to the given
3418 * token. 3746 * token.
3419 * @param semicolon the token representing the semicolon that marks the end of the function body 3747 * @param semicolon the token representing the semicolon that marks the end of the function body
3420 */ 3748 */
3421 void set semicolon6(Token semicolon) { 3749 void set semicolon(Token semicolon6) {
3422 this._semicolon = semicolon; 3750 this._semicolon = semicolon6;
3423 } 3751 }
3424 void visitChildren(ASTVisitor<Object> visitor) { 3752 void visitChildren(ASTVisitor<Object> visitor) {
3425 } 3753 }
3426 } 3754 }
3427 /** 3755 /**
3428 * Instances of the class {@code EmptyStatement} represent an empty statement. 3756 * Instances of the class {@code EmptyStatement} represent an empty statement.
3429 * <pre> 3757 * <pre>
3430 * emptyStatement ::= 3758 * emptyStatement ::=
3431 * ';' 3759 * ';'
3432 * </pre> 3760 * </pre>
3433 */ 3761 */
3434 class EmptyStatement extends Statement { 3762 class EmptyStatement extends Statement {
3435 /** 3763 /**
3436 * The semicolon terminating the statement. 3764 * The semicolon terminating the statement.
3437 */ 3765 */
3438 Token _semicolon; 3766 Token _semicolon;
3439 /** 3767 /**
3440 * Initialize a newly created empty statement. 3768 * Initialize a newly created empty statement.
3441 * @param semicolon the semicolon terminating the statement 3769 * @param semicolon the semicolon terminating the statement
3442 */ 3770 */
3443 EmptyStatement(Token semicolon) { 3771 EmptyStatement.full(Token semicolon) {
3444 this._semicolon = semicolon; 3772 this._semicolon = semicolon;
3445 } 3773 }
3774 /**
3775 * Initialize a newly created empty statement.
3776 * @param semicolon the semicolon terminating the statement
3777 */
3778 EmptyStatement({Token semicolon}) : this.full(semicolon);
3446 accept(ASTVisitor visitor) => visitor.visitEmptyStatement(this); 3779 accept(ASTVisitor visitor) => visitor.visitEmptyStatement(this);
3447 Token get beginToken => _semicolon; 3780 Token get beginToken => _semicolon;
3448 Token get endToken => _semicolon; 3781 Token get endToken => _semicolon;
3449 /** 3782 /**
3450 * Return the semicolon terminating the statement. 3783 * Return the semicolon terminating the statement.
3451 * @return the semicolon terminating the statement 3784 * @return the semicolon terminating the statement
3452 */ 3785 */
3453 Token get semicolon => _semicolon; 3786 Token get semicolon => _semicolon;
3454 /** 3787 /**
3455 * Set the semicolon terminating the statement to the given token. 3788 * Set the semicolon terminating the statement to the given token.
3456 * @param semicolon the semicolon terminating the statement 3789 * @param semicolon the semicolon terminating the statement
3457 */ 3790 */
3458 void set semicolon7(Token semicolon) { 3791 void set semicolon(Token semicolon7) {
3459 this._semicolon = semicolon; 3792 this._semicolon = semicolon7;
3460 } 3793 }
3461 void visitChildren(ASTVisitor<Object> visitor) { 3794 void visitChildren(ASTVisitor<Object> visitor) {
3462 } 3795 }
3463 } 3796 }
3464 /** 3797 /**
3465 * Instances of the class {@code ExportDirective} represent an export directive. 3798 * Instances of the class {@code ExportDirective} represent an export directive.
3466 * <pre> 3799 * <pre>
3467 * exportDirective ::={@link Annotation metadata} 'export' {@link StringLiteral libraryUri} {@link Combinator combinator}* ';' 3800 * exportDirective ::={@link Annotation metadata} 'export' {@link StringLiteral libraryUri} {@link Combinator combinator}* ';'
3468 * </pre> 3801 * </pre>
3469 */ 3802 */
3470 class ExportDirective extends NamespaceDirective { 3803 class ExportDirective extends NamespaceDirective {
3471 /** 3804 /**
3472 * Initialize a newly created export directive. 3805 * Initialize a newly created export directive.
3473 * @param comment the documentation comment associated with this directive 3806 * @param comment the documentation comment associated with this directive
3474 * @param metadata the annotations associated with the directive 3807 * @param metadata the annotations associated with the directive
3475 * @param keyword the token representing the 'export' keyword 3808 * @param keyword the token representing the 'export' keyword
3476 * @param libraryUri the URI of the library being exported 3809 * @param libraryUri the URI of the library being exported
3477 * @param combinators the combinators used to control which names are exported 3810 * @param combinators the combinators used to control which names are exported
3478 * @param semicolon the semicolon terminating the directive 3811 * @param semicolon the semicolon terminating the directive
3479 */ 3812 */
3480 ExportDirective(Comment comment, List<Annotation> metadata, Token keyword, Str ingLiteral libraryUri, List<Combinator> combinators, Token semicolon) : super(co mment, metadata, keyword, libraryUri, combinators, semicolon) { 3813 ExportDirective.full(Comment comment, List<Annotation> metadata, Token keyword , StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) : sup er.full(comment, metadata, keyword, libraryUri, combinators, semicolon) {
3481 } 3814 }
3815 /**
3816 * Initialize a newly created export directive.
3817 * @param comment the documentation comment associated with this directive
3818 * @param metadata the annotations associated with the directive
3819 * @param keyword the token representing the 'export' keyword
3820 * @param libraryUri the URI of the library being exported
3821 * @param combinators the combinators used to control which names are exported
3822 * @param semicolon the semicolon terminating the directive
3823 */
3824 ExportDirective({Comment comment, List<Annotation> metadata, Token keyword, St ringLiteral libraryUri, List<Combinator> combinators, Token semicolon}) : this.f ull(comment, metadata, keyword, libraryUri, combinators, semicolon);
3482 accept(ASTVisitor visitor) => visitor.visitExportDirective(this); 3825 accept(ASTVisitor visitor) => visitor.visitExportDirective(this);
3483 void visitChildren(ASTVisitor<Object> visitor) { 3826 void visitChildren(ASTVisitor<Object> visitor) {
3484 super.visitChildren(visitor); 3827 super.visitChildren(visitor);
3485 safelyVisitChild(libraryUri, visitor);
3486 combinators.accept(visitor); 3828 combinators.accept(visitor);
3487 } 3829 }
3488 } 3830 }
3489 /** 3831 /**
3490 * Instances of the class {@code Expression} defines the behavior common to node s that represent an 3832 * Instances of the class {@code Expression} defines the behavior common to node s that represent an
3491 * expression. 3833 * expression.
3492 * <pre> 3834 * <pre>
3493 * expression ::={@link AssignmentExpression assignmentExpression}| {@link Condi tionalExpression conditionalExpression} cascadeSection 3835 * expression ::={@link AssignmentExpression assignmentExpression}| {@link Condi tionalExpression conditionalExpression} cascadeSection
3494 * | {@link ThrowExpression throwExpression}</pre> 3836 * | {@link ThrowExpression throwExpression}</pre>
3495 */ 3837 */
(...skipping 21 matching lines...) Expand all
3517 Type2 get staticType => _staticType; 3859 Type2 get staticType => _staticType;
3518 /** 3860 /**
3519 * Return {@code true} if this expression is syntactically valid for the LHS o f an{@link AssignmentExpression assignment expression}. 3861 * Return {@code true} if this expression is syntactically valid for the LHS o f an{@link AssignmentExpression assignment expression}.
3520 * @return {@code true} if this expression matches the {@code assignableExpres sion} production 3862 * @return {@code true} if this expression matches the {@code assignableExpres sion} production
3521 */ 3863 */
3522 bool isAssignable() => false; 3864 bool isAssignable() => false;
3523 /** 3865 /**
3524 * Set the propagated type of this expression to the given type. 3866 * Set the propagated type of this expression to the given type.
3525 * @param propagatedType the propagated type of this expression 3867 * @param propagatedType the propagated type of this expression
3526 */ 3868 */
3527 void set propagatedType2(Type2 propagatedType) { 3869 void set propagatedType(Type2 propagatedType2) {
3528 this._propagatedType = propagatedType; 3870 this._propagatedType = propagatedType2;
3529 } 3871 }
3530 /** 3872 /**
3531 * Set the static type of this expression to the given type. 3873 * Set the static type of this expression to the given type.
3532 * @param staticType the static type of this expression 3874 * @param staticType the static type of this expression
3533 */ 3875 */
3534 void set staticType2(Type2 staticType) { 3876 void set staticType(Type2 staticType2) {
3535 this._staticType = staticType; 3877 this._staticType = staticType2;
3536 } 3878 }
3537 } 3879 }
3538 /** 3880 /**
3539 * Instances of the class {@code ExpressionFunctionBody} represent a function bo dy consisting of a 3881 * Instances of the class {@code ExpressionFunctionBody} represent a function bo dy consisting of a
3540 * single expression. 3882 * single expression.
3541 * <pre> 3883 * <pre>
3542 * expressionFunctionBody ::= 3884 * expressionFunctionBody ::=
3543 * '=>' {@link Expression expression} ';' 3885 * '=>' {@link Expression expression} ';'
3544 * </pre> 3886 * </pre>
3545 */ 3887 */
(...skipping 10 matching lines...) Expand all
3556 * The semicolon terminating the statement. 3898 * The semicolon terminating the statement.
3557 */ 3899 */
3558 Token _semicolon; 3900 Token _semicolon;
3559 /** 3901 /**
3560 * Initialize a newly created function body consisting of a block of statement s. 3902 * Initialize a newly created function body consisting of a block of statement s.
3561 * @param functionDefinition the token introducing the expression that represe nts the body of the 3903 * @param functionDefinition the token introducing the expression that represe nts the body of the
3562 * function 3904 * function
3563 * @param expression the expression representing the body of the function 3905 * @param expression the expression representing the body of the function
3564 * @param semicolon the semicolon terminating the statement 3906 * @param semicolon the semicolon terminating the statement
3565 */ 3907 */
3566 ExpressionFunctionBody(Token functionDefinition, Expression expression, Token semicolon) { 3908 ExpressionFunctionBody.full(Token functionDefinition, Expression expression, T oken semicolon) {
3567 this._functionDefinition = functionDefinition; 3909 this._functionDefinition = functionDefinition;
3568 this._expression = becomeParentOf(expression); 3910 this._expression = becomeParentOf(expression);
3569 this._semicolon = semicolon; 3911 this._semicolon = semicolon;
3570 } 3912 }
3913 /**
3914 * Initialize a newly created function body consisting of a block of statement s.
3915 * @param functionDefinition the token introducing the expression that represe nts the body of the
3916 * function
3917 * @param expression the expression representing the body of the function
3918 * @param semicolon the semicolon terminating the statement
3919 */
3920 ExpressionFunctionBody({Token functionDefinition, Expression expression, Token semicolon}) : this.full(functionDefinition, expression, semicolon);
3571 accept(ASTVisitor visitor) => visitor.visitExpressionFunctionBody(this); 3921 accept(ASTVisitor visitor) => visitor.visitExpressionFunctionBody(this);
3572 Token get beginToken => _functionDefinition; 3922 Token get beginToken => _functionDefinition;
3573 Token get endToken { 3923 Token get endToken {
3574 if (_semicolon != null) { 3924 if (_semicolon != null) {
3575 return _semicolon; 3925 return _semicolon;
3576 } 3926 }
3577 return _expression.endToken; 3927 return _expression.endToken;
3578 } 3928 }
3579 /** 3929 /**
3580 * Return the expression representing the body of the function. 3930 * Return the expression representing the body of the function.
3581 * @return the expression representing the body of the function 3931 * @return the expression representing the body of the function
3582 */ 3932 */
3583 Expression get expression => _expression; 3933 Expression get expression => _expression;
3584 /** 3934 /**
3585 * Return the token introducing the expression that represents the body of the function. 3935 * Return the token introducing the expression that represents the body of the function.
3586 * @return the function definition token 3936 * @return the function definition token
3587 */ 3937 */
3588 Token get functionDefinition => _functionDefinition; 3938 Token get functionDefinition => _functionDefinition;
3589 /** 3939 /**
3590 * Return the semicolon terminating the statement. 3940 * Return the semicolon terminating the statement.
3591 * @return the semicolon terminating the statement 3941 * @return the semicolon terminating the statement
3592 */ 3942 */
3593 Token get semicolon => _semicolon; 3943 Token get semicolon => _semicolon;
3594 /** 3944 /**
3595 * Set the expression representing the body of the function to the given expre ssion. 3945 * Set the expression representing the body of the function to the given expre ssion.
3596 * @param expression the expression representing the body of the function 3946 * @param expression the expression representing the body of the function
3597 */ 3947 */
3598 void set expression4(Expression expression) { 3948 void set expression(Expression expression4) {
3599 this._expression = becomeParentOf(expression); 3949 this._expression = becomeParentOf(expression4);
3600 } 3950 }
3601 /** 3951 /**
3602 * Set the token introducing the expression that represents the body of the fu nction to the given 3952 * Set the token introducing the expression that represents the body of the fu nction to the given
3603 * token. 3953 * token.
3604 * @param functionDefinition the function definition token 3954 * @param functionDefinition the function definition token
3605 */ 3955 */
3606 void set functionDefinition2(Token functionDefinition) { 3956 void set functionDefinition(Token functionDefinition2) {
3607 this._functionDefinition = functionDefinition; 3957 this._functionDefinition = functionDefinition2;
3608 } 3958 }
3609 /** 3959 /**
3610 * Set the semicolon terminating the statement to the given token. 3960 * Set the semicolon terminating the statement to the given token.
3611 * @param semicolon the semicolon terminating the statement 3961 * @param semicolon the semicolon terminating the statement
3612 */ 3962 */
3613 void set semicolon8(Token semicolon) { 3963 void set semicolon(Token semicolon8) {
3614 this._semicolon = semicolon; 3964 this._semicolon = semicolon8;
3615 } 3965 }
3616 void visitChildren(ASTVisitor<Object> visitor) { 3966 void visitChildren(ASTVisitor<Object> visitor) {
3617 safelyVisitChild(_expression, visitor); 3967 safelyVisitChild(_expression, visitor);
3618 } 3968 }
3619 } 3969 }
3620 /** 3970 /**
3621 * Instances of the class {@code ExpressionStatement} wrap an expression as a st atement. 3971 * Instances of the class {@code ExpressionStatement} wrap an expression as a st atement.
3622 * <pre> 3972 * <pre>
3623 * expressionStatement ::={@link Expression expression}? ';' 3973 * expressionStatement ::={@link Expression expression}? ';'
3624 * </pre> 3974 * </pre>
3625 */ 3975 */
3626 class ExpressionStatement extends Statement { 3976 class ExpressionStatement extends Statement {
3627 /** 3977 /**
3628 * The expression that comprises the statement. 3978 * The expression that comprises the statement.
3629 */ 3979 */
3630 Expression _expression; 3980 Expression _expression;
3631 /** 3981 /**
3632 * The semicolon terminating the statement, or {@code null} if the expression is a function 3982 * The semicolon terminating the statement, or {@code null} if the expression is a function
3633 * expression and isn't followed by a semicolon. 3983 * expression and isn't followed by a semicolon.
3634 */ 3984 */
3635 Token _semicolon; 3985 Token _semicolon;
3636 /** 3986 /**
3637 * Initialize a newly created expression statement. 3987 * Initialize a newly created expression statement.
3638 * @param expression the expression that comprises the statement 3988 * @param expression the expression that comprises the statement
3639 * @param semicolon the semicolon terminating the statement 3989 * @param semicolon the semicolon terminating the statement
3640 */ 3990 */
3641 ExpressionStatement(Expression expression, Token semicolon) { 3991 ExpressionStatement.full(Expression expression, Token semicolon) {
3642 this._expression = becomeParentOf(expression); 3992 this._expression = becomeParentOf(expression);
3643 this._semicolon = semicolon; 3993 this._semicolon = semicolon;
3644 } 3994 }
3995 /**
3996 * Initialize a newly created expression statement.
3997 * @param expression the expression that comprises the statement
3998 * @param semicolon the semicolon terminating the statement
3999 */
4000 ExpressionStatement({Expression expression, Token semicolon}) : this.full(expr ession, semicolon);
3645 accept(ASTVisitor visitor) => visitor.visitExpressionStatement(this); 4001 accept(ASTVisitor visitor) => visitor.visitExpressionStatement(this);
3646 Token get beginToken => _expression.beginToken; 4002 Token get beginToken => _expression.beginToken;
3647 Token get endToken { 4003 Token get endToken {
3648 if (_semicolon != null) { 4004 if (_semicolon != null) {
3649 return _semicolon; 4005 return _semicolon;
3650 } 4006 }
3651 return _expression.endToken; 4007 return _expression.endToken;
3652 } 4008 }
3653 /** 4009 /**
3654 * Return the expression that comprises the statement. 4010 * Return the expression that comprises the statement.
3655 * @return the expression that comprises the statement 4011 * @return the expression that comprises the statement
3656 */ 4012 */
3657 Expression get expression => _expression; 4013 Expression get expression => _expression;
3658 /** 4014 /**
3659 * Return the semicolon terminating the statement. 4015 * Return the semicolon terminating the statement.
3660 * @return the semicolon terminating the statement 4016 * @return the semicolon terminating the statement
3661 */ 4017 */
3662 Token get semicolon => _semicolon; 4018 Token get semicolon => _semicolon;
3663 bool isSynthetic() => _expression.isSynthetic() && _semicolon.isSynthetic(); 4019 bool isSynthetic() => _expression.isSynthetic() && _semicolon.isSynthetic();
3664 /** 4020 /**
3665 * Set the expression that comprises the statement to the given expression. 4021 * Set the expression that comprises the statement to the given expression.
3666 * @param expression the expression that comprises the statement 4022 * @param expression the expression that comprises the statement
3667 */ 4023 */
3668 void set expression5(Expression expression) { 4024 void set expression(Expression expression5) {
3669 this._expression = becomeParentOf(expression); 4025 this._expression = becomeParentOf(expression5);
3670 } 4026 }
3671 /** 4027 /**
3672 * Set the semicolon terminating the statement to the given token. 4028 * Set the semicolon terminating the statement to the given token.
3673 * @param semicolon the semicolon terminating the statement 4029 * @param semicolon the semicolon terminating the statement
3674 */ 4030 */
3675 void set semicolon9(Token semicolon) { 4031 void set semicolon(Token semicolon9) {
3676 this._semicolon = semicolon; 4032 this._semicolon = semicolon9;
3677 } 4033 }
3678 void visitChildren(ASTVisitor<Object> visitor) { 4034 void visitChildren(ASTVisitor<Object> visitor) {
3679 safelyVisitChild(_expression, visitor); 4035 safelyVisitChild(_expression, visitor);
3680 } 4036 }
3681 } 4037 }
3682 /** 4038 /**
3683 * Instances of the class {@code ExtendsClause} represent the "extends" clause i n a class 4039 * Instances of the class {@code ExtendsClause} represent the "extends" clause i n a class
3684 * declaration. 4040 * declaration.
3685 * <pre> 4041 * <pre>
3686 * extendsClause ::= 4042 * extendsClause ::=
3687 * 'extends' {@link TypeName superclass}</pre> 4043 * 'extends' {@link TypeName superclass}</pre>
3688 */ 4044 */
3689 class ExtendsClause extends ASTNode { 4045 class ExtendsClause extends ASTNode {
3690 /** 4046 /**
3691 * The token representing the 'extends' keyword. 4047 * The token representing the 'extends' keyword.
3692 */ 4048 */
3693 Token _keyword; 4049 Token _keyword;
3694 /** 4050 /**
3695 * The name of the class that is being extended. 4051 * The name of the class that is being extended.
3696 */ 4052 */
3697 TypeName _superclass; 4053 TypeName _superclass;
3698 /** 4054 /**
3699 * Initialize a newly created extends clause. 4055 * Initialize a newly created extends clause.
3700 * @param keyword the token representing the 'extends' keyword 4056 * @param keyword the token representing the 'extends' keyword
3701 * @param superclass the name of the class that is being extended 4057 * @param superclass the name of the class that is being extended
3702 */ 4058 */
3703 ExtendsClause(Token keyword, TypeName superclass) { 4059 ExtendsClause.full(Token keyword, TypeName superclass) {
3704 this._keyword = keyword; 4060 this._keyword = keyword;
3705 this._superclass = becomeParentOf(superclass); 4061 this._superclass = becomeParentOf(superclass);
3706 } 4062 }
4063 /**
4064 * Initialize a newly created extends clause.
4065 * @param keyword the token representing the 'extends' keyword
4066 * @param superclass the name of the class that is being extended
4067 */
4068 ExtendsClause({Token keyword, TypeName superclass}) : this.full(keyword, super class);
3707 accept(ASTVisitor visitor) => visitor.visitExtendsClause(this); 4069 accept(ASTVisitor visitor) => visitor.visitExtendsClause(this);
3708 Token get beginToken => _keyword; 4070 Token get beginToken => _keyword;
3709 Token get endToken => _superclass.endToken; 4071 Token get endToken => _superclass.endToken;
3710 /** 4072 /**
3711 * Return the token representing the 'extends' keyword. 4073 * Return the token representing the 'extends' keyword.
3712 * @return the token representing the 'extends' keyword 4074 * @return the token representing the 'extends' keyword
3713 */ 4075 */
3714 Token get keyword => _keyword; 4076 Token get keyword => _keyword;
3715 /** 4077 /**
3716 * Return the name of the class that is being extended. 4078 * Return the name of the class that is being extended.
3717 * @return the name of the class that is being extended 4079 * @return the name of the class that is being extended
3718 */ 4080 */
3719 TypeName get superclass => _superclass; 4081 TypeName get superclass => _superclass;
3720 /** 4082 /**
3721 * Set the token representing the 'extends' keyword to the given token. 4083 * Set the token representing the 'extends' keyword to the given token.
3722 * @param keyword the token representing the 'extends' keyword 4084 * @param keyword the token representing the 'extends' keyword
3723 */ 4085 */
3724 void set keyword8(Token keyword) { 4086 void set keyword(Token keyword8) {
3725 this._keyword = keyword; 4087 this._keyword = keyword8;
3726 } 4088 }
3727 /** 4089 /**
3728 * Set the name of the class that is being extended to the given name. 4090 * Set the name of the class that is being extended to the given name.
3729 * @param name the name of the class that is being extended 4091 * @param name the name of the class that is being extended
3730 */ 4092 */
3731 void set superclass3(TypeName name) { 4093 void set superclass(TypeName name) {
3732 _superclass = becomeParentOf(name); 4094 _superclass = becomeParentOf(name);
3733 } 4095 }
3734 void visitChildren(ASTVisitor<Object> visitor) { 4096 void visitChildren(ASTVisitor<Object> visitor) {
3735 safelyVisitChild(_superclass, visitor); 4097 safelyVisitChild(_superclass, visitor);
3736 } 4098 }
3737 } 4099 }
3738 /** 4100 /**
3739 * Instances of the class {@code FieldDeclaration} represent the declaration of one or more fields 4101 * Instances of the class {@code FieldDeclaration} represent the declaration of one or more fields
3740 * of the same type. 4102 * of the same type.
3741 * <pre> 4103 * <pre>
(...skipping 15 matching lines...) Expand all
3757 */ 4119 */
3758 Token _semicolon; 4120 Token _semicolon;
3759 /** 4121 /**
3760 * Initialize a newly created field declaration. 4122 * Initialize a newly created field declaration.
3761 * @param comment the documentation comment associated with this field 4123 * @param comment the documentation comment associated with this field
3762 * @param metadata the annotations associated with this field 4124 * @param metadata the annotations associated with this field
3763 * @param keyword the token representing the 'static' keyword 4125 * @param keyword the token representing the 'static' keyword
3764 * @param fieldList the fields being declared 4126 * @param fieldList the fields being declared
3765 * @param semicolon the semicolon terminating the declaration 4127 * @param semicolon the semicolon terminating the declaration
3766 */ 4128 */
3767 FieldDeclaration(Comment comment, List<Annotation> metadata, Token keyword, Va riableDeclarationList fieldList, Token semicolon) : super(comment, metadata) { 4129 FieldDeclaration.full(Comment comment, List<Annotation> metadata, Token keywor d, VariableDeclarationList fieldList, Token semicolon) : super.full(comment, met adata) {
3768 this._keyword = keyword; 4130 this._keyword = keyword;
3769 this._fieldList = becomeParentOf(fieldList); 4131 this._fieldList = becomeParentOf(fieldList);
3770 this._semicolon = semicolon; 4132 this._semicolon = semicolon;
3771 } 4133 }
4134 /**
4135 * Initialize a newly created field declaration.
4136 * @param comment the documentation comment associated with this field
4137 * @param metadata the annotations associated with this field
4138 * @param keyword the token representing the 'static' keyword
4139 * @param fieldList the fields being declared
4140 * @param semicolon the semicolon terminating the declaration
4141 */
4142 FieldDeclaration({Comment comment, List<Annotation> metadata, Token keyword, V ariableDeclarationList fieldList, Token semicolon}) : this.full(comment, metadat a, keyword, fieldList, semicolon);
3772 accept(ASTVisitor visitor) => visitor.visitFieldDeclaration(this); 4143 accept(ASTVisitor visitor) => visitor.visitFieldDeclaration(this);
3773 Token get endToken => _semicolon; 4144 Token get endToken => _semicolon;
3774 /** 4145 /**
3775 * Return the fields being declared. 4146 * Return the fields being declared.
3776 * @return the fields being declared 4147 * @return the fields being declared
3777 */ 4148 */
3778 VariableDeclarationList get fields => _fieldList; 4149 VariableDeclarationList get fields => _fieldList;
3779 /** 4150 /**
3780 * Return the token representing the 'static' keyword, or {@code null} if the fields are not 4151 * Return the token representing the 'static' keyword, or {@code null} if the fields are not
3781 * static. 4152 * static.
3782 * @return the token representing the 'static' keyword 4153 * @return the token representing the 'static' keyword
3783 */ 4154 */
3784 Token get keyword => _keyword; 4155 Token get keyword => _keyword;
3785 /** 4156 /**
3786 * Return the semicolon terminating the declaration. 4157 * Return the semicolon terminating the declaration.
3787 * @return the semicolon terminating the declaration 4158 * @return the semicolon terminating the declaration
3788 */ 4159 */
3789 Token get semicolon => _semicolon; 4160 Token get semicolon => _semicolon;
3790 /** 4161 /**
3791 * Set the fields being declared to the given list of variables. 4162 * Set the fields being declared to the given list of variables.
3792 * @param fieldList the fields being declared 4163 * @param fieldList the fields being declared
3793 */ 4164 */
3794 void set fields2(VariableDeclarationList fieldList) { 4165 void set fields(VariableDeclarationList fieldList) {
3795 fieldList = becomeParentOf(fieldList); 4166 fieldList = becomeParentOf(fieldList);
3796 } 4167 }
3797 /** 4168 /**
3798 * Set the token representing the 'static' keyword to the given token. 4169 * Set the token representing the 'static' keyword to the given token.
3799 * @param keyword the token representing the 'static' keyword 4170 * @param keyword the token representing the 'static' keyword
3800 */ 4171 */
3801 void set keyword9(Token keyword) { 4172 void set keyword(Token keyword9) {
3802 this._keyword = keyword; 4173 this._keyword = keyword9;
3803 } 4174 }
3804 /** 4175 /**
3805 * Set the semicolon terminating the declaration to the given token. 4176 * Set the semicolon terminating the declaration to the given token.
3806 * @param semicolon the semicolon terminating the declaration 4177 * @param semicolon the semicolon terminating the declaration
3807 */ 4178 */
3808 void set semicolon10(Token semicolon) { 4179 void set semicolon(Token semicolon10) {
3809 this._semicolon = semicolon; 4180 this._semicolon = semicolon10;
3810 } 4181 }
3811 void visitChildren(ASTVisitor<Object> visitor) { 4182 void visitChildren(ASTVisitor<Object> visitor) {
3812 super.visitChildren(visitor); 4183 super.visitChildren(visitor);
3813 safelyVisitChild(_fieldList, visitor); 4184 safelyVisitChild(_fieldList, visitor);
3814 } 4185 }
3815 Token get firstTokenAfterCommentAndMetadata { 4186 Token get firstTokenAfterCommentAndMetadata {
3816 if (_keyword != null) { 4187 if (_keyword != null) {
3817 return _keyword; 4188 return _keyword;
3818 } 4189 }
3819 return _fieldList.beginToken; 4190 return _fieldList.beginToken;
(...skipping 27 matching lines...) Expand all
3847 /** 4218 /**
3848 * Initialize a newly created formal parameter. 4219 * Initialize a newly created formal parameter.
3849 * @param comment the documentation comment associated with this parameter 4220 * @param comment the documentation comment associated with this parameter
3850 * @param metadata the annotations associated with this parameter 4221 * @param metadata the annotations associated with this parameter
3851 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 4222 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
3852 * @param type the name of the declared type of the parameter 4223 * @param type the name of the declared type of the parameter
3853 * @param thisToken the token representing the 'this' keyword 4224 * @param thisToken the token representing the 'this' keyword
3854 * @param period the token representing the period 4225 * @param period the token representing the period
3855 * @param identifier the name of the parameter being declared 4226 * @param identifier the name of the parameter being declared
3856 */ 4227 */
3857 FieldFormalParameter(Comment comment, List<Annotation> metadata, Token keyword , TypeName type, Token thisToken, Token period, SimpleIdentifier identifier) : s uper(comment, metadata, identifier) { 4228 FieldFormalParameter.full(Comment comment, List<Annotation> metadata, Token ke yword, TypeName type, Token thisToken, Token period, SimpleIdentifier identifier ) : super.full(comment, metadata, identifier) {
3858 this._keyword = keyword; 4229 this._keyword = keyword;
3859 this._type = becomeParentOf(type); 4230 this._type = becomeParentOf(type);
3860 this._thisToken = thisToken; 4231 this._thisToken = thisToken;
3861 this._period = period; 4232 this._period = period;
3862 } 4233 }
4234 /**
4235 * Initialize a newly created formal parameter.
4236 * @param comment the documentation comment associated with this parameter
4237 * @param metadata the annotations associated with this parameter
4238 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
4239 * @param type the name of the declared type of the parameter
4240 * @param thisToken the token representing the 'this' keyword
4241 * @param period the token representing the period
4242 * @param identifier the name of the parameter being declared
4243 */
4244 FieldFormalParameter({Comment comment, List<Annotation> metadata, Token keywor d, TypeName type, Token thisToken, Token period, SimpleIdentifier identifier}) : this.full(comment, metadata, keyword, type, thisToken, period, identifier);
3863 accept(ASTVisitor visitor) => visitor.visitFieldFormalParameter(this); 4245 accept(ASTVisitor visitor) => visitor.visitFieldFormalParameter(this);
3864 Token get beginToken { 4246 Token get beginToken {
3865 if (_keyword != null) { 4247 if (_keyword != null) {
3866 return _keyword; 4248 return _keyword;
3867 } else if (_type != null) { 4249 } else if (_type != null) {
3868 return _type.beginToken; 4250 return _type.beginToken;
3869 } 4251 }
3870 return _thisToken; 4252 return _thisToken;
3871 } 4253 }
3872 Token get endToken => identifier.endToken; 4254 Token get endToken => identifier.endToken;
(...skipping 11 matching lines...) Expand all
3884 * Return the token representing the 'this' keyword. 4266 * Return the token representing the 'this' keyword.
3885 * @return the token representing the 'this' keyword 4267 * @return the token representing the 'this' keyword
3886 */ 4268 */
3887 Token get thisToken => _thisToken; 4269 Token get thisToken => _thisToken;
3888 /** 4270 /**
3889 * Return the name of the declared type of the parameter, or {@code null} if t he parameter does 4271 * Return the name of the declared type of the parameter, or {@code null} if t he parameter does
3890 * not have a declared type. 4272 * not have a declared type.
3891 * @return the name of the declared type of the parameter 4273 * @return the name of the declared type of the parameter
3892 */ 4274 */
3893 TypeName get type => _type; 4275 TypeName get type => _type;
3894 bool isConst() => (_keyword is KeywordToken) && (_keyword as KeywordToken).key word == Keyword.CONST; 4276 bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.CONST);
3895 bool isFinal() => (_keyword is KeywordToken) && (_keyword as KeywordToken).key word == Keyword.FINAL; 4277 bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.FINAL);
3896 /** 4278 /**
3897 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token. 4279 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
3898 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 4280 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
3899 */ 4281 */
3900 void set keyword10(Token keyword) { 4282 void set keyword(Token keyword10) {
3901 this._keyword = keyword; 4283 this._keyword = keyword10;
3902 } 4284 }
3903 /** 4285 /**
3904 * Set the token representing the period to the given token. 4286 * Set the token representing the period to the given token.
3905 * @param period the token representing the period 4287 * @param period the token representing the period
3906 */ 4288 */
3907 void set period6(Token period) { 4289 void set period(Token period6) {
3908 this._period = period; 4290 this._period = period6;
3909 } 4291 }
3910 /** 4292 /**
3911 * Set the token representing the 'this' keyword to the given token. 4293 * Set the token representing the 'this' keyword to the given token.
3912 * @param thisToken the token representing the 'this' keyword 4294 * @param thisToken the token representing the 'this' keyword
3913 */ 4295 */
3914 void set thisToken2(Token thisToken) { 4296 void set thisToken(Token thisToken2) {
3915 this._thisToken = thisToken; 4297 this._thisToken = thisToken2;
3916 } 4298 }
3917 /** 4299 /**
3918 * Set the name of the declared type of the parameter to the given type name. 4300 * Set the name of the declared type of the parameter to the given type name.
3919 * @param typeName the name of the declared type of the parameter 4301 * @param typeName the name of the declared type of the parameter
3920 */ 4302 */
3921 void set type4(TypeName typeName) { 4303 void set type(TypeName typeName) {
3922 _type = becomeParentOf(typeName); 4304 _type = becomeParentOf(typeName);
3923 } 4305 }
3924 void visitChildren(ASTVisitor<Object> visitor) { 4306 void visitChildren(ASTVisitor<Object> visitor) {
3925 super.visitChildren(visitor); 4307 super.visitChildren(visitor);
3926 safelyVisitChild(_type, visitor); 4308 safelyVisitChild(_type, visitor);
3927 safelyVisitChild(identifier, visitor); 4309 safelyVisitChild(identifier, visitor);
3928 } 4310 }
3929 } 4311 }
3930 /** 4312 /**
3931 * Instances of the class {@code ForEachStatement} represent a for-each statemen t. 4313 * Instances of the class {@code ForEachStatement} represent a for-each statemen t.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
3964 Statement _body; 4346 Statement _body;
3965 /** 4347 /**
3966 * Initialize a newly created for-each statement. 4348 * Initialize a newly created for-each statement.
3967 * @param forKeyword the token representing the 'for' keyword 4349 * @param forKeyword the token representing the 'for' keyword
3968 * @param leftParenthesis the left parenthesis 4350 * @param leftParenthesis the left parenthesis
3969 * @param loopParameter the declaration of the loop variable 4351 * @param loopParameter the declaration of the loop variable
3970 * @param iterator the expression evaluated to produce the iterator 4352 * @param iterator the expression evaluated to produce the iterator
3971 * @param rightParenthesis the right parenthesis 4353 * @param rightParenthesis the right parenthesis
3972 * @param body the body of the loop 4354 * @param body the body of the loop
3973 */ 4355 */
3974 ForEachStatement(Token forKeyword, Token leftParenthesis, SimpleFormalParamete r loopParameter, Token inKeyword, Expression iterator, Token rightParenthesis, S tatement body) { 4356 ForEachStatement.full(Token forKeyword, Token leftParenthesis, SimpleFormalPar ameter loopParameter, Token inKeyword, Expression iterator, Token rightParenthes is, Statement body) {
3975 this._forKeyword = forKeyword; 4357 this._forKeyword = forKeyword;
3976 this._leftParenthesis = leftParenthesis; 4358 this._leftParenthesis = leftParenthesis;
3977 this._loopParameter = becomeParentOf(loopParameter); 4359 this._loopParameter = becomeParentOf(loopParameter);
3978 this._inKeyword = inKeyword; 4360 this._inKeyword = inKeyword;
3979 this._iterator = becomeParentOf(iterator); 4361 this._iterator = becomeParentOf(iterator);
3980 this._rightParenthesis = rightParenthesis; 4362 this._rightParenthesis = rightParenthesis;
3981 this._body = becomeParentOf(body); 4363 this._body = becomeParentOf(body);
3982 } 4364 }
4365 /**
4366 * Initialize a newly created for-each statement.
4367 * @param forKeyword the token representing the 'for' keyword
4368 * @param leftParenthesis the left parenthesis
4369 * @param loopParameter the declaration of the loop variable
4370 * @param iterator the expression evaluated to produce the iterator
4371 * @param rightParenthesis the right parenthesis
4372 * @param body the body of the loop
4373 */
4374 ForEachStatement({Token forKeyword, Token leftParenthesis, SimpleFormalParamet er loopParameter, Token inKeyword, Expression iterator, Token rightParenthesis, Statement body}) : this.full(forKeyword, leftParenthesis, loopParameter, inKeywo rd, iterator, rightParenthesis, body);
3983 accept(ASTVisitor visitor) => visitor.visitForEachStatement(this); 4375 accept(ASTVisitor visitor) => visitor.visitForEachStatement(this);
3984 Token get beginToken => _forKeyword; 4376 Token get beginToken => _forKeyword;
3985 /** 4377 /**
3986 * Return the body of the loop. 4378 * Return the body of the loop.
3987 * @return the body of the loop 4379 * @return the body of the loop
3988 */ 4380 */
3989 Statement get body => _body; 4381 Statement get body => _body;
3990 Token get endToken => _body.endToken; 4382 Token get endToken => _body.endToken;
3991 /** 4383 /**
3992 * Return the token representing the 'for' keyword. 4384 * Return the token representing the 'for' keyword.
(...skipping 22 matching lines...) Expand all
4015 SimpleFormalParameter get loopParameter => _loopParameter; 4407 SimpleFormalParameter get loopParameter => _loopParameter;
4016 /** 4408 /**
4017 * Return the right parenthesis. 4409 * Return the right parenthesis.
4018 * @return the right parenthesis 4410 * @return the right parenthesis
4019 */ 4411 */
4020 Token get rightParenthesis => _rightParenthesis; 4412 Token get rightParenthesis => _rightParenthesis;
4021 /** 4413 /**
4022 * Set the body of the loop to the given block. 4414 * Set the body of the loop to the given block.
4023 * @param body the body of the loop 4415 * @param body the body of the loop
4024 */ 4416 */
4025 void set body5(Statement body) { 4417 void set body(Statement body2) {
4026 this._body = becomeParentOf(body); 4418 this._body = becomeParentOf(body2);
4027 } 4419 }
4028 /** 4420 /**
4029 * Set the token representing the 'for' keyword to the given token. 4421 * Set the token representing the 'for' keyword to the given token.
4030 * @param forKeyword the token representing the 'for' keyword 4422 * @param forKeyword the token representing the 'for' keyword
4031 */ 4423 */
4032 void set forKeyword2(Token forKeyword) { 4424 void set forKeyword(Token forKeyword2) {
4033 this._forKeyword = forKeyword; 4425 this._forKeyword = forKeyword2;
4034 } 4426 }
4035 /** 4427 /**
4036 * Set the token representing the 'in' keyword to the given token. 4428 * Set the token representing the 'in' keyword to the given token.
4037 * @param inKeyword the token representing the 'in' keyword 4429 * @param inKeyword the token representing the 'in' keyword
4038 */ 4430 */
4039 void set inKeyword2(Token inKeyword) { 4431 void set inKeyword(Token inKeyword2) {
4040 this._inKeyword = inKeyword; 4432 this._inKeyword = inKeyword2;
4041 } 4433 }
4042 /** 4434 /**
4043 * Set the expression evaluated to produce the iterator to the given expressio n. 4435 * Set the expression evaluated to produce the iterator to the given expressio n.
4044 * @param expression the expression evaluated to produce the iterator 4436 * @param expression the expression evaluated to produce the iterator
4045 */ 4437 */
4046 void set iterator2(Expression expression) { 4438 void set iterator(Expression expression) {
4047 _iterator = becomeParentOf(expression); 4439 _iterator = becomeParentOf(expression);
4048 } 4440 }
4049 /** 4441 /**
4050 * Set the left parenthesis to the given token. 4442 * Set the left parenthesis to the given token.
4051 * @param leftParenthesis the left parenthesis 4443 * @param leftParenthesis the left parenthesis
4052 */ 4444 */
4053 void set leftParenthesis6(Token leftParenthesis) { 4445 void set leftParenthesis(Token leftParenthesis3) {
4054 this._leftParenthesis = leftParenthesis; 4446 this._leftParenthesis = leftParenthesis3;
4055 } 4447 }
4056 /** 4448 /**
4057 * Set the declaration of the loop variable to the given parameter. 4449 * Set the declaration of the loop variable to the given parameter.
4058 * @param parameter the declaration of the loop variable 4450 * @param parameter the declaration of the loop variable
4059 */ 4451 */
4060 void set loopParameter2(SimpleFormalParameter parameter) { 4452 void set loopParameter(SimpleFormalParameter parameter) {
4061 _loopParameter = becomeParentOf(parameter); 4453 _loopParameter = becomeParentOf(parameter);
4062 } 4454 }
4063 /** 4455 /**
4064 * Set the right parenthesis to the given token. 4456 * Set the right parenthesis to the given token.
4065 * @param rightParenthesis the right parenthesis 4457 * @param rightParenthesis the right parenthesis
4066 */ 4458 */
4067 void set rightParenthesis6(Token rightParenthesis) { 4459 void set rightParenthesis(Token rightParenthesis3) {
4068 this._rightParenthesis = rightParenthesis; 4460 this._rightParenthesis = rightParenthesis3;
4069 } 4461 }
4070 void visitChildren(ASTVisitor<Object> visitor) { 4462 void visitChildren(ASTVisitor<Object> visitor) {
4071 safelyVisitChild(_loopParameter, visitor); 4463 safelyVisitChild(_loopParameter, visitor);
4072 safelyVisitChild(_iterator, visitor); 4464 safelyVisitChild(_iterator, visitor);
4073 safelyVisitChild(_body, visitor); 4465 safelyVisitChild(_body, visitor);
4074 } 4466 }
4075 } 4467 }
4076 /** 4468 /**
4077 * Instances of the class {@code ForStatement} represent a for statement. 4469 * Instances of the class {@code ForStatement} represent a for statement.
4078 * <pre> 4470 * <pre>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
4133 * @param leftParenthesis the left parenthesis 4525 * @param leftParenthesis the left parenthesis
4134 * @param variableList the declaration of the loop variables 4526 * @param variableList the declaration of the loop variables
4135 * @param initialization the initialization expression 4527 * @param initialization the initialization expression
4136 * @param leftSeparator the semicolon separating the initializer and the condi tion 4528 * @param leftSeparator the semicolon separating the initializer and the condi tion
4137 * @param condition the condition used to determine when to terminate the loop 4529 * @param condition the condition used to determine when to terminate the loop
4138 * @param rightSeparator the semicolon separating the condition and the update r 4530 * @param rightSeparator the semicolon separating the condition and the update r
4139 * @param updaters the list of expressions run after each execution of the loo p body 4531 * @param updaters the list of expressions run after each execution of the loo p body
4140 * @param rightParenthesis the right parenthesis 4532 * @param rightParenthesis the right parenthesis
4141 * @param body the body of the loop 4533 * @param body the body of the loop
4142 */ 4534 */
4143 ForStatement(Token forKeyword, Token leftParenthesis, VariableDeclarationList variableList, Expression initialization, Token leftSeparator, Expression conditi on, Token rightSeparator, List<Expression> updaters, Token rightParenthesis, Sta tement body) { 4535 ForStatement.full(Token forKeyword, Token leftParenthesis, VariableDeclaration List variableList, Expression initialization, Token leftSeparator, Expression co ndition, Token rightSeparator, List<Expression> updaters, Token rightParenthesis , Statement body) {
4144 this._updaters = new NodeList<Expression>(this); 4536 this._updaters = new NodeList<Expression>(this);
4145 this._forKeyword = forKeyword; 4537 this._forKeyword = forKeyword;
4146 this._leftParenthesis = leftParenthesis; 4538 this._leftParenthesis = leftParenthesis;
4147 this._variableList = becomeParentOf(variableList); 4539 this._variableList = becomeParentOf(variableList);
4148 this._initialization = becomeParentOf(initialization); 4540 this._initialization = becomeParentOf(initialization);
4149 this._leftSeparator = leftSeparator; 4541 this._leftSeparator = leftSeparator;
4150 this._condition = becomeParentOf(condition); 4542 this._condition = becomeParentOf(condition);
4151 this._rightSeparator = rightSeparator; 4543 this._rightSeparator = rightSeparator;
4152 this._updaters.addAll(updaters); 4544 this._updaters.addAll(updaters);
4153 this._rightParenthesis = rightParenthesis; 4545 this._rightParenthesis = rightParenthesis;
4154 this._body = becomeParentOf(body); 4546 this._body = becomeParentOf(body);
4155 } 4547 }
4548 /**
4549 * Initialize a newly created for statement.
4550 * @param forKeyword the token representing the 'for' keyword
4551 * @param leftParenthesis the left parenthesis
4552 * @param variableList the declaration of the loop variables
4553 * @param initialization the initialization expression
4554 * @param leftSeparator the semicolon separating the initializer and the condi tion
4555 * @param condition the condition used to determine when to terminate the loop
4556 * @param rightSeparator the semicolon separating the condition and the update r
4557 * @param updaters the list of expressions run after each execution of the loo p body
4558 * @param rightParenthesis the right parenthesis
4559 * @param body the body of the loop
4560 */
4561 ForStatement({Token forKeyword, Token leftParenthesis, VariableDeclarationList variableList, Expression initialization, Token leftSeparator, Expression condit ion, Token rightSeparator, List<Expression> updaters, Token rightParenthesis, St atement body}) : this.full(forKeyword, leftParenthesis, variableList, initializa tion, leftSeparator, condition, rightSeparator, updaters, rightParenthesis, body );
4156 accept(ASTVisitor visitor) => visitor.visitForStatement(this); 4562 accept(ASTVisitor visitor) => visitor.visitForStatement(this);
4157 Token get beginToken => _forKeyword; 4563 Token get beginToken => _forKeyword;
4158 /** 4564 /**
4159 * Return the body of the loop. 4565 * Return the body of the loop.
4160 * @return the body of the loop 4566 * @return the body of the loop
4161 */ 4567 */
4162 Statement get body => _body; 4568 Statement get body => _body;
4163 /** 4569 /**
4164 * Return the condition used to determine when to terminate the loop. 4570 * Return the condition used to determine when to terminate the loop.
4165 * @return the condition used to determine when to terminate the loop 4571 * @return the condition used to determine when to terminate the loop
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
4203 NodeList<Expression> get updaters => _updaters; 4609 NodeList<Expression> get updaters => _updaters;
4204 /** 4610 /**
4205 * Return the declaration of the loop variables, or {@code null} if there are no variables. 4611 * Return the declaration of the loop variables, or {@code null} if there are no variables.
4206 * @return the declaration of the loop variables, or {@code null} if there are no variables 4612 * @return the declaration of the loop variables, or {@code null} if there are no variables
4207 */ 4613 */
4208 VariableDeclarationList get variables => _variableList; 4614 VariableDeclarationList get variables => _variableList;
4209 /** 4615 /**
4210 * Set the body of the loop to the given statement. 4616 * Set the body of the loop to the given statement.
4211 * @param body the body of the loop 4617 * @param body the body of the loop
4212 */ 4618 */
4213 void set body6(Statement body) { 4619 void set body(Statement body3) {
4214 this._body = becomeParentOf(body); 4620 this._body = becomeParentOf(body3);
4215 } 4621 }
4216 /** 4622 /**
4217 * Set the condition used to determine when to terminate the loop to the given expression. 4623 * Set the condition used to determine when to terminate the loop to the given expression.
4218 * @param expression the condition used to determine when to terminate the loo p 4624 * @param expression the condition used to determine when to terminate the loo p
4219 */ 4625 */
4220 void set condition5(Expression expression) { 4626 void set condition(Expression expression) {
4221 _condition = becomeParentOf(expression); 4627 _condition = becomeParentOf(expression);
4222 } 4628 }
4223 /** 4629 /**
4224 * Set the token representing the 'for' keyword to the given token. 4630 * Set the token representing the 'for' keyword to the given token.
4225 * @param forKeyword the token representing the 'for' keyword 4631 * @param forKeyword the token representing the 'for' keyword
4226 */ 4632 */
4227 void set forKeyword3(Token forKeyword) { 4633 void set forKeyword(Token forKeyword3) {
4228 this._forKeyword = forKeyword; 4634 this._forKeyword = forKeyword3;
4229 } 4635 }
4230 /** 4636 /**
4231 * Set the initialization expression to the given expression. 4637 * Set the initialization expression to the given expression.
4232 * @param initialization the initialization expression 4638 * @param initialization the initialization expression
4233 */ 4639 */
4234 void set initialization2(Expression initialization) { 4640 void set initialization(Expression initialization2) {
4235 this._initialization = becomeParentOf(initialization); 4641 this._initialization = becomeParentOf(initialization2);
4236 } 4642 }
4237 /** 4643 /**
4238 * Set the left parenthesis to the given token. 4644 * Set the left parenthesis to the given token.
4239 * @param leftParenthesis the left parenthesis 4645 * @param leftParenthesis the left parenthesis
4240 */ 4646 */
4241 void set leftParenthesis7(Token leftParenthesis) { 4647 void set leftParenthesis(Token leftParenthesis4) {
4242 this._leftParenthesis = leftParenthesis; 4648 this._leftParenthesis = leftParenthesis4;
4243 } 4649 }
4244 /** 4650 /**
4245 * Set the semicolon separating the initializer and the condition to the given token. 4651 * Set the semicolon separating the initializer and the condition to the given token.
4246 * @param leftSeparator the semicolon separating the initializer and the condi tion 4652 * @param leftSeparator the semicolon separating the initializer and the condi tion
4247 */ 4653 */
4248 void set leftSeparator2(Token leftSeparator) { 4654 void set leftSeparator(Token leftSeparator2) {
4249 this._leftSeparator = leftSeparator; 4655 this._leftSeparator = leftSeparator2;
4250 } 4656 }
4251 /** 4657 /**
4252 * Set the right parenthesis to the given token. 4658 * Set the right parenthesis to the given token.
4253 * @param rightParenthesis the right parenthesis 4659 * @param rightParenthesis the right parenthesis
4254 */ 4660 */
4255 void set rightParenthesis7(Token rightParenthesis) { 4661 void set rightParenthesis(Token rightParenthesis4) {
4256 this._rightParenthesis = rightParenthesis; 4662 this._rightParenthesis = rightParenthesis4;
4257 } 4663 }
4258 /** 4664 /**
4259 * Set the semicolon separating the condition and the updater to the given tok en. 4665 * Set the semicolon separating the condition and the updater to the given tok en.
4260 * @param rightSeparator the semicolon separating the condition and the update r 4666 * @param rightSeparator the semicolon separating the condition and the update r
4261 */ 4667 */
4262 void set rightSeparator2(Token rightSeparator) { 4668 void set rightSeparator(Token rightSeparator2) {
4263 this._rightSeparator = rightSeparator; 4669 this._rightSeparator = rightSeparator2;
4264 } 4670 }
4265 /** 4671 /**
4266 * Set the declaration of the loop variables to the given parameter. 4672 * Set the declaration of the loop variables to the given parameter.
4267 * @param variableList the declaration of the loop variables 4673 * @param variableList the declaration of the loop variables
4268 */ 4674 */
4269 void set variables2(VariableDeclarationList variableList) { 4675 void set variables(VariableDeclarationList variableList) {
4270 variableList = becomeParentOf(variableList); 4676 variableList = becomeParentOf(variableList);
4271 } 4677 }
4272 void visitChildren(ASTVisitor<Object> visitor) { 4678 void visitChildren(ASTVisitor<Object> visitor) {
4273 safelyVisitChild(_variableList, visitor); 4679 safelyVisitChild(_variableList, visitor);
4274 safelyVisitChild(_initialization, visitor); 4680 safelyVisitChild(_initialization, visitor);
4275 safelyVisitChild(_condition, visitor); 4681 safelyVisitChild(_condition, visitor);
4276 _updaters.accept(visitor); 4682 _updaters.accept(visitor);
4277 safelyVisitChild(_body, visitor); 4683 safelyVisitChild(_body, visitor);
4278 } 4684 }
4279 } 4685 }
4280 /** 4686 /**
4281 * The abstract class {@code FormalParameter} defines the behavior of objects re presenting a 4687 * The abstract class {@code FormalParameter} defines the behavior of objects re presenting a
4282 * parameter to a function. 4688 * parameter to a function.
4283 * <pre> 4689 * <pre>
4284 * formalParameter ::={@link NormalFormalParameter normalFormalParameter}| {@lin k DefaultFormalParameter namedFormalParameter}| {@link DefaultFormalParameter op tionalFormalParameter}</pre> 4690 * formalParameter ::={@link NormalFormalParameter normalFormalParameter}| {@lin k DefaultFormalParameter namedFormalParameter}| {@link DefaultFormalParameter op tionalFormalParameter}</pre>
4285 */ 4691 */
4286 abstract class FormalParameter extends ASTNode { 4692 abstract class FormalParameter extends ASTNode {
4287 /** 4693 /**
4288 * Return the element representing this parameter, or {@code null} if this par ameter has not been 4694 * Return the element representing this parameter, or {@code null} if this par ameter has not been
4289 * resolved. 4695 * resolved.
4290 * @return the element representing this parameter 4696 * @return the element representing this parameter
4291 */ 4697 */
4292 ParameterElement get element { 4698 ParameterElement get element {
4293 SimpleIdentifier identifier6 = identifier; 4699 SimpleIdentifier identifier9 = identifier;
4294 if (identifier6 == null) { 4700 if (identifier9 == null) {
4295 return null; 4701 return null;
4296 } 4702 }
4297 return identifier6.element as ParameterElement; 4703 return (identifier9.element as ParameterElement);
4298 } 4704 }
4299 /** 4705 /**
4300 * Return the name of the parameter being declared. 4706 * Return the name of the parameter being declared.
4301 * @return the name of the parameter being declared 4707 * @return the name of the parameter being declared
4302 */ 4708 */
4303 SimpleIdentifier get identifier; 4709 SimpleIdentifier get identifier;
4304 /** 4710 /**
4305 * Return the kind of this parameter. 4711 * Return the kind of this parameter.
4306 * @return the kind of this parameter 4712 * @return the kind of this parameter
4307 */ 4713 */
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
4352 */ 4758 */
4353 Token _rightParenthesis; 4759 Token _rightParenthesis;
4354 /** 4760 /**
4355 * Initialize a newly created parameter list. 4761 * Initialize a newly created parameter list.
4356 * @param leftParenthesis the left parenthesis 4762 * @param leftParenthesis the left parenthesis
4357 * @param parameters the parameters associated with the method 4763 * @param parameters the parameters associated with the method
4358 * @param leftDelimiter the left delimiter introducing the optional parameters 4764 * @param leftDelimiter the left delimiter introducing the optional parameters
4359 * @param rightDelimiter the right delimiter introducing the optional paramete rs 4765 * @param rightDelimiter the right delimiter introducing the optional paramete rs
4360 * @param rightParenthesis the right parenthesis 4766 * @param rightParenthesis the right parenthesis
4361 */ 4767 */
4362 FormalParameterList(Token leftParenthesis, List<FormalParameter> parameters, T oken leftDelimiter, Token rightDelimiter, Token rightParenthesis) { 4768 FormalParameterList.full(Token leftParenthesis, List<FormalParameter> paramete rs, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis) {
4363 this._parameters = new NodeList<FormalParameter>(this); 4769 this._parameters = new NodeList<FormalParameter>(this);
4364 this._leftParenthesis = leftParenthesis; 4770 this._leftParenthesis = leftParenthesis;
4365 this._parameters.addAll(parameters); 4771 this._parameters.addAll(parameters);
4366 this._leftDelimiter = leftDelimiter; 4772 this._leftDelimiter = leftDelimiter;
4367 this._rightDelimiter = rightDelimiter; 4773 this._rightDelimiter = rightDelimiter;
4368 this._rightParenthesis = rightParenthesis; 4774 this._rightParenthesis = rightParenthesis;
4369 } 4775 }
4776 /**
4777 * Initialize a newly created parameter list.
4778 * @param leftParenthesis the left parenthesis
4779 * @param parameters the parameters associated with the method
4780 * @param leftDelimiter the left delimiter introducing the optional parameters
4781 * @param rightDelimiter the right delimiter introducing the optional paramete rs
4782 * @param rightParenthesis the right parenthesis
4783 */
4784 FormalParameterList({Token leftParenthesis, List<FormalParameter> parameters, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis}) : this.full( leftParenthesis, parameters, leftDelimiter, rightDelimiter, rightParenthesis);
4370 accept(ASTVisitor visitor) => visitor.visitFormalParameterList(this); 4785 accept(ASTVisitor visitor) => visitor.visitFormalParameterList(this);
4371 Token get beginToken => _leftParenthesis; 4786 Token get beginToken => _leftParenthesis;
4372 /** 4787 /**
4373 * Return an array containing the elements representing the parameters in this list. The array 4788 * Return an array containing the elements representing the parameters in this list. The array
4374 * will contain {@code null}s if the parameters in this list have not been res olved. 4789 * will contain {@code null}s if the parameters in this list have not been res olved.
4375 * @return the elements representing the parameters in this list 4790 * @return the elements representing the parameters in this list
4376 */ 4791 */
4377 List<ParameterElement> get elements { 4792 List<ParameterElement> get elements {
4378 int count = _parameters.length; 4793 int count = _parameters.length;
4379 List<ParameterElement> types = new List<ParameterElement>.fixedLength(count) ; 4794 List<ParameterElement> types = new List<ParameterElement>.fixedLength(count) ;
(...skipping 30 matching lines...) Expand all
4410 /** 4825 /**
4411 * Return the right parenthesis. 4826 * Return the right parenthesis.
4412 * @return the right parenthesis 4827 * @return the right parenthesis
4413 */ 4828 */
4414 Token get rightParenthesis => _rightParenthesis; 4829 Token get rightParenthesis => _rightParenthesis;
4415 /** 4830 /**
4416 * Set the left square bracket ('[') or left curly brace ('{') introducing the optional parameters 4831 * Set the left square bracket ('[') or left curly brace ('{') introducing the optional parameters
4417 * to the given token. 4832 * to the given token.
4418 * @param bracket the left delimiter introducing the optional parameters 4833 * @param bracket the left delimiter introducing the optional parameters
4419 */ 4834 */
4420 void set leftDelimiter2(Token bracket) { 4835 void set leftDelimiter(Token bracket) {
4421 _leftDelimiter = bracket; 4836 _leftDelimiter = bracket;
4422 } 4837 }
4423 /** 4838 /**
4424 * Set the left parenthesis to the given token. 4839 * Set the left parenthesis to the given token.
4425 * @param parenthesis the left parenthesis 4840 * @param parenthesis the left parenthesis
4426 */ 4841 */
4427 void set leftParenthesis8(Token parenthesis) { 4842 void set leftParenthesis(Token parenthesis) {
4428 _leftParenthesis = parenthesis; 4843 _leftParenthesis = parenthesis;
4429 } 4844 }
4430 /** 4845 /**
4431 * Set the right square bracket (']') or right curly brace ('}') introducing t he optional 4846 * Set the right square bracket (']') or right curly brace ('}') introducing t he optional
4432 * parameters to the given token. 4847 * parameters to the given token.
4433 * @param bracket the right delimiter introducing the optional parameters 4848 * @param bracket the right delimiter introducing the optional parameters
4434 */ 4849 */
4435 void set rightDelimiter2(Token bracket) { 4850 void set rightDelimiter(Token bracket) {
4436 _rightDelimiter = bracket; 4851 _rightDelimiter = bracket;
4437 } 4852 }
4438 /** 4853 /**
4439 * Set the right parenthesis to the given token. 4854 * Set the right parenthesis to the given token.
4440 * @param parenthesis the right parenthesis 4855 * @param parenthesis the right parenthesis
4441 */ 4856 */
4442 void set rightParenthesis8(Token parenthesis) { 4857 void set rightParenthesis(Token parenthesis) {
4443 _rightParenthesis = parenthesis; 4858 _rightParenthesis = parenthesis;
4444 } 4859 }
4445 void visitChildren(ASTVisitor<Object> visitor) { 4860 void visitChildren(ASTVisitor<Object> visitor) {
4446 _parameters.accept(visitor); 4861 _parameters.accept(visitor);
4447 } 4862 }
4448 } 4863 }
4449 /** 4864 /**
4450 * The abstract class {@code FunctionBody} defines the behavior common to object s representing the 4865 * The abstract class {@code FunctionBody} defines the behavior common to object s representing the
4451 * body of a function or method. 4866 * body of a function or method.
4452 * <pre> 4867 * <pre>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
4488 /** 4903 /**
4489 * Initialize a newly created function declaration. 4904 * Initialize a newly created function declaration.
4490 * @param comment the documentation comment associated with this function 4905 * @param comment the documentation comment associated with this function
4491 * @param metadata the annotations associated with this function 4906 * @param metadata the annotations associated with this function
4492 * @param externalKeyword the token representing the 'external' keyword 4907 * @param externalKeyword the token representing the 'external' keyword
4493 * @param returnType the return type of the function 4908 * @param returnType the return type of the function
4494 * @param propertyKeyword the token representing the 'get' or 'set' keyword 4909 * @param propertyKeyword the token representing the 'get' or 'set' keyword
4495 * @param name the name of the function 4910 * @param name the name of the function
4496 * @param functionExpression the function expression being wrapped 4911 * @param functionExpression the function expression being wrapped
4497 */ 4912 */
4498 FunctionDeclaration(Comment comment, List<Annotation> metadata, Token external Keyword, TypeName returnType, Token propertyKeyword, SimpleIdentifier name, Func tionExpression functionExpression) : super(comment, metadata) { 4913 FunctionDeclaration.full(Comment comment, List<Annotation> metadata, Token ext ernalKeyword, TypeName returnType, Token propertyKeyword, SimpleIdentifier name, FunctionExpression functionExpression) : super.full(comment, metadata) {
4499 this._externalKeyword = externalKeyword; 4914 this._externalKeyword = externalKeyword;
4500 this._returnType = becomeParentOf(returnType); 4915 this._returnType = becomeParentOf(returnType);
4501 this._propertyKeyword = propertyKeyword; 4916 this._propertyKeyword = propertyKeyword;
4502 this._name = becomeParentOf(name); 4917 this._name = becomeParentOf(name);
4503 this._functionExpression = becomeParentOf(functionExpression); 4918 this._functionExpression = becomeParentOf(functionExpression);
4504 } 4919 }
4920 /**
4921 * Initialize a newly created function declaration.
4922 * @param comment the documentation comment associated with this function
4923 * @param metadata the annotations associated with this function
4924 * @param externalKeyword the token representing the 'external' keyword
4925 * @param returnType the return type of the function
4926 * @param propertyKeyword the token representing the 'get' or 'set' keyword
4927 * @param name the name of the function
4928 * @param functionExpression the function expression being wrapped
4929 */
4930 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);
4505 accept(ASTVisitor visitor) => visitor.visitFunctionDeclaration(this); 4931 accept(ASTVisitor visitor) => visitor.visitFunctionDeclaration(this);
4506 /** 4932 /**
4507 * Return the {@link FunctionElement} associated with this function, or {@code null} if the AST 4933 * Return the {@link FunctionElement} associated with this function, or {@code null} if the AST
4508 * structure has not been resolved. 4934 * structure has not been resolved.
4509 * @return the {@link FunctionElement} associated with this function 4935 * @return the {@link FunctionElement} associated with this function
4510 */ 4936 */
4511 FunctionElement get element => _name != null ? _name.element as FunctionElemen t : null; 4937 FunctionElement get element => _name != null ? (_name.element as FunctionEleme nt) : null;
4512 Token get endToken => _functionExpression.endToken; 4938 Token get endToken => _functionExpression.endToken;
4513 /** 4939 /**
4514 * Return the token representing the 'external' keyword, or {@code null} if th is is not an 4940 * Return the token representing the 'external' keyword, or {@code null} if th is is not an
4515 * external function. 4941 * external function.
4516 * @return the token representing the 'external' keyword 4942 * @return the token representing the 'external' keyword
4517 */ 4943 */
4518 Token get externalKeyword => _externalKeyword; 4944 Token get externalKeyword => _externalKeyword;
4519 /** 4945 /**
4520 * Return the function expression being wrapped. 4946 * Return the function expression being wrapped.
4521 * @return the function expression being wrapped 4947 * @return the function expression being wrapped
(...skipping 12 matching lines...) Expand all
4534 Token get propertyKeyword => _propertyKeyword; 4960 Token get propertyKeyword => _propertyKeyword;
4535 /** 4961 /**
4536 * Return the return type of the function, or {@code null} if no return type w as declared. 4962 * Return the return type of the function, or {@code null} if no return type w as declared.
4537 * @return the return type of the function 4963 * @return the return type of the function
4538 */ 4964 */
4539 TypeName get returnType => _returnType; 4965 TypeName get returnType => _returnType;
4540 /** 4966 /**
4541 * Set the token representing the 'external' keyword to the given token. 4967 * Set the token representing the 'external' keyword to the given token.
4542 * @param externalKeyword the token representing the 'external' keyword 4968 * @param externalKeyword the token representing the 'external' keyword
4543 */ 4969 */
4544 void set externalKeyword3(Token externalKeyword) { 4970 void set externalKeyword(Token externalKeyword3) {
4545 this._externalKeyword = externalKeyword; 4971 this._externalKeyword = externalKeyword3;
4546 } 4972 }
4547 /** 4973 /**
4548 * Set the function expression being wrapped to the given function expression. 4974 * Set the function expression being wrapped to the given function expression.
4549 * @param functionExpression the function expression being wrapped 4975 * @param functionExpression the function expression being wrapped
4550 */ 4976 */
4551 void set functionExpression2(FunctionExpression functionExpression) { 4977 void set functionExpression(FunctionExpression functionExpression3) {
4552 functionExpression = becomeParentOf(functionExpression); 4978 functionExpression3 = becomeParentOf(functionExpression3);
4553 } 4979 }
4554 /** 4980 /**
4555 * Set the name of the function to the given identifier. 4981 * Set the name of the function to the given identifier.
4556 * @param identifier the name of the function 4982 * @param identifier the name of the function
4557 */ 4983 */
4558 void set name7(SimpleIdentifier identifier) { 4984 void set name(SimpleIdentifier identifier) {
4559 _name = becomeParentOf(identifier); 4985 _name = becomeParentOf(identifier);
4560 } 4986 }
4561 /** 4987 /**
4562 * Set the token representing the 'get' or 'set' keyword to the given token. 4988 * Set the token representing the 'get' or 'set' keyword to the given token.
4563 * @param propertyKeyword the token representing the 'get' or 'set' keyword 4989 * @param propertyKeyword the token representing the 'get' or 'set' keyword
4564 */ 4990 */
4565 void set propertyKeyword2(Token propertyKeyword) { 4991 void set propertyKeyword(Token propertyKeyword2) {
4566 this._propertyKeyword = propertyKeyword; 4992 this._propertyKeyword = propertyKeyword2;
4567 } 4993 }
4568 /** 4994 /**
4569 * Set the return type of the function to the given name. 4995 * Set the return type of the function to the given name.
4570 * @param name the return type of the function 4996 * @param name the return type of the function
4571 */ 4997 */
4572 void set returnType3(TypeName name) { 4998 void set returnType(TypeName name) {
4573 _returnType = becomeParentOf(name); 4999 _returnType = becomeParentOf(name);
4574 } 5000 }
4575 void visitChildren(ASTVisitor<Object> visitor) { 5001 void visitChildren(ASTVisitor<Object> visitor) {
4576 super.visitChildren(visitor); 5002 super.visitChildren(visitor);
4577 safelyVisitChild(_returnType, visitor); 5003 safelyVisitChild(_returnType, visitor);
4578 safelyVisitChild(_name, visitor); 5004 safelyVisitChild(_name, visitor);
4579 safelyVisitChild(_functionExpression, visitor); 5005 safelyVisitChild(_functionExpression, visitor);
4580 } 5006 }
4581 Token get firstTokenAfterCommentAndMetadata { 5007 Token get firstTokenAfterCommentAndMetadata {
4582 if (_externalKeyword != null) { 5008 if (_externalKeyword != null) {
(...skipping 14 matching lines...) Expand all
4597 */ 5023 */
4598 class FunctionDeclarationStatement extends Statement { 5024 class FunctionDeclarationStatement extends Statement {
4599 /** 5025 /**
4600 * The function declaration being wrapped. 5026 * The function declaration being wrapped.
4601 */ 5027 */
4602 FunctionDeclaration _functionDeclaration; 5028 FunctionDeclaration _functionDeclaration;
4603 /** 5029 /**
4604 * Initialize a newly created function declaration statement. 5030 * Initialize a newly created function declaration statement.
4605 * @param functionDeclaration the the function declaration being wrapped 5031 * @param functionDeclaration the the function declaration being wrapped
4606 */ 5032 */
4607 FunctionDeclarationStatement(FunctionDeclaration functionDeclaration) { 5033 FunctionDeclarationStatement.full(FunctionDeclaration functionDeclaration) {
4608 this._functionDeclaration = becomeParentOf(functionDeclaration); 5034 this._functionDeclaration = becomeParentOf(functionDeclaration);
4609 } 5035 }
5036 /**
5037 * Initialize a newly created function declaration statement.
5038 * @param functionDeclaration the the function declaration being wrapped
5039 */
5040 FunctionDeclarationStatement({FunctionDeclaration functionDeclaration}) : this .full(functionDeclaration);
4610 accept(ASTVisitor visitor) => visitor.visitFunctionDeclarationStatement(this); 5041 accept(ASTVisitor visitor) => visitor.visitFunctionDeclarationStatement(this);
4611 Token get beginToken => _functionDeclaration.beginToken; 5042 Token get beginToken => _functionDeclaration.beginToken;
4612 Token get endToken => _functionDeclaration.endToken; 5043 Token get endToken => _functionDeclaration.endToken;
4613 /** 5044 /**
4614 * Return the function declaration being wrapped. 5045 * Return the function declaration being wrapped.
4615 * @return the function declaration being wrapped 5046 * @return the function declaration being wrapped
4616 */ 5047 */
4617 FunctionDeclaration get functionDeclaration => _functionDeclaration; 5048 FunctionDeclaration get functionDeclaration => _functionDeclaration;
4618 /** 5049 /**
4619 * Set the function declaration being wrapped to the given function declaratio n. 5050 * Set the function declaration being wrapped to the given function declaratio n.
4620 * @param functionDeclaration the function declaration being wrapped 5051 * @param functionDeclaration the function declaration being wrapped
4621 */ 5052 */
4622 void set functionExpression(FunctionDeclaration functionDeclaration) { 5053 void set functionExpression(FunctionDeclaration functionDeclaration2) {
4623 this._functionDeclaration = becomeParentOf(functionDeclaration); 5054 this._functionDeclaration = becomeParentOf(functionDeclaration2);
4624 } 5055 }
4625 void visitChildren(ASTVisitor<Object> visitor) { 5056 void visitChildren(ASTVisitor<Object> visitor) {
4626 safelyVisitChild(_functionDeclaration, visitor); 5057 safelyVisitChild(_functionDeclaration, visitor);
4627 } 5058 }
4628 } 5059 }
4629 /** 5060 /**
4630 * Instances of the class {@code FunctionExpression} represent a function expres sion. 5061 * Instances of the class {@code FunctionExpression} represent a function expres sion.
4631 * <pre> 5062 * <pre>
4632 * functionExpression ::={@link FormalParameterList formalParameterList} {@link FunctionBody functionBody}</pre> 5063 * functionExpression ::={@link FormalParameterList formalParameterList} {@link FunctionBody functionBody}</pre>
4633 */ 5064 */
4634 class FunctionExpression extends Expression { 5065 class FunctionExpression extends Expression {
4635 /** 5066 /**
4636 * The parameters associated with the function. 5067 * The parameters associated with the function.
4637 */ 5068 */
4638 FormalParameterList _parameters; 5069 FormalParameterList _parameters;
4639 /** 5070 /**
4640 * The body of the function, or {@code null} if this is an external function. 5071 * The body of the function, or {@code null} if this is an external function.
4641 */ 5072 */
4642 FunctionBody _body; 5073 FunctionBody _body;
4643 /** 5074 /**
4644 * The element associated with the function, or {@code null} if the AST struct ure has not been 5075 * The element associated with the function, or {@code null} if the AST struct ure has not been
4645 * resolved. 5076 * resolved.
4646 */ 5077 */
4647 ExecutableElement _element; 5078 ExecutableElement _element;
4648 /** 5079 /**
4649 * Initialize a newly created function declaration. 5080 * Initialize a newly created function declaration.
4650 * @param parameters the parameters associated with the function 5081 * @param parameters the parameters associated with the function
4651 * @param body the body of the function 5082 * @param body the body of the function
4652 */ 5083 */
4653 FunctionExpression(FormalParameterList parameters, FunctionBody body) { 5084 FunctionExpression.full(FormalParameterList parameters, FunctionBody body) {
4654 this._parameters = becomeParentOf(parameters); 5085 this._parameters = becomeParentOf(parameters);
4655 this._body = becomeParentOf(body); 5086 this._body = becomeParentOf(body);
4656 } 5087 }
5088 /**
5089 * Initialize a newly created function declaration.
5090 * @param parameters the parameters associated with the function
5091 * @param body the body of the function
5092 */
5093 FunctionExpression({FormalParameterList parameters, FunctionBody body}) : this .full(parameters, body);
4657 accept(ASTVisitor visitor) => visitor.visitFunctionExpression(this); 5094 accept(ASTVisitor visitor) => visitor.visitFunctionExpression(this);
4658 Token get beginToken { 5095 Token get beginToken {
4659 if (_parameters != null) { 5096 if (_parameters != null) {
4660 return _parameters.beginToken; 5097 return _parameters.beginToken;
4661 } else if (_body != null) { 5098 } else if (_body != null) {
4662 return _body.beginToken; 5099 return _body.beginToken;
4663 } 5100 }
4664 throw new IllegalStateException("Non-external functions must have a body"); 5101 throw new IllegalStateException("Non-external functions must have a body");
4665 } 5102 }
4666 /** 5103 /**
(...skipping 17 matching lines...) Expand all
4684 } 5121 }
4685 /** 5122 /**
4686 * Return the parameters associated with the function. 5123 * Return the parameters associated with the function.
4687 * @return the parameters associated with the function 5124 * @return the parameters associated with the function
4688 */ 5125 */
4689 FormalParameterList get parameters => _parameters; 5126 FormalParameterList get parameters => _parameters;
4690 /** 5127 /**
4691 * Set the body of the function to the given function body. 5128 * Set the body of the function to the given function body.
4692 * @param functionBody the body of the function 5129 * @param functionBody the body of the function
4693 */ 5130 */
4694 void set body7(FunctionBody functionBody) { 5131 void set body(FunctionBody functionBody) {
4695 _body = becomeParentOf(functionBody); 5132 _body = becomeParentOf(functionBody);
4696 } 5133 }
4697 /** 5134 /**
4698 * Set the element associated with this function to the given element. 5135 * Set the element associated with this function to the given element.
4699 * @param element the element associated with this function 5136 * @param element the element associated with this function
4700 */ 5137 */
4701 void set element8(ExecutableElement element) { 5138 void set element(ExecutableElement element9) {
4702 this._element = element; 5139 this._element = element9;
4703 } 5140 }
4704 /** 5141 /**
4705 * Set the parameters associated with the function to the given list of parame ters. 5142 * Set the parameters associated with the function to the given list of parame ters.
4706 * @param parameters the parameters associated with the function 5143 * @param parameters the parameters associated with the function
4707 */ 5144 */
4708 void set parameters3(FormalParameterList parameters) { 5145 void set parameters(FormalParameterList parameters3) {
4709 this._parameters = becomeParentOf(parameters); 5146 this._parameters = becomeParentOf(parameters3);
4710 } 5147 }
4711 void visitChildren(ASTVisitor<Object> visitor) { 5148 void visitChildren(ASTVisitor<Object> visitor) {
4712 safelyVisitChild(_parameters, visitor); 5149 safelyVisitChild(_parameters, visitor);
4713 safelyVisitChild(_body, visitor); 5150 safelyVisitChild(_body, visitor);
4714 } 5151 }
4715 } 5152 }
4716 /** 5153 /**
4717 * Instances of the class {@code FunctionExpressionInvocation} represent the inv ocation of a 5154 * Instances of the class {@code FunctionExpressionInvocation} represent the inv ocation of a
4718 * function resulting from evaluating an expression. Invocations of methods and other forms of 5155 * function resulting from evaluating an expression. Invocations of methods and other forms of
4719 * functions are represented by {@link MethodInvocation method invocation} nodes . Invocations of 5156 * functions are represented by {@link MethodInvocation method invocation} nodes . Invocations of
(...skipping 13 matching lines...) Expand all
4733 /** 5170 /**
4734 * The element associated with the function being invoked, or {@code null} if the AST structure 5171 * The element associated with the function being invoked, or {@code null} if the AST structure
4735 * has not been resolved or the function could not be resolved. 5172 * has not been resolved or the function could not be resolved.
4736 */ 5173 */
4737 ExecutableElement _element; 5174 ExecutableElement _element;
4738 /** 5175 /**
4739 * Initialize a newly created function expression invocation. 5176 * Initialize a newly created function expression invocation.
4740 * @param function the expression producing the function being invoked 5177 * @param function the expression producing the function being invoked
4741 * @param argumentList the list of arguments to the method 5178 * @param argumentList the list of arguments to the method
4742 */ 5179 */
4743 FunctionExpressionInvocation(Expression function, ArgumentList argumentList) { 5180 FunctionExpressionInvocation.full(Expression function, ArgumentList argumentLi st) {
4744 this._function = becomeParentOf(function); 5181 this._function = becomeParentOf(function);
4745 this._argumentList = becomeParentOf(argumentList); 5182 this._argumentList = becomeParentOf(argumentList);
4746 } 5183 }
5184 /**
5185 * Initialize a newly created function expression invocation.
5186 * @param function the expression producing the function being invoked
5187 * @param argumentList the list of arguments to the method
5188 */
5189 FunctionExpressionInvocation({Expression function, ArgumentList argumentList}) : this.full(function, argumentList);
4747 accept(ASTVisitor visitor) => visitor.visitFunctionExpressionInvocation(this); 5190 accept(ASTVisitor visitor) => visitor.visitFunctionExpressionInvocation(this);
4748 /** 5191 /**
4749 * Return the list of arguments to the method. 5192 * Return the list of arguments to the method.
4750 * @return the list of arguments to the method 5193 * @return the list of arguments to the method
4751 */ 5194 */
4752 ArgumentList get argumentList => _argumentList; 5195 ArgumentList get argumentList => _argumentList;
4753 Token get beginToken => _function.beginToken; 5196 Token get beginToken => _function.beginToken;
4754 /** 5197 /**
4755 * Return the element associated with the function being invoked, or {@code nu ll} if the AST 5198 * Return the element associated with the function being invoked, or {@code nu ll} if the AST
4756 * structure has not been resolved or the function could not be resolved. One common example of 5199 * structure has not been resolved or the function could not be resolved. One common example of
4757 * the latter case is an expression whose value can change over time. 5200 * the latter case is an expression whose value can change over time.
4758 * @return the element associated with the function being invoked 5201 * @return the element associated with the function being invoked
4759 */ 5202 */
4760 ExecutableElement get element => _element; 5203 ExecutableElement get element => _element;
4761 Token get endToken => _argumentList.endToken; 5204 Token get endToken => _argumentList.endToken;
4762 /** 5205 /**
4763 * Return the expression producing the function being invoked. 5206 * Return the expression producing the function being invoked.
4764 * @return the expression producing the function being invoked 5207 * @return the expression producing the function being invoked
4765 */ 5208 */
4766 Expression get function => _function; 5209 Expression get function => _function;
4767 /** 5210 /**
4768 * Set the list of arguments to the method to the given list. 5211 * Set the list of arguments to the method to the given list.
4769 * @param argumentList the list of arguments to the method 5212 * @param argumentList the list of arguments to the method
4770 */ 5213 */
4771 void set argumentList5(ArgumentList argumentList) { 5214 void set argumentList(ArgumentList argumentList5) {
4772 this._argumentList = becomeParentOf(argumentList); 5215 this._argumentList = becomeParentOf(argumentList5);
4773 } 5216 }
4774 /** 5217 /**
4775 * Set the element associated with the function being invoked to the given ele ment. 5218 * Set the element associated with the function being invoked to the given ele ment.
4776 * @param element the element associated with the function being invoked 5219 * @param element the element associated with the function being invoked
4777 */ 5220 */
4778 void set element9(ExecutableElement element) { 5221 void set element(ExecutableElement element10) {
4779 this._element = element; 5222 this._element = element10;
4780 } 5223 }
4781 /** 5224 /**
4782 * Set the expression producing the function being invoked to the given expres sion. 5225 * Set the expression producing the function being invoked to the given expres sion.
4783 * @param function the expression producing the function being invoked 5226 * @param function the expression producing the function being invoked
4784 */ 5227 */
4785 void set function2(Expression function) { 5228 void set function(Expression function2) {
4786 function = becomeParentOf(function); 5229 function2 = becomeParentOf(function2);
4787 } 5230 }
4788 void visitChildren(ASTVisitor<Object> visitor) { 5231 void visitChildren(ASTVisitor<Object> visitor) {
4789 safelyVisitChild(_function, visitor); 5232 safelyVisitChild(_function, visitor);
4790 safelyVisitChild(_argumentList, visitor); 5233 safelyVisitChild(_argumentList, visitor);
4791 } 5234 }
4792 } 5235 }
4793 /** 5236 /**
4794 * Instances of the class {@code FunctionTypeAlias} represent a function type al ias. 5237 * Instances of the class {@code FunctionTypeAlias} represent a function type al ias.
4795 * <pre> 5238 * <pre>
4796 * functionTypeAlias ::= 5239 * functionTypeAlias ::=
(...skipping 23 matching lines...) Expand all
4820 * Initialize a newly created function type alias. 5263 * Initialize a newly created function type alias.
4821 * @param comment the documentation comment associated with this type alias 5264 * @param comment the documentation comment associated with this type alias
4822 * @param metadata the annotations associated with this type alias 5265 * @param metadata the annotations associated with this type alias
4823 * @param keyword the token representing the 'typedef' keyword 5266 * @param keyword the token representing the 'typedef' keyword
4824 * @param returnType the name of the return type of the function type being de fined 5267 * @param returnType the name of the return type of the function type being de fined
4825 * @param name the name of the type being declared 5268 * @param name the name of the type being declared
4826 * @param typeParameters the type parameters for the type 5269 * @param typeParameters the type parameters for the type
4827 * @param parameters the parameters associated with the function 5270 * @param parameters the parameters associated with the function
4828 * @param semicolon the semicolon terminating the declaration 5271 * @param semicolon the semicolon terminating the declaration
4829 */ 5272 */
4830 FunctionTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, T ypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters, For malParameterList parameters, Token semicolon) : super(comment, metadata, keyword , semicolon) { 5273 FunctionTypeAlias.full(Comment comment, List<Annotation> metadata, Token keywo rd, TypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters , FormalParameterList parameters, Token semicolon) : super.full(comment, metadat a, keyword, semicolon) {
4831 this._returnType = becomeParentOf(returnType); 5274 this._returnType = becomeParentOf(returnType);
4832 this._name = becomeParentOf(name); 5275 this._name = becomeParentOf(name);
4833 this._typeParameters = becomeParentOf(typeParameters); 5276 this._typeParameters = becomeParentOf(typeParameters);
4834 this._parameters = becomeParentOf(parameters); 5277 this._parameters = becomeParentOf(parameters);
4835 } 5278 }
5279 /**
5280 * Initialize a newly created function type alias.
5281 * @param comment the documentation comment associated with this type alias
5282 * @param metadata the annotations associated with this type alias
5283 * @param keyword the token representing the 'typedef' keyword
5284 * @param returnType the name of the return type of the function type being de fined
5285 * @param name the name of the type being declared
5286 * @param typeParameters the type parameters for the type
5287 * @param parameters the parameters associated with the function
5288 * @param semicolon the semicolon terminating the declaration
5289 */
5290 FunctionTypeAlias({Comment comment, List<Annotation> metadata, Token keyword, TypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters, Fo rmalParameterList parameters, Token semicolon}) : this.full(comment, metadata, k eyword, returnType, name, typeParameters, parameters, semicolon);
4836 accept(ASTVisitor visitor) => visitor.visitFunctionTypeAlias(this); 5291 accept(ASTVisitor visitor) => visitor.visitFunctionTypeAlias(this);
4837 /** 5292 /**
4838 * Return the {@link TypeAliasElement} associated with this type alias, or {@c ode null} if the AST 5293 * Return the {@link TypeAliasElement} associated with this type alias, or {@c ode null} if the AST
4839 * structure has not been resolved. 5294 * structure has not been resolved.
4840 * @return the {@link TypeAliasElement} associated with this type alias 5295 * @return the {@link TypeAliasElement} associated with this type alias
4841 */ 5296 */
4842 TypeAliasElement get element => _name != null ? _name.element as TypeAliasElem ent : null; 5297 TypeAliasElement get element => _name != null ? (_name.element as TypeAliasEle ment) : null;
4843 /** 5298 /**
4844 * Return the name of the function type being declared. 5299 * Return the name of the function type being declared.
4845 * @return the name of the function type being declared 5300 * @return the name of the function type being declared
4846 */ 5301 */
4847 SimpleIdentifier get name => _name; 5302 SimpleIdentifier get name => _name;
4848 /** 5303 /**
4849 * Return the parameters associated with the function type. 5304 * Return the parameters associated with the function type.
4850 * @return the parameters associated with the function type 5305 * @return the parameters associated with the function type
4851 */ 5306 */
4852 FormalParameterList get parameters => _parameters; 5307 FormalParameterList get parameters => _parameters;
4853 /** 5308 /**
4854 * Return the name of the return type of the function type being defined, or { @code null} if no 5309 * Return the name of the return type of the function type being defined, or { @code null} if no
4855 * return type was given. 5310 * return type was given.
4856 * @return the name of the return type of the function type being defined 5311 * @return the name of the return type of the function type being defined
4857 */ 5312 */
4858 TypeName get returnType => _returnType; 5313 TypeName get returnType => _returnType;
4859 /** 5314 /**
4860 * Return the type parameters for the function type, or {@code null} if the fu nction type does not 5315 * Return the type parameters for the function type, or {@code null} if the fu nction type does not
4861 * have any type parameters. 5316 * have any type parameters.
4862 * @return the type parameters for the function type 5317 * @return the type parameters for the function type
4863 */ 5318 */
4864 TypeParameterList get typeParameters => _typeParameters; 5319 TypeParameterList get typeParameters => _typeParameters;
4865 /** 5320 /**
4866 * Set the name of the function type being declared to the given identifier. 5321 * Set the name of the function type being declared to the given identifier.
4867 * @param name the name of the function type being declared 5322 * @param name the name of the function type being declared
4868 */ 5323 */
4869 void set name8(SimpleIdentifier name) { 5324 void set name(SimpleIdentifier name5) {
4870 this._name = becomeParentOf(name); 5325 this._name = becomeParentOf(name5);
4871 } 5326 }
4872 /** 5327 /**
4873 * Set the parameters associated with the function type to the given list of p arameters. 5328 * Set the parameters associated with the function type to the given list of p arameters.
4874 * @param parameters the parameters associated with the function type 5329 * @param parameters the parameters associated with the function type
4875 */ 5330 */
4876 void set parameters4(FormalParameterList parameters) { 5331 void set parameters(FormalParameterList parameters4) {
4877 this._parameters = becomeParentOf(parameters); 5332 this._parameters = becomeParentOf(parameters4);
4878 } 5333 }
4879 /** 5334 /**
4880 * Set the name of the return type of the function type being defined to the g iven type name. 5335 * Set the name of the return type of the function type being defined to the g iven type name.
4881 * @param typeName the name of the return type of the function type being defi ned 5336 * @param typeName the name of the return type of the function type being defi ned
4882 */ 5337 */
4883 void set returnType4(TypeName typeName) { 5338 void set returnType(TypeName typeName) {
4884 _returnType = becomeParentOf(typeName); 5339 _returnType = becomeParentOf(typeName);
4885 } 5340 }
4886 /** 5341 /**
4887 * Set the type parameters for the function type to the given list of paramete rs. 5342 * Set the type parameters for the function type to the given list of paramete rs.
4888 * @param typeParameters the type parameters for the function type 5343 * @param typeParameters the type parameters for the function type
4889 */ 5344 */
4890 void set typeParameters4(TypeParameterList typeParameters) { 5345 void set typeParameters(TypeParameterList typeParameters4) {
4891 this._typeParameters = becomeParentOf(typeParameters); 5346 this._typeParameters = becomeParentOf(typeParameters4);
4892 } 5347 }
4893 void visitChildren(ASTVisitor<Object> visitor) { 5348 void visitChildren(ASTVisitor<Object> visitor) {
4894 super.visitChildren(visitor); 5349 super.visitChildren(visitor);
4895 safelyVisitChild(_returnType, visitor); 5350 safelyVisitChild(_returnType, visitor);
4896 safelyVisitChild(_name, visitor); 5351 safelyVisitChild(_name, visitor);
4897 safelyVisitChild(_typeParameters, visitor); 5352 safelyVisitChild(_typeParameters, visitor);
4898 safelyVisitChild(_parameters, visitor); 5353 safelyVisitChild(_parameters, visitor);
4899 } 5354 }
4900 } 5355 }
4901 /** 5356 /**
(...skipping 13 matching lines...) Expand all
4915 FormalParameterList _parameters; 5370 FormalParameterList _parameters;
4916 /** 5371 /**
4917 * Initialize a newly created formal parameter. 5372 * Initialize a newly created formal parameter.
4918 * @param comment the documentation comment associated with this parameter 5373 * @param comment the documentation comment associated with this parameter
4919 * @param metadata the annotations associated with this parameter 5374 * @param metadata the annotations associated with this parameter
4920 * @param returnType the return type of the function, or {@code null} if the f unction does not 5375 * @param returnType the return type of the function, or {@code null} if the f unction does not
4921 * have a return type 5376 * have a return type
4922 * @param identifier the name of the function-typed parameter 5377 * @param identifier the name of the function-typed parameter
4923 * @param parameters the parameters of the function-typed parameter 5378 * @param parameters the parameters of the function-typed parameter
4924 */ 5379 */
4925 FunctionTypedFormalParameter(Comment comment, List<Annotation> metadata, TypeN ame returnType, SimpleIdentifier identifier, FormalParameterList parameters) : s uper(comment, metadata, identifier) { 5380 FunctionTypedFormalParameter.full(Comment comment, List<Annotation> metadata, TypeName returnType, SimpleIdentifier identifier, FormalParameterList parameters ) : super.full(comment, metadata, identifier) {
4926 this._returnType = becomeParentOf(returnType); 5381 this._returnType = becomeParentOf(returnType);
4927 this._parameters = becomeParentOf(parameters); 5382 this._parameters = becomeParentOf(parameters);
4928 } 5383 }
5384 /**
5385 * Initialize a newly created formal parameter.
5386 * @param comment the documentation comment associated with this parameter
5387 * @param metadata the annotations associated with this parameter
5388 * @param returnType the return type of the function, or {@code null} if the f unction does not
5389 * have a return type
5390 * @param identifier the name of the function-typed parameter
5391 * @param parameters the parameters of the function-typed parameter
5392 */
5393 FunctionTypedFormalParameter({Comment comment, List<Annotation> metadata, Type Name returnType, SimpleIdentifier identifier, FormalParameterList parameters}) : this.full(comment, metadata, returnType, identifier, parameters);
4929 accept(ASTVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this); 5394 accept(ASTVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this);
4930 Token get beginToken { 5395 Token get beginToken {
4931 if (_returnType != null) { 5396 if (_returnType != null) {
4932 return _returnType.beginToken; 5397 return _returnType.beginToken;
4933 } 5398 }
4934 return identifier.beginToken; 5399 return identifier.beginToken;
4935 } 5400 }
4936 Token get endToken => _parameters.endToken; 5401 Token get endToken => _parameters.endToken;
4937 /** 5402 /**
4938 * Return the parameters of the function-typed parameter. 5403 * Return the parameters of the function-typed parameter.
4939 * @return the parameters of the function-typed parameter 5404 * @return the parameters of the function-typed parameter
4940 */ 5405 */
4941 FormalParameterList get parameters => _parameters; 5406 FormalParameterList get parameters => _parameters;
4942 /** 5407 /**
4943 * Return the return type of the function, or {@code null} if the function doe s not have a return 5408 * Return the return type of the function, or {@code null} if the function doe s not have a return
4944 * type. 5409 * type.
4945 * @return the return type of the function 5410 * @return the return type of the function
4946 */ 5411 */
4947 TypeName get returnType => _returnType; 5412 TypeName get returnType => _returnType;
4948 bool isConst() => false; 5413 bool isConst() => false;
4949 bool isFinal() => false; 5414 bool isFinal() => false;
4950 /** 5415 /**
4951 * Set the parameters of the function-typed parameter to the given parameters. 5416 * Set the parameters of the function-typed parameter to the given parameters.
4952 * @param parameters the parameters of the function-typed parameter 5417 * @param parameters the parameters of the function-typed parameter
4953 */ 5418 */
4954 void set parameters5(FormalParameterList parameters) { 5419 void set parameters(FormalParameterList parameters5) {
4955 this._parameters = becomeParentOf(parameters); 5420 this._parameters = becomeParentOf(parameters5);
4956 } 5421 }
4957 /** 5422 /**
4958 * Set the return type of the function to the given type. 5423 * Set the return type of the function to the given type.
4959 * @param returnType the return type of the function 5424 * @param returnType the return type of the function
4960 */ 5425 */
4961 void set returnType5(TypeName returnType) { 5426 void set returnType(TypeName returnType2) {
4962 this._returnType = becomeParentOf(returnType); 5427 this._returnType = becomeParentOf(returnType2);
4963 } 5428 }
4964 void visitChildren(ASTVisitor<Object> visitor) { 5429 void visitChildren(ASTVisitor<Object> visitor) {
4965 super.visitChildren(visitor); 5430 super.visitChildren(visitor);
4966 safelyVisitChild(_returnType, visitor); 5431 safelyVisitChild(_returnType, visitor);
4967 safelyVisitChild(identifier, visitor); 5432 safelyVisitChild(identifier, visitor);
4968 safelyVisitChild(_parameters, visitor); 5433 safelyVisitChild(_parameters, visitor);
4969 } 5434 }
4970 } 5435 }
4971 /** 5436 /**
4972 * Instances of the class {@code HideCombinator} represent a combinator that res tricts the names 5437 * Instances of the class {@code HideCombinator} represent a combinator that res tricts the names
4973 * being imported to those that are not in a given list. 5438 * being imported to those that are not in a given list.
4974 * <pre> 5439 * <pre>
4975 * hideCombinator ::= 5440 * hideCombinator ::=
4976 * 'hide' {@link SimpleIdentifier identifier} (',' {@link SimpleIdentifier ident ifier}) 5441 * 'hide' {@link SimpleIdentifier identifier} (',' {@link SimpleIdentifier ident ifier})
4977 * </pre> 5442 * </pre>
4978 */ 5443 */
4979 class HideCombinator extends Combinator { 5444 class HideCombinator extends Combinator {
4980 /** 5445 /**
4981 * The list of names from the library that are hidden by this combinator. 5446 * The list of names from the library that are hidden by this combinator.
4982 */ 5447 */
4983 NodeList<SimpleIdentifier> _hiddenNames; 5448 NodeList<SimpleIdentifier> _hiddenNames;
4984 /** 5449 /**
4985 * Initialize a newly created import show combinator. 5450 * Initialize a newly created import show combinator.
4986 * @param keyword the comma introducing the combinator 5451 * @param keyword the comma introducing the combinator
4987 * @param hiddenNames the list of names from the library that are hidden by th is combinator 5452 * @param hiddenNames the list of names from the library that are hidden by th is combinator
4988 */ 5453 */
4989 HideCombinator(Token keyword, List<SimpleIdentifier> hiddenNames) : super(keyw ord) { 5454 HideCombinator.full(Token keyword, List<SimpleIdentifier> hiddenNames) : super .full(keyword) {
4990 this._hiddenNames = new NodeList<SimpleIdentifier>(this); 5455 this._hiddenNames = new NodeList<SimpleIdentifier>(this);
4991 this._hiddenNames.addAll(hiddenNames); 5456 this._hiddenNames.addAll(hiddenNames);
4992 } 5457 }
5458 /**
5459 * Initialize a newly created import show combinator.
5460 * @param keyword the comma introducing the combinator
5461 * @param hiddenNames the list of names from the library that are hidden by th is combinator
5462 */
5463 HideCombinator({Token keyword, List<SimpleIdentifier> hiddenNames}) : this.ful l(keyword, hiddenNames);
4993 accept(ASTVisitor visitor) => visitor.visitHideCombinator(this); 5464 accept(ASTVisitor visitor) => visitor.visitHideCombinator(this);
4994 Token get endToken => _hiddenNames.endToken; 5465 Token get endToken => _hiddenNames.endToken;
4995 /** 5466 /**
4996 * Return the list of names from the library that are hidden by this combinato r. 5467 * Return the list of names from the library that are hidden by this combinato r.
4997 * @return the list of names from the library that are hidden by this combinat or 5468 * @return the list of names from the library that are hidden by this combinat or
4998 */ 5469 */
4999 NodeList<SimpleIdentifier> get hiddenNames => _hiddenNames; 5470 NodeList<SimpleIdentifier> get hiddenNames => _hiddenNames;
5000 void visitChildren(ASTVisitor<Object> visitor) { 5471 void visitChildren(ASTVisitor<Object> visitor) {
5001 _hiddenNames.accept(visitor); 5472 _hiddenNames.accept(visitor);
5002 } 5473 }
(...skipping 27 matching lines...) Expand all
5030 /** 5501 /**
5031 * Return the lexical representation of the identifier. 5502 * Return the lexical representation of the identifier.
5032 * @return the lexical representation of the identifier 5503 * @return the lexical representation of the identifier
5033 */ 5504 */
5034 String get name; 5505 String get name;
5035 bool isAssignable() => true; 5506 bool isAssignable() => true;
5036 /** 5507 /**
5037 * Set the element associated with this identifier to the given element. 5508 * Set the element associated with this identifier to the given element.
5038 * @param element the element associated with this identifier 5509 * @param element the element associated with this identifier
5039 */ 5510 */
5040 void set element10(Element element) { 5511 void set element(Element element11) {
5041 this._element = element; 5512 this._element = element11;
5042 } 5513 }
5043 } 5514 }
5044 /** 5515 /**
5045 * Instances of the class {@code IfStatement} represent an if statement. 5516 * Instances of the class {@code IfStatement} represent an if statement.
5046 * <pre> 5517 * <pre>
5047 * ifStatement ::= 5518 * ifStatement ::=
5048 * 'if' '(' {@link Expression expression} ')' {@link Statement thenStatement} (' else' {@link Statement elseStatement})? 5519 * 'if' '(' {@link Expression expression} ')' {@link Statement thenStatement} (' else' {@link Statement elseStatement})?
5049 * </pre> 5520 * </pre>
5050 */ 5521 */
5051 class IfStatement extends Statement { 5522 class IfStatement extends Statement {
(...skipping 29 matching lines...) Expand all
5081 /** 5552 /**
5082 * Initialize a newly created if statement. 5553 * Initialize a newly created if statement.
5083 * @param ifKeyword the token representing the 'if' keyword 5554 * @param ifKeyword the token representing the 'if' keyword
5084 * @param leftParenthesis the left parenthesis 5555 * @param leftParenthesis the left parenthesis
5085 * @param condition the condition used to determine which of the statements is executed next 5556 * @param condition the condition used to determine which of the statements is executed next
5086 * @param rightParenthesis the right parenthesis 5557 * @param rightParenthesis the right parenthesis
5087 * @param thenStatement the statement that is executed if the condition evalua tes to {@code true} 5558 * @param thenStatement the statement that is executed if the condition evalua tes to {@code true}
5088 * @param elseKeyword the token representing the 'else' keyword 5559 * @param elseKeyword the token representing the 'else' keyword
5089 * @param elseStatement the statement that is executed if the condition evalua tes to {@code false} 5560 * @param elseStatement the statement that is executed if the condition evalua tes to {@code false}
5090 */ 5561 */
5091 IfStatement(Token ifKeyword, Token leftParenthesis, Expression condition, Toke n rightParenthesis, Statement thenStatement, Token elseKeyword, Statement elseSt atement) { 5562 IfStatement.full(Token ifKeyword, Token leftParenthesis, Expression condition, Token rightParenthesis, Statement thenStatement, Token elseKeyword, Statement e lseStatement) {
5092 this._ifKeyword = ifKeyword; 5563 this._ifKeyword = ifKeyword;
5093 this._leftParenthesis = leftParenthesis; 5564 this._leftParenthesis = leftParenthesis;
5094 this._condition = becomeParentOf(condition); 5565 this._condition = becomeParentOf(condition);
5095 this._rightParenthesis = rightParenthesis; 5566 this._rightParenthesis = rightParenthesis;
5096 this._thenStatement = becomeParentOf(thenStatement); 5567 this._thenStatement = becomeParentOf(thenStatement);
5097 this._elseKeyword = elseKeyword; 5568 this._elseKeyword = elseKeyword;
5098 this._elseStatement = becomeParentOf(elseStatement); 5569 this._elseStatement = becomeParentOf(elseStatement);
5099 } 5570 }
5571 /**
5572 * Initialize a newly created if statement.
5573 * @param ifKeyword the token representing the 'if' keyword
5574 * @param leftParenthesis the left parenthesis
5575 * @param condition the condition used to determine which of the statements is executed next
5576 * @param rightParenthesis the right parenthesis
5577 * @param thenStatement the statement that is executed if the condition evalua tes to {@code true}
5578 * @param elseKeyword the token representing the 'else' keyword
5579 * @param elseStatement the statement that is executed if the condition evalua tes to {@code false}
5580 */
5581 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);
5100 accept(ASTVisitor visitor) => visitor.visitIfStatement(this); 5582 accept(ASTVisitor visitor) => visitor.visitIfStatement(this);
5101 Token get beginToken => _ifKeyword; 5583 Token get beginToken => _ifKeyword;
5102 /** 5584 /**
5103 * Return the condition used to determine which of the statements is executed next. 5585 * Return the condition used to determine which of the statements is executed next.
5104 * @return the condition used to determine which statement is executed next 5586 * @return the condition used to determine which statement is executed next
5105 */ 5587 */
5106 Expression get condition => _condition; 5588 Expression get condition => _condition;
5107 /** 5589 /**
5108 * Return the token representing the 'else' keyword. 5590 * Return the token representing the 'else' keyword.
5109 * @return the token representing the 'else' keyword 5591 * @return the token representing the 'else' keyword
(...skipping 28 matching lines...) Expand all
5138 /** 5620 /**
5139 * Return the statement that is executed if the condition evaluates to {@code true}. 5621 * Return the statement that is executed if the condition evaluates to {@code true}.
5140 * @return the statement that is executed if the condition evaluates to {@code true} 5622 * @return the statement that is executed if the condition evaluates to {@code true}
5141 */ 5623 */
5142 Statement get thenStatement => _thenStatement; 5624 Statement get thenStatement => _thenStatement;
5143 /** 5625 /**
5144 * Set the condition used to determine which of the statements is executed nex t to the given 5626 * Set the condition used to determine which of the statements is executed nex t to the given
5145 * expression. 5627 * expression.
5146 * @param expression the condition used to determine which statement is execut ed next 5628 * @param expression the condition used to determine which statement is execut ed next
5147 */ 5629 */
5148 void set condition6(Expression expression) { 5630 void set condition(Expression expression) {
5149 _condition = becomeParentOf(expression); 5631 _condition = becomeParentOf(expression);
5150 } 5632 }
5151 /** 5633 /**
5152 * Set the token representing the 'else' keyword to the given token. 5634 * Set the token representing the 'else' keyword to the given token.
5153 * @param elseKeyword the token representing the 'else' keyword 5635 * @param elseKeyword the token representing the 'else' keyword
5154 */ 5636 */
5155 void set elseKeyword2(Token elseKeyword) { 5637 void set elseKeyword(Token elseKeyword2) {
5156 this._elseKeyword = elseKeyword; 5638 this._elseKeyword = elseKeyword2;
5157 } 5639 }
5158 /** 5640 /**
5159 * Set the statement that is executed if the condition evaluates to {@code fal se} to the given 5641 * Set the statement that is executed if the condition evaluates to {@code fal se} to the given
5160 * statement. 5642 * statement.
5161 * @param statement the statement that is executed if the condition evaluates to {@code false} 5643 * @param statement the statement that is executed if the condition evaluates to {@code false}
5162 */ 5644 */
5163 void set elseStatement2(Statement statement) { 5645 void set elseStatement(Statement statement) {
5164 _elseStatement = becomeParentOf(statement); 5646 _elseStatement = becomeParentOf(statement);
5165 } 5647 }
5166 /** 5648 /**
5167 * Set the token representing the 'if' keyword to the given token. 5649 * Set the token representing the 'if' keyword to the given token.
5168 * @param ifKeyword the token representing the 'if' keyword 5650 * @param ifKeyword the token representing the 'if' keyword
5169 */ 5651 */
5170 void set ifKeyword2(Token ifKeyword) { 5652 void set ifKeyword(Token ifKeyword2) {
5171 this._ifKeyword = ifKeyword; 5653 this._ifKeyword = ifKeyword2;
5172 } 5654 }
5173 /** 5655 /**
5174 * Set the left parenthesis to the given token. 5656 * Set the left parenthesis to the given token.
5175 * @param leftParenthesis the left parenthesis 5657 * @param leftParenthesis the left parenthesis
5176 */ 5658 */
5177 void set leftParenthesis9(Token leftParenthesis) { 5659 void set leftParenthesis(Token leftParenthesis5) {
5178 this._leftParenthesis = leftParenthesis; 5660 this._leftParenthesis = leftParenthesis5;
5179 } 5661 }
5180 /** 5662 /**
5181 * Set the right parenthesis to the given token. 5663 * Set the right parenthesis to the given token.
5182 * @param rightParenthesis the right parenthesis 5664 * @param rightParenthesis the right parenthesis
5183 */ 5665 */
5184 void set rightParenthesis9(Token rightParenthesis) { 5666 void set rightParenthesis(Token rightParenthesis5) {
5185 this._rightParenthesis = rightParenthesis; 5667 this._rightParenthesis = rightParenthesis5;
5186 } 5668 }
5187 /** 5669 /**
5188 * Set the statement that is executed if the condition evaluates to {@code tru e} to the given 5670 * Set the statement that is executed if the condition evaluates to {@code tru e} to the given
5189 * statement. 5671 * statement.
5190 * @param statement the statement that is executed if the condition evaluates to {@code true} 5672 * @param statement the statement that is executed if the condition evaluates to {@code true}
5191 */ 5673 */
5192 void set thenStatement2(Statement statement) { 5674 void set thenStatement(Statement statement) {
5193 _thenStatement = becomeParentOf(statement); 5675 _thenStatement = becomeParentOf(statement);
5194 } 5676 }
5195 void visitChildren(ASTVisitor<Object> visitor) { 5677 void visitChildren(ASTVisitor<Object> visitor) {
5196 safelyVisitChild(_condition, visitor); 5678 safelyVisitChild(_condition, visitor);
5197 safelyVisitChild(_thenStatement, visitor); 5679 safelyVisitChild(_thenStatement, visitor);
5198 safelyVisitChild(_elseStatement, visitor); 5680 safelyVisitChild(_elseStatement, visitor);
5199 } 5681 }
5200 } 5682 }
5201 /** 5683 /**
5202 * Instances of the class {@code ImplementsClause} represent the "implements" cl ause in an class 5684 * Instances of the class {@code ImplementsClause} represent the "implements" cl ause in an class
(...skipping 10 matching lines...) Expand all
5213 Token _keyword; 5695 Token _keyword;
5214 /** 5696 /**
5215 * The interfaces that are being implemented. 5697 * The interfaces that are being implemented.
5216 */ 5698 */
5217 NodeList<TypeName> _interfaces; 5699 NodeList<TypeName> _interfaces;
5218 /** 5700 /**
5219 * Initialize a newly created extends clause. 5701 * Initialize a newly created extends clause.
5220 * @param keyword the token representing the 'implements' keyword 5702 * @param keyword the token representing the 'implements' keyword
5221 * @param interfaces the interfaces that are being implemented 5703 * @param interfaces the interfaces that are being implemented
5222 */ 5704 */
5223 ImplementsClause(Token keyword, List<TypeName> interfaces) { 5705 ImplementsClause.full(Token keyword, List<TypeName> interfaces) {
5224 this._interfaces = new NodeList<TypeName>(this); 5706 this._interfaces = new NodeList<TypeName>(this);
5225 this._keyword = keyword; 5707 this._keyword = keyword;
5226 this._interfaces.addAll(interfaces); 5708 this._interfaces.addAll(interfaces);
5227 } 5709 }
5710 /**
5711 * Initialize a newly created extends clause.
5712 * @param keyword the token representing the 'implements' keyword
5713 * @param interfaces the interfaces that are being implemented
5714 */
5715 ImplementsClause({Token keyword, List<TypeName> interfaces}) : this.full(keywo rd, interfaces);
5228 accept(ASTVisitor visitor) => visitor.visitImplementsClause(this); 5716 accept(ASTVisitor visitor) => visitor.visitImplementsClause(this);
5229 Token get beginToken => _keyword; 5717 Token get beginToken => _keyword;
5230 Token get endToken => _interfaces.endToken; 5718 Token get endToken => _interfaces.endToken;
5231 /** 5719 /**
5232 * Return the list of the interfaces that are being implemented. 5720 * Return the list of the interfaces that are being implemented.
5233 * @return the list of the interfaces that are being implemented 5721 * @return the list of the interfaces that are being implemented
5234 */ 5722 */
5235 NodeList<TypeName> get interfaces => _interfaces; 5723 NodeList<TypeName> get interfaces => _interfaces;
5236 /** 5724 /**
5237 * Return the token representing the 'implements' keyword. 5725 * Return the token representing the 'implements' keyword.
5238 * @return the token representing the 'implements' keyword 5726 * @return the token representing the 'implements' keyword
5239 */ 5727 */
5240 Token get keyword => _keyword; 5728 Token get keyword => _keyword;
5241 /** 5729 /**
5242 * Set the token representing the 'implements' keyword to the given token. 5730 * Set the token representing the 'implements' keyword to the given token.
5243 * @param keyword the token representing the 'implements' keyword 5731 * @param keyword the token representing the 'implements' keyword
5244 */ 5732 */
5245 void set keyword11(Token keyword) { 5733 void set keyword(Token keyword11) {
5246 this._keyword = keyword; 5734 this._keyword = keyword11;
5247 } 5735 }
5248 void visitChildren(ASTVisitor<Object> visitor) { 5736 void visitChildren(ASTVisitor<Object> visitor) {
5249 _interfaces.accept(visitor); 5737 _interfaces.accept(visitor);
5250 } 5738 }
5251 } 5739 }
5252 /** 5740 /**
5253 * Instances of the class {@code ImportDirective} represent an import directive. 5741 * Instances of the class {@code ImportDirective} represent an import directive.
5254 * <pre> 5742 * <pre>
5255 * importDirective ::={@link Annotation metadata} 'import' {@link StringLiteral libraryUri} ('as' identifier)? {@link Combinator combinator}* ';' 5743 * importDirective ::={@link Annotation metadata} 'import' {@link StringLiteral libraryUri} ('as' identifier)? {@link Combinator combinator}* ';'
5256 * </pre> 5744 * </pre>
(...skipping 12 matching lines...) Expand all
5269 * Initialize a newly created import directive. 5757 * Initialize a newly created import directive.
5270 * @param comment the documentation comment associated with this directive 5758 * @param comment the documentation comment associated with this directive
5271 * @param metadata the annotations associated with the directive 5759 * @param metadata the annotations associated with the directive
5272 * @param keyword the token representing the 'import' keyword 5760 * @param keyword the token representing the 'import' keyword
5273 * @param libraryUri the URI of the library being imported 5761 * @param libraryUri the URI of the library being imported
5274 * @param asToken the token representing the 'as' token 5762 * @param asToken the token representing the 'as' token
5275 * @param prefix the prefix to be used with the imported names 5763 * @param prefix the prefix to be used with the imported names
5276 * @param combinators the combinators used to control how names are imported 5764 * @param combinators the combinators used to control how names are imported
5277 * @param semicolon the semicolon terminating the directive 5765 * @param semicolon the semicolon terminating the directive
5278 */ 5766 */
5279 ImportDirective(Comment comment, List<Annotation> metadata, Token keyword, Str ingLiteral libraryUri, Token asToken, SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon) : super(comment, metadata, keyword, libraryUri, co mbinators, semicolon) { 5767 ImportDirective.full(Comment comment, List<Annotation> metadata, Token keyword , StringLiteral libraryUri, Token asToken, SimpleIdentifier prefix, List<Combina tor> combinators, Token semicolon) : super.full(comment, metadata, keyword, libr aryUri, combinators, semicolon) {
5280 this._asToken = asToken; 5768 this._asToken = asToken;
5281 this._prefix = becomeParentOf(prefix); 5769 this._prefix = becomeParentOf(prefix);
5282 } 5770 }
5771 /**
5772 * Initialize a newly created import directive.
5773 * @param comment the documentation comment associated with this directive
5774 * @param metadata the annotations associated with the directive
5775 * @param keyword the token representing the 'import' keyword
5776 * @param libraryUri the URI of the library being imported
5777 * @param asToken the token representing the 'as' token
5778 * @param prefix the prefix to be used with the imported names
5779 * @param combinators the combinators used to control how names are imported
5780 * @param semicolon the semicolon terminating the directive
5781 */
5782 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);
5283 accept(ASTVisitor visitor) => visitor.visitImportDirective(this); 5783 accept(ASTVisitor visitor) => visitor.visitImportDirective(this);
5284 /** 5784 /**
5285 * Return the token representing the 'as' token, or {@code null} if the import ed names are not 5785 * Return the token representing the 'as' token, or {@code null} if the import ed names are not
5286 * prefixed. 5786 * prefixed.
5287 * @return the token representing the 'as' token 5787 * @return the token representing the 'as' token
5288 */ 5788 */
5289 Token get asToken => _asToken; 5789 Token get asToken => _asToken;
5290 /** 5790 /**
5291 * Return the prefix to be used with the imported names, or {@code null} if th e imported names are 5791 * Return the prefix to be used with the imported names, or {@code null} if th e imported names are
5292 * not prefixed. 5792 * not prefixed.
5293 * @return the prefix to be used with the imported names 5793 * @return the prefix to be used with the imported names
5294 */ 5794 */
5295 SimpleIdentifier get prefix => _prefix; 5795 SimpleIdentifier get prefix => _prefix;
5296 /** 5796 /**
5297 * Set the token representing the 'as' token to the given token. 5797 * Set the token representing the 'as' token to the given token.
5298 * @param asToken the token representing the 'as' token 5798 * @param asToken the token representing the 'as' token
5299 */ 5799 */
5300 void set asToken2(Token asToken) { 5800 void set asToken(Token asToken2) {
5301 this._asToken = asToken; 5801 this._asToken = asToken2;
5302 } 5802 }
5303 /** 5803 /**
5304 * Set the prefix to be used with the imported names to the given identifier. 5804 * Set the prefix to be used with the imported names to the given identifier.
5305 * @param prefix the prefix to be used with the imported names 5805 * @param prefix the prefix to be used with the imported names
5306 */ 5806 */
5307 void set prefix2(SimpleIdentifier prefix) { 5807 void set prefix(SimpleIdentifier prefix2) {
5308 this._prefix = becomeParentOf(prefix); 5808 this._prefix = becomeParentOf(prefix2);
5309 } 5809 }
5310 void visitChildren(ASTVisitor<Object> visitor) { 5810 void visitChildren(ASTVisitor<Object> visitor) {
5311 super.visitChildren(visitor); 5811 super.visitChildren(visitor);
5312 safelyVisitChild(libraryUri, visitor);
5313 safelyVisitChild(_prefix, visitor); 5812 safelyVisitChild(_prefix, visitor);
5314 combinators.accept(visitor); 5813 combinators.accept(visitor);
5315 } 5814 }
5316 } 5815 }
5317 /** 5816 /**
5318 * Instances of the class {@code IndexExpression} represent an index expression. 5817 * Instances of the class {@code IndexExpression} represent an index expression.
5319 * <pre> 5818 * <pre>
5320 * indexExpression ::={@link Expression target} '[' {@link Expression index} ']' 5819 * indexExpression ::={@link Expression target} '[' {@link Expression index} ']'
5321 * </pre> 5820 * </pre>
5322 */ 5821 */
(...skipping 25 matching lines...) Expand all
5348 * resolved or if the operator could not be resolved. 5847 * resolved or if the operator could not be resolved.
5349 */ 5848 */
5350 MethodElement _element; 5849 MethodElement _element;
5351 /** 5850 /**
5352 * Initialize a newly created index expression. 5851 * Initialize a newly created index expression.
5353 * @param target the expression used to compute the object being indexed 5852 * @param target the expression used to compute the object being indexed
5354 * @param leftBracket the left square bracket 5853 * @param leftBracket the left square bracket
5355 * @param index the expression used to compute the index 5854 * @param index the expression used to compute the index
5356 * @param rightBracket the right square bracket 5855 * @param rightBracket the right square bracket
5357 */ 5856 */
5358 IndexExpression.con1(Expression target, Token leftBracket, Expression index, T oken rightBracket) { 5857 IndexExpression.forTarget_full(Expression target3, Token leftBracket4, Express ion index2, Token rightBracket4) {
5359 _jtd_constructor_55_impl(target, leftBracket, index, rightBracket); 5858 _jtd_constructor_56_impl(target3, leftBracket4, index2, rightBracket4);
5360 }
5361 _jtd_constructor_55_impl(Expression target, Token leftBracket, Expression inde x, Token rightBracket) {
5362 this._target = becomeParentOf(target);
5363 this._leftBracket = leftBracket;
5364 this._index = becomeParentOf(index);
5365 this._rightBracket = rightBracket;
5366 } 5859 }
5367 /** 5860 /**
5368 * Initialize a newly created index expression. 5861 * Initialize a newly created index expression.
5862 * @param target the expression used to compute the object being indexed
5863 * @param leftBracket the left square bracket
5864 * @param index the expression used to compute the index
5865 * @param rightBracket the right square bracket
5866 */
5867 IndexExpression.forTarget({Expression target3, Token leftBracket4, Expression index2, Token rightBracket4}) : this.forTarget_full(target3, leftBracket4, index 2, rightBracket4);
5868 _jtd_constructor_56_impl(Expression target3, Token leftBracket4, Expression in dex2, Token rightBracket4) {
5869 this._target = becomeParentOf(target3);
5870 this._leftBracket = leftBracket4;
5871 this._index = becomeParentOf(index2);
5872 this._rightBracket = rightBracket4;
5873 }
5874 /**
5875 * Initialize a newly created index expression.
5369 * @param period the period ("..") before a cascaded index expression 5876 * @param period the period ("..") before a cascaded index expression
5370 * @param leftBracket the left square bracket 5877 * @param leftBracket the left square bracket
5371 * @param index the expression used to compute the index 5878 * @param index the expression used to compute the index
5372 * @param rightBracket the right square bracket 5879 * @param rightBracket the right square bracket
5373 */ 5880 */
5374 IndexExpression.con2(Token period, Token leftBracket, Expression index, Token rightBracket) { 5881 IndexExpression.forCascade_full(Token period7, Token leftBracket5, Expression index3, Token rightBracket5) {
5375 _jtd_constructor_56_impl(period, leftBracket, index, rightBracket); 5882 _jtd_constructor_57_impl(period7, leftBracket5, index3, rightBracket5);
5376 } 5883 }
5377 _jtd_constructor_56_impl(Token period, Token leftBracket, Expression index, To ken rightBracket) { 5884 /**
5378 this._period = period; 5885 * Initialize a newly created index expression.
5379 this._leftBracket = leftBracket; 5886 * @param period the period ("..") before a cascaded index expression
5380 this._index = becomeParentOf(index); 5887 * @param leftBracket the left square bracket
5381 this._rightBracket = rightBracket; 5888 * @param index the expression used to compute the index
5889 * @param rightBracket the right square bracket
5890 */
5891 IndexExpression.forCascade({Token period7, Token leftBracket5, Expression inde x3, Token rightBracket5}) : this.forCascade_full(period7, leftBracket5, index3, rightBracket5);
5892 _jtd_constructor_57_impl(Token period7, Token leftBracket5, Expression index3, Token rightBracket5) {
5893 this._period = period7;
5894 this._leftBracket = leftBracket5;
5895 this._index = becomeParentOf(index3);
5896 this._rightBracket = rightBracket5;
5382 } 5897 }
5383 accept(ASTVisitor visitor) => visitor.visitIndexExpression(this); 5898 accept(ASTVisitor visitor) => visitor.visitIndexExpression(this);
5384 /** 5899 /**
5385 * Return the expression used to compute the object being indexed, or {@code n ull} if this index 5900 * Return the expression used to compute the object being indexed, or {@code n ull} if this index
5386 * expression is part of a cascade expression. 5901 * expression is part of a cascade expression.
5387 * @return the expression used to compute the object being indexed 5902 * @return the expression used to compute the object being indexed
5388 * @see #getRealTarget() 5903 * @see #getRealTarget()
5389 */ 5904 */
5390 Expression get array => _target; 5905 Expression get array => _target;
5391 Token get beginToken { 5906 Token get beginToken {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
5428 */ 5943 */
5429 Expression get realTarget { 5944 Expression get realTarget {
5430 if (isCascaded()) { 5945 if (isCascaded()) {
5431 ASTNode ancestor = parent; 5946 ASTNode ancestor = parent;
5432 while (ancestor is! CascadeExpression) { 5947 while (ancestor is! CascadeExpression) {
5433 if (ancestor == null) { 5948 if (ancestor == null) {
5434 return _target; 5949 return _target;
5435 } 5950 }
5436 ancestor = ancestor.parent; 5951 ancestor = ancestor.parent;
5437 } 5952 }
5438 return (ancestor as CascadeExpression).target; 5953 return ((ancestor as CascadeExpression)).target;
5439 } 5954 }
5440 return _target; 5955 return _target;
5441 } 5956 }
5442 /** 5957 /**
5443 * Return the right square bracket. 5958 * Return the right square bracket.
5444 * @return the right square bracket 5959 * @return the right square bracket
5445 */ 5960 */
5446 Token get rightBracket => _rightBracket; 5961 Token get rightBracket => _rightBracket;
5447 /** 5962 /**
5448 * Return {@code true} if this expression is computing a right-hand value. 5963 * Return {@code true} if this expression is computing a right-hand value.
5449 * <p> 5964 * <p>
5450 * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are 5965 * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are
5451 * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node. 5966 * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node.
5452 * @return {@code true} if this expression is in a context where the operator '[]' will be invoked 5967 * @return {@code true} if this expression is in a context where the operator '[]' will be invoked
5453 */ 5968 */
5454 bool inGetterContext() { 5969 bool inGetterContext() {
5455 ASTNode parent4 = parent; 5970 ASTNode parent3 = parent;
5456 if (parent4 is AssignmentExpression) { 5971 if (parent3 is AssignmentExpression) {
5457 AssignmentExpression assignment = parent4 as AssignmentExpression; 5972 AssignmentExpression assignment = (parent3 as AssignmentExpression);
5458 if (assignment.leftHandSide == this && assignment.operator.type == TokenTy pe.EQ) { 5973 if (identical(assignment.leftHandSide, this) && identical(assignment.opera tor.type, TokenType.EQ)) {
5459 return false; 5974 return false;
5460 } 5975 }
5461 } 5976 }
5462 return true; 5977 return true;
5463 } 5978 }
5464 /** 5979 /**
5465 * Return {@code true} if this expression is computing a left-hand value. 5980 * Return {@code true} if this expression is computing a left-hand value.
5466 * <p> 5981 * <p>
5467 * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are 5982 * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are
5468 * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node. 5983 * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node.
5469 * @return {@code true} if this expression is in a context where the operator '[]=' will be 5984 * @return {@code true} if this expression is in a context where the operator '[]=' will be
5470 * invoked 5985 * invoked
5471 */ 5986 */
5472 bool inSetterContext() { 5987 bool inSetterContext() {
5473 ASTNode parent5 = parent; 5988 ASTNode parent4 = parent;
5474 if (parent5 is PrefixExpression) { 5989 if (parent4 is PrefixExpression) {
5475 return (parent5 as PrefixExpression).operator.type.isIncrementOperator(); 5990 return ((parent4 as PrefixExpression)).operator.type.isIncrementOperator() ;
5476 } else if (parent5 is PostfixExpression) { 5991 } else if (parent4 is PostfixExpression) {
5477 return true; 5992 return true;
5478 } else if (parent5 is AssignmentExpression) { 5993 } else if (parent4 is AssignmentExpression) {
5479 return (parent5 as AssignmentExpression).leftHandSide == this; 5994 return identical(((parent4 as AssignmentExpression)).leftHandSide, this);
5480 } 5995 }
5481 return false; 5996 return false;
5482 } 5997 }
5483 bool isAssignable() => true; 5998 bool isAssignable() => true;
5484 /** 5999 /**
5485 * Return {@code true} if this expression is cascaded. If it is, then the targ et of this 6000 * Return {@code true} if this expression is cascaded. If it is, then the targ et of this
5486 * expression is not stored locally but is stored in the nearest ancestor that is a{@link CascadeExpression}. 6001 * expression is not stored locally but is stored in the nearest ancestor that is a{@link CascadeExpression}.
5487 * @return {@code true} if this expression is cascaded 6002 * @return {@code true} if this expression is cascaded
5488 */ 6003 */
5489 bool isCascaded() => _period != null; 6004 bool isCascaded() => _period != null;
5490 /** 6005 /**
5491 * Set the expression used to compute the object being indexed to the given ex pression. 6006 * Set the expression used to compute the object being indexed to the given ex pression.
5492 * @param expression the expression used to compute the object being indexed 6007 * @param expression the expression used to compute the object being indexed
5493 */ 6008 */
5494 void set array2(Expression expression) { 6009 void set array(Expression expression) {
5495 _target = becomeParentOf(expression); 6010 _target = becomeParentOf(expression);
5496 } 6011 }
5497 /** 6012 /**
5498 * Set the element associated with the operator to the given element. 6013 * Set the element associated with the operator to the given element.
5499 * @param element the element associated with this operator 6014 * @param element the element associated with this operator
5500 */ 6015 */
5501 void set element11(MethodElement element) { 6016 void set element(MethodElement element12) {
5502 this._element = element; 6017 this._element = element12;
5503 } 6018 }
5504 /** 6019 /**
5505 * Set the expression used to compute the index to the given expression. 6020 * Set the expression used to compute the index to the given expression.
5506 * @param expression the expression used to compute the index 6021 * @param expression the expression used to compute the index
5507 */ 6022 */
5508 void set index2(Expression expression) { 6023 void set index(Expression expression) {
5509 _index = becomeParentOf(expression); 6024 _index = becomeParentOf(expression);
5510 } 6025 }
5511 /** 6026 /**
5512 * Set the left square bracket to the given token. 6027 * Set the left square bracket to the given token.
5513 * @param bracket the left square bracket 6028 * @param bracket the left square bracket
5514 */ 6029 */
5515 void set leftBracket4(Token bracket) { 6030 void set leftBracket(Token bracket) {
5516 _leftBracket = bracket; 6031 _leftBracket = bracket;
5517 } 6032 }
5518 /** 6033 /**
5519 * Set the period ("..") before a cascaded index expression to the given token . 6034 * Set the period ("..") before a cascaded index expression to the given token .
5520 * @param period the period ("..") before a cascaded index expression 6035 * @param period the period ("..") before a cascaded index expression
5521 */ 6036 */
5522 void set period7(Token period) { 6037 void set period(Token period8) {
5523 this._period = period; 6038 this._period = period8;
5524 } 6039 }
5525 /** 6040 /**
5526 * Set the right square bracket to the given token. 6041 * Set the right square bracket to the given token.
5527 * @param bracket the right square bracket 6042 * @param bracket the right square bracket
5528 */ 6043 */
5529 void set rightBracket4(Token bracket) { 6044 void set rightBracket(Token bracket) {
5530 _rightBracket = bracket; 6045 _rightBracket = bracket;
5531 } 6046 }
5532 void visitChildren(ASTVisitor<Object> visitor) { 6047 void visitChildren(ASTVisitor<Object> visitor) {
5533 safelyVisitChild(_target, visitor); 6048 safelyVisitChild(_target, visitor);
5534 safelyVisitChild(_index, visitor); 6049 safelyVisitChild(_index, visitor);
5535 } 6050 }
5536 } 6051 }
5537 /** 6052 /**
5538 * Instances of the class {@code InstanceCreationExpression} represent an instan ce creation 6053 * Instances of the class {@code InstanceCreationExpression} represent an instan ce creation
5539 * expression. 6054 * expression.
(...skipping 18 matching lines...) Expand all
5558 * The element associated with the constructor, or {@code null} if the AST str ucture has not been 6073 * The element associated with the constructor, or {@code null} if the AST str ucture has not been
5559 * resolved or if the constructor could not be resolved. 6074 * resolved or if the constructor could not be resolved.
5560 */ 6075 */
5561 ConstructorElement _element; 6076 ConstructorElement _element;
5562 /** 6077 /**
5563 * Initialize a newly created instance creation expression. 6078 * Initialize a newly created instance creation expression.
5564 * @param keyword the keyword used to indicate how an object should be created 6079 * @param keyword the keyword used to indicate how an object should be created
5565 * @param constructorName the name of the constructor to be invoked 6080 * @param constructorName the name of the constructor to be invoked
5566 * @param argumentList the list of arguments to the constructor 6081 * @param argumentList the list of arguments to the constructor
5567 */ 6082 */
5568 InstanceCreationExpression(Token keyword, ConstructorName constructorName, Arg umentList argumentList) { 6083 InstanceCreationExpression.full(Token keyword, ConstructorName constructorName , ArgumentList argumentList) {
5569 this._keyword = keyword; 6084 this._keyword = keyword;
5570 this._constructorName = becomeParentOf(constructorName); 6085 this._constructorName = becomeParentOf(constructorName);
5571 this._argumentList = becomeParentOf(argumentList); 6086 this._argumentList = becomeParentOf(argumentList);
5572 } 6087 }
6088 /**
6089 * Initialize a newly created instance creation expression.
6090 * @param keyword the keyword used to indicate how an object should be created
6091 * @param constructorName the name of the constructor to be invoked
6092 * @param argumentList the list of arguments to the constructor
6093 */
6094 InstanceCreationExpression({Token keyword, ConstructorName constructorName, Ar gumentList argumentList}) : this.full(keyword, constructorName, argumentList);
5573 accept(ASTVisitor visitor) => visitor.visitInstanceCreationExpression(this); 6095 accept(ASTVisitor visitor) => visitor.visitInstanceCreationExpression(this);
5574 /** 6096 /**
5575 * Return the list of arguments to the constructor. 6097 * Return the list of arguments to the constructor.
5576 * @return the list of arguments to the constructor 6098 * @return the list of arguments to the constructor
5577 */ 6099 */
5578 ArgumentList get argumentList => _argumentList; 6100 ArgumentList get argumentList => _argumentList;
5579 Token get beginToken => _keyword; 6101 Token get beginToken => _keyword;
5580 /** 6102 /**
5581 * Return the name of the constructor to be invoked. 6103 * Return the name of the constructor to be invoked.
5582 * @return the name of the constructor to be invoked 6104 * @return the name of the constructor to be invoked
5583 */ 6105 */
5584 ConstructorName get constructorName => _constructorName; 6106 ConstructorName get constructorName => _constructorName;
5585 /** 6107 /**
5586 * Return the element associated with the constructor, or {@code null} if the AST structure has 6108 * Return the element associated with the constructor, or {@code null} if the AST structure has
5587 * not been resolved or if the constructor could not be resolved. 6109 * not been resolved or if the constructor could not be resolved.
5588 * @return the element associated with the constructor 6110 * @return the element associated with the constructor
5589 */ 6111 */
5590 ConstructorElement get element => _element; 6112 ConstructorElement get element => _element;
5591 Token get endToken => _argumentList.endToken; 6113 Token get endToken => _argumentList.endToken;
5592 /** 6114 /**
5593 * Return the keyword used to indicate how an object should be created. 6115 * Return the keyword used to indicate how an object should be created.
5594 * @return the keyword used to indicate how an object should be created 6116 * @return the keyword used to indicate how an object should be created
5595 */ 6117 */
5596 Token get keyword => _keyword; 6118 Token get keyword => _keyword;
5597 /** 6119 /**
5598 * Set the list of arguments to the constructor to the given list. 6120 * Set the list of arguments to the constructor to the given list.
5599 * @param argumentList the list of arguments to the constructor 6121 * @param argumentList the list of arguments to the constructor
5600 */ 6122 */
5601 void set argumentList6(ArgumentList argumentList) { 6123 void set argumentList(ArgumentList argumentList6) {
5602 this._argumentList = becomeParentOf(argumentList); 6124 this._argumentList = becomeParentOf(argumentList6);
5603 } 6125 }
5604 /** 6126 /**
5605 * Set the name of the constructor to be invoked to the given name. 6127 * Set the name of the constructor to be invoked to the given name.
5606 * @param constructorName the name of the constructor to be invoked 6128 * @param constructorName the name of the constructor to be invoked
5607 */ 6129 */
5608 void set constructorName3(ConstructorName constructorName) { 6130 void set constructorName(ConstructorName constructorName3) {
5609 this._constructorName = constructorName; 6131 this._constructorName = constructorName3;
5610 } 6132 }
5611 /** 6133 /**
5612 * Set the element associated with the constructor to the given element. 6134 * Set the element associated with the constructor to the given element.
5613 * @param element the element associated with the constructor 6135 * @param element the element associated with the constructor
5614 */ 6136 */
5615 void set element12(ConstructorElement element) { 6137 void set element(ConstructorElement element13) {
5616 this._element = element; 6138 this._element = element13;
5617 } 6139 }
5618 /** 6140 /**
5619 * Set the keyword used to indicate how an object should be created to the giv en keyword. 6141 * Set the keyword used to indicate how an object should be created to the giv en keyword.
5620 * @param keyword the keyword used to indicate how an object should be created 6142 * @param keyword the keyword used to indicate how an object should be created
5621 */ 6143 */
5622 void set keyword12(Token keyword) { 6144 void set keyword(Token keyword12) {
5623 this._keyword = keyword; 6145 this._keyword = keyword12;
5624 } 6146 }
5625 void visitChildren(ASTVisitor<Object> visitor) { 6147 void visitChildren(ASTVisitor<Object> visitor) {
5626 safelyVisitChild(_constructorName, visitor); 6148 safelyVisitChild(_constructorName, visitor);
5627 safelyVisitChild(_argumentList, visitor); 6149 safelyVisitChild(_argumentList, visitor);
5628 } 6150 }
5629 } 6151 }
5630 /** 6152 /**
5631 * Instances of the class {@code IntegerLiteral} represent an integer literal ex pression. 6153 * Instances of the class {@code IntegerLiteral} represent an integer literal ex pression.
5632 * <pre> 6154 * <pre>
5633 * integerLiteral ::= 6155 * integerLiteral ::=
(...skipping 13 matching lines...) Expand all
5647 Token _literal; 6169 Token _literal;
5648 /** 6170 /**
5649 * The value of the literal. 6171 * The value of the literal.
5650 */ 6172 */
5651 int _value = 0; 6173 int _value = 0;
5652 /** 6174 /**
5653 * Initialize a newly created integer literal. 6175 * Initialize a newly created integer literal.
5654 * @param literal the token representing the literal 6176 * @param literal the token representing the literal
5655 * @param value the value of the literal 6177 * @param value the value of the literal
5656 */ 6178 */
5657 IntegerLiteral.con1(Token literal, int value) { 6179 IntegerLiteral.full(Token literal, int value) {
5658 _jtd_constructor_58_impl(literal, value);
5659 }
5660 _jtd_constructor_58_impl(Token literal, int value) {
5661 this._literal = literal; 6180 this._literal = literal;
5662 this._value = value; 6181 this._value = value;
5663 } 6182 }
5664 /** 6183 /**
5665 * Initialize a newly created integer literal. 6184 * Initialize a newly created integer literal.
5666 * @param token the token representing the literal 6185 * @param literal the token representing the literal
5667 * @param value the value of the literal 6186 * @param value the value of the literal
5668 */ 6187 */
5669 IntegerLiteral.con2(Token token, int value) { 6188 IntegerLiteral({Token literal, int value}) : this.full(literal, value);
5670 _jtd_constructor_59_impl(token, value);
5671 }
5672 _jtd_constructor_59_impl(Token token, int value) {
5673 _jtd_constructor_58_impl(token, value);
5674 }
5675 accept(ASTVisitor visitor) => visitor.visitIntegerLiteral(this); 6189 accept(ASTVisitor visitor) => visitor.visitIntegerLiteral(this);
5676 Token get beginToken => _literal; 6190 Token get beginToken => _literal;
5677 Token get endToken => _literal; 6191 Token get endToken => _literal;
5678 /** 6192 /**
5679 * Return the token representing the literal. 6193 * Return the token representing the literal.
5680 * @return the token representing the literal 6194 * @return the token representing the literal
5681 */ 6195 */
5682 Token get literal => _literal; 6196 Token get literal => _literal;
5683 /** 6197 /**
5684 * Return the value of the literal. 6198 * Return the value of the literal.
5685 * @return the value of the literal 6199 * @return the value of the literal
5686 */ 6200 */
5687 int get value => _value; 6201 int get value => _value;
5688 /** 6202 /**
5689 * Set the token representing the literal to the given token. 6203 * Set the token representing the literal to the given token.
5690 * @param literal the token representing the literal 6204 * @param literal the token representing the literal
5691 */ 6205 */
5692 void set literal4(Token literal) { 6206 void set literal(Token literal4) {
5693 this._literal = literal; 6207 this._literal = literal4;
5694 } 6208 }
5695 /** 6209 /**
5696 * Set the value of the literal to the given value. 6210 * Set the value of the literal to the given value.
5697 * @param value the value of the literal 6211 * @param value the value of the literal
5698 */ 6212 */
5699 void set value6(int value) { 6213 void set value(int value6) {
5700 this._value = value; 6214 this._value = value6;
5701 } 6215 }
5702 void visitChildren(ASTVisitor<Object> visitor) { 6216 void visitChildren(ASTVisitor<Object> visitor) {
5703 } 6217 }
5704 } 6218 }
5705 /** 6219 /**
5706 * The abstract class {@code InterpolationElement} defines the behavior common t o elements within a{@link StringInterpolation string interpolation}. 6220 * The abstract class {@code InterpolationElement} defines the behavior common t o elements within a{@link StringInterpolation string interpolation}.
5707 * <pre> 6221 * <pre>
5708 * interpolationElement ::={@link InterpolationExpression interpolationExpressio n}| {@link InterpolationString interpolationString}</pre> 6222 * interpolationElement ::={@link InterpolationExpression interpolationExpressio n}| {@link InterpolationString interpolationString}</pre>
5709 */ 6223 */
5710 abstract class InterpolationElement extends ASTNode { 6224 abstract class InterpolationElement extends ASTNode {
(...skipping 19 matching lines...) Expand all
5730 /** 6244 /**
5731 * The right curly bracket, or {@code null} if the expression is an identifier without brackets. 6245 * The right curly bracket, or {@code null} if the expression is an identifier without brackets.
5732 */ 6246 */
5733 Token _rightBracket; 6247 Token _rightBracket;
5734 /** 6248 /**
5735 * Initialize a newly created interpolation expression. 6249 * Initialize a newly created interpolation expression.
5736 * @param leftBracket the left curly bracket 6250 * @param leftBracket the left curly bracket
5737 * @param expression the expression to be evaluated for the value to be conver ted into a string 6251 * @param expression the expression to be evaluated for the value to be conver ted into a string
5738 * @param rightBracket the right curly bracket 6252 * @param rightBracket the right curly bracket
5739 */ 6253 */
5740 InterpolationExpression(Token leftBracket, Expression expression, Token rightB racket) { 6254 InterpolationExpression.full(Token leftBracket, Expression expression, Token r ightBracket) {
5741 this._leftBracket = leftBracket; 6255 this._leftBracket = leftBracket;
5742 this._expression = becomeParentOf(expression); 6256 this._expression = becomeParentOf(expression);
5743 this._rightBracket = rightBracket; 6257 this._rightBracket = rightBracket;
5744 } 6258 }
6259 /**
6260 * Initialize a newly created interpolation expression.
6261 * @param leftBracket the left curly bracket
6262 * @param expression the expression to be evaluated for the value to be conver ted into a string
6263 * @param rightBracket the right curly bracket
6264 */
6265 InterpolationExpression({Token leftBracket, Expression expression, Token right Bracket}) : this.full(leftBracket, expression, rightBracket);
5745 accept(ASTVisitor visitor) => visitor.visitInterpolationExpression(this); 6266 accept(ASTVisitor visitor) => visitor.visitInterpolationExpression(this);
5746 Token get beginToken => _leftBracket; 6267 Token get beginToken => _leftBracket;
5747 Token get endToken { 6268 Token get endToken {
5748 if (_rightBracket != null) { 6269 if (_rightBracket != null) {
5749 return _rightBracket; 6270 return _rightBracket;
5750 } 6271 }
5751 return _expression.endToken; 6272 return _expression.endToken;
5752 } 6273 }
5753 /** 6274 /**
5754 * Return the expression to be evaluated for the value to be converted into a string. 6275 * Return the expression to be evaluated for the value to be converted into a string.
5755 * @return the expression to be evaluated for the value to be converted into a string 6276 * @return the expression to be evaluated for the value to be converted into a string
5756 */ 6277 */
5757 Expression get expression => _expression; 6278 Expression get expression => _expression;
5758 /** 6279 /**
5759 * Return the left curly bracket. 6280 * Return the left curly bracket.
5760 * @return the left curly bracket 6281 * @return the left curly bracket
5761 */ 6282 */
5762 Token get leftBracket => _leftBracket; 6283 Token get leftBracket => _leftBracket;
5763 /** 6284 /**
5764 * Return the right curly bracket. 6285 * Return the right curly bracket.
5765 * @return the right curly bracket 6286 * @return the right curly bracket
5766 */ 6287 */
5767 Token get rightBracket => _rightBracket; 6288 Token get rightBracket => _rightBracket;
5768 /** 6289 /**
5769 * Set the expression to be evaluated for the value to be converted into a str ing to the given 6290 * Set the expression to be evaluated for the value to be converted into a str ing to the given
5770 * expression. 6291 * expression.
5771 * @param expression the expression to be evaluated for the value to be conver ted into a string 6292 * @param expression the expression to be evaluated for the value to be conver ted into a string
5772 */ 6293 */
5773 void set expression6(Expression expression) { 6294 void set expression(Expression expression6) {
5774 this._expression = becomeParentOf(expression); 6295 this._expression = becomeParentOf(expression6);
5775 } 6296 }
5776 /** 6297 /**
5777 * Set the left curly bracket to the given token. 6298 * Set the left curly bracket to the given token.
5778 * @param leftBracket the left curly bracket 6299 * @param leftBracket the left curly bracket
5779 */ 6300 */
5780 void set leftBracket5(Token leftBracket) { 6301 void set leftBracket(Token leftBracket6) {
5781 this._leftBracket = leftBracket; 6302 this._leftBracket = leftBracket6;
5782 } 6303 }
5783 /** 6304 /**
5784 * Set the right curly bracket to the given token. 6305 * Set the right curly bracket to the given token.
5785 * @param rightBracket the right curly bracket 6306 * @param rightBracket the right curly bracket
5786 */ 6307 */
5787 void set rightBracket5(Token rightBracket) { 6308 void set rightBracket(Token rightBracket6) {
5788 this._rightBracket = rightBracket; 6309 this._rightBracket = rightBracket6;
5789 } 6310 }
5790 void visitChildren(ASTVisitor<Object> visitor) { 6311 void visitChildren(ASTVisitor<Object> visitor) {
5791 safelyVisitChild(_expression, visitor); 6312 safelyVisitChild(_expression, visitor);
5792 } 6313 }
5793 } 6314 }
5794 /** 6315 /**
5795 * Instances of the class {@code InterpolationString} represent a non-empty subs tring of an 6316 * Instances of the class {@code InterpolationString} represent a non-empty subs tring of an
5796 * interpolated string. 6317 * interpolated string.
5797 * <pre> 6318 * <pre>
5798 * interpolationString ::= 6319 * interpolationString ::=
5799 * characters 6320 * characters
5800 * </pre> 6321 * </pre>
5801 */ 6322 */
5802 class InterpolationString extends InterpolationElement { 6323 class InterpolationString extends InterpolationElement {
5803 /** 6324 /**
5804 * The characters that will be added to the string. 6325 * The characters that will be added to the string.
5805 */ 6326 */
5806 Token _contents; 6327 Token _contents;
5807 /** 6328 /**
5808 * The value of the literal. 6329 * The value of the literal.
5809 */ 6330 */
5810 String _value; 6331 String _value;
5811 /** 6332 /**
5812 * Initialize a newly created string of characters that are part of a string i nterpolation. 6333 * Initialize a newly created string of characters that are part of a string i nterpolation.
5813 * @param the characters that will be added to the string 6334 * @param the characters that will be added to the string
5814 * @param value the value of the literal 6335 * @param value the value of the literal
5815 */ 6336 */
5816 InterpolationString(Token contents, String value) { 6337 InterpolationString.full(Token contents, String value) {
5817 this._contents = contents; 6338 this._contents = contents;
5818 this._value = value; 6339 this._value = value;
5819 } 6340 }
6341 /**
6342 * Initialize a newly created string of characters that are part of a string i nterpolation.
6343 * @param the characters that will be added to the string
6344 * @param value the value of the literal
6345 */
6346 InterpolationString({Token contents, String value}) : this.full(contents, valu e);
5820 accept(ASTVisitor visitor) => visitor.visitInterpolationString(this); 6347 accept(ASTVisitor visitor) => visitor.visitInterpolationString(this);
5821 Token get beginToken => _contents; 6348 Token get beginToken => _contents;
5822 /** 6349 /**
5823 * Return the characters that will be added to the string. 6350 * Return the characters that will be added to the string.
5824 * @return the characters that will be added to the string 6351 * @return the characters that will be added to the string
5825 */ 6352 */
5826 Token get contents => _contents; 6353 Token get contents => _contents;
5827 Token get endToken => _contents; 6354 Token get endToken => _contents;
5828 /** 6355 /**
5829 * Return the value of the literal. 6356 * Return the value of the literal.
5830 * @return the value of the literal 6357 * @return the value of the literal
5831 */ 6358 */
5832 String get value => _value; 6359 String get value => _value;
5833 /** 6360 /**
5834 * Set the characters that will be added to the string to those in the given s tring. 6361 * Set the characters that will be added to the string to those in the given s tring.
5835 * @param string the characters that will be added to the string 6362 * @param string the characters that will be added to the string
5836 */ 6363 */
5837 void set contents2(Token string) { 6364 void set contents(Token string) {
5838 _contents = string; 6365 _contents = string;
5839 } 6366 }
5840 /** 6367 /**
5841 * Set the value of the literal to the given string. 6368 * Set the value of the literal to the given string.
5842 * @param string the value of the literal 6369 * @param string the value of the literal
5843 */ 6370 */
5844 void set value7(String string) { 6371 void set value(String string) {
5845 _value = string; 6372 _value = string;
5846 } 6373 }
5847 void visitChildren(ASTVisitor<Object> visitor) { 6374 void visitChildren(ASTVisitor<Object> visitor) {
5848 } 6375 }
5849 } 6376 }
5850 /** 6377 /**
5851 * Instances of the class {@code IsExpression} represent an is expression. 6378 * Instances of the class {@code IsExpression} represent an is expression.
5852 * <pre> 6379 * <pre>
5853 * isExpression ::={@link Expression expression} 'is' '!'? {@link TypeName type} </pre> 6380 * isExpression ::={@link Expression expression} 'is' '!'? {@link TypeName type} </pre>
5854 */ 6381 */
(...skipping 14 matching lines...) Expand all
5869 * The name of the type being tested for. 6396 * The name of the type being tested for.
5870 */ 6397 */
5871 TypeName _type; 6398 TypeName _type;
5872 /** 6399 /**
5873 * Initialize a newly created is expression. 6400 * Initialize a newly created is expression.
5874 * @param expression the expression used to compute the value whose type is be ing tested 6401 * @param expression the expression used to compute the value whose type is be ing tested
5875 * @param isOperator the is operator 6402 * @param isOperator the is operator
5876 * @param notOperator the not operator, or {@code null} if the sense of the te st is not negated 6403 * @param notOperator the not operator, or {@code null} if the sense of the te st is not negated
5877 * @param type the name of the type being tested for 6404 * @param type the name of the type being tested for
5878 */ 6405 */
5879 IsExpression(Expression expression, Token isOperator, Token notOperator, TypeN ame type) { 6406 IsExpression.full(Expression expression, Token isOperator, Token notOperator, TypeName type) {
5880 this._expression = becomeParentOf(expression); 6407 this._expression = becomeParentOf(expression);
5881 this._isOperator = isOperator; 6408 this._isOperator = isOperator;
5882 this._notOperator = notOperator; 6409 this._notOperator = notOperator;
5883 this._type = becomeParentOf(type); 6410 this._type = becomeParentOf(type);
5884 } 6411 }
6412 /**
6413 * Initialize a newly created is expression.
6414 * @param expression the expression used to compute the value whose type is be ing tested
6415 * @param isOperator the is operator
6416 * @param notOperator the not operator, or {@code null} if the sense of the te st is not negated
6417 * @param type the name of the type being tested for
6418 */
6419 IsExpression({Expression expression, Token isOperator, Token notOperator, Type Name type}) : this.full(expression, isOperator, notOperator, type);
5885 accept(ASTVisitor visitor) => visitor.visitIsExpression(this); 6420 accept(ASTVisitor visitor) => visitor.visitIsExpression(this);
5886 Token get beginToken => _expression.beginToken; 6421 Token get beginToken => _expression.beginToken;
5887 Token get endToken => _type.endToken; 6422 Token get endToken => _type.endToken;
5888 /** 6423 /**
5889 * Return the expression used to compute the value whose type is being tested. 6424 * Return the expression used to compute the value whose type is being tested.
5890 * @return the expression used to compute the value whose type is being tested 6425 * @return the expression used to compute the value whose type is being tested
5891 */ 6426 */
5892 Expression get expression => _expression; 6427 Expression get expression => _expression;
5893 /** 6428 /**
5894 * Return the is operator being applied. 6429 * Return the is operator being applied.
5895 * @return the is operator being applied 6430 * @return the is operator being applied
5896 */ 6431 */
5897 Token get isOperator => _isOperator; 6432 Token get isOperator => _isOperator;
5898 /** 6433 /**
5899 * Return the not operator being applied. 6434 * Return the not operator being applied.
5900 * @return the not operator being applied 6435 * @return the not operator being applied
5901 */ 6436 */
5902 Token get notOperator => _notOperator; 6437 Token get notOperator => _notOperator;
5903 /** 6438 /**
5904 * Return the name of the type being tested for. 6439 * Return the name of the type being tested for.
5905 * @return the name of the type being tested for 6440 * @return the name of the type being tested for
5906 */ 6441 */
5907 TypeName get type => _type; 6442 TypeName get type => _type;
5908 /** 6443 /**
5909 * Set the expression used to compute the value whose type is being tested to the given 6444 * Set the expression used to compute the value whose type is being tested to the given
5910 * expression. 6445 * expression.
5911 * @param expression the expression used to compute the value whose type is be ing tested 6446 * @param expression the expression used to compute the value whose type is be ing tested
5912 */ 6447 */
5913 void set expression7(Expression expression) { 6448 void set expression(Expression expression7) {
5914 this._expression = becomeParentOf(expression); 6449 this._expression = becomeParentOf(expression7);
5915 } 6450 }
5916 /** 6451 /**
5917 * Set the is operator being applied to the given operator. 6452 * Set the is operator being applied to the given operator.
5918 * @param isOperator the is operator being applied 6453 * @param isOperator the is operator being applied
5919 */ 6454 */
5920 void set isOperator2(Token isOperator) { 6455 void set isOperator(Token isOperator2) {
5921 this._isOperator = isOperator; 6456 this._isOperator = isOperator2;
5922 } 6457 }
5923 /** 6458 /**
5924 * Set the not operator being applied to the given operator. 6459 * Set the not operator being applied to the given operator.
5925 * @param notOperator the is operator being applied 6460 * @param notOperator the is operator being applied
5926 */ 6461 */
5927 void set notOperator2(Token notOperator) { 6462 void set notOperator(Token notOperator2) {
5928 this._notOperator = notOperator; 6463 this._notOperator = notOperator2;
5929 } 6464 }
5930 /** 6465 /**
5931 * Set the name of the type being tested for to the given name. 6466 * Set the name of the type being tested for to the given name.
5932 * @param name the name of the type being tested for 6467 * @param name the name of the type being tested for
5933 */ 6468 */
5934 void set type5(TypeName name) { 6469 void set type(TypeName name) {
5935 this._type = becomeParentOf(name); 6470 this._type = becomeParentOf(name);
5936 } 6471 }
5937 void visitChildren(ASTVisitor<Object> visitor) { 6472 void visitChildren(ASTVisitor<Object> visitor) {
5938 safelyVisitChild(_expression, visitor); 6473 safelyVisitChild(_expression, visitor);
5939 safelyVisitChild(_type, visitor); 6474 safelyVisitChild(_type, visitor);
5940 } 6475 }
5941 } 6476 }
5942 /** 6477 /**
5943 * Instances of the class {@code Label} represent a label. 6478 * Instances of the class {@code Label} represent a label.
5944 * <pre> 6479 * <pre>
5945 * label ::={@link SimpleIdentifier label} ':' 6480 * label ::={@link SimpleIdentifier label} ':'
5946 * </pre> 6481 * </pre>
5947 */ 6482 */
5948 class Label extends ASTNode { 6483 class Label extends ASTNode {
5949 /** 6484 /**
5950 * The label being associated with the statement. 6485 * The label being associated with the statement.
5951 */ 6486 */
5952 SimpleIdentifier _label; 6487 SimpleIdentifier _label;
5953 /** 6488 /**
5954 * The colon that separates the label from the statement. 6489 * The colon that separates the label from the statement.
5955 */ 6490 */
5956 Token _colon; 6491 Token _colon;
5957 /** 6492 /**
5958 * Initialize a newly created label. 6493 * Initialize a newly created label.
5959 * @param label the label being applied 6494 * @param label the label being applied
5960 * @param colon the colon that separates the label from whatever follows 6495 * @param colon the colon that separates the label from whatever follows
5961 */ 6496 */
5962 Label(SimpleIdentifier label, Token colon) { 6497 Label.full(SimpleIdentifier label, Token colon) {
5963 this._label = becomeParentOf(label); 6498 this._label = becomeParentOf(label);
5964 this._colon = colon; 6499 this._colon = colon;
5965 } 6500 }
6501 /**
6502 * Initialize a newly created label.
6503 * @param label the label being applied
6504 * @param colon the colon that separates the label from whatever follows
6505 */
6506 Label({SimpleIdentifier label, Token colon}) : this.full(label, colon);
5966 accept(ASTVisitor visitor) => visitor.visitLabel(this); 6507 accept(ASTVisitor visitor) => visitor.visitLabel(this);
5967 Token get beginToken => _label.beginToken; 6508 Token get beginToken => _label.beginToken;
5968 /** 6509 /**
5969 * Return the colon that separates the label from the statement. 6510 * Return the colon that separates the label from the statement.
5970 * @return the colon that separates the label from the statement 6511 * @return the colon that separates the label from the statement
5971 */ 6512 */
5972 Token get colon => _colon; 6513 Token get colon => _colon;
5973 Token get endToken => _colon; 6514 Token get endToken => _colon;
5974 /** 6515 /**
5975 * Return the label being associated with the statement. 6516 * Return the label being associated with the statement.
5976 * @return the label being associated with the statement 6517 * @return the label being associated with the statement
5977 */ 6518 */
5978 SimpleIdentifier get label => _label; 6519 SimpleIdentifier get label => _label;
5979 /** 6520 /**
5980 * Set the colon that separates the label from the statement to the given toke n. 6521 * Set the colon that separates the label from the statement to the given toke n.
5981 * @param colon the colon that separates the label from the statement 6522 * @param colon the colon that separates the label from the statement
5982 */ 6523 */
5983 void set colon3(Token colon) { 6524 void set colon(Token colon3) {
5984 this._colon = colon; 6525 this._colon = colon3;
5985 } 6526 }
5986 /** 6527 /**
5987 * Set the label being associated with the statement to the given label. 6528 * Set the label being associated with the statement to the given label.
5988 * @param label the label being associated with the statement 6529 * @param label the label being associated with the statement
5989 */ 6530 */
5990 void set label4(SimpleIdentifier label) { 6531 void set label(SimpleIdentifier label2) {
5991 this._label = becomeParentOf(label); 6532 this._label = becomeParentOf(label2);
5992 } 6533 }
5993 void visitChildren(ASTVisitor<Object> visitor) { 6534 void visitChildren(ASTVisitor<Object> visitor) {
5994 safelyVisitChild(_label, visitor); 6535 safelyVisitChild(_label, visitor);
5995 } 6536 }
5996 } 6537 }
5997 /** 6538 /**
5998 * Instances of the class {@code LabeledStatement} represent a statement that ha s a label associated 6539 * Instances of the class {@code LabeledStatement} represent a statement that ha s a label associated
5999 * with them. 6540 * with them.
6000 * <pre> 6541 * <pre>
6001 * labeledStatement ::={@link Label label}+ {@link Statement statement}</pre> 6542 * labeledStatement ::={@link Label label}+ {@link Statement statement}</pre>
6002 */ 6543 */
6003 class LabeledStatement extends Statement { 6544 class LabeledStatement extends Statement {
6004 /** 6545 /**
6005 * The labels being associated with the statement. 6546 * The labels being associated with the statement.
6006 */ 6547 */
6007 NodeList<Label> _labels; 6548 NodeList<Label> _labels;
6008 /** 6549 /**
6009 * The statement with which the labels are being associated. 6550 * The statement with which the labels are being associated.
6010 */ 6551 */
6011 Statement _statement; 6552 Statement _statement;
6012 /** 6553 /**
6013 * Initialize a newly created labeled statement. 6554 * Initialize a newly created labeled statement.
6014 * @param labels the labels being associated with the statement 6555 * @param labels the labels being associated with the statement
6015 * @param statement the statement with which the labels are being associated 6556 * @param statement the statement with which the labels are being associated
6016 */ 6557 */
6017 LabeledStatement(List<Label> labels, Statement statement) { 6558 LabeledStatement.full(List<Label> labels, Statement statement) {
6018 this._labels = new NodeList<Label>(this); 6559 this._labels = new NodeList<Label>(this);
6019 this._labels.addAll(labels); 6560 this._labels.addAll(labels);
6020 this._statement = becomeParentOf(statement); 6561 this._statement = becomeParentOf(statement);
6021 } 6562 }
6563 /**
6564 * Initialize a newly created labeled statement.
6565 * @param labels the labels being associated with the statement
6566 * @param statement the statement with which the labels are being associated
6567 */
6568 LabeledStatement({List<Label> labels, Statement statement}) : this.full(labels , statement);
6022 accept(ASTVisitor visitor) => visitor.visitLabeledStatement(this); 6569 accept(ASTVisitor visitor) => visitor.visitLabeledStatement(this);
6023 Token get beginToken { 6570 Token get beginToken {
6024 if (!_labels.isEmpty) { 6571 if (!_labels.isEmpty) {
6025 return _labels.beginToken; 6572 return _labels.beginToken;
6026 } 6573 }
6027 return _statement.beginToken; 6574 return _statement.beginToken;
6028 } 6575 }
6029 Token get endToken => _statement.endToken; 6576 Token get endToken => _statement.endToken;
6030 /** 6577 /**
6031 * Return the labels being associated with the statement. 6578 * Return the labels being associated with the statement.
6032 * @return the labels being associated with the statement 6579 * @return the labels being associated with the statement
6033 */ 6580 */
6034 NodeList<Label> get labels => _labels; 6581 NodeList<Label> get labels => _labels;
6035 /** 6582 /**
6036 * Return the statement with which the labels are being associated. 6583 * Return the statement with which the labels are being associated.
6037 * @return the statement with which the labels are being associated 6584 * @return the statement with which the labels are being associated
6038 */ 6585 */
6039 Statement get statement => _statement; 6586 Statement get statement => _statement;
6040 /** 6587 /**
6041 * Set the statement with which the labels are being associated to the given s tatement. 6588 * Set the statement with which the labels are being associated to the given s tatement.
6042 * @param statement the statement with which the labels are being associated 6589 * @param statement the statement with which the labels are being associated
6043 */ 6590 */
6044 void set statement2(Statement statement) { 6591 void set statement(Statement statement2) {
6045 this._statement = becomeParentOf(statement); 6592 this._statement = becomeParentOf(statement2);
6046 } 6593 }
6047 void visitChildren(ASTVisitor<Object> visitor) { 6594 void visitChildren(ASTVisitor<Object> visitor) {
6048 _labels.accept(visitor); 6595 _labels.accept(visitor);
6049 safelyVisitChild(_statement, visitor); 6596 safelyVisitChild(_statement, visitor);
6050 } 6597 }
6051 } 6598 }
6052 /** 6599 /**
6053 * Instances of the class {@code LibraryDirective} represent a library directive . 6600 * Instances of the class {@code LibraryDirective} represent a library directive .
6054 * <pre> 6601 * <pre>
6055 * libraryDirective ::={@link Annotation metadata} 'library' {@link Identifier n ame} ';' 6602 * libraryDirective ::={@link Annotation metadata} 'library' {@link Identifier n ame} ';'
(...skipping 13 matching lines...) Expand all
6069 */ 6616 */
6070 Token _semicolon; 6617 Token _semicolon;
6071 /** 6618 /**
6072 * Initialize a newly created library directive. 6619 * Initialize a newly created library directive.
6073 * @param comment the documentation comment associated with this directive 6620 * @param comment the documentation comment associated with this directive
6074 * @param metadata the annotations associated with the directive 6621 * @param metadata the annotations associated with the directive
6075 * @param libraryToken the token representing the 'library' token 6622 * @param libraryToken the token representing the 'library' token
6076 * @param name the name of the library being defined 6623 * @param name the name of the library being defined
6077 * @param semicolon the semicolon terminating the directive 6624 * @param semicolon the semicolon terminating the directive
6078 */ 6625 */
6079 LibraryDirective(Comment comment, List<Annotation> metadata, Token libraryToke n, LibraryIdentifier name, Token semicolon) : super(comment, metadata) { 6626 LibraryDirective.full(Comment comment, List<Annotation> metadata, Token librar yToken, LibraryIdentifier name, Token semicolon) : super.full(comment, metadata) {
6080 this._libraryToken = libraryToken; 6627 this._libraryToken = libraryToken;
6081 this._name = becomeParentOf(name); 6628 this._name = becomeParentOf(name);
6082 this._semicolon = semicolon; 6629 this._semicolon = semicolon;
6083 } 6630 }
6631 /**
6632 * Initialize a newly created library directive.
6633 * @param comment the documentation comment associated with this directive
6634 * @param metadata the annotations associated with the directive
6635 * @param libraryToken the token representing the 'library' token
6636 * @param name the name of the library being defined
6637 * @param semicolon the semicolon terminating the directive
6638 */
6639 LibraryDirective({Comment comment, List<Annotation> metadata, Token libraryTok en, LibraryIdentifier name, Token semicolon}) : this.full(comment, metadata, lib raryToken, name, semicolon);
6084 accept(ASTVisitor visitor) => visitor.visitLibraryDirective(this); 6640 accept(ASTVisitor visitor) => visitor.visitLibraryDirective(this);
6085 Token get endToken => _semicolon; 6641 Token get endToken => _semicolon;
6086 Token get keyword => _libraryToken; 6642 Token get keyword => _libraryToken;
6087 /** 6643 /**
6088 * Return the token representing the 'library' token. 6644 * Return the token representing the 'library' token.
6089 * @return the token representing the 'library' token 6645 * @return the token representing the 'library' token
6090 */ 6646 */
6091 Token get libraryToken => _libraryToken; 6647 Token get libraryToken => _libraryToken;
6092 /** 6648 /**
6093 * Return the name of the library being defined. 6649 * Return the name of the library being defined.
6094 * @return the name of the library being defined 6650 * @return the name of the library being defined
6095 */ 6651 */
6096 LibraryIdentifier get name => _name; 6652 LibraryIdentifier get name => _name;
6097 /** 6653 /**
6098 * Return the semicolon terminating the directive. 6654 * Return the semicolon terminating the directive.
6099 * @return the semicolon terminating the directive 6655 * @return the semicolon terminating the directive
6100 */ 6656 */
6101 Token get semicolon => _semicolon; 6657 Token get semicolon => _semicolon;
6102 /** 6658 /**
6103 * Set the token representing the 'library' token to the given token. 6659 * Set the token representing the 'library' token to the given token.
6104 * @param libraryToken the token representing the 'library' token 6660 * @param libraryToken the token representing the 'library' token
6105 */ 6661 */
6106 void set libraryToken2(Token libraryToken) { 6662 void set libraryToken(Token libraryToken2) {
6107 this._libraryToken = libraryToken; 6663 this._libraryToken = libraryToken2;
6108 } 6664 }
6109 /** 6665 /**
6110 * Set the name of the library being defined to the given name. 6666 * Set the name of the library being defined to the given name.
6111 * @param name the name of the library being defined 6667 * @param name the name of the library being defined
6112 */ 6668 */
6113 void set name9(LibraryIdentifier name) { 6669 void set name(LibraryIdentifier name6) {
6114 this._name = becomeParentOf(name); 6670 this._name = becomeParentOf(name6);
6115 } 6671 }
6116 /** 6672 /**
6117 * Set the semicolon terminating the directive to the given token. 6673 * Set the semicolon terminating the directive to the given token.
6118 * @param semicolon the semicolon terminating the directive 6674 * @param semicolon the semicolon terminating the directive
6119 */ 6675 */
6120 void set semicolon11(Token semicolon) { 6676 void set semicolon(Token semicolon11) {
6121 this._semicolon = semicolon; 6677 this._semicolon = semicolon11;
6122 } 6678 }
6123 void visitChildren(ASTVisitor<Object> visitor) { 6679 void visitChildren(ASTVisitor<Object> visitor) {
6124 super.visitChildren(visitor); 6680 super.visitChildren(visitor);
6125 safelyVisitChild(_name, visitor); 6681 safelyVisitChild(_name, visitor);
6126 } 6682 }
6127 Token get firstTokenAfterCommentAndMetadata => _libraryToken; 6683 Token get firstTokenAfterCommentAndMetadata => _libraryToken;
6128 } 6684 }
6129 /** 6685 /**
6130 * Instances of the class {@code LibraryIdentifier} represent the identifier for a library. 6686 * Instances of the class {@code LibraryIdentifier} represent the identifier for a library.
6131 * <pre> 6687 * <pre>
6132 * libraryIdentifier ::={@link SimpleIdentifier component} ('.' {@link SimpleIde ntifier component}) 6688 * libraryIdentifier ::={@link SimpleIdentifier component} ('.' {@link SimpleIde ntifier component})
6133 * </pre> 6689 * </pre>
6134 */ 6690 */
6135 class LibraryIdentifier extends Identifier { 6691 class LibraryIdentifier extends Identifier {
6136 /** 6692 /**
6137 * The components of the identifier. 6693 * The components of the identifier.
6138 */ 6694 */
6139 NodeList<SimpleIdentifier> _components; 6695 NodeList<SimpleIdentifier> _components;
6140 /** 6696 /**
6141 * Initialize a newly created prefixed identifier. 6697 * Initialize a newly created prefixed identifier.
6142 * @param components the components of the identifier 6698 * @param components the components of the identifier
6143 */ 6699 */
6144 LibraryIdentifier(List<SimpleIdentifier> components) { 6700 LibraryIdentifier.full(List<SimpleIdentifier> components) {
6145 this._components = new NodeList<SimpleIdentifier>(this); 6701 this._components = new NodeList<SimpleIdentifier>(this);
6146 this._components.addAll(components); 6702 this._components.addAll(components);
6147 } 6703 }
6704 /**
6705 * Initialize a newly created prefixed identifier.
6706 * @param components the components of the identifier
6707 */
6708 LibraryIdentifier({List<SimpleIdentifier> components}) : this.full(components) ;
6148 accept(ASTVisitor visitor) => visitor.visitLibraryIdentifier(this); 6709 accept(ASTVisitor visitor) => visitor.visitLibraryIdentifier(this);
6149 Token get beginToken => _components.beginToken; 6710 Token get beginToken => _components.beginToken;
6150 /** 6711 /**
6151 * Return the components of the identifier. 6712 * Return the components of the identifier.
6152 * @return the components of the identifier 6713 * @return the components of the identifier
6153 */ 6714 */
6154 NodeList<SimpleIdentifier> get components => _components; 6715 NodeList<SimpleIdentifier> get components => _components;
6155 Token get endToken => _components.endToken; 6716 Token get endToken => _components.endToken;
6156 String get name { 6717 String get name {
6157 StringBuffer builder = new StringBuffer(); 6718 StringBuffer builder = new StringBuffer();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
6192 Token _rightBracket; 6753 Token _rightBracket;
6193 /** 6754 /**
6194 * Initialize a newly created list literal. 6755 * Initialize a newly created list literal.
6195 * @param modifier the const modifier associated with this literal 6756 * @param modifier the const modifier associated with this literal
6196 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type 6757 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type
6197 * arguments were declared 6758 * arguments were declared
6198 * @param leftBracket the left square bracket 6759 * @param leftBracket the left square bracket
6199 * @param elements the expressions used to compute the elements of the list 6760 * @param elements the expressions used to compute the elements of the list
6200 * @param rightBracket the right square bracket 6761 * @param rightBracket the right square bracket
6201 */ 6762 */
6202 ListLiteral(Token modifier, TypeArgumentList typeArguments, Token leftBracket, List<Expression> elements, Token rightBracket) : super(modifier, typeArguments) { 6763 ListLiteral.full(Token modifier, TypeArgumentList typeArguments, Token leftBra cket, List<Expression> elements, Token rightBracket) : super.full(modifier, type Arguments) {
6203 this._elements = new NodeList<Expression>(this); 6764 this._elements = new NodeList<Expression>(this);
6204 this._leftBracket = leftBracket; 6765 this._leftBracket = leftBracket;
6205 this._elements.addAll(elements); 6766 this._elements.addAll(elements);
6206 this._rightBracket = rightBracket; 6767 this._rightBracket = rightBracket;
6207 } 6768 }
6769 /**
6770 * Initialize a newly created list literal.
6771 * @param modifier the const modifier associated with this literal
6772 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type
6773 * arguments were declared
6774 * @param leftBracket the left square bracket
6775 * @param elements the expressions used to compute the elements of the list
6776 * @param rightBracket the right square bracket
6777 */
6778 ListLiteral({Token modifier, TypeArgumentList typeArguments, Token leftBracket , List<Expression> elements, Token rightBracket}) : this.full(modifier, typeArgu ments, leftBracket, elements, rightBracket);
6208 accept(ASTVisitor visitor) => visitor.visitListLiteral(this); 6779 accept(ASTVisitor visitor) => visitor.visitListLiteral(this);
6209 Token get beginToken { 6780 Token get beginToken {
6210 Token token = modifier; 6781 Token token = modifier;
6211 if (token != null) { 6782 if (token != null) {
6212 return token; 6783 return token;
6213 } 6784 }
6214 TypeArgumentList typeArguments6 = typeArguments; 6785 TypeArgumentList typeArguments6 = typeArguments;
6215 if (typeArguments6 != null) { 6786 if (typeArguments6 != null) {
6216 return typeArguments6.beginToken; 6787 return typeArguments6.beginToken;
6217 } 6788 }
(...skipping 12 matching lines...) Expand all
6230 Token get leftBracket => _leftBracket; 6801 Token get leftBracket => _leftBracket;
6231 /** 6802 /**
6232 * Return the right square bracket. 6803 * Return the right square bracket.
6233 * @return the right square bracket 6804 * @return the right square bracket
6234 */ 6805 */
6235 Token get rightBracket => _rightBracket; 6806 Token get rightBracket => _rightBracket;
6236 /** 6807 /**
6237 * Set the left square bracket to the given token. 6808 * Set the left square bracket to the given token.
6238 * @param bracket the left square bracket 6809 * @param bracket the left square bracket
6239 */ 6810 */
6240 void set leftBracket6(Token bracket) { 6811 void set leftBracket(Token bracket) {
6241 _leftBracket = bracket; 6812 _leftBracket = bracket;
6242 } 6813 }
6243 /** 6814 /**
6244 * Set the right square bracket to the given token. 6815 * Set the right square bracket to the given token.
6245 * @param bracket the right square bracket 6816 * @param bracket the right square bracket
6246 */ 6817 */
6247 void set rightBracket6(Token bracket) { 6818 void set rightBracket(Token bracket) {
6248 _rightBracket = bracket; 6819 _rightBracket = bracket;
6249 } 6820 }
6250 void visitChildren(ASTVisitor<Object> visitor) { 6821 void visitChildren(ASTVisitor<Object> visitor) {
6251 super.visitChildren(visitor); 6822 super.visitChildren(visitor);
6252 _elements.accept(visitor); 6823 _elements.accept(visitor);
6253 } 6824 }
6254 } 6825 }
6255 /** 6826 /**
6256 * The abstract class {@code Literal} defines the behavior common to nodes that represent a literal 6827 * The abstract class {@code Literal} defines the behavior common to nodes that represent a literal
6257 * expression. 6828 * expression.
(...skipping 24 matching lines...) Expand all
6282 Token _rightBracket; 6853 Token _rightBracket;
6283 /** 6854 /**
6284 * Initialize a newly created map literal. 6855 * Initialize a newly created map literal.
6285 * @param modifier the const modifier associated with this literal 6856 * @param modifier the const modifier associated with this literal
6286 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type 6857 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type
6287 * arguments were declared 6858 * arguments were declared
6288 * @param leftBracket the left curly bracket 6859 * @param leftBracket the left curly bracket
6289 * @param entries the entries in the map 6860 * @param entries the entries in the map
6290 * @param rightBracket the right curly bracket 6861 * @param rightBracket the right curly bracket
6291 */ 6862 */
6292 MapLiteral(Token modifier, TypeArgumentList typeArguments, Token leftBracket, List<MapLiteralEntry> entries, Token rightBracket) : super(modifier, typeArgumen ts) { 6863 MapLiteral.full(Token modifier, TypeArgumentList typeArguments, Token leftBrac ket, List<MapLiteralEntry> entries, Token rightBracket) : super.full(modifier, t ypeArguments) {
6293 this._entries = new NodeList<MapLiteralEntry>(this); 6864 this._entries = new NodeList<MapLiteralEntry>(this);
6294 this._leftBracket = leftBracket; 6865 this._leftBracket = leftBracket;
6295 this._entries.addAll(entries); 6866 this._entries.addAll(entries);
6296 this._rightBracket = rightBracket; 6867 this._rightBracket = rightBracket;
6297 } 6868 }
6869 /**
6870 * Initialize a newly created map literal.
6871 * @param modifier the const modifier associated with this literal
6872 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type
6873 * arguments were declared
6874 * @param leftBracket the left curly bracket
6875 * @param entries the entries in the map
6876 * @param rightBracket the right curly bracket
6877 */
6878 MapLiteral({Token modifier, TypeArgumentList typeArguments, Token leftBracket, List<MapLiteralEntry> entries, Token rightBracket}) : this.full(modifier, typeA rguments, leftBracket, entries, rightBracket);
6298 accept(ASTVisitor visitor) => visitor.visitMapLiteral(this); 6879 accept(ASTVisitor visitor) => visitor.visitMapLiteral(this);
6299 Token get beginToken { 6880 Token get beginToken {
6300 Token token = modifier; 6881 Token token = modifier;
6301 if (token != null) { 6882 if (token != null) {
6302 return token; 6883 return token;
6303 } 6884 }
6304 TypeArgumentList typeArguments7 = typeArguments; 6885 TypeArgumentList typeArguments7 = typeArguments;
6305 if (typeArguments7 != null) { 6886 if (typeArguments7 != null) {
6306 return typeArguments7.beginToken; 6887 return typeArguments7.beginToken;
6307 } 6888 }
(...skipping 12 matching lines...) Expand all
6320 Token get leftBracket => _leftBracket; 6901 Token get leftBracket => _leftBracket;
6321 /** 6902 /**
6322 * Return the right curly bracket. 6903 * Return the right curly bracket.
6323 * @return the right curly bracket 6904 * @return the right curly bracket
6324 */ 6905 */
6325 Token get rightBracket => _rightBracket; 6906 Token get rightBracket => _rightBracket;
6326 /** 6907 /**
6327 * Set the left curly bracket to the given token. 6908 * Set the left curly bracket to the given token.
6328 * @param bracket the left curly bracket 6909 * @param bracket the left curly bracket
6329 */ 6910 */
6330 void set leftBracket7(Token bracket) { 6911 void set leftBracket(Token bracket) {
6331 _leftBracket = bracket; 6912 _leftBracket = bracket;
6332 } 6913 }
6333 /** 6914 /**
6334 * Set the right curly bracket to the given token. 6915 * Set the right curly bracket to the given token.
6335 * @param bracket the right curly bracket 6916 * @param bracket the right curly bracket
6336 */ 6917 */
6337 void set rightBracket7(Token bracket) { 6918 void set rightBracket(Token bracket) {
6338 _rightBracket = bracket; 6919 _rightBracket = bracket;
6339 } 6920 }
6340 void visitChildren(ASTVisitor<Object> visitor) { 6921 void visitChildren(ASTVisitor<Object> visitor) {
6341 super.visitChildren(visitor); 6922 super.visitChildren(visitor);
6342 _entries.accept(visitor); 6923 _entries.accept(visitor);
6343 } 6924 }
6344 } 6925 }
6345 /** 6926 /**
6346 * Instances of the class {@code MapLiteralEntry} represent a single key/value p air in a map 6927 * Instances of the class {@code MapLiteralEntry} represent a single key/value p air in a map
6347 * literal. 6928 * literal.
(...skipping 12 matching lines...) Expand all
6360 /** 6941 /**
6361 * The expression computing the value that will be associated with the key. 6942 * The expression computing the value that will be associated with the key.
6362 */ 6943 */
6363 Expression _value; 6944 Expression _value;
6364 /** 6945 /**
6365 * Initialize a newly created map literal entry. 6946 * Initialize a newly created map literal entry.
6366 * @param key the key with which the value will be associated 6947 * @param key the key with which the value will be associated
6367 * @param separator the colon that separates the key from the value 6948 * @param separator the colon that separates the key from the value
6368 * @param value the expression computing the value that will be associated wit h the key 6949 * @param value the expression computing the value that will be associated wit h the key
6369 */ 6950 */
6370 MapLiteralEntry(StringLiteral key, Token separator, Expression value) { 6951 MapLiteralEntry.full(StringLiteral key, Token separator, Expression value) {
6371 this._key = becomeParentOf(key); 6952 this._key = becomeParentOf(key);
6372 this._separator = separator; 6953 this._separator = separator;
6373 this._value = becomeParentOf(value); 6954 this._value = becomeParentOf(value);
6374 } 6955 }
6956 /**
6957 * Initialize a newly created map literal entry.
6958 * @param key the key with which the value will be associated
6959 * @param separator the colon that separates the key from the value
6960 * @param value the expression computing the value that will be associated wit h the key
6961 */
6962 MapLiteralEntry({StringLiteral key, Token separator, Expression value}) : this .full(key, separator, value);
6375 accept(ASTVisitor visitor) => visitor.visitMapLiteralEntry(this); 6963 accept(ASTVisitor visitor) => visitor.visitMapLiteralEntry(this);
6376 Token get beginToken => _key.beginToken; 6964 Token get beginToken => _key.beginToken;
6377 Token get endToken => _value.endToken; 6965 Token get endToken => _value.endToken;
6378 /** 6966 /**
6379 * Return the key with which the value will be associated. 6967 * Return the key with which the value will be associated.
6380 * @return the key with which the value will be associated 6968 * @return the key with which the value will be associated
6381 */ 6969 */
6382 StringLiteral get key => _key; 6970 StringLiteral get key => _key;
6383 /** 6971 /**
6384 * Return the colon that separates the key from the value. 6972 * Return the colon that separates the key from the value.
6385 * @return the colon that separates the key from the value 6973 * @return the colon that separates the key from the value
6386 */ 6974 */
6387 Token get separator => _separator; 6975 Token get separator => _separator;
6388 /** 6976 /**
6389 * Return the expression computing the value that will be associated with the key. 6977 * Return the expression computing the value that will be associated with the key.
6390 * @return the expression computing the value that will be associated with the key 6978 * @return the expression computing the value that will be associated with the key
6391 */ 6979 */
6392 Expression get value => _value; 6980 Expression get value => _value;
6393 /** 6981 /**
6394 * Set the key with which the value will be associated to the given string. 6982 * Set the key with which the value will be associated to the given string.
6395 * @param string the key with which the value will be associated 6983 * @param string the key with which the value will be associated
6396 */ 6984 */
6397 void set key2(StringLiteral string) { 6985 void set key(StringLiteral string) {
6398 _key = becomeParentOf(string); 6986 _key = becomeParentOf(string);
6399 } 6987 }
6400 /** 6988 /**
6401 * Set the colon that separates the key from the value to the given token. 6989 * Set the colon that separates the key from the value to the given token.
6402 * @param separator the colon that separates the key from the value 6990 * @param separator the colon that separates the key from the value
6403 */ 6991 */
6404 void set separator4(Token separator) { 6992 void set separator(Token separator4) {
6405 this._separator = separator; 6993 this._separator = separator4;
6406 } 6994 }
6407 /** 6995 /**
6408 * Set the expression computing the value that will be associated with the key to the given 6996 * Set the expression computing the value that will be associated with the key to the given
6409 * expression. 6997 * expression.
6410 * @param expression the expression computing the value that will be associate d with the key 6998 * @param expression the expression computing the value that will be associate d with the key
6411 */ 6999 */
6412 void set value8(Expression expression) { 7000 void set value(Expression expression) {
6413 _value = becomeParentOf(expression); 7001 _value = becomeParentOf(expression);
6414 } 7002 }
6415 void visitChildren(ASTVisitor<Object> visitor) { 7003 void visitChildren(ASTVisitor<Object> visitor) {
6416 safelyVisitChild(_key, visitor); 7004 safelyVisitChild(_key, visitor);
6417 safelyVisitChild(_value, visitor); 7005 safelyVisitChild(_value, visitor);
6418 } 7006 }
6419 } 7007 }
6420 /** 7008 /**
6421 * Instances of the class {@code MethodDeclaration} represent a method declarati on. 7009 * Instances of the class {@code MethodDeclaration} represent a method declarati on.
6422 * <pre> 7010 * <pre>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
6468 * @param metadata the annotations associated with this method 7056 * @param metadata the annotations associated with this method
6469 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword 7057 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword
6470 * @param returnType the return type of the method 7058 * @param returnType the return type of the method
6471 * @param propertyKeyword the token representing the 'get' or 'set' keyword 7059 * @param propertyKeyword the token representing the 'get' or 'set' keyword
6472 * @param operatorKeyword the token representing the 'operator' keyword 7060 * @param operatorKeyword the token representing the 'operator' keyword
6473 * @param name the name of the method 7061 * @param name the name of the method
6474 * @param parameters the parameters associated with the method, or {@code null } if this method 7062 * @param parameters the parameters associated with the method, or {@code null } if this method
6475 * declares a getter 7063 * declares a getter
6476 * @param body the body of the method 7064 * @param body the body of the method
6477 */ 7065 */
6478 MethodDeclaration(Comment comment, List<Annotation> metadata, Token externalKe yword, Token modifierKeyword, TypeName returnType, Token propertyKeyword, Token operatorKeyword, Identifier name, FormalParameterList parameters, FunctionBody b ody) : super(comment, metadata) { 7066 MethodDeclaration.full(Comment comment, List<Annotation> metadata, Token exter nalKeyword, Token modifierKeyword, TypeName returnType, Token propertyKeyword, T oken operatorKeyword, Identifier name, FormalParameterList parameters, FunctionB ody body) : super.full(comment, metadata) {
6479 this._externalKeyword = externalKeyword; 7067 this._externalKeyword = externalKeyword;
6480 this._modifierKeyword = modifierKeyword; 7068 this._modifierKeyword = modifierKeyword;
6481 this._returnType = becomeParentOf(returnType); 7069 this._returnType = becomeParentOf(returnType);
6482 this._propertyKeyword = propertyKeyword; 7070 this._propertyKeyword = propertyKeyword;
6483 this._operatorKeyword = operatorKeyword; 7071 this._operatorKeyword = operatorKeyword;
6484 this._name = becomeParentOf(name); 7072 this._name = becomeParentOf(name);
6485 this._parameters = becomeParentOf(parameters); 7073 this._parameters = becomeParentOf(parameters);
6486 this._body = becomeParentOf(body); 7074 this._body = becomeParentOf(body);
6487 } 7075 }
7076 /**
7077 * Initialize a newly created method declaration.
7078 * @param externalKeyword the token for the 'external' keyword
7079 * @param comment the documentation comment associated with this method
7080 * @param metadata the annotations associated with this method
7081 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword
7082 * @param returnType the return type of the method
7083 * @param propertyKeyword the token representing the 'get' or 'set' keyword
7084 * @param operatorKeyword the token representing the 'operator' keyword
7085 * @param name the name of the method
7086 * @param parameters the parameters associated with the method, or {@code null } if this method
7087 * declares a getter
7088 * @param body the body of the method
7089 */
7090 MethodDeclaration({Comment comment, List<Annotation> metadata, Token externalK eyword, Token modifierKeyword, TypeName returnType, Token propertyKeyword, Token operatorKeyword, Identifier name, FormalParameterList parameters, FunctionBody body}) : this.full(comment, metadata, externalKeyword, modifierKeyword, returnTy pe, propertyKeyword, operatorKeyword, name, parameters, body);
6488 accept(ASTVisitor visitor) => visitor.visitMethodDeclaration(this); 7091 accept(ASTVisitor visitor) => visitor.visitMethodDeclaration(this);
6489 /** 7092 /**
6490 * Return the body of the method. 7093 * Return the body of the method.
6491 * @return the body of the method 7094 * @return the body of the method
6492 */ 7095 */
6493 FunctionBody get body => _body; 7096 FunctionBody get body => _body;
6494 /** 7097 /**
6495 * Return the element associated with this method, or {@code null} if the AST structure has not 7098 * Return the element associated with this method, or {@code null} if the AST structure has not
6496 * been resolved. The element can either be a {@link MethodElement}, if this r epresents the 7099 * been resolved. The element can either be a {@link MethodElement}, if this r epresents the
6497 * declaration of a normal method, or a {@link PropertyAccessorElement} if thi s represents the 7100 * declaration of a normal method, or a {@link PropertyAccessorElement} if thi s represents the
6498 * declaration of either a getter or a setter. 7101 * declaration of either a getter or a setter.
6499 * @return the element associated with this method 7102 * @return the element associated with this method
6500 */ 7103 */
6501 ExecutableElement get element => _name != null ? _name.element as ExecutableEl ement : null; 7104 ExecutableElement get element => _name != null ? (_name.element as ExecutableE lement) : null;
6502 Token get endToken => _body.endToken; 7105 Token get endToken => _body.endToken;
6503 /** 7106 /**
6504 * Return the token for the 'external' keyword, or {@code null} if the constru ctor is not 7107 * Return the token for the 'external' keyword, or {@code null} if the constru ctor is not
6505 * external. 7108 * external.
6506 * @return the token for the 'external' keyword 7109 * @return the token for the 'external' keyword
6507 */ 7110 */
6508 Token get externalKeyword => _externalKeyword; 7111 Token get externalKeyword => _externalKeyword;
6509 /** 7112 /**
6510 * Return the token representing the 'abstract' or 'static' keyword, or {@code null} if neither 7113 * Return the token representing the 'abstract' or 'static' keyword, or {@code null} if neither
6511 * modifier was specified. 7114 * modifier was specified.
(...skipping 25 matching lines...) Expand all
6537 Token get propertyKeyword => _propertyKeyword; 7140 Token get propertyKeyword => _propertyKeyword;
6538 /** 7141 /**
6539 * Return the return type of the method, or {@code null} if no return type was declared. 7142 * Return the return type of the method, or {@code null} if no return type was declared.
6540 * @return the return type of the method 7143 * @return the return type of the method
6541 */ 7144 */
6542 TypeName get returnType => _returnType; 7145 TypeName get returnType => _returnType;
6543 /** 7146 /**
6544 * Return {@code true} if this method declares a getter. 7147 * Return {@code true} if this method declares a getter.
6545 * @return {@code true} if this method declares a getter 7148 * @return {@code true} if this method declares a getter
6546 */ 7149 */
6547 bool isGetter() => _propertyKeyword != null && (_propertyKeyword as KeywordTok en).keyword == Keyword.GET; 7150 bool isGetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET);
6548 /** 7151 /**
6549 * Return {@code true} if this method declares an operator. 7152 * Return {@code true} if this method declares an operator.
6550 * @return {@code true} if this method declares an operator 7153 * @return {@code true} if this method declares an operator
6551 */ 7154 */
6552 bool isOperator() => _operatorKeyword != null; 7155 bool isOperator() => _operatorKeyword != null;
6553 /** 7156 /**
6554 * Return {@code true} if this method declares a setter. 7157 * Return {@code true} if this method declares a setter.
6555 * @return {@code true} if this method declares a setter 7158 * @return {@code true} if this method declares a setter
6556 */ 7159 */
6557 bool isSetter() => _propertyKeyword != null && (_propertyKeyword as KeywordTok en).keyword == Keyword.SET; 7160 bool isSetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET);
6558 /** 7161 /**
6559 * Set the body of the method to the given function body. 7162 * Set the body of the method to the given function body.
6560 * @param functionBody the body of the method 7163 * @param functionBody the body of the method
6561 */ 7164 */
6562 void set body8(FunctionBody functionBody) { 7165 void set body(FunctionBody functionBody) {
6563 _body = becomeParentOf(functionBody); 7166 _body = becomeParentOf(functionBody);
6564 } 7167 }
6565 /** 7168 /**
6566 * Set the token for the 'external' keyword to the given token. 7169 * Set the token for the 'external' keyword to the given token.
6567 * @param externalKeyword the token for the 'external' keyword 7170 * @param externalKeyword the token for the 'external' keyword
6568 */ 7171 */
6569 void set externalKeyword4(Token externalKeyword) { 7172 void set externalKeyword(Token externalKeyword4) {
6570 this._externalKeyword = externalKeyword; 7173 this._externalKeyword = externalKeyword4;
6571 } 7174 }
6572 /** 7175 /**
6573 * Set the token representing the 'abstract' or 'static' keyword to the given token. 7176 * Set the token representing the 'abstract' or 'static' keyword to the given token.
6574 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword 7177 * @param modifierKeyword the token representing the 'abstract' or 'static' ke yword
6575 */ 7178 */
6576 void set modifierKeyword2(Token modifierKeyword) { 7179 void set modifierKeyword(Token modifierKeyword2) {
6577 this._modifierKeyword = modifierKeyword; 7180 this._modifierKeyword = modifierKeyword2;
6578 } 7181 }
6579 /** 7182 /**
6580 * Set the name of the method to the given identifier. 7183 * Set the name of the method to the given identifier.
6581 * @param identifier the name of the method 7184 * @param identifier the name of the method
6582 */ 7185 */
6583 void set name10(Identifier identifier) { 7186 void set name(Identifier identifier) {
6584 _name = becomeParentOf(identifier); 7187 _name = becomeParentOf(identifier);
6585 } 7188 }
6586 /** 7189 /**
6587 * Set the token representing the 'operator' keyword to the given token. 7190 * Set the token representing the 'operator' keyword to the given token.
6588 * @param operatorKeyword the token representing the 'operator' keyword 7191 * @param operatorKeyword the token representing the 'operator' keyword
6589 */ 7192 */
6590 void set operatorKeyword2(Token operatorKeyword) { 7193 void set operatorKeyword(Token operatorKeyword2) {
6591 this._operatorKeyword = operatorKeyword; 7194 this._operatorKeyword = operatorKeyword2;
6592 } 7195 }
6593 /** 7196 /**
6594 * Set the parameters associated with the method to the given list of paramete rs. 7197 * Set the parameters associated with the method to the given list of paramete rs.
6595 * @param parameters the parameters associated with the method 7198 * @param parameters the parameters associated with the method
6596 */ 7199 */
6597 void set parameters6(FormalParameterList parameters) { 7200 void set parameters(FormalParameterList parameters6) {
6598 this._parameters = becomeParentOf(parameters); 7201 this._parameters = becomeParentOf(parameters6);
6599 } 7202 }
6600 /** 7203 /**
6601 * Set the token representing the 'get' or 'set' keyword to the given token. 7204 * Set the token representing the 'get' or 'set' keyword to the given token.
6602 * @param propertyKeyword the token representing the 'get' or 'set' keyword 7205 * @param propertyKeyword the token representing the 'get' or 'set' keyword
6603 */ 7206 */
6604 void set propertyKeyword3(Token propertyKeyword) { 7207 void set propertyKeyword(Token propertyKeyword3) {
6605 this._propertyKeyword = propertyKeyword; 7208 this._propertyKeyword = propertyKeyword3;
6606 } 7209 }
6607 /** 7210 /**
6608 * Set the return type of the method to the given type name. 7211 * Set the return type of the method to the given type name.
6609 * @param typeName the return type of the method 7212 * @param typeName the return type of the method
6610 */ 7213 */
6611 void set returnType6(TypeName typeName) { 7214 void set returnType(TypeName typeName) {
6612 _returnType = becomeParentOf(typeName); 7215 _returnType = becomeParentOf(typeName);
6613 } 7216 }
6614 void visitChildren(ASTVisitor<Object> visitor) { 7217 void visitChildren(ASTVisitor<Object> visitor) {
6615 super.visitChildren(visitor); 7218 super.visitChildren(visitor);
6616 safelyVisitChild(_returnType, visitor); 7219 safelyVisitChild(_returnType, visitor);
6617 safelyVisitChild(_name, visitor); 7220 safelyVisitChild(_name, visitor);
6618 safelyVisitChild(_parameters, visitor); 7221 safelyVisitChild(_parameters, visitor);
6619 safelyVisitChild(_body, visitor); 7222 safelyVisitChild(_body, visitor);
6620 } 7223 }
6621 Token get firstTokenAfterCommentAndMetadata { 7224 Token get firstTokenAfterCommentAndMetadata {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
6658 * The list of arguments to the method. 7261 * The list of arguments to the method.
6659 */ 7262 */
6660 ArgumentList _argumentList; 7263 ArgumentList _argumentList;
6661 /** 7264 /**
6662 * Initialize a newly created method invocation. 7265 * Initialize a newly created method invocation.
6663 * @param target the expression producing the object on which the method is de fined 7266 * @param target the expression producing the object on which the method is de fined
6664 * @param period the period that separates the target from the method name 7267 * @param period the period that separates the target from the method name
6665 * @param methodName the name of the method being invoked 7268 * @param methodName the name of the method being invoked
6666 * @param argumentList the list of arguments to the method 7269 * @param argumentList the list of arguments to the method
6667 */ 7270 */
6668 MethodInvocation(Expression target, Token period, SimpleIdentifier methodName, ArgumentList argumentList) { 7271 MethodInvocation.full(Expression target, Token period, SimpleIdentifier method Name, ArgumentList argumentList) {
6669 this._target = becomeParentOf(target); 7272 this._target = becomeParentOf(target);
6670 this._period = period; 7273 this._period = period;
6671 this._methodName = becomeParentOf(methodName); 7274 this._methodName = becomeParentOf(methodName);
6672 this._argumentList = becomeParentOf(argumentList); 7275 this._argumentList = becomeParentOf(argumentList);
6673 } 7276 }
7277 /**
7278 * Initialize a newly created method invocation.
7279 * @param target the expression producing the object on which the method is de fined
7280 * @param period the period that separates the target from the method name
7281 * @param methodName the name of the method being invoked
7282 * @param argumentList the list of arguments to the method
7283 */
7284 MethodInvocation({Expression target, Token period, SimpleIdentifier methodName , ArgumentList argumentList}) : this.full(target, period, methodName, argumentLi st);
6674 accept(ASTVisitor visitor) => visitor.visitMethodInvocation(this); 7285 accept(ASTVisitor visitor) => visitor.visitMethodInvocation(this);
6675 /** 7286 /**
6676 * Return the list of arguments to the method. 7287 * Return the list of arguments to the method.
6677 * @return the list of arguments to the method 7288 * @return the list of arguments to the method
6678 */ 7289 */
6679 ArgumentList get argumentList => _argumentList; 7290 ArgumentList get argumentList => _argumentList;
6680 Token get beginToken { 7291 Token get beginToken {
6681 if (_target != null) { 7292 if (_target != null) {
6682 return _target.beginToken; 7293 return _target.beginToken;
6683 } 7294 }
(...skipping 21 matching lines...) Expand all
6705 */ 7316 */
6706 Expression get realTarget { 7317 Expression get realTarget {
6707 if (isCascaded()) { 7318 if (isCascaded()) {
6708 ASTNode ancestor = parent; 7319 ASTNode ancestor = parent;
6709 while (ancestor is! CascadeExpression) { 7320 while (ancestor is! CascadeExpression) {
6710 if (ancestor == null) { 7321 if (ancestor == null) {
6711 return _target; 7322 return _target;
6712 } 7323 }
6713 ancestor = ancestor.parent; 7324 ancestor = ancestor.parent;
6714 } 7325 }
6715 return (ancestor as CascadeExpression).target; 7326 return ((ancestor as CascadeExpression)).target;
6716 } 7327 }
6717 return _target; 7328 return _target;
6718 } 7329 }
6719 /** 7330 /**
6720 * Return the expression producing the object on which the method is defined, or {@code null} if 7331 * Return the expression producing the object on which the method is defined, or {@code null} if
6721 * there is no target (that is, the target is implicitly {@code this}) or if t his method 7332 * there is no target (that is, the target is implicitly {@code this}) or if t his method
6722 * invocation is part of a cascade expression. 7333 * invocation is part of a cascade expression.
6723 * @return the expression producing the object on which the method is defined 7334 * @return the expression producing the object on which the method is defined
6724 * @see #getRealTarget() 7335 * @see #getRealTarget()
6725 */ 7336 */
6726 Expression get target => _target; 7337 Expression get target => _target;
6727 /** 7338 /**
6728 * Return {@code true} if this expression is cascaded. If it is, then the targ et of this 7339 * Return {@code true} if this expression is cascaded. If it is, then the targ et of this
6729 * expression is not stored locally but is stored in the nearest ancestor that is a{@link CascadeExpression}. 7340 * expression is not stored locally but is stored in the nearest ancestor that is a{@link CascadeExpression}.
6730 * @return {@code true} if this expression is cascaded 7341 * @return {@code true} if this expression is cascaded
6731 */ 7342 */
6732 bool isCascaded() => _period != null && _period.type == TokenType.PERIOD_PERIO D; 7343 bool isCascaded() => _period != null && identical(_period.type, TokenType.PERI OD_PERIOD);
6733 /** 7344 /**
6734 * Set the list of arguments to the method to the given list. 7345 * Set the list of arguments to the method to the given list.
6735 * @param argumentList the list of arguments to the method 7346 * @param argumentList the list of arguments to the method
6736 */ 7347 */
6737 void set argumentList7(ArgumentList argumentList) { 7348 void set argumentList(ArgumentList argumentList7) {
6738 this._argumentList = becomeParentOf(argumentList); 7349 this._argumentList = becomeParentOf(argumentList7);
6739 } 7350 }
6740 /** 7351 /**
6741 * Set the name of the method being invoked to the given identifier. 7352 * Set the name of the method being invoked to the given identifier.
6742 * @param identifier the name of the method being invoked 7353 * @param identifier the name of the method being invoked
6743 */ 7354 */
6744 void set methodName2(SimpleIdentifier identifier) { 7355 void set methodName(SimpleIdentifier identifier) {
6745 _methodName = becomeParentOf(identifier); 7356 _methodName = becomeParentOf(identifier);
6746 } 7357 }
6747 /** 7358 /**
6748 * Set the period that separates the target from the method name to the given token. 7359 * Set the period that separates the target from the method name to the given token.
6749 * @param period the period that separates the target from the method name 7360 * @param period the period that separates the target from the method name
6750 */ 7361 */
6751 void set period8(Token period) { 7362 void set period(Token period9) {
6752 this._period = period; 7363 this._period = period9;
6753 } 7364 }
6754 /** 7365 /**
6755 * Set the expression producing the object on which the method is defined to t he given expression. 7366 * Set the expression producing the object on which the method is defined to t he given expression.
6756 * @param expression the expression producing the object on which the method i s defined 7367 * @param expression the expression producing the object on which the method i s defined
6757 */ 7368 */
6758 void set target3(Expression expression) { 7369 void set target(Expression expression) {
6759 _target = becomeParentOf(expression); 7370 _target = becomeParentOf(expression);
6760 } 7371 }
6761 void visitChildren(ASTVisitor<Object> visitor) { 7372 void visitChildren(ASTVisitor<Object> visitor) {
6762 safelyVisitChild(_target, visitor); 7373 safelyVisitChild(_target, visitor);
6763 safelyVisitChild(_methodName, visitor); 7374 safelyVisitChild(_methodName, visitor);
6764 safelyVisitChild(_argumentList, visitor); 7375 safelyVisitChild(_argumentList, visitor);
6765 } 7376 }
6766 } 7377 }
6767 /** 7378 /**
6768 * Instances of the class {@code NamedExpression} represent an expression that h as a name associated 7379 * Instances of the class {@code NamedExpression} represent an expression that h as a name associated
6769 * with it. They are used in method invocations when there are named parameters. 7380 * with it. They are used in method invocations when there are named parameters.
6770 * <pre> 7381 * <pre>
6771 * namedExpression ::={@link Label name} {@link Expression expression}</pre> 7382 * namedExpression ::={@link Label name} {@link Expression expression}</pre>
6772 */ 7383 */
6773 class NamedExpression extends Expression { 7384 class NamedExpression extends Expression {
6774 /** 7385 /**
6775 * The name associated with the expression. 7386 * The name associated with the expression.
6776 */ 7387 */
6777 Label _name; 7388 Label _name;
6778 /** 7389 /**
6779 * The expression with which the name is associated. 7390 * The expression with which the name is associated.
6780 */ 7391 */
6781 Expression _expression; 7392 Expression _expression;
6782 /** 7393 /**
6783 * Initialize a newly created named expression. 7394 * Initialize a newly created named expression.
6784 * @param name the name associated with the expression 7395 * @param name the name associated with the expression
6785 * @param expression the expression with which the name is associated 7396 * @param expression the expression with which the name is associated
6786 */ 7397 */
6787 NamedExpression(Label name, Expression expression) { 7398 NamedExpression.full(Label name, Expression expression) {
6788 this._name = becomeParentOf(name); 7399 this._name = becomeParentOf(name);
6789 this._expression = becomeParentOf(expression); 7400 this._expression = becomeParentOf(expression);
6790 } 7401 }
7402 /**
7403 * Initialize a newly created named expression.
7404 * @param name the name associated with the expression
7405 * @param expression the expression with which the name is associated
7406 */
7407 NamedExpression({Label name, Expression expression}) : this.full(name, express ion);
6791 accept(ASTVisitor visitor) => visitor.visitNamedExpression(this); 7408 accept(ASTVisitor visitor) => visitor.visitNamedExpression(this);
6792 Token get beginToken => _name.beginToken; 7409 Token get beginToken => _name.beginToken;
6793 Token get endToken => _expression.endToken; 7410 Token get endToken => _expression.endToken;
6794 /** 7411 /**
6795 * Return the expression with which the name is associated. 7412 * Return the expression with which the name is associated.
6796 * @return the expression with which the name is associated 7413 * @return the expression with which the name is associated
6797 */ 7414 */
6798 Expression get expression => _expression; 7415 Expression get expression => _expression;
6799 /** 7416 /**
6800 * Return the name associated with the expression. 7417 * Return the name associated with the expression.
6801 * @return the name associated with the expression 7418 * @return the name associated with the expression
6802 */ 7419 */
6803 Label get name => _name; 7420 Label get name => _name;
6804 /** 7421 /**
6805 * Set the expression with which the name is associated to the given expressio n. 7422 * Set the expression with which the name is associated to the given expressio n.
6806 * @param expression the expression with which the name is associated 7423 * @param expression the expression with which the name is associated
6807 */ 7424 */
6808 void set expression8(Expression expression) { 7425 void set expression(Expression expression8) {
6809 this._expression = becomeParentOf(expression); 7426 this._expression = becomeParentOf(expression8);
6810 } 7427 }
6811 /** 7428 /**
6812 * Set the name associated with the expression to the given identifier. 7429 * Set the name associated with the expression to the given identifier.
6813 * @param identifier the name associated with the expression 7430 * @param identifier the name associated with the expression
6814 */ 7431 */
6815 void set name11(Label identifier) { 7432 void set name(Label identifier) {
6816 _name = becomeParentOf(identifier); 7433 _name = becomeParentOf(identifier);
6817 } 7434 }
6818 void visitChildren(ASTVisitor<Object> visitor) { 7435 void visitChildren(ASTVisitor<Object> visitor) {
6819 safelyVisitChild(_name, visitor); 7436 safelyVisitChild(_name, visitor);
6820 safelyVisitChild(_expression, visitor); 7437 safelyVisitChild(_expression, visitor);
6821 } 7438 }
6822 } 7439 }
6823 /** 7440 /**
6824 * The abstract class {@code NamespaceDirective} defines the behavior common to nodes that represent 7441 * The abstract class {@code NamespaceDirective} defines the behavior common to nodes that represent
6825 * a directive that impacts the namespace of a library. 7442 * a directive that impacts the namespace of a library.
6826 * <pre> 7443 * <pre>
6827 * directive ::={@link ExportDirective exportDirective}| {@link ImportDirective importDirective}</pre> 7444 * directive ::={@link ExportDirective exportDirective}| {@link ImportDirective importDirective}</pre>
6828 */ 7445 */
6829 abstract class NamespaceDirective extends Directive { 7446 abstract class NamespaceDirective extends UriBasedDirective {
6830 /** 7447 /**
6831 * The token representing the 'import' or 'export' keyword. 7448 * The token representing the 'import' or 'export' keyword.
6832 */ 7449 */
6833 Token _keyword; 7450 Token _keyword;
6834 /** 7451 /**
6835 * The URI of the library being imported or exported.
6836 */
6837 StringLiteral _libraryUri;
6838 /**
6839 * The combinators used to control which names are imported or exported. 7452 * The combinators used to control which names are imported or exported.
6840 */ 7453 */
6841 NodeList<Combinator> _combinators; 7454 NodeList<Combinator> _combinators;
6842 /** 7455 /**
6843 * The semicolon terminating the directive. 7456 * The semicolon terminating the directive.
6844 */ 7457 */
6845 Token _semicolon; 7458 Token _semicolon;
6846 /** 7459 /**
6847 * Initialize a newly created namespace directive. 7460 * Initialize a newly created namespace directive.
6848 * @param comment the documentation comment associated with this directive 7461 * @param comment the documentation comment associated with this directive
6849 * @param metadata the annotations associated with the directive 7462 * @param metadata the annotations associated with the directive
6850 * @param keyword the token representing the 'import' or 'export' keyword 7463 * @param keyword the token representing the 'import' or 'export' keyword
6851 * @param libraryUri the URI of the library being imported or exported 7464 * @param libraryUri the URI of the library being imported or exported
6852 * @param combinators the combinators used to control which names are imported or exported 7465 * @param combinators the combinators used to control which names are imported or exported
6853 * @param semicolon the semicolon terminating the directive 7466 * @param semicolon the semicolon terminating the directive
6854 */ 7467 */
6855 NamespaceDirective(Comment comment, List<Annotation> metadata, Token keyword, StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) : super (comment, metadata) { 7468 NamespaceDirective.full(Comment comment, List<Annotation> metadata, Token keyw ord, StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) : super.full(comment, metadata, libraryUri) {
6856 this._combinators = new NodeList<Combinator>(this); 7469 this._combinators = new NodeList<Combinator>(this);
6857 this._keyword = keyword; 7470 this._keyword = keyword;
6858 this._libraryUri = becomeParentOf(libraryUri);
6859 this._combinators.addAll(combinators); 7471 this._combinators.addAll(combinators);
6860 this._semicolon = semicolon; 7472 this._semicolon = semicolon;
6861 } 7473 }
6862 /** 7474 /**
7475 * Initialize a newly created namespace directive.
7476 * @param comment the documentation comment associated with this directive
7477 * @param metadata the annotations associated with the directive
7478 * @param keyword the token representing the 'import' or 'export' keyword
7479 * @param libraryUri the URI of the library being imported or exported
7480 * @param combinators the combinators used to control which names are imported or exported
7481 * @param semicolon the semicolon terminating the directive
7482 */
7483 NamespaceDirective({Comment comment, List<Annotation> metadata, Token keyword, StringLiteral libraryUri, List<Combinator> combinators, Token semicolon}) : thi s.full(comment, metadata, keyword, libraryUri, combinators, semicolon);
7484 /**
6863 * Return the combinators used to control how names are imported or exported. 7485 * Return the combinators used to control how names are imported or exported.
6864 * @return the combinators used to control how names are imported or exported 7486 * @return the combinators used to control how names are imported or exported
6865 */ 7487 */
6866 NodeList<Combinator> get combinators => _combinators; 7488 NodeList<Combinator> get combinators => _combinators;
6867 Token get endToken => _semicolon; 7489 Token get endToken => _semicolon;
6868 Token get keyword => _keyword; 7490 Token get keyword => _keyword;
6869 /** 7491 /**
6870 * Return the URI of the library being imported or exported.
6871 * @return the URI of the library being imported or exported
6872 */
6873 StringLiteral get libraryUri => _libraryUri;
6874 /**
6875 * Return the semicolon terminating the directive. 7492 * Return the semicolon terminating the directive.
6876 * @return the semicolon terminating the directive 7493 * @return the semicolon terminating the directive
6877 */ 7494 */
6878 Token get semicolon => _semicolon; 7495 Token get semicolon => _semicolon;
6879 /** 7496 /**
6880 * Set the token representing the 'import' or 'export' keyword to the given to ken. 7497 * Set the token representing the 'import' or 'export' keyword to the given to ken.
6881 * @param exportToken the token representing the 'import' or 'export' keyword 7498 * @param exportToken the token representing the 'import' or 'export' keyword
6882 */ 7499 */
6883 void set keyword13(Token exportToken) { 7500 void set keyword(Token exportToken) {
6884 this._keyword = exportToken; 7501 this._keyword = exportToken;
6885 } 7502 }
6886 /** 7503 /**
6887 * Set the URI of the library being imported or exported to the given literal.
6888 * @param literal the URI of the library being imported or exported
6889 */
6890 void set libraryUri2(StringLiteral literal) {
6891 _libraryUri = becomeParentOf(literal);
6892 }
6893 /**
6894 * Set the semicolon terminating the directive to the given token. 7504 * Set the semicolon terminating the directive to the given token.
6895 * @param semicolon the semicolon terminating the directive 7505 * @param semicolon the semicolon terminating the directive
6896 */ 7506 */
6897 void set semicolon12(Token semicolon) { 7507 void set semicolon(Token semicolon12) {
6898 this._semicolon = semicolon; 7508 this._semicolon = semicolon12;
6899 } 7509 }
6900 Token get firstTokenAfterCommentAndMetadata => _keyword; 7510 Token get firstTokenAfterCommentAndMetadata => _keyword;
6901 } 7511 }
6902 /** 7512 /**
6903 * The abstract class {@code NormalFormalParameter} defines the behavior common to formal parameters 7513 * The abstract class {@code NormalFormalParameter} defines the behavior common to formal parameters
6904 * that are required (are not optional). 7514 * that are required (are not optional).
6905 * <pre> 7515 * <pre>
6906 * normalFormalParameter ::={@link FunctionTypedFormalParameter functionSignatur e}| {@link FieldFormalParameter fieldFormalParameter}| {@link SimpleFormalParame ter simpleFormalParameter}</pre> 7516 * normalFormalParameter ::={@link FunctionTypedFormalParameter functionSignatur e}| {@link FieldFormalParameter fieldFormalParameter}| {@link SimpleFormalParame ter simpleFormalParameter}</pre>
6907 */ 7517 */
6908 abstract class NormalFormalParameter extends FormalParameter { 7518 abstract class NormalFormalParameter extends FormalParameter {
6909 /** 7519 /**
6910 * The documentation comment associated with this parameter, or {@code null} i f this parameter 7520 * The documentation comment associated with this parameter, or {@code null} i f this parameter
6911 * does not have a documentation comment associated with it. 7521 * does not have a documentation comment associated with it.
6912 */ 7522 */
6913 Comment _comment; 7523 Comment _comment;
6914 /** 7524 /**
6915 * The annotations associated with this parameter. 7525 * The annotations associated with this parameter.
6916 */ 7526 */
6917 NodeList<Annotation> _metadata; 7527 NodeList<Annotation> _metadata;
6918 /** 7528 /**
6919 * The name of the parameter being declared. 7529 * The name of the parameter being declared.
6920 */ 7530 */
6921 SimpleIdentifier _identifier; 7531 SimpleIdentifier _identifier;
6922 /** 7532 /**
6923 * Initialize a newly created formal parameter. 7533 * Initialize a newly created formal parameter.
6924 * @param comment the documentation comment associated with this parameter 7534 * @param comment the documentation comment associated with this parameter
6925 * @param metadata the annotations associated with this parameter 7535 * @param metadata the annotations associated with this parameter
6926 * @param identifier the name of the parameter being declared 7536 * @param identifier the name of the parameter being declared
6927 */ 7537 */
6928 NormalFormalParameter(Comment comment, List<Annotation> metadata, SimpleIdenti fier identifier) { 7538 NormalFormalParameter.full(Comment comment, List<Annotation> metadata, SimpleI dentifier identifier) {
6929 this._metadata = new NodeList<Annotation>(this); 7539 this._metadata = new NodeList<Annotation>(this);
6930 this._comment = becomeParentOf(comment); 7540 this._comment = becomeParentOf(comment);
6931 this._metadata.addAll(metadata); 7541 this._metadata.addAll(metadata);
6932 this._identifier = becomeParentOf(identifier); 7542 this._identifier = becomeParentOf(identifier);
6933 } 7543 }
6934 /** 7544 /**
7545 * Initialize a newly created formal parameter.
7546 * @param comment the documentation comment associated with this parameter
7547 * @param metadata the annotations associated with this parameter
7548 * @param identifier the name of the parameter being declared
7549 */
7550 NormalFormalParameter({Comment comment, List<Annotation> metadata, SimpleIdent ifier identifier}) : this.full(comment, metadata, identifier);
7551 /**
6935 * Return the documentation comment associated with this parameter, or {@code null} if this 7552 * Return the documentation comment associated with this parameter, or {@code null} if this
6936 * parameter does not have a documentation comment associated with it. 7553 * parameter does not have a documentation comment associated with it.
6937 * @return the documentation comment associated with this parameter 7554 * @return the documentation comment associated with this parameter
6938 */ 7555 */
6939 Comment get documentationComment => _comment; 7556 Comment get documentationComment => _comment;
6940 SimpleIdentifier get identifier => _identifier; 7557 SimpleIdentifier get identifier => _identifier;
6941 ParameterKind get kind { 7558 ParameterKind get kind {
6942 ASTNode parent6 = parent; 7559 ASTNode parent5 = parent;
6943 if (parent6 is DefaultFormalParameter) { 7560 if (parent5 is DefaultFormalParameter) {
6944 return (parent6 as DefaultFormalParameter).kind; 7561 return ((parent5 as DefaultFormalParameter)).kind;
6945 } 7562 }
6946 return ParameterKind.REQUIRED; 7563 return ParameterKind.REQUIRED;
6947 } 7564 }
6948 /** 7565 /**
6949 * Return the annotations associated with this parameter. 7566 * Return the annotations associated with this parameter.
6950 * @return the annotations associated with this parameter 7567 * @return the annotations associated with this parameter
6951 */ 7568 */
6952 NodeList<Annotation> get metadata => _metadata; 7569 NodeList<Annotation> get metadata => _metadata;
6953 /** 7570 /**
6954 * Return {@code true} if this parameter is a const parameter. 7571 * Return {@code true} if this parameter is a const parameter.
6955 * @return {@code true} if this parameter is a const parameter 7572 * @return {@code true} if this parameter is a const parameter
6956 */ 7573 */
6957 bool isConst(); 7574 bool isConst();
6958 /** 7575 /**
6959 * Return {@code true} if this parameter is a final parameter. 7576 * Return {@code true} if this parameter is a final parameter.
6960 * @return {@code true} if this parameter is a final parameter 7577 * @return {@code true} if this parameter is a final parameter
6961 */ 7578 */
6962 bool isFinal(); 7579 bool isFinal();
6963 /** 7580 /**
6964 * Set the documentation comment associated with this parameter to the given c omment 7581 * Set the documentation comment associated with this parameter to the given c omment
6965 * @param comment the documentation comment to be associated with this paramet er 7582 * @param comment the documentation comment to be associated with this paramet er
6966 */ 7583 */
6967 void set documentationComment(Comment comment) { 7584 void set documentationComment(Comment comment3) {
6968 this._comment = becomeParentOf(comment); 7585 this._comment = becomeParentOf(comment3);
6969 } 7586 }
6970 /** 7587 /**
6971 * Set the name of the parameter being declared to the given identifier. 7588 * Set the name of the parameter being declared to the given identifier.
6972 * @param identifier the name of the parameter being declared 7589 * @param identifier the name of the parameter being declared
6973 */ 7590 */
6974 void set identifier4(SimpleIdentifier identifier) { 7591 void set identifier(SimpleIdentifier identifier6) {
6975 this._identifier = becomeParentOf(identifier); 7592 this._identifier = becomeParentOf(identifier6);
6976 } 7593 }
6977 void visitChildren(ASTVisitor<Object> visitor) { 7594 void visitChildren(ASTVisitor<Object> visitor) {
6978 if (commentIsBeforeAnnotations()) { 7595 if (commentIsBeforeAnnotations()) {
6979 safelyVisitChild(_comment, visitor); 7596 safelyVisitChild(_comment, visitor);
6980 _metadata.accept(visitor); 7597 _metadata.accept(visitor);
6981 } else { 7598 } else {
6982 for (ASTNode child in sortedCommentAndAnnotations) { 7599 for (ASTNode child in sortedCommentAndAnnotations) {
6983 child.accept(visitor); 7600 child.accept(visitor);
6984 } 7601 }
6985 } 7602 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
7019 */ 7636 */
7020 class NullLiteral extends Literal { 7637 class NullLiteral extends Literal {
7021 /** 7638 /**
7022 * The token representing the literal. 7639 * The token representing the literal.
7023 */ 7640 */
7024 Token _literal; 7641 Token _literal;
7025 /** 7642 /**
7026 * Initialize a newly created null literal. 7643 * Initialize a newly created null literal.
7027 * @param token the token representing the literal 7644 * @param token the token representing the literal
7028 */ 7645 */
7029 NullLiteral(Token token) { 7646 NullLiteral.full(Token token) {
7030 this._literal = token; 7647 this._literal = token;
7031 } 7648 }
7649 /**
7650 * Initialize a newly created null literal.
7651 * @param token the token representing the literal
7652 */
7653 NullLiteral({Token token}) : this.full(token);
7032 accept(ASTVisitor visitor) => visitor.visitNullLiteral(this); 7654 accept(ASTVisitor visitor) => visitor.visitNullLiteral(this);
7033 Token get beginToken => _literal; 7655 Token get beginToken => _literal;
7034 Token get endToken => _literal; 7656 Token get endToken => _literal;
7035 /** 7657 /**
7036 * Return the token representing the literal. 7658 * Return the token representing the literal.
7037 * @return the token representing the literal 7659 * @return the token representing the literal
7038 */ 7660 */
7039 Token get literal => _literal; 7661 Token get literal => _literal;
7040 /** 7662 /**
7041 * Set the token representing the literal to the given token. 7663 * Set the token representing the literal to the given token.
7042 * @param literal the token representing the literal 7664 * @param literal the token representing the literal
7043 */ 7665 */
7044 void set literal5(Token literal) { 7666 void set literal(Token literal5) {
7045 this._literal = literal; 7667 this._literal = literal5;
7046 } 7668 }
7047 void visitChildren(ASTVisitor<Object> visitor) { 7669 void visitChildren(ASTVisitor<Object> visitor) {
7048 } 7670 }
7049 } 7671 }
7050 /** 7672 /**
7051 * Instances of the class {@code ParenthesizedExpression} represent a parenthesi zed expression. 7673 * Instances of the class {@code ParenthesizedExpression} represent a parenthesi zed expression.
7052 * <pre> 7674 * <pre>
7053 * parenthesizedExpression ::= 7675 * parenthesizedExpression ::=
7054 * '(' {@link Expression expression} ')' 7676 * '(' {@link Expression expression} ')'
7055 * </pre> 7677 * </pre>
(...skipping 10 matching lines...) Expand all
7066 /** 7688 /**
7067 * The right parenthesis. 7689 * The right parenthesis.
7068 */ 7690 */
7069 Token _rightParenthesis; 7691 Token _rightParenthesis;
7070 /** 7692 /**
7071 * Initialize a newly created parenthesized expression. 7693 * Initialize a newly created parenthesized expression.
7072 * @param leftParenthesis the left parenthesis 7694 * @param leftParenthesis the left parenthesis
7073 * @param expression the expression within the parentheses 7695 * @param expression the expression within the parentheses
7074 * @param rightParenthesis the right parenthesis 7696 * @param rightParenthesis the right parenthesis
7075 */ 7697 */
7076 ParenthesizedExpression(Token leftParenthesis, Expression expression, Token ri ghtParenthesis) { 7698 ParenthesizedExpression.full(Token leftParenthesis, Expression expression, Tok en rightParenthesis) {
7077 this._leftParenthesis = leftParenthesis; 7699 this._leftParenthesis = leftParenthesis;
7078 this._expression = becomeParentOf(expression); 7700 this._expression = becomeParentOf(expression);
7079 this._rightParenthesis = rightParenthesis; 7701 this._rightParenthesis = rightParenthesis;
7080 } 7702 }
7703 /**
7704 * Initialize a newly created parenthesized expression.
7705 * @param leftParenthesis the left parenthesis
7706 * @param expression the expression within the parentheses
7707 * @param rightParenthesis the right parenthesis
7708 */
7709 ParenthesizedExpression({Token leftParenthesis, Expression expression, Token r ightParenthesis}) : this.full(leftParenthesis, expression, rightParenthesis);
7081 accept(ASTVisitor visitor) => visitor.visitParenthesizedExpression(this); 7710 accept(ASTVisitor visitor) => visitor.visitParenthesizedExpression(this);
7082 Token get beginToken => _leftParenthesis; 7711 Token get beginToken => _leftParenthesis;
7083 Token get endToken => _rightParenthesis; 7712 Token get endToken => _rightParenthesis;
7084 /** 7713 /**
7085 * Return the expression within the parentheses. 7714 * Return the expression within the parentheses.
7086 * @return the expression within the parentheses 7715 * @return the expression within the parentheses
7087 */ 7716 */
7088 Expression get expression => _expression; 7717 Expression get expression => _expression;
7089 /** 7718 /**
7090 * Return the left parenthesis. 7719 * Return the left parenthesis.
7091 * @return the left parenthesis 7720 * @return the left parenthesis
7092 */ 7721 */
7093 Token get leftParenthesis => _leftParenthesis; 7722 Token get leftParenthesis => _leftParenthesis;
7094 /** 7723 /**
7095 * Return the right parenthesis. 7724 * Return the right parenthesis.
7096 * @return the right parenthesis 7725 * @return the right parenthesis
7097 */ 7726 */
7098 Token get rightParenthesis => _rightParenthesis; 7727 Token get rightParenthesis => _rightParenthesis;
7099 /** 7728 /**
7100 * Set the expression within the parentheses to the given expression. 7729 * Set the expression within the parentheses to the given expression.
7101 * @param expression the expression within the parentheses 7730 * @param expression the expression within the parentheses
7102 */ 7731 */
7103 void set expression9(Expression expression) { 7732 void set expression(Expression expression9) {
7104 this._expression = becomeParentOf(expression); 7733 this._expression = becomeParentOf(expression9);
7105 } 7734 }
7106 /** 7735 /**
7107 * Set the left parenthesis to the given token. 7736 * Set the left parenthesis to the given token.
7108 * @param parenthesis the left parenthesis 7737 * @param parenthesis the left parenthesis
7109 */ 7738 */
7110 void set leftParenthesis10(Token parenthesis) { 7739 void set leftParenthesis(Token parenthesis) {
7111 _leftParenthesis = parenthesis; 7740 _leftParenthesis = parenthesis;
7112 } 7741 }
7113 /** 7742 /**
7114 * Set the right parenthesis to the given token. 7743 * Set the right parenthesis to the given token.
7115 * @param parenthesis the right parenthesis 7744 * @param parenthesis the right parenthesis
7116 */ 7745 */
7117 void set rightParenthesis10(Token parenthesis) { 7746 void set rightParenthesis(Token parenthesis) {
7118 _rightParenthesis = parenthesis; 7747 _rightParenthesis = parenthesis;
7119 } 7748 }
7120 void visitChildren(ASTVisitor<Object> visitor) { 7749 void visitChildren(ASTVisitor<Object> visitor) {
7121 safelyVisitChild(_expression, visitor); 7750 safelyVisitChild(_expression, visitor);
7122 } 7751 }
7123 } 7752 }
7124 /** 7753 /**
7125 * Instances of the class {@code PartDirective} represent a part directive. 7754 * Instances of the class {@code PartDirective} represent a part directive.
7126 * <pre> 7755 * <pre>
7127 * partDirective ::={@link Annotation metadata} 'part' {@link StringLiteral part Uri} ';' 7756 * partDirective ::={@link Annotation metadata} 'part' {@link StringLiteral part Uri} ';'
7128 * </pre> 7757 * </pre>
7129 */ 7758 */
7130 class PartDirective extends Directive { 7759 class PartDirective extends UriBasedDirective {
7131 /** 7760 /**
7132 * The token representing the 'part' token. 7761 * The token representing the 'part' token.
7133 */ 7762 */
7134 Token _partToken; 7763 Token _partToken;
7135 /** 7764 /**
7136 * The URI of the part being included.
7137 */
7138 StringLiteral _partUri;
7139 /**
7140 * The semicolon terminating the directive. 7765 * The semicolon terminating the directive.
7141 */ 7766 */
7142 Token _semicolon; 7767 Token _semicolon;
7143 /** 7768 /**
7144 * Initialize a newly created part directive. 7769 * Initialize a newly created part directive.
7145 * @param comment the documentation comment associated with this directive 7770 * @param comment the documentation comment associated with this directive
7146 * @param metadata the annotations associated with the directive 7771 * @param metadata the annotations associated with the directive
7147 * @param partToken the token representing the 'part' token 7772 * @param partToken the token representing the 'part' token
7148 * @param partUri the URI of the part being included 7773 * @param partUri the URI of the part being included
7149 * @param semicolon the semicolon terminating the directive 7774 * @param semicolon the semicolon terminating the directive
7150 */ 7775 */
7151 PartDirective(Comment comment, List<Annotation> metadata, Token partToken, Str ingLiteral partUri, Token semicolon) : super(comment, metadata) { 7776 PartDirective.full(Comment comment, List<Annotation> metadata, Token partToken , StringLiteral partUri, Token semicolon) : super.full(comment, metadata, partUr i) {
7152 this._partToken = partToken; 7777 this._partToken = partToken;
7153 this._partUri = becomeParentOf(partUri);
7154 this._semicolon = semicolon; 7778 this._semicolon = semicolon;
7155 } 7779 }
7780 /**
7781 * Initialize a newly created part directive.
7782 * @param comment the documentation comment associated with this directive
7783 * @param metadata the annotations associated with the directive
7784 * @param partToken the token representing the 'part' token
7785 * @param partUri the URI of the part being included
7786 * @param semicolon the semicolon terminating the directive
7787 */
7788 PartDirective({Comment comment, List<Annotation> metadata, Token partToken, St ringLiteral partUri, Token semicolon}) : this.full(comment, metadata, partToken, partUri, semicolon);
7156 accept(ASTVisitor visitor) => visitor.visitPartDirective(this); 7789 accept(ASTVisitor visitor) => visitor.visitPartDirective(this);
7157 Token get endToken => _semicolon; 7790 Token get endToken => _semicolon;
7158 Token get keyword => _partToken; 7791 Token get keyword => _partToken;
7159 /** 7792 /**
7160 * Return the token representing the 'part' token. 7793 * Return the token representing the 'part' token.
7161 * @return the token representing the 'part' token 7794 * @return the token representing the 'part' token
7162 */ 7795 */
7163 Token get partToken => _partToken; 7796 Token get partToken => _partToken;
7164 /** 7797 /**
7165 * Return the URI of the part being included.
7166 * @return the URI of the part being included
7167 */
7168 StringLiteral get partUri => _partUri;
7169 /**
7170 * Return the semicolon terminating the directive. 7798 * Return the semicolon terminating the directive.
7171 * @return the semicolon terminating the directive 7799 * @return the semicolon terminating the directive
7172 */ 7800 */
7173 Token get semicolon => _semicolon; 7801 Token get semicolon => _semicolon;
7174 /** 7802 /**
7175 * Set the token representing the 'part' token to the given token. 7803 * Set the token representing the 'part' token to the given token.
7176 * @param partToken the token representing the 'part' token 7804 * @param partToken the token representing the 'part' token
7177 */ 7805 */
7178 void set partToken2(Token partToken) { 7806 void set partToken(Token partToken2) {
7179 this._partToken = partToken; 7807 this._partToken = partToken2;
7180 }
7181 /**
7182 * Set the URI of the part being included to the given string.
7183 * @param partUri the URI of the part being included
7184 */
7185 void set partUri2(StringLiteral partUri) {
7186 this._partUri = becomeParentOf(partUri);
7187 } 7808 }
7188 /** 7809 /**
7189 * Set the semicolon terminating the directive to the given token. 7810 * Set the semicolon terminating the directive to the given token.
7190 * @param semicolon the semicolon terminating the directive 7811 * @param semicolon the semicolon terminating the directive
7191 */ 7812 */
7192 void set semicolon13(Token semicolon) { 7813 void set semicolon(Token semicolon13) {
7193 this._semicolon = semicolon; 7814 this._semicolon = semicolon13;
7194 }
7195 void visitChildren(ASTVisitor<Object> visitor) {
7196 super.visitChildren(visitor);
7197 safelyVisitChild(_partUri, visitor);
7198 } 7815 }
7199 Token get firstTokenAfterCommentAndMetadata => _partToken; 7816 Token get firstTokenAfterCommentAndMetadata => _partToken;
7200 } 7817 }
7201 /** 7818 /**
7202 * Instances of the class {@code PartOfDirective} represent a part-of directive. 7819 * Instances of the class {@code PartOfDirective} represent a part-of directive.
7203 * <pre> 7820 * <pre>
7204 * partOfDirective ::={@link Annotation metadata} 'part' 'of' {@link Identifier libraryName} ';' 7821 * partOfDirective ::={@link Annotation metadata} 'part' 'of' {@link Identifier libraryName} ';'
7205 * </pre> 7822 * </pre>
7206 */ 7823 */
7207 class PartOfDirective extends Directive { 7824 class PartOfDirective extends Directive {
(...skipping 15 matching lines...) Expand all
7223 Token _semicolon; 7840 Token _semicolon;
7224 /** 7841 /**
7225 * Initialize a newly created part-of directive. 7842 * Initialize a newly created part-of directive.
7226 * @param comment the documentation comment associated with this directive 7843 * @param comment the documentation comment associated with this directive
7227 * @param metadata the annotations associated with the directive 7844 * @param metadata the annotations associated with the directive
7228 * @param partToken the token representing the 'part' token 7845 * @param partToken the token representing the 'part' token
7229 * @param ofToken the token representing the 'of' token 7846 * @param ofToken the token representing the 'of' token
7230 * @param libraryName the name of the library that the containing compilation unit is part of 7847 * @param libraryName the name of the library that the containing compilation unit is part of
7231 * @param semicolon the semicolon terminating the directive 7848 * @param semicolon the semicolon terminating the directive
7232 */ 7849 */
7233 PartOfDirective(Comment comment, List<Annotation> metadata, Token partToken, T oken ofToken, LibraryIdentifier libraryName, Token semicolon) : super(comment, m etadata) { 7850 PartOfDirective.full(Comment comment, List<Annotation> metadata, Token partTok en, Token ofToken, LibraryIdentifier libraryName, Token semicolon) : super.full( comment, metadata) {
7234 this._partToken = partToken; 7851 this._partToken = partToken;
7235 this._ofToken = ofToken; 7852 this._ofToken = ofToken;
7236 this._libraryName = becomeParentOf(libraryName); 7853 this._libraryName = becomeParentOf(libraryName);
7237 this._semicolon = semicolon; 7854 this._semicolon = semicolon;
7238 } 7855 }
7856 /**
7857 * Initialize a newly created part-of directive.
7858 * @param comment the documentation comment associated with this directive
7859 * @param metadata the annotations associated with the directive
7860 * @param partToken the token representing the 'part' token
7861 * @param ofToken the token representing the 'of' token
7862 * @param libraryName the name of the library that the containing compilation unit is part of
7863 * @param semicolon the semicolon terminating the directive
7864 */
7865 PartOfDirective({Comment comment, List<Annotation> metadata, Token partToken, Token ofToken, LibraryIdentifier libraryName, Token semicolon}) : this.full(comm ent, metadata, partToken, ofToken, libraryName, semicolon);
7239 accept(ASTVisitor visitor) => visitor.visitPartOfDirective(this); 7866 accept(ASTVisitor visitor) => visitor.visitPartOfDirective(this);
7240 Token get endToken => _semicolon; 7867 Token get endToken => _semicolon;
7241 Token get keyword => _partToken; 7868 Token get keyword => _partToken;
7242 /** 7869 /**
7243 * Return the name of the library that the containing compilation unit is part of. 7870 * Return the name of the library that the containing compilation unit is part of.
7244 * @return the name of the library that the containing compilation unit is par t of 7871 * @return the name of the library that the containing compilation unit is par t of
7245 */ 7872 */
7246 LibraryIdentifier get libraryName => _libraryName; 7873 LibraryIdentifier get libraryName => _libraryName;
7247 /** 7874 /**
7248 * Return the token representing the 'of' token. 7875 * Return the token representing the 'of' token.
7249 * @return the token representing the 'of' token 7876 * @return the token representing the 'of' token
7250 */ 7877 */
7251 Token get ofToken => _ofToken; 7878 Token get ofToken => _ofToken;
7252 /** 7879 /**
7253 * Return the token representing the 'part' token. 7880 * Return the token representing the 'part' token.
7254 * @return the token representing the 'part' token 7881 * @return the token representing the 'part' token
7255 */ 7882 */
7256 Token get partToken => _partToken; 7883 Token get partToken => _partToken;
7257 /** 7884 /**
7258 * Return the semicolon terminating the directive. 7885 * Return the semicolon terminating the directive.
7259 * @return the semicolon terminating the directive 7886 * @return the semicolon terminating the directive
7260 */ 7887 */
7261 Token get semicolon => _semicolon; 7888 Token get semicolon => _semicolon;
7262 /** 7889 /**
7263 * Set the name of the library that the containing compilation unit is part of to the given name. 7890 * Set the name of the library that the containing compilation unit is part of to the given name.
7264 * @param libraryName the name of the library that the containing compilation unit is part of 7891 * @param libraryName the name of the library that the containing compilation unit is part of
7265 */ 7892 */
7266 void set libraryName2(LibraryIdentifier libraryName) { 7893 void set libraryName(LibraryIdentifier libraryName2) {
7267 this._libraryName = becomeParentOf(libraryName); 7894 this._libraryName = becomeParentOf(libraryName2);
7268 } 7895 }
7269 /** 7896 /**
7270 * Set the token representing the 'of' token to the given token. 7897 * Set the token representing the 'of' token to the given token.
7271 * @param ofToken the token representing the 'of' token 7898 * @param ofToken the token representing the 'of' token
7272 */ 7899 */
7273 void set ofToken2(Token ofToken) { 7900 void set ofToken(Token ofToken2) {
7274 this._ofToken = ofToken; 7901 this._ofToken = ofToken2;
7275 } 7902 }
7276 /** 7903 /**
7277 * Set the token representing the 'part' token to the given token. 7904 * Set the token representing the 'part' token to the given token.
7278 * @param partToken the token representing the 'part' token 7905 * @param partToken the token representing the 'part' token
7279 */ 7906 */
7280 void set partToken3(Token partToken) { 7907 void set partToken(Token partToken3) {
7281 this._partToken = partToken; 7908 this._partToken = partToken3;
7282 } 7909 }
7283 /** 7910 /**
7284 * Set the semicolon terminating the directive to the given token. 7911 * Set the semicolon terminating the directive to the given token.
7285 * @param semicolon the semicolon terminating the directive 7912 * @param semicolon the semicolon terminating the directive
7286 */ 7913 */
7287 void set semicolon14(Token semicolon) { 7914 void set semicolon(Token semicolon14) {
7288 this._semicolon = semicolon; 7915 this._semicolon = semicolon14;
7289 } 7916 }
7290 void visitChildren(ASTVisitor<Object> visitor) { 7917 void visitChildren(ASTVisitor<Object> visitor) {
7291 super.visitChildren(visitor); 7918 super.visitChildren(visitor);
7292 safelyVisitChild(_libraryName, visitor); 7919 safelyVisitChild(_libraryName, visitor);
7293 } 7920 }
7294 Token get firstTokenAfterCommentAndMetadata => _partToken; 7921 Token get firstTokenAfterCommentAndMetadata => _partToken;
7295 } 7922 }
7296 /** 7923 /**
7297 * Instances of the class {@code PostfixExpression} represent a postfix unary ex pression. 7924 * Instances of the class {@code PostfixExpression} represent a postfix unary ex pression.
7298 * <pre> 7925 * <pre>
(...skipping 11 matching lines...) Expand all
7310 /** 7937 /**
7311 * The element associated with this the operator, or {@code null} if the AST s tructure has not 7938 * The element associated with this the operator, or {@code null} if the AST s tructure has not
7312 * been resolved, if the operator is not user definable, or if the operator co uld not be resolved. 7939 * been resolved, if the operator is not user definable, or if the operator co uld not be resolved.
7313 */ 7940 */
7314 MethodElement _element; 7941 MethodElement _element;
7315 /** 7942 /**
7316 * Initialize a newly created postfix expression. 7943 * Initialize a newly created postfix expression.
7317 * @param operand the expression computing the operand for the operator 7944 * @param operand the expression computing the operand for the operator
7318 * @param operator the postfix operator being applied to the operand 7945 * @param operator the postfix operator being applied to the operand
7319 */ 7946 */
7320 PostfixExpression(Expression operand, Token operator) { 7947 PostfixExpression.full(Expression operand, Token operator) {
7321 this._operand = becomeParentOf(operand); 7948 this._operand = becomeParentOf(operand);
7322 this._operator = operator; 7949 this._operator = operator;
7323 } 7950 }
7951 /**
7952 * Initialize a newly created postfix expression.
7953 * @param operand the expression computing the operand for the operator
7954 * @param operator the postfix operator being applied to the operand
7955 */
7956 PostfixExpression({Expression operand, Token operator}) : this.full(operand, o perator);
7324 accept(ASTVisitor visitor) => visitor.visitPostfixExpression(this); 7957 accept(ASTVisitor visitor) => visitor.visitPostfixExpression(this);
7325 Token get beginToken => _operand.beginToken; 7958 Token get beginToken => _operand.beginToken;
7326 /** 7959 /**
7327 * Return the element associated with the operator, or {@code null} if the AST structure has not 7960 * Return the element associated with the operator, or {@code null} if the AST structure has not
7328 * been resolved, if the operator is not user definable, or if the operator co uld not be resolved. 7961 * been resolved, if the operator is not user definable, or if the operator co uld not be resolved.
7329 * One example of the latter case is an operator that is not defined for the t ype of the operand. 7962 * One example of the latter case is an operator that is not defined for the t ype of the operand.
7330 * @return the element associated with the operator 7963 * @return the element associated with the operator
7331 */ 7964 */
7332 MethodElement get element => _element; 7965 MethodElement get element => _element;
7333 Token get endToken => _operator; 7966 Token get endToken => _operator;
7334 /** 7967 /**
7335 * Return the expression computing the operand for the operator. 7968 * Return the expression computing the operand for the operator.
7336 * @return the expression computing the operand for the operator 7969 * @return the expression computing the operand for the operator
7337 */ 7970 */
7338 Expression get operand => _operand; 7971 Expression get operand => _operand;
7339 /** 7972 /**
7340 * Return the postfix operator being applied to the operand. 7973 * Return the postfix operator being applied to the operand.
7341 * @return the postfix operator being applied to the operand 7974 * @return the postfix operator being applied to the operand
7342 */ 7975 */
7343 Token get operator => _operator; 7976 Token get operator => _operator;
7344 /** 7977 /**
7345 * Set the element associated with the operator to the given element. 7978 * Set the element associated with the operator to the given element.
7346 * @param element the element associated with the operator 7979 * @param element the element associated with the operator
7347 */ 7980 */
7348 void set element13(MethodElement element) { 7981 void set element(MethodElement element14) {
7349 this._element = element; 7982 this._element = element14;
7350 } 7983 }
7351 /** 7984 /**
7352 * Set the expression computing the operand for the operator to the given expr ession. 7985 * Set the expression computing the operand for the operator to the given expr ession.
7353 * @param expression the expression computing the operand for the operator 7986 * @param expression the expression computing the operand for the operator
7354 */ 7987 */
7355 void set operand2(Expression expression) { 7988 void set operand(Expression expression) {
7356 _operand = becomeParentOf(expression); 7989 _operand = becomeParentOf(expression);
7357 } 7990 }
7358 /** 7991 /**
7359 * Set the postfix operator being applied to the operand to the given operator . 7992 * Set the postfix operator being applied to the operand to the given operator .
7360 * @param operator the postfix operator being applied to the operand 7993 * @param operator the postfix operator being applied to the operand
7361 */ 7994 */
7362 void set operator4(Token operator) { 7995 void set operator(Token operator4) {
7363 this._operator = operator; 7996 this._operator = operator4;
7364 } 7997 }
7365 void visitChildren(ASTVisitor<Object> visitor) { 7998 void visitChildren(ASTVisitor<Object> visitor) {
7366 safelyVisitChild(_operand, visitor); 7999 safelyVisitChild(_operand, visitor);
7367 } 8000 }
7368 } 8001 }
7369 /** 8002 /**
7370 * Instances of the class {@code PrefixExpression} represent a prefix unary expr ession. 8003 * Instances of the class {@code PrefixExpression} represent a prefix unary expr ession.
7371 * <pre> 8004 * <pre>
7372 * prefixExpression ::={@link Token operator} {@link Expression operand}</pre> 8005 * prefixExpression ::={@link Token operator} {@link Expression operand}</pre>
7373 */ 8006 */
7374 class PrefixExpression extends Expression { 8007 class PrefixExpression extends Expression {
7375 /** 8008 /**
7376 * The prefix operator being applied to the operand. 8009 * The prefix operator being applied to the operand.
7377 */ 8010 */
7378 Token _operator; 8011 Token _operator;
7379 /** 8012 /**
7380 * The expression computing the operand for the operator. 8013 * The expression computing the operand for the operator.
7381 */ 8014 */
7382 Expression _operand; 8015 Expression _operand;
7383 /** 8016 /**
7384 * The element associated with the operator, or {@code null} if the AST struct ure has not been 8017 * The element associated with the operator, or {@code null} if the AST struct ure has not been
7385 * resolved, if the operator is not user definable, or if the operator could n ot be resolved. 8018 * resolved, if the operator is not user definable, or if the operator could n ot be resolved.
7386 */ 8019 */
7387 MethodElement _element; 8020 MethodElement _element;
7388 /** 8021 /**
7389 * Initialize a newly created prefix expression. 8022 * Initialize a newly created prefix expression.
7390 * @param operator the prefix operator being applied to the operand 8023 * @param operator the prefix operator being applied to the operand
7391 * @param operand the expression computing the operand for the operator 8024 * @param operand the expression computing the operand for the operator
7392 */ 8025 */
7393 PrefixExpression(Token operator, Expression operand) { 8026 PrefixExpression.full(Token operator, Expression operand) {
7394 this._operator = operator; 8027 this._operator = operator;
7395 this._operand = becomeParentOf(operand); 8028 this._operand = becomeParentOf(operand);
7396 } 8029 }
8030 /**
8031 * Initialize a newly created prefix expression.
8032 * @param operator the prefix operator being applied to the operand
8033 * @param operand the expression computing the operand for the operator
8034 */
8035 PrefixExpression({Token operator, Expression operand}) : this.full(operator, o perand);
7397 accept(ASTVisitor visitor) => visitor.visitPrefixExpression(this); 8036 accept(ASTVisitor visitor) => visitor.visitPrefixExpression(this);
7398 Token get beginToken => _operator; 8037 Token get beginToken => _operator;
7399 /** 8038 /**
7400 * Return the element associated with the operator, or {@code null} if the AST structure has not 8039 * Return the element associated with the operator, or {@code null} if the AST structure has not
7401 * been resolved, if the operator is not user definable, or if the operator co uld not be resolved. 8040 * been resolved, if the operator is not user definable, or if the operator co uld not be resolved.
7402 * One example of the latter case is an operator that is not defined for the t ype of the operand. 8041 * One example of the latter case is an operator that is not defined for the t ype of the operand.
7403 * @return the element associated with the operator 8042 * @return the element associated with the operator
7404 */ 8043 */
7405 MethodElement get element => _element; 8044 MethodElement get element => _element;
7406 Token get endToken => _operand.endToken; 8045 Token get endToken => _operand.endToken;
7407 /** 8046 /**
7408 * Return the expression computing the operand for the operator. 8047 * Return the expression computing the operand for the operator.
7409 * @return the expression computing the operand for the operator 8048 * @return the expression computing the operand for the operator
7410 */ 8049 */
7411 Expression get operand => _operand; 8050 Expression get operand => _operand;
7412 /** 8051 /**
7413 * Return the prefix operator being applied to the operand. 8052 * Return the prefix operator being applied to the operand.
7414 * @return the prefix operator being applied to the operand 8053 * @return the prefix operator being applied to the operand
7415 */ 8054 */
7416 Token get operator => _operator; 8055 Token get operator => _operator;
7417 /** 8056 /**
7418 * Set the element associated with the operator to the given element. 8057 * Set the element associated with the operator to the given element.
7419 * @param element the element associated with the operator 8058 * @param element the element associated with the operator
7420 */ 8059 */
7421 void set element14(MethodElement element) { 8060 void set element(MethodElement element15) {
7422 this._element = element; 8061 this._element = element15;
7423 } 8062 }
7424 /** 8063 /**
7425 * Set the expression computing the operand for the operator to the given expr ession. 8064 * Set the expression computing the operand for the operator to the given expr ession.
7426 * @param expression the expression computing the operand for the operator 8065 * @param expression the expression computing the operand for the operator
7427 */ 8066 */
7428 void set operand3(Expression expression) { 8067 void set operand(Expression expression) {
7429 _operand = becomeParentOf(expression); 8068 _operand = becomeParentOf(expression);
7430 } 8069 }
7431 /** 8070 /**
7432 * Set the prefix operator being applied to the operand to the given operator. 8071 * Set the prefix operator being applied to the operand to the given operator.
7433 * @param operator the prefix operator being applied to the operand 8072 * @param operator the prefix operator being applied to the operand
7434 */ 8073 */
7435 void set operator5(Token operator) { 8074 void set operator(Token operator5) {
7436 this._operator = operator; 8075 this._operator = operator5;
7437 } 8076 }
7438 void visitChildren(ASTVisitor<Object> visitor) { 8077 void visitChildren(ASTVisitor<Object> visitor) {
7439 safelyVisitChild(_operand, visitor); 8078 safelyVisitChild(_operand, visitor);
7440 } 8079 }
7441 } 8080 }
7442 /** 8081 /**
7443 * Instances of the class {@code PrefixedIdentifier} represent either an identif ier that is prefixed 8082 * Instances of the class {@code PrefixedIdentifier} represent either an identif ier that is prefixed
7444 * or an access to an object property where the target of the property access is a simple 8083 * or an access to an object property where the target of the property access is a simple
7445 * identifier. 8084 * identifier.
7446 * <pre> 8085 * <pre>
(...skipping 11 matching lines...) Expand all
7458 /** 8097 /**
7459 * The identifier being prefixed. 8098 * The identifier being prefixed.
7460 */ 8099 */
7461 SimpleIdentifier _identifier; 8100 SimpleIdentifier _identifier;
7462 /** 8101 /**
7463 * Initialize a newly created prefixed identifier. 8102 * Initialize a newly created prefixed identifier.
7464 * @param prefix the identifier being prefixed 8103 * @param prefix the identifier being prefixed
7465 * @param period the period used to separate the prefix from the identifier 8104 * @param period the period used to separate the prefix from the identifier
7466 * @param identifier the prefix associated with the library in which the ident ifier is defined 8105 * @param identifier the prefix associated with the library in which the ident ifier is defined
7467 */ 8106 */
7468 PrefixedIdentifier(SimpleIdentifier prefix, Token period, SimpleIdentifier ide ntifier) { 8107 PrefixedIdentifier.full(SimpleIdentifier prefix, Token period, SimpleIdentifie r identifier) {
7469 this._prefix = becomeParentOf(prefix); 8108 this._prefix = becomeParentOf(prefix);
7470 this._period = period; 8109 this._period = period;
7471 this._identifier = becomeParentOf(identifier); 8110 this._identifier = becomeParentOf(identifier);
7472 } 8111 }
8112 /**
8113 * Initialize a newly created prefixed identifier.
8114 * @param prefix the identifier being prefixed
8115 * @param period the period used to separate the prefix from the identifier
8116 * @param identifier the prefix associated with the library in which the ident ifier is defined
8117 */
8118 PrefixedIdentifier({SimpleIdentifier prefix, Token period, SimpleIdentifier id entifier}) : this.full(prefix, period, identifier);
7473 accept(ASTVisitor visitor) => visitor.visitPrefixedIdentifier(this); 8119 accept(ASTVisitor visitor) => visitor.visitPrefixedIdentifier(this);
7474 Token get beginToken => _prefix.beginToken; 8120 Token get beginToken => _prefix.beginToken;
7475 Token get endToken => _identifier.endToken; 8121 Token get endToken => _identifier.endToken;
7476 /** 8122 /**
7477 * Return the identifier being prefixed. 8123 * Return the identifier being prefixed.
7478 * @return the identifier being prefixed 8124 * @return the identifier being prefixed
7479 */ 8125 */
7480 SimpleIdentifier get identifier => _identifier; 8126 SimpleIdentifier get identifier => _identifier;
7481 String get name => "${_prefix.name}.${_identifier.name}"; 8127 String get name => "${_prefix.name}.${_identifier.name}";
7482 /** 8128 /**
7483 * Return the period used to separate the prefix from the identifier. 8129 * Return the period used to separate the prefix from the identifier.
7484 * @return the period used to separate the prefix from the identifier 8130 * @return the period used to separate the prefix from the identifier
7485 */ 8131 */
7486 Token get period => _period; 8132 Token get period => _period;
7487 /** 8133 /**
7488 * Return the prefix associated with the library in which the identifier is de fined. 8134 * Return the prefix associated with the library in which the identifier is de fined.
7489 * @return the prefix associated with the library in which the identifier is d efined 8135 * @return the prefix associated with the library in which the identifier is d efined
7490 */ 8136 */
7491 SimpleIdentifier get prefix => _prefix; 8137 SimpleIdentifier get prefix => _prefix;
7492 /** 8138 /**
7493 * Set the identifier being prefixed to the given identifier. 8139 * Set the identifier being prefixed to the given identifier.
7494 * @param identifier the identifier being prefixed 8140 * @param identifier the identifier being prefixed
7495 */ 8141 */
7496 void set identifier5(SimpleIdentifier identifier) { 8142 void set identifier(SimpleIdentifier identifier7) {
7497 this._identifier = becomeParentOf(identifier); 8143 this._identifier = becomeParentOf(identifier7);
7498 } 8144 }
7499 /** 8145 /**
7500 * Set the period used to separate the prefix from the identifier to the given token. 8146 * Set the period used to separate the prefix from the identifier to the given token.
7501 * @param period the period used to separate the prefix from the identifier 8147 * @param period the period used to separate the prefix from the identifier
7502 */ 8148 */
7503 void set period9(Token period) { 8149 void set period(Token period10) {
7504 this._period = period; 8150 this._period = period10;
7505 } 8151 }
7506 /** 8152 /**
7507 * Set the prefix associated with the library in which the identifier is defin ed to the given 8153 * Set the prefix associated with the library in which the identifier is defin ed to the given
7508 * identifier. 8154 * identifier.
7509 * @param identifier the prefix associated with the library in which the ident ifier is defined 8155 * @param identifier the prefix associated with the library in which the ident ifier is defined
7510 */ 8156 */
7511 void set prefix3(SimpleIdentifier identifier) { 8157 void set prefix(SimpleIdentifier identifier) {
7512 _prefix = becomeParentOf(identifier); 8158 _prefix = becomeParentOf(identifier);
7513 } 8159 }
7514 void visitChildren(ASTVisitor<Object> visitor) { 8160 void visitChildren(ASTVisitor<Object> visitor) {
7515 safelyVisitChild(_prefix, visitor); 8161 safelyVisitChild(_prefix, visitor);
7516 safelyVisitChild(_identifier, visitor); 8162 safelyVisitChild(_identifier, visitor);
7517 } 8163 }
7518 } 8164 }
7519 /** 8165 /**
7520 * Instances of the class {@code PropertyAccess} represent the access of a prope rty of an object. 8166 * Instances of the class {@code PropertyAccess} represent the access of a prope rty of an object.
7521 * <p> 8167 * <p>
(...skipping 14 matching lines...) Expand all
7536 /** 8182 /**
7537 * The name of the property being accessed. 8183 * The name of the property being accessed.
7538 */ 8184 */
7539 SimpleIdentifier _propertyName; 8185 SimpleIdentifier _propertyName;
7540 /** 8186 /**
7541 * Initialize a newly created property access expression. 8187 * Initialize a newly created property access expression.
7542 * @param target the expression computing the object defining the property bei ng accessed 8188 * @param target the expression computing the object defining the property bei ng accessed
7543 * @param operator the property access operator 8189 * @param operator the property access operator
7544 * @param propertyName the name of the property being accessed 8190 * @param propertyName the name of the property being accessed
7545 */ 8191 */
7546 PropertyAccess(Expression target, Token operator, SimpleIdentifier propertyNam e) { 8192 PropertyAccess.full(Expression target, Token operator, SimpleIdentifier proper tyName) {
7547 this._target = becomeParentOf(target); 8193 this._target = becomeParentOf(target);
7548 this._operator = operator; 8194 this._operator = operator;
7549 this._propertyName = becomeParentOf(propertyName); 8195 this._propertyName = becomeParentOf(propertyName);
7550 } 8196 }
8197 /**
8198 * Initialize a newly created property access expression.
8199 * @param target the expression computing the object defining the property bei ng accessed
8200 * @param operator the property access operator
8201 * @param propertyName the name of the property being accessed
8202 */
8203 PropertyAccess({Expression target, Token operator, SimpleIdentifier propertyNa me}) : this.full(target, operator, propertyName);
7551 accept(ASTVisitor visitor) => visitor.visitPropertyAccess(this); 8204 accept(ASTVisitor visitor) => visitor.visitPropertyAccess(this);
7552 Token get beginToken { 8205 Token get beginToken {
7553 if (_target != null) { 8206 if (_target != null) {
7554 return _target.beginToken; 8207 return _target.beginToken;
7555 } 8208 }
7556 return _operator; 8209 return _operator;
7557 } 8210 }
7558 Token get endToken => _propertyName.endToken; 8211 Token get endToken => _propertyName.endToken;
7559 /** 8212 /**
7560 * Return the property access operator. 8213 * Return the property access operator.
(...skipping 15 matching lines...) Expand all
7576 */ 8229 */
7577 Expression get realTarget { 8230 Expression get realTarget {
7578 if (isCascaded()) { 8231 if (isCascaded()) {
7579 ASTNode ancestor = parent; 8232 ASTNode ancestor = parent;
7580 while (ancestor is! CascadeExpression) { 8233 while (ancestor is! CascadeExpression) {
7581 if (ancestor == null) { 8234 if (ancestor == null) {
7582 return _target; 8235 return _target;
7583 } 8236 }
7584 ancestor = ancestor.parent; 8237 ancestor = ancestor.parent;
7585 } 8238 }
7586 return (ancestor as CascadeExpression).target; 8239 return ((ancestor as CascadeExpression)).target;
7587 } 8240 }
7588 return _target; 8241 return _target;
7589 } 8242 }
7590 /** 8243 /**
7591 * 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. 8244 * 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.
7592 * @return the expression computing the object defining the property being acc essed 8245 * @return the expression computing the object defining the property being acc essed
7593 * @see #getRealTarget() 8246 * @see #getRealTarget()
7594 */ 8247 */
7595 Expression get target => _target; 8248 Expression get target => _target;
7596 bool isAssignable() => true; 8249 bool isAssignable() => true;
7597 /** 8250 /**
7598 * Return {@code true} if this expression is cascaded. If it is, then the targ et of this 8251 * Return {@code true} if this expression is cascaded. If it is, then the targ et of this
7599 * expression is not stored locally but is stored in the nearest ancestor that is a{@link CascadeExpression}. 8252 * expression is not stored locally but is stored in the nearest ancestor that is a{@link CascadeExpression}.
7600 * @return {@code true} if this expression is cascaded 8253 * @return {@code true} if this expression is cascaded
7601 */ 8254 */
7602 bool isCascaded() => _operator != null && _operator.type == TokenType.PERIOD_P ERIOD; 8255 bool isCascaded() => _operator != null && identical(_operator.type, TokenType. PERIOD_PERIOD);
7603 /** 8256 /**
7604 * Set the property access operator to the given token. 8257 * Set the property access operator to the given token.
7605 * @param operator the property access operator 8258 * @param operator the property access operator
7606 */ 8259 */
7607 void set operator6(Token operator) { 8260 void set operator(Token operator6) {
7608 this._operator = operator; 8261 this._operator = operator6;
7609 } 8262 }
7610 /** 8263 /**
7611 * Set the name of the property being accessed to the given identifier. 8264 * Set the name of the property being accessed to the given identifier.
7612 * @param identifier the name of the property being accessed 8265 * @param identifier the name of the property being accessed
7613 */ 8266 */
7614 void set propertyName2(SimpleIdentifier identifier) { 8267 void set propertyName(SimpleIdentifier identifier) {
7615 _propertyName = becomeParentOf(identifier); 8268 _propertyName = becomeParentOf(identifier);
7616 } 8269 }
7617 /** 8270 /**
7618 * Set the expression computing the object defining the property being accesse d to the given 8271 * Set the expression computing the object defining the property being accesse d to the given
7619 * expression. 8272 * expression.
7620 * @param expression the expression computing the object defining the property being accessed 8273 * @param expression the expression computing the object defining the property being accessed
7621 */ 8274 */
7622 void set target4(Expression expression) { 8275 void set target(Expression expression) {
7623 _target = becomeParentOf(expression); 8276 _target = becomeParentOf(expression);
7624 } 8277 }
7625 void visitChildren(ASTVisitor<Object> visitor) { 8278 void visitChildren(ASTVisitor<Object> visitor) {
7626 safelyVisitChild(_target, visitor); 8279 safelyVisitChild(_target, visitor);
7627 safelyVisitChild(_propertyName, visitor); 8280 safelyVisitChild(_propertyName, visitor);
7628 } 8281 }
7629 } 8282 }
7630 /** 8283 /**
7631 * Instances of the class {@code RedirectingConstructorInvocation} represent the invocation of a 8284 * Instances of the class {@code RedirectingConstructorInvocation} represent the invocation of a
7632 * another constructor in the same class from within a constructor's initializat ion list. 8285 * another constructor in the same class from within a constructor's initializat ion list.
(...skipping 14 matching lines...) Expand all
7647 /** 8300 /**
7648 * The name of the constructor that is being invoked, or {@code null} if the u nnamed constructor 8301 * The name of the constructor that is being invoked, or {@code null} if the u nnamed constructor
7649 * is being invoked. 8302 * is being invoked.
7650 */ 8303 */
7651 SimpleIdentifier _constructorName; 8304 SimpleIdentifier _constructorName;
7652 /** 8305 /**
7653 * The list of arguments to the constructor. 8306 * The list of arguments to the constructor.
7654 */ 8307 */
7655 ArgumentList _argumentList; 8308 ArgumentList _argumentList;
7656 /** 8309 /**
8310 * The element associated with the constructor, or {@code null} if the AST str ucture has not been
8311 * resolved or if the constructor could not be resolved.
8312 */
8313 ConstructorElement _element;
8314 /**
7657 * Initialize a newly created redirecting invocation to invoke the constructor with the given name 8315 * Initialize a newly created redirecting invocation to invoke the constructor with the given name
7658 * with the given arguments. 8316 * with the given arguments.
7659 * @param keyword the token for the 'this' keyword 8317 * @param keyword the token for the 'this' keyword
7660 * @param period the token for the period before the name of the constructor t hat is being invoked 8318 * @param period the token for the period before the name of the constructor t hat is being invoked
7661 * @param constructorName the name of the constructor that is being invoked 8319 * @param constructorName the name of the constructor that is being invoked
7662 * @param argumentList the list of arguments to the constructor 8320 * @param argumentList the list of arguments to the constructor
7663 */ 8321 */
7664 RedirectingConstructorInvocation(Token keyword, Token period, SimpleIdentifier constructorName, ArgumentList argumentList) { 8322 RedirectingConstructorInvocation.full(Token keyword, Token period, SimpleIdent ifier constructorName, ArgumentList argumentList) {
7665 this._keyword = keyword; 8323 this._keyword = keyword;
7666 this._period = period; 8324 this._period = period;
7667 this._constructorName = becomeParentOf(constructorName); 8325 this._constructorName = becomeParentOf(constructorName);
7668 this._argumentList = becomeParentOf(argumentList); 8326 this._argumentList = becomeParentOf(argumentList);
7669 } 8327 }
8328 /**
8329 * Initialize a newly created redirecting invocation to invoke the constructor with the given name
8330 * with the given arguments.
8331 * @param keyword the token for the 'this' keyword
8332 * @param period the token for the period before the name of the constructor t hat is being invoked
8333 * @param constructorName the name of the constructor that is being invoked
8334 * @param argumentList the list of arguments to the constructor
8335 */
8336 RedirectingConstructorInvocation({Token keyword, Token period, SimpleIdentifie r constructorName, ArgumentList argumentList}) : this.full(keyword, period, cons tructorName, argumentList);
7670 accept(ASTVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th is); 8337 accept(ASTVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th is);
7671 /** 8338 /**
7672 * Return the list of arguments to the constructor. 8339 * Return the list of arguments to the constructor.
7673 * @return the list of arguments to the constructor 8340 * @return the list of arguments to the constructor
7674 */ 8341 */
7675 ArgumentList get argumentList => _argumentList; 8342 ArgumentList get argumentList => _argumentList;
7676 Token get beginToken => _keyword; 8343 Token get beginToken => _keyword;
7677 /** 8344 /**
7678 * Return the name of the constructor that is being invoked, or {@code null} i f the unnamed 8345 * Return the name of the constructor that is being invoked, or {@code null} i f the unnamed
7679 * constructor is being invoked. 8346 * constructor is being invoked.
7680 * @return the name of the constructor that is being invoked 8347 * @return the name of the constructor that is being invoked
7681 */ 8348 */
7682 SimpleIdentifier get constructorName => _constructorName; 8349 SimpleIdentifier get constructorName => _constructorName;
8350 /**
8351 * Return the element associated with the constructor, or {@code null} if the AST structure has
8352 * not been resolved or if the constructor could not be resolved.
8353 * @return the element associated with the super constructor
8354 */
8355 ConstructorElement get element => _element;
7683 Token get endToken => _argumentList.endToken; 8356 Token get endToken => _argumentList.endToken;
7684 /** 8357 /**
7685 * Return the token for the 'this' keyword. 8358 * Return the token for the 'this' keyword.
7686 * @return the token for the 'this' keyword 8359 * @return the token for the 'this' keyword
7687 */ 8360 */
7688 Token get keyword => _keyword; 8361 Token get keyword => _keyword;
7689 /** 8362 /**
7690 * 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. 8363 * 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.
7691 * @return the token for the period before the name of the constructor that is being invoked 8364 * @return the token for the period before the name of the constructor that is being invoked
7692 */ 8365 */
7693 Token get period => _period; 8366 Token get period => _period;
7694 /** 8367 /**
7695 * Set the list of arguments to the constructor to the given list. 8368 * Set the list of arguments to the constructor to the given list.
7696 * @param argumentList the list of arguments to the constructor 8369 * @param argumentList the list of arguments to the constructor
7697 */ 8370 */
7698 void set argumentList8(ArgumentList argumentList) { 8371 void set argumentList(ArgumentList argumentList8) {
7699 this._argumentList = becomeParentOf(argumentList); 8372 this._argumentList = becomeParentOf(argumentList8);
7700 } 8373 }
7701 /** 8374 /**
7702 * Set the name of the constructor that is being invoked to the given identifi er. 8375 * Set the name of the constructor that is being invoked to the given identifi er.
7703 * @param identifier the name of the constructor that is being invoked 8376 * @param identifier the name of the constructor that is being invoked
7704 */ 8377 */
7705 void set constructorName4(SimpleIdentifier identifier) { 8378 void set constructorName(SimpleIdentifier identifier) {
7706 _constructorName = becomeParentOf(identifier); 8379 _constructorName = becomeParentOf(identifier);
7707 } 8380 }
7708 /** 8381 /**
8382 * Set the element associated with the constructor to the given element.
8383 * @param element the element associated with the constructor
8384 */
8385 void set element(ConstructorElement element16) {
8386 this._element = element16;
8387 }
8388 /**
7709 * Set the token for the 'this' keyword to the given token. 8389 * Set the token for the 'this' keyword to the given token.
7710 * @param keyword the token for the 'this' keyword 8390 * @param keyword the token for the 'this' keyword
7711 */ 8391 */
7712 void set keyword14(Token keyword) { 8392 void set keyword(Token keyword13) {
7713 this._keyword = keyword; 8393 this._keyword = keyword13;
7714 } 8394 }
7715 /** 8395 /**
7716 * Set the token for the period before the name of the constructor that is bei ng invoked to the 8396 * Set the token for the period before the name of the constructor that is bei ng invoked to the
7717 * given token. 8397 * given token.
7718 * @param period the token for the period before the name of the constructor t hat is being invoked 8398 * @param period the token for the period before the name of the constructor t hat is being invoked
7719 */ 8399 */
7720 void set period10(Token period) { 8400 void set period(Token period11) {
7721 this._period = period; 8401 this._period = period11;
7722 } 8402 }
7723 void visitChildren(ASTVisitor<Object> visitor) { 8403 void visitChildren(ASTVisitor<Object> visitor) {
7724 safelyVisitChild(_constructorName, visitor); 8404 safelyVisitChild(_constructorName, visitor);
7725 safelyVisitChild(_argumentList, visitor); 8405 safelyVisitChild(_argumentList, visitor);
7726 } 8406 }
7727 } 8407 }
7728 /** 8408 /**
7729 * Instances of the class {@code ReturnStatement} represent a return statement. 8409 * Instances of the class {@code ReturnStatement} represent a return statement.
7730 * <pre> 8410 * <pre>
7731 * returnStatement ::= 8411 * returnStatement ::=
(...skipping 13 matching lines...) Expand all
7745 /** 8425 /**
7746 * The semicolon terminating the statement. 8426 * The semicolon terminating the statement.
7747 */ 8427 */
7748 Token _semicolon; 8428 Token _semicolon;
7749 /** 8429 /**
7750 * Initialize a newly created return statement. 8430 * Initialize a newly created return statement.
7751 * @param keyword the token representing the 'return' keyword 8431 * @param keyword the token representing the 'return' keyword
7752 * @param expression the expression computing the value to be returned 8432 * @param expression the expression computing the value to be returned
7753 * @param semicolon the semicolon terminating the statement 8433 * @param semicolon the semicolon terminating the statement
7754 */ 8434 */
7755 ReturnStatement(Token keyword, Expression expression, Token semicolon) { 8435 ReturnStatement.full(Token keyword, Expression expression, Token semicolon) {
7756 this._keyword = keyword; 8436 this._keyword = keyword;
7757 this._expression = becomeParentOf(expression); 8437 this._expression = becomeParentOf(expression);
7758 this._semicolon = semicolon; 8438 this._semicolon = semicolon;
7759 } 8439 }
8440 /**
8441 * Initialize a newly created return statement.
8442 * @param keyword the token representing the 'return' keyword
8443 * @param expression the expression computing the value to be returned
8444 * @param semicolon the semicolon terminating the statement
8445 */
8446 ReturnStatement({Token keyword, Expression expression, Token semicolon}) : thi s.full(keyword, expression, semicolon);
7760 accept(ASTVisitor visitor) => visitor.visitReturnStatement(this); 8447 accept(ASTVisitor visitor) => visitor.visitReturnStatement(this);
7761 Token get beginToken => _keyword; 8448 Token get beginToken => _keyword;
7762 Token get endToken => _semicolon; 8449 Token get endToken => _semicolon;
7763 /** 8450 /**
7764 * Return the expression computing the value to be returned, or {@code null} i f no explicit value 8451 * Return the expression computing the value to be returned, or {@code null} i f no explicit value
7765 * was provided. 8452 * was provided.
7766 * @return the expression computing the value to be returned 8453 * @return the expression computing the value to be returned
7767 */ 8454 */
7768 Expression get expression => _expression; 8455 Expression get expression => _expression;
7769 /** 8456 /**
7770 * Return the token representing the 'return' keyword. 8457 * Return the token representing the 'return' keyword.
7771 * @return the token representing the 'return' keyword 8458 * @return the token representing the 'return' keyword
7772 */ 8459 */
7773 Token get keyword => _keyword; 8460 Token get keyword => _keyword;
7774 /** 8461 /**
7775 * Return the semicolon terminating the statement. 8462 * Return the semicolon terminating the statement.
7776 * @return the semicolon terminating the statement 8463 * @return the semicolon terminating the statement
7777 */ 8464 */
7778 Token get semicolon => _semicolon; 8465 Token get semicolon => _semicolon;
7779 /** 8466 /**
7780 * Set the expression computing the value to be returned to the given expressi on. 8467 * Set the expression computing the value to be returned to the given expressi on.
7781 * @param expression the expression computing the value to be returned 8468 * @param expression the expression computing the value to be returned
7782 */ 8469 */
7783 void set expression10(Expression expression) { 8470 void set expression(Expression expression10) {
7784 this._expression = becomeParentOf(expression); 8471 this._expression = becomeParentOf(expression10);
7785 } 8472 }
7786 /** 8473 /**
7787 * Set the token representing the 'return' keyword to the given token. 8474 * Set the token representing the 'return' keyword to the given token.
7788 * @param keyword the token representing the 'return' keyword 8475 * @param keyword the token representing the 'return' keyword
7789 */ 8476 */
7790 void set keyword15(Token keyword) { 8477 void set keyword(Token keyword14) {
7791 this._keyword = keyword; 8478 this._keyword = keyword14;
7792 } 8479 }
7793 /** 8480 /**
7794 * Set the semicolon terminating the statement to the given token. 8481 * Set the semicolon terminating the statement to the given token.
7795 * @param semicolon the semicolon terminating the statement 8482 * @param semicolon the semicolon terminating the statement
7796 */ 8483 */
7797 void set semicolon15(Token semicolon) { 8484 void set semicolon(Token semicolon15) {
7798 this._semicolon = semicolon; 8485 this._semicolon = semicolon15;
7799 } 8486 }
7800 void visitChildren(ASTVisitor<Object> visitor) { 8487 void visitChildren(ASTVisitor<Object> visitor) {
7801 safelyVisitChild(_expression, visitor); 8488 safelyVisitChild(_expression, visitor);
7802 } 8489 }
7803 } 8490 }
7804 /** 8491 /**
7805 * Instances of the class {@code ScriptTag} represent the script tag that can op tionally occur at 8492 * Instances of the class {@code ScriptTag} represent the script tag that can op tionally occur at
7806 * the beginning of a compilation unit. 8493 * the beginning of a compilation unit.
7807 * <pre> 8494 * <pre>
7808 * scriptTag ::= 8495 * scriptTag ::=
7809 * '#!' (~NEWLINE)* NEWLINE 8496 * '#!' (~NEWLINE)* NEWLINE
7810 * </pre> 8497 * </pre>
7811 */ 8498 */
7812 class ScriptTag extends ASTNode { 8499 class ScriptTag extends ASTNode {
7813 /** 8500 /**
7814 * The token representing this script tag. 8501 * The token representing this script tag.
7815 */ 8502 */
7816 Token _scriptTag; 8503 Token _scriptTag;
7817 /** 8504 /**
7818 * Initialize a newly created script tag. 8505 * Initialize a newly created script tag.
7819 * @param scriptTag the token representing this script tag 8506 * @param scriptTag the token representing this script tag
7820 */ 8507 */
7821 ScriptTag(Token scriptTag) { 8508 ScriptTag.full(Token scriptTag) {
7822 this._scriptTag = scriptTag; 8509 this._scriptTag = scriptTag;
7823 } 8510 }
8511 /**
8512 * Initialize a newly created script tag.
8513 * @param scriptTag the token representing this script tag
8514 */
8515 ScriptTag({Token scriptTag}) : this.full(scriptTag);
7824 accept(ASTVisitor visitor) => visitor.visitScriptTag(this); 8516 accept(ASTVisitor visitor) => visitor.visitScriptTag(this);
7825 Token get beginToken => _scriptTag; 8517 Token get beginToken => _scriptTag;
7826 Token get endToken => _scriptTag; 8518 Token get endToken => _scriptTag;
7827 /** 8519 /**
7828 * Return the token representing this script tag. 8520 * Return the token representing this script tag.
7829 * @return the token representing this script tag 8521 * @return the token representing this script tag
7830 */ 8522 */
7831 Token get scriptTag => _scriptTag; 8523 Token get scriptTag => _scriptTag;
7832 /** 8524 /**
7833 * Set the token representing this script tag to the given script tag. 8525 * Set the token representing this script tag to the given script tag.
7834 * @param scriptTag the token representing this script tag 8526 * @param scriptTag the token representing this script tag
7835 */ 8527 */
7836 void set scriptTag3(Token scriptTag) { 8528 void set scriptTag(Token scriptTag3) {
7837 this._scriptTag = scriptTag; 8529 this._scriptTag = scriptTag3;
7838 } 8530 }
7839 void visitChildren(ASTVisitor<Object> visitor) { 8531 void visitChildren(ASTVisitor<Object> visitor) {
7840 } 8532 }
7841 } 8533 }
7842 /** 8534 /**
7843 * Instances of the class {@code ShowCombinator} represent a combinator that res tricts the names 8535 * Instances of the class {@code ShowCombinator} represent a combinator that res tricts the names
7844 * being imported to those in a given list. 8536 * being imported to those in a given list.
7845 * <pre> 8537 * <pre>
7846 * showCombinator ::= 8538 * showCombinator ::=
7847 * 'show' {@link SimpleIdentifier identifier} (',' {@link SimpleIdentifier ident ifier}) 8539 * 'show' {@link SimpleIdentifier identifier} (',' {@link SimpleIdentifier ident ifier})
7848 * </pre> 8540 * </pre>
7849 */ 8541 */
7850 class ShowCombinator extends Combinator { 8542 class ShowCombinator extends Combinator {
7851 /** 8543 /**
7852 * The list of names from the library that are made visible by this combinator . 8544 * The list of names from the library that are made visible by this combinator .
7853 */ 8545 */
7854 NodeList<SimpleIdentifier> _shownNames; 8546 NodeList<SimpleIdentifier> _shownNames;
7855 /** 8547 /**
7856 * Initialize a newly created import show combinator. 8548 * Initialize a newly created import show combinator.
7857 * @param keyword the comma introducing the combinator 8549 * @param keyword the comma introducing the combinator
7858 * @param shownNames the list of names from the library that are made visible by this combinator 8550 * @param shownNames the list of names from the library that are made visible by this combinator
7859 */ 8551 */
7860 ShowCombinator(Token keyword, List<SimpleIdentifier> shownNames) : super(keywo rd) { 8552 ShowCombinator.full(Token keyword, List<SimpleIdentifier> shownNames) : super. full(keyword) {
7861 this._shownNames = new NodeList<SimpleIdentifier>(this); 8553 this._shownNames = new NodeList<SimpleIdentifier>(this);
7862 this._shownNames.addAll(shownNames); 8554 this._shownNames.addAll(shownNames);
7863 } 8555 }
8556 /**
8557 * Initialize a newly created import show combinator.
8558 * @param keyword the comma introducing the combinator
8559 * @param shownNames the list of names from the library that are made visible by this combinator
8560 */
8561 ShowCombinator({Token keyword, List<SimpleIdentifier> shownNames}) : this.full (keyword, shownNames);
7864 accept(ASTVisitor visitor) => visitor.visitShowCombinator(this); 8562 accept(ASTVisitor visitor) => visitor.visitShowCombinator(this);
7865 Token get endToken => _shownNames.endToken; 8563 Token get endToken => _shownNames.endToken;
7866 /** 8564 /**
7867 * Return the list of names from the library that are made visible by this com binator. 8565 * Return the list of names from the library that are made visible by this com binator.
7868 * @return the list of names from the library that are made visible by this co mbinator 8566 * @return the list of names from the library that are made visible by this co mbinator
7869 */ 8567 */
7870 NodeList<SimpleIdentifier> get shownNames => _shownNames; 8568 NodeList<SimpleIdentifier> get shownNames => _shownNames;
7871 void visitChildren(ASTVisitor<Object> visitor) { 8569 void visitChildren(ASTVisitor<Object> visitor) {
7872 _shownNames.accept(visitor); 8570 _shownNames.accept(visitor);
7873 } 8571 }
(...skipping 16 matching lines...) Expand all
7890 */ 8588 */
7891 TypeName _type; 8589 TypeName _type;
7892 /** 8590 /**
7893 * Initialize a newly created formal parameter. 8591 * Initialize a newly created formal parameter.
7894 * @param comment the documentation comment associated with this parameter 8592 * @param comment the documentation comment associated with this parameter
7895 * @param metadata the annotations associated with this parameter 8593 * @param metadata the annotations associated with this parameter
7896 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 8594 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
7897 * @param type the name of the declared type of the parameter 8595 * @param type the name of the declared type of the parameter
7898 * @param identifier the name of the parameter being declared 8596 * @param identifier the name of the parameter being declared
7899 */ 8597 */
7900 SimpleFormalParameter(Comment comment, List<Annotation> metadata, Token keywor d, TypeName type, SimpleIdentifier identifier) : super(comment, metadata, identi fier) { 8598 SimpleFormalParameter.full(Comment comment, List<Annotation> metadata, Token k eyword, TypeName type, SimpleIdentifier identifier) : super.full(comment, metada ta, identifier) {
7901 this._keyword = keyword; 8599 this._keyword = keyword;
7902 this._type = becomeParentOf(type); 8600 this._type = becomeParentOf(type);
7903 } 8601 }
8602 /**
8603 * Initialize a newly created formal parameter.
8604 * @param comment the documentation comment associated with this parameter
8605 * @param metadata the annotations associated with this parameter
8606 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
8607 * @param type the name of the declared type of the parameter
8608 * @param identifier the name of the parameter being declared
8609 */
8610 SimpleFormalParameter({Comment comment, List<Annotation> metadata, Token keywo rd, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, keyword, type, identifier);
7904 accept(ASTVisitor visitor) => visitor.visitSimpleFormalParameter(this); 8611 accept(ASTVisitor visitor) => visitor.visitSimpleFormalParameter(this);
7905 Token get beginToken { 8612 Token get beginToken {
7906 if (_keyword != null) { 8613 if (_keyword != null) {
7907 return _keyword; 8614 return _keyword;
7908 } else if (_type != null) { 8615 } else if (_type != null) {
7909 return _type.beginToken; 8616 return _type.beginToken;
7910 } 8617 }
7911 return identifier.beginToken; 8618 return identifier.beginToken;
7912 } 8619 }
7913 Token get endToken => identifier.endToken; 8620 Token get endToken => identifier.endToken;
7914 /** 8621 /**
7915 * Return the token representing either the 'final', 'const' or 'var' keyword. 8622 * Return the token representing either the 'final', 'const' or 'var' keyword.
7916 * @return the token representing either the 'final', 'const' or 'var' keyword 8623 * @return the token representing either the 'final', 'const' or 'var' keyword
7917 */ 8624 */
7918 Token get keyword => _keyword; 8625 Token get keyword => _keyword;
7919 /** 8626 /**
7920 * Return the name of the declared type of the parameter, or {@code null} if t he parameter does 8627 * Return the name of the declared type of the parameter, or {@code null} if t he parameter does
7921 * not have a declared type. 8628 * not have a declared type.
7922 * @return the name of the declared type of the parameter 8629 * @return the name of the declared type of the parameter
7923 */ 8630 */
7924 TypeName get type => _type; 8631 TypeName get type => _type;
7925 bool isConst() => (_keyword is KeywordToken) && (_keyword as KeywordToken).key word == Keyword.CONST; 8632 bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.CONST);
7926 bool isFinal() => (_keyword is KeywordToken) && (_keyword as KeywordToken).key word == Keyword.FINAL; 8633 bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.FINAL);
7927 /** 8634 /**
7928 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token. 8635 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
7929 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 8636 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
7930 */ 8637 */
7931 void set keyword16(Token keyword) { 8638 void set keyword(Token keyword15) {
7932 this._keyword = keyword; 8639 this._keyword = keyword15;
7933 } 8640 }
7934 /** 8641 /**
7935 * Set the name of the declared type of the parameter to the given type name. 8642 * Set the name of the declared type of the parameter to the given type name.
7936 * @param typeName the name of the declared type of the parameter 8643 * @param typeName the name of the declared type of the parameter
7937 */ 8644 */
7938 void set type6(TypeName typeName) { 8645 void set type(TypeName typeName) {
7939 _type = becomeParentOf(typeName); 8646 _type = becomeParentOf(typeName);
7940 } 8647 }
7941 void visitChildren(ASTVisitor<Object> visitor) { 8648 void visitChildren(ASTVisitor<Object> visitor) {
7942 super.visitChildren(visitor); 8649 super.visitChildren(visitor);
7943 safelyVisitChild(_type, visitor); 8650 safelyVisitChild(_type, visitor);
7944 safelyVisitChild(identifier, visitor); 8651 safelyVisitChild(identifier, visitor);
7945 } 8652 }
7946 } 8653 }
7947 /** 8654 /**
7948 * Instances of the class {@code SimpleIdentifier} represent a simple identifier . 8655 * Instances of the class {@code SimpleIdentifier} represent a simple identifier .
7949 * <pre> 8656 * <pre>
7950 * simpleIdentifier ::= 8657 * simpleIdentifier ::=
7951 * initialCharacter internalCharacter 8658 * initialCharacter internalCharacter
7952 * initialCharacter ::= '_' | '$' | letter 8659 * initialCharacter ::= '_' | '$' | letter
7953 * internalCharacter ::= '_' | '$' | letter | digit 8660 * internalCharacter ::= '_' | '$' | letter | digit
7954 * </pre> 8661 * </pre>
7955 */ 8662 */
7956 class SimpleIdentifier extends Identifier { 8663 class SimpleIdentifier extends Identifier {
7957 /** 8664 /**
7958 * The token representing the identifier. 8665 * The token representing the identifier.
7959 */ 8666 */
7960 Token _token; 8667 Token _token;
7961 /** 8668 /**
7962 * Initialize a newly created identifier. 8669 * Initialize a newly created identifier.
7963 * @param token the token representing the identifier 8670 * @param token the token representing the identifier
7964 */ 8671 */
7965 SimpleIdentifier(Token token) { 8672 SimpleIdentifier.full(Token token) {
7966 this._token = token; 8673 this._token = token;
7967 } 8674 }
8675 /**
8676 * Initialize a newly created identifier.
8677 * @param token the token representing the identifier
8678 */
8679 SimpleIdentifier({Token token}) : this.full(token);
7968 accept(ASTVisitor visitor) => visitor.visitSimpleIdentifier(this); 8680 accept(ASTVisitor visitor) => visitor.visitSimpleIdentifier(this);
7969 Token get beginToken => _token; 8681 Token get beginToken => _token;
7970 Token get endToken => _token; 8682 Token get endToken => _token;
7971 String get name => _token.lexeme; 8683 String get name => _token.lexeme;
7972 /** 8684 /**
7973 * Return the token representing the identifier. 8685 * Return the token representing the identifier.
7974 * @return the token representing the identifier 8686 * @return the token representing the identifier
7975 */ 8687 */
7976 Token get token => _token; 8688 Token get token => _token;
7977 /** 8689 /**
7978 * Return {@code true} if this expression is computing a right-hand value. 8690 * Return {@code true} if this expression is computing a right-hand value.
7979 * <p> 8691 * <p>
7980 * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are 8692 * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are
7981 * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node. 8693 * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node.
7982 * @return {@code true} if this expression is in a context where a getter will be invoked 8694 * @return {@code true} if this expression is in a context where a getter will be invoked
7983 */ 8695 */
7984 bool inGetterContext() { 8696 bool inGetterContext() {
7985 ASTNode parent7 = parent; 8697 ASTNode parent6 = parent;
7986 ASTNode target = this; 8698 ASTNode target = this;
7987 if (parent7 is PrefixedIdentifier) { 8699 if (parent6 is PrefixedIdentifier) {
7988 PrefixedIdentifier prefixed = parent7 as PrefixedIdentifier; 8700 PrefixedIdentifier prefixed = (parent6 as PrefixedIdentifier);
7989 if (prefixed.identifier != this) { 8701 if (identical(prefixed.prefix, this)) {
7990 return false; 8702 return true;
7991 } 8703 }
7992 parent7 = prefixed.parent; 8704 parent6 = prefixed.parent;
7993 target = prefixed; 8705 target = prefixed;
7994 } 8706 }
7995 if (parent7 is AssignmentExpression) { 8707 if (parent6 is AssignmentExpression) {
7996 AssignmentExpression expr = parent7 as AssignmentExpression; 8708 AssignmentExpression expr = (parent6 as AssignmentExpression);
7997 if (expr.leftHandSide == target && expr.operator.type == TokenType.EQ) { 8709 if (identical(expr.leftHandSide, target) && identical(expr.operator.type, TokenType.EQ)) {
7998 return false; 8710 return false;
7999 } 8711 }
8000 } 8712 }
8001 return true; 8713 return true;
8002 } 8714 }
8003 /** 8715 /**
8004 * Return {@code true} if this expression is computing a left-hand value. 8716 * Return {@code true} if this expression is computing a left-hand value.
8005 * <p> 8717 * <p>
8006 * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are 8718 * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are
8007 * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node. 8719 * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node.
8008 * @return {@code true} if this expression is in a context where a setter will be invoked 8720 * @return {@code true} if this expression is in a context where a setter will be invoked
8009 */ 8721 */
8010 bool inSetterContext() { 8722 bool inSetterContext() {
8011 ASTNode parent8 = parent; 8723 ASTNode parent7 = parent;
8012 ASTNode target = this; 8724 ASTNode target = this;
8013 if (parent8 is PrefixedIdentifier) { 8725 if (parent7 is PrefixedIdentifier) {
8014 PrefixedIdentifier prefixed = parent8 as PrefixedIdentifier; 8726 PrefixedIdentifier prefixed = (parent7 as PrefixedIdentifier);
8015 if (prefixed.identifier != this) { 8727 if (identical(prefixed.prefix, this)) {
8016 return false; 8728 return false;
8017 } 8729 }
8018 parent8 = prefixed.parent; 8730 parent7 = prefixed.parent;
8019 target = prefixed; 8731 target = prefixed;
8020 } 8732 }
8021 if (parent8 is PrefixExpression) { 8733 if (parent7 is PrefixExpression) {
8022 return (parent8 as PrefixExpression).operator.type.isIncrementOperator(); 8734 return ((parent7 as PrefixExpression)).operator.type.isIncrementOperator() ;
8023 } else if (parent8 is PostfixExpression) { 8735 } else if (parent7 is PostfixExpression) {
8024 return true; 8736 return true;
8025 } else if (parent8 is AssignmentExpression) { 8737 } else if (parent7 is AssignmentExpression) {
8026 return (parent8 as AssignmentExpression).leftHandSide == target; 8738 return identical(((parent7 as AssignmentExpression)).leftHandSide, target) ;
8027 } 8739 }
8028 return false; 8740 return false;
8029 } 8741 }
8030 bool isSynthetic() => _token.isSynthetic(); 8742 bool isSynthetic() => _token.isSynthetic();
8031 /** 8743 /**
8032 * Set the token representing the identifier to the given token. 8744 * Set the token representing the identifier to the given token.
8033 * @param token the token representing the literal 8745 * @param token the token representing the literal
8034 */ 8746 */
8035 void set token12(Token token) { 8747 void set token(Token token12) {
8036 this._token = token; 8748 this._token = token12;
8037 } 8749 }
8038 void visitChildren(ASTVisitor<Object> visitor) { 8750 void visitChildren(ASTVisitor<Object> visitor) {
8039 } 8751 }
8040 } 8752 }
8041 /** 8753 /**
8042 * Instances of the class {@code SimpleStringLiteral} represent a string literal expression that 8754 * Instances of the class {@code SimpleStringLiteral} represent a string literal expression that
8043 * does not contain any interpolations. 8755 * does not contain any interpolations.
8044 * <pre> 8756 * <pre>
8045 * simpleStringLiteral ::= 8757 * simpleStringLiteral ::=
8046 * rawStringLiteral 8758 * rawStringLiteral
(...skipping 18 matching lines...) Expand all
8065 Token _literal; 8777 Token _literal;
8066 /** 8778 /**
8067 * The value of the literal. 8779 * The value of the literal.
8068 */ 8780 */
8069 String _value; 8781 String _value;
8070 /** 8782 /**
8071 * Initialize a newly created simple string literal. 8783 * Initialize a newly created simple string literal.
8072 * @param literal the token representing the literal 8784 * @param literal the token representing the literal
8073 * @param value the value of the literal 8785 * @param value the value of the literal
8074 */ 8786 */
8075 SimpleStringLiteral(Token literal, String value) { 8787 SimpleStringLiteral.full(Token literal, String value) {
8076 this._literal = literal; 8788 this._literal = literal;
8077 this._value = value; 8789 this._value = value;
8078 } 8790 }
8791 /**
8792 * Initialize a newly created simple string literal.
8793 * @param literal the token representing the literal
8794 * @param value the value of the literal
8795 */
8796 SimpleStringLiteral({Token literal, String value}) : this.full(literal, value) ;
8079 accept(ASTVisitor visitor) => visitor.visitSimpleStringLiteral(this); 8797 accept(ASTVisitor visitor) => visitor.visitSimpleStringLiteral(this);
8080 Token get beginToken => _literal; 8798 Token get beginToken => _literal;
8081 Token get endToken => _literal; 8799 Token get endToken => _literal;
8082 /** 8800 /**
8083 * Return the token representing the literal. 8801 * Return the token representing the literal.
8084 * @return the token representing the literal 8802 * @return the token representing the literal
8085 */ 8803 */
8086 Token get literal => _literal; 8804 Token get literal => _literal;
8087 /** 8805 /**
8088 * Return the value of the literal. 8806 * Return the value of the literal.
8089 * @return the value of the literal 8807 * @return the value of the literal
8090 */ 8808 */
8091 String get value => _value; 8809 String get value => _value;
8092 /** 8810 /**
8093 * Return {@code true} if this string literal is a multi-line string. 8811 * Return {@code true} if this string literal is a multi-line string.
8094 * @return {@code true} if this string literal is a multi-line string 8812 * @return {@code true} if this string literal is a multi-line string
8095 */ 8813 */
8096 bool isMultiline() { 8814 bool isMultiline() {
8097 if (_value.length < 6) { 8815 if (_value.length < 6) {
8098 return false; 8816 return false;
8099 } 8817 }
8100 return _value.endsWith("\"\"\"") || _value.endsWith("'''"); 8818 return _value.endsWith("\"\"\"") || _value.endsWith("'''");
8101 } 8819 }
8102 /** 8820 /**
8103 * Return {@code true} if this string literal is a raw string. 8821 * Return {@code true} if this string literal is a raw string.
8104 * @return {@code true} if this string literal is a raw string 8822 * @return {@code true} if this string literal is a raw string
8105 */ 8823 */
8106 bool isRaw() => _value.charCodeAt(0) == 0x40; 8824 bool isRaw() => _value.codeUnitAt(0) == 0x40;
8107 bool isSynthetic() => _literal.isSynthetic(); 8825 bool isSynthetic() => _literal.isSynthetic();
8108 /** 8826 /**
8109 * Set the token representing the literal to the given token. 8827 * Set the token representing the literal to the given token.
8110 * @param literal the token representing the literal 8828 * @param literal the token representing the literal
8111 */ 8829 */
8112 void set literal6(Token literal) { 8830 void set literal(Token literal6) {
8113 this._literal = literal; 8831 this._literal = literal6;
8114 } 8832 }
8115 /** 8833 /**
8116 * Set the value of the literal to the given string. 8834 * Set the value of the literal to the given string.
8117 * @param string the value of the literal 8835 * @param string the value of the literal
8118 */ 8836 */
8119 void set value9(String string) { 8837 void set value(String string) {
8120 _value = string; 8838 _value = string;
8121 } 8839 }
8122 void visitChildren(ASTVisitor<Object> visitor) { 8840 void visitChildren(ASTVisitor<Object> visitor) {
8123 } 8841 }
8124 } 8842 }
8125 /** 8843 /**
8126 * Instances of the class {@code Statement} defines the behavior common to nodes that represent a 8844 * Instances of the class {@code Statement} defines the behavior common to nodes that represent a
8127 * statement. 8845 * statement.
8128 * <pre> 8846 * <pre>
8129 * 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> 8847 * 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>
(...skipping 10 matching lines...) Expand all
8140 */ 8858 */
8141 class StringInterpolation extends StringLiteral { 8859 class StringInterpolation extends StringLiteral {
8142 /** 8860 /**
8143 * The elements that will be composed to produce the resulting string. 8861 * The elements that will be composed to produce the resulting string.
8144 */ 8862 */
8145 NodeList<InterpolationElement> _elements; 8863 NodeList<InterpolationElement> _elements;
8146 /** 8864 /**
8147 * Initialize a newly created string interpolation expression. 8865 * Initialize a newly created string interpolation expression.
8148 * @param elements the elements that will be composed to produce the resulting string 8866 * @param elements the elements that will be composed to produce the resulting string
8149 */ 8867 */
8150 StringInterpolation(List<InterpolationElement> elements) { 8868 StringInterpolation.full(List<InterpolationElement> elements) {
8151 this._elements = new NodeList<InterpolationElement>(this); 8869 this._elements = new NodeList<InterpolationElement>(this);
8152 this._elements.addAll(elements); 8870 this._elements.addAll(elements);
8153 } 8871 }
8872 /**
8873 * Initialize a newly created string interpolation expression.
8874 * @param elements the elements that will be composed to produce the resulting string
8875 */
8876 StringInterpolation({List<InterpolationElement> elements}) : this.full(element s);
8154 accept(ASTVisitor visitor) => visitor.visitStringInterpolation(this); 8877 accept(ASTVisitor visitor) => visitor.visitStringInterpolation(this);
8155 Token get beginToken => _elements.beginToken; 8878 Token get beginToken => _elements.beginToken;
8156 /** 8879 /**
8157 * Return the elements that will be composed to produce the resulting string. 8880 * Return the elements that will be composed to produce the resulting string.
8158 * @return the elements that will be composed to produce the resulting string 8881 * @return the elements that will be composed to produce the resulting string
8159 */ 8882 */
8160 NodeList<InterpolationElement> get elements => _elements; 8883 NodeList<InterpolationElement> get elements => _elements;
8161 Token get endToken => _elements.endToken; 8884 Token get endToken => _elements.endToken;
8162 void visitChildren(ASTVisitor<Object> visitor) { 8885 void visitChildren(ASTVisitor<Object> visitor) {
8163 _elements.accept(visitor); 8886 _elements.accept(visitor);
(...skipping 25 matching lines...) Expand all
8189 /** 8912 /**
8190 * The name of the constructor that is being invoked, or {@code null} if the u nnamed constructor 8913 * The name of the constructor that is being invoked, or {@code null} if the u nnamed constructor
8191 * is being invoked. 8914 * is being invoked.
8192 */ 8915 */
8193 SimpleIdentifier _constructorName; 8916 SimpleIdentifier _constructorName;
8194 /** 8917 /**
8195 * The list of arguments to the constructor. 8918 * The list of arguments to the constructor.
8196 */ 8919 */
8197 ArgumentList _argumentList; 8920 ArgumentList _argumentList;
8198 /** 8921 /**
8922 * The element associated with the constructor, or {@code null} if the AST str ucture has not been
8923 * resolved or if the constructor could not be resolved.
8924 */
8925 ConstructorElement _element;
8926 /**
8199 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given 8927 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given
8200 * name with the given arguments. 8928 * name with the given arguments.
8201 * @param keyword the token for the 'super' keyword 8929 * @param keyword the token for the 'super' keyword
8202 * @param period the token for the period before the name of the constructor t hat is being invoked 8930 * @param period the token for the period before the name of the constructor t hat is being invoked
8203 * @param constructorName the name of the constructor that is being invoked 8931 * @param constructorName the name of the constructor that is being invoked
8204 * @param argumentList the list of arguments to the constructor 8932 * @param argumentList the list of arguments to the constructor
8205 */ 8933 */
8206 SuperConstructorInvocation(Token keyword, Token period, SimpleIdentifier const ructorName, ArgumentList argumentList) { 8934 SuperConstructorInvocation.full(Token keyword, Token period, SimpleIdentifier constructorName, ArgumentList argumentList) {
8207 this._keyword = keyword; 8935 this._keyword = keyword;
8208 this._period = period; 8936 this._period = period;
8209 this._constructorName = becomeParentOf(constructorName); 8937 this._constructorName = becomeParentOf(constructorName);
8210 this._argumentList = becomeParentOf(argumentList); 8938 this._argumentList = becomeParentOf(argumentList);
8211 } 8939 }
8940 /**
8941 * Initialize a newly created super invocation to invoke the inherited constru ctor with the given
8942 * name with the given arguments.
8943 * @param keyword the token for the 'super' keyword
8944 * @param period the token for the period before the name of the constructor t hat is being invoked
8945 * @param constructorName the name of the constructor that is being invoked
8946 * @param argumentList the list of arguments to the constructor
8947 */
8948 SuperConstructorInvocation({Token keyword, Token period, SimpleIdentifier cons tructorName, ArgumentList argumentList}) : this.full(keyword, period, constructo rName, argumentList);
8212 accept(ASTVisitor visitor) => visitor.visitSuperConstructorInvocation(this); 8949 accept(ASTVisitor visitor) => visitor.visitSuperConstructorInvocation(this);
8213 /** 8950 /**
8214 * Return the list of arguments to the constructor. 8951 * Return the list of arguments to the constructor.
8215 * @return the list of arguments to the constructor 8952 * @return the list of arguments to the constructor
8216 */ 8953 */
8217 ArgumentList get argumentList => _argumentList; 8954 ArgumentList get argumentList => _argumentList;
8218 Token get beginToken => _keyword; 8955 Token get beginToken => _keyword;
8219 /** 8956 /**
8220 * Return the name of the constructor that is being invoked, or {@code null} i f the unnamed 8957 * Return the name of the constructor that is being invoked, or {@code null} i f the unnamed
8221 * constructor is being invoked. 8958 * constructor is being invoked.
8222 * @return the name of the constructor that is being invoked 8959 * @return the name of the constructor that is being invoked
8223 */ 8960 */
8224 SimpleIdentifier get constructorName => _constructorName; 8961 SimpleIdentifier get constructorName => _constructorName;
8962 /**
8963 * Return the element associated with the constructor, or {@code null} if the AST structure has
8964 * not been resolved or if the constructor could not be resolved.
8965 * @return the element associated with the super constructor
8966 */
8967 ConstructorElement get element => _element;
8225 Token get endToken => _argumentList.endToken; 8968 Token get endToken => _argumentList.endToken;
8226 /** 8969 /**
8227 * Return the token for the 'super' keyword. 8970 * Return the token for the 'super' keyword.
8228 * @return the token for the 'super' keyword 8971 * @return the token for the 'super' keyword
8229 */ 8972 */
8230 Token get keyword => _keyword; 8973 Token get keyword => _keyword;
8231 /** 8974 /**
8232 * 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. 8975 * 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.
8233 * @return the token for the period before the name of the constructor that is being invoked 8976 * @return the token for the period before the name of the constructor that is being invoked
8234 */ 8977 */
8235 Token get period => _period; 8978 Token get period => _period;
8236 /** 8979 /**
8237 * Set the list of arguments to the constructor to the given list. 8980 * Set the list of arguments to the constructor to the given list.
8238 * @param argumentList the list of arguments to the constructor 8981 * @param argumentList the list of arguments to the constructor
8239 */ 8982 */
8240 void set argumentList9(ArgumentList argumentList) { 8983 void set argumentList(ArgumentList argumentList9) {
8241 this._argumentList = becomeParentOf(argumentList); 8984 this._argumentList = becomeParentOf(argumentList9);
8242 } 8985 }
8243 /** 8986 /**
8244 * Set the name of the constructor that is being invoked to the given identifi er. 8987 * Set the name of the constructor that is being invoked to the given identifi er.
8245 * @param identifier the name of the constructor that is being invoked 8988 * @param identifier the name of the constructor that is being invoked
8246 */ 8989 */
8247 void set constructorName5(SimpleIdentifier identifier) { 8990 void set constructorName(SimpleIdentifier identifier) {
8248 _constructorName = becomeParentOf(identifier); 8991 _constructorName = becomeParentOf(identifier);
8249 } 8992 }
8250 /** 8993 /**
8994 * Set the element associated with the constructor to the given element.
8995 * @param element the element associated with the constructor
8996 */
8997 void set element(ConstructorElement element17) {
8998 this._element = element17;
8999 }
9000 /**
8251 * Set the token for the 'super' keyword to the given token. 9001 * Set the token for the 'super' keyword to the given token.
8252 * @param keyword the token for the 'super' keyword 9002 * @param keyword the token for the 'super' keyword
8253 */ 9003 */
8254 void set keyword17(Token keyword) { 9004 void set keyword(Token keyword16) {
8255 this._keyword = keyword; 9005 this._keyword = keyword16;
8256 } 9006 }
8257 /** 9007 /**
8258 * Set the token for the period before the name of the constructor that is bei ng invoked to the 9008 * Set the token for the period before the name of the constructor that is bei ng invoked to the
8259 * given token. 9009 * given token.
8260 * @param period the token for the period before the name of the constructor t hat is being invoked 9010 * @param period the token for the period before the name of the constructor t hat is being invoked
8261 */ 9011 */
8262 void set period11(Token period) { 9012 void set period(Token period12) {
8263 this._period = period; 9013 this._period = period12;
8264 } 9014 }
8265 void visitChildren(ASTVisitor<Object> visitor) { 9015 void visitChildren(ASTVisitor<Object> visitor) {
8266 safelyVisitChild(_constructorName, visitor); 9016 safelyVisitChild(_constructorName, visitor);
8267 safelyVisitChild(_argumentList, visitor); 9017 safelyVisitChild(_argumentList, visitor);
8268 } 9018 }
8269 } 9019 }
8270 /** 9020 /**
8271 * Instances of the class {@code SuperExpression} represent a super expression. 9021 * Instances of the class {@code SuperExpression} represent a super expression.
8272 * <pre> 9022 * <pre>
8273 * superExpression ::= 9023 * superExpression ::=
8274 * 'super' 9024 * 'super'
8275 * </pre> 9025 * </pre>
8276 */ 9026 */
8277 class SuperExpression extends Expression { 9027 class SuperExpression extends Expression {
8278 /** 9028 /**
8279 * The token representing the keyword. 9029 * The token representing the keyword.
8280 */ 9030 */
8281 Token _keyword; 9031 Token _keyword;
8282 /** 9032 /**
8283 * Initialize a newly created super expression. 9033 * Initialize a newly created super expression.
8284 * @param keyword the token representing the keyword 9034 * @param keyword the token representing the keyword
8285 */ 9035 */
8286 SuperExpression(Token keyword) { 9036 SuperExpression.full(Token keyword) {
8287 this._keyword = keyword; 9037 this._keyword = keyword;
8288 } 9038 }
9039 /**
9040 * Initialize a newly created super expression.
9041 * @param keyword the token representing the keyword
9042 */
9043 SuperExpression({Token keyword}) : this.full(keyword);
8289 accept(ASTVisitor visitor) => visitor.visitSuperExpression(this); 9044 accept(ASTVisitor visitor) => visitor.visitSuperExpression(this);
8290 Token get beginToken => _keyword; 9045 Token get beginToken => _keyword;
8291 Token get endToken => _keyword; 9046 Token get endToken => _keyword;
8292 /** 9047 /**
8293 * Return the token representing the keyword. 9048 * Return the token representing the keyword.
8294 * @return the token representing the keyword 9049 * @return the token representing the keyword
8295 */ 9050 */
8296 Token get keyword => _keyword; 9051 Token get keyword => _keyword;
8297 /** 9052 /**
8298 * Set the token representing the keyword to the given token. 9053 * Set the token representing the keyword to the given token.
8299 * @param keyword the token representing the keyword 9054 * @param keyword the token representing the keyword
8300 */ 9055 */
8301 void set keyword18(Token keyword) { 9056 void set keyword(Token keyword17) {
8302 this._keyword = keyword; 9057 this._keyword = keyword17;
8303 } 9058 }
8304 void visitChildren(ASTVisitor<Object> visitor) { 9059 void visitChildren(ASTVisitor<Object> visitor) {
8305 } 9060 }
8306 } 9061 }
8307 /** 9062 /**
8308 * Instances of the class {@code SwitchCase} represent the case in a switch stat ement. 9063 * Instances of the class {@code SwitchCase} represent the case in a switch stat ement.
8309 * <pre> 9064 * <pre>
8310 * switchCase ::={@link SimpleIdentifier label}* 'case' {@link Expression expres sion} ':' {@link Statement statement}</pre> 9065 * switchCase ::={@link SimpleIdentifier label}* 'case' {@link Expression expres sion} ':' {@link Statement statement}</pre>
8311 */ 9066 */
8312 class SwitchCase extends SwitchMember { 9067 class SwitchCase extends SwitchMember {
8313 /** 9068 /**
8314 * The expression controlling whether the statements will be executed. 9069 * The expression controlling whether the statements will be executed.
8315 */ 9070 */
8316 Expression _expression; 9071 Expression _expression;
8317 /** 9072 /**
8318 * Initialize a newly created switch case. 9073 * Initialize a newly created switch case.
8319 * @param labels the labels associated with the switch member 9074 * @param labels the labels associated with the switch member
8320 * @param keyword the token representing the 'case' or 'default' keyword 9075 * @param keyword the token representing the 'case' or 'default' keyword
8321 * @param expression the expression controlling whether the statements will be executed 9076 * @param expression the expression controlling whether the statements will be executed
8322 * @param colon the colon separating the keyword or the expression from the st atements 9077 * @param colon the colon separating the keyword or the expression from the st atements
8323 * @param statements the statements that will be executed if this switch membe r is selected 9078 * @param statements the statements that will be executed if this switch membe r is selected
8324 */ 9079 */
8325 SwitchCase(List<Label> labels, Token keyword, Expression expression, Token col on, List<Statement> statements) : super(labels, keyword, colon, statements) { 9080 SwitchCase.full(List<Label> labels, Token keyword, Expression expression, Toke n colon, List<Statement> statements) : super.full(labels, keyword, colon, statem ents) {
8326 this._expression = becomeParentOf(expression); 9081 this._expression = becomeParentOf(expression);
8327 } 9082 }
9083 /**
9084 * Initialize a newly created switch case.
9085 * @param labels the labels associated with the switch member
9086 * @param keyword the token representing the 'case' or 'default' keyword
9087 * @param expression the expression controlling whether the statements will be executed
9088 * @param colon the colon separating the keyword or the expression from the st atements
9089 * @param statements the statements that will be executed if this switch membe r is selected
9090 */
9091 SwitchCase({List<Label> labels, Token keyword, Expression expression, Token co lon, List<Statement> statements}) : this.full(labels, keyword, expression, colon , statements);
8328 accept(ASTVisitor visitor) => visitor.visitSwitchCase(this); 9092 accept(ASTVisitor visitor) => visitor.visitSwitchCase(this);
8329 /** 9093 /**
8330 * Return the expression controlling whether the statements will be executed. 9094 * Return the expression controlling whether the statements will be executed.
8331 * @return the expression controlling whether the statements will be executed 9095 * @return the expression controlling whether the statements will be executed
8332 */ 9096 */
8333 Expression get expression => _expression; 9097 Expression get expression => _expression;
8334 /** 9098 /**
8335 * Set the expression controlling whether the statements will be executed to t he given expression. 9099 * Set the expression controlling whether the statements will be executed to t he given expression.
8336 * @param expression the expression controlling whether the statements will be executed 9100 * @param expression the expression controlling whether the statements will be executed
8337 */ 9101 */
8338 void set expression11(Expression expression) { 9102 void set expression(Expression expression11) {
8339 this._expression = becomeParentOf(expression); 9103 this._expression = becomeParentOf(expression11);
8340 } 9104 }
8341 void visitChildren(ASTVisitor<Object> visitor) { 9105 void visitChildren(ASTVisitor<Object> visitor) {
8342 labels.accept(visitor); 9106 labels.accept(visitor);
8343 safelyVisitChild(_expression, visitor); 9107 safelyVisitChild(_expression, visitor);
8344 statements.accept(visitor); 9108 statements.accept(visitor);
8345 } 9109 }
8346 } 9110 }
8347 /** 9111 /**
8348 * Instances of the class {@code SwitchDefault} represent the default case in a switch statement. 9112 * Instances of the class {@code SwitchDefault} represent the default case in a switch statement.
8349 * <pre> 9113 * <pre>
8350 * switchDefault ::={@link SimpleIdentifier label}* 'default' ':' {@link Stateme nt statement}</pre> 9114 * switchDefault ::={@link SimpleIdentifier label}* 'default' ':' {@link Stateme nt statement}</pre>
8351 */ 9115 */
8352 class SwitchDefault extends SwitchMember { 9116 class SwitchDefault extends SwitchMember {
8353 /** 9117 /**
8354 * Initialize a newly created switch default. 9118 * Initialize a newly created switch default.
8355 * @param labels the labels associated with the switch member 9119 * @param labels the labels associated with the switch member
8356 * @param keyword the token representing the 'case' or 'default' keyword 9120 * @param keyword the token representing the 'case' or 'default' keyword
8357 * @param colon the colon separating the keyword or the expression from the st atements 9121 * @param colon the colon separating the keyword or the expression from the st atements
8358 * @param statements the statements that will be executed if this switch membe r is selected 9122 * @param statements the statements that will be executed if this switch membe r is selected
8359 */ 9123 */
8360 SwitchDefault(List<Label> labels, Token keyword, Token colon, List<Statement> statements) : super(labels, keyword, colon, statements) { 9124 SwitchDefault.full(List<Label> labels, Token keyword, Token colon, List<Statem ent> statements) : super.full(labels, keyword, colon, statements) {
8361 } 9125 }
9126 /**
9127 * Initialize a newly created switch default.
9128 * @param labels the labels associated with the switch member
9129 * @param keyword the token representing the 'case' or 'default' keyword
9130 * @param colon the colon separating the keyword or the expression from the st atements
9131 * @param statements the statements that will be executed if this switch membe r is selected
9132 */
9133 SwitchDefault({List<Label> labels, Token keyword, Token colon, List<Statement> statements}) : this.full(labels, keyword, colon, statements);
8362 accept(ASTVisitor visitor) => visitor.visitSwitchDefault(this); 9134 accept(ASTVisitor visitor) => visitor.visitSwitchDefault(this);
8363 void visitChildren(ASTVisitor<Object> visitor) { 9135 void visitChildren(ASTVisitor<Object> visitor) {
8364 labels.accept(visitor); 9136 labels.accept(visitor);
8365 statements.accept(visitor); 9137 statements.accept(visitor);
8366 } 9138 }
8367 } 9139 }
8368 /** 9140 /**
8369 * The abstract class {@code SwitchMember} defines the behavior common to object s representing 9141 * The abstract class {@code SwitchMember} defines the behavior common to object s representing
8370 * elements within a switch statement. 9142 * elements within a switch statement.
8371 * <pre> 9143 * <pre>
(...skipping 19 matching lines...) Expand all
8391 * The statements that will be executed if this switch member is selected. 9163 * The statements that will be executed if this switch member is selected.
8392 */ 9164 */
8393 NodeList<Statement> _statements; 9165 NodeList<Statement> _statements;
8394 /** 9166 /**
8395 * Initialize a newly created switch member. 9167 * Initialize a newly created switch member.
8396 * @param labels the labels associated with the switch member 9168 * @param labels the labels associated with the switch member
8397 * @param keyword the token representing the 'case' or 'default' keyword 9169 * @param keyword the token representing the 'case' or 'default' keyword
8398 * @param colon the colon separating the keyword or the expression from the st atements 9170 * @param colon the colon separating the keyword or the expression from the st atements
8399 * @param statements the statements that will be executed if this switch membe r is selected 9171 * @param statements the statements that will be executed if this switch membe r is selected
8400 */ 9172 */
8401 SwitchMember(List<Label> labels, Token keyword, Token colon, List<Statement> s tatements) { 9173 SwitchMember.full(List<Label> labels, Token keyword, Token colon, List<Stateme nt> statements) {
8402 this._labels = new NodeList<Label>(this); 9174 this._labels = new NodeList<Label>(this);
8403 this._statements = new NodeList<Statement>(this); 9175 this._statements = new NodeList<Statement>(this);
8404 this._labels.addAll(labels); 9176 this._labels.addAll(labels);
8405 this._keyword = keyword; 9177 this._keyword = keyword;
8406 this._colon = colon; 9178 this._colon = colon;
8407 this._statements.addAll(statements); 9179 this._statements.addAll(statements);
8408 } 9180 }
9181 /**
9182 * Initialize a newly created switch member.
9183 * @param labels the labels associated with the switch member
9184 * @param keyword the token representing the 'case' or 'default' keyword
9185 * @param colon the colon separating the keyword or the expression from the st atements
9186 * @param statements the statements that will be executed if this switch membe r is selected
9187 */
9188 SwitchMember({List<Label> labels, Token keyword, Token colon, List<Statement> statements}) : this.full(labels, keyword, colon, statements);
8409 Token get beginToken { 9189 Token get beginToken {
8410 if (!_labels.isEmpty) { 9190 if (!_labels.isEmpty) {
8411 return _labels.beginToken; 9191 return _labels.beginToken;
8412 } 9192 }
8413 return _keyword; 9193 return _keyword;
8414 } 9194 }
8415 /** 9195 /**
8416 * Return the colon separating the keyword or the expression from the statemen ts. 9196 * Return the colon separating the keyword or the expression from the statemen ts.
8417 * @return the colon separating the keyword or the expression from the stateme nts 9197 * @return the colon separating the keyword or the expression from the stateme nts
8418 */ 9198 */
(...skipping 16 matching lines...) Expand all
8435 NodeList<Label> get labels => _labels; 9215 NodeList<Label> get labels => _labels;
8436 /** 9216 /**
8437 * Return the statements that will be executed if this switch member is select ed. 9217 * Return the statements that will be executed if this switch member is select ed.
8438 * @return the statements that will be executed if this switch member is selec ted 9218 * @return the statements that will be executed if this switch member is selec ted
8439 */ 9219 */
8440 NodeList<Statement> get statements => _statements; 9220 NodeList<Statement> get statements => _statements;
8441 /** 9221 /**
8442 * Set the colon separating the keyword or the expression from the statements to the given token. 9222 * Set the colon separating the keyword or the expression from the statements to the given token.
8443 * @param colon the colon separating the keyword or the expression from the st atements 9223 * @param colon the colon separating the keyword or the expression from the st atements
8444 */ 9224 */
8445 void set colon4(Token colon) { 9225 void set colon(Token colon4) {
8446 this._colon = colon; 9226 this._colon = colon4;
8447 } 9227 }
8448 /** 9228 /**
8449 * Set the token representing the 'case' or 'default' keyword to the given tok en. 9229 * Set the token representing the 'case' or 'default' keyword to the given tok en.
8450 * @param keyword the token representing the 'case' or 'default' keyword 9230 * @param keyword the token representing the 'case' or 'default' keyword
8451 */ 9231 */
8452 void set keyword19(Token keyword) { 9232 void set keyword(Token keyword18) {
8453 this._keyword = keyword; 9233 this._keyword = keyword18;
8454 } 9234 }
8455 } 9235 }
8456 /** 9236 /**
8457 * Instances of the class {@code SwitchStatement} represent a switch statement. 9237 * Instances of the class {@code SwitchStatement} represent a switch statement.
8458 * <pre> 9238 * <pre>
8459 * switchStatement ::= 9239 * switchStatement ::=
8460 * 'switch' '(' {@link Expression expression} ')' '{' {@link SwitchCase switchCa se}* {@link SwitchDefault defaultCase}? '}' 9240 * 'switch' '(' {@link Expression expression} ')' '{' {@link SwitchCase switchCa se}* {@link SwitchDefault defaultCase}? '}'
8461 * </pre> 9241 * </pre>
8462 */ 9242 */
8463 class SwitchStatement extends Statement { 9243 class SwitchStatement extends Statement {
(...skipping 28 matching lines...) Expand all
8492 /** 9272 /**
8493 * Initialize a newly created switch statement. 9273 * Initialize a newly created switch statement.
8494 * @param keyword the token representing the 'switch' keyword 9274 * @param keyword the token representing the 'switch' keyword
8495 * @param leftParenthesis the left parenthesis 9275 * @param leftParenthesis the left parenthesis
8496 * @param expression the expression used to determine which of the switch memb ers will be selected 9276 * @param expression the expression used to determine which of the switch memb ers will be selected
8497 * @param rightParenthesis the right parenthesis 9277 * @param rightParenthesis the right parenthesis
8498 * @param leftBracket the left curly bracket 9278 * @param leftBracket the left curly bracket
8499 * @param members the switch members that can be selected by the expression 9279 * @param members the switch members that can be selected by the expression
8500 * @param rightBracket the right curly bracket 9280 * @param rightBracket the right curly bracket
8501 */ 9281 */
8502 SwitchStatement(Token keyword, Token leftParenthesis, Expression expression, T oken rightParenthesis, Token leftBracket, List<SwitchMember> members, Token righ tBracket) { 9282 SwitchStatement.full(Token keyword, Token leftParenthesis, Expression expressi on, Token rightParenthesis, Token leftBracket, List<SwitchMember> members, Token rightBracket) {
8503 this._members = new NodeList<SwitchMember>(this); 9283 this._members = new NodeList<SwitchMember>(this);
8504 this._keyword = keyword; 9284 this._keyword = keyword;
8505 this._leftParenthesis = leftParenthesis; 9285 this._leftParenthesis = leftParenthesis;
8506 this._expression = becomeParentOf(expression); 9286 this._expression = becomeParentOf(expression);
8507 this._rightParenthesis = rightParenthesis; 9287 this._rightParenthesis = rightParenthesis;
8508 this._leftBracket = leftBracket; 9288 this._leftBracket = leftBracket;
8509 this._members.addAll(members); 9289 this._members.addAll(members);
8510 this._rightBracket = rightBracket; 9290 this._rightBracket = rightBracket;
8511 } 9291 }
9292 /**
9293 * Initialize a newly created switch statement.
9294 * @param keyword the token representing the 'switch' keyword
9295 * @param leftParenthesis the left parenthesis
9296 * @param expression the expression used to determine which of the switch memb ers will be selected
9297 * @param rightParenthesis the right parenthesis
9298 * @param leftBracket the left curly bracket
9299 * @param members the switch members that can be selected by the expression
9300 * @param rightBracket the right curly bracket
9301 */
9302 SwitchStatement({Token keyword, Token leftParenthesis, Expression expression, Token rightParenthesis, Token leftBracket, List<SwitchMember> members, Token rig htBracket}) : this.full(keyword, leftParenthesis, expression, rightParenthesis, leftBracket, members, rightBracket);
8512 accept(ASTVisitor visitor) => visitor.visitSwitchStatement(this); 9303 accept(ASTVisitor visitor) => visitor.visitSwitchStatement(this);
8513 Token get beginToken => _keyword; 9304 Token get beginToken => _keyword;
8514 Token get endToken => _rightBracket; 9305 Token get endToken => _rightBracket;
8515 /** 9306 /**
8516 * Return the expression used to determine which of the switch members will be selected. 9307 * Return the expression used to determine which of the switch members will be selected.
8517 * @return the expression used to determine which of the switch members will b e selected 9308 * @return the expression used to determine which of the switch members will b e selected
8518 */ 9309 */
8519 Expression get expression => _expression; 9310 Expression get expression => _expression;
8520 /** 9311 /**
8521 * Return the token representing the 'switch' keyword. 9312 * Return the token representing the 'switch' keyword.
(...skipping 23 matching lines...) Expand all
8545 /** 9336 /**
8546 * Return the right parenthesis. 9337 * Return the right parenthesis.
8547 * @return the right parenthesis 9338 * @return the right parenthesis
8548 */ 9339 */
8549 Token get rightParenthesis => _rightParenthesis; 9340 Token get rightParenthesis => _rightParenthesis;
8550 /** 9341 /**
8551 * Set the expression used to determine which of the switch members will be se lected to the given 9342 * Set the expression used to determine which of the switch members will be se lected to the given
8552 * expression. 9343 * expression.
8553 * @param expression the expression used to determine which of the switch memb ers will be selected 9344 * @param expression the expression used to determine which of the switch memb ers will be selected
8554 */ 9345 */
8555 void set expression12(Expression expression) { 9346 void set expression(Expression expression12) {
8556 this._expression = becomeParentOf(expression); 9347 this._expression = becomeParentOf(expression12);
8557 } 9348 }
8558 /** 9349 /**
8559 * Set the token representing the 'switch' keyword to the given token. 9350 * Set the token representing the 'switch' keyword to the given token.
8560 * @param keyword the token representing the 'switch' keyword 9351 * @param keyword the token representing the 'switch' keyword
8561 */ 9352 */
8562 void set keyword20(Token keyword) { 9353 void set keyword(Token keyword19) {
8563 this._keyword = keyword; 9354 this._keyword = keyword19;
8564 } 9355 }
8565 /** 9356 /**
8566 * Set the left curly bracket to the given token. 9357 * Set the left curly bracket to the given token.
8567 * @param leftBracket the left curly bracket 9358 * @param leftBracket the left curly bracket
8568 */ 9359 */
8569 void set leftBracket8(Token leftBracket) { 9360 void set leftBracket(Token leftBracket7) {
8570 this._leftBracket = leftBracket; 9361 this._leftBracket = leftBracket7;
8571 } 9362 }
8572 /** 9363 /**
8573 * Set the left parenthesis to the given token. 9364 * Set the left parenthesis to the given token.
8574 * @param leftParenthesis the left parenthesis 9365 * @param leftParenthesis the left parenthesis
8575 */ 9366 */
8576 void set leftParenthesis11(Token leftParenthesis) { 9367 void set leftParenthesis(Token leftParenthesis6) {
8577 this._leftParenthesis = leftParenthesis; 9368 this._leftParenthesis = leftParenthesis6;
8578 } 9369 }
8579 /** 9370 /**
8580 * Set the right curly bracket to the given token. 9371 * Set the right curly bracket to the given token.
8581 * @param rightBracket the right curly bracket 9372 * @param rightBracket the right curly bracket
8582 */ 9373 */
8583 void set rightBracket8(Token rightBracket) { 9374 void set rightBracket(Token rightBracket7) {
8584 this._rightBracket = rightBracket; 9375 this._rightBracket = rightBracket7;
8585 } 9376 }
8586 /** 9377 /**
8587 * Set the right parenthesis to the given token. 9378 * Set the right parenthesis to the given token.
8588 * @param rightParenthesis the right parenthesis 9379 * @param rightParenthesis the right parenthesis
8589 */ 9380 */
8590 void set rightParenthesis11(Token rightParenthesis) { 9381 void set rightParenthesis(Token rightParenthesis6) {
8591 this._rightParenthesis = rightParenthesis; 9382 this._rightParenthesis = rightParenthesis6;
8592 } 9383 }
8593 void visitChildren(ASTVisitor<Object> visitor) { 9384 void visitChildren(ASTVisitor<Object> visitor) {
8594 safelyVisitChild(_expression, visitor); 9385 safelyVisitChild(_expression, visitor);
8595 _members.accept(visitor); 9386 _members.accept(visitor);
8596 } 9387 }
8597 } 9388 }
8598 /** 9389 /**
8599 * Instances of the class {@code ThisExpression} represent a this expression. 9390 * Instances of the class {@code ThisExpression} represent a this expression.
8600 * <pre> 9391 * <pre>
8601 * thisExpression ::= 9392 * thisExpression ::=
8602 * 'this' 9393 * 'this'
8603 * </pre> 9394 * </pre>
8604 */ 9395 */
8605 class ThisExpression extends Expression { 9396 class ThisExpression extends Expression {
8606 /** 9397 /**
8607 * The token representing the keyword. 9398 * The token representing the keyword.
8608 */ 9399 */
8609 Token _keyword; 9400 Token _keyword;
8610 /** 9401 /**
8611 * Initialize a newly created this expression. 9402 * Initialize a newly created this expression.
8612 * @param keyword the token representing the keyword 9403 * @param keyword the token representing the keyword
8613 */ 9404 */
8614 ThisExpression(Token keyword) { 9405 ThisExpression.full(Token keyword) {
8615 this._keyword = keyword; 9406 this._keyword = keyword;
8616 } 9407 }
9408 /**
9409 * Initialize a newly created this expression.
9410 * @param keyword the token representing the keyword
9411 */
9412 ThisExpression({Token keyword}) : this.full(keyword);
8617 accept(ASTVisitor visitor) => visitor.visitThisExpression(this); 9413 accept(ASTVisitor visitor) => visitor.visitThisExpression(this);
8618 Token get beginToken => _keyword; 9414 Token get beginToken => _keyword;
8619 Token get endToken => _keyword; 9415 Token get endToken => _keyword;
8620 /** 9416 /**
8621 * Return the token representing the keyword. 9417 * Return the token representing the keyword.
8622 * @return the token representing the keyword 9418 * @return the token representing the keyword
8623 */ 9419 */
8624 Token get keyword => _keyword; 9420 Token get keyword => _keyword;
8625 /** 9421 /**
8626 * Set the token representing the keyword to the given token. 9422 * Set the token representing the keyword to the given token.
8627 * @param keyword the token representing the keyword 9423 * @param keyword the token representing the keyword
8628 */ 9424 */
8629 void set keyword21(Token keyword) { 9425 void set keyword(Token keyword20) {
8630 this._keyword = keyword; 9426 this._keyword = keyword20;
8631 } 9427 }
8632 void visitChildren(ASTVisitor<Object> visitor) { 9428 void visitChildren(ASTVisitor<Object> visitor) {
8633 } 9429 }
8634 } 9430 }
8635 /** 9431 /**
8636 * Instances of the class {@code ThrowExpression} represent a throw expression. 9432 * Instances of the class {@code ThrowExpression} represent a throw expression.
8637 * <pre> 9433 * <pre>
8638 * throwExpression ::= 9434 * throwExpression ::=
8639 * 'throw' {@link Expression expression}? ';' 9435 * 'throw' {@link Expression expression}? ';'
8640 * </pre> 9436 * </pre>
8641 */ 9437 */
8642 class ThrowExpression extends Expression { 9438 class ThrowExpression extends Expression {
8643 /** 9439 /**
8644 * The token representing the 'throw' keyword. 9440 * The token representing the 'throw' keyword.
8645 */ 9441 */
8646 Token _keyword; 9442 Token _keyword;
8647 /** 9443 /**
8648 * The expression computing the exception to be thrown, or {@code null} if the current exception 9444 * The expression computing the exception to be thrown, or {@code null} if the current exception
8649 * is to be re-thrown. (The latter case can only occur if the throw statement is inside a catch 9445 * is to be re-thrown. (The latter case can only occur if the throw statement is inside a catch
8650 * clause.) 9446 * clause.)
8651 */ 9447 */
8652 Expression _expression; 9448 Expression _expression;
8653 /** 9449 /**
8654 * Initialize a newly created throw expression. 9450 * Initialize a newly created throw expression.
8655 * @param keyword the token representing the 'throw' keyword 9451 * @param keyword the token representing the 'throw' keyword
8656 * @param expression the expression computing the exception to be thrown 9452 * @param expression the expression computing the exception to be thrown
8657 */ 9453 */
8658 ThrowExpression(Token keyword, Expression expression) { 9454 ThrowExpression.full(Token keyword, Expression expression) {
8659 this._keyword = keyword; 9455 this._keyword = keyword;
8660 this._expression = becomeParentOf(expression); 9456 this._expression = becomeParentOf(expression);
8661 } 9457 }
9458 /**
9459 * Initialize a newly created throw expression.
9460 * @param keyword the token representing the 'throw' keyword
9461 * @param expression the expression computing the exception to be thrown
9462 */
9463 ThrowExpression({Token keyword, Expression expression}) : this.full(keyword, e xpression);
8662 accept(ASTVisitor visitor) => visitor.visitThrowExpression(this); 9464 accept(ASTVisitor visitor) => visitor.visitThrowExpression(this);
8663 Token get beginToken => _keyword; 9465 Token get beginToken => _keyword;
8664 Token get endToken { 9466 Token get endToken {
8665 if (_expression != null) { 9467 if (_expression != null) {
8666 return _expression.endToken; 9468 return _expression.endToken;
8667 } 9469 }
8668 return _keyword; 9470 return _keyword;
8669 } 9471 }
8670 /** 9472 /**
8671 * Return the expression computing the exception to be thrown, or {@code null} if the current 9473 * Return the expression computing the exception to be thrown, or {@code null} if the current
8672 * exception is to be re-thrown. (The latter case can only occur if the throw statement is inside 9474 * exception is to be re-thrown. (The latter case can only occur if the throw statement is inside
8673 * a catch clause.) 9475 * a catch clause.)
8674 * @return the expression computing the exception to be thrown 9476 * @return the expression computing the exception to be thrown
8675 */ 9477 */
8676 Expression get expression => _expression; 9478 Expression get expression => _expression;
8677 /** 9479 /**
8678 * Return the token representing the 'throw' keyword. 9480 * Return the token representing the 'throw' keyword.
8679 * @return the token representing the 'throw' keyword 9481 * @return the token representing the 'throw' keyword
8680 */ 9482 */
8681 Token get keyword => _keyword; 9483 Token get keyword => _keyword;
8682 /** 9484 /**
8683 * Set the expression computing the exception to be thrown to the given expres sion. 9485 * Set the expression computing the exception to be thrown to the given expres sion.
8684 * @param expression the expression computing the exception to be thrown 9486 * @param expression the expression computing the exception to be thrown
8685 */ 9487 */
8686 void set expression13(Expression expression) { 9488 void set expression(Expression expression13) {
8687 this._expression = becomeParentOf(expression); 9489 this._expression = becomeParentOf(expression13);
8688 } 9490 }
8689 /** 9491 /**
8690 * Set the token representing the 'throw' keyword to the given token. 9492 * Set the token representing the 'throw' keyword to the given token.
8691 * @param keyword the token representing the 'throw' keyword 9493 * @param keyword the token representing the 'throw' keyword
8692 */ 9494 */
8693 void set keyword22(Token keyword) { 9495 void set keyword(Token keyword21) {
8694 this._keyword = keyword; 9496 this._keyword = keyword21;
8695 } 9497 }
8696 void visitChildren(ASTVisitor<Object> visitor) { 9498 void visitChildren(ASTVisitor<Object> visitor) {
8697 safelyVisitChild(_expression, visitor); 9499 safelyVisitChild(_expression, visitor);
8698 } 9500 }
8699 } 9501 }
8700 /** 9502 /**
8701 * Instances of the class {@code TopLevelVariableDeclaration} represent the decl aration of one or 9503 * Instances of the class {@code TopLevelVariableDeclaration} represent the decl aration of one or
8702 * more top-level variables of the same type. 9504 * more top-level variables of the same type.
8703 * <pre> 9505 * <pre>
8704 * topLevelVariableDeclaration ::= 9506 * topLevelVariableDeclaration ::=
(...skipping 10 matching lines...) Expand all
8715 * The semicolon terminating the declaration. 9517 * The semicolon terminating the declaration.
8716 */ 9518 */
8717 Token _semicolon; 9519 Token _semicolon;
8718 /** 9520 /**
8719 * Initialize a newly created top-level variable declaration. 9521 * Initialize a newly created top-level variable declaration.
8720 * @param comment the documentation comment associated with this variable 9522 * @param comment the documentation comment associated with this variable
8721 * @param metadata the annotations associated with this variable 9523 * @param metadata the annotations associated with this variable
8722 * @param variableList the top-level variables being declared 9524 * @param variableList the top-level variables being declared
8723 * @param semicolon the semicolon terminating the declaration 9525 * @param semicolon the semicolon terminating the declaration
8724 */ 9526 */
8725 TopLevelVariableDeclaration(Comment comment, List<Annotation> metadata, Variab leDeclarationList variableList, Token semicolon) : super(comment, metadata) { 9527 TopLevelVariableDeclaration.full(Comment comment, List<Annotation> metadata, V ariableDeclarationList variableList, Token semicolon) : super.full(comment, meta data) {
8726 this._variableList = becomeParentOf(variableList); 9528 this._variableList = becomeParentOf(variableList);
8727 this._semicolon = semicolon; 9529 this._semicolon = semicolon;
8728 } 9530 }
9531 /**
9532 * Initialize a newly created top-level variable declaration.
9533 * @param comment the documentation comment associated with this variable
9534 * @param metadata the annotations associated with this variable
9535 * @param variableList the top-level variables being declared
9536 * @param semicolon the semicolon terminating the declaration
9537 */
9538 TopLevelVariableDeclaration({Comment comment, List<Annotation> metadata, Varia bleDeclarationList variableList, Token semicolon}) : this.full(comment, metadata , variableList, semicolon);
8729 accept(ASTVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this); 9539 accept(ASTVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this);
8730 Token get endToken => _semicolon; 9540 Token get endToken => _semicolon;
8731 /** 9541 /**
8732 * Return the semicolon terminating the declaration. 9542 * Return the semicolon terminating the declaration.
8733 * @return the semicolon terminating the declaration 9543 * @return the semicolon terminating the declaration
8734 */ 9544 */
8735 Token get semicolon => _semicolon; 9545 Token get semicolon => _semicolon;
8736 /** 9546 /**
8737 * Return the top-level variables being declared. 9547 * Return the top-level variables being declared.
8738 * @return the top-level variables being declared 9548 * @return the top-level variables being declared
8739 */ 9549 */
8740 VariableDeclarationList get variables => _variableList; 9550 VariableDeclarationList get variables => _variableList;
8741 /** 9551 /**
8742 * Set the semicolon terminating the declaration to the given token. 9552 * Set the semicolon terminating the declaration to the given token.
8743 * @param semicolon the semicolon terminating the declaration 9553 * @param semicolon the semicolon terminating the declaration
8744 */ 9554 */
8745 void set semicolon16(Token semicolon) { 9555 void set semicolon(Token semicolon16) {
8746 this._semicolon = semicolon; 9556 this._semicolon = semicolon16;
8747 } 9557 }
8748 /** 9558 /**
8749 * Set the top-level variables being declared to the given list of variables. 9559 * Set the top-level variables being declared to the given list of variables.
8750 * @param variableList the top-level variables being declared 9560 * @param variableList the top-level variables being declared
8751 */ 9561 */
8752 void set variables3(VariableDeclarationList variableList) { 9562 void set variables(VariableDeclarationList variableList) {
8753 variableList = becomeParentOf(variableList); 9563 variableList = becomeParentOf(variableList);
8754 } 9564 }
8755 void visitChildren(ASTVisitor<Object> visitor) { 9565 void visitChildren(ASTVisitor<Object> visitor) {
8756 super.visitChildren(visitor); 9566 super.visitChildren(visitor);
8757 safelyVisitChild(_variableList, visitor); 9567 safelyVisitChild(_variableList, visitor);
8758 } 9568 }
8759 Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken; 9569 Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken;
8760 } 9570 }
8761 /** 9571 /**
8762 * Instances of the class {@code TryStatement} represent a try statement. 9572 * Instances of the class {@code TryStatement} represent a try statement.
(...skipping 27 matching lines...) Expand all
8790 */ 9600 */
8791 Block _finallyClause; 9601 Block _finallyClause;
8792 /** 9602 /**
8793 * Initialize a newly created try statement. 9603 * Initialize a newly created try statement.
8794 * @param tryKeyword the token representing the 'try' keyword 9604 * @param tryKeyword the token representing the 'try' keyword
8795 * @param body the body of the statement 9605 * @param body the body of the statement
8796 * @param catchClauses the catch clauses contained in the try statement 9606 * @param catchClauses the catch clauses contained in the try statement
8797 * @param finallyKeyword the token representing the 'finally' keyword 9607 * @param finallyKeyword the token representing the 'finally' keyword
8798 * @param finallyClause the finally clause contained in the try statement 9608 * @param finallyClause the finally clause contained in the try statement
8799 */ 9609 */
8800 TryStatement(Token tryKeyword, Block body, List<CatchClause> catchClauses, Tok en finallyKeyword, Block finallyClause) { 9610 TryStatement.full(Token tryKeyword, Block body, List<CatchClause> catchClauses , Token finallyKeyword, Block finallyClause) {
8801 this._catchClauses = new NodeList<CatchClause>(this); 9611 this._catchClauses = new NodeList<CatchClause>(this);
8802 this._tryKeyword = tryKeyword; 9612 this._tryKeyword = tryKeyword;
8803 this._body = becomeParentOf(body); 9613 this._body = becomeParentOf(body);
8804 this._catchClauses.addAll(catchClauses); 9614 this._catchClauses.addAll(catchClauses);
8805 this._finallyKeyword = finallyKeyword; 9615 this._finallyKeyword = finallyKeyword;
8806 this._finallyClause = becomeParentOf(finallyClause); 9616 this._finallyClause = becomeParentOf(finallyClause);
8807 } 9617 }
9618 /**
9619 * Initialize a newly created try statement.
9620 * @param tryKeyword the token representing the 'try' keyword
9621 * @param body the body of the statement
9622 * @param catchClauses the catch clauses contained in the try statement
9623 * @param finallyKeyword the token representing the 'finally' keyword
9624 * @param finallyClause the finally clause contained in the try statement
9625 */
9626 TryStatement({Token tryKeyword, Block body, List<CatchClause> catchClauses, To ken finallyKeyword, Block finallyClause}) : this.full(tryKeyword, body, catchCla uses, finallyKeyword, finallyClause);
8808 accept(ASTVisitor visitor) => visitor.visitTryStatement(this); 9627 accept(ASTVisitor visitor) => visitor.visitTryStatement(this);
8809 Token get beginToken => _tryKeyword; 9628 Token get beginToken => _tryKeyword;
8810 /** 9629 /**
8811 * Return the body of the statement. 9630 * Return the body of the statement.
8812 * @return the body of the statement 9631 * @return the body of the statement
8813 */ 9632 */
8814 Block get body => _body; 9633 Block get body => _body;
8815 /** 9634 /**
8816 * Return the catch clauses contained in the try statement. 9635 * Return the catch clauses contained in the try statement.
8817 * @return the catch clauses contained in the try statement 9636 * @return the catch clauses contained in the try statement
(...skipping 23 matching lines...) Expand all
8841 Token get finallyKeyword => _finallyKeyword; 9660 Token get finallyKeyword => _finallyKeyword;
8842 /** 9661 /**
8843 * Return the token representing the 'try' keyword. 9662 * Return the token representing the 'try' keyword.
8844 * @return the token representing the 'try' keyword 9663 * @return the token representing the 'try' keyword
8845 */ 9664 */
8846 Token get tryKeyword => _tryKeyword; 9665 Token get tryKeyword => _tryKeyword;
8847 /** 9666 /**
8848 * Set the body of the statement to the given block. 9667 * Set the body of the statement to the given block.
8849 * @param block the body of the statement 9668 * @param block the body of the statement
8850 */ 9669 */
8851 void set body9(Block block) { 9670 void set body(Block block) {
8852 _body = becomeParentOf(block); 9671 _body = becomeParentOf(block);
8853 } 9672 }
8854 /** 9673 /**
8855 * Set the finally clause contained in the try statement to the given block. 9674 * Set the finally clause contained in the try statement to the given block.
8856 * @param block the finally clause contained in the try statement 9675 * @param block the finally clause contained in the try statement
8857 */ 9676 */
8858 void set finallyClause2(Block block) { 9677 void set finallyClause(Block block) {
8859 _finallyClause = becomeParentOf(block); 9678 _finallyClause = becomeParentOf(block);
8860 } 9679 }
8861 /** 9680 /**
8862 * Set the token representing the 'finally' keyword to the given token. 9681 * Set the token representing the 'finally' keyword to the given token.
8863 * @param finallyKeyword the token representing the 'finally' keyword 9682 * @param finallyKeyword the token representing the 'finally' keyword
8864 */ 9683 */
8865 void set finallyKeyword2(Token finallyKeyword) { 9684 void set finallyKeyword(Token finallyKeyword2) {
8866 this._finallyKeyword = finallyKeyword; 9685 this._finallyKeyword = finallyKeyword2;
8867 } 9686 }
8868 /** 9687 /**
8869 * Set the token representing the 'try' keyword to the given token. 9688 * Set the token representing the 'try' keyword to the given token.
8870 * @param tryKeyword the token representing the 'try' keyword 9689 * @param tryKeyword the token representing the 'try' keyword
8871 */ 9690 */
8872 void set tryKeyword2(Token tryKeyword) { 9691 void set tryKeyword(Token tryKeyword2) {
8873 this._tryKeyword = tryKeyword; 9692 this._tryKeyword = tryKeyword2;
8874 } 9693 }
8875 void visitChildren(ASTVisitor<Object> visitor) { 9694 void visitChildren(ASTVisitor<Object> visitor) {
8876 safelyVisitChild(_body, visitor); 9695 safelyVisitChild(_body, visitor);
8877 _catchClauses.accept(visitor); 9696 _catchClauses.accept(visitor);
8878 safelyVisitChild(_finallyClause, visitor); 9697 safelyVisitChild(_finallyClause, visitor);
8879 } 9698 }
8880 } 9699 }
8881 /** 9700 /**
8882 * The abstract class {@code TypeAlias} defines the behavior common to declarati ons of type aliases. 9701 * The abstract class {@code TypeAlias} defines the behavior common to declarati ons of type aliases.
8883 * <pre> 9702 * <pre>
(...skipping 13 matching lines...) Expand all
8897 * The semicolon terminating the declaration. 9716 * The semicolon terminating the declaration.
8898 */ 9717 */
8899 Token _semicolon; 9718 Token _semicolon;
8900 /** 9719 /**
8901 * Initialize a newly created type alias. 9720 * Initialize a newly created type alias.
8902 * @param comment the documentation comment associated with this type alias 9721 * @param comment the documentation comment associated with this type alias
8903 * @param metadata the annotations associated with this type alias 9722 * @param metadata the annotations associated with this type alias
8904 * @param keyword the token representing the 'typedef' keyword 9723 * @param keyword the token representing the 'typedef' keyword
8905 * @param semicolon the semicolon terminating the declaration 9724 * @param semicolon the semicolon terminating the declaration
8906 */ 9725 */
8907 TypeAlias(Comment comment, List<Annotation> metadata, Token keyword, Token sem icolon) : super(comment, metadata) { 9726 TypeAlias.full(Comment comment, List<Annotation> metadata, Token keyword, Toke n semicolon) : super.full(comment, metadata) {
8908 this._keyword = keyword; 9727 this._keyword = keyword;
8909 this._semicolon = semicolon; 9728 this._semicolon = semicolon;
8910 } 9729 }
9730 /**
9731 * Initialize a newly created type alias.
9732 * @param comment the documentation comment associated with this type alias
9733 * @param metadata the annotations associated with this type alias
9734 * @param keyword the token representing the 'typedef' keyword
9735 * @param semicolon the semicolon terminating the declaration
9736 */
9737 TypeAlias({Comment comment, List<Annotation> metadata, Token keyword, Token se micolon}) : this.full(comment, metadata, keyword, semicolon);
8911 Token get endToken => _semicolon; 9738 Token get endToken => _semicolon;
8912 /** 9739 /**
8913 * Return the token representing the 'typedef' keyword. 9740 * Return the token representing the 'typedef' keyword.
8914 * @return the token representing the 'typedef' keyword 9741 * @return the token representing the 'typedef' keyword
8915 */ 9742 */
8916 Token get keyword => _keyword; 9743 Token get keyword => _keyword;
8917 /** 9744 /**
8918 * Return the semicolon terminating the declaration. 9745 * Return the semicolon terminating the declaration.
8919 * @return the semicolon terminating the declaration 9746 * @return the semicolon terminating the declaration
8920 */ 9747 */
8921 Token get semicolon => _semicolon; 9748 Token get semicolon => _semicolon;
8922 /** 9749 /**
8923 * Set the token representing the 'typedef' keyword to the given token. 9750 * Set the token representing the 'typedef' keyword to the given token.
8924 * @param keyword the token representing the 'typedef' keyword 9751 * @param keyword the token representing the 'typedef' keyword
8925 */ 9752 */
8926 void set keyword23(Token keyword) { 9753 void set keyword(Token keyword22) {
8927 this._keyword = keyword; 9754 this._keyword = keyword22;
8928 } 9755 }
8929 /** 9756 /**
8930 * Set the semicolon terminating the declaration to the given token. 9757 * Set the semicolon terminating the declaration to the given token.
8931 * @param semicolon the semicolon terminating the declaration 9758 * @param semicolon the semicolon terminating the declaration
8932 */ 9759 */
8933 void set semicolon17(Token semicolon) { 9760 void set semicolon(Token semicolon17) {
8934 this._semicolon = semicolon; 9761 this._semicolon = semicolon17;
8935 } 9762 }
8936 Token get firstTokenAfterCommentAndMetadata => _keyword; 9763 Token get firstTokenAfterCommentAndMetadata => _keyword;
8937 } 9764 }
8938 /** 9765 /**
8939 * Instances of the class {@code TypeArgumentList} represent a list of type argu ments. 9766 * Instances of the class {@code TypeArgumentList} represent a list of type argu ments.
8940 * <pre> 9767 * <pre>
8941 * typeArguments ::= 9768 * typeArguments ::=
8942 * '<' typeName (',' typeName)* '>' 9769 * '<' typeName (',' typeName)* '>'
8943 * </pre> 9770 * </pre>
8944 */ 9771 */
8945 class TypeArgumentList extends ASTNode { 9772 class TypeArgumentList extends ASTNode {
8946 /** 9773 /**
8947 * The left bracket. 9774 * The left bracket.
8948 */ 9775 */
8949 Token _leftBracket; 9776 Token _leftBracket;
8950 /** 9777 /**
8951 * The type arguments associated with the type. 9778 * The type arguments associated with the type.
8952 */ 9779 */
8953 NodeList<TypeName> _arguments; 9780 NodeList<TypeName> _arguments;
8954 /** 9781 /**
8955 * The right bracket. 9782 * The right bracket.
8956 */ 9783 */
8957 Token _rightBracket; 9784 Token _rightBracket;
8958 /** 9785 /**
8959 * Initialize a newly created list of type arguments. 9786 * Initialize a newly created list of type arguments.
8960 * @param leftBracket the left bracket 9787 * @param leftBracket the left bracket
8961 * @param arguments the type arguments associated with the type 9788 * @param arguments the type arguments associated with the type
8962 * @param rightBracket the right bracket 9789 * @param rightBracket the right bracket
8963 */ 9790 */
8964 TypeArgumentList(Token leftBracket, List<TypeName> arguments, Token rightBrack et) { 9791 TypeArgumentList.full(Token leftBracket, List<TypeName> arguments, Token right Bracket) {
8965 this._arguments = new NodeList<TypeName>(this); 9792 this._arguments = new NodeList<TypeName>(this);
8966 this._leftBracket = leftBracket; 9793 this._leftBracket = leftBracket;
8967 this._arguments.addAll(arguments); 9794 this._arguments.addAll(arguments);
8968 this._rightBracket = rightBracket; 9795 this._rightBracket = rightBracket;
8969 } 9796 }
9797 /**
9798 * Initialize a newly created list of type arguments.
9799 * @param leftBracket the left bracket
9800 * @param arguments the type arguments associated with the type
9801 * @param rightBracket the right bracket
9802 */
9803 TypeArgumentList({Token leftBracket, List<TypeName> arguments, Token rightBrac ket}) : this.full(leftBracket, arguments, rightBracket);
8970 accept(ASTVisitor visitor) => visitor.visitTypeArgumentList(this); 9804 accept(ASTVisitor visitor) => visitor.visitTypeArgumentList(this);
8971 /** 9805 /**
8972 * Return the type arguments associated with the type. 9806 * Return the type arguments associated with the type.
8973 * @return the type arguments associated with the type 9807 * @return the type arguments associated with the type
8974 */ 9808 */
8975 NodeList<TypeName> get arguments => _arguments; 9809 NodeList<TypeName> get arguments => _arguments;
8976 Token get beginToken => _leftBracket; 9810 Token get beginToken => _leftBracket;
8977 Token get endToken => _rightBracket; 9811 Token get endToken => _rightBracket;
8978 /** 9812 /**
8979 * Return the left bracket. 9813 * Return the left bracket.
8980 * @return the left bracket 9814 * @return the left bracket
8981 */ 9815 */
8982 Token get leftBracket => _leftBracket; 9816 Token get leftBracket => _leftBracket;
8983 /** 9817 /**
8984 * Return the right bracket. 9818 * Return the right bracket.
8985 * @return the right bracket 9819 * @return the right bracket
8986 */ 9820 */
8987 Token get rightBracket => _rightBracket; 9821 Token get rightBracket => _rightBracket;
8988 /** 9822 /**
8989 * Set the left bracket to the given token. 9823 * Set the left bracket to the given token.
8990 * @param leftBracket the left bracket 9824 * @param leftBracket the left bracket
8991 */ 9825 */
8992 void set leftBracket9(Token leftBracket) { 9826 void set leftBracket(Token leftBracket8) {
8993 this._leftBracket = leftBracket; 9827 this._leftBracket = leftBracket8;
8994 } 9828 }
8995 /** 9829 /**
8996 * Set the right bracket to the given token. 9830 * Set the right bracket to the given token.
8997 * @param rightBracket the right bracket 9831 * @param rightBracket the right bracket
8998 */ 9832 */
8999 void set rightBracket9(Token rightBracket) { 9833 void set rightBracket(Token rightBracket8) {
9000 this._rightBracket = rightBracket; 9834 this._rightBracket = rightBracket8;
9001 } 9835 }
9002 void visitChildren(ASTVisitor<Object> visitor) { 9836 void visitChildren(ASTVisitor<Object> visitor) {
9003 _arguments.accept(visitor); 9837 _arguments.accept(visitor);
9004 } 9838 }
9005 } 9839 }
9006 /** 9840 /**
9007 * Instances of the class {@code TypeName} represent the name of a type, which c an optionally 9841 * Instances of the class {@code TypeName} represent the name of a type, which c an optionally
9008 * include type arguments. 9842 * include type arguments.
9009 * <pre> 9843 * <pre>
9010 * typeName ::={@link Identifier identifier} typeArguments? 9844 * typeName ::={@link Identifier identifier} typeArguments?
(...skipping 11 matching lines...) Expand all
9022 /** 9856 /**
9023 * The type being named, or {@code null} if the AST structure has not been res olved. 9857 * The type being named, or {@code null} if the AST structure has not been res olved.
9024 */ 9858 */
9025 Type2 _type; 9859 Type2 _type;
9026 /** 9860 /**
9027 * Initialize a newly created type name. 9861 * Initialize a newly created type name.
9028 * @param name the name of the type 9862 * @param name the name of the type
9029 * @param typeArguments the type arguments associated with the type, or {@code null} if there are 9863 * @param typeArguments the type arguments associated with the type, or {@code null} if there are
9030 * no type arguments 9864 * no type arguments
9031 */ 9865 */
9032 TypeName(Identifier name, TypeArgumentList typeArguments) { 9866 TypeName.full(Identifier name, TypeArgumentList typeArguments) {
9033 this._name = becomeParentOf(name); 9867 this._name = becomeParentOf(name);
9034 this._typeArguments = becomeParentOf(typeArguments); 9868 this._typeArguments = becomeParentOf(typeArguments);
9035 } 9869 }
9870 /**
9871 * Initialize a newly created type name.
9872 * @param name the name of the type
9873 * @param typeArguments the type arguments associated with the type, or {@code null} if there are
9874 * no type arguments
9875 */
9876 TypeName({Identifier name, TypeArgumentList typeArguments}) : this.full(name, typeArguments);
9036 accept(ASTVisitor visitor) => visitor.visitTypeName(this); 9877 accept(ASTVisitor visitor) => visitor.visitTypeName(this);
9037 Token get beginToken => _name.beginToken; 9878 Token get beginToken => _name.beginToken;
9038 Token get endToken { 9879 Token get endToken {
9039 if (_typeArguments != null) { 9880 if (_typeArguments != null) {
9040 return _typeArguments.endToken; 9881 return _typeArguments.endToken;
9041 } 9882 }
9042 return _name.endToken; 9883 return _name.endToken;
9043 } 9884 }
9044 /** 9885 /**
9045 * Return the name of the type. 9886 * Return the name of the type.
9046 * @return the name of the type 9887 * @return the name of the type
9047 */ 9888 */
9048 Identifier get name => _name; 9889 Identifier get name => _name;
9049 /** 9890 /**
9050 * Return the type being named, or {@code null} if the AST structure has not b een resolved. 9891 * Return the type being named, or {@code null} if the AST structure has not b een resolved.
9051 * @return the type being named 9892 * @return the type being named
9052 */ 9893 */
9053 Type2 get type => _type; 9894 Type2 get type => _type;
9054 /** 9895 /**
9055 * Return the type arguments associated with the type, or {@code null} if ther e are no type 9896 * Return the type arguments associated with the type, or {@code null} if ther e are no type
9056 * arguments. 9897 * arguments.
9057 * @return the type arguments associated with the type 9898 * @return the type arguments associated with the type
9058 */ 9899 */
9059 TypeArgumentList get typeArguments => _typeArguments; 9900 TypeArgumentList get typeArguments => _typeArguments;
9060 bool isSynthetic() => _name.isSynthetic() && _typeArguments == null; 9901 bool isSynthetic() => _name.isSynthetic() && _typeArguments == null;
9061 /** 9902 /**
9062 * Set the name of the type to the given identifier. 9903 * Set the name of the type to the given identifier.
9063 * @param identifier the name of the type 9904 * @param identifier the name of the type
9064 */ 9905 */
9065 void set name12(Identifier identifier) { 9906 void set name(Identifier identifier) {
9066 _name = becomeParentOf(identifier); 9907 _name = becomeParentOf(identifier);
9067 } 9908 }
9068 /** 9909 /**
9069 * Set the type being named to the given type. 9910 * Set the type being named to the given type.
9070 * @param type the type being named 9911 * @param type the type being named
9071 */ 9912 */
9072 void set type7(Type2 type) { 9913 void set type(Type2 type3) {
9073 this._type = type; 9914 this._type = type3;
9074 } 9915 }
9075 /** 9916 /**
9076 * Set the type arguments associated with the type to the given type arguments . 9917 * Set the type arguments associated with the type to the given type arguments .
9077 * @param typeArguments the type arguments associated with the type 9918 * @param typeArguments the type arguments associated with the type
9078 */ 9919 */
9079 void set typeArguments2(TypeArgumentList typeArguments) { 9920 void set typeArguments(TypeArgumentList typeArguments2) {
9080 this._typeArguments = becomeParentOf(typeArguments); 9921 this._typeArguments = becomeParentOf(typeArguments2);
9081 } 9922 }
9082 void visitChildren(ASTVisitor<Object> visitor) { 9923 void visitChildren(ASTVisitor<Object> visitor) {
9083 safelyVisitChild(_name, visitor); 9924 safelyVisitChild(_name, visitor);
9084 safelyVisitChild(_typeArguments, visitor); 9925 safelyVisitChild(_typeArguments, visitor);
9085 } 9926 }
9086 } 9927 }
9087 /** 9928 /**
9088 * Instances of the class {@code TypeParameter} represent a type parameter. 9929 * Instances of the class {@code TypeParameter} represent a type parameter.
9089 * <pre> 9930 * <pre>
9090 * typeParameter ::={@link SimpleIdentifier name} ('extends' {@link TypeName bou nd})? 9931 * typeParameter ::={@link SimpleIdentifier name} ('extends' {@link TypeName bou nd})?
(...skipping 15 matching lines...) Expand all
9106 */ 9947 */
9107 TypeName _bound; 9948 TypeName _bound;
9108 /** 9949 /**
9109 * Initialize a newly created type parameter. 9950 * Initialize a newly created type parameter.
9110 * @param comment the documentation comment associated with the type parameter 9951 * @param comment the documentation comment associated with the type parameter
9111 * @param metadata the annotations associated with the type parameter 9952 * @param metadata the annotations associated with the type parameter
9112 * @param name the name of the type parameter 9953 * @param name the name of the type parameter
9113 * @param keyword the token representing the 'extends' keyword 9954 * @param keyword the token representing the 'extends' keyword
9114 * @param bound the name of the upper bound for legal arguments 9955 * @param bound the name of the upper bound for legal arguments
9115 */ 9956 */
9116 TypeParameter(Comment comment, List<Annotation> metadata, SimpleIdentifier nam e, Token keyword, TypeName bound) : super(comment, metadata) { 9957 TypeParameter.full(Comment comment, List<Annotation> metadata, SimpleIdentifie r name, Token keyword, TypeName bound) : super.full(comment, metadata) {
9117 this._name = becomeParentOf(name); 9958 this._name = becomeParentOf(name);
9118 this._keyword = keyword; 9959 this._keyword = keyword;
9119 this._bound = becomeParentOf(bound); 9960 this._bound = becomeParentOf(bound);
9120 } 9961 }
9962 /**
9963 * Initialize a newly created type parameter.
9964 * @param comment the documentation comment associated with the type parameter
9965 * @param metadata the annotations associated with the type parameter
9966 * @param name the name of the type parameter
9967 * @param keyword the token representing the 'extends' keyword
9968 * @param bound the name of the upper bound for legal arguments
9969 */
9970 TypeParameter({Comment comment, List<Annotation> metadata, SimpleIdentifier na me, Token keyword, TypeName bound}) : this.full(comment, metadata, name, keyword , bound);
9121 accept(ASTVisitor visitor) => visitor.visitTypeParameter(this); 9971 accept(ASTVisitor visitor) => visitor.visitTypeParameter(this);
9122 /** 9972 /**
9123 * Return the name of the upper bound for legal arguments, or {@code null} if there was no 9973 * Return the name of the upper bound for legal arguments, or {@code null} if there was no
9124 * explicit upper bound. 9974 * explicit upper bound.
9125 * @return the name of the upper bound for legal arguments 9975 * @return the name of the upper bound for legal arguments
9126 */ 9976 */
9127 TypeName get bound => _bound; 9977 TypeName get bound => _bound;
9128 Token get endToken { 9978 Token get endToken {
9129 if (_bound == null) { 9979 if (_bound == null) {
9130 return _name.endToken; 9980 return _name.endToken;
9131 } 9981 }
9132 return _bound.endToken; 9982 return _bound.endToken;
9133 } 9983 }
9134 /** 9984 /**
9135 * Return the token representing the 'assert' keyword. 9985 * Return the token representing the 'assert' keyword.
9136 * @return the token representing the 'assert' keyword 9986 * @return the token representing the 'assert' keyword
9137 */ 9987 */
9138 Token get keyword => _keyword; 9988 Token get keyword => _keyword;
9139 /** 9989 /**
9140 * Return the name of the type parameter. 9990 * Return the name of the type parameter.
9141 * @return the name of the type parameter 9991 * @return the name of the type parameter
9142 */ 9992 */
9143 SimpleIdentifier get name => _name; 9993 SimpleIdentifier get name => _name;
9144 /** 9994 /**
9145 * Set the name of the upper bound for legal arguments to the given type name. 9995 * Set the name of the upper bound for legal arguments to the given type name.
9146 * @param typeName the name of the upper bound for legal arguments 9996 * @param typeName the name of the upper bound for legal arguments
9147 */ 9997 */
9148 void set bound2(TypeName typeName) { 9998 void set bound(TypeName typeName) {
9149 _bound = becomeParentOf(typeName); 9999 _bound = becomeParentOf(typeName);
9150 } 10000 }
9151 /** 10001 /**
9152 * Set the token representing the 'assert' keyword to the given token. 10002 * Set the token representing the 'assert' keyword to the given token.
9153 * @param keyword the token representing the 'assert' keyword 10003 * @param keyword the token representing the 'assert' keyword
9154 */ 10004 */
9155 void set keyword24(Token keyword) { 10005 void set keyword(Token keyword23) {
9156 this._keyword = keyword; 10006 this._keyword = keyword23;
9157 } 10007 }
9158 /** 10008 /**
9159 * Set the name of the type parameter to the given identifier. 10009 * Set the name of the type parameter to the given identifier.
9160 * @param identifier the name of the type parameter 10010 * @param identifier the name of the type parameter
9161 */ 10011 */
9162 void set name13(SimpleIdentifier identifier) { 10012 void set name(SimpleIdentifier identifier) {
9163 _name = becomeParentOf(identifier); 10013 _name = becomeParentOf(identifier);
9164 } 10014 }
9165 void visitChildren(ASTVisitor<Object> visitor) { 10015 void visitChildren(ASTVisitor<Object> visitor) {
9166 super.visitChildren(visitor); 10016 super.visitChildren(visitor);
9167 safelyVisitChild(_name, visitor); 10017 safelyVisitChild(_name, visitor);
9168 safelyVisitChild(_bound, visitor); 10018 safelyVisitChild(_bound, visitor);
9169 } 10019 }
9170 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; 10020 Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
9171 } 10021 }
9172 /** 10022 /**
(...skipping 15 matching lines...) Expand all
9188 /** 10038 /**
9189 * The right angle bracket. 10039 * The right angle bracket.
9190 */ 10040 */
9191 Token _rightBracket; 10041 Token _rightBracket;
9192 /** 10042 /**
9193 * Initialize a newly created list of type parameters. 10043 * Initialize a newly created list of type parameters.
9194 * @param leftBracket the left angle bracket 10044 * @param leftBracket the left angle bracket
9195 * @param typeParameters the type parameters in the list 10045 * @param typeParameters the type parameters in the list
9196 * @param rightBracket the right angle bracket 10046 * @param rightBracket the right angle bracket
9197 */ 10047 */
9198 TypeParameterList(Token leftBracket, List<TypeParameter> typeParameters, Token rightBracket) { 10048 TypeParameterList.full(Token leftBracket, List<TypeParameter> typeParameters, Token rightBracket) {
9199 this._typeParameters = new NodeList<TypeParameter>(this); 10049 this._typeParameters = new NodeList<TypeParameter>(this);
9200 this._leftBracket = leftBracket; 10050 this._leftBracket = leftBracket;
9201 this._typeParameters.addAll(typeParameters); 10051 this._typeParameters.addAll(typeParameters);
9202 this._rightBracket = rightBracket; 10052 this._rightBracket = rightBracket;
9203 } 10053 }
10054 /**
10055 * Initialize a newly created list of type parameters.
10056 * @param leftBracket the left angle bracket
10057 * @param typeParameters the type parameters in the list
10058 * @param rightBracket the right angle bracket
10059 */
10060 TypeParameterList({Token leftBracket, List<TypeParameter> typeParameters, Toke n rightBracket}) : this.full(leftBracket, typeParameters, rightBracket);
9204 accept(ASTVisitor visitor) => visitor.visitTypeParameterList(this); 10061 accept(ASTVisitor visitor) => visitor.visitTypeParameterList(this);
9205 Token get beginToken => _leftBracket; 10062 Token get beginToken => _leftBracket;
9206 Token get endToken => _rightBracket; 10063 Token get endToken => _rightBracket;
9207 /** 10064 /**
9208 * Return the left angle bracket. 10065 * Return the left angle bracket.
9209 * @return the left angle bracket 10066 * @return the left angle bracket
9210 */ 10067 */
9211 Token get leftBracket => _leftBracket; 10068 Token get leftBracket => _leftBracket;
9212 /** 10069 /**
9213 * Return the right angle bracket. 10070 * Return the right angle bracket.
(...skipping 25 matching lines...) Expand all
9239 * The type argument associated with this literal, or {@code null} if no type arguments were 10096 * The type argument associated with this literal, or {@code null} if no type arguments were
9240 * declared. 10097 * declared.
9241 */ 10098 */
9242 TypeArgumentList _typeArguments; 10099 TypeArgumentList _typeArguments;
9243 /** 10100 /**
9244 * Initialize a newly created typed literal. 10101 * Initialize a newly created typed literal.
9245 * @param modifier the const modifier associated with this literal 10102 * @param modifier the const modifier associated with this literal
9246 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type 10103 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type
9247 * arguments were declared 10104 * arguments were declared
9248 */ 10105 */
9249 TypedLiteral(Token modifier, TypeArgumentList typeArguments) { 10106 TypedLiteral.full(Token modifier, TypeArgumentList typeArguments) {
9250 this._modifier = modifier; 10107 this._modifier = modifier;
9251 this._typeArguments = becomeParentOf(typeArguments); 10108 this._typeArguments = becomeParentOf(typeArguments);
9252 } 10109 }
9253 /** 10110 /**
10111 * Initialize a newly created typed literal.
10112 * @param modifier the const modifier associated with this literal
10113 * @param typeArguments the type argument associated with this literal, or {@c ode null} if no type
10114 * arguments were declared
10115 */
10116 TypedLiteral({Token modifier, TypeArgumentList typeArguments}) : this.full(mod ifier, typeArguments);
10117 /**
9254 * Return the const modifier associated with this literal. 10118 * Return the const modifier associated with this literal.
9255 * @return the const modifier associated with this literal 10119 * @return the const modifier associated with this literal
9256 */ 10120 */
9257 Token get modifier => _modifier; 10121 Token get modifier => _modifier;
9258 /** 10122 /**
9259 * Return the type argument associated with this literal, or {@code null} if n o type arguments 10123 * Return the type argument associated with this literal, or {@code null} if n o type arguments
9260 * were declared. 10124 * were declared.
9261 * @return the type argument associated with this literal 10125 * @return the type argument associated with this literal
9262 */ 10126 */
9263 TypeArgumentList get typeArguments => _typeArguments; 10127 TypeArgumentList get typeArguments => _typeArguments;
9264 /** 10128 /**
9265 * Set the modifiers associated with this literal to the given modifiers. 10129 * Set the modifiers associated with this literal to the given modifiers.
9266 * @param modifiers the modifiers associated with this literal 10130 * @param modifiers the modifiers associated with this literal
9267 */ 10131 */
9268 void set modifier2(Token modifier) { 10132 void set modifier(Token modifier2) {
9269 this._modifier = modifier; 10133 this._modifier = modifier2;
9270 } 10134 }
9271 /** 10135 /**
9272 * Set the type argument associated with this literal to the given arguments. 10136 * Set the type argument associated with this literal to the given arguments.
9273 * @param typeArguments the type argument associated with this literal 10137 * @param typeArguments the type argument associated with this literal
9274 */ 10138 */
9275 void set typeArguments3(TypeArgumentList typeArguments) { 10139 void set typeArguments(TypeArgumentList typeArguments3) {
9276 this._typeArguments = typeArguments; 10140 this._typeArguments = typeArguments3;
9277 } 10141 }
9278 void visitChildren(ASTVisitor<Object> visitor) { 10142 void visitChildren(ASTVisitor<Object> visitor) {
9279 safelyVisitChild(_typeArguments, visitor); 10143 safelyVisitChild(_typeArguments, visitor);
9280 } 10144 }
9281 } 10145 }
9282 /** 10146 /**
10147 * The abstract class {@code UriBasedDirective} defines the behavior common to n odes that represent
10148 * a directive that references a URI.
10149 * <pre>
10150 * uriBasedDirective ::={@link ExportDirective exportDirective}| {@link ImportDi rective importDirective}| {@link PartDirective partDirective}</pre>
10151 */
10152 abstract class UriBasedDirective extends Directive {
10153 /**
10154 * The URI referenced by this directive.
10155 */
10156 StringLiteral _uri;
10157 /**
10158 * Initialize a newly create URI-based directive.
10159 * @param comment the documentation comment associated with this directive
10160 * @param metadata the annotations associated with the directive
10161 * @param uri the URI referenced by this directive
10162 */
10163 UriBasedDirective.full(Comment comment, List<Annotation> metadata, StringLiter al uri) : super.full(comment, metadata) {
10164 this._uri = becomeParentOf(uri);
10165 }
10166 /**
10167 * Initialize a newly create URI-based directive.
10168 * @param comment the documentation comment associated with this directive
10169 * @param metadata the annotations associated with the directive
10170 * @param uri the URI referenced by this directive
10171 */
10172 UriBasedDirective({Comment comment, List<Annotation> metadata, StringLiteral u ri}) : this.full(comment, metadata, uri);
10173 /**
10174 * Return the URI referenced by this directive.
10175 * @return the URI referenced by this directive
10176 */
10177 StringLiteral get uri => _uri;
10178 /**
10179 * Set the URI referenced by this directive to the given URI.
10180 * @param uri the URI referenced by this directive
10181 */
10182 void set uri(StringLiteral uri2) {
10183 this._uri = becomeParentOf(uri2);
10184 }
10185 void visitChildren(ASTVisitor<Object> visitor) {
10186 super.visitChildren(visitor);
10187 safelyVisitChild(_uri, visitor);
10188 }
10189 }
10190 /**
9283 * Instances of the class {@code VariableDeclaration} represent an identifier th at has an initial 10191 * Instances of the class {@code VariableDeclaration} represent an identifier th at has an initial
9284 * value associated with it. Instances of this class are always children of the class{@link VariableDeclarationList}. 10192 * value associated with it. Instances of this class are always children of the class{@link VariableDeclarationList}.
9285 * <pre> 10193 * <pre>
9286 * variableDeclaration ::={@link SimpleIdentifier identifier} ('=' {@link Expres sion initialValue})? 10194 * variableDeclaration ::={@link SimpleIdentifier identifier} ('=' {@link Expres sion initialValue})?
9287 * </pre> 10195 * </pre>
9288 */ 10196 */
9289 class VariableDeclaration extends Declaration { 10197 class VariableDeclaration extends Declaration {
9290 /** 10198 /**
9291 * The name of the variable being declared. 10199 * The name of the variable being declared.
9292 */ 10200 */
9293 SimpleIdentifier _name; 10201 SimpleIdentifier _name;
9294 /** 10202 /**
9295 * The equal sign separating the variable name from the initial value, or {@co de null} if the 10203 * The equal sign separating the variable name from the initial value, or {@co de null} if the
9296 * initial value was not specified. 10204 * initial value was not specified.
9297 */ 10205 */
9298 Token _equals; 10206 Token _equals;
9299 /** 10207 /**
9300 * The expression used to compute the initial value for the variable, or {@cod e null} if the 10208 * The expression used to compute the initial value for the variable, or {@cod e null} if the
9301 * initial value was not specified. 10209 * initial value was not specified.
9302 */ 10210 */
9303 Expression _initializer; 10211 Expression _initializer;
9304 /** 10212 /**
9305 * Initialize a newly created variable declaration. 10213 * Initialize a newly created variable declaration.
9306 * @param comment the documentation comment associated with this declaration 10214 * @param comment the documentation comment associated with this declaration
9307 * @param metadata the annotations associated with this member 10215 * @param metadata the annotations associated with this member
9308 * @param name the name of the variable being declared 10216 * @param name the name of the variable being declared
9309 * @param equals the equal sign separating the variable name from the initial value 10217 * @param equals the equal sign separating the variable name from the initial value
9310 * @param initializer the expression used to compute the initial value for the variable 10218 * @param initializer the expression used to compute the initial value for the variable
9311 */ 10219 */
9312 VariableDeclaration(Comment comment, List<Annotation> metadata, SimpleIdentifi er name, Token equals, Expression initializer) : super(comment, metadata) { 10220 VariableDeclaration.full(Comment comment, List<Annotation> metadata, SimpleIde ntifier name, Token equals, Expression initializer) : super.full(comment, metada ta) {
9313 this._name = becomeParentOf(name); 10221 this._name = becomeParentOf(name);
9314 this._equals = equals; 10222 this._equals = equals;
9315 this._initializer = becomeParentOf(initializer); 10223 this._initializer = becomeParentOf(initializer);
9316 } 10224 }
10225 /**
10226 * Initialize a newly created variable declaration.
10227 * @param comment the documentation comment associated with this declaration
10228 * @param metadata the annotations associated with this member
10229 * @param name the name of the variable being declared
10230 * @param equals the equal sign separating the variable name from the initial value
10231 * @param initializer the expression used to compute the initial value for the variable
10232 */
10233 VariableDeclaration({Comment comment, List<Annotation> metadata, SimpleIdentif ier name, Token equals, Expression initializer}) : this.full(comment, metadata, name, equals, initializer);
9317 accept(ASTVisitor visitor) => visitor.visitVariableDeclaration(this); 10234 accept(ASTVisitor visitor) => visitor.visitVariableDeclaration(this);
9318 /** 10235 /**
9319 * Return the {@link VariableElement} associated with this variable, or {@code null} if the AST 10236 * Return the {@link VariableElement} associated with this variable, or {@code null} if the AST
9320 * structure has not been resolved. 10237 * structure has not been resolved.
9321 * @return the {@link VariableElement} associated with this variable 10238 * @return the {@link VariableElement} associated with this variable
9322 */ 10239 */
9323 VariableElement get element => _name != null ? _name.element as VariableElemen t : null; 10240 VariableElement get element => _name != null ? (_name.element as VariableEleme nt) : null;
9324 Token get endToken { 10241 Token get endToken {
9325 if (_initializer != null) { 10242 if (_initializer != null) {
9326 return _initializer.endToken; 10243 return _initializer.endToken;
9327 } 10244 }
9328 return _name.endToken; 10245 return _name.endToken;
9329 } 10246 }
9330 /** 10247 /**
9331 * Return the equal sign separating the variable name from the initial value, or {@code null} if 10248 * Return the equal sign separating the variable name from the initial value, or {@code null} if
9332 * the initial value was not specified. 10249 * the initial value was not specified.
9333 * @return the equal sign separating the variable name from the initial value 10250 * @return the equal sign separating the variable name from the initial value
9334 */ 10251 */
9335 Token get equals => _equals; 10252 Token get equals => _equals;
9336 /** 10253 /**
9337 * Return the expression used to compute the initial value for the variable, o r {@code null} if 10254 * Return the expression used to compute the initial value for the variable, o r {@code null} if
9338 * the initial value was not specified. 10255 * the initial value was not specified.
9339 * @return the expression used to compute the initial value for the variable 10256 * @return the expression used to compute the initial value for the variable
9340 */ 10257 */
9341 Expression get initializer => _initializer; 10258 Expression get initializer => _initializer;
9342 /** 10259 /**
9343 * Return the name of the variable being declared. 10260 * Return the name of the variable being declared.
9344 * @return the name of the variable being declared 10261 * @return the name of the variable being declared
9345 */ 10262 */
9346 SimpleIdentifier get name => _name; 10263 SimpleIdentifier get name => _name;
9347 /** 10264 /**
9348 * Set the equal sign separating the variable name from the initial value to t he given token. 10265 * Set the equal sign separating the variable name from the initial value to t he given token.
9349 * @param equals the equal sign separating the variable name from the initial value 10266 * @param equals the equal sign separating the variable name from the initial value
9350 */ 10267 */
9351 void set equals6(Token equals) { 10268 void set equals(Token equals6) {
9352 this._equals = equals; 10269 this._equals = equals6;
9353 } 10270 }
9354 /** 10271 /**
9355 * Set the expression used to compute the initial value for the variable to th e given expression. 10272 * Set the expression used to compute the initial value for the variable to th e given expression.
9356 * @param initializer the expression used to compute the initial value for the variable 10273 * @param initializer the expression used to compute the initial value for the variable
9357 */ 10274 */
9358 void set initializer2(Expression initializer) { 10275 void set initializer(Expression initializer2) {
9359 this._initializer = becomeParentOf(initializer); 10276 this._initializer = becomeParentOf(initializer2);
9360 } 10277 }
9361 /** 10278 /**
9362 * Set the name of the variable being declared to the given identifier. 10279 * Set the name of the variable being declared to the given identifier.
9363 * @param name the name of the variable being declared 10280 * @param name the name of the variable being declared
9364 */ 10281 */
9365 void set name14(SimpleIdentifier name) { 10282 void set name(SimpleIdentifier name7) {
9366 this._name = becomeParentOf(name); 10283 this._name = becomeParentOf(name7);
9367 } 10284 }
9368 void visitChildren(ASTVisitor<Object> visitor) { 10285 void visitChildren(ASTVisitor<Object> visitor) {
9369 super.visitChildren(visitor); 10286 super.visitChildren(visitor);
9370 safelyVisitChild(_name, visitor); 10287 safelyVisitChild(_name, visitor);
9371 safelyVisitChild(_initializer, visitor); 10288 safelyVisitChild(_initializer, visitor);
9372 } 10289 }
9373 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; 10290 Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
9374 } 10291 }
9375 /** 10292 /**
9376 * Instances of the class {@code VariableDeclarationList} represent the declarat ion of one or more 10293 * Instances of the class {@code VariableDeclarationList} represent the declarat ion of one or more
(...skipping 20 matching lines...) Expand all
9397 /** 10314 /**
9398 * A list containing the individual variables being declared. 10315 * A list containing the individual variables being declared.
9399 */ 10316 */
9400 NodeList<VariableDeclaration> _variables; 10317 NodeList<VariableDeclaration> _variables;
9401 /** 10318 /**
9402 * Initialize a newly created variable declaration list. 10319 * Initialize a newly created variable declaration list.
9403 * @param keyword the token representing the 'final', 'const' or 'var' keyword 10320 * @param keyword the token representing the 'final', 'const' or 'var' keyword
9404 * @param type the type of the variables being declared 10321 * @param type the type of the variables being declared
9405 * @param variables a list containing the individual variables being declared 10322 * @param variables a list containing the individual variables being declared
9406 */ 10323 */
9407 VariableDeclarationList(Token keyword, TypeName type, List<VariableDeclaration > variables) { 10324 VariableDeclarationList.full(Token keyword, TypeName type, List<VariableDeclar ation> variables) {
9408 this._variables = new NodeList<VariableDeclaration>(this); 10325 this._variables = new NodeList<VariableDeclaration>(this);
9409 this._keyword = keyword; 10326 this._keyword = keyword;
9410 this._type = becomeParentOf(type); 10327 this._type = becomeParentOf(type);
9411 this._variables.addAll(variables); 10328 this._variables.addAll(variables);
9412 } 10329 }
10330 /**
10331 * Initialize a newly created variable declaration list.
10332 * @param keyword the token representing the 'final', 'const' or 'var' keyword
10333 * @param type the type of the variables being declared
10334 * @param variables a list containing the individual variables being declared
10335 */
10336 VariableDeclarationList({Token keyword, TypeName type, List<VariableDeclaratio n> variables}) : this.full(keyword, type, variables);
9413 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this); 10337 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this);
9414 Token get beginToken { 10338 Token get beginToken {
9415 if (_keyword != null) { 10339 if (_keyword != null) {
9416 return _keyword; 10340 return _keyword;
9417 } else if (_type != null) { 10341 } else if (_type != null) {
9418 return _type.beginToken; 10342 return _type.beginToken;
9419 } 10343 }
9420 return _variables.beginToken; 10344 return _variables.beginToken;
9421 } 10345 }
9422 Token get endToken => _variables.endToken; 10346 Token get endToken => _variables.endToken;
(...skipping 10 matching lines...) Expand all
9433 TypeName get type => _type; 10357 TypeName get type => _type;
9434 /** 10358 /**
9435 * Return a list containing the individual variables being declared. 10359 * Return a list containing the individual variables being declared.
9436 * @return a list containing the individual variables being declared 10360 * @return a list containing the individual variables being declared
9437 */ 10361 */
9438 NodeList<VariableDeclaration> get variables => _variables; 10362 NodeList<VariableDeclaration> get variables => _variables;
9439 /** 10363 /**
9440 * Set the token representing the 'final', 'const' or 'var' keyword to the giv en token. 10364 * Set the token representing the 'final', 'const' or 'var' keyword to the giv en token.
9441 * @param keyword the token representing the 'final', 'const' or 'var' keyword 10365 * @param keyword the token representing the 'final', 'const' or 'var' keyword
9442 */ 10366 */
9443 void set keyword25(Token keyword) { 10367 void set keyword(Token keyword24) {
9444 this._keyword = keyword; 10368 this._keyword = keyword24;
9445 } 10369 }
9446 /** 10370 /**
9447 * Set the type of the variables being declared to the given type name. 10371 * Set the type of the variables being declared to the given type name.
9448 * @param typeName the type of the variables being declared 10372 * @param typeName the type of the variables being declared
9449 */ 10373 */
9450 void set type8(TypeName typeName) { 10374 void set type(TypeName typeName) {
9451 _type = becomeParentOf(typeName); 10375 _type = becomeParentOf(typeName);
9452 } 10376 }
9453 void visitChildren(ASTVisitor<Object> visitor) { 10377 void visitChildren(ASTVisitor<Object> visitor) {
9454 safelyVisitChild(_type, visitor); 10378 safelyVisitChild(_type, visitor);
9455 _variables.accept(visitor); 10379 _variables.accept(visitor);
9456 } 10380 }
9457 } 10381 }
9458 /** 10382 /**
9459 * Instances of the class {@code VariableDeclarationStatement} represent a list of variables that 10383 * Instances of the class {@code VariableDeclarationStatement} represent a list of variables that
9460 * are being declared in a context where a statement is required. 10384 * are being declared in a context where a statement is required.
9461 * <pre> 10385 * <pre>
9462 * variableDeclarationStatement ::={@link VariableDeclarationList variableList} ';' 10386 * variableDeclarationStatement ::={@link VariableDeclarationList variableList} ';'
9463 * </pre> 10387 * </pre>
9464 */ 10388 */
9465 class VariableDeclarationStatement extends Statement { 10389 class VariableDeclarationStatement extends Statement {
9466 /** 10390 /**
9467 * The variables being declared. 10391 * The variables being declared.
9468 */ 10392 */
9469 VariableDeclarationList _variableList; 10393 VariableDeclarationList _variableList;
9470 /** 10394 /**
9471 * The semicolon terminating the statement. 10395 * The semicolon terminating the statement.
9472 */ 10396 */
9473 Token _semicolon; 10397 Token _semicolon;
9474 /** 10398 /**
9475 * Initialize a newly created variable declaration statement. 10399 * Initialize a newly created variable declaration statement.
9476 * @param variableList the fields being declared 10400 * @param variableList the fields being declared
9477 * @param semicolon the semicolon terminating the statement 10401 * @param semicolon the semicolon terminating the statement
9478 */ 10402 */
9479 VariableDeclarationStatement(VariableDeclarationList variableList, Token semic olon) { 10403 VariableDeclarationStatement.full(VariableDeclarationList variableList, Token semicolon) {
9480 this._variableList = becomeParentOf(variableList); 10404 this._variableList = becomeParentOf(variableList);
9481 this._semicolon = semicolon; 10405 this._semicolon = semicolon;
9482 } 10406 }
10407 /**
10408 * Initialize a newly created variable declaration statement.
10409 * @param variableList the fields being declared
10410 * @param semicolon the semicolon terminating the statement
10411 */
10412 VariableDeclarationStatement({VariableDeclarationList variableList, Token semi colon}) : this.full(variableList, semicolon);
9483 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationStatement(this); 10413 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationStatement(this);
9484 Token get beginToken => _variableList.beginToken; 10414 Token get beginToken => _variableList.beginToken;
9485 Token get endToken => _semicolon; 10415 Token get endToken => _semicolon;
9486 /** 10416 /**
9487 * Return the semicolon terminating the statement. 10417 * Return the semicolon terminating the statement.
9488 * @return the semicolon terminating the statement 10418 * @return the semicolon terminating the statement
9489 */ 10419 */
9490 Token get semicolon => _semicolon; 10420 Token get semicolon => _semicolon;
9491 /** 10421 /**
9492 * Return the variables being declared. 10422 * Return the variables being declared.
9493 * @return the variables being declared 10423 * @return the variables being declared
9494 */ 10424 */
9495 VariableDeclarationList get variables => _variableList; 10425 VariableDeclarationList get variables => _variableList;
9496 /** 10426 /**
9497 * Set the semicolon terminating the statement to the given token. 10427 * Set the semicolon terminating the statement to the given token.
9498 * @param semicolon the semicolon terminating the statement 10428 * @param semicolon the semicolon terminating the statement
9499 */ 10429 */
9500 void set semicolon18(Token semicolon) { 10430 void set semicolon(Token semicolon18) {
9501 this._semicolon = semicolon; 10431 this._semicolon = semicolon18;
9502 } 10432 }
9503 /** 10433 /**
9504 * Set the variables being declared to the given list of variables. 10434 * Set the variables being declared to the given list of variables.
9505 * @param variableList the variables being declared 10435 * @param variableList the variables being declared
9506 */ 10436 */
9507 void set variables4(VariableDeclarationList variableList) { 10437 void set variables(VariableDeclarationList variableList2) {
9508 this._variableList = becomeParentOf(variableList); 10438 this._variableList = becomeParentOf(variableList2);
9509 } 10439 }
9510 void visitChildren(ASTVisitor<Object> visitor) { 10440 void visitChildren(ASTVisitor<Object> visitor) {
9511 safelyVisitChild(_variableList, visitor); 10441 safelyVisitChild(_variableList, visitor);
9512 } 10442 }
9513 } 10443 }
9514 /** 10444 /**
9515 * Instances of the class {@code WhileStatement} represent a while statement. 10445 * Instances of the class {@code WhileStatement} represent a while statement.
9516 * <pre> 10446 * <pre>
9517 * whileStatement ::= 10447 * whileStatement ::=
9518 * 'while' '(' {@link Expression condition} ')' {@link Statement body}</pre> 10448 * 'while' '(' {@link Expression condition} ')' {@link Statement body}</pre>
(...skipping 20 matching lines...) Expand all
9539 */ 10469 */
9540 Statement _body; 10470 Statement _body;
9541 /** 10471 /**
9542 * Initialize a newly created while statement. 10472 * Initialize a newly created while statement.
9543 * @param keyword the token representing the 'while' keyword 10473 * @param keyword the token representing the 'while' keyword
9544 * @param leftParenthesis the left parenthesis 10474 * @param leftParenthesis the left parenthesis
9545 * @param condition the expression used to determine whether to execute the bo dy of the loop 10475 * @param condition the expression used to determine whether to execute the bo dy of the loop
9546 * @param rightParenthesis the right parenthesis 10476 * @param rightParenthesis the right parenthesis
9547 * @param body the body of the loop 10477 * @param body the body of the loop
9548 */ 10478 */
9549 WhileStatement(Token keyword, Token leftParenthesis, Expression condition, Tok en rightParenthesis, Statement body) { 10479 WhileStatement.full(Token keyword, Token leftParenthesis, Expression condition , Token rightParenthesis, Statement body) {
9550 this._keyword = keyword; 10480 this._keyword = keyword;
9551 this._leftParenthesis = leftParenthesis; 10481 this._leftParenthesis = leftParenthesis;
9552 this._condition = becomeParentOf(condition); 10482 this._condition = becomeParentOf(condition);
9553 this._rightParenthesis = rightParenthesis; 10483 this._rightParenthesis = rightParenthesis;
9554 this._body = becomeParentOf(body); 10484 this._body = becomeParentOf(body);
9555 } 10485 }
10486 /**
10487 * Initialize a newly created while statement.
10488 * @param keyword the token representing the 'while' keyword
10489 * @param leftParenthesis the left parenthesis
10490 * @param condition the expression used to determine whether to execute the bo dy of the loop
10491 * @param rightParenthesis the right parenthesis
10492 * @param body the body of the loop
10493 */
10494 WhileStatement({Token keyword, Token leftParenthesis, Expression condition, To ken rightParenthesis, Statement body}) : this.full(keyword, leftParenthesis, con dition, rightParenthesis, body);
9556 accept(ASTVisitor visitor) => visitor.visitWhileStatement(this); 10495 accept(ASTVisitor visitor) => visitor.visitWhileStatement(this);
9557 Token get beginToken => _keyword; 10496 Token get beginToken => _keyword;
9558 /** 10497 /**
9559 * Return the body of the loop. 10498 * Return the body of the loop.
9560 * @return the body of the loop 10499 * @return the body of the loop
9561 */ 10500 */
9562 Statement get body => _body; 10501 Statement get body => _body;
9563 /** 10502 /**
9564 * Return the expression used to determine whether to execute the body of the loop. 10503 * Return the expression used to determine whether to execute the body of the loop.
9565 * @return the expression used to determine whether to execute the body of the loop 10504 * @return the expression used to determine whether to execute the body of the loop
(...skipping 12 matching lines...) Expand all
9578 Token get leftParenthesis => _leftParenthesis; 10517 Token get leftParenthesis => _leftParenthesis;
9579 /** 10518 /**
9580 * Return the right parenthesis. 10519 * Return the right parenthesis.
9581 * @return the right parenthesis 10520 * @return the right parenthesis
9582 */ 10521 */
9583 Token get rightParenthesis => _rightParenthesis; 10522 Token get rightParenthesis => _rightParenthesis;
9584 /** 10523 /**
9585 * Set the body of the loop to the given statement. 10524 * Set the body of the loop to the given statement.
9586 * @param statement the body of the loop 10525 * @param statement the body of the loop
9587 */ 10526 */
9588 void set body10(Statement statement) { 10527 void set body(Statement statement) {
9589 _body = becomeParentOf(statement); 10528 _body = becomeParentOf(statement);
9590 } 10529 }
9591 /** 10530 /**
9592 * Set the expression used to determine whether to execute the body of the loo p to the given 10531 * Set the expression used to determine whether to execute the body of the loo p to the given
9593 * expression. 10532 * expression.
9594 * @param expression the expression used to determine whether to execute the b ody of the loop 10533 * @param expression the expression used to determine whether to execute the b ody of the loop
9595 */ 10534 */
9596 void set condition7(Expression expression) { 10535 void set condition(Expression expression) {
9597 _condition = becomeParentOf(expression); 10536 _condition = becomeParentOf(expression);
9598 } 10537 }
9599 /** 10538 /**
9600 * Set the token representing the 'while' keyword to the given token. 10539 * Set the token representing the 'while' keyword to the given token.
9601 * @param keyword the token representing the 'while' keyword 10540 * @param keyword the token representing the 'while' keyword
9602 */ 10541 */
9603 void set keyword26(Token keyword) { 10542 void set keyword(Token keyword25) {
9604 this._keyword = keyword; 10543 this._keyword = keyword25;
9605 } 10544 }
9606 /** 10545 /**
9607 * Set the left parenthesis to the given token. 10546 * Set the left parenthesis to the given token.
9608 * @param leftParenthesis the left parenthesis 10547 * @param leftParenthesis the left parenthesis
9609 */ 10548 */
9610 void set leftParenthesis12(Token leftParenthesis) { 10549 void set leftParenthesis(Token leftParenthesis7) {
9611 this._leftParenthesis = leftParenthesis; 10550 this._leftParenthesis = leftParenthesis7;
9612 } 10551 }
9613 /** 10552 /**
9614 * Set the right parenthesis to the given token. 10553 * Set the right parenthesis to the given token.
9615 * @param rightParenthesis the right parenthesis 10554 * @param rightParenthesis the right parenthesis
9616 */ 10555 */
9617 void set rightParenthesis12(Token rightParenthesis) { 10556 void set rightParenthesis(Token rightParenthesis7) {
9618 this._rightParenthesis = rightParenthesis; 10557 this._rightParenthesis = rightParenthesis7;
9619 } 10558 }
9620 void visitChildren(ASTVisitor<Object> visitor) { 10559 void visitChildren(ASTVisitor<Object> visitor) {
9621 safelyVisitChild(_condition, visitor); 10560 safelyVisitChild(_condition, visitor);
9622 safelyVisitChild(_body, visitor); 10561 safelyVisitChild(_body, visitor);
9623 } 10562 }
9624 } 10563 }
9625 /** 10564 /**
9626 * Instances of the class {@code WithClause} represent the with clause in a clas s declaration. 10565 * Instances of the class {@code WithClause} represent the with clause in a clas s declaration.
9627 * <pre> 10566 * <pre>
9628 * withClause ::= 10567 * withClause ::=
9629 * 'with' {@link TypeName mixin} (',' {@link TypeName mixin}) 10568 * 'with' {@link TypeName mixin} (',' {@link TypeName mixin})
9630 * </pre> 10569 * </pre>
9631 */ 10570 */
9632 class WithClause extends ASTNode { 10571 class WithClause extends ASTNode {
9633 /** 10572 /**
9634 * The token representing the 'with' keyword. 10573 * The token representing the 'with' keyword.
9635 */ 10574 */
9636 Token _withKeyword; 10575 Token _withKeyword;
9637 /** 10576 /**
9638 * The names of the mixins that were specified. 10577 * The names of the mixins that were specified.
9639 */ 10578 */
9640 NodeList<TypeName> _mixinTypes; 10579 NodeList<TypeName> _mixinTypes;
9641 /** 10580 /**
9642 * Initialize a newly created with clause. 10581 * Initialize a newly created with clause.
9643 * @param withKeyword the token representing the 'with' keyword 10582 * @param withKeyword the token representing the 'with' keyword
9644 * @param mixinTypes the names of the mixins that were specified 10583 * @param mixinTypes the names of the mixins that were specified
9645 */ 10584 */
9646 WithClause(Token withKeyword, List<TypeName> mixinTypes) { 10585 WithClause.full(Token withKeyword, List<TypeName> mixinTypes) {
9647 this._mixinTypes = new NodeList<TypeName>(this); 10586 this._mixinTypes = new NodeList<TypeName>(this);
9648 this._withKeyword = withKeyword; 10587 this._withKeyword = withKeyword;
9649 this._mixinTypes.addAll(mixinTypes); 10588 this._mixinTypes.addAll(mixinTypes);
9650 } 10589 }
10590 /**
10591 * Initialize a newly created with clause.
10592 * @param withKeyword the token representing the 'with' keyword
10593 * @param mixinTypes the names of the mixins that were specified
10594 */
10595 WithClause({Token withKeyword, List<TypeName> mixinTypes}) : this.full(withKey word, mixinTypes);
9651 accept(ASTVisitor visitor) => visitor.visitWithClause(this); 10596 accept(ASTVisitor visitor) => visitor.visitWithClause(this);
9652 Token get beginToken => _withKeyword; 10597 Token get beginToken => _withKeyword;
9653 Token get endToken => _mixinTypes.endToken; 10598 Token get endToken => _mixinTypes.endToken;
9654 /** 10599 /**
9655 * Return the names of the mixins that were specified. 10600 * Return the names of the mixins that were specified.
9656 * @return the names of the mixins that were specified 10601 * @return the names of the mixins that were specified
9657 */ 10602 */
9658 NodeList<TypeName> get mixinTypes => _mixinTypes; 10603 NodeList<TypeName> get mixinTypes => _mixinTypes;
9659 /** 10604 /**
9660 * Return the token representing the 'with' keyword. 10605 * Return the token representing the 'with' keyword.
9661 * @return the token representing the 'with' keyword 10606 * @return the token representing the 'with' keyword
9662 */ 10607 */
9663 Token get withKeyword => _withKeyword; 10608 Token get withKeyword => _withKeyword;
9664 /** 10609 /**
9665 * Set the token representing the 'with' keyword to the given token. 10610 * Set the token representing the 'with' keyword to the given token.
9666 * @param withKeyword the token representing the 'with' keyword 10611 * @param withKeyword the token representing the 'with' keyword
9667 */ 10612 */
9668 void set mixinKeyword(Token withKeyword) { 10613 void set mixinKeyword(Token withKeyword2) {
9669 this._withKeyword = withKeyword; 10614 this._withKeyword = withKeyword2;
9670 } 10615 }
9671 void visitChildren(ASTVisitor<Object> visitor) { 10616 void visitChildren(ASTVisitor<Object> visitor) {
9672 _mixinTypes.accept(visitor); 10617 _mixinTypes.accept(visitor);
9673 } 10618 }
9674 } 10619 }
9675 /** 10620 /**
9676 * Instances of the class {@code ConstantEvaluator} evaluate constant expression s to produce their 10621 * Instances of the class {@code ConstantEvaluator} evaluate constant expression s to produce their
9677 * compile-time value. According to the Dart Language Specification: <blockquote > A constant 10622 * compile-time value. According to the Dart Language Specification: <blockquote > A constant
9678 * expression is one of the following: 10623 * expression is one of the following:
9679 * <ul> 10624 * <ul>
(...skipping 26 matching lines...) Expand all
9706 class ConstantEvaluator extends GeneralizingASTVisitor<Object> { 10651 class ConstantEvaluator extends GeneralizingASTVisitor<Object> {
9707 /** 10652 /**
9708 * The value returned for expressions (or non-expression nodes) that are not c ompile-time constant 10653 * The value returned for expressions (or non-expression nodes) that are not c ompile-time constant
9709 * expressions. 10654 * expressions.
9710 */ 10655 */
9711 static Object NOT_A_CONSTANT = new Object(); 10656 static Object NOT_A_CONSTANT = new Object();
9712 Object visitAdjacentStrings(AdjacentStrings node) { 10657 Object visitAdjacentStrings(AdjacentStrings node) {
9713 StringBuffer builder = new StringBuffer(); 10658 StringBuffer builder = new StringBuffer();
9714 for (StringLiteral string in node.strings) { 10659 for (StringLiteral string in node.strings) {
9715 Object value = string.accept(this); 10660 Object value = string.accept(this);
9716 if (value == ConstantEvaluator.NOT_A_CONSTANT) { 10661 if (identical(value, NOT_A_CONSTANT)) {
9717 return value; 10662 return value;
9718 } 10663 }
9719 builder.add(value); 10664 builder.add(value);
9720 } 10665 }
9721 return builder.toString(); 10666 return builder.toString();
9722 } 10667 }
9723 Object visitBinaryExpression(BinaryExpression node) { 10668 Object visitBinaryExpression(BinaryExpression node) {
9724 Object leftOperand3 = node.leftOperand.accept(this); 10669 Object leftOperand2 = node.leftOperand.accept(this);
9725 if (leftOperand3 == ConstantEvaluator.NOT_A_CONSTANT) { 10670 if (identical(leftOperand2, NOT_A_CONSTANT)) {
9726 return leftOperand3; 10671 return leftOperand2;
9727 } 10672 }
9728 Object rightOperand3 = node.rightOperand.accept(this); 10673 Object rightOperand2 = node.rightOperand.accept(this);
9729 if (rightOperand3 == ConstantEvaluator.NOT_A_CONSTANT) { 10674 if (identical(rightOperand2, NOT_A_CONSTANT)) {
9730 return rightOperand3; 10675 return rightOperand2;
9731 } 10676 }
9732 if (node.operator.type == TokenType.AMPERSAND) { 10677 if (node.operator.type == TokenType.AMPERSAND) {
9733 if (leftOperand3 is int && rightOperand3 is int) { 10678 if (leftOperand2 is int && rightOperand2 is int) {
9734 return (leftOperand3 as int) & rightOperand3 as int; 10679 return ((leftOperand2 as int)) & (rightOperand2 as int);
9735 } 10680 }
9736 } else if (node.operator.type == TokenType.AMPERSAND_AMPERSAND) { 10681 } else if (node.operator.type == TokenType.AMPERSAND_AMPERSAND) {
9737 if (leftOperand3 is bool && rightOperand3 is bool) { 10682 if (leftOperand2 is bool && rightOperand2 is bool) {
9738 return (leftOperand3 as bool) && (rightOperand3 as bool); 10683 return ((leftOperand2 as bool)) && ((rightOperand2 as bool));
9739 } 10684 }
9740 } else if (node.operator.type == TokenType.BANG_EQ) { 10685 } else if (node.operator.type == TokenType.BANG_EQ) {
9741 if (leftOperand3 is bool && rightOperand3 is bool) { 10686 if (leftOperand2 is bool && rightOperand2 is bool) {
9742 return (leftOperand3 as bool) != (rightOperand3 as bool); 10687 return ((leftOperand2 as bool)) != ((rightOperand2 as bool));
9743 } else if (leftOperand3 is int && rightOperand3 is int) { 10688 } else if (leftOperand2 is int && rightOperand2 is int) {
9744 return (leftOperand3 as int) != rightOperand3; 10689 return ((leftOperand2 as int)) != rightOperand2;
9745 } else if (leftOperand3 is double && rightOperand3 is double) { 10690 } else if (leftOperand2 is double && rightOperand2 is double) {
9746 return (leftOperand3 as double) != rightOperand3; 10691 return ((leftOperand2 as double)) != rightOperand2;
9747 } else if (leftOperand3 is String && rightOperand3 is String) { 10692 } else if (leftOperand2 is String && rightOperand2 is String) {
9748 return (leftOperand3 as String) != rightOperand3; 10693 return ((leftOperand2 as String)) != rightOperand2;
9749 } 10694 }
9750 } else if (node.operator.type == TokenType.BAR) { 10695 } else if (node.operator.type == TokenType.BAR) {
9751 if (leftOperand3 is int && rightOperand3 is int) { 10696 if (leftOperand2 is int && rightOperand2 is int) {
9752 return (leftOperand3 as int) | rightOperand3 as int; 10697 return ((leftOperand2 as int)) | (rightOperand2 as int);
9753 } 10698 }
9754 } else if (node.operator.type == TokenType.BAR_BAR) { 10699 } else if (node.operator.type == TokenType.BAR_BAR) {
9755 if (leftOperand3 is bool && rightOperand3 is bool) { 10700 if (leftOperand2 is bool && rightOperand2 is bool) {
9756 return (leftOperand3 as bool) || (rightOperand3 as bool); 10701 return ((leftOperand2 as bool)) || ((rightOperand2 as bool));
9757 } 10702 }
9758 } else if (node.operator.type == TokenType.CARET) { 10703 } else if (node.operator.type == TokenType.CARET) {
9759 if (leftOperand3 is int && rightOperand3 is int) { 10704 if (leftOperand2 is int && rightOperand2 is int) {
9760 return (leftOperand3 as int) ^ rightOperand3 as int; 10705 return ((leftOperand2 as int)) ^ (rightOperand2 as int);
9761 } 10706 }
9762 } else if (node.operator.type == TokenType.EQ_EQ) { 10707 } else if (node.operator.type == TokenType.EQ_EQ) {
9763 if (leftOperand3 is bool && rightOperand3 is bool) { 10708 if (leftOperand2 is bool && rightOperand2 is bool) {
9764 return (leftOperand3 as bool) == (rightOperand3 as bool); 10709 return identical(((leftOperand2 as bool)), ((rightOperand2 as bool)));
9765 } else if (leftOperand3 is int && rightOperand3 is int) { 10710 } else if (leftOperand2 is int && rightOperand2 is int) {
9766 return (leftOperand3 as int) == rightOperand3; 10711 return ((leftOperand2 as int)) == rightOperand2;
9767 } else if (leftOperand3 is double && rightOperand3 is double) { 10712 } else if (leftOperand2 is double && rightOperand2 is double) {
9768 return (leftOperand3 as double) == rightOperand3; 10713 return ((leftOperand2 as double)) == rightOperand2;
9769 } else if (leftOperand3 is String && rightOperand3 is String) { 10714 } else if (leftOperand2 is String && rightOperand2 is String) {
9770 return (leftOperand3 as String) == rightOperand3; 10715 return ((leftOperand2 as String)) == rightOperand2;
9771 } 10716 }
9772 } else if (node.operator.type == TokenType.GT) { 10717 } else if (node.operator.type == TokenType.GT) {
9773 if (leftOperand3 is int && rightOperand3 is int) { 10718 if (leftOperand2 is int && rightOperand2 is int) {
9774 return (leftOperand3 as int).compareTo(rightOperand3 as int) > 0; 10719 return ((leftOperand2 as int)).compareTo((rightOperand2 as int)) > 0;
9775 } else if (leftOperand3 is double && rightOperand3 is double) { 10720 } else if (leftOperand2 is double && rightOperand2 is double) {
9776 return (leftOperand3 as double).compareTo(rightOperand3 as double) > 0; 10721 return ((leftOperand2 as double)).compareTo((rightOperand2 as double)) > 0;
9777 } 10722 }
9778 } else if (node.operator.type == TokenType.GT_EQ) { 10723 } else if (node.operator.type == TokenType.GT_EQ) {
9779 if (leftOperand3 is int && rightOperand3 is int) { 10724 if (leftOperand2 is int && rightOperand2 is int) {
9780 return (leftOperand3 as int).compareTo(rightOperand3 as int) >= 0; 10725 return ((leftOperand2 as int)).compareTo((rightOperand2 as int)) >= 0;
9781 } else if (leftOperand3 is double && rightOperand3 is double) { 10726 } else if (leftOperand2 is double && rightOperand2 is double) {
9782 return (leftOperand3 as double).compareTo(rightOperand3 as double) >= 0; 10727 return ((leftOperand2 as double)).compareTo((rightOperand2 as double)) > = 0;
9783 } 10728 }
9784 } else if (node.operator.type == TokenType.GT_GT) { 10729 } else if (node.operator.type == TokenType.GT_GT) {
9785 if (leftOperand3 is int && rightOperand3 is int) { 10730 if (leftOperand2 is int && rightOperand2 is int) {
9786 return (leftOperand3 as int) >> (rightOperand3 as int); 10731 return ((leftOperand2 as int)) >> ((rightOperand2 as int));
9787 } 10732 }
9788 } else if (node.operator.type == TokenType.LT) { 10733 } else if (node.operator.type == TokenType.LT) {
9789 if (leftOperand3 is int && rightOperand3 is int) { 10734 if (leftOperand2 is int && rightOperand2 is int) {
9790 return (leftOperand3 as int).compareTo(rightOperand3 as int) < 0; 10735 return ((leftOperand2 as int)).compareTo((rightOperand2 as int)) < 0;
9791 } else if (leftOperand3 is double && rightOperand3 is double) { 10736 } else if (leftOperand2 is double && rightOperand2 is double) {
9792 return (leftOperand3 as double).compareTo(rightOperand3 as double) < 0; 10737 return ((leftOperand2 as double)).compareTo((rightOperand2 as double)) < 0;
9793 } 10738 }
9794 } else if (node.operator.type == TokenType.LT_EQ) { 10739 } else if (node.operator.type == TokenType.LT_EQ) {
9795 if (leftOperand3 is int && rightOperand3 is int) { 10740 if (leftOperand2 is int && rightOperand2 is int) {
9796 return (leftOperand3 as int).compareTo(rightOperand3 as int) <= 0; 10741 return ((leftOperand2 as int)).compareTo((rightOperand2 as int)) <= 0;
9797 } else if (leftOperand3 is double && rightOperand3 is double) { 10742 } else if (leftOperand2 is double && rightOperand2 is double) {
9798 return (leftOperand3 as double).compareTo(rightOperand3 as double) <= 0; 10743 return ((leftOperand2 as double)).compareTo((rightOperand2 as double)) < = 0;
9799 } 10744 }
9800 } else if (node.operator.type == TokenType.LT_LT) { 10745 } else if (node.operator.type == TokenType.LT_LT) {
9801 if (leftOperand3 is int && rightOperand3 is int) { 10746 if (leftOperand2 is int && rightOperand2 is int) {
9802 return (leftOperand3 as int) << (rightOperand3 as int); 10747 return ((leftOperand2 as int)) << ((rightOperand2 as int));
9803 } 10748 }
9804 } else if (node.operator.type == TokenType.MINUS) { 10749 } else if (node.operator.type == TokenType.MINUS) {
9805 if (leftOperand3 is int && rightOperand3 is int) { 10750 if (leftOperand2 is int && rightOperand2 is int) {
9806 return (leftOperand3 as int) - rightOperand3 as int; 10751 return ((leftOperand2 as int)) - (rightOperand2 as int);
9807 } else if (leftOperand3 is double && rightOperand3 is double) { 10752 } else if (leftOperand2 is double && rightOperand2 is double) {
9808 return (leftOperand3 as double) - (rightOperand3 as double); 10753 return ((leftOperand2 as double)) - ((rightOperand2 as double));
9809 } 10754 }
9810 } else if (node.operator.type == TokenType.PERCENT) { 10755 } else if (node.operator.type == TokenType.PERCENT) {
9811 if (leftOperand3 is int && rightOperand3 is int) { 10756 if (leftOperand2 is int && rightOperand2 is int) {
9812 return (leftOperand3 as int).remainder(rightOperand3 as int); 10757 return ((leftOperand2 as int)).remainder((rightOperand2 as int));
9813 } else if (leftOperand3 is double && rightOperand3 is double) { 10758 } else if (leftOperand2 is double && rightOperand2 is double) {
9814 return (leftOperand3 as double) % (rightOperand3 as double); 10759 return ((leftOperand2 as double)) % ((rightOperand2 as double));
9815 } 10760 }
9816 } else if (node.operator.type == TokenType.PLUS) { 10761 } else if (node.operator.type == TokenType.PLUS) {
9817 if (leftOperand3 is int && rightOperand3 is int) { 10762 if (leftOperand2 is int && rightOperand2 is int) {
9818 return (leftOperand3 as int) + rightOperand3 as int; 10763 return ((leftOperand2 as int)) + (rightOperand2 as int);
9819 } else if (leftOperand3 is double && rightOperand3 is double) { 10764 } else if (leftOperand2 is double && rightOperand2 is double) {
9820 return (leftOperand3 as double) + (rightOperand3 as double); 10765 return ((leftOperand2 as double)) + ((rightOperand2 as double));
9821 } 10766 }
9822 } else if (node.operator.type == TokenType.STAR) { 10767 } else if (node.operator.type == TokenType.STAR) {
9823 if (leftOperand3 is int && rightOperand3 is int) { 10768 if (leftOperand2 is int && rightOperand2 is int) {
9824 return (leftOperand3 as int) * rightOperand3 as int; 10769 return ((leftOperand2 as int)) * (rightOperand2 as int);
9825 } else if (leftOperand3 is double && rightOperand3 is double) { 10770 } else if (leftOperand2 is double && rightOperand2 is double) {
9826 return (leftOperand3 as double) * (rightOperand3 as double); 10771 return ((leftOperand2 as double)) * ((rightOperand2 as double));
9827 } 10772 }
9828 } else if (node.operator.type == TokenType.SLASH) { 10773 } else if (node.operator.type == TokenType.SLASH) {
9829 if (leftOperand3 is int && rightOperand3 is int) { 10774 if (leftOperand2 is int && rightOperand2 is int) {
9830 return (leftOperand3 as int) / rightOperand3 as int; 10775 return ((leftOperand2 as int)) ~/ (rightOperand2 as int);
9831 } else if (leftOperand3 is double && rightOperand3 is double) { 10776 } else if (leftOperand2 is double && rightOperand2 is double) {
9832 return (leftOperand3 as double) / (rightOperand3 as double); 10777 return ((leftOperand2 as double)) / ((rightOperand2 as double));
9833 } 10778 }
9834 } else if (node.operator.type == TokenType.TILDE_SLASH) { 10779 } else if (node.operator.type == TokenType.TILDE_SLASH) {
9835 if (leftOperand3 is int && rightOperand3 is int) { 10780 if (leftOperand2 is int && rightOperand2 is int) {
9836 return (leftOperand3 as int) / rightOperand3 as int; 10781 return ((leftOperand2 as int)) ~/ (rightOperand2 as int);
9837 } else if (leftOperand3 is double && rightOperand3 is double) { 10782 } else if (leftOperand2 is double && rightOperand2 is double) {
9838 return (leftOperand3 as double) ~/ (rightOperand3 as double); 10783 return ((leftOperand2 as double)) ~/ ((rightOperand2 as double));
9839 } 10784 }
9840 } 10785 }
9841 return visitExpression(node); 10786 return visitExpression(node);
9842 } 10787 }
9843 Object visitBooleanLiteral(BooleanLiteral node) => node.value ? true : false; 10788 Object visitBooleanLiteral(BooleanLiteral node) => node.value ? true : false;
9844 Object visitDoubleLiteral(DoubleLiteral node) => node.value; 10789 Object visitDoubleLiteral(DoubleLiteral node) => node.value;
9845 Object visitIntegerLiteral(IntegerLiteral node) => node.value; 10790 Object visitIntegerLiteral(IntegerLiteral node) => node.value;
9846 Object visitInterpolationExpression(InterpolationExpression node) { 10791 Object visitInterpolationExpression(InterpolationExpression node) {
9847 Object value = node.expression.accept(this); 10792 Object value = node.expression.accept(this);
9848 if (value == null || value is bool || value is String || value is int || val ue is double) { 10793 if (value == null || value is bool || value is String || value is int || val ue is double) {
9849 return value; 10794 return value;
9850 } 10795 }
9851 return NOT_A_CONSTANT; 10796 return NOT_A_CONSTANT;
9852 } 10797 }
9853 Object visitInterpolationString(InterpolationString node) => node.value; 10798 Object visitInterpolationString(InterpolationString node) => node.value;
9854 Object visitListLiteral(ListLiteral node) { 10799 Object visitListLiteral(ListLiteral node) {
9855 List<Object> list = new List<Object>(); 10800 List<Object> list = new List<Object>();
9856 for (Expression element in node.elements) { 10801 for (Expression element in node.elements) {
9857 Object value = element.accept(this); 10802 Object value = element.accept(this);
9858 if (value == ConstantEvaluator.NOT_A_CONSTANT) { 10803 if (identical(value, NOT_A_CONSTANT)) {
9859 return value; 10804 return value;
9860 } 10805 }
9861 list.add(value); 10806 list.add(value);
9862 } 10807 }
9863 return list; 10808 return list;
9864 } 10809 }
9865 Object visitMapLiteral(MapLiteral node) { 10810 Object visitMapLiteral(MapLiteral node) {
9866 Map<String, Object> map = new Map<String, Object>(); 10811 Map<String, Object> map = new Map<String, Object>();
9867 for (MapLiteralEntry entry in node.entries) { 10812 for (MapLiteralEntry entry in node.entries) {
9868 Object key3 = entry.key.accept(this); 10813 Object key2 = entry.key.accept(this);
9869 Object value10 = entry.value.accept(this); 10814 Object value7 = entry.value.accept(this);
9870 if (key3 is! String || value10 == ConstantEvaluator.NOT_A_CONSTANT) { 10815 if (key2 is! String || identical(value7, NOT_A_CONSTANT)) {
9871 return NOT_A_CONSTANT; 10816 return NOT_A_CONSTANT;
9872 } 10817 }
9873 map[key3 as String] = value10; 10818 map[(key2 as String)] = value7;
9874 } 10819 }
9875 return map; 10820 return map;
9876 } 10821 }
9877 Object visitMethodInvocation(MethodInvocation node) => visitNode(node); 10822 Object visitMethodInvocation(MethodInvocation node) => visitNode(node);
9878 Object visitNode(ASTNode node) => NOT_A_CONSTANT; 10823 Object visitNode(ASTNode node) => NOT_A_CONSTANT;
9879 Object visitNullLiteral(NullLiteral node) => null; 10824 Object visitNullLiteral(NullLiteral node) => null;
9880 Object visitParenthesizedExpression(ParenthesizedExpression node) => node.expr ession.accept(this); 10825 Object visitParenthesizedExpression(ParenthesizedExpression node) => node.expr ession.accept(this);
9881 Object visitPrefixedIdentifier(PrefixedIdentifier node) => getConstantValue(nu ll); 10826 Object visitPrefixedIdentifier(PrefixedIdentifier node) => getConstantValue(nu ll);
9882 Object visitPrefixExpression(PrefixExpression node) { 10827 Object visitPrefixExpression(PrefixExpression node) {
9883 Object operand4 = node.operand.accept(this); 10828 Object operand2 = node.operand.accept(this);
9884 if (operand4 == ConstantEvaluator.NOT_A_CONSTANT) { 10829 if (identical(operand2, NOT_A_CONSTANT)) {
9885 return operand4; 10830 return operand2;
9886 } 10831 }
9887 if (node.operator.type == TokenType.BANG) { 10832 if (node.operator.type == TokenType.BANG) {
9888 if (operand4 == true) { 10833 if (identical(operand2, true)) {
9889 return false; 10834 return false;
9890 } else if (operand4 == false) { 10835 } else if (identical(operand2, false)) {
9891 return true; 10836 return true;
9892 } 10837 }
9893 } else if (node.operator.type == TokenType.TILDE) { 10838 } else if (node.operator.type == TokenType.TILDE) {
9894 if (operand4 is int) { 10839 if (operand2 is int) {
9895 return ~(operand4 as int); 10840 return ~((operand2 as int));
9896 } 10841 }
9897 } else if (node.operator.type == TokenType.MINUS) { 10842 } else if (node.operator.type == TokenType.MINUS) {
9898 if (operand4 == null) { 10843 if (operand2 == null) {
9899 return null; 10844 return null;
9900 } else if (operand4 is int) { 10845 } else if (operand2 is int) {
9901 return -(operand4 as int); 10846 return -((operand2 as int));
9902 } else if (operand4 is double) { 10847 } else if (operand2 is double) {
9903 return -(operand4 as double); 10848 return -((operand2 as double));
9904 } 10849 }
9905 } 10850 }
9906 return NOT_A_CONSTANT; 10851 return NOT_A_CONSTANT;
9907 } 10852 }
9908 Object visitPropertyAccess(PropertyAccess node) => getConstantValue(null); 10853 Object visitPropertyAccess(PropertyAccess node) => getConstantValue(null);
9909 Object visitSimpleIdentifier(SimpleIdentifier node) => getConstantValue(null); 10854 Object visitSimpleIdentifier(SimpleIdentifier node) => getConstantValue(null);
9910 Object visitSimpleStringLiteral(SimpleStringLiteral node) => node.value; 10855 Object visitSimpleStringLiteral(SimpleStringLiteral node) => node.value;
9911 Object visitStringInterpolation(StringInterpolation node) { 10856 Object visitStringInterpolation(StringInterpolation node) {
9912 StringBuffer builder = new StringBuffer(); 10857 StringBuffer builder = new StringBuffer();
9913 for (InterpolationElement element in node.elements) { 10858 for (InterpolationElement element in node.elements) {
9914 Object value = element.accept(this); 10859 Object value = element.accept(this);
9915 if (value == ConstantEvaluator.NOT_A_CONSTANT) { 10860 if (identical(value, NOT_A_CONSTANT)) {
9916 return value; 10861 return value;
9917 } 10862 }
9918 builder.add(value); 10863 builder.add(value);
9919 } 10864 }
9920 return builder.toString(); 10865 return builder.toString();
9921 } 10866 }
9922 /** 10867 /**
9923 * Return the constant value of the static constant represented by the given e lement. 10868 * Return the constant value of the static constant represented by the given e lement.
9924 * @param element the element whose value is to be returned 10869 * @param element the element whose value is to be returned
9925 * @return the constant value of the static constant 10870 * @return the constant value of the static constant
9926 */ 10871 */
9927 Object getConstantValue(Element element) { 10872 Object getConstantValue(Element element) {
9928 if (element is FieldElement) { 10873 if (element is FieldElement) {
9929 FieldElement field = element as FieldElement; 10874 FieldElement field = (element as FieldElement);
9930 if (field.isStatic() && field.isConst()) { 10875 if (field.isStatic() && field.isConst()) {
9931 } 10876 }
9932 } 10877 }
9933 return NOT_A_CONSTANT; 10878 return NOT_A_CONSTANT;
9934 } 10879 }
9935 } 10880 }
9936 /** 10881 /**
9937 * Instances of the class {@code GeneralizingASTVisitor} implement an AST visito r that will 10882 * Instances of the class {@code GeneralizingASTVisitor} implement an AST visito r that will
9938 * 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 10883 * 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
9939 * will the visit method for that specific type of node be invoked, but addition al methods for the 10884 * will the visit method for that specific type of node be invoked, but addition al methods for the
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
10019 R visitLabeledStatement(LabeledStatement node) => visitStatement(node); 10964 R visitLabeledStatement(LabeledStatement node) => visitStatement(node);
10020 R visitLibraryDirective(LibraryDirective node) => visitDirective(node); 10965 R visitLibraryDirective(LibraryDirective node) => visitDirective(node);
10021 R visitLibraryIdentifier(LibraryIdentifier node) => visitIdentifier(node); 10966 R visitLibraryIdentifier(LibraryIdentifier node) => visitIdentifier(node);
10022 R visitListLiteral(ListLiteral node) => visitTypedLiteral(node); 10967 R visitListLiteral(ListLiteral node) => visitTypedLiteral(node);
10023 R visitLiteral(Literal node) => visitExpression(node); 10968 R visitLiteral(Literal node) => visitExpression(node);
10024 R visitMapLiteral(MapLiteral node) => visitTypedLiteral(node); 10969 R visitMapLiteral(MapLiteral node) => visitTypedLiteral(node);
10025 R visitMapLiteralEntry(MapLiteralEntry node) => visitNode(node); 10970 R visitMapLiteralEntry(MapLiteralEntry node) => visitNode(node);
10026 R visitMethodDeclaration(MethodDeclaration node) => visitClassMember(node); 10971 R visitMethodDeclaration(MethodDeclaration node) => visitClassMember(node);
10027 R visitMethodInvocation(MethodInvocation node) => visitNode(node); 10972 R visitMethodInvocation(MethodInvocation node) => visitNode(node);
10028 R visitNamedExpression(NamedExpression node) => visitExpression(node); 10973 R visitNamedExpression(NamedExpression node) => visitExpression(node);
10029 R visitNamespaceDirective(NamespaceDirective node) => visitDirective(node); 10974 R visitNamespaceDirective(NamespaceDirective node) => visitUriBasedDirective(n ode);
10030 R visitNode(ASTNode node) { 10975 R visitNode(ASTNode node) {
10031 node.visitChildren(this); 10976 node.visitChildren(this);
10032 return null; 10977 return null;
10033 } 10978 }
10034 R visitNormalFormalParameter(NormalFormalParameter node) => visitFormalParamet er(node); 10979 R visitNormalFormalParameter(NormalFormalParameter node) => visitFormalParamet er(node);
10035 R visitNullLiteral(NullLiteral node) => visitLiteral(node); 10980 R visitNullLiteral(NullLiteral node) => visitLiteral(node);
10036 R visitParenthesizedExpression(ParenthesizedExpression node) => visitExpressio n(node); 10981 R visitParenthesizedExpression(ParenthesizedExpression node) => visitExpressio n(node);
10037 R visitPartDirective(PartDirective node) => visitDirective(node); 10982 R visitPartDirective(PartDirective node) => visitUriBasedDirective(node);
10038 R visitPartOfDirective(PartOfDirective node) => visitDirective(node); 10983 R visitPartOfDirective(PartOfDirective node) => visitDirective(node);
10039 R visitPostfixExpression(PostfixExpression node) => visitExpression(node); 10984 R visitPostfixExpression(PostfixExpression node) => visitExpression(node);
10040 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitIdentifier(node); 10985 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitIdentifier(node);
10041 R visitPrefixExpression(PrefixExpression node) => visitExpression(node); 10986 R visitPrefixExpression(PrefixExpression node) => visitExpression(node);
10042 R visitPropertyAccess(PropertyAccess node) => visitExpression(node); 10987 R visitPropertyAccess(PropertyAccess node) => visitExpression(node);
10043 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => visitConstructorInitializer(node); 10988 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => visitConstructorInitializer(node);
10044 R visitReturnStatement(ReturnStatement node) => visitStatement(node); 10989 R visitReturnStatement(ReturnStatement node) => visitStatement(node);
10045 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag); 10990 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag);
10046 R visitShowCombinator(ShowCombinator node) => visitCombinator(node); 10991 R visitShowCombinator(ShowCombinator node) => visitCombinator(node);
10047 R visitSimpleFormalParameter(SimpleFormalParameter node) => visitNormalFormalP arameter(node); 10992 R visitSimpleFormalParameter(SimpleFormalParameter node) => visitNormalFormalP arameter(node);
(...skipping 11 matching lines...) Expand all
10059 R visitThisExpression(ThisExpression node) => visitExpression(node); 11004 R visitThisExpression(ThisExpression node) => visitExpression(node);
10060 R visitThrowExpression(ThrowExpression node) => visitExpression(node); 11005 R visitThrowExpression(ThrowExpression node) => visitExpression(node);
10061 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => visitC ompilationUnitMember(node); 11006 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => visitC ompilationUnitMember(node);
10062 R visitTryStatement(TryStatement node) => visitStatement(node); 11007 R visitTryStatement(TryStatement node) => visitStatement(node);
10063 R visitTypeAlias(TypeAlias node) => visitCompilationUnitMember(node); 11008 R visitTypeAlias(TypeAlias node) => visitCompilationUnitMember(node);
10064 R visitTypeArgumentList(TypeArgumentList node) => visitNode(node); 11009 R visitTypeArgumentList(TypeArgumentList node) => visitNode(node);
10065 R visitTypedLiteral(TypedLiteral node) => visitLiteral(node); 11010 R visitTypedLiteral(TypedLiteral node) => visitLiteral(node);
10066 R visitTypeName(TypeName node) => visitNode(node); 11011 R visitTypeName(TypeName node) => visitNode(node);
10067 R visitTypeParameter(TypeParameter node) => visitNode(node); 11012 R visitTypeParameter(TypeParameter node) => visitNode(node);
10068 R visitTypeParameterList(TypeParameterList node) => visitNode(node); 11013 R visitTypeParameterList(TypeParameterList node) => visitNode(node);
11014 R visitUriBasedDirective(UriBasedDirective node) => visitDirective(node);
10069 R visitVariableDeclaration(VariableDeclaration node) => visitDeclaration(node) ; 11015 R visitVariableDeclaration(VariableDeclaration node) => visitDeclaration(node) ;
10070 R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node ); 11016 R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node );
10071 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visi tStatement(node); 11017 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visi tStatement(node);
10072 R visitWhileStatement(WhileStatement node) => visitStatement(node); 11018 R visitWhileStatement(WhileStatement node) => visitStatement(node);
10073 R visitWithClause(WithClause node) => visitNode(node); 11019 R visitWithClause(WithClause node) => visitNode(node);
10074 } 11020 }
10075 /** 11021 /**
11022 * Instances of the class {@code NodeLocator} locate the {@link ASTNode AST node } associated with a
11023 * source range, given the AST structure built from the source. More specificall y, they will return
11024 * the {@link ASTNode AST node} with the shortest length whose source range comp letely encompasses
11025 * the specified range.
11026 */
11027 class NodeLocator extends GeneralizingASTVisitor<Object> {
Jennifer Messerly 2013/02/13 21:36:54 nice, very useful for answering the question of "w
11028 /**
11029 * The start offset of the range used to identify the node.
11030 */
11031 int _startOffset = 0;
11032 /**
11033 * The end offset of the range used to identify the node.
11034 */
11035 int _endOffset = 0;
11036 /**
11037 * The element that was found that corresponds to the given source range, or { @code null} if there
11038 * is no such element.
11039 */
11040 ASTNode _foundNode;
11041 /**
11042 * Initialize a newly created locator to locate one or more {@link ASTNode AST nodes} by locating
11043 * the node within an AST structure that corresponds to the given offset in th e source.
11044 * @param offset the offset used to identify the node
11045 */
11046 NodeLocator.con1(int offset) {
11047 _jtd_constructor_114_impl(offset);
11048 }
11049 _jtd_constructor_114_impl(int offset) {
11050 _jtd_constructor_115_impl(offset, offset);
11051 }
11052 /**
11053 * Initialize a newly created locator to locate one or more {@link ASTNode AST nodes} by locating
11054 * the node within an AST structure that corresponds to the given range of cha racters in the
11055 * source.
11056 * @param start the start offset of the range used to identify the node
11057 * @param end the end offset of the range used to identify the node
11058 */
11059 NodeLocator.con2(int start, int end) {
11060 _jtd_constructor_115_impl(start, end);
11061 }
11062 _jtd_constructor_115_impl(int start, int end) {
11063 this._startOffset = start;
11064 this._endOffset = end;
11065 }
11066 /**
11067 * Return the node that was found that corresponds to the given source range, or {@code null} if
11068 * there is no such node.
11069 * @return the node that was found
11070 */
11071 ASTNode get foundNode => _foundNode;
11072 /**
11073 * Search within the given AST node for an identifier representing a {@link Da rtElement Dart
11074 * element} in the specified source range. Return the element that was found, or {@code null} if
11075 * no element was found.
11076 * @param node the AST node within which to search
11077 * @return the element that was found
11078 */
11079 ASTNode searchWithin(ASTNode node) {
11080 try {
11081 node.accept(this);
11082 } on NodeLocator_NodeFoundException catch (exception) {
11083 } on JavaException catch (exception) {
11084 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a t offset (${_startOffset} - ${_endOffset})", exception);
11085 return null;
11086 }
11087 return _foundNode;
11088 }
11089 Object visitNode(ASTNode node) {
11090 try {
11091 node.visitChildren(this);
11092 } on NodeLocator_NodeFoundException catch (exception) {
11093 throw exception;
11094 } on JavaException catch (exception) {
11095 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra versing an AST structure.", exception);
11096 }
11097 int start = node.offset;
11098 int end = start + node.length;
11099 if (start <= _startOffset && _endOffset <= end) {
11100 _foundNode = node;
11101 throw new NodeLocator_NodeFoundException();
11102 }
11103 return null;
11104 }
11105 }
11106 /**
10076 * Instances of the class {@code NodeFoundException} are used to cancel visiting after a node has 11107 * Instances of the class {@code NodeFoundException} are used to cancel visiting after a node has
10077 * been found. 11108 * been found.
10078 */ 11109 */
10079 class NodeLocator_NodeFoundException extends RuntimeException { 11110 class NodeLocator_NodeFoundException extends RuntimeException {
10080 static int _serialVersionUID = 1; 11111 static int _serialVersionUID = 1;
10081 } 11112 }
10082 /** 11113 /**
10083 * Instances of the class {@code RecursiveASTVisitor} implement an AST visitor t hat will recursively 11114 * Instances of the class {@code RecursiveASTVisitor} implement an AST visitor t hat will recursively
10084 * visit all of the nodes in an AST structure. For example, using an instance of this class to visit 11115 * visit all of the nodes in an AST structure. For example, using an instance of this class to visit
10085 * a {@link Block} will also cause all of the statements in the block to be visi ted. 11116 * a {@link Block} will also cause all of the statements in the block to be visi ted.
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
10719 } 11750 }
10720 visit(node.superclass); 11751 visit(node.superclass);
10721 visit3(" ", node.withClause); 11752 visit3(" ", node.withClause);
10722 visit3(" ", node.implementsClause); 11753 visit3(" ", node.implementsClause);
10723 _writer.print(";"); 11754 _writer.print(";");
10724 return null; 11755 return null;
10725 } 11756 }
10726 Object visitComment(Comment node) => null; 11757 Object visitComment(Comment node) => null;
10727 Object visitCommentReference(CommentReference node) => null; 11758 Object visitCommentReference(CommentReference node) => null;
10728 Object visitCompilationUnit(CompilationUnit node) { 11759 Object visitCompilationUnit(CompilationUnit node) {
10729 ScriptTag scriptTag4 = node.scriptTag; 11760 ScriptTag scriptTag6 = node.scriptTag;
10730 NodeList<Directive> directives2 = node.directives; 11761 NodeList<Directive> directives2 = node.directives;
10731 visit(scriptTag4); 11762 visit(scriptTag6);
10732 String prefix = scriptTag4 == null ? "" : " "; 11763 String prefix = scriptTag6 == null ? "" : " ";
10733 visitList4(prefix, directives2, " "); 11764 visitList4(prefix, directives2, " ");
10734 prefix = scriptTag4 == null && directives2.isEmpty ? "" : " "; 11765 prefix = scriptTag6 == null && directives2.isEmpty ? "" : " ";
10735 visitList4(prefix, node.declarations, " "); 11766 visitList4(prefix, node.declarations, " ");
10736 return null; 11767 return null;
10737 } 11768 }
10738 Object visitConditionalExpression(ConditionalExpression node) { 11769 Object visitConditionalExpression(ConditionalExpression node) {
10739 visit(node.condition); 11770 visit(node.condition);
10740 _writer.print(" ? "); 11771 _writer.print(" ? ");
10741 visit(node.thenExpression); 11772 visit(node.thenExpression);
10742 _writer.print(" : "); 11773 _writer.print(" : ");
10743 visit(node.elseExpression); 11774 visit(node.elseExpression);
10744 return null; 11775 return null;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
10797 Object visitEmptyFunctionBody(EmptyFunctionBody node) { 11828 Object visitEmptyFunctionBody(EmptyFunctionBody node) {
10798 _writer.print(';'); 11829 _writer.print(';');
10799 return null; 11830 return null;
10800 } 11831 }
10801 Object visitEmptyStatement(EmptyStatement node) { 11832 Object visitEmptyStatement(EmptyStatement node) {
10802 _writer.print(';'); 11833 _writer.print(';');
10803 return null; 11834 return null;
10804 } 11835 }
10805 Object visitExportDirective(ExportDirective node) { 11836 Object visitExportDirective(ExportDirective node) {
10806 _writer.print("export "); 11837 _writer.print("export ");
10807 visit(node.libraryUri); 11838 visit(node.uri);
10808 visitList4(" ", node.combinators, " "); 11839 visitList4(" ", node.combinators, " ");
10809 _writer.print(';'); 11840 _writer.print(';');
10810 return null; 11841 return null;
10811 } 11842 }
10812 Object visitExpressionFunctionBody(ExpressionFunctionBody node) { 11843 Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
10813 _writer.print("=> "); 11844 _writer.print("=> ");
10814 visit(node.expression); 11845 visit(node.expression);
10815 if (node.semicolon != null) { 11846 if (node.semicolon != null) {
10816 _writer.print(';'); 11847 _writer.print(';');
10817 } 11848 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
10853 String groupEnd = null; 11884 String groupEnd = null;
10854 _writer.print('('); 11885 _writer.print('(');
10855 NodeList<FormalParameter> parameters9 = node.parameters; 11886 NodeList<FormalParameter> parameters9 = node.parameters;
10856 int size2 = parameters9.length; 11887 int size2 = parameters9.length;
10857 for (int i = 0; i < size2; i++) { 11888 for (int i = 0; i < size2; i++) {
10858 FormalParameter parameter = parameters9[i]; 11889 FormalParameter parameter = parameters9[i];
10859 if (i > 0) { 11890 if (i > 0) {
10860 _writer.print(", "); 11891 _writer.print(", ");
10861 } 11892 }
10862 if (groupEnd == null && parameter is DefaultFormalParameter) { 11893 if (groupEnd == null && parameter is DefaultFormalParameter) {
10863 if (parameter.kind == ParameterKind.NAMED) { 11894 if (identical(parameter.kind, ParameterKind.NAMED)) {
10864 groupEnd = "}"; 11895 groupEnd = "}";
10865 _writer.print('{'); 11896 _writer.print('{');
10866 } else { 11897 } else {
10867 groupEnd = "]"; 11898 groupEnd = "]";
10868 _writer.print('['); 11899 _writer.print('[');
10869 } 11900 }
10870 } 11901 }
10871 parameter.accept(this); 11902 parameter.accept(this);
10872 } 11903 }
10873 if (groupEnd != null) { 11904 if (groupEnd != null) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
10943 visit3(" else ", node.elseStatement); 11974 visit3(" else ", node.elseStatement);
10944 return null; 11975 return null;
10945 } 11976 }
10946 Object visitImplementsClause(ImplementsClause node) { 11977 Object visitImplementsClause(ImplementsClause node) {
10947 _writer.print("implements "); 11978 _writer.print("implements ");
10948 visitList2(node.interfaces, ", "); 11979 visitList2(node.interfaces, ", ");
10949 return null; 11980 return null;
10950 } 11981 }
10951 Object visitImportDirective(ImportDirective node) { 11982 Object visitImportDirective(ImportDirective node) {
10952 _writer.print("import "); 11983 _writer.print("import ");
10953 visit(node.libraryUri); 11984 visit(node.uri);
10954 visit3(" as ", node.prefix); 11985 visit3(" as ", node.prefix);
10955 visitList4(" ", node.combinators, " "); 11986 visitList4(" ", node.combinators, " ");
10956 _writer.print(';'); 11987 _writer.print(';');
10957 return null; 11988 return null;
10958 } 11989 }
10959 Object visitIndexExpression(IndexExpression node) { 11990 Object visitIndexExpression(IndexExpression node) {
10960 if (node.isCascaded()) { 11991 if (node.isCascaded()) {
10961 _writer.print(".."); 11992 _writer.print("..");
10962 } else { 11993 } else {
10963 visit(node.array); 11994 visit(node.array);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
11083 return null; 12114 return null;
11084 } 12115 }
11085 Object visitParenthesizedExpression(ParenthesizedExpression node) { 12116 Object visitParenthesizedExpression(ParenthesizedExpression node) {
11086 _writer.print('('); 12117 _writer.print('(');
11087 visit(node.expression); 12118 visit(node.expression);
11088 _writer.print(')'); 12119 _writer.print(')');
11089 return null; 12120 return null;
11090 } 12121 }
11091 Object visitPartDirective(PartDirective node) { 12122 Object visitPartDirective(PartDirective node) {
11092 _writer.print("part "); 12123 _writer.print("part ");
11093 visit(node.partUri); 12124 visit(node.uri);
11094 _writer.print(';'); 12125 _writer.print(';');
11095 return null; 12126 return null;
11096 } 12127 }
11097 Object visitPartOfDirective(PartOfDirective node) { 12128 Object visitPartOfDirective(PartOfDirective node) {
11098 _writer.print("part of "); 12129 _writer.print("part of ");
11099 visit(node.libraryName); 12130 visit(node.libraryName);
11100 _writer.print(';'); 12131 _writer.print(';');
11101 return null; 12132 return null;
11102 } 12133 }
11103 Object visitPostfixExpression(PostfixExpression node) { 12134 Object visitPostfixExpression(PostfixExpression node) {
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
11448 return elements[elements.length - 1].endToken; 12479 return elements[elements.length - 1].endToken;
11449 } 12480 }
11450 /** 12481 /**
11451 * Return the node that is the parent of each of the elements in the list. 12482 * Return the node that is the parent of each of the elements in the list.
11452 * @return the node that is the parent of each of the elements in the list 12483 * @return the node that is the parent of each of the elements in the list
11453 */ 12484 */
11454 ASTNode getOwner() { 12485 ASTNode getOwner() {
11455 return owner; 12486 return owner;
11456 } 12487 }
11457 } 12488 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698