 | cpphs-1.11: A liberalised re-implementation of cpp, the C pre-processor. | Contents | Index |
|
Language.Preprocessor.Cpphs | Portability | All | Stability | experimental | Maintainer | Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk> |
|
|
|
Description |
Include the interface that is exported
|
|
Synopsis |
|
|
|
Documentation |
|
runCpphs :: CpphsOptions -> FilePath -> String -> IO String |
|
cppIfdef |
:: FilePath | File for error reports
| -> [(String, String)] | Pre-defined symbols and their values
| -> [String] | Search path for #includes
| -> BoolOptions | Options controlling output style
| -> String | The input file content
| -> IO [(Posn, String)] | The file after processing (in lines)
| Run a first pass of cpp, evaluating #ifdef's and processing #include's,
whilst taking account of #define's and #undef's as we encounter them.
|
|
|
macroPass |
:: [(String, String)] | Pre-defined symbols and their values
| -> BoolOptions | Options that alter processing style
| -> [(Posn, String)] | The input file content
| -> IO String | The file after processing
| Walk through the document, replacing calls of macros with the expanded RHS.
|
|
|
data CpphsOptions |
Cpphs options structure.
| Constructors | |
|
|
data BoolOptions |
Options representable as Booleans.
| Constructors | BoolOptions | | macros :: Bool | Leave #define and #undef in output of ifdef?
| locations :: Bool | Place #line droppings in output?
| hashline :: Bool | Write -} ?
| pragma :: Bool | Keep #pragma in final output?
| stripEol :: Bool | Remove C eol (//) comments everywhere?
| stripC89 :: Bool | Remove C inline (/**/) comments everywhere?
| lang :: Bool | Lex input as Haskell code?
| ansi :: Bool | Permit stringise # and catenate ## operators?
| layout :: Bool | Retain newlines in macro expansions?
| literate :: Bool | Remove literate markup?
| warnings :: Bool | Issue warnings?
|
|
|
|
|
parseOptions :: [String] -> Either String CpphsOptions |
Parse all command-line options.
|
|
defaultCpphsOptions :: CpphsOptions |
Default options.
|
|
defaultBoolOptions :: BoolOptions |
Default settings of boolean options.
|
|
data Posn |
Source positions contain a filename, line, column, and an
inclusion point, which is itself another source position,
recursively.
| Constructors | | Instances | |
|
|
newfile :: String -> Posn |
Constructor. Argument is filename.
|
|
addcol :: Int -> Posn -> Posn |
Increment column number by given quantity.
|
|
newline :: Posn -> Posn |
Increment row number, reset column to 1.
|
|
tab :: Posn -> Posn |
Increment column number, tab stops are every 8 chars.
|
|
newlines :: Int -> Posn -> Posn |
Increment row number by given quantity.
|
|
newpos :: Int -> Maybe String -> Posn -> Posn |
Update position with a new row, and possible filename.
|
|
cppline :: Posn -> String |
cpp-style printing of file position
|
|
haskline :: Posn -> String |
haskell-style printing of file position
|
|
cpp2hask :: String -> String |
Conversion from a cpp-style to haskell-style pragma.
|
|
filename :: Posn -> String |
Project the filename.
|
|
lineno :: Posn -> Int |
Project the line number.
|
|
directory :: Posn -> FilePath |
Project the directory of the filename.
|
|
Produced by Haddock version 2.7.2 |