X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=mTaskInterpret.dcl;h=0939ab45a7c1b15cf042ffdeb2a5e4faf4ce0a8c;hb=73d6866bdbab8f393b53c9951b05b62005a5423a;hp=00488591cd8620d97ca29995eda4d516f62544cf;hpb=2936e3ba44acd430c2b3290801ab1ffa700a8c25;p=mTask.git diff --git a/mTaskInterpret.dcl b/mTaskInterpret.dcl index 0048859..0939ab4 100644 --- a/mTaskInterpret.dcl +++ b/mTaskInterpret.dcl @@ -6,8 +6,12 @@ import mTask :: BC = BCNop - | BCPush String + | BCPush Int | BCPop + //SDS functions + | BCSdsStore Int + | BCSdsFetch Int + | BCSdsPublish Int //Unary ops | BCNot //Binary Int ops @@ -35,10 +39,11 @@ import mTask | BCSerialRead | BCSerialParseInt //Pins - | BCAnalogRead String - | BCAnalogWrite String - | BCDigitalRead String - | BCDigitalWrite String + | BCAnalogRead Pin + | BCAnalogWrite Pin + | BCDigitalRead Pin + | BCDigitalWrite Pin + | BCTest AnalogPin //:: ByteCode a p = BC (BCState -> ([BC], BCState)) :: ByteCode a p = BC [BC] @@ -47,7 +52,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