GaBuZoMeu/check-wf.hs

16 lines
499 B
Haskell
Raw Normal View History

2023-06-08 21:49:35 +02:00
import Grammar
import System.Environment (getArgs)
analyze language input
= case (parse language "" input) of
Left err -> (input ++ " is NOT well-formed: " ++ (show err) ++
"\n")
Right x -> (input ++ " is well-formed\n")
main = do
myargs <- getArgs
putStr (concat (map (analyze tag) myargs))
-- TODO: set return code? What code to use if some are well-formed and some are not?
-- TODO: provide a version with -q and -v ?