1 implementation module mTaskInterpret
4 import gdynamic, gCons, GenEq, StdMisc, StdArray
12 import Control.Monad.State
13 from Data.Func import $
16 toByteVal :: BC -> String
21 toReadableByteVal :: BC -> String
22 toReadableByteVal a = printToString a
24 //:: ByteCode a p = BC (BCState -> ([BC], BCState))
25 instance arith ByteCode where
26 lit a = BC \_ s->([BCPush $ toCode a], s)
32 instance serial ByteCode where
33 serialAvailable = undef
35 serialPrintln _ = undef
37 serialParseInt = undef
39 instance zero BCState where
42 runByteCode :: (ByteCode Int Expr) BCState -> [BC]
43 runByteCode (BC f) s = fst (f Rd s)
45 //Start :: Main (ByteCode Int Expr)
47 //Start :: ByteCode Int Expr
48 Start = runByteCode (lit 36) zero