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.PlatformToKotlinClassMap;
025    import org.jetbrains.jet.lang.resolve.BodyResolver;
026    import org.jetbrains.jet.lang.resolve.AnnotationResolver;
027    import org.jetbrains.jet.lang.resolve.calls.CallResolver;
028    import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver;
029    import org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices;
030    import org.jetbrains.jet.lang.types.expressions.ExpressionTypingComponents;
031    import org.jetbrains.jet.lang.types.expressions.ControlStructureTypingUtils;
032    import org.jetbrains.jet.lang.types.expressions.ExpressionTypingUtils;
033    import org.jetbrains.jet.lang.types.expressions.ForLoopConventionsChecker;
034    import org.jetbrains.jet.lang.resolve.calls.CallExpressionResolver;
035    import org.jetbrains.jet.lang.resolve.DescriptorResolver;
036    import org.jetbrains.jet.lang.resolve.DelegatedPropertyResolver;
037    import org.jetbrains.jet.lang.resolve.TypeResolver;
038    import org.jetbrains.jet.lang.resolve.QualifiedExpressionResolver;
039    import org.jetbrains.jet.lang.resolve.calls.CallResolverExtensionProvider;
040    import org.jetbrains.jet.lang.resolve.calls.CandidateResolver;
041    import org.jetbrains.jet.lang.resolve.ControlFlowAnalyzer;
042    import org.jetbrains.jet.lang.resolve.DeclarationsChecker;
043    import org.jetbrains.jet.lang.resolve.FunctionAnalyzerExtension;
044    import org.jetbrains.jet.lang.resolve.ScriptBodyResolver;
045    import org.jetbrains.annotations.NotNull;
046    import javax.annotation.PreDestroy;
047    
048    /* This file is generated by org.jetbrains.jet.generators.injectors.InjectorsPackage. DO NOT EDIT! */
049    @SuppressWarnings("ALL")
050    public class InjectorForBodyResolve {
051        
052        private final Project project;
053        private final GlobalContext globalContext;
054        private final StorageManager storageManager;
055        private final BindingTrace bindingTrace;
056        private final ModuleDescriptor moduleDescriptor;
057        private final PlatformToKotlinClassMap platformToKotlinClassMap;
058        private final BodyResolver bodyResolver;
059        private final AnnotationResolver annotationResolver;
060        private final CallResolver callResolver;
061        private final ArgumentTypeResolver argumentTypeResolver;
062        private final ExpressionTypingServices expressionTypingServices;
063        private final ExpressionTypingComponents expressionTypingComponents;
064        private final ControlStructureTypingUtils controlStructureTypingUtils;
065        private final ExpressionTypingUtils expressionTypingUtils;
066        private final ForLoopConventionsChecker forLoopConventionsChecker;
067        private final CallExpressionResolver callExpressionResolver;
068        private final DescriptorResolver descriptorResolver;
069        private final DelegatedPropertyResolver delegatedPropertyResolver;
070        private final TypeResolver typeResolver;
071        private final QualifiedExpressionResolver qualifiedExpressionResolver;
072        private final CallResolverExtensionProvider callResolverExtensionProvider;
073        private final CandidateResolver candidateResolver;
074        private final ControlFlowAnalyzer controlFlowAnalyzer;
075        private final DeclarationsChecker declarationsChecker;
076        private final FunctionAnalyzerExtension functionAnalyzerExtension;
077        private final ScriptBodyResolver scriptBodyResolver;
078        
079        public InjectorForBodyResolve(
080            @NotNull Project project,
081            @NotNull GlobalContext globalContext,
082            @NotNull BindingTrace bindingTrace,
083            @NotNull ModuleDescriptor moduleDescriptor
084        ) {
085            this.project = project;
086            this.globalContext = globalContext;
087            this.storageManager = globalContext.getStorageManager();
088            this.bindingTrace = bindingTrace;
089            this.moduleDescriptor = moduleDescriptor;
090            this.platformToKotlinClassMap = moduleDescriptor.getPlatformToKotlinClassMap();
091            this.bodyResolver = new BodyResolver();
092            this.annotationResolver = new AnnotationResolver();
093            this.callResolver = new CallResolver();
094            this.argumentTypeResolver = new ArgumentTypeResolver();
095            this.expressionTypingComponents = new ExpressionTypingComponents();
096            this.expressionTypingServices = new ExpressionTypingServices(expressionTypingComponents);
097            this.controlStructureTypingUtils = new ControlStructureTypingUtils(expressionTypingServices);
098            this.expressionTypingUtils = new ExpressionTypingUtils(expressionTypingServices, callResolver);
099            this.forLoopConventionsChecker = new ForLoopConventionsChecker();
100            this.callExpressionResolver = new CallExpressionResolver();
101            this.descriptorResolver = new DescriptorResolver();
102            this.delegatedPropertyResolver = new DelegatedPropertyResolver();
103            this.typeResolver = new TypeResolver();
104            this.qualifiedExpressionResolver = new QualifiedExpressionResolver();
105            this.callResolverExtensionProvider = new CallResolverExtensionProvider();
106            this.candidateResolver = new CandidateResolver();
107            this.controlFlowAnalyzer = new ControlFlowAnalyzer();
108            this.declarationsChecker = new DeclarationsChecker();
109            this.functionAnalyzerExtension = new FunctionAnalyzerExtension();
110            this.scriptBodyResolver = new ScriptBodyResolver();
111    
112            this.bodyResolver.setAnnotationResolver(annotationResolver);
113            this.bodyResolver.setCallResolver(callResolver);
114            this.bodyResolver.setControlFlowAnalyzer(controlFlowAnalyzer);
115            this.bodyResolver.setDeclarationsChecker(declarationsChecker);
116            this.bodyResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
117            this.bodyResolver.setExpressionTypingServices(expressionTypingServices);
118            this.bodyResolver.setFunctionAnalyzerExtension(functionAnalyzerExtension);
119            this.bodyResolver.setScriptBodyResolverResolver(scriptBodyResolver);
120            this.bodyResolver.setTrace(bindingTrace);
121    
122            annotationResolver.setCallResolver(callResolver);
123            annotationResolver.setExpressionTypingServices(expressionTypingServices);
124    
125            callResolver.setArgumentTypeResolver(argumentTypeResolver);
126            callResolver.setCandidateResolver(candidateResolver);
127            callResolver.setExpressionTypingServices(expressionTypingServices);
128            callResolver.setTypeResolver(typeResolver);
129    
130            argumentTypeResolver.setExpressionTypingServices(expressionTypingServices);
131            argumentTypeResolver.setTypeResolver(typeResolver);
132    
133            expressionTypingServices.setAnnotationResolver(annotationResolver);
134            expressionTypingServices.setCallExpressionResolver(callExpressionResolver);
135            expressionTypingServices.setCallResolver(callResolver);
136            expressionTypingServices.setDescriptorResolver(descriptorResolver);
137            expressionTypingServices.setExtensionProvider(callResolverExtensionProvider);
138            expressionTypingServices.setProject(project);
139            expressionTypingServices.setTypeResolver(typeResolver);
140    
141            expressionTypingComponents.setCallResolver(callResolver);
142            expressionTypingComponents.setControlStructureTypingUtils(controlStructureTypingUtils);
143            expressionTypingComponents.setExpressionTypingServices(expressionTypingServices);
144            expressionTypingComponents.setExpressionTypingUtils(expressionTypingUtils);
145            expressionTypingComponents.setForLoopConventionsChecker(forLoopConventionsChecker);
146            expressionTypingComponents.setGlobalContext(globalContext);
147            expressionTypingComponents.setPlatformToKotlinClassMap(platformToKotlinClassMap);
148    
149            forLoopConventionsChecker.setExpressionTypingServices(expressionTypingServices);
150            forLoopConventionsChecker.setExpressionTypingUtils(expressionTypingUtils);
151            forLoopConventionsChecker.setProject(project);
152    
153            callExpressionResolver.setExpressionTypingServices(expressionTypingServices);
154    
155            descriptorResolver.setAnnotationResolver(annotationResolver);
156            descriptorResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
157            descriptorResolver.setExpressionTypingServices(expressionTypingServices);
158            descriptorResolver.setStorageManager(storageManager);
159            descriptorResolver.setTypeResolver(typeResolver);
160    
161            delegatedPropertyResolver.setCallResolver(callResolver);
162            delegatedPropertyResolver.setExpressionTypingServices(expressionTypingServices);
163    
164            typeResolver.setAnnotationResolver(annotationResolver);
165            typeResolver.setModuleDescriptor(moduleDescriptor);
166            typeResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);
167    
168            candidateResolver.setArgumentTypeResolver(argumentTypeResolver);
169    
170            controlFlowAnalyzer.setTrace(bindingTrace);
171    
172            declarationsChecker.setTrace(bindingTrace);
173    
174            functionAnalyzerExtension.setTrace(bindingTrace);
175    
176            scriptBodyResolver.setExpressionTypingServices(expressionTypingServices);
177            scriptBodyResolver.setTrace(bindingTrace);
178    
179        }
180        
181        @PreDestroy
182        public void destroy() {
183        }
184        
185        public BodyResolver getBodyResolver() {
186            return this.bodyResolver;
187        }
188        
189    }