diff --git a/build.sbt b/build.sbt index 08729ba5..fbdc08e7 100644 --- a/build.sbt +++ b/build.sbt @@ -1242,13 +1242,19 @@ lazy val interpreter = crossProject(JSPlatform, JVMPlatform, NativePlatform) val cp = (Compile / dependencyClasspath).value.map(_.data) val processorJars = cp.filter(_.getName.contains("truffle-dsl-processor")) val processorPath = processorJars.map(_.getAbsolutePath).mkString(java.io.File.pathSeparator) + val generatedSourcesDir = (Compile / sourceManaged).value / "generated" / "truffle" + println(s"processorJars: $processorJars") + println(s"processorPath: $processorPath") + println(s"generatedSourcesDir: $generatedSourcesDir") Seq( "-processor", "com.oracle.truffle.dsl.processor.TruffleProcessor", "-processorpath", processorPath, + "-s", generatedSourcesDir.getAbsolutePath, "-source", "17", "-target", "17" ) - } + }, + Compile / unmanagedSourceDirectories += (Compile / sourceManaged).value / "generated" / "truffle" ) lazy val root = crossProject(JSPlatform, JVMPlatform, NativePlatform) diff --git a/interpreter/jvm/src/main/scala/chester/truffle/ChesterLang.java b/interpreter/jvm/src/main/scala/chester/truffle/ChesterLang.java new file mode 100644 index 00000000..7057391a --- /dev/null +++ b/interpreter/jvm/src/main/scala/chester/truffle/ChesterLang.java @@ -0,0 +1,19 @@ +package chester.truffle; + +import com.oracle.truffle.api.CallTarget; +import com.oracle.truffle.api.TruffleLanguage; +import com.oracle.truffle.api.TruffleLanguage.Env; +import com.oracle.truffle.api.TruffleLanguage.ParsingRequest; + +@TruffleLanguage.Registration(id = "cst", name = "Chester") +public class ChesterLang extends TruffleLanguage { + @Override + protected CallTarget parse(ParsingRequest request) throws Exception { + throw new UnsupportedOperationException("Not implemented yet"); + } + + @Override + protected ChesterContext createContext(Env env) { + return null; + } +} \ No newline at end of file diff --git a/interpreter/jvm/src/main/scala/chester/truffle/index.scala b/interpreter/jvm/src/main/scala/chester/truffle/index.scala index 157c0014..32cac642 100644 --- a/interpreter/jvm/src/main/scala/chester/truffle/index.scala +++ b/interpreter/jvm/src/main/scala/chester/truffle/index.scala @@ -4,13 +4,3 @@ import com.oracle.truffle.api.{CallTarget, TruffleLanguage} import com.oracle.truffle.api.TruffleLanguage.{Env, ParsingRequest} trait ChesterContext - -@TruffleLanguage.Registration(id = "cst", name = "Chester") -class ChesterLang extends TruffleLanguage[ChesterContext] { - @throws[Exception] - override protected def parse(request: ParsingRequest): CallTarget = { - ??? - } - - override protected def createContext(env: Env): ChesterContext = null -} \ No newline at end of file