001    /*
002     * Copyright 2010-2014 JetBrains s.r.o.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    package org.jetbrains.jet.di;
018    
019    import com.intellij.openapi.project.Project;
020    import org.jetbrains.jet.context.GlobalContext;
021    import org.jetbrains.jet.storage.StorageManager;
022    import org.jetbrains.jet.lang.resolve.BindingTrace;
023    import org.jetbrains.jet.lang.descriptors.ModuleDescriptor;
024    import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
025    import org.jetbrains.jet.lang.PlatformToKotlinClassMap;
026    import org.jetbrains.jet.lang.resolve.TopDownAnalyzer;
027    import org.jetbrains.jet.lang.resolve.MutablePackageFragmentProvider;
028    import org.jetbrains.jet.lang.resolve.AdditionalCheckerProvider;
029    import org.jetbrains.jet.lang.types.DynamicTypesSettings;
030    import org.jetbrains.jet.lang.resolve.BodyResolver;
031    import org.jetbrains.jet.lang.resolve.AnnotationResolver;
032    import org.jetbrains.jet.lang.resolve.calls.CallResolver;
033    import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver;
034    import org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices;
035    import org.jetbrains.jet.lang.types.expressions.ExpressionTypingComponents;
036    import org.jetbrains.jet.lang.types.expressions.ControlStructureTypingUtils;
037    import org.jetbrains.jet.lang.types.expressions.ExpressionTypingUtils;
038    import org.jetbrains.jet.lang.types.expressions.ForLoopConventionsChecker;
039    import org.jetbrains.jet.lang.reflect.ReflectionTypes;
040    import org.jetbrains.jet.lang.resolve.calls.CallExpressionResolver;
041    import org.jetbrains.jet.lang.resolve.DescriptorResolver;
042    import org.jetbrains.jet.lang.resolve.DelegatedPropertyResolver;
043    import org.jetbrains.jet.lang.resolve.TypeResolver;
044    import org.jetbrains.jet.lang.resolve.QualifiedExpressionResolver;
045    import org.jetbrains.jet.lang.resolve.TypeResolver.FlexibleTypeCapabilitiesProvider;
046    import org.jetbrains.jet.context.LazinessToken;
047    import org.jetbrains.jet.lang.resolve.calls.CallResolverExtensionProvider;
048    import org.jetbrains.jet.lang.resolve.PartialBodyResolveProvider;
049    import org.jetbrains.jet.lang.resolve.calls.CallCompleter;
050    import org.jetbrains.jet.lang.resolve.calls.CandidateResolver;
051    import org.jetbrains.jet.lang.resolve.calls.tasks.TaskPrioritizer;
052    import org.jetbrains.jet.lang.resolve.ControlFlowAnalyzer;
053    import org.jetbrains.jet.lang.resolve.DeclarationsChecker;
054    import org.jetbrains.jet.lang.resolve.ModifiersChecker;
055    import org.jetbrains.jet.lang.resolve.FunctionAnalyzerExtension;
056    import org.jetbrains.jet.lang.resolve.ScriptBodyResolver;
057    import org.jetbrains.jet.lang.resolve.DeclarationResolver;
058    import org.jetbrains.jet.lang.resolve.ImportsResolver;
059    import org.jetbrains.jet.lang.psi.JetImportsFactory;
060    import org.jetbrains.jet.lang.resolve.OverloadResolver;
061    import org.jetbrains.jet.lang.resolve.OverrideResolver;
062    import org.jetbrains.jet.lang.resolve.TypeHierarchyResolver;
063    import org.jetbrains.jet.lang.resolve.ScriptHeaderResolver;
064    import org.jetbrains.jet.lang.resolve.varianceChecker.VarianceChecker;
065    import org.jetbrains.annotations.NotNull;
066    import javax.annotation.PreDestroy;
067    
068    /* This file is generated by org.jetbrains.jet.generators.injectors.InjectorsPackage. DO NOT EDIT! */
069    @SuppressWarnings("all")
070    public class InjectorForTopDownAnalyzerBasic {
071    
072        private final Project project;
073        private final GlobalContext globalContext;
074        private final StorageManager storageManager;
075        private final BindingTrace bindingTrace;
076        private final ModuleDescriptor moduleDescriptor;
077        private final KotlinBuiltIns kotlinBuiltIns;
078        private final PlatformToKotlinClassMap platformToKotlinClassMap;
079        private final TopDownAnalyzer topDownAnalyzer;
080        private final MutablePackageFragmentProvider mutablePackageFragmentProvider;
081        private final AdditionalCheckerProvider additionalCheckerProvider;
082        private final DynamicTypesSettings dynamicTypesSettings;
083        private final BodyResolver bodyResolver;
084        private final AnnotationResolver annotationResolver;
085        private final CallResolver callResolver;
086        private final ArgumentTypeResolver argumentTypeResolver;
087        private final ExpressionTypingServices expressionTypingServices;
088        private final ExpressionTypingComponents expressionTypingComponents;
089        private final ControlStructureTypingUtils controlStructureTypingUtils;
090        private final ExpressionTypingUtils expressionTypingUtils;
091        private final ForLoopConventionsChecker forLoopConventionsChecker;
092        private final ReflectionTypes reflectionTypes;
093        private final CallExpressionResolver callExpressionResolver;
094        private final DescriptorResolver descriptorResolver;
095        private final DelegatedPropertyResolver delegatedPropertyResolver;
096        private final TypeResolver typeResolver;
097        private final QualifiedExpressionResolver qualifiedExpressionResolver;
098        private final FlexibleTypeCapabilitiesProvider flexibleTypeCapabilitiesProvider;
099        private final LazinessToken lazinessToken;
100        private final CallResolverExtensionProvider callResolverExtensionProvider;
101        private final PartialBodyResolveProvider partialBodyResolveProvider;
102        private final CallCompleter callCompleter;
103        private final CandidateResolver candidateResolver;
104        private final TaskPrioritizer taskPrioritizer;
105        private final ControlFlowAnalyzer controlFlowAnalyzer;
106        private final DeclarationsChecker declarationsChecker;
107        private final ModifiersChecker modifiersChecker;
108        private final FunctionAnalyzerExtension functionAnalyzerExtension;
109        private final ScriptBodyResolver scriptBodyResolver;
110        private final DeclarationResolver declarationResolver;
111        private final ImportsResolver importsResolver;
112        private final JetImportsFactory jetImportsFactory;
113        private final OverloadResolver overloadResolver;
114        private final OverrideResolver overrideResolver;
115        private final TypeHierarchyResolver typeHierarchyResolver;
116        private final ScriptHeaderResolver scriptHeaderResolver;
117        private final VarianceChecker varianceChecker;
118    
119        public InjectorForTopDownAnalyzerBasic(
120            @NotNull Project project,
121            @NotNull GlobalContext globalContext,
122            @NotNull BindingTrace bindingTrace,
123            @NotNull ModuleDescriptor moduleDescriptor,
124            @NotNull AdditionalCheckerProvider additionalCheckerProvider,
125            @NotNull DynamicTypesSettings dynamicTypesSettings
126        ) {
127            this.project = project;
128            this.globalContext = globalContext;
129            this.storageManager = globalContext.getStorageManager();
130            this.bindingTrace = bindingTrace;
131            this.moduleDescriptor = moduleDescriptor;
132            this.kotlinBuiltIns = moduleDescriptor.getBuiltIns();
133            this.platformToKotlinClassMap = moduleDescriptor.getPlatformToKotlinClassMap();
134            this.topDownAnalyzer = new TopDownAnalyzer();
135            this.mutablePackageFragmentProvider = new MutablePackageFragmentProvider(getModuleDescriptor());
136            this.additionalCheckerProvider = additionalCheckerProvider;
137            this.dynamicTypesSettings = dynamicTypesSettings;
138            this.bodyResolver = new BodyResolver();
139            this.annotationResolver = new AnnotationResolver();
140            this.callResolver = new CallResolver();
141            this.argumentTypeResolver = new ArgumentTypeResolver();
142            this.expressionTypingComponents = new ExpressionTypingComponents();
143            this.expressionTypingServices = new ExpressionTypingServices(expressionTypingComponents);
144            this.controlStructureTypingUtils = new ControlStructureTypingUtils(expressionTypingServices);
145            this.expressionTypingUtils = new ExpressionTypingUtils(expressionTypingServices, callResolver, kotlinBuiltIns);
146            this.forLoopConventionsChecker = new ForLoopConventionsChecker();
147            this.reflectionTypes = new ReflectionTypes(getModuleDescriptor());
148            this.callExpressionResolver = new CallExpressionResolver();
149            this.descriptorResolver = new DescriptorResolver();
150            this.delegatedPropertyResolver = new DelegatedPropertyResolver();
151            this.qualifiedExpressionResolver = new QualifiedExpressionResolver();
152            this.flexibleTypeCapabilitiesProvider = new FlexibleTypeCapabilitiesProvider();
153            this.lazinessToken = new LazinessToken();
154            this.typeResolver = new TypeResolver(annotationResolver, qualifiedExpressionResolver, getModuleDescriptor(), flexibleTypeCapabilitiesProvider, storageManager, lazinessToken, dynamicTypesSettings);
155            this.callResolverExtensionProvider = new CallResolverExtensionProvider();
156            this.partialBodyResolveProvider = new PartialBodyResolveProvider();
157            this.candidateResolver = new CandidateResolver();
158            this.callCompleter = new CallCompleter(argumentTypeResolver, candidateResolver);
159            this.taskPrioritizer = new TaskPrioritizer(storageManager);
160            this.controlFlowAnalyzer = new ControlFlowAnalyzer();
161            this.declarationsChecker = new DeclarationsChecker();
162            this.modifiersChecker = new ModifiersChecker(bindingTrace, additionalCheckerProvider);
163            this.functionAnalyzerExtension = new FunctionAnalyzerExtension();
164            this.scriptBodyResolver = new ScriptBodyResolver();
165            this.declarationResolver = new DeclarationResolver();
166            this.importsResolver = new ImportsResolver();
167            this.jetImportsFactory = new JetImportsFactory();
168            this.overloadResolver = new OverloadResolver();
169            this.overrideResolver = new OverrideResolver();
170            this.typeHierarchyResolver = new TypeHierarchyResolver();
171            this.scriptHeaderResolver = new ScriptHeaderResolver();
172            this.varianceChecker = new VarianceChecker(bindingTrace);
173    
174            this.topDownAnalyzer.setBodyResolver(bodyResolver);
175            this.topDownAnalyzer.setDeclarationResolver(declarationResolver);
176            this.topDownAnalyzer.setModuleDescriptor(moduleDescriptor);
177            this.topDownAnalyzer.setOverloadResolver(overloadResolver);
178            this.topDownAnalyzer.setOverrideResolver(overrideResolver);
179            this.topDownAnalyzer.setPackageFragmentProvider(mutablePackageFragmentProvider);
180            this.topDownAnalyzer.setTypeHierarchyResolver(typeHierarchyResolver);
181            this.topDownAnalyzer.setVarianceChecker(varianceChecker);
182    
183            bodyResolver.setAnnotationResolver(annotationResolver);
184            bodyResolver.setCallResolver(callResolver);
185            bodyResolver.setControlFlowAnalyzer(controlFlowAnalyzer);
186            bodyResolver.setDeclarationsChecker(declarationsChecker);
187            bodyResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
188            bodyResolver.setExpressionTypingServices(expressionTypingServices);
189            bodyResolver.setFunctionAnalyzerExtension(functionAnalyzerExtension);
190            bodyResolver.setScriptBodyResolverResolver(scriptBodyResolver);
191            bodyResolver.setTrace(bindingTrace);
192    
193            annotationResolver.setCallResolver(callResolver);
194            annotationResolver.setStorageManager(storageManager);
195            annotationResolver.setTypeResolver(typeResolver);
196    
197            callResolver.setArgumentTypeResolver(argumentTypeResolver);
198            callResolver.setCallCompleter(callCompleter);
199            callResolver.setCandidateResolver(candidateResolver);
200            callResolver.setExpressionTypingServices(expressionTypingServices);
201            callResolver.setTaskPrioritizer(taskPrioritizer);
202            callResolver.setTypeResolver(typeResolver);
203    
204            argumentTypeResolver.setBuiltIns(kotlinBuiltIns);
205            argumentTypeResolver.setExpressionTypingServices(expressionTypingServices);
206            argumentTypeResolver.setTypeResolver(typeResolver);
207    
208            expressionTypingServices.setAnnotationResolver(annotationResolver);
209            expressionTypingServices.setBuiltIns(kotlinBuiltIns);
210            expressionTypingServices.setCallExpressionResolver(callExpressionResolver);
211            expressionTypingServices.setCallResolver(callResolver);
212            expressionTypingServices.setDescriptorResolver(descriptorResolver);
213            expressionTypingServices.setExtensionProvider(callResolverExtensionProvider);
214            expressionTypingServices.setPartialBodyResolveProvider(partialBodyResolveProvider);
215            expressionTypingServices.setProject(project);
216            expressionTypingServices.setTypeResolver(typeResolver);
217    
218            expressionTypingComponents.setAdditionalCheckerProvider(additionalCheckerProvider);
219            expressionTypingComponents.setBuiltIns(kotlinBuiltIns);
220            expressionTypingComponents.setCallResolver(callResolver);
221            expressionTypingComponents.setControlStructureTypingUtils(controlStructureTypingUtils);
222            expressionTypingComponents.setDynamicTypesSettings(dynamicTypesSettings);
223            expressionTypingComponents.setExpressionTypingServices(expressionTypingServices);
224            expressionTypingComponents.setExpressionTypingUtils(expressionTypingUtils);
225            expressionTypingComponents.setForLoopConventionsChecker(forLoopConventionsChecker);
226            expressionTypingComponents.setGlobalContext(globalContext);
227            expressionTypingComponents.setPlatformToKotlinClassMap(platformToKotlinClassMap);
228            expressionTypingComponents.setReflectionTypes(reflectionTypes);
229    
230            forLoopConventionsChecker.setBuiltIns(kotlinBuiltIns);
231            forLoopConventionsChecker.setExpressionTypingServices(expressionTypingServices);
232            forLoopConventionsChecker.setExpressionTypingUtils(expressionTypingUtils);
233            forLoopConventionsChecker.setProject(project);
234    
235            callExpressionResolver.setExpressionTypingServices(expressionTypingServices);
236    
237            descriptorResolver.setAnnotationResolver(annotationResolver);
238            descriptorResolver.setBuiltIns(kotlinBuiltIns);
239            descriptorResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
240            descriptorResolver.setExpressionTypingServices(expressionTypingServices);
241            descriptorResolver.setStorageManager(storageManager);
242            descriptorResolver.setTypeResolver(typeResolver);
243    
244            delegatedPropertyResolver.setBuiltIns(kotlinBuiltIns);
245            delegatedPropertyResolver.setCallResolver(callResolver);
246            delegatedPropertyResolver.setExpressionTypingServices(expressionTypingServices);
247    
248            candidateResolver.setArgumentTypeResolver(argumentTypeResolver);
249    
250            controlFlowAnalyzer.setTrace(bindingTrace);
251    
252            declarationsChecker.setDescriptorResolver(descriptorResolver);
253            declarationsChecker.setModifiersChecker(modifiersChecker);
254            declarationsChecker.setTrace(bindingTrace);
255    
256            functionAnalyzerExtension.setTrace(bindingTrace);
257    
258            scriptBodyResolver.setExpressionTypingServices(expressionTypingServices);
259    
260            declarationResolver.setAnnotationResolver(annotationResolver);
261            declarationResolver.setDescriptorResolver(descriptorResolver);
262            declarationResolver.setImportsResolver(importsResolver);
263            declarationResolver.setTrace(bindingTrace);
264    
265            importsResolver.setImportsFactory(jetImportsFactory);
266            importsResolver.setModuleDescriptor(moduleDescriptor);
267            importsResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);
268            importsResolver.setTrace(bindingTrace);
269    
270            jetImportsFactory.setProject(project);
271    
272            overloadResolver.setTrace(bindingTrace);
273    
274            overrideResolver.setTrace(bindingTrace);
275    
276            typeHierarchyResolver.setDescriptorResolver(descriptorResolver);
277            typeHierarchyResolver.setImportsResolver(importsResolver);
278            typeHierarchyResolver.setPackageFragmentProvider(mutablePackageFragmentProvider);
279            typeHierarchyResolver.setScriptHeaderResolver(scriptHeaderResolver);
280            typeHierarchyResolver.setTrace(bindingTrace);
281    
282            scriptHeaderResolver.setPackageFragmentProvider(mutablePackageFragmentProvider);
283            scriptHeaderResolver.setTrace(bindingTrace);
284    
285        }
286    
287        @PreDestroy
288        public void destroy() {
289        }
290    
291        public ModuleDescriptor getModuleDescriptor() {
292            return this.moduleDescriptor;
293        }
294    
295        public TopDownAnalyzer getTopDownAnalyzer() {
296            return this.topDownAnalyzer;
297        }
298    
299    }