Language.Preprocessor.Cpphs.HashDefine

| cpphs | Source code | Contents | Index
Language.Preprocessor.Cpphs.HashDefine |
Portability | All
Stability | experimental
Maintainer | Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk>
Description
What structures are declared in a #define.
Synopsis
data HashDefine
= LineDrop {
name :: String
}
| Pragma {
name :: String
}
| SymbolReplacement {
name :: String
replacement :: String
linebreaks :: Int
}
| MacroExpansion {
name :: String
arguments :: [String]
expansion :: [(ArgOrText, String)]
linebreaks :: Int
}
data ArgOrText
= Arg
| Text
| Str
expandMacro :: HashDefine -> [String] -> Bool -> String
parseHashDefine :: Bool -> [String] -> Maybe HashDefine
Documentation
data HashDefine | Source
Constructors
LineDrop |
name :: String |
Pragma |
name :: String |
SymbolReplacement |
name :: String |
replacement :: String |
linebreaks :: Int |
MacroExpansion |
name :: String |
arguments :: [String] |
expansion :: [(ArgOrText, String)] |
linebreaks :: Int |
Instances
Eq HashDefine
Show HashDefine
data ArgOrText | Source
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
Eq ArgOrText
Show ArgOrText
expandMacro :: HashDefine -> [String] -> Bool -> String | Source
Expand an instance of a macro. Precondition: got a match on the macro name.
parseHashDefine :: Bool -> [String] -> Maybe HashDefine | Source
Parse a #define, or #undef, ignoring other # directives
Produced by Haddock version 0.8