2019-03-18 10:00:23 +01:00
|
|
|
{- sv2v
|
|
|
|
|
- Author: Zachary Snow <zach@zachjs.com>
|
|
|
|
|
-}
|
2019-02-08 06:19:39 +01:00
|
|
|
module Language.SystemVerilog.Parser
|
2019-03-18 10:00:23 +01:00
|
|
|
( parseFile
|
|
|
|
|
) where
|
2019-02-08 05:49:12 +01:00
|
|
|
|
2019-02-08 06:19:39 +01:00
|
|
|
import Language.SystemVerilog.AST
|
|
|
|
|
import Language.SystemVerilog.Parser.Parse
|
|
|
|
|
import Language.SystemVerilog.Parser.Preprocess
|
2019-02-08 05:49:12 +01:00
|
|
|
|
2019-03-18 10:00:23 +01:00
|
|
|
-- parses a file given a table of predefined macros and the file name
|
2019-03-29 00:55:53 +01:00
|
|
|
parseFile :: [String] -> [(String, String)] -> FilePath -> IO AST
|
|
|
|
|
parseFile includePaths env file =
|
|
|
|
|
loadFile file >>=
|
|
|
|
|
preprocess includePaths env >>=
|
|
|
|
|
return . descriptions
|