OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 /// API to get results from a static analysis of the source program. |
| 6 // TODO(sigmund): split out implementations out of this file. |
| 7 library compiler.src.stats.naive_analysis_result; |
| 8 |
| 9 import 'analysis_result.dart'; |
| 10 import '../tree/tree.dart' show Node; |
| 11 import '../universe/selector.dart' show Selector; |
| 12 |
| 13 /// A naive [AnalysisResult] that tells us very little. This is the most |
| 14 /// conservative we can be when we only use information from the AST structure |
| 15 /// and from resolution, but no type information. |
| 16 class NaiveAnalysisResult implements AnalysisResult { |
| 17 NaiveAnalysisResult(); |
| 18 |
| 19 ReceiverInfo infoForReceiver(Node receiver) => |
| 20 new NaiveReceiverInfo(receiver); |
| 21 SelectorInfo infoForSelector(Node receiver, Selector selector) => |
| 22 new NaiveSelectorInfo(receiver, selector); |
| 23 } |
| 24 |
| 25 class NaiveReceiverInfo implements ReceiverInfo { |
| 26 final Node receiver; |
| 27 |
| 28 NaiveReceiverInfo(this.receiver); |
| 29 Boolish get hasNoSuchMethod => Boolish.maybe; |
| 30 Boolish get isNull => Boolish.maybe; |
| 31 int get possibleNsmTargets => -1; |
| 32 } |
| 33 |
| 34 class NaiveSelectorInfo implements SelectorInfo { |
| 35 final Node receiver; |
| 36 final Selector selector; |
| 37 |
| 38 NaiveSelectorInfo(this.receiver, this.selector); |
| 39 |
| 40 Boolish get exists => Boolish.maybe; |
| 41 Boolish get usesInterceptor => Boolish.maybe; |
| 42 int get possibleTargets => -1; |
| 43 bool get isAccurate => false; |
| 44 } |
OLD | NEW |