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

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

Issue 103233003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 3
4 library engine.ast; 4 library engine.ast;
5 5
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'java_core.dart'; 7 import 'java_core.dart';
8 import 'java_engine.dart'; 8 import 'java_engine.dart';
9 import 'source.dart' show LineInfo; 9 import 'source.dart' show LineInfo;
10 import 'scanner.dart'; 10 import 'scanner.dart';
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 888
889 Token get endToken => _identifier.endToken; 889 Token get endToken => _identifier.endToken;
890 890
891 /** 891 /**
892 * Return the identifier representing the argument being tested. 892 * Return the identifier representing the argument being tested.
893 * 893 *
894 * @return the identifier representing the argument being tested 894 * @return the identifier representing the argument being tested
895 */ 895 */
896 SimpleIdentifier get identifier => _identifier; 896 SimpleIdentifier get identifier => _identifier;
897 897
898 int get precedence => 15;
899
898 /** 900 /**
899 * Set the identifier representing the argument being tested to the given iden tifier. 901 * Set the identifier representing the argument being tested to the given iden tifier.
900 * 902 *
901 * @param identifier the identifier representing the argument being tested 903 * @param identifier the identifier representing the argument being tested
902 */ 904 */
903 void set identifier(SimpleIdentifier identifier) { 905 void set identifier(SimpleIdentifier identifier) {
904 this._identifier = becomeParentOf(identifier); 906 this._identifier = becomeParentOf(identifier);
905 } 907 }
906 908
907 void visitChildren(ASTVisitor visitor) { 909 void visitChildren(ASTVisitor visitor) {
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 1158
1157 Token get endToken => _type.endToken; 1159 Token get endToken => _type.endToken;
1158 1160
1159 /** 1161 /**
1160 * Return the expression used to compute the value being cast. 1162 * Return the expression used to compute the value being cast.
1161 * 1163 *
1162 * @return the expression used to compute the value being cast 1164 * @return the expression used to compute the value being cast
1163 */ 1165 */
1164 Expression get expression => _expression; 1166 Expression get expression => _expression;
1165 1167
1168 int get precedence => 7;
1169
1166 /** 1170 /**
1167 * Return the name of the type being cast to. 1171 * Return the name of the type being cast to.
1168 * 1172 *
1169 * @return the name of the type being cast to 1173 * @return the name of the type being cast to
1170 */ 1174 */
1171 TypeName get type => _type; 1175 TypeName get type => _type;
1172 1176
1173 /** 1177 /**
1174 * Set the expression used to compute the value being cast to the given expres sion. 1178 * Set the expression used to compute the value being cast to the given expres sion.
1175 * 1179 *
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 1373
1370 Token get endToken => _rightHandSide.endToken; 1374 Token get endToken => _rightHandSide.endToken;
1371 1375
1372 /** 1376 /**
1373 * Set the expression used to compute the left hand side to the given expressi on. 1377 * Set the expression used to compute the left hand side to the given expressi on.
1374 * 1378 *
1375 * @return the expression used to compute the left hand side 1379 * @return the expression used to compute the left hand side
1376 */ 1380 */
1377 Expression get leftHandSide => _leftHandSide; 1381 Expression get leftHandSide => _leftHandSide;
1378 1382
1383 int get precedence => 1;
1384
1379 /** 1385 /**
1380 * Return the element associated with the operator based on the propagated typ e of the 1386 * Return the element associated with the operator based on the propagated typ e of the
1381 * left-hand-side, or `null` if the AST structure has not been resolved, if th e operator is 1387 * left-hand-side, or `null` if the AST structure has not been resolved, if th e operator is
1382 * not a compound operator, or if the operator could not be resolved. One exam ple of the latter 1388 * not a compound operator, or if the operator could not be resolved. One exam ple of the latter
1383 * case is an operator that is not defined for the type of the left-hand opera nd. 1389 * case is an operator that is not defined for the type of the left-hand opera nd.
1384 * 1390 *
1385 * @return the element associated with the operator 1391 * @return the element associated with the operator
1386 */ 1392 */
1387 MethodElement get propagatedElement => _propagatedElement; 1393 MethodElement get propagatedElement => _propagatedElement;
1388 1394
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 1579
1574 Token get endToken => _rightOperand.endToken; 1580 Token get endToken => _rightOperand.endToken;
1575 1581
1576 /** 1582 /**
1577 * Return the expression used to compute the left operand. 1583 * Return the expression used to compute the left operand.
1578 * 1584 *
1579 * @return the expression used to compute the left operand 1585 * @return the expression used to compute the left operand
1580 */ 1586 */
1581 Expression get leftOperand => _leftOperand; 1587 Expression get leftOperand => _leftOperand;
1582 1588
1589 int get precedence => operator.type.precedence;
1590
1583 /** 1591 /**
1584 * Return the element associated with the operator based on the propagated typ e of the left 1592 * Return the element associated with the operator based on the propagated typ e of the left
1585 * operand, or `null` if the AST structure has not been resolved, if the opera tor is not 1593 * operand, or `null` if the AST structure has not been resolved, if the opera tor is not
1586 * user definable, or if the operator could not be resolved. One example of th e latter case is an 1594 * user definable, or if the operator could not be resolved. One example of th e latter case is an
1587 * operator that is not defined for the type of the left-hand operand. 1595 * operator that is not defined for the type of the left-hand operand.
1588 * 1596 *
1589 * @return the element associated with the operator 1597 * @return the element associated with the operator
1590 */ 1598 */
1591 MethodElement get propagatedElement => _propagatedElement; 1599 MethodElement get propagatedElement => _propagatedElement;
1592 1600
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 * @param cascadeSections the cascade sections sharing the common target 1998 * @param cascadeSections the cascade sections sharing the common target
1991 */ 1999 */
1992 CascadeExpression({Expression target, List<Expression> cascadeSections}) : thi s.full(target, cascadeSections); 2000 CascadeExpression({Expression target, List<Expression> cascadeSections}) : thi s.full(target, cascadeSections);
1993 2001
1994 accept(ASTVisitor visitor) => visitor.visitCascadeExpression(this); 2002 accept(ASTVisitor visitor) => visitor.visitCascadeExpression(this);
1995 2003
1996 Token get beginToken => _target.beginToken; 2004 Token get beginToken => _target.beginToken;
1997 2005
1998 Token get endToken => cascadeSections.endToken; 2006 Token get endToken => cascadeSections.endToken;
1999 2007
2008 int get precedence => 2;
2009
2000 /** 2010 /**
2001 * Return the target of the cascade sections. 2011 * Return the target of the cascade sections.
2002 * 2012 *
2003 * @return the target of the cascade sections 2013 * @return the target of the cascade sections
2004 */ 2014 */
2005 Expression get target => _target; 2015 Expression get target => _target;
2006 2016
2007 /** 2017 /**
2008 * Set the target of the cascade sections to the given expression. 2018 * Set the target of the cascade sections to the given expression.
2009 * 2019 *
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
3191 3201
3192 /** 3202 /**
3193 * Return the expression that is executed if the condition evaluates to `false `. 3203 * Return the expression that is executed if the condition evaluates to `false `.
3194 * 3204 *
3195 * @return the expression that is executed if the condition evaluates to `fals e` 3205 * @return the expression that is executed if the condition evaluates to `fals e`
3196 */ 3206 */
3197 Expression get elseExpression => _elseExpression; 3207 Expression get elseExpression => _elseExpression;
3198 3208
3199 Token get endToken => _elseExpression.endToken; 3209 Token get endToken => _elseExpression.endToken;
3200 3210
3211 int get precedence => 3;
3212
3201 /** 3213 /**
3202 * Return the expression that is executed if the condition evaluates to `true` . 3214 * Return the expression that is executed if the condition evaluates to `true` .
3203 * 3215 *
3204 * @return the expression that is executed if the condition evaluates to `true ` 3216 * @return the expression that is executed if the condition evaluates to `true `
3205 */ 3217 */
3206 Expression get thenExpression => _thenExpression; 3218 Expression get thenExpression => _thenExpression;
3207 3219
3208 /** 3220 /**
3209 * Set the condition used to determine which of the expressions is executed ne xt to the given 3221 * Set the condition used to determine which of the expressions is executed ne xt to the given
3210 * expression. 3222 * expression.
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
4504 void visitChildren(ASTVisitor visitor) { 4516 void visitChildren(ASTVisitor visitor) {
4505 } 4517 }
4506 } 4518 }
4507 4519
4508 /** 4520 /**
4509 * Ephemeral identifiers are created as needed to mimic the presence of an empty identifier. 4521 * Ephemeral identifiers are created as needed to mimic the presence of an empty identifier.
4510 * 4522 *
4511 * @coverage dart.engine.ast 4523 * @coverage dart.engine.ast
4512 */ 4524 */
4513 class EphemeralIdentifier extends SimpleIdentifier { 4525 class EphemeralIdentifier extends SimpleIdentifier {
4514 EphemeralIdentifier.full(ASTNode parent, int location) : super.full(new Token( TokenType.IDENTIFIER, location)) { 4526 EphemeralIdentifier.full(ASTNode parent, int location) : super.full(new String Token(TokenType.IDENTIFIER, "", location)) {
4515 parent.becomeParentOf(this); 4527 parent.becomeParentOf(this);
4516 } 4528 }
4517 4529
4518 EphemeralIdentifier({ASTNode parent, int location}) : this.full(parent, locati on); 4530 EphemeralIdentifier({ASTNode parent, int location}) : this.full(parent, locati on);
4519 } 4531 }
4520 4532
4521 /** 4533 /**
4522 * Instances of the class `ExportDirective` represent an export directive. 4534 * Instances of the class `ExportDirective` represent an export directive.
4523 * 4535 *
4524 * <pre> 4536 * <pre>
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
4621 Type2 get bestType { 4633 Type2 get bestType {
4622 if (propagatedType != null) { 4634 if (propagatedType != null) {
4623 return propagatedType; 4635 return propagatedType;
4624 } else if (staticType != null) { 4636 } else if (staticType != null) {
4625 return staticType; 4637 return staticType;
4626 } 4638 }
4627 return DynamicTypeImpl.instance; 4639 return DynamicTypeImpl.instance;
4628 } 4640 }
4629 4641
4630 /** 4642 /**
4643 * Return the precedence of this expression. The precedence is a positive inte ger value that
4644 * defines how the source code is parsed into an AST. For example `a * b + c` is parsed as
4645 * `(a * b) + c` because the precedence of `*` is greater than the precedence of
4646 * `+`.
4647 *
4648 * You should not assume that returned values will stay the same, they might c hange as result of
4649 * specification change. Only relative order should be used.
4650 *
4651 * @return the precedence of this expression
4652 */
4653 int get precedence;
4654
4655 /**
4631 * If this expression is an argument to an invocation, and the AST structure h as been resolved, 4656 * If this expression is an argument to an invocation, and the AST structure h as been resolved,
4632 * and the function being invoked is known based on propagated type informatio n, and this 4657 * and the function being invoked is known based on propagated type informatio n, and this
4633 * expression corresponds to one of the parameters of the function being invok ed, then return the 4658 * expression corresponds to one of the parameters of the function being invok ed, then return the
4634 * parameter element representing the parameter to which the value of this exp ression will be 4659 * parameter element representing the parameter to which the value of this exp ression will be
4635 * bound. Otherwise, return `null`. 4660 * bound. Otherwise, return `null`.
4636 * 4661 *
4637 * @return the parameter element representing the parameter to which the value of this expression 4662 * @return the parameter element representing the parameter to which the value of this expression
4638 * will be bound 4663 * will be bound
4639 */ 4664 */
4640 ParameterElement get propagatedParameterElement { 4665 ParameterElement get propagatedParameterElement {
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
6103 throw new IllegalStateException("Non-external functions must have a body"); 6128 throw new IllegalStateException("Non-external functions must have a body");
6104 } 6129 }
6105 6130
6106 /** 6131 /**
6107 * Return the parameters associated with the function. 6132 * Return the parameters associated with the function.
6108 * 6133 *
6109 * @return the parameters associated with the function 6134 * @return the parameters associated with the function
6110 */ 6135 */
6111 FormalParameterList get parameters => _parameters; 6136 FormalParameterList get parameters => _parameters;
6112 6137
6138 int get precedence => 16;
6139
6113 /** 6140 /**
6114 * Set the body of the function to the given function body. 6141 * Set the body of the function to the given function body.
6115 * 6142 *
6116 * @param functionBody the body of the function 6143 * @param functionBody the body of the function
6117 */ 6144 */
6118 void set body(FunctionBody functionBody) { 6145 void set body(FunctionBody functionBody) {
6119 _body = becomeParentOf(functionBody); 6146 _body = becomeParentOf(functionBody);
6120 } 6147 }
6121 6148
6122 /** 6149 /**
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
6219 6246
6220 Token get endToken => _argumentList.endToken; 6247 Token get endToken => _argumentList.endToken;
6221 6248
6222 /** 6249 /**
6223 * Return the expression producing the function being invoked. 6250 * Return the expression producing the function being invoked.
6224 * 6251 *
6225 * @return the expression producing the function being invoked 6252 * @return the expression producing the function being invoked
6226 */ 6253 */
6227 Expression get function => _function; 6254 Expression get function => _function;
6228 6255
6256 int get precedence => 15;
6257
6229 /** 6258 /**
6230 * Return the element associated with the function being invoked based on prop agated type 6259 * Return the element associated with the function being invoked based on prop agated type
6231 * information, or `null` if the AST structure has not been resolved or the fu nction could 6260 * information, or `null` if the AST structure has not been resolved or the fu nction could
6232 * not be resolved. One common example of the latter case is an expression who se value can change 6261 * not be resolved. One common example of the latter case is an expression who se value can change
6233 * over time. 6262 * over time.
6234 * 6263 *
6235 * @return the element associated with the function being invoked 6264 * @return the element associated with the function being invoked
6236 */ 6265 */
6237 ExecutableElement get propagatedElement => _propagatedElement; 6266 ExecutableElement get propagatedElement => _propagatedElement;
6238 6267
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
7146 */ 7175 */
7147 Expression get index => _index; 7176 Expression get index => _index;
7148 7177
7149 /** 7178 /**
7150 * Return the left square bracket. 7179 * Return the left square bracket.
7151 * 7180 *
7152 * @return the left square bracket 7181 * @return the left square bracket
7153 */ 7182 */
7154 Token get leftBracket => _leftBracket; 7183 Token get leftBracket => _leftBracket;
7155 7184
7185 int get precedence => 15;
7186
7156 /** 7187 /**
7157 * Return the element associated with the operator based on the propagated typ e of the target, or 7188 * Return the element associated with the operator based on the propagated typ e of the target, or
7158 * `null` if the AST structure has not been resolved or if the operator could not be 7189 * `null` if the AST structure has not been resolved or if the operator could not be
7159 * resolved. One example of the latter case is an operator that is not defined for the type of the 7190 * resolved. One example of the latter case is an operator that is not defined for the type of the
7160 * target. 7191 * target.
7161 * 7192 *
7162 * @return the element associated with this operator 7193 * @return the element associated with this operator
7163 */ 7194 */
7164 MethodElement get propagatedElement => _propagatedElement; 7195 MethodElement get propagatedElement => _propagatedElement;
7165 7196
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
7430 * Return the list of arguments to the constructor. 7461 * Return the list of arguments to the constructor.
7431 * 7462 *
7432 * @return the list of arguments to the constructor 7463 * @return the list of arguments to the constructor
7433 */ 7464 */
7434 ArgumentList get argumentList => _argumentList; 7465 ArgumentList get argumentList => _argumentList;
7435 7466
7436 Token get beginToken => keyword; 7467 Token get beginToken => keyword;
7437 7468
7438 Token get endToken => _argumentList.endToken; 7469 Token get endToken => _argumentList.endToken;
7439 7470
7471 int get precedence => 15;
7472
7440 /** 7473 /**
7441 * Return `true` if this creation expression is used to invoke a constant cons tructor. 7474 * Return `true` if this creation expression is used to invoke a constant cons tructor.
7442 * 7475 *
7443 * @return `true` if this creation expression is used to invoke a constant con structor 7476 * @return `true` if this creation expression is used to invoke a constant con structor
7444 */ 7477 */
7445 bool get isConst => keyword is KeywordToken && identical((keyword as KeywordTo ken).keyword, Keyword.CONST); 7478 bool get isConst => keyword is KeywordToken && identical((keyword as KeywordTo ken).keyword, Keyword.CONST);
7446 7479
7447 /** 7480 /**
7448 * Set the list of arguments to the constructor to the given list. 7481 * Set the list of arguments to the constructor to the given list.
7449 * 7482 *
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
7761 7794
7762 Token get endToken => _type.endToken; 7795 Token get endToken => _type.endToken;
7763 7796
7764 /** 7797 /**
7765 * Return the expression used to compute the value whose type is being tested. 7798 * Return the expression used to compute the value whose type is being tested.
7766 * 7799 *
7767 * @return the expression used to compute the value whose type is being tested 7800 * @return the expression used to compute the value whose type is being tested
7768 */ 7801 */
7769 Expression get expression => _expression; 7802 Expression get expression => _expression;
7770 7803
7804 int get precedence => 7;
7805
7771 /** 7806 /**
7772 * Return the name of the type being tested for. 7807 * Return the name of the type being tested for.
7773 * 7808 *
7774 * @return the name of the type being tested for 7809 * @return the name of the type being tested for
7775 */ 7810 */
7776 TypeName get type => _type; 7811 TypeName get type => _type;
7777 7812
7778 /** 7813 /**
7779 * Set the expression used to compute the value whose type is being tested to the given 7814 * Set the expression used to compute the value whose type is being tested to the given
7780 * expression. 7815 * expression.
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
8072 if (needsPeriod) { 8107 if (needsPeriod) {
8073 builder.append("."); 8108 builder.append(".");
8074 } else { 8109 } else {
8075 needsPeriod = true; 8110 needsPeriod = true;
8076 } 8111 }
8077 builder.append(identifier.name); 8112 builder.append(identifier.name);
8078 } 8113 }
8079 return builder.toString(); 8114 return builder.toString();
8080 } 8115 }
8081 8116
8117 int get precedence => 15;
8118
8082 Element get propagatedElement => null; 8119 Element get propagatedElement => null;
8083 8120
8084 Element get staticElement => null; 8121 Element get staticElement => null;
8085 8122
8086 void visitChildren(ASTVisitor visitor) { 8123 void visitChildren(ASTVisitor visitor) {
8087 components.accept(visitor); 8124 components.accept(visitor);
8088 } 8125 }
8089 } 8126 }
8090 8127
8091 /** 8128 /**
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
8208 * | [IntegerLiteral] 8245 * | [IntegerLiteral]
8209 * | [ListLiteral] 8246 * | [ListLiteral]
8210 * | [MapLiteral] 8247 * | [MapLiteral]
8211 * | [NullLiteral] 8248 * | [NullLiteral]
8212 * | [StringLiteral] 8249 * | [StringLiteral]
8213 * </pre> 8250 * </pre>
8214 * 8251 *
8215 * @coverage dart.engine.ast 8252 * @coverage dart.engine.ast
8216 */ 8253 */
8217 abstract class Literal extends Expression { 8254 abstract class Literal extends Expression {
8255 int get precedence => 16;
8218 } 8256 }
8219 8257
8220 /** 8258 /**
8221 * Instances of the class `MapLiteral` represent a literal map. 8259 * Instances of the class `MapLiteral` represent a literal map.
8222 * 8260 *
8223 * <pre> 8261 * <pre>
8224 * mapLiteral ::= 8262 * mapLiteral ::=
8225 * 'const'? ('<' [TypeName] (',' [TypeName])* '>')? '{' ([MapLiteralEntry] ( ',' [MapLiteralEntry])* ','?)? '}' 8263 * 'const'? ('<' [TypeName] (',' [TypeName])* '>')? '{' ([MapLiteralEntry] ( ',' [MapLiteralEntry])* ','?)? '}'
8226 * </pre> 8264 * </pre>
8227 * 8265 *
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
8744 8782
8745 Token get endToken => _argumentList.endToken; 8783 Token get endToken => _argumentList.endToken;
8746 8784
8747 /** 8785 /**
8748 * Return the name of the method being invoked. 8786 * Return the name of the method being invoked.
8749 * 8787 *
8750 * @return the name of the method being invoked 8788 * @return the name of the method being invoked
8751 */ 8789 */
8752 SimpleIdentifier get methodName => _methodName; 8790 SimpleIdentifier get methodName => _methodName;
8753 8791
8792 int get precedence => 15;
8793
8754 /** 8794 /**
8755 * Return the expression used to compute the receiver of the invocation. If th is invocation is not 8795 * Return the expression used to compute the receiver of the invocation. If th is invocation is not
8756 * part of a cascade expression, then this is the same as [getTarget]. If this invocation 8796 * part of a cascade expression, then this is the same as [getTarget]. If this invocation
8757 * is part of a cascade expression, then the target stored with the cascade ex pression is 8797 * is part of a cascade expression, then the target stored with the cascade ex pression is
8758 * returned. 8798 * returned.
8759 * 8799 *
8760 * @return the expression used to compute the receiver of the invocation 8800 * @return the expression used to compute the receiver of the invocation
8761 * @see #getTarget() 8801 * @see #getTarget()
8762 */ 8802 */
8763 Expression get realTarget { 8803 Expression get realTarget {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
8896 */ 8936 */
8897 Expression get expression => _expression; 8937 Expression get expression => _expression;
8898 8938
8899 /** 8939 /**
8900 * Return the name associated with the expression. 8940 * Return the name associated with the expression.
8901 * 8941 *
8902 * @return the name associated with the expression 8942 * @return the name associated with the expression
8903 */ 8943 */
8904 Label get name => _name; 8944 Label get name => _name;
8905 8945
8946 int get precedence => 0;
8947
8906 /** 8948 /**
8907 * Set the expression with which the name is associated to the given expressio n. 8949 * Set the expression with which the name is associated to the given expressio n.
8908 * 8950 *
8909 * @param expression the expression with which the name is associated 8951 * @param expression the expression with which the name is associated
8910 */ 8952 */
8911 void set expression(Expression expression) { 8953 void set expression(Expression expression) {
8912 this._expression = becomeParentOf(expression); 8954 this._expression = becomeParentOf(expression);
8913 } 8955 }
8914 8956
8915 /** 8957 /**
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
9349 */ 9391 */
9350 Expression get expression => _expression; 9392 Expression get expression => _expression;
9351 9393
9352 /** 9394 /**
9353 * Return the left parenthesis. 9395 * Return the left parenthesis.
9354 * 9396 *
9355 * @return the left parenthesis 9397 * @return the left parenthesis
9356 */ 9398 */
9357 Token get leftParenthesis => _leftParenthesis; 9399 Token get leftParenthesis => _leftParenthesis;
9358 9400
9401 int get precedence => 15;
9402
9359 /** 9403 /**
9360 * Return the right parenthesis. 9404 * Return the right parenthesis.
9361 * 9405 *
9362 * @return the right parenthesis 9406 * @return the right parenthesis
9363 */ 9407 */
9364 Token get rightParenthesis => _rightParenthesis; 9408 Token get rightParenthesis => _rightParenthesis;
9365 9409
9366 /** 9410 /**
9367 * Set the expression within the parentheses to the given expression. 9411 * Set the expression within the parentheses to the given expression.
9368 * 9412 *
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
9618 9662
9619 Token get endToken => operator; 9663 Token get endToken => operator;
9620 9664
9621 /** 9665 /**
9622 * Return the expression computing the operand for the operator. 9666 * Return the expression computing the operand for the operator.
9623 * 9667 *
9624 * @return the expression computing the operand for the operator 9668 * @return the expression computing the operand for the operator
9625 */ 9669 */
9626 Expression get operand => _operand; 9670 Expression get operand => _operand;
9627 9671
9672 int get precedence => 15;
9673
9628 /** 9674 /**
9629 * Return the element associated with the operator based on the propagated typ e of the operand, or 9675 * Return the element associated with the operator based on the propagated typ e of the operand, or
9630 * `null` if the AST structure has not been resolved, if the operator is not u ser definable, 9676 * `null` if the AST structure has not been resolved, if the operator is not u ser definable,
9631 * or if the operator could not be resolved. One example of the latter case is an operator that is 9677 * or if the operator could not be resolved. One example of the latter case is an operator that is
9632 * not defined for the type of the operand. 9678 * not defined for the type of the operand.
9633 * 9679 *
9634 * @return the element associated with the operator 9680 * @return the element associated with the operator
9635 */ 9681 */
9636 MethodElement get propagatedElement => _propagatedElement; 9682 MethodElement get propagatedElement => _propagatedElement;
9637 9683
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
9797 9843
9798 Token get endToken => _operand.endToken; 9844 Token get endToken => _operand.endToken;
9799 9845
9800 /** 9846 /**
9801 * Return the expression computing the operand for the operator. 9847 * Return the expression computing the operand for the operator.
9802 * 9848 *
9803 * @return the expression computing the operand for the operator 9849 * @return the expression computing the operand for the operator
9804 */ 9850 */
9805 Expression get operand => _operand; 9851 Expression get operand => _operand;
9806 9852
9853 int get precedence => 14;
9854
9807 /** 9855 /**
9808 * Return the element associated with the operator based on the propagated typ e of the operand, or 9856 * Return the element associated with the operator based on the propagated typ e of the operand, or
9809 * `null` if the AST structure has not been resolved, if the operator is not u ser definable, 9857 * `null` if the AST structure has not been resolved, if the operator is not u ser definable,
9810 * or if the operator could not be resolved. One example of the latter case is an operator that is 9858 * or if the operator could not be resolved. One example of the latter case is an operator that is
9811 * not defined for the type of the operand. 9859 * not defined for the type of the operand.
9812 * 9860 *
9813 * @return the element associated with the operator 9861 * @return the element associated with the operator
9814 */ 9862 */
9815 MethodElement get propagatedElement => _propagatedElement; 9863 MethodElement get propagatedElement => _propagatedElement;
9816 9864
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
9965 10013
9966 /** 10014 /**
9967 * Return the identifier being prefixed. 10015 * Return the identifier being prefixed.
9968 * 10016 *
9969 * @return the identifier being prefixed 10017 * @return the identifier being prefixed
9970 */ 10018 */
9971 SimpleIdentifier get identifier => _identifier; 10019 SimpleIdentifier get identifier => _identifier;
9972 10020
9973 String get name => "${_prefix.name}.${_identifier.name}"; 10021 String get name => "${_prefix.name}.${_identifier.name}";
9974 10022
10023 int get precedence => 15;
10024
9975 /** 10025 /**
9976 * Return the prefix associated with the library in which the identifier is de fined. 10026 * Return the prefix associated with the library in which the identifier is de fined.
9977 * 10027 *
9978 * @return the prefix associated with the library in which the identifier is d efined 10028 * @return the prefix associated with the library in which the identifier is d efined
9979 */ 10029 */
9980 SimpleIdentifier get prefix => _prefix; 10030 SimpleIdentifier get prefix => _prefix;
9981 10031
9982 Element get propagatedElement { 10032 Element get propagatedElement {
9983 if (_identifier == null) { 10033 if (_identifier == null) {
9984 return null; 10034 return null;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
10074 10124
10075 Token get beginToken { 10125 Token get beginToken {
10076 if (_target != null) { 10126 if (_target != null) {
10077 return _target.beginToken; 10127 return _target.beginToken;
10078 } 10128 }
10079 return operator; 10129 return operator;
10080 } 10130 }
10081 10131
10082 Token get endToken => _propertyName.endToken; 10132 Token get endToken => _propertyName.endToken;
10083 10133
10134 int get precedence => 15;
10135
10084 /** 10136 /**
10085 * Return the name of the property being accessed. 10137 * Return the name of the property being accessed.
10086 * 10138 *
10087 * @return the name of the property being accessed 10139 * @return the name of the property being accessed
10088 */ 10140 */
10089 SimpleIdentifier get propertyName => _propertyName; 10141 SimpleIdentifier get propertyName => _propertyName;
10090 10142
10091 /** 10143 /**
10092 * Return the expression used to compute the receiver of the invocation. If th is invocation is not 10144 * Return the expression used to compute the receiver of the invocation. If th is invocation is not
10093 * part of a cascade expression, then this is the same as [getTarget]. If this invocation 10145 * part of a cascade expression, then this is the same as [getTarget]. If this invocation
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
10299 * @param keyword the token representing the 'rethrow' keyword 10351 * @param keyword the token representing the 'rethrow' keyword
10300 */ 10352 */
10301 RethrowExpression({Token keyword}) : this.full(keyword); 10353 RethrowExpression({Token keyword}) : this.full(keyword);
10302 10354
10303 accept(ASTVisitor visitor) => visitor.visitRethrowExpression(this); 10355 accept(ASTVisitor visitor) => visitor.visitRethrowExpression(this);
10304 10356
10305 Token get beginToken => keyword; 10357 Token get beginToken => keyword;
10306 10358
10307 Token get endToken => keyword; 10359 Token get endToken => keyword;
10308 10360
10361 int get precedence => 0;
10362
10309 void visitChildren(ASTVisitor visitor) { 10363 void visitChildren(ASTVisitor visitor) {
10310 } 10364 }
10311 } 10365 }
10312 10366
10313 /** 10367 /**
10314 * Instances of the class `ReturnStatement` represent a return statement. 10368 * Instances of the class `ReturnStatement` represent a return statement.
10315 * 10369 *
10316 * <pre> 10370 * <pre>
10317 * returnStatement ::= 10371 * returnStatement ::=
10318 * 'return' [Expression]? ';' 10372 * 'return' [Expression]? ';'
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
10628 if (_propagatedElement == null) { 10682 if (_propagatedElement == null) {
10629 return _staticElement; 10683 return _staticElement;
10630 } 10684 }
10631 return _propagatedElement; 10685 return _propagatedElement;
10632 } 10686 }
10633 10687
10634 Token get endToken => token; 10688 Token get endToken => token;
10635 10689
10636 String get name => token.lexeme; 10690 String get name => token.lexeme;
10637 10691
10692 int get precedence => 16;
10693
10638 Element get propagatedElement => _propagatedElement; 10694 Element get propagatedElement => _propagatedElement;
10639 10695
10640 Element get staticElement => _staticElement; 10696 Element get staticElement => _staticElement;
10641 10697
10642 /** 10698 /**
10643 * Return `true` if this identifier is the name being declared in a declaratio n. 10699 * Return `true` if this identifier is the name being declared in a declaratio n.
10644 * 10700 *
10645 * @return `true` if this identifier is the name being declared in a declarati on 10701 * @return `true` if this identifier is the name being declared in a declarati on
10646 */ 10702 */
10647 bool inDeclarationContext() { 10703 bool inDeclarationContext() {
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
11192 * @param keyword the token representing the keyword 11248 * @param keyword the token representing the keyword
11193 */ 11249 */
11194 SuperExpression({Token keyword}) : this.full(keyword); 11250 SuperExpression({Token keyword}) : this.full(keyword);
11195 11251
11196 accept(ASTVisitor visitor) => visitor.visitSuperExpression(this); 11252 accept(ASTVisitor visitor) => visitor.visitSuperExpression(this);
11197 11253
11198 Token get beginToken => keyword; 11254 Token get beginToken => keyword;
11199 11255
11200 Token get endToken => keyword; 11256 Token get endToken => keyword;
11201 11257
11258 int get precedence => 16;
11259
11202 void visitChildren(ASTVisitor visitor) { 11260 void visitChildren(ASTVisitor visitor) {
11203 } 11261 }
11204 } 11262 }
11205 11263
11206 /** 11264 /**
11207 * Instances of the class `SwitchCase` represent the case in a switch statement. 11265 * Instances of the class `SwitchCase` represent the case in a switch statement.
11208 * 11266 *
11209 * <pre> 11267 * <pre>
11210 * switchCase ::= 11268 * switchCase ::=
11211 * [SimpleIdentifier]* 'case' [Expression] ':' [Statement]* 11269 * [SimpleIdentifier]* 'case' [Expression] ':' [Statement]*
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
11573 * @param keyword the token representing the keyword 11631 * @param keyword the token representing the keyword
11574 */ 11632 */
11575 ThisExpression({Token keyword}) : this.full(keyword); 11633 ThisExpression({Token keyword}) : this.full(keyword);
11576 11634
11577 accept(ASTVisitor visitor) => visitor.visitThisExpression(this); 11635 accept(ASTVisitor visitor) => visitor.visitThisExpression(this);
11578 11636
11579 Token get beginToken => keyword; 11637 Token get beginToken => keyword;
11580 11638
11581 Token get endToken => keyword; 11639 Token get endToken => keyword;
11582 11640
11641 int get precedence => 16;
11642
11583 void visitChildren(ASTVisitor visitor) { 11643 void visitChildren(ASTVisitor visitor) {
11584 } 11644 }
11585 } 11645 }
11586 11646
11587 /** 11647 /**
11588 * Instances of the class `ThrowExpression` represent a throw expression. 11648 * Instances of the class `ThrowExpression` represent a throw expression.
11589 * 11649 *
11590 * <pre> 11650 * <pre>
11591 * throwExpression ::= 11651 * throwExpression ::=
11592 * 'throw' [Expression] 11652 * 'throw' [Expression]
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
11635 return keyword; 11695 return keyword;
11636 } 11696 }
11637 11697
11638 /** 11698 /**
11639 * Return the expression computing the exception to be thrown. 11699 * Return the expression computing the exception to be thrown.
11640 * 11700 *
11641 * @return the expression computing the exception to be thrown 11701 * @return the expression computing the exception to be thrown
11642 */ 11702 */
11643 Expression get expression => _expression; 11703 Expression get expression => _expression;
11644 11704
11705 int get precedence => 0;
11706
11645 /** 11707 /**
11646 * Set the expression computing the exception to be thrown to the given expres sion. 11708 * Set the expression computing the exception to be thrown to the given expres sion.
11647 * 11709 *
11648 * @param expression the expression computing the exception to be thrown 11710 * @param expression the expression computing the exception to be thrown
11649 */ 11711 */
11650 void set expression(Expression expression) { 11712 void set expression(Expression expression) {
11651 this._expression = becomeParentOf(expression); 11713 this._expression = becomeParentOf(expression);
11652 } 11714 }
11653 11715
11654 void visitChildren(ASTVisitor visitor) { 11716 void visitChildren(ASTVisitor visitor) {
(...skipping 4226 matching lines...) Expand 10 before | Expand all | Expand 10 after
15881 WithClause visitWithClause(WithClause node) => new WithClause.full(node.withKe yword, clone3(node.mixinTypes)); 15943 WithClause visitWithClause(WithClause node) => new WithClause.full(node.withKe yword, clone3(node.mixinTypes));
15882 15944
15883 ASTNode clone2(ASTNode node) { 15945 ASTNode clone2(ASTNode node) {
15884 if (node == null) { 15946 if (node == null) {
15885 return null; 15947 return null;
15886 } 15948 }
15887 return node.accept(this) as ASTNode; 15949 return node.accept(this) as ASTNode;
15888 } 15950 }
15889 15951
15890 List clone3(NodeList nodes) { 15952 List clone3(NodeList nodes) {
15953 int count = nodes.length;
15891 List clonedNodes = new List(); 15954 List clonedNodes = new List();
15892 for (ASTNode node in nodes) { 15955 for (int i = 0; i < count; i++) {
15893 clonedNodes.add(node.accept(this) as ASTNode); 15956 clonedNodes.add((nodes[i]).accept(this) as ASTNode);
15894 } 15957 }
15895 return clonedNodes; 15958 return clonedNodes;
15896 } 15959 }
15897 } 15960 }
15898 15961
15899 /** 15962 /**
15900 * Instances of the class `ASTComparator` compare the structure of two ASTNodes to see whether 15963 * Instances of the class `ASTComparator` compare the structure of two ASTNodes to see whether
15901 * they are equal. 15964 * they are equal.
15902 */ 15965 */
15903 class ASTComparator implements ASTVisitor<bool> { 15966 class ASTComparator implements ASTVisitor<bool> {
15904 /** 15967 /**
15905 * Return `true` if the two AST nodes are equal. 15968 * Return `true` if the two AST nodes are equal.
15906 * 15969 *
15907 * @param first the first node being compared 15970 * @param first the first node being compared
15908 * @param second the second node being compared 15971 * @param second the second node being compared
15909 * @return `true` if the two AST nodes are equal 15972 * @return `true` if the two AST nodes are equal
15910 */ 15973 */
15911 static bool equals3(CompilationUnit first, CompilationUnit second) { 15974 static bool equals4(CompilationUnit first, CompilationUnit second) {
15912 ASTComparator comparator = new ASTComparator(); 15975 ASTComparator comparator = new ASTComparator();
15913 return comparator.isEqual(first, second); 15976 return comparator.isEqual(first, second);
15914 } 15977 }
15915 15978
15916 /** 15979 /**
15917 * The AST node with which the node being visited is to be compared. This is o nly valid at the 15980 * The AST node with which the node being visited is to be compared. This is o nly valid at the
15918 * beginning of each visit method (until [isEqual] is invoked). 15981 * beginning of each visit method (until [isEqual] is invoked).
15919 */ 15982 */
15920 ASTNode _other; 15983 ASTNode _other;
15921 15984
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
16169 return isEqual(node.target, other.target) && isEqual6(node.leftBracket, othe r.leftBracket) && isEqual(node.index, other.index) && isEqual6(node.rightBracket , other.rightBracket); 16232 return isEqual(node.target, other.target) && isEqual6(node.leftBracket, othe r.leftBracket) && isEqual(node.index, other.index) && isEqual6(node.rightBracket , other.rightBracket);
16170 } 16233 }
16171 16234
16172 bool visitInstanceCreationExpression(InstanceCreationExpression node) { 16235 bool visitInstanceCreationExpression(InstanceCreationExpression node) {
16173 InstanceCreationExpression other = this._other as InstanceCreationExpression ; 16236 InstanceCreationExpression other = this._other as InstanceCreationExpression ;
16174 return isEqual6(node.keyword, other.keyword) && isEqual(node.constructorName , other.constructorName) && isEqual(node.argumentList, other.argumentList); 16237 return isEqual6(node.keyword, other.keyword) && isEqual(node.constructorName , other.constructorName) && isEqual(node.argumentList, other.argumentList);
16175 } 16238 }
16176 16239
16177 bool visitIntegerLiteral(IntegerLiteral node) { 16240 bool visitIntegerLiteral(IntegerLiteral node) {
16178 IntegerLiteral other = this._other as IntegerLiteral; 16241 IntegerLiteral other = this._other as IntegerLiteral;
16179 return isEqual6(node.literal, other.literal) && identical(node.value, other. value); 16242 return isEqual6(node.literal, other.literal) && (node.value == other.value);
16180 } 16243 }
16181 16244
16182 bool visitInterpolationExpression(InterpolationExpression node) { 16245 bool visitInterpolationExpression(InterpolationExpression node) {
16183 InterpolationExpression other = this._other as InterpolationExpression; 16246 InterpolationExpression other = this._other as InterpolationExpression;
16184 return isEqual6(node.leftBracket, other.leftBracket) && isEqual(node.express ion, other.expression) && isEqual6(node.rightBracket, other.rightBracket); 16247 return isEqual6(node.leftBracket, other.leftBracket) && isEqual(node.express ion, other.expression) && isEqual6(node.rightBracket, other.rightBracket);
16185 } 16248 }
16186 16249
16187 bool visitInterpolationString(InterpolationString node) { 16250 bool visitInterpolationString(InterpolationString node) {
16188 InterpolationString other = this._other as InterpolationString; 16251 InterpolationString other = this._other as InterpolationString;
16189 return isEqual6(node.contents, other.contents) && node.value == other.value; 16252 return isEqual6(node.contents, other.contents) && node.value == other.value;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
16324 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual(node.identifier, other.identifier); 16387 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual(node.identifier, other.identifier);
16325 } 16388 }
16326 16389
16327 bool visitSimpleIdentifier(SimpleIdentifier node) { 16390 bool visitSimpleIdentifier(SimpleIdentifier node) {
16328 SimpleIdentifier other = this._other as SimpleIdentifier; 16391 SimpleIdentifier other = this._other as SimpleIdentifier;
16329 return isEqual6(node.token, other.token); 16392 return isEqual6(node.token, other.token);
16330 } 16393 }
16331 16394
16332 bool visitSimpleStringLiteral(SimpleStringLiteral node) { 16395 bool visitSimpleStringLiteral(SimpleStringLiteral node) {
16333 SimpleStringLiteral other = this._other as SimpleStringLiteral; 16396 SimpleStringLiteral other = this._other as SimpleStringLiteral;
16334 return isEqual6(node.literal, other.literal) && identical(node.value, other. value); 16397 return isEqual6(node.literal, other.literal) && (node.value == other.value);
16335 } 16398 }
16336 16399
16337 bool visitStringInterpolation(StringInterpolation node) { 16400 bool visitStringInterpolation(StringInterpolation node) {
16338 StringInterpolation other = this._other as StringInterpolation; 16401 StringInterpolation other = this._other as StringInterpolation;
16339 return isEqual5(node.elements, other.elements); 16402 return isEqual5(node.elements, other.elements);
16340 } 16403 }
16341 16404
16342 bool visitSuperConstructorInvocation(SuperConstructorInvocation node) { 16405 bool visitSuperConstructorInvocation(SuperConstructorInvocation node) {
16343 SuperConstructorInvocation other = this._other as SuperConstructorInvocation ; 16406 SuperConstructorInvocation other = this._other as SuperConstructorInvocation ;
16344 return isEqual6(node.keyword, other.keyword) && isEqual6(node.period, other. period) && isEqual(node.constructorName, other.constructorName) && isEqual(node. argumentList, other.argumentList); 16407 return isEqual6(node.keyword, other.keyword) && isEqual6(node.period, other. period) && isEqual(node.constructorName, other.constructorName) && isEqual(node. argumentList, other.argumentList);
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
17332 void operator[]=(int index, E node) { 17395 void operator[]=(int index, E node) {
17333 if (index < 0 || index >= _elements.length) { 17396 if (index < 0 || index >= _elements.length) {
17334 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); 17397 throw new RangeError("Index: ${index}, Size: ${_elements.length}");
17335 } 17398 }
17336 _elements[index] as E; 17399 _elements[index] as E;
17337 owner.becomeParentOf(node); 17400 owner.becomeParentOf(node);
17338 _elements[index] = node; 17401 _elements[index] = node;
17339 } 17402 }
17340 int get length => _elements.length; 17403 int get length => _elements.length;
17341 } 17404 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698