Skip to content

Commit

Permalink
Cleanup to divide project
Browse files Browse the repository at this point in the history
  • Loading branch information
marad committed Nov 15, 2023
1 parent d93f2df commit e23a4cf
Show file tree
Hide file tree
Showing 49 changed files with 115 additions and 61 deletions.
4 changes: 2 additions & 2 deletions build_native.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ REM %GRAALVM_HOME%\bin\native-image -H:+ReportUnsupportedElementsAtRuntime --mac
REM call gradlew.bat clean chi-launcher:shadowJar
call gradlew.bat chi-launcher:shadowJar
%GRAALVM_HOME%\bin\native-image ^
-H:+UnlockExperimentalVMOptions ^
-H:+ReportUnsupportedElementsAtRuntime ^
-H:ReflectionConfigurationFiles=native/reflectionconfig.json ^
-H:DynamicProxyConfigurationFiles=native/proxyconfig.json ^
--macro:truffle ^
--language:nfi ^
--macro:truffle-svm ^
--no-fallback ^
--enable-http ^
--enable-https ^
Expand Down
24 changes: 19 additions & 5 deletions chi-compiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@ plugins {
id 'application'
id 'distribution'
id 'antlr'
id 'maven-publish'
}

group 'gh.marad.chi.core'
group 'gh.marad.chi'
version '1.0'

publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}

application {
mainClass = 'gh.marad.chi.MainKt'
}
Expand All @@ -17,7 +26,7 @@ repositories {
}

dependencies {
antlr "org.antlr:antlr4:4.9.3"
antlr "org.antlr:antlr4:4.12.0"
implementation 'org.jgrapht:jgrapht-core:1.5.1'
testImplementation 'io.kotest:kotest-runner-junit5:5.0.0.M3'
testImplementation("org.junit.jupiter:junit-jupiter")
Expand All @@ -28,14 +37,19 @@ test {
}

generateGrammarSource {
arguments += ["-visitor", "-no-listener"]
arguments += ["-visitor", "-no-listener", "-package", "gh.marad.chi.core.antlr"]
outputDirectory = new File("src/main/java/gh/marad/chi/core/antlr")
}

compileKotlin {
dependsOn tasks.named("generateGrammarSource")
compileJava {
targetCompatibility = JavaVersion.VERSION_17
}

compileKotlin {
dependsOn(generateGrammarSource)
targetCompatibility = JavaVersion.VERSION_17
}

compileTestKotlin {
dependsOn(generateTestGrammarSource)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package gh.marad.chi.core

import ChiLexer
import gh.marad.chi.core.analyzer.CodePoint
import gh.marad.chi.core.analyzer.InvalidImport
import gh.marad.chi.core.analyzer.Message
import gh.marad.chi.core.analyzer.SyntaxError
import gh.marad.chi.core.antlr.ChiLexer
import org.antlr.v4.runtime.BaseErrorListener
import org.antlr.v4.runtime.IntStream
import org.antlr.v4.runtime.RecognitionException
Expand Down
4 changes: 2 additions & 2 deletions chi-compiler/src/main/kotlin/gh/marad/chi/core/Parser.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package gh.marad.chi.core

import ChiLexer
import ChiParser
import gh.marad.chi.core.analyzer.Message
import gh.marad.chi.core.antlr.ChiLexer
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.expressionast.generateExpressionsFromParsedProgram
import gh.marad.chi.core.namespace.GlobalCompilationNamespace
import gh.marad.chi.core.parser.ChiSource
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gh.marad.chi.core.parser

import ChiParser
import ChiParserBaseVisitor
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.antlr.ChiParserBaseVisitor
import gh.marad.chi.core.parser.readers.*
import org.antlr.v4.runtime.tree.TerminalNode

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package gh.marad.chi.core.parser.readers

import ChiLexer
import ChiParser
import ChiParser.StringPartContext
import gh.marad.chi.core.antlr.ChiLexer
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down Expand Up @@ -37,7 +36,7 @@ internal object AtomReader {
val parts = mutableListOf<StringPart>()
var currentSection: ChiSource.Section? = null

fun updateSection(ctx: StringPartContext) {
fun updateSection(ctx: ChiParser.StringPartContext) {
val lastSection = currentSection
val section = getSection(source, ctx)
currentSection =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.getSection
import gh.marad.chi.core.parser.readers.CommonReader.readModuleName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.getSection

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gh.marad.chi.core.parser.readers

import ChiParser
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import gh.marad.chi.core.parser.getSection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gh.marad.chi.core.parser

import ChiLexer
import ChiParser
import gh.marad.chi.core.antlr.ChiLexer
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.readers.*
import io.kotest.matchers.shouldBe
import io.kotest.matchers.types.shouldBeTypeOf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gh.marad.chi.core.parser.readers

import ChiLexer
import ChiParser
import gh.marad.chi.core.antlr.ChiLexer
import gh.marad.chi.core.antlr.ChiParser
import gh.marad.chi.core.parser.ChiSource
import gh.marad.chi.core.parser.ParserVisitor
import io.kotest.matchers.collections.shouldBeEmpty
Expand Down
3 changes: 2 additions & 1 deletion chi-launcher/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ applicationDefaultJvmArgs = ["-Dgraalvm.locatorDisabled=true"]

dependencies {
implementation project(':chi-truffle-language')
implementation 'org.graalvm.tools:profiler:22.1.0'
// implementation 'org.graalvm.truffle:truffle-api:'
implementation 'org.graalvm.tools:profiler:23.0.2'
implementation 'org.pcollections:pcollections:4.0.1'
}

Expand Down
10 changes: 5 additions & 5 deletions chi-truffle-language/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ version '1.0'

dependencies {
implementation project(':chi-compiler')
implementation 'org.graalvm.sdk:graal-sdk:22.1.0'
implementation 'org.graalvm.truffle:truffle-api:22.1.0'
annotationProcessor 'org.graalvm.truffle:truffle-dsl-processor:22.1.0'
testAnnotationProcessor 'org.graalvm.truffle:truffle-dsl-processor:22.1.0'
//implementation 'org.graalvm.sdk:graal-sdk:23.1.1'
implementation 'org.graalvm.truffle:truffle-api:23.1.1'
annotationProcessor 'org.graalvm.truffle:truffle-dsl-processor:23.1.1'
testAnnotationProcessor 'org.graalvm.truffle:truffle-dsl-processor:23.1.1'
testImplementation 'junit:junit:4.13.2'
implementation 'org.graalvm.tools:profiler:22.1.0'
implementation 'org.graalvm.tools:profiler:23.0.1'

}

Expand Down
Loading

0 comments on commit e23a4cf

Please sign in to comment.