All Downloads are FREE. Search and download functionalities are using the official Maven repository.

chapi.app.analyser.ChapiAnalyser.kt Maven / Gradle / Ivy

Go to download

Chapi is A common language meta information convertor, convert different languages to same meta-data model

There is a newer version: 1.5.10
Show newest version
package chapi.app.analyser

import chapi.app.analyser.config.ChapiConfig
import chapi.app.analyser.config.Language
import chapi.app.analyser.support.BaseAnalyser
import chapi.domain.core.CodeDataStruct

open class ChapiAnalyser(var config: ChapiConfig = ChapiConfig()) {
    open fun analysis(path: String): Array {
        val appAnalyser = getAnalyserByLang(config.language)
        return appAnalyser.analysisNodeByPath(path)
    }

    open fun getAnalyserByLang(lang: String): BaseAnalyser {
        return when (lang) {
            Language.JAVA -> JavaAnalyserApp(config)
            Language.Golang -> GoAnalyserApp(config)
            Language.Python -> PythonAnalyserApp(config)
            Language.TypeScript -> TypeScriptAnalyserApp(config)
            Language.Scala -> ScalaAnalyserApp(config)
            Language.KOTLIN -> KotlinAnalyserApp(config)
            Language.CSharpStr,
            Language.CSharp -> CSharpAnalyserApp(config)
            else -> JavaAnalyserApp(config)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy