add conses, add if, some examples
[mTask.git] / mTaskInterpret.dcl
index 32e7b9b..0048859 100644 (file)
@@ -9,15 +9,40 @@ import mTask
        | 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
 
-:: ByteCode a p = BC ((ReadWrite (ByteCode a Expr)) 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::()
        }