repositories
/
cc1516.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of https://github.com/dopefishh/cc1516
[cc1516.git]
/
spl.icl
diff --git
a/spl.icl
b/spl.icl
index
1690d71
..
5dad10e
100644
(file)
--- a/
spl.icl
+++ b/
spl.icl
@@
-12,6
+12,7
@@
import Data.Maybe
import Data.Func
import System.CommandLine
import GenPrint
import Data.Func
import System.CommandLine
import GenPrint
+import Data.Map
from Text import class Text(concat,join), instance Text String
import parse
from Text import class Text(concat,join), instance Text String
import parse
@@
-50,7
+51,8
@@
Start w
<<< " --help Show this help\n"
<<< " --version Show the version\n"
<<< " --[no-]lex Lexer output(default: disabled)\n"
<<< " --help Show this help\n"
<<< " --version Show the version\n"
<<< " --[no-]lex Lexer output(default: disabled)\n"
- <<< " --[no-]parse Parser output(default: enabled)\n"
+ <<< " --[no-]parse Parser output(default: disabled)\n"
+ <<< " --[no-]sem Semantic analysis output(default: enabled)\n"
= snd $ fclose stdin w
# (contents, stdin, w) = readFileOrStdin stdin args.fp w
= case contents of
= snd $ fclose stdin w
# (contents, stdin, w) = readFileOrStdin stdin args.fp w
= case contents of
@@
-67,9
+69,9
@@
Start w
stdin <<< "//PARSER\n" <<< toString parseOut <<< "//PARSER\n")
= case sem parseOut of
(Left e) = snd $ fclose (stdin <<< join "\n" (map toString e)) w
stdin <<< "//PARSER\n" <<< toString parseOut <<< "//PARSER\n")
= case sem parseOut of
(Left e) = snd $ fclose (stdin <<< join "\n" (map toString e)) w
- (Right
semOut
)
+ (Right
(semOut, gamma)
)
# stdin = if (not args.sem) stdin (
# stdin = if (not args.sem) stdin (
- stdin <<< "//SEM\n" <<< toString
semOut
<<< "//SEM\n")
+ stdin <<< "//SEM\n" <<< toString
gamma
<<< "//SEM\n")
= snd $ fclose stdin w
where
printTokens :: [Token] -> String
= snd $ fclose stdin w
where
printTokens :: [Token] -> String