cpphsSource codeContentsIndex
Language.Preprocessor.Cpphs.HashDefine
PortabilityAll
Stabilityexperimental
MaintainerMalcolm 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
show/hide Instances
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
show/hide Instances
expandMacro :: HashDefine -> [String] -> Bool -> StringSource
Expand an instance of a macro. Precondition: got a match on the macro name.
parseHashDefine :: Bool -> [String] -> Maybe HashDefineSource
Parse a #define, or #undef, ignoring other # directives
Produced by Haddock version 0.8