------------------------------------------------------------------
-- |
-- Program     :  idlppr          
-- Copyright   :  (c) Dmitry Golubovsky, 2009
-- License     :  BSD-style
-- 
-- Maintainer  :  golubovsky@gmail.com
-- Stability   :  experimental
-- Portability :  portable
-- 
--
--
-- Parse and pretty-print IDL declarations: good for testing.
------------------------------------------------------------------

module Main where

import Language.WebIDL.Lexer
import Language.WebIDL.Parser
import Language.WebIDL.PrettyPrint

import Prelude hiding (putStrLn)
import Control.Monad
import System.Exit
import System.IO.UTF8

main = do
  tks <- lexStdin
  let pp = parseIDL tks
  case pp of
    Right p -> putStrLn $ prettyPrint p
    Left e -> putStrLn $ show e

