chapi.app.analyser.ChapiAnalyser.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chapi-application Show documentation
Show all versions of chapi-application Show documentation
Chapi is A common language meta information convertor, convert different languages to same meta-data model
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)
}
}
}