summaryrefslogtreecommitdiff
path: root/src/Syntactic.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Syntactic.hs')
-rw-r--r--src/Syntactic.hs51
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"
+