| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 * @param atSign the at sign that introduced the annotation | 263 * @param atSign the at sign that introduced the annotation |
| 264 * @param name the name of the class defining the constructor that is being in
voked or the name of | 264 * @param name the name of the class defining the constructor that is being in
voked or the name of |
| 265 * the field that is being referenced | 265 * the field that is being referenced |
| 266 * @param period the period before the constructor name, or `null` if this ann
otation is not | 266 * @param period the period before the constructor name, or `null` if this ann
otation is not |
| 267 * the invocation of a named constructor | 267 * the invocation of a named constructor |
| 268 * @param constructorName the name of the constructor being invoked, or `null`
if this | 268 * @param constructorName the name of the constructor being invoked, or `null`
if this |
| 269 * annotation is not the invocation of a named constructor | 269 * annotation is not the invocation of a named constructor |
| 270 * @param arguments the arguments to the constructor being invoked, or `null`
if this | 270 * @param arguments the arguments to the constructor being invoked, or `null`
if this |
| 271 * annotation is not the invocation of a constructor | 271 * annotation is not the invocation of a constructor |
| 272 */ | 272 */ |
| 273 Annotation(Token atSign, Identifier name, Token period, SimpleIdentifier const
ructorName, ArgumentList arguments) { | 273 Annotation(this.atSign, Identifier name, this.period, SimpleIdentifier constru
ctorName, ArgumentList arguments) { |
| 274 this.atSign = atSign; | |
| 275 this._name = becomeParentOf(name); | 274 this._name = becomeParentOf(name); |
| 276 this.period = period; | |
| 277 this._constructorName = becomeParentOf(constructorName); | 275 this._constructorName = becomeParentOf(constructorName); |
| 278 this._arguments = becomeParentOf(arguments); | 276 this._arguments = becomeParentOf(arguments); |
| 279 } | 277 } |
| 280 | 278 |
| 281 @override | 279 @override |
| 282 accept(AstVisitor visitor) => visitor.visitAnnotation(this); | 280 accept(AstVisitor visitor) => visitor.visitAnnotation(this); |
| 283 | 281 |
| 284 /** | 282 /** |
| 285 * Return the arguments to the constructor being invoked, or `null` if this an
notation is | 283 * Return the arguments to the constructor being invoked, or `null` if this an
notation is |
| 286 * not the invocation of a constructor. | 284 * not the invocation of a constructor. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 * The identifier representing the argument being tested. | 395 * The identifier representing the argument being tested. |
| 398 */ | 396 */ |
| 399 SimpleIdentifier _identifier; | 397 SimpleIdentifier _identifier; |
| 400 | 398 |
| 401 /** | 399 /** |
| 402 * Initialize a newly created argument definition test. | 400 * Initialize a newly created argument definition test. |
| 403 * | 401 * |
| 404 * @param question the token representing the question mark | 402 * @param question the token representing the question mark |
| 405 * @param identifier the identifier representing the argument being tested | 403 * @param identifier the identifier representing the argument being tested |
| 406 */ | 404 */ |
| 407 ArgumentDefinitionTest(Token question, SimpleIdentifier identifier) { | 405 ArgumentDefinitionTest(this.question, SimpleIdentifier identifier) { |
| 408 this.question = question; | |
| 409 this._identifier = becomeParentOf(identifier); | 406 this._identifier = becomeParentOf(identifier); |
| 410 } | 407 } |
| 411 | 408 |
| 412 @override | 409 @override |
| 413 accept(AstVisitor visitor) => visitor.visitArgumentDefinitionTest(this); | 410 accept(AstVisitor visitor) => visitor.visitArgumentDefinitionTest(this); |
| 414 | 411 |
| 415 @override | 412 @override |
| 416 Token get beginToken => question; | 413 Token get beginToken => question; |
| 417 | 414 |
| 418 @override | 415 @override |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 | 765 |
| 769 /** | 766 /** |
| 770 * Initialize a newly created assert statement. | 767 * Initialize a newly created assert statement. |
| 771 * | 768 * |
| 772 * @param keyword the token representing the 'assert' keyword | 769 * @param keyword the token representing the 'assert' keyword |
| 773 * @param leftParenthesis the left parenthesis | 770 * @param leftParenthesis the left parenthesis |
| 774 * @param condition the condition that is being asserted to be `true` | 771 * @param condition the condition that is being asserted to be `true` |
| 775 * @param rightParenthesis the right parenthesis | 772 * @param rightParenthesis the right parenthesis |
| 776 * @param semicolon the semicolon terminating the statement | 773 * @param semicolon the semicolon terminating the statement |
| 777 */ | 774 */ |
| 778 AssertStatement(Token keyword, Token leftParenthesis, Expression condition, To
ken rightParenthesis, Token semicolon) { | 775 AssertStatement(this.keyword, this.leftParenthesis, Expression condition, this
.rightParenthesis, this.semicolon) { |
| 779 this.keyword = keyword; | |
| 780 this.leftParenthesis = leftParenthesis; | |
| 781 this._condition = becomeParentOf(condition); | 776 this._condition = becomeParentOf(condition); |
| 782 this.rightParenthesis = rightParenthesis; | |
| 783 this.semicolon = semicolon; | |
| 784 } | 777 } |
| 785 | 778 |
| 786 @override | 779 @override |
| 787 accept(AstVisitor visitor) => visitor.visitAssertStatement(this); | 780 accept(AstVisitor visitor) => visitor.visitAssertStatement(this); |
| 788 | 781 |
| 789 @override | 782 @override |
| 790 Token get beginToken => keyword; | 783 Token get beginToken => keyword; |
| 791 | 784 |
| 792 /** | 785 /** |
| 793 * Return the condition that is being asserted to be `true`. | 786 * Return the condition that is being asserted to be `true`. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 */ | 845 */ |
| 853 MethodElement _propagatedElement; | 846 MethodElement _propagatedElement; |
| 854 | 847 |
| 855 /** | 848 /** |
| 856 * Initialize a newly created assignment expression. | 849 * Initialize a newly created assignment expression. |
| 857 * | 850 * |
| 858 * @param leftHandSide the expression used to compute the left hand side | 851 * @param leftHandSide the expression used to compute the left hand side |
| 859 * @param operator the assignment operator being applied | 852 * @param operator the assignment operator being applied |
| 860 * @param rightHandSide the expression used to compute the right hand side | 853 * @param rightHandSide the expression used to compute the right hand side |
| 861 */ | 854 */ |
| 862 AssignmentExpression(Expression leftHandSide, Token operator, Expression right
HandSide) { | 855 AssignmentExpression(Expression leftHandSide, this.operator, Expression rightH
andSide) { |
| 863 this._leftHandSide = becomeParentOf(leftHandSide); | 856 this._leftHandSide = becomeParentOf(leftHandSide); |
| 864 this.operator = operator; | |
| 865 this._rightHandSide = becomeParentOf(rightHandSide); | 857 this._rightHandSide = becomeParentOf(rightHandSide); |
| 866 } | 858 } |
| 867 | 859 |
| 868 @override | 860 @override |
| 869 accept(AstVisitor visitor) => visitor.visitAssignmentExpression(this); | 861 accept(AstVisitor visitor) => visitor.visitAssignmentExpression(this); |
| 870 | 862 |
| 871 @override | 863 @override |
| 872 Token get beginToken => _leftHandSide.beginToken; | 864 Token get beginToken => _leftHandSide.beginToken; |
| 873 | 865 |
| 874 /** | 866 /** |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1499 */ | 1491 */ |
| 1500 MethodElement _propagatedElement; | 1492 MethodElement _propagatedElement; |
| 1501 | 1493 |
| 1502 /** | 1494 /** |
| 1503 * Initialize a newly created binary expression. | 1495 * Initialize a newly created binary expression. |
| 1504 * | 1496 * |
| 1505 * @param leftOperand the expression used to compute the left operand | 1497 * @param leftOperand the expression used to compute the left operand |
| 1506 * @param operator the binary operator being applied | 1498 * @param operator the binary operator being applied |
| 1507 * @param rightOperand the expression used to compute the right operand | 1499 * @param rightOperand the expression used to compute the right operand |
| 1508 */ | 1500 */ |
| 1509 BinaryExpression(Expression leftOperand, Token operator, Expression rightOpera
nd) { | 1501 BinaryExpression(Expression leftOperand, this.operator, Expression rightOperan
d) { |
| 1510 this._leftOperand = becomeParentOf(leftOperand); | 1502 this._leftOperand = becomeParentOf(leftOperand); |
| 1511 this.operator = operator; | |
| 1512 this._rightOperand = becomeParentOf(rightOperand); | 1503 this._rightOperand = becomeParentOf(rightOperand); |
| 1513 } | 1504 } |
| 1514 | 1505 |
| 1515 @override | 1506 @override |
| 1516 accept(AstVisitor visitor) => visitor.visitBinaryExpression(this); | 1507 accept(AstVisitor visitor) => visitor.visitBinaryExpression(this); |
| 1517 | 1508 |
| 1518 @override | 1509 @override |
| 1519 Token get beginToken => _leftOperand.beginToken; | 1510 Token get beginToken => _leftOperand.beginToken; |
| 1520 | 1511 |
| 1521 /** | 1512 /** |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1685 */ | 1676 */ |
| 1686 Token rightBracket; | 1677 Token rightBracket; |
| 1687 | 1678 |
| 1688 /** | 1679 /** |
| 1689 * Initialize a newly created block of code. | 1680 * Initialize a newly created block of code. |
| 1690 * | 1681 * |
| 1691 * @param leftBracket the left curly bracket | 1682 * @param leftBracket the left curly bracket |
| 1692 * @param statements the statements contained in the block | 1683 * @param statements the statements contained in the block |
| 1693 * @param rightBracket the right curly bracket | 1684 * @param rightBracket the right curly bracket |
| 1694 */ | 1685 */ |
| 1695 Block(Token leftBracket, List<Statement> statements, Token rightBracket) { | 1686 Block(this.leftBracket, List<Statement> statements, this.rightBracket) { |
| 1696 this._statements = new NodeList<Statement>(this); | 1687 this._statements = new NodeList<Statement>(this); |
| 1697 this.leftBracket = leftBracket; | |
| 1698 this._statements.addAll(statements); | 1688 this._statements.addAll(statements); |
| 1699 this.rightBracket = rightBracket; | |
| 1700 } | 1689 } |
| 1701 | 1690 |
| 1702 @override | 1691 @override |
| 1703 accept(AstVisitor visitor) => visitor.visitBlock(this); | 1692 accept(AstVisitor visitor) => visitor.visitBlock(this); |
| 1704 | 1693 |
| 1705 @override | 1694 @override |
| 1706 Token get beginToken => leftBracket; | 1695 Token get beginToken => leftBracket; |
| 1707 | 1696 |
| 1708 @override | 1697 @override |
| 1709 Token get endToken => rightBracket; | 1698 Token get endToken => rightBracket; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1794 * The value of the literal. | 1783 * The value of the literal. |
| 1795 */ | 1784 */ |
| 1796 bool value = false; | 1785 bool value = false; |
| 1797 | 1786 |
| 1798 /** | 1787 /** |
| 1799 * Initialize a newly created boolean literal. | 1788 * Initialize a newly created boolean literal. |
| 1800 * | 1789 * |
| 1801 * @param literal the token representing the literal | 1790 * @param literal the token representing the literal |
| 1802 * @param value the value of the literal | 1791 * @param value the value of the literal |
| 1803 */ | 1792 */ |
| 1804 BooleanLiteral(Token literal, bool value) { | 1793 BooleanLiteral(this.literal, this.value); |
| 1805 this.literal = literal; | |
| 1806 this.value = value; | |
| 1807 } | |
| 1808 | 1794 |
| 1809 @override | 1795 @override |
| 1810 accept(AstVisitor visitor) => visitor.visitBooleanLiteral(this); | 1796 accept(AstVisitor visitor) => visitor.visitBooleanLiteral(this); |
| 1811 | 1797 |
| 1812 @override | 1798 @override |
| 1813 Token get beginToken => literal; | 1799 Token get beginToken => literal; |
| 1814 | 1800 |
| 1815 @override | 1801 @override |
| 1816 Token get endToken => literal; | 1802 Token get endToken => literal; |
| 1817 | 1803 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1847 */ | 1833 */ |
| 1848 Token semicolon; | 1834 Token semicolon; |
| 1849 | 1835 |
| 1850 /** | 1836 /** |
| 1851 * Initialize a newly created break statement. | 1837 * Initialize a newly created break statement. |
| 1852 * | 1838 * |
| 1853 * @param keyword the token representing the 'break' keyword | 1839 * @param keyword the token representing the 'break' keyword |
| 1854 * @param label the label associated with the statement | 1840 * @param label the label associated with the statement |
| 1855 * @param semicolon the semicolon terminating the statement | 1841 * @param semicolon the semicolon terminating the statement |
| 1856 */ | 1842 */ |
| 1857 BreakStatement(Token keyword, SimpleIdentifier label, Token semicolon) { | 1843 BreakStatement(this.keyword, SimpleIdentifier label, this.semicolon) { |
| 1858 this.keyword = keyword; | |
| 1859 this._label = becomeParentOf(label); | 1844 this._label = becomeParentOf(label); |
| 1860 this.semicolon = semicolon; | |
| 1861 } | 1845 } |
| 1862 | 1846 |
| 1863 @override | 1847 @override |
| 1864 accept(AstVisitor visitor) => visitor.visitBreakStatement(this); | 1848 accept(AstVisitor visitor) => visitor.visitBreakStatement(this); |
| 1865 | 1849 |
| 1866 @override | 1850 @override |
| 1867 Token get beginToken => keyword; | 1851 Token get beginToken => keyword; |
| 1868 | 1852 |
| 1869 @override | 1853 @override |
| 1870 Token get endToken => semicolon; | 1854 Token get endToken => semicolon; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 * @param onKeyword the token representing the 'on' keyword | 2025 * @param onKeyword the token representing the 'on' keyword |
| 2042 * @param exceptionType the type of exceptions caught by this catch clause | 2026 * @param exceptionType the type of exceptions caught by this catch clause |
| 2043 * @param leftParenthesis the left parenthesis | 2027 * @param leftParenthesis the left parenthesis |
| 2044 * @param exceptionParameter the parameter whose value will be the exception t
hat was thrown | 2028 * @param exceptionParameter the parameter whose value will be the exception t
hat was thrown |
| 2045 * @param comma the comma separating the exception parameter from the stack tr
ace parameter | 2029 * @param comma the comma separating the exception parameter from the stack tr
ace parameter |
| 2046 * @param stackTraceParameter the parameter whose value will be the stack trac
e associated with | 2030 * @param stackTraceParameter the parameter whose value will be the stack trac
e associated with |
| 2047 * the exception | 2031 * the exception |
| 2048 * @param rightParenthesis the right parenthesis | 2032 * @param rightParenthesis the right parenthesis |
| 2049 * @param body the body of the catch block | 2033 * @param body the body of the catch block |
| 2050 */ | 2034 */ |
| 2051 CatchClause(Token onKeyword, TypeName exceptionType, Token catchKeyword, Token
leftParenthesis, SimpleIdentifier exceptionParameter, Token comma, SimpleIdenti
fier stackTraceParameter, Token rightParenthesis, Block body) { | 2035 CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword, Token l
eftParenthesis, SimpleIdentifier exceptionParameter, this.comma, SimpleIdentifie
r stackTraceParameter, Token rightParenthesis, Block body) { |
| 2052 this.onKeyword = onKeyword; | |
| 2053 this.exceptionType = becomeParentOf(exceptionType); | 2036 this.exceptionType = becomeParentOf(exceptionType); |
| 2054 this.catchKeyword = catchKeyword; | |
| 2055 this._leftParenthesis = leftParenthesis; | 2037 this._leftParenthesis = leftParenthesis; |
| 2056 this._exceptionParameter = becomeParentOf(exceptionParameter); | 2038 this._exceptionParameter = becomeParentOf(exceptionParameter); |
| 2057 this.comma = comma; | |
| 2058 this._stackTraceParameter = becomeParentOf(stackTraceParameter); | 2039 this._stackTraceParameter = becomeParentOf(stackTraceParameter); |
| 2059 this._rightParenthesis = rightParenthesis; | 2040 this._rightParenthesis = rightParenthesis; |
| 2060 this._body = becomeParentOf(body); | 2041 this._body = becomeParentOf(body); |
| 2061 } | 2042 } |
| 2062 | 2043 |
| 2063 @override | 2044 @override |
| 2064 accept(AstVisitor visitor) => visitor.visitCatchClause(this); | 2045 accept(AstVisitor visitor) => visitor.visitCatchClause(this); |
| 2065 | 2046 |
| 2066 @override | 2047 @override |
| 2067 Token get beginToken { | 2048 Token get beginToken { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2244 * @param classKeyword the token representing the 'class' keyword | 2225 * @param classKeyword the token representing the 'class' keyword |
| 2245 * @param name the name of the class being declared | 2226 * @param name the name of the class being declared |
| 2246 * @param typeParameters the type parameters for the class | 2227 * @param typeParameters the type parameters for the class |
| 2247 * @param extendsClause the extends clause for the class | 2228 * @param extendsClause the extends clause for the class |
| 2248 * @param withClause the with clause for the class | 2229 * @param withClause the with clause for the class |
| 2249 * @param implementsClause the implements clause for the class | 2230 * @param implementsClause the implements clause for the class |
| 2250 * @param leftBracket the left curly bracket | 2231 * @param leftBracket the left curly bracket |
| 2251 * @param members the members defined by the class | 2232 * @param members the members defined by the class |
| 2252 * @param rightBracket the right curly bracket | 2233 * @param rightBracket the right curly bracket |
| 2253 */ | 2234 */ |
| 2254 ClassDeclaration(Comment comment, List<Annotation> metadata, Token abstractKey
word, Token classKeyword, SimpleIdentifier name, TypeParameterList typeParameter
s, ExtendsClause extendsClause, WithClause withClause, ImplementsClause implemen
tsClause, Token leftBracket, List<ClassMember> members, Token rightBracket) : su
per(comment, metadata) { | 2235 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) { |
| 2255 this._members = new NodeList<ClassMember>(this); | 2236 this._members = new NodeList<ClassMember>(this); |
| 2256 this.abstractKeyword = abstractKeyword; | |
| 2257 this.classKeyword = classKeyword; | |
| 2258 this._name = becomeParentOf(name); | 2237 this._name = becomeParentOf(name); |
| 2259 this.typeParameters = becomeParentOf(typeParameters); | 2238 this.typeParameters = becomeParentOf(typeParameters); |
| 2260 this._extendsClause = becomeParentOf(extendsClause); | 2239 this._extendsClause = becomeParentOf(extendsClause); |
| 2261 this._withClause = becomeParentOf(withClause); | 2240 this._withClause = becomeParentOf(withClause); |
| 2262 this._implementsClause = becomeParentOf(implementsClause); | 2241 this._implementsClause = becomeParentOf(implementsClause); |
| 2263 this.leftBracket = leftBracket; | |
| 2264 this._members.addAll(members); | 2242 this._members.addAll(members); |
| 2265 this.rightBracket = rightBracket; | |
| 2266 } | 2243 } |
| 2267 | 2244 |
| 2268 @override | 2245 @override |
| 2269 accept(AstVisitor visitor) => visitor.visitClassDeclaration(this); | 2246 accept(AstVisitor visitor) => visitor.visitClassDeclaration(this); |
| 2270 | 2247 |
| 2271 /** | 2248 /** |
| 2272 * Return the constructor declared in the class with the given name. | 2249 * Return the constructor declared in the class with the given name. |
| 2273 * | 2250 * |
| 2274 * @param name the name of the constructor to find, `null` for default | 2251 * @param name the name of the constructor to find, `null` for default |
| 2275 * @return the found constructor or `null` if not found | 2252 * @return the found constructor or `null` if not found |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2502 * @param keyword the token representing the 'typedef' keyword | 2479 * @param keyword the token representing the 'typedef' keyword |
| 2503 * @param name the name of the class being declared | 2480 * @param name the name of the class being declared |
| 2504 * @param typeParameters the type parameters for the class | 2481 * @param typeParameters the type parameters for the class |
| 2505 * @param equals the token for the '=' separating the name from the definition | 2482 * @param equals the token for the '=' separating the name from the definition |
| 2506 * @param abstractKeyword the token for the 'abstract' keyword | 2483 * @param abstractKeyword the token for the 'abstract' keyword |
| 2507 * @param superclass the name of the superclass of the class being declared | 2484 * @param superclass the name of the superclass of the class being declared |
| 2508 * @param withClause the with clause for this class | 2485 * @param withClause the with clause for this class |
| 2509 * @param implementsClause the implements clause for this class | 2486 * @param implementsClause the implements clause for this class |
| 2510 * @param semicolon the semicolon terminating the declaration | 2487 * @param semicolon the semicolon terminating the declaration |
| 2511 */ | 2488 */ |
| 2512 ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, Simp
leIdentifier name, TypeParameterList typeParameters, Token equals, Token abstrac
tKeyword, TypeName superclass, WithClause withClause, ImplementsClause implement
sClause, Token semicolon) : super(comment, metadata, keyword, semicolon) { | 2489 ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, Simp
leIdentifier name, TypeParameterList typeParameters, this.equals, this.abstractK
eyword, TypeName superclass, WithClause withClause, ImplementsClause implementsC
lause, Token semicolon) : super(comment, metadata, keyword, semicolon) { |
| 2513 this._name = becomeParentOf(name); | 2490 this._name = becomeParentOf(name); |
| 2514 this._typeParameters = becomeParentOf(typeParameters); | 2491 this._typeParameters = becomeParentOf(typeParameters); |
| 2515 this.equals = equals; | |
| 2516 this.abstractKeyword = abstractKeyword; | |
| 2517 this._superclass = becomeParentOf(superclass); | 2492 this._superclass = becomeParentOf(superclass); |
| 2518 this._withClause = becomeParentOf(withClause); | 2493 this._withClause = becomeParentOf(withClause); |
| 2519 this._implementsClause = becomeParentOf(implementsClause); | 2494 this._implementsClause = becomeParentOf(implementsClause); |
| 2520 } | 2495 } |
| 2521 | 2496 |
| 2522 @override | 2497 @override |
| 2523 accept(AstVisitor visitor) => visitor.visitClassTypeAlias(this); | 2498 accept(AstVisitor visitor) => visitor.visitClassTypeAlias(this); |
| 2524 | 2499 |
| 2525 @override | 2500 @override |
| 2526 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme
nt) : null; | 2501 ClassElement get element => _name != null ? (_name.staticElement as ClassEleme
nt) : null; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2632 * The keyword specifying what kind of processing is to be done on the importe
d names. | 2607 * The keyword specifying what kind of processing is to be done on the importe
d names. |
| 2633 */ | 2608 */ |
| 2634 Token keyword; | 2609 Token keyword; |
| 2635 | 2610 |
| 2636 /** | 2611 /** |
| 2637 * Initialize a newly created import combinator. | 2612 * Initialize a newly created import combinator. |
| 2638 * | 2613 * |
| 2639 * @param keyword the keyword specifying what kind of processing is to be done
on the imported | 2614 * @param keyword the keyword specifying what kind of processing is to be done
on the imported |
| 2640 * names | 2615 * names |
| 2641 */ | 2616 */ |
| 2642 Combinator(Token keyword) { | 2617 Combinator(this.keyword); |
| 2643 this.keyword = keyword; | |
| 2644 } | |
| 2645 | 2618 |
| 2646 @override | 2619 @override |
| 2647 Token get beginToken => keyword; | 2620 Token get beginToken => keyword; |
| 2648 } | 2621 } |
| 2649 | 2622 |
| 2650 /** | 2623 /** |
| 2651 * Instances of the class `Comment` represent a comment within the source code. | 2624 * Instances of the class `Comment` represent a comment within the source code. |
| 2652 * | 2625 * |
| 2653 * <pre> | 2626 * <pre> |
| 2654 * comment ::= | 2627 * comment ::= |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2697 * Create an end-of-line comment. | 2670 * Create an end-of-line comment. |
| 2698 * | 2671 * |
| 2699 * @param tokens the tokens representing the comment | 2672 * @param tokens the tokens representing the comment |
| 2700 * @return the end-of-line comment that was created | 2673 * @return the end-of-line comment that was created |
| 2701 */ | 2674 */ |
| 2702 static Comment createEndOfLineComment(List<Token> tokens) => new Comment(token
s, CommentType.END_OF_LINE, null); | 2675 static Comment createEndOfLineComment(List<Token> tokens) => new Comment(token
s, CommentType.END_OF_LINE, null); |
| 2703 | 2676 |
| 2704 /** | 2677 /** |
| 2705 * The tokens representing the comment. | 2678 * The tokens representing the comment. |
| 2706 */ | 2679 */ |
| 2707 List<Token> tokens; | 2680 final List<Token> tokens; |
| 2708 | 2681 |
| 2709 /** | 2682 /** |
| 2710 * The type of the comment. | 2683 * The type of the comment. |
| 2711 */ | 2684 */ |
| 2712 CommentType _type; | 2685 final CommentType _type; |
| 2713 | 2686 |
| 2714 /** | 2687 /** |
| 2715 * The references embedded within the documentation comment. This list will be
empty unless this | 2688 * The references embedded within the documentation comment. This list will be
empty unless this |
| 2716 * is a documentation comment that has references embedded within it. | 2689 * is a documentation comment that has references embedded within it. |
| 2717 */ | 2690 */ |
| 2718 NodeList<CommentReference> _references; | 2691 NodeList<CommentReference> _references; |
| 2719 | 2692 |
| 2720 /** | 2693 /** |
| 2721 * Initialize a newly created comment. | 2694 * Initialize a newly created comment. |
| 2722 * | 2695 * |
| 2723 * @param tokens the tokens representing the comment | 2696 * @param tokens the tokens representing the comment |
| 2724 * @param type the type of the comment | 2697 * @param type the type of the comment |
| 2725 * @param references the references embedded within the documentation comment | 2698 * @param references the references embedded within the documentation comment |
| 2726 */ | 2699 */ |
| 2727 Comment(List<Token> tokens, CommentType type, List<CommentReference> reference
s) { | 2700 Comment(this.tokens, this._type, List<CommentReference> references) { |
| 2728 this._references = new NodeList<CommentReference>(this); | 2701 this._references = new NodeList<CommentReference>(this); |
| 2729 this.tokens = tokens; | |
| 2730 this._type = type; | |
| 2731 this._references.addAll(references); | 2702 this._references.addAll(references); |
| 2732 } | 2703 } |
| 2733 | 2704 |
| 2734 @override | 2705 @override |
| 2735 accept(AstVisitor visitor) => visitor.visitComment(this); | 2706 accept(AstVisitor visitor) => visitor.visitComment(this); |
| 2736 | 2707 |
| 2737 @override | 2708 @override |
| 2738 Token get beginToken => tokens[0]; | 2709 Token get beginToken => tokens[0]; |
| 2739 | 2710 |
| 2740 @override | 2711 @override |
| 2741 Token get endToken => tokens[tokens.length - 1]; | 2712 Token get endToken => tokens[tokens.length - 1]; |
| 2742 | 2713 |
| 2743 /** | 2714 /** |
| 2744 * Return the references embedded within the documentation comment. | 2715 * Return the references embedded within the documentation comment. |
| 2745 * | 2716 * |
| 2746 * @return the references embedded within the documentation comment | 2717 * @return the references embedded within the documentation comment |
| 2747 */ | 2718 */ |
| 2748 NodeList<CommentReference> get references => _references; | 2719 NodeList<CommentReference> get references => _references; |
| 2749 | 2720 |
| 2750 /** | 2721 /** |
| 2751 * Return `true` if this is a block comment. | 2722 * Return `true` if this is a block comment. |
| 2752 * | 2723 * |
| 2753 * @return `true` if this is a block comment | 2724 * @return `true` if this is a block comment |
| 2754 */ | 2725 */ |
| 2755 bool get isBlock => identical(_type, CommentType.BLOCK); | 2726 bool get isBlock => _type == CommentType.BLOCK; |
| 2756 | 2727 |
| 2757 /** | 2728 /** |
| 2758 * Return `true` if this is a documentation comment. | 2729 * Return `true` if this is a documentation comment. |
| 2759 * | 2730 * |
| 2760 * @return `true` if this is a documentation comment | 2731 * @return `true` if this is a documentation comment |
| 2761 */ | 2732 */ |
| 2762 bool get isDocumentation => identical(_type, CommentType.DOCUMENTATION); | 2733 bool get isDocumentation => _type == CommentType.DOCUMENTATION; |
| 2763 | 2734 |
| 2764 /** | 2735 /** |
| 2765 * Return `true` if this is an end-of-line comment. | 2736 * Return `true` if this is an end-of-line comment. |
| 2766 * | 2737 * |
| 2767 * @return `true` if this is an end-of-line comment | 2738 * @return `true` if this is an end-of-line comment |
| 2768 */ | 2739 */ |
| 2769 bool get isEndOfLine => identical(_type, CommentType.END_OF_LINE); | 2740 bool get isEndOfLine => _type == CommentType.END_OF_LINE; |
| 2770 | 2741 |
| 2771 @override | 2742 @override |
| 2772 void visitChildren(AstVisitor visitor) { | 2743 void visitChildren(AstVisitor visitor) { |
| 2773 _references.accept(visitor); | 2744 _references.accept(visitor); |
| 2774 } | 2745 } |
| 2775 } | 2746 } |
| 2776 | 2747 |
| 2777 /** | 2748 /** |
| 2778 * The enumeration `CommentType` encodes all the different types of comments tha
t are | 2749 * The enumeration `CommentType` encodes all the different types of comments tha
t are |
| 2779 * recognized by the parser. | 2750 * recognized by the parser. |
| 2780 */ | 2751 */ |
| 2781 class CommentType extends Enum<CommentType> { | 2752 class CommentType extends Enum<CommentType> { |
| 2782 /** | 2753 /** |
| 2783 * An end-of-line comment. | 2754 * An end-of-line comment. |
| 2784 */ | 2755 */ |
| 2785 static final CommentType END_OF_LINE = new CommentType('END_OF_LINE', 0); | 2756 static const CommentType END_OF_LINE = const CommentType('END_OF_LINE', 0); |
| 2786 | 2757 |
| 2787 /** | 2758 /** |
| 2788 * A block comment. | 2759 * A block comment. |
| 2789 */ | 2760 */ |
| 2790 static final CommentType BLOCK = new CommentType('BLOCK', 1); | 2761 static const CommentType BLOCK = const CommentType('BLOCK', 1); |
| 2791 | 2762 |
| 2792 /** | 2763 /** |
| 2793 * A documentation comment. | 2764 * A documentation comment. |
| 2794 */ | 2765 */ |
| 2795 static final CommentType DOCUMENTATION = new CommentType('DOCUMENTATION', 2); | 2766 static const CommentType DOCUMENTATION = const CommentType('DOCUMENTATION', 2)
; |
| 2796 | 2767 |
| 2797 static final List<CommentType> values = [END_OF_LINE, BLOCK, DOCUMENTATION]; | 2768 static const List<CommentType> values = const [END_OF_LINE, BLOCK, DOCUMENTATI
ON]; |
| 2798 | 2769 |
| 2799 CommentType(String name, int ordinal) : super(name, ordinal); | 2770 const CommentType(String name, int ordinal) : super(name, ordinal); |
| 2800 } | 2771 } |
| 2801 | 2772 |
| 2802 /** | 2773 /** |
| 2803 * Instances of the class `CommentReference` represent a reference to a Dart ele
ment that is | 2774 * Instances of the class `CommentReference` represent a reference to a Dart ele
ment that is |
| 2804 * found within a documentation comment. | 2775 * found within a documentation comment. |
| 2805 * | 2776 * |
| 2806 * <pre> | 2777 * <pre> |
| 2807 * commentReference ::= | 2778 * commentReference ::= |
| 2808 * '[' 'new'? [Identifier] ']' | 2779 * '[' 'new'? [Identifier] ']' |
| 2809 * </pre> | 2780 * </pre> |
| 2810 */ | 2781 */ |
| 2811 class CommentReference extends AstNode { | 2782 class CommentReference extends AstNode { |
| 2812 /** | 2783 /** |
| 2813 * The token representing the 'new' keyword, or `null` if there was no 'new' k
eyword. | 2784 * The token representing the 'new' keyword, or `null` if there was no 'new' k
eyword. |
| 2814 */ | 2785 */ |
| 2815 Token newKeyword; | 2786 Token newKeyword; |
| 2816 | 2787 |
| 2817 /** | 2788 /** |
| 2818 * The identifier being referenced. | 2789 * The identifier being referenced. |
| 2819 */ | 2790 */ |
| 2820 Identifier _identifier; | 2791 Identifier _identifier; |
| 2821 | 2792 |
| 2822 /** | 2793 /** |
| 2823 * Initialize a newly created reference to a Dart element. | 2794 * Initialize a newly created reference to a Dart element. |
| 2824 * | 2795 * |
| 2825 * @param newKeyword the token representing the 'new' keyword | 2796 * @param newKeyword the token representing the 'new' keyword |
| 2826 * @param identifier the identifier being referenced | 2797 * @param identifier the identifier being referenced |
| 2827 */ | 2798 */ |
| 2828 CommentReference(Token newKeyword, Identifier identifier) { | 2799 CommentReference(this.newKeyword, Identifier identifier) { |
| 2829 this.newKeyword = newKeyword; | |
| 2830 this._identifier = becomeParentOf(identifier); | 2800 this._identifier = becomeParentOf(identifier); |
| 2831 } | 2801 } |
| 2832 | 2802 |
| 2833 @override | 2803 @override |
| 2834 accept(AstVisitor visitor) => visitor.visitCommentReference(this); | 2804 accept(AstVisitor visitor) => visitor.visitCommentReference(this); |
| 2835 | 2805 |
| 2836 @override | 2806 @override |
| 2837 Token get beginToken => _identifier.beginToken; | 2807 Token get beginToken => _identifier.beginToken; |
| 2838 | 2808 |
| 2839 @override | 2809 @override |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2882 * | [ExportDirective] | 2852 * | [ExportDirective] |
| 2883 * | 2853 * |
| 2884 * declarations ::= | 2854 * declarations ::= |
| 2885 * [CompilationUnitMember]* | 2855 * [CompilationUnitMember]* |
| 2886 * </pre> | 2856 * </pre> |
| 2887 */ | 2857 */ |
| 2888 class CompilationUnit extends AstNode { | 2858 class CompilationUnit extends AstNode { |
| 2889 /** | 2859 /** |
| 2890 * The first token in the token stream that was parsed to form this compilatio
n unit. | 2860 * The first token in the token stream that was parsed to form this compilatio
n unit. |
| 2891 */ | 2861 */ |
| 2892 Token beginToken; | 2862 final Token beginToken; |
| 2893 | 2863 |
| 2894 /** | 2864 /** |
| 2895 * The script tag at the beginning of the compilation unit, or `null` if there
is no script | 2865 * The script tag at the beginning of the compilation unit, or `null` if there
is no script |
| 2896 * tag in this compilation unit. | 2866 * tag in this compilation unit. |
| 2897 */ | 2867 */ |
| 2898 ScriptTag _scriptTag; | 2868 ScriptTag _scriptTag; |
| 2899 | 2869 |
| 2900 /** | 2870 /** |
| 2901 * The directives contained in this compilation unit. | 2871 * The directives contained in this compilation unit. |
| 2902 */ | 2872 */ |
| 2903 NodeList<Directive> _directives; | 2873 NodeList<Directive> _directives; |
| 2904 | 2874 |
| 2905 /** | 2875 /** |
| 2906 * The declarations contained in this compilation unit. | 2876 * The declarations contained in this compilation unit. |
| 2907 */ | 2877 */ |
| 2908 NodeList<CompilationUnitMember> _declarations; | 2878 NodeList<CompilationUnitMember> _declarations; |
| 2909 | 2879 |
| 2910 /** | 2880 /** |
| 2911 * The last token in the token stream that was parsed to form this compilation
unit. This token | 2881 * The last token in the token stream that was parsed to form this compilation
unit. This token |
| 2912 * should always have a type of [TokenType.EOF]. | 2882 * should always have a type of [TokenType.EOF]. |
| 2913 */ | 2883 */ |
| 2914 Token endToken; | 2884 final Token endToken; |
| 2915 | 2885 |
| 2916 /** | 2886 /** |
| 2917 * The element associated with this compilation unit, or `null` if the AST str
ucture has not | 2887 * The element associated with this compilation unit, or `null` if the AST str
ucture has not |
| 2918 * been resolved. | 2888 * been resolved. |
| 2919 */ | 2889 */ |
| 2920 CompilationUnitElement element; | 2890 CompilationUnitElement element; |
| 2921 | 2891 |
| 2922 /** | 2892 /** |
| 2923 * The line information for this compilation unit. | 2893 * The line information for this compilation unit. |
| 2924 */ | 2894 */ |
| 2925 LineInfo lineInfo; | 2895 LineInfo lineInfo; |
| 2926 | 2896 |
| 2927 /** | 2897 /** |
| 2928 * Initialize a newly created compilation unit to have the given directives an
d declarations. | 2898 * Initialize a newly created compilation unit to have the given directives an
d declarations. |
| 2929 * | 2899 * |
| 2930 * @param beginToken the first token in the token stream | 2900 * @param beginToken the first token in the token stream |
| 2931 * @param scriptTag the script tag at the beginning of the compilation unit | 2901 * @param scriptTag the script tag at the beginning of the compilation unit |
| 2932 * @param directives the directives contained in this compilation unit | 2902 * @param directives the directives contained in this compilation unit |
| 2933 * @param declarations the declarations contained in this compilation unit | 2903 * @param declarations the declarations contained in this compilation unit |
| 2934 * @param endToken the last token in the token stream | 2904 * @param endToken the last token in the token stream |
| 2935 */ | 2905 */ |
| 2936 CompilationUnit(Token beginToken, ScriptTag scriptTag, List<Directive> directi
ves, List<CompilationUnitMember> declarations, Token endToken) { | 2906 CompilationUnit(this.beginToken, ScriptTag scriptTag, List<Directive> directiv
es, List<CompilationUnitMember> declarations, this.endToken) { |
| 2937 this._directives = new NodeList<Directive>(this); | 2907 this._directives = new NodeList<Directive>(this); |
| 2938 this._declarations = new NodeList<CompilationUnitMember>(this); | 2908 this._declarations = new NodeList<CompilationUnitMember>(this); |
| 2939 this.beginToken = beginToken; | |
| 2940 this._scriptTag = becomeParentOf(scriptTag); | 2909 this._scriptTag = becomeParentOf(scriptTag); |
| 2941 this._directives.addAll(directives); | 2910 this._directives.addAll(directives); |
| 2942 this._declarations.addAll(declarations); | 2911 this._declarations.addAll(declarations); |
| 2943 this.endToken = endToken; | |
| 2944 } | 2912 } |
| 2945 | 2913 |
| 2946 @override | 2914 @override |
| 2947 accept(AstVisitor visitor) => visitor.visitCompilationUnit(this); | 2915 accept(AstVisitor visitor) => visitor.visitCompilationUnit(this); |
| 2948 | 2916 |
| 2949 /** | 2917 /** |
| 2950 * Return the declarations contained in this compilation unit. | 2918 * Return the declarations contained in this compilation unit. |
| 2951 * | 2919 * |
| 2952 * @return the declarations contained in this compilation unit | 2920 * @return the declarations contained in this compilation unit |
| 2953 */ | 2921 */ |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3095 * Initialize a newly created conditional expression. | 3063 * Initialize a newly created conditional expression. |
| 3096 * | 3064 * |
| 3097 * @param condition the condition used to determine which expression is execut
ed next | 3065 * @param condition the condition used to determine which expression is execut
ed next |
| 3098 * @param question the token used to separate the condition from the then expr
ession | 3066 * @param question the token used to separate the condition from the then expr
ession |
| 3099 * @param thenExpression the expression that is executed if the condition eval
uates to | 3067 * @param thenExpression the expression that is executed if the condition eval
uates to |
| 3100 * `true` | 3068 * `true` |
| 3101 * @param colon the token used to separate the then expression from the else e
xpression | 3069 * @param colon the token used to separate the then expression from the else e
xpression |
| 3102 * @param elseExpression the expression that is executed if the condition eval
uates to | 3070 * @param elseExpression the expression that is executed if the condition eval
uates to |
| 3103 * `false` | 3071 * `false` |
| 3104 */ | 3072 */ |
| 3105 ConditionalExpression(Expression condition, Token question, Expression thenExp
ression, Token colon, Expression elseExpression) { | 3073 ConditionalExpression(Expression condition, this.question, Expression thenExpr
ession, this.colon, Expression elseExpression) { |
| 3106 this._condition = becomeParentOf(condition); | 3074 this._condition = becomeParentOf(condition); |
| 3107 this.question = question; | |
| 3108 this._thenExpression = becomeParentOf(thenExpression); | 3075 this._thenExpression = becomeParentOf(thenExpression); |
| 3109 this.colon = colon; | |
| 3110 this._elseExpression = becomeParentOf(elseExpression); | 3076 this._elseExpression = becomeParentOf(elseExpression); |
| 3111 } | 3077 } |
| 3112 | 3078 |
| 3113 @override | 3079 @override |
| 3114 accept(AstVisitor visitor) => visitor.visitConditionalExpression(this); | 3080 accept(AstVisitor visitor) => visitor.visitConditionalExpression(this); |
| 3115 | 3081 |
| 3116 @override | 3082 @override |
| 3117 Token get beginToken => _condition.beginToken; | 3083 Token get beginToken => _condition.beginToken; |
| 3118 | 3084 |
| 3119 /** | 3085 /** |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3283 * @param returnType the return type of the constructor | 3249 * @param returnType the return type of the constructor |
| 3284 * @param period the token for the period before the constructor name | 3250 * @param period the token for the period before the constructor name |
| 3285 * @param name the name of the constructor | 3251 * @param name the name of the constructor |
| 3286 * @param parameters the parameters associated with the constructor | 3252 * @param parameters the parameters associated with the constructor |
| 3287 * @param separator the token for the colon or equals before the initializers | 3253 * @param separator the token for the colon or equals before the initializers |
| 3288 * @param initializers the initializers associated with the constructor | 3254 * @param initializers the initializers associated with the constructor |
| 3289 * @param redirectedConstructor the name of the constructor to which this cons
tructor will be | 3255 * @param redirectedConstructor the name of the constructor to which this cons
tructor will be |
| 3290 * redirected | 3256 * redirected |
| 3291 * @param body the body of the constructor | 3257 * @param body the body of the constructor |
| 3292 */ | 3258 */ |
| 3293 ConstructorDeclaration(Comment comment, List<Annotation> metadata, Token exter
nalKeyword, Token constKeyword, Token factoryKeyword, Identifier returnType, Tok
en period, SimpleIdentifier name, FormalParameterList parameters, Token separato
r, List<ConstructorInitializer> initializers, ConstructorName redirectedConstruc
tor, FunctionBody body) : super(comment, metadata) { | 3259 ConstructorDeclaration(Comment comment, List<Annotation> metadata, this.extern
alKeyword, this.constKeyword, this.factoryKeyword, Identifier returnType, this.p
eriod, SimpleIdentifier name, FormalParameterList parameters, this.separator, Li
st<ConstructorInitializer> initializers, ConstructorName redirectedConstructor,
FunctionBody body) : super(comment, metadata) { |
| 3294 this._initializers = new NodeList<ConstructorInitializer>(this); | 3260 this._initializers = new NodeList<ConstructorInitializer>(this); |
| 3295 this.externalKeyword = externalKeyword; | |
| 3296 this.constKeyword = constKeyword; | |
| 3297 this.factoryKeyword = factoryKeyword; | |
| 3298 this._returnType = becomeParentOf(returnType); | 3261 this._returnType = becomeParentOf(returnType); |
| 3299 this.period = period; | |
| 3300 this._name = becomeParentOf(name); | 3262 this._name = becomeParentOf(name); |
| 3301 this._parameters = becomeParentOf(parameters); | 3263 this._parameters = becomeParentOf(parameters); |
| 3302 this.separator = separator; | |
| 3303 this._initializers.addAll(initializers); | 3264 this._initializers.addAll(initializers); |
| 3304 this._redirectedConstructor = becomeParentOf(redirectedConstructor); | 3265 this._redirectedConstructor = becomeParentOf(redirectedConstructor); |
| 3305 this._body = becomeParentOf(body); | 3266 this._body = becomeParentOf(body); |
| 3306 } | 3267 } |
| 3307 | 3268 |
| 3308 @override | 3269 @override |
| 3309 accept(AstVisitor visitor) => visitor.visitConstructorDeclaration(this); | 3270 accept(AstVisitor visitor) => visitor.visitConstructorDeclaration(this); |
| 3310 | 3271 |
| 3311 /** | 3272 /** |
| 3312 * Return the body of the constructor, or `null` if the constructor does not h
ave a body. | 3273 * Return the body of the constructor, or `null` if the constructor does not h
ave a body. |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3489 /** | 3450 /** |
| 3490 * Initialize a newly created field initializer to initialize the field with t
he given name to the | 3451 * Initialize a newly created field initializer to initialize the field with t
he given name to the |
| 3491 * value of the given expression. | 3452 * value of the given expression. |
| 3492 * | 3453 * |
| 3493 * @param keyword the token for the 'this' keyword | 3454 * @param keyword the token for the 'this' keyword |
| 3494 * @param period the token for the period after the 'this' keyword | 3455 * @param period the token for the period after the 'this' keyword |
| 3495 * @param fieldName the name of the field being initialized | 3456 * @param fieldName the name of the field being initialized |
| 3496 * @param equals the token for the equal sign between the field name and the e
xpression | 3457 * @param equals the token for the equal sign between the field name and the e
xpression |
| 3497 * @param expression the expression computing the value to which the field wil
l be initialized | 3458 * @param expression the expression computing the value to which the field wil
l be initialized |
| 3498 */ | 3459 */ |
| 3499 ConstructorFieldInitializer(Token keyword, Token period, SimpleIdentifier fiel
dName, Token equals, Expression expression) { | 3460 ConstructorFieldInitializer(this.keyword, this.period, SimpleIdentifier fieldN
ame, this.equals, Expression expression) { |
| 3500 this.keyword = keyword; | |
| 3501 this.period = period; | |
| 3502 this._fieldName = becomeParentOf(fieldName); | 3461 this._fieldName = becomeParentOf(fieldName); |
| 3503 this.equals = equals; | |
| 3504 this._expression = becomeParentOf(expression); | 3462 this._expression = becomeParentOf(expression); |
| 3505 } | 3463 } |
| 3506 | 3464 |
| 3507 @override | 3465 @override |
| 3508 accept(AstVisitor visitor) => visitor.visitConstructorFieldInitializer(this); | 3466 accept(AstVisitor visitor) => visitor.visitConstructorFieldInitializer(this); |
| 3509 | 3467 |
| 3510 @override | 3468 @override |
| 3511 Token get beginToken { | 3469 Token get beginToken { |
| 3512 if (keyword != null) { | 3470 if (keyword != null) { |
| 3513 return keyword; | 3471 return keyword; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3604 */ | 3562 */ |
| 3605 ConstructorElement _staticElement; | 3563 ConstructorElement _staticElement; |
| 3606 | 3564 |
| 3607 /** | 3565 /** |
| 3608 * Initialize a newly created constructor name. | 3566 * Initialize a newly created constructor name. |
| 3609 * | 3567 * |
| 3610 * @param type the name of the type defining the constructor | 3568 * @param type the name of the type defining the constructor |
| 3611 * @param period the token for the period before the constructor name | 3569 * @param period the token for the period before the constructor name |
| 3612 * @param name the name of the constructor | 3570 * @param name the name of the constructor |
| 3613 */ | 3571 */ |
| 3614 ConstructorName(TypeName type, Token period, SimpleIdentifier name) { | 3572 ConstructorName(TypeName type, this.period, SimpleIdentifier name) { |
| 3615 this._type = becomeParentOf(type); | 3573 this._type = becomeParentOf(type); |
| 3616 this.period = period; | |
| 3617 this._name = becomeParentOf(name); | 3574 this._name = becomeParentOf(name); |
| 3618 } | 3575 } |
| 3619 | 3576 |
| 3620 @override | 3577 @override |
| 3621 accept(AstVisitor visitor) => visitor.visitConstructorName(this); | 3578 accept(AstVisitor visitor) => visitor.visitConstructorName(this); |
| 3622 | 3579 |
| 3623 @override | 3580 @override |
| 3624 Token get beginToken => _type.beginToken; | 3581 Token get beginToken => _type.beginToken; |
| 3625 | 3582 |
| 3626 @override | 3583 @override |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3714 */ | 3671 */ |
| 3715 Token semicolon; | 3672 Token semicolon; |
| 3716 | 3673 |
| 3717 /** | 3674 /** |
| 3718 * Initialize a newly created continue statement. | 3675 * Initialize a newly created continue statement. |
| 3719 * | 3676 * |
| 3720 * @param keyword the token representing the 'continue' keyword | 3677 * @param keyword the token representing the 'continue' keyword |
| 3721 * @param label the label associated with the statement | 3678 * @param label the label associated with the statement |
| 3722 * @param semicolon the semicolon terminating the statement | 3679 * @param semicolon the semicolon terminating the statement |
| 3723 */ | 3680 */ |
| 3724 ContinueStatement(Token keyword, SimpleIdentifier label, Token semicolon) { | 3681 ContinueStatement(this.keyword, SimpleIdentifier label, this.semicolon) { |
| 3725 this.keyword = keyword; | |
| 3726 this._label = becomeParentOf(label); | 3682 this._label = becomeParentOf(label); |
| 3727 this.semicolon = semicolon; | |
| 3728 } | 3683 } |
| 3729 | 3684 |
| 3730 @override | 3685 @override |
| 3731 accept(AstVisitor visitor) => visitor.visitContinueStatement(this); | 3686 accept(AstVisitor visitor) => visitor.visitContinueStatement(this); |
| 3732 | 3687 |
| 3733 @override | 3688 @override |
| 3734 Token get beginToken => keyword; | 3689 Token get beginToken => keyword; |
| 3735 | 3690 |
| 3736 @override | 3691 @override |
| 3737 Token get endToken => semicolon; | 3692 Token get endToken => semicolon; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3809 | 3764 |
| 3810 /** | 3765 /** |
| 3811 * Initialize a newly created formal parameter. | 3766 * Initialize a newly created formal parameter. |
| 3812 * | 3767 * |
| 3813 * @param comment the documentation comment associated with this parameter | 3768 * @param comment the documentation comment associated with this parameter |
| 3814 * @param metadata the annotations associated with this parameter | 3769 * @param metadata the annotations associated with this parameter |
| 3815 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword | 3770 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword |
| 3816 * @param type the name of the declared type of the parameter | 3771 * @param type the name of the declared type of the parameter |
| 3817 * @param identifier the name of the parameter being declared | 3772 * @param identifier the name of the parameter being declared |
| 3818 */ | 3773 */ |
| 3819 DeclaredIdentifier(Comment comment, List<Annotation> metadata, Token keyword,
TypeName type, SimpleIdentifier identifier) : super(comment, metadata) { | 3774 DeclaredIdentifier(Comment comment, List<Annotation> metadata, this.keyword, T
ypeName type, SimpleIdentifier identifier) : super(comment, metadata) { |
| 3820 this.keyword = keyword; | |
| 3821 this._type = becomeParentOf(type); | 3775 this._type = becomeParentOf(type); |
| 3822 this._identifier = becomeParentOf(identifier); | 3776 this._identifier = becomeParentOf(identifier); |
| 3823 } | 3777 } |
| 3824 | 3778 |
| 3825 @override | 3779 @override |
| 3826 accept(AstVisitor visitor) => visitor.visitDeclaredIdentifier(this); | 3780 accept(AstVisitor visitor) => visitor.visitDeclaredIdentifier(this); |
| 3827 | 3781 |
| 3828 @override | 3782 @override |
| 3829 LocalVariableElement get element { | 3783 LocalVariableElement get element { |
| 3830 SimpleIdentifier identifier = this.identifier; | 3784 SimpleIdentifier identifier = this.identifier; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3850 * | 3804 * |
| 3851 * @return the name of the declared type of the parameter | 3805 * @return the name of the declared type of the parameter |
| 3852 */ | 3806 */ |
| 3853 TypeName get type => _type; | 3807 TypeName get type => _type; |
| 3854 | 3808 |
| 3855 /** | 3809 /** |
| 3856 * Return `true` if this variable was declared with the 'const' modifier. | 3810 * Return `true` if this variable was declared with the 'const' modifier. |
| 3857 * | 3811 * |
| 3858 * @return `true` if this variable was declared with the 'const' modifier | 3812 * @return `true` if this variable was declared with the 'const' modifier |
| 3859 */ | 3813 */ |
| 3860 bool get isConst => (keyword is KeywordToken) && identical((keyword as Keyword
Token).keyword, Keyword.CONST); | 3814 bool get isConst => (keyword is KeywordToken) && (keyword as KeywordToken).key
word == Keyword.CONST; |
| 3861 | 3815 |
| 3862 /** | 3816 /** |
| 3863 * Return `true` if this variable was declared with the 'final' modifier. Vari
ables that are | 3817 * Return `true` if this variable was declared with the 'final' modifier. Vari
ables that are |
| 3864 * declared with the 'const' modifier will return `false` even though they are
implicitly | 3818 * declared with the 'const' modifier will return `false` even though they are
implicitly |
| 3865 * final. | 3819 * final. |
| 3866 * | 3820 * |
| 3867 * @return `true` if this variable was declared with the 'final' modifier | 3821 * @return `true` if this variable was declared with the 'final' modifier |
| 3868 */ | 3822 */ |
| 3869 bool get isFinal => (keyword is KeywordToken) && identical((keyword as Keyword
Token).keyword, Keyword.FINAL); | 3823 bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).key
word == Keyword.FINAL; |
| 3870 | 3824 |
| 3871 /** | 3825 /** |
| 3872 * Set the name of the declared type of the parameter to the given type name. | 3826 * Set the name of the declared type of the parameter to the given type name. |
| 3873 * | 3827 * |
| 3874 * @param typeName the name of the declared type of the parameter | 3828 * @param typeName the name of the declared type of the parameter |
| 3875 */ | 3829 */ |
| 3876 void set type(TypeName typeName) { | 3830 void set type(TypeName typeName) { |
| 3877 _type = becomeParentOf(typeName); | 3831 _type = becomeParentOf(typeName); |
| 3878 } | 3832 } |
| 3879 | 3833 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3932 Expression _defaultValue; | 3886 Expression _defaultValue; |
| 3933 | 3887 |
| 3934 /** | 3888 /** |
| 3935 * Initialize a newly created default formal parameter. | 3889 * Initialize a newly created default formal parameter. |
| 3936 * | 3890 * |
| 3937 * @param parameter the formal parameter with which the default value is assoc
iated | 3891 * @param parameter the formal parameter with which the default value is assoc
iated |
| 3938 * @param kind the kind of this parameter | 3892 * @param kind the kind of this parameter |
| 3939 * @param separator the token separating the parameter from the default value | 3893 * @param separator the token separating the parameter from the default value |
| 3940 * @param defaultValue the expression computing the default value for the para
meter | 3894 * @param defaultValue the expression computing the default value for the para
meter |
| 3941 */ | 3895 */ |
| 3942 DefaultFormalParameter(NormalFormalParameter parameter, ParameterKind kind, To
ken separator, Expression defaultValue) { | 3896 DefaultFormalParameter(NormalFormalParameter parameter, this.kind, this.separa
tor, Expression defaultValue) { |
| 3943 this._parameter = becomeParentOf(parameter); | 3897 this._parameter = becomeParentOf(parameter); |
| 3944 this.kind = kind; | |
| 3945 this.separator = separator; | |
| 3946 this._defaultValue = becomeParentOf(defaultValue); | 3898 this._defaultValue = becomeParentOf(defaultValue); |
| 3947 } | 3899 } |
| 3948 | 3900 |
| 3949 @override | 3901 @override |
| 3950 accept(AstVisitor visitor) => visitor.visitDefaultFormalParameter(this); | 3902 accept(AstVisitor visitor) => visitor.visitDefaultFormalParameter(this); |
| 3951 | 3903 |
| 3952 @override | 3904 @override |
| 3953 Token get beginToken => _parameter.beginToken; | 3905 Token get beginToken => _parameter.beginToken; |
| 3954 | 3906 |
| 3955 /** | 3907 /** |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4112 * Initialize a newly created do loop. | 4064 * Initialize a newly created do loop. |
| 4113 * | 4065 * |
| 4114 * @param doKeyword the token representing the 'do' keyword | 4066 * @param doKeyword the token representing the 'do' keyword |
| 4115 * @param body the body of the loop | 4067 * @param body the body of the loop |
| 4116 * @param whileKeyword the token representing the 'while' keyword | 4068 * @param whileKeyword the token representing the 'while' keyword |
| 4117 * @param leftParenthesis the left parenthesis | 4069 * @param leftParenthesis the left parenthesis |
| 4118 * @param condition the condition that determines when the loop will terminate | 4070 * @param condition the condition that determines when the loop will terminate |
| 4119 * @param rightParenthesis the right parenthesis | 4071 * @param rightParenthesis the right parenthesis |
| 4120 * @param semicolon the semicolon terminating the statement | 4072 * @param semicolon the semicolon terminating the statement |
| 4121 */ | 4073 */ |
| 4122 DoStatement(Token doKeyword, Statement body, Token whileKeyword, Token leftPar
enthesis, Expression condition, Token rightParenthesis, Token semicolon) { | 4074 DoStatement(this.doKeyword, Statement body, this.whileKeyword, Token leftParen
thesis, Expression condition, Token rightParenthesis, this.semicolon) { |
| 4123 this.doKeyword = doKeyword; | |
| 4124 this._body = becomeParentOf(body); | 4075 this._body = becomeParentOf(body); |
| 4125 this.whileKeyword = whileKeyword; | |
| 4126 this._leftParenthesis = leftParenthesis; | 4076 this._leftParenthesis = leftParenthesis; |
| 4127 this._condition = becomeParentOf(condition); | 4077 this._condition = becomeParentOf(condition); |
| 4128 this._rightParenthesis = rightParenthesis; | 4078 this._rightParenthesis = rightParenthesis; |
| 4129 this.semicolon = semicolon; | |
| 4130 } | 4079 } |
| 4131 | 4080 |
| 4132 @override | 4081 @override |
| 4133 accept(AstVisitor visitor) => visitor.visitDoStatement(this); | 4082 accept(AstVisitor visitor) => visitor.visitDoStatement(this); |
| 4134 | 4083 |
| 4135 @override | 4084 @override |
| 4136 Token get beginToken => doKeyword; | 4085 Token get beginToken => doKeyword; |
| 4137 | 4086 |
| 4138 /** | 4087 /** |
| 4139 * Return the body of the loop. | 4088 * Return the body of the loop. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4231 * The value of the literal. | 4180 * The value of the literal. |
| 4232 */ | 4181 */ |
| 4233 double value = 0.0; | 4182 double value = 0.0; |
| 4234 | 4183 |
| 4235 /** | 4184 /** |
| 4236 * Initialize a newly created floating point literal. | 4185 * Initialize a newly created floating point literal. |
| 4237 * | 4186 * |
| 4238 * @param literal the token representing the literal | 4187 * @param literal the token representing the literal |
| 4239 * @param value the value of the literal | 4188 * @param value the value of the literal |
| 4240 */ | 4189 */ |
| 4241 DoubleLiteral(Token literal, double value) { | 4190 DoubleLiteral(this.literal, this.value); |
| 4242 this.literal = literal; | |
| 4243 this.value = value; | |
| 4244 } | |
| 4245 | 4191 |
| 4246 @override | 4192 @override |
| 4247 accept(AstVisitor visitor) => visitor.visitDoubleLiteral(this); | 4193 accept(AstVisitor visitor) => visitor.visitDoubleLiteral(this); |
| 4248 | 4194 |
| 4249 @override | 4195 @override |
| 4250 Token get beginToken => literal; | 4196 Token get beginToken => literal; |
| 4251 | 4197 |
| 4252 @override | 4198 @override |
| 4253 Token get endToken => literal; | 4199 Token get endToken => literal; |
| 4254 | 4200 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 4270 /** | 4216 /** |
| 4271 * The token representing the semicolon that marks the end of the function bod
y. | 4217 * The token representing the semicolon that marks the end of the function bod
y. |
| 4272 */ | 4218 */ |
| 4273 Token semicolon; | 4219 Token semicolon; |
| 4274 | 4220 |
| 4275 /** | 4221 /** |
| 4276 * Initialize a newly created function body. | 4222 * Initialize a newly created function body. |
| 4277 * | 4223 * |
| 4278 * @param semicolon the token representing the semicolon that marks the end of
the function body | 4224 * @param semicolon the token representing the semicolon that marks the end of
the function body |
| 4279 */ | 4225 */ |
| 4280 EmptyFunctionBody(Token semicolon) { | 4226 EmptyFunctionBody(this.semicolon); |
| 4281 this.semicolon = semicolon; | |
| 4282 } | |
| 4283 | 4227 |
| 4284 @override | 4228 @override |
| 4285 accept(AstVisitor visitor) => visitor.visitEmptyFunctionBody(this); | 4229 accept(AstVisitor visitor) => visitor.visitEmptyFunctionBody(this); |
| 4286 | 4230 |
| 4287 @override | 4231 @override |
| 4288 Token get beginToken => semicolon; | 4232 Token get beginToken => semicolon; |
| 4289 | 4233 |
| 4290 @override | 4234 @override |
| 4291 Token get endToken => semicolon; | 4235 Token get endToken => semicolon; |
| 4292 | 4236 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 4307 /** | 4251 /** |
| 4308 * The semicolon terminating the statement. | 4252 * The semicolon terminating the statement. |
| 4309 */ | 4253 */ |
| 4310 Token semicolon; | 4254 Token semicolon; |
| 4311 | 4255 |
| 4312 /** | 4256 /** |
| 4313 * Initialize a newly created empty statement. | 4257 * Initialize a newly created empty statement. |
| 4314 * | 4258 * |
| 4315 * @param semicolon the semicolon terminating the statement | 4259 * @param semicolon the semicolon terminating the statement |
| 4316 */ | 4260 */ |
| 4317 EmptyStatement(Token semicolon) { | 4261 EmptyStatement(this.semicolon); |
| 4318 this.semicolon = semicolon; | |
| 4319 } | |
| 4320 | 4262 |
| 4321 @override | 4263 @override |
| 4322 accept(AstVisitor visitor) => visitor.visitEmptyStatement(this); | 4264 accept(AstVisitor visitor) => visitor.visitEmptyStatement(this); |
| 4323 | 4265 |
| 4324 @override | 4266 @override |
| 4325 Token get beginToken => semicolon; | 4267 Token get beginToken => semicolon; |
| 4326 | 4268 |
| 4327 @override | 4269 @override |
| 4328 Token get endToken => semicolon; | 4270 Token get endToken => semicolon; |
| 4329 | 4271 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4567 Token semicolon; | 4509 Token semicolon; |
| 4568 | 4510 |
| 4569 /** | 4511 /** |
| 4570 * Initialize a newly created function body consisting of a block of statement
s. | 4512 * Initialize a newly created function body consisting of a block of statement
s. |
| 4571 * | 4513 * |
| 4572 * @param functionDefinition the token introducing the expression that represe
nts the body of the | 4514 * @param functionDefinition the token introducing the expression that represe
nts the body of the |
| 4573 * function | 4515 * function |
| 4574 * @param expression the expression representing the body of the function | 4516 * @param expression the expression representing the body of the function |
| 4575 * @param semicolon the semicolon terminating the statement | 4517 * @param semicolon the semicolon terminating the statement |
| 4576 */ | 4518 */ |
| 4577 ExpressionFunctionBody(Token functionDefinition, Expression expression, Token
semicolon) { | 4519 ExpressionFunctionBody(this.functionDefinition, Expression expression, this.se
micolon) { |
| 4578 this.functionDefinition = functionDefinition; | |
| 4579 this._expression = becomeParentOf(expression); | 4520 this._expression = becomeParentOf(expression); |
| 4580 this.semicolon = semicolon; | |
| 4581 } | 4521 } |
| 4582 | 4522 |
| 4583 @override | 4523 @override |
| 4584 accept(AstVisitor visitor) => visitor.visitExpressionFunctionBody(this); | 4524 accept(AstVisitor visitor) => visitor.visitExpressionFunctionBody(this); |
| 4585 | 4525 |
| 4586 @override | 4526 @override |
| 4587 Token get beginToken => functionDefinition; | 4527 Token get beginToken => functionDefinition; |
| 4588 | 4528 |
| 4589 @override | 4529 @override |
| 4590 Token get endToken { | 4530 Token get endToken { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4635 * expression and therefore isn't followed by a semicolon. | 4575 * expression and therefore isn't followed by a semicolon. |
| 4636 */ | 4576 */ |
| 4637 Token semicolon; | 4577 Token semicolon; |
| 4638 | 4578 |
| 4639 /** | 4579 /** |
| 4640 * Initialize a newly created expression statement. | 4580 * Initialize a newly created expression statement. |
| 4641 * | 4581 * |
| 4642 * @param expression the expression that comprises the statement | 4582 * @param expression the expression that comprises the statement |
| 4643 * @param semicolon the semicolon terminating the statement | 4583 * @param semicolon the semicolon terminating the statement |
| 4644 */ | 4584 */ |
| 4645 ExpressionStatement(Expression expression, Token semicolon) { | 4585 ExpressionStatement(Expression expression, this.semicolon) { |
| 4646 this._expression = becomeParentOf(expression); | 4586 this._expression = becomeParentOf(expression); |
| 4647 this.semicolon = semicolon; | |
| 4648 } | 4587 } |
| 4649 | 4588 |
| 4650 @override | 4589 @override |
| 4651 accept(AstVisitor visitor) => visitor.visitExpressionStatement(this); | 4590 accept(AstVisitor visitor) => visitor.visitExpressionStatement(this); |
| 4652 | 4591 |
| 4653 @override | 4592 @override |
| 4654 Token get beginToken => _expression.beginToken; | 4593 Token get beginToken => _expression.beginToken; |
| 4655 | 4594 |
| 4656 @override | 4595 @override |
| 4657 Token get endToken { | 4596 Token get endToken { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4705 * The name of the class that is being extended. | 4644 * The name of the class that is being extended. |
| 4706 */ | 4645 */ |
| 4707 TypeName _superclass; | 4646 TypeName _superclass; |
| 4708 | 4647 |
| 4709 /** | 4648 /** |
| 4710 * Initialize a newly created extends clause. | 4649 * Initialize a newly created extends clause. |
| 4711 * | 4650 * |
| 4712 * @param keyword the token representing the 'extends' keyword | 4651 * @param keyword the token representing the 'extends' keyword |
| 4713 * @param superclass the name of the class that is being extended | 4652 * @param superclass the name of the class that is being extended |
| 4714 */ | 4653 */ |
| 4715 ExtendsClause(Token keyword, TypeName superclass) { | 4654 ExtendsClause(this.keyword, TypeName superclass) { |
| 4716 this.keyword = keyword; | |
| 4717 this._superclass = becomeParentOf(superclass); | 4655 this._superclass = becomeParentOf(superclass); |
| 4718 } | 4656 } |
| 4719 | 4657 |
| 4720 @override | 4658 @override |
| 4721 accept(AstVisitor visitor) => visitor.visitExtendsClause(this); | 4659 accept(AstVisitor visitor) => visitor.visitExtendsClause(this); |
| 4722 | 4660 |
| 4723 @override | 4661 @override |
| 4724 Token get beginToken => keyword; | 4662 Token get beginToken => keyword; |
| 4725 | 4663 |
| 4726 @override | 4664 @override |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4775 | 4713 |
| 4776 /** | 4714 /** |
| 4777 * Initialize a newly created field declaration. | 4715 * Initialize a newly created field declaration. |
| 4778 * | 4716 * |
| 4779 * @param comment the documentation comment associated with this field | 4717 * @param comment the documentation comment associated with this field |
| 4780 * @param metadata the annotations associated with this field | 4718 * @param metadata the annotations associated with this field |
| 4781 * @param staticKeyword the token representing the 'static' keyword | 4719 * @param staticKeyword the token representing the 'static' keyword |
| 4782 * @param fieldList the fields being declared | 4720 * @param fieldList the fields being declared |
| 4783 * @param semicolon the semicolon terminating the declaration | 4721 * @param semicolon the semicolon terminating the declaration |
| 4784 */ | 4722 */ |
| 4785 FieldDeclaration(Comment comment, List<Annotation> metadata, Token staticKeywo
rd, VariableDeclarationList fieldList, Token semicolon) : super(comment, metadat
a) { | 4723 FieldDeclaration(Comment comment, List<Annotation> metadata, this.staticKeywor
d, VariableDeclarationList fieldList, this.semicolon) : super(comment, metadata)
{ |
| 4786 this.staticKeyword = staticKeyword; | |
| 4787 this._fieldList = becomeParentOf(fieldList); | 4724 this._fieldList = becomeParentOf(fieldList); |
| 4788 this.semicolon = semicolon; | |
| 4789 } | 4725 } |
| 4790 | 4726 |
| 4791 @override | 4727 @override |
| 4792 accept(AstVisitor visitor) => visitor.visitFieldDeclaration(this); | 4728 accept(AstVisitor visitor) => visitor.visitFieldDeclaration(this); |
| 4793 | 4729 |
| 4794 @override | 4730 @override |
| 4795 Element get element => null; | 4731 Element get element => null; |
| 4796 | 4732 |
| 4797 @override | 4733 @override |
| 4798 Token get endToken => semicolon; | 4734 Token get endToken => semicolon; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4878 * @param comment the documentation comment associated with this parameter | 4814 * @param comment the documentation comment associated with this parameter |
| 4879 * @param metadata the annotations associated with this parameter | 4815 * @param metadata the annotations associated with this parameter |
| 4880 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword | 4816 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword |
| 4881 * @param type the name of the declared type of the parameter | 4817 * @param type the name of the declared type of the parameter |
| 4882 * @param thisToken the token representing the 'this' keyword | 4818 * @param thisToken the token representing the 'this' keyword |
| 4883 * @param period the token representing the period | 4819 * @param period the token representing the period |
| 4884 * @param identifier the name of the parameter being declared | 4820 * @param identifier the name of the parameter being declared |
| 4885 * @param parameters the parameters of the function-typed parameter, or `null`
if this is | 4821 * @param parameters the parameters of the function-typed parameter, or `null`
if this is |
| 4886 * not a function-typed field formal parameter | 4822 * not a function-typed field formal parameter |
| 4887 */ | 4823 */ |
| 4888 FieldFormalParameter(Comment comment, List<Annotation> metadata, Token keyword
, TypeName type, Token thisToken, Token period, SimpleIdentifier identifier, For
malParameterList parameters) : super(comment, metadata, identifier) { | 4824 FieldFormalParameter(Comment comment, List<Annotation> metadata, this.keyword,
TypeName type, this.thisToken, this.period, SimpleIdentifier identifier, Formal
ParameterList parameters) : super(comment, metadata, identifier) { |
| 4889 this.keyword = keyword; | |
| 4890 this._type = becomeParentOf(type); | 4825 this._type = becomeParentOf(type); |
| 4891 this.thisToken = thisToken; | |
| 4892 this.period = period; | |
| 4893 this._parameters = becomeParentOf(parameters); | 4826 this._parameters = becomeParentOf(parameters); |
| 4894 } | 4827 } |
| 4895 | 4828 |
| 4896 @override | 4829 @override |
| 4897 accept(AstVisitor visitor) => visitor.visitFieldFormalParameter(this); | 4830 accept(AstVisitor visitor) => visitor.visitFieldFormalParameter(this); |
| 4898 | 4831 |
| 4899 @override | 4832 @override |
| 4900 Token get beginToken { | 4833 Token get beginToken { |
| 4901 if (keyword != null) { | 4834 if (keyword != null) { |
| 4902 return keyword; | 4835 return keyword; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 4920 /** | 4853 /** |
| 4921 * Return the name of the declared type of the parameter, or `null` if the par
ameter does | 4854 * Return the name of the declared type of the parameter, or `null` if the par
ameter does |
| 4922 * not have a declared type. Note that if this is a function-typed field forma
l parameter this is | 4855 * not have a declared type. Note that if this is a function-typed field forma
l parameter this is |
| 4923 * the return type of the function. | 4856 * the return type of the function. |
| 4924 * | 4857 * |
| 4925 * @return the name of the declared type of the parameter | 4858 * @return the name of the declared type of the parameter |
| 4926 */ | 4859 */ |
| 4927 TypeName get type => _type; | 4860 TypeName get type => _type; |
| 4928 | 4861 |
| 4929 @override | 4862 @override |
| 4930 bool get isConst => (keyword is KeywordToken) && identical((keyword as Keyword
Token).keyword, Keyword.CONST); | 4863 bool get isConst => (keyword is KeywordToken) && (keyword as KeywordToken).key
word == Keyword.CONST; |
| 4931 | 4864 |
| 4932 @override | 4865 @override |
| 4933 bool get isFinal => (keyword is KeywordToken) && identical((keyword as Keyword
Token).keyword, Keyword.FINAL); | 4866 bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).key
word == Keyword.FINAL; |
| 4934 | 4867 |
| 4935 /** | 4868 /** |
| 4936 * Set the parameters of the function-typed parameter to the given parameters. | 4869 * Set the parameters of the function-typed parameter to the given parameters. |
| 4937 * | 4870 * |
| 4938 * @param parameters the parameters of the function-typed parameter | 4871 * @param parameters the parameters of the function-typed parameter |
| 4939 */ | 4872 */ |
| 4940 void set parameters(FormalParameterList parameters) { | 4873 void set parameters(FormalParameterList parameters) { |
| 4941 this._parameters = becomeParentOf(parameters); | 4874 this._parameters = becomeParentOf(parameters); |
| 4942 } | 4875 } |
| 4943 | 4876 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5013 /** | 4946 /** |
| 5014 * Initialize a newly created for-each statement. | 4947 * Initialize a newly created for-each statement. |
| 5015 * | 4948 * |
| 5016 * @param forKeyword the token representing the 'for' keyword | 4949 * @param forKeyword the token representing the 'for' keyword |
| 5017 * @param leftParenthesis the left parenthesis | 4950 * @param leftParenthesis the left parenthesis |
| 5018 * @param loopVariable the declaration of the loop variable | 4951 * @param loopVariable the declaration of the loop variable |
| 5019 * @param iterator the expression evaluated to produce the iterator | 4952 * @param iterator the expression evaluated to produce the iterator |
| 5020 * @param rightParenthesis the right parenthesis | 4953 * @param rightParenthesis the right parenthesis |
| 5021 * @param body the body of the loop | 4954 * @param body the body of the loop |
| 5022 */ | 4955 */ |
| 5023 ForEachStatement.con1(Token forKeyword, Token leftParenthesis, DeclaredIdentif
ier loopVariable, Token inKeyword, Expression iterator, Token rightParenthesis,
Statement body) { | 4956 ForEachStatement.con1(this.forKeyword, this.leftParenthesis, DeclaredIdentifie
r loopVariable, this.inKeyword, Expression iterator, this.rightParenthesis, Stat
ement body) { |
| 5024 this.forKeyword = forKeyword; | |
| 5025 this.leftParenthesis = leftParenthesis; | |
| 5026 this._loopVariable = becomeParentOf(loopVariable); | 4957 this._loopVariable = becomeParentOf(loopVariable); |
| 5027 this.inKeyword = inKeyword; | |
| 5028 this._iterator = becomeParentOf(iterator); | 4958 this._iterator = becomeParentOf(iterator); |
| 5029 this.rightParenthesis = rightParenthesis; | |
| 5030 this._body = becomeParentOf(body); | 4959 this._body = becomeParentOf(body); |
| 5031 } | 4960 } |
| 5032 | 4961 |
| 5033 /** | 4962 /** |
| 5034 * Initialize a newly created for-each statement. | 4963 * Initialize a newly created for-each statement. |
| 5035 * | 4964 * |
| 5036 * @param forKeyword the token representing the 'for' keyword | 4965 * @param forKeyword the token representing the 'for' keyword |
| 5037 * @param leftParenthesis the left parenthesis | 4966 * @param leftParenthesis the left parenthesis |
| 5038 * @param identifier the loop variable | 4967 * @param identifier the loop variable |
| 5039 * @param iterator the expression evaluated to produce the iterator | 4968 * @param iterator the expression evaluated to produce the iterator |
| 5040 * @param rightParenthesis the right parenthesis | 4969 * @param rightParenthesis the right parenthesis |
| 5041 * @param body the body of the loop | 4970 * @param body the body of the loop |
| 5042 */ | 4971 */ |
| 5043 ForEachStatement.con2(Token forKeyword, Token leftParenthesis, SimpleIdentifie
r identifier, Token inKeyword, Expression iterator, Token rightParenthesis, Stat
ement body) { | 4972 ForEachStatement.con2(this.forKeyword, this.leftParenthesis, SimpleIdentifier
identifier, this.inKeyword, Expression iterator, this.rightParenthesis, Statemen
t body) { |
| 5044 this.forKeyword = forKeyword; | |
| 5045 this.leftParenthesis = leftParenthesis; | |
| 5046 this._identifier = becomeParentOf(identifier); | 4973 this._identifier = becomeParentOf(identifier); |
| 5047 this.inKeyword = inKeyword; | |
| 5048 this._iterator = becomeParentOf(iterator); | 4974 this._iterator = becomeParentOf(iterator); |
| 5049 this.rightParenthesis = rightParenthesis; | |
| 5050 this._body = becomeParentOf(body); | 4975 this._body = becomeParentOf(body); |
| 5051 } | 4976 } |
| 5052 | 4977 |
| 5053 @override | 4978 @override |
| 5054 accept(AstVisitor visitor) => visitor.visitForEachStatement(this); | 4979 accept(AstVisitor visitor) => visitor.visitForEachStatement(this); |
| 5055 | 4980 |
| 5056 @override | 4981 @override |
| 5057 Token get beginToken => forKeyword; | 4982 Token get beginToken => forKeyword; |
| 5058 | 4983 |
| 5059 /** | 4984 /** |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5211 * @param leftParenthesis the left parenthesis | 5136 * @param leftParenthesis the left parenthesis |
| 5212 * @param variableList the declaration of the loop variables | 5137 * @param variableList the declaration of the loop variables |
| 5213 * @param initialization the initialization expression | 5138 * @param initialization the initialization expression |
| 5214 * @param leftSeparator the semicolon separating the initializer and the condi
tion | 5139 * @param leftSeparator the semicolon separating the initializer and the condi
tion |
| 5215 * @param condition the condition used to determine when to terminate the loop | 5140 * @param condition the condition used to determine when to terminate the loop |
| 5216 * @param rightSeparator the semicolon separating the condition and the update
r | 5141 * @param rightSeparator the semicolon separating the condition and the update
r |
| 5217 * @param updaters the list of expressions run after each execution of the loo
p body | 5142 * @param updaters the list of expressions run after each execution of the loo
p body |
| 5218 * @param rightParenthesis the right parenthesis | 5143 * @param rightParenthesis the right parenthesis |
| 5219 * @param body the body of the loop | 5144 * @param body the body of the loop |
| 5220 */ | 5145 */ |
| 5221 ForStatement(Token forKeyword, Token leftParenthesis, VariableDeclarationList
variableList, Expression initialization, Token leftSeparator, Expression conditi
on, Token rightSeparator, List<Expression> updaters, Token rightParenthesis, Sta
tement body) { | 5146 ForStatement(this.forKeyword, this.leftParenthesis, VariableDeclarationList va
riableList, Expression initialization, this.leftSeparator, Expression condition,
this.rightSeparator, List<Expression> updaters, this.rightParenthesis, Statemen
t body) { |
| 5222 this._updaters = new NodeList<Expression>(this); | 5147 this._updaters = new NodeList<Expression>(this); |
| 5223 this.forKeyword = forKeyword; | |
| 5224 this.leftParenthesis = leftParenthesis; | |
| 5225 this._variableList = becomeParentOf(variableList); | 5148 this._variableList = becomeParentOf(variableList); |
| 5226 this._initialization = becomeParentOf(initialization); | 5149 this._initialization = becomeParentOf(initialization); |
| 5227 this.leftSeparator = leftSeparator; | |
| 5228 this._condition = becomeParentOf(condition); | 5150 this._condition = becomeParentOf(condition); |
| 5229 this.rightSeparator = rightSeparator; | |
| 5230 this._updaters.addAll(updaters); | 5151 this._updaters.addAll(updaters); |
| 5231 this.rightParenthesis = rightParenthesis; | |
| 5232 this._body = becomeParentOf(body); | 5152 this._body = becomeParentOf(body); |
| 5233 } | 5153 } |
| 5234 | 5154 |
| 5235 @override | 5155 @override |
| 5236 accept(AstVisitor visitor) => visitor.visitForStatement(this); | 5156 accept(AstVisitor visitor) => visitor.visitForStatement(this); |
| 5237 | 5157 |
| 5238 @override | 5158 @override |
| 5239 Token get beginToken => forKeyword; | 5159 Token get beginToken => forKeyword; |
| 5240 | 5160 |
| 5241 /** | 5161 /** |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5620 * Initialize a newly created function declaration. | 5540 * Initialize a newly created function declaration. |
| 5621 * | 5541 * |
| 5622 * @param comment the documentation comment associated with this function | 5542 * @param comment the documentation comment associated with this function |
| 5623 * @param metadata the annotations associated with this function | 5543 * @param metadata the annotations associated with this function |
| 5624 * @param externalKeyword the token representing the 'external' keyword | 5544 * @param externalKeyword the token representing the 'external' keyword |
| 5625 * @param returnType the return type of the function | 5545 * @param returnType the return type of the function |
| 5626 * @param propertyKeyword the token representing the 'get' or 'set' keyword | 5546 * @param propertyKeyword the token representing the 'get' or 'set' keyword |
| 5627 * @param name the name of the function | 5547 * @param name the name of the function |
| 5628 * @param functionExpression the function expression being wrapped | 5548 * @param functionExpression the function expression being wrapped |
| 5629 */ | 5549 */ |
| 5630 FunctionDeclaration(Comment comment, List<Annotation> metadata, Token external
Keyword, TypeName returnType, Token propertyKeyword, SimpleIdentifier name, Func
tionExpression functionExpression) : super(comment, metadata) { | 5550 FunctionDeclaration(Comment comment, List<Annotation> metadata, this.externalK
eyword, TypeName returnType, this.propertyKeyword, SimpleIdentifier name, Functi
onExpression functionExpression) : super(comment, metadata) { |
| 5631 this.externalKeyword = externalKeyword; | |
| 5632 this._returnType = becomeParentOf(returnType); | 5551 this._returnType = becomeParentOf(returnType); |
| 5633 this.propertyKeyword = propertyKeyword; | |
| 5634 this._name = becomeParentOf(name); | 5552 this._name = becomeParentOf(name); |
| 5635 this._functionExpression = becomeParentOf(functionExpression); | 5553 this._functionExpression = becomeParentOf(functionExpression); |
| 5636 } | 5554 } |
| 5637 | 5555 |
| 5638 @override | 5556 @override |
| 5639 accept(AstVisitor visitor) => visitor.visitFunctionDeclaration(this); | 5557 accept(AstVisitor visitor) => visitor.visitFunctionDeclaration(this); |
| 5640 | 5558 |
| 5641 @override | 5559 @override |
| 5642 ExecutableElement get element => _name != null ? (_name.staticElement as Execu
tableElement) : null; | 5560 ExecutableElement get element => _name != null ? (_name.staticElement as Execu
tableElement) : null; |
| 5643 | 5561 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 5663 * | 5581 * |
| 5664 * @return the return type of the function | 5582 * @return the return type of the function |
| 5665 */ | 5583 */ |
| 5666 TypeName get returnType => _returnType; | 5584 TypeName get returnType => _returnType; |
| 5667 | 5585 |
| 5668 /** | 5586 /** |
| 5669 * Return `true` if this function declares a getter. | 5587 * Return `true` if this function declares a getter. |
| 5670 * | 5588 * |
| 5671 * @return `true` if this function declares a getter | 5589 * @return `true` if this function declares a getter |
| 5672 */ | 5590 */ |
| 5673 bool get isGetter => propertyKeyword != null && identical((propertyKeyword as
KeywordToken).keyword, Keyword.GET); | 5591 bool get isGetter => propertyKeyword != null && (propertyKeyword as KeywordTok
en).keyword == Keyword.GET; |
| 5674 | 5592 |
| 5675 /** | 5593 /** |
| 5676 * Return `true` if this function declares a setter. | 5594 * Return `true` if this function declares a setter. |
| 5677 * | 5595 * |
| 5678 * @return `true` if this function declares a setter | 5596 * @return `true` if this function declares a setter |
| 5679 */ | 5597 */ |
| 5680 bool get isSetter => propertyKeyword != null && identical((propertyKeyword as
KeywordToken).keyword, Keyword.SET); | 5598 bool get isSetter => propertyKeyword != null && (propertyKeyword as KeywordTok
en).keyword == Keyword.SET; |
| 5681 | 5599 |
| 5682 /** | 5600 /** |
| 5683 * Set the function expression being wrapped to the given function expression. | 5601 * Set the function expression being wrapped to the given function expression. |
| 5684 * | 5602 * |
| 5685 * @param functionExpression the function expression being wrapped | 5603 * @param functionExpression the function expression being wrapped |
| 5686 */ | 5604 */ |
| 5687 void set functionExpression(FunctionExpression functionExpression) { | 5605 void set functionExpression(FunctionExpression functionExpression) { |
| 5688 functionExpression = becomeParentOf(functionExpression); | 5606 functionExpression = becomeParentOf(functionExpression); |
| 5689 } | 5607 } |
| 5690 | 5608 |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6405 * Initialize a newly created if statement. | 6323 * Initialize a newly created if statement. |
| 6406 * | 6324 * |
| 6407 * @param ifKeyword the token representing the 'if' keyword | 6325 * @param ifKeyword the token representing the 'if' keyword |
| 6408 * @param leftParenthesis the left parenthesis | 6326 * @param leftParenthesis the left parenthesis |
| 6409 * @param condition the condition used to determine which of the statements is
executed next | 6327 * @param condition the condition used to determine which of the statements is
executed next |
| 6410 * @param rightParenthesis the right parenthesis | 6328 * @param rightParenthesis the right parenthesis |
| 6411 * @param thenStatement the statement that is executed if the condition evalua
tes to `true` | 6329 * @param thenStatement the statement that is executed if the condition evalua
tes to `true` |
| 6412 * @param elseKeyword the token representing the 'else' keyword | 6330 * @param elseKeyword the token representing the 'else' keyword |
| 6413 * @param elseStatement the statement that is executed if the condition evalua
tes to `false` | 6331 * @param elseStatement the statement that is executed if the condition evalua
tes to `false` |
| 6414 */ | 6332 */ |
| 6415 IfStatement(Token ifKeyword, Token leftParenthesis, Expression condition, Toke
n rightParenthesis, Statement thenStatement, Token elseKeyword, Statement elseSt
atement) { | 6333 IfStatement(this.ifKeyword, this.leftParenthesis, Expression condition, this.r
ightParenthesis, Statement thenStatement, this.elseKeyword, Statement elseStatem
ent) { |
| 6416 this.ifKeyword = ifKeyword; | |
| 6417 this.leftParenthesis = leftParenthesis; | |
| 6418 this._condition = becomeParentOf(condition); | 6334 this._condition = becomeParentOf(condition); |
| 6419 this.rightParenthesis = rightParenthesis; | |
| 6420 this._thenStatement = becomeParentOf(thenStatement); | 6335 this._thenStatement = becomeParentOf(thenStatement); |
| 6421 this.elseKeyword = elseKeyword; | |
| 6422 this._elseStatement = becomeParentOf(elseStatement); | 6336 this._elseStatement = becomeParentOf(elseStatement); |
| 6423 } | 6337 } |
| 6424 | 6338 |
| 6425 @override | 6339 @override |
| 6426 accept(AstVisitor visitor) => visitor.visitIfStatement(this); | 6340 accept(AstVisitor visitor) => visitor.visitIfStatement(this); |
| 6427 | 6341 |
| 6428 @override | 6342 @override |
| 6429 Token get beginToken => ifKeyword; | 6343 Token get beginToken => ifKeyword; |
| 6430 | 6344 |
| 6431 /** | 6345 /** |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6515 * The interfaces that are being implemented. | 6429 * The interfaces that are being implemented. |
| 6516 */ | 6430 */ |
| 6517 NodeList<TypeName> _interfaces; | 6431 NodeList<TypeName> _interfaces; |
| 6518 | 6432 |
| 6519 /** | 6433 /** |
| 6520 * Initialize a newly created implements clause. | 6434 * Initialize a newly created implements clause. |
| 6521 * | 6435 * |
| 6522 * @param keyword the token representing the 'implements' keyword | 6436 * @param keyword the token representing the 'implements' keyword |
| 6523 * @param interfaces the interfaces that are being implemented | 6437 * @param interfaces the interfaces that are being implemented |
| 6524 */ | 6438 */ |
| 6525 ImplementsClause(Token keyword, List<TypeName> interfaces) { | 6439 ImplementsClause(this.keyword, List<TypeName> interfaces) { |
| 6526 this._interfaces = new NodeList<TypeName>(this); | 6440 this._interfaces = new NodeList<TypeName>(this); |
| 6527 this.keyword = keyword; | |
| 6528 this._interfaces.addAll(interfaces); | 6441 this._interfaces.addAll(interfaces); |
| 6529 } | 6442 } |
| 6530 | 6443 |
| 6531 @override | 6444 @override |
| 6532 accept(AstVisitor visitor) => visitor.visitImplementsClause(this); | 6445 accept(AstVisitor visitor) => visitor.visitImplementsClause(this); |
| 6533 | 6446 |
| 6534 @override | 6447 @override |
| 6535 Token get beginToken => keyword; | 6448 Token get beginToken => keyword; |
| 6536 | 6449 |
| 6537 @override | 6450 @override |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6666 * | 6579 * |
| 6667 * @param comment the documentation comment associated with this directive | 6580 * @param comment the documentation comment associated with this directive |
| 6668 * @param metadata the annotations associated with the directive | 6581 * @param metadata the annotations associated with the directive |
| 6669 * @param keyword the token representing the 'import' keyword | 6582 * @param keyword the token representing the 'import' keyword |
| 6670 * @param libraryUri the URI of the library being imported | 6583 * @param libraryUri the URI of the library being imported |
| 6671 * @param asToken the token representing the 'as' token | 6584 * @param asToken the token representing the 'as' token |
| 6672 * @param prefix the prefix to be used with the imported names | 6585 * @param prefix the prefix to be used with the imported names |
| 6673 * @param combinators the combinators used to control how names are imported | 6586 * @param combinators the combinators used to control how names are imported |
| 6674 * @param semicolon the semicolon terminating the directive | 6587 * @param semicolon the semicolon terminating the directive |
| 6675 */ | 6588 */ |
| 6676 ImportDirective(Comment comment, List<Annotation> metadata, Token keyword, Str
ingLiteral libraryUri, Token asToken, SimpleIdentifier prefix, List<Combinator>
combinators, Token semicolon) : super(comment, metadata, keyword, libraryUri, co
mbinators, semicolon) { | 6589 ImportDirective(Comment comment, List<Annotation> metadata, Token keyword, Str
ingLiteral libraryUri, this.asToken, SimpleIdentifier prefix, List<Combinator> c
ombinators, Token semicolon) : super(comment, metadata, keyword, libraryUri, com
binators, semicolon) { |
| 6677 this.asToken = asToken; | |
| 6678 this._prefix = becomeParentOf(prefix); | 6590 this._prefix = becomeParentOf(prefix); |
| 6679 } | 6591 } |
| 6680 | 6592 |
| 6681 @override | 6593 @override |
| 6682 accept(AstVisitor visitor) => visitor.visitImportDirective(this); | 6594 accept(AstVisitor visitor) => visitor.visitImportDirective(this); |
| 6683 | 6595 |
| 6684 @override | 6596 @override |
| 6685 ImportElement get element => super.element as ImportElement; | 6597 ImportElement get element => super.element as ImportElement; |
| 6686 | 6598 |
| 6687 /** | 6599 /** |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6791 } | 6703 } |
| 6792 | 6704 |
| 6793 /** | 6705 /** |
| 6794 * Initialize a newly created index expression. | 6706 * Initialize a newly created index expression. |
| 6795 * | 6707 * |
| 6796 * @param period the period ("..") before a cascaded index expression | 6708 * @param period the period ("..") before a cascaded index expression |
| 6797 * @param leftBracket the left square bracket | 6709 * @param leftBracket the left square bracket |
| 6798 * @param index the expression used to compute the index | 6710 * @param index the expression used to compute the index |
| 6799 * @param rightBracket the right square bracket | 6711 * @param rightBracket the right square bracket |
| 6800 */ | 6712 */ |
| 6801 IndexExpression.forCascade(Token period, Token leftBracket, Expression index,
Token rightBracket) { | 6713 IndexExpression.forCascade(this.period, Token leftBracket, Expression index, T
oken rightBracket) { |
| 6802 this.period = period; | |
| 6803 this._leftBracket = leftBracket; | 6714 this._leftBracket = leftBracket; |
| 6804 this._index = becomeParentOf(index); | 6715 this._index = becomeParentOf(index); |
| 6805 this._rightBracket = rightBracket; | 6716 this._rightBracket = rightBracket; |
| 6806 } | 6717 } |
| 6807 | 6718 |
| 6808 @override | 6719 @override |
| 6809 accept(AstVisitor visitor) => visitor.visitIndexExpression(this); | 6720 accept(AstVisitor visitor) => visitor.visitIndexExpression(this); |
| 6810 | 6721 |
| 6811 @override | 6722 @override |
| 6812 Token get beginToken { | 6723 Token get beginToken { |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6917 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar
e | 6828 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar
e |
| 6918 * they mutually exclusive. In other words, it is possible for both methods to
return `true` | 6829 * they mutually exclusive. In other words, it is possible for both methods to
return `true` |
| 6919 * when invoked on the same node. | 6830 * when invoked on the same node. |
| 6920 * | 6831 * |
| 6921 * @return `true` if this expression is in a context where the operator '[]' w
ill be invoked | 6832 * @return `true` if this expression is in a context where the operator '[]' w
ill be invoked |
| 6922 */ | 6833 */ |
| 6923 bool inGetterContext() { | 6834 bool inGetterContext() { |
| 6924 AstNode parent = this.parent; | 6835 AstNode parent = this.parent; |
| 6925 if (parent is AssignmentExpression) { | 6836 if (parent is AssignmentExpression) { |
| 6926 AssignmentExpression assignment = parent; | 6837 AssignmentExpression assignment = parent; |
| 6927 if (identical(assignment.leftHandSide, this) && identical(assignment.opera
tor.type, TokenType.EQ)) { | 6838 if (identical(assignment.leftHandSide, this) && assignment.operator.type =
= TokenType.EQ) { |
| 6928 return false; | 6839 return false; |
| 6929 } | 6840 } |
| 6930 } | 6841 } |
| 6931 return true; | 6842 return true; |
| 6932 } | 6843 } |
| 6933 | 6844 |
| 6934 /** | 6845 /** |
| 6935 * Return `true` if this expression is computing a left-hand value. | 6846 * Return `true` if this expression is computing a left-hand value. |
| 6936 * | 6847 * |
| 6937 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar
e | 6848 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar
e |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7101 */ | 7012 */ |
| 7102 ConstructorElement staticElement; | 7013 ConstructorElement staticElement; |
| 7103 | 7014 |
| 7104 /** | 7015 /** |
| 7105 * Initialize a newly created instance creation expression. | 7016 * Initialize a newly created instance creation expression. |
| 7106 * | 7017 * |
| 7107 * @param keyword the keyword used to indicate how an object should be created | 7018 * @param keyword the keyword used to indicate how an object should be created |
| 7108 * @param constructorName the name of the constructor to be invoked | 7019 * @param constructorName the name of the constructor to be invoked |
| 7109 * @param argumentList the list of arguments to the constructor | 7020 * @param argumentList the list of arguments to the constructor |
| 7110 */ | 7021 */ |
| 7111 InstanceCreationExpression(Token keyword, ConstructorName constructorName, Arg
umentList argumentList) { | 7022 InstanceCreationExpression(this.keyword, ConstructorName constructorName, Argu
mentList argumentList) { |
| 7112 this.keyword = keyword; | |
| 7113 this.constructorName = becomeParentOf(constructorName); | 7023 this.constructorName = becomeParentOf(constructorName); |
| 7114 this._argumentList = becomeParentOf(argumentList); | 7024 this._argumentList = becomeParentOf(argumentList); |
| 7115 } | 7025 } |
| 7116 | 7026 |
| 7117 @override | 7027 @override |
| 7118 accept(AstVisitor visitor) => visitor.visitInstanceCreationExpression(this); | 7028 accept(AstVisitor visitor) => visitor.visitInstanceCreationExpression(this); |
| 7119 | 7029 |
| 7120 /** | 7030 /** |
| 7121 * Return the list of arguments to the constructor. | 7031 * Return the list of arguments to the constructor. |
| 7122 * | 7032 * |
| 7123 * @return the list of arguments to the constructor | 7033 * @return the list of arguments to the constructor |
| 7124 */ | 7034 */ |
| 7125 ArgumentList get argumentList => _argumentList; | 7035 ArgumentList get argumentList => _argumentList; |
| 7126 | 7036 |
| 7127 @override | 7037 @override |
| 7128 Token get beginToken => keyword; | 7038 Token get beginToken => keyword; |
| 7129 | 7039 |
| 7130 @override | 7040 @override |
| 7131 Token get endToken => _argumentList.endToken; | 7041 Token get endToken => _argumentList.endToken; |
| 7132 | 7042 |
| 7133 @override | 7043 @override |
| 7134 int get precedence => 15; | 7044 int get precedence => 15; |
| 7135 | 7045 |
| 7136 /** | 7046 /** |
| 7137 * Return `true` if this creation expression is used to invoke a constant cons
tructor. | 7047 * Return `true` if this creation expression is used to invoke a constant cons
tructor. |
| 7138 * | 7048 * |
| 7139 * @return `true` if this creation expression is used to invoke a constant con
structor | 7049 * @return `true` if this creation expression is used to invoke a constant con
structor |
| 7140 */ | 7050 */ |
| 7141 bool get isConst => keyword is KeywordToken && identical((keyword as KeywordTo
ken).keyword, Keyword.CONST); | 7051 bool get isConst => keyword is KeywordToken && (keyword as KeywordToken).keywo
rd == Keyword.CONST; |
| 7142 | 7052 |
| 7143 /** | 7053 /** |
| 7144 * Set the list of arguments to the constructor to the given list. | 7054 * Set the list of arguments to the constructor to the given list. |
| 7145 * | 7055 * |
| 7146 * @param argumentList the list of arguments to the constructor | 7056 * @param argumentList the list of arguments to the constructor |
| 7147 */ | 7057 */ |
| 7148 void set argumentList(ArgumentList argumentList) { | 7058 void set argumentList(ArgumentList argumentList) { |
| 7149 this._argumentList = becomeParentOf(argumentList); | 7059 this._argumentList = becomeParentOf(argumentList); |
| 7150 } | 7060 } |
| 7151 | 7061 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 7182 * The value of the literal. | 7092 * The value of the literal. |
| 7183 */ | 7093 */ |
| 7184 int value = 0; | 7094 int value = 0; |
| 7185 | 7095 |
| 7186 /** | 7096 /** |
| 7187 * Initialize a newly created integer literal. | 7097 * Initialize a newly created integer literal. |
| 7188 * | 7098 * |
| 7189 * @param literal the token representing the literal | 7099 * @param literal the token representing the literal |
| 7190 * @param value the value of the literal | 7100 * @param value the value of the literal |
| 7191 */ | 7101 */ |
| 7192 IntegerLiteral(Token literal, int value) { | 7102 IntegerLiteral(this.literal, this.value); |
| 7193 this.literal = literal; | |
| 7194 this.value = value; | |
| 7195 } | |
| 7196 | 7103 |
| 7197 @override | 7104 @override |
| 7198 accept(AstVisitor visitor) => visitor.visitIntegerLiteral(this); | 7105 accept(AstVisitor visitor) => visitor.visitIntegerLiteral(this); |
| 7199 | 7106 |
| 7200 @override | 7107 @override |
| 7201 Token get beginToken => literal; | 7108 Token get beginToken => literal; |
| 7202 | 7109 |
| 7203 @override | 7110 @override |
| 7204 Token get endToken => literal; | 7111 Token get endToken => literal; |
| 7205 | 7112 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7248 */ | 7155 */ |
| 7249 Token rightBracket; | 7156 Token rightBracket; |
| 7250 | 7157 |
| 7251 /** | 7158 /** |
| 7252 * Initialize a newly created interpolation expression. | 7159 * Initialize a newly created interpolation expression. |
| 7253 * | 7160 * |
| 7254 * @param leftBracket the left curly bracket | 7161 * @param leftBracket the left curly bracket |
| 7255 * @param expression the expression to be evaluated for the value to be conver
ted into a string | 7162 * @param expression the expression to be evaluated for the value to be conver
ted into a string |
| 7256 * @param rightBracket the right curly bracket | 7163 * @param rightBracket the right curly bracket |
| 7257 */ | 7164 */ |
| 7258 InterpolationExpression(Token leftBracket, Expression expression, Token rightB
racket) { | 7165 InterpolationExpression(this.leftBracket, Expression expression, this.rightBra
cket) { |
| 7259 this.leftBracket = leftBracket; | |
| 7260 this._expression = becomeParentOf(expression); | 7166 this._expression = becomeParentOf(expression); |
| 7261 this.rightBracket = rightBracket; | |
| 7262 } | 7167 } |
| 7263 | 7168 |
| 7264 @override | 7169 @override |
| 7265 accept(AstVisitor visitor) => visitor.visitInterpolationExpression(this); | 7170 accept(AstVisitor visitor) => visitor.visitInterpolationExpression(this); |
| 7266 | 7171 |
| 7267 @override | 7172 @override |
| 7268 Token get beginToken => leftBracket; | 7173 Token get beginToken => leftBracket; |
| 7269 | 7174 |
| 7270 @override | 7175 @override |
| 7271 Token get endToken { | 7176 Token get endToken { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7405 TypeName _type; | 7310 TypeName _type; |
| 7406 | 7311 |
| 7407 /** | 7312 /** |
| 7408 * Initialize a newly created is expression. | 7313 * Initialize a newly created is expression. |
| 7409 * | 7314 * |
| 7410 * @param expression the expression used to compute the value whose type is be
ing tested | 7315 * @param expression the expression used to compute the value whose type is be
ing tested |
| 7411 * @param isOperator the is operator | 7316 * @param isOperator the is operator |
| 7412 * @param notOperator the not operator, or `null` if the sense of the test is
not negated | 7317 * @param notOperator the not operator, or `null` if the sense of the test is
not negated |
| 7413 * @param type the name of the type being tested for | 7318 * @param type the name of the type being tested for |
| 7414 */ | 7319 */ |
| 7415 IsExpression(Expression expression, Token isOperator, Token notOperator, TypeN
ame type) { | 7320 IsExpression(Expression expression, this.isOperator, this.notOperator, TypeNam
e type) { |
| 7416 this._expression = becomeParentOf(expression); | 7321 this._expression = becomeParentOf(expression); |
| 7417 this.isOperator = isOperator; | |
| 7418 this.notOperator = notOperator; | |
| 7419 this._type = becomeParentOf(type); | 7322 this._type = becomeParentOf(type); |
| 7420 } | 7323 } |
| 7421 | 7324 |
| 7422 @override | 7325 @override |
| 7423 accept(AstVisitor visitor) => visitor.visitIsExpression(this); | 7326 accept(AstVisitor visitor) => visitor.visitIsExpression(this); |
| 7424 | 7327 |
| 7425 @override | 7328 @override |
| 7426 Token get beginToken => _expression.beginToken; | 7329 Token get beginToken => _expression.beginToken; |
| 7427 | 7330 |
| 7428 @override | 7331 @override |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7489 * The colon that separates the label from the statement. | 7392 * The colon that separates the label from the statement. |
| 7490 */ | 7393 */ |
| 7491 Token colon; | 7394 Token colon; |
| 7492 | 7395 |
| 7493 /** | 7396 /** |
| 7494 * Initialize a newly created label. | 7397 * Initialize a newly created label. |
| 7495 * | 7398 * |
| 7496 * @param label the label being applied | 7399 * @param label the label being applied |
| 7497 * @param colon the colon that separates the label from whatever follows | 7400 * @param colon the colon that separates the label from whatever follows |
| 7498 */ | 7401 */ |
| 7499 Label(SimpleIdentifier label, Token colon) { | 7402 Label(SimpleIdentifier label, this.colon) { |
| 7500 this._label = becomeParentOf(label); | 7403 this._label = becomeParentOf(label); |
| 7501 this.colon = colon; | |
| 7502 } | 7404 } |
| 7503 | 7405 |
| 7504 @override | 7406 @override |
| 7505 accept(AstVisitor visitor) => visitor.visitLabel(this); | 7407 accept(AstVisitor visitor) => visitor.visitLabel(this); |
| 7506 | 7408 |
| 7507 @override | 7409 @override |
| 7508 Token get beginToken => _label.beginToken; | 7410 Token get beginToken => _label.beginToken; |
| 7509 | 7411 |
| 7510 @override | 7412 @override |
| 7511 Token get endToken => colon; | 7413 Token get endToken => colon; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7634 | 7536 |
| 7635 /** | 7537 /** |
| 7636 * Initialize a newly created library directive. | 7538 * Initialize a newly created library directive. |
| 7637 * | 7539 * |
| 7638 * @param comment the documentation comment associated with this directive | 7540 * @param comment the documentation comment associated with this directive |
| 7639 * @param metadata the annotations associated with the directive | 7541 * @param metadata the annotations associated with the directive |
| 7640 * @param libraryToken the token representing the 'library' token | 7542 * @param libraryToken the token representing the 'library' token |
| 7641 * @param name the name of the library being defined | 7543 * @param name the name of the library being defined |
| 7642 * @param semicolon the semicolon terminating the directive | 7544 * @param semicolon the semicolon terminating the directive |
| 7643 */ | 7545 */ |
| 7644 LibraryDirective(Comment comment, List<Annotation> metadata, Token libraryToke
n, LibraryIdentifier name, Token semicolon) : super(comment, metadata) { | 7546 LibraryDirective(Comment comment, List<Annotation> metadata, this.libraryToken
, LibraryIdentifier name, this.semicolon) : super(comment, metadata) { |
| 7645 this.libraryToken = libraryToken; | |
| 7646 this._name = becomeParentOf(name); | 7547 this._name = becomeParentOf(name); |
| 7647 this.semicolon = semicolon; | |
| 7648 } | 7548 } |
| 7649 | 7549 |
| 7650 @override | 7550 @override |
| 7651 accept(AstVisitor visitor) => visitor.visitLibraryDirective(this); | 7551 accept(AstVisitor visitor) => visitor.visitLibraryDirective(this); |
| 7652 | 7552 |
| 7653 @override | 7553 @override |
| 7654 Token get endToken => semicolon; | 7554 Token get endToken => semicolon; |
| 7655 | 7555 |
| 7656 @override | 7556 @override |
| 7657 Token get keyword => libraryToken; | 7557 Token get keyword => libraryToken; |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8012 */ | 7912 */ |
| 8013 Expression _value; | 7913 Expression _value; |
| 8014 | 7914 |
| 8015 /** | 7915 /** |
| 8016 * Initialize a newly created map literal entry. | 7916 * Initialize a newly created map literal entry. |
| 8017 * | 7917 * |
| 8018 * @param key the expression computing the key with which the value will be as
sociated | 7918 * @param key the expression computing the key with which the value will be as
sociated |
| 8019 * @param separator the colon that separates the key from the value | 7919 * @param separator the colon that separates the key from the value |
| 8020 * @param value the expression computing the value that will be associated wit
h the key | 7920 * @param value the expression computing the value that will be associated wit
h the key |
| 8021 */ | 7921 */ |
| 8022 MapLiteralEntry(Expression key, Token separator, Expression value) { | 7922 MapLiteralEntry(Expression key, this.separator, Expression value) { |
| 8023 this._key = becomeParentOf(key); | 7923 this._key = becomeParentOf(key); |
| 8024 this.separator = separator; | |
| 8025 this._value = becomeParentOf(value); | 7924 this._value = becomeParentOf(value); |
| 8026 } | 7925 } |
| 8027 | 7926 |
| 8028 @override | 7927 @override |
| 8029 accept(AstVisitor visitor) => visitor.visitMapLiteralEntry(this); | 7928 accept(AstVisitor visitor) => visitor.visitMapLiteralEntry(this); |
| 8030 | 7929 |
| 8031 @override | 7930 @override |
| 8032 Token get beginToken => _key.beginToken; | 7931 Token get beginToken => _key.beginToken; |
| 8033 | 7932 |
| 8034 @override | 7933 @override |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8143 * @param metadata the annotations associated with this method | 8042 * @param metadata the annotations associated with this method |
| 8144 * @param modifierKeyword the token representing the 'abstract' or 'static' ke
yword | 8043 * @param modifierKeyword the token representing the 'abstract' or 'static' ke
yword |
| 8145 * @param returnType the return type of the method | 8044 * @param returnType the return type of the method |
| 8146 * @param propertyKeyword the token representing the 'get' or 'set' keyword | 8045 * @param propertyKeyword the token representing the 'get' or 'set' keyword |
| 8147 * @param operatorKeyword the token representing the 'operator' keyword | 8046 * @param operatorKeyword the token representing the 'operator' keyword |
| 8148 * @param name the name of the method | 8047 * @param name the name of the method |
| 8149 * @param parameters the parameters associated with the method, or `null` if t
his method | 8048 * @param parameters the parameters associated with the method, or `null` if t
his method |
| 8150 * declares a getter | 8049 * declares a getter |
| 8151 * @param body the body of the method | 8050 * @param body the body of the method |
| 8152 */ | 8051 */ |
| 8153 MethodDeclaration(Comment comment, List<Annotation> metadata, Token externalKe
yword, Token modifierKeyword, TypeName returnType, Token propertyKeyword, Token
operatorKeyword, SimpleIdentifier name, FormalParameterList parameters, Function
Body body) : super(comment, metadata) { | 8052 MethodDeclaration(Comment comment, List<Annotation> metadata, this.externalKey
word, this.modifierKeyword, TypeName returnType, this.propertyKeyword, this.oper
atorKeyword, SimpleIdentifier name, FormalParameterList parameters, FunctionBody
body) : super(comment, metadata) { |
| 8154 this.externalKeyword = externalKeyword; | |
| 8155 this.modifierKeyword = modifierKeyword; | |
| 8156 this._returnType = becomeParentOf(returnType); | 8053 this._returnType = becomeParentOf(returnType); |
| 8157 this.propertyKeyword = propertyKeyword; | |
| 8158 this.operatorKeyword = operatorKeyword; | |
| 8159 this._name = becomeParentOf(name); | 8054 this._name = becomeParentOf(name); |
| 8160 this._parameters = becomeParentOf(parameters); | 8055 this._parameters = becomeParentOf(parameters); |
| 8161 this._body = becomeParentOf(body); | 8056 this._body = becomeParentOf(body); |
| 8162 } | 8057 } |
| 8163 | 8058 |
| 8164 @override | 8059 @override |
| 8165 accept(AstVisitor visitor) => visitor.visitMethodDeclaration(this); | 8060 accept(AstVisitor visitor) => visitor.visitMethodDeclaration(this); |
| 8166 | 8061 |
| 8167 /** | 8062 /** |
| 8168 * Return the body of the method. | 8063 * Return the body of the method. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8212 * | 8107 * |
| 8213 * @return `true` if this method is declared to be an abstract method | 8108 * @return `true` if this method is declared to be an abstract method |
| 8214 */ | 8109 */ |
| 8215 bool get isAbstract => externalKeyword == null && (_body is EmptyFunctionBody)
; | 8110 bool get isAbstract => externalKeyword == null && (_body is EmptyFunctionBody)
; |
| 8216 | 8111 |
| 8217 /** | 8112 /** |
| 8218 * Return `true` if this method declares a getter. | 8113 * Return `true` if this method declares a getter. |
| 8219 * | 8114 * |
| 8220 * @return `true` if this method declares a getter | 8115 * @return `true` if this method declares a getter |
| 8221 */ | 8116 */ |
| 8222 bool get isGetter => propertyKeyword != null && identical((propertyKeyword as
KeywordToken).keyword, Keyword.GET); | 8117 bool get isGetter => propertyKeyword != null && (propertyKeyword as KeywordTok
en).keyword == Keyword.GET; |
| 8223 | 8118 |
| 8224 /** | 8119 /** |
| 8225 * Return `true` if this method declares an operator. | 8120 * Return `true` if this method declares an operator. |
| 8226 * | 8121 * |
| 8227 * @return `true` if this method declares an operator | 8122 * @return `true` if this method declares an operator |
| 8228 */ | 8123 */ |
| 8229 bool get isOperator => operatorKeyword != null; | 8124 bool get isOperator => operatorKeyword != null; |
| 8230 | 8125 |
| 8231 /** | 8126 /** |
| 8232 * Return `true` if this method declares a setter. | 8127 * Return `true` if this method declares a setter. |
| 8233 * | 8128 * |
| 8234 * @return `true` if this method declares a setter | 8129 * @return `true` if this method declares a setter |
| 8235 */ | 8130 */ |
| 8236 bool get isSetter => propertyKeyword != null && identical((propertyKeyword as
KeywordToken).keyword, Keyword.SET); | 8131 bool get isSetter => propertyKeyword != null && (propertyKeyword as KeywordTok
en).keyword == Keyword.SET; |
| 8237 | 8132 |
| 8238 /** | 8133 /** |
| 8239 * Return `true` if this method is declared to be a static method. | 8134 * Return `true` if this method is declared to be a static method. |
| 8240 * | 8135 * |
| 8241 * @return `true` if this method is declared to be a static method | 8136 * @return `true` if this method is declared to be a static method |
| 8242 */ | 8137 */ |
| 8243 bool get isStatic => modifierKeyword != null && identical((modifierKeyword as
KeywordToken).keyword, Keyword.STATIC); | 8138 bool get isStatic => modifierKeyword != null && (modifierKeyword as KeywordTok
en).keyword == Keyword.STATIC; |
| 8244 | 8139 |
| 8245 /** | 8140 /** |
| 8246 * Set the body of the method to the given function body. | 8141 * Set the body of the method to the given function body. |
| 8247 * | 8142 * |
| 8248 * @param functionBody the body of the method | 8143 * @param functionBody the body of the method |
| 8249 */ | 8144 */ |
| 8250 void set body(FunctionBody functionBody) { | 8145 void set body(FunctionBody functionBody) { |
| 8251 _body = becomeParentOf(functionBody); | 8146 _body = becomeParentOf(functionBody); |
| 8252 } | 8147 } |
| 8253 | 8148 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8338 ArgumentList _argumentList; | 8233 ArgumentList _argumentList; |
| 8339 | 8234 |
| 8340 /** | 8235 /** |
| 8341 * Initialize a newly created method invocation. | 8236 * Initialize a newly created method invocation. |
| 8342 * | 8237 * |
| 8343 * @param target the expression producing the object on which the method is de
fined | 8238 * @param target the expression producing the object on which the method is de
fined |
| 8344 * @param period the period that separates the target from the method name | 8239 * @param period the period that separates the target from the method name |
| 8345 * @param methodName the name of the method being invoked | 8240 * @param methodName the name of the method being invoked |
| 8346 * @param argumentList the list of arguments to the method | 8241 * @param argumentList the list of arguments to the method |
| 8347 */ | 8242 */ |
| 8348 MethodInvocation(Expression target, Token period, SimpleIdentifier methodName,
ArgumentList argumentList) { | 8243 MethodInvocation(Expression target, this.period, SimpleIdentifier methodName,
ArgumentList argumentList) { |
| 8349 this._target = becomeParentOf(target); | 8244 this._target = becomeParentOf(target); |
| 8350 this.period = period; | |
| 8351 this._methodName = becomeParentOf(methodName); | 8245 this._methodName = becomeParentOf(methodName); |
| 8352 this._argumentList = becomeParentOf(argumentList); | 8246 this._argumentList = becomeParentOf(argumentList); |
| 8353 } | 8247 } |
| 8354 | 8248 |
| 8355 @override | 8249 @override |
| 8356 accept(AstVisitor visitor) => visitor.visitMethodInvocation(this); | 8250 accept(AstVisitor visitor) => visitor.visitMethodInvocation(this); |
| 8357 | 8251 |
| 8358 /** | 8252 /** |
| 8359 * Return the list of arguments to the method. | 8253 * Return the list of arguments to the method. |
| 8360 * | 8254 * |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8418 */ | 8312 */ |
| 8419 Expression get target => _target; | 8313 Expression get target => _target; |
| 8420 | 8314 |
| 8421 /** | 8315 /** |
| 8422 * Return `true` if this expression is cascaded. If it is, then the target of
this | 8316 * Return `true` if this expression is cascaded. If it is, then the target of
this |
| 8423 * expression is not stored locally but is stored in the nearest ancestor that
is a | 8317 * expression is not stored locally but is stored in the nearest ancestor that
is a |
| 8424 * [CascadeExpression]. | 8318 * [CascadeExpression]. |
| 8425 * | 8319 * |
| 8426 * @return `true` if this expression is cascaded | 8320 * @return `true` if this expression is cascaded |
| 8427 */ | 8321 */ |
| 8428 bool get isCascaded => period != null && identical(period.type, TokenType.PERI
OD_PERIOD); | 8322 bool get isCascaded => period != null && period.type == TokenType.PERIOD_PERIO
D; |
| 8429 | 8323 |
| 8430 /** | 8324 /** |
| 8431 * Set the list of arguments to the method to the given list. | 8325 * Set the list of arguments to the method to the given list. |
| 8432 * | 8326 * |
| 8433 * @param argumentList the list of arguments to the method | 8327 * @param argumentList the list of arguments to the method |
| 8434 */ | 8328 */ |
| 8435 void set argumentList(ArgumentList argumentList) { | 8329 void set argumentList(ArgumentList argumentList) { |
| 8436 this._argumentList = becomeParentOf(argumentList); | 8330 this._argumentList = becomeParentOf(argumentList); |
| 8437 } | 8331 } |
| 8438 | 8332 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8588 /** | 8482 /** |
| 8589 * Initialize a newly created namespace directive. | 8483 * Initialize a newly created namespace directive. |
| 8590 * | 8484 * |
| 8591 * @param comment the documentation comment associated with this directive | 8485 * @param comment the documentation comment associated with this directive |
| 8592 * @param metadata the annotations associated with the directive | 8486 * @param metadata the annotations associated with the directive |
| 8593 * @param keyword the token representing the 'import' or 'export' keyword | 8487 * @param keyword the token representing the 'import' or 'export' keyword |
| 8594 * @param libraryUri the URI of the library being imported or exported | 8488 * @param libraryUri the URI of the library being imported or exported |
| 8595 * @param combinators the combinators used to control which names are imported
or exported | 8489 * @param combinators the combinators used to control which names are imported
or exported |
| 8596 * @param semicolon the semicolon terminating the directive | 8490 * @param semicolon the semicolon terminating the directive |
| 8597 */ | 8491 */ |
| 8598 NamespaceDirective(Comment comment, List<Annotation> metadata, Token keyword,
StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) : super
(comment, metadata, libraryUri) { | 8492 NamespaceDirective(Comment comment, List<Annotation> metadata, this.keyword, S
tringLiteral libraryUri, List<Combinator> combinators, this.semicolon) : super(c
omment, metadata, libraryUri) { |
| 8599 this._combinators = new NodeList<Combinator>(this); | 8493 this._combinators = new NodeList<Combinator>(this); |
| 8600 this.keyword = keyword; | |
| 8601 this._combinators.addAll(combinators); | 8494 this._combinators.addAll(combinators); |
| 8602 this.semicolon = semicolon; | |
| 8603 } | 8495 } |
| 8604 | 8496 |
| 8605 /** | 8497 /** |
| 8606 * Return the combinators used to control how names are imported or exported. | 8498 * Return the combinators used to control how names are imported or exported. |
| 8607 * | 8499 * |
| 8608 * @return the combinators used to control how names are imported or exported | 8500 * @return the combinators used to control how names are imported or exported |
| 8609 */ | 8501 */ |
| 8610 NodeList<Combinator> get combinators => _combinators; | 8502 NodeList<Combinator> get combinators => _combinators; |
| 8611 | 8503 |
| 8612 @override | 8504 @override |
| (...skipping 25 matching lines...) Expand all Loading... |
| 8638 * The name of the native object that implements the class. | 8530 * The name of the native object that implements the class. |
| 8639 */ | 8531 */ |
| 8640 StringLiteral name; | 8532 StringLiteral name; |
| 8641 | 8533 |
| 8642 /** | 8534 /** |
| 8643 * Initialize a newly created native clause. | 8535 * Initialize a newly created native clause. |
| 8644 * | 8536 * |
| 8645 * @param keyword the token representing the 'native' keyword | 8537 * @param keyword the token representing the 'native' keyword |
| 8646 * @param name the name of the native object that implements the class. | 8538 * @param name the name of the native object that implements the class. |
| 8647 */ | 8539 */ |
| 8648 NativeClause(Token keyword, StringLiteral name) { | 8540 NativeClause(this.keyword, this.name); |
| 8649 this.keyword = keyword; | |
| 8650 this.name = name; | |
| 8651 } | |
| 8652 | 8541 |
| 8653 @override | 8542 @override |
| 8654 accept(AstVisitor visitor) => visitor.visitNativeClause(this); | 8543 accept(AstVisitor visitor) => visitor.visitNativeClause(this); |
| 8655 | 8544 |
| 8656 @override | 8545 @override |
| 8657 Token get beginToken => keyword; | 8546 Token get beginToken => keyword; |
| 8658 | 8547 |
| 8659 @override | 8548 @override |
| 8660 Token get endToken => name.endToken; | 8549 Token get endToken => name.endToken; |
| 8661 | 8550 |
| 8662 @override | 8551 @override |
| 8663 void visitChildren(AstVisitor visitor) { | 8552 void visitChildren(AstVisitor visitor) { |
| 8664 safelyVisitChild(name, visitor); | 8553 safelyVisitChild(name, visitor); |
| 8665 } | 8554 } |
| 8666 } | 8555 } |
| 8667 | 8556 |
| 8668 /** | 8557 /** |
| 8669 * Instances of the class `NativeFunctionBody` represent a function body that co
nsists of a | 8558 * Instances of the class `NativeFunctionBody` represent a function body that co
nsists of a |
| 8670 * native keyword followed by a string literal. | 8559 * native keyword followed by a string literal. |
| 8671 * | 8560 * |
| 8672 * <pre> | 8561 * <pre> |
| 8673 * nativeFunctionBody ::= | 8562 * nativeFunctionBody ::= |
| 8674 * 'native' [SimpleStringLiteral] ';' | 8563 * 'native' [SimpleStringLiteral] ';' |
| 8675 * </pre> | 8564 * </pre> |
| 8676 */ | 8565 */ |
| 8677 class NativeFunctionBody extends FunctionBody { | 8566 class NativeFunctionBody extends FunctionBody { |
| 8678 /** | 8567 /** |
| 8679 * The token representing 'native' that marks the start of the function body. | 8568 * The token representing 'native' that marks the start of the function body. |
| 8680 */ | 8569 */ |
| 8681 Token nativeToken; | 8570 final Token nativeToken; |
| 8682 | 8571 |
| 8683 /** | 8572 /** |
| 8684 * The string literal, after the 'native' token. | 8573 * The string literal, after the 'native' token. |
| 8685 */ | 8574 */ |
| 8686 StringLiteral _stringLiteral; | 8575 StringLiteral _stringLiteral; |
| 8687 | 8576 |
| 8688 /** | 8577 /** |
| 8689 * The token representing the semicolon that marks the end of the function bod
y. | 8578 * The token representing the semicolon that marks the end of the function bod
y. |
| 8690 */ | 8579 */ |
| 8691 Token semicolon; | 8580 final Token semicolon; |
| 8692 | 8581 |
| 8693 /** | 8582 /** |
| 8694 * Initialize a newly created function body consisting of the 'native' token,
a string literal, | 8583 * Initialize a newly created function body consisting of the 'native' token,
a string literal, |
| 8695 * and a semicolon. | 8584 * and a semicolon. |
| 8696 * | 8585 * |
| 8697 * @param nativeToken the token representing 'native' that marks the start of
the function body | 8586 * @param nativeToken the token representing 'native' that marks the start of
the function body |
| 8698 * @param stringLiteral the string literal | 8587 * @param stringLiteral the string literal |
| 8699 * @param semicolon the token representing the semicolon that marks the end of
the function body | 8588 * @param semicolon the token representing the semicolon that marks the end of
the function body |
| 8700 */ | 8589 */ |
| 8701 NativeFunctionBody(Token nativeToken, StringLiteral stringLiteral, Token semic
olon) { | 8590 NativeFunctionBody(this.nativeToken, StringLiteral stringLiteral, this.semicol
on) { |
| 8702 this.nativeToken = nativeToken; | |
| 8703 this._stringLiteral = becomeParentOf(stringLiteral); | 8591 this._stringLiteral = becomeParentOf(stringLiteral); |
| 8704 this.semicolon = semicolon; | |
| 8705 } | 8592 } |
| 8706 | 8593 |
| 8707 @override | 8594 @override |
| 8708 accept(AstVisitor visitor) => visitor.visitNativeFunctionBody(this); | 8595 accept(AstVisitor visitor) => visitor.visitNativeFunctionBody(this); |
| 8709 | 8596 |
| 8710 @override | 8597 @override |
| 8711 Token get beginToken => nativeToken; | 8598 Token get beginToken => nativeToken; |
| 8712 | 8599 |
| 8713 @override | 8600 @override |
| 8714 Token get endToken => semicolon; | 8601 Token get endToken => semicolon; |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9020 | 8907 |
| 9021 /** | 8908 /** |
| 9022 * Initialize a newly created part directive. | 8909 * Initialize a newly created part directive. |
| 9023 * | 8910 * |
| 9024 * @param comment the documentation comment associated with this directive | 8911 * @param comment the documentation comment associated with this directive |
| 9025 * @param metadata the annotations associated with the directive | 8912 * @param metadata the annotations associated with the directive |
| 9026 * @param partToken the token representing the 'part' token | 8913 * @param partToken the token representing the 'part' token |
| 9027 * @param partUri the URI of the part being included | 8914 * @param partUri the URI of the part being included |
| 9028 * @param semicolon the semicolon terminating the directive | 8915 * @param semicolon the semicolon terminating the directive |
| 9029 */ | 8916 */ |
| 9030 PartDirective(Comment comment, List<Annotation> metadata, Token partToken, Str
ingLiteral partUri, Token semicolon) : super(comment, metadata, partUri) { | 8917 PartDirective(Comment comment, List<Annotation> metadata, this.partToken, Stri
ngLiteral partUri, this.semicolon) : super(comment, metadata, partUri); |
| 9031 this.partToken = partToken; | |
| 9032 this.semicolon = semicolon; | |
| 9033 } | |
| 9034 | 8918 |
| 9035 @override | 8919 @override |
| 9036 accept(AstVisitor visitor) => visitor.visitPartDirective(this); | 8920 accept(AstVisitor visitor) => visitor.visitPartDirective(this); |
| 9037 | 8921 |
| 9038 @override | 8922 @override |
| 9039 Token get endToken => semicolon; | 8923 Token get endToken => semicolon; |
| 9040 | 8924 |
| 9041 @override | 8925 @override |
| 9042 Token get keyword => partToken; | 8926 Token get keyword => partToken; |
| 9043 | 8927 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9080 /** | 8964 /** |
| 9081 * Initialize a newly created part-of directive. | 8965 * Initialize a newly created part-of directive. |
| 9082 * | 8966 * |
| 9083 * @param comment the documentation comment associated with this directive | 8967 * @param comment the documentation comment associated with this directive |
| 9084 * @param metadata the annotations associated with the directive | 8968 * @param metadata the annotations associated with the directive |
| 9085 * @param partToken the token representing the 'part' token | 8969 * @param partToken the token representing the 'part' token |
| 9086 * @param ofToken the token representing the 'of' token | 8970 * @param ofToken the token representing the 'of' token |
| 9087 * @param libraryName the name of the library that the containing compilation
unit is part of | 8971 * @param libraryName the name of the library that the containing compilation
unit is part of |
| 9088 * @param semicolon the semicolon terminating the directive | 8972 * @param semicolon the semicolon terminating the directive |
| 9089 */ | 8973 */ |
| 9090 PartOfDirective(Comment comment, List<Annotation> metadata, Token partToken, T
oken ofToken, LibraryIdentifier libraryName, Token semicolon) : super(comment, m
etadata) { | 8974 PartOfDirective(Comment comment, List<Annotation> metadata, this.partToken, th
is.ofToken, LibraryIdentifier libraryName, this.semicolon) : super(comment, meta
data) { |
| 9091 this.partToken = partToken; | |
| 9092 this.ofToken = ofToken; | |
| 9093 this._libraryName = becomeParentOf(libraryName); | 8975 this._libraryName = becomeParentOf(libraryName); |
| 9094 this.semicolon = semicolon; | |
| 9095 } | 8976 } |
| 9096 | 8977 |
| 9097 @override | 8978 @override |
| 9098 accept(AstVisitor visitor) => visitor.visitPartOfDirective(this); | 8979 accept(AstVisitor visitor) => visitor.visitPartOfDirective(this); |
| 9099 | 8980 |
| 9100 @override | 8981 @override |
| 9101 Token get endToken => semicolon; | 8982 Token get endToken => semicolon; |
| 9102 | 8983 |
| 9103 @override | 8984 @override |
| 9104 Token get keyword => partToken; | 8985 Token get keyword => partToken; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9161 * or if the operator could not be resolved. | 9042 * or if the operator could not be resolved. |
| 9162 */ | 9043 */ |
| 9163 MethodElement _staticElement; | 9044 MethodElement _staticElement; |
| 9164 | 9045 |
| 9165 /** | 9046 /** |
| 9166 * Initialize a newly created postfix expression. | 9047 * Initialize a newly created postfix expression. |
| 9167 * | 9048 * |
| 9168 * @param operand the expression computing the operand for the operator | 9049 * @param operand the expression computing the operand for the operator |
| 9169 * @param operator the postfix operator being applied to the operand | 9050 * @param operator the postfix operator being applied to the operand |
| 9170 */ | 9051 */ |
| 9171 PostfixExpression(Expression operand, Token operator) { | 9052 PostfixExpression(Expression operand, this.operator) { |
| 9172 this._operand = becomeParentOf(operand); | 9053 this._operand = becomeParentOf(operand); |
| 9173 this.operator = operator; | |
| 9174 } | 9054 } |
| 9175 | 9055 |
| 9176 @override | 9056 @override |
| 9177 accept(AstVisitor visitor) => visitor.visitPostfixExpression(this); | 9057 accept(AstVisitor visitor) => visitor.visitPostfixExpression(this); |
| 9178 | 9058 |
| 9179 @override | 9059 @override |
| 9180 Token get beginToken => _operand.beginToken; | 9060 Token get beginToken => _operand.beginToken; |
| 9181 | 9061 |
| 9182 /** | 9062 /** |
| 9183 * Return the best element available for this operator. If resolution was able
to find a better | 9063 * Return the best element available for this operator. If resolution was able
to find a better |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9337 * or if the operator could not be resolved. | 9217 * or if the operator could not be resolved. |
| 9338 */ | 9218 */ |
| 9339 MethodElement _propagatedElement; | 9219 MethodElement _propagatedElement; |
| 9340 | 9220 |
| 9341 /** | 9221 /** |
| 9342 * Initialize a newly created prefix expression. | 9222 * Initialize a newly created prefix expression. |
| 9343 * | 9223 * |
| 9344 * @param operator the prefix operator being applied to the operand | 9224 * @param operator the prefix operator being applied to the operand |
| 9345 * @param operand the expression computing the operand for the operator | 9225 * @param operand the expression computing the operand for the operator |
| 9346 */ | 9226 */ |
| 9347 PrefixExpression(Token operator, Expression operand) { | 9227 PrefixExpression(this.operator, Expression operand) { |
| 9348 this.operator = operator; | |
| 9349 this._operand = becomeParentOf(operand); | 9228 this._operand = becomeParentOf(operand); |
| 9350 } | 9229 } |
| 9351 | 9230 |
| 9352 @override | 9231 @override |
| 9353 accept(AstVisitor visitor) => visitor.visitPrefixExpression(this); | 9232 accept(AstVisitor visitor) => visitor.visitPrefixExpression(this); |
| 9354 | 9233 |
| 9355 @override | 9234 @override |
| 9356 Token get beginToken => operator; | 9235 Token get beginToken => operator; |
| 9357 | 9236 |
| 9358 /** | 9237 /** |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9507 */ | 9386 */ |
| 9508 SimpleIdentifier _identifier; | 9387 SimpleIdentifier _identifier; |
| 9509 | 9388 |
| 9510 /** | 9389 /** |
| 9511 * Initialize a newly created prefixed identifier. | 9390 * Initialize a newly created prefixed identifier. |
| 9512 * | 9391 * |
| 9513 * @param prefix the identifier being prefixed | 9392 * @param prefix the identifier being prefixed |
| 9514 * @param period the period used to separate the prefix from the identifier | 9393 * @param period the period used to separate the prefix from the identifier |
| 9515 * @param identifier the prefix associated with the library in which the ident
ifier is defined | 9394 * @param identifier the prefix associated with the library in which the ident
ifier is defined |
| 9516 */ | 9395 */ |
| 9517 PrefixedIdentifier(SimpleIdentifier prefix, Token period, SimpleIdentifier ide
ntifier) { | 9396 PrefixedIdentifier(SimpleIdentifier prefix, this.period, SimpleIdentifier iden
tifier) { |
| 9518 this._prefix = becomeParentOf(prefix); | 9397 this._prefix = becomeParentOf(prefix); |
| 9519 this.period = period; | |
| 9520 this._identifier = becomeParentOf(identifier); | 9398 this._identifier = becomeParentOf(identifier); |
| 9521 } | 9399 } |
| 9522 | 9400 |
| 9523 @override | 9401 @override |
| 9524 accept(AstVisitor visitor) => visitor.visitPrefixedIdentifier(this); | 9402 accept(AstVisitor visitor) => visitor.visitPrefixedIdentifier(this); |
| 9525 | 9403 |
| 9526 @override | 9404 @override |
| 9527 Token get beginToken => _prefix.beginToken; | 9405 Token get beginToken => _prefix.beginToken; |
| 9528 | 9406 |
| 9529 @override | 9407 @override |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9627 */ | 9505 */ |
| 9628 SimpleIdentifier _propertyName; | 9506 SimpleIdentifier _propertyName; |
| 9629 | 9507 |
| 9630 /** | 9508 /** |
| 9631 * Initialize a newly created property access expression. | 9509 * Initialize a newly created property access expression. |
| 9632 * | 9510 * |
| 9633 * @param target the expression computing the object defining the property bei
ng accessed | 9511 * @param target the expression computing the object defining the property bei
ng accessed |
| 9634 * @param operator the property access operator | 9512 * @param operator the property access operator |
| 9635 * @param propertyName the name of the property being accessed | 9513 * @param propertyName the name of the property being accessed |
| 9636 */ | 9514 */ |
| 9637 PropertyAccess(Expression target, Token operator, SimpleIdentifier propertyNam
e) { | 9515 PropertyAccess(Expression target, this.operator, SimpleIdentifier propertyName
) { |
| 9638 this._target = becomeParentOf(target); | 9516 this._target = becomeParentOf(target); |
| 9639 this.operator = operator; | |
| 9640 this._propertyName = becomeParentOf(propertyName); | 9517 this._propertyName = becomeParentOf(propertyName); |
| 9641 } | 9518 } |
| 9642 | 9519 |
| 9643 @override | 9520 @override |
| 9644 accept(AstVisitor visitor) => visitor.visitPropertyAccess(this); | 9521 accept(AstVisitor visitor) => visitor.visitPropertyAccess(this); |
| 9645 | 9522 |
| 9646 @override | 9523 @override |
| 9647 Token get beginToken { | 9524 Token get beginToken { |
| 9648 if (_target != null) { | 9525 if (_target != null) { |
| 9649 return _target.beginToken; | 9526 return _target.beginToken; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9699 @override | 9576 @override |
| 9700 bool get isAssignable => true; | 9577 bool get isAssignable => true; |
| 9701 | 9578 |
| 9702 /** | 9579 /** |
| 9703 * Return `true` if this expression is cascaded. If it is, then the target of
this | 9580 * Return `true` if this expression is cascaded. If it is, then the target of
this |
| 9704 * expression is not stored locally but is stored in the nearest ancestor that
is a | 9581 * expression is not stored locally but is stored in the nearest ancestor that
is a |
| 9705 * [CascadeExpression]. | 9582 * [CascadeExpression]. |
| 9706 * | 9583 * |
| 9707 * @return `true` if this expression is cascaded | 9584 * @return `true` if this expression is cascaded |
| 9708 */ | 9585 */ |
| 9709 bool get isCascaded => operator != null && identical(operator.type, TokenType.
PERIOD_PERIOD); | 9586 bool get isCascaded => operator != null && operator.type == TokenType.PERIOD_P
ERIOD; |
| 9710 | 9587 |
| 9711 /** | 9588 /** |
| 9712 * Set the name of the property being accessed to the given identifier. | 9589 * Set the name of the property being accessed to the given identifier. |
| 9713 * | 9590 * |
| 9714 * @param identifier the name of the property being accessed | 9591 * @param identifier the name of the property being accessed |
| 9715 */ | 9592 */ |
| 9716 void set propertyName(SimpleIdentifier identifier) { | 9593 void set propertyName(SimpleIdentifier identifier) { |
| 9717 _propertyName = becomeParentOf(identifier); | 9594 _propertyName = becomeParentOf(identifier); |
| 9718 } | 9595 } |
| 9719 | 9596 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9774 | 9651 |
| 9775 /** | 9652 /** |
| 9776 * Initialize a newly created redirecting invocation to invoke the constructor
with the given name | 9653 * Initialize a newly created redirecting invocation to invoke the constructor
with the given name |
| 9777 * with the given arguments. | 9654 * with the given arguments. |
| 9778 * | 9655 * |
| 9779 * @param keyword the token for the 'this' keyword | 9656 * @param keyword the token for the 'this' keyword |
| 9780 * @param period the token for the period before the name of the constructor t
hat is being invoked | 9657 * @param period the token for the period before the name of the constructor t
hat is being invoked |
| 9781 * @param constructorName the name of the constructor that is being invoked | 9658 * @param constructorName the name of the constructor that is being invoked |
| 9782 * @param argumentList the list of arguments to the constructor | 9659 * @param argumentList the list of arguments to the constructor |
| 9783 */ | 9660 */ |
| 9784 RedirectingConstructorInvocation(Token keyword, Token period, SimpleIdentifier
constructorName, ArgumentList argumentList) { | 9661 RedirectingConstructorInvocation(this.keyword, this.period, SimpleIdentifier c
onstructorName, ArgumentList argumentList) { |
| 9785 this.keyword = keyword; | |
| 9786 this.period = period; | |
| 9787 this._constructorName = becomeParentOf(constructorName); | 9662 this._constructorName = becomeParentOf(constructorName); |
| 9788 this._argumentList = becomeParentOf(argumentList); | 9663 this._argumentList = becomeParentOf(argumentList); |
| 9789 } | 9664 } |
| 9790 | 9665 |
| 9791 @override | 9666 @override |
| 9792 accept(AstVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th
is); | 9667 accept(AstVisitor visitor) => visitor.visitRedirectingConstructorInvocation(th
is); |
| 9793 | 9668 |
| 9794 /** | 9669 /** |
| 9795 * Return the list of arguments to the constructor. | 9670 * Return the list of arguments to the constructor. |
| 9796 * | 9671 * |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9849 /** | 9724 /** |
| 9850 * The token representing the 'rethrow' keyword. | 9725 * The token representing the 'rethrow' keyword. |
| 9851 */ | 9726 */ |
| 9852 Token keyword; | 9727 Token keyword; |
| 9853 | 9728 |
| 9854 /** | 9729 /** |
| 9855 * Initialize a newly created rethrow expression. | 9730 * Initialize a newly created rethrow expression. |
| 9856 * | 9731 * |
| 9857 * @param keyword the token representing the 'rethrow' keyword | 9732 * @param keyword the token representing the 'rethrow' keyword |
| 9858 */ | 9733 */ |
| 9859 RethrowExpression(Token keyword) { | 9734 RethrowExpression(this.keyword); |
| 9860 this.keyword = keyword; | |
| 9861 } | |
| 9862 | 9735 |
| 9863 @override | 9736 @override |
| 9864 accept(AstVisitor visitor) => visitor.visitRethrowExpression(this); | 9737 accept(AstVisitor visitor) => visitor.visitRethrowExpression(this); |
| 9865 | 9738 |
| 9866 @override | 9739 @override |
| 9867 Token get beginToken => keyword; | 9740 Token get beginToken => keyword; |
| 9868 | 9741 |
| 9869 @override | 9742 @override |
| 9870 Token get endToken => keyword; | 9743 Token get endToken => keyword; |
| 9871 | 9744 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 9902 */ | 9775 */ |
| 9903 Token semicolon; | 9776 Token semicolon; |
| 9904 | 9777 |
| 9905 /** | 9778 /** |
| 9906 * Initialize a newly created return statement. | 9779 * Initialize a newly created return statement. |
| 9907 * | 9780 * |
| 9908 * @param keyword the token representing the 'return' keyword | 9781 * @param keyword the token representing the 'return' keyword |
| 9909 * @param expression the expression computing the value to be returned | 9782 * @param expression the expression computing the value to be returned |
| 9910 * @param semicolon the semicolon terminating the statement | 9783 * @param semicolon the semicolon terminating the statement |
| 9911 */ | 9784 */ |
| 9912 ReturnStatement(Token keyword, Expression expression, Token semicolon) { | 9785 ReturnStatement(this.keyword, Expression expression, this.semicolon) { |
| 9913 this.keyword = keyword; | |
| 9914 this._expression = becomeParentOf(expression); | 9786 this._expression = becomeParentOf(expression); |
| 9915 this.semicolon = semicolon; | |
| 9916 } | 9787 } |
| 9917 | 9788 |
| 9918 @override | 9789 @override |
| 9919 accept(AstVisitor visitor) => visitor.visitReturnStatement(this); | 9790 accept(AstVisitor visitor) => visitor.visitReturnStatement(this); |
| 9920 | 9791 |
| 9921 @override | 9792 @override |
| 9922 Token get beginToken => keyword; | 9793 Token get beginToken => keyword; |
| 9923 | 9794 |
| 9924 @override | 9795 @override |
| 9925 Token get endToken => semicolon; | 9796 Token get endToken => semicolon; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9960 /** | 9831 /** |
| 9961 * The token representing this script tag. | 9832 * The token representing this script tag. |
| 9962 */ | 9833 */ |
| 9963 Token scriptTag; | 9834 Token scriptTag; |
| 9964 | 9835 |
| 9965 /** | 9836 /** |
| 9966 * Initialize a newly created script tag. | 9837 * Initialize a newly created script tag. |
| 9967 * | 9838 * |
| 9968 * @param scriptTag the token representing this script tag | 9839 * @param scriptTag the token representing this script tag |
| 9969 */ | 9840 */ |
| 9970 ScriptTag(Token scriptTag) { | 9841 ScriptTag(this.scriptTag); |
| 9971 this.scriptTag = scriptTag; | |
| 9972 } | |
| 9973 | 9842 |
| 9974 @override | 9843 @override |
| 9975 accept(AstVisitor visitor) => visitor.visitScriptTag(this); | 9844 accept(AstVisitor visitor) => visitor.visitScriptTag(this); |
| 9976 | 9845 |
| 9977 @override | 9846 @override |
| 9978 Token get beginToken => scriptTag; | 9847 Token get beginToken => scriptTag; |
| 9979 | 9848 |
| 9980 @override | 9849 @override |
| 9981 Token get endToken => scriptTag; | 9850 Token get endToken => scriptTag; |
| 9982 | 9851 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10053 | 9922 |
| 10054 /** | 9923 /** |
| 10055 * Initialize a newly created formal parameter. | 9924 * Initialize a newly created formal parameter. |
| 10056 * | 9925 * |
| 10057 * @param comment the documentation comment associated with this parameter | 9926 * @param comment the documentation comment associated with this parameter |
| 10058 * @param metadata the annotations associated with this parameter | 9927 * @param metadata the annotations associated with this parameter |
| 10059 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword | 9928 * @param keyword the token representing either the 'final', 'const' or 'var'
keyword |
| 10060 * @param type the name of the declared type of the parameter | 9929 * @param type the name of the declared type of the parameter |
| 10061 * @param identifier the name of the parameter being declared | 9930 * @param identifier the name of the parameter being declared |
| 10062 */ | 9931 */ |
| 10063 SimpleFormalParameter(Comment comment, List<Annotation> metadata, Token keywor
d, TypeName type, SimpleIdentifier identifier) : super(comment, metadata, identi
fier) { | 9932 SimpleFormalParameter(Comment comment, List<Annotation> metadata, this.keyword
, TypeName type, SimpleIdentifier identifier) : super(comment, metadata, identif
ier) { |
| 10064 this.keyword = keyword; | |
| 10065 this._type = becomeParentOf(type); | 9933 this._type = becomeParentOf(type); |
| 10066 } | 9934 } |
| 10067 | 9935 |
| 10068 @override | 9936 @override |
| 10069 accept(AstVisitor visitor) => visitor.visitSimpleFormalParameter(this); | 9937 accept(AstVisitor visitor) => visitor.visitSimpleFormalParameter(this); |
| 10070 | 9938 |
| 10071 @override | 9939 @override |
| 10072 Token get beginToken { | 9940 Token get beginToken { |
| 10073 if (keyword != null) { | 9941 if (keyword != null) { |
| 10074 return keyword; | 9942 return keyword; |
| 10075 } else if (_type != null) { | 9943 } else if (_type != null) { |
| 10076 return _type.beginToken; | 9944 return _type.beginToken; |
| 10077 } | 9945 } |
| 10078 return identifier.beginToken; | 9946 return identifier.beginToken; |
| 10079 } | 9947 } |
| 10080 | 9948 |
| 10081 @override | 9949 @override |
| 10082 Token get endToken => identifier.endToken; | 9950 Token get endToken => identifier.endToken; |
| 10083 | 9951 |
| 10084 /** | 9952 /** |
| 10085 * Return the name of the declared type of the parameter, or `null` if the par
ameter does | 9953 * Return the name of the declared type of the parameter, or `null` if the par
ameter does |
| 10086 * not have a declared type. | 9954 * not have a declared type. |
| 10087 * | 9955 * |
| 10088 * @return the name of the declared type of the parameter | 9956 * @return the name of the declared type of the parameter |
| 10089 */ | 9957 */ |
| 10090 TypeName get type => _type; | 9958 TypeName get type => _type; |
| 10091 | 9959 |
| 10092 @override | 9960 @override |
| 10093 bool get isConst => (keyword is KeywordToken) && identical((keyword as Keyword
Token).keyword, Keyword.CONST); | 9961 bool get isConst => (keyword is KeywordToken) && (keyword as KeywordToken).key
word == Keyword.CONST; |
| 10094 | 9962 |
| 10095 @override | 9963 @override |
| 10096 bool get isFinal => (keyword is KeywordToken) && identical((keyword as Keyword
Token).keyword, Keyword.FINAL); | 9964 bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).key
word == Keyword.FINAL; |
| 10097 | 9965 |
| 10098 /** | 9966 /** |
| 10099 * Set the name of the declared type of the parameter to the given type name. | 9967 * Set the name of the declared type of the parameter to the given type name. |
| 10100 * | 9968 * |
| 10101 * @param typeName the name of the declared type of the parameter | 9969 * @param typeName the name of the declared type of the parameter |
| 10102 */ | 9970 */ |
| 10103 void set type(TypeName typeName) { | 9971 void set type(TypeName typeName) { |
| 10104 _type = becomeParentOf(typeName); | 9972 _type = becomeParentOf(typeName); |
| 10105 } | 9973 } |
| 10106 | 9974 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10148 * be set to hold onto the static and propagated information. The auxiliary el
ement will hold onto | 10016 * be set to hold onto the static and propagated information. The auxiliary el
ement will hold onto |
| 10149 * the elements from the getter context. | 10017 * the elements from the getter context. |
| 10150 */ | 10018 */ |
| 10151 AuxiliaryElements auxiliaryElements = null; | 10019 AuxiliaryElements auxiliaryElements = null; |
| 10152 | 10020 |
| 10153 /** | 10021 /** |
| 10154 * Initialize a newly created identifier. | 10022 * Initialize a newly created identifier. |
| 10155 * | 10023 * |
| 10156 * @param token the token representing the identifier | 10024 * @param token the token representing the identifier |
| 10157 */ | 10025 */ |
| 10158 SimpleIdentifier(Token token) { | 10026 SimpleIdentifier(this.token); |
| 10159 this.token = token; | |
| 10160 } | |
| 10161 | 10027 |
| 10162 @override | 10028 @override |
| 10163 accept(AstVisitor visitor) => visitor.visitSimpleIdentifier(this); | 10029 accept(AstVisitor visitor) => visitor.visitSimpleIdentifier(this); |
| 10164 | 10030 |
| 10165 @override | 10031 @override |
| 10166 Token get beginToken => token; | 10032 Token get beginToken => token; |
| 10167 | 10033 |
| 10168 @override | 10034 @override |
| 10169 Element get bestElement { | 10035 Element get bestElement { |
| 10170 if (_propagatedElement == null) { | 10036 if (_propagatedElement == null) { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10252 parent = access.parent; | 10118 parent = access.parent; |
| 10253 target = access; | 10119 target = access; |
| 10254 } | 10120 } |
| 10255 // skip label | 10121 // skip label |
| 10256 if (parent is Label) { | 10122 if (parent is Label) { |
| 10257 return false; | 10123 return false; |
| 10258 } | 10124 } |
| 10259 // analyze usage | 10125 // analyze usage |
| 10260 if (parent is AssignmentExpression) { | 10126 if (parent is AssignmentExpression) { |
| 10261 AssignmentExpression expr = parent as AssignmentExpression; | 10127 AssignmentExpression expr = parent as AssignmentExpression; |
| 10262 if (identical(expr.leftHandSide, target) && identical(expr.operator.type,
TokenType.EQ)) { | 10128 if (identical(expr.leftHandSide, target) && expr.operator.type == TokenTyp
e.EQ) { |
| 10263 return false; | 10129 return false; |
| 10264 } | 10130 } |
| 10265 } | 10131 } |
| 10266 return true; | 10132 return true; |
| 10267 } | 10133 } |
| 10268 | 10134 |
| 10269 /** | 10135 /** |
| 10270 * Return `true` if this expression is computing a left-hand value. | 10136 * Return `true` if this expression is computing a left-hand value. |
| 10271 * | 10137 * |
| 10272 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar
e | 10138 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar
e |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10425 * The toolkit specific element associated with this literal, or `null`. | 10291 * The toolkit specific element associated with this literal, or `null`. |
| 10426 */ | 10292 */ |
| 10427 Element _toolkitElement; | 10293 Element _toolkitElement; |
| 10428 | 10294 |
| 10429 /** | 10295 /** |
| 10430 * Initialize a newly created simple string literal. | 10296 * Initialize a newly created simple string literal. |
| 10431 * | 10297 * |
| 10432 * @param literal the token representing the literal | 10298 * @param literal the token representing the literal |
| 10433 * @param value the value of the literal | 10299 * @param value the value of the literal |
| 10434 */ | 10300 */ |
| 10435 SimpleStringLiteral(Token literal, String value) { | 10301 SimpleStringLiteral(this.literal, String value) { |
| 10436 this.literal = literal; | |
| 10437 this._value = StringUtilities.intern(value); | 10302 this._value = StringUtilities.intern(value); |
| 10438 } | 10303 } |
| 10439 | 10304 |
| 10440 @override | 10305 @override |
| 10441 accept(AstVisitor visitor) => visitor.visitSimpleStringLiteral(this); | 10306 accept(AstVisitor visitor) => visitor.visitSimpleStringLiteral(this); |
| 10442 | 10307 |
| 10443 @override | 10308 @override |
| 10444 Token get beginToken => literal; | 10309 Token get beginToken => literal; |
| 10445 | 10310 |
| 10446 @override | 10311 @override |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10683 | 10548 |
| 10684 /** | 10549 /** |
| 10685 * Initialize a newly created super invocation to invoke the inherited constru
ctor with the given | 10550 * Initialize a newly created super invocation to invoke the inherited constru
ctor with the given |
| 10686 * name with the given arguments. | 10551 * name with the given arguments. |
| 10687 * | 10552 * |
| 10688 * @param keyword the token for the 'super' keyword | 10553 * @param keyword the token for the 'super' keyword |
| 10689 * @param period the token for the period before the name of the constructor t
hat is being invoked | 10554 * @param period the token for the period before the name of the constructor t
hat is being invoked |
| 10690 * @param constructorName the name of the constructor that is being invoked | 10555 * @param constructorName the name of the constructor that is being invoked |
| 10691 * @param argumentList the list of arguments to the constructor | 10556 * @param argumentList the list of arguments to the constructor |
| 10692 */ | 10557 */ |
| 10693 SuperConstructorInvocation(Token keyword, Token period, SimpleIdentifier const
ructorName, ArgumentList argumentList) { | 10558 SuperConstructorInvocation(this.keyword, this.period, SimpleIdentifier constru
ctorName, ArgumentList argumentList) { |
| 10694 this.keyword = keyword; | |
| 10695 this.period = period; | |
| 10696 this._constructorName = becomeParentOf(constructorName); | 10559 this._constructorName = becomeParentOf(constructorName); |
| 10697 this._argumentList = becomeParentOf(argumentList); | 10560 this._argumentList = becomeParentOf(argumentList); |
| 10698 } | 10561 } |
| 10699 | 10562 |
| 10700 @override | 10563 @override |
| 10701 accept(AstVisitor visitor) => visitor.visitSuperConstructorInvocation(this); | 10564 accept(AstVisitor visitor) => visitor.visitSuperConstructorInvocation(this); |
| 10702 | 10565 |
| 10703 /** | 10566 /** |
| 10704 * Return the list of arguments to the constructor. | 10567 * Return the list of arguments to the constructor. |
| 10705 * | 10568 * |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10758 /** | 10621 /** |
| 10759 * The token representing the keyword. | 10622 * The token representing the keyword. |
| 10760 */ | 10623 */ |
| 10761 Token keyword; | 10624 Token keyword; |
| 10762 | 10625 |
| 10763 /** | 10626 /** |
| 10764 * Initialize a newly created super expression. | 10627 * Initialize a newly created super expression. |
| 10765 * | 10628 * |
| 10766 * @param keyword the token representing the keyword | 10629 * @param keyword the token representing the keyword |
| 10767 */ | 10630 */ |
| 10768 SuperExpression(Token keyword) { | 10631 SuperExpression(this.keyword); |
| 10769 this.keyword = keyword; | |
| 10770 } | |
| 10771 | 10632 |
| 10772 @override | 10633 @override |
| 10773 accept(AstVisitor visitor) => visitor.visitSuperExpression(this); | 10634 accept(AstVisitor visitor) => visitor.visitSuperExpression(this); |
| 10774 | 10635 |
| 10775 @override | 10636 @override |
| 10776 Token get beginToken => keyword; | 10637 Token get beginToken => keyword; |
| 10777 | 10638 |
| 10778 @override | 10639 @override |
| 10779 Token get endToken => keyword; | 10640 Token get endToken => keyword; |
| 10780 | 10641 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10901 NodeList<Statement> _statements; | 10762 NodeList<Statement> _statements; |
| 10902 | 10763 |
| 10903 /** | 10764 /** |
| 10904 * Initialize a newly created switch member. | 10765 * Initialize a newly created switch member. |
| 10905 * | 10766 * |
| 10906 * @param labels the labels associated with the switch member | 10767 * @param labels the labels associated with the switch member |
| 10907 * @param keyword the token representing the 'case' or 'default' keyword | 10768 * @param keyword the token representing the 'case' or 'default' keyword |
| 10908 * @param colon the colon separating the keyword or the expression from the st
atements | 10769 * @param colon the colon separating the keyword or the expression from the st
atements |
| 10909 * @param statements the statements that will be executed if this switch membe
r is selected | 10770 * @param statements the statements that will be executed if this switch membe
r is selected |
| 10910 */ | 10771 */ |
| 10911 SwitchMember(List<Label> labels, Token keyword, Token colon, List<Statement> s
tatements) { | 10772 SwitchMember(List<Label> labels, this.keyword, this.colon, List<Statement> sta
tements) { |
| 10912 this._labels = new NodeList<Label>(this); | 10773 this._labels = new NodeList<Label>(this); |
| 10913 this._statements = new NodeList<Statement>(this); | 10774 this._statements = new NodeList<Statement>(this); |
| 10914 this._labels.addAll(labels); | 10775 this._labels.addAll(labels); |
| 10915 this.keyword = keyword; | |
| 10916 this.colon = colon; | |
| 10917 this._statements.addAll(statements); | 10776 this._statements.addAll(statements); |
| 10918 } | 10777 } |
| 10919 | 10778 |
| 10920 @override | 10779 @override |
| 10921 Token get beginToken { | 10780 Token get beginToken { |
| 10922 if (!_labels.isEmpty) { | 10781 if (!_labels.isEmpty) { |
| 10923 return _labels.beginToken; | 10782 return _labels.beginToken; |
| 10924 } | 10783 } |
| 10925 return keyword; | 10784 return keyword; |
| 10926 } | 10785 } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10996 * Initialize a newly created switch statement. | 10855 * Initialize a newly created switch statement. |
| 10997 * | 10856 * |
| 10998 * @param keyword the token representing the 'switch' keyword | 10857 * @param keyword the token representing the 'switch' keyword |
| 10999 * @param leftParenthesis the left parenthesis | 10858 * @param leftParenthesis the left parenthesis |
| 11000 * @param expression the expression used to determine which of the switch memb
ers will be selected | 10859 * @param expression the expression used to determine which of the switch memb
ers will be selected |
| 11001 * @param rightParenthesis the right parenthesis | 10860 * @param rightParenthesis the right parenthesis |
| 11002 * @param leftBracket the left curly bracket | 10861 * @param leftBracket the left curly bracket |
| 11003 * @param members the switch members that can be selected by the expression | 10862 * @param members the switch members that can be selected by the expression |
| 11004 * @param rightBracket the right curly bracket | 10863 * @param rightBracket the right curly bracket |
| 11005 */ | 10864 */ |
| 11006 SwitchStatement(Token keyword, Token leftParenthesis, Expression expression, T
oken rightParenthesis, Token leftBracket, List<SwitchMember> members, Token righ
tBracket) { | 10865 SwitchStatement(this.keyword, this.leftParenthesis, Expression expression, thi
s.rightParenthesis, this.leftBracket, List<SwitchMember> members, this.rightBrac
ket) { |
| 11007 this._members = new NodeList<SwitchMember>(this); | 10866 this._members = new NodeList<SwitchMember>(this); |
| 11008 this.keyword = keyword; | |
| 11009 this.leftParenthesis = leftParenthesis; | |
| 11010 this._expression = becomeParentOf(expression); | 10867 this._expression = becomeParentOf(expression); |
| 11011 this.rightParenthesis = rightParenthesis; | |
| 11012 this.leftBracket = leftBracket; | |
| 11013 this._members.addAll(members); | 10868 this._members.addAll(members); |
| 11014 this.rightBracket = rightBracket; | |
| 11015 } | 10869 } |
| 11016 | 10870 |
| 11017 @override | 10871 @override |
| 11018 accept(AstVisitor visitor) => visitor.visitSwitchStatement(this); | 10872 accept(AstVisitor visitor) => visitor.visitSwitchStatement(this); |
| 11019 | 10873 |
| 11020 @override | 10874 @override |
| 11021 Token get beginToken => keyword; | 10875 Token get beginToken => keyword; |
| 11022 | 10876 |
| 11023 @override | 10877 @override |
| 11024 Token get endToken => rightBracket; | 10878 Token get endToken => rightBracket; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11064 */ | 10918 */ |
| 11065 class SymbolLiteral extends Literal { | 10919 class SymbolLiteral extends Literal { |
| 11066 /** | 10920 /** |
| 11067 * The token introducing the literal. | 10921 * The token introducing the literal. |
| 11068 */ | 10922 */ |
| 11069 Token poundSign; | 10923 Token poundSign; |
| 11070 | 10924 |
| 11071 /** | 10925 /** |
| 11072 * The components of the literal. | 10926 * The components of the literal. |
| 11073 */ | 10927 */ |
| 11074 List<Token> components; | 10928 final List<Token> components; |
| 11075 | 10929 |
| 11076 /** | 10930 /** |
| 11077 * Initialize a newly created symbol literal. | 10931 * Initialize a newly created symbol literal. |
| 11078 * | 10932 * |
| 11079 * @param poundSign the token introducing the literal | 10933 * @param poundSign the token introducing the literal |
| 11080 * @param components the components of the literal | 10934 * @param components the components of the literal |
| 11081 */ | 10935 */ |
| 11082 SymbolLiteral(Token poundSign, List<Token> components) { | 10936 SymbolLiteral(this.poundSign, this.components); |
| 11083 this.poundSign = poundSign; | |
| 11084 this.components = components; | |
| 11085 } | |
| 11086 | 10937 |
| 11087 @override | 10938 @override |
| 11088 accept(AstVisitor visitor) => visitor.visitSymbolLiteral(this); | 10939 accept(AstVisitor visitor) => visitor.visitSymbolLiteral(this); |
| 11089 | 10940 |
| 11090 @override | 10941 @override |
| 11091 Token get beginToken => poundSign; | 10942 Token get beginToken => poundSign; |
| 11092 | 10943 |
| 11093 @override | 10944 @override |
| 11094 Token get endToken => components[components.length - 1]; | 10945 Token get endToken => components[components.length - 1]; |
| 11095 | 10946 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 11110 /** | 10961 /** |
| 11111 * The token representing the keyword. | 10962 * The token representing the keyword. |
| 11112 */ | 10963 */ |
| 11113 Token keyword; | 10964 Token keyword; |
| 11114 | 10965 |
| 11115 /** | 10966 /** |
| 11116 * Initialize a newly created this expression. | 10967 * Initialize a newly created this expression. |
| 11117 * | 10968 * |
| 11118 * @param keyword the token representing the keyword | 10969 * @param keyword the token representing the keyword |
| 11119 */ | 10970 */ |
| 11120 ThisExpression(Token keyword) { | 10971 ThisExpression(this.keyword); |
| 11121 this.keyword = keyword; | |
| 11122 } | |
| 11123 | 10972 |
| 11124 @override | 10973 @override |
| 11125 accept(AstVisitor visitor) => visitor.visitThisExpression(this); | 10974 accept(AstVisitor visitor) => visitor.visitThisExpression(this); |
| 11126 | 10975 |
| 11127 @override | 10976 @override |
| 11128 Token get beginToken => keyword; | 10977 Token get beginToken => keyword; |
| 11129 | 10978 |
| 11130 @override | 10979 @override |
| 11131 Token get endToken => keyword; | 10980 Token get endToken => keyword; |
| 11132 | 10981 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 11156 * The expression computing the exception to be thrown. | 11005 * The expression computing the exception to be thrown. |
| 11157 */ | 11006 */ |
| 11158 Expression _expression; | 11007 Expression _expression; |
| 11159 | 11008 |
| 11160 /** | 11009 /** |
| 11161 * Initialize a newly created throw expression. | 11010 * Initialize a newly created throw expression. |
| 11162 * | 11011 * |
| 11163 * @param keyword the token representing the 'throw' keyword | 11012 * @param keyword the token representing the 'throw' keyword |
| 11164 * @param expression the expression computing the exception to be thrown | 11013 * @param expression the expression computing the exception to be thrown |
| 11165 */ | 11014 */ |
| 11166 ThrowExpression(Token keyword, Expression expression) { | 11015 ThrowExpression(this.keyword, Expression expression) { |
| 11167 this.keyword = keyword; | |
| 11168 this._expression = becomeParentOf(expression); | 11016 this._expression = becomeParentOf(expression); |
| 11169 } | 11017 } |
| 11170 | 11018 |
| 11171 @override | 11019 @override |
| 11172 accept(AstVisitor visitor) => visitor.visitThrowExpression(this); | 11020 accept(AstVisitor visitor) => visitor.visitThrowExpression(this); |
| 11173 | 11021 |
| 11174 @override | 11022 @override |
| 11175 Token get beginToken => keyword; | 11023 Token get beginToken => keyword; |
| 11176 | 11024 |
| 11177 @override | 11025 @override |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11229 Token semicolon; | 11077 Token semicolon; |
| 11230 | 11078 |
| 11231 /** | 11079 /** |
| 11232 * Initialize a newly created top-level variable declaration. | 11080 * Initialize a newly created top-level variable declaration. |
| 11233 * | 11081 * |
| 11234 * @param comment the documentation comment associated with this variable | 11082 * @param comment the documentation comment associated with this variable |
| 11235 * @param metadata the annotations associated with this variable | 11083 * @param metadata the annotations associated with this variable |
| 11236 * @param variableList the top-level variables being declared | 11084 * @param variableList the top-level variables being declared |
| 11237 * @param semicolon the semicolon terminating the declaration | 11085 * @param semicolon the semicolon terminating the declaration |
| 11238 */ | 11086 */ |
| 11239 TopLevelVariableDeclaration(Comment comment, List<Annotation> metadata, Variab
leDeclarationList variableList, Token semicolon) : super(comment, metadata) { | 11087 TopLevelVariableDeclaration(Comment comment, List<Annotation> metadata, Variab
leDeclarationList variableList, this.semicolon) : super(comment, metadata) { |
| 11240 this._variableList = becomeParentOf(variableList); | 11088 this._variableList = becomeParentOf(variableList); |
| 11241 this.semicolon = semicolon; | |
| 11242 } | 11089 } |
| 11243 | 11090 |
| 11244 @override | 11091 @override |
| 11245 accept(AstVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this); | 11092 accept(AstVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this); |
| 11246 | 11093 |
| 11247 @override | 11094 @override |
| 11248 Element get element => null; | 11095 Element get element => null; |
| 11249 | 11096 |
| 11250 @override | 11097 @override |
| 11251 Token get endToken => semicolon; | 11098 Token get endToken => semicolon; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11317 | 11164 |
| 11318 /** | 11165 /** |
| 11319 * Initialize a newly created try statement. | 11166 * Initialize a newly created try statement. |
| 11320 * | 11167 * |
| 11321 * @param tryKeyword the token representing the 'try' keyword | 11168 * @param tryKeyword the token representing the 'try' keyword |
| 11322 * @param body the body of the statement | 11169 * @param body the body of the statement |
| 11323 * @param catchClauses the catch clauses contained in the try statement | 11170 * @param catchClauses the catch clauses contained in the try statement |
| 11324 * @param finallyKeyword the token representing the 'finally' keyword | 11171 * @param finallyKeyword the token representing the 'finally' keyword |
| 11325 * @param finallyBlock the finally block contained in the try statement | 11172 * @param finallyBlock the finally block contained in the try statement |
| 11326 */ | 11173 */ |
| 11327 TryStatement(Token tryKeyword, Block body, List<CatchClause> catchClauses, Tok
en finallyKeyword, Block finallyBlock) { | 11174 TryStatement(this.tryKeyword, Block body, List<CatchClause> catchClauses, this
.finallyKeyword, Block finallyBlock) { |
| 11328 this._catchClauses = new NodeList<CatchClause>(this); | 11175 this._catchClauses = new NodeList<CatchClause>(this); |
| 11329 this.tryKeyword = tryKeyword; | |
| 11330 this._body = becomeParentOf(body); | 11176 this._body = becomeParentOf(body); |
| 11331 this._catchClauses.addAll(catchClauses); | 11177 this._catchClauses.addAll(catchClauses); |
| 11332 this.finallyKeyword = finallyKeyword; | |
| 11333 this._finallyBlock = becomeParentOf(finallyBlock); | 11178 this._finallyBlock = becomeParentOf(finallyBlock); |
| 11334 } | 11179 } |
| 11335 | 11180 |
| 11336 @override | 11181 @override |
| 11337 accept(AstVisitor visitor) => visitor.visitTryStatement(this); | 11182 accept(AstVisitor visitor) => visitor.visitTryStatement(this); |
| 11338 | 11183 |
| 11339 @override | 11184 @override |
| 11340 Token get beginToken => tryKeyword; | 11185 Token get beginToken => tryKeyword; |
| 11341 | 11186 |
| 11342 /** | 11187 /** |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11423 Token semicolon; | 11268 Token semicolon; |
| 11424 | 11269 |
| 11425 /** | 11270 /** |
| 11426 * Initialize a newly created type alias. | 11271 * Initialize a newly created type alias. |
| 11427 * | 11272 * |
| 11428 * @param comment the documentation comment associated with this type alias | 11273 * @param comment the documentation comment associated with this type alias |
| 11429 * @param metadata the annotations associated with this type alias | 11274 * @param metadata the annotations associated with this type alias |
| 11430 * @param keyword the token representing the 'typedef' keyword | 11275 * @param keyword the token representing the 'typedef' keyword |
| 11431 * @param semicolon the semicolon terminating the declaration | 11276 * @param semicolon the semicolon terminating the declaration |
| 11432 */ | 11277 */ |
| 11433 TypeAlias(Comment comment, List<Annotation> metadata, Token keyword, Token sem
icolon) : super(comment, metadata) { | 11278 TypeAlias(Comment comment, List<Annotation> metadata, this.keyword, this.semic
olon) : super(comment, metadata); |
| 11434 this.keyword = keyword; | |
| 11435 this.semicolon = semicolon; | |
| 11436 } | |
| 11437 | 11279 |
| 11438 @override | 11280 @override |
| 11439 Token get endToken => semicolon; | 11281 Token get endToken => semicolon; |
| 11440 | 11282 |
| 11441 @override | 11283 @override |
| 11442 Token get firstTokenAfterCommentAndMetadata => keyword; | 11284 Token get firstTokenAfterCommentAndMetadata => keyword; |
| 11443 } | 11285 } |
| 11444 | 11286 |
| 11445 /** | 11287 /** |
| 11446 * Instances of the class `TypeArgumentList` represent a list of type arguments. | 11288 * Instances of the class `TypeArgumentList` represent a list of type arguments. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 11466 */ | 11308 */ |
| 11467 Token rightBracket; | 11309 Token rightBracket; |
| 11468 | 11310 |
| 11469 /** | 11311 /** |
| 11470 * Initialize a newly created list of type arguments. | 11312 * Initialize a newly created list of type arguments. |
| 11471 * | 11313 * |
| 11472 * @param leftBracket the left bracket | 11314 * @param leftBracket the left bracket |
| 11473 * @param arguments the type arguments associated with the type | 11315 * @param arguments the type arguments associated with the type |
| 11474 * @param rightBracket the right bracket | 11316 * @param rightBracket the right bracket |
| 11475 */ | 11317 */ |
| 11476 TypeArgumentList(Token leftBracket, List<TypeName> arguments, Token rightBrack
et) { | 11318 TypeArgumentList(this.leftBracket, List<TypeName> arguments, this.rightBracket
) { |
| 11477 this._arguments = new NodeList<TypeName>(this); | 11319 this._arguments = new NodeList<TypeName>(this); |
| 11478 this.leftBracket = leftBracket; | |
| 11479 this._arguments.addAll(arguments); | 11320 this._arguments.addAll(arguments); |
| 11480 this.rightBracket = rightBracket; | |
| 11481 } | 11321 } |
| 11482 | 11322 |
| 11483 @override | 11323 @override |
| 11484 accept(AstVisitor visitor) => visitor.visitTypeArgumentList(this); | 11324 accept(AstVisitor visitor) => visitor.visitTypeArgumentList(this); |
| 11485 | 11325 |
| 11486 /** | 11326 /** |
| 11487 * Return the type arguments associated with the type. | 11327 * Return the type arguments associated with the type. |
| 11488 * | 11328 * |
| 11489 * @return the type arguments associated with the type | 11329 * @return the type arguments associated with the type |
| 11490 */ | 11330 */ |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11624 | 11464 |
| 11625 /** | 11465 /** |
| 11626 * Initialize a newly created type parameter. | 11466 * Initialize a newly created type parameter. |
| 11627 * | 11467 * |
| 11628 * @param comment the documentation comment associated with the type parameter | 11468 * @param comment the documentation comment associated with the type parameter |
| 11629 * @param metadata the annotations associated with the type parameter | 11469 * @param metadata the annotations associated with the type parameter |
| 11630 * @param name the name of the type parameter | 11470 * @param name the name of the type parameter |
| 11631 * @param keyword the token representing the 'extends' keyword | 11471 * @param keyword the token representing the 'extends' keyword |
| 11632 * @param bound the name of the upper bound for legal arguments | 11472 * @param bound the name of the upper bound for legal arguments |
| 11633 */ | 11473 */ |
| 11634 TypeParameter(Comment comment, List<Annotation> metadata, SimpleIdentifier nam
e, Token keyword, TypeName bound) : super(comment, metadata) { | 11474 TypeParameter(Comment comment, List<Annotation> metadata, SimpleIdentifier nam
e, this.keyword, TypeName bound) : super(comment, metadata) { |
| 11635 this._name = becomeParentOf(name); | 11475 this._name = becomeParentOf(name); |
| 11636 this.keyword = keyword; | |
| 11637 this._bound = becomeParentOf(bound); | 11476 this._bound = becomeParentOf(bound); |
| 11638 } | 11477 } |
| 11639 | 11478 |
| 11640 @override | 11479 @override |
| 11641 accept(AstVisitor visitor) => visitor.visitTypeParameter(this); | 11480 accept(AstVisitor visitor) => visitor.visitTypeParameter(this); |
| 11642 | 11481 |
| 11643 /** | 11482 /** |
| 11644 * Return the name of the upper bound for legal arguments, or `null` if there
was no | 11483 * Return the name of the upper bound for legal arguments, or `null` if there
was no |
| 11645 * explicit upper bound. | 11484 * explicit upper bound. |
| 11646 * | 11485 * |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11700 * | 11539 * |
| 11701 * <pre> | 11540 * <pre> |
| 11702 * typeParameterList ::= | 11541 * typeParameterList ::= |
| 11703 * '<' [TypeParameter] (',' [TypeParameter])* '>' | 11542 * '<' [TypeParameter] (',' [TypeParameter])* '>' |
| 11704 * </pre> | 11543 * </pre> |
| 11705 */ | 11544 */ |
| 11706 class TypeParameterList extends AstNode { | 11545 class TypeParameterList extends AstNode { |
| 11707 /** | 11546 /** |
| 11708 * The left angle bracket. | 11547 * The left angle bracket. |
| 11709 */ | 11548 */ |
| 11710 Token leftBracket; | 11549 final Token leftBracket; |
| 11711 | 11550 |
| 11712 /** | 11551 /** |
| 11713 * The type parameters in the list. | 11552 * The type parameters in the list. |
| 11714 */ | 11553 */ |
| 11715 NodeList<TypeParameter> _typeParameters; | 11554 NodeList<TypeParameter> _typeParameters; |
| 11716 | 11555 |
| 11717 /** | 11556 /** |
| 11718 * The right angle bracket. | 11557 * The right angle bracket. |
| 11719 */ | 11558 */ |
| 11720 Token rightBracket; | 11559 final Token rightBracket; |
| 11721 | 11560 |
| 11722 /** | 11561 /** |
| 11723 * Initialize a newly created list of type parameters. | 11562 * Initialize a newly created list of type parameters. |
| 11724 * | 11563 * |
| 11725 * @param leftBracket the left angle bracket | 11564 * @param leftBracket the left angle bracket |
| 11726 * @param typeParameters the type parameters in the list | 11565 * @param typeParameters the type parameters in the list |
| 11727 * @param rightBracket the right angle bracket | 11566 * @param rightBracket the right angle bracket |
| 11728 */ | 11567 */ |
| 11729 TypeParameterList(Token leftBracket, List<TypeParameter> typeParameters, Token
rightBracket) { | 11568 TypeParameterList(this.leftBracket, List<TypeParameter> typeParameters, this.r
ightBracket) { |
| 11730 this._typeParameters = new NodeList<TypeParameter>(this); | 11569 this._typeParameters = new NodeList<TypeParameter>(this); |
| 11731 this.leftBracket = leftBracket; | |
| 11732 this._typeParameters.addAll(typeParameters); | 11570 this._typeParameters.addAll(typeParameters); |
| 11733 this.rightBracket = rightBracket; | |
| 11734 } | 11571 } |
| 11735 | 11572 |
| 11736 @override | 11573 @override |
| 11737 accept(AstVisitor visitor) => visitor.visitTypeParameterList(this); | 11574 accept(AstVisitor visitor) => visitor.visitTypeParameterList(this); |
| 11738 | 11575 |
| 11739 @override | 11576 @override |
| 11740 Token get beginToken => leftBracket; | 11577 Token get beginToken => leftBracket; |
| 11741 | 11578 |
| 11742 @override | 11579 @override |
| 11743 Token get endToken => rightBracket; | 11580 Token get endToken => rightBracket; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11777 */ | 11614 */ |
| 11778 TypeArgumentList typeArguments; | 11615 TypeArgumentList typeArguments; |
| 11779 | 11616 |
| 11780 /** | 11617 /** |
| 11781 * Initialize a newly created typed literal. | 11618 * Initialize a newly created typed literal. |
| 11782 * | 11619 * |
| 11783 * @param constKeyword the token representing the 'const' keyword | 11620 * @param constKeyword the token representing the 'const' keyword |
| 11784 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type | 11621 * @param typeArguments the type argument associated with this literal, or `nu
ll` if no type |
| 11785 * arguments were declared | 11622 * arguments were declared |
| 11786 */ | 11623 */ |
| 11787 TypedLiteral(Token constKeyword, TypeArgumentList typeArguments) { | 11624 TypedLiteral(this.constKeyword, TypeArgumentList typeArguments) { |
| 11788 this.constKeyword = constKeyword; | |
| 11789 this.typeArguments = becomeParentOf(typeArguments); | 11625 this.typeArguments = becomeParentOf(typeArguments); |
| 11790 } | 11626 } |
| 11791 | 11627 |
| 11792 @override | 11628 @override |
| 11793 void visitChildren(AstVisitor visitor) { | 11629 void visitChildren(AstVisitor visitor) { |
| 11794 safelyVisitChild(typeArguments, visitor); | 11630 safelyVisitChild(typeArguments, visitor); |
| 11795 } | 11631 } |
| 11796 } | 11632 } |
| 11797 | 11633 |
| 11798 /** | 11634 /** |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11895 | 11731 |
| 11896 /** | 11732 /** |
| 11897 * Initialize a newly created variable declaration. | 11733 * Initialize a newly created variable declaration. |
| 11898 * | 11734 * |
| 11899 * @param comment the documentation comment associated with this declaration | 11735 * @param comment the documentation comment associated with this declaration |
| 11900 * @param metadata the annotations associated with this member | 11736 * @param metadata the annotations associated with this member |
| 11901 * @param name the name of the variable being declared | 11737 * @param name the name of the variable being declared |
| 11902 * @param equals the equal sign separating the variable name from the initial
value | 11738 * @param equals the equal sign separating the variable name from the initial
value |
| 11903 * @param initializer the expression used to compute the initial value for the
variable | 11739 * @param initializer the expression used to compute the initial value for the
variable |
| 11904 */ | 11740 */ |
| 11905 VariableDeclaration(Comment comment, List<Annotation> metadata, SimpleIdentifi
er name, Token equals, Expression initializer) : super(comment, metadata) { | 11741 VariableDeclaration(Comment comment, List<Annotation> metadata, SimpleIdentifi
er name, this.equals, Expression initializer) : super(comment, metadata) { |
| 11906 this._name = becomeParentOf(name); | 11742 this._name = becomeParentOf(name); |
| 11907 this.equals = equals; | |
| 11908 this._initializer = becomeParentOf(initializer); | 11743 this._initializer = becomeParentOf(initializer); |
| 11909 } | 11744 } |
| 11910 | 11745 |
| 11911 @override | 11746 @override |
| 11912 accept(AstVisitor visitor) => visitor.visitVariableDeclaration(this); | 11747 accept(AstVisitor visitor) => visitor.visitVariableDeclaration(this); |
| 11913 | 11748 |
| 11914 /** | 11749 /** |
| 11915 * This overridden implementation of getDocumentationComment() looks in the gr
andparent node for | 11750 * This overridden implementation of getDocumentationComment() looks in the gr
andparent node for |
| 11916 * dartdoc comments if no documentation is specifically available on the node. | 11751 * dartdoc comments if no documentation is specifically available on the node. |
| 11917 */ | 11752 */ |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12040 | 11875 |
| 12041 /** | 11876 /** |
| 12042 * Initialize a newly created variable declaration list. | 11877 * Initialize a newly created variable declaration list. |
| 12043 * | 11878 * |
| 12044 * @param comment the documentation comment associated with this declaration l
ist | 11879 * @param comment the documentation comment associated with this declaration l
ist |
| 12045 * @param metadata the annotations associated with this declaration list | 11880 * @param metadata the annotations associated with this declaration list |
| 12046 * @param keyword the token representing the 'final', 'const' or 'var' keyword | 11881 * @param keyword the token representing the 'final', 'const' or 'var' keyword |
| 12047 * @param type the type of the variables being declared | 11882 * @param type the type of the variables being declared |
| 12048 * @param variables a list containing the individual variables being declared | 11883 * @param variables a list containing the individual variables being declared |
| 12049 */ | 11884 */ |
| 12050 VariableDeclarationList(Comment comment, List<Annotation> metadata, Token keyw
ord, TypeName type, List<VariableDeclaration> variables) : super(comment, metada
ta) { | 11885 VariableDeclarationList(Comment comment, List<Annotation> metadata, this.keywo
rd, TypeName type, List<VariableDeclaration> variables) : super(comment, metadat
a) { |
| 12051 this._variables = new NodeList<VariableDeclaration>(this); | 11886 this._variables = new NodeList<VariableDeclaration>(this); |
| 12052 this.keyword = keyword; | |
| 12053 this._type = becomeParentOf(type); | 11887 this._type = becomeParentOf(type); |
| 12054 this._variables.addAll(variables); | 11888 this._variables.addAll(variables); |
| 12055 } | 11889 } |
| 12056 | 11890 |
| 12057 @override | 11891 @override |
| 12058 accept(AstVisitor visitor) => visitor.visitVariableDeclarationList(this); | 11892 accept(AstVisitor visitor) => visitor.visitVariableDeclarationList(this); |
| 12059 | 11893 |
| 12060 @override | 11894 @override |
| 12061 Token get endToken => _variables.endToken; | 11895 Token get endToken => _variables.endToken; |
| 12062 | 11896 |
| 12063 /** | 11897 /** |
| 12064 * Return the type of the variables being declared, or `null` if no type was p
rovided. | 11898 * Return the type of the variables being declared, or `null` if no type was p
rovided. |
| 12065 * | 11899 * |
| 12066 * @return the type of the variables being declared | 11900 * @return the type of the variables being declared |
| 12067 */ | 11901 */ |
| 12068 TypeName get type => _type; | 11902 TypeName get type => _type; |
| 12069 | 11903 |
| 12070 /** | 11904 /** |
| 12071 * Return a list containing the individual variables being declared. | 11905 * Return a list containing the individual variables being declared. |
| 12072 * | 11906 * |
| 12073 * @return a list containing the individual variables being declared | 11907 * @return a list containing the individual variables being declared |
| 12074 */ | 11908 */ |
| 12075 NodeList<VariableDeclaration> get variables => _variables; | 11909 NodeList<VariableDeclaration> get variables => _variables; |
| 12076 | 11910 |
| 12077 /** | 11911 /** |
| 12078 * Return `true` if the variables in this list were declared with the 'const'
modifier. | 11912 * Return `true` if the variables in this list were declared with the 'const'
modifier. |
| 12079 * | 11913 * |
| 12080 * @return `true` if the variables in this list were declared with the 'const'
modifier | 11914 * @return `true` if the variables in this list were declared with the 'const'
modifier |
| 12081 */ | 11915 */ |
| 12082 bool get isConst => keyword is KeywordToken && identical((keyword as KeywordTo
ken).keyword, Keyword.CONST); | 11916 bool get isConst => keyword is KeywordToken && (keyword as KeywordToken).keywo
rd == Keyword.CONST; |
| 12083 | 11917 |
| 12084 /** | 11918 /** |
| 12085 * Return `true` if the variables in this list were declared with the 'final'
modifier. | 11919 * Return `true` if the variables in this list were declared with the 'final'
modifier. |
| 12086 * Variables that are declared with the 'const' modifier will return `false` e
ven though | 11920 * Variables that are declared with the 'const' modifier will return `false` e
ven though |
| 12087 * they are implicitly final. | 11921 * they are implicitly final. |
| 12088 * | 11922 * |
| 12089 * @return `true` if the variables in this list were declared with the 'final'
modifier | 11923 * @return `true` if the variables in this list were declared with the 'final'
modifier |
| 12090 */ | 11924 */ |
| 12091 bool get isFinal => keyword is KeywordToken && identical((keyword as KeywordTo
ken).keyword, Keyword.FINAL); | 11925 bool get isFinal => keyword is KeywordToken && (keyword as KeywordToken).keywo
rd == Keyword.FINAL; |
| 12092 | 11926 |
| 12093 /** | 11927 /** |
| 12094 * Set the type of the variables being declared to the given type name. | 11928 * Set the type of the variables being declared to the given type name. |
| 12095 * | 11929 * |
| 12096 * @param typeName the type of the variables being declared | 11930 * @param typeName the type of the variables being declared |
| 12097 */ | 11931 */ |
| 12098 void set type(TypeName typeName) { | 11932 void set type(TypeName typeName) { |
| 12099 _type = becomeParentOf(typeName); | 11933 _type = becomeParentOf(typeName); |
| 12100 } | 11934 } |
| 12101 | 11935 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12135 * The semicolon terminating the statement. | 11969 * The semicolon terminating the statement. |
| 12136 */ | 11970 */ |
| 12137 Token semicolon; | 11971 Token semicolon; |
| 12138 | 11972 |
| 12139 /** | 11973 /** |
| 12140 * Initialize a newly created variable declaration statement. | 11974 * Initialize a newly created variable declaration statement. |
| 12141 * | 11975 * |
| 12142 * @param variableList the fields being declared | 11976 * @param variableList the fields being declared |
| 12143 * @param semicolon the semicolon terminating the statement | 11977 * @param semicolon the semicolon terminating the statement |
| 12144 */ | 11978 */ |
| 12145 VariableDeclarationStatement(VariableDeclarationList variableList, Token semic
olon) { | 11979 VariableDeclarationStatement(VariableDeclarationList variableList, this.semico
lon) { |
| 12146 this._variableList = becomeParentOf(variableList); | 11980 this._variableList = becomeParentOf(variableList); |
| 12147 this.semicolon = semicolon; | |
| 12148 } | 11981 } |
| 12149 | 11982 |
| 12150 @override | 11983 @override |
| 12151 accept(AstVisitor visitor) => visitor.visitVariableDeclarationStatement(this); | 11984 accept(AstVisitor visitor) => visitor.visitVariableDeclarationStatement(this); |
| 12152 | 11985 |
| 12153 @override | 11986 @override |
| 12154 Token get beginToken => _variableList.beginToken; | 11987 Token get beginToken => _variableList.beginToken; |
| 12155 | 11988 |
| 12156 @override | 11989 @override |
| 12157 Token get endToken => semicolon; | 11990 Token get endToken => semicolon; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12214 | 12047 |
| 12215 /** | 12048 /** |
| 12216 * Initialize a newly created while statement. | 12049 * Initialize a newly created while statement. |
| 12217 * | 12050 * |
| 12218 * @param keyword the token representing the 'while' keyword | 12051 * @param keyword the token representing the 'while' keyword |
| 12219 * @param leftParenthesis the left parenthesis | 12052 * @param leftParenthesis the left parenthesis |
| 12220 * @param condition the expression used to determine whether to execute the bo
dy of the loop | 12053 * @param condition the expression used to determine whether to execute the bo
dy of the loop |
| 12221 * @param rightParenthesis the right parenthesis | 12054 * @param rightParenthesis the right parenthesis |
| 12222 * @param body the body of the loop | 12055 * @param body the body of the loop |
| 12223 */ | 12056 */ |
| 12224 WhileStatement(Token keyword, Token leftParenthesis, Expression condition, Tok
en rightParenthesis, Statement body) { | 12057 WhileStatement(this.keyword, this.leftParenthesis, Expression condition, this.
rightParenthesis, Statement body) { |
| 12225 this.keyword = keyword; | |
| 12226 this.leftParenthesis = leftParenthesis; | |
| 12227 this._condition = becomeParentOf(condition); | 12058 this._condition = becomeParentOf(condition); |
| 12228 this.rightParenthesis = rightParenthesis; | |
| 12229 this._body = becomeParentOf(body); | 12059 this._body = becomeParentOf(body); |
| 12230 } | 12060 } |
| 12231 | 12061 |
| 12232 @override | 12062 @override |
| 12233 accept(AstVisitor visitor) => visitor.visitWhileStatement(this); | 12063 accept(AstVisitor visitor) => visitor.visitWhileStatement(this); |
| 12234 | 12064 |
| 12235 @override | 12065 @override |
| 12236 Token get beginToken => keyword; | 12066 Token get beginToken => keyword; |
| 12237 | 12067 |
| 12238 /** | 12068 /** |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12511 return leftOperand || rightOperand; | 12341 return leftOperand || rightOperand; |
| 12512 } | 12342 } |
| 12513 } else if (node.operator.type == TokenType.CARET) { | 12343 } else if (node.operator.type == TokenType.CARET) { |
| 12514 // integer or {@code null} | 12344 // integer or {@code null} |
| 12515 if (leftOperand is int && rightOperand is int) { | 12345 if (leftOperand is int && rightOperand is int) { |
| 12516 return leftOperand ^ rightOperand; | 12346 return leftOperand ^ rightOperand; |
| 12517 } | 12347 } |
| 12518 } else if (node.operator.type == TokenType.EQ_EQ) { | 12348 } else if (node.operator.type == TokenType.EQ_EQ) { |
| 12519 // numeric, string, boolean, or {@code null} | 12349 // numeric, string, boolean, or {@code null} |
| 12520 if (leftOperand is bool && rightOperand is bool) { | 12350 if (leftOperand is bool && rightOperand is bool) { |
| 12521 return identical(leftOperand, rightOperand); | 12351 return leftOperand == rightOperand; |
| 12522 } else if (leftOperand is int && rightOperand is int) { | 12352 } else if (leftOperand is int && rightOperand is int) { |
| 12523 return leftOperand == rightOperand; | 12353 return leftOperand == rightOperand; |
| 12524 } else if (leftOperand is double && rightOperand is double) { | 12354 } else if (leftOperand is double && rightOperand is double) { |
| 12525 return leftOperand == rightOperand; | 12355 return leftOperand == rightOperand; |
| 12526 } else if (leftOperand is String && rightOperand is String) { | 12356 } else if (leftOperand is String && rightOperand is String) { |
| 12527 return leftOperand == rightOperand; | 12357 return leftOperand == rightOperand; |
| 12528 } | 12358 } |
| 12529 } else if (node.operator.type == TokenType.GT) { | 12359 } else if (node.operator.type == TokenType.GT) { |
| 12530 // numeric or {@code null} | 12360 // numeric or {@code null} |
| 12531 if (leftOperand is int && rightOperand is int) { | 12361 if (leftOperand is int && rightOperand is int) { |
| (...skipping 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14355 } | 14185 } |
| 14356 | 14186 |
| 14357 /** | 14187 /** |
| 14358 * Instances of the class `ToSourceVisitor` write a source representation of a v
isited AST | 14188 * Instances of the class `ToSourceVisitor` write a source representation of a v
isited AST |
| 14359 * node (and all of it's children) to a writer. | 14189 * node (and all of it's children) to a writer. |
| 14360 */ | 14190 */ |
| 14361 class ToSourceVisitor implements AstVisitor<Object> { | 14191 class ToSourceVisitor implements AstVisitor<Object> { |
| 14362 /** | 14192 /** |
| 14363 * The writer to which the source is to be written. | 14193 * The writer to which the source is to be written. |
| 14364 */ | 14194 */ |
| 14365 PrintWriter _writer; | 14195 final PrintWriter _writer; |
| 14366 | 14196 |
| 14367 /** | 14197 /** |
| 14368 * Initialize a newly created visitor to write source code representing the vi
sited nodes to the | 14198 * Initialize a newly created visitor to write source code representing the vi
sited nodes to the |
| 14369 * given writer. | 14199 * given writer. |
| 14370 * | 14200 * |
| 14371 * @param writer the writer to which the source is to be written | 14201 * @param writer the writer to which the source is to be written |
| 14372 */ | 14202 */ |
| 14373 ToSourceVisitor(PrintWriter writer) { | 14203 ToSourceVisitor(this._writer); |
| 14374 this._writer = writer; | |
| 14375 } | |
| 14376 | 14204 |
| 14377 @override | 14205 @override |
| 14378 Object visitAdjacentStrings(AdjacentStrings node) { | 14206 Object visitAdjacentStrings(AdjacentStrings node) { |
| 14379 _visitNodeListWithSeparator(node.strings, " "); | 14207 _visitNodeListWithSeparator(node.strings, " "); |
| 14380 return null; | 14208 return null; |
| 14381 } | 14209 } |
| 14382 | 14210 |
| 14383 @override | 14211 @override |
| 14384 Object visitAnnotation(Annotation node) { | 14212 Object visitAnnotation(Annotation node) { |
| 14385 _writer.print('@'); | 14213 _writer.print('@'); |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14715 String groupEnd = null; | 14543 String groupEnd = null; |
| 14716 _writer.print('('); | 14544 _writer.print('('); |
| 14717 NodeList<FormalParameter> parameters = node.parameters; | 14545 NodeList<FormalParameter> parameters = node.parameters; |
| 14718 int size = parameters.length; | 14546 int size = parameters.length; |
| 14719 for (int i = 0; i < size; i++) { | 14547 for (int i = 0; i < size; i++) { |
| 14720 FormalParameter parameter = parameters[i]; | 14548 FormalParameter parameter = parameters[i]; |
| 14721 if (i > 0) { | 14549 if (i > 0) { |
| 14722 _writer.print(", "); | 14550 _writer.print(", "); |
| 14723 } | 14551 } |
| 14724 if (groupEnd == null && parameter is DefaultFormalParameter) { | 14552 if (groupEnd == null && parameter is DefaultFormalParameter) { |
| 14725 if (identical(parameter.kind, ParameterKind.NAMED)) { | 14553 if (parameter.kind == ParameterKind.NAMED) { |
| 14726 groupEnd = "}"; | 14554 groupEnd = "}"; |
| 14727 _writer.print('{'); | 14555 _writer.print('{'); |
| 14728 } else { | 14556 } else { |
| 14729 groupEnd = "]"; | 14557 groupEnd = "]"; |
| 14730 _writer.print('['); | 14558 _writer.print('['); |
| 14731 } | 14559 } |
| 14732 } | 14560 } |
| 14733 parameter.accept(this); | 14561 parameter.accept(this); |
| 14734 } | 14562 } |
| 14735 if (groupEnd != null) { | 14563 if (groupEnd != null) { |
| (...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16217 | 16045 |
| 16218 @override | 16046 @override |
| 16219 bool visitBlockFunctionBody(BlockFunctionBody node) { | 16047 bool visitBlockFunctionBody(BlockFunctionBody node) { |
| 16220 BlockFunctionBody other = this._other as BlockFunctionBody; | 16048 BlockFunctionBody other = this._other as BlockFunctionBody; |
| 16221 return _isEqualNodes(node.block, other.block); | 16049 return _isEqualNodes(node.block, other.block); |
| 16222 } | 16050 } |
| 16223 | 16051 |
| 16224 @override | 16052 @override |
| 16225 bool visitBooleanLiteral(BooleanLiteral node) { | 16053 bool visitBooleanLiteral(BooleanLiteral node) { |
| 16226 BooleanLiteral other = this._other as BooleanLiteral; | 16054 BooleanLiteral other = this._other as BooleanLiteral; |
| 16227 return _isEqualTokens(node.literal, other.literal) && identical(node.value,
other.value); | 16055 return _isEqualTokens(node.literal, other.literal) && node.value == other.va
lue; |
| 16228 } | 16056 } |
| 16229 | 16057 |
| 16230 @override | 16058 @override |
| 16231 bool visitBreakStatement(BreakStatement node) { | 16059 bool visitBreakStatement(BreakStatement node) { |
| 16232 BreakStatement other = this._other as BreakStatement; | 16060 BreakStatement other = this._other as BreakStatement; |
| 16233 return _isEqualTokens(node.keyword, other.keyword) && _isEqualNodes(node.lab
el, other.label) && _isEqualTokens(node.semicolon, other.semicolon); | 16061 return _isEqualTokens(node.keyword, other.keyword) && _isEqualNodes(node.lab
el, other.label) && _isEqualTokens(node.semicolon, other.semicolon); |
| 16234 } | 16062 } |
| 16235 | 16063 |
| 16236 @override | 16064 @override |
| 16237 bool visitCascadeExpression(CascadeExpression node) { | 16065 bool visitCascadeExpression(CascadeExpression node) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16307 | 16135 |
| 16308 @override | 16136 @override |
| 16309 bool visitDeclaredIdentifier(DeclaredIdentifier node) { | 16137 bool visitDeclaredIdentifier(DeclaredIdentifier node) { |
| 16310 DeclaredIdentifier other = this._other as DeclaredIdentifier; | 16138 DeclaredIdentifier other = this._other as DeclaredIdentifier; |
| 16311 return _isEqualNodes(node.documentationComment, other.documentationComment)
&& _isEqualNodeLists(node.metadata, other.metadata) && _isEqualTokens(node.keywo
rd, other.keyword) && _isEqualNodes(node.type, other.type) && _isEqualNodes(node
.identifier, other.identifier); | 16139 return _isEqualNodes(node.documentationComment, other.documentationComment)
&& _isEqualNodeLists(node.metadata, other.metadata) && _isEqualTokens(node.keywo
rd, other.keyword) && _isEqualNodes(node.type, other.type) && _isEqualNodes(node
.identifier, other.identifier); |
| 16312 } | 16140 } |
| 16313 | 16141 |
| 16314 @override | 16142 @override |
| 16315 bool visitDefaultFormalParameter(DefaultFormalParameter node) { | 16143 bool visitDefaultFormalParameter(DefaultFormalParameter node) { |
| 16316 DefaultFormalParameter other = this._other as DefaultFormalParameter; | 16144 DefaultFormalParameter other = this._other as DefaultFormalParameter; |
| 16317 return _isEqualNodes(node.parameter, other.parameter) && identical(node.kind
, other.kind) && _isEqualTokens(node.separator, other.separator) && _isEqualNode
s(node.defaultValue, other.defaultValue); | 16145 return _isEqualNodes(node.parameter, other.parameter) && node.kind == other.
kind && _isEqualTokens(node.separator, other.separator) && _isEqualNodes(node.de
faultValue, other.defaultValue); |
| 16318 } | 16146 } |
| 16319 | 16147 |
| 16320 @override | 16148 @override |
| 16321 bool visitDoStatement(DoStatement node) { | 16149 bool visitDoStatement(DoStatement node) { |
| 16322 DoStatement other = this._other as DoStatement; | 16150 DoStatement other = this._other as DoStatement; |
| 16323 return _isEqualTokens(node.doKeyword, other.doKeyword) && _isEqualNodes(node
.body, other.body) && _isEqualTokens(node.whileKeyword, other.whileKeyword) && _
isEqualTokens(node.leftParenthesis, other.leftParenthesis) && _isEqualNodes(node
.condition, other.condition) && _isEqualTokens(node.rightParenthesis, other.righ
tParenthesis) && _isEqualTokens(node.semicolon, other.semicolon); | 16151 return _isEqualTokens(node.doKeyword, other.doKeyword) && _isEqualNodes(node
.body, other.body) && _isEqualTokens(node.whileKeyword, other.whileKeyword) && _
isEqualTokens(node.leftParenthesis, other.leftParenthesis) && _isEqualNodes(node
.condition, other.condition) && _isEqualTokens(node.rightParenthesis, other.righ
tParenthesis) && _isEqualTokens(node.semicolon, other.semicolon); |
| 16324 } | 16152 } |
| 16325 | 16153 |
| 16326 @override | 16154 @override |
| 16327 bool visitDoubleLiteral(DoubleLiteral node) { | 16155 bool visitDoubleLiteral(DoubleLiteral node) { |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16867 /** | 16695 /** |
| 16868 * Instances of the class `IncrementalAstCloner` implement an object that will c
lone any AST | 16696 * Instances of the class `IncrementalAstCloner` implement an object that will c
lone any AST |
| 16869 * structure that it visits. The cloner will clone the structure, replacing the
specified ASTNode | 16697 * structure that it visits. The cloner will clone the structure, replacing the
specified ASTNode |
| 16870 * with a new ASTNode, mapping the old token stream to a new token stream, and p
reserving resolution | 16698 * with a new ASTNode, mapping the old token stream to a new token stream, and p
reserving resolution |
| 16871 * results. | 16699 * results. |
| 16872 */ | 16700 */ |
| 16873 class IncrementalAstCloner implements AstVisitor<AstNode> { | 16701 class IncrementalAstCloner implements AstVisitor<AstNode> { |
| 16874 /** | 16702 /** |
| 16875 * The node to be replaced during the cloning process. | 16703 * The node to be replaced during the cloning process. |
| 16876 */ | 16704 */ |
| 16877 AstNode _oldNode; | 16705 final AstNode _oldNode; |
| 16878 | 16706 |
| 16879 /** | 16707 /** |
| 16880 * The replacement node used during the cloning process. | 16708 * The replacement node used during the cloning process. |
| 16881 */ | 16709 */ |
| 16882 AstNode _newNode; | 16710 final AstNode _newNode; |
| 16883 | 16711 |
| 16884 /** | 16712 /** |
| 16885 * A mapping of old tokens to new tokens used during the cloning process. | 16713 * A mapping of old tokens to new tokens used during the cloning process. |
| 16886 */ | 16714 */ |
| 16887 TokenMap _tokenMap; | 16715 final TokenMap _tokenMap; |
| 16888 | 16716 |
| 16889 /** | 16717 /** |
| 16890 * Construct a new instance that will replace `oldNode` with `newNode` in the
process | 16718 * Construct a new instance that will replace `oldNode` with `newNode` in the
process |
| 16891 * of cloning an existing AST structure. | 16719 * of cloning an existing AST structure. |
| 16892 * | 16720 * |
| 16893 * @param oldNode the node to be replaced | 16721 * @param oldNode the node to be replaced |
| 16894 * @param newNode the replacement node | 16722 * @param newNode the replacement node |
| 16895 * @param tokenMap a mapping of old tokens to new tokens (not `null`) | 16723 * @param tokenMap a mapping of old tokens to new tokens (not `null`) |
| 16896 */ | 16724 */ |
| 16897 IncrementalAstCloner(AstNode oldNode, AstNode newNode, TokenMap tokenMap) { | 16725 IncrementalAstCloner(this._oldNode, this._newNode, this._tokenMap); |
| 16898 this._oldNode = oldNode; | |
| 16899 this._newNode = newNode; | |
| 16900 this._tokenMap = tokenMap; | |
| 16901 } | |
| 16902 | 16726 |
| 16903 @override | 16727 @override |
| 16904 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri
ngs(_cloneNodeList(node.strings)); | 16728 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri
ngs(_cloneNodeList(node.strings)); |
| 16905 | 16729 |
| 16906 @override | 16730 @override |
| 16907 Annotation visitAnnotation(Annotation node) { | 16731 Annotation visitAnnotation(Annotation node) { |
| 16908 Annotation copy = new Annotation(_mapToken(node.atSign), _cloneNode(node.nam
e), _mapToken(node.period), _cloneNode(node.constructorName), _cloneNode(node.ar
guments)); | 16732 Annotation copy = new Annotation(_mapToken(node.atSign), _cloneNode(node.nam
e), _mapToken(node.period), _cloneNode(node.constructorName), _cloneNode(node.ar
guments)); |
| 16909 copy.element = node.element; | 16733 copy.element = node.element; |
| 16910 return copy; | 16734 return copy; |
| 16911 } | 16735 } |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17506 * Completion test code coverage is 95%. The two basic blocks that are not execu
ted cannot be | 17330 * Completion test code coverage is 95%. The two basic blocks that are not execu
ted cannot be |
| 17507 * executed. They are included for future reference. | 17331 * executed. They are included for future reference. |
| 17508 */ | 17332 */ |
| 17509 class ScopedNameFinder extends GeneralizingAstVisitor<Object> { | 17333 class ScopedNameFinder extends GeneralizingAstVisitor<Object> { |
| 17510 Declaration _declarationNode; | 17334 Declaration _declarationNode; |
| 17511 | 17335 |
| 17512 AstNode _immediateChild; | 17336 AstNode _immediateChild; |
| 17513 | 17337 |
| 17514 Map<String, SimpleIdentifier> _locals = new Map<String, SimpleIdentifier>(); | 17338 Map<String, SimpleIdentifier> _locals = new Map<String, SimpleIdentifier>(); |
| 17515 | 17339 |
| 17516 int _position = 0; | 17340 final int _position; |
| 17517 | 17341 |
| 17518 bool _referenceIsWithinLocalFunction = false; | 17342 bool _referenceIsWithinLocalFunction = false; |
| 17519 | 17343 |
| 17520 ScopedNameFinder(int position) { | 17344 ScopedNameFinder(this._position); |
| 17521 this._position = position; | |
| 17522 } | |
| 17523 | 17345 |
| 17524 Declaration get declaration => _declarationNode; | 17346 Declaration get declaration => _declarationNode; |
| 17525 | 17347 |
| 17526 Map<String, SimpleIdentifier> get locals => _locals; | 17348 Map<String, SimpleIdentifier> get locals => _locals; |
| 17527 | 17349 |
| 17528 @override | 17350 @override |
| 17529 Object visitBlock(Block node) { | 17351 Object visitBlock(Block node) { |
| 17530 _checkStatements(node.statements); | 17352 _checkStatements(node.statements); |
| 17531 return super.visitBlock(node); | 17353 return super.visitBlock(node); |
| 17532 } | 17354 } |
| 17533 | 17355 |
| 17534 @override | 17356 @override |
| 17535 Object visitCatchClause(CatchClause node) { | 17357 Object visitCatchClause(CatchClause node) { |
| 17536 _addToScope(node.exceptionParameter); | 17358 _addToScope(node.exceptionParameter); |
| 17537 _addToScope(node.stackTraceParameter); | 17359 _addToScope(node.stackTraceParameter); |
| 17538 return super.visitCatchClause(node); | 17360 return super.visitCatchClause(node); |
| 17539 } | 17361 } |
| 17540 | 17362 |
| 17541 @override | 17363 @override |
| 17542 Object visitConstructorDeclaration(ConstructorDeclaration node) { | 17364 Object visitConstructorDeclaration(ConstructorDeclaration node) { |
| 17543 if (_immediateChild != node.parameters) { | 17365 if (!identical(_immediateChild, node.parameters)) { |
| 17544 _addParameters(node.parameters.parameters); | 17366 _addParameters(node.parameters.parameters); |
| 17545 } | 17367 } |
| 17546 _declarationNode = node; | 17368 _declarationNode = node; |
| 17547 return null; | 17369 return null; |
| 17548 } | 17370 } |
| 17549 | 17371 |
| 17550 @override | 17372 @override |
| 17551 Object visitFieldDeclaration(FieldDeclaration node) { | 17373 Object visitFieldDeclaration(FieldDeclaration node) { |
| 17552 _declarationNode = node; | 17374 _declarationNode = node; |
| 17553 return null; | 17375 return null; |
| 17554 } | 17376 } |
| 17555 | 17377 |
| 17556 @override | 17378 @override |
| 17557 Object visitForEachStatement(ForEachStatement node) { | 17379 Object visitForEachStatement(ForEachStatement node) { |
| 17558 DeclaredIdentifier loopVariable = node.loopVariable; | 17380 DeclaredIdentifier loopVariable = node.loopVariable; |
| 17559 if (loopVariable != null) { | 17381 if (loopVariable != null) { |
| 17560 _addToScope(loopVariable.identifier); | 17382 _addToScope(loopVariable.identifier); |
| 17561 } | 17383 } |
| 17562 return super.visitForEachStatement(node); | 17384 return super.visitForEachStatement(node); |
| 17563 } | 17385 } |
| 17564 | 17386 |
| 17565 @override | 17387 @override |
| 17566 Object visitForStatement(ForStatement node) { | 17388 Object visitForStatement(ForStatement node) { |
| 17567 if (_immediateChild != node.variables && node.variables != null) { | 17389 if (!identical(_immediateChild, node.variables) && node.variables != null) { |
| 17568 _addVariables(node.variables.variables); | 17390 _addVariables(node.variables.variables); |
| 17569 } | 17391 } |
| 17570 return super.visitForStatement(node); | 17392 return super.visitForStatement(node); |
| 17571 } | 17393 } |
| 17572 | 17394 |
| 17573 @override | 17395 @override |
| 17574 Object visitFunctionDeclaration(FunctionDeclaration node) { | 17396 Object visitFunctionDeclaration(FunctionDeclaration node) { |
| 17575 if (node.parent is! FunctionDeclarationStatement) { | 17397 if (node.parent is! FunctionDeclarationStatement) { |
| 17576 _declarationNode = node; | 17398 _declarationNode = node; |
| 17577 return null; | 17399 return null; |
| 17578 } | 17400 } |
| 17579 return super.visitFunctionDeclaration(node); | 17401 return super.visitFunctionDeclaration(node); |
| 17580 } | 17402 } |
| 17581 | 17403 |
| 17582 @override | 17404 @override |
| 17583 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { | 17405 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { |
| 17584 _referenceIsWithinLocalFunction = true; | 17406 _referenceIsWithinLocalFunction = true; |
| 17585 return super.visitFunctionDeclarationStatement(node); | 17407 return super.visitFunctionDeclarationStatement(node); |
| 17586 } | 17408 } |
| 17587 | 17409 |
| 17588 @override | 17410 @override |
| 17589 Object visitFunctionExpression(FunctionExpression node) { | 17411 Object visitFunctionExpression(FunctionExpression node) { |
| 17590 if (node.parameters != null && _immediateChild != node.parameters) { | 17412 if (node.parameters != null && !identical(_immediateChild, node.parameters))
{ |
| 17591 _addParameters(node.parameters.parameters); | 17413 _addParameters(node.parameters.parameters); |
| 17592 } | 17414 } |
| 17593 return super.visitFunctionExpression(node); | 17415 return super.visitFunctionExpression(node); |
| 17594 } | 17416 } |
| 17595 | 17417 |
| 17596 @override | 17418 @override |
| 17597 Object visitMethodDeclaration(MethodDeclaration node) { | 17419 Object visitMethodDeclaration(MethodDeclaration node) { |
| 17598 _declarationNode = node; | 17420 _declarationNode = node; |
| 17599 if (node.parameters == null) { | 17421 if (node.parameters == null) { |
| 17600 return null; | 17422 return null; |
| 17601 } | 17423 } |
| 17602 if (_immediateChild != node.parameters) { | 17424 if (!identical(_immediateChild, node.parameters)) { |
| 17603 _addParameters(node.parameters.parameters); | 17425 _addParameters(node.parameters.parameters); |
| 17604 } | 17426 } |
| 17605 return null; | 17427 return null; |
| 17606 } | 17428 } |
| 17607 | 17429 |
| 17608 @override | 17430 @override |
| 17609 Object visitNode(AstNode node) { | 17431 Object visitNode(AstNode node) { |
| 17610 _immediateChild = node; | 17432 _immediateChild = node; |
| 17611 AstNode parent = node.parent; | 17433 AstNode parent = node.parent; |
| 17612 if (parent != null) { | 17434 if (parent != null) { |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17798 _elements[index] = node; | 17620 _elements[index] = node; |
| 17799 } | 17621 } |
| 17800 void clear() { | 17622 void clear() { |
| 17801 _elements = <E> []; | 17623 _elements = <E> []; |
| 17802 } | 17624 } |
| 17803 int get length => _elements.length; | 17625 int get length => _elements.length; |
| 17804 void set length(int value) { | 17626 void set length(int value) { |
| 17805 throw new UnsupportedError("Cannot resize NodeList."); | 17627 throw new UnsupportedError("Cannot resize NodeList."); |
| 17806 } | 17628 } |
| 17807 } | 17629 } |
| OLD | NEW |