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