language-c-0.10.1: Analysis and generation of C code

Copyright | (c) 2007..2008 Duncan Coutts Benedikt Huber
License | BSD-style
Maintainer | benedikt.huber@gmail.com
Stability | experimental
Portability | ghc
Safe Haskell | None
Language | Haskell2010

Language.C.Syntax.Constants

Contents

- Utilities
- C char constants (and multi-character character constants)
- C integral constants
- C floating point constants
- C string literals
- Clang C version literals

Description

This module provides support for representing, checking and exporting c constants, i.e. integral, float, character and string constants.

Synopsis

- escapeChar :: Char -> String
- unescapeChar :: String -> (Char, String)
- unescapeString :: String -> String
- newtype Flags f = Flags Integer
- 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
- cChar :: Char -> CChar
- cChar_w :: Char -> CChar
- cChars :: String -> Bool -> CChar
- data CChar
  - = CChar !Char !Bool
  - | CChars [Char] !Bool
- getCChar :: CChar -> String
- getCCharAsInt :: CChar -> Integer
- isWideChar :: CChar -> Bool
- showCharConst :: Char -> ShowS
- data CIntFlag
  - = FlagUnsigned
  - | FlagLong
  - | FlagLongLong
  - | FlagImag
- data CIntRepr
  - = DecRepr
  - | HexRepr
  - | OctalRepr
- cInteger :: Integer -> CInteger
- data CInteger = CInteger !Integer !CIntRepr !(Flags CIntFlag)
- getCInteger :: CInteger -> Integer
- readCInteger :: CIntRepr -> String -> Either String CInteger
- cFloat :: Float -> CFloat
- data CFloat = CFloat !String
- readCFloat :: String -> CFloat
- cString :: String -> CString
- cString_w :: String -> CString
- data CString = CString String Bool
- getCString :: CString -> String
- showStringLit :: String -> ShowS
- concatCStrings :: [CString] -> CString
- data ClangCVersion = ClangCVersion !String
- readClangCVersion :: String -> ClangCVersion

# Utilities

escapeChar :: Char -> String Source #

unescapeChar :: String -> (Char, String) Source #

unescapeString :: String -> String Source #

newtype Flags f Source #

Constructors

Flags Integer |

#### Instances

Instances details

Generic1 Flags Source # |

Instance details

Defined in Language.C.Syntax.Constants

Associated Types

type Rep1 Flags |
Instance details Defined in Language.C.Syntax.Constants type Rep1 Flags = D1 ('MetaData "Flags" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'True) (C1 ('MetaCons "Flags" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))

Methods

from1 :: Flags a -> Rep1 Flags a Source #

to1 :: Rep1 Flags a -> Flags a Source #

NFData (Flags f) Source # |
Instance details Defined in Language.C.Syntax.Constants Methods rnf :: Flags f -> () Source #
Data f => Data (Flags f) Source # |

Instance details

Defined in Language.C.Syntax.Constants

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Flags f -> c (Flags f) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Flags f) Source #

toConstr :: Flags f -> Constr Source #

dataTypeOf :: Flags f -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Flags f)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Flags f)) Source #

gmapT :: (forall b. Data b => b -> b) -> Flags f -> Flags f Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Flags f -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Flags f -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Flags f -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Flags f -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Flags f -> m (Flags f) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Flags f -> m (Flags f) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Flags f -> m (Flags f) Source #

Generic (Flags f) Source # |

Instance details

Defined in Language.C.Syntax.Constants

Associated Types

