Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- assignStmt = do
- s <- identifier
- symbol "="
- e <- expr
- symbol ";"
- return $ Assign s e
- ifStmt = do
- keyword "if"
- cond <- (expr)
- s1 <- stmt
- keyword "else"
- s2 <- stmt
- return $ If cond s1 s2
- whileStmt = do
- keyword "while"
- cond <- (expr)
- s <- stmt
- return $ While cond s
- blockStmt = do
- symbol "{"
- stmts <- many stmt
- symbol "}"
- return $ Block stmts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement