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