Commit 2d44c866 authored by Sapphie's avatar Sapphie
Browse files

Implement literal transforming

parent 8ae06c27
package l3
import l3.{ L3Primitive => L3 }
import l3.{ SymbolicCL3TreeModule => S}
import l3.{ SymbolicCPSTreeModule => C}
object CL3ToCPSTranslator extends (Any => Nothing) {
def apply(tree: Any): Nothing =
???
object CL3ToCPSTranslator extends (S.Tree => C.Tree) {
def apply(tree: S.Tree): C.Tree = transform(tree)(_ =>
C.Halt(C.AtomL(IntLit(L3Int(0))))
)
def transform(tree: S.Tree)(ctx: C.Atom => C.Tree): C.Tree = {
tree match {
case S.Lit(v) => ctx(C.AtomL(v))
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment