language-c-0.6.1: Analysis and generation of C code

Copyright(c) 2008 Benedikt Huber
LicenseBSD-style
Maintainerbenedikt.huber@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Language.C.System.Preprocess

Description

Invoking external preprocessors.

Synopsis

Documentation

class Preprocessor cpp where #

Preprocessor encapsulates the abstract interface for invoking C preprocessors

Minimal complete definition

parseCPPArgs, runCPP

Methods

parseCPPArgs :: cpp -> [String] -> Either String (CppArgs, [String]) #

parse the given command line arguments, and return a pair of parsed and ignored arguments

runCPP :: cpp -> CppArgs -> IO ExitCode #

run the preprocessor

data CppOption #

Generic Options for the preprocessor

data CppArgs #

Generic arguments for the preprocessor

rawCppArgs :: [String] -> FilePath -> CppArgs #

use the given preprocessor arguments without analyzing them

addCppOption :: CppArgs -> CppOption -> CppArgs #

add a typed option to the given preprocessor arguments

addExtraOption :: CppArgs -> String -> CppArgs #

add a string option to the given preprocessor arguments

cppFile :: FilePath -> CppArgs #

Cpp arguments that only specify the input file name.

runPreprocessor :: Preprocessor cpp => cpp -> CppArgs -> IO (Either ExitCode InputStream) #

run the preprocessor and return an InputStream if preprocesssing succeeded

isPreprocessed :: FilePath -> Bool #

guess whether a file is preprocessed (file end with .i)