infrastructuur voor het lezen van taken
[mTask.git] / mTaskInterpret.dcl
index 557225f..53bb69b 100644 (file)
@@ -1,21 +1,49 @@
 definition module mTaskInterpret
 
+from Data.Functor.Identity import :: Identity
+from Control.Monad.State import :: State, :: StateT
 import mTask
 
 :: BC
        = BCNop
-       | BCPush Int
+       | BCPush String
        | BCPop
        //Unary ops
-       | BCNeg
        | BCNot
        //Binary Int ops
        | BCAdd
        | BCSub
        | BCMul
        | BCDiv
+       //Binary Bool ops
+       | BCAnd
+       | BCOr
+       | BCEq
+       | BCNeq
+       | BCLes
+       | BCGre
+       | BCLeq
+       | BCGeq
+       //Conditionals and jumping
+       | BCJmp Int
+       | BCJmpT Int
+       | BCJmpF Int
+       //Serial
+       | BCSerialAvail
+       | BCSerialPrint
+       | BCSerialPrintln
+       | BCSerialRead
+       | BCSerialParseInt
+       //Pins
+       | BCAnalogRead String
+       | BCAnalogWrite String
+       | BCDigitalRead String
+       | BCDigitalWrite String
+       | BCTest AnalogPin
 
-:: ByteCode a p = BC ((ReadWrite a) BCState -> ([BC], BCState))
+//:: ByteCode a p = BC (BCState -> ([BC], BCState))
+:: ByteCode a p = BC [BC]
+//:: ByteCode a p = BC ((ReadWrite (ByteCode a Expr)) BCState -> ([BC], BCState))
 :: BCState = {
                a::()
        }