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.ModuleDescriptorImpl;
024    import org.jetbrains.jet.lang.PlatformToKotlinClassMap;
025    import org.jetbrains.jet.lang.resolve.TopDownAnalyzer;
026    import org.jetbrains.jet.lang.resolve.MutablePackageFragmentProvider;
027    import org.jetbrains.jet.lang.types.DependencyClassByQualifiedNameResolverDummyImpl;
028    import org.jetbrains.jet.lang.resolve.BodyResolver;
029    import org.jetbrains.jet.lang.resolve.AnnotationResolver;
030    import org.jetbrains.jet.lang.resolve.calls.CallResolver;
031    import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver;
032    import org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices;
033    import org.jetbrains.jet.lang.types.expressions.ExpressionTypingComponents;
034    import org.jetbrains.jet.lang.types.expressions.ControlStructureTypingUtils;
035    import org.jetbrains.jet.lang.types.expressions.ExpressionTypingUtils;
036    import org.jetbrains.jet.lang.types.expressions.ForLoopConventionsChecker;
037    import org.jetbrains.jet.lang.resolve.calls.CallExpressionResolver;
038    import org.jetbrains.jet.lang.resolve.DescriptorResolver;
039    import org.jetbrains.jet.lang.resolve.DelegatedPropertyResolver;
040    import org.jetbrains.jet.lang.resolve.TypeResolver;
041    import org.jetbrains.jet.lang.resolve.QualifiedExpressionResolver;
042    import org.jetbrains.jet.lang.resolve.calls.CallResolverExtensionProvider;
043    import org.jetbrains.jet.lang.resolve.calls.CandidateResolver;
044    import org.jetbrains.jet.lang.resolve.ControlFlowAnalyzer;
045    import org.jetbrains.jet.lang.resolve.DeclarationsChecker;
046    import org.jetbrains.jet.lang.resolve.FunctionAnalyzerExtension;
047    import org.jetbrains.jet.lang.resolve.ScriptBodyResolver;
048    import org.jetbrains.jet.lang.resolve.DeclarationResolver;
049    import org.jetbrains.jet.lang.resolve.ImportsResolver;
050    import org.jetbrains.jet.lang.psi.JetImportsFactory;
051    import org.jetbrains.jet.lang.resolve.ScriptHeaderResolver;
052    import org.jetbrains.jet.lang.resolve.OverloadResolver;
053    import org.jetbrains.jet.lang.resolve.OverrideResolver;
054    import org.jetbrains.jet.lang.resolve.TypeHierarchyResolver;
055    import org.jetbrains.annotations.NotNull;
056    import javax.annotation.PreDestroy;
057    
058    /* This file is generated by org.jetbrains.jet.generators.injectors.InjectorsPackage. DO NOT EDIT! */
059    @SuppressWarnings("ALL")
060    public class InjectorForTopDownAnalyzerBasic {
061        
062        private final Project project;
063        private final GlobalContext globalContext;
064        private final StorageManager storageManager;
065        private final BindingTrace bindingTrace;
066        private final ModuleDescriptorImpl moduleDescriptor;
067        private final PlatformToKotlinClassMap platformToKotlinClassMap;
068        private final TopDownAnalyzer topDownAnalyzer;
069        private final MutablePackageFragmentProvider mutablePackageFragmentProvider;
070        private final DependencyClassByQualifiedNameResolverDummyImpl dependencyClassByQualifiedNameResolverDummy;
071        private final BodyResolver bodyResolver;
072        private final AnnotationResolver annotationResolver;
073        private final CallResolver callResolver;
074        private final ArgumentTypeResolver argumentTypeResolver;
075        private final ExpressionTypingServices expressionTypingServices;
076        private final ExpressionTypingComponents expressionTypingComponents;
077        private final ControlStructureTypingUtils controlStructureTypingUtils;
078        private final ExpressionTypingUtils expressionTypingUtils;
079        private final ForLoopConventionsChecker forLoopConventionsChecker;
080        private final CallExpressionResolver callExpressionResolver;
081        private final DescriptorResolver descriptorResolver;
082        private final DelegatedPropertyResolver delegatedPropertyResolver;
083        private final TypeResolver typeResolver;
084        private final QualifiedExpressionResolver qualifiedExpressionResolver;
085        private final CallResolverExtensionProvider callResolverExtensionProvider;
086        private final CandidateResolver candidateResolver;
087        private final ControlFlowAnalyzer controlFlowAnalyzer;
088        private final DeclarationsChecker declarationsChecker;
089        private final FunctionAnalyzerExtension functionAnalyzerExtension;
090        private final ScriptBodyResolver scriptBodyResolver;
091        private final DeclarationResolver declarationResolver;
092        private final ImportsResolver importsResolver;
093        private final JetImportsFactory jetImportsFactory;
094        private final ScriptHeaderResolver scriptHeaderResolver;
095        private final OverloadResolver overloadResolver;
096        private final OverrideResolver overrideResolver;
097        private final TypeHierarchyResolver typeHierarchyResolver;
098        
099        public InjectorForTopDownAnalyzerBasic(
100            @NotNull Project project,
101            @NotNull GlobalContext globalContext,
102            @NotNull BindingTrace bindingTrace,
103            @NotNull ModuleDescriptorImpl moduleDescriptor
104        ) {
105            this.project = project;
106            this.globalContext = globalContext;
107            this.storageManager = globalContext.getStorageManager();
108            this.bindingTrace = bindingTrace;
109            this.moduleDescriptor = moduleDescriptor;
110            this.platformToKotlinClassMap = moduleDescriptor.getPlatformToKotlinClassMap();
111            this.topDownAnalyzer = new TopDownAnalyzer();
112            this.mutablePackageFragmentProvider = new MutablePackageFragmentProvider(getModuleDescriptor());
113            this.dependencyClassByQualifiedNameResolverDummy = new DependencyClassByQualifiedNameResolverDummyImpl();
114            this.bodyResolver = new BodyResolver();
115            this.annotationResolver = new AnnotationResolver();
116            this.callResolver = new CallResolver();
117            this.argumentTypeResolver = new ArgumentTypeResolver();
118            this.expressionTypingComponents = new ExpressionTypingComponents();
119            this.expressionTypingServices = new ExpressionTypingServices(expressionTypingComponents);
120            this.controlStructureTypingUtils = new ControlStructureTypingUtils(expressionTypingServices);
121            this.expressionTypingUtils = new ExpressionTypingUtils(expressionTypingServices, callResolver);
122            this.forLoopConventionsChecker = new ForLoopConventionsChecker();
123            this.callExpressionResolver = new CallExpressionResolver();
124            this.descriptorResolver = new DescriptorResolver();
125            this.delegatedPropertyResolver = new DelegatedPropertyResolver();
126            this.typeResolver = new TypeResolver();
127            this.qualifiedExpressionResolver = new QualifiedExpressionResolver();
128            this.callResolverExtensionProvider = new CallResolverExtensionProvider();
129            this.candidateResolver = new CandidateResolver();
130            this.controlFlowAnalyzer = new ControlFlowAnalyzer();
131            this.declarationsChecker = new DeclarationsChecker();
132            this.functionAnalyzerExtension = new FunctionAnalyzerExtension();
133            this.scriptBodyResolver = new ScriptBodyResolver();
134            this.declarationResolver = new DeclarationResolver();
135            this.importsResolver = new ImportsResolver();
136            this.jetImportsFactory = new JetImportsFactory();
137            this.scriptHeaderResolver = new ScriptHeaderResolver();
138            this.overloadResolver = new OverloadResolver();
139            this.overrideResolver = new OverrideResolver();
140            this.typeHierarchyResolver = new TypeHierarchyResolver();
141    
142            this.topDownAnalyzer.setBodyResolver(bodyResolver);
143            this.topDownAnalyzer.setDeclarationResolver(declarationResolver);
144            this.topDownAnalyzer.setModuleDescriptor(moduleDescriptor);
145            this.topDownAnalyzer.setOverloadResolver(overloadResolver);
146            this.topDownAnalyzer.setOverrideResolver(overrideResolver);
147            this.topDownAnalyzer.setPackageFragmentProvider(mutablePackageFragmentProvider);
148            this.topDownAnalyzer.setScriptHeaderResolver(scriptHeaderResolver);
149            this.topDownAnalyzer.setTrace(bindingTrace);
150            this.topDownAnalyzer.setTypeHierarchyResolver(typeHierarchyResolver);
151    
152            bodyResolver.setAnnotationResolver(annotationResolver);
153            bodyResolver.setCallResolver(callResolver);
154            bodyResolver.setControlFlowAnalyzer(controlFlowAnalyzer);
155            bodyResolver.setDeclarationsChecker(declarationsChecker);
156            bodyResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
157            bodyResolver.setExpressionTypingServices(expressionTypingServices);
158            bodyResolver.setFunctionAnalyzerExtension(functionAnalyzerExtension);
159            bodyResolver.setScriptBodyResolverResolver(scriptBodyResolver);
160            bodyResolver.setTrace(bindingTrace);
161    
162            annotationResolver.setCallResolver(callResolver);
163            annotationResolver.setExpressionTypingServices(expressionTypingServices);
164    
165            callResolver.setArgumentTypeResolver(argumentTypeResolver);
166            callResolver.setCandidateResolver(candidateResolver);
167            callResolver.setExpressionTypingServices(expressionTypingServices);
168            callResolver.setTypeResolver(typeResolver);
169    
170            argumentTypeResolver.setExpressionTypingServices(expressionTypingServices);
171            argumentTypeResolver.setTypeResolver(typeResolver);
172    
173            expressionTypingServices.setAnnotationResolver(annotationResolver);
174            expressionTypingServices.setCallExpressionResolver(callExpressionResolver);
175            expressionTypingServices.setCallResolver(callResolver);
176            expressionTypingServices.setDescriptorResolver(descriptorResolver);
177            expressionTypingServices.setExtensionProvider(callResolverExtensionProvider);
178            expressionTypingServices.setProject(project);
179            expressionTypingServices.setTypeResolver(typeResolver);
180    
181            expressionTypingComponents.setCallResolver(callResolver);
182            expressionTypingComponents.setControlStructureTypingUtils(controlStructureTypingUtils);
183            expressionTypingComponents.setExpressionTypingServices(expressionTypingServices);
184            expressionTypingComponents.setExpressionTypingUtils(expressionTypingUtils);
185            expressionTypingComponents.setForLoopConventionsChecker(forLoopConventionsChecker);
186            expressionTypingComponents.setGlobalContext(globalContext);
187            expressionTypingComponents.setPlatformToKotlinClassMap(platformToKotlinClassMap);
188    
189            forLoopConventionsChecker.setExpressionTypingServices(expressionTypingServices);
190            forLoopConventionsChecker.setExpressionTypingUtils(expressionTypingUtils);
191            forLoopConventionsChecker.setProject(project);
192    
193            callExpressionResolver.setExpressionTypingServices(expressionTypingServices);
194    
195            descriptorResolver.setAnnotationResolver(annotationResolver);
196            descriptorResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
197            descriptorResolver.setExpressionTypingServices(expressionTypingServices);
198            descriptorResolver.setStorageManager(storageManager);
199            descriptorResolver.setTypeResolver(typeResolver);
200    
201            delegatedPropertyResolver.setCallResolver(callResolver);
202            delegatedPropertyResolver.setExpressionTypingServices(expressionTypingServices);
203    
204            typeResolver.setAnnotationResolver(annotationResolver);
205            typeResolver.setModuleDescriptor(moduleDescriptor);
206            typeResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);
207    
208            candidateResolver.setArgumentTypeResolver(argumentTypeResolver);
209    
210            controlFlowAnalyzer.setTrace(bindingTrace);
211    
212            declarationsChecker.setDescriptorResolver(descriptorResolver);
213            declarationsChecker.setTrace(bindingTrace);
214    
215            functionAnalyzerExtension.setTrace(bindingTrace);
216    
217            scriptBodyResolver.setExpressionTypingServices(expressionTypingServices);
218            scriptBodyResolver.setTrace(bindingTrace);
219    
220            declarationResolver.setAnnotationResolver(annotationResolver);
221            declarationResolver.setDescriptorResolver(descriptorResolver);
222            declarationResolver.setImportsResolver(importsResolver);
223            declarationResolver.setScriptHeaderResolver(scriptHeaderResolver);
224            declarationResolver.setTrace(bindingTrace);
225    
226            importsResolver.setImportsFactory(jetImportsFactory);
227            importsResolver.setModuleDescriptor(moduleDescriptor);
228            importsResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);
229            importsResolver.setTrace(bindingTrace);
230    
231            jetImportsFactory.setProject(project);
232    
233            scriptHeaderResolver.setDependencyClassByQualifiedNameResolver(dependencyClassByQualifiedNameResolverDummy);
234            scriptHeaderResolver.setPackageFragmentProvider(mutablePackageFragmentProvider);
235            scriptHeaderResolver.setTrace(bindingTrace);
236    
237            overloadResolver.setTrace(bindingTrace);
238    
239            overrideResolver.setTrace(bindingTrace);
240    
241            typeHierarchyResolver.setDescriptorResolver(descriptorResolver);
242            typeHierarchyResolver.setImportsResolver(importsResolver);
243            typeHierarchyResolver.setPackageFragmentProvider(mutablePackageFragmentProvider);
244            typeHierarchyResolver.setScriptHeaderResolver(scriptHeaderResolver);
245            typeHierarchyResolver.setTrace(bindingTrace);
246    
247        }
248        
249        @PreDestroy
250        public void destroy() {
251        }
252        
253        public ModuleDescriptorImpl getModuleDescriptor() {
254            return this.moduleDescriptor;
255        }
256        
257        public TopDownAnalyzer getTopDownAnalyzer() {
258            return this.topDownAnalyzer;
259        }
260        
261    }