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

chapi.app.analyser.ScalaAnalyserApp.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.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()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy