chapi.app.analyser.ScalaAnalyserApp.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.support.AbstractFile
import chapi.app.analyser.support.BaseAnalyser
import chapi.ast.goast.GoAnalyser
import chapi.ast.scalaast.ScalaAnalyser
import chapi.domain.core.CodeDataStruct
open class ScalaAnalyserApp(config: ChapiConfig) : BaseAnalyser(config) {
override fun analysisByFiles(files: Array): Array {
return files.flatMap(::analysisByFile).toTypedArray()
}
override fun analysisByFile(file: AbstractFile): List {
val codeFile = ScalaAnalyser().analysis(file.content, file.fileName)
return codeFile.DataStructures.map {
it.apply {
it.Imports = codeFile.Imports
it.FilePath = file.absolutePath
}
}.toList()
}
}