Codegen: Rename classes
This commit is contained in:
parent
15de70e9b1
commit
04eeede1f0
@ -1,6 +1,6 @@
|
||||
package io.neoterm.component.codegen
|
||||
|
||||
import io.neoterm.component.codegen.interfaces.ICodeGenerator
|
||||
import io.neoterm.component.codegen.interfaces.CodeGenerator
|
||||
import io.neoterm.component.codegen.interfaces.CodeGenObject
|
||||
import io.neoterm.frontend.component.NeoComponent
|
||||
|
||||
@ -17,7 +17,7 @@ class CodeGenComponent : NeoComponent {
|
||||
override fun onServiceObtained() {
|
||||
}
|
||||
|
||||
fun newGenerator(codeObject: CodeGenObject): ICodeGenerator {
|
||||
fun newGenerator(codeObject: CodeGenObject): CodeGenerator {
|
||||
val parameter = CodeGenParameter()
|
||||
return codeObject.getCodeGenerator(parameter)
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package io.neoterm.component.codegen.generators
|
||||
|
||||
import io.neoterm.component.codegen.CodeGenParameter
|
||||
import io.neoterm.component.codegen.interfaces.ICodeGenerator
|
||||
import io.neoterm.component.codegen.interfaces.CodeGenerator
|
||||
import io.neoterm.component.codegen.interfaces.CodeGenObject
|
||||
import io.neoterm.component.colorscheme.NeoColorScheme
|
||||
import io.neoterm.component.config.ConfigureComponent
|
||||
@ -10,7 +10,7 @@ import io.neoterm.frontend.component.ComponentManager
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
class NeoColorGenerator(parameter: CodeGenParameter) : ICodeGenerator(parameter) {
|
||||
class NeoColorGenerator(parameter: CodeGenParameter) : CodeGenerator(parameter) {
|
||||
override fun getGeneratorName(): String {
|
||||
return "NeoColorScheme-Generator"
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
package io.neoterm.component.codegen.generators
|
||||
|
||||
import io.neoterm.component.codegen.CodeGenParameter
|
||||
import io.neoterm.component.codegen.interfaces.ICodeGenerator
|
||||
import io.neoterm.component.codegen.interfaces.CodeGenerator
|
||||
import io.neoterm.component.codegen.interfaces.CodeGenObject
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
class NeoProfileGenerator(parameter: CodeGenParameter) : ICodeGenerator(parameter) {
|
||||
class NeoProfileGenerator(parameter: CodeGenParameter) : CodeGenerator(parameter) {
|
||||
override fun getGeneratorName(): String {
|
||||
return "NeoProfile-Generator"
|
||||
}
|
||||
|
@ -1,11 +1,10 @@
|
||||
package io.neoterm.component.codegen.interfaces
|
||||
|
||||
import io.neoterm.component.codegen.CodeGenParameter
|
||||
import io.neoterm.component.codegen.interfaces.ICodeGenerator
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
interface CodeGenObject {
|
||||
fun getCodeGenerator(parameter: CodeGenParameter): ICodeGenerator
|
||||
fun getCodeGenerator(parameter: CodeGenParameter): CodeGenerator
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
package io.neoterm.component.codegen.interfaces
|
||||
|
||||
import io.neoterm.component.codegen.CodeGenParameter
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
abstract class ICodeGenerator(parameter: CodeGenParameter) {
|
||||
abstract fun getGeneratorName(): String
|
||||
|
||||
abstract fun generateCode(codeGenObject: CodeGenObject): String
|
||||
}
|
@ -4,7 +4,7 @@ import io.neolang.visitor.ConfigVisitor
|
||||
import io.neoterm.backend.TerminalColorScheme
|
||||
import io.neoterm.backend.TerminalColors
|
||||
import io.neoterm.component.codegen.CodeGenParameter
|
||||
import io.neoterm.component.codegen.interfaces.ICodeGenerator
|
||||
import io.neoterm.component.codegen.interfaces.CodeGenerator
|
||||
import io.neoterm.component.codegen.interfaces.CodeGenObject
|
||||
import io.neoterm.component.codegen.generators.NeoColorGenerator
|
||||
import io.neoterm.component.config.ConfigureComponent
|
||||
@ -156,7 +156,7 @@ open class NeoColorScheme : CodeGenObject, ConfigFileBasedObject {
|
||||
}
|
||||
}
|
||||
|
||||
override fun getCodeGenerator(parameter: CodeGenParameter): ICodeGenerator {
|
||||
override fun getCodeGenerator(parameter: CodeGenParameter): CodeGenerator {
|
||||
return NeoColorGenerator(parameter)
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package io.neoterm.component.profile
|
||||
|
||||
import io.neoterm.component.codegen.CodeGenParameter
|
||||
import io.neoterm.component.codegen.interfaces.ICodeGenerator
|
||||
import io.neoterm.component.codegen.interfaces.CodeGenerator
|
||||
import io.neoterm.component.codegen.generators.NeoProfileGenerator
|
||||
import io.neoterm.component.codegen.interfaces.CodeGenObject
|
||||
import io.neoterm.frontend.component.helper.ConfigFileBasedObject
|
||||
@ -12,7 +12,7 @@ import io.neoterm.frontend.component.helper.ConfigFileBasedObject
|
||||
abstract class NeoProfile : CodeGenObject, ConfigFileBasedObject {
|
||||
abstract val profileMetaName: String
|
||||
|
||||
override fun getCodeGenerator(parameter: CodeGenParameter): ICodeGenerator {
|
||||
override fun getCodeGenerator(parameter: CodeGenParameter): CodeGenerator {
|
||||
return NeoProfileGenerator(parameter)
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user