mirror of
https://github.com/irmen/prog8.git
synced 2024-09-10 09:54:32 +00:00
reducing dependencies
This commit is contained in:
parent
1e1d1efd90
commit
844ad09464
@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -25,7 +25,6 @@ compileTestKotlin {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':compilerInterfaces')
|
implementation project(':compilerInterfaces')
|
||||||
implementation project(':compilerAst')
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||||
// implementation "org.jetbrains.kotlin:kotlin-reflect"
|
// implementation "org.jetbrains.kotlin:kotlin-reflect"
|
||||||
implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.14"
|
implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.14"
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||||
<orderEntry type="module" module-name="compilerAst" />
|
|
||||||
<orderEntry type="module" module-name="compilerInterfaces" />
|
<orderEntry type="module" module-name="compilerInterfaces" />
|
||||||
<orderEntry type="library" name="michael.bull.kotlin.result.jvm" level="project" />
|
<orderEntry type="library" name="michael.bull.kotlin.result.jvm" level="project" />
|
||||||
</component>
|
</component>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package prog8.codegen.experimental6502
|
package prog8.codegen.experimental6502
|
||||||
|
|
||||||
import prog8.ast.Program
|
|
||||||
import prog8.compilerinterface.*
|
import prog8.compilerinterface.*
|
||||||
|
import prog8.compilerinterface.intermediate.PtProgram
|
||||||
|
|
||||||
class AsmGen(internal val program: Program,
|
class AsmGen(internal val program: PtProgram,
|
||||||
internal val errors: IErrorReporter,
|
internal val errors: IErrorReporter,
|
||||||
internal val symbolTable: SymbolTable,
|
internal val symbolTable: SymbolTable,
|
||||||
internal val options: CompilationOptions): IAssemblyGenerator {
|
internal val options: CompilationOptions): IAssemblyGenerator {
|
||||||
@ -14,10 +14,7 @@ class AsmGen(internal val program: Program,
|
|||||||
|
|
||||||
symbolTable.print()
|
symbolTable.print()
|
||||||
symbolTable.flat.forEach { println(it) }
|
symbolTable.flat.forEach { println(it) }
|
||||||
|
program.print()
|
||||||
// TODO temporary location to do this:
|
|
||||||
val intermediateAst = IntermediateAstMaker(program).transform()
|
|
||||||
intermediateAst.print()
|
|
||||||
|
|
||||||
println("..todo: create assembly code into ${options.outputDir.toAbsolutePath()}..")
|
println("..todo: create assembly code into ${options.outputDir.toAbsolutePath()}..")
|
||||||
return AssemblyProgram("dummy")
|
return AssemblyProgram("dummy")
|
||||||
|
@ -398,8 +398,12 @@ internal fun asmGeneratorFor(program: Program,
|
|||||||
options: CompilationOptions): IAssemblyGenerator
|
options: CompilationOptions): IAssemblyGenerator
|
||||||
{
|
{
|
||||||
if(options.experimentalCodegen) {
|
if(options.experimentalCodegen) {
|
||||||
if (options.compTarget.machine.cpu in arrayOf(CpuType.CPU6502, CpuType.CPU65c02))
|
if (options.compTarget.machine.cpu in arrayOf(CpuType.CPU6502, CpuType.CPU65c02)) {
|
||||||
return prog8.codegen.experimental6502.AsmGen(program, errors, symbolTable, options)
|
|
||||||
|
// TODO for now, only use the new Intermediary Ast for this experimental codegen:
|
||||||
|
val intermediateAst = IntermediateAstMaker(program).transform()
|
||||||
|
return prog8.codegen.experimental6502.AsmGen(intermediateAst, errors, symbolTable, options)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (options.compTarget.machine.cpu in arrayOf(CpuType.CPU6502, CpuType.CPU65c02))
|
if (options.compTarget.machine.cpu in arrayOf(CpuType.CPU6502, CpuType.CPU65c02))
|
||||||
return prog8.codegen.cpu6502.AsmGen(program, errors, symbolTable, options)
|
return prog8.codegen.cpu6502.AsmGen(program, errors, symbolTable, options)
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package prog8.codegen.experimental6502
|
package prog8.compiler
|
||||||
|
|
||||||
import prog8.ast.Module
|
|
||||||
import prog8.ast.Program
|
import prog8.ast.Program
|
||||||
|
import prog8.ast.Module
|
||||||
import prog8.ast.base.FatalAstException
|
import prog8.ast.base.FatalAstException
|
||||||
import prog8.ast.expressions.*
|
|
||||||
import prog8.ast.statements.*
|
import prog8.ast.statements.*
|
||||||
|
import prog8.ast.expressions.*
|
||||||
import prog8.compilerinterface.VarDeclType
|
import prog8.compilerinterface.VarDeclType
|
||||||
import prog8.compilerinterface.intermediate.*
|
import prog8.compilerinterface.intermediate.*
|
||||||
|
|
@ -4,8 +4,8 @@ import io.kotest.assertions.fail
|
|||||||
import io.kotest.core.spec.style.FunSpec
|
import io.kotest.core.spec.style.FunSpec
|
||||||
import io.kotest.matchers.ints.shouldBeGreaterThan
|
import io.kotest.matchers.ints.shouldBeGreaterThan
|
||||||
import io.kotest.matchers.shouldBe
|
import io.kotest.matchers.shouldBe
|
||||||
import prog8.codegen.experimental6502.IntermediateAstMaker
|
|
||||||
import prog8.codegen.target.C64Target
|
import prog8.codegen.target.C64Target
|
||||||
|
import prog8.compiler.IntermediateAstMaker
|
||||||
import prog8.compilerinterface.intermediate.PtVariable
|
import prog8.compilerinterface.intermediate.PtVariable
|
||||||
import prog8tests.helpers.compileText
|
import prog8tests.helpers.compileText
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user