- = case sem parseOut of
- (Left e) = snd $ fclose (stdin <<< join "\n" (map toString e)) w
- (Right (semOut, gamma))
- # stdin = if (not args.sem) stdin (
- stdin <<< "//SEM\n" <<< toString gamma <<< "//SEM\n")
- = snd $ fclose (stdin <<< "\n") w
+ = case sem (preamble parseOut) of
+ (Left e) = snd $ fclose (stdin <<< join "\n" (map toString e) <<< "\n") w
+ (Right ast)
+ # stdin = if (not args.sem) stdin (stdin
+ <<< "//SEM G\n" <<< toString ast <<< "//SEMA\n")
+ = case gen ast of
+ (Left e) = snd $ fclose (stdin <<< e) w
+ (Right asm)
+ # stdin = if (not args.gen) stdin (stdin
+ <<< ";CODE GEN\n" <<< asm <<< "\n;CODE GEN\n")
+ = snd $ fclose (stdin <<< "\n") w