cpphs
Copyright2004 Malcolm Wallace
LicenseLGPL
MaintainerMalcolm Wallace <Malcolm.Wallace@cs.york.ac.uk>
Stabilityexperimental
PortabilityAll
Safe HaskellSafe-Inferred
LanguageHaskell98

Language.Preprocessor.Cpphs.HashDefine

Description

What structures are declared in a #define.

Synopsis

Documentation

data HashDefine #

Constructors

LineDrop 

Fields

Pragma 

Fields

AntiDefined 

Fields

SymbolReplacement 

Fields

MacroExpansion 

Fields

Instances

Instances details
Eq HashDefine # 
Instance details

Defined in Language.Preprocessor.Cpphs.HashDefine

Methods

(==) :: HashDefine -> HashDefine -> Bool

(/=) :: HashDefine -> HashDefine -> Bool

Show HashDefine # 
Instance details

Defined in Language.Preprocessor.Cpphs.HashDefine

Methods

showsPrec :: Int -> HashDefine -> ShowS

show :: HashDefine -> String

showList :: [HashDefine] -> ShowS

data ArgOrText #

Macro expansion text is divided into sections, each of which is classified as one of three kinds: a formal argument (Arg), plain text (Text), or a stringised formal argument (Str).

Constructors

Arg 
Text 
Str 

Instances

Instances details
Eq ArgOrText # 
Instance details

Defined in Language.Preprocessor.Cpphs.HashDefine

Methods

(==) :: ArgOrText -> ArgOrText -> Bool

(/=) :: ArgOrText -> ArgOrText -> Bool

Show ArgOrText # 
Instance details

Defined in Language.Preprocessor.Cpphs.HashDefine

Methods

showsPrec :: Int -> ArgOrText -> ShowS

show :: ArgOrText -> String

showList :: [ArgOrText] -> ShowS

expandMacro :: HashDefine -> [String] -> Bool -> String #

Expand an instance of a macro. Precondition: got a match on the macro name.

parseHashDefine :: Bool -> [String] -> Maybe HashDefine #

Parse a #define, or #undef, ignoring other # directives

simplifyHashDefines :: [HashDefine] -> [(String, String)] #

Pretty-print hash defines to a simpler format, as key-value pairs.