Safe Haskell | None |
---|---|
Language | Haskell2010 |
A driver for a command-line interface to a generator.
A simple Main.hs
for a generator can simply be:
import Foreign.Hoppy.Generator.Main (defaultMain
) import Foreign.Hoppy.Generator.Spec (ErrorMsg
,Interface
,interface
) interfaceResult :: EitherErrorMsg
Interface
interfaceResult =interface
... main :: IO () main =defaultMain
interfaceResult
Documentation
Actions that can be requested of the program.
ListInterfaces | Lists the interfaces compiled into the generator. |
ListCppFiles | Lists the generated files in C++ bindings. |
ListHsFiles | Lists the generated files in Haskell bindings. |
GenCpp FilePath | Generates C++ wrappers for an interface in the given location. |
GenHaskell FilePath | Generates Haskell bindings for an interface in the given location. |
run :: [Interface] -> [String] -> IO [Action] Source #
run interfaces args
runs the driver with the command-line arguments from
args
against the listed interfaces, and returns the list of actions
performed.
The recognized arguments are listed below. The exact forms shown are
required; the --long-arg=value
style is not supported.
--help
: Displays a menu listing the valid commands.--list-interfaces
: Lists the interfaces compiled into the generator.--gen-cpp <outdir>
: Generates C++ bindings in the given directory.--gen-hs <outdir>
: Generates Haskell bindings under the given top-level source directory.