 | language-c-0.3.1.1: Analysis and generation of C code | Contents | Index |
|
| Language.C.Syntax.Constants | | Portability | ghc | | Stability | experimental | | Maintainer | benedikt.huber@gmail.com |
|
|
|
|
|
| Description |
| This module provides support for representing, checking and exporting c
constants, i.e. integral, float, character and string constants.
|
|
| Synopsis |
|
|
|
|
| Utilities
|
|
| escapeChar :: Char -> String |
|
| unescapeChar :: String -> (Char, String) |
|
| unescapeString :: String -> String |
|
| newtype Flags f |
| Constructors | | Instances | |
|
|
| noFlags :: Flags f |
|
| setFlag :: Enum f => f -> Flags f -> Flags f |
|
| clearFlag :: Enum f => f -> Flags f -> Flags f |
|
| testFlag :: Enum f => f -> Flags f -> Bool |
|
| C char constants (and multi-character character constants)
|
|
| cChar :: Char -> CChar |
| construct a character constant from a haskell Char
Use cchar_w if you want a wide character constant.
|
|
| cChar_w :: Char -> CChar |
| construct a wide chararacter constant
|
|
| cChars :: [Char] -> Bool -> CChar |
| create a multi-character character constant
|
|
| data CChar |
| C char constants (abstract)
| | Constructors | | Instances | |
|
|
| getCChar :: CChar -> [Char] |
| get the haskell representation of a char constant
|
|
| getCCharAsInt :: CChar -> Integer |
| get integer value of a C char constant
undefined result for multi-char char constants
|
|
| isWideChar :: CChar -> Bool |
| return true if the character constant is wide.
|
|
| showCharConst :: Char -> ShowS |
| showCharConst c prepends _a_ String representing the C char constant corresponding to c.
If neccessary uses octal or hexadecimal escape sequences.
|
|
| C integral constants
|
|
| data CIntFlag |
| datatype representing type flags for integers
| | Constructors | | FlagUnsigned | | | FlagLong | | | FlagLongLong | | | FlagImag | |
| Instances | |
|
|
| data CIntRepr |
| datatype for memorizing the representation of an integer
| | Constructors | | Instances | |
|
|
| cInteger :: Integer -> CInteger |
| construct a integer constant (without type flags) from a haskell integer
|
|
| data CInteger |
| Constructors | | Instances | |
|
|
| getCInteger :: CInteger -> Integer |
|
| readCInteger :: CIntRepr -> String -> Either String CInteger |
|
| C floating point constants
|
|
| cFloat :: Float -> CFloat |
|
| data CFloat |
| Floats (represented as strings)
| | Constructors | | Instances | |
|
|
| readCFloat :: String -> CFloat |
|
| C string literals
|
|
| cString :: String -> CString |
|
| cString_w :: String -> CString |
|
| data CString |
| C String literals
| | Constructors | | Instances | |
|
|
| getCString :: CString -> String |
|
| showStringLit :: String -> ShowS |
| showStringLiteral s prepends a String representing the C string literal corresponding to s.
If neccessary it uses octal or hexadecimal escape sequences.
|
|
| concatCStrings :: [CString] -> CString |
| concatenate a list of C string literals
|
|
| Produced by Haddock version 2.7.2 |