type Rep (Flags f) |
Instance details Defined in Language.C.Syntax.Constants type Rep (Flags f) = D1 ('MetaData "Flags" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'True) (C1 ('MetaCons "Flags" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))

Methods

from :: Flags f -> Rep (Flags f) x Source #

to :: Rep (Flags f) x -> Flags f Source #

Eq (Flags f) Source # |
Instance details Defined in Language.C.Syntax.Constants Methods (==) :: Flags f -> Flags f -> Bool Source # (/=) :: Flags f -> Flags f -> Bool Source #
Ord (Flags f) Source # |
Instance details Defined in Language.C.Syntax.Constants Methods compare :: Flags f -> Flags f -> Ordering Source # (<) :: Flags f -> Flags f -> Bool Source # (<=) :: Flags f -> Flags f -> Bool Source # (>) :: Flags f -> Flags f -> Bool Source # (>=) :: Flags f -> Flags f -> Bool Source # max :: Flags f -> Flags f -> Flags f Source # min :: Flags f -> Flags f -> Flags f Source #
type Rep1 Flags Source # |
Instance details Defined in Language.C.Syntax.Constants type Rep1 Flags = D1 ('MetaData "Flags" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'True) (C1 ('MetaCons "Flags" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))
type Rep (Flags f) Source # |
Instance details Defined in Language.C.Syntax.Constants type Rep (Flags f) = D1 ('MetaData "Flags" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'True) (C1 ('MetaCons "Flags" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))

noFlags :: Flags f Source #

setFlag :: Enum f => f -> Flags f -> Flags f Source #

clearFlag :: Enum f => f -> Flags f -> Flags f Source #

testFlag :: Enum f => f -> Flags f -> Bool Source #

# C char constants (and multi-character character constants)

cChar :: Char -> CChar Source #

construct a character constant from a haskell `Char` Use `cchar_w` if you want a wide character constant.

cChar_w :: Char -> CChar Source #

construct a wide chararacter constant

cChars :: String -> Bool -> CChar Source #

create a multi-character character constant

data CChar Source #

C char constants (abstract)

Constructors

CChar !Char !Bool |
CChars [Char] !Bool |

#### Instances

Instances details

NFData CChar Source # |
Instance details Defined in Language.C.Syntax.Constants Methods rnf :: CChar -> () Source #
Data CChar Source # |

Instance details

Defined in Language.C.Syntax.Constants

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CChar -> c CChar Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CChar Source #

toConstr :: CChar -> Constr Source #

dataTypeOf :: CChar -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CChar) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CChar) Source #

gmapT :: (forall b. Data b => b -> b) -> CChar -> CChar Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CChar -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CChar -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CChar -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CChar -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CChar -> m CChar Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CChar -> m CChar Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CChar -> m CChar Source #

Generic CChar Source # |

Instance details

Defined in Language.C.Syntax.Constants

Associated Types

type Rep CChar |

Instance details

Defined in Language.C.Syntax.Constants

type Rep CChar = D1 ('MetaData "CChar" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'False) (C1 ('MetaCons "CChar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Char) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)) :+: C1 ('MetaCons "CChars" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Char]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)))

Methods

from :: CChar -> Rep CChar x Source #

to :: Rep CChar x -> CChar Source #

Show CChar Source # |
Instance details Defined in Language.C.Syntax.Constants Methods showsPrec :: Int -> CChar -> ShowS Source # show :: CChar -> String Source # showList :: [CChar] -> ShowS Source #
Eq CChar Source # |
Instance details Defined in Language.C.Syntax.Constants Methods (==) :: CChar -> CChar -> Bool Source # (/=) :: CChar -> CChar -> Bool Source #
Ord CChar Source # |
Instance details Defined in Language.C.Syntax.Constants Methods compare :: CChar -> CChar -> Ordering Source # (<) :: CChar -> CChar -> Bool Source # (<=) :: CChar -> CChar -> Bool Source # (>) :: CChar -> CChar -> Bool Source # (>=) :: CChar -> CChar -> Bool Source # max :: CChar -> CChar -> CChar Source # min :: CChar -> CChar -> CChar Source #
type Rep CChar Source # |

Instance details

Defined in Language.C.Syntax.Constants

type Rep CChar = D1 ('MetaData "CChar" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'False) (C1 ('MetaCons "CChar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Char) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)) :+: C1 ('MetaCons "CChars" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Char]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)))

getCChar :: CChar -> String Source #

get the haskell representation of a char constant

getCCharAsInt :: CChar -> Integer Source #

get integer value of a C char constant undefined result for multi-char char constants

isWideChar :: CChar -> Bool Source #

return `true` if the character constant is wide.

showCharConst :: Char -> ShowS Source #

`showCharConst c` prepends _a_ String representing the C char constant corresponding to `c`. If necessary uses octal or hexadecimal escape sequences.

