diff options
author | Jed Barber <jjbarber@y7mail.com> | 2014-04-08 15:06:40 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2014-04-08 15:06:40 +1000 |
commit | 03d38eb3190eb5e51fb18847fe0792013285bde5 (patch) | |
tree | 1060d26d3042b5c0c5b1c027fac45fe87f3d685a /src/Syntactic.hs | |
parent | f2c4e4614613ede497f19ef79dc7dc157eaca834 (diff) |
Reorganising source code
Diffstat (limited to 'src/Syntactic.hs')
-rw-r--r-- | src/Syntactic.hs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/Syntactic.hs b/src/Syntactic.hs new file mode 100644 index 0000000..870cc35 --- /dev/null +++ b/src/Syntactic.hs @@ -0,0 +1,51 @@ +import System.Environment( getArgs ) +import Text.Printf +import Library.Parse + + + +scan :: String -> String +scan s = if (s == "absTerm" || + s == "absThm" || + s == "appTerm" || + s == "appThm" || + s == "assume" || + s == "axiom" || + s == "betaConv" || + s == "cons" || + s == "const" || + s == "constTerm" || + s == "deductAntisym" || + s == "def" || + s == "defineConst" || + s == "defineTypeOp" || + s == "eqMp" || + s == "nil" || + s == "opType" || + s == "pop" || + s == "ref" || + s == "refl" || + s == "remove" || + s == "subst" || + s == "thm" || + s == "typeOp" || + s == "var" || + s == "varTerm" || + s == "varType" || + isComment(s) || + isNumber(s) || + isName(s)) + then s + else error $ "Invalid input " ++ s + + +doScan :: [String] -> [String] +doScan = map (scan . stripReturn) + + +main = do + args <- getArgs + list <- getLines (head args) + plist <- return $ doScan list + printf $ if (args == plist) then "Scan OK\n" else "Syntax error\n" + |