Portability | All |
---|---|
Stability | experimental |
Maintainer | Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk> |
Language.Preprocessor.Cpphs.HashDefine
Description
What structures are declared in a #define.
- data HashDefine
- = LineDrop { }
- | Pragma { }
- | AntiDefined {
- name :: String
- linebreaks :: Int
- | SymbolReplacement {
- name :: String
- replacement :: String
- linebreaks :: Int
- | MacroExpansion { }
- data ArgOrText
- expandMacro :: HashDefine -> [String] -> Bool -> String
- parseHashDefine :: Bool -> [String] -> Maybe HashDefine
Documentation
data HashDefine
Constructors
LineDrop | |
Pragma | |
AntiDefined | |
Fields
| |
SymbolReplacement | |
Fields
| |
MacroExpansion | |
Instances
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).
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