# C integral constants

data CIntFlag Source #

datatype representing type flags for integers

Constructors

FlagUnsigned |
FlagLong |
FlagLongLong |
FlagImag |

#### Instances

Instances details

NFData CIntFlag Source # |
Instance details Defined in Language.C.Syntax.Constants Methods rnf :: CIntFlag -> () Source #
Data CIntFlag Source # |

Instance details

Defined in Language.C.Syntax.Constants

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CIntFlag -> c CIntFlag Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CIntFlag Source #

toConstr :: CIntFlag -> Constr Source #

dataTypeOf :: CIntFlag -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CIntFlag) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntFlag) Source #

gmapT :: (forall b. Data b => b -> b) -> CIntFlag -> CIntFlag Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CIntFlag -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CIntFlag -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CIntFlag -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CIntFlag -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag Source #

Bounded CIntFlag Source # |
Instance details Defined in Language.C.Syntax.Constants Methods minBound :: CIntFlag Source # maxBound :: CIntFlag Source #
Enum CIntFlag Source # |

Instance details

Defined in Language.C.Syntax.Constants

Methods

succ :: CIntFlag -> CIntFlag Source #

pred :: CIntFlag -> CIntFlag Source #

toEnum :: Int -> CIntFlag Source #

fromEnum :: CIntFlag -> Int Source #

enumFrom :: CIntFlag -> [CIntFlag] Source #

enumFromThen :: CIntFlag -> CIntFlag -> [CIntFlag] Source #

enumFromTo :: CIntFlag -> CIntFlag -> [CIntFlag] Source #

enumFromThenTo :: CIntFlag -> CIntFlag -> CIntFlag -> [CIntFlag] Source #

Generic CIntFlag Source # |

Instance details

Defined in Language.C.Syntax.Constants

Associated Types

type Rep CIntFlag |

Instance details

Defined in Language.C.Syntax.Constants

type Rep CIntFlag = D1 ('MetaData "CIntFlag" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'False) ((C1 ('MetaCons "FlagUnsigned" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FlagLong" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "FlagLongLong" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FlagImag" 'PrefixI 'False) (U1 :: Type -> Type)))

Methods

from :: CIntFlag -> Rep CIntFlag x Source #

to :: Rep CIntFlag x -> CIntFlag Source #

Show CIntFlag Source # |
Instance details Defined in Language.C.Syntax.Constants Methods showsPrec :: Int -> CIntFlag -> ShowS Source # show :: CIntFlag -> String Source # showList :: [CIntFlag] -> ShowS Source #
Eq CIntFlag Source # |
Instance details Defined in Language.C.Syntax.Constants Methods (==) :: CIntFlag -> CIntFlag -> Bool Source # (/=) :: CIntFlag -> CIntFlag -> Bool Source #
Ord CIntFlag Source # |
Instance details Defined in Language.C.Syntax.Constants Methods compare :: CIntFlag -> CIntFlag -> Ordering Source # (<) :: CIntFlag -> CIntFlag -> Bool Source # (<=) :: CIntFlag -> CIntFlag -> Bool Source # (>) :: CIntFlag -> CIntFlag -> Bool Source # (>=) :: CIntFlag -> CIntFlag -> Bool Source # max :: CIntFlag -> CIntFlag -> CIntFlag Source # min :: CIntFlag -> CIntFlag -> CIntFlag Source #
type Rep CIntFlag Source # |

Instance details

Defined in Language.C.Syntax.Constants

type Rep CIntFlag = D1 ('MetaData "CIntFlag" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'False) ((C1 ('MetaCons "FlagUnsigned" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FlagLong" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "FlagLongLong" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FlagImag" 'PrefixI 'False) (U1 :: Type -> Type)))

data CIntRepr Source #

datatype for memorizing the representation of an integer

Constructors

DecRepr |
HexRepr |
OctalRepr |

#### Instances

Instances details

NFData CIntRepr Source # |
Instance details Defined in Language.C.Syntax.Constants Methods rnf :: CIntRepr -> () Source #
Data CIntRepr Source # |

Instance details

Defined in Language.C.Syntax.Constants

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CIntRepr -> c CIntRepr Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CIntRepr Source #

toConstr :: CIntRepr -> Constr Source #

dataTypeOf :: CIntRepr -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CIntRepr) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntRepr) Source #

gmapT :: (forall b. Data b => b -> b) -> CIntRepr -> CIntRepr Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CIntRepr -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CIntRepr -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CIntRepr -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CIntRepr -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr Source #

Bounded CIntRepr Source # |
Instance details Defined in Language.C.Syntax.Constants Methods minBound :: CIntRepr Source # maxBound :: CIntRepr Source #
Enum CIntRepr Source # |

Instance details

Defined in Language.C.Syntax.Constants

Methods

succ :: CIntRepr -> CIntRepr Source #

pred :: CIntRepr -> CIntRepr Source #

toEnum :: Int -> CIntRepr Source #

fromEnum :: CIntRepr -> Int Source #

enumFrom :: CIntRepr -> [CIntRepr] Source #

enumFromThen :: CIntRepr -> CIntRepr -> [CIntRepr] Source #

enumFromTo :: CIntRepr -> CIntRepr -> [CIntRepr] Source #

enumFromThenTo :: CIntRepr -> CIntRepr -> CIntRepr -> [CIntRepr] Source #

Generic CIntRepr Source # |

Instance details

Defined in Language.C.Syntax.Constants

Associated Types

type Rep CIntRepr |
Instance details Defined in Language.C.Syntax.Constants type Rep CIntRepr = D1 ('MetaData "CIntRepr" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'False) (C1 ('MetaCons "DecRepr" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "HexRepr" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OctalRepr" 'PrefixI 'False) (U1 :: Type -> Type)))

Methods

from :: CIntRepr -> Rep CIntRepr x Source #

to :: Rep CIntRepr x -> CIntRepr Source #

Eq CIntRepr Source # |
Instance details Defined in Language.C.Syntax.Constants Methods (==) :: CIntRepr -> CIntRepr -> Bool Source # (/=) :: CIntRepr -> CIntRepr -> Bool Source #
Ord CIntRepr Source # |
Instance details Defined in Language.C.Syntax.Constants Methods compare :: CIntRepr -> CIntRepr -> Ordering Source # (<) :: CIntRepr -> CIntRepr -> Bool Source # (<=) :: CIntRepr -> CIntRepr -> Bool Source # (>) :: CIntRepr -> CIntRepr -> Bool Source # (>=) :: CIntRepr -> CIntRepr -> Bool Source # max :: CIntRepr -> CIntRepr -> CIntRepr Source # min :: CIntRepr -> CIntRepr -> CIntRepr Source #
type Rep CIntRepr Source # |
Instance details Defined in Language.C.Syntax.Constants type Rep CIntRepr = D1 ('MetaData "CIntRepr" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'False) (C1 ('MetaCons "DecRepr" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "HexRepr" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OctalRepr" 'PrefixI 'False) (U1 :: Type -> Type)))

cInteger :: Integer -> CInteger Source #

construct a integer constant (without type flags) from a haskell integer

data CInteger Source #

Constructors

CInteger !Integer !CIntRepr !(Flags CIntFlag) |

#### Instances

Instances details

NFData CInteger Source # |
Instance details Defined in Language.C.Syntax.Constants Methods rnf :: CInteger -> () Source #
Data CInteger Source # |

Instance details

Defined in Language.C.Syntax.Constants

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CInteger -> c CInteger Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CInteger Source #

toConstr :: CInteger -> Constr Source #

dataTypeOf :: CInteger -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CInteger) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CInteger) Source #

gmapT :: (forall b. Data b => b -> b) -> CInteger -> CInteger Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CInteger -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CInteger -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CInteger -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CInteger -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CInteger -> m CInteger Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CInteger -> m CInteger Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CInteger -> m CInteger Source #

Generic CInteger Source # |

Instance details

Defined in Language.C.Syntax.Constants

Associated Types

type Rep CInteger |

Instance details

Defined in Language.C.Syntax.Constants

type Rep CInteger = D1 ('MetaData "CInteger" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'False) (C1 ('MetaCons "CInteger" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Integer) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CIntRepr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Flags CIntFlag)))))

Methods

from :: CInteger -> Rep CInteger x Source #

to :: Rep CInteger x -> CInteger Source #

Show CInteger Source # |
Instance details Defined in Language.C.Syntax.Constants Methods showsPrec :: Int -> CInteger -> ShowS Source # show :: CInteger -> String Source # showList :: [CInteger] -> ShowS Source #
Eq CInteger Source # |
Instance details Defined in Language.C.Syntax.Constants Methods (==) :: CInteger -> CInteger -> Bool Source # (/=) :: CInteger -> CInteger -> Bool Source #
Ord CInteger Source # |
Instance details Defined in Language.C.Syntax.Constants Methods compare :: CInteger -> CInteger -> Ordering Source # (<) :: CInteger -> CInteger -> Bool Source # (<=) :: CInteger -> CInteger -> Bool Source # (>) :: CInteger -> CInteger -> Bool Source # (>=) :: CInteger -> CInteger -> Bool Source # max :: CInteger -> CInteger -> CInteger Source # min :: CInteger -> CInteger -> CInteger Source #
type Rep CInteger Source # |

Instance details

Defined in Language.C.Syntax.Constants

type Rep CInteger = D1 ('MetaData "CInteger" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'False) (C1 ('MetaCons "CInteger" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Integer) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CIntRepr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Flags CIntFlag)))))

getCInteger :: CInteger -> Integer Source #

readCInteger :: CIntRepr -> String -> Either String CInteger Source #

# C floating point constants

cFloat :: Float -> CFloat Source #

data CFloat Source #

Floats (represented as strings)

Constructors

CFloat !String |

#### Instances

Instances details

NFData CFloat Source # |
Instance details Defined in Language.C.Syntax.Constants Methods rnf :: CFloat -> () Source #
Data CFloat Source # |

Instance details

Defined in Language.C.Syntax.Constants

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CFloat -> c CFloat Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CFloat Source #

toConstr :: CFloat -> Constr Source #

dataTypeOf :: CFloat -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CFloat) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CFloat) Source #

gmapT :: (forall b. Data b => b -> b) -> CFloat -> CFloat Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CFloat -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CFloat -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CFloat -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CFloat -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CFloat -> m CFloat Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CFloat -> m CFloat Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CFloat -> m CFloat Source #

Generic CFloat Source # |

Instance details

Defined in Language.C.Syntax.Constants

Associated Types

type Rep CFloat |
Instance details Defined in Language.C.Syntax.Constants type Rep CFloat = D1 ('MetaData "CFloat" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'False) (C1 ('MetaCons "CFloat" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String)))

Methods

from :: CFloat -> Rep CFloat x Source #

to :: Rep CFloat x -> CFloat Source #

Show CFloat Source # |
Instance details Defined in Language.C.Syntax.Constants Methods showsPrec :: Int -> CFloat -> ShowS Source # show :: CFloat -> String Source # showList :: [CFloat] -> ShowS Source #
Eq CFloat Source # |
Instance details Defined in Language.C.Syntax.Constants Methods (==) :: CFloat -> CFloat -> Bool Source # (/=) :: CFloat -> CFloat -> Bool Source #
Ord CFloat Source # |
Instance details Defined in Language.C.Syntax.Constants Methods compare :: CFloat -> CFloat -> Ordering Source # (<) :: CFloat -> CFloat -> Bool Source # (<=) :: CFloat -> CFloat -> Bool Source # (>) :: CFloat -> CFloat -> Bool Source # (>=) :: CFloat -> CFloat -> Bool Source # max :: CFloat -> CFloat -> CFloat Source # min :: CFloat -> CFloat -> CFloat Source #
type Rep CFloat Source # |
Instance details Defined in Language.C.Syntax.Constants type Rep CFloat = D1 ('MetaData "CFloat" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'False) (C1 ('MetaCons "CFloat" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String)))

readCFloat :: String -> CFloat Source #

# C string literals

cString :: String -> CString Source #

cString_w :: String -> CString Source #

data CString Source #

C String literals

Constructors

CString String Bool |

#### Instances

Instances details

NFData CString Source # |
Instance details Defined in Language.C.Syntax.Constants Methods rnf :: CString -> () Source #
Data CString Source # |

Instance details

Defined in Language.C.Syntax.Constants

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CString -> c CString Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CString Source #

toConstr :: CString -> Constr Source #

dataTypeOf :: CString -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CString) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CString) Source #

gmapT :: (forall b. Data b => b -> b) -> CString -> CString Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CString -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CString -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CString -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CString -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CString -> m CString Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CString -> m CString Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CString -> m CString Source #

Generic CString Source # |

Instance details

Defined in Language.C.Syntax.Constants

Associated Types

type Rep CString |

Instance details

Defined in Language.C.Syntax.Constants

type Rep CString = D1 ('MetaData "CString" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'False) (C1 ('MetaCons "CString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))

Methods

from :: CString -> Rep CString x Source #

to :: Rep CString x -> CString Source #

Show CString Source # |
Instance details Defined in Language.C.Syntax.Constants Methods showsPrec :: Int -> CString -> ShowS Source # show :: CString -> String Source # showList :: [CString] -> ShowS Source #
Eq CString Source # |
Instance details Defined in Language.C.Syntax.Constants Methods (==) :: CString -> CString -> Bool Source # (/=) :: CString -> CString -> Bool Source #
Ord CString Source # |
Instance details Defined in Language.C.Syntax.Constants Methods compare :: CString -> CString -> Ordering Source # (<) :: CString -> CString -> Bool Source # (<=) :: CString -> CString -> Bool Source # (>) :: CString -> CString -> Bool Source # (>=) :: CString -> CString -> Bool Source # max :: CString -> CString -> CString Source # min :: CString -> CString -> CString Source #
type Rep CString Source # |

Instance details

Defined in Language.C.Syntax.Constants

type Rep CString = D1 ('MetaData "CString" "Language.C.Syntax.Constants" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'False) (C1 ('MetaCons "CString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))

getCString :: CString -> String Source #

showStringLit :: String -> ShowS Source #

`showStringLiteral s` prepends a String representing the C string literal corresponding to `s`. If necessary it uses octal or hexadecimal escape sequences.

concatCStrings :: [CString] -> CString Source #

concatenate a list of C string literals

# Clang C version literals

data ClangCVersion Source #

Clang dotted version literal https://clang.llvm.org/docs/AttributeReference.html#availability

Constructors

ClangCVersion !String |

#### Instances

Instances details

Data ClangCVersion Source # |

Instance details

Defined in Language.C.Syntax.Constants

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ClangCVersion -> c ClangCVersion Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ClangCVersion Source #

toConstr :: ClangCVersion -> Constr Source #

dataTypeOf :: ClangCVersion -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ClangCVersion) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ClangCVersion) Source #

gmapT :: (forall b. Data b => b -> b) -> ClangCVersion -> ClangCVersion Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ClangCVersion -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ClangCVersion -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ClangCVersion -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ClangCVersion -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion Source #

Show ClangCVersion Source # |
Instance details Defined in Language.C.Syntax.Constants Methods showsPrec :: Int -> ClangCVersion -> ShowS Source # show :: ClangCVersion -> String Source # showList :: [ClangCVersion] -> ShowS Source #
Eq ClangCVersion Source # |
Instance details Defined in Language.C.Syntax.Constants Methods (==) :: ClangCVersion -> ClangCVersion -> Bool Source # (/=) :: ClangCVersion -> ClangCVersion -> Bool Source #
Ord ClangCVersion Source # |

Instance details

Defined in Language.C.Syntax.Constants

Methods

compare :: ClangCVersion -> ClangCVersion -> Ordering Source #

(<) :: ClangCVersion -> ClangCVersion -> Bool Source #

(<=) :: ClangCVersion -> ClangCVersion -> Bool Source #

(>) :: ClangCVersion -> ClangCVersion -> Bool Source #

(>=) :: ClangCVersion -> ClangCVersion -> Bool Source #

max :: ClangCVersion -> ClangCVersion -> ClangCVersion Source #

min :: ClangCVersion -> ClangCVersion -> ClangCVersion Source #

readClangCVersion :: String -> ClangCVersion Source #