diff --git a/README.md b/README.md index 5f442ae..ecbcb43 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,22 @@ minimal object-oriented language with integrated semantic state access. The interpreter can be used to examine the state with SPARQL, SHACL and OWL queries. +The language is in development, for a general description, examples and tutorial to SMOL, we refer to [its webpage](https://www.smolang.org). -This branch in particular contains the case study for modeling geological processes. -To run the experiment contained in the article _"Semantically Triggered Qualitative Simulation of a Geological Process"_, run the following commands (tested on a Linux machine) +To compile and run the SMOL REPL, run ``` -chmod +x ./execute_case.sh -./execute_case.sh +./gradlew build +java -jar build/libs/smol.jar --help ``` -For a general description and tutorial to SMOL, we refer to [its webpage](www.smolang.org). \ No newline at end of file +To run the SMOL REPL pre-compiled using docker, run the following command: +``` +docker run -it --rm -v "$PWD":/root/smol ghcr.io/smolang/smol:latest +``` + +To compile and run the SMOL REPL inside docker, run the following commands: +``` +docker build -t smol . +docker run -it --rm -v "$PWD":/root/smol smol +``` \ No newline at end of file diff --git a/build.gradle b/build.gradle index 0bd87f3..4a63142 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { } group = 'org.smolang' -version = '0.3' +version = '0.4' java { toolchain { diff --git a/src/main/kotlin/no/uio/microobject/type/TypeChecker.kt b/src/main/kotlin/no/uio/microobject/type/TypeChecker.kt index ac03be4..f7beb3b 100644 --- a/src/main/kotlin/no/uio/microobject/type/TypeChecker.kt +++ b/src/main/kotlin/no/uio/microobject/type/TypeChecker.kt @@ -1,7 +1,6 @@ package no.uio.microobject.type import no.uio.microobject.antlr.WhileParser -import no.uio.microobject.ast.expr.Conversion import no.uio.microobject.data.TripleManager import no.uio.microobject.main.Settings import no.uio.microobject.runtime.FieldInfo @@ -30,7 +29,7 @@ class TypeChecker(private val ctx: WhileParser.ProgramContext, private val setti Handling type data structures ***********************************************************************/ //translates a string text to a type, even accessed within class createClass (needed to determine generics) - private fun stringToType(text: String, createClass: String, generics : MutableMap>) : Type { + private fun stringToType(text: String, generics : MutableMap>) : Type { return when { //generics.getOrDefault(createClass, listOf()).contains(text) -> GenericType(text) generics.values.flatten().contains(text) -> GenericType(text) @@ -46,9 +45,9 @@ class TypeChecker(private val ctx: WhileParser.ProgramContext, private val setti //translates a type AST text to a type, even accessed within class createClass (needed to determine generics) fun translateType(ctx : WhileParser.TypeContext, className : String, generics : MutableMap>) : Type { return when(ctx){ - is WhileParser.Simple_typeContext -> stringToType(ctx.text, className, generics) + is WhileParser.Simple_typeContext -> stringToType(ctx.text, generics) is WhileParser.Nested_typeContext -> { - val lead = stringToType(ctx.NAME().text, className, generics) + val lead = stringToType(ctx.NAME().text, generics) ComposedType(lead, ctx.typelist().type().map { translateType(it, className, generics) }) } is WhileParser.Fmu_typeContext -> {