コード例 #1
0
  public InjectorForTopDownAnalyzerForJs(
      @NotNull Project project,
      @NotNull TopDownAnalysisParameters topDownAnalysisParameters,
      @NotNull BindingTrace bindingTrace,
      @NotNull ModuleDescriptorImpl moduleDescriptor) {
    this.topDownAnalyzer = new TopDownAnalyzer();
    this.topDownAnalysisContext = new TopDownAnalysisContext();
    this.bodyResolver = new BodyResolver();
    this.controlFlowAnalyzer = new ControlFlowAnalyzer();
    this.declarationsChecker = new DeclarationsChecker();
    this.descriptorResolver = new DescriptorResolver();
    this.callResolverExtensionProvider = new CallResolverExtensionProvider();
    this.project = project;
    this.topDownAnalysisParameters = topDownAnalysisParameters;
    this.bindingTrace = bindingTrace;
    this.moduleDescriptor = moduleDescriptor;
    this.dependencyClassByQualifiedNameResolverDummy =
        new DependencyClassByQualifiedNameResolverDummyImpl();
    this.namespaceFactory = new NamespaceFactoryImpl();
    this.platformToKotlinClassMap = org.jetbrains.jet.lang.PlatformToKotlinClassMap.EMPTY;
    this.declarationResolver = new DeclarationResolver();
    this.annotationResolver = new AnnotationResolver();
    this.callResolver = new CallResolver();
    this.argumentTypeResolver = new ArgumentTypeResolver();
    this.expressionTypingServices = new ExpressionTypingServices();
    this.callExpressionResolver = new CallExpressionResolver();
    this.typeResolver = new TypeResolver();
    this.qualifiedExpressionResolver = new QualifiedExpressionResolver();
    this.candidateResolver = new CandidateResolver();
    this.importsResolver = new ImportsResolver();
    this.jetImportsFactory = new JetImportsFactory();
    this.scriptHeaderResolver = new ScriptHeaderResolver();
    this.overloadResolver = new OverloadResolver();
    this.overrideResolver = new OverrideResolver();
    this.typeHierarchyResolver = new TypeHierarchyResolver();
    this.delegatedPropertyResolver = new DelegatedPropertyResolver();
    this.functionAnalyzerExtension = new FunctionAnalyzerExtension();
    this.scriptBodyResolver = new ScriptBodyResolver();

    this.topDownAnalyzer.setBodyResolver(bodyResolver);
    this.topDownAnalyzer.setContext(topDownAnalysisContext);
    this.topDownAnalyzer.setDeclarationResolver(declarationResolver);
    this.topDownAnalyzer.setModuleDescriptor(moduleDescriptor);
    this.topDownAnalyzer.setNamespaceFactory(namespaceFactory);
    this.topDownAnalyzer.setOverloadResolver(overloadResolver);
    this.topDownAnalyzer.setOverrideResolver(overrideResolver);
    this.topDownAnalyzer.setTopDownAnalysisParameters(topDownAnalysisParameters);
    this.topDownAnalyzer.setTrace(bindingTrace);
    this.topDownAnalyzer.setTypeHierarchyResolver(typeHierarchyResolver);

    this.topDownAnalysisContext.setTopDownAnalysisParameters(topDownAnalysisParameters);

    this.bodyResolver.setAnnotationResolver(annotationResolver);
    this.bodyResolver.setCallResolver(callResolver);
    this.bodyResolver.setContext(topDownAnalysisContext);
    this.bodyResolver.setControlFlowAnalyzer(controlFlowAnalyzer);
    this.bodyResolver.setDeclarationsChecker(declarationsChecker);
    this.bodyResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
    this.bodyResolver.setExpressionTypingServices(expressionTypingServices);
    this.bodyResolver.setFunctionAnalyzerExtension(functionAnalyzerExtension);
    this.bodyResolver.setScriptBodyResolverResolver(scriptBodyResolver);
    this.bodyResolver.setTopDownAnalysisParameters(topDownAnalysisParameters);
    this.bodyResolver.setTrace(bindingTrace);

    this.controlFlowAnalyzer.setTopDownAnalysisParameters(topDownAnalysisParameters);
    this.controlFlowAnalyzer.setTrace(bindingTrace);

    this.declarationsChecker.setTrace(bindingTrace);

    this.descriptorResolver.setAnnotationResolver(annotationResolver);
    this.descriptorResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
    this.descriptorResolver.setExpressionTypingServices(expressionTypingServices);
    this.descriptorResolver.setTypeResolver(typeResolver);

    namespaceFactory.setModuleDescriptor(moduleDescriptor);
    namespaceFactory.setTrace(bindingTrace);

    declarationResolver.setAnnotationResolver(annotationResolver);
    declarationResolver.setContext(topDownAnalysisContext);
    declarationResolver.setDescriptorResolver(descriptorResolver);
    declarationResolver.setImportsResolver(importsResolver);
    declarationResolver.setScriptHeaderResolver(scriptHeaderResolver);
    declarationResolver.setTrace(bindingTrace);

    annotationResolver.setCallResolver(callResolver);
    annotationResolver.setExpressionTypingServices(expressionTypingServices);

    callResolver.setArgumentTypeResolver(argumentTypeResolver);
    callResolver.setCandidateResolver(candidateResolver);
    callResolver.setExpressionTypingServices(expressionTypingServices);
    callResolver.setTypeResolver(typeResolver);

    argumentTypeResolver.setExpressionTypingServices(expressionTypingServices);
    argumentTypeResolver.setTypeResolver(typeResolver);

    expressionTypingServices.setAnnotationResolver(annotationResolver);
    expressionTypingServices.setCallExpressionResolver(callExpressionResolver);
    expressionTypingServices.setCallResolver(callResolver);
    expressionTypingServices.setDescriptorResolver(descriptorResolver);
    expressionTypingServices.setExtensionProvider(callResolverExtensionProvider);
    expressionTypingServices.setPlatformToKotlinClassMap(platformToKotlinClassMap);
    expressionTypingServices.setProject(project);
    expressionTypingServices.setTypeResolver(typeResolver);

    callExpressionResolver.setExpressionTypingServices(expressionTypingServices);

    typeResolver.setAnnotationResolver(annotationResolver);
    typeResolver.setModuleDescriptor(moduleDescriptor);
    typeResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);

    candidateResolver.setArgumentTypeResolver(argumentTypeResolver);

    importsResolver.setContext(topDownAnalysisContext);
    importsResolver.setImportsFactory(jetImportsFactory);
    importsResolver.setModuleDescriptor(moduleDescriptor);
    importsResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);
    importsResolver.setTrace(bindingTrace);

    jetImportsFactory.setProject(project);

    scriptHeaderResolver.setContext(topDownAnalysisContext);
    scriptHeaderResolver.setDependencyClassByQualifiedNameResolver(
        dependencyClassByQualifiedNameResolverDummy);
    scriptHeaderResolver.setNamespaceFactory(namespaceFactory);
    scriptHeaderResolver.setTopDownAnalysisParameters(topDownAnalysisParameters);
    scriptHeaderResolver.setTrace(bindingTrace);

    overloadResolver.setContext(topDownAnalysisContext);
    overloadResolver.setTrace(bindingTrace);

    overrideResolver.setContext(topDownAnalysisContext);
    overrideResolver.setTopDownAnalysisParameters(topDownAnalysisParameters);
    overrideResolver.setTrace(bindingTrace);

    typeHierarchyResolver.setContext(topDownAnalysisContext);
    typeHierarchyResolver.setDescriptorResolver(descriptorResolver);
    typeHierarchyResolver.setImportsResolver(importsResolver);
    typeHierarchyResolver.setNamespaceFactory(namespaceFactory);
    typeHierarchyResolver.setScriptHeaderResolver(scriptHeaderResolver);
    typeHierarchyResolver.setTrace(bindingTrace);

    delegatedPropertyResolver.setExpressionTypingServices(expressionTypingServices);

    functionAnalyzerExtension.setTrace(bindingTrace);

    scriptBodyResolver.setContext(topDownAnalysisContext);
    scriptBodyResolver.setExpressionTypingServices(expressionTypingServices);
    scriptBodyResolver.setTrace(bindingTrace);
  }
