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

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

Issue 14308011: New Analysis Engine snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 'source.dart' show LineInfo; 10 import 'source.dart' show LineInfo;
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 R visitLabel(Label node); 268 R visitLabel(Label node);
269 R visitLabeledStatement(LabeledStatement node); 269 R visitLabeledStatement(LabeledStatement node);
270 R visitLibraryDirective(LibraryDirective node); 270 R visitLibraryDirective(LibraryDirective node);
271 R visitLibraryIdentifier(LibraryIdentifier node); 271 R visitLibraryIdentifier(LibraryIdentifier node);
272 R visitListLiteral(ListLiteral node); 272 R visitListLiteral(ListLiteral node);
273 R visitMapLiteral(MapLiteral node); 273 R visitMapLiteral(MapLiteral node);
274 R visitMapLiteralEntry(MapLiteralEntry node); 274 R visitMapLiteralEntry(MapLiteralEntry node);
275 R visitMethodDeclaration(MethodDeclaration node); 275 R visitMethodDeclaration(MethodDeclaration node);
276 R visitMethodInvocation(MethodInvocation node); 276 R visitMethodInvocation(MethodInvocation node);
277 R visitNamedExpression(NamedExpression node); 277 R visitNamedExpression(NamedExpression node);
278 R visitNativeFunctionBody(NativeFunctionBody node);
278 R visitNullLiteral(NullLiteral node); 279 R visitNullLiteral(NullLiteral node);
279 R visitParenthesizedExpression(ParenthesizedExpression node); 280 R visitParenthesizedExpression(ParenthesizedExpression node);
280 R visitPartDirective(PartDirective node); 281 R visitPartDirective(PartDirective node);
281 R visitPartOfDirective(PartOfDirective node); 282 R visitPartOfDirective(PartOfDirective node);
282 R visitPostfixExpression(PostfixExpression node); 283 R visitPostfixExpression(PostfixExpression node);
283 R visitPrefixedIdentifier(PrefixedIdentifier node); 284 R visitPrefixedIdentifier(PrefixedIdentifier node);
284 R visitPrefixExpression(PrefixExpression node); 285 R visitPrefixExpression(PrefixExpression node);
285 R visitPropertyAccess(PropertyAccess node); 286 R visitPropertyAccess(PropertyAccess node);
286 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) ; 287 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) ;
287 R visitRethrowExpression(RethrowExpression node); 288 R visitRethrowExpression(RethrowExpression node);
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 return children; 468 return children;
468 } 469 }
469 } 470 }
470 /** 471 /**
471 * Instances of the class {@code Annotation} represent an annotation that can be associated with an 472 * Instances of the class {@code Annotation} represent an annotation that can be associated with an
472 * AST node. 473 * AST node.
473 * <pre> 474 * <pre>
474 * metadata ::= 475 * metadata ::=
475 * annotation 476 * annotation
476 * annotation ::= 477 * annotation ::=
477 * '@' {@link Identifier qualified} (‘.’ {@link SimpleIdentifier identifier} )? {@link ArgumentList arguments}? 478 * '@' {@link Identifier qualified} ('.' {@link SimpleIdentifier identifier})? { @link ArgumentList arguments}?
478 * </pre> 479 * </pre>
479 * @coverage dart.engine.ast 480 * @coverage dart.engine.ast
480 */ 481 */
481 class Annotation extends ASTNode { 482 class Annotation extends ASTNode {
482 /** 483 /**
483 * The at sign that introduced the annotation. 484 * The at sign that introduced the annotation.
484 */ 485 */
485 Token _atSign; 486 Token _atSign;
486 /** 487 /**
487 * The name of the class defining the constructor that is being invoked or the name of the field 488 * The name of the class defining the constructor that is being invoked or the name of the field
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 * @param constructorName the name of the constructor being invoked 594 * @param constructorName the name of the constructor being invoked
594 */ 595 */
595 void set constructorName(SimpleIdentifier constructorName2) { 596 void set constructorName(SimpleIdentifier constructorName2) {
596 this._constructorName = becomeParentOf(constructorName2); 597 this._constructorName = becomeParentOf(constructorName2);
597 } 598 }
598 /** 599 /**
599 * Set the name of the class defining the constructor that is being invoked or the name of the 600 * Set the name of the class defining the constructor that is being invoked or the name of the
600 * field that is being referenced to the given name. 601 * field that is being referenced to the given name.
601 * @param name the name of the constructor being invoked or the name of the fi eld being referenced 602 * @param name the name of the constructor being invoked or the name of the fi eld being referenced
602 */ 603 */
603 void set name(Identifier name2) { 604 void set name(Identifier name3) {
604 this._name = becomeParentOf(name2); 605 this._name = becomeParentOf(name3);
605 } 606 }
606 /** 607 /**
607 * Set the period before the constructor name to the given token. 608 * Set the period before the constructor name to the given token.
608 * @param period the period before the constructor name 609 * @param period the period before the constructor name
609 */ 610 */
610 void set period(Token period2) { 611 void set period(Token period2) {
611 this._period = period2; 612 this._period = period2;
612 } 613 }
613 void visitChildren(ASTVisitor<Object> visitor) { 614 void visitChildren(ASTVisitor<Object> visitor) {
614 safelyVisitChild(_name, visitor); 615 safelyVisitChild(_name, visitor);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 SimpleIdentifier get identifier => _identifier; 658 SimpleIdentifier get identifier => _identifier;
658 /** 659 /**
659 * Return the token representing the question mark. 660 * Return the token representing the question mark.
660 * @return the token representing the question mark 661 * @return the token representing the question mark
661 */ 662 */
662 Token get question => _question; 663 Token get question => _question;
663 /** 664 /**
664 * Set the identifier representing the argument being tested to the given iden tifier. 665 * Set the identifier representing the argument being tested to the given iden tifier.
665 * @param identifier the identifier representing the argument being tested 666 * @param identifier the identifier representing the argument being tested
666 */ 667 */
667 void set identifier(SimpleIdentifier identifier7) { 668 void set identifier(SimpleIdentifier identifier8) {
668 this._identifier = becomeParentOf(identifier7); 669 this._identifier = becomeParentOf(identifier8);
669 } 670 }
670 /** 671 /**
671 * Set the token representing the question mark to the given token. 672 * Set the token representing the question mark to the given token.
672 * @param question the token representing the question mark 673 * @param question the token representing the question mark
673 */ 674 */
674 void set question(Token question2) { 675 void set question(Token question2) {
675 this._question = question2; 676 this._question = question2;
676 } 677 }
677 void visitChildren(ASTVisitor<Object> visitor) { 678 void visitChildren(ASTVisitor<Object> visitor) {
678 safelyVisitChild(_identifier, visitor); 679 safelyVisitChild(_identifier, visitor);
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
2128 * Set the implements clause for this class to the given implements clause. 2129 * Set the implements clause for this class to the given implements clause.
2129 * @param implementsClause the implements clause for this class 2130 * @param implementsClause the implements clause for this class
2130 */ 2131 */
2131 void set implementsClause(ImplementsClause implementsClause5) { 2132 void set implementsClause(ImplementsClause implementsClause5) {
2132 this._implementsClause = becomeParentOf(implementsClause5); 2133 this._implementsClause = becomeParentOf(implementsClause5);
2133 } 2134 }
2134 /** 2135 /**
2135 * Set the name of the class being declared to the given identifier. 2136 * Set the name of the class being declared to the given identifier.
2136 * @param name the name of the class being declared 2137 * @param name the name of the class being declared
2137 */ 2138 */
2138 void set name(SimpleIdentifier name3) { 2139 void set name(SimpleIdentifier name4) {
2139 this._name = becomeParentOf(name3); 2140 this._name = becomeParentOf(name4);
2140 } 2141 }
2141 /** 2142 /**
2142 * Set the name of the superclass of the class being declared to the given nam e. 2143 * Set the name of the superclass of the class being declared to the given nam e.
2143 * @param superclass the name of the superclass of the class being declared 2144 * @param superclass the name of the superclass of the class being declared
2144 */ 2145 */
2145 void set superclass(TypeName superclass2) { 2146 void set superclass(TypeName superclass2) {
2146 this._superclass = becomeParentOf(superclass2); 2147 this._superclass = becomeParentOf(superclass2);
2147 } 2148 }
2148 /** 2149 /**
2149 * Set the type parameters for the class to the given list of parameters. 2150 * Set the type parameters for the class to the given list of parameters.
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
2287 Comment({List<Token> tokens, CommentType type, List<CommentReference> referenc es}) : this.full(tokens, type, references); 2288 Comment({List<Token> tokens, CommentType type, List<CommentReference> referenc es}) : this.full(tokens, type, references);
2288 accept(ASTVisitor visitor) => visitor.visitComment(this); 2289 accept(ASTVisitor visitor) => visitor.visitComment(this);
2289 Token get beginToken => _tokens[0]; 2290 Token get beginToken => _tokens[0];
2290 Token get endToken => _tokens[_tokens.length - 1]; 2291 Token get endToken => _tokens[_tokens.length - 1];
2291 /** 2292 /**
2292 * Return the references embedded within the documentation comment. 2293 * Return the references embedded within the documentation comment.
2293 * @return the references embedded within the documentation comment 2294 * @return the references embedded within the documentation comment
2294 */ 2295 */
2295 NodeList<CommentReference> get references => _references; 2296 NodeList<CommentReference> get references => _references;
2296 /** 2297 /**
2298 * Return the tokens representing the comment.
2299 * @return the tokens representing the comment
2300 */
2301 List<Token> get tokens => _tokens;
2302 /**
2297 * Return {@code true} if this is a block comment. 2303 * Return {@code true} if this is a block comment.
2298 * @return {@code true} if this is a block comment 2304 * @return {@code true} if this is a block comment
2299 */ 2305 */
2300 bool isBlock() => identical(_type, CommentType.BLOCK); 2306 bool isBlock() => identical(_type, CommentType.BLOCK);
2301 /** 2307 /**
2302 * Return {@code true} if this is a documentation comment. 2308 * Return {@code true} if this is a documentation comment.
2303 * @return {@code true} if this is a documentation comment 2309 * @return {@code true} if this is a documentation comment
2304 */ 2310 */
2305 bool isDocumentation() => identical(_type, CommentType.DOCUMENTATION); 2311 bool isDocumentation() => identical(_type, CommentType.DOCUMENTATION);
2306 /** 2312 /**
2307 * Return {@code true} if this is an end-of-line comment. 2313 * Return {@code true} if this is an end-of-line comment.
2308 * @return {@code true} if this is an end-of-line comment 2314 * @return {@code true} if this is an end-of-line comment
2309 */ 2315 */
2310 bool isEndOfLine() => identical(_type, CommentType.END_OF_LINE); 2316 bool isEndOfLine() => identical(_type, CommentType.END_OF_LINE);
2311 void visitChildren(ASTVisitor<Object> visitor) { 2317 void visitChildren(ASTVisitor<Object> visitor) {
2312 _references.accept(visitor); 2318 _references.accept(visitor);
2313 } 2319 }
2314 } 2320 }
2315 /** 2321 /**
2316 * The enumeration {@code CommentType} encodes all the different types of commen ts that are 2322 * The enumeration {@code CommentType} encodes all the different types of commen ts that are
2317 * recognized by the parser. 2323 * recognized by the parser.
2318 */ 2324 */
2319 class CommentType { 2325 class CommentType implements Comparable<CommentType> {
2320 /** 2326 /**
2321 * An end-of-line comment. 2327 * An end-of-line comment.
2322 */ 2328 */
2323 static final CommentType END_OF_LINE = new CommentType('END_OF_LINE', 0); 2329 static final CommentType END_OF_LINE = new CommentType('END_OF_LINE', 0);
2324 /** 2330 /**
2325 * A block comment. 2331 * A block comment.
2326 */ 2332 */
2327 static final CommentType BLOCK = new CommentType('BLOCK', 1); 2333 static final CommentType BLOCK = new CommentType('BLOCK', 1);
2328 /** 2334 /**
2329 * A documentation comment. 2335 * A documentation comment.
2330 */ 2336 */
2331 static final CommentType DOCUMENTATION = new CommentType('DOCUMENTATION', 2); 2337 static final CommentType DOCUMENTATION = new CommentType('DOCUMENTATION', 2);
2332 static final List<CommentType> values = [END_OF_LINE, BLOCK, DOCUMENTATION]; 2338 static final List<CommentType> values = [END_OF_LINE, BLOCK, DOCUMENTATION];
2333 final String __name; 2339 final String __name;
2334 final int __ordinal; 2340 final int __ordinal;
2335 int get ordinal => __ordinal; 2341 int get ordinal => __ordinal;
2336 CommentType(this.__name, this.__ordinal) { 2342 CommentType(this.__name, this.__ordinal) {
2337 } 2343 }
2344 int compareTo(CommentType other) => __ordinal - other.__ordinal;
2338 String toString() => __name; 2345 String toString() => __name;
2339 } 2346 }
2340 /** 2347 /**
2341 * Instances of the class {@code CommentReference} represent a reference to a Da rt element that is 2348 * Instances of the class {@code CommentReference} represent a reference to a Da rt element that is
2342 * found within a documentation comment. 2349 * found within a documentation comment.
2343 * <pre> 2350 * <pre>
2344 * commentReference ::= 2351 * commentReference ::=
2345 * '[' 'new'? {@link Identifier identifier} ']' 2352 * '[' 'new'? {@link Identifier identifier} ']'
2346 * </pre> 2353 * </pre>
2347 * @coverage dart.engine.ast 2354 * @coverage dart.engine.ast
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2380 Identifier get identifier => _identifier; 2387 Identifier get identifier => _identifier;
2381 /** 2388 /**
2382 * Return the token representing the 'new' keyword, or {@code null} if there w as no 'new' keyword. 2389 * Return the token representing the 'new' keyword, or {@code null} if there w as no 'new' keyword.
2383 * @return the token representing the 'new' keyword 2390 * @return the token representing the 'new' keyword
2384 */ 2391 */
2385 Token get newKeyword => _newKeyword; 2392 Token get newKeyword => _newKeyword;
2386 /** 2393 /**
2387 * Set the identifier being referenced to the given identifier. 2394 * Set the identifier being referenced to the given identifier.
2388 * @param identifier the identifier being referenced 2395 * @param identifier the identifier being referenced
2389 */ 2396 */
2390 void set identifier(Identifier identifier24) { 2397 void set identifier(Identifier identifier26) {
2391 identifier24 = becomeParentOf(identifier24); 2398 identifier26 = becomeParentOf(identifier26);
2392 } 2399 }
2393 /** 2400 /**
2394 * Set the token representing the 'new' keyword to the given token. 2401 * Set the token representing the 'new' keyword to the given token.
2395 * @param newKeyword the token representing the 'new' keyword 2402 * @param newKeyword the token representing the 'new' keyword
2396 */ 2403 */
2397 void set newKeyword(Token newKeyword2) { 2404 void set newKeyword(Token newKeyword2) {
2398 this._newKeyword = newKeyword2; 2405 this._newKeyword = newKeyword2;
2399 } 2406 }
2400 void visitChildren(ASTVisitor<Object> visitor) { 2407 void visitChildren(ASTVisitor<Object> visitor) {
2401 safelyVisitChild(_identifier, visitor); 2408 safelyVisitChild(_identifier, visitor);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2559 } 2566 }
2560 /** 2567 /**
2561 * Set the {@link LineInfo} object for this compilation unit. 2568 * Set the {@link LineInfo} object for this compilation unit.
2562 * @param errors LineInfo to associate with this compilation unit 2569 * @param errors LineInfo to associate with this compilation unit
2563 */ 2570 */
2564 void set lineInfo(LineInfo lineInfo2) { 2571 void set lineInfo(LineInfo lineInfo2) {
2565 this._lineInfo = lineInfo2; 2572 this._lineInfo = lineInfo2;
2566 } 2573 }
2567 /** 2574 /**
2568 * Called to cache the parsing errors when the unit is parsed. 2575 * Called to cache the parsing errors when the unit is parsed.
2569 * @param errors an array of parsing errors, if <code>null</code> is passed, t he error array is 2576 * @param errors an array of parsing errors, if {@code null} is passed, the er ror array is set to
2570 * set to an empty array, {@link AnalysisError#NO_ERRORS} 2577 * an empty array, {@link AnalysisError#NO_ERRORS}
2571 */ 2578 */
2572 void set parsingErrors(List<AnalysisError> errors) { 2579 void set parsingErrors(List<AnalysisError> errors) {
2573 _parsingErrors = errors == null ? AnalysisError.NO_ERRORS : errors; 2580 _parsingErrors = errors == null ? AnalysisError.NO_ERRORS : errors;
2574 } 2581 }
2575 /** 2582 /**
2576 * Called to cache the resolution errors when the unit is resolved. 2583 * Called to cache the resolution errors when the unit is resolved.
2577 * @param errors an array of resolution errors, if <code>null</code> is passed , the error array is 2584 * @param errors an array of resolution errors, if {@code null} is passed, the error array is set
2578 * set to an empty array, {@link AnalysisError#NO_ERRORS} 2585 * to an empty array, {@link AnalysisError#NO_ERRORS}
2579 */ 2586 */
2580 void set resolutionErrors(List<AnalysisError> errors) { 2587 void set resolutionErrors(List<AnalysisError> errors) {
2581 _resolutionErrors = errors == null ? AnalysisError.NO_ERRORS : errors; 2588 _resolutionErrors = errors == null ? AnalysisError.NO_ERRORS : errors;
2582 } 2589 }
2583 /** 2590 /**
2584 * Set the script tag at the beginning of the compilation unit to the given sc ript tag. 2591 * Set the script tag at the beginning of the compilation unit to the given sc ript tag.
2585 * @param scriptTag the script tag at the beginning of the compilation unit 2592 * @param scriptTag the script tag at the beginning of the compilation unit
2586 */ 2593 */
2587 void set scriptTag(ScriptTag scriptTag2) { 2594 void set scriptTag(ScriptTag scriptTag2) {
2588 this._scriptTag = becomeParentOf(scriptTag2); 2595 this._scriptTag = becomeParentOf(scriptTag2);
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
3295 * Set the element associated with this constructor name to the given element. 3302 * Set the element associated with this constructor name to the given element.
3296 * @param element the element associated with this constructor name 3303 * @param element the element associated with this constructor name
3297 */ 3304 */
3298 void set element(ConstructorElement element7) { 3305 void set element(ConstructorElement element7) {
3299 this._element = element7; 3306 this._element = element7;
3300 } 3307 }
3301 /** 3308 /**
3302 * Set the name of the constructor to the given name. 3309 * Set the name of the constructor to the given name.
3303 * @param name the name of the constructor 3310 * @param name the name of the constructor
3304 */ 3311 */
3305 void set name(SimpleIdentifier name4) { 3312 void set name(SimpleIdentifier name5) {
3306 this._name = becomeParentOf(name4); 3313 this._name = becomeParentOf(name5);
3307 } 3314 }
3308 /** 3315 /**
3309 * Return the token for the period before the constructor name to the given to ken. 3316 * Return the token for the period before the constructor name to the given to ken.
3310 * @param period the token for the period before the constructor name 3317 * @param period the token for the period before the constructor name
3311 */ 3318 */
3312 void set period(Token period5) { 3319 void set period(Token period5) {
3313 this._period = period5; 3320 this._period = period5;
3314 } 3321 }
3315 /** 3322 /**
3316 * Set the name of the type defining the constructor to the given type name. 3323 * Set the name of the type defining the constructor to the given type name.
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
3472 * Initialize a newly created formal parameter. 3479 * Initialize a newly created formal parameter.
3473 * @param comment the documentation comment associated with this parameter 3480 * @param comment the documentation comment associated with this parameter
3474 * @param metadata the annotations associated with this parameter 3481 * @param metadata the annotations associated with this parameter
3475 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 3482 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
3476 * @param type the name of the declared type of the parameter 3483 * @param type the name of the declared type of the parameter
3477 * @param identifier the name of the parameter being declared 3484 * @param identifier the name of the parameter being declared
3478 */ 3485 */
3479 DeclaredIdentifier({Comment comment, List<Annotation> metadata, Token keyword, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, key word, type, identifier); 3486 DeclaredIdentifier({Comment comment, List<Annotation> metadata, Token keyword, TypeName type, SimpleIdentifier identifier}) : this.full(comment, metadata, key word, type, identifier);
3480 accept(ASTVisitor visitor) => visitor.visitDeclaredIdentifier(this); 3487 accept(ASTVisitor visitor) => visitor.visitDeclaredIdentifier(this);
3481 LocalVariableElement get element { 3488 LocalVariableElement get element {
3482 SimpleIdentifier identifier11 = identifier; 3489 SimpleIdentifier identifier12 = identifier;
3483 if (identifier11 == null) { 3490 if (identifier12 == null) {
3484 return null; 3491 return null;
3485 } 3492 }
3486 return identifier11.element as LocalVariableElement; 3493 return identifier12.element as LocalVariableElement;
3487 } 3494 }
3488 Token get endToken => _identifier.endToken; 3495 Token get endToken => _identifier.endToken;
3489 /** 3496 /**
3490 * Return the name of the variable being declared. 3497 * Return the name of the variable being declared.
3491 * @return the name of the variable being declared 3498 * @return the name of the variable being declared
3492 */ 3499 */
3493 SimpleIdentifier get identifier => _identifier; 3500 SimpleIdentifier get identifier => _identifier;
3494 /** 3501 /**
3495 * Return the token representing either the 'final', 'const' or 'var' keyword. 3502 * Return the token representing either the 'final', 'const' or 'var' keyword.
3496 * @return the token representing either the 'final', 'const' or 'var' keyword 3503 * @return the token representing either the 'final', 'const' or 'var' keyword
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after
4954 * formalParameter ::={@link NormalFormalParameter normalFormalParameter}| {@lin k DefaultFormalParameter namedFormalParameter}| {@link DefaultFormalParameter op tionalFormalParameter}</pre> 4961 * formalParameter ::={@link NormalFormalParameter normalFormalParameter}| {@lin k DefaultFormalParameter namedFormalParameter}| {@link DefaultFormalParameter op tionalFormalParameter}</pre>
4955 * @coverage dart.engine.ast 4962 * @coverage dart.engine.ast
4956 */ 4963 */
4957 abstract class FormalParameter extends ASTNode { 4964 abstract class FormalParameter extends ASTNode {
4958 /** 4965 /**
4959 * Return the element representing this parameter, or {@code null} if this par ameter has not been 4966 * Return the element representing this parameter, or {@code null} if this par ameter has not been
4960 * resolved. 4967 * resolved.
4961 * @return the element representing this parameter 4968 * @return the element representing this parameter
4962 */ 4969 */
4963 ParameterElement get element { 4970 ParameterElement get element {
4964 SimpleIdentifier identifier12 = identifier; 4971 SimpleIdentifier identifier13 = identifier;
4965 if (identifier12 == null) { 4972 if (identifier13 == null) {
4966 return null; 4973 return null;
4967 } 4974 }
4968 return identifier12.element as ParameterElement; 4975 return identifier13.element as ParameterElement;
4969 } 4976 }
4970 /** 4977 /**
4971 * Return the name of the parameter being declared. 4978 * Return the name of the parameter being declared.
4972 * @return the name of the parameter being declared 4979 * @return the name of the parameter being declared
4973 */ 4980 */
4974 SimpleIdentifier get identifier; 4981 SimpleIdentifier get identifier;
4975 /** 4982 /**
4976 * Return the kind of this parameter. 4983 * Return the kind of this parameter.
4977 * @return the kind of this parameter 4984 * @return the kind of this parameter
4978 */ 4985 */
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
5576 /** 5583 /**
5577 * Return the type parameters for the function type, or {@code null} if the fu nction type does not 5584 * Return the type parameters for the function type, or {@code null} if the fu nction type does not
5578 * have any type parameters. 5585 * have any type parameters.
5579 * @return the type parameters for the function type 5586 * @return the type parameters for the function type
5580 */ 5587 */
5581 TypeParameterList get typeParameters => _typeParameters; 5588 TypeParameterList get typeParameters => _typeParameters;
5582 /** 5589 /**
5583 * Set the name of the function type being declared to the given identifier. 5590 * Set the name of the function type being declared to the given identifier.
5584 * @param name the name of the function type being declared 5591 * @param name the name of the function type being declared
5585 */ 5592 */
5586 void set name(SimpleIdentifier name5) { 5593 void set name(SimpleIdentifier name6) {
5587 this._name = becomeParentOf(name5); 5594 this._name = becomeParentOf(name6);
5588 } 5595 }
5589 /** 5596 /**
5590 * Set the parameters associated with the function type to the given list of p arameters. 5597 * Set the parameters associated with the function type to the given list of p arameters.
5591 * @param parameters the parameters associated with the function type 5598 * @param parameters the parameters associated with the function type
5592 */ 5599 */
5593 void set parameters(FormalParameterList parameters4) { 5600 void set parameters(FormalParameterList parameters4) {
5594 this._parameters = becomeParentOf(parameters4); 5601 this._parameters = becomeParentOf(parameters4);
5595 } 5602 }
5596 /** 5603 /**
5597 * Set the name of the return type of the function type being defined to the g iven type name. 5604 * Set the name of the return type of the function type being defined to the g iven type name.
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
6930 * Set the token representing the 'library' token to the given token. 6937 * Set the token representing the 'library' token to the given token.
6931 * @param libraryToken the token representing the 'library' token 6938 * @param libraryToken the token representing the 'library' token
6932 */ 6939 */
6933 void set libraryToken(Token libraryToken2) { 6940 void set libraryToken(Token libraryToken2) {
6934 this._libraryToken = libraryToken2; 6941 this._libraryToken = libraryToken2;
6935 } 6942 }
6936 /** 6943 /**
6937 * Set the name of the library being defined to the given name. 6944 * Set the name of the library being defined to the given name.
6938 * @param name the name of the library being defined 6945 * @param name the name of the library being defined
6939 */ 6946 */
6940 void set name(LibraryIdentifier name6) { 6947 void set name(LibraryIdentifier name7) {
6941 this._name = becomeParentOf(name6); 6948 this._name = becomeParentOf(name7);
6942 } 6949 }
6943 /** 6950 /**
6944 * Set the semicolon terminating the directive to the given token. 6951 * Set the semicolon terminating the directive to the given token.
6945 * @param semicolon the semicolon terminating the directive 6952 * @param semicolon the semicolon terminating the directive
6946 */ 6953 */
6947 void set semicolon(Token semicolon11) { 6954 void set semicolon(Token semicolon11) {
6948 this._semicolon = semicolon11; 6955 this._semicolon = semicolon11;
6949 } 6956 }
6950 void visitChildren(ASTVisitor<Object> visitor) { 6957 void visitChildren(ASTVisitor<Object> visitor) {
6951 super.visitChildren(visitor); 6958 super.visitChildren(visitor);
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
7807 /** 7814 /**
7808 * Set the semicolon terminating the directive to the given token. 7815 * Set the semicolon terminating the directive to the given token.
7809 * @param semicolon the semicolon terminating the directive 7816 * @param semicolon the semicolon terminating the directive
7810 */ 7817 */
7811 void set semicolon(Token semicolon12) { 7818 void set semicolon(Token semicolon12) {
7812 this._semicolon = semicolon12; 7819 this._semicolon = semicolon12;
7813 } 7820 }
7814 Token get firstTokenAfterCommentAndMetadata => _keyword; 7821 Token get firstTokenAfterCommentAndMetadata => _keyword;
7815 } 7822 }
7816 /** 7823 /**
7824 * Instances of the class {@code NativeFunctionBody} represent a function body t hat consists of a
7825 * native keyword followed by a string literal.
7826 * <pre>
7827 * nativeFunctionBody ::=
7828 * 'native' {@link SimpleStringLiteral simpleStringLiteral} ';'
7829 * </pre>
7830 * @coverage dart.engine.ast
7831 */
7832 class NativeFunctionBody extends FunctionBody {
7833 /**
7834 * The token representing 'native' that marks the start of the function body.
7835 */
7836 Token _nativeToken;
7837 /**
7838 * The string literal, after the 'native' token.
7839 */
7840 StringLiteral _stringLiteral;
7841 /**
7842 * The token representing the semicolon that marks the end of the function bod y.
7843 */
7844 Token _semicolon;
7845 /**
7846 * Initialize a newly created function body consisting of the 'native' token, a string literal,
7847 * and a semicolon.
7848 * @param nativeToken the token representing 'native' that marks the start of the function body
7849 * @param stringLiteral the string literal
7850 * @param semicolon the token representing the semicolon that marks the end of the function body
7851 */
7852 NativeFunctionBody.full(Token nativeToken, StringLiteral stringLiteral, Token semicolon) {
7853 this._nativeToken = nativeToken;
7854 this._stringLiteral = becomeParentOf(stringLiteral);
7855 this._semicolon = semicolon;
7856 }
7857 /**
7858 * Initialize a newly created function body consisting of the 'native' token, a string literal,
7859 * and a semicolon.
7860 * @param nativeToken the token representing 'native' that marks the start of the function body
7861 * @param stringLiteral the string literal
7862 * @param semicolon the token representing the semicolon that marks the end of the function body
7863 */
7864 NativeFunctionBody({Token nativeToken, StringLiteral stringLiteral, Token semi colon}) : this.full(nativeToken, stringLiteral, semicolon);
7865 accept(ASTVisitor visitor) => visitor.visitNativeFunctionBody(this);
7866 Token get beginToken => _nativeToken;
7867 Token get endToken => _semicolon;
7868 /**
7869 * Return the simple identifier representing the 'native' token.
7870 * @return the simple identifier representing the 'native' token
7871 */
7872 Token get nativeToken => _nativeToken;
7873 /**
7874 * Return the token representing the semicolon that marks the end of the funct ion body.
7875 * @return the token representing the semicolon that marks the end of the func tion body
7876 */
7877 Token get semicolon => _semicolon;
7878 /**
7879 * Return the string literal representing the string after the 'native' token.
7880 * @return the string literal representing the string after the 'native' token
7881 */
7882 StringLiteral get stringLiteral => _stringLiteral;
7883 void visitChildren(ASTVisitor<Object> visitor) {
7884 safelyVisitChild(_stringLiteral, visitor);
7885 }
7886 }
7887 /**
7817 * The abstract class {@code NormalFormalParameter} defines the behavior common to formal parameters 7888 * The abstract class {@code NormalFormalParameter} defines the behavior common to formal parameters
7818 * that are required (are not optional). 7889 * that are required (are not optional).
7819 * <pre> 7890 * <pre>
7820 * normalFormalParameter ::={@link FunctionTypedFormalParameter functionSignatur e}| {@link FieldFormalParameter fieldFormalParameter}| {@link SimpleFormalParame ter simpleFormalParameter}</pre> 7891 * normalFormalParameter ::={@link FunctionTypedFormalParameter functionSignatur e}| {@link FieldFormalParameter fieldFormalParameter}| {@link SimpleFormalParame ter simpleFormalParameter}</pre>
7821 * @coverage dart.engine.ast 7892 * @coverage dart.engine.ast
7822 */ 7893 */
7823 abstract class NormalFormalParameter extends FormalParameter { 7894 abstract class NormalFormalParameter extends FormalParameter {
7824 /** 7895 /**
7825 * The documentation comment associated with this parameter, or {@code null} i f this parameter 7896 * The documentation comment associated with this parameter, or {@code null} i f this parameter
7826 * does not have a documentation comment associated with it. 7897 * does not have a documentation comment associated with it.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
7888 * Set the documentation comment associated with this parameter to the given c omment 7959 * Set the documentation comment associated with this parameter to the given c omment
7889 * @param comment the documentation comment to be associated with this paramet er 7960 * @param comment the documentation comment to be associated with this paramet er
7890 */ 7961 */
7891 void set documentationComment(Comment comment3) { 7962 void set documentationComment(Comment comment3) {
7892 this._comment = becomeParentOf(comment3); 7963 this._comment = becomeParentOf(comment3);
7893 } 7964 }
7894 /** 7965 /**
7895 * Set the name of the parameter being declared to the given identifier. 7966 * Set the name of the parameter being declared to the given identifier.
7896 * @param identifier the name of the parameter being declared 7967 * @param identifier the name of the parameter being declared
7897 */ 7968 */
7898 void set identifier(SimpleIdentifier identifier8) { 7969 void set identifier(SimpleIdentifier identifier9) {
7899 this._identifier = becomeParentOf(identifier8); 7970 this._identifier = becomeParentOf(identifier9);
7900 } 7971 }
7901 void visitChildren(ASTVisitor<Object> visitor) { 7972 void visitChildren(ASTVisitor<Object> visitor) {
7902 if (commentIsBeforeAnnotations()) { 7973 if (commentIsBeforeAnnotations()) {
7903 safelyVisitChild(_comment, visitor); 7974 safelyVisitChild(_comment, visitor);
7904 _metadata.accept(visitor); 7975 _metadata.accept(visitor);
7905 } else { 7976 } else {
7906 for (ASTNode child in sortedCommentAndAnnotations) { 7977 for (ASTNode child in sortedCommentAndAnnotations) {
7907 child.accept(visitor); 7978 child.accept(visitor);
7908 } 7979 }
7909 } 7980 }
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
8452 Token get period => _period; 8523 Token get period => _period;
8453 /** 8524 /**
8454 * Return the prefix associated with the library in which the identifier is de fined. 8525 * Return the prefix associated with the library in which the identifier is de fined.
8455 * @return the prefix associated with the library in which the identifier is d efined 8526 * @return the prefix associated with the library in which the identifier is d efined
8456 */ 8527 */
8457 SimpleIdentifier get prefix => _prefix; 8528 SimpleIdentifier get prefix => _prefix;
8458 /** 8529 /**
8459 * Set the identifier being prefixed to the given identifier. 8530 * Set the identifier being prefixed to the given identifier.
8460 * @param identifier the identifier being prefixed 8531 * @param identifier the identifier being prefixed
8461 */ 8532 */
8462 void set identifier(SimpleIdentifier identifier9) { 8533 void set identifier(SimpleIdentifier identifier10) {
8463 this._identifier = becomeParentOf(identifier9); 8534 this._identifier = becomeParentOf(identifier10);
8464 } 8535 }
8465 /** 8536 /**
8466 * Set the period used to separate the prefix from the identifier to the given token. 8537 * Set the period used to separate the prefix from the identifier to the given token.
8467 * @param period the period used to separate the prefix from the identifier 8538 * @param period the period used to separate the prefix from the identifier
8468 */ 8539 */
8469 void set period(Token period10) { 8540 void set period(Token period10) {
8470 this._period = period10; 8541 this._period = period10;
8471 } 8542 }
8472 /** 8543 /**
8473 * Set the prefix associated with the library in which the identifier is defin ed to the given 8544 * Set the prefix associated with the library in which the identifier is defin ed to the given
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
9078 } else if (parent7 is ConstructorDeclaration) { 9149 } else if (parent7 is ConstructorDeclaration) {
9079 return identical(this, ((parent7 as ConstructorDeclaration)).name); 9150 return identical(this, ((parent7 as ConstructorDeclaration)).name);
9080 } else if (parent7 is FunctionDeclaration) { 9151 } else if (parent7 is FunctionDeclaration) {
9081 return identical(this, ((parent7 as FunctionDeclaration)).name); 9152 return identical(this, ((parent7 as FunctionDeclaration)).name);
9082 } else if (parent7 is FunctionTypeAlias) { 9153 } else if (parent7 is FunctionTypeAlias) {
9083 return identical(this, ((parent7 as FunctionTypeAlias)).name); 9154 return identical(this, ((parent7 as FunctionTypeAlias)).name);
9084 } else if (parent7 is Label) { 9155 } else if (parent7 is Label) {
9085 return identical(this, ((parent7 as Label)).label) && (parent7.parent is L abeledStatement); 9156 return identical(this, ((parent7 as Label)).label) && (parent7.parent is L abeledStatement);
9086 } else if (parent7 is MethodDeclaration) { 9157 } else if (parent7 is MethodDeclaration) {
9087 return identical(this, ((parent7 as MethodDeclaration)).name); 9158 return identical(this, ((parent7 as MethodDeclaration)).name);
9088 } else if (parent7 is NormalFormalParameter) { 9159 } else if (parent7 is FunctionTypedFormalParameter || parent7 is SimpleForma lParameter) {
9089 return identical(this, ((parent7 as NormalFormalParameter)).identifier); 9160 return identical(this, ((parent7 as NormalFormalParameter)).identifier);
9090 } else if (parent7 is TypeParameter) { 9161 } else if (parent7 is TypeParameter) {
9091 return identical(this, ((parent7 as TypeParameter)).name); 9162 return identical(this, ((parent7 as TypeParameter)).name);
9092 } else if (parent7 is VariableDeclaration) { 9163 } else if (parent7 is VariableDeclaration) {
9093 return identical(this, ((parent7 as VariableDeclaration)).name); 9164 return identical(this, ((parent7 as VariableDeclaration)).name);
9094 } 9165 }
9095 return false; 9166 return false;
9096 } 9167 }
9097 /** 9168 /**
9098 * Return {@code true} if this expression is computing a right-hand value. 9169 * Return {@code true} if this expression is computing a right-hand value.
(...skipping 13 matching lines...) Expand all
9112 parent8 = prefixed.parent; 9183 parent8 = prefixed.parent;
9113 target = prefixed; 9184 target = prefixed;
9114 } else if (parent8 is PropertyAccess) { 9185 } else if (parent8 is PropertyAccess) {
9115 PropertyAccess access = parent8 as PropertyAccess; 9186 PropertyAccess access = parent8 as PropertyAccess;
9116 if (identical(access.target, this)) { 9187 if (identical(access.target, this)) {
9117 return true; 9188 return true;
9118 } 9189 }
9119 parent8 = access.parent; 9190 parent8 = access.parent;
9120 target = access; 9191 target = access;
9121 } 9192 }
9193 if (parent8 is Label) {
9194 return false;
9195 }
9122 if (parent8 is AssignmentExpression) { 9196 if (parent8 is AssignmentExpression) {
9123 AssignmentExpression expr = parent8 as AssignmentExpression; 9197 AssignmentExpression expr = parent8 as AssignmentExpression;
9124 if (identical(expr.leftHandSide, target) && identical(expr.operator.type, TokenType.EQ)) { 9198 if (identical(expr.leftHandSide, target) && identical(expr.operator.type, TokenType.EQ)) {
9125 return false; 9199 return false;
9126 } 9200 }
9127 } 9201 }
9128 return true; 9202 return true;
9129 } 9203 }
9130 /** 9204 /**
9131 * Return {@code true} if this expression is computing a left-hand value. 9205 * Return {@code true} if this expression is computing a left-hand value.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
9166 * Set the element associated with this identifier to the given element. 9240 * Set the element associated with this identifier to the given element.
9167 * @param element the element associated with this identifier 9241 * @param element the element associated with this identifier
9168 */ 9242 */
9169 void set element(Element element16) { 9243 void set element(Element element16) {
9170 this._element = element16; 9244 this._element = element16;
9171 } 9245 }
9172 /** 9246 /**
9173 * Set the token representing the identifier to the given token. 9247 * Set the token representing the identifier to the given token.
9174 * @param token the token representing the literal 9248 * @param token the token representing the literal
9175 */ 9249 */
9176 void set token(Token token12) { 9250 void set token(Token token17) {
9177 this._token = token12; 9251 this._token = token17;
9178 } 9252 }
9179 void visitChildren(ASTVisitor<Object> visitor) { 9253 void visitChildren(ASTVisitor<Object> visitor) {
9180 } 9254 }
9181 } 9255 }
9182 /** 9256 /**
9183 * Instances of the class {@code SimpleStringLiteral} represent a string literal expression that 9257 * Instances of the class {@code SimpleStringLiteral} represent a string literal expression that
9184 * does not contain any interpolations. 9258 * does not contain any interpolations.
9185 * <pre> 9259 * <pre>
9186 * simpleStringLiteral ::= 9260 * simpleStringLiteral ::=
9187 * rawStringLiteral 9261 * rawStringLiteral
(...skipping 21 matching lines...) Expand all
9209 * The value of the literal. 9283 * The value of the literal.
9210 */ 9284 */
9211 String _value; 9285 String _value;
9212 /** 9286 /**
9213 * Initialize a newly created simple string literal. 9287 * Initialize a newly created simple string literal.
9214 * @param literal the token representing the literal 9288 * @param literal the token representing the literal
9215 * @param value the value of the literal 9289 * @param value the value of the literal
9216 */ 9290 */
9217 SimpleStringLiteral.full(Token literal, String value) { 9291 SimpleStringLiteral.full(Token literal, String value) {
9218 this._literal = literal; 9292 this._literal = literal;
9219 this._value = value; 9293 this._value = StringUtilities.intern(value);
9220 } 9294 }
9221 /** 9295 /**
9222 * Initialize a newly created simple string literal. 9296 * Initialize a newly created simple string literal.
9223 * @param literal the token representing the literal 9297 * @param literal the token representing the literal
9224 * @param value the value of the literal 9298 * @param value the value of the literal
9225 */ 9299 */
9226 SimpleStringLiteral({Token literal, String value}) : this.full(literal, value) ; 9300 SimpleStringLiteral({Token literal, String value}) : this.full(literal, value) ;
9227 accept(ASTVisitor visitor) => visitor.visitSimpleStringLiteral(this); 9301 accept(ASTVisitor visitor) => visitor.visitSimpleStringLiteral(this);
9228 Token get beginToken => _literal; 9302 Token get beginToken => _literal;
9229 Token get endToken => _literal; 9303 Token get endToken => _literal;
(...skipping 28 matching lines...) Expand all
9258 * @param literal the token representing the literal 9332 * @param literal the token representing the literal
9259 */ 9333 */
9260 void set literal(Token literal6) { 9334 void set literal(Token literal6) {
9261 this._literal = literal6; 9335 this._literal = literal6;
9262 } 9336 }
9263 /** 9337 /**
9264 * Set the value of the literal to the given string. 9338 * Set the value of the literal to the given string.
9265 * @param string the value of the literal 9339 * @param string the value of the literal
9266 */ 9340 */
9267 void set value(String string) { 9341 void set value(String string) {
9268 _value = string; 9342 _value = StringUtilities.intern(_value);
9269 } 9343 }
9270 void visitChildren(ASTVisitor<Object> visitor) { 9344 void visitChildren(ASTVisitor<Object> visitor) {
9271 } 9345 }
9272 } 9346 }
9273 /** 9347 /**
9274 * Instances of the class {@code Statement} defines the behavior common to nodes that represent a 9348 * Instances of the class {@code Statement} defines the behavior common to nodes that represent a
9275 * statement. 9349 * statement.
9276 * <pre> 9350 * <pre>
9277 * 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> 9351 * 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>
9278 * @coverage dart.engine.ast 9352 * @coverage dart.engine.ast
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after
10733 * Set the expression used to compute the initial value for the variable to th e given expression. 10807 * Set the expression used to compute the initial value for the variable to th e given expression.
10734 * @param initializer the expression used to compute the initial value for the variable 10808 * @param initializer the expression used to compute the initial value for the variable
10735 */ 10809 */
10736 void set initializer(Expression initializer2) { 10810 void set initializer(Expression initializer2) {
10737 this._initializer = becomeParentOf(initializer2); 10811 this._initializer = becomeParentOf(initializer2);
10738 } 10812 }
10739 /** 10813 /**
10740 * Set the name of the variable being declared to the given identifier. 10814 * Set the name of the variable being declared to the given identifier.
10741 * @param name the name of the variable being declared 10815 * @param name the name of the variable being declared
10742 */ 10816 */
10743 void set name(SimpleIdentifier name7) { 10817 void set name(SimpleIdentifier name8) {
10744 this._name = becomeParentOf(name7); 10818 this._name = becomeParentOf(name8);
10745 } 10819 }
10746 void visitChildren(ASTVisitor<Object> visitor) { 10820 void visitChildren(ASTVisitor<Object> visitor) {
10747 super.visitChildren(visitor); 10821 super.visitChildren(visitor);
10748 safelyVisitChild(_name, visitor); 10822 safelyVisitChild(_name, visitor);
10749 safelyVisitChild(_initializer, visitor); 10823 safelyVisitChild(_initializer, visitor);
10750 } 10824 }
10751 Token get firstTokenAfterCommentAndMetadata => _name.beginToken; 10825 Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
10752 } 10826 }
10753 /** 10827 /**
10754 * Instances of the class {@code VariableDeclarationList} represent the declarat ion of one or more 10828 * Instances of the class {@code VariableDeclarationList} represent the declarat ion of one or more
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
11130 * those values. 11204 * those values.
11131 * @coverage dart.engine.ast 11205 * @coverage dart.engine.ast
11132 */ 11206 */
11133 class ConstantEvaluator extends GeneralizingASTVisitor<Object> { 11207 class ConstantEvaluator extends GeneralizingASTVisitor<Object> {
11134 /** 11208 /**
11135 * The value returned for expressions (or non-expression nodes) that are not c ompile-time constant 11209 * The value returned for expressions (or non-expression nodes) that are not c ompile-time constant
11136 * expressions. 11210 * expressions.
11137 */ 11211 */
11138 static Object NOT_A_CONSTANT = new Object(); 11212 static Object NOT_A_CONSTANT = new Object();
11139 /** 11213 /**
11140 * The error reporter by which errors will be reported. 11214 * Initialize a newly created constant evaluator.
11141 */ 11215 */
11142 ErrorReporter _errorReporter; 11216 ConstantEvaluator() {
11143 /**
11144 * Initialize a newly created constant evaluator.
11145 * @param errorReporter the error reporter by which errors will be reported
11146 */
11147 ConstantEvaluator(ErrorReporter errorReporter) {
11148 this._errorReporter = errorReporter;
11149 } 11217 }
11150 Object visitAdjacentStrings(AdjacentStrings node) { 11218 Object visitAdjacentStrings(AdjacentStrings node) {
11151 JavaStringBuilder builder = new JavaStringBuilder(); 11219 JavaStringBuilder builder = new JavaStringBuilder();
11152 for (StringLiteral string in node.strings) { 11220 for (StringLiteral string in node.strings) {
11153 Object value = string.accept(this); 11221 Object value = string.accept(this);
11154 if (identical(value, NOT_A_CONSTANT)) { 11222 if (identical(value, NOT_A_CONSTANT)) {
11155 return value; 11223 return value;
11156 } 11224 }
11157 builder.append(value); 11225 builder.append(value);
11158 } 11226 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
11262 if (leftOperand2 is int && rightOperand2 is int) { 11330 if (leftOperand2 is int && rightOperand2 is int) {
11263 return ((leftOperand2 as int)) * (rightOperand2 as int); 11331 return ((leftOperand2 as int)) * (rightOperand2 as int);
11264 } else if (leftOperand2 is double && rightOperand2 is double) { 11332 } else if (leftOperand2 is double && rightOperand2 is double) {
11265 return ((leftOperand2 as double)) * ((rightOperand2 as double)); 11333 return ((leftOperand2 as double)) * ((rightOperand2 as double));
11266 } 11334 }
11267 } else if (node.operator.type == TokenType.SLASH) { 11335 } else if (node.operator.type == TokenType.SLASH) {
11268 if (leftOperand2 is int && rightOperand2 is int) { 11336 if (leftOperand2 is int && rightOperand2 is int) {
11269 if (rightOperand2 != 0) { 11337 if (rightOperand2 != 0) {
11270 return ((leftOperand2 as int)) ~/ (rightOperand2 as int); 11338 return ((leftOperand2 as int)) ~/ (rightOperand2 as int);
11271 } else { 11339 } else {
11272 reportDivideByZeroError(node); 11340 return ((leftOperand2 as int)).toDouble() / ((rightOperand2 as int)) .toDouble();
11273 return 0;
11274 } 11341 }
11275 } else if (leftOperand2 is double && rightOperand2 is double) { 11342 } else if (leftOperand2 is double && rightOperand2 is double) {
11276 if (rightOperand2 != 0) { 11343 return ((leftOperand2 as double)) / ((rightOperand2 as double));
11277 return ((leftOperand2 as double)) / ((rightOperand2 as double));
11278 } else {
11279 reportDivideByZeroError(node);
11280 return 0;
11281 }
11282 } 11344 }
11283 } else if (node.operator.type == TokenType.TILDE_SLASH) { 11345 } else if (node.operator.type == TokenType.TILDE_SLASH) {
11284 if (leftOperand2 is int && rightOperand2 is int) { 11346 if (leftOperand2 is int && rightOperand2 is int) {
11285 if (rightOperand2 != 0) { 11347 if (rightOperand2 != 0) {
11286 return ((leftOperand2 as int)) ~/ (rightOperand2 as int); 11348 return ((leftOperand2 as int)) ~/ (rightOperand2 as int);
11287 } else { 11349 } else {
11288 reportDivideByZeroError(node);
11289 return 0; 11350 return 0;
11290 } 11351 }
11291 } else if (leftOperand2 is double && rightOperand2 is double) { 11352 } else if (leftOperand2 is double && rightOperand2 is double) {
11292 if (rightOperand2 != 0) { 11353 return ((leftOperand2 as double)) ~/ ((rightOperand2 as double));
11293 return ((leftOperand2 as double)) ~/ ((rightOperand2 as double));
11294 } else {
11295 reportDivideByZeroError(node);
11296 return 0;
11297 }
11298 } 11354 }
11299 } 11355 }
11300 break; 11356 break;
11301 } 11357 }
11302 return visitExpression(node); 11358 return visitExpression(node);
11303 } 11359 }
11304 Object visitBooleanLiteral(BooleanLiteral node) => node.value ? true : false; 11360 Object visitBooleanLiteral(BooleanLiteral node) => node.value ? true : false;
11305 Object visitDoubleLiteral(DoubleLiteral node) => node.value; 11361 Object visitDoubleLiteral(DoubleLiteral node) => node.value;
11306 Object visitIntegerLiteral(IntegerLiteral node) => node.value; 11362 Object visitIntegerLiteral(IntegerLiteral node) => node.value;
11307 Object visitInterpolationExpression(InterpolationExpression node) { 11363 Object visitInterpolationExpression(InterpolationExpression node) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
11389 * @return the constant value of the static constant 11445 * @return the constant value of the static constant
11390 */ 11446 */
11391 Object getConstantValue(Element element) { 11447 Object getConstantValue(Element element) {
11392 if (element is FieldElement) { 11448 if (element is FieldElement) {
11393 FieldElement field = element as FieldElement; 11449 FieldElement field = element as FieldElement;
11394 if (field.isStatic() && field.isConst()) { 11450 if (field.isStatic() && field.isConst()) {
11395 } 11451 }
11396 } 11452 }
11397 return NOT_A_CONSTANT; 11453 return NOT_A_CONSTANT;
11398 } 11454 }
11399 void reportDivideByZeroError(BinaryExpression node) {
11400 _errorReporter.reportError(CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES _EXCEPTION_DIVIDE_BY_ZERO, node, []);
11401 }
11402 } 11455 }
11403 /** 11456 /**
11404 * Instances of the class {@code ElementLocator} locate the {@link Element Dart model element}associated with a given {@link ASTNode AST node}. 11457 * Instances of the class {@code ElementLocator} locate the {@link Element Dart model element}associated with a given {@link ASTNode AST node}.
11405 * @coverage dart.engine.ast 11458 * @coverage dart.engine.ast
11406 */ 11459 */
11407 class ElementLocator { 11460 class ElementLocator {
11408 /** 11461 /**
11409 * Locate the {@link Element Dart model element} associated with the given {@l ink ASTNode AST 11462 * Locate the {@link Element Dart model element} associated with the given {@l ink ASTNode AST
11410 * node}. 11463 * node}.
11411 * @param node the node (not {@code null}) 11464 * @param node the node (not {@code null})
11412 * @return the associated element, or {@code null} if none is found 11465 * @return the associated element, or {@code null} if none is found
11413 */ 11466 */
11414 static Element locate(ASTNode node) { 11467 static Element locate(ASTNode node) {
11415 ElementLocator_ElementMapper mapper = new ElementLocator_ElementMapper(); 11468 ElementLocator_ElementMapper mapper = new ElementLocator_ElementMapper();
11416 return node.accept(mapper); 11469 return node.accept(mapper);
11417 } 11470 }
11418 /** 11471 /**
11419 * Clients should use {@link #locate(ASTNode)}. 11472 * Clients should use {@link #locate(ASTNode)}.
11420 */ 11473 */
11421 ElementLocator() { 11474 ElementLocator() {
11422 } 11475 }
11423 } 11476 }
11424 /** 11477 /**
11425 * Visitor that maps nodes to elements. 11478 * Visitor that maps nodes to elements.
11426 */ 11479 */
11427 class ElementLocator_ElementMapper extends GeneralizingASTVisitor<Element> { 11480 class ElementLocator_ElementMapper extends GeneralizingASTVisitor<Element> {
11428 Element visitBinaryExpression(BinaryExpression node) => node.element; 11481 Element visitBinaryExpression(BinaryExpression node) => node.element;
11429 Element visitClassDeclaration(ClassDeclaration node) => node.element; 11482 Element visitClassDeclaration(ClassDeclaration node) => node.element;
11483 Element visitCompilationUnit(CompilationUnit node) => node.element;
11484 Element visitConstructorDeclaration(ConstructorDeclaration node) => node.eleme nt;
11430 Element visitFunctionDeclaration(FunctionDeclaration node) => node.element; 11485 Element visitFunctionDeclaration(FunctionDeclaration node) => node.element;
11431 Element visitIdentifier(Identifier node) => node.element; 11486 Element visitIdentifier(Identifier node) => node.element;
11432 Element visitImportDirective(ImportDirective node) => node.element; 11487 Element visitImportDirective(ImportDirective node) => node.element;
11433 Element visitIndexExpression(IndexExpression node) => node.element; 11488 Element visitIndexExpression(IndexExpression node) => node.element;
11489 Element visitInstanceCreationExpression(InstanceCreationExpression node) => no de.element;
11434 Element visitLibraryDirective(LibraryDirective node) => node.element; 11490 Element visitLibraryDirective(LibraryDirective node) => node.element;
11435 Element visitMethodDeclaration(MethodDeclaration node) => node.element; 11491 Element visitMethodDeclaration(MethodDeclaration node) => node.element;
11492 Element visitMethodInvocation(MethodInvocation node) => node.methodName.elemen t;
11436 Element visitPostfixExpression(PostfixExpression node) => node.element; 11493 Element visitPostfixExpression(PostfixExpression node) => node.element;
11437 Element visitPrefixedIdentifier(PrefixedIdentifier node) => node.element; 11494 Element visitPrefixedIdentifier(PrefixedIdentifier node) => node.element;
11438 Element visitPrefixExpression(PrefixExpression node) => node.element; 11495 Element visitPrefixExpression(PrefixExpression node) => node.element;
11439 Element visitStringLiteral(StringLiteral node) { 11496 Element visitStringLiteral(StringLiteral node) {
11440 ASTNode parent12 = node.parent; 11497 ASTNode parent12 = node.parent;
11441 if (parent12 is UriBasedDirective) { 11498 if (parent12 is UriBasedDirective) {
11442 return ((parent12 as UriBasedDirective)).element; 11499 return ((parent12 as UriBasedDirective)).element;
11443 } 11500 }
11444 return null; 11501 return null;
11445 } 11502 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
11534 R visitLibraryDirective(LibraryDirective node) => visitDirective(node); 11591 R visitLibraryDirective(LibraryDirective node) => visitDirective(node);
11535 R visitLibraryIdentifier(LibraryIdentifier node) => visitIdentifier(node); 11592 R visitLibraryIdentifier(LibraryIdentifier node) => visitIdentifier(node);
11536 R visitListLiteral(ListLiteral node) => visitTypedLiteral(node); 11593 R visitListLiteral(ListLiteral node) => visitTypedLiteral(node);
11537 R visitLiteral(Literal node) => visitExpression(node); 11594 R visitLiteral(Literal node) => visitExpression(node);
11538 R visitMapLiteral(MapLiteral node) => visitTypedLiteral(node); 11595 R visitMapLiteral(MapLiteral node) => visitTypedLiteral(node);
11539 R visitMapLiteralEntry(MapLiteralEntry node) => visitNode(node); 11596 R visitMapLiteralEntry(MapLiteralEntry node) => visitNode(node);
11540 R visitMethodDeclaration(MethodDeclaration node) => visitClassMember(node); 11597 R visitMethodDeclaration(MethodDeclaration node) => visitClassMember(node);
11541 R visitMethodInvocation(MethodInvocation node) => visitExpression(node); 11598 R visitMethodInvocation(MethodInvocation node) => visitExpression(node);
11542 R visitNamedExpression(NamedExpression node) => visitExpression(node); 11599 R visitNamedExpression(NamedExpression node) => visitExpression(node);
11543 R visitNamespaceDirective(NamespaceDirective node) => visitUriBasedDirective(n ode); 11600 R visitNamespaceDirective(NamespaceDirective node) => visitUriBasedDirective(n ode);
11601 R visitNativeFunctionBody(NativeFunctionBody node) => visitFunctionBody(node);
11544 R visitNode(ASTNode node) { 11602 R visitNode(ASTNode node) {
11545 node.visitChildren(this); 11603 node.visitChildren(this);
11546 return null; 11604 return null;
11547 } 11605 }
11548 R visitNormalFormalParameter(NormalFormalParameter node) => visitFormalParamet er(node); 11606 R visitNormalFormalParameter(NormalFormalParameter node) => visitFormalParamet er(node);
11549 R visitNullLiteral(NullLiteral node) => visitLiteral(node); 11607 R visitNullLiteral(NullLiteral node) => visitLiteral(node);
11550 R visitParenthesizedExpression(ParenthesizedExpression node) => visitExpressio n(node); 11608 R visitParenthesizedExpression(ParenthesizedExpression node) => visitExpressio n(node);
11551 R visitPartDirective(PartDirective node) => visitUriBasedDirective(node); 11609 R visitPartDirective(PartDirective node) => visitUriBasedDirective(node);
11552 R visitPartOfDirective(PartOfDirective node) => visitDirective(node); 11610 R visitPartOfDirective(PartOfDirective node) => visitDirective(node);
11553 R visitPostfixExpression(PostfixExpression node) => visitExpression(node); 11611 R visitPostfixExpression(PostfixExpression node) => visitExpression(node);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
11608 * The element that was found that corresponds to the given source range, or { @code null} if there 11666 * The element that was found that corresponds to the given source range, or { @code null} if there
11609 * is no such element. 11667 * is no such element.
11610 */ 11668 */
11611 ASTNode _foundNode; 11669 ASTNode _foundNode;
11612 /** 11670 /**
11613 * Initialize a newly created locator to locate one or more {@link ASTNode AST nodes} by locating 11671 * Initialize a newly created locator to locate one or more {@link ASTNode AST nodes} by locating
11614 * the node within an AST structure that corresponds to the given offset in th e source. 11672 * the node within an AST structure that corresponds to the given offset in th e source.
11615 * @param offset the offset used to identify the node 11673 * @param offset the offset used to identify the node
11616 */ 11674 */
11617 NodeLocator.con1(int offset) { 11675 NodeLocator.con1(int offset) {
11618 _jtd_constructor_119_impl(offset); 11676 _jtd_constructor_120_impl(offset);
11619 } 11677 }
11620 _jtd_constructor_119_impl(int offset) { 11678 _jtd_constructor_120_impl(int offset) {
11621 _jtd_constructor_120_impl(offset, offset); 11679 _jtd_constructor_121_impl(offset, offset);
11622 } 11680 }
11623 /** 11681 /**
11624 * Initialize a newly created locator to locate one or more {@link ASTNode AST nodes} by locating 11682 * Initialize a newly created locator to locate one or more {@link ASTNode AST nodes} by locating
11625 * the node within an AST structure that corresponds to the given range of cha racters in the 11683 * the node within an AST structure that corresponds to the given range of cha racters in the
11626 * source. 11684 * source.
11627 * @param start the start offset of the range used to identify the node 11685 * @param start the start offset of the range used to identify the node
11628 * @param end the end offset of the range used to identify the node 11686 * @param end the end offset of the range used to identify the node
11629 */ 11687 */
11630 NodeLocator.con2(int start, int end) { 11688 NodeLocator.con2(int start, int end) {
11631 _jtd_constructor_120_impl(start, end); 11689 _jtd_constructor_121_impl(start, end);
11632 } 11690 }
11633 _jtd_constructor_120_impl(int start, int end) { 11691 _jtd_constructor_121_impl(int start, int end) {
11634 this._startOffset = start; 11692 this._startOffset = start;
11635 this._endOffset = end; 11693 this._endOffset = end;
11636 } 11694 }
11637 /** 11695 /**
11638 * Return the node that was found that corresponds to the given source range, or {@code null} if 11696 * Return the node that was found that corresponds to the given source range, or {@code null} if
11639 * there is no such node. 11697 * there is no such node.
11640 * @return the node that was found 11698 * @return the node that was found
11641 */ 11699 */
11642 ASTNode get foundNode => _foundNode; 11700 ASTNode get foundNode => _foundNode;
11643 /** 11701 /**
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
11945 return null; 12003 return null;
11946 } 12004 }
11947 R visitMethodInvocation(MethodInvocation node) { 12005 R visitMethodInvocation(MethodInvocation node) {
11948 node.visitChildren(this); 12006 node.visitChildren(this);
11949 return null; 12007 return null;
11950 } 12008 }
11951 R visitNamedExpression(NamedExpression node) { 12009 R visitNamedExpression(NamedExpression node) {
11952 node.visitChildren(this); 12010 node.visitChildren(this);
11953 return null; 12011 return null;
11954 } 12012 }
12013 R visitNativeFunctionBody(NativeFunctionBody node) {
12014 node.visitChildren(this);
12015 return null;
12016 }
11955 R visitNullLiteral(NullLiteral node) { 12017 R visitNullLiteral(NullLiteral node) {
11956 node.visitChildren(this); 12018 node.visitChildren(this);
11957 return null; 12019 return null;
11958 } 12020 }
11959 R visitParenthesizedExpression(ParenthesizedExpression node) { 12021 R visitParenthesizedExpression(ParenthesizedExpression node) {
11960 node.visitChildren(this); 12022 node.visitChildren(this);
11961 return null; 12023 return null;
11962 } 12024 }
11963 R visitPartDirective(PartDirective node) { 12025 R visitPartDirective(PartDirective node) {
11964 node.visitChildren(this); 12026 node.visitChildren(this);
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
12159 R visitLabel(Label node) => null; 12221 R visitLabel(Label node) => null;
12160 R visitLabeledStatement(LabeledStatement node) => null; 12222 R visitLabeledStatement(LabeledStatement node) => null;
12161 R visitLibraryDirective(LibraryDirective node) => null; 12223 R visitLibraryDirective(LibraryDirective node) => null;
12162 R visitLibraryIdentifier(LibraryIdentifier node) => null; 12224 R visitLibraryIdentifier(LibraryIdentifier node) => null;
12163 R visitListLiteral(ListLiteral node) => null; 12225 R visitListLiteral(ListLiteral node) => null;
12164 R visitMapLiteral(MapLiteral node) => null; 12226 R visitMapLiteral(MapLiteral node) => null;
12165 R visitMapLiteralEntry(MapLiteralEntry node) => null; 12227 R visitMapLiteralEntry(MapLiteralEntry node) => null;
12166 R visitMethodDeclaration(MethodDeclaration node) => null; 12228 R visitMethodDeclaration(MethodDeclaration node) => null;
12167 R visitMethodInvocation(MethodInvocation node) => null; 12229 R visitMethodInvocation(MethodInvocation node) => null;
12168 R visitNamedExpression(NamedExpression node) => null; 12230 R visitNamedExpression(NamedExpression node) => null;
12231 R visitNativeFunctionBody(NativeFunctionBody node) => null;
12169 R visitNullLiteral(NullLiteral node) => null; 12232 R visitNullLiteral(NullLiteral node) => null;
12170 R visitParenthesizedExpression(ParenthesizedExpression node) => null; 12233 R visitParenthesizedExpression(ParenthesizedExpression node) => null;
12171 R visitPartDirective(PartDirective node) => null; 12234 R visitPartDirective(PartDirective node) => null;
12172 R visitPartOfDirective(PartOfDirective node) => null; 12235 R visitPartOfDirective(PartOfDirective node) => null;
12173 R visitPostfixExpression(PostfixExpression node) => null; 12236 R visitPostfixExpression(PostfixExpression node) => null;
12174 R visitPrefixedIdentifier(PrefixedIdentifier node) => null; 12237 R visitPrefixedIdentifier(PrefixedIdentifier node) => null;
12175 R visitPrefixExpression(PrefixExpression node) => null; 12238 R visitPrefixExpression(PrefixExpression node) => null;
12176 R visitPropertyAccess(PropertyAccess node) => null; 12239 R visitPropertyAccess(PropertyAccess node) => null;
12177 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => null; 12240 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => null;
12178 R visitRethrowExpression(RethrowExpression node) => null; 12241 R visitRethrowExpression(RethrowExpression node) => null;
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
12466 visit(node.loopVariable); 12529 visit(node.loopVariable);
12467 _writer.print(" in "); 12530 _writer.print(" in ");
12468 visit(node.iterator); 12531 visit(node.iterator);
12469 _writer.print(") "); 12532 _writer.print(") ");
12470 visit(node.body); 12533 visit(node.body);
12471 return null; 12534 return null;
12472 } 12535 }
12473 Object visitFormalParameterList(FormalParameterList node) { 12536 Object visitFormalParameterList(FormalParameterList node) {
12474 String groupEnd = null; 12537 String groupEnd = null;
12475 _writer.print('('); 12538 _writer.print('(');
12476 NodeList<FormalParameter> parameters9 = node.parameters; 12539 NodeList<FormalParameter> parameters10 = node.parameters;
12477 int size2 = parameters9.length; 12540 int size2 = parameters10.length;
12478 for (int i = 0; i < size2; i++) { 12541 for (int i = 0; i < size2; i++) {
12479 FormalParameter parameter = parameters9[i]; 12542 FormalParameter parameter = parameters10[i];
12480 if (i > 0) { 12543 if (i > 0) {
12481 _writer.print(", "); 12544 _writer.print(", ");
12482 } 12545 }
12483 if (groupEnd == null && parameter is DefaultFormalParameter) { 12546 if (groupEnd == null && parameter is DefaultFormalParameter) {
12484 if (identical(parameter.kind, ParameterKind.NAMED)) { 12547 if (identical(parameter.kind, ParameterKind.NAMED)) {
12485 groupEnd = "}"; 12548 groupEnd = "}";
12486 _writer.print('{'); 12549 _writer.print('{');
12487 } else { 12550 } else {
12488 groupEnd = "]"; 12551 groupEnd = "]";
12489 _writer.print('['); 12552 _writer.print('[');
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
12692 } 12755 }
12693 visit(node.methodName); 12756 visit(node.methodName);
12694 visit(node.argumentList); 12757 visit(node.argumentList);
12695 return null; 12758 return null;
12696 } 12759 }
12697 Object visitNamedExpression(NamedExpression node) { 12760 Object visitNamedExpression(NamedExpression node) {
12698 visit(node.name); 12761 visit(node.name);
12699 visit3(" ", node.expression); 12762 visit3(" ", node.expression);
12700 return null; 12763 return null;
12701 } 12764 }
12765 Object visitNativeFunctionBody(NativeFunctionBody node) {
12766 _writer.print("native ");
12767 visit(node.stringLiteral);
12768 _writer.print(';');
12769 return null;
12770 }
12702 Object visitNullLiteral(NullLiteral node) { 12771 Object visitNullLiteral(NullLiteral node) {
12703 _writer.print("null"); 12772 _writer.print("null");
12704 return null; 12773 return null;
12705 } 12774 }
12706 Object visitParenthesizedExpression(ParenthesizedExpression node) { 12775 Object visitParenthesizedExpression(ParenthesizedExpression node) {
12707 _writer.print('('); 12776 _writer.print('(');
12708 visit(node.expression); 12777 visit(node.expression);
12709 _writer.print(')'); 12778 _writer.print(')');
12710 return null; 12779 return null;
12711 } 12780 }
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
13009 if (i > 0) { 13078 if (i > 0) {
13010 _writer.print(separator); 13079 _writer.print(separator);
13011 } 13080 }
13012 nodes[i].accept(this); 13081 nodes[i].accept(this);
13013 } 13082 }
13014 } 13083 }
13015 } 13084 }
13016 } 13085 }
13017 } 13086 }
13018 /** 13087 /**
13088 * Instances of the class {@code ASTCloner} implement an object that will clone any AST structure
13089 * that it visits. The cloner will only clone the structure, it will not preserv e any resolution
13090 * results or properties associated with the nodes.
13091 */
13092 class ASTCloner implements ASTVisitor<ASTNode> {
13093 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs.full(clone2(node.strings));
13094 Annotation visitAnnotation(Annotation node) => new Annotation.full(node.atSign , clone(node.name), node.period, clone(node.constructorName), clone(node.argumen ts));
13095 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) => new ArgumentDefinitionTest.full(node.question, clone(node.identifier));
13096 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList.full(nod e.leftParenthesis, clone2(node.arguments), node.rightParenthesis);
13097 AsExpression visitAsExpression(AsExpression node) => new AsExpression.full(clo ne(node.expression), node.asOperator, clone(node.type));
13098 ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement.full (node.keyword, node.leftParenthesis, clone(node.condition), node.rightParenthesi s, node.semicolon);
13099 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => n ew AssignmentExpression.full(clone(node.leftHandSide), node.operator, clone(node .rightHandSide));
13100 BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExp ression.full(clone(node.leftOperand), node.operator, clone(node.rightOperand));
13101 Block visitBlock(Block node) => new Block.full(node.leftBracket, clone2(node.s tatements), node.rightBracket);
13102 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody.full(clone(node.block));
13103 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral. full(node.literal, node.value);
13104 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement. full(node.keyword, clone(node.label), node.semicolon);
13105 CascadeExpression visitCascadeExpression(CascadeExpression node) => new Cascad eExpression.full(clone(node.target), clone2(node.cascadeSections));
13106 CatchClause visitCatchClause(CatchClause node) => new CatchClause.full(node.on Keyword, clone(node.exceptionType), node.catchKeyword, node.leftParenthesis, clo ne(node.exceptionParameter), node.comma, clone(node.stackTraceParameter), node.r ightParenthesis, clone(node.body));
13107 ClassDeclaration visitClassDeclaration(ClassDeclaration node) => new ClassDecl aration.full(clone(node.documentationComment), clone2(node.metadata), node.abstr actKeyword, node.classKeyword, clone(node.name), clone(node.typeParameters), clo ne(node.extendsClause), clone(node.withClause), clone(node.implementsClause), no de.leftBracket, clone2(node.members), node.rightBracket);
13108 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias. full(clone(node.documentationComment), clone2(node.metadata), node.keyword, clon e(node.name), clone(node.typeParameters), node.equals, node.abstractKeyword, clo ne(node.superclass), clone(node.withClause), clone(node.implementsClause), node. semicolon);
13109 Comment visitComment(Comment node) {
13110 if (node.isDocumentation()) {
13111 return Comment.createDocumentationComment2(node.tokens, clone2(node.refere nces));
13112 } else if (node.isBlock()) {
13113 return Comment.createBlockComment(node.tokens);
13114 }
13115 return Comment.createEndOfLineComment(node.tokens);
13116 }
13117 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference.full(node.newKeyword, clone(node.identifier));
13118 CompilationUnit visitCompilationUnit(CompilationUnit node) {
13119 CompilationUnit clone3 = new CompilationUnit.full(node.beginToken, clone(nod e.scriptTag), clone2(node.directives), clone2(node.declarations), node.endToken) ;
13120 clone3.lineInfo = node.lineInfo;
13121 clone3.parsingErrors = node.parsingErrors;
13122 clone3.resolutionErrors = node.resolutionErrors;
13123 return clone3;
13124 }
13125 ConditionalExpression visitConditionalExpression(ConditionalExpression node) = > new ConditionalExpression.full(clone(node.condition), node.question, clone(nod e.thenExpression), node.colon, clone(node.elseExpression));
13126 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node ) => new ConstructorDeclaration.full(clone(node.documentationComment), clone2(no de.metadata), node.externalKeyword, node.constKeyword, node.factoryKeyword, clon e(node.returnType), node.period, clone(node.name), clone(node.parameters), node. separator, clone2(node.initializers), clone(node.redirectedConstructor), clone(n ode.body));
13127 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI nitializer node) => new ConstructorFieldInitializer.full(node.keyword, node.peri od, clone(node.fieldName), node.equals, clone(node.expression));
13128 ConstructorName visitConstructorName(ConstructorName node) => new ConstructorN ame.full(clone(node.type), node.period, clone(node.name));
13129 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin ueStatement.full(node.keyword, clone(node.label), node.semicolon);
13130 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec laredIdentifier.full(clone(node.documentationComment), clone2(node.metadata), no de.keyword, clone(node.type), clone(node.identifier));
13131 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node ) => new DefaultFormalParameter.full(clone(node.parameter), node.kind, node.sepa rator, clone(node.defaultValue));
13132 DoStatement visitDoStatement(DoStatement node) => new DoStatement.full(node.do Keyword, clone(node.body), node.whileKeyword, node.leftParenthesis, clone(node.c ondition), node.rightParenthesis, node.semicolon);
13133 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => new DoubleLiteral.full (node.literal, node.value);
13134 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF unctionBody.full(node.semicolon);
13135 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement. full(node.semicolon);
13136 ExportDirective visitExportDirective(ExportDirective node) => new ExportDirect ive.full(clone(node.documentationComment), clone2(node.metadata), node.keyword, clone(node.uri), clone2(node.combinators), node.semicolon);
13137 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody.full(node.functionDefinition, clone(node.express ion), node.semicolon);
13138 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement.full(clone(node.expression), node.semicolon);
13139 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause.full (node.keyword, clone(node.superclass));
13140 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration.full(clone(node.documentationComment), clone2(node.metadata), node.keywo rd, clone(node.fields), node.semicolon);
13141 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter.full(clone(node.documentationComment), clone2(node.metad ata), node.keyword, clone(node.type), node.thisToken, node.period, clone(node.id entifier));
13142 ForEachStatement visitForEachStatement(ForEachStatement node) => new ForEachSt atement.full(node.forKeyword, node.leftParenthesis, clone(node.loopVariable), no de.inKeyword, clone(node.iterator), node.rightParenthesis, clone(node.body));
13143 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList.full(node.leftParenthesis, clone2(node.parameters), node.lef tDelimiter, node.rightDelimiter, node.rightParenthesis);
13144 ForStatement visitForStatement(ForStatement node) => new ForStatement.full(nod e.forKeyword, node.leftParenthesis, clone(node.variables), clone(node.initializa tion), node.leftSeparator, clone(node.condition), node.rightSeparator, clone2(no de.updaters), node.rightParenthesis, clone(node.body));
13145 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration.full(clone(node.documentationComment), clone2(node.metadata) , node.externalKeyword, clone(node.returnType), node.propertyKeyword, clone(node .name), clone(node.functionExpression));
13146 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara tionStatement node) => new FunctionDeclarationStatement.full(clone(node.function Declaration));
13147 FunctionExpression visitFunctionExpression(FunctionExpression node) => new Fun ctionExpression.full(clone(node.parameters), clone(node.body));
13148 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress ionInvocation node) => new FunctionExpressionInvocation.full(clone(node.function ), clone(node.argumentList));
13149 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi onTypeAlias.full(clone(node.documentationComment), clone2(node.metadata), node.k eyword, clone(node.returnType), clone(node.name), clone(node.typeParameters), cl one(node.parameters), node.semicolon);
13150 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo rmalParameter node) => new FunctionTypedFormalParameter.full(clone(node.document ationComment), clone2(node.metadata), clone(node.returnType), clone(node.identif ier), clone(node.parameters));
13151 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator. full(node.keyword, clone2(node.hiddenNames));
13152 IfStatement visitIfStatement(IfStatement node) => new IfStatement.full(node.if Keyword, node.leftParenthesis, clone(node.condition), node.rightParenthesis, clo ne(node.thenStatement), node.elseKeyword, clone(node.elseStatement));
13153 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement sClause.full(node.keyword, clone2(node.interfaces));
13154 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect ive.full(clone(node.documentationComment), clone2(node.metadata), node.keyword, clone(node.uri), node.asToken, clone(node.prefix), clone2(node.combinators), nod e.semicolon);
13155 IndexExpression visitIndexExpression(IndexExpression node) {
13156 Token period13 = node.period;
13157 if (period13 == null) {
13158 return new IndexExpression.forTarget_full(clone(node.array), node.leftBrac ket, clone(node.index), node.rightBracket);
13159 } else {
13160 return new IndexExpression.forCascade_full(period13, node.leftBracket, clo ne(node.index), node.rightBracket);
13161 }
13162 }
13163 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp ression node) => new InstanceCreationExpression.full(node.keyword, clone(node.co nstructorName), clone(node.argumentList));
13164 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => new IntegerLiteral. full(node.literal, node.value);
13165 InterpolationExpression visitInterpolationExpression(InterpolationExpression n ode) => new InterpolationExpression.full(node.leftBracket, clone(node.expression ), node.rightBracket);
13166 InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString.full(node.contents, node.value);
13167 IsExpression visitIsExpression(IsExpression node) => new IsExpression.full(clo ne(node.expression), node.isOperator, node.notOperator, clone(node.type));
13168 Label visitLabel(Label node) => new Label.full(clone(node.label), node.colon);
13169 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt atement.full(clone2(node.labels), clone(node.statement));
13170 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi rective.full(clone(node.documentationComment), clone2(node.metadata), node.libra ryToken, clone(node.name), node.semicolon);
13171 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => new Librar yIdentifier.full(clone2(node.components));
13172 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral.full(node.mo difier, clone(node.typeArguments), node.leftBracket, clone2(node.elements), node .rightBracket);
13173 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral.full(node.modifi er, clone(node.typeArguments), node.leftBracket, clone2(node.entries), node.righ tBracket);
13174 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn try.full(clone(node.key), node.separator, clone(node.value));
13175 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method Declaration.full(clone(node.documentationComment), clone2(node.metadata), node.e xternalKeyword, node.modifierKeyword, clone(node.returnType), node.propertyKeywo rd, node.operatorKeyword, clone(node.name), clone(node.parameters), clone(node.b ody));
13176 MethodInvocation visitMethodInvocation(MethodInvocation node) => new MethodInv ocation.full(clone(node.target), node.period, clone(node.methodName), clone(node .argumentList));
13177 NamedExpression visitNamedExpression(NamedExpression node) => new NamedExpress ion.full(clone(node.name), clone(node.expression));
13178 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat iveFunctionBody.full(node.nativeToken, clone(node.stringLiteral), node.semicolon );
13179 NullLiteral visitNullLiteral(NullLiteral node) => new NullLiteral.full(node.li teral);
13180 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n ode) => new ParenthesizedExpression.full(node.leftParenthesis, clone(node.expres sion), node.rightParenthesis);
13181 PartDirective visitPartDirective(PartDirective node) => new PartDirective.full (clone(node.documentationComment), clone2(node.metadata), node.partToken, clone( node.uri), node.semicolon);
13182 PartOfDirective visitPartOfDirective(PartOfDirective node) => new PartOfDirect ive.full(clone(node.documentationComment), clone2(node.metadata), node.partToken , node.ofToken, clone(node.libraryName), node.semicolon);
13183 PostfixExpression visitPostfixExpression(PostfixExpression node) => new Postfi xExpression.full(clone(node.operand), node.operator);
13184 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => new Pre fixedIdentifier.full(clone(node.prefix), node.period, clone(node.identifier));
13185 PrefixExpression visitPrefixExpression(PrefixExpression node) => new PrefixExp ression.full(node.operator, clone(node.operand));
13186 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess. full(clone(node.target), node.operator, clone(node.propertyName));
13187 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec tingConstructorInvocation node) => new RedirectingConstructorInvocation.full(nod e.keyword, node.period, clone(node.constructorName), clone(node.argumentList));
13188 RethrowExpression visitRethrowExpression(RethrowExpression node) => new Rethro wExpression.full(node.keyword);
13189 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent.full(node.keyword, clone(node.expression), node.semicolon);
13190 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag.full(node.scriptTag) ;
13191 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator. full(node.keyword, clone2(node.shownNames));
13192 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter.full(clone(node.documentationComment), clone2(node.m etadata), node.keyword, clone(node.type), clone(node.identifier));
13193 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => new SimpleIde ntifier.full(node.token);
13194 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => new SimpleStringLiteral.full(node.literal, node.value);
13195 StringInterpolation visitStringInterpolation(StringInterpolation node) => new StringInterpolation.full(clone2(node.elements));
13196 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv ocation node) => new SuperConstructorInvocation.full(node.keyword, node.period, clone(node.constructorName), clone(node.argumentList));
13197 SuperExpression visitSuperExpression(SuperExpression node) => new SuperExpress ion.full(node.keyword);
13198 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase.full(clone2(node .labels), node.keyword, clone(node.expression), node.colon, clone2(node.statemen ts));
13199 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault.full (clone2(node.labels), node.keyword, node.colon, clone2(node.statements));
13200 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem ent.full(node.keyword, node.leftParenthesis, clone(node.expression), node.rightP arenthesis, node.leftBracket, clone2(node.members), node.rightBracket);
13201 ThisExpression visitThisExpression(ThisExpression node) => new ThisExpression. full(node.keyword);
13202 ThrowExpression visitThrowExpression(ThrowExpression node) => new ThrowExpress ion.full(node.keyword, clone(node.expression));
13203 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD eclaration node) => new TopLevelVariableDeclaration.full(clone(node.documentatio nComment), clone2(node.metadata), clone(node.variables), node.semicolon);
13204 TryStatement visitTryStatement(TryStatement node) => new TryStatement.full(nod e.tryKeyword, clone(node.body), clone2(node.catchClauses), node.finallyKeyword, clone(node.finallyClause));
13205 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum entList.full(node.leftBracket, clone2(node.arguments), node.rightBracket);
13206 TypeName visitTypeName(TypeName node) => new TypeName.full(clone(node.name), c lone(node.typeArguments));
13207 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter.full (clone(node.documentationComment), clone2(node.metadata), clone(node.name), node .keyword, clone(node.bound));
13208 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa rameterList.full(node.leftBracket, clone2(node.typeParameters), node.rightBracke t);
13209 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration.full(clone(node.documentationComment), clone2(node.metadata) , clone(node.name), node.equals, clone(node.initializer));
13210 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n ode) => new VariableDeclarationList.full(clone(node.documentationComment), clone 2(node.metadata), node.keyword, clone(node.type), clone2(node.variables));
13211 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement.full(clone(node.variable s), node.semicolon);
13212 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement. full(node.keyword, node.leftParenthesis, clone(node.condition), node.rightParent hesis, clone(node.body));
13213 WithClause visitWithClause(WithClause node) => new WithClause.full(node.withKe yword, clone2(node.mixinTypes));
13214 ASTNode clone(ASTNode node) {
13215 if (node == null) {
13216 return null;
13217 }
13218 return node.accept(this) as ASTNode;
13219 }
13220 List clone2(NodeList nodes) {
13221 List clonedNodes = new List();
13222 for (ASTNode node in nodes) {
13223 clonedNodes.add((node.accept(this) as ASTNode));
13224 }
13225 return clonedNodes;
13226 }
13227 }
13228 /**
13019 * Instances of the class {@code NodeList} represent a list of AST nodes that ha ve a common parent. 13229 * Instances of the class {@code NodeList} represent a list of AST nodes that ha ve a common parent.
13020 */ 13230 */
13021 class NodeList<E extends ASTNode> extends ListWrapper<E> { 13231 class NodeList<E extends ASTNode> extends ListWrapper<E> {
13022 /** 13232 /**
13023 * The node that is the parent of each of the elements in the list. 13233 * The node that is the parent of each of the elements in the list.
13024 */ 13234 */
13025 ASTNode owner; 13235 ASTNode owner;
13026 /** 13236 /**
13027 * The elements of the list. 13237 * The elements of the list.
13028 */ 13238 */
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
13075 return elements[elements.length - 1].endToken; 13285 return elements[elements.length - 1].endToken;
13076 } 13286 }
13077 /** 13287 /**
13078 * Return the node that is the parent of each of the elements in the list. 13288 * Return the node that is the parent of each of the elements in the list.
13079 * @return the node that is the parent of each of the elements in the list 13289 * @return the node that is the parent of each of the elements in the list
13080 */ 13290 */
13081 ASTNode getOwner() { 13291 ASTNode getOwner() {
13082 return owner; 13292 return owner;
13083 } 13293 }
13084 } 13294 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/example/resolver_driver.dart ('k') | pkg/analyzer_experimental/lib/src/generated/constant.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698