HXQ-0.5: Main.hs
{--------------------------------------------------------------
-
- The main program of the XQuery interpreter
- Programmer: Leonidas Fegaras (fegaras@cse.uta.edu)
- Date: 03/23/2008
-
---------------------------------------------------------------}
{-# OPTIONS_GHC -fth #-}
module Main where
import System.Environment
import XQuery
main = do env <- getArgs
result <- if (length env) == 1
then xfile (head env)
else do let readl x = do t <- getLine
if null t then return x else readl (x++" "++t)
putStrLn "Write an XQuery (finish the query with an empty line)"
query <- readl ""
xquery query
putStrLn (show result)