| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.ast; | 8 library engine.ast; |
| 9 | 9 |
| 10 import 'dart:collection'; | 10 import 'dart:collection'; |
| (...skipping 3057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3068 class CatchClause extends AstNode { | 3068 class CatchClause extends AstNode { |
| 3069 /** | 3069 /** |
| 3070 * The token representing the 'on' keyword, or `null` if there is no 'on' keyw
ord. | 3070 * The token representing the 'on' keyword, or `null` if there is no 'on' keyw
ord. |
| 3071 */ | 3071 */ |
| 3072 Token onKeyword; | 3072 Token onKeyword; |
| 3073 | 3073 |
| 3074 /** | 3074 /** |
| 3075 * The type of exceptions caught by this catch clause, or `null` if this catch
clause | 3075 * The type of exceptions caught by this catch clause, or `null` if this catch
clause |
| 3076 * catches every type of exception. | 3076 * catches every type of exception. |
| 3077 */ | 3077 */ |
| 3078 TypeName exceptionType; | 3078 TypeName _exceptionType; |
| 3079 | 3079 |
| 3080 /** | 3080 /** |
| 3081 * The token representing the 'catch' keyword, or `null` if there is no 'catch
' keyword. | 3081 * The token representing the 'catch' keyword, or `null` if there is no 'catch
' keyword. |
| 3082 */ | 3082 */ |
| 3083 Token catchKeyword; | 3083 Token catchKeyword; |
| 3084 | 3084 |
| 3085 /** | 3085 /** |
| 3086 * The left parenthesis. | 3086 * The left parenthesis. |
| 3087 */ | 3087 */ |
| 3088 Token _leftParenthesis; | 3088 Token _leftParenthesis; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3121 * @param exceptionType the type of exceptions caught by this catch clause | 3121 * @param exceptionType the type of exceptions caught by this catch clause |
| 3122 * @param leftParenthesis the left parenthesis | 3122 * @param leftParenthesis the left parenthesis |
| 3123 * @param exceptionParameter the parameter whose value will be the exception t
hat was thrown | 3123 * @param exceptionParameter the parameter whose value will be the exception t
hat was thrown |
| 3124 * @param comma the comma separating the exception parameter from the stack tr
ace parameter | 3124 * @param comma the comma separating the exception parameter from the stack tr
ace parameter |
| 3125 * @param stackTraceParameter the parameter whose value will be the stack trac
e associated with | 3125 * @param stackTraceParameter the parameter whose value will be the stack trac
e associated with |
| 3126 * the exception | 3126 * the exception |
| 3127 * @param rightParenthesis the right parenthesis | 3127 * @param rightParenthesis the right parenthesis |
| 3128 * @param body the body of the catch block | 3128 * @param body the body of the catch block |
| 3129 */ | 3129 */ |
| 3130 CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword, Token l
eftParenthesis, SimpleIdentifier exceptionParameter, this.comma, SimpleIdentifie
r stackTraceParameter, Token rightParenthesis, Block body) { | 3130 CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword, Token l
eftParenthesis, SimpleIdentifier exceptionParameter, this.comma, SimpleIdentifie
r stackTraceParameter, Token rightParenthesis, Block body) { |
| 3131 this.exceptionType = becomeParentOf(exceptionType); | 3131 this._exceptionType = becomeParentOf(exceptionType); |
| 3132 this._leftParenthesis = leftParenthesis; | 3132 this._leftParenthesis = leftParenthesis; |
| 3133 this._exceptionParameter = becomeParentOf(exceptionParameter); | 3133 this._exceptionParameter = becomeParentOf(exceptionParameter); |
| 3134 this._stackTraceParameter = becomeParentOf(stackTraceParameter); | 3134 this._stackTraceParameter = becomeParentOf(stackTraceParameter); |
| 3135 this._rightParenthesis = rightParenthesis; | 3135 this._rightParenthesis = rightParenthesis; |
| 3136 this._body = becomeParentOf(body); | 3136 this._body = becomeParentOf(body); |
| 3137 } | 3137 } |
| 3138 | 3138 |
| 3139 @override | 3139 @override |
| 3140 accept(AstVisitor visitor) => visitor.visitCatchClause(this); | 3140 accept(AstVisitor visitor) => visitor.visitCatchClause(this); |
| 3141 | 3141 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 3158 Token get endToken => _body.endToken; | 3158 Token get endToken => _body.endToken; |
| 3159 | 3159 |
| 3160 /** | 3160 /** |
| 3161 * Return the parameter whose value will be the exception that was thrown. | 3161 * Return the parameter whose value will be the exception that was thrown. |
| 3162 * | 3162 * |
| 3163 * @return the parameter whose value will be the exception that was thrown | 3163 * @return the parameter whose value will be the exception that was thrown |
| 3164 */ | 3164 */ |
| 3165 SimpleIdentifier get exceptionParameter => _exceptionParameter; | 3165 SimpleIdentifier get exceptionParameter => _exceptionParameter; |
| 3166 | 3166 |
| 3167 /** | 3167 /** |
| 3168 * Return the type of exceptions caught by this catch clause, or `null` if thi
s catch clause |
| 3169 * catches every type of exception. |
| 3170 * |
| 3171 * @return the type of exceptions caught by this catch clause |
| 3172 */ |
| 3173 TypeName get exceptionType => _exceptionType; |
| 3174 |
| 3175 /** |
| 3168 * Return the left parenthesis. | 3176 * Return the left parenthesis. |
| 3169 * | 3177 * |
| 3170 * @return the left parenthesis | 3178 * @return the left parenthesis |
| 3171 */ | 3179 */ |
| 3172 Token get leftParenthesis => _leftParenthesis; | 3180 Token get leftParenthesis => _leftParenthesis; |
| 3173 | 3181 |
| 3174 /** | 3182 /** |
| 3175 * Return the right parenthesis. | 3183 * Return the right parenthesis. |
| 3176 * | 3184 * |
| 3177 * @return the right parenthesis | 3185 * @return the right parenthesis |
| (...skipping 20 matching lines...) Expand all Loading... |
| 3198 /** | 3206 /** |
| 3199 * Set the parameter whose value will be the exception that was thrown to the
given parameter. | 3207 * Set the parameter whose value will be the exception that was thrown to the
given parameter. |
| 3200 * | 3208 * |
| 3201 * @param parameter the parameter whose value will be the exception that was t
hrown | 3209 * @param parameter the parameter whose value will be the exception that was t
hrown |
| 3202 */ | 3210 */ |
| 3203 void set exceptionParameter(SimpleIdentifier parameter) { | 3211 void set exceptionParameter(SimpleIdentifier parameter) { |
| 3204 _exceptionParameter = becomeParentOf(parameter); | 3212 _exceptionParameter = becomeParentOf(parameter); |
| 3205 } | 3213 } |
| 3206 | 3214 |
| 3207 /** | 3215 /** |
| 3216 * Set the type of exceptions caught by this catch clause to the given type. |
| 3217 * |
| 3218 * @param exceptionType the type of exceptions caught by this catch clause |
| 3219 */ |
| 3220 void set exceptionType(TypeName exceptionType) { |
| 3221 this._exceptionType = becomeParentOf(exceptionType); |
| 3222 } |
| 3223 |
| 3224 /** |
| 3208 * Set the left parenthesis to the given token. | 3225 * Set the left parenthesis to the given token. |
| 3209 * | 3226 * |
| 3210 * @param parenthesis the left parenthesis | 3227 * @param parenthesis the left parenthesis |
| 3211 */ | 3228 */ |
| 3212 void set leftParenthesis(Token parenthesis) { | 3229 void set leftParenthesis(Token parenthesis) { |
| 3213 _leftParenthesis = parenthesis; | 3230 _leftParenthesis = parenthesis; |
| 3214 } | 3231 } |
| 3215 | 3232 |
| 3216 /** | 3233 /** |
| 3217 * Set the right parenthesis to the given token. | 3234 * Set the right parenthesis to the given token. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 3228 * | 3245 * |
| 3229 * @param parameter the parameter whose value will be the stack trace associat
ed with the | 3246 * @param parameter the parameter whose value will be the stack trace associat
ed with the |
| 3230 * exception | 3247 * exception |
| 3231 */ | 3248 */ |
| 3232 void set stackTraceParameter(SimpleIdentifier parameter) { | 3249 void set stackTraceParameter(SimpleIdentifier parameter) { |
| 3233 _stackTraceParameter = becomeParentOf(parameter); | 3250 _stackTraceParameter = becomeParentOf(parameter); |
| 3234 } | 3251 } |
| 3235 | 3252 |
| 3236 @override | 3253 @override |
| 3237 void visitChildren(AstVisitor visitor) { | 3254 void visitChildren(AstVisitor visitor) { |
| 3238 safelyVisitChild(exceptionType, visitor); | 3255 safelyVisitChild(_exceptionType, visitor); |
| 3239 safelyVisitChild(_exceptionParameter, visitor); | 3256 safelyVisitChild(_exceptionParameter, visitor); |
| 3240 safelyVisitChild(_stackTraceParameter, visitor); | 3257 safelyVisitChild(_stackTraceParameter, visitor); |
| 3241 safelyVisitChild(_body, visitor); | 3258 safelyVisitChild(_body, visitor); |
| 3242 } | 3259 } |
| 3243 } | 3260 } |
| 3244 | 3261 |
| 3245 /** | 3262 /** |
| 3246 * Instances of the class `ClassDeclaration` represent the declaration of a clas
s. | 3263 * Instances of the class `ClassDeclaration` represent the declaration of a clas
s. |
| 3247 * | 3264 * |
| 3248 * <pre> | 3265 * <pre> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 3266 | 3283 |
| 3267 /** | 3284 /** |
| 3268 * The name of the class being declared. | 3285 * The name of the class being declared. |
| 3269 */ | 3286 */ |
| 3270 SimpleIdentifier _name; | 3287 SimpleIdentifier _name; |
| 3271 | 3288 |
| 3272 /** | 3289 /** |
| 3273 * The type parameters for the class, or `null` if the class does not have any
type | 3290 * The type parameters for the class, or `null` if the class does not have any
type |
| 3274 * parameters. | 3291 * parameters. |
| 3275 */ | 3292 */ |
| 3276 TypeParameterList typeParameters; | 3293 TypeParameterList _typeParameters; |
| 3277 | 3294 |
| 3278 /** | 3295 /** |
| 3279 * The extends clause for the class, or `null` if the class does not extend an
y other class. | 3296 * The extends clause for the class, or `null` if the class does not extend an
y other class. |
| 3280 */ | 3297 */ |
| 3281 ExtendsClause _extendsClause; | 3298 ExtendsClause _extendsClause; |
| 3282 | 3299 |
| 3283 /** | 3300 /** |
| 3284 * The with clause for the class, or `null` if the class does not have a with
clause. | 3301 * The with clause for the class, or `null` if the class does not have a with
clause. |
| 3285 */ | 3302 */ |
| 3286 WithClause _withClause; | 3303 WithClause _withClause; |
| 3287 | 3304 |
| 3288 /** | 3305 /** |
| 3289 * The implements clause for the class, or `null` if the class does not implem
ent any | 3306 * The implements clause for the class, or `null` if the class does not implem
ent any |
| 3290 * interfaces. | 3307 * interfaces. |
| 3291 */ | 3308 */ |
| 3292 ImplementsClause _implementsClause; | 3309 ImplementsClause _implementsClause; |
| 3293 | 3310 |
| 3294 /** | 3311 /** |
| 3295 * The native clause for the class, or `null` if the class does not have a nat
ive clause. | 3312 * The native clause for the class, or `null` if the class does not have a nat
ive clause. |
| 3296 */ | 3313 */ |
| 3297 NativeClause nativeClause; | 3314 NativeClause _nativeClause; |
| 3298 | 3315 |
| 3299 /** | 3316 /** |
| 3300 * The left curly bracket. | 3317 * The left curly bracket. |
| 3301 */ | 3318 */ |
| 3302 Token leftBracket; | 3319 Token leftBracket; |
| 3303 | 3320 |
| 3304 /** | 3321 /** |
| 3305 * The members defined by the class. | 3322 * The members defined by the class. |
| 3306 */ | 3323 */ |
| 3307 NodeList<ClassMember> _members; | 3324 NodeList<ClassMember> _members; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 3323 * @param extendsClause the extends clause for the class | 3340 * @param extendsClause the extends clause for the class |
| 3324 * @param withClause the with clause for the class | 3341 * @param withClause the with clause for the class |
| 3325 * @param implementsClause the implements clause for the class | 3342 * @param implementsClause the implements clause for the class |
| 3326 * @param leftBracket the left curly bracket | 3343 * @param leftBracket the left curly bracket |
| 3327 * @param members the members defined by the class | 3344 * @param members the members defined by the class |
| 3328 * @param rightBracket the right curly bracket | 3345 * @param rightBracket the right curly bracket |
| 3329 */ | 3346 */ |
| 3330 ClassDeclaration(Comment comment, List<Annotation> metadata, this.abstractKeyw
ord, this.classKeyword, SimpleIdentifier name, TypeParameterList typeParameters,
ExtendsClause extendsClause, WithClause withClause, ImplementsClause implements
Clause, this.leftBracket, List<ClassMember> members, this.rightBracket) : super(
comment, metadata) { | 3347 ClassDeclaration(Comment comment, List<Annotation> metadata, this.abstractKeyw
ord, this.classKeyword, SimpleIdentifier name, TypeParameterList typeParameters,
ExtendsClause extendsClause, WithClause withClause, ImplementsClause implements
Clause, this.leftBracket, List<ClassMember> members, this.rightBracket) : super(
comment, metadata) { |
| 3331 this._members = new NodeList<ClassMember>(this); | 3348 this._members = new NodeList<ClassMember>(this); |
| 3332 this._name = becomeParentOf(name); | 3349 this._name = becomeParentOf(name); |
| 3333 this.typeParameters = becomeParentOf(typeParameters); | 3350 this._typeParameters = becomeParentOf(typeParameters); |
| 3334 this._extendsClause = becomeParentOf(extendsClause); | 3351 this._extendsClause = becomeParentOf(extendsClause); |
| 3335 this._withClause = becomeParentOf(withClause); | 3352 this._withClause = becomeParentOf(withClause); |
| 3336 this._implementsClause = becomeParentOf(implementsClause); | 3353 this._implementsClause = becomeParentOf(implementsClause); |
| 3337 this._members.addAll(members); | 3354 this._members.addAll(members); |
| 3338 } | 3355 } |
| 3339 | 3356 |
| 3340 @override | 3357 @override |
| 3341 accept(AstVisitor visitor) => visitor.visitClassDeclaration(this); | 3358 accept(AstVisitor visitor) => visitor.visitClassDeclaration(this); |
| 3342 | 3359 |
| 3343 /** | 3360 /** |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3433 } | 3450 } |
| 3434 | 3451 |
| 3435 /** | 3452 /** |
| 3436 * Return the name of the class being declared. | 3453 * Return the name of the class being declared. |
| 3437 * | 3454 * |
| 3438 * @return the name of the class being declared | 3455 * @return the name of the class being declared |
| 3439 */ | 3456 */ |
| 3440 SimpleIdentifier get name => _name; | 3457 SimpleIdentifier get name => _name; |
| 3441 | 3458 |
| 3442 /** | 3459 /** |
| 3460 * Return the native clause for this class, or `null` if the class does not ha
ve a native |
| 3461 * cluse. |
| 3462 * |
| 3463 * @return the native clause for this class |
| 3464 */ |
| 3465 NativeClause get nativeClause => _nativeClause; |
| 3466 |
| 3467 /** |
| 3468 * Return the type parameters for the class, or `null` if the class does not h
ave any type |
| 3469 * parameters. |
| 3470 * |
| 3471 * @return the type parameters for the class |
| 3472 */ |
| 3473 TypeParameterList get typeParameters => _typeParameters; |
| 3474 |
| 3475 /** |
| 3443 * Return the with clause for the class, or `null` if the class does not have
a with clause. | 3476 * Return the with clause for the class, or `null` if the class does not have
a with clause. |
| 3444 * | 3477 * |
| 3445 * @return the with clause for the class | 3478 * @return the with clause for the class |
| 3446 */ | 3479 */ |
| 3447 WithClause get withClause => _withClause; | 3480 WithClause get withClause => _withClause; |
| 3448 | 3481 |
| 3449 /** | 3482 /** |
| 3450 * Return `true` if this class is declared to be an abstract class. | 3483 * Return `true` if this class is declared to be an abstract class. |
| 3451 * | 3484 * |
| 3452 * @return `true` if this class is declared to be an abstract class | 3485 * @return `true` if this class is declared to be an abstract class |
| (...skipping 21 matching lines...) Expand all Loading... |
| 3474 /** | 3507 /** |
| 3475 * Set the name of the class being declared to the given identifier. | 3508 * Set the name of the class being declared to the given identifier. |
| 3476 * | 3509 * |
| 3477 * @param identifier the name of the class being declared | 3510 * @param identifier the name of the class being declared |
| 3478 */ | 3511 */ |
| 3479 void set name(SimpleIdentifier identifier) { | 3512 void set name(SimpleIdentifier identifier) { |
| 3480 _name = becomeParentOf(identifier); | 3513 _name = becomeParentOf(identifier); |
| 3481 } | 3514 } |
| 3482 | 3515 |
| 3483 /** | 3516 /** |
| 3517 * Set the native clause for this class to the given clause. |
| 3518 * |
| 3519 * @param nativeClause the native clause for this class |
| 3520 */ |
| 3521 void set nativeClause(NativeClause nativeClause) { |
| 3522 this._nativeClause = becomeParentOf(nativeClause); |
| 3523 } |
| 3524 |
| 3525 /** |
| 3526 * Set the type parameters for the class to the given list of type parameters. |
| 3527 * |
| 3528 * @param typeParameters the type parameters for the class |
| 3529 */ |
| 3530 void set typeParameters(TypeParameterList typeParameters) { |
| 3531 this._typeParameters = becomeParentOf(typeParameters); |
| 3532 } |
| 3533 |
| 3534 /** |
| 3484 * Set the with clause for the class to the given clause. | 3535 * Set the with clause for the class to the given clause. |
| 3485 * | 3536 * |
| 3486 * @param withClause the with clause for the class | 3537 * @param withClause the with clause for the class |
| 3487 */ | 3538 */ |
| 3488 void set withClause(WithClause withClause) { | 3539 void set withClause(WithClause withClause) { |
| 3489 this._withClause = becomeParentOf(withClause); | 3540 this._withClause = becomeParentOf(withClause); |
| 3490 } | 3541 } |
| 3491 | 3542 |
| 3492 @override | 3543 @override |
| 3493 void visitChildren(AstVisitor visitor) { | 3544 void visitChildren(AstVisitor visitor) { |
| 3494 super.visitChildren(visitor); | 3545 super.visitChildren(visitor); |
| 3495 safelyVisitChild(_name, visitor); | 3546 safelyVisitChild(_name, visitor); |
| 3496 safelyVisitChild(typeParameters, visitor); | 3547 safelyVisitChild(_typeParameters, visitor); |
| 3497 safelyVisitChild(_extendsClause, visitor); | 3548 safelyVisitChild(_extendsClause, visitor); |
| 3498 safelyVisitChild(_withClause, visitor); | 3549 safelyVisitChild(_withClause, visitor); |
| 3499 safelyVisitChild(_implementsClause, visitor); | 3550 safelyVisitChild(_implementsClause, visitor); |
| 3500 safelyVisitChild(nativeClause, visitor); | 3551 safelyVisitChild(_nativeClause, visitor); |
| 3501 members.accept(visitor); | 3552 members.accept(visitor); |
| 3502 } | 3553 } |
| 3503 | 3554 |
| 3504 @override | 3555 @override |
| 3505 Token get firstTokenAfterCommentAndMetadata { | 3556 Token get firstTokenAfterCommentAndMetadata { |
| 3506 if (abstractKeyword != null) { | 3557 if (abstractKeyword != null) { |
| 3507 return abstractKeyword; | 3558 return abstractKeyword; |
| 3508 } | 3559 } |
| 3509 return classKeyword; | 3560 return classKeyword; |
| 3510 } | 3561 } |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3899 * @return the identifier being referenced | 3950 * @return the identifier being referenced |
| 3900 */ | 3951 */ |
| 3901 Identifier get identifier => _identifier; | 3952 Identifier get identifier => _identifier; |
| 3902 | 3953 |
| 3903 /** | 3954 /** |
| 3904 * Set the identifier being referenced to the given identifier. | 3955 * Set the identifier being referenced to the given identifier. |
| 3905 * | 3956 * |
| 3906 * @param identifier the identifier being referenced | 3957 * @param identifier the identifier being referenced |
| 3907 */ | 3958 */ |
| 3908 void set identifier(Identifier identifier) { | 3959 void set identifier(Identifier identifier) { |
| 3909 identifier = becomeParentOf(identifier); | 3960 this._identifier = becomeParentOf(identifier); |
| 3910 } | 3961 } |
| 3911 | 3962 |
| 3912 @override | 3963 @override |
| 3913 void visitChildren(AstVisitor visitor) { | 3964 void visitChildren(AstVisitor visitor) { |
| 3914 safelyVisitChild(_identifier, visitor); | 3965 safelyVisitChild(_identifier, visitor); |
| 3915 } | 3966 } |
| 3916 } | 3967 } |
| 3917 | 3968 |
| 3918 /** | 3969 /** |
| 3919 * The enumeration `CommentType` encodes all the different types of comments tha
t are | 3970 * The enumeration `CommentType` encodes all the different types of comments tha
t are |
| (...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5283 /** | 5334 /** |
| 5284 * Return `true` if this variable was declared with the 'final' modifier. Vari
ables that are | 5335 * Return `true` if this variable was declared with the 'final' modifier. Vari
ables that are |
| 5285 * declared with the 'const' modifier will return `false` even though they are
implicitly | 5336 * declared with the 'const' modifier will return `false` even though they are
implicitly |
| 5286 * final. | 5337 * final. |
| 5287 * | 5338 * |
| 5288 * @return `true` if this variable was declared with the 'final' modifier | 5339 * @return `true` if this variable was declared with the 'final' modifier |
| 5289 */ | 5340 */ |
| 5290 bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).key
word == Keyword.FINAL; | 5341 bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).key
word == Keyword.FINAL; |
| 5291 | 5342 |
| 5292 /** | 5343 /** |
| 5344 * Set the name of the variable being declared to the given name. |
| 5345 * |
| 5346 * @param identifier the new name of the variable being declared |
| 5347 */ |
| 5348 void set identifier(SimpleIdentifier identifier) { |
| 5349 this._identifier = becomeParentOf(identifier); |
| 5350 } |
| 5351 |
| 5352 /** |
| 5293 * Set the name of the declared type of the parameter to the given type name. | 5353 * Set the name of the declared type of the parameter to the given type name. |
| 5294 * | 5354 * |
| 5295 * @param typeName the name of the declared type of the parameter | 5355 * @param typeName the name of the declared type of the parameter |
| 5296 */ | 5356 */ |
| 5297 void set type(TypeName typeName) { | 5357 void set type(TypeName typeName) { |
| 5298 _type = becomeParentOf(typeName); | 5358 _type = becomeParentOf(typeName); |
| 5299 } | 5359 } |
| 5300 | 5360 |
| 5301 @override | 5361 @override |
| 5302 void visitChildren(AstVisitor visitor) { | 5362 void visitChildren(AstVisitor visitor) { |
| (...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6408 * @return `true` if the fields are declared to be static | 6468 * @return `true` if the fields are declared to be static |
| 6409 */ | 6469 */ |
| 6410 bool get isStatic => staticKeyword != null; | 6470 bool get isStatic => staticKeyword != null; |
| 6411 | 6471 |
| 6412 /** | 6472 /** |
| 6413 * Set the fields being declared to the given list of variables. | 6473 * Set the fields being declared to the given list of variables. |
| 6414 * | 6474 * |
| 6415 * @param fieldList the fields being declared | 6475 * @param fieldList the fields being declared |
| 6416 */ | 6476 */ |
| 6417 void set fields(VariableDeclarationList fieldList) { | 6477 void set fields(VariableDeclarationList fieldList) { |
| 6418 fieldList = becomeParentOf(fieldList); | 6478 this._fieldList = becomeParentOf(fieldList); |
| 6419 } | 6479 } |
| 6420 | 6480 |
| 6421 @override | 6481 @override |
| 6422 void visitChildren(AstVisitor visitor) { | 6482 void visitChildren(AstVisitor visitor) { |
| 6423 super.visitChildren(visitor); | 6483 super.visitChildren(visitor); |
| 6424 safelyVisitChild(_fieldList, visitor); | 6484 safelyVisitChild(_fieldList, visitor); |
| 6425 } | 6485 } |
| 6426 | 6486 |
| 6427 @override | 6487 @override |
| 6428 Token get firstTokenAfterCommentAndMetadata { | 6488 Token get firstTokenAfterCommentAndMetadata { |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6885 void set initialization(Expression initialization) { | 6945 void set initialization(Expression initialization) { |
| 6886 this._initialization = becomeParentOf(initialization); | 6946 this._initialization = becomeParentOf(initialization); |
| 6887 } | 6947 } |
| 6888 | 6948 |
| 6889 /** | 6949 /** |
| 6890 * Set the declaration of the loop variables to the given parameter. | 6950 * Set the declaration of the loop variables to the given parameter. |
| 6891 * | 6951 * |
| 6892 * @param variableList the declaration of the loop variables | 6952 * @param variableList the declaration of the loop variables |
| 6893 */ | 6953 */ |
| 6894 void set variables(VariableDeclarationList variableList) { | 6954 void set variables(VariableDeclarationList variableList) { |
| 6895 variableList = becomeParentOf(variableList); | 6955 this._variableList = becomeParentOf(variableList); |
| 6896 } | 6956 } |
| 6897 | 6957 |
| 6898 @override | 6958 @override |
| 6899 void visitChildren(AstVisitor visitor) { | 6959 void visitChildren(AstVisitor visitor) { |
| 6900 safelyVisitChild(_variableList, visitor); | 6960 safelyVisitChild(_variableList, visitor); |
| 6901 safelyVisitChild(_initialization, visitor); | 6961 safelyVisitChild(_initialization, visitor); |
| 6902 safelyVisitChild(_condition, visitor); | 6962 safelyVisitChild(_condition, visitor); |
| 6903 _updaters.accept(visitor); | 6963 _updaters.accept(visitor); |
| 6904 safelyVisitChild(_body, visitor); | 6964 safelyVisitChild(_body, visitor); |
| 6905 } | 6965 } |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7258 * @return `true` if this function declares a setter | 7318 * @return `true` if this function declares a setter |
| 7259 */ | 7319 */ |
| 7260 bool get isSetter => propertyKeyword != null && (propertyKeyword as KeywordTok
en).keyword == Keyword.SET; | 7320 bool get isSetter => propertyKeyword != null && (propertyKeyword as KeywordTok
en).keyword == Keyword.SET; |
| 7261 | 7321 |
| 7262 /** | 7322 /** |
| 7263 * Set the function expression being wrapped to the given function expression. | 7323 * Set the function expression being wrapped to the given function expression. |
| 7264 * | 7324 * |
| 7265 * @param functionExpression the function expression being wrapped | 7325 * @param functionExpression the function expression being wrapped |
| 7266 */ | 7326 */ |
| 7267 void set functionExpression(FunctionExpression functionExpression) { | 7327 void set functionExpression(FunctionExpression functionExpression) { |
| 7268 functionExpression = becomeParentOf(functionExpression); | 7328 this._functionExpression = becomeParentOf(functionExpression); |
| 7269 } | 7329 } |
| 7270 | 7330 |
| 7271 /** | 7331 /** |
| 7272 * Set the name of the function to the given identifier. | 7332 * Set the name of the function to the given identifier. |
| 7273 * | 7333 * |
| 7274 * @param identifier the name of the function | 7334 * @param identifier the name of the function |
| 7275 */ | 7335 */ |
| 7276 void set name(SimpleIdentifier identifier) { | 7336 void set name(SimpleIdentifier identifier) { |
| 7277 _name = becomeParentOf(identifier); | 7337 this._name = becomeParentOf(identifier); |
| 7278 } | 7338 } |
| 7279 | 7339 |
| 7280 /** | 7340 /** |
| 7281 * Set the return type of the function to the given name. | 7341 * Set the return type of the function to the given name. |
| 7282 * | 7342 * |
| 7283 * @param name the return type of the function | 7343 * @param returnType the return type of the function |
| 7284 */ | 7344 */ |
| 7285 void set returnType(TypeName name) { | 7345 void set returnType(TypeName returnType) { |
| 7286 _returnType = becomeParentOf(name); | 7346 this._returnType = becomeParentOf(returnType); |
| 7287 } | 7347 } |
| 7288 | 7348 |
| 7289 @override | 7349 @override |
| 7290 void visitChildren(AstVisitor visitor) { | 7350 void visitChildren(AstVisitor visitor) { |
| 7291 super.visitChildren(visitor); | 7351 super.visitChildren(visitor); |
| 7292 safelyVisitChild(_returnType, visitor); | 7352 safelyVisitChild(_returnType, visitor); |
| 7293 safelyVisitChild(_name, visitor); | 7353 safelyVisitChild(_name, visitor); |
| 7294 safelyVisitChild(_functionExpression, visitor); | 7354 safelyVisitChild(_functionExpression, visitor); |
| 7295 } | 7355 } |
| 7296 | 7356 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7343 * | 7403 * |
| 7344 * @return the function declaration being wrapped | 7404 * @return the function declaration being wrapped |
| 7345 */ | 7405 */ |
| 7346 FunctionDeclaration get functionDeclaration => _functionDeclaration; | 7406 FunctionDeclaration get functionDeclaration => _functionDeclaration; |
| 7347 | 7407 |
| 7348 /** | 7408 /** |
| 7349 * Set the function declaration being wrapped to the given function declaratio
n. | 7409 * Set the function declaration being wrapped to the given function declaratio
n. |
| 7350 * | 7410 * |
| 7351 * @param functionDeclaration the function declaration being wrapped | 7411 * @param functionDeclaration the function declaration being wrapped |
| 7352 */ | 7412 */ |
| 7353 void set functionExpression(FunctionDeclaration functionDeclaration) { | 7413 void set functionDeclaration(FunctionDeclaration functionDeclaration) { |
| 7354 this._functionDeclaration = becomeParentOf(functionDeclaration); | 7414 this._functionDeclaration = becomeParentOf(functionDeclaration); |
| 7355 } | 7415 } |
| 7356 | 7416 |
| 7357 @override | 7417 @override |
| 7358 void visitChildren(AstVisitor visitor) { | 7418 void visitChildren(AstVisitor visitor) { |
| 7359 safelyVisitChild(_functionDeclaration, visitor); | 7419 safelyVisitChild(_functionDeclaration, visitor); |
| 7360 } | 7420 } |
| 7361 } | 7421 } |
| 7362 | 7422 |
| 7363 /** | 7423 /** |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7571 void set argumentList(ArgumentList argumentList) { | 7631 void set argumentList(ArgumentList argumentList) { |
| 7572 this._argumentList = becomeParentOf(argumentList); | 7632 this._argumentList = becomeParentOf(argumentList); |
| 7573 } | 7633 } |
| 7574 | 7634 |
| 7575 /** | 7635 /** |
| 7576 * Set the expression producing the function being invoked to the given expres
sion. | 7636 * Set the expression producing the function being invoked to the given expres
sion. |
| 7577 * | 7637 * |
| 7578 * @param function the expression producing the function being invoked | 7638 * @param function the expression producing the function being invoked |
| 7579 */ | 7639 */ |
| 7580 void set function(Expression function) { | 7640 void set function(Expression function) { |
| 7581 function = becomeParentOf(function); | 7641 this._function = becomeParentOf(function); |
| 7582 } | 7642 } |
| 7583 | 7643 |
| 7584 /** | 7644 /** |
| 7585 * Set the element associated with the function being invoked based on propaga
ted type information | 7645 * Set the element associated with the function being invoked based on propaga
ted type information |
| 7586 * to the given element. | 7646 * to the given element. |
| 7587 * | 7647 * |
| 7588 * @param element the element to be associated with the function being invoked | 7648 * @param element the element to be associated with the function being invoked |
| 7589 */ | 7649 */ |
| 7590 void set propagatedElement(ExecutableElement element) { | 7650 void set propagatedElement(ExecutableElement element) { |
| 7591 _propagatedElement = element; | 7651 _propagatedElement = element; |
| (...skipping 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9666 */ | 9726 */ |
| 9667 class InstanceCreationExpression extends Expression { | 9727 class InstanceCreationExpression extends Expression { |
| 9668 /** | 9728 /** |
| 9669 * The keyword used to indicate how an object should be created. | 9729 * The keyword used to indicate how an object should be created. |
| 9670 */ | 9730 */ |
| 9671 Token keyword; | 9731 Token keyword; |
| 9672 | 9732 |
| 9673 /** | 9733 /** |
| 9674 * The name of the constructor to be invoked. | 9734 * The name of the constructor to be invoked. |
| 9675 */ | 9735 */ |
| 9676 ConstructorName constructorName; | 9736 ConstructorName _constructorName; |
| 9677 | 9737 |
| 9678 /** | 9738 /** |
| 9679 * The list of arguments to the constructor. | 9739 * The list of arguments to the constructor. |
| 9680 */ | 9740 */ |
| 9681 ArgumentList _argumentList; | 9741 ArgumentList _argumentList; |
| 9682 | 9742 |
| 9683 /** | 9743 /** |
| 9684 * The element associated with the constructor based on static type informatio
n, or `null` | 9744 * The element associated with the constructor based on static type informatio
n, or `null` |
| 9685 * if the AST structure has not been resolved or if the constructor could not
be resolved. | 9745 * if the AST structure has not been resolved or if the constructor could not
be resolved. |
| 9686 */ | 9746 */ |
| 9687 ConstructorElement staticElement; | 9747 ConstructorElement staticElement; |
| 9688 | 9748 |
| 9689 /** | 9749 /** |
| 9690 * The result of evaluating this expression, if it is constant. | 9750 * The result of evaluating this expression, if it is constant. |
| 9691 */ | 9751 */ |
| 9692 EvaluationResultImpl _result; | 9752 EvaluationResultImpl _result; |
| 9693 | 9753 |
| 9694 /** | 9754 /** |
| 9695 * Initialize a newly created instance creation expression. | 9755 * Initialize a newly created instance creation expression. |
| 9696 * | 9756 * |
| 9697 * @param keyword the keyword used to indicate how an object should be created | 9757 * @param keyword the keyword used to indicate how an object should be created |
| 9698 * @param constructorName the name of the constructor to be invoked | 9758 * @param constructorName the name of the constructor to be invoked |
| 9699 * @param argumentList the list of arguments to the constructor | 9759 * @param argumentList the list of arguments to the constructor |
| 9700 */ | 9760 */ |
| 9701 InstanceCreationExpression(this.keyword, ConstructorName constructorName, Argu
mentList argumentList) { | 9761 InstanceCreationExpression(this.keyword, ConstructorName constructorName, Argu
mentList argumentList) { |
| 9702 this.constructorName = becomeParentOf(constructorName); | 9762 this._constructorName = becomeParentOf(constructorName); |
| 9703 this._argumentList = becomeParentOf(argumentList); | 9763 this._argumentList = becomeParentOf(argumentList); |
| 9704 } | 9764 } |
| 9705 | 9765 |
| 9706 @override | 9766 @override |
| 9707 accept(AstVisitor visitor) => visitor.visitInstanceCreationExpression(this); | 9767 accept(AstVisitor visitor) => visitor.visitInstanceCreationExpression(this); |
| 9708 | 9768 |
| 9709 /** | 9769 /** |
| 9710 * Return the list of arguments to the constructor. | 9770 * Return the list of arguments to the constructor. |
| 9711 * | 9771 * |
| 9712 * @return the list of arguments to the constructor | 9772 * @return the list of arguments to the constructor |
| 9713 */ | 9773 */ |
| 9714 ArgumentList get argumentList => _argumentList; | 9774 ArgumentList get argumentList => _argumentList; |
| 9715 | 9775 |
| 9716 @override | 9776 @override |
| 9717 Token get beginToken => keyword; | 9777 Token get beginToken => keyword; |
| 9718 | 9778 |
| 9779 /** |
| 9780 * Return the name of the constructor to be invoked. |
| 9781 * |
| 9782 * @return the name of the constructor to be invoked |
| 9783 */ |
| 9784 ConstructorName get constructorName => _constructorName; |
| 9785 |
| 9719 @override | 9786 @override |
| 9720 Token get endToken => _argumentList.endToken; | 9787 Token get endToken => _argumentList.endToken; |
| 9721 | 9788 |
| 9722 /** | 9789 /** |
| 9723 * Return the result of evaluating this constant as a compile-time constant ex
pression, or | 9790 * Return the result of evaluating this constant as a compile-time constant ex
pression, or |
| 9724 * `null` if this variable is not a 'const' expression or an error prevented t
he result from | 9791 * `null` if this variable is not a 'const' expression or an error prevented t
he result from |
| 9725 * being computed. | 9792 * being computed. |
| 9726 * | 9793 * |
| 9727 * @return the result of evaluating this constant | 9794 * @return the result of evaluating this constant |
| 9728 */ | 9795 */ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 9741 /** | 9808 /** |
| 9742 * Set the list of arguments to the constructor to the given list. | 9809 * Set the list of arguments to the constructor to the given list. |
| 9743 * | 9810 * |
| 9744 * @param argumentList the list of arguments to the constructor | 9811 * @param argumentList the list of arguments to the constructor |
| 9745 */ | 9812 */ |
| 9746 void set argumentList(ArgumentList argumentList) { | 9813 void set argumentList(ArgumentList argumentList) { |
| 9747 this._argumentList = becomeParentOf(argumentList); | 9814 this._argumentList = becomeParentOf(argumentList); |
| 9748 } | 9815 } |
| 9749 | 9816 |
| 9750 /** | 9817 /** |
| 9818 * Set the name of the constructor to be invoked to the given name. |
| 9819 * |
| 9820 * @param constructorName the name of the constructor to be invoked |
| 9821 */ |
| 9822 void set constructorName(ConstructorName constructorName) { |
| 9823 this._constructorName = becomeParentOf(constructorName); |
| 9824 } |
| 9825 |
| 9826 /** |
| 9751 * Set the result of evaluating this expression as a compile-time constant exp
ression to the given | 9827 * Set the result of evaluating this expression as a compile-time constant exp
ression to the given |
| 9752 * result. | 9828 * result. |
| 9753 * | 9829 * |
| 9754 * @param result the result of evaluating this expression | 9830 * @param result the result of evaluating this expression |
| 9755 */ | 9831 */ |
| 9756 void set evaluationResult(EvaluationResultImpl result) { | 9832 void set evaluationResult(EvaluationResultImpl result) { |
| 9757 this._result = result; | 9833 this._result = result; |
| 9758 } | 9834 } |
| 9759 | 9835 |
| 9760 @override | 9836 @override |
| 9761 void visitChildren(AstVisitor visitor) { | 9837 void visitChildren(AstVisitor visitor) { |
| 9762 safelyVisitChild(constructorName, visitor); | 9838 safelyVisitChild(_constructorName, visitor); |
| 9763 safelyVisitChild(_argumentList, visitor); | 9839 safelyVisitChild(_argumentList, visitor); |
| 9764 } | 9840 } |
| 9765 } | 9841 } |
| 9766 | 9842 |
| 9767 /** | 9843 /** |
| 9768 * Instances of the class `IntegerLiteral` represent an integer literal expressi
on. | 9844 * Instances of the class `IntegerLiteral` represent an integer literal expressi
on. |
| 9769 * | 9845 * |
| 9770 * <pre> | 9846 * <pre> |
| 9771 * integerLiteral ::= | 9847 * integerLiteral ::= |
| 9772 * decimalIntegerLiteral | 9848 * decimalIntegerLiteral |
| (...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11220 */ | 11296 */ |
| 11221 class NativeClause extends AstNode { | 11297 class NativeClause extends AstNode { |
| 11222 /** | 11298 /** |
| 11223 * The token representing the 'native' keyword. | 11299 * The token representing the 'native' keyword. |
| 11224 */ | 11300 */ |
| 11225 Token keyword; | 11301 Token keyword; |
| 11226 | 11302 |
| 11227 /** | 11303 /** |
| 11228 * The name of the native object that implements the class. | 11304 * The name of the native object that implements the class. |
| 11229 */ | 11305 */ |
| 11230 StringLiteral name; | 11306 StringLiteral _name; |
| 11231 | 11307 |
| 11232 /** | 11308 /** |
| 11233 * Initialize a newly created native clause. | 11309 * Initialize a newly created native clause. |
| 11234 * | 11310 * |
| 11235 * @param keyword the token representing the 'native' keyword | 11311 * @param keyword the token representing the 'native' keyword |
| 11236 * @param name the name of the native object that implements the class. | 11312 * @param name the name of the native object that implements the class. |
| 11237 */ | 11313 */ |
| 11238 NativeClause(this.keyword, this.name); | 11314 NativeClause(this.keyword, StringLiteral name) { |
| 11315 this._name = becomeParentOf(name); |
| 11316 } |
| 11239 | 11317 |
| 11240 @override | 11318 @override |
| 11241 accept(AstVisitor visitor) => visitor.visitNativeClause(this); | 11319 accept(AstVisitor visitor) => visitor.visitNativeClause(this); |
| 11242 | 11320 |
| 11243 @override | 11321 @override |
| 11244 Token get beginToken => keyword; | 11322 Token get beginToken => keyword; |
| 11245 | 11323 |
| 11246 @override | 11324 @override |
| 11247 Token get endToken => name.endToken; | 11325 Token get endToken => _name.endToken; |
| 11326 |
| 11327 /** |
| 11328 * Return the name of the native object that implements the class. |
| 11329 * |
| 11330 * @return the name of the native object that implements the class |
| 11331 */ |
| 11332 StringLiteral get name => _name; |
| 11333 |
| 11334 /** |
| 11335 * Sets the name of the native object that implements the class. |
| 11336 * |
| 11337 * @param name the name of the native object that implements the class. |
| 11338 */ |
| 11339 void set name(StringLiteral name) { |
| 11340 this._name = becomeParentOf(name); |
| 11341 } |
| 11248 | 11342 |
| 11249 @override | 11343 @override |
| 11250 void visitChildren(AstVisitor visitor) { | 11344 void visitChildren(AstVisitor visitor) { |
| 11251 safelyVisitChild(name, visitor); | 11345 safelyVisitChild(_name, visitor); |
| 11252 } | 11346 } |
| 11253 } | 11347 } |
| 11254 | 11348 |
| 11255 /** | 11349 /** |
| 11256 * Instances of the class `NativeFunctionBody` represent a function body that co
nsists of a | 11350 * Instances of the class `NativeFunctionBody` represent a function body that co
nsists of a |
| 11257 * native keyword followed by a string literal. | 11351 * native keyword followed by a string literal. |
| 11258 * | 11352 * |
| 11259 * <pre> | 11353 * <pre> |
| 11260 * nativeFunctionBody ::= | 11354 * nativeFunctionBody ::= |
| 11261 * 'native' [SimpleStringLiteral] ';' | 11355 * 'native' [SimpleStringLiteral] ';' |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11298 @override | 11392 @override |
| 11299 Token get endToken => semicolon; | 11393 Token get endToken => semicolon; |
| 11300 | 11394 |
| 11301 /** | 11395 /** |
| 11302 * Return the string literal representing the string after the 'native' token. | 11396 * Return the string literal representing the string after the 'native' token. |
| 11303 * | 11397 * |
| 11304 * @return the string literal representing the string after the 'native' token | 11398 * @return the string literal representing the string after the 'native' token |
| 11305 */ | 11399 */ |
| 11306 StringLiteral get stringLiteral => _stringLiteral; | 11400 StringLiteral get stringLiteral => _stringLiteral; |
| 11307 | 11401 |
| 11402 /** |
| 11403 * Set the string literal representing the string after the 'native' token to
the given string. |
| 11404 * |
| 11405 * @param stringLiteral the string literal representing the string after the '
native' token |
| 11406 */ |
| 11407 void set stringLiteral(StringLiteral stringLiteral) { |
| 11408 this._stringLiteral = becomeParentOf(stringLiteral); |
| 11409 } |
| 11410 |
| 11308 @override | 11411 @override |
| 11309 void visitChildren(AstVisitor visitor) { | 11412 void visitChildren(AstVisitor visitor) { |
| 11310 safelyVisitChild(_stringLiteral, visitor); | 11413 safelyVisitChild(_stringLiteral, visitor); |
| 11311 } | 11414 } |
| 11312 } | 11415 } |
| 11313 | 11416 |
| 11314 /** | 11417 /** |
| 11315 * Instances of the class `NodeLocator` locate the [AstNode] associated with a | 11418 * Instances of the class `NodeLocator` locate the [AstNode] associated with a |
| 11316 * source range, given the AST structure built from the source. More specificall
y, they will return | 11419 * source range, given the AST structure built from the source. More specificall
y, they will return |
| 11317 * the [AstNode] with the shortest length whose source range completely encompas
ses | 11420 * the [AstNode] with the shortest length whose source range completely encompas
ses |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11412 | 11515 |
| 11413 /** | 11516 /** |
| 11414 * Instances of the class `NodeFoundException` are used to cancel visiting after
a node has | 11517 * Instances of the class `NodeFoundException` are used to cancel visiting after
a node has |
| 11415 * been found. | 11518 * been found. |
| 11416 */ | 11519 */ |
| 11417 class NodeLocator_NodeFoundException extends RuntimeException { | 11520 class NodeLocator_NodeFoundException extends RuntimeException { |
| 11418 static int _serialVersionUID = 1; | 11521 static int _serialVersionUID = 1; |
| 11419 } | 11522 } |
| 11420 | 11523 |
| 11421 /** | 11524 /** |
| 11525 * Instances of the class `NodeReplacer` implement an object that will replace o
ne child node |
| 11526 * in an AST node with another node. |
| 11527 */ |
| 11528 class NodeReplacer implements AstVisitor<bool> { |
| 11529 /** |
| 11530 * Replace the old node with the new node in the AST structure containing the
old node. |
| 11531 * |
| 11532 * @param oldNode |
| 11533 * @param newNode |
| 11534 * @return `true` if the replacement was successful |
| 11535 * @throws IllegalArgumentException if either node is `null`, if the old node
does not have |
| 11536 * a parent node, or if the AST structure has been corrupted |
| 11537 */ |
| 11538 static bool replace(AstNode oldNode, AstNode newNode) { |
| 11539 if (oldNode == null || newNode == null) { |
| 11540 throw new IllegalArgumentException("The old and new nodes must be non-null
"); |
| 11541 } else if (identical(oldNode, newNode)) { |
| 11542 return true; |
| 11543 } |
| 11544 AstNode parent = oldNode.parent; |
| 11545 if (parent == null) { |
| 11546 throw new IllegalArgumentException("The old node is not a child of another
node"); |
| 11547 } |
| 11548 NodeReplacer replacer = new NodeReplacer(oldNode, newNode); |
| 11549 return parent.accept(replacer); |
| 11550 } |
| 11551 |
| 11552 final AstNode _oldNode; |
| 11553 |
| 11554 final AstNode _newNode; |
| 11555 |
| 11556 NodeReplacer(this._oldNode, this._newNode); |
| 11557 |
| 11558 @override |
| 11559 bool visitAdjacentStrings(AdjacentStrings node) { |
| 11560 if (_replaceInList(node.strings)) { |
| 11561 return true; |
| 11562 } |
| 11563 return visitNode(node); |
| 11564 } |
| 11565 |
| 11566 bool visitAnnotatedNode(AnnotatedNode node) { |
| 11567 if (identical(node.documentationComment, _oldNode)) { |
| 11568 node.documentationComment = _newNode as Comment; |
| 11569 return true; |
| 11570 } else if (_replaceInList(node.metadata)) { |
| 11571 return true; |
| 11572 } |
| 11573 return visitNode(node); |
| 11574 } |
| 11575 |
| 11576 @override |
| 11577 bool visitAnnotation(Annotation node) { |
| 11578 if (identical(node.arguments, _oldNode)) { |
| 11579 node.arguments = _newNode as ArgumentList; |
| 11580 return true; |
| 11581 } else if (identical(node.constructorName, _oldNode)) { |
| 11582 node.constructorName = _newNode as SimpleIdentifier; |
| 11583 return true; |
| 11584 } else if (identical(node.name, _oldNode)) { |
| 11585 node.name = _newNode as Identifier; |
| 11586 return true; |
| 11587 } |
| 11588 return visitNode(node); |
| 11589 } |
| 11590 |
| 11591 @override |
| 11592 bool visitArgumentList(ArgumentList node) { |
| 11593 if (_replaceInList(node.arguments)) { |
| 11594 return true; |
| 11595 } |
| 11596 return visitNode(node); |
| 11597 } |
| 11598 |
| 11599 @override |
| 11600 bool visitAsExpression(AsExpression node) { |
| 11601 if (identical(node.expression, _oldNode)) { |
| 11602 node.expression = _newNode as Expression; |
| 11603 return true; |
| 11604 } else if (identical(node.type, _oldNode)) { |
| 11605 node.type = _newNode as TypeName; |
| 11606 return true; |
| 11607 } |
| 11608 return visitNode(node); |
| 11609 } |
| 11610 |
| 11611 @override |
| 11612 bool visitAssertStatement(AssertStatement node) { |
| 11613 if (identical(node.condition, _oldNode)) { |
| 11614 node.condition = _newNode as Expression; |
| 11615 return true; |
| 11616 } |
| 11617 return visitNode(node); |
| 11618 } |
| 11619 |
| 11620 @override |
| 11621 bool visitAssignmentExpression(AssignmentExpression node) { |
| 11622 if (identical(node.leftHandSide, _oldNode)) { |
| 11623 node.leftHandSide = _newNode as Expression; |
| 11624 return true; |
| 11625 } else if (identical(node.rightHandSide, _oldNode)) { |
| 11626 node.rightHandSide = _newNode as Expression; |
| 11627 return true; |
| 11628 } |
| 11629 return visitNode(node); |
| 11630 } |
| 11631 |
| 11632 @override |
| 11633 bool visitBinaryExpression(BinaryExpression node) { |
| 11634 if (identical(node.leftOperand, _oldNode)) { |
| 11635 node.leftOperand = _newNode as Expression; |
| 11636 return true; |
| 11637 } else if (identical(node.rightOperand, _oldNode)) { |
| 11638 node.rightOperand = _newNode as Expression; |
| 11639 return true; |
| 11640 } |
| 11641 return visitNode(node); |
| 11642 } |
| 11643 |
| 11644 @override |
| 11645 bool visitBlock(Block node) { |
| 11646 if (_replaceInList(node.statements)) { |
| 11647 return true; |
| 11648 } |
| 11649 return visitNode(node); |
| 11650 } |
| 11651 |
| 11652 @override |
| 11653 bool visitBlockFunctionBody(BlockFunctionBody node) { |
| 11654 if (identical(node.block, _oldNode)) { |
| 11655 node.block = _newNode as Block; |
| 11656 return true; |
| 11657 } |
| 11658 return visitNode(node); |
| 11659 } |
| 11660 |
| 11661 @override |
| 11662 bool visitBooleanLiteral(BooleanLiteral node) => visitNode(node); |
| 11663 |
| 11664 @override |
| 11665 bool visitBreakStatement(BreakStatement node) { |
| 11666 if (identical(node.label, _oldNode)) { |
| 11667 node.label = _newNode as SimpleIdentifier; |
| 11668 return true; |
| 11669 } |
| 11670 return visitNode(node); |
| 11671 } |
| 11672 |
| 11673 @override |
| 11674 bool visitCascadeExpression(CascadeExpression node) { |
| 11675 if (identical(node.target, _oldNode)) { |
| 11676 node.target = _newNode as Expression; |
| 11677 return true; |
| 11678 } else if (_replaceInList(node.cascadeSections)) { |
| 11679 return true; |
| 11680 } |
| 11681 return visitNode(node); |
| 11682 } |
| 11683 |
| 11684 @override |
| 11685 bool visitCatchClause(CatchClause node) { |
| 11686 if (identical(node.exceptionType, _oldNode)) { |
| 11687 node.exceptionType = _newNode as TypeName; |
| 11688 return true; |
| 11689 } else if (identical(node.exceptionParameter, _oldNode)) { |
| 11690 node.exceptionParameter = _newNode as SimpleIdentifier; |
| 11691 return true; |
| 11692 } else if (identical(node.stackTraceParameter, _oldNode)) { |
| 11693 node.stackTraceParameter = _newNode as SimpleIdentifier; |
| 11694 return true; |
| 11695 } |
| 11696 return visitNode(node); |
| 11697 } |
| 11698 |
| 11699 @override |
| 11700 bool visitClassDeclaration(ClassDeclaration node) { |
| 11701 if (identical(node.name, _oldNode)) { |
| 11702 node.name = _newNode as SimpleIdentifier; |
| 11703 return true; |
| 11704 } else if (identical(node.typeParameters, _oldNode)) { |
| 11705 node.typeParameters = _newNode as TypeParameterList; |
| 11706 return true; |
| 11707 } else if (identical(node.extendsClause, _oldNode)) { |
| 11708 node.extendsClause = _newNode as ExtendsClause; |
| 11709 return true; |
| 11710 } else if (identical(node.withClause, _oldNode)) { |
| 11711 node.withClause = _newNode as WithClause; |
| 11712 return true; |
| 11713 } else if (identical(node.implementsClause, _oldNode)) { |
| 11714 node.implementsClause = _newNode as ImplementsClause; |
| 11715 return true; |
| 11716 } else if (identical(node.nativeClause, _oldNode)) { |
| 11717 node.nativeClause = _newNode as NativeClause; |
| 11718 return true; |
| 11719 } else if (_replaceInList(node.members)) { |
| 11720 return true; |
| 11721 } |
| 11722 return visitAnnotatedNode(node); |
| 11723 } |
| 11724 |
| 11725 @override |
| 11726 bool visitClassTypeAlias(ClassTypeAlias node) { |
| 11727 if (identical(node.name, _oldNode)) { |
| 11728 node.name = _newNode as SimpleIdentifier; |
| 11729 return true; |
| 11730 } else if (identical(node.typeParameters, _oldNode)) { |
| 11731 node.typeParameters = _newNode as TypeParameterList; |
| 11732 return true; |
| 11733 } else if (identical(node.superclass, _oldNode)) { |
| 11734 node.superclass = _newNode as TypeName; |
| 11735 return true; |
| 11736 } else if (identical(node.withClause, _oldNode)) { |
| 11737 node.withClause = _newNode as WithClause; |
| 11738 return true; |
| 11739 } else if (identical(node.implementsClause, _oldNode)) { |
| 11740 node.implementsClause = _newNode as ImplementsClause; |
| 11741 return true; |
| 11742 } |
| 11743 return visitAnnotatedNode(node); |
| 11744 } |
| 11745 |
| 11746 @override |
| 11747 bool visitComment(Comment node) { |
| 11748 if (_replaceInList(node.references)) { |
| 11749 return true; |
| 11750 } |
| 11751 return visitNode(node); |
| 11752 } |
| 11753 |
| 11754 @override |
| 11755 bool visitCommentReference(CommentReference node) { |
| 11756 if (identical(node.identifier, _oldNode)) { |
| 11757 node.identifier = _newNode as Identifier; |
| 11758 return true; |
| 11759 } |
| 11760 return visitNode(node); |
| 11761 } |
| 11762 |
| 11763 @override |
| 11764 bool visitCompilationUnit(CompilationUnit node) { |
| 11765 if (identical(node.scriptTag, _oldNode)) { |
| 11766 node.scriptTag = _newNode as ScriptTag; |
| 11767 return true; |
| 11768 } else if (_replaceInList(node.directives)) { |
| 11769 return true; |
| 11770 } else if (_replaceInList(node.declarations)) { |
| 11771 return true; |
| 11772 } |
| 11773 return visitNode(node); |
| 11774 } |
| 11775 |
| 11776 @override |
| 11777 bool visitConditionalExpression(ConditionalExpression node) { |
| 11778 if (identical(node.condition, _oldNode)) { |
| 11779 node.condition = _newNode as Expression; |
| 11780 return true; |
| 11781 } else if (identical(node.thenExpression, _oldNode)) { |
| 11782 node.thenExpression = _newNode as Expression; |
| 11783 return true; |
| 11784 } else if (identical(node.elseExpression, _oldNode)) { |
| 11785 node.elseExpression = _newNode as Expression; |
| 11786 return true; |
| 11787 } |
| 11788 return visitNode(node); |
| 11789 } |
| 11790 |
| 11791 @override |
| 11792 bool visitConstructorDeclaration(ConstructorDeclaration node) { |
| 11793 if (identical(node.returnType, _oldNode)) { |
| 11794 node.returnType = _newNode as Identifier; |
| 11795 return true; |
| 11796 } else if (identical(node.name, _oldNode)) { |
| 11797 node.name = _newNode as SimpleIdentifier; |
| 11798 return true; |
| 11799 } else if (identical(node.parameters, _oldNode)) { |
| 11800 node.parameters = _newNode as FormalParameterList; |
| 11801 return true; |
| 11802 } else if (identical(node.redirectedConstructor, _oldNode)) { |
| 11803 node.redirectedConstructor = _newNode as ConstructorName; |
| 11804 return true; |
| 11805 } else if (identical(node.body, _oldNode)) { |
| 11806 node.body = _newNode as FunctionBody; |
| 11807 return true; |
| 11808 } else if (_replaceInList(node.initializers)) { |
| 11809 return true; |
| 11810 } |
| 11811 return visitAnnotatedNode(node); |
| 11812 } |
| 11813 |
| 11814 @override |
| 11815 bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) { |
| 11816 if (identical(node.fieldName, _oldNode)) { |
| 11817 node.fieldName = _newNode as SimpleIdentifier; |
| 11818 return true; |
| 11819 } else if (identical(node.expression, _oldNode)) { |
| 11820 node.expression = _newNode as Expression; |
| 11821 return true; |
| 11822 } |
| 11823 return visitNode(node); |
| 11824 } |
| 11825 |
| 11826 @override |
| 11827 bool visitConstructorName(ConstructorName node) { |
| 11828 if (identical(node.type, _oldNode)) { |
| 11829 node.type = _newNode as TypeName; |
| 11830 return true; |
| 11831 } else if (identical(node.name, _oldNode)) { |
| 11832 node.name = _newNode as SimpleIdentifier; |
| 11833 return true; |
| 11834 } |
| 11835 return visitNode(node); |
| 11836 } |
| 11837 |
| 11838 @override |
| 11839 bool visitContinueStatement(ContinueStatement node) { |
| 11840 if (identical(node.label, _oldNode)) { |
| 11841 node.label = _newNode as SimpleIdentifier; |
| 11842 return true; |
| 11843 } |
| 11844 return visitNode(node); |
| 11845 } |
| 11846 |
| 11847 @override |
| 11848 bool visitDeclaredIdentifier(DeclaredIdentifier node) { |
| 11849 if (identical(node.type, _oldNode)) { |
| 11850 node.type = _newNode as TypeName; |
| 11851 return true; |
| 11852 } else if (identical(node.identifier, _oldNode)) { |
| 11853 node.identifier = _newNode as SimpleIdentifier; |
| 11854 return true; |
| 11855 } |
| 11856 return visitAnnotatedNode(node); |
| 11857 } |
| 11858 |
| 11859 @override |
| 11860 bool visitDefaultFormalParameter(DefaultFormalParameter node) { |
| 11861 if (identical(node.parameter, _oldNode)) { |
| 11862 node.parameter = _newNode as NormalFormalParameter; |
| 11863 return true; |
| 11864 } else if (identical(node.defaultValue, _oldNode)) { |
| 11865 node.defaultValue = _newNode as Expression; |
| 11866 return true; |
| 11867 } |
| 11868 return visitNode(node); |
| 11869 } |
| 11870 |
| 11871 @override |
| 11872 bool visitDoStatement(DoStatement node) { |
| 11873 if (identical(node.body, _oldNode)) { |
| 11874 node.body = _newNode as Statement; |
| 11875 return true; |
| 11876 } else if (identical(node.condition, _oldNode)) { |
| 11877 node.condition = _newNode as Expression; |
| 11878 return true; |
| 11879 } |
| 11880 return visitNode(node); |
| 11881 } |
| 11882 |
| 11883 @override |
| 11884 bool visitDoubleLiteral(DoubleLiteral node) => visitNode(node); |
| 11885 |
| 11886 @override |
| 11887 bool visitEmptyFunctionBody(EmptyFunctionBody node) => visitNode(node); |
| 11888 |
| 11889 @override |
| 11890 bool visitEmptyStatement(EmptyStatement node) => visitNode(node); |
| 11891 |
| 11892 @override |
| 11893 bool visitExportDirective(ExportDirective node) => visitNamespaceDirective(nod
e); |
| 11894 |
| 11895 @override |
| 11896 bool visitExpressionFunctionBody(ExpressionFunctionBody node) { |
| 11897 if (identical(node.expression, _oldNode)) { |
| 11898 node.expression = _newNode as Expression; |
| 11899 return true; |
| 11900 } |
| 11901 return visitNode(node); |
| 11902 } |
| 11903 |
| 11904 @override |
| 11905 bool visitExpressionStatement(ExpressionStatement node) { |
| 11906 if (identical(node.expression, _oldNode)) { |
| 11907 node.expression = _newNode as Expression; |
| 11908 return true; |
| 11909 } |
| 11910 return visitNode(node); |
| 11911 } |
| 11912 |
| 11913 @override |
| 11914 bool visitExtendsClause(ExtendsClause node) { |
| 11915 if (identical(node.superclass, _oldNode)) { |
| 11916 node.superclass = _newNode as TypeName; |
| 11917 return true; |
| 11918 } |
| 11919 return visitNode(node); |
| 11920 } |
| 11921 |
| 11922 @override |
| 11923 bool visitFieldDeclaration(FieldDeclaration node) { |
| 11924 if (identical(node.fields, _oldNode)) { |
| 11925 node.fields = _newNode as VariableDeclarationList; |
| 11926 return true; |
| 11927 } |
| 11928 return visitAnnotatedNode(node); |
| 11929 } |
| 11930 |
| 11931 @override |
| 11932 bool visitFieldFormalParameter(FieldFormalParameter node) { |
| 11933 if (identical(node.type, _oldNode)) { |
| 11934 node.type = _newNode as TypeName; |
| 11935 return true; |
| 11936 } else if (identical(node.parameters, _oldNode)) { |
| 11937 node.parameters = _newNode as FormalParameterList; |
| 11938 return true; |
| 11939 } |
| 11940 return visitNormalFormalParameter(node); |
| 11941 } |
| 11942 |
| 11943 @override |
| 11944 bool visitForEachStatement(ForEachStatement node) { |
| 11945 if (identical(node.loopVariable, _oldNode)) { |
| 11946 node.loopVariable = _newNode as DeclaredIdentifier; |
| 11947 return true; |
| 11948 } else if (identical(node.identifier, _oldNode)) { |
| 11949 node.identifier = _newNode as SimpleIdentifier; |
| 11950 return true; |
| 11951 } else if (identical(node.iterator, _oldNode)) { |
| 11952 node.iterator = _newNode as Expression; |
| 11953 return true; |
| 11954 } else if (identical(node.body, _oldNode)) { |
| 11955 node.body = _newNode as Statement; |
| 11956 return true; |
| 11957 } |
| 11958 return visitNode(node); |
| 11959 } |
| 11960 |
| 11961 @override |
| 11962 bool visitFormalParameterList(FormalParameterList node) { |
| 11963 if (_replaceInList(node.parameters)) { |
| 11964 return true; |
| 11965 } |
| 11966 return visitNode(node); |
| 11967 } |
| 11968 |
| 11969 @override |
| 11970 bool visitForStatement(ForStatement node) { |
| 11971 if (identical(node.variables, _oldNode)) { |
| 11972 node.variables = _newNode as VariableDeclarationList; |
| 11973 return true; |
| 11974 } else if (identical(node.initialization, _oldNode)) { |
| 11975 node.initialization = _newNode as Expression; |
| 11976 return true; |
| 11977 } else if (identical(node.condition, _oldNode)) { |
| 11978 node.condition = _newNode as Expression; |
| 11979 return true; |
| 11980 } else if (identical(node.body, _oldNode)) { |
| 11981 node.body = _newNode as Statement; |
| 11982 return true; |
| 11983 } else if (_replaceInList(node.updaters)) { |
| 11984 return true; |
| 11985 } |
| 11986 return visitNode(node); |
| 11987 } |
| 11988 |
| 11989 @override |
| 11990 bool visitFunctionDeclaration(FunctionDeclaration node) { |
| 11991 if (identical(node.returnType, _oldNode)) { |
| 11992 node.returnType = _newNode as TypeName; |
| 11993 return true; |
| 11994 } else if (identical(node.name, _oldNode)) { |
| 11995 node.name = _newNode as SimpleIdentifier; |
| 11996 return true; |
| 11997 } else if (identical(node.functionExpression, _oldNode)) { |
| 11998 node.functionExpression = _newNode as FunctionExpression; |
| 11999 return true; |
| 12000 } |
| 12001 return visitAnnotatedNode(node); |
| 12002 } |
| 12003 |
| 12004 @override |
| 12005 bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { |
| 12006 if (identical(node.functionDeclaration, _oldNode)) { |
| 12007 node.functionDeclaration = _newNode as FunctionDeclaration; |
| 12008 return true; |
| 12009 } |
| 12010 return visitNode(node); |
| 12011 } |
| 12012 |
| 12013 @override |
| 12014 bool visitFunctionExpression(FunctionExpression node) { |
| 12015 if (identical(node.parameters, _oldNode)) { |
| 12016 node.parameters = _newNode as FormalParameterList; |
| 12017 return true; |
| 12018 } else if (identical(node.body, _oldNode)) { |
| 12019 node.body = _newNode as FunctionBody; |
| 12020 return true; |
| 12021 } |
| 12022 return visitNode(node); |
| 12023 } |
| 12024 |
| 12025 @override |
| 12026 bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { |
| 12027 if (identical(node.function, _oldNode)) { |
| 12028 node.function = _newNode as Expression; |
| 12029 return true; |
| 12030 } else if (identical(node.argumentList, _oldNode)) { |
| 12031 node.argumentList = _newNode as ArgumentList; |
| 12032 return true; |
| 12033 } |
| 12034 return visitNode(node); |
| 12035 } |
| 12036 |
| 12037 @override |
| 12038 bool visitFunctionTypeAlias(FunctionTypeAlias node) { |
| 12039 if (identical(node.returnType, _oldNode)) { |
| 12040 node.returnType = _newNode as TypeName; |
| 12041 return true; |
| 12042 } else if (identical(node.name, _oldNode)) { |
| 12043 node.name = _newNode as SimpleIdentifier; |
| 12044 return true; |
| 12045 } else if (identical(node.typeParameters, _oldNode)) { |
| 12046 node.typeParameters = _newNode as TypeParameterList; |
| 12047 return true; |
| 12048 } else if (identical(node.parameters, _oldNode)) { |
| 12049 node.parameters = _newNode as FormalParameterList; |
| 12050 return true; |
| 12051 } |
| 12052 return visitAnnotatedNode(node); |
| 12053 } |
| 12054 |
| 12055 @override |
| 12056 bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { |
| 12057 if (identical(node.returnType, _oldNode)) { |
| 12058 node.returnType = _newNode as TypeName; |
| 12059 return true; |
| 12060 } else if (identical(node.parameters, _oldNode)) { |
| 12061 node.parameters = _newNode as FormalParameterList; |
| 12062 return true; |
| 12063 } |
| 12064 return visitNormalFormalParameter(node); |
| 12065 } |
| 12066 |
| 12067 @override |
| 12068 bool visitHideCombinator(HideCombinator node) { |
| 12069 if (_replaceInList(node.hiddenNames)) { |
| 12070 return true; |
| 12071 } |
| 12072 return visitNode(node); |
| 12073 } |
| 12074 |
| 12075 @override |
| 12076 bool visitIfStatement(IfStatement node) { |
| 12077 if (identical(node.condition, _oldNode)) { |
| 12078 node.condition = _newNode as Expression; |
| 12079 return true; |
| 12080 } else if (identical(node.thenStatement, _oldNode)) { |
| 12081 node.thenStatement = _newNode as Statement; |
| 12082 return true; |
| 12083 } else if (identical(node.elseStatement, _oldNode)) { |
| 12084 node.elseStatement = _newNode as Statement; |
| 12085 return true; |
| 12086 } |
| 12087 return visitNode(node); |
| 12088 } |
| 12089 |
| 12090 @override |
| 12091 bool visitImplementsClause(ImplementsClause node) { |
| 12092 if (_replaceInList(node.interfaces)) { |
| 12093 return true; |
| 12094 } |
| 12095 return visitNode(node); |
| 12096 } |
| 12097 |
| 12098 @override |
| 12099 bool visitImportDirective(ImportDirective node) { |
| 12100 if (identical(node.prefix, _oldNode)) { |
| 12101 node.prefix = _newNode as SimpleIdentifier; |
| 12102 return true; |
| 12103 } |
| 12104 return visitNamespaceDirective(node); |
| 12105 } |
| 12106 |
| 12107 @override |
| 12108 bool visitIndexExpression(IndexExpression node) { |
| 12109 if (identical(node.target, _oldNode)) { |
| 12110 node.target = _newNode as Expression; |
| 12111 return true; |
| 12112 } else if (identical(node.index, _oldNode)) { |
| 12113 node.index = _newNode as Expression; |
| 12114 return true; |
| 12115 } |
| 12116 return visitNode(node); |
| 12117 } |
| 12118 |
| 12119 @override |
| 12120 bool visitInstanceCreationExpression(InstanceCreationExpression node) { |
| 12121 if (identical(node.constructorName, _oldNode)) { |
| 12122 node.constructorName = _newNode as ConstructorName; |
| 12123 return true; |
| 12124 } else if (identical(node.argumentList, _oldNode)) { |
| 12125 node.argumentList = _newNode as ArgumentList; |
| 12126 return true; |
| 12127 } |
| 12128 return visitNode(node); |
| 12129 } |
| 12130 |
| 12131 @override |
| 12132 bool visitIntegerLiteral(IntegerLiteral node) => visitNode(node); |
| 12133 |
| 12134 @override |
| 12135 bool visitInterpolationExpression(InterpolationExpression node) { |
| 12136 if (identical(node.expression, _oldNode)) { |
| 12137 node.expression = _newNode as Expression; |
| 12138 return true; |
| 12139 } |
| 12140 return visitNode(node); |
| 12141 } |
| 12142 |
| 12143 @override |
| 12144 bool visitInterpolationString(InterpolationString node) => visitNode(node); |
| 12145 |
| 12146 @override |
| 12147 bool visitIsExpression(IsExpression node) { |
| 12148 if (identical(node.expression, _oldNode)) { |
| 12149 node.expression = _newNode as Expression; |
| 12150 return true; |
| 12151 } else if (identical(node.type, _oldNode)) { |
| 12152 node.type = _newNode as TypeName; |
| 12153 return true; |
| 12154 } |
| 12155 return visitNode(node); |
| 12156 } |
| 12157 |
| 12158 @override |
| 12159 bool visitLabel(Label node) { |
| 12160 if (identical(node.label, _oldNode)) { |
| 12161 node.label = _newNode as SimpleIdentifier; |
| 12162 return true; |
| 12163 } |
| 12164 return visitNode(node); |
| 12165 } |
| 12166 |
| 12167 @override |
| 12168 bool visitLabeledStatement(LabeledStatement node) { |
| 12169 if (identical(node.statement, _oldNode)) { |
| 12170 node.statement = _newNode as Statement; |
| 12171 return true; |
| 12172 } else if (_replaceInList(node.labels)) { |
| 12173 return true; |
| 12174 } |
| 12175 return visitNode(node); |
| 12176 } |
| 12177 |
| 12178 @override |
| 12179 bool visitLibraryDirective(LibraryDirective node) { |
| 12180 if (identical(node.name, _oldNode)) { |
| 12181 node.name = _newNode as LibraryIdentifier; |
| 12182 return true; |
| 12183 } |
| 12184 return visitAnnotatedNode(node); |
| 12185 } |
| 12186 |
| 12187 @override |
| 12188 bool visitLibraryIdentifier(LibraryIdentifier node) { |
| 12189 if (_replaceInList(node.components)) { |
| 12190 return true; |
| 12191 } |
| 12192 return visitNode(node); |
| 12193 } |
| 12194 |
| 12195 @override |
| 12196 bool visitListLiteral(ListLiteral node) { |
| 12197 if (_replaceInList(node.elements)) { |
| 12198 return true; |
| 12199 } |
| 12200 return visitTypedLiteral(node); |
| 12201 } |
| 12202 |
| 12203 @override |
| 12204 bool visitMapLiteral(MapLiteral node) { |
| 12205 if (_replaceInList(node.entries)) { |
| 12206 return true; |
| 12207 } |
| 12208 return visitTypedLiteral(node); |
| 12209 } |
| 12210 |
| 12211 @override |
| 12212 bool visitMapLiteralEntry(MapLiteralEntry node) { |
| 12213 if (identical(node.key, _oldNode)) { |
| 12214 node.key = _newNode as Expression; |
| 12215 return true; |
| 12216 } else if (identical(node.value, _oldNode)) { |
| 12217 node.value = _newNode as Expression; |
| 12218 return true; |
| 12219 } |
| 12220 return visitNode(node); |
| 12221 } |
| 12222 |
| 12223 @override |
| 12224 bool visitMethodDeclaration(MethodDeclaration node) { |
| 12225 if (identical(node.returnType, _oldNode)) { |
| 12226 node.returnType = _newNode as TypeName; |
| 12227 return true; |
| 12228 } else if (identical(node.name, _oldNode)) { |
| 12229 node.name = _newNode as SimpleIdentifier; |
| 12230 return true; |
| 12231 } else if (identical(node.parameters, _oldNode)) { |
| 12232 node.parameters = _newNode as FormalParameterList; |
| 12233 return true; |
| 12234 } else if (identical(node.body, _oldNode)) { |
| 12235 node.body = _newNode as FunctionBody; |
| 12236 return true; |
| 12237 } |
| 12238 return visitAnnotatedNode(node); |
| 12239 } |
| 12240 |
| 12241 @override |
| 12242 bool visitMethodInvocation(MethodInvocation node) { |
| 12243 if (identical(node.target, _oldNode)) { |
| 12244 node.target = _newNode as Expression; |
| 12245 return true; |
| 12246 } else if (identical(node.methodName, _oldNode)) { |
| 12247 node.methodName = _newNode as SimpleIdentifier; |
| 12248 return true; |
| 12249 } else if (identical(node.argumentList, _oldNode)) { |
| 12250 node.argumentList = _newNode as ArgumentList; |
| 12251 return true; |
| 12252 } |
| 12253 return visitNode(node); |
| 12254 } |
| 12255 |
| 12256 @override |
| 12257 bool visitNamedExpression(NamedExpression node) { |
| 12258 if (identical(node.name, _oldNode)) { |
| 12259 node.name = _newNode as Label; |
| 12260 return true; |
| 12261 } else if (identical(node.expression, _oldNode)) { |
| 12262 node.expression = _newNode as Expression; |
| 12263 return true; |
| 12264 } |
| 12265 return visitNode(node); |
| 12266 } |
| 12267 |
| 12268 bool visitNamespaceDirective(NamespaceDirective node) { |
| 12269 if (_replaceInList(node.combinators)) { |
| 12270 return true; |
| 12271 } |
| 12272 return visitUriBasedDirective(node); |
| 12273 } |
| 12274 |
| 12275 @override |
| 12276 bool visitNativeClause(NativeClause node) { |
| 12277 if (identical(node.name, _oldNode)) { |
| 12278 node.name = _newNode as StringLiteral; |
| 12279 return true; |
| 12280 } |
| 12281 return visitNode(node); |
| 12282 } |
| 12283 |
| 12284 @override |
| 12285 bool visitNativeFunctionBody(NativeFunctionBody node) { |
| 12286 if (identical(node.stringLiteral, _oldNode)) { |
| 12287 node.stringLiteral = _newNode as StringLiteral; |
| 12288 return true; |
| 12289 } |
| 12290 return visitNode(node); |
| 12291 } |
| 12292 |
| 12293 bool visitNode(AstNode node) { |
| 12294 throw new IllegalArgumentException("The old node is not a child of it's pare
nt"); |
| 12295 } |
| 12296 |
| 12297 bool visitNormalFormalParameter(NormalFormalParameter node) { |
| 12298 if (identical(node.documentationComment, _oldNode)) { |
| 12299 node.documentationComment = _newNode as Comment; |
| 12300 return true; |
| 12301 } else if (identical(node.identifier, _oldNode)) { |
| 12302 node.identifier = _newNode as SimpleIdentifier; |
| 12303 return true; |
| 12304 } else if (_replaceInList(node.metadata)) { |
| 12305 return true; |
| 12306 } |
| 12307 return visitNode(node); |
| 12308 } |
| 12309 |
| 12310 @override |
| 12311 bool visitNullLiteral(NullLiteral node) => visitNode(node); |
| 12312 |
| 12313 @override |
| 12314 bool visitParenthesizedExpression(ParenthesizedExpression node) { |
| 12315 if (identical(node.expression, _oldNode)) { |
| 12316 node.expression = _newNode as Expression; |
| 12317 return true; |
| 12318 } |
| 12319 return visitNode(node); |
| 12320 } |
| 12321 |
| 12322 @override |
| 12323 bool visitPartDirective(PartDirective node) => visitUriBasedDirective(node); |
| 12324 |
| 12325 @override |
| 12326 bool visitPartOfDirective(PartOfDirective node) { |
| 12327 if (identical(node.libraryName, _oldNode)) { |
| 12328 node.libraryName = _newNode as LibraryIdentifier; |
| 12329 return true; |
| 12330 } |
| 12331 return visitAnnotatedNode(node); |
| 12332 } |
| 12333 |
| 12334 @override |
| 12335 bool visitPostfixExpression(PostfixExpression node) { |
| 12336 if (identical(node.operand, _oldNode)) { |
| 12337 node.operand = _newNode as Expression; |
| 12338 return true; |
| 12339 } |
| 12340 return visitNode(node); |
| 12341 } |
| 12342 |
| 12343 @override |
| 12344 bool visitPrefixedIdentifier(PrefixedIdentifier node) { |
| 12345 if (identical(node.prefix, _oldNode)) { |
| 12346 node.prefix = _newNode as SimpleIdentifier; |
| 12347 return true; |
| 12348 } else if (identical(node.identifier, _oldNode)) { |
| 12349 node.identifier = _newNode as SimpleIdentifier; |
| 12350 return true; |
| 12351 } |
| 12352 return visitNode(node); |
| 12353 } |
| 12354 |
| 12355 @override |
| 12356 bool visitPrefixExpression(PrefixExpression node) { |
| 12357 if (identical(node.operand, _oldNode)) { |
| 12358 node.operand = _newNode as Expression; |
| 12359 return true; |
| 12360 } |
| 12361 return visitNode(node); |
| 12362 } |
| 12363 |
| 12364 @override |
| 12365 bool visitPropertyAccess(PropertyAccess node) { |
| 12366 if (identical(node.target, _oldNode)) { |
| 12367 node.target = _newNode as Expression; |
| 12368 return true; |
| 12369 } else if (identical(node.propertyName, _oldNode)) { |
| 12370 node.propertyName = _newNode as SimpleIdentifier; |
| 12371 return true; |
| 12372 } |
| 12373 return visitNode(node); |
| 12374 } |
| 12375 |
| 12376 @override |
| 12377 bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation no
de) { |
| 12378 if (identical(node.constructorName, _oldNode)) { |
| 12379 node.constructorName = _newNode as SimpleIdentifier; |
| 12380 return true; |
| 12381 } else if (identical(node.argumentList, _oldNode)) { |
| 12382 node.argumentList = _newNode as ArgumentList; |
| 12383 return true; |
| 12384 } |
| 12385 return visitNode(node); |
| 12386 } |
| 12387 |
| 12388 @override |
| 12389 bool visitRethrowExpression(RethrowExpression node) => visitNode(node); |
| 12390 |
| 12391 @override |
| 12392 bool visitReturnStatement(ReturnStatement node) { |
| 12393 if (identical(node.expression, _oldNode)) { |
| 12394 node.expression = _newNode as Expression; |
| 12395 return true; |
| 12396 } |
| 12397 return visitNode(node); |
| 12398 } |
| 12399 |
| 12400 @override |
| 12401 bool visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag); |
| 12402 |
| 12403 @override |
| 12404 bool visitShowCombinator(ShowCombinator node) { |
| 12405 if (_replaceInList(node.shownNames)) { |
| 12406 return true; |
| 12407 } |
| 12408 return visitNode(node); |
| 12409 } |
| 12410 |
| 12411 @override |
| 12412 bool visitSimpleFormalParameter(SimpleFormalParameter node) { |
| 12413 if (identical(node.type, _oldNode)) { |
| 12414 node.type = _newNode as TypeName; |
| 12415 return true; |
| 12416 } |
| 12417 return visitNormalFormalParameter(node); |
| 12418 } |
| 12419 |
| 12420 @override |
| 12421 bool visitSimpleIdentifier(SimpleIdentifier node) => visitNode(node); |
| 12422 |
| 12423 @override |
| 12424 bool visitSimpleStringLiteral(SimpleStringLiteral node) => visitNode(node); |
| 12425 |
| 12426 @override |
| 12427 bool visitStringInterpolation(StringInterpolation node) { |
| 12428 if (_replaceInList(node.elements)) { |
| 12429 return true; |
| 12430 } |
| 12431 return visitNode(node); |
| 12432 } |
| 12433 |
| 12434 @override |
| 12435 bool visitSuperConstructorInvocation(SuperConstructorInvocation node) { |
| 12436 if (identical(node.constructorName, _oldNode)) { |
| 12437 node.constructorName = _newNode as SimpleIdentifier; |
| 12438 return true; |
| 12439 } else if (identical(node.argumentList, _oldNode)) { |
| 12440 node.argumentList = _newNode as ArgumentList; |
| 12441 return true; |
| 12442 } |
| 12443 return visitNode(node); |
| 12444 } |
| 12445 |
| 12446 @override |
| 12447 bool visitSuperExpression(SuperExpression node) => visitNode(node); |
| 12448 |
| 12449 @override |
| 12450 bool visitSwitchCase(SwitchCase node) { |
| 12451 if (identical(node.expression, _oldNode)) { |
| 12452 node.expression = _newNode as Expression; |
| 12453 return true; |
| 12454 } |
| 12455 return visitSwitchMember(node); |
| 12456 } |
| 12457 |
| 12458 @override |
| 12459 bool visitSwitchDefault(SwitchDefault node) => visitSwitchMember(node); |
| 12460 |
| 12461 bool visitSwitchMember(SwitchMember node) { |
| 12462 if (_replaceInList(node.labels)) { |
| 12463 return true; |
| 12464 } else if (_replaceInList(node.statements)) { |
| 12465 return true; |
| 12466 } |
| 12467 return visitNode(node); |
| 12468 } |
| 12469 |
| 12470 @override |
| 12471 bool visitSwitchStatement(SwitchStatement node) { |
| 12472 if (identical(node.expression, _oldNode)) { |
| 12473 node.expression = _newNode as Expression; |
| 12474 return true; |
| 12475 } else if (_replaceInList(node.members)) { |
| 12476 return true; |
| 12477 } |
| 12478 return visitNode(node); |
| 12479 } |
| 12480 |
| 12481 @override |
| 12482 bool visitSymbolLiteral(SymbolLiteral node) => visitNode(node); |
| 12483 |
| 12484 @override |
| 12485 bool visitThisExpression(ThisExpression node) => visitNode(node); |
| 12486 |
| 12487 @override |
| 12488 bool visitThrowExpression(ThrowExpression node) { |
| 12489 if (identical(node.expression, _oldNode)) { |
| 12490 node.expression = _newNode as Expression; |
| 12491 return true; |
| 12492 } |
| 12493 return visitNode(node); |
| 12494 } |
| 12495 |
| 12496 @override |
| 12497 bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { |
| 12498 if (identical(node.variables, _oldNode)) { |
| 12499 node.variables = _newNode as VariableDeclarationList; |
| 12500 return true; |
| 12501 } |
| 12502 return visitAnnotatedNode(node); |
| 12503 } |
| 12504 |
| 12505 @override |
| 12506 bool visitTryStatement(TryStatement node) { |
| 12507 if (identical(node.body, _oldNode)) { |
| 12508 node.body = _newNode as Block; |
| 12509 return true; |
| 12510 } else if (identical(node.finallyBlock, _oldNode)) { |
| 12511 node.finallyBlock = _newNode as Block; |
| 12512 return true; |
| 12513 } else if (_replaceInList(node.catchClauses)) { |
| 12514 return true; |
| 12515 } |
| 12516 return visitNode(node); |
| 12517 } |
| 12518 |
| 12519 @override |
| 12520 bool visitTypeArgumentList(TypeArgumentList node) { |
| 12521 if (_replaceInList(node.arguments)) { |
| 12522 return true; |
| 12523 } |
| 12524 return visitNode(node); |
| 12525 } |
| 12526 |
| 12527 bool visitTypedLiteral(TypedLiteral node) { |
| 12528 if (identical(node.typeArguments, _oldNode)) { |
| 12529 node.typeArguments = _newNode as TypeArgumentList; |
| 12530 return true; |
| 12531 } |
| 12532 return visitNode(node); |
| 12533 } |
| 12534 |
| 12535 @override |
| 12536 bool visitTypeName(TypeName node) { |
| 12537 if (identical(node.name, _oldNode)) { |
| 12538 node.name = _newNode as Identifier; |
| 12539 return true; |
| 12540 } else if (identical(node.typeArguments, _oldNode)) { |
| 12541 node.typeArguments = _newNode as TypeArgumentList; |
| 12542 return true; |
| 12543 } |
| 12544 return visitNode(node); |
| 12545 } |
| 12546 |
| 12547 @override |
| 12548 bool visitTypeParameter(TypeParameter node) { |
| 12549 if (identical(node.name, _oldNode)) { |
| 12550 node.name = _newNode as SimpleIdentifier; |
| 12551 return true; |
| 12552 } else if (identical(node.bound, _oldNode)) { |
| 12553 node.bound = _newNode as TypeName; |
| 12554 return true; |
| 12555 } |
| 12556 return visitNode(node); |
| 12557 } |
| 12558 |
| 12559 @override |
| 12560 bool visitTypeParameterList(TypeParameterList node) { |
| 12561 if (_replaceInList(node.typeParameters)) { |
| 12562 return true; |
| 12563 } |
| 12564 return visitNode(node); |
| 12565 } |
| 12566 |
| 12567 bool visitUriBasedDirective(UriBasedDirective node) { |
| 12568 if (identical(node.uri, _oldNode)) { |
| 12569 node.uri = _newNode as StringLiteral; |
| 12570 return true; |
| 12571 } |
| 12572 return visitAnnotatedNode(node); |
| 12573 } |
| 12574 |
| 12575 @override |
| 12576 bool visitVariableDeclaration(VariableDeclaration node) { |
| 12577 if (identical(node.name, _oldNode)) { |
| 12578 node.name = _newNode as SimpleIdentifier; |
| 12579 return true; |
| 12580 } else if (identical(node.initializer, _oldNode)) { |
| 12581 node.initializer = _newNode as Expression; |
| 12582 return true; |
| 12583 } |
| 12584 return visitAnnotatedNode(node); |
| 12585 } |
| 12586 |
| 12587 @override |
| 12588 bool visitVariableDeclarationList(VariableDeclarationList node) { |
| 12589 if (identical(node.type, _oldNode)) { |
| 12590 node.type = _newNode as TypeName; |
| 12591 return true; |
| 12592 } else if (_replaceInList(node.variables)) { |
| 12593 return true; |
| 12594 } |
| 12595 return visitNode(node); |
| 12596 } |
| 12597 |
| 12598 @override |
| 12599 bool visitVariableDeclarationStatement(VariableDeclarationStatement node) { |
| 12600 if (identical(node.variables, _oldNode)) { |
| 12601 node.variables = _newNode as VariableDeclarationList; |
| 12602 return true; |
| 12603 } |
| 12604 return visitNode(node); |
| 12605 } |
| 12606 |
| 12607 @override |
| 12608 bool visitWhileStatement(WhileStatement node) { |
| 12609 if (identical(node.condition, _oldNode)) { |
| 12610 node.condition = _newNode as Expression; |
| 12611 return true; |
| 12612 } else if (identical(node.body, _oldNode)) { |
| 12613 node.body = _newNode as Statement; |
| 12614 return true; |
| 12615 } |
| 12616 return visitNode(node); |
| 12617 } |
| 12618 |
| 12619 @override |
| 12620 bool visitWithClause(WithClause node) { |
| 12621 if (_replaceInList(node.mixinTypes)) { |
| 12622 return true; |
| 12623 } |
| 12624 return visitNode(node); |
| 12625 } |
| 12626 |
| 12627 bool _replaceInList(NodeList list) { |
| 12628 int count = list.length; |
| 12629 for (int i = 0; i < count; i++) { |
| 12630 if (identical(_oldNode, list[i])) { |
| 12631 javaListSet(list, i, _newNode); |
| 12632 return true; |
| 12633 } |
| 12634 } |
| 12635 return false; |
| 12636 } |
| 12637 } |
| 12638 |
| 12639 /** |
| 11422 * The abstract class `NormalFormalParameter` defines the behavior common to for
mal parameters | 12640 * The abstract class `NormalFormalParameter` defines the behavior common to for
mal parameters |
| 11423 * that are required (are not optional). | 12641 * that are required (are not optional). |
| 11424 * | 12642 * |
| 11425 * <pre> | 12643 * <pre> |
| 11426 * normalFormalParameter ::= | 12644 * normalFormalParameter ::= |
| 11427 * [FunctionTypedFormalParameter] | 12645 * [FunctionTypedFormalParameter] |
| 11428 * | [FieldFormalParameter] | 12646 * | [FieldFormalParameter] |
| 11429 * | [SimpleFormalParameter] | 12647 * | [SimpleFormalParameter] |
| 11430 * </pre> | 12648 * </pre> |
| 11431 */ | 12649 */ |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11498 | 12716 |
| 11499 /** | 12717 /** |
| 11500 * Set the name of the parameter being declared to the given identifier. | 12718 * Set the name of the parameter being declared to the given identifier. |
| 11501 * | 12719 * |
| 11502 * @param identifier the name of the parameter being declared | 12720 * @param identifier the name of the parameter being declared |
| 11503 */ | 12721 */ |
| 11504 void set identifier(SimpleIdentifier identifier) { | 12722 void set identifier(SimpleIdentifier identifier) { |
| 11505 this._identifier = becomeParentOf(identifier); | 12723 this._identifier = becomeParentOf(identifier); |
| 11506 } | 12724 } |
| 11507 | 12725 |
| 12726 /** |
| 12727 * Set the metadata associated with this node to the given metadata. |
| 12728 * |
| 12729 * @param metadata the metadata to be associated with this node |
| 12730 */ |
| 12731 void set metadata(List<Annotation> metadata) { |
| 12732 this._metadata.clear(); |
| 12733 this._metadata.addAll(metadata); |
| 12734 } |
| 12735 |
| 11508 @override | 12736 @override |
| 11509 void visitChildren(AstVisitor visitor) { | 12737 void visitChildren(AstVisitor visitor) { |
| 11510 // | 12738 // |
| 11511 // Note that subclasses are responsible for visiting the identifier because
they often need to | 12739 // Note that subclasses are responsible for visiting the identifier because
they often need to |
| 11512 // visit other nodes before visiting the identifier. | 12740 // visit other nodes before visiting the identifier. |
| 11513 // | 12741 // |
| 11514 if (_commentIsBeforeAnnotations()) { | 12742 if (_commentIsBeforeAnnotations()) { |
| 11515 safelyVisitChild(_comment, visitor); | 12743 safelyVisitChild(_comment, visitor); |
| 11516 _metadata.accept(visitor); | 12744 _metadata.accept(visitor); |
| 11517 } else { | 12745 } else { |
| (...skipping 4606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16124 * @return the top-level variables being declared | 17352 * @return the top-level variables being declared |
| 16125 */ | 17353 */ |
| 16126 VariableDeclarationList get variables => _variableList; | 17354 VariableDeclarationList get variables => _variableList; |
| 16127 | 17355 |
| 16128 /** | 17356 /** |
| 16129 * Set the top-level variables being declared to the given list of variables. | 17357 * Set the top-level variables being declared to the given list of variables. |
| 16130 * | 17358 * |
| 16131 * @param variableList the top-level variables being declared | 17359 * @param variableList the top-level variables being declared |
| 16132 */ | 17360 */ |
| 16133 void set variables(VariableDeclarationList variableList) { | 17361 void set variables(VariableDeclarationList variableList) { |
| 16134 variableList = becomeParentOf(variableList); | 17362 this._variableList = becomeParentOf(variableList); |
| 16135 } | 17363 } |
| 16136 | 17364 |
| 16137 @override | 17365 @override |
| 16138 void visitChildren(AstVisitor visitor) { | 17366 void visitChildren(AstVisitor visitor) { |
| 16139 super.visitChildren(visitor); | 17367 super.visitChildren(visitor); |
| 16140 safelyVisitChild(_variableList, visitor); | 17368 safelyVisitChild(_variableList, visitor); |
| 16141 } | 17369 } |
| 16142 | 17370 |
| 16143 @override | 17371 @override |
| 16144 Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken; | 17372 Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken; |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16642 abstract class TypedLiteral extends Literal { | 17870 abstract class TypedLiteral extends Literal { |
| 16643 /** | 17871 /** |
| 16644 * The token representing the 'const' keyword, or `null` if the literal is not
a constant. | 17872 * The token representing the 'const' keyword, or `null` if the literal is not
a constant. |
| 16645 */ | 17873 */ |
| 16646 Token constKeyword; | 17874 Token constKeyword; |
| 16647 | 17875 |
| 16648 /** | 17876 /** |
| 16649 * The type argument associated with this literal, or `null` if no type argume
nts were | 17877 * The type argument associated with this literal, or `null` if no type argume
nts were |
| 16650 * declared. | 17878 * declared. |
| 16651 */ | 17879 */ |
| 16652 TypeArgumentList typeArguments; | 17880 TypeArgumentList _typeArguments; |
| 16653 | 17881 |
| 16654 /** | 17882 /** |
| 16655 * Initialize a newly created typed literal. | 17883 * Initialize a newly created typed literal. |
| 16656 * | 17884 * |
| 16657 * @param constKeyword the token representing the 'const' keyword | 17885 * @param constKeyword the token representing the 'const' keyword |
| 16658 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type | 17886 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type |
| 16659 * arguments were declared | 17887 * arguments were declared |
| 16660 */ | 17888 */ |
| 16661 TypedLiteral(this.constKeyword, TypeArgumentList typeArguments) { | 17889 TypedLiteral(this.constKeyword, TypeArgumentList typeArguments) { |
| 16662 this.typeArguments = becomeParentOf(typeArguments); | 17890 this._typeArguments = becomeParentOf(typeArguments); |
| 17891 } |
| 17892 |
| 17893 /** |
| 17894 * Return the type argument associated with this literal, or `null` if no type
arguments |
| 17895 * were declared. |
| 17896 * |
| 17897 * @return the type argument associated with this literal |
| 17898 */ |
| 17899 TypeArgumentList get typeArguments => _typeArguments; |
| 17900 |
| 17901 /** |
| 17902 * Set the type argument associated with this literal to the given arguments. |
| 17903 * |
| 17904 * @param typeArguments the type argument associated with this literal |
| 17905 */ |
| 17906 void set typeArguments(TypeArgumentList typeArguments) { |
| 17907 this._typeArguments = becomeParentOf(typeArguments); |
| 16663 } | 17908 } |
| 16664 | 17909 |
| 16665 @override | 17910 @override |
| 16666 void visitChildren(AstVisitor visitor) { | 17911 void visitChildren(AstVisitor visitor) { |
| 16667 safelyVisitChild(typeArguments, visitor); | 17912 safelyVisitChild(_typeArguments, visitor); |
| 16668 } | 17913 } |
| 16669 } | 17914 } |
| 16670 | 17915 |
| 16671 /** | 17916 /** |
| 16672 * Instances of the class `UnifyingAstVisitor` implement an AST visitor that wil
l recursively | 17917 * Instances of the class `UnifyingAstVisitor` implement an AST visitor that wil
l recursively |
| 16673 * visit all of the nodes in an AST structure (like instances of the class | 17918 * visit all of the nodes in an AST structure (like instances of the class |
| 16674 * [RecursiveAstVisitor]). In addition, every node will also be visited by using
a single | 17919 * [RecursiveAstVisitor]). In addition, every node will also be visited by using
a single |
| 16675 * unified [visitNode] method. | 17920 * unified [visitNode] method. |
| 16676 * | 17921 * |
| 16677 * Subclasses that override a visit method must either invoke the overridden vis
it method or | 17922 * Subclasses that override a visit method must either invoke the overridden vis
it method or |
| (...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17702 _elements[index] = node; | 18947 _elements[index] = node; |
| 17703 } | 18948 } |
| 17704 void clear() { | 18949 void clear() { |
| 17705 _elements = <E> []; | 18950 _elements = <E> []; |
| 17706 } | 18951 } |
| 17707 int get length => _elements.length; | 18952 int get length => _elements.length; |
| 17708 void set length(int value) { | 18953 void set length(int value) { |
| 17709 throw new UnsupportedError("Cannot resize NodeList."); | 18954 throw new UnsupportedError("Cannot resize NodeList."); |
| 17710 } | 18955 } |
| 17711 } | 18956 } |
| OLD | NEW |