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.BodyResolver;
020import org.jetbrains.jet.lang.resolve.calls.NeedSyntheticCallResolverExtension;
021import com.intellij.openapi.project.Project;
022import org.jetbrains.jet.lang.resolve.TopDownAnalysisParameters;
023import org.jetbrains.jet.lang.resolve.BindingTrace;
024import org.jetbrains.jet.lang.resolve.BodiesResolveContext;
025import org.jetbrains.jet.lang.descriptors.ModuleDescriptor;
026import org.jetbrains.jet.lang.resolve.AnnotationResolver;
027import org.jetbrains.jet.lang.resolve.calls.CallResolver;
028import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver;
029import org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices;
030import org.jetbrains.jet.lang.resolve.calls.CallExpressionResolver;
031import org.jetbrains.jet.lang.resolve.DescriptorResolver;
032import org.jetbrains.jet.lang.resolve.TypeResolver;
033import org.jetbrains.jet.lang.resolve.QualifiedExpressionResolver;
034import org.jetbrains.jet.lang.resolve.calls.CandidateResolver;
035import org.jetbrains.jet.lang.resolve.ControlFlowAnalyzer;
036import org.jetbrains.jet.lang.resolve.DeclarationsChecker;
037import org.jetbrains.jet.lang.resolve.ScriptBodyResolver;
038import org.jetbrains.jet.lang.resolve.TopDownAnalysisContext;
039import org.jetbrains.annotations.NotNull;
040import javax.annotation.PreDestroy;
041
042/* This file is generated by org.jetbrains.jet.generators.injectors.GenerateInjectors. DO NOT EDIT! */
043public class InjectorForBodyResolve {
044    
045    private BodyResolver bodyResolver;
046    private NeedSyntheticCallResolverExtension needSyntheticCallResolverExtension;
047    private final Project project;
048    private final TopDownAnalysisParameters topDownAnalysisParameters;
049    private final BindingTrace bindingTrace;
050    private final BodiesResolveContext bodiesResolveContext;
051    private final ModuleDescriptor moduleDescriptor;
052    private AnnotationResolver annotationResolver;
053    private CallResolver callResolver;
054    private ArgumentTypeResolver argumentTypeResolver;
055    private ExpressionTypingServices expressionTypingServices;
056    private CallExpressionResolver callExpressionResolver;
057    private DescriptorResolver descriptorResolver;
058    private TypeResolver typeResolver;
059    private QualifiedExpressionResolver qualifiedExpressionResolver;
060    private CandidateResolver candidateResolver;
061    private ControlFlowAnalyzer controlFlowAnalyzer;
062    private DeclarationsChecker declarationsChecker;
063    private ScriptBodyResolver scriptBodyResolver;
064    private TopDownAnalysisContext topDownAnalysisContext;
065    
066    public InjectorForBodyResolve(
067        @NotNull Project project,
068        @NotNull TopDownAnalysisParameters topDownAnalysisParameters,
069        @NotNull BindingTrace bindingTrace,
070        @NotNull BodiesResolveContext bodiesResolveContext,
071        @NotNull ModuleDescriptor moduleDescriptor
072    ) {
073        this.bodyResolver = new BodyResolver();
074        this.needSyntheticCallResolverExtension = new NeedSyntheticCallResolverExtension();
075        this.project = project;
076        this.topDownAnalysisParameters = topDownAnalysisParameters;
077        this.bindingTrace = bindingTrace;
078        this.bodiesResolveContext = bodiesResolveContext;
079        this.moduleDescriptor = moduleDescriptor;
080        this.annotationResolver = new AnnotationResolver();
081        this.callResolver = new CallResolver();
082        this.argumentTypeResolver = new ArgumentTypeResolver();
083        this.expressionTypingServices = new ExpressionTypingServices();
084        this.callExpressionResolver = new CallExpressionResolver();
085        this.descriptorResolver = new DescriptorResolver();
086        this.typeResolver = new TypeResolver();
087        this.qualifiedExpressionResolver = new QualifiedExpressionResolver();
088        this.candidateResolver = new CandidateResolver();
089        this.controlFlowAnalyzer = new ControlFlowAnalyzer();
090        this.declarationsChecker = new DeclarationsChecker();
091        this.scriptBodyResolver = new ScriptBodyResolver();
092        this.topDownAnalysisContext = new TopDownAnalysisContext();
093
094        this.bodyResolver.setAnnotationResolver(annotationResolver);
095        this.bodyResolver.setCallResolver(callResolver);
096        this.bodyResolver.setContext(bodiesResolveContext);
097        this.bodyResolver.setControlFlowAnalyzer(controlFlowAnalyzer);
098        this.bodyResolver.setDeclarationsChecker(declarationsChecker);
099        this.bodyResolver.setDescriptorResolver(descriptorResolver);
100        this.bodyResolver.setExpressionTypingServices(expressionTypingServices);
101        this.bodyResolver.setScriptBodyResolverResolver(scriptBodyResolver);
102        this.bodyResolver.setTopDownAnalysisParameters(topDownAnalysisParameters);
103        this.bodyResolver.setTrace(bindingTrace);
104
105        annotationResolver.setCallResolver(callResolver);
106        annotationResolver.setExpressionTypingServices(expressionTypingServices);
107
108        callResolver.setArgumentTypeResolver(argumentTypeResolver);
109        callResolver.setCandidateResolver(candidateResolver);
110        callResolver.setExpressionTypingServices(expressionTypingServices);
111        callResolver.setExtension(needSyntheticCallResolverExtension);
112        callResolver.setTypeResolver(typeResolver);
113
114        argumentTypeResolver.setExpressionTypingServices(expressionTypingServices);
115        argumentTypeResolver.setTypeResolver(typeResolver);
116
117        expressionTypingServices.setCallExpressionResolver(callExpressionResolver);
118        expressionTypingServices.setCallResolver(callResolver);
119        expressionTypingServices.setDescriptorResolver(descriptorResolver);
120        expressionTypingServices.setProject(project);
121        expressionTypingServices.setTypeResolver(typeResolver);
122
123        callExpressionResolver.setExpressionTypingServices(expressionTypingServices);
124
125        descriptorResolver.setAnnotationResolver(annotationResolver);
126        descriptorResolver.setExpressionTypingServices(expressionTypingServices);
127        descriptorResolver.setTypeResolver(typeResolver);
128
129        typeResolver.setAnnotationResolver(annotationResolver);
130        typeResolver.setDescriptorResolver(descriptorResolver);
131        typeResolver.setModuleDescriptor(moduleDescriptor);
132        typeResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);
133
134        candidateResolver.setArgumentTypeResolver(argumentTypeResolver);
135
136        controlFlowAnalyzer.setTopDownAnalysisParameters(topDownAnalysisParameters);
137        controlFlowAnalyzer.setTrace(bindingTrace);
138
139        declarationsChecker.setTrace(bindingTrace);
140
141        scriptBodyResolver.setContext(topDownAnalysisContext);
142        scriptBodyResolver.setExpressionTypingServices(expressionTypingServices);
143        scriptBodyResolver.setTrace(bindingTrace);
144
145        topDownAnalysisContext.setTopDownAnalysisParameters(topDownAnalysisParameters);
146
147    }
148    
149    @PreDestroy
150    public void destroy() {
151    }
152    
153    public BodyResolver getBodyResolver() {
154        return this.bodyResolver;
155    }
156    
157    public Project getProject() {
158        return this.project;
159    }
160    
161    public TopDownAnalysisParameters getTopDownAnalysisParameters() {
162        return this.topDownAnalysisParameters;
163    }
164    
165    public BindingTrace getBindingTrace() {
166        return this.bindingTrace;
167    }
168    
169    public BodiesResolveContext getBodiesResolveContext() {
170        return this.bodiesResolveContext;
171    }
172    
173}