repositories
/
mTask.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changed mTaskInterpret to output a real task
[mTask.git]
/
mTaskInterpret.dcl
diff --git
a/mTaskInterpret.dcl
b/mTaskInterpret.dcl
index
32e7b9b
..
2648cb9
100644
(file)
--- a/
mTaskInterpret.dcl
+++ b/
mTaskInterpret.dcl
@@
-6,23
+6,49
@@
import mTask
:: BC
= BCNop
:: BC
= BCNop
- | BCPush
String
+ | BCPush
Int
| BCPop
//Unary ops
| BCPop
//Unary ops
- | BCNeg
| BCNot
//Binary Int ops
| BCAdd
| BCSub
| BCMul
| BCDiv
| 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 Pin
+ | BCAnalogWrite Pin
+ | BCDigitalRead Pin
+ | BCDigitalWrite Pin
+ | BCTest AnalogPin
-:: 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::()
}
:: BCState = {
a::()
}
-toByteVal :: BC ->
String
+toByteVal :: BC ->
[Char]
toReadableByteVal :: BC -> String
//instance toCode Pin
toReadableByteVal :: BC -> String
//instance toCode Pin