OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
7 | 7 |
8 library engine.ast; | 8 library engine.ast; |
9 | 9 |
10 import 'dart:collection'; | 10 import 'dart:collection'; |
(...skipping 10076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10087 * The token representing the literal. | 10087 * The token representing the literal. |
10088 */ | 10088 */ |
10089 Token literal; | 10089 Token literal; |
10090 | 10090 |
10091 /** | 10091 /** |
10092 * The value of the literal. | 10092 * The value of the literal. |
10093 */ | 10093 */ |
10094 String _value; | 10094 String _value; |
10095 | 10095 |
10096 /** | 10096 /** |
| 10097 * The toolkit specific element associated with this literal, or `null`. |
| 10098 */ |
| 10099 Element _toolkitElement; |
| 10100 |
| 10101 /** |
10097 * Initialize a newly created simple string literal. | 10102 * Initialize a newly created simple string literal. |
10098 * | 10103 * |
10099 * @param literal the token representing the literal | 10104 * @param literal the token representing the literal |
10100 * @param value the value of the literal | 10105 * @param value the value of the literal |
10101 */ | 10106 */ |
10102 SimpleStringLiteral(this.literal, String value) { | 10107 SimpleStringLiteral(this.literal, String value) { |
10103 this._value = StringUtilities.intern(value); | 10108 this._value = StringUtilities.intern(value); |
10104 } | 10109 } |
10105 | 10110 |
10106 accept(ASTVisitor visitor) => visitor.visitSimpleStringLiteral(this); | 10111 accept(ASTVisitor visitor) => visitor.visitSimpleStringLiteral(this); |
10107 | 10112 |
10108 Token get beginToken => literal; | 10113 Token get beginToken => literal; |
10109 | 10114 |
10110 Token get endToken => literal; | 10115 Token get endToken => literal; |
10111 | 10116 |
10112 /** | 10117 /** |
| 10118 * Return the toolkit specific, non-Dart, element associated with this literal
, or `null`. |
| 10119 * |
| 10120 * @return the element associated with this literal |
| 10121 */ |
| 10122 Element get toolkitElement => _toolkitElement; |
| 10123 |
| 10124 /** |
10113 * Return the value of the literal. | 10125 * Return the value of the literal. |
10114 * | 10126 * |
10115 * @return the value of the literal | 10127 * @return the value of the literal |
10116 */ | 10128 */ |
10117 String get value => _value; | 10129 String get value => _value; |
10118 | 10130 |
10119 /** | 10131 /** |
10120 * Return the offset of the first value character. | 10132 * Return the offset of the first value character. |
10121 * | 10133 * |
10122 * @return the offset of the first value character | 10134 * @return the offset of the first value character |
(...skipping 27 matching lines...) Expand all Loading... |
10150 /** | 10162 /** |
10151 * Return `true` if this string literal is a raw string. | 10163 * Return `true` if this string literal is a raw string. |
10152 * | 10164 * |
10153 * @return `true` if this string literal is a raw string | 10165 * @return `true` if this string literal is a raw string |
10154 */ | 10166 */ |
10155 bool get isRaw => literal.lexeme.codeUnitAt(0) == 0x72; | 10167 bool get isRaw => literal.lexeme.codeUnitAt(0) == 0x72; |
10156 | 10168 |
10157 bool get isSynthetic => literal.isSynthetic; | 10169 bool get isSynthetic => literal.isSynthetic; |
10158 | 10170 |
10159 /** | 10171 /** |
| 10172 * Set the toolkit specific, non-Dart, element associated with this literal. |
| 10173 * |
| 10174 * @param element the toolkit specific element to be associated with this lite
ral |
| 10175 */ |
| 10176 void set toolkitElement(Element element) { |
| 10177 _toolkitElement = element; |
| 10178 } |
| 10179 |
| 10180 /** |
10160 * Set the value of the literal to the given string. | 10181 * Set the value of the literal to the given string. |
10161 * | 10182 * |
10162 * @param string the value of the literal | 10183 * @param string the value of the literal |
10163 */ | 10184 */ |
10164 void set value(String string) { | 10185 void set value(String string) { |
10165 _value = StringUtilities.intern(_value); | 10186 _value = StringUtilities.intern(_value); |
10166 } | 10187 } |
10167 | 10188 |
10168 void visitChildren(ASTVisitor visitor) { | 10189 void visitChildren(ASTVisitor visitor) { |
10169 } | 10190 } |
(...skipping 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12169 // numeric or {@code null} | 12190 // numeric or {@code null} |
12170 if (leftOperand is int && rightOperand is int) { | 12191 if (leftOperand is int && rightOperand is int) { |
12171 if (rightOperand != 0) { | 12192 if (rightOperand != 0) { |
12172 return leftOperand ~/ rightOperand; | 12193 return leftOperand ~/ rightOperand; |
12173 } else { | 12194 } else { |
12174 return 0; | 12195 return 0; |
12175 } | 12196 } |
12176 } else if (leftOperand is double && rightOperand is double) { | 12197 } else if (leftOperand is double && rightOperand is double) { |
12177 return leftOperand ~/ rightOperand; | 12198 return leftOperand ~/ rightOperand; |
12178 } | 12199 } |
| 12200 } else { |
12179 } | 12201 } |
12180 break; | 12202 break; |
12181 } | 12203 } |
12182 // TODO(brianwilkerson) This doesn't handle numeric conversions. | 12204 // TODO(brianwilkerson) This doesn't handle numeric conversions. |
12183 return visitExpression(node); | 12205 return visitExpression(node); |
12184 } | 12206 } |
12185 | 12207 |
12186 Object visitBooleanLiteral(BooleanLiteral node) => node.value ? true : false; | 12208 Object visitBooleanLiteral(BooleanLiteral node) => node.value ? true : false; |
12187 | 12209 |
12188 Object visitDoubleLiteral(DoubleLiteral node) => node.value; | 12210 Object visitDoubleLiteral(DoubleLiteral node) => node.value; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12251 return ~operand; | 12273 return ~operand; |
12252 } | 12274 } |
12253 } else if (node.operator.type == TokenType.MINUS) { | 12275 } else if (node.operator.type == TokenType.MINUS) { |
12254 if (operand == null) { | 12276 if (operand == null) { |
12255 return null; | 12277 return null; |
12256 } else if (operand is int) { | 12278 } else if (operand is int) { |
12257 return -operand; | 12279 return -operand; |
12258 } else if (operand is double) { | 12280 } else if (operand is double) { |
12259 return -operand; | 12281 return -operand; |
12260 } | 12282 } |
| 12283 } else { |
12261 } | 12284 } |
12262 break; | 12285 break; |
12263 } | 12286 } |
12264 return NOT_A_CONSTANT; | 12287 return NOT_A_CONSTANT; |
12265 } | 12288 } |
12266 | 12289 |
12267 Object visitPropertyAccess(PropertyAccess node) => getConstantValue(null); | 12290 Object visitPropertyAccess(PropertyAccess node) => getConstantValue(null); |
12268 | 12291 |
12269 Object visitSimpleIdentifier(SimpleIdentifier node) => getConstantValue(null); | 12292 Object visitSimpleIdentifier(SimpleIdentifier node) => getConstantValue(null); |
12270 | 12293 |
(...skipping 4194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16465 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); | 16488 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); |
16466 } | 16489 } |
16467 owner.becomeParentOf(node); | 16490 owner.becomeParentOf(node); |
16468 _elements[index] = node; | 16491 _elements[index] = node; |
16469 } | 16492 } |
16470 int get length => _elements.length; | 16493 int get length => _elements.length; |
16471 void set length(int value) { | 16494 void set length(int value) { |
16472 throw new UnsupportedError("Cannot resize NodeList."); | 16495 throw new UnsupportedError("Cannot resize NodeList."); |
16473 } | 16496 } |
16474 } | 16497 } |
OLD | NEW |