mirror of https://github.com/zachjs/sv2v.git
28 lines
544 B
Haskell
28 lines
544 B
Haskell
{- sv2v
|
|
- Author: Zachary Snow <zach@zachjs.com>
|
|
-
|
|
- conversion entry point
|
|
-}
|
|
|
|
import System.IO
|
|
import System.Exit
|
|
import System.Environment
|
|
|
|
import Language.SystemVerilog.Parser
|
|
|
|
import Convert (convert)
|
|
|
|
main :: IO ()
|
|
main = do
|
|
[filePath] <- getArgs
|
|
content <- readFile filePath
|
|
let ast = parseFile [] filePath content
|
|
let res = Right (convert ast)
|
|
case res of
|
|
Left _ -> do
|
|
--hPrint stderr err
|
|
exitFailure
|
|
Right str -> do
|
|
hPrint stdout str
|
|
exitSuccess
|