| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 | 3 |
| 4 library engine.ast; | 4 library engine.ast; |
| 5 | 5 |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'java_core.dart'; | 7 import 'java_core.dart'; |
| 8 import 'java_engine.dart'; | 8 import 'java_engine.dart'; |
| 9 import 'error.dart'; | 9 import 'error.dart'; |
| 10 import 'source.dart' show LineInfo; | 10 import 'source.dart' show LineInfo; |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 R visitNamedExpression(NamedExpression node); | 277 R visitNamedExpression(NamedExpression node); |
| 278 R visitNullLiteral(NullLiteral node); | 278 R visitNullLiteral(NullLiteral node); |
| 279 R visitParenthesizedExpression(ParenthesizedExpression node); | 279 R visitParenthesizedExpression(ParenthesizedExpression node); |
| 280 R visitPartDirective(PartDirective node); | 280 R visitPartDirective(PartDirective node); |
| 281 R visitPartOfDirective(PartOfDirective node); | 281 R visitPartOfDirective(PartOfDirective node); |
| 282 R visitPostfixExpression(PostfixExpression node); | 282 R visitPostfixExpression(PostfixExpression node); |
| 283 R visitPrefixedIdentifier(PrefixedIdentifier node); | 283 R visitPrefixedIdentifier(PrefixedIdentifier node); |
| 284 R visitPrefixExpression(PrefixExpression node); | 284 R visitPrefixExpression(PrefixExpression node); |
| 285 R visitPropertyAccess(PropertyAccess node); | 285 R visitPropertyAccess(PropertyAccess node); |
| 286 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node)
; | 286 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node)
; |
| 287 R visitRethrowExpression(RethrowExpression node); |
| 287 R visitReturnStatement(ReturnStatement node); | 288 R visitReturnStatement(ReturnStatement node); |
| 288 R visitScriptTag(ScriptTag node); | 289 R visitScriptTag(ScriptTag node); |
| 289 R visitShowCombinator(ShowCombinator node); | 290 R visitShowCombinator(ShowCombinator node); |
| 290 R visitSimpleFormalParameter(SimpleFormalParameter node); | 291 R visitSimpleFormalParameter(SimpleFormalParameter node); |
| 291 R visitSimpleIdentifier(SimpleIdentifier node); | 292 R visitSimpleIdentifier(SimpleIdentifier node); |
| 292 R visitSimpleStringLiteral(SimpleStringLiteral node); | 293 R visitSimpleStringLiteral(SimpleStringLiteral node); |
| 293 R visitStringInterpolation(StringInterpolation node); | 294 R visitStringInterpolation(StringInterpolation node); |
| 294 R visitSuperConstructorInvocation(SuperConstructorInvocation node); | 295 R visitSuperConstructorInvocation(SuperConstructorInvocation node); |
| 295 R visitSuperExpression(SuperExpression node); | 296 R visitSuperExpression(SuperExpression node); |
| 296 R visitSwitchCase(SwitchCase node); | 297 R visitSwitchCase(SwitchCase node); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 * not have a documentation comment associated with it. | 405 * not have a documentation comment associated with it. |
| 405 * @return the documentation comment associated with this node | 406 * @return the documentation comment associated with this node |
| 406 */ | 407 */ |
| 407 Comment get documentationComment => _comment; | 408 Comment get documentationComment => _comment; |
| 408 /** | 409 /** |
| 409 * Return the annotations associated with this node. | 410 * Return the annotations associated with this node. |
| 410 * @return the annotations associated with this node | 411 * @return the annotations associated with this node |
| 411 */ | 412 */ |
| 412 NodeList<Annotation> get metadata => _metadata; | 413 NodeList<Annotation> get metadata => _metadata; |
| 413 /** | 414 /** |
| 414 * Set the documentation comment associated with this node to the given commen
t | 415 * Set the documentation comment associated with this node to the given commen
t. |
| 415 * @param comment the documentation comment to be associated with this node | 416 * @param comment the documentation comment to be associated with this node |
| 416 */ | 417 */ |
| 417 void set documentationComment(Comment comment2) { | 418 void set documentationComment(Comment comment2) { |
| 418 this._comment = becomeParentOf(comment2); | 419 this._comment = becomeParentOf(comment2); |
| 419 } | 420 } |
| 421 /** |
| 422 * Set the metadata associated with this node to the given metadata. |
| 423 * @param metadata the metadata to be associated with this node |
| 424 */ |
| 425 void set metadata(List<Annotation> metadata2) { |
| 426 this._metadata.clear(); |
| 427 this._metadata.addAll(metadata2); |
| 428 } |
| 420 void visitChildren(ASTVisitor<Object> visitor) { | 429 void visitChildren(ASTVisitor<Object> visitor) { |
| 421 if (commentIsBeforeAnnotations()) { | 430 if (commentIsBeforeAnnotations()) { |
| 422 safelyVisitChild(_comment, visitor); | 431 safelyVisitChild(_comment, visitor); |
| 423 _metadata.accept(visitor); | 432 _metadata.accept(visitor); |
| 424 } else { | 433 } else { |
| 425 for (ASTNode child in sortedCommentAndAnnotations) { | 434 for (ASTNode child in sortedCommentAndAnnotations) { |
| 426 child.accept(visitor); | 435 child.accept(visitor); |
| 427 } | 436 } |
| 428 } | 437 } |
| 429 } | 438 } |
| (...skipping 7258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7688 */ | 7697 */ |
| 7689 NamedExpression({Label name, Expression expression}) : this.full(name, express
ion); | 7698 NamedExpression({Label name, Expression expression}) : this.full(name, express
ion); |
| 7690 accept(ASTVisitor visitor) => visitor.visitNamedExpression(this); | 7699 accept(ASTVisitor visitor) => visitor.visitNamedExpression(this); |
| 7691 Token get beginToken => _name.beginToken; | 7700 Token get beginToken => _name.beginToken; |
| 7692 /** | 7701 /** |
| 7693 * Return the element representing the parameter being named by this expressio
n, or {@code null}if the AST structure has not been resolved or if there is no p
arameter with the same name as | 7702 * Return the element representing the parameter being named by this expressio
n, or {@code null}if the AST structure has not been resolved or if there is no p
arameter with the same name as |
| 7694 * this expression. | 7703 * this expression. |
| 7695 * @return the element representing the parameter being named by this expressi
on | 7704 * @return the element representing the parameter being named by this expressi
on |
| 7696 */ | 7705 */ |
| 7697 ParameterElement get element { | 7706 ParameterElement get element { |
| 7698 Element element20 = _name.label.element; | 7707 Element element22 = _name.label.element; |
| 7699 if (element20 is ParameterElement) { | 7708 if (element22 is ParameterElement) { |
| 7700 return element20 as ParameterElement; | 7709 return element22 as ParameterElement; |
| 7701 } | 7710 } |
| 7702 return null; | 7711 return null; |
| 7703 } | 7712 } |
| 7704 Token get endToken => _expression.endToken; | 7713 Token get endToken => _expression.endToken; |
| 7705 /** | 7714 /** |
| 7706 * Return the expression with which the name is associated. | 7715 * Return the expression with which the name is associated. |
| 7707 * @return the expression with which the name is associated | 7716 * @return the expression with which the name is associated |
| 7708 */ | 7717 */ |
| 7709 Expression get expression => _expression; | 7718 Expression get expression => _expression; |
| 7710 /** | 7719 /** |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8712 */ | 8721 */ |
| 8713 void set period(Token period11) { | 8722 void set period(Token period11) { |
| 8714 this._period = period11; | 8723 this._period = period11; |
| 8715 } | 8724 } |
| 8716 void visitChildren(ASTVisitor<Object> visitor) { | 8725 void visitChildren(ASTVisitor<Object> visitor) { |
| 8717 safelyVisitChild(_constructorName, visitor); | 8726 safelyVisitChild(_constructorName, visitor); |
| 8718 safelyVisitChild(_argumentList, visitor); | 8727 safelyVisitChild(_argumentList, visitor); |
| 8719 } | 8728 } |
| 8720 } | 8729 } |
| 8721 /** | 8730 /** |
| 8731 * Instances of the class {@code RethrowExpression} represent a rethrow expressi
on. |
| 8732 * <pre> |
| 8733 * rethrowExpression ::= |
| 8734 * 'rethrow' |
| 8735 * </pre> |
| 8736 * @coverage dart.engine.ast |
| 8737 */ |
| 8738 class RethrowExpression extends Expression { |
| 8739 /** |
| 8740 * The token representing the 'rethrow' keyword. |
| 8741 */ |
| 8742 Token _keyword; |
| 8743 /** |
| 8744 * Initialize a newly created rethrow expression. |
| 8745 * @param keyword the token representing the 'rethrow' keyword |
| 8746 */ |
| 8747 RethrowExpression.full(Token keyword) { |
| 8748 this._keyword = keyword; |
| 8749 } |
| 8750 /** |
| 8751 * Initialize a newly created rethrow expression. |
| 8752 * @param keyword the token representing the 'rethrow' keyword |
| 8753 */ |
| 8754 RethrowExpression({Token keyword}) : this.full(keyword); |
| 8755 accept(ASTVisitor visitor) => visitor.visitRethrowExpression(this); |
| 8756 Token get beginToken => _keyword; |
| 8757 Token get endToken => _keyword; |
| 8758 /** |
| 8759 * Return the token representing the 'rethrow' keyword. |
| 8760 * @return the token representing the 'rethrow' keyword |
| 8761 */ |
| 8762 Token get keyword => _keyword; |
| 8763 /** |
| 8764 * Set the token representing the 'rethrow' keyword to the given token. |
| 8765 * @param keyword the token representing the 'rethrow' keyword |
| 8766 */ |
| 8767 void set keyword(Token keyword15) { |
| 8768 this._keyword = keyword15; |
| 8769 } |
| 8770 void visitChildren(ASTVisitor<Object> visitor) { |
| 8771 } |
| 8772 } |
| 8773 /** |
| 8722 * Instances of the class {@code ReturnStatement} represent a return statement. | 8774 * Instances of the class {@code ReturnStatement} represent a return statement. |
| 8723 * <pre> | 8775 * <pre> |
| 8724 * returnStatement ::= | 8776 * returnStatement ::= |
| 8725 * 'return' {@link Expression expression}? ';' | 8777 * 'return' {@link Expression expression}? ';' |
| 8726 * </pre> | 8778 * </pre> |
| 8727 * @coverage dart.engine.ast | 8779 * @coverage dart.engine.ast |
| 8728 */ | 8780 */ |
| 8729 class ReturnStatement extends Statement { | 8781 class ReturnStatement extends Statement { |
| 8730 /** | 8782 /** |
| 8731 * The token representing the 'return' keyword. | 8783 * The token representing the 'return' keyword. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8781 * Set the expression computing the value to be returned to the given expressi
on. | 8833 * Set the expression computing the value to be returned to the given expressi
on. |
| 8782 * @param expression the expression computing the value to be returned | 8834 * @param expression the expression computing the value to be returned |
| 8783 */ | 8835 */ |
| 8784 void set expression(Expression expression10) { | 8836 void set expression(Expression expression10) { |
| 8785 this._expression = becomeParentOf(expression10); | 8837 this._expression = becomeParentOf(expression10); |
| 8786 } | 8838 } |
| 8787 /** | 8839 /** |
| 8788 * Set the token representing the 'return' keyword to the given token. | 8840 * Set the token representing the 'return' keyword to the given token. |
| 8789 * @param keyword the token representing the 'return' keyword | 8841 * @param keyword the token representing the 'return' keyword |
| 8790 */ | 8842 */ |
| 8791 void set keyword(Token keyword15) { | 8843 void set keyword(Token keyword16) { |
| 8792 this._keyword = keyword15; | 8844 this._keyword = keyword16; |
| 8793 } | 8845 } |
| 8794 /** | 8846 /** |
| 8795 * Set the semicolon terminating the statement to the given token. | 8847 * Set the semicolon terminating the statement to the given token. |
| 8796 * @param semicolon the semicolon terminating the statement | 8848 * @param semicolon the semicolon terminating the statement |
| 8797 */ | 8849 */ |
| 8798 void set semicolon(Token semicolon15) { | 8850 void set semicolon(Token semicolon15) { |
| 8799 this._semicolon = semicolon15; | 8851 this._semicolon = semicolon15; |
| 8800 } | 8852 } |
| 8801 void visitChildren(ASTVisitor<Object> visitor) { | 8853 void visitChildren(ASTVisitor<Object> visitor) { |
| 8802 safelyVisitChild(_expression, visitor); | 8854 safelyVisitChild(_expression, visitor); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8945 * not have a declared type. | 8997 * not have a declared type. |
| 8946 * @return the name of the declared type of the parameter | 8998 * @return the name of the declared type of the parameter |
| 8947 */ | 8999 */ |
| 8948 TypeName get type => _type; | 9000 TypeName get type => _type; |
| 8949 bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as Keywor
dToken)).keyword, Keyword.CONST); | 9001 bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as Keywor
dToken)).keyword, Keyword.CONST); |
| 8950 bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as Keywor
dToken)).keyword, Keyword.FINAL); | 9002 bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as Keywor
dToken)).keyword, Keyword.FINAL); |
| 8951 /** | 9003 /** |
| 8952 * Set the token representing either the 'final', 'const' or 'var' keyword to
the given token. | 9004 * Set the token representing either the 'final', 'const' or 'var' keyword to
the given token. |
| 8953 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword | 9005 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword |
| 8954 */ | 9006 */ |
| 8955 void set keyword(Token keyword16) { | 9007 void set keyword(Token keyword17) { |
| 8956 this._keyword = keyword16; | 9008 this._keyword = keyword17; |
| 8957 } | 9009 } |
| 8958 /** | 9010 /** |
| 8959 * Set the name of the declared type of the parameter to the given type name. | 9011 * Set the name of the declared type of the parameter to the given type name. |
| 8960 * @param typeName the name of the declared type of the parameter | 9012 * @param typeName the name of the declared type of the parameter |
| 8961 */ | 9013 */ |
| 8962 void set type(TypeName typeName) { | 9014 void set type(TypeName typeName) { |
| 8963 _type = becomeParentOf(typeName); | 9015 _type = becomeParentOf(typeName); |
| 8964 } | 9016 } |
| 8965 void visitChildren(ASTVisitor<Object> visitor) { | 9017 void visitChildren(ASTVisitor<Object> visitor) { |
| 8966 super.visitChildren(visitor); | 9018 super.visitChildren(visitor); |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9376 * Set the element associated with the constructor to the given element. | 9428 * Set the element associated with the constructor to the given element. |
| 9377 * @param element the element associated with the constructor | 9429 * @param element the element associated with the constructor |
| 9378 */ | 9430 */ |
| 9379 void set element(ConstructorElement element17) { | 9431 void set element(ConstructorElement element17) { |
| 9380 this._element = element17; | 9432 this._element = element17; |
| 9381 } | 9433 } |
| 9382 /** | 9434 /** |
| 9383 * Set the token for the 'super' keyword to the given token. | 9435 * Set the token for the 'super' keyword to the given token. |
| 9384 * @param keyword the token for the 'super' keyword | 9436 * @param keyword the token for the 'super' keyword |
| 9385 */ | 9437 */ |
| 9386 void set keyword(Token keyword17) { | 9438 void set keyword(Token keyword18) { |
| 9387 this._keyword = keyword17; | 9439 this._keyword = keyword18; |
| 9388 } | 9440 } |
| 9389 /** | 9441 /** |
| 9390 * Set the token for the period before the name of the constructor that is bei
ng invoked to the | 9442 * Set the token for the period before the name of the constructor that is bei
ng invoked to the |
| 9391 * given token. | 9443 * given token. |
| 9392 * @param period the token for the period before the name of the constructor t
hat is being invoked | 9444 * @param period the token for the period before the name of the constructor t
hat is being invoked |
| 9393 */ | 9445 */ |
| 9394 void set period(Token period12) { | 9446 void set period(Token period12) { |
| 9395 this._period = period12; | 9447 this._period = period12; |
| 9396 } | 9448 } |
| 9397 void visitChildren(ASTVisitor<Object> visitor) { | 9449 void visitChildren(ASTVisitor<Object> visitor) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9429 Token get endToken => _keyword; | 9481 Token get endToken => _keyword; |
| 9430 /** | 9482 /** |
| 9431 * Return the token representing the keyword. | 9483 * Return the token representing the keyword. |
| 9432 * @return the token representing the keyword | 9484 * @return the token representing the keyword |
| 9433 */ | 9485 */ |
| 9434 Token get keyword => _keyword; | 9486 Token get keyword => _keyword; |
| 9435 /** | 9487 /** |
| 9436 * Set the token representing the keyword to the given token. | 9488 * Set the token representing the keyword to the given token. |
| 9437 * @param keyword the token representing the keyword | 9489 * @param keyword the token representing the keyword |
| 9438 */ | 9490 */ |
| 9439 void set keyword(Token keyword18) { | 9491 void set keyword(Token keyword19) { |
| 9440 this._keyword = keyword18; | 9492 this._keyword = keyword19; |
| 9441 } | 9493 } |
| 9442 void visitChildren(ASTVisitor<Object> visitor) { | 9494 void visitChildren(ASTVisitor<Object> visitor) { |
| 9443 } | 9495 } |
| 9444 } | 9496 } |
| 9445 /** | 9497 /** |
| 9446 * Instances of the class {@code SwitchCase} represent the case in a switch stat
ement. | 9498 * Instances of the class {@code SwitchCase} represent the case in a switch stat
ement. |
| 9447 * <pre> | 9499 * <pre> |
| 9448 * switchCase ::={@link SimpleIdentifier label}* 'case' {@link Expression expres
sion} ':' {@link Statement statement}</pre> | 9500 * switchCase ::={@link SimpleIdentifier label}* 'case' {@link Expression expres
sion} ':' {@link Statement statement}</pre> |
| 9449 * @coverage dart.engine.ast | 9501 * @coverage dart.engine.ast |
| 9450 */ | 9502 */ |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9608 * Set the colon separating the keyword or the expression from the statements
to the given token. | 9660 * Set the colon separating the keyword or the expression from the statements
to the given token. |
| 9609 * @param colon the colon separating the keyword or the expression from the st
atements | 9661 * @param colon the colon separating the keyword or the expression from the st
atements |
| 9610 */ | 9662 */ |
| 9611 void set colon(Token colon4) { | 9663 void set colon(Token colon4) { |
| 9612 this._colon = colon4; | 9664 this._colon = colon4; |
| 9613 } | 9665 } |
| 9614 /** | 9666 /** |
| 9615 * Set the token representing the 'case' or 'default' keyword to the given tok
en. | 9667 * Set the token representing the 'case' or 'default' keyword to the given tok
en. |
| 9616 * @param keyword the token representing the 'case' or 'default' keyword | 9668 * @param keyword the token representing the 'case' or 'default' keyword |
| 9617 */ | 9669 */ |
| 9618 void set keyword(Token keyword19) { | 9670 void set keyword(Token keyword20) { |
| 9619 this._keyword = keyword19; | 9671 this._keyword = keyword20; |
| 9620 } | 9672 } |
| 9621 } | 9673 } |
| 9622 /** | 9674 /** |
| 9623 * Instances of the class {@code SwitchStatement} represent a switch statement. | 9675 * Instances of the class {@code SwitchStatement} represent a switch statement. |
| 9624 * <pre> | 9676 * <pre> |
| 9625 * switchStatement ::= | 9677 * switchStatement ::= |
| 9626 * 'switch' '(' {@link Expression expression} ')' '{' {@link SwitchCase switchCa
se}* {@link SwitchDefault defaultCase}? '}' | 9678 * 'switch' '(' {@link Expression expression} ')' '{' {@link SwitchCase switchCa
se}* {@link SwitchDefault defaultCase}? '}' |
| 9627 * </pre> | 9679 * </pre> |
| 9628 * @coverage dart.engine.ast | 9680 * @coverage dart.engine.ast |
| 9629 */ | 9681 */ |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9730 * expression. | 9782 * expression. |
| 9731 * @param expression the expression used to determine which of the switch memb
ers will be selected | 9783 * @param expression the expression used to determine which of the switch memb
ers will be selected |
| 9732 */ | 9784 */ |
| 9733 void set expression(Expression expression12) { | 9785 void set expression(Expression expression12) { |
| 9734 this._expression = becomeParentOf(expression12); | 9786 this._expression = becomeParentOf(expression12); |
| 9735 } | 9787 } |
| 9736 /** | 9788 /** |
| 9737 * Set the token representing the 'switch' keyword to the given token. | 9789 * Set the token representing the 'switch' keyword to the given token. |
| 9738 * @param keyword the token representing the 'switch' keyword | 9790 * @param keyword the token representing the 'switch' keyword |
| 9739 */ | 9791 */ |
| 9740 void set keyword(Token keyword20) { | 9792 void set keyword(Token keyword21) { |
| 9741 this._keyword = keyword20; | 9793 this._keyword = keyword21; |
| 9742 } | 9794 } |
| 9743 /** | 9795 /** |
| 9744 * Set the left curly bracket to the given token. | 9796 * Set the left curly bracket to the given token. |
| 9745 * @param leftBracket the left curly bracket | 9797 * @param leftBracket the left curly bracket |
| 9746 */ | 9798 */ |
| 9747 void set leftBracket(Token leftBracket7) { | 9799 void set leftBracket(Token leftBracket7) { |
| 9748 this._leftBracket = leftBracket7; | 9800 this._leftBracket = leftBracket7; |
| 9749 } | 9801 } |
| 9750 /** | 9802 /** |
| 9751 * Set the left parenthesis to the given token. | 9803 * Set the left parenthesis to the given token. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9803 Token get endToken => _keyword; | 9855 Token get endToken => _keyword; |
| 9804 /** | 9856 /** |
| 9805 * Return the token representing the keyword. | 9857 * Return the token representing the keyword. |
| 9806 * @return the token representing the keyword | 9858 * @return the token representing the keyword |
| 9807 */ | 9859 */ |
| 9808 Token get keyword => _keyword; | 9860 Token get keyword => _keyword; |
| 9809 /** | 9861 /** |
| 9810 * Set the token representing the keyword to the given token. | 9862 * Set the token representing the keyword to the given token. |
| 9811 * @param keyword the token representing the keyword | 9863 * @param keyword the token representing the keyword |
| 9812 */ | 9864 */ |
| 9813 void set keyword(Token keyword21) { | 9865 void set keyword(Token keyword22) { |
| 9814 this._keyword = keyword21; | 9866 this._keyword = keyword22; |
| 9815 } | 9867 } |
| 9816 void visitChildren(ASTVisitor<Object> visitor) { | 9868 void visitChildren(ASTVisitor<Object> visitor) { |
| 9817 } | 9869 } |
| 9818 } | 9870 } |
| 9819 /** | 9871 /** |
| 9820 * Instances of the class {@code ThrowExpression} represent a throw expression. | 9872 * Instances of the class {@code ThrowExpression} represent a throw expression. |
| 9821 * <pre> | 9873 * <pre> |
| 9822 * throwExpression ::= | 9874 * throwExpression ::= |
| 9823 * 'throw' {@link Expression expression}? ';' | 9875 * 'throw' {@link Expression expression}</pre> |
| 9824 * </pre> | |
| 9825 * @coverage dart.engine.ast | 9876 * @coverage dart.engine.ast |
| 9826 */ | 9877 */ |
| 9827 class ThrowExpression extends Expression { | 9878 class ThrowExpression extends Expression { |
| 9828 /** | 9879 /** |
| 9829 * The token representing the 'throw' keyword. | 9880 * The token representing the 'throw' keyword. |
| 9830 */ | 9881 */ |
| 9831 Token _keyword; | 9882 Token _keyword; |
| 9832 /** | 9883 /** |
| 9833 * The expression computing the exception to be thrown, or {@code null} if the
current exception | 9884 * The expression computing the exception to be thrown. |
| 9834 * is to be re-thrown. (The latter case can only occur if the throw statement
is inside a catch | |
| 9835 * clause.) | |
| 9836 */ | 9885 */ |
| 9837 Expression _expression; | 9886 Expression _expression; |
| 9838 /** | 9887 /** |
| 9839 * Initialize a newly created throw expression. | 9888 * Initialize a newly created throw expression. |
| 9840 * @param keyword the token representing the 'throw' keyword | 9889 * @param keyword the token representing the 'throw' keyword |
| 9841 * @param expression the expression computing the exception to be thrown | 9890 * @param expression the expression computing the exception to be thrown |
| 9842 */ | 9891 */ |
| 9843 ThrowExpression.full(Token keyword, Expression expression) { | 9892 ThrowExpression.full(Token keyword, Expression expression) { |
| 9844 this._keyword = keyword; | 9893 this._keyword = keyword; |
| 9845 this._expression = becomeParentOf(expression); | 9894 this._expression = becomeParentOf(expression); |
| 9846 } | 9895 } |
| 9847 /** | 9896 /** |
| 9848 * Initialize a newly created throw expression. | 9897 * Initialize a newly created throw expression. |
| 9849 * @param keyword the token representing the 'throw' keyword | 9898 * @param keyword the token representing the 'throw' keyword |
| 9850 * @param expression the expression computing the exception to be thrown | 9899 * @param expression the expression computing the exception to be thrown |
| 9851 */ | 9900 */ |
| 9852 ThrowExpression({Token keyword, Expression expression}) : this.full(keyword, e
xpression); | 9901 ThrowExpression({Token keyword, Expression expression}) : this.full(keyword, e
xpression); |
| 9853 accept(ASTVisitor visitor) => visitor.visitThrowExpression(this); | 9902 accept(ASTVisitor visitor) => visitor.visitThrowExpression(this); |
| 9854 Token get beginToken => _keyword; | 9903 Token get beginToken => _keyword; |
| 9855 Token get endToken { | 9904 Token get endToken { |
| 9856 if (_expression != null) { | 9905 if (_expression != null) { |
| 9857 return _expression.endToken; | 9906 return _expression.endToken; |
| 9858 } | 9907 } |
| 9859 return _keyword; | 9908 return _keyword; |
| 9860 } | 9909 } |
| 9861 /** | 9910 /** |
| 9862 * Return the expression computing the exception to be thrown, or {@code null}
if the current | 9911 * Return the expression computing the exception to be thrown. |
| 9863 * exception is to be re-thrown. (The latter case can only occur if the throw
statement is inside | |
| 9864 * a catch clause.) | |
| 9865 * @return the expression computing the exception to be thrown | 9912 * @return the expression computing the exception to be thrown |
| 9866 */ | 9913 */ |
| 9867 Expression get expression => _expression; | 9914 Expression get expression => _expression; |
| 9868 /** | 9915 /** |
| 9869 * Return the token representing the 'throw' keyword. | 9916 * Return the token representing the 'throw' keyword. |
| 9870 * @return the token representing the 'throw' keyword | 9917 * @return the token representing the 'throw' keyword |
| 9871 */ | 9918 */ |
| 9872 Token get keyword => _keyword; | 9919 Token get keyword => _keyword; |
| 9873 /** | 9920 /** |
| 9874 * Set the expression computing the exception to be thrown to the given expres
sion. | 9921 * Set the expression computing the exception to be thrown to the given expres
sion. |
| 9875 * @param expression the expression computing the exception to be thrown | 9922 * @param expression the expression computing the exception to be thrown |
| 9876 */ | 9923 */ |
| 9877 void set expression(Expression expression13) { | 9924 void set expression(Expression expression13) { |
| 9878 this._expression = becomeParentOf(expression13); | 9925 this._expression = becomeParentOf(expression13); |
| 9879 } | 9926 } |
| 9880 /** | 9927 /** |
| 9881 * Set the token representing the 'throw' keyword to the given token. | 9928 * Set the token representing the 'throw' keyword to the given token. |
| 9882 * @param keyword the token representing the 'throw' keyword | 9929 * @param keyword the token representing the 'throw' keyword |
| 9883 */ | 9930 */ |
| 9884 void set keyword(Token keyword22) { | 9931 void set keyword(Token keyword23) { |
| 9885 this._keyword = keyword22; | 9932 this._keyword = keyword23; |
| 9886 } | 9933 } |
| 9887 void visitChildren(ASTVisitor<Object> visitor) { | 9934 void visitChildren(ASTVisitor<Object> visitor) { |
| 9888 safelyVisitChild(_expression, visitor); | 9935 safelyVisitChild(_expression, visitor); |
| 9889 } | 9936 } |
| 9890 } | 9937 } |
| 9891 /** | 9938 /** |
| 9892 * Instances of the class {@code TopLevelVariableDeclaration} represent the decl
aration of one or | 9939 * Instances of the class {@code TopLevelVariableDeclaration} represent the decl
aration of one or |
| 9893 * more top-level variables of the same type. | 9940 * more top-level variables of the same type. |
| 9894 * <pre> | 9941 * <pre> |
| 9895 * topLevelVariableDeclaration ::= | 9942 * topLevelVariableDeclaration ::= |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10136 Token get keyword => _keyword; | 10183 Token get keyword => _keyword; |
| 10137 /** | 10184 /** |
| 10138 * Return the semicolon terminating the declaration. | 10185 * Return the semicolon terminating the declaration. |
| 10139 * @return the semicolon terminating the declaration | 10186 * @return the semicolon terminating the declaration |
| 10140 */ | 10187 */ |
| 10141 Token get semicolon => _semicolon; | 10188 Token get semicolon => _semicolon; |
| 10142 /** | 10189 /** |
| 10143 * Set the token representing the 'typedef' keyword to the given token. | 10190 * Set the token representing the 'typedef' keyword to the given token. |
| 10144 * @param keyword the token representing the 'typedef' keyword | 10191 * @param keyword the token representing the 'typedef' keyword |
| 10145 */ | 10192 */ |
| 10146 void set keyword(Token keyword23) { | 10193 void set keyword(Token keyword24) { |
| 10147 this._keyword = keyword23; | 10194 this._keyword = keyword24; |
| 10148 } | 10195 } |
| 10149 /** | 10196 /** |
| 10150 * Set the semicolon terminating the declaration to the given token. | 10197 * Set the semicolon terminating the declaration to the given token. |
| 10151 * @param semicolon the semicolon terminating the declaration | 10198 * @param semicolon the semicolon terminating the declaration |
| 10152 */ | 10199 */ |
| 10153 void set semicolon(Token semicolon17) { | 10200 void set semicolon(Token semicolon17) { |
| 10154 this._semicolon = semicolon17; | 10201 this._semicolon = semicolon17; |
| 10155 } | 10202 } |
| 10156 Token get firstTokenAfterCommentAndMetadata => _keyword; | 10203 Token get firstTokenAfterCommentAndMetadata => _keyword; |
| 10157 } | 10204 } |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10392 * Set the name of the upper bound for legal arguments to the given type name. | 10439 * Set the name of the upper bound for legal arguments to the given type name. |
| 10393 * @param typeName the name of the upper bound for legal arguments | 10440 * @param typeName the name of the upper bound for legal arguments |
| 10394 */ | 10441 */ |
| 10395 void set bound(TypeName typeName) { | 10442 void set bound(TypeName typeName) { |
| 10396 _bound = becomeParentOf(typeName); | 10443 _bound = becomeParentOf(typeName); |
| 10397 } | 10444 } |
| 10398 /** | 10445 /** |
| 10399 * Set the token representing the 'assert' keyword to the given token. | 10446 * Set the token representing the 'assert' keyword to the given token. |
| 10400 * @param keyword the token representing the 'assert' keyword | 10447 * @param keyword the token representing the 'assert' keyword |
| 10401 */ | 10448 */ |
| 10402 void set keyword(Token keyword24) { | 10449 void set keyword(Token keyword25) { |
| 10403 this._keyword = keyword24; | 10450 this._keyword = keyword25; |
| 10404 } | 10451 } |
| 10405 /** | 10452 /** |
| 10406 * Set the name of the type parameter to the given identifier. | 10453 * Set the name of the type parameter to the given identifier. |
| 10407 * @param identifier the name of the type parameter | 10454 * @param identifier the name of the type parameter |
| 10408 */ | 10455 */ |
| 10409 void set name(SimpleIdentifier identifier) { | 10456 void set name(SimpleIdentifier identifier) { |
| 10410 _name = becomeParentOf(identifier); | 10457 _name = becomeParentOf(identifier); |
| 10411 } | 10458 } |
| 10412 void visitChildren(ASTVisitor<Object> visitor) { | 10459 void visitChildren(ASTVisitor<Object> visitor) { |
| 10413 super.visitChildren(visitor); | 10460 super.visitChildren(visitor); |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10709 * <pre> | 10756 * <pre> |
| 10710 * variableDeclarationList ::= | 10757 * variableDeclarationList ::= |
| 10711 * finalConstVarOrType {@link VariableDeclaration variableDeclaration} (',' {@li
nk VariableDeclaration variableDeclaration}) | 10758 * finalConstVarOrType {@link VariableDeclaration variableDeclaration} (',' {@li
nk VariableDeclaration variableDeclaration}) |
| 10712 * finalConstVarOrType ::= | 10759 * finalConstVarOrType ::= |
| 10713 * | 'final' {@link TypeName type}? | 10760 * | 'final' {@link TypeName type}? |
| 10714 * | 'const' {@link TypeName type}? | 10761 * | 'const' {@link TypeName type}? |
| 10715 * | 'var' | 10762 * | 'var' |
| 10716 * | {@link TypeName type}</pre> | 10763 * | {@link TypeName type}</pre> |
| 10717 * @coverage dart.engine.ast | 10764 * @coverage dart.engine.ast |
| 10718 */ | 10765 */ |
| 10719 class VariableDeclarationList extends ASTNode { | 10766 class VariableDeclarationList extends AnnotatedNode { |
| 10720 /** | 10767 /** |
| 10721 * The token representing the 'final', 'const' or 'var' keyword, or {@code nul
l} if no keyword was | 10768 * The token representing the 'final', 'const' or 'var' keyword, or {@code nul
l} if no keyword was |
| 10722 * included. | 10769 * included. |
| 10723 */ | 10770 */ |
| 10724 Token _keyword; | 10771 Token _keyword; |
| 10725 /** | 10772 /** |
| 10726 * The type of the variables being declared, or {@code null} if no type was pr
ovided. | 10773 * The type of the variables being declared, or {@code null} if no type was pr
ovided. |
| 10727 */ | 10774 */ |
| 10728 TypeName _type; | 10775 TypeName _type; |
| 10729 /** | 10776 /** |
| 10730 * A list containing the individual variables being declared. | 10777 * A list containing the individual variables being declared. |
| 10731 */ | 10778 */ |
| 10732 NodeList<VariableDeclaration> _variables; | 10779 NodeList<VariableDeclaration> _variables; |
| 10733 /** | 10780 /** |
| 10734 * Initialize a newly created variable declaration list. | 10781 * Initialize a newly created variable declaration list. |
| 10782 * @param comment the documentation comment associated with this declaration l
ist |
| 10783 * @param metadata the annotations associated with this declaration list |
| 10735 * @param keyword the token representing the 'final', 'const' or 'var' keyword | 10784 * @param keyword the token representing the 'final', 'const' or 'var' keyword |
| 10736 * @param type the type of the variables being declared | 10785 * @param type the type of the variables being declared |
| 10737 * @param variables a list containing the individual variables being declared | 10786 * @param variables a list containing the individual variables being declared |
| 10738 */ | 10787 */ |
| 10739 VariableDeclarationList.full(Token keyword, TypeName type, List<VariableDeclar
ation> variables) { | 10788 VariableDeclarationList.full(Comment comment, List<Annotation> metadata, Token
keyword, TypeName type, List<VariableDeclaration> variables) : super.full(comme
nt, metadata) { |
| 10740 this._variables = new NodeList<VariableDeclaration>(this); | 10789 this._variables = new NodeList<VariableDeclaration>(this); |
| 10741 this._keyword = keyword; | 10790 this._keyword = keyword; |
| 10742 this._type = becomeParentOf(type); | 10791 this._type = becomeParentOf(type); |
| 10743 this._variables.addAll(variables); | 10792 this._variables.addAll(variables); |
| 10744 } | 10793 } |
| 10745 /** | 10794 /** |
| 10746 * Initialize a newly created variable declaration list. | 10795 * Initialize a newly created variable declaration list. |
| 10796 * @param comment the documentation comment associated with this declaration l
ist |
| 10797 * @param metadata the annotations associated with this declaration list |
| 10747 * @param keyword the token representing the 'final', 'const' or 'var' keyword | 10798 * @param keyword the token representing the 'final', 'const' or 'var' keyword |
| 10748 * @param type the type of the variables being declared | 10799 * @param type the type of the variables being declared |
| 10749 * @param variables a list containing the individual variables being declared | 10800 * @param variables a list containing the individual variables being declared |
| 10750 */ | 10801 */ |
| 10751 VariableDeclarationList({Token keyword, TypeName type, List<VariableDeclaratio
n> variables}) : this.full(keyword, type, variables); | 10802 VariableDeclarationList({Comment comment, List<Annotation> metadata, Token key
word, TypeName type, List<VariableDeclaration> variables}) : this.full(comment,
metadata, keyword, type, variables); |
| 10752 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this); | 10803 accept(ASTVisitor visitor) => visitor.visitVariableDeclarationList(this); |
| 10753 Token get beginToken { | |
| 10754 if (_keyword != null) { | |
| 10755 return _keyword; | |
| 10756 } else if (_type != null) { | |
| 10757 return _type.beginToken; | |
| 10758 } | |
| 10759 return _variables.beginToken; | |
| 10760 } | |
| 10761 Token get endToken => _variables.endToken; | 10804 Token get endToken => _variables.endToken; |
| 10762 /** | 10805 /** |
| 10763 * Return the token representing the 'final', 'const' or 'var' keyword, or {@c
ode null} if no | 10806 * Return the token representing the 'final', 'const' or 'var' keyword, or {@c
ode null} if no |
| 10764 * keyword was included. | 10807 * keyword was included. |
| 10765 * @return the token representing the 'final', 'const' or 'var' keyword | 10808 * @return the token representing the 'final', 'const' or 'var' keyword |
| 10766 */ | 10809 */ |
| 10767 Token get keyword => _keyword; | 10810 Token get keyword => _keyword; |
| 10768 /** | 10811 /** |
| 10769 * Return the type of the variables being declared, or {@code null} if no type
was provided. | 10812 * Return the type of the variables being declared, or {@code null} if no type
was provided. |
| 10770 * @return the type of the variables being declared | 10813 * @return the type of the variables being declared |
| (...skipping 13 matching lines...) Expand all Loading... |
| 10784 * Return {@code true} if the variables in this list were declared with the 'f
inal' modifier. | 10827 * Return {@code true} if the variables in this list were declared with the 'f
inal' modifier. |
| 10785 * Variables that are declared with the 'const' modifier will return {@code fa
lse} even though | 10828 * Variables that are declared with the 'const' modifier will return {@code fa
lse} even though |
| 10786 * they are implicitly final. | 10829 * they are implicitly final. |
| 10787 * @return {@code true} if the variables in this list were declared with the '
final' modifier | 10830 * @return {@code true} if the variables in this list were declared with the '
final' modifier |
| 10788 */ | 10831 */ |
| 10789 bool isFinal() => _keyword is KeywordToken && identical(((_keyword as KeywordT
oken)).keyword, Keyword.FINAL); | 10832 bool isFinal() => _keyword is KeywordToken && identical(((_keyword as KeywordT
oken)).keyword, Keyword.FINAL); |
| 10790 /** | 10833 /** |
| 10791 * Set the token representing the 'final', 'const' or 'var' keyword to the giv
en token. | 10834 * Set the token representing the 'final', 'const' or 'var' keyword to the giv
en token. |
| 10792 * @param keyword the token representing the 'final', 'const' or 'var' keyword | 10835 * @param keyword the token representing the 'final', 'const' or 'var' keyword |
| 10793 */ | 10836 */ |
| 10794 void set keyword(Token keyword25) { | 10837 void set keyword(Token keyword26) { |
| 10795 this._keyword = keyword25; | 10838 this._keyword = keyword26; |
| 10796 } | 10839 } |
| 10797 /** | 10840 /** |
| 10798 * Set the type of the variables being declared to the given type name. | 10841 * Set the type of the variables being declared to the given type name. |
| 10799 * @param typeName the type of the variables being declared | 10842 * @param typeName the type of the variables being declared |
| 10800 */ | 10843 */ |
| 10801 void set type(TypeName typeName) { | 10844 void set type(TypeName typeName) { |
| 10802 _type = becomeParentOf(typeName); | 10845 _type = becomeParentOf(typeName); |
| 10803 } | 10846 } |
| 10804 void visitChildren(ASTVisitor<Object> visitor) { | 10847 void visitChildren(ASTVisitor<Object> visitor) { |
| 10805 safelyVisitChild(_type, visitor); | 10848 safelyVisitChild(_type, visitor); |
| 10806 _variables.accept(visitor); | 10849 _variables.accept(visitor); |
| 10807 } | 10850 } |
| 10851 Token get firstTokenAfterCommentAndMetadata { |
| 10852 if (_keyword != null) { |
| 10853 return _keyword; |
| 10854 } else if (_type != null) { |
| 10855 return _type.beginToken; |
| 10856 } |
| 10857 return _variables.beginToken; |
| 10858 } |
| 10808 } | 10859 } |
| 10809 /** | 10860 /** |
| 10810 * Instances of the class {@code VariableDeclarationStatement} represent a list
of variables that | 10861 * Instances of the class {@code VariableDeclarationStatement} represent a list
of variables that |
| 10811 * are being declared in a context where a statement is required. | 10862 * are being declared in a context where a statement is required. |
| 10812 * <pre> | 10863 * <pre> |
| 10813 * variableDeclarationStatement ::={@link VariableDeclarationList variableList}
';' | 10864 * variableDeclarationStatement ::={@link VariableDeclarationList variableList}
';' |
| 10814 * </pre> | 10865 * </pre> |
| 10815 * @coverage dart.engine.ast | 10866 * @coverage dart.engine.ast |
| 10816 */ | 10867 */ |
| 10817 class VariableDeclarationStatement extends Statement { | 10868 class VariableDeclarationStatement extends Statement { |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10961 * expression. | 11012 * expression. |
| 10962 * @param expression the expression used to determine whether to execute the b
ody of the loop | 11013 * @param expression the expression used to determine whether to execute the b
ody of the loop |
| 10963 */ | 11014 */ |
| 10964 void set condition(Expression expression) { | 11015 void set condition(Expression expression) { |
| 10965 _condition = becomeParentOf(expression); | 11016 _condition = becomeParentOf(expression); |
| 10966 } | 11017 } |
| 10967 /** | 11018 /** |
| 10968 * Set the token representing the 'while' keyword to the given token. | 11019 * Set the token representing the 'while' keyword to the given token. |
| 10969 * @param keyword the token representing the 'while' keyword | 11020 * @param keyword the token representing the 'while' keyword |
| 10970 */ | 11021 */ |
| 10971 void set keyword(Token keyword26) { | 11022 void set keyword(Token keyword27) { |
| 10972 this._keyword = keyword26; | 11023 this._keyword = keyword27; |
| 10973 } | 11024 } |
| 10974 /** | 11025 /** |
| 10975 * Set the left parenthesis to the given token. | 11026 * Set the left parenthesis to the given token. |
| 10976 * @param leftParenthesis the left parenthesis | 11027 * @param leftParenthesis the left parenthesis |
| 10977 */ | 11028 */ |
| 10978 void set leftParenthesis(Token leftParenthesis7) { | 11029 void set leftParenthesis(Token leftParenthesis7) { |
| 10979 this._leftParenthesis = leftParenthesis7; | 11030 this._leftParenthesis = leftParenthesis7; |
| 10980 } | 11031 } |
| 10981 /** | 11032 /** |
| 10982 * Set the right parenthesis to the given token. | 11033 * Set the right parenthesis to the given token. |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11368 * Clients should use {@link #locate(ASTNode)}. | 11419 * Clients should use {@link #locate(ASTNode)}. |
| 11369 */ | 11420 */ |
| 11370 ElementLocator() { | 11421 ElementLocator() { |
| 11371 } | 11422 } |
| 11372 } | 11423 } |
| 11373 /** | 11424 /** |
| 11374 * Visitor that maps nodes to elements. | 11425 * Visitor that maps nodes to elements. |
| 11375 */ | 11426 */ |
| 11376 class ElementLocator_ElementMapper extends GeneralizingASTVisitor<Element> { | 11427 class ElementLocator_ElementMapper extends GeneralizingASTVisitor<Element> { |
| 11377 Element visitBinaryExpression(BinaryExpression node) => node.element; | 11428 Element visitBinaryExpression(BinaryExpression node) => node.element; |
| 11429 Element visitClassDeclaration(ClassDeclaration node) => node.element; |
| 11430 Element visitFunctionDeclaration(FunctionDeclaration node) => node.element; |
| 11378 Element visitIdentifier(Identifier node) => node.element; | 11431 Element visitIdentifier(Identifier node) => node.element; |
| 11379 Element visitImportDirective(ImportDirective node) => node.element; | 11432 Element visitImportDirective(ImportDirective node) => node.element; |
| 11380 Element visitIndexExpression(IndexExpression node) => node.element; | 11433 Element visitIndexExpression(IndexExpression node) => node.element; |
| 11381 Element visitLibraryDirective(LibraryDirective node) => node.element; | 11434 Element visitLibraryDirective(LibraryDirective node) => node.element; |
| 11435 Element visitMethodDeclaration(MethodDeclaration node) => node.element; |
| 11382 Element visitPostfixExpression(PostfixExpression node) => node.element; | 11436 Element visitPostfixExpression(PostfixExpression node) => node.element; |
| 11383 Element visitPrefixedIdentifier(PrefixedIdentifier node) => node.element; | 11437 Element visitPrefixedIdentifier(PrefixedIdentifier node) => node.element; |
| 11384 Element visitPrefixExpression(PrefixExpression node) => node.element; | 11438 Element visitPrefixExpression(PrefixExpression node) => node.element; |
| 11385 Element visitStringLiteral(StringLiteral node) { | 11439 Element visitStringLiteral(StringLiteral node) { |
| 11386 ASTNode parent12 = node.parent; | 11440 ASTNode parent12 = node.parent; |
| 11387 if (parent12 is UriBasedDirective) { | 11441 if (parent12 is UriBasedDirective) { |
| 11388 return ((parent12 as UriBasedDirective)).element; | 11442 return ((parent12 as UriBasedDirective)).element; |
| 11389 } | 11443 } |
| 11390 return null; | 11444 return null; |
| 11391 } | 11445 } |
| 11446 Element visitVariableDeclaration(VariableDeclaration node) => node.element; |
| 11392 } | 11447 } |
| 11393 /** | 11448 /** |
| 11394 * Instances of the class {@code GeneralizingASTVisitor} implement an AST visito
r that will | 11449 * Instances of the class {@code GeneralizingASTVisitor} implement an AST visito
r that will |
| 11395 * recursively visit all of the nodes in an AST structure (like instances of the
class{@link RecursiveASTVisitor}). In addition, when a node of a specific type
is visited not only | 11450 * recursively visit all of the nodes in an AST structure (like instances of the
class{@link RecursiveASTVisitor}). In addition, when a node of a specific type
is visited not only |
| 11396 * will the visit method for that specific type of node be invoked, but addition
al methods for the | 11451 * will the visit method for that specific type of node be invoked, but addition
al methods for the |
| 11397 * superclasses of that node will also be invoked. For example, using an instanc
e of this class to | 11452 * superclasses of that node will also be invoked. For example, using an instanc
e of this class to |
| 11398 * visit a {@link Block} will cause the method {@link #visitBlock(Block)} to be
invoked but will | 11453 * visit a {@link Block} will cause the method {@link #visitBlock(Block)} to be
invoked but will |
| 11399 * also cause the methods {@link #visitStatement(Statement)} and {@link #visitNo
de(ASTNode)} to be | 11454 * also cause the methods {@link #visitStatement(Statement)} and {@link #visitNo
de(ASTNode)} to be |
| 11400 * subsequently invoked. This allows visitors to be written that visit all state
ments without | 11455 * subsequently invoked. This allows visitors to be written that visit all state
ments without |
| 11401 * needing to override the visit method for each of the specific subclasses of {
@link Statement}. | 11456 * needing to override the visit method for each of the specific subclasses of {
@link Statement}. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11493 R visitNormalFormalParameter(NormalFormalParameter node) => visitFormalParamet
er(node); | 11548 R visitNormalFormalParameter(NormalFormalParameter node) => visitFormalParamet
er(node); |
| 11494 R visitNullLiteral(NullLiteral node) => visitLiteral(node); | 11549 R visitNullLiteral(NullLiteral node) => visitLiteral(node); |
| 11495 R visitParenthesizedExpression(ParenthesizedExpression node) => visitExpressio
n(node); | 11550 R visitParenthesizedExpression(ParenthesizedExpression node) => visitExpressio
n(node); |
| 11496 R visitPartDirective(PartDirective node) => visitUriBasedDirective(node); | 11551 R visitPartDirective(PartDirective node) => visitUriBasedDirective(node); |
| 11497 R visitPartOfDirective(PartOfDirective node) => visitDirective(node); | 11552 R visitPartOfDirective(PartOfDirective node) => visitDirective(node); |
| 11498 R visitPostfixExpression(PostfixExpression node) => visitExpression(node); | 11553 R visitPostfixExpression(PostfixExpression node) => visitExpression(node); |
| 11499 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitIdentifier(node); | 11554 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitIdentifier(node); |
| 11500 R visitPrefixExpression(PrefixExpression node) => visitExpression(node); | 11555 R visitPrefixExpression(PrefixExpression node) => visitExpression(node); |
| 11501 R visitPropertyAccess(PropertyAccess node) => visitExpression(node); | 11556 R visitPropertyAccess(PropertyAccess node) => visitExpression(node); |
| 11502 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node)
=> visitConstructorInitializer(node); | 11557 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node)
=> visitConstructorInitializer(node); |
| 11558 R visitRethrowExpression(RethrowExpression node) => visitExpression(node); |
| 11503 R visitReturnStatement(ReturnStatement node) => visitStatement(node); | 11559 R visitReturnStatement(ReturnStatement node) => visitStatement(node); |
| 11504 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag); | 11560 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag); |
| 11505 R visitShowCombinator(ShowCombinator node) => visitCombinator(node); | 11561 R visitShowCombinator(ShowCombinator node) => visitCombinator(node); |
| 11506 R visitSimpleFormalParameter(SimpleFormalParameter node) => visitNormalFormalP
arameter(node); | 11562 R visitSimpleFormalParameter(SimpleFormalParameter node) => visitNormalFormalP
arameter(node); |
| 11507 R visitSimpleIdentifier(SimpleIdentifier node) => visitIdentifier(node); | 11563 R visitSimpleIdentifier(SimpleIdentifier node) => visitIdentifier(node); |
| 11508 R visitSimpleStringLiteral(SimpleStringLiteral node) => visitStringLiteral(nod
e); | 11564 R visitSimpleStringLiteral(SimpleStringLiteral node) => visitStringLiteral(nod
e); |
| 11509 R visitStatement(Statement node) => visitNode(node); | 11565 R visitStatement(Statement node) => visitNode(node); |
| 11510 R visitStringInterpolation(StringInterpolation node) => visitStringLiteral(nod
e); | 11566 R visitStringInterpolation(StringInterpolation node) => visitStringLiteral(nod
e); |
| 11511 R visitStringLiteral(StringLiteral node) => visitLiteral(node); | 11567 R visitStringLiteral(StringLiteral node) => visitLiteral(node); |
| 11512 R visitSuperConstructorInvocation(SuperConstructorInvocation node) => visitCon
structorInitializer(node); | 11568 R visitSuperConstructorInvocation(SuperConstructorInvocation node) => visitCon
structorInitializer(node); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11552 * The element that was found that corresponds to the given source range, or {
@code null} if there | 11608 * The element that was found that corresponds to the given source range, or {
@code null} if there |
| 11553 * is no such element. | 11609 * is no such element. |
| 11554 */ | 11610 */ |
| 11555 ASTNode _foundNode; | 11611 ASTNode _foundNode; |
| 11556 /** | 11612 /** |
| 11557 * Initialize a newly created locator to locate one or more {@link ASTNode AST
nodes} by locating | 11613 * Initialize a newly created locator to locate one or more {@link ASTNode AST
nodes} by locating |
| 11558 * the node within an AST structure that corresponds to the given offset in th
e source. | 11614 * the node within an AST structure that corresponds to the given offset in th
e source. |
| 11559 * @param offset the offset used to identify the node | 11615 * @param offset the offset used to identify the node |
| 11560 */ | 11616 */ |
| 11561 NodeLocator.con1(int offset) { | 11617 NodeLocator.con1(int offset) { |
| 11562 _jtd_constructor_118_impl(offset); | 11618 _jtd_constructor_119_impl(offset); |
| 11563 } | 11619 } |
| 11564 _jtd_constructor_118_impl(int offset) { | 11620 _jtd_constructor_119_impl(int offset) { |
| 11565 _jtd_constructor_119_impl(offset, offset); | 11621 _jtd_constructor_120_impl(offset, offset); |
| 11566 } | 11622 } |
| 11567 /** | 11623 /** |
| 11568 * Initialize a newly created locator to locate one or more {@link ASTNode AST
nodes} by locating | 11624 * Initialize a newly created locator to locate one or more {@link ASTNode AST
nodes} by locating |
| 11569 * the node within an AST structure that corresponds to the given range of cha
racters in the | 11625 * the node within an AST structure that corresponds to the given range of cha
racters in the |
| 11570 * source. | 11626 * source. |
| 11571 * @param start the start offset of the range used to identify the node | 11627 * @param start the start offset of the range used to identify the node |
| 11572 * @param end the end offset of the range used to identify the node | 11628 * @param end the end offset of the range used to identify the node |
| 11573 */ | 11629 */ |
| 11574 NodeLocator.con2(int start, int end) { | 11630 NodeLocator.con2(int start, int end) { |
| 11575 _jtd_constructor_119_impl(start, end); | 11631 _jtd_constructor_120_impl(start, end); |
| 11576 } | 11632 } |
| 11577 _jtd_constructor_119_impl(int start, int end) { | 11633 _jtd_constructor_120_impl(int start, int end) { |
| 11578 this._startOffset = start; | 11634 this._startOffset = start; |
| 11579 this._endOffset = end; | 11635 this._endOffset = end; |
| 11580 } | 11636 } |
| 11581 /** | 11637 /** |
| 11582 * Return the node that was found that corresponds to the given source range,
or {@code null} if | 11638 * Return the node that was found that corresponds to the given source range,
or {@code null} if |
| 11583 * there is no such node. | 11639 * there is no such node. |
| 11584 * @return the node that was found | 11640 * @return the node that was found |
| 11585 */ | 11641 */ |
| 11586 ASTNode get foundNode => _foundNode; | 11642 ASTNode get foundNode => _foundNode; |
| 11587 /** | 11643 /** |
| 11588 * Search within the given AST node for an identifier representing a {@link Da
rtElement Dart | 11644 * Search within the given AST node for an identifier representing a {@link Da
rtElement Dart |
| 11589 * element} in the specified source range. Return the element that was found,
or {@code null} if | 11645 * element} in the specified source range. Return the element that was found,
or {@code null} if |
| 11590 * no element was found. | 11646 * no element was found. |
| 11591 * @param node the AST node within which to search | 11647 * @param node the AST node within which to search |
| 11592 * @return the element that was found | 11648 * @return the element that was found |
| 11593 */ | 11649 */ |
| 11594 ASTNode searchWithin(ASTNode node) { | 11650 ASTNode searchWithin(ASTNode node) { |
| 11595 try { | 11651 try { |
| 11596 node.accept(this); | 11652 node.accept(this); |
| 11597 } on NodeLocator_NodeFoundException catch (exception) { | 11653 } on NodeLocator_NodeFoundException catch (exception) { |
| 11598 } on JavaException catch (exception) { | 11654 } catch (exception) { |
| 11599 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a
t offset (${_startOffset} - ${_endOffset})", exception); | 11655 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a
t offset (${_startOffset} - ${_endOffset})", exception); |
| 11600 return null; | 11656 return null; |
| 11601 } | 11657 } |
| 11602 return _foundNode; | 11658 return _foundNode; |
| 11603 } | 11659 } |
| 11604 Object visitNode(ASTNode node) { | 11660 Object visitNode(ASTNode node) { |
| 11605 try { | 11661 try { |
| 11606 node.visitChildren(this); | 11662 node.visitChildren(this); |
| 11607 } on NodeLocator_NodeFoundException catch (exception) { | 11663 } on NodeLocator_NodeFoundException catch (exception) { |
| 11608 throw exception; | 11664 throw exception; |
| 11609 } on JavaException catch (exception) { | 11665 } catch (exception) { |
| 11610 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra
versing an AST structure.", exception); | 11666 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra
versing an AST structure.", exception); |
| 11611 } | 11667 } |
| 11612 int start = node.offset; | 11668 int start = node.offset; |
| 11613 int end = start + node.length; | 11669 int end = start + node.length; |
| 11614 if (start <= _startOffset && _endOffset <= end) { | 11670 if (start <= _startOffset && _endOffset <= end) { |
| 11615 _foundNode = node; | 11671 _foundNode = node; |
| 11616 throw new NodeLocator_NodeFoundException(); | 11672 throw new NodeLocator_NodeFoundException(); |
| 11617 } | 11673 } |
| 11618 return null; | 11674 return null; |
| 11619 } | 11675 } |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11925 return null; | 11981 return null; |
| 11926 } | 11982 } |
| 11927 R visitPropertyAccess(PropertyAccess node) { | 11983 R visitPropertyAccess(PropertyAccess node) { |
| 11928 node.visitChildren(this); | 11984 node.visitChildren(this); |
| 11929 return null; | 11985 return null; |
| 11930 } | 11986 } |
| 11931 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node)
{ | 11987 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node)
{ |
| 11932 node.visitChildren(this); | 11988 node.visitChildren(this); |
| 11933 return null; | 11989 return null; |
| 11934 } | 11990 } |
| 11991 R visitRethrowExpression(RethrowExpression node) { |
| 11992 node.visitChildren(this); |
| 11993 return null; |
| 11994 } |
| 11935 R visitReturnStatement(ReturnStatement node) { | 11995 R visitReturnStatement(ReturnStatement node) { |
| 11936 node.visitChildren(this); | 11996 node.visitChildren(this); |
| 11937 return null; | 11997 return null; |
| 11938 } | 11998 } |
| 11939 R visitScriptTag(ScriptTag node) { | 11999 R visitScriptTag(ScriptTag node) { |
| 11940 node.visitChildren(this); | 12000 node.visitChildren(this); |
| 11941 return null; | 12001 return null; |
| 11942 } | 12002 } |
| 11943 R visitShowCombinator(ShowCombinator node) { | 12003 R visitShowCombinator(ShowCombinator node) { |
| 11944 node.visitChildren(this); | 12004 node.visitChildren(this); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12108 R visitNamedExpression(NamedExpression node) => null; | 12168 R visitNamedExpression(NamedExpression node) => null; |
| 12109 R visitNullLiteral(NullLiteral node) => null; | 12169 R visitNullLiteral(NullLiteral node) => null; |
| 12110 R visitParenthesizedExpression(ParenthesizedExpression node) => null; | 12170 R visitParenthesizedExpression(ParenthesizedExpression node) => null; |
| 12111 R visitPartDirective(PartDirective node) => null; | 12171 R visitPartDirective(PartDirective node) => null; |
| 12112 R visitPartOfDirective(PartOfDirective node) => null; | 12172 R visitPartOfDirective(PartOfDirective node) => null; |
| 12113 R visitPostfixExpression(PostfixExpression node) => null; | 12173 R visitPostfixExpression(PostfixExpression node) => null; |
| 12114 R visitPrefixedIdentifier(PrefixedIdentifier node) => null; | 12174 R visitPrefixedIdentifier(PrefixedIdentifier node) => null; |
| 12115 R visitPrefixExpression(PrefixExpression node) => null; | 12175 R visitPrefixExpression(PrefixExpression node) => null; |
| 12116 R visitPropertyAccess(PropertyAccess node) => null; | 12176 R visitPropertyAccess(PropertyAccess node) => null; |
| 12117 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node)
=> null; | 12177 R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node)
=> null; |
| 12178 R visitRethrowExpression(RethrowExpression node) => null; |
| 12118 R visitReturnStatement(ReturnStatement node) => null; | 12179 R visitReturnStatement(ReturnStatement node) => null; |
| 12119 R visitScriptTag(ScriptTag node) => null; | 12180 R visitScriptTag(ScriptTag node) => null; |
| 12120 R visitShowCombinator(ShowCombinator node) => null; | 12181 R visitShowCombinator(ShowCombinator node) => null; |
| 12121 R visitSimpleFormalParameter(SimpleFormalParameter node) => null; | 12182 R visitSimpleFormalParameter(SimpleFormalParameter node) => null; |
| 12122 R visitSimpleIdentifier(SimpleIdentifier node) => null; | 12183 R visitSimpleIdentifier(SimpleIdentifier node) => null; |
| 12123 R visitSimpleStringLiteral(SimpleStringLiteral node) => null; | 12184 R visitSimpleStringLiteral(SimpleStringLiteral node) => null; |
| 12124 R visitStringInterpolation(StringInterpolation node) => null; | 12185 R visitStringInterpolation(StringInterpolation node) => null; |
| 12125 R visitSuperConstructorInvocation(SuperConstructorInvocation node) => null; | 12186 R visitSuperConstructorInvocation(SuperConstructorInvocation node) => null; |
| 12126 R visitSuperExpression(SuperExpression node) => null; | 12187 R visitSuperExpression(SuperExpression node) => null; |
| 12127 R visitSwitchCase(SwitchCase node) => null; | 12188 R visitSwitchCase(SwitchCase node) => null; |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12685 } | 12746 } |
| 12686 visit(node.propertyName); | 12747 visit(node.propertyName); |
| 12687 return null; | 12748 return null; |
| 12688 } | 12749 } |
| 12689 Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation
node) { | 12750 Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation
node) { |
| 12690 _writer.print("this"); | 12751 _writer.print("this"); |
| 12691 visit3(".", node.constructorName); | 12752 visit3(".", node.constructorName); |
| 12692 visit(node.argumentList); | 12753 visit(node.argumentList); |
| 12693 return null; | 12754 return null; |
| 12694 } | 12755 } |
| 12756 Object visitRethrowExpression(RethrowExpression node) { |
| 12757 _writer.print("rethrow"); |
| 12758 return null; |
| 12759 } |
| 12695 Object visitReturnStatement(ReturnStatement node) { | 12760 Object visitReturnStatement(ReturnStatement node) { |
| 12696 Expression expression14 = node.expression; | 12761 Expression expression14 = node.expression; |
| 12697 if (expression14 == null) { | 12762 if (expression14 == null) { |
| 12698 _writer.print("return;"); | 12763 _writer.print("return;"); |
| 12699 } else { | 12764 } else { |
| 12700 _writer.print("return "); | 12765 _writer.print("return "); |
| 12701 expression14.accept(this); | 12766 expression14.accept(this); |
| 12702 _writer.print(";"); | 12767 _writer.print(";"); |
| 12703 } | 12768 } |
| 12704 return null; | 12769 return null; |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13010 return elements[elements.length - 1].endToken; | 13075 return elements[elements.length - 1].endToken; |
| 13011 } | 13076 } |
| 13012 /** | 13077 /** |
| 13013 * Return the node that is the parent of each of the elements in the list. | 13078 * Return the node that is the parent of each of the elements in the list. |
| 13014 * @return the node that is the parent of each of the elements in the list | 13079 * @return the node that is the parent of each of the elements in the list |
| 13015 */ | 13080 */ |
| 13016 ASTNode getOwner() { | 13081 ASTNode getOwner() { |
| 13017 return owner; | 13082 return owner; |
| 13018 } | 13083 } |
| 13019 } | 13084 } |
| OLD | NEW |