OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 fasta.analyzer_loader; | 5 library fasta.analyzer_loader; |
6 | 6 |
7 import 'package:front_end/physical_file_system.dart'; | 7 import 'package:front_end/physical_file_system.dart'; |
8 import 'package:kernel/ast.dart' show Program; | 8 import 'package:kernel/ast.dart' show Program; |
9 | 9 |
10 import 'package:front_end/src/fasta/builder/builder.dart' show LibraryBuilder; | 10 import 'package:front_end/src/fasta/builder/builder.dart' show LibraryBuilder; |
11 | 11 |
12 import 'package:front_end/src/fasta/target_implementation.dart' | 12 import 'package:front_end/src/fasta/target_implementation.dart' |
13 show TargetImplementation; | 13 show TargetImplementation; |
14 | 14 |
15 import 'package:front_end/src/fasta/source/source_class_builder.dart' | 15 import 'package:front_end/src/fasta/source/source_class_builder.dart' |
16 show SourceClassBuilder; | 16 show SourceClassBuilder; |
17 | 17 |
18 import 'package:front_end/src/fasta/source/source_loader.dart' | 18 import 'package:front_end/src/fasta/source/source_loader.dart' |
19 show SourceLoader; | 19 show SourceLoader; |
20 | 20 |
21 import 'analyzer_diet_listener.dart' show AnalyzerDietListener; | 21 import 'analyzer_diet_listener.dart' show AnalyzerDietListener; |
22 | 22 |
23 import 'package:kernel/core_types.dart' show CoreTypes; | 23 import 'package:kernel/core_types.dart' show CoreTypes; |
24 import 'package:kernel/src/incremental_class_hierarchy.dart'; | 24 import 'package:kernel/src/incremental_class_hierarchy.dart'; |
25 | 25 |
26 class AnalyzerLoader<L> extends SourceLoader<L> { | 26 class AnalyzerLoader<L> extends SourceLoader<L> { |
27 AnalyzerLoader(TargetImplementation target) | 27 AnalyzerLoader(TargetImplementation target) |
28 : super(PhysicalFileSystem.instance, target); | 28 : super(PhysicalFileSystem.instance, false, target); |
29 | 29 |
30 @override | 30 @override |
31 void computeHierarchy(Program program) { | 31 void computeHierarchy(Program program) { |
32 ticker.logMs("Built analyzer element model."); | 32 ticker.logMs("Built analyzer element model."); |
33 hierarchy = new IncrementalClassHierarchy(); | 33 hierarchy = new IncrementalClassHierarchy(); |
34 ticker.logMs("Computed class hierarchy"); | 34 ticker.logMs("Computed class hierarchy"); |
35 coreTypes = new CoreTypes(program); | 35 coreTypes = new CoreTypes(program); |
36 ticker.logMs("Computed core types"); | 36 ticker.logMs("Computed core types"); |
37 } | 37 } |
38 | 38 |
39 @override | 39 @override |
40 AnalyzerDietListener createDietListener(LibraryBuilder library) { | 40 AnalyzerDietListener createDietListener(LibraryBuilder library) { |
41 return new AnalyzerDietListener( | 41 return new AnalyzerDietListener( |
42 library, hierarchy, coreTypes, typeInferenceEngine); | 42 library, hierarchy, coreTypes, typeInferenceEngine); |
43 } | 43 } |
44 | 44 |
45 @override | 45 @override |
46 void checkOverrides(List<SourceClassBuilder> sourceClasses) { | 46 void checkOverrides(List<SourceClassBuilder> sourceClasses) { |
47 // Not implemented yet. Requires [hierarchy]. | 47 // Not implemented yet. Requires [hierarchy]. |
48 } | 48 } |
49 } | 49 } |
OLD | NEW |