summaryrefslogtreecommitdiffstats
path: root/syntax.sml
diff options
context:
space:
mode:
Diffstat (limited to 'syntax.sml')
-rw-r--r--syntax.sml10
1 files changed, 10 insertions, 0 deletions
diff --git a/syntax.sml b/syntax.sml
index 2e2cc11..5ed5954 100644
--- a/syntax.sml
+++ b/syntax.sml
@@ -125,4 +125,14 @@ struct
end
val cexpToString : cexp -> string = cexpToStringI ""
+
+ fun opcodeToString (oper : opcode) : string =
+ case oper of
+ OAlloc (r, s) => "OAlloc (" ^ Int.toString r ^ ", " ^ valueToString s ^ ")"
+ | OCall => "OCall"
+ | OPoke (i, p, v) => "OPoke (" ^ Int.toString i ^ ", " ^ Int.toString p ^ ", " ^ valueToString v ^ ")"
+ | OPeek (r, i, p) => "OPeek (" ^ Int.toString r ^ ", " ^ Int.toString i ^ ", " ^ valueToString p ^ ")"
+ | OShuf (d, s) => "OShuf (" ^ Int.toString d ^ ", " ^ valueToString s ^ ")"
+ | OExit v => "OExit " ^ valueToString v
+ | OLabel l => "OLabel " ^ Int.toString l
end