| 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 dart2js.frontend_strategy; | 5 library dart2js.frontend_strategy; |
| 6 | 6 |
| 7 import 'common.dart'; | 7 import 'common.dart'; |
| 8 import 'common_elements.dart'; | 8 import 'common_elements.dart'; |
| 9 import 'common/tasks.dart'; | 9 import 'common/tasks.dart'; |
| 10 import 'elements/entities.dart'; | 10 import 'elements/entities.dart'; |
| 11 import 'environment.dart'; | 11 import 'environment.dart'; |
| 12 import 'js_backend/native_data.dart'; | 12 import 'js_backend/native_data.dart'; |
| 13 import 'library_loader.dart'; | 13 import 'library_loader.dart'; |
| 14 import 'native/resolver.dart'; |
| 14 import 'serialization/task.dart'; | 15 import 'serialization/task.dart'; |
| 15 import 'patch_parser.dart'; | 16 import 'patch_parser.dart'; |
| 16 import 'resolved_uri_translator.dart'; | 17 import 'resolved_uri_translator.dart'; |
| 17 | 18 |
| 18 /// Strategy pattern that defines the connection between the input format and | 19 /// Strategy pattern that defines the connection between the input format and |
| 19 /// the resolved element model. | 20 /// the resolved element model. |
| 20 abstract class FrontEndStrategy { | 21 abstract class FrontEndStrategy { |
| 21 /// Creates library loader task for this strategy. | 22 /// Creates library loader task for this strategy. |
| 22 LibraryLoaderTask createLibraryLoader( | 23 LibraryLoaderTask createLibraryLoader( |
| 23 ResolvedUriTranslator uriTranslator, | 24 ResolvedUriTranslator uriTranslator, |
| 24 ScriptLoader scriptLoader, | 25 ScriptLoader scriptLoader, |
| 25 ElementScanner scriptScanner, | 26 ElementScanner scriptScanner, |
| 26 LibraryDeserializer deserializer, | 27 LibraryDeserializer deserializer, |
| 27 PatchResolverFunction patchResolverFunc, | 28 PatchResolverFunction patchResolverFunc, |
| 28 PatchParserTask patchParser, | 29 PatchParserTask patchParser, |
| 29 Environment environment, | 30 Environment environment, |
| 30 DiagnosticReporter reporter, | 31 DiagnosticReporter reporter, |
| 31 Measurer measurer); | 32 Measurer measurer); |
| 32 | 33 |
| 33 /// Returns the [ElementEnvironment] for the element model used in this | 34 /// Returns the [ElementEnvironment] for the element model used in this |
| 34 /// strategy. | 35 /// strategy. |
| 35 ElementEnvironment get elementEnvironment; | 36 ElementEnvironment get elementEnvironment; |
| 36 | 37 |
| 37 /// Returns the [AnnotationProcessor] for this strategy. | 38 /// Returns the [AnnotationProcessor] for this strategy. |
| 38 AnnotationProcessor get annotationProcesser; | 39 AnnotationProcessor get annotationProcesser; |
| 40 |
| 41 /// Creates the [NativeClassFinder] for this strategy. |
| 42 NativeClassFinder createNativeClassResolver(NativeBasicData nativeBasicData); |
| 39 } | 43 } |
| 40 | 44 |
| 41 /// Class that performs the mechanics to investigate annotations in the code. | 45 /// Class that performs the mechanics to investigate annotations in the code. |
| 42 abstract class AnnotationProcessor { | 46 abstract class AnnotationProcessor { |
| 43 void extractNativeAnnotations( | 47 void extractNativeAnnotations( |
| 44 LibraryEntity library, NativeBasicDataBuilder nativeBasicDataBuilder); | 48 LibraryEntity library, NativeBasicDataBuilder nativeBasicDataBuilder); |
| 45 | 49 |
| 46 void extractJsInteropAnnotations( | 50 void extractJsInteropAnnotations( |
| 47 LibraryEntity library, NativeBasicDataBuilder nativeBasicDataBuilder); | 51 LibraryEntity library, NativeBasicDataBuilder nativeBasicDataBuilder); |
| 48 } | 52 } |
| OLD | NEW |