aboutsummaryrefslogtreecommitdiff
path: root/Smurf.dcl
blob: 7d75a6d99d3243c0ebe1780a592bc94465750c05 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
definition module Smurf

from StdOverloaded import
	class zero,
	class toString,
	class toChar, class fromChar,
	class ==

from GenEq import generic gEq

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
           }

derive gEq Stm

instance == Stm
instance toString Stm
instance toChar Stm
instance fromChar Stm

instance zero State
instance toString State

step :: !Program State !*File -> *(Maybe (!Program, State), *File)
run :: !Program State *File -> *(Maybe State, *File)