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

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

Issue 200583002: Analyzer snapshot with disabled 'this.field' generation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/ast.dart ('k') | pkg/analyzer/lib/src/generated/element.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.constant; 8 library engine.constant;
9 9
10 import 'java_core.dart'; 10 import 'java_core.dart';
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 * compile-time constant that evaluates to the given value. 199 * compile-time constant that evaluates to the given value.
200 * 200 *
201 * @param value the value of the expression 201 * @param value the value of the expression
202 * @return the result of evaluating an expression that is a compile-time const ant 202 * @return the result of evaluating an expression that is a compile-time const ant
203 */ 203 */
204 static EvaluationResult forValue(DartObject value) => new EvaluationResult(val ue, null); 204 static EvaluationResult forValue(DartObject value) => new EvaluationResult(val ue, null);
205 205
206 /** 206 /**
207 * The value of the expression. 207 * The value of the expression.
208 */ 208 */
209 final DartObject value; 209 DartObject value;
210 210
211 /** 211 /**
212 * The errors that should be reported for the expression(s) that were evaluate d. 212 * The errors that should be reported for the expression(s) that were evaluate d.
213 */ 213 */
214 List<AnalysisError> _errors; 214 List<AnalysisError> _errors;
215 215
216 /** 216 /**
217 * Initialize a newly created result object with the given state. Clients shou ld use one of the 217 * Initialize a newly created result object with the given state. Clients shou ld use one of the
218 * factory methods: [forErrors] and [forValue]. 218 * factory methods: [forErrors] and [forValue].
219 * 219 *
220 * @param value the value of the expression 220 * @param value the value of the expression
221 * @param errors the errors that should be reported for the expression(s) that were evaluated 221 * @param errors the errors that should be reported for the expression(s) that were evaluated
222 */ 222 */
223 EvaluationResult(this.value, List<AnalysisError> errors) { 223 EvaluationResult(DartObject value, List<AnalysisError> errors) {
224 this.value = value;
224 this._errors = errors; 225 this._errors = errors;
225 } 226 }
226 227
227 /** 228 /**
228 * Return an array containing the errors that should be reported for the expre ssion(s) that were 229 * Return an array containing the errors that should be reported for the expre ssion(s) that were
229 * evaluated. If there are no such errors, the array will be empty. The array can be empty even if 230 * evaluated. If there are no such errors, the array will be empty. The array can be empty even if
230 * the expression is not a valid compile time constant if the errors would hav e been reported by 231 * the expression is not a valid compile time constant if the errors would hav e been reported by
231 * other parts of the analysis engine. 232 * other parts of the analysis engine.
232 */ 233 */
233 List<AnalysisError> get errors => _errors == null ? AnalysisError.NO_ERRORS : _errors; 234 List<AnalysisError> get errors => _errors == null ? AnalysisError.NO_ERRORS : _errors;
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 EvaluationResultImpl timesError(BinaryExpression node, ErrorResult leftOperand ) => new ErrorResult.con2(this, leftOperand); 1120 EvaluationResultImpl timesError(BinaryExpression node, ErrorResult leftOperand ) => new ErrorResult.con2(this, leftOperand);
1120 1121
1121 @override 1122 @override
1122 EvaluationResultImpl timesValid(TypeProvider typeProvider, BinaryExpression no de, ValidResult leftOperand) => this; 1123 EvaluationResultImpl timesValid(TypeProvider typeProvider, BinaryExpression no de, ValidResult leftOperand) => this;
1123 } 1124 }
1124 1125
1125 class ErrorResult_ErrorData { 1126 class ErrorResult_ErrorData {
1126 /** 1127 /**
1127 * The node against which the error should be reported. 1128 * The node against which the error should be reported.
1128 */ 1129 */
1129 final AstNode node; 1130 AstNode node;
1130 1131
1131 /** 1132 /**
1132 * The error code for the error to be generated. 1133 * The error code for the error to be generated.
1133 */ 1134 */
1134 final ErrorCode errorCode; 1135 ErrorCode errorCode;
1135 1136
1136 /** 1137 /**
1137 * Initialize a newly created data holder to represent the error with the give n code reported 1138 * Initialize a newly created data holder to represent the error with the give n code reported
1138 * against the given node. 1139 * against the given node.
1139 * 1140 *
1140 * @param node the node against which the error should be reported 1141 * @param node the node against which the error should be reported
1141 * @param errorCode the error code for the error to be generated 1142 * @param errorCode the error code for the error to be generated
1142 */ 1143 */
1143 ErrorResult_ErrorData(this.node, this.errorCode); 1144 ErrorResult_ErrorData(AstNode node, ErrorCode errorCode) {
1145 this.node = node;
1146 this.errorCode = errorCode;
1147 }
1144 } 1148 }
1145 1149
1146 /** 1150 /**
1147 * Instances of the class `InternalResult` represent the result of attempting to evaluate a 1151 * Instances of the class `InternalResult` represent the result of attempting to evaluate a
1148 * expression. 1152 * expression.
1149 */ 1153 */
1150 abstract class EvaluationResultImpl { 1154 abstract class EvaluationResultImpl {
1151 EvaluationResultImpl add(TypeProvider typeProvider, BinaryExpression node, Eva luationResultImpl rightOperand); 1155 EvaluationResultImpl add(TypeProvider typeProvider, BinaryExpression node, Eva luationResultImpl rightOperand);
1152 1156
1153 /** 1157 /**
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 } 1338 }
1335 1339
1336 /** 1340 /**
1337 * Instances of the class `ValidResult` represent the result of attempting to ev aluate a valid 1341 * Instances of the class `ValidResult` represent the result of attempting to ev aluate a valid
1338 * compile time constant expression. 1342 * compile time constant expression.
1339 */ 1343 */
1340 class ValidResult extends EvaluationResultImpl { 1344 class ValidResult extends EvaluationResultImpl {
1341 /** 1345 /**
1342 * The value of the expression. 1346 * The value of the expression.
1343 */ 1347 */
1344 final DartObjectImpl value; 1348 DartObjectImpl value;
1345 1349
1346 /** 1350 /**
1347 * Initialize a newly created result to represent the given value. 1351 * Initialize a newly created result to represent the given value.
1348 * 1352 *
1349 * @param value the value of the expression 1353 * @param value the value of the expression
1350 */ 1354 */
1351 ValidResult(this.value); 1355 ValidResult(DartObjectImpl value) {
1356 this.value = value;
1357 }
1352 1358
1353 @override 1359 @override
1354 EvaluationResultImpl add(TypeProvider typeProvider, BinaryExpression node, Eva luationResultImpl rightOperand) => rightOperand.addToValid(typeProvider, node, t his); 1360 EvaluationResultImpl add(TypeProvider typeProvider, BinaryExpression node, Eva luationResultImpl rightOperand) => rightOperand.addToValid(typeProvider, node, t his);
1355 1361
1356 /** 1362 /**
1357 * Return the result of applying boolean conversion to this result. 1363 * Return the result of applying boolean conversion to this result.
1358 * 1364 *
1359 * @param node the node against which errors should be reported 1365 * @param node the node against which errors should be reported
1360 * @return the result of applying boolean conversion to the given value 1366 * @return the result of applying boolean conversion to the given value
1361 */ 1367 */
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 } 1785 }
1780 1786
1781 /** 1787 /**
1782 * Instances of the class `BoolState` represent the state of an object represent ing a boolean 1788 * Instances of the class `BoolState` represent the state of an object represent ing a boolean
1783 * value. 1789 * value.
1784 */ 1790 */
1785 class BoolState extends InstanceState { 1791 class BoolState extends InstanceState {
1786 /** 1792 /**
1787 * The value of this instance. 1793 * The value of this instance.
1788 */ 1794 */
1789 final bool value; 1795 bool value = false;
1790 1796
1791 /** 1797 /**
1792 * An instance representing the boolean value 'false'. 1798 * An instance representing the boolean value 'false'.
1793 */ 1799 */
1794 static BoolState FALSE_STATE = new BoolState(false); 1800 static BoolState FALSE_STATE = new BoolState(false);
1795 1801
1796 /** 1802 /**
1797 * An instance representing the boolean value 'true'. 1803 * An instance representing the boolean value 'true'.
1798 */ 1804 */
1799 static BoolState TRUE_STATE = new BoolState(true); 1805 static BoolState TRUE_STATE = new BoolState(true);
1800 1806
1801 /** 1807 /**
1802 * A state that can be used to represent a boolean whose value is not known. 1808 * A state that can be used to represent a boolean whose value is not known.
1803 */ 1809 */
1804 static BoolState UNKNOWN_VALUE = new BoolState(null); 1810 static BoolState UNKNOWN_VALUE = new BoolState(null);
1805 1811
1806 /** 1812 /**
1807 * Return the boolean state representing the given boolean value. 1813 * Return the boolean state representing the given boolean value.
1808 * 1814 *
1809 * @param value the value to be represented 1815 * @param value the value to be represented
1810 * @return the boolean state representing the given boolean value 1816 * @return the boolean state representing the given boolean value
1811 */ 1817 */
1812 static BoolState from(bool value) => value ? BoolState.TRUE_STATE : BoolState. FALSE_STATE; 1818 static BoolState from(bool value) => value ? BoolState.TRUE_STATE : BoolState. FALSE_STATE;
1813 1819
1814 /** 1820 /**
1815 * Initialize a newly created state to represent the given value. 1821 * Initialize a newly created state to represent the given value.
1816 * 1822 *
1817 * @param value the value of this instance 1823 * @param value the value of this instance
1818 */ 1824 */
1819 BoolState(this.value); 1825 BoolState(bool value) {
1826 this.value = value;
1827 }
1820 1828
1821 @override 1829 @override
1822 BoolState convertToBool() => this; 1830 BoolState convertToBool() => this;
1823 1831
1824 @override 1832 @override
1825 StringState convertToString() { 1833 StringState convertToString() {
1826 if (value == null) { 1834 if (value == null) {
1827 return StringState.UNKNOWN_VALUE; 1835 return StringState.UNKNOWN_VALUE;
1828 } 1836 }
1829 return new StringState(value ? "true" : "false"); 1837 return new StringState(value ? "true" : "false");
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 String toString() => value == null ? "-unknown-" : (value ? "true" : "false"); 1908 String toString() => value == null ? "-unknown-" : (value ? "true" : "false");
1901 } 1909 }
1902 1910
1903 /** 1911 /**
1904 * Instances of the class `DartObjectImpl` represent an instance of a Dart class . 1912 * Instances of the class `DartObjectImpl` represent an instance of a Dart class .
1905 */ 1913 */
1906 class DartObjectImpl implements DartObject { 1914 class DartObjectImpl implements DartObject {
1907 /** 1915 /**
1908 * The run-time type of this object. 1916 * The run-time type of this object.
1909 */ 1917 */
1910 final InterfaceType type; 1918 InterfaceType type;
1911 1919
1912 /** 1920 /**
1913 * The state of the object. 1921 * The state of the object.
1914 */ 1922 */
1915 InstanceState _state; 1923 InstanceState _state;
1916 1924
1917 /** 1925 /**
1918 * Initialize a newly created object to have the given type and state. 1926 * Initialize a newly created object to have the given type and state.
1919 * 1927 *
1920 * @param type the run-time type of this object 1928 * @param type the run-time type of this object
1921 * @param state the state of the object 1929 * @param state the state of the object
1922 */ 1930 */
1923 DartObjectImpl(this.type, InstanceState state) { 1931 DartObjectImpl(InterfaceType type, InstanceState state) {
1932 this.type = type;
1924 this._state = state; 1933 this._state = state;
1925 } 1934 }
1926 1935
1927 /** 1936 /**
1928 * Return the result of invoking the '+' operator on this object with the give n argument. 1937 * Return the result of invoking the '+' operator on this object with the give n argument.
1929 * 1938 *
1930 * @param typeProvider the type provider used to find known types 1939 * @param typeProvider the type provider used to find known types
1931 * @param rightOperand the right-hand operand of the operation 1940 * @param rightOperand the right-hand operand of the operation
1932 * @return the result of invoking the '+' operator on this object with the giv en argument 1941 * @return the result of invoking the '+' operator on this object with the giv en argument
1933 * @throws EvaluationException if the operator is not appropriate for an objec t of this kind 1942 * @throws EvaluationException if the operator is not appropriate for an objec t of this kind
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
2349 } 2358 }
2350 2359
2351 /** 2360 /**
2352 * Instances of the class `DoubleState` represent the state of an object represe nting a 2361 * Instances of the class `DoubleState` represent the state of an object represe nting a
2353 * double. 2362 * double.
2354 */ 2363 */
2355 class DoubleState extends NumState { 2364 class DoubleState extends NumState {
2356 /** 2365 /**
2357 * The value of this instance. 2366 * The value of this instance.
2358 */ 2367 */
2359 final double value; 2368 double value = 0.0;
2360 2369
2361 /** 2370 /**
2362 * A state that can be used to represent a double whose value is not known. 2371 * A state that can be used to represent a double whose value is not known.
2363 */ 2372 */
2364 static DoubleState UNKNOWN_VALUE = new DoubleState(null); 2373 static DoubleState UNKNOWN_VALUE = new DoubleState(null);
2365 2374
2366 /** 2375 /**
2367 * Initialize a newly created state to represent a double with the given value . 2376 * Initialize a newly created state to represent a double with the given value .
2368 * 2377 *
2369 * @param value the value of this instance 2378 * @param value the value of this instance
2370 */ 2379 */
2371 DoubleState(this.value); 2380 DoubleState(double value) {
2381 this.value = value;
2382 }
2372 2383
2373 @override 2384 @override
2374 NumState add(InstanceState rightOperand) { 2385 NumState add(InstanceState rightOperand) {
2375 assertNumOrNull(rightOperand); 2386 assertNumOrNull(rightOperand);
2376 if (value == null) { 2387 if (value == null) {
2377 return UNKNOWN_VALUE; 2388 return UNKNOWN_VALUE;
2378 } 2389 }
2379 if (rightOperand is IntState) { 2390 if (rightOperand is IntState) {
2380 int rightValue = rightOperand.value; 2391 int rightValue = rightOperand.value;
2381 if (rightValue == null) { 2392 if (rightValue == null) {
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
2837 } 2848 }
2838 2849
2839 /** 2850 /**
2840 * Instances of the class `EvaluationException` represent a run-time exception t hat would be 2851 * Instances of the class `EvaluationException` represent a run-time exception t hat would be
2841 * thrown during the evaluation of Dart code. 2852 * thrown during the evaluation of Dart code.
2842 */ 2853 */
2843 class EvaluationException extends JavaException { 2854 class EvaluationException extends JavaException {
2844 /** 2855 /**
2845 * The error code associated with the exception. 2856 * The error code associated with the exception.
2846 */ 2857 */
2847 final ErrorCode errorCode; 2858 ErrorCode errorCode;
2848 2859
2849 /** 2860 /**
2850 * Initialize a newly created exception to have the given error code. 2861 * Initialize a newly created exception to have the given error code.
2851 * 2862 *
2852 * @param errorCode the error code associated with the exception 2863 * @param errorCode the error code associated with the exception
2853 */ 2864 */
2854 EvaluationException(this.errorCode); 2865 EvaluationException(ErrorCode errorCode) {
2866 this.errorCode = errorCode;
2867 }
2855 } 2868 }
2856 2869
2857 /** 2870 /**
2858 * Instances of the class `FunctionState` represent the state of an object repre senting a 2871 * Instances of the class `FunctionState` represent the state of an object repre senting a
2859 * function. 2872 * function.
2860 */ 2873 */
2861 class FunctionState extends InstanceState { 2874 class FunctionState extends InstanceState {
2862 /** 2875 /**
2863 * The element representing the function being modeled. 2876 * The element representing the function being modeled.
2864 */ 2877 */
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
3380 } 3393 }
3381 } 3394 }
3382 3395
3383 /** 3396 /**
3384 * Instances of the class `IntState` represent the state of an object representi ng an int. 3397 * Instances of the class `IntState` represent the state of an object representi ng an int.
3385 */ 3398 */
3386 class IntState extends NumState { 3399 class IntState extends NumState {
3387 /** 3400 /**
3388 * The value of this instance. 3401 * The value of this instance.
3389 */ 3402 */
3390 final int value; 3403 int value = 0;
3391 3404
3392 /** 3405 /**
3393 * A state that can be used to represent an int whose value is not known. 3406 * A state that can be used to represent an int whose value is not known.
3394 */ 3407 */
3395 static IntState UNKNOWN_VALUE = new IntState(null); 3408 static IntState UNKNOWN_VALUE = new IntState(null);
3396 3409
3397 /** 3410 /**
3398 * Initialize a newly created state to represent an int with the given value. 3411 * Initialize a newly created state to represent an int with the given value.
3399 * 3412 *
3400 * @param value the value of this instance 3413 * @param value the value of this instance
3401 */ 3414 */
3402 IntState(this.value); 3415 IntState(int value) {
3416 this.value = value;
3417 }
3403 3418
3404 @override 3419 @override
3405 NumState add(InstanceState rightOperand) { 3420 NumState add(InstanceState rightOperand) {
3406 assertNumOrNull(rightOperand); 3421 assertNumOrNull(rightOperand);
3407 if (value == null) { 3422 if (value == null) {
3408 if (rightOperand is DoubleState) { 3423 if (rightOperand is DoubleState) {
3409 return DoubleState.UNKNOWN_VALUE; 3424 return DoubleState.UNKNOWN_VALUE;
3410 } 3425 }
3411 return UNKNOWN_VALUE; 3426 return UNKNOWN_VALUE;
3412 } 3427 }
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
4164 } 4179 }
4165 4180
4166 /** 4181 /**
4167 * Instances of the class `StringState` represent the state of an object represe nting a 4182 * Instances of the class `StringState` represent the state of an object represe nting a
4168 * string. 4183 * string.
4169 */ 4184 */
4170 class StringState extends InstanceState { 4185 class StringState extends InstanceState {
4171 /** 4186 /**
4172 * The value of this instance. 4187 * The value of this instance.
4173 */ 4188 */
4174 final String value; 4189 String value;
4175 4190
4176 /** 4191 /**
4177 * A state that can be used to represent a double whose value is not known. 4192 * A state that can be used to represent a double whose value is not known.
4178 */ 4193 */
4179 static StringState UNKNOWN_VALUE = new StringState(null); 4194 static StringState UNKNOWN_VALUE = new StringState(null);
4180 4195
4181 /** 4196 /**
4182 * Initialize a newly created state to represent the given value. 4197 * Initialize a newly created state to represent the given value.
4183 * 4198 *
4184 * @param value the value of this instance 4199 * @param value the value of this instance
4185 */ 4200 */
4186 StringState(this.value); 4201 StringState(String value) {
4202 this.value = value;
4203 }
4187 4204
4188 @override 4205 @override
4189 StringState concatenate(InstanceState rightOperand) { 4206 StringState concatenate(InstanceState rightOperand) {
4190 if (value == null) { 4207 if (value == null) {
4191 return UNKNOWN_VALUE; 4208 return UNKNOWN_VALUE;
4192 } 4209 }
4193 if (rightOperand is StringState) { 4210 if (rightOperand is StringState) {
4194 String rightValue = rightOperand.value; 4211 String rightValue = rightOperand.value;
4195 if (rightValue == null) { 4212 if (rightValue == null) {
4196 return UNKNOWN_VALUE; 4213 return UNKNOWN_VALUE;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
4243 } 4260 }
4244 4261
4245 /** 4262 /**
4246 * Instances of the class `StringState` represent the state of an object represe nting a 4263 * Instances of the class `StringState` represent the state of an object represe nting a
4247 * symbol. 4264 * symbol.
4248 */ 4265 */
4249 class SymbolState extends InstanceState { 4266 class SymbolState extends InstanceState {
4250 /** 4267 /**
4251 * The value of this instance. 4268 * The value of this instance.
4252 */ 4269 */
4253 final String value; 4270 String value;
4254 4271
4255 /** 4272 /**
4256 * Initialize a newly created state to represent the given value. 4273 * Initialize a newly created state to represent the given value.
4257 * 4274 *
4258 * @param value the value of this instance 4275 * @param value the value of this instance
4259 */ 4276 */
4260 SymbolState(this.value); 4277 SymbolState(String value) {
4278 this.value = value;
4279 }
4261 4280
4262 @override 4281 @override
4263 StringState convertToString() { 4282 StringState convertToString() {
4264 if (value == null) { 4283 if (value == null) {
4265 return StringState.UNKNOWN_VALUE; 4284 return StringState.UNKNOWN_VALUE;
4266 } 4285 }
4267 return new StringState(value); 4286 return new StringState(value);
4268 } 4287 }
4269 4288
4270 @override 4289 @override
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
4350 4369
4351 @override 4370 @override
4352 String get typeName => "Type"; 4371 String get typeName => "Type";
4353 4372
4354 @override 4373 @override
4355 int get hashCode => _element == null ? 0 : _element.hashCode; 4374 int get hashCode => _element == null ? 0 : _element.hashCode;
4356 4375
4357 @override 4376 @override
4358 String toString() => _element == null ? "-unknown-" : _element.name; 4377 String toString() => _element == null ? "-unknown-" : _element.name;
4359 } 4378 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/ast.dart ('k') | pkg/analyzer/lib/src/generated/element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698