Rain: added parsing support for time

This commit is contained in:
Neil Brown 2007-09-19 12:04:11 +00:00
parent ae262125da
commit 1f298a8ff6
2 changed files with 4 additions and 2 deletions

View File

@ -40,11 +40,11 @@ $hexDigit = [0-9 a-f A-F]
| ".."
| "process" | "function"
| "pareach" | "seqeach" | "par" | "seq"
| "run" | "return"
| "run" | "return" | "now"
| "if" | "while" | "else"
| "sint8" | "sint16" | "sint32" | "sint64"
| "uint8" | "uint16" | "uint32" | "uint64"
| "int" | "bool" | "channel"
| "int" | "bool" | "time" | "channel"
| "true" | "false"

View File

@ -155,6 +155,7 @@ dataType
<|> do {reserved "sint16" ; return A.Int16}
<|> do {reserved "sint32" ; return A.Int32}
<|> do {reserved "sint64" ; return A.Int64}
<|> do {reserved "time" ; return A.Time}
<|> do {sChannel ; inner <- dataType ; return $ A.Chan A.DirUnknown (A.ChanAttributes {A.caWritingShared = False, A.caReadingShared = False}) inner}
<|> do {sIn ; inner <- dataType ; return $ A.Chan A.DirInput (A.ChanAttributes {A.caWritingShared = False, A.caReadingShared = False}) inner}
<|> do {sOut ; inner <- dataType ; return $ A.Chan A.DirOutput (A.ChanAttributes {A.caWritingShared = False, A.caReadingShared = False}) inner}
@ -337,6 +338,7 @@ statement
<|> block
<|> each
<|> runProcess
<|> do {m <- reserved "now" ; dest <- lvalue ; sSemiColon ; return $ A.GetTime m dest}
<|> try comm
<|> try (do { lv <- lvalue ; op <- assignOp ; exp <- expression ; sSemiColon ;
case op of