language-c-0.9.3: Analysis and generation of C code
Copyright(c) 2008 Benedikt Huber
LicenseBSD-style
Maintainerbenedikt.huber@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.C.System.Preprocess

Description

Invoking external preprocessors.

Synopsis

Documentation

class Preprocessor cpp where Source #

Preprocessor encapsulates the abstract interface for invoking C preprocessors

Methods

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

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

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

run the preprocessor

Instances

Instances details
Preprocessor GCC Source # 
Instance details

Defined in Language.C.System.GCC

data CppOption Source #

Generic Options for the preprocessor

data CppArgs Source #

Generic arguments for the preprocessor

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

use the given preprocessor arguments without analyzing them

addCppOption :: CppArgs -> CppOption -> CppArgs Source #

add a typed option to the given preprocessor arguments

addExtraOption :: CppArgs -> String -> CppArgs Source #

add a string option to the given preprocessor arguments

cppFile :: FilePath -> CppArgs Source #

Cpp arguments that only specify the input file name.

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

run the preprocessor and return an InputStream if preprocesssing succeeded

isPreprocessed :: FilePath -> Bool Source #

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