1 definition module mTaskInterpret
5 from Data.Functor.Identity import :: Identity
6 from Control.Monad.State import :: State, :: StateT
7 from Control.Monad.RWST import :: RWST, :: RWS
8 from Data.Either import :: Either
9 from iTasks._Framework.Generic.Defaults import generic gDefault
10 from GenPrint import generic gPrint
11 from Generics.gCons import class gCons, generic conses, generic consName, generic consIndex, generic consNum
20 | MTDevSpec MTaskDeviceSpec
24 = MTTask MTaskInterval String
38 ,maxTask :: Int //Should be number of bytes reserved in total for shares, tasks and functions
42 :: BCValue = E.e: BCValue e & mTaskType e
44 instance toString MTaskInterval
45 instance toString MTaskMSGRecv
46 instance toString MTaskMSGSend
47 encode :: MTaskMSGSend -> String
48 decode :: String -> MTaskMSGRecv
76 //Conditionals and jumping
96 derive gPrint BCValue, MTaskDeviceSpec
97 derive consIndex BCValue
98 derive consName BCValue
100 derive consNum BCValue
102 derive class gCons Long, UserLED, Button, AnalogPin, DigitalPin, PinMode, Pin
103 derive class iTask UserLED, Long, Pin, Button, AnalogPin, DigitalPin, PinMode, MTaskDeviceSpec
104 derive gEditor BCValue
106 derive JSONEncode BCValue
107 derive JSONDecode BCValue
108 derive gDefault BCValue
111 :: ByteCode a p = BC (RWS () [BC] BCState ())
124 instance zero BCState
126 class toByteCode a :: a -> String
127 class fromByteCode a :: String -> a
128 class mTaskType a | toByteCode, fromByteCode, iTask, TC a
130 instance toByteCode Int, Bool, Char, Long, String, Button, UserLED, BCValue
131 instance fromByteCode Int, Bool, Char, Long, String, Button, UserLED, BCValue
132 instance toByteCode MTaskInterval
133 instance fromByteCode MTaskInterval, MTaskDeviceSpec
135 instance arith ByteCode
136 instance boolExpr ByteCode
137 instance analogIO ByteCode
138 instance digitalIO ByteCode
139 instance userLed ByteCode
140 instance If ByteCode Stmt Stmt Stmt
141 instance If ByteCode e Stmt Stmt
142 instance If ByteCode Stmt e Stmt
143 instance If ByteCode x y Stmt
145 instance noOp ByteCode
147 instance sds ByteCode
148 instance assign ByteCode
149 instance seq ByteCode
150 instance serial ByteCode
152 toMessages :: MTaskInterval (String, BCState) -> ([MTaskMSGSend], BCState)
153 toSDSUpdate :: Int Int -> [MTaskMSGSend]
155 toByteVal :: BC -> String
156 toReadableByteCode :: (ByteCode a b) BCState -> (String, BCState)
157 toRealByteCode :: (ByteCode a b) BCState -> (String, BCState)