,
FunDecl zero "1printbool" ["x"] Nothing [] [
IfStmt (VarExpr zero (VarDef "x" []))
- [FunStmt "1printstr" [strOp2 $ fromString "True"] []]
- [FunStmt "1printstr" [strOp2 $ fromString "False"] []]
- ]]
-
- strOp2 :: [Char] -> Expr
- strOp2 [] = EmptyListExpr zero
- strOp2 [x:xs] = Op2Expr zero (CharExpr zero x) BiCons (strOp2 xs)
+ [FunStmt "1printstr" [makeStrExpr zero $ fromString "True"] []]
+ [FunStmt "1printstr" [makeStrExpr zero $ fromString "False"] []]]
+ ]
Start :: *World -> *World
Start w
# (stdin, w) = stdio w
| args.version
# stdin = stdin
- <<< "spl 0.1 (17 march 2016)\n"
+ <<< "spl 1.0 (9 June 2016)\n"
<<< "Copyright Pim Jager and Mart Lubbers\n"
= snd $ fclose stdin w
| args.help
# stdin = stdin
<<< "Usage: " <<< args.program <<< " [OPTION] [FILE]\n"
- <<< "<spl> ::= <spl> <parser> <lexer>\n"
- <<< "Lex parse and either FILE or stdin\n"
<<< "\n"
<<< "Options:\n"
<<< " --help Show this help\n"
stdin <<< "//PARSER\n" <<< toString parseOut <<< "//PARSER\n")
= case sem (preamble parseOut) of
(Left e) = snd $ fclose (stdin <<< join "\n" (map toString e) <<< "\n") w
- (Right ast)
+ (Right (ast, gam))
# stdin = if (not args.sem) stdin (stdin
- <<< "//SEM G\n" <<< toString ast <<< "//SEMA\n")
+ <<< "//SEM AST\n" <<< toString ast <<< "//SEM AST\n"
+ <<< "//SEM GAMMA\n" <<< toString gam <<< "//SEM GAMMA\n")
= case gen ast of
(Left e) = snd $ fclose (stdin <<< e) w
(Right asm)