コード例 #2
0
  public InjectorForTopDownAnalyzerForJvm(
      @NotNull Project project,
      @NotNull TopDownAnalysisParameters topDownAnalysisParameters,
      @NotNull BindingTrace bindingTrace,
      @NotNull ModuleDescriptorImpl moduleDescriptor) {
    this.topDownAnalyzer = new TopDownAnalyzer();
    this.topDownAnalysisContext = new TopDownAnalysisContext();
    this.bodyResolver = new BodyResolver();
    this.controlFlowAnalyzer = new ControlFlowAnalyzer();
    this.declarationsChecker = new DeclarationsChecker();
    this.descriptorResolver = new DescriptorResolver();
    this.project = project;
    this.topDownAnalysisParameters = topDownAnalysisParameters;
    this.bindingTrace = bindingTrace;
    this.moduleDescriptor = moduleDescriptor;
    this.javaBridgeConfiguration = new JavaBridgeConfiguration();
    this.javaDescriptorResolver = new JavaDescriptorResolver();
    this.psiClassFinder = new PsiClassFinderImpl();
    this.namespaceFactory = new NamespaceFactoryImpl();
    this.declarationResolver = new DeclarationResolver();
    this.annotationResolver = new AnnotationResolver();
    this.callResolver = new CallResolver();
    this.argumentTypeResolver = new ArgumentTypeResolver();
    this.expressionTypingServices = new ExpressionTypingServices();
    this.callExpressionResolver = new CallExpressionResolver();
    this.typeResolver = new TypeResolver();
    this.qualifiedExpressionResolver = new QualifiedExpressionResolver();
    this.candidateResolver = new CandidateResolver();
    this.importsResolver = new ImportsResolver();
    this.jetImportsFactory = new JetImportsFactory();
    this.scriptHeaderResolver = new ScriptHeaderResolver();
    this.overloadResolver = new OverloadResolver();
    this.overrideResolver = new OverrideResolver();
    this.typeHierarchyResolver = new TypeHierarchyResolver();
    this.scriptBodyResolver = new ScriptBodyResolver();
    this.javaSemanticServices = new JavaSemanticServices();
    this.psiDeclarationProviderFactory = new PsiDeclarationProviderFactory(psiClassFinder);
    this.javaTypeTransformer = new JavaTypeTransformer();
    this.javaClassResolver = new JavaClassResolver();
    this.javaAnnotationResolver = new JavaAnnotationResolver();
    this.javaCompileTimeConstResolver = new JavaCompileTimeConstResolver();
    this.javaClassObjectResolver = new JavaClassObjectResolver();
    this.javaSupertypeResolver = new JavaSupertypeResolver();
    this.javaNamespaceResolver = new JavaNamespaceResolver();
    this.javaSignatureResolver = new JavaSignatureResolver();
    this.javaConstructorResolver = new JavaConstructorResolver();
    this.javaValueParameterResolver = new JavaValueParameterResolver();
    this.javaFunctionResolver = new JavaFunctionResolver();
    this.javaInnerClassResolver = new JavaInnerClassResolver();
    this.javaPropertyResolver = new JavaPropertyResolver();

    this.topDownAnalyzer.setBodyResolver(bodyResolver);
    this.topDownAnalyzer.setContext(topDownAnalysisContext);
    this.topDownAnalyzer.setDeclarationResolver(declarationResolver);
    this.topDownAnalyzer.setModuleDescriptor(moduleDescriptor);
    this.topDownAnalyzer.setNamespaceFactory(namespaceFactory);
    this.topDownAnalyzer.setOverloadResolver(overloadResolver);
    this.topDownAnalyzer.setOverrideResolver(overrideResolver);
    this.topDownAnalyzer.setTopDownAnalysisParameters(topDownAnalysisParameters);
    this.topDownAnalyzer.setTrace(bindingTrace);
    this.topDownAnalyzer.setTypeHierarchyResolver(typeHierarchyResolver);

    this.topDownAnalysisContext.setTopDownAnalysisParameters(topDownAnalysisParameters);

    this.bodyResolver.setCallResolver(callResolver);
    this.bodyResolver.setContext(topDownAnalysisContext);
    this.bodyResolver.setControlFlowAnalyzer(controlFlowAnalyzer);
    this.bodyResolver.setDeclarationsChecker(declarationsChecker);
    this.bodyResolver.setDescriptorResolver(descriptorResolver);
    this.bodyResolver.setExpressionTypingServices(expressionTypingServices);
    this.bodyResolver.setScriptBodyResolverResolver(scriptBodyResolver);
    this.bodyResolver.setTopDownAnalysisParameters(topDownAnalysisParameters);
    this.bodyResolver.setTrace(bindingTrace);

    this.controlFlowAnalyzer.setTopDownAnalysisParameters(topDownAnalysisParameters);
    this.controlFlowAnalyzer.setTrace(bindingTrace);

    this.declarationsChecker.setTrace(bindingTrace);

    this.descriptorResolver.setAnnotationResolver(annotationResolver);
    this.descriptorResolver.setExpressionTypingServices(expressionTypingServices);
    this.descriptorResolver.setTypeResolver(typeResolver);

    this.javaBridgeConfiguration.setJavaSemanticServices(javaSemanticServices);

    javaDescriptorResolver.setClassResolver(javaClassResolver);
    javaDescriptorResolver.setConstructorResolver(javaConstructorResolver);
    javaDescriptorResolver.setFunctionResolver(javaFunctionResolver);
    javaDescriptorResolver.setInnerClassResolver(javaInnerClassResolver);
    javaDescriptorResolver.setNamespaceResolver(javaNamespaceResolver);
    javaDescriptorResolver.setPropertiesResolver(javaPropertyResolver);

    psiClassFinder.setProject(project);

    this.namespaceFactory.setModuleDescriptor(moduleDescriptor);
    this.namespaceFactory.setTrace(bindingTrace);

    declarationResolver.setAnnotationResolver(annotationResolver);
    declarationResolver.setContext(topDownAnalysisContext);
    declarationResolver.setDescriptorResolver(descriptorResolver);
    declarationResolver.setImportsResolver(importsResolver);
    declarationResolver.setScriptHeaderResolver(scriptHeaderResolver);
    declarationResolver.setTrace(bindingTrace);

    annotationResolver.setCallResolver(callResolver);
    annotationResolver.setExpressionTypingServices(expressionTypingServices);

    callResolver.setArgumentTypeResolver(argumentTypeResolver);
    callResolver.setCandidateResolver(candidateResolver);
    callResolver.setExpressionTypingServices(expressionTypingServices);
    callResolver.setTypeResolver(typeResolver);

    argumentTypeResolver.setExpressionTypingServices(expressionTypingServices);
    argumentTypeResolver.setTypeResolver(typeResolver);

    expressionTypingServices.setCallExpressionResolver(callExpressionResolver);
    expressionTypingServices.setCallResolver(callResolver);
    expressionTypingServices.setDescriptorResolver(descriptorResolver);
    expressionTypingServices.setProject(project);
    expressionTypingServices.setTypeResolver(typeResolver);

    callExpressionResolver.setExpressionTypingServices(expressionTypingServices);

    typeResolver.setAnnotationResolver(annotationResolver);
    typeResolver.setDescriptorResolver(descriptorResolver);
    typeResolver.setModuleDescriptor(moduleDescriptor);
    typeResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);

    candidateResolver.setArgumentTypeResolver(argumentTypeResolver);

    importsResolver.setContext(topDownAnalysisContext);
    importsResolver.setImportsFactory(jetImportsFactory);
    importsResolver.setModuleDescriptor(moduleDescriptor);
    importsResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);
    importsResolver.setTrace(bindingTrace);

    jetImportsFactory.setProject(project);

    scriptHeaderResolver.setContext(topDownAnalysisContext);
    scriptHeaderResolver.setDependencyClassByQualifiedNameResolver(javaDescriptorResolver);
    scriptHeaderResolver.setNamespaceFactory(namespaceFactory);
    scriptHeaderResolver.setTopDownAnalysisParameters(topDownAnalysisParameters);
    scriptHeaderResolver.setTrace(bindingTrace);

    overloadResolver.setContext(topDownAnalysisContext);
    overloadResolver.setTrace(bindingTrace);

    overrideResolver.setContext(topDownAnalysisContext);
    overrideResolver.setTopDownAnalysisParameters(topDownAnalysisParameters);
    overrideResolver.setTrace(bindingTrace);

    typeHierarchyResolver.setContext(topDownAnalysisContext);
    typeHierarchyResolver.setDescriptorResolver(descriptorResolver);
    typeHierarchyResolver.setImportsResolver(importsResolver);
    typeHierarchyResolver.setNamespaceFactory(namespaceFactory);
    typeHierarchyResolver.setScriptHeaderResolver(scriptHeaderResolver);
    typeHierarchyResolver.setTrace(bindingTrace);

    scriptBodyResolver.setContext(topDownAnalysisContext);
    scriptBodyResolver.setExpressionTypingServices(expressionTypingServices);
    scriptBodyResolver.setTrace(bindingTrace);

    javaSemanticServices.setDescriptorResolver(javaDescriptorResolver);
    javaSemanticServices.setPsiClassFinder(psiClassFinder);
    javaSemanticServices.setPsiDeclarationProviderFactory(psiDeclarationProviderFactory);
    javaSemanticServices.setTrace(bindingTrace);
    javaSemanticServices.setTypeTransformer(javaTypeTransformer);

    javaTypeTransformer.setJavaSemanticServices(javaSemanticServices);
    javaTypeTransformer.setResolver(javaDescriptorResolver);

    javaClassResolver.setAnnotationResolver(javaAnnotationResolver);
    javaClassResolver.setClassObjectResolver(javaClassObjectResolver);
    javaClassResolver.setNamespaceResolver(javaNamespaceResolver);
    javaClassResolver.setPsiClassFinder(psiClassFinder);
    javaClassResolver.setSemanticServices(javaSemanticServices);
    javaClassResolver.setSignatureResolver(javaSignatureResolver);
    javaClassResolver.setSupertypesResolver(javaSupertypeResolver);
    javaClassResolver.setTrace(bindingTrace);

    javaAnnotationResolver.setClassResolver(javaClassResolver);
    javaAnnotationResolver.setCompileTimeConstResolver(javaCompileTimeConstResolver);

    javaCompileTimeConstResolver.setAnnotationResolver(javaAnnotationResolver);
    javaCompileTimeConstResolver.setClassResolver(javaClassResolver);

    javaClassObjectResolver.setSemanticServices(javaSemanticServices);
    javaClassObjectResolver.setSupertypesResolver(javaSupertypeResolver);
    javaClassObjectResolver.setTrace(bindingTrace);

    javaSupertypeResolver.setClassResolver(javaClassResolver);
    javaSupertypeResolver.setSemanticServices(javaSemanticServices);
    javaSupertypeResolver.setTrace(bindingTrace);
    javaSupertypeResolver.setTypeTransformer(javaTypeTransformer);

    javaNamespaceResolver.setJavaSemanticServices(javaSemanticServices);
    javaNamespaceResolver.setPsiClassFinder(psiClassFinder);
    javaNamespaceResolver.setTrace(bindingTrace);

    javaSignatureResolver.setJavaSemanticServices(javaSemanticServices);

    javaConstructorResolver.setTrace(bindingTrace);
    javaConstructorResolver.setTypeTransformer(javaTypeTransformer);
    javaConstructorResolver.setValueParameterResolver(javaValueParameterResolver);

    javaValueParameterResolver.setTypeTransformer(javaTypeTransformer);

    javaFunctionResolver.setAnnotationResolver(javaAnnotationResolver);
    javaFunctionResolver.setParameterResolver(javaValueParameterResolver);
    javaFunctionResolver.setSignatureResolver(javaSignatureResolver);
    javaFunctionResolver.setTrace(bindingTrace);
    javaFunctionResolver.setTypeTransformer(javaTypeTransformer);

    javaInnerClassResolver.setClassResolver(javaClassResolver);

    javaPropertyResolver.setAnnotationResolver(javaAnnotationResolver);
    javaPropertyResolver.setJavaSignatureResolver(javaSignatureResolver);
    javaPropertyResolver.setSemanticServices(javaSemanticServices);
    javaPropertyResolver.setTrace(bindingTrace);

    psiClassFinder.initialize();
  }