OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library dart2js.common.resolution; | 5 library dart2js.common.resolution; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
9 import '../constants/expressions.dart' show ConstantExpression; | 9 import '../constants/expressions.dart' show ConstantExpression; |
10 import '../core_types.dart' show CoreTypes; | 10 import '../core_types.dart' show CoreTypes; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 return type == other.type && | 175 return type == other.type && |
176 isConstant == other.isConstant && | 176 isConstant == other.isConstant && |
177 isEmpty == other.isEmpty; | 177 isEmpty == other.isEmpty; |
178 } | 178 } |
179 | 179 |
180 String toString() { | 180 String toString() { |
181 return 'ListLiteralUse($type,isConstant:$isConstant,isEmpty:$isEmpty)'; | 181 return 'ListLiteralUse($type,isConstant:$isConstant,isEmpty:$isEmpty)'; |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
| 185 /// Interface for the accessing the front-end analysis. |
| 186 // TODO(johnniwinther): Find a better name for this. |
| 187 abstract class Frontend { |
| 188 /// Returns the `ResolvedAst` for the [element]. |
| 189 ResolvedAst getResolvedAst(Element element); |
| 190 |
| 191 /// Returns the [ResolutionImpact] for [element]. |
| 192 ResolutionImpact getResolutionImpact(Element element); |
| 193 } |
| 194 |
185 // TODO(johnniwinther): Rename to `Resolver` or `ResolverContext`. | 195 // TODO(johnniwinther): Rename to `Resolver` or `ResolverContext`. |
186 abstract class Resolution { | 196 abstract class Resolution implements Frontend { |
187 Parsing get parsing; | 197 Parsing get parsing; |
188 DiagnosticReporter get reporter; | 198 DiagnosticReporter get reporter; |
189 CoreTypes get coreTypes; | 199 CoreTypes get coreTypes; |
190 | 200 |
191 /// If set to `true` resolution caches will not be cleared. Use this only for | 201 /// If set to `true` resolution caches will not be cleared. Use this only for |
192 /// testing. | 202 /// testing. |
193 bool retainCachesForTesting; | 203 bool retainCachesForTesting; |
194 | 204 |
195 void resolveTypedef(TypedefElement typdef); | 205 void resolveTypedef(TypedefElement typdef); |
196 void resolveClass(ClassElement cls); | 206 void resolveClass(ClassElement cls); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 243 } |
234 | 244 |
235 // TODO(johnniwinther): Rename to `Parser` or `ParsingContext`. | 245 // TODO(johnniwinther): Rename to `Parser` or `ParsingContext`. |
236 abstract class Parsing { | 246 abstract class Parsing { |
237 DiagnosticReporter get reporter; | 247 DiagnosticReporter get reporter; |
238 void parsePatchClass(ClassElement cls); | 248 void parsePatchClass(ClassElement cls); |
239 measure(f()); | 249 measure(f()); |
240 ScannerOptions getScannerOptionsFor(Element element); | 250 ScannerOptions getScannerOptionsFor(Element element); |
241 ParserOptions get parserOptions; | 251 ParserOptions get parserOptions; |
242 } | 252 } |
OLD | NEW |