aboutsummaryrefslogtreecommitdiff
path: root/Smurf.dcl
diff options
context:
space:
mode:
Diffstat (limited to 'Smurf.dcl')
-rw-r--r--Smurf.dcl28
1 files changed, 28 insertions, 0 deletions
diff --git a/Smurf.dcl b/Smurf.dcl
new file mode 100644
index 0000000..c4f1c45
--- /dev/null
+++ b/Smurf.dcl
@@ -0,0 +1,28 @@
+definition module Smurf
+
+from StdOverloaded import class zero, class toString
+
+from Data.Maybe import ::Maybe
+
+:: Stm = Push String
+ | Input | Output
+ | Cat | Head | Tail | Quotify
+ | Put | Get | Exec
+
+:: Program :== [Stm]
+
+:: Stack :== [String]
+:: Store :== [(String, String)]
+
+:: State = { stack :: Stack
+ , store :: Store
+ }
+
+instance toString Stm
+
+instance zero State
+instance toString State
+
+step :: !Program State !*File -> *(Maybe (!Program, State), *File)
+run :: !Program State *File -> *(Maybe State, *File)
+