X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=mTaskInterpret.dcl;h=a7b463dcde69a02300a40cf3622d770dfaf141ba;hb=8bd3b26a870ee17a687c54e5e7b6d4c1c7bf808a;hp=885d52e8b3cf857d53dfdc774bf40e386a488761;hpb=48dfd7ad2f104321657a3ea44d33340761c95c2e;p=mTask.git diff --git a/mTaskInterpret.dcl b/mTaskInterpret.dcl index 885d52e..a7b463d 100644 --- a/mTaskInterpret.dcl +++ b/mTaskInterpret.dcl @@ -6,8 +6,9 @@ import mTask :: BC = BCNop - | BCPush String + | BCPush Int | BCPop + | BCSds Int //Unary ops | BCNot //Binary Int ops @@ -28,6 +29,18 @@ import mTask | BCJmp Int | BCJmpT Int | BCJmpF Int + //Serial + | BCSerialAvail + | BCSerialPrint + | BCSerialPrintln + | BCSerialRead + | BCSerialParseInt + //Pins + | BCAnalogRead Pin + | BCAnalogWrite Pin + | BCDigitalRead Pin + | BCDigitalWrite Pin + | BCTest AnalogPin //:: ByteCode a p = BC (BCState -> ([BC], BCState)) :: ByteCode a p = BC [BC] @@ -36,7 +49,15 @@ import mTask a::() } -toByteVal :: BC -> String +class toByteCode a :: a -> [Char] +instance toByteCode Int +instance toByteCode Bool +instance toByteCode Char +instance toByteCode String +instance toByteCode Long +instance toByteCode Button + +toByteVal :: BC -> [Char] toReadableByteVal :: BC -> String //instance toCode Pin