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.impl.ModuleDescriptorImpl; 024 import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; 025 import org.jetbrains.jet.lang.PlatformToKotlinClassMap; 026 import org.jetbrains.jet.lang.resolve.lazy.declarations.DeclarationProviderFactory; 027 import org.jetbrains.jet.lang.resolve.lazy.ResolveSession; 028 import org.jetbrains.jet.lang.resolve.LazyTopDownAnalyzer; 029 import org.jetbrains.jet.lang.resolve.AdditionalCheckerProvider.Empty; 030 import org.jetbrains.jet.lang.resolve.AnnotationResolver; 031 import org.jetbrains.jet.lang.resolve.calls.CallResolver; 032 import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver; 033 import org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices; 034 import org.jetbrains.jet.lang.types.expressions.ExpressionTypingComponents; 035 import org.jetbrains.jet.lang.types.expressions.ControlStructureTypingUtils; 036 import org.jetbrains.jet.lang.types.DynamicTypesSettings; 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.psi.JetImportsFactory; 053 import org.jetbrains.jet.lang.resolve.lazy.ScopeProvider; 054 import org.jetbrains.jet.lang.resolve.lazy.ScopeProvider.AdditionalFileScopeProvider; 055 import org.jetbrains.jet.lang.resolve.ScriptBodyResolver; 056 import org.jetbrains.jet.lang.resolve.BodyResolver; 057 import org.jetbrains.jet.lang.resolve.ControlFlowAnalyzer; 058 import org.jetbrains.jet.lang.resolve.DeclarationsChecker; 059 import org.jetbrains.jet.lang.resolve.ModifiersChecker; 060 import org.jetbrains.jet.lang.resolve.FunctionAnalyzerExtension; 061 import org.jetbrains.jet.lang.resolve.DeclarationResolver; 062 import org.jetbrains.jet.lang.resolve.ImportsResolver; 063 import org.jetbrains.jet.lang.resolve.OverloadResolver; 064 import org.jetbrains.jet.lang.resolve.OverrideResolver; 065 import org.jetbrains.jet.lang.resolve.TopDownAnalyzer; 066 import org.jetbrains.jet.lang.resolve.MutablePackageFragmentProvider; 067 import org.jetbrains.jet.lang.resolve.TypeHierarchyResolver; 068 import org.jetbrains.jet.lang.resolve.ScriptHeaderResolver; 069 import org.jetbrains.jet.lang.resolve.varianceChecker.VarianceChecker; 070 import org.jetbrains.annotations.NotNull; 071 import javax.annotation.PreDestroy; 072 073 /* This file is generated by org.jetbrains.jet.generators.injectors.InjectorsPackage. DO NOT EDIT! */ 074 @SuppressWarnings("all") 075 public class InjectorForLazyTopDownAnalyzerBasic { 076 077 private final Project project; 078 private final GlobalContext globalContext; 079 private final StorageManager storageManager; 080 private final BindingTrace bindingTrace; 081 private final ModuleDescriptorImpl module; 082 private final KotlinBuiltIns kotlinBuiltIns; 083 private final PlatformToKotlinClassMap platformToKotlinClassMap; 084 private final DeclarationProviderFactory declarationProviderFactory; 085 private final ResolveSession resolveSession; 086 private final LazyTopDownAnalyzer lazyTopDownAnalyzer; 087 private final Empty empty; 088 private final AnnotationResolver annotationResolver; 089 private final CallResolver callResolver; 090 private final ArgumentTypeResolver argumentTypeResolver; 091 private final ExpressionTypingServices expressionTypingServices; 092 private final ExpressionTypingComponents expressionTypingComponents; 093 private final ControlStructureTypingUtils controlStructureTypingUtils; 094 private final DynamicTypesSettings dynamicTypesSettings; 095 private final ExpressionTypingUtils expressionTypingUtils; 096 private final ForLoopConventionsChecker forLoopConventionsChecker; 097 private final ReflectionTypes reflectionTypes; 098 private final CallExpressionResolver callExpressionResolver; 099 private final DescriptorResolver descriptorResolver; 100 private final DelegatedPropertyResolver delegatedPropertyResolver; 101 private final TypeResolver typeResolver; 102 private final QualifiedExpressionResolver qualifiedExpressionResolver; 103 private final FlexibleTypeCapabilitiesProvider flexibleTypeCapabilitiesProvider; 104 private final LazinessToken lazinessToken; 105 private final CallResolverExtensionProvider callResolverExtensionProvider; 106 private final PartialBodyResolveProvider partialBodyResolveProvider; 107 private final CallCompleter callCompleter; 108 private final CandidateResolver candidateResolver; 109 private final TaskPrioritizer taskPrioritizer; 110 private final JetImportsFactory jetImportsFactory; 111 private final ScopeProvider scopeProvider; 112 private final AdditionalFileScopeProvider additionalFileScopeProvider; 113 private final ScriptBodyResolver scriptBodyResolver; 114 private final BodyResolver bodyResolver; 115 private final ControlFlowAnalyzer controlFlowAnalyzer; 116 private final DeclarationsChecker declarationsChecker; 117 private final ModifiersChecker modifiersChecker; 118 private final FunctionAnalyzerExtension functionAnalyzerExtension; 119 private final DeclarationResolver declarationResolver; 120 private final ImportsResolver importsResolver; 121 private final OverloadResolver overloadResolver; 122 private final OverrideResolver overrideResolver; 123 private final TopDownAnalyzer topDownAnalyzer; 124 private final MutablePackageFragmentProvider mutablePackageFragmentProvider; 125 private final TypeHierarchyResolver typeHierarchyResolver; 126 private final ScriptHeaderResolver scriptHeaderResolver; 127 private final VarianceChecker varianceChecker; 128 129 public InjectorForLazyTopDownAnalyzerBasic( 130 @NotNull Project project, 131 @NotNull GlobalContext globalContext, 132 @NotNull BindingTrace bindingTrace, 133 @NotNull ModuleDescriptorImpl module, 134 @NotNull DeclarationProviderFactory declarationProviderFactory 135 ) { 136 this.project = project; 137 this.globalContext = globalContext; 138 this.storageManager = globalContext.getStorageManager(); 139 this.bindingTrace = bindingTrace; 140 this.module = module; 141 this.kotlinBuiltIns = module.getBuiltIns(); 142 this.platformToKotlinClassMap = module.getPlatformToKotlinClassMap(); 143 this.declarationProviderFactory = declarationProviderFactory; 144 this.resolveSession = new ResolveSession(project, globalContext, module, declarationProviderFactory, bindingTrace); 145 this.lazyTopDownAnalyzer = new LazyTopDownAnalyzer(); 146 this.empty = Empty.INSTANCE$; 147 this.annotationResolver = new AnnotationResolver(); 148 this.callResolver = new CallResolver(); 149 this.argumentTypeResolver = new ArgumentTypeResolver(); 150 this.expressionTypingComponents = new ExpressionTypingComponents(); 151 this.expressionTypingServices = new ExpressionTypingServices(expressionTypingComponents); 152 this.controlStructureTypingUtils = new ControlStructureTypingUtils(expressionTypingServices); 153 this.dynamicTypesSettings = new DynamicTypesSettings(); 154 this.expressionTypingUtils = new ExpressionTypingUtils(expressionTypingServices, callResolver, kotlinBuiltIns); 155 this.forLoopConventionsChecker = new ForLoopConventionsChecker(); 156 this.reflectionTypes = new ReflectionTypes(module); 157 this.callExpressionResolver = new CallExpressionResolver(); 158 this.descriptorResolver = new DescriptorResolver(); 159 this.delegatedPropertyResolver = new DelegatedPropertyResolver(); 160 this.qualifiedExpressionResolver = new QualifiedExpressionResolver(); 161 this.flexibleTypeCapabilitiesProvider = new FlexibleTypeCapabilitiesProvider(); 162 this.lazinessToken = new LazinessToken(); 163 this.typeResolver = new TypeResolver(annotationResolver, qualifiedExpressionResolver, module, flexibleTypeCapabilitiesProvider, storageManager, lazinessToken, dynamicTypesSettings); 164 this.callResolverExtensionProvider = new CallResolverExtensionProvider(); 165 this.partialBodyResolveProvider = new PartialBodyResolveProvider(); 166 this.candidateResolver = new CandidateResolver(); 167 this.callCompleter = new CallCompleter(argumentTypeResolver, candidateResolver); 168 this.taskPrioritizer = new TaskPrioritizer(storageManager); 169 this.jetImportsFactory = new JetImportsFactory(); 170 this.scopeProvider = new ScopeProvider(getResolveSession()); 171 this.additionalFileScopeProvider = new AdditionalFileScopeProvider(); 172 this.scriptBodyResolver = new ScriptBodyResolver(); 173 this.bodyResolver = new BodyResolver(); 174 this.controlFlowAnalyzer = new ControlFlowAnalyzer(); 175 this.declarationsChecker = new DeclarationsChecker(); 176 this.modifiersChecker = new ModifiersChecker(bindingTrace, empty); 177 this.functionAnalyzerExtension = new FunctionAnalyzerExtension(); 178 this.declarationResolver = new DeclarationResolver(); 179 this.importsResolver = new ImportsResolver(); 180 this.overloadResolver = new OverloadResolver(); 181 this.overrideResolver = new OverrideResolver(); 182 this.topDownAnalyzer = new TopDownAnalyzer(); 183 this.mutablePackageFragmentProvider = new MutablePackageFragmentProvider(module); 184 this.typeHierarchyResolver = new TypeHierarchyResolver(); 185 this.scriptHeaderResolver = new ScriptHeaderResolver(); 186 this.varianceChecker = new VarianceChecker(bindingTrace); 187 188 this.resolveSession.setAnnotationResolve(annotationResolver); 189 this.resolveSession.setDescriptorResolver(descriptorResolver); 190 this.resolveSession.setJetImportFactory(jetImportsFactory); 191 this.resolveSession.setQualifiedExpressionResolver(qualifiedExpressionResolver); 192 this.resolveSession.setScopeProvider(scopeProvider); 193 this.resolveSession.setScriptBodyResolver(scriptBodyResolver); 194 this.resolveSession.setTypeResolver(typeResolver); 195 196 this.lazyTopDownAnalyzer.setBodyResolver(bodyResolver); 197 this.lazyTopDownAnalyzer.setDeclarationResolver(declarationResolver); 198 this.lazyTopDownAnalyzer.setKotlinCodeAnalyzer(resolveSession); 199 this.lazyTopDownAnalyzer.setModuleDescriptor(module); 200 this.lazyTopDownAnalyzer.setOverloadResolver(overloadResolver); 201 this.lazyTopDownAnalyzer.setOverrideResolver(overrideResolver); 202 this.lazyTopDownAnalyzer.setTopDownAnalyzer(topDownAnalyzer); 203 this.lazyTopDownAnalyzer.setTrace(bindingTrace); 204 this.lazyTopDownAnalyzer.setVarianceChecker(varianceChecker); 205 206 annotationResolver.setCallResolver(callResolver); 207 annotationResolver.setStorageManager(storageManager); 208 annotationResolver.setTypeResolver(typeResolver); 209 210 callResolver.setArgumentTypeResolver(argumentTypeResolver); 211 callResolver.setCallCompleter(callCompleter); 212 callResolver.setCandidateResolver(candidateResolver); 213 callResolver.setExpressionTypingServices(expressionTypingServices); 214 callResolver.setTaskPrioritizer(taskPrioritizer); 215 callResolver.setTypeResolver(typeResolver); 216 217 argumentTypeResolver.setBuiltIns(kotlinBuiltIns); 218 argumentTypeResolver.setExpressionTypingServices(expressionTypingServices); 219 argumentTypeResolver.setTypeResolver(typeResolver); 220 221 expressionTypingServices.setAnnotationResolver(annotationResolver); 222 expressionTypingServices.setBuiltIns(kotlinBuiltIns); 223 expressionTypingServices.setCallExpressionResolver(callExpressionResolver); 224 expressionTypingServices.setCallResolver(callResolver); 225 expressionTypingServices.setDescriptorResolver(descriptorResolver); 226 expressionTypingServices.setExtensionProvider(callResolverExtensionProvider); 227 expressionTypingServices.setPartialBodyResolveProvider(partialBodyResolveProvider); 228 expressionTypingServices.setProject(project); 229 expressionTypingServices.setTypeResolver(typeResolver); 230 231 expressionTypingComponents.setAdditionalCheckerProvider(empty); 232 expressionTypingComponents.setBuiltIns(kotlinBuiltIns); 233 expressionTypingComponents.setCallResolver(callResolver); 234 expressionTypingComponents.setControlStructureTypingUtils(controlStructureTypingUtils); 235 expressionTypingComponents.setDynamicTypesSettings(dynamicTypesSettings); 236 expressionTypingComponents.setExpressionTypingServices(expressionTypingServices); 237 expressionTypingComponents.setExpressionTypingUtils(expressionTypingUtils); 238 expressionTypingComponents.setForLoopConventionsChecker(forLoopConventionsChecker); 239 expressionTypingComponents.setGlobalContext(globalContext); 240 expressionTypingComponents.setPlatformToKotlinClassMap(platformToKotlinClassMap); 241 expressionTypingComponents.setReflectionTypes(reflectionTypes); 242 243 forLoopConventionsChecker.setBuiltIns(kotlinBuiltIns); 244 forLoopConventionsChecker.setExpressionTypingServices(expressionTypingServices); 245 forLoopConventionsChecker.setExpressionTypingUtils(expressionTypingUtils); 246 forLoopConventionsChecker.setProject(project); 247 248 callExpressionResolver.setExpressionTypingServices(expressionTypingServices); 249 250 descriptorResolver.setAnnotationResolver(annotationResolver); 251 descriptorResolver.setBuiltIns(kotlinBuiltIns); 252 descriptorResolver.setDelegatedPropertyResolver(delegatedPropertyResolver); 253 descriptorResolver.setExpressionTypingServices(expressionTypingServices); 254 descriptorResolver.setStorageManager(storageManager); 255 descriptorResolver.setTypeResolver(typeResolver); 256 257 delegatedPropertyResolver.setBuiltIns(kotlinBuiltIns); 258 delegatedPropertyResolver.setCallResolver(callResolver); 259 delegatedPropertyResolver.setExpressionTypingServices(expressionTypingServices); 260 261 candidateResolver.setArgumentTypeResolver(argumentTypeResolver); 262 263 jetImportsFactory.setProject(project); 264 265 scopeProvider.setAdditionalFileScopesProvider(additionalFileScopeProvider); 266 267 scriptBodyResolver.setExpressionTypingServices(expressionTypingServices); 268 269 bodyResolver.setAnnotationResolver(annotationResolver); 270 bodyResolver.setCallResolver(callResolver); 271 bodyResolver.setControlFlowAnalyzer(controlFlowAnalyzer); 272 bodyResolver.setDeclarationsChecker(declarationsChecker); 273 bodyResolver.setDelegatedPropertyResolver(delegatedPropertyResolver); 274 bodyResolver.setExpressionTypingServices(expressionTypingServices); 275 bodyResolver.setFunctionAnalyzerExtension(functionAnalyzerExtension); 276 bodyResolver.setScriptBodyResolverResolver(scriptBodyResolver); 277 bodyResolver.setTrace(bindingTrace); 278 279 controlFlowAnalyzer.setTrace(bindingTrace); 280 281 declarationsChecker.setDescriptorResolver(descriptorResolver); 282 declarationsChecker.setModifiersChecker(modifiersChecker); 283 declarationsChecker.setTrace(bindingTrace); 284 285 functionAnalyzerExtension.setTrace(bindingTrace); 286 287 declarationResolver.setAnnotationResolver(annotationResolver); 288 declarationResolver.setDescriptorResolver(descriptorResolver); 289 declarationResolver.setImportsResolver(importsResolver); 290 declarationResolver.setTrace(bindingTrace); 291 292 importsResolver.setImportsFactory(jetImportsFactory); 293 importsResolver.setModuleDescriptor(module); 294 importsResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver); 295 importsResolver.setTrace(bindingTrace); 296 297 overloadResolver.setTrace(bindingTrace); 298 299 overrideResolver.setTrace(bindingTrace); 300 301 topDownAnalyzer.setBodyResolver(bodyResolver); 302 topDownAnalyzer.setDeclarationResolver(declarationResolver); 303 topDownAnalyzer.setModuleDescriptor(module); 304 topDownAnalyzer.setOverloadResolver(overloadResolver); 305 topDownAnalyzer.setOverrideResolver(overrideResolver); 306 topDownAnalyzer.setPackageFragmentProvider(mutablePackageFragmentProvider); 307 topDownAnalyzer.setTypeHierarchyResolver(typeHierarchyResolver); 308 topDownAnalyzer.setVarianceChecker(varianceChecker); 309 310 typeHierarchyResolver.setDescriptorResolver(descriptorResolver); 311 typeHierarchyResolver.setImportsResolver(importsResolver); 312 typeHierarchyResolver.setPackageFragmentProvider(mutablePackageFragmentProvider); 313 typeHierarchyResolver.setScriptHeaderResolver(scriptHeaderResolver); 314 typeHierarchyResolver.setTrace(bindingTrace); 315 316 scriptHeaderResolver.setPackageFragmentProvider(mutablePackageFragmentProvider); 317 scriptHeaderResolver.setTrace(bindingTrace); 318 319 } 320 321 @PreDestroy 322 public void destroy() { 323 } 324 325 public ResolveSession getResolveSession() { 326 return this.resolveSession; 327 } 328 329 public LazyTopDownAnalyzer getLazyTopDownAnalyzer() { 330 return this.lazyTopDownAnalyzer; 331 } 332 333 }