Skip to content

Commit

Permalink
still wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mio-19 committed Oct 25, 2024
1 parent e97cb48 commit 295dd1d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
8 changes: 7 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
19 changes: 19 additions & 0 deletions interpreter/jvm/src/main/scala/chester/truffle/ChesterLang.java
Original file line number Diff line number Diff line change
@@ -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<ChesterContext> {
@Override
protected CallTarget parse(ParsingRequest request) throws Exception {
throw new UnsupportedOperationException("Not implemented yet");
}

@Override
protected ChesterContext createContext(Env env) {
return null;
}
}
10 changes: 0 additions & 10 deletions interpreter/jvm/src/main/scala/chester/truffle/index.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 295dd1d

Please sign in to comment.