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

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

Issue 17317002: Convert isX() methods to isX getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 library engine.ast; 3 library engine.ast;
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'java_core.dart'; 5 import 'java_core.dart';
6 import 'java_engine.dart'; 6 import 'java_engine.dart';
7 import 'error.dart'; 7 import 'error.dart';
8 import 'source.dart' show LineInfo; 8 import 'source.dart' show LineInfo;
9 import 'scanner.dart'; 9 import 'scanner.dart';
10 import 'engine.dart' show AnalysisEngine; 10 import 'engine.dart' show AnalysisEngine;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 138 }
139 return root; 139 return root;
140 } 140 }
141 141
142 /** 142 /**
143 * Return `true` if this node is a synthetic node. A synthetic node is a node that was 143 * Return `true` if this node is a synthetic node. A synthetic node is a node that was
144 * introduced by the parser in order to recover from an error in the code. Syn thetic nodes always 144 * introduced by the parser in order to recover from an error in the code. Syn thetic nodes always
145 * have a length of zero (`0`). 145 * have a length of zero (`0`).
146 * @return `true` if this node is a synthetic node 146 * @return `true` if this node is a synthetic node
147 */ 147 */
148 bool isSynthetic() => false; 148 bool get isSynthetic => false;
149 149
150 /** 150 /**
151 * Set the value of the property with the given name to the given value. If th e value is`null`, the property will effectively be removed. 151 * Set the value of the property with the given name to the given value. If th e value is`null`, the property will effectively be removed.
152 * @param propertyName the name of the property whose value is to be set 152 * @param propertyName the name of the property whose value is to be set
153 * @param propertyValue the new value of the property 153 * @param propertyValue the new value of the property
154 */ 154 */
155 void setProperty(String propertyName, Object propertyValue) { 155 void setProperty(String propertyName, Object propertyValue) {
156 if (propertyValue == null) { 156 if (propertyValue == null) {
157 if (_propertyMap != null) { 157 if (_propertyMap != null) {
158 _propertyMap.remove(propertyName); 158 _propertyMap.remove(propertyName);
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 * Return the token representing the literal. 1665 * Return the token representing the literal.
1666 * @return the token representing the literal 1666 * @return the token representing the literal
1667 */ 1667 */
1668 Token get literal => _literal; 1668 Token get literal => _literal;
1669 1669
1670 /** 1670 /**
1671 * Return the value of the literal. 1671 * Return the value of the literal.
1672 * @return the value of the literal 1672 * @return the value of the literal
1673 */ 1673 */
1674 bool get value => _value; 1674 bool get value => _value;
1675 bool isSynthetic() => _literal.isSynthetic(); 1675 bool get isSynthetic => _literal.isSynthetic;
1676 1676
1677 /** 1677 /**
1678 * Set the token representing the literal to the given token. 1678 * Set the token representing the literal to the given token.
1679 * @param literal the token representing the literal 1679 * @param literal the token representing the literal
1680 */ 1680 */
1681 void set literal(Token literal2) { 1681 void set literal(Token literal2) {
1682 this._literal = literal2; 1682 this._literal = literal2;
1683 } 1683 }
1684 1684
1685 /** 1685 /**
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
2721 /** 2721 /**
2722 * Return the tokens representing the comment. 2722 * Return the tokens representing the comment.
2723 * @return the tokens representing the comment 2723 * @return the tokens representing the comment
2724 */ 2724 */
2725 List<Token> get tokens => _tokens; 2725 List<Token> get tokens => _tokens;
2726 2726
2727 /** 2727 /**
2728 * Return `true` if this is a block comment. 2728 * Return `true` if this is a block comment.
2729 * @return `true` if this is a block comment 2729 * @return `true` if this is a block comment
2730 */ 2730 */
2731 bool isBlock() => identical(_type, CommentType.BLOCK); 2731 bool get isBlock => identical(_type, CommentType.BLOCK);
2732 2732
2733 /** 2733 /**
2734 * Return `true` if this is a documentation comment. 2734 * Return `true` if this is a documentation comment.
2735 * @return `true` if this is a documentation comment 2735 * @return `true` if this is a documentation comment
2736 */ 2736 */
2737 bool isDocumentation() => identical(_type, CommentType.DOCUMENTATION); 2737 bool get isDocumentation => identical(_type, CommentType.DOCUMENTATION);
2738 2738
2739 /** 2739 /**
2740 * Return `true` if this is an end-of-line comment. 2740 * Return `true` if this is an end-of-line comment.
2741 * @return `true` if this is an end-of-line comment 2741 * @return `true` if this is an end-of-line comment
2742 */ 2742 */
2743 bool isEndOfLine() => identical(_type, CommentType.END_OF_LINE); 2743 bool get isEndOfLine => identical(_type, CommentType.END_OF_LINE);
2744 void visitChildren(ASTVisitor<Object> visitor) { 2744 void visitChildren(ASTVisitor<Object> visitor) {
2745 _references.accept(visitor); 2745 _references.accept(visitor);
2746 } 2746 }
2747 } 2747 }
2748 /** 2748 /**
2749 * 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
2750 * recognized by the parser. 2750 * recognized by the parser.
2751 */ 2751 */
2752 class CommentType implements Comparable<CommentType> { 2752 class CommentType implements Comparable<CommentType> {
2753 2753
(...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after
4108 * Return the name of the declared type of the parameter, or `null` if the par ameter does 4108 * Return the name of the declared type of the parameter, or `null` if the par ameter does
4109 * not have a declared type. 4109 * not have a declared type.
4110 * @return the name of the declared type of the parameter 4110 * @return the name of the declared type of the parameter
4111 */ 4111 */
4112 TypeName get type => _type; 4112 TypeName get type => _type;
4113 4113
4114 /** 4114 /**
4115 * Return `true` if this variable was declared with the 'const' modifier. 4115 * Return `true` if this variable was declared with the 'const' modifier.
4116 * @return `true` if this variable was declared with the 'const' modifier 4116 * @return `true` if this variable was declared with the 'const' modifier
4117 */ 4117 */
4118 bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.CONST); 4118 bool get isConst => (_keyword is KeywordToken) && identical(((_keyword as Keyw ordToken)).keyword, Keyword.CONST);
4119 4119
4120 /** 4120 /**
4121 * Return `true` if this variable was declared with the 'final' modifier. Vari ables that are 4121 * Return `true` if this variable was declared with the 'final' modifier. Vari ables that are
4122 * declared with the 'const' modifier will return `false` even though they are implicitly 4122 * declared with the 'const' modifier will return `false` even though they are implicitly
4123 * final. 4123 * final.
4124 * @return `true` if this variable was declared with the 'final' modifier 4124 * @return `true` if this variable was declared with the 'final' modifier
4125 */ 4125 */
4126 bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.FINAL); 4126 bool get isFinal => (_keyword is KeywordToken) && identical(((_keyword as Keyw ordToken)).keyword, Keyword.FINAL);
4127 4127
4128 /** 4128 /**
4129 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token. 4129 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
4130 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 4130 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
4131 */ 4131 */
4132 void set keyword(Token keyword2) { 4132 void set keyword(Token keyword2) {
4133 this._keyword = keyword2; 4133 this._keyword = keyword2;
4134 } 4134 }
4135 4135
4136 /** 4136 /**
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
4238 * Return the token separating the parameter from the default value, or `null` if there is 4238 * Return the token separating the parameter from the default value, or `null` if there is
4239 * no default value. 4239 * no default value.
4240 * @return the token separating the parameter from the default value 4240 * @return the token separating the parameter from the default value
4241 */ 4241 */
4242 Token get separator => _separator; 4242 Token get separator => _separator;
4243 4243
4244 /** 4244 /**
4245 * Return `true` if this parameter was declared with the 'const' modifier. 4245 * Return `true` if this parameter was declared with the 'const' modifier.
4246 * @return `true` if this parameter was declared with the 'const' modifier 4246 * @return `true` if this parameter was declared with the 'const' modifier
4247 */ 4247 */
4248 bool isConst() => _parameter != null && _parameter.isConst(); 4248 bool get isConst => _parameter != null && _parameter.isConst;
4249 4249
4250 /** 4250 /**
4251 * Return `true` if this parameter was declared with the 'final' modifier. Par ameters that 4251 * Return `true` if this parameter was declared with the 'final' modifier. Par ameters that
4252 * are declared with the 'const' modifier will return `false` even though they are 4252 * are declared with the 'const' modifier will return `false` even though they are
4253 * implicitly final. 4253 * implicitly final.
4254 * @return `true` if this parameter was declared with the 'final' modifier 4254 * @return `true` if this parameter was declared with the 'final' modifier
4255 */ 4255 */
4256 bool isFinal() => _parameter != null && _parameter.isFinal(); 4256 bool get isFinal => _parameter != null && _parameter.isFinal;
4257 4257
4258 /** 4258 /**
4259 * Set the expression computing the default value for the parameter to the giv en expression. 4259 * Set the expression computing the default value for the parameter to the giv en expression.
4260 * @param expression the expression computing the default value for the parame ter 4260 * @param expression the expression computing the default value for the parame ter
4261 */ 4261 */
4262 void set defaultValue(Expression expression) { 4262 void set defaultValue(Expression expression) {
4263 _defaultValue = becomeParentOf(expression); 4263 _defaultValue = becomeParentOf(expression);
4264 } 4264 }
4265 4265
4266 /** 4266 /**
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
4845 * Return the static type of this expression, or `null` if the AST structure h as not been 4845 * Return the static type of this expression, or `null` if the AST structure h as not been
4846 * resolved. 4846 * resolved.
4847 * @return the static type of this expression 4847 * @return the static type of this expression
4848 */ 4848 */
4849 Type2 get staticType => _staticType; 4849 Type2 get staticType => _staticType;
4850 4850
4851 /** 4851 /**
4852 * Return `true` if this expression is syntactically valid for the LHS of an[A ssignmentExpression assignment expression]. 4852 * Return `true` if this expression is syntactically valid for the LHS of an[A ssignmentExpression assignment expression].
4853 * @return `true` if this expression matches the `assignableExpression` produc tion 4853 * @return `true` if this expression matches the `assignableExpression` produc tion
4854 */ 4854 */
4855 bool isAssignable() => false; 4855 bool get isAssignable => false;
4856 4856
4857 /** 4857 /**
4858 * Set the propagated type of this expression to the given type. 4858 * Set the propagated type of this expression to the given type.
4859 * @param propagatedType the propagated type of this expression 4859 * @param propagatedType the propagated type of this expression
4860 */ 4860 */
4861 void set propagatedType(Type2 propagatedType2) { 4861 void set propagatedType(Type2 propagatedType2) {
4862 this._propagatedType = propagatedType2; 4862 this._propagatedType = propagatedType2;
4863 } 4863 }
4864 4864
4865 /** 4865 /**
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
5021 * Return the expression that comprises the statement. 5021 * Return the expression that comprises the statement.
5022 * @return the expression that comprises the statement 5022 * @return the expression that comprises the statement
5023 */ 5023 */
5024 Expression get expression => _expression; 5024 Expression get expression => _expression;
5025 5025
5026 /** 5026 /**
5027 * Return the semicolon terminating the statement. 5027 * Return the semicolon terminating the statement.
5028 * @return the semicolon terminating the statement 5028 * @return the semicolon terminating the statement
5029 */ 5029 */
5030 Token get semicolon => _semicolon; 5030 Token get semicolon => _semicolon;
5031 bool isSynthetic() => _expression.isSynthetic() && _semicolon.isSynthetic(); 5031 bool get isSynthetic => _expression.isSynthetic && _semicolon.isSynthetic;
5032 5032
5033 /** 5033 /**
5034 * Set the expression that comprises the statement to the given expression. 5034 * Set the expression that comprises the statement to the given expression.
5035 * @param expression the expression that comprises the statement 5035 * @param expression the expression that comprises the statement
5036 */ 5036 */
5037 void set expression(Expression expression2) { 5037 void set expression(Expression expression2) {
5038 this._expression = becomeParentOf(expression2); 5038 this._expression = becomeParentOf(expression2);
5039 } 5039 }
5040 5040
5041 /** 5041 /**
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
5189 /** 5189 /**
5190 * Return the semicolon terminating the declaration. 5190 * Return the semicolon terminating the declaration.
5191 * @return the semicolon terminating the declaration 5191 * @return the semicolon terminating the declaration
5192 */ 5192 */
5193 Token get semicolon => _semicolon; 5193 Token get semicolon => _semicolon;
5194 5194
5195 /** 5195 /**
5196 * Return `true` if the fields are static. 5196 * Return `true` if the fields are static.
5197 * @return `true` if the fields are declared to be static 5197 * @return `true` if the fields are declared to be static
5198 */ 5198 */
5199 bool isStatic() => _keyword != null; 5199 bool get isStatic => _keyword != null;
5200 5200
5201 /** 5201 /**
5202 * Set the fields being declared to the given list of variables. 5202 * Set the fields being declared to the given list of variables.
5203 * @param fieldList the fields being declared 5203 * @param fieldList the fields being declared
5204 */ 5204 */
5205 void set fields(VariableDeclarationList fieldList) { 5205 void set fields(VariableDeclarationList fieldList) {
5206 fieldList = becomeParentOf(fieldList); 5206 fieldList = becomeParentOf(fieldList);
5207 } 5207 }
5208 5208
5209 /** 5209 /**
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
5319 * @return the token representing the 'this' keyword 5319 * @return the token representing the 'this' keyword
5320 */ 5320 */
5321 Token get thisToken => _thisToken; 5321 Token get thisToken => _thisToken;
5322 5322
5323 /** 5323 /**
5324 * Return the name of the declared type of the parameter, or `null` if the par ameter does 5324 * Return the name of the declared type of the parameter, or `null` if the par ameter does
5325 * not have a declared type. 5325 * not have a declared type.
5326 * @return the name of the declared type of the parameter 5326 * @return the name of the declared type of the parameter
5327 */ 5327 */
5328 TypeName get type => _type; 5328 TypeName get type => _type;
5329 bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.CONST); 5329 bool get isConst => (_keyword is KeywordToken) && identical(((_keyword as Keyw ordToken)).keyword, Keyword.CONST);
5330 bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.FINAL); 5330 bool get isFinal => (_keyword is KeywordToken) && identical(((_keyword as Keyw ordToken)).keyword, Keyword.FINAL);
5331 5331
5332 /** 5332 /**
5333 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token. 5333 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
5334 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 5334 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
5335 */ 5335 */
5336 void set keyword(Token keyword2) { 5336 void set keyword(Token keyword2) {
5337 this._keyword = keyword2; 5337 this._keyword = keyword2;
5338 } 5338 }
5339 5339
5340 /** 5340 /**
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
6105 /** 6105 /**
6106 * Return the return type of the function, or `null` if no return type was dec lared. 6106 * Return the return type of the function, or `null` if no return type was dec lared.
6107 * @return the return type of the function 6107 * @return the return type of the function
6108 */ 6108 */
6109 TypeName get returnType => _returnType; 6109 TypeName get returnType => _returnType;
6110 6110
6111 /** 6111 /**
6112 * Return `true` if this function declares a getter. 6112 * Return `true` if this function declares a getter.
6113 * @return `true` if this function declares a getter 6113 * @return `true` if this function declares a getter
6114 */ 6114 */
6115 bool isGetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET); 6115 bool get isGetter => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET);
6116 6116
6117 /** 6117 /**
6118 * Return `true` if this function declares a setter. 6118 * Return `true` if this function declares a setter.
6119 * @return `true` if this function declares a setter 6119 * @return `true` if this function declares a setter
6120 */ 6120 */
6121 bool isSetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET); 6121 bool get isSetter => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET);
6122 6122
6123 /** 6123 /**
6124 * Set the token representing the 'external' keyword to the given token. 6124 * Set the token representing the 'external' keyword to the given token.
6125 * @param externalKeyword the token representing the 'external' keyword 6125 * @param externalKeyword the token representing the 'external' keyword
6126 */ 6126 */
6127 void set externalKeyword(Token externalKeyword2) { 6127 void set externalKeyword(Token externalKeyword2) {
6128 this._externalKeyword = externalKeyword2; 6128 this._externalKeyword = externalKeyword2;
6129 } 6129 }
6130 6130
6131 /** 6131 /**
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
6635 * @return the parameters of the function-typed parameter 6635 * @return the parameters of the function-typed parameter
6636 */ 6636 */
6637 FormalParameterList get parameters => _parameters; 6637 FormalParameterList get parameters => _parameters;
6638 6638
6639 /** 6639 /**
6640 * Return the return type of the function, or `null` if the function does not have a return 6640 * Return the return type of the function, or `null` if the function does not have a return
6641 * type. 6641 * type.
6642 * @return the return type of the function 6642 * @return the return type of the function
6643 */ 6643 */
6644 TypeName get returnType => _returnType; 6644 TypeName get returnType => _returnType;
6645 bool isConst() => false; 6645 bool get isConst => false;
6646 bool isFinal() => false; 6646 bool get isFinal => false;
6647 6647
6648 /** 6648 /**
6649 * Set the parameters of the function-typed parameter to the given parameters. 6649 * Set the parameters of the function-typed parameter to the given parameters.
6650 * @param parameters the parameters of the function-typed parameter 6650 * @param parameters the parameters of the function-typed parameter
6651 */ 6651 */
6652 void set parameters(FormalParameterList parameters2) { 6652 void set parameters(FormalParameterList parameters2) {
6653 this._parameters = becomeParentOf(parameters2); 6653 this._parameters = becomeParentOf(parameters2);
6654 } 6654 }
6655 6655
6656 /** 6656 /**
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
6742 */ 6742 */
6743 String get name; 6743 String get name;
6744 6744
6745 /** 6745 /**
6746 * Return the element associated with this identifier based on static type inf ormation, or`null` if the AST structure has not been resolved or if this identif ier could not be 6746 * Return the element associated with this identifier based on static type inf ormation, or`null` if the AST structure has not been resolved or if this identif ier could not be
6747 * resolved. One example of the latter case is an identifier that is not defin ed within the scope 6747 * resolved. One example of the latter case is an identifier that is not defin ed within the scope
6748 * in which it appears 6748 * in which it appears
6749 * @return the element associated with the operator 6749 * @return the element associated with the operator
6750 */ 6750 */
6751 Element get staticElement; 6751 Element get staticElement;
6752 bool isAssignable() => true; 6752 bool get isAssignable => true;
6753 } 6753 }
6754 /** 6754 /**
6755 * Instances of the class `IfStatement` represent an if statement. 6755 * Instances of the class `IfStatement` represent an if statement.
6756 * <pre> 6756 * <pre>
6757 * ifStatement ::= 6757 * ifStatement ::=
6758 * 'if' '(' [Expression expression] ')' [Statement thenStatement] ('else' [State ment elseStatement])? 6758 * 'if' '(' [Expression expression] ')' [Statement thenStatement] ('else' [State ment elseStatement])?
6759 * </pre> 6759 * </pre>
6760 * @coverage dart.engine.ast 6760 * @coverage dart.engine.ast
6761 */ 6761 */
6762 class IfStatement extends Statement { 6762 class IfStatement extends Statement {
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
7245 7245
7246 /** 7246 /**
7247 * Return the expression used to compute the object being indexed. If this ind ex expression is not 7247 * Return the expression used to compute the object being indexed. If this ind ex expression is not
7248 * part of a cascade expression, then this is the same as [getArray]. If this index 7248 * part of a cascade expression, then this is the same as [getArray]. If this index
7249 * expression is part of a cascade expression, then the target expression stor ed with the cascade 7249 * expression is part of a cascade expression, then the target expression stor ed with the cascade
7250 * expression is returned. 7250 * expression is returned.
7251 * @return the expression used to compute the object being indexed 7251 * @return the expression used to compute the object being indexed
7252 * @see #getArray() 7252 * @see #getArray()
7253 */ 7253 */
7254 Expression get realTarget { 7254 Expression get realTarget {
7255 if (isCascaded()) { 7255 if (isCascaded) {
7256 ASTNode ancestor = parent; 7256 ASTNode ancestor = parent;
7257 while (ancestor is! CascadeExpression) { 7257 while (ancestor is! CascadeExpression) {
7258 if (ancestor == null) { 7258 if (ancestor == null) {
7259 return _target; 7259 return _target;
7260 } 7260 }
7261 ancestor = ancestor.parent; 7261 ancestor = ancestor.parent;
7262 } 7262 }
7263 return ((ancestor as CascadeExpression)).target; 7263 return ((ancestor as CascadeExpression)).target;
7264 } 7264 }
7265 return _target; 7265 return _target;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
7301 * Return `true` if this expression is computing a left-hand value. 7301 * Return `true` if this expression is computing a left-hand value.
7302 * 7302 *
7303 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar e 7303 * Note that [inGetterContext] and [inSetterContext] are not opposites, nor ar e
7304 * they mutually exclusive. In other words, it is possible for both methods to return `true`when invoked on the same node. 7304 * they mutually exclusive. In other words, it is possible for both methods to return `true`when invoked on the same node.
7305 * @return `true` if this expression is in a context where the operator '\[\]= ' will be 7305 * @return `true` if this expression is in a context where the operator '\[\]= ' will be
7306 * invoked 7306 * invoked
7307 */ 7307 */
7308 bool inSetterContext() { 7308 bool inSetterContext() {
7309 ASTNode parent = this.parent; 7309 ASTNode parent = this.parent;
7310 if (parent is PrefixExpression) { 7310 if (parent is PrefixExpression) {
7311 return ((parent as PrefixExpression)).operator.type.isIncrementOperator(); 7311 return ((parent as PrefixExpression)).operator.type.isIncrementOperator;
7312 } else if (parent is PostfixExpression) { 7312 } else if (parent is PostfixExpression) {
7313 return true; 7313 return true;
7314 } else if (parent is AssignmentExpression) { 7314 } else if (parent is AssignmentExpression) {
7315 return identical(((parent as AssignmentExpression)).leftHandSide, this); 7315 return identical(((parent as AssignmentExpression)).leftHandSide, this);
7316 } 7316 }
7317 return false; 7317 return false;
7318 } 7318 }
7319 bool isAssignable() => true; 7319 bool get isAssignable => true;
7320 7320
7321 /** 7321 /**
7322 * Return `true` if this expression is cascaded. If it is, then the target of this 7322 * Return `true` if this expression is cascaded. If it is, then the target of this
7323 * expression is not stored locally but is stored in the nearest ancestor that is a[CascadeExpression]. 7323 * expression is not stored locally but is stored in the nearest ancestor that is a[CascadeExpression].
7324 * @return `true` if this expression is cascaded 7324 * @return `true` if this expression is cascaded
7325 */ 7325 */
7326 bool isCascaded() => _period != null; 7326 bool get isCascaded => _period != null;
7327 7327
7328 /** 7328 /**
7329 * Set the expression used to compute the object being indexed to the given ex pression. 7329 * Set the expression used to compute the object being indexed to the given ex pression.
7330 * @param expression the expression used to compute the object being indexed 7330 * @param expression the expression used to compute the object being indexed
7331 */ 7331 */
7332 void set array(Expression expression) { 7332 void set array(Expression expression) {
7333 _target = becomeParentOf(expression); 7333 _target = becomeParentOf(expression);
7334 } 7334 }
7335 7335
7336 /** 7336 /**
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
7515 * Return the element associated with the constructor based on static type inf ormation, or`null` if the AST structure has not been resolved or if the construc tor could not be 7515 * Return the element associated with the constructor based on static type inf ormation, or`null` if the AST structure has not been resolved or if the construc tor could not be
7516 * resolved. 7516 * resolved.
7517 * @return the element associated with the constructor 7517 * @return the element associated with the constructor
7518 */ 7518 */
7519 ConstructorElement get staticElement => _staticElement; 7519 ConstructorElement get staticElement => _staticElement;
7520 7520
7521 /** 7521 /**
7522 * Return `true` if this creation expression is used to invoke a constant cons tructor. 7522 * Return `true` if this creation expression is used to invoke a constant cons tructor.
7523 * @return `true` if this creation expression is used to invoke a constant con structor 7523 * @return `true` if this creation expression is used to invoke a constant con structor
7524 */ 7524 */
7525 bool isConst() => _keyword is KeywordToken && identical(((_keyword as KeywordT oken)).keyword, Keyword.CONST); 7525 bool get isConst => _keyword is KeywordToken && identical(((_keyword as Keywor dToken)).keyword, Keyword.CONST);
7526 7526
7527 /** 7527 /**
7528 * Set the list of arguments to the constructor to the given list. 7528 * Set the list of arguments to the constructor to the given list.
7529 * @param argumentList the list of arguments to the constructor 7529 * @param argumentList the list of arguments to the constructor
7530 */ 7530 */
7531 void set argumentList(ArgumentList argumentList2) { 7531 void set argumentList(ArgumentList argumentList2) {
7532 this._argumentList = becomeParentOf(argumentList2); 7532 this._argumentList = becomeParentOf(argumentList2);
7533 } 7533 }
7534 7534
7535 /** 7535 /**
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
8699 /** 8699 /**
8700 * Return the return type of the method, or `null` if no return type was decla red. 8700 * Return the return type of the method, or `null` if no return type was decla red.
8701 * @return the return type of the method 8701 * @return the return type of the method
8702 */ 8702 */
8703 TypeName get returnType => _returnType; 8703 TypeName get returnType => _returnType;
8704 8704
8705 /** 8705 /**
8706 * Return `true` if this method is declared to be an abstract method. 8706 * Return `true` if this method is declared to be an abstract method.
8707 * @return `true` if this method is declared to be an abstract method 8707 * @return `true` if this method is declared to be an abstract method
8708 */ 8708 */
8709 bool isAbstract() => _externalKeyword == null && (_body is EmptyFunctionBody); 8709 bool get isAbstract => _externalKeyword == null && (_body is EmptyFunctionBody );
8710 8710
8711 /** 8711 /**
8712 * Return `true` if this method declares a getter. 8712 * Return `true` if this method declares a getter.
8713 * @return `true` if this method declares a getter 8713 * @return `true` if this method declares a getter
8714 */ 8714 */
8715 bool isGetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET); 8715 bool get isGetter => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET);
8716 8716
8717 /** 8717 /**
8718 * Return `true` if this method declares an operator. 8718 * Return `true` if this method declares an operator.
8719 * @return `true` if this method declares an operator 8719 * @return `true` if this method declares an operator
8720 */ 8720 */
8721 bool isOperator() => _operatorKeyword != null; 8721 bool get isOperator => _operatorKeyword != null;
8722 8722
8723 /** 8723 /**
8724 * Return `true` if this method declares a setter. 8724 * Return `true` if this method declares a setter.
8725 * @return `true` if this method declares a setter 8725 * @return `true` if this method declares a setter
8726 */ 8726 */
8727 bool isSetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET); 8727 bool get isSetter => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET);
8728 8728
8729 /** 8729 /**
8730 * Return `true` if this method is declared to be a static method. 8730 * Return `true` if this method is declared to be a static method.
8731 * @return `true` if this method is declared to be a static method 8731 * @return `true` if this method is declared to be a static method
8732 */ 8732 */
8733 bool isStatic() => _modifierKeyword != null && identical(((_modifierKeyword as KeywordToken)).keyword, Keyword.STATIC); 8733 bool get isStatic => _modifierKeyword != null && identical(((_modifierKeyword as KeywordToken)).keyword, Keyword.STATIC);
8734 8734
8735 /** 8735 /**
8736 * Set the body of the method to the given function body. 8736 * Set the body of the method to the given function body.
8737 * @param functionBody the body of the method 8737 * @param functionBody the body of the method
8738 */ 8738 */
8739 void set body(FunctionBody functionBody) { 8739 void set body(FunctionBody functionBody) {
8740 _body = becomeParentOf(functionBody); 8740 _body = becomeParentOf(functionBody);
8741 } 8741 }
8742 8742
8743 /** 8743 /**
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
8902 8902
8903 /** 8903 /**
8904 * Return the expression used to compute the receiver of the invocation. If th is invocation is not 8904 * Return the expression used to compute the receiver of the invocation. If th is invocation is not
8905 * part of a cascade expression, then this is the same as [getTarget]. If this invocation 8905 * part of a cascade expression, then this is the same as [getTarget]. If this invocation
8906 * is part of a cascade expression, then the target stored with the cascade ex pression is 8906 * is part of a cascade expression, then the target stored with the cascade ex pression is
8907 * returned. 8907 * returned.
8908 * @return the expression used to compute the receiver of the invocation 8908 * @return the expression used to compute the receiver of the invocation
8909 * @see #getTarget() 8909 * @see #getTarget()
8910 */ 8910 */
8911 Expression get realTarget { 8911 Expression get realTarget {
8912 if (isCascaded()) { 8912 if (isCascaded) {
8913 ASTNode ancestor = parent; 8913 ASTNode ancestor = parent;
8914 while (ancestor is! CascadeExpression) { 8914 while (ancestor is! CascadeExpression) {
8915 if (ancestor == null) { 8915 if (ancestor == null) {
8916 return _target; 8916 return _target;
8917 } 8917 }
8918 ancestor = ancestor.parent; 8918 ancestor = ancestor.parent;
8919 } 8919 }
8920 return ((ancestor as CascadeExpression)).target; 8920 return ((ancestor as CascadeExpression)).target;
8921 } 8921 }
8922 return _target; 8922 return _target;
8923 } 8923 }
8924 8924
8925 /** 8925 /**
8926 * Return the expression producing the object on which the method is defined, or `null` if 8926 * Return the expression producing the object on which the method is defined, or `null` if
8927 * there is no target (that is, the target is implicitly `this`) or if this me thod 8927 * there is no target (that is, the target is implicitly `this`) or if this me thod
8928 * invocation is part of a cascade expression. 8928 * invocation is part of a cascade expression.
8929 * @return the expression producing the object on which the method is defined 8929 * @return the expression producing the object on which the method is defined
8930 * @see #getRealTarget() 8930 * @see #getRealTarget()
8931 */ 8931 */
8932 Expression get target => _target; 8932 Expression get target => _target;
8933 8933
8934 /** 8934 /**
8935 * Return `true` if this expression is cascaded. If it is, then the target of this 8935 * Return `true` if this expression is cascaded. If it is, then the target of this
8936 * expression is not stored locally but is stored in the nearest ancestor that is a[CascadeExpression]. 8936 * expression is not stored locally but is stored in the nearest ancestor that is a[CascadeExpression].
8937 * @return `true` if this expression is cascaded 8937 * @return `true` if this expression is cascaded
8938 */ 8938 */
8939 bool isCascaded() => _period != null && identical(_period.type, TokenType.PERI OD_PERIOD); 8939 bool get isCascaded => _period != null && identical(_period.type, TokenType.PE RIOD_PERIOD);
8940 8940
8941 /** 8941 /**
8942 * Set the list of arguments to the method to the given list. 8942 * Set the list of arguments to the method to the given list.
8943 * @param argumentList the list of arguments to the method 8943 * @param argumentList the list of arguments to the method
8944 */ 8944 */
8945 void set argumentList(ArgumentList argumentList2) { 8945 void set argumentList(ArgumentList argumentList2) {
8946 this._argumentList = becomeParentOf(argumentList2); 8946 this._argumentList = becomeParentOf(argumentList2);
8947 } 8947 }
8948 8948
8949 /** 8949 /**
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
9278 /** 9278 /**
9279 * Return the annotations associated with this parameter. 9279 * Return the annotations associated with this parameter.
9280 * @return the annotations associated with this parameter 9280 * @return the annotations associated with this parameter
9281 */ 9281 */
9282 NodeList<Annotation> get metadata => _metadata; 9282 NodeList<Annotation> get metadata => _metadata;
9283 9283
9284 /** 9284 /**
9285 * Return `true` if this parameter was declared with the 'const' modifier. 9285 * Return `true` if this parameter was declared with the 'const' modifier.
9286 * @return `true` if this parameter was declared with the 'const' modifier 9286 * @return `true` if this parameter was declared with the 'const' modifier
9287 */ 9287 */
9288 bool isConst(); 9288 bool get isConst;
9289 9289
9290 /** 9290 /**
9291 * Return `true` if this parameter was declared with the 'final' modifier. Par ameters that 9291 * Return `true` if this parameter was declared with the 'final' modifier. Par ameters that
9292 * are declared with the 'const' modifier will return `false` even though they are 9292 * are declared with the 'const' modifier will return `false` even though they are
9293 * implicitly final. 9293 * implicitly final.
9294 * @return `true` if this parameter was declared with the 'final' modifier 9294 * @return `true` if this parameter was declared with the 'final' modifier
9295 */ 9295 */
9296 bool isFinal(); 9296 bool get isFinal;
9297 9297
9298 /** 9298 /**
9299 * Set the documentation comment associated with this parameter to the given c omment 9299 * Set the documentation comment associated with this parameter to the given c omment
9300 * @param comment the documentation comment to be associated with this paramet er 9300 * @param comment the documentation comment to be associated with this paramet er
9301 */ 9301 */
9302 void set documentationComment(Comment comment2) { 9302 void set documentationComment(Comment comment2) {
9303 this._comment = becomeParentOf(comment2); 9303 this._comment = becomeParentOf(comment2);
9304 } 9304 }
9305 9305
9306 /** 9306 /**
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
10170 10170
10171 /** 10171 /**
10172 * Return the expression used to compute the receiver of the invocation. If th is invocation is not 10172 * Return the expression used to compute the receiver of the invocation. If th is invocation is not
10173 * part of a cascade expression, then this is the same as [getTarget]. If this invocation 10173 * part of a cascade expression, then this is the same as [getTarget]. If this invocation
10174 * is part of a cascade expression, then the target stored with the cascade ex pression is 10174 * is part of a cascade expression, then the target stored with the cascade ex pression is
10175 * returned. 10175 * returned.
10176 * @return the expression used to compute the receiver of the invocation 10176 * @return the expression used to compute the receiver of the invocation
10177 * @see #getTarget() 10177 * @see #getTarget()
10178 */ 10178 */
10179 Expression get realTarget { 10179 Expression get realTarget {
10180 if (isCascaded()) { 10180 if (isCascaded) {
10181 ASTNode ancestor = parent; 10181 ASTNode ancestor = parent;
10182 while (ancestor is! CascadeExpression) { 10182 while (ancestor is! CascadeExpression) {
10183 if (ancestor == null) { 10183 if (ancestor == null) {
10184 return _target; 10184 return _target;
10185 } 10185 }
10186 ancestor = ancestor.parent; 10186 ancestor = ancestor.parent;
10187 } 10187 }
10188 return ((ancestor as CascadeExpression)).target; 10188 return ((ancestor as CascadeExpression)).target;
10189 } 10189 }
10190 return _target; 10190 return _target;
10191 } 10191 }
10192 10192
10193 /** 10193 /**
10194 * Return the expression computing the object defining the property being acce ssed, or`null` if this property access is part of a cascade expression. 10194 * Return the expression computing the object defining the property being acce ssed, or`null` if this property access is part of a cascade expression.
10195 * @return the expression computing the object defining the property being acc essed 10195 * @return the expression computing the object defining the property being acc essed
10196 * @see #getRealTarget() 10196 * @see #getRealTarget()
10197 */ 10197 */
10198 Expression get target => _target; 10198 Expression get target => _target;
10199 bool isAssignable() => true; 10199 bool get isAssignable => true;
10200 10200
10201 /** 10201 /**
10202 * Return `true` if this expression is cascaded. If it is, then the target of this 10202 * Return `true` if this expression is cascaded. If it is, then the target of this
10203 * expression is not stored locally but is stored in the nearest ancestor that is a[CascadeExpression]. 10203 * expression is not stored locally but is stored in the nearest ancestor that is a[CascadeExpression].
10204 * @return `true` if this expression is cascaded 10204 * @return `true` if this expression is cascaded
10205 */ 10205 */
10206 bool isCascaded() => _operator != null && identical(_operator.type, TokenType. PERIOD_PERIOD); 10206 bool get isCascaded => _operator != null && identical(_operator.type, TokenTyp e.PERIOD_PERIOD);
10207 10207
10208 /** 10208 /**
10209 * Set the property access operator to the given token. 10209 * Set the property access operator to the given token.
10210 * @param operator the property access operator 10210 * @param operator the property access operator
10211 */ 10211 */
10212 void set operator(Token operator2) { 10212 void set operator(Token operator2) {
10213 this._operator = operator2; 10213 this._operator = operator2;
10214 } 10214 }
10215 10215
10216 /** 10216 /**
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
10694 * @return the token representing either the 'final', 'const' or 'var' keyword 10694 * @return the token representing either the 'final', 'const' or 'var' keyword
10695 */ 10695 */
10696 Token get keyword => _keyword; 10696 Token get keyword => _keyword;
10697 10697
10698 /** 10698 /**
10699 * Return the name of the declared type of the parameter, or `null` if the par ameter does 10699 * Return the name of the declared type of the parameter, or `null` if the par ameter does
10700 * not have a declared type. 10700 * not have a declared type.
10701 * @return the name of the declared type of the parameter 10701 * @return the name of the declared type of the parameter
10702 */ 10702 */
10703 TypeName get type => _type; 10703 TypeName get type => _type;
10704 bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.CONST); 10704 bool get isConst => (_keyword is KeywordToken) && identical(((_keyword as Keyw ordToken)).keyword, Keyword.CONST);
10705 bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as Keywor dToken)).keyword, Keyword.FINAL); 10705 bool get isFinal => (_keyword is KeywordToken) && identical(((_keyword as Keyw ordToken)).keyword, Keyword.FINAL);
10706 10706
10707 /** 10707 /**
10708 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token. 10708 * Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
10709 * @param keyword the token representing either the 'final', 'const' or 'var' keyword 10709 * @param keyword the token representing either the 'final', 'const' or 'var' keyword
10710 */ 10710 */
10711 void set keyword(Token keyword2) { 10711 void set keyword(Token keyword2) {
10712 this._keyword = keyword2; 10712 this._keyword = keyword2;
10713 } 10713 }
10714 10714
10715 /** 10715 /**
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
10868 target = prefixed; 10868 target = prefixed;
10869 } else if (parent is PropertyAccess) { 10869 } else if (parent is PropertyAccess) {
10870 PropertyAccess access = parent as PropertyAccess; 10870 PropertyAccess access = parent as PropertyAccess;
10871 if (identical(access.target, this)) { 10871 if (identical(access.target, this)) {
10872 return false; 10872 return false;
10873 } 10873 }
10874 parent = access.parent; 10874 parent = access.parent;
10875 target = access; 10875 target = access;
10876 } 10876 }
10877 if (parent is PrefixExpression) { 10877 if (parent is PrefixExpression) {
10878 return ((parent as PrefixExpression)).operator.type.isIncrementOperator(); 10878 return ((parent as PrefixExpression)).operator.type.isIncrementOperator;
10879 } else if (parent is PostfixExpression) { 10879 } else if (parent is PostfixExpression) {
10880 return true; 10880 return true;
10881 } else if (parent is AssignmentExpression) { 10881 } else if (parent is AssignmentExpression) {
10882 return identical(((parent as AssignmentExpression)).leftHandSide, target); 10882 return identical(((parent as AssignmentExpression)).leftHandSide, target);
10883 } 10883 }
10884 return false; 10884 return false;
10885 } 10885 }
10886 bool isSynthetic() => _token.isSynthetic(); 10886 bool get isSynthetic => _token.isSynthetic;
10887 10887
10888 /** 10888 /**
10889 * Set the element associated with this identifier based on propagated type in formation to the 10889 * Set the element associated with this identifier based on propagated type in formation to the
10890 * given element. 10890 * given element.
10891 * @param element the element to be associated with this identifier 10891 * @param element the element to be associated with this identifier
10892 */ 10892 */
10893 void set element(Element element2) { 10893 void set element(Element element2) {
10894 _propagatedElement = element2; 10894 _propagatedElement = element2;
10895 } 10895 }
10896 10896
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
10975 /** 10975 /**
10976 * Return the value of the literal. 10976 * Return the value of the literal.
10977 * @return the value of the literal 10977 * @return the value of the literal
10978 */ 10978 */
10979 String get value => _value; 10979 String get value => _value;
10980 10980
10981 /** 10981 /**
10982 * Return `true` if this string literal is a multi-line string. 10982 * Return `true` if this string literal is a multi-line string.
10983 * @return `true` if this string literal is a multi-line string 10983 * @return `true` if this string literal is a multi-line string
10984 */ 10984 */
10985 bool isMultiline() { 10985 bool get isMultiline {
10986 if (_value.length < 6) { 10986 if (_value.length < 6) {
10987 return false; 10987 return false;
10988 } 10988 }
10989 return _value.endsWith("\"\"\"") || _value.endsWith("'''"); 10989 return _value.endsWith("\"\"\"") || _value.endsWith("'''");
10990 } 10990 }
10991 10991
10992 /** 10992 /**
10993 * Return `true` if this string literal is a raw string. 10993 * Return `true` if this string literal is a raw string.
10994 * @return `true` if this string literal is a raw string 10994 * @return `true` if this string literal is a raw string
10995 */ 10995 */
10996 bool isRaw() => _value.codeUnitAt(0) == 0x40; 10996 bool get isRaw => _value.codeUnitAt(0) == 0x40;
10997 bool isSynthetic() => _literal.isSynthetic(); 10997 bool get isSynthetic => _literal.isSynthetic;
10998 10998
10999 /** 10999 /**
11000 * Set the token representing the literal to the given token. 11000 * Set the token representing the literal to the given token.
11001 * @param literal the token representing the literal 11001 * @param literal the token representing the literal
11002 */ 11002 */
11003 void set literal(Token literal2) { 11003 void set literal(Token literal2) {
11004 this._literal = literal2; 11004 this._literal = literal2;
11005 } 11005 }
11006 11006
11007 /** 11007 /**
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
12258 * @return the type being named 12258 * @return the type being named
12259 */ 12259 */
12260 Type2 get type => _type; 12260 Type2 get type => _type;
12261 12261
12262 /** 12262 /**
12263 * Return the type arguments associated with the type, or `null` if there are no type 12263 * Return the type arguments associated with the type, or `null` if there are no type
12264 * arguments. 12264 * arguments.
12265 * @return the type arguments associated with the type 12265 * @return the type arguments associated with the type
12266 */ 12266 */
12267 TypeArgumentList get typeArguments => _typeArguments; 12267 TypeArgumentList get typeArguments => _typeArguments;
12268 bool isSynthetic() => _name.isSynthetic() && _typeArguments == null; 12268 bool get isSynthetic => _name.isSynthetic && _typeArguments == null;
12269 12269
12270 /** 12270 /**
12271 * Set the name of the type to the given identifier. 12271 * Set the name of the type to the given identifier.
12272 * @param identifier the name of the type 12272 * @param identifier the name of the type
12273 */ 12273 */
12274 void set name(Identifier identifier) { 12274 void set name(Identifier identifier) {
12275 _name = becomeParentOf(identifier); 12275 _name = becomeParentOf(identifier);
12276 } 12276 }
12277 12277
12278 /** 12278 /**
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
12695 /** 12695 /**
12696 * Return the name of the variable being declared. 12696 * Return the name of the variable being declared.
12697 * @return the name of the variable being declared 12697 * @return the name of the variable being declared
12698 */ 12698 */
12699 SimpleIdentifier get name => _name; 12699 SimpleIdentifier get name => _name;
12700 12700
12701 /** 12701 /**
12702 * Return `true` if this variable was declared with the 'const' modifier. 12702 * Return `true` if this variable was declared with the 'const' modifier.
12703 * @return `true` if this variable was declared with the 'const' modifier 12703 * @return `true` if this variable was declared with the 'const' modifier
12704 */ 12704 */
12705 bool isConst() { 12705 bool get isConst {
12706 ASTNode parent = this.parent; 12706 ASTNode parent = this.parent;
12707 return parent is VariableDeclarationList && ((parent as VariableDeclarationL ist)).isConst(); 12707 return parent is VariableDeclarationList && ((parent as VariableDeclarationL ist)).isConst;
12708 } 12708 }
12709 12709
12710 /** 12710 /**
12711 * Return `true` if this variable was declared with the 'final' modifier. Vari ables that are 12711 * Return `true` if this variable was declared with the 'final' modifier. Vari ables that are
12712 * declared with the 'const' modifier will return `false` even though they are implicitly 12712 * declared with the 'const' modifier will return `false` even though they are implicitly
12713 * final. 12713 * final.
12714 * @return `true` if this variable was declared with the 'final' modifier 12714 * @return `true` if this variable was declared with the 'final' modifier
12715 */ 12715 */
12716 bool isFinal() { 12716 bool get isFinal {
12717 ASTNode parent = this.parent; 12717 ASTNode parent = this.parent;
12718 return parent is VariableDeclarationList && ((parent as VariableDeclarationL ist)).isFinal(); 12718 return parent is VariableDeclarationList && ((parent as VariableDeclarationL ist)).isFinal;
12719 } 12719 }
12720 12720
12721 /** 12721 /**
12722 * Set the equal sign separating the variable name from the initial value to t he given token. 12722 * Set the equal sign separating the variable name from the initial value to t he given token.
12723 * @param equals the equal sign separating the variable name from the initial value 12723 * @param equals the equal sign separating the variable name from the initial value
12724 */ 12724 */
12725 void set equals(Token equals2) { 12725 void set equals(Token equals2) {
12726 this._equals = equals2; 12726 this._equals = equals2;
12727 } 12727 }
12728 12728
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
12822 /** 12822 /**
12823 * Return a list containing the individual variables being declared. 12823 * Return a list containing the individual variables being declared.
12824 * @return a list containing the individual variables being declared 12824 * @return a list containing the individual variables being declared
12825 */ 12825 */
12826 NodeList<VariableDeclaration> get variables => _variables; 12826 NodeList<VariableDeclaration> get variables => _variables;
12827 12827
12828 /** 12828 /**
12829 * Return `true` if the variables in this list were declared with the 'const' modifier. 12829 * Return `true` if the variables in this list were declared with the 'const' modifier.
12830 * @return `true` if the variables in this list were declared with the 'const' modifier 12830 * @return `true` if the variables in this list were declared with the 'const' modifier
12831 */ 12831 */
12832 bool isConst() => _keyword is KeywordToken && identical(((_keyword as KeywordT oken)).keyword, Keyword.CONST); 12832 bool get isConst => _keyword is KeywordToken && identical(((_keyword as Keywor dToken)).keyword, Keyword.CONST);
12833 12833
12834 /** 12834 /**
12835 * Return `true` if the variables in this list were declared with the 'final' modifier. 12835 * Return `true` if the variables in this list were declared with the 'final' modifier.
12836 * Variables that are declared with the 'const' modifier will return `false` e ven though 12836 * Variables that are declared with the 'const' modifier will return `false` e ven though
12837 * they are implicitly final. 12837 * they are implicitly final.
12838 * @return `true` if the variables in this list were declared with the 'final' modifier 12838 * @return `true` if the variables in this list were declared with the 'final' modifier
12839 */ 12839 */
12840 bool isFinal() => _keyword is KeywordToken && identical(((_keyword as KeywordT oken)).keyword, Keyword.FINAL); 12840 bool get isFinal => _keyword is KeywordToken && identical(((_keyword as Keywor dToken)).keyword, Keyword.FINAL);
12841 12841
12842 /** 12842 /**
12843 * Set the token representing the 'final', 'const' or 'var' keyword to the giv en token. 12843 * Set the token representing the 'final', 'const' or 'var' keyword to the giv en token.
12844 * @param keyword the token representing the 'final', 'const' or 'var' keyword 12844 * @param keyword the token representing the 'final', 'const' or 'var' keyword
12845 */ 12845 */
12846 void set keyword(Token keyword2) { 12846 void set keyword(Token keyword2) {
12847 this._keyword = keyword2; 12847 this._keyword = keyword2;
12848 } 12848 }
12849 12849
12850 /** 12850 /**
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
13442 } 13442 }
13443 13443
13444 /** 13444 /**
13445 * Return the constant value of the static constant represented by the given e lement. 13445 * Return the constant value of the static constant represented by the given e lement.
13446 * @param element the element whose value is to be returned 13446 * @param element the element whose value is to be returned
13447 * @return the constant value of the static constant 13447 * @return the constant value of the static constant
13448 */ 13448 */
13449 Object getConstantValue(Element element) { 13449 Object getConstantValue(Element element) {
13450 if (element is FieldElement) { 13450 if (element is FieldElement) {
13451 FieldElement field = element as FieldElement; 13451 FieldElement field = element as FieldElement;
13452 if (field.isStatic() && field.isConst()) { 13452 if (field.isStatic && field.isConst) {
13453 } 13453 }
13454 } 13454 }
13455 return NOT_A_CONSTANT; 13455 return NOT_A_CONSTANT;
13456 } 13456 }
13457 } 13457 }
13458 /** 13458 /**
13459 * Instances of the class `ElementLocator` locate the [Element Dart model elemen t]associated with a given [ASTNode AST node]. 13459 * Instances of the class `ElementLocator` locate the [Element Dart model elemen t]associated with a given [ASTNode AST node].
13460 * @coverage dart.engine.ast 13460 * @coverage dart.engine.ast
13461 */ 13461 */
13462 class ElementLocator { 13462 class ElementLocator {
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after
14673 } 14673 }
14674 Object visitImportDirective(ImportDirective node) { 14674 Object visitImportDirective(ImportDirective node) {
14675 _writer.print("import "); 14675 _writer.print("import ");
14676 visit(node.uri); 14676 visit(node.uri);
14677 visit3(" as ", node.prefix); 14677 visit3(" as ", node.prefix);
14678 visitList4(" ", node.combinators, " "); 14678 visitList4(" ", node.combinators, " ");
14679 _writer.print(';'); 14679 _writer.print(';');
14680 return null; 14680 return null;
14681 } 14681 }
14682 Object visitIndexExpression(IndexExpression node) { 14682 Object visitIndexExpression(IndexExpression node) {
14683 if (node.isCascaded()) { 14683 if (node.isCascaded) {
14684 _writer.print(".."); 14684 _writer.print("..");
14685 } else { 14685 } else {
14686 visit(node.array); 14686 visit(node.array);
14687 } 14687 }
14688 _writer.print('['); 14688 _writer.print('[');
14689 visit(node.index); 14689 visit(node.index);
14690 _writer.print(']'); 14690 _writer.print(']');
14691 return null; 14691 return null;
14692 } 14692 }
14693 Object visitInstanceCreationExpression(InstanceCreationExpression node) { 14693 Object visitInstanceCreationExpression(InstanceCreationExpression node) {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
14773 visit(node.value); 14773 visit(node.value);
14774 return null; 14774 return null;
14775 } 14775 }
14776 Object visitMethodDeclaration(MethodDeclaration node) { 14776 Object visitMethodDeclaration(MethodDeclaration node) {
14777 visit5(node.externalKeyword, " "); 14777 visit5(node.externalKeyword, " ");
14778 visit5(node.modifierKeyword, " "); 14778 visit5(node.modifierKeyword, " ");
14779 visit2(node.returnType, " "); 14779 visit2(node.returnType, " ");
14780 visit5(node.propertyKeyword, " "); 14780 visit5(node.propertyKeyword, " ");
14781 visit5(node.operatorKeyword, " "); 14781 visit5(node.operatorKeyword, " ");
14782 visit(node.name); 14782 visit(node.name);
14783 if (!node.isGetter()) { 14783 if (!node.isGetter) {
14784 visit(node.parameters); 14784 visit(node.parameters);
14785 } 14785 }
14786 visit4(" ", node.body); 14786 visit4(" ", node.body);
14787 return null; 14787 return null;
14788 } 14788 }
14789 Object visitMethodInvocation(MethodInvocation node) { 14789 Object visitMethodInvocation(MethodInvocation node) {
14790 if (node.isCascaded()) { 14790 if (node.isCascaded) {
14791 _writer.print(".."); 14791 _writer.print("..");
14792 } else { 14792 } else {
14793 visit2(node.target, "."); 14793 visit2(node.target, ".");
14794 } 14794 }
14795 visit(node.methodName); 14795 visit(node.methodName);
14796 visit(node.argumentList); 14796 visit(node.argumentList);
14797 return null; 14797 return null;
14798 } 14798 }
14799 Object visitNamedExpression(NamedExpression node) { 14799 Object visitNamedExpression(NamedExpression node) {
14800 visit(node.name); 14800 visit(node.name);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
14839 _writer.print('.'); 14839 _writer.print('.');
14840 visit(node.identifier); 14840 visit(node.identifier);
14841 return null; 14841 return null;
14842 } 14842 }
14843 Object visitPrefixExpression(PrefixExpression node) { 14843 Object visitPrefixExpression(PrefixExpression node) {
14844 _writer.print(node.operator.lexeme); 14844 _writer.print(node.operator.lexeme);
14845 visit(node.operand); 14845 visit(node.operand);
14846 return null; 14846 return null;
14847 } 14847 }
14848 Object visitPropertyAccess(PropertyAccess node) { 14848 Object visitPropertyAccess(PropertyAccess node) {
14849 if (node.isCascaded()) { 14849 if (node.isCascaded) {
14850 _writer.print(".."); 14850 _writer.print("..");
14851 } else { 14851 } else {
14852 visit(node.target); 14852 visit(node.target);
14853 _writer.print('.'); 14853 _writer.print('.');
14854 } 14854 }
14855 visit(node.propertyName); 14855 visit(node.propertyName);
14856 return null; 14856 return null;
14857 } 14857 }
14858 Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) { 14858 Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
14859 _writer.print("this"); 14859 _writer.print("this");
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
15148 BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExp ression.full(clone2(node.leftOperand), node.operator, clone2(node.rightOperand)) ; 15148 BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExp ression.full(clone2(node.leftOperand), node.operator, clone2(node.rightOperand)) ;
15149 Block visitBlock(Block node) => new Block.full(node.leftBracket, clone3(node.s tatements), node.rightBracket); 15149 Block visitBlock(Block node) => new Block.full(node.leftBracket, clone3(node.s tatements), node.rightBracket);
15150 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody.full(clone2(node.block)); 15150 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody.full(clone2(node.block));
15151 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral. full(node.literal, node.value); 15151 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral. full(node.literal, node.value);
15152 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement. full(node.keyword, clone2(node.label), node.semicolon); 15152 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement. full(node.keyword, clone2(node.label), node.semicolon);
15153 CascadeExpression visitCascadeExpression(CascadeExpression node) => new Cascad eExpression.full(clone2(node.target), clone3(node.cascadeSections)); 15153 CascadeExpression visitCascadeExpression(CascadeExpression node) => new Cascad eExpression.full(clone2(node.target), clone3(node.cascadeSections));
15154 CatchClause visitCatchClause(CatchClause node) => new CatchClause.full(node.on Keyword, clone2(node.exceptionType), node.catchKeyword, node.leftParenthesis, cl one2(node.exceptionParameter), node.comma, clone2(node.stackTraceParameter), nod e.rightParenthesis, clone2(node.body)); 15154 CatchClause visitCatchClause(CatchClause node) => new CatchClause.full(node.on Keyword, clone2(node.exceptionType), node.catchKeyword, node.leftParenthesis, cl one2(node.exceptionParameter), node.comma, clone2(node.stackTraceParameter), nod e.rightParenthesis, clone2(node.body));
15155 ClassDeclaration visitClassDeclaration(ClassDeclaration node) => new ClassDecl aration.full(clone2(node.documentationComment), clone3(node.metadata), node.abst ractKeyword, node.classKeyword, clone2(node.name), clone2(node.typeParameters), clone2(node.extendsClause), clone2(node.withClause), clone2(node.implementsClaus e), node.leftBracket, clone3(node.members), node.rightBracket); 15155 ClassDeclaration visitClassDeclaration(ClassDeclaration node) => new ClassDecl aration.full(clone2(node.documentationComment), clone3(node.metadata), node.abst ractKeyword, node.classKeyword, clone2(node.name), clone2(node.typeParameters), clone2(node.extendsClause), clone2(node.withClause), clone2(node.implementsClaus e), node.leftBracket, clone3(node.members), node.rightBracket);
15156 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias. full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clo ne2(node.name), clone2(node.typeParameters), node.equals, node.abstractKeyword, clone2(node.superclass), clone2(node.withClause), clone2(node.implementsClause), node.semicolon); 15156 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias. full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clo ne2(node.name), clone2(node.typeParameters), node.equals, node.abstractKeyword, clone2(node.superclass), clone2(node.withClause), clone2(node.implementsClause), node.semicolon);
15157 Comment visitComment(Comment node) { 15157 Comment visitComment(Comment node) {
15158 if (node.isDocumentation()) { 15158 if (node.isDocumentation) {
15159 return Comment.createDocumentationComment2(node.tokens, clone3(node.refere nces)); 15159 return Comment.createDocumentationComment2(node.tokens, clone3(node.refere nces));
15160 } else if (node.isBlock()) { 15160 } else if (node.isBlock) {
15161 return Comment.createBlockComment(node.tokens); 15161 return Comment.createBlockComment(node.tokens);
15162 } 15162 }
15163 return Comment.createEndOfLineComment(node.tokens); 15163 return Comment.createEndOfLineComment(node.tokens);
15164 } 15164 }
15165 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference.full(node.newKeyword, clone2(node.identifier)); 15165 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference.full(node.newKeyword, clone2(node.identifier));
15166 CompilationUnit visitCompilationUnit(CompilationUnit node) { 15166 CompilationUnit visitCompilationUnit(CompilationUnit node) {
15167 CompilationUnit clone = new CompilationUnit.full(node.beginToken, clone2(nod e.scriptTag), clone3(node.directives), clone3(node.declarations), node.endToken) ; 15167 CompilationUnit clone = new CompilationUnit.full(node.beginToken, clone2(nod e.scriptTag), clone3(node.directives), clone3(node.declarations), node.endToken) ;
15168 clone.lineInfo = node.lineInfo; 15168 clone.lineInfo = node.lineInfo;
15169 clone.parsingErrors = node.parsingErrors; 15169 clone.parsingErrors = node.parsingErrors;
15170 clone.resolutionErrors = node.resolutionErrors; 15170 clone.resolutionErrors = node.resolutionErrors;
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
15472 return elements[elements.length - 1].endToken; 15472 return elements[elements.length - 1].endToken;
15473 } 15473 }
15474 /** 15474 /**
15475 * Return the node that is the parent of each of the elements in the list. 15475 * Return the node that is the parent of each of the elements in the list.
15476 * @return the node that is the parent of each of the elements in the list 15476 * @return the node that is the parent of each of the elements in the list
15477 */ 15477 */
15478 ASTNode getOwner() { 15478 ASTNode getOwner() {
15479 return owner; 15479 return owner;
15480 } 15480 }
15481 } 15481 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698