    {-# LANGUAGE CPP #-}
    {-# LANGUAGE ConstraintKinds #-}
    {-# LANGUAGE DeriveDataTypeable #-}
    {-# LANGUAGE DeriveFoldable #-}
    {-# LANGUAGE DeriveFunctor #-}
    {-# LANGUAGE DeriveTraversable #-}
    {-# LANGUAGE FlexibleContexts #-}
    {-# LANGUAGE FlexibleInstances #-}
    {-# LANGUAGE GeneralizedNewtypeDeriving #-}
    {-# LANGUAGE MultiParamTypeClasses #-}
    {-# LANGUAGE OverloadedStrings #-}
    {-# LANGUAGE RankNTypes #-}
    {-# LANGUAGE ScopedTypeVariables #-}

    -- | A parser for C99 declarations. Currently, the parser has the following limitations:
    --
    -- * Array sizes can only be @*@, @n@ (where n is a positive integer), @x@
    -- (where @x@ is a C identifier). In C99 they can be arbitrary expressions. See
    -- the @'ArrayType'@ data type.
    --
    -- * @_Bool@, @_Complex@, and @_Imaginary@ are not present.
    --
    -- * Untyped parameter lists (pre-K&R C) are not allowed.
    --
    -- The parser is incremental and generic (see 'CParser').  'PP.Pretty'
    -- and 'QC.Arbitrary' instances are provided for all the data types.
    --
    -- The entry point if you want to parse C declarations is
    -- @'parameter_declaration'@.

    module Language.C.Types.Parse
      ( -- * Parser configuration
        TypeNames
      , CParserContext(..)
        -- ** Default configuration
      , CIdentifier
      , unCIdentifier
      , cIdentifierFromString
      , cCParserContext

        -- * Parser type
      , CParser
      , runCParser
      , quickCParser
      , quickCParser_

        -- * Types and parsing
      -- , identifier
      , identifier_no_lex
      , DeclarationSpecifier(..)
      , declaration_specifiers
      , StorageClassSpecifier(..)
      , storage_class_specifier
      , TypeSpecifier(..)
      , type_specifier
      , TypeQualifier(..)
      , type_qualifier
      , FunctionSpecifier(..)
      , function_specifier
      , Declarator(..)
      , declarator
      , DirectDeclarator(..)
      , direct_declarator
      , ArrayOrProto(..)
      , array_or_proto
      , ArrayType(..)
      , array_type
      , Pointer(..)
      , pointer
      , ParameterDeclaration(..)
      , DeclaratorOrAbstractDeclarator(..)
      , parameter_declaration
      , parameter_list
      , AbstractDeclarator(..)
      , abstract_declarator
      , DirectAbstractDeclarator(..)
      , direct_abstract_declarator

        -- * YACC grammar
        -- $yacc

        -- * Testing utilities
      , cIdentStart
      , cIdentLetter
      , cReservedWords
      , isTypeName
      ) where

    import           Control.Applicative
    import           Control.Monad (msum, void, MonadPlus, unless, when)
    import           Control.Monad.Reader (MonadReader, runReaderT, ReaderT, asks, ask)
    import           Data.List (intersperse)
    import           Data.Functor.Identity (Identity)
    import qualified Data.HashSet as HashSet
    import           Data.Hashable (Hashable)
    import           Data.Monoid ((<>))
    import           Data.String (IsString(..))
    import           Data.Typeable (Typeable)
    import qualified Text.Parsec as Parsec
    import           Text.Parser.Char
    import           Text.Parser.Combinators
    import           Text.Parser.LookAhead
    import           Text.Parser.Token
    import qualified Text.Parser.Token.Highlight as Highlight
    import           Prettyprinter (Pretty(..), (<+>), Doc, hsep)
    import qualified Prettyprinter as PP

    #if __GLASGOW_HASKELL__ < 710
    import           Data.Foldable (Foldable)
    import           Data.Traversable (Traversable)
    #endif

    ------------------------------------------------------------------------
    -- Config

    -- | A collection of named types (typedefs)
    type TypeNames = HashSet.HashSet CIdentifier

    data CParserContext i = CParserContext
      { forall i. CParserContext i -> String
    cpcIdentName :: String
      , forall i. CParserContext i -> TypeNames
    cpcTypeNames :: TypeNames
        -- ^ Function used to determine whether an identifier is a type name.
      , forall i.
    CParserContext i -> forall (m :: * -> *). CParser i m => m i
    cpcParseIdent :: forall m. CParser i m => m i
        -- ^ Parses an identifier, *without consuming whitespace afterwards*.
      , forall i. CParserContext i -> i -> String
    cpcIdentToString :: i -> String
      , forall i. CParserContext i -> Bool
    cpcEnableCpp :: Bool
      }

    -- | A type for C identifiers.
    newtype CIdentifier = CIdentifier {CIdentifier -> String
    unCIdentifier :: String}
      deriving (Typeable, CIdentifier -> CIdentifier -> Bool
    (CIdentifier -> CIdentifier -> Bool)
    -> (CIdentifier -> CIdentifier -> Bool) -> Eq CIdentifier
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CIdentifier -> CIdentifier -> Bool
    == :: CIdentifier -> CIdentifier -> Bool
    $c/= :: CIdentifier -> CIdentifier -> Bool
    /= :: CIdentifier -> CIdentifier -> Bool
    Eq, Eq CIdentifier
    Eq CIdentifier =>
    (CIdentifier -> CIdentifier -> Ordering)
    -> (CIdentifier -> CIdentifier -> Bool)
    -> (CIdentifier -> CIdentifier -> Bool)
    -> (CIdentifier -> CIdentifier -> Bool)
    -> (CIdentifier -> CIdentifier -> Bool)
    -> (CIdentifier -> CIdentifier -> CIdentifier)
    -> (CIdentifier -> CIdentifier -> CIdentifier)
    -> Ord CIdentifier
    CIdentifier -> CIdentifier -> Bool
    CIdentifier -> CIdentifier -> Ordering
    CIdentifier -> CIdentifier -> CIdentifier
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: CIdentifier -> CIdentifier -> Ordering
    compare :: CIdentifier -> CIdentifier -> Ordering
    $c< :: CIdentifier -> CIdentifier -> Bool
    < :: CIdentifier -> CIdentifier -> Bool
    $c<= :: CIdentifier -> CIdentifier -> Bool
    <= :: CIdentifier -> CIdentifier -> Bool
    $c> :: CIdentifier -> CIdentifier -> Bool
    > :: CIdentifier -> CIdentifier -> Bool
    $c>= :: CIdentifier -> CIdentifier -> Bool
    >= :: CIdentifier -> CIdentifier -> Bool
    $cmax :: CIdentifier -> CIdentifier -> CIdentifier
    max :: CIdentifier -> CIdentifier -> CIdentifier
    $cmin :: CIdentifier -> CIdentifier -> CIdentifier
    min :: CIdentifier -> CIdentifier -> CIdentifier
    Ord, Int -> CIdentifier -> String -> String
    [CIdentifier] -> String -> String
    CIdentifier -> String
    (Int -> CIdentifier -> String -> String)
    -> (CIdentifier -> String)
    -> ([CIdentifier] -> String -> String)
    -> Show CIdentifier
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: Int -> CIdentifier -> String -> String
    showsPrec :: Int -> CIdentifier -> String -> String
    $cshow :: CIdentifier -> String
    show :: CIdentifier -> String
    $cshowList :: [CIdentifier] -> String -> String
    showList :: [CIdentifier] -> String -> String
    Show, Eq CIdentifier
    Eq CIdentifier =>
    (Int -> CIdentifier -> Int)
    -> (CIdentifier -> Int) -> Hashable CIdentifier
    Int -> CIdentifier -> Int
    CIdentifier -> Int
    forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
    $chashWithSalt :: Int -> CIdentifier -> Int
    hashWithSalt :: Int -> CIdentifier -> Int
    $chash :: CIdentifier -> Int
    hash :: CIdentifier -> Int
    Hashable)

    cIdentifierFromString :: Bool -> String -> Either String CIdentifier
    cIdentifierFromString :: Bool -> String -> Either String CIdentifier
    cIdentifierFromString Bool
    useCpp String
    s =
      -- Note: it's important not to use 'cidentifier_raw' here, otherwise
      -- we go in a loop:
      --
      -- @
      -- cIdentifierFromString => fromString => cIdentifierFromString => ...
      -- @
      case Parsec String () String
    -> String -> String -> Either ParseError String
    forall s t a.
    Stream s Identity t =>
    Parsec s () a -> String -> s -> Either ParseError a
    Parsec.parse (Bool
    -> IdentifierStyle (ParsecT String () Identity)
    -> Parsec String () String
    forall (m :: * -> *) s.
    (TokenParsing m, Monad m, IsString s) =>
    Bool -> IdentifierStyle m -> m s
    identNoLex Bool
    useCpp IdentifierStyle (ParsecT String () Identity)
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle Parsec String () String
    -> ParsecT String () Identity () -> Parsec String () String
    forall a b.
    ParsecT String () Identity a
    -> ParsecT String () Identity b -> ParsecT String () Identity a
    forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
    <* ParsecT String () Identity ()
    forall (m :: * -> *). Parsing m => m ()
    eof) String
    "cIdentifierFromString" String
    s of
        Left ParseError
    err -> String -> Either String CIdentifier
    forall a b. a -> Either a b
    Left (String -> Either String CIdentifier)
    -> String -> Either String CIdentifier
    forall a b. (a -> b) -> a -> b
    $ ParseError -> String
    forall a. Show a => a -> String
    show ParseError
    err
        Right String
    x -> CIdentifier -> Either String CIdentifier
    forall a b. b -> Either a b
    Right (CIdentifier -> Either String CIdentifier)
    -> CIdentifier -> Either String CIdentifier
    forall a b. (a -> b) -> a -> b
    $ String -> CIdentifier
    CIdentifier String
    x

    instance IsString CIdentifier where
      fromString :: String -> CIdentifier
    fromString String
    s =
        case Bool -> String -> Either String CIdentifier
    cIdentifierFromString Bool
    True String
    s of
          Left String
    err -> String -> CIdentifier
    forall a. HasCallStack => String -> a
    error (String -> CIdentifier) -> String -> CIdentifier
    forall a b. (a -> b) -> a -> b
    $ String
    "CIdentifier fromString: invalid string " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String -> String
    forall a. Show a => a -> String
    show String
    s String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    "\n" String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    err
          Right CIdentifier
    x -> CIdentifier
    x

    cCParserContext :: Bool -> TypeNames -> CParserContext CIdentifier
    cCParserContext :: Bool -> TypeNames -> CParserContext CIdentifier
    cCParserContext Bool
    useCpp TypeNames
    typeNames = CParserContext
      { cpcTypeNames :: TypeNames
    cpcTypeNames = TypeNames
    typeNames
      , cpcParseIdent :: forall (m :: * -> *). CParser CIdentifier m => m CIdentifier
    cpcParseIdent = m CIdentifier
    forall i (m :: * -> *). CParser i m => m CIdentifier
    forall (m :: * -> *). CParser CIdentifier m => m CIdentifier
    cidentifier_no_lex
      , cpcIdentToString :: CIdentifier -> String
    cpcIdentToString = CIdentifier -> String
    unCIdentifier
      , cpcIdentName :: String
    cpcIdentName = String
    "C identifier"
      , cpcEnableCpp :: Bool
    cpcEnableCpp = Bool
    useCpp
      }

    ------------------------------------------------------------------------
    -- Parser

    -- | All the parsing is done using the type classes provided by the
    -- @parsers@ package. You can use the parsing routines with any of the parsers
    -- that implement the classes, such as @parsec@ or @trifecta@.
    --
    -- We parametrize the parsing by the type of the variable identifiers,
    -- @i@.  We do so because we use this parser to implement anti-quoters
    -- referring to Haskell variables, and thus we need to parse Haskell
    -- identifiers in certain positions.
    type CParser i m =
      ( Monad m
      , Functor m
      , Applicative m
      , MonadPlus m
      , Parsing m
      , CharParsing m
      , TokenParsing m
      , LookAheadParsing m
      , MonadReader (CParserContext i) m
    #if (MIN_VERSION_base(4,13,0))
      , MonadFail m
    #endif
      , Hashable i
      )

    -- | Runs a @'CParser'@ using @parsec@.
    runCParser
      :: Parsec.Stream s Identity Char
      => CParserContext i
      -> String
      -- ^ Source name.
      -> s
      -- ^ String to parse.
      -> (ReaderT (CParserContext i) (Parsec.Parsec s ()) a)
      -- ^ Parser.  Anything with type @forall m. CParser i m => m a@ is a
      -- valid argument.
      -> Either Parsec.ParseError a
    runCParser :: forall s i a.
    Stream s Identity Char =>
    CParserContext i
    -> String
    -> s
    -> ReaderT (CParserContext i) (Parsec s ()) a
    -> Either ParseError a
    runCParser CParserContext i
    typeNames String
    fn s
    s ReaderT (CParserContext i) (Parsec s ()) a
    p = Parsec s () a -> String -> s -> Either ParseError a
    forall s t a.
    Stream s Identity t =>
    Parsec s () a -> String -> s -> Either ParseError a
    Parsec.parse (ReaderT (CParserContext i) (Parsec s ()) a
    -> CParserContext i -> Parsec s () a
    forall r (m :: * -> *) a. ReaderT r m a -> r -> m a
    runReaderT ReaderT (CParserContext i) (Parsec s ()) a
    p CParserContext i
    typeNames) String
    fn s
    s

    -- | Useful for quick testing.  Uses @\"quickCParser\"@ as source name, and throws
    -- an 'error' if parsing fails.
    quickCParser
      :: CParserContext i
      -> String
      -- ^ String to parse.
      -> (ReaderT (CParserContext i) (Parsec.Parsec String ()) a)
      -- ^ Parser.  Anything with type @forall m. CParser i m => m a@ is a
      -- valid argument.
      -> a
    quickCParser :: forall i a.
    CParserContext i
    -> String
    -> ReaderT (CParserContext i) (ParsecT String () Identity) a
    -> a
    quickCParser CParserContext i
    typeNames String
    s ReaderT (CParserContext i) (ParsecT String () Identity) a
    p = case CParserContext i
    -> String
    -> String
    -> ReaderT (CParserContext i) (ParsecT String () Identity) a
    -> Either ParseError a
    forall s i a.
    Stream s Identity Char =>
    CParserContext i
    -> String
    -> s
    -> ReaderT (CParserContext i) (Parsec s ()) a
    -> Either ParseError a
    runCParser CParserContext i
    typeNames String
    "quickCParser" String
    s ReaderT (CParserContext i) (ParsecT String () Identity) a
    p of
      Left ParseError
    err -> String -> a
    forall a. HasCallStack => String -> a
    error (String -> a) -> String -> a
    forall a b. (a -> b) -> a -> b
    $ String
    "quickCParser: " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ ParseError -> String
    forall a. Show a => a -> String
    show ParseError
    err
      Right a
    x -> a
    x

    -- | Like 'quickCParser', but uses @'cCParserContext' ('const' 'False')@ as
    -- 'CParserContext'.
    quickCParser_
      :: Bool
      -> String
      -- ^ String to parse.
      -> (ReaderT (CParserContext CIdentifier) (Parsec.Parsec String ()) a)
      -- ^ Parser.  Anything with type @forall m. CParser i m => m a@ is a
      -- valid argument.
      -> a
    quickCParser_ :: forall a.
    Bool
    -> String
    -> ReaderT
         (CParserContext CIdentifier) (ParsecT String () Identity) a
    -> a
    quickCParser_ Bool
    useCpp = CParserContext CIdentifier
    -> String
    -> ReaderT
         (CParserContext CIdentifier) (ParsecT String () Identity) a
    -> a
    forall i a.
    CParserContext i
    -> String
    -> ReaderT (CParserContext i) (ParsecT String () Identity) a
    -> a
    quickCParser (Bool -> TypeNames -> CParserContext CIdentifier
    cCParserContext Bool
    useCpp TypeNames
    forall a. HashSet a
    HashSet.empty)

    cReservedWords :: HashSet.HashSet String
    cReservedWords :: HashSet String
    cReservedWords = [String] -> HashSet String
    forall a. (Eq a, Hashable a) => [a] -> HashSet a
    HashSet.fromList
      [ String
    "auto", String
    "else", String
    "long", String
    "switch"
      , String
    "break", String
    "enum", String
    "register", String
    "typedef"
      , String
    "case", String
    "extern", String
    "return", String
    "union"
      , String
    "char", String
    "float", String
    "short", String
    "unsigned"
      , String
    "const", String
    "for", String
    "signed", String
    "void"
      , String
    "continue", String
    "goto", String
    "sizeof", String
    "volatile"
      , String
    "default", String
    "if", String
    "static", String
    "while"
      , String
    "do", String
    "int", String
    "struct", String
    "double"
      ]

    cIdentStart :: [Char]
    cIdentStart :: String
    cIdentStart = [Char
    'a'..Char
    'z'] String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ [Char
    'A'..Char
    'Z'] String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ [Char
    '_']

    cIdentLetter :: [Char]
    cIdentLetter :: String
    cIdentLetter = [Char
    'a'..Char
    'z'] String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ [Char
    'A'..Char
    'Z'] String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ [Char
    '_'] String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ [Char
    '0'..Char
    '9']

    cIdentStyle :: (TokenParsing m, Monad m) => IdentifierStyle m
    cIdentStyle :: forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle = IdentifierStyle
      { _styleName :: String
    _styleName = String
    "C identifier"
      , _styleStart :: m Char
    _styleStart = String -> m Char
    forall (m :: * -> *). CharParsing m => String -> m Char
    oneOf String
    cIdentStart
      , _styleLetter :: m Char
    _styleLetter = String -> m Char
    forall (m :: * -> *). CharParsing m => String -> m Char
    oneOf String
    cIdentLetter
      , _styleReserved :: HashSet String
    _styleReserved = HashSet String
    cReservedWords
      , _styleHighlight :: Highlight
    _styleHighlight = Highlight
    Highlight.Identifier
      , _styleReservedHighlight :: Highlight
    _styleReservedHighlight = Highlight
    Highlight.ReservedIdentifier
      }

    data DeclarationSpecifier
      = StorageClassSpecifier StorageClassSpecifier
      | TypeSpecifier TypeSpecifier
      | TypeQualifier TypeQualifier
      | FunctionSpecifier FunctionSpecifier
      deriving (Typeable, DeclarationSpecifier -> DeclarationSpecifier -> Bool
    (DeclarationSpecifier -> DeclarationSpecifier -> Bool)
    -> (DeclarationSpecifier -> DeclarationSpecifier -> Bool)
    -> Eq DeclarationSpecifier
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: DeclarationSpecifier -> DeclarationSpecifier -> Bool
    == :: DeclarationSpecifier -> DeclarationSpecifier -> Bool
    $c/= :: DeclarationSpecifier -> DeclarationSpecifier -> Bool
    /= :: DeclarationSpecifier -> DeclarationSpecifier -> Bool
    Eq, Int -> DeclarationSpecifier -> String -> String
    [DeclarationSpecifier] -> String -> String
    DeclarationSpecifier -> String
    (Int -> DeclarationSpecifier -> String -> String)
    -> (DeclarationSpecifier -> String)
    -> ([DeclarationSpecifier] -> String -> String)
    -> Show DeclarationSpecifier
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: Int -> DeclarationSpecifier -> String -> String
    showsPrec :: Int -> DeclarationSpecifier -> String -> String
    $cshow :: DeclarationSpecifier -> String
    show :: DeclarationSpecifier -> String
    $cshowList :: [DeclarationSpecifier] -> String -> String
    showList :: [DeclarationSpecifier] -> String -> String
    Show)

    declaration_specifiers :: CParser i m => m [DeclarationSpecifier]
    declaration_specifiers :: forall i (m :: * -> *). CParser i m => m [DeclarationSpecifier]
    declaration_specifiers = m DeclarationSpecifier -> m [DeclarationSpecifier]
    forall i (m :: * -> *) a. CParser i m => m a -> m [a]
    many1 (m DeclarationSpecifier -> m [DeclarationSpecifier])
    -> m DeclarationSpecifier -> m [DeclarationSpecifier]
    forall a b. (a -> b) -> a -> b
    $ [m DeclarationSpecifier] -> m DeclarationSpecifier
    forall (t :: * -> *) (m :: * -> *) a.
    (Foldable t, MonadPlus m) =>
    t (m a) -> m a
    msum
      [ StorageClassSpecifier -> DeclarationSpecifier
    StorageClassSpecifier (StorageClassSpecifier -> DeclarationSpecifier)
    -> m StorageClassSpecifier -> m DeclarationSpecifier
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m StorageClassSpecifier
    forall i (m :: * -> *). CParser i m => m StorageClassSpecifier
    storage_class_specifier
      , TypeSpecifier -> DeclarationSpecifier
    TypeSpecifier (TypeSpecifier -> DeclarationSpecifier)
    -> m TypeSpecifier -> m DeclarationSpecifier
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m TypeSpecifier
    forall i (m :: * -> *). CParser i m => m TypeSpecifier
    type_specifier
      , TypeQualifier -> DeclarationSpecifier
    TypeQualifier (TypeQualifier -> DeclarationSpecifier)
    -> m TypeQualifier -> m DeclarationSpecifier
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m TypeQualifier
    forall i (m :: * -> *). CParser i m => m TypeQualifier
    type_qualifier
      , FunctionSpecifier -> DeclarationSpecifier
    FunctionSpecifier (FunctionSpecifier -> DeclarationSpecifier)
    -> m FunctionSpecifier -> m DeclarationSpecifier
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m FunctionSpecifier
    forall i (m :: * -> *). CParser i m => m FunctionSpecifier
    function_specifier
      ]

    data StorageClassSpecifier
      = TYPEDEF
      | EXTERN
      | STATIC
      | AUTO
      | REGISTER
      deriving (Typeable, StorageClassSpecifier -> StorageClassSpecifier -> Bool
    (StorageClassSpecifier -> StorageClassSpecifier -> Bool)
    -> (StorageClassSpecifier -> StorageClassSpecifier -> Bool)
    -> Eq StorageClassSpecifier
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: StorageClassSpecifier -> StorageClassSpecifier -> Bool
    == :: StorageClassSpecifier -> StorageClassSpecifier -> Bool
    $c/= :: StorageClassSpecifier -> StorageClassSpecifier -> Bool
    /= :: StorageClassSpecifier -> StorageClassSpecifier -> Bool
    Eq, Int -> StorageClassSpecifier -> String -> String
    [StorageClassSpecifier] -> String -> String
    StorageClassSpecifier -> String
    (Int -> StorageClassSpecifier -> String -> String)
    -> (StorageClassSpecifier -> String)
    -> ([StorageClassSpecifier] -> String -> String)
    -> Show StorageClassSpecifier
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: Int -> StorageClassSpecifier -> String -> String
    showsPrec :: Int -> StorageClassSpecifier -> String -> String
    $cshow :: StorageClassSpecifier -> String
    show :: StorageClassSpecifier -> String
    $cshowList :: [StorageClassSpecifier] -> String -> String
    showList :: [StorageClassSpecifier] -> String -> String
    Show)

    storage_class_specifier :: CParser i m => m StorageClassSpecifier
    storage_class_specifier :: forall i (m :: * -> *). CParser i m => m StorageClassSpecifier
    storage_class_specifier = [m StorageClassSpecifier] -> m StorageClassSpecifier
    forall (t :: * -> *) (m :: * -> *) a.
    (Foldable t, MonadPlus m) =>
    t (m a) -> m a
    msum
      [ StorageClassSpecifier
    TYPEDEF StorageClassSpecifier -> m () -> m StorageClassSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "typedef"
      , StorageClassSpecifier
    EXTERN StorageClassSpecifier -> m () -> m StorageClassSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "extern"
      , StorageClassSpecifier
    STATIC StorageClassSpecifier -> m () -> m StorageClassSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "static"
      , StorageClassSpecifier
    AUTO StorageClassSpecifier -> m () -> m StorageClassSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "auto"
      , StorageClassSpecifier
    REGISTER StorageClassSpecifier -> m () -> m StorageClassSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "register"
      ]

    data TypeSpecifier
      = VOID
      | BOOL
      | CHAR
      | SHORT
      | INT
      | LONG
      | FLOAT
      | DOUBLE
      | SIGNED
      | UNSIGNED
      | Struct CIdentifier
      | Enum CIdentifier
      | TypeName CIdentifier
      | Template CIdentifier [[TypeSpecifier]]
      | TemplateConst String
      | TemplatePointer TypeSpecifier
      deriving (Typeable, TypeSpecifier -> TypeSpecifier -> Bool
    (TypeSpecifier -> TypeSpecifier -> Bool)
    -> (TypeSpecifier -> TypeSpecifier -> Bool) -> Eq TypeSpecifier
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: TypeSpecifier -> TypeSpecifier -> Bool
    == :: TypeSpecifier -> TypeSpecifier -> Bool
    $c/= :: TypeSpecifier -> TypeSpecifier -> Bool
    /= :: TypeSpecifier -> TypeSpecifier -> Bool
    Eq, Int -> TypeSpecifier -> String -> String
    [TypeSpecifier] -> String -> String
    TypeSpecifier -> String
    (Int -> TypeSpecifier -> String -> String)
    -> (TypeSpecifier -> String)
    -> ([TypeSpecifier] -> String -> String)
    -> Show TypeSpecifier
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: Int -> TypeSpecifier -> String -> String
    showsPrec :: Int -> TypeSpecifier -> String -> String
    $cshow :: TypeSpecifier -> String
    show :: TypeSpecifier -> String
    $cshowList :: [TypeSpecifier] -> String -> String
    showList :: [TypeSpecifier] -> String -> String
    Show)

    type_specifier :: CParser i m => m TypeSpecifier
    type_specifier :: forall i (m :: * -> *). CParser i m => m TypeSpecifier
    type_specifier = [m TypeSpecifier] -> m TypeSpecifier
    forall (t :: * -> *) (m :: * -> *) a.
    (Foldable t, MonadPlus m) =>
    t (m a) -> m a
    msum
      [ TypeSpecifier
    VOID TypeSpecifier -> m () -> m TypeSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "void"
      , TypeSpecifier
    BOOL TypeSpecifier -> m () -> m TypeSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "bool"
      , TypeSpecifier
    CHAR TypeSpecifier -> m () -> m TypeSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "char"
      , TypeSpecifier
    SHORT TypeSpecifier -> m () -> m TypeSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "short"
      , TypeSpecifier
    INT TypeSpecifier -> m () -> m TypeSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "int"
      , TypeSpecifier
    LONG TypeSpecifier -> m () -> m TypeSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "long"
      , TypeSpecifier
    FLOAT TypeSpecifier -> m () -> m TypeSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "float"
      , TypeSpecifier
    DOUBLE TypeSpecifier -> m () -> m TypeSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "double"
      , TypeSpecifier
    SIGNED TypeSpecifier -> m () -> m TypeSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "signed"
      , TypeSpecifier
    UNSIGNED TypeSpecifier -> m () -> m TypeSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "unsigned"
      , CIdentifier -> TypeSpecifier
    Struct (CIdentifier -> TypeSpecifier) -> m CIdentifier -> m TypeSpecifier
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "struct" m () -> m CIdentifier -> m CIdentifier
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> m CIdentifier
    forall i (m :: * -> *). CParser i m => m CIdentifier
    cidentifier)
      , CIdentifier -> TypeSpecifier
    Enum (CIdentifier -> TypeSpecifier) -> m CIdentifier -> m TypeSpecifier
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "enum" m () -> m CIdentifier -> m CIdentifier
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> m CIdentifier
    forall i (m :: * -> *). CParser i m => m CIdentifier
    cidentifier)
      , m TypeSpecifier
    forall i (m :: * -> *). CParser i m => m TypeSpecifier
    template_parser
      , CIdentifier -> TypeSpecifier
    TypeName (CIdentifier -> TypeSpecifier) -> m CIdentifier -> m TypeSpecifier
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m CIdentifier
    forall i (m :: * -> *). CParser i m => m CIdentifier
    type_name
      ]

    identifier :: CParser i m => m i
    identifier :: forall i (m :: * -> *). CParser i m => m i
    identifier = m i -> m i
    forall a. m a -> m a
    forall (m :: * -> *) a. TokenParsing m => m a -> m a
    token m i
    forall i (m :: * -> *). CParser i m => m i
    identifier_no_lex

    isTypeName :: Bool -> TypeNames -> String -> Bool
    isTypeName :: Bool -> TypeNames -> String -> Bool
    isTypeName Bool
    useCpp TypeNames
    typeNames String
    id_ =
      case Bool -> String -> Either String CIdentifier
    cIdentifierFromString Bool
    useCpp String
    id_ of
        -- If it's not a valid C identifier, then it's definitely not a C type name.
        Left String
    _err -> Bool
    False
        Right CIdentifier
    s -> CIdentifier -> TypeNames -> Bool
    forall a. (Eq a, Hashable a) => a -> HashSet a -> Bool
    HashSet.member CIdentifier
    s TypeNames
    typeNames

    identifier_no_lex :: CParser i m => m i
    identifier_no_lex :: forall i (m :: * -> *). CParser i m => m i
    identifier_no_lex = m i -> m i
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try (m i -> m i) -> m i -> m i
    forall a b. (a -> b) -> a -> b
    $ do
      ctx <- m (CParserContext i)
    forall r (m :: * -> *). MonadReader r m => m r
    ask
      id_ <- cpcParseIdent ctx <?> cpcIdentName ctx
      when (isTypeName (cpcEnableCpp ctx) (cpcTypeNames ctx) (cpcIdentToString ctx id_)) $
        unexpected $ "type name " ++ cpcIdentToString ctx id_
      return id_

    -- | Same as 'cidentifier_no_lex', but does not check that the
    -- identifier is not a type name.
    cidentifier_raw :: (TokenParsing m, Monad m) => Bool -> m CIdentifier
    cidentifier_raw :: forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    Bool -> m CIdentifier
    cidentifier_raw Bool
    useCpp = Bool -> IdentifierStyle m -> m CIdentifier
    forall (m :: * -> *) s.
    (TokenParsing m, Monad m, IsString s) =>
    Bool -> IdentifierStyle m -> m s
    identNoLex Bool
    useCpp IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle

    -- | This parser parses a 'CIdentifier' and nothing else -- it does not consume
    -- trailing spaces and the like.
    cidentifier_no_lex :: CParser i m => m CIdentifier
    cidentifier_no_lex :: forall i (m :: * -> *). CParser i m => m CIdentifier
    cidentifier_no_lex = m CIdentifier -> m CIdentifier
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try (m CIdentifier -> m CIdentifier) -> m CIdentifier -> m CIdentifier
    forall a b. (a -> b) -> a -> b
    $ do
      ctx <- m (CParserContext i)
    forall r (m :: * -> *). MonadReader r m => m r
    ask
      s <- cidentifier_raw (cpcEnableCpp ctx)
      typeNames <- asks cpcTypeNames
      when (HashSet.member s typeNames) $
        unexpected $ "type name " ++ unCIdentifier s
      return s

    cidentifier :: CParser i m => m CIdentifier
    cidentifier :: forall i (m :: * -> *). CParser i m => m CIdentifier
    cidentifier = m CIdentifier -> m CIdentifier
    forall a. m a -> m a
    forall (m :: * -> *) a. TokenParsing m => m a -> m a
    token m CIdentifier
    forall i (m :: * -> *). CParser i m => m CIdentifier
    cidentifier_no_lex

    type_name :: CParser i m => m CIdentifier
    type_name :: forall i (m :: * -> *). CParser i m => m CIdentifier
    type_name = m CIdentifier -> m CIdentifier
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try (m CIdentifier -> m CIdentifier) -> m CIdentifier -> m CIdentifier
    forall a b. (a -> b) -> a -> b
    $ do
      ctx <- m (CParserContext i)
    forall r (m :: * -> *). MonadReader r m => m r
    ask
      s <- ident' (cpcEnableCpp ctx) cIdentStyle <?> "type name"
      typeNames <- asks cpcTypeNames
      unless (HashSet.member s typeNames) $
        unexpected $ "identifier  " ++ unCIdentifier s
      return s

    templateParser :: (Monad m, CharParsing m, CParser i m) => IdentifierStyle m -> m TypeSpecifier
    templateParser :: forall (m :: * -> *) i.
    (Monad m, CharParsing m, CParser i m) =>
    IdentifierStyle m -> m TypeSpecifier
    templateParser IdentifierStyle m
    s = m TypeSpecifier
    parse'
      where
        parse' :: m TypeSpecifier
    parse' = do
          id' <- m String
    cidentParserWithNamespace
          _ <- string "<"
          args <- templateArgParser
          _ <- string ">"
          return $ Template (CIdentifier id') args
        cidentParser :: m String
    cidentParser = ((:) (Char -> String -> String) -> m Char -> m (String -> String)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> IdentifierStyle m -> m Char
    forall (m :: * -> *). IdentifierStyle m -> m Char
    _styleStart IdentifierStyle m
    s m (String -> String) -> m String -> m String
    forall a b. m (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> m Char -> m String
    forall a. m a -> m [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many (IdentifierStyle m -> m Char
    forall (m :: * -> *). IdentifierStyle m -> m Char
    _styleLetter IdentifierStyle m
    s) m String -> String -> m String
    forall a. m a -> String -> m a
    forall (m :: * -> *) a. Parsing m => m a -> String -> m a
    <?> IdentifierStyle m -> String
    forall (m :: * -> *). IdentifierStyle m -> String
    _styleName IdentifierStyle m
    s)
        cidentParserWithNamespace :: m String
    cidentParserWithNamespace =
          m String -> m String
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try ([String] -> String
    forall (t :: * -> *) a. Foldable t => t [a] -> [a]
    concat ([String] -> String) -> m [String] -> m String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> [m String] -> m [String]
    forall (t :: * -> *) (m :: * -> *) a.
    (Traversable t, Monad m) =>
    t (m a) -> m (t a)
    forall (m :: * -> *) a. Monad m => [m a] -> m [a]
    sequence [m String
    cidentParser, (String -> m String
    forall (m :: * -> *). CharParsing m => String -> m String
    string String
    "::"), m String
    cidentParserWithNamespace]) m String -> m String -> m String
    forall a. m a -> m a -> m a
    forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
    <|>
          m String
    cidentParser
        templateArgType :: m TypeSpecifier
    templateArgType = m TypeSpecifier -> m TypeSpecifier
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try ((TypeSpecifier -> TypeSpecifier
    TemplatePointer (TypeSpecifier -> TypeSpecifier)
    -> m TypeSpecifier -> m TypeSpecifier
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (m TypeSpecifier
    forall i (m :: * -> *). CParser i m => m TypeSpecifier
    type_specifier)) m TypeSpecifier -> m String -> m TypeSpecifier
    forall a b. m a -> m b -> m a
    forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
    <* (String -> m String
    forall (m :: * -> *). CharParsing m => String -> m String
    string String
    "*")) m TypeSpecifier -> m TypeSpecifier -> m TypeSpecifier
    forall a. m a -> m a -> m a
    forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
    <|> m TypeSpecifier -> m TypeSpecifier
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try m TypeSpecifier
    forall i (m :: * -> *). CParser i m => m TypeSpecifier
    type_specifier m TypeSpecifier -> m TypeSpecifier -> m TypeSpecifier
    forall a. m a -> m a -> m a
    forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
    <|> (String -> TypeSpecifier
    TemplateConst (String -> TypeSpecifier) -> m String -> m TypeSpecifier
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (m Char -> m String
    forall a. m a -> m [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    some (m Char -> m String) -> m Char -> m String
    forall a b. (a -> b) -> a -> b
    $ String -> m Char
    forall (m :: * -> *). CharParsing m => String -> m Char
    oneOf [Char
    '0'..Char
    '9']))
        templateArgParser' :: m [[TypeSpecifier]]
    templateArgParser' = do
          t <- m TypeSpecifier -> m [TypeSpecifier]
    forall a. m a -> m [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    some (m TypeSpecifier -> m TypeSpecifier
    forall a. m a -> m a
    forall (m :: * -> *) a. TokenParsing m => m a -> m a
    token m TypeSpecifier
    templateArgType)
          _ <- string ","
          tt <- templateArgParser
          return $ t:tt
        templateArgParser :: m [[TypeSpecifier]]
    templateArgParser =
          m [[TypeSpecifier]] -> m [[TypeSpecifier]]
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try (m [[TypeSpecifier]]
    templateArgParser') m [[TypeSpecifier]] -> m [[TypeSpecifier]] -> m [[TypeSpecifier]]
    forall a. m a -> m a -> m a
    forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
    <|> ((:) ([TypeSpecifier] -> [[TypeSpecifier]] -> [[TypeSpecifier]])
    -> m [TypeSpecifier] -> m ([[TypeSpecifier]] -> [[TypeSpecifier]])
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m TypeSpecifier -> m [TypeSpecifier]
    forall a. m a -> m [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    some (m TypeSpecifier -> m TypeSpecifier
    forall a. m a -> m a
    forall (m :: * -> *) a. TokenParsing m => m a -> m a
    token m TypeSpecifier
    templateArgType) m ([[TypeSpecifier]] -> [[TypeSpecifier]])
    -> m [[TypeSpecifier]] -> m [[TypeSpecifier]]
    forall a b. m (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> [[TypeSpecifier]] -> m [[TypeSpecifier]]
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return [])

    template_parser :: CParser i m => m TypeSpecifier
    template_parser :: forall i (m :: * -> *). CParser i m => m TypeSpecifier
    template_parser = m TypeSpecifier -> m TypeSpecifier
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try (m TypeSpecifier -> m TypeSpecifier)
    -> m TypeSpecifier -> m TypeSpecifier
    forall a b. (a -> b) -> a -> b
    $ IdentifierStyle m -> m TypeSpecifier
    forall (m :: * -> *) i.
    (Monad m, CharParsing m, CParser i m) =>
    IdentifierStyle m -> m TypeSpecifier
    templateParser IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle m TypeSpecifier -> String -> m TypeSpecifier
    forall a. m a -> String -> m a
    forall (m :: * -> *) a. Parsing m => m a -> String -> m a
    <?> String
    "template name"

    data TypeQualifier
      = CONST
      | RESTRICT
      | VOLATILE
      deriving (Typeable, TypeQualifier -> TypeQualifier -> Bool
    (TypeQualifier -> TypeQualifier -> Bool)
    -> (TypeQualifier -> TypeQualifier -> Bool) -> Eq TypeQualifier
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: TypeQualifier -> TypeQualifier -> Bool
    == :: TypeQualifier -> TypeQualifier -> Bool
    $c/= :: TypeQualifier -> TypeQualifier -> Bool
    /= :: TypeQualifier -> TypeQualifier -> Bool
    Eq, Int -> TypeQualifier -> String -> String
    [TypeQualifier] -> String -> String
    TypeQualifier -> String
    (Int -> TypeQualifier -> String -> String)
    -> (TypeQualifier -> String)
    -> ([TypeQualifier] -> String -> String)
    -> Show TypeQualifier
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: Int -> TypeQualifier -> String -> String
    showsPrec :: Int -> TypeQualifier -> String -> String
    $cshow :: TypeQualifier -> String
    show :: TypeQualifier -> String
    $cshowList :: [TypeQualifier] -> String -> String
    showList :: [TypeQualifier] -> String -> String
    Show)

    type_qualifier :: CParser i m => m TypeQualifier
    type_qualifier :: forall i (m :: * -> *). CParser i m => m TypeQualifier
    type_qualifier = [m TypeQualifier] -> m TypeQualifier
    forall (t :: * -> *) (m :: * -> *) a.
    (Foldable t, MonadPlus m) =>
    t (m a) -> m a
    msum
      [ TypeQualifier
    CONST TypeQualifier -> m () -> m TypeQualifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "const"
      , TypeQualifier
    RESTRICT TypeQualifier -> m () -> m TypeQualifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "restrict"
      , TypeQualifier
    VOLATILE TypeQualifier -> m () -> m TypeQualifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "volatile"
      ]

    data FunctionSpecifier
      = INLINE
      deriving (Typeable, FunctionSpecifier -> FunctionSpecifier -> Bool
    (FunctionSpecifier -> FunctionSpecifier -> Bool)
    -> (FunctionSpecifier -> FunctionSpecifier -> Bool)
    -> Eq FunctionSpecifier
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: FunctionSpecifier -> FunctionSpecifier -> Bool
    == :: FunctionSpecifier -> FunctionSpecifier -> Bool
    $c/= :: FunctionSpecifier -> FunctionSpecifier -> Bool
    /= :: FunctionSpecifier -> FunctionSpecifier -> Bool
    Eq, Int -> FunctionSpecifier -> String -> String
    [FunctionSpecifier] -> String -> String
    FunctionSpecifier -> String
    (Int -> FunctionSpecifier -> String -> String)
    -> (FunctionSpecifier -> String)
    -> ([FunctionSpecifier] -> String -> String)
    -> Show FunctionSpecifier
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: Int -> FunctionSpecifier -> String -> String
    showsPrec :: Int -> FunctionSpecifier -> String -> String
    $cshow :: FunctionSpecifier -> String
    show :: FunctionSpecifier -> String
    $cshowList :: [FunctionSpecifier] -> String -> String
    showList :: [FunctionSpecifier] -> String -> String
    Show)

    function_specifier :: CParser i m => m FunctionSpecifier
    function_specifier :: forall i (m :: * -> *). CParser i m => m FunctionSpecifier
    function_specifier = [m FunctionSpecifier] -> m FunctionSpecifier
    forall (t :: * -> *) (m :: * -> *) a.
    (Foldable t, MonadPlus m) =>
    t (m a) -> m a
    msum
      [ FunctionSpecifier
    INLINE FunctionSpecifier -> m () -> m FunctionSpecifier
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ IdentifierStyle m -> String -> m ()
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m -> String -> m ()
    reserve IdentifierStyle m
    forall (m :: * -> *).
    (TokenParsing m, Monad m) =>
    IdentifierStyle m
    cIdentStyle String
    "inline"
      ]

    data Declarator i = Declarator
      { forall i. Declarator i -> [Pointer]
    declaratorPointers :: [Pointer]
      , forall i. Declarator i -> DirectDeclarator i
    declaratorDirect :: (DirectDeclarator i)
      } deriving (Typeable, Declarator i -> Declarator i -> Bool
    (Declarator i -> Declarator i -> Bool)
    -> (Declarator i -> Declarator i -> Bool) -> Eq (Declarator i)
    forall i. Eq i => Declarator i -> Declarator i -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall i. Eq i => Declarator i -> Declarator i -> Bool
    == :: Declarator i -> Declarator i -> Bool
    $c/= :: forall i. Eq i => Declarator i -> Declarator i -> Bool
    /= :: Declarator i -> Declarator i -> Bool
    Eq, Int -> Declarator i -> String -> String
    [Declarator i] -> String -> String
    Declarator i -> String
    (Int -> Declarator i -> String -> String)
    -> (Declarator i -> String)
    -> ([Declarator i] -> String -> String)
    -> Show (Declarator i)
    forall i. Show i => Int -> Declarator i -> String -> String
    forall i. Show i => [Declarator i] -> String -> String
    forall i. Show i => Declarator i -> String
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: forall i. Show i => Int -> Declarator i -> String -> String
    showsPrec :: Int -> Declarator i -> String -> String
    $cshow :: forall i. Show i => Declarator i -> String
    show :: Declarator i -> String
    $cshowList :: forall i. Show i => [Declarator i] -> String -> String
    showList :: [Declarator i] -> String -> String
    Show, (forall a b. (a -> b) -> Declarator a -> Declarator b)
    -> (forall a b. a -> Declarator b -> Declarator a)
    -> Functor Declarator
    forall a b. a -> Declarator b -> Declarator a
    forall a b. (a -> b) -> Declarator a -> Declarator b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a b. (a -> b) -> Declarator a -> Declarator b
    fmap :: forall a b. (a -> b) -> Declarator a -> Declarator b
    $c<$ :: forall a b. a -> Declarator b -> Declarator a
    <$ :: forall a b. a -> Declarator b -> Declarator a
    Functor, (forall m. Monoid m => Declarator m -> m)
    -> (forall m a. Monoid m => (a -> m) -> Declarator a -> m)
    -> (forall m a. Monoid m => (a -> m) -> Declarator a -> m)
    -> (forall a b. (a -> b -> b) -> b -> Declarator a -> b)
    -> (forall a b. (a -> b -> b) -> b -> Declarator a -> b)
    -> (forall b a. (b -> a -> b) -> b -> Declarator a -> b)
    -> (forall b a. (b -> a -> b) -> b -> Declarator a -> b)
    -> (forall a. (a -> a -> a) -> Declarator a -> a)
    -> (forall a. (a -> a -> a) -> Declarator a -> a)
    -> (forall a. Declarator a -> [a])
    -> (forall a. Declarator a -> Bool)
    -> (forall a. Declarator a -> Int)
    -> (forall a. Eq a => a -> Declarator a -> Bool)
    -> (forall a. Ord a => Declarator a -> a)
    -> (forall a. Ord a => Declarator a -> a)
    -> (forall a. Num a => Declarator a -> a)
    -> (forall a. Num a => Declarator a -> a)
    -> Foldable Declarator
    forall a. Eq a => a -> Declarator a -> Bool
    forall a. Num a => Declarator a -> a
    forall a. Ord a => Declarator a -> a
    forall m. Monoid m => Declarator m -> m
    forall a. Declarator a -> Bool
    forall a. Declarator a -> Int
    forall a. Declarator a -> [a]
    forall a. (a -> a -> a) -> Declarator a -> a
    forall m a. Monoid m => (a -> m) -> Declarator a -> m
    forall b a. (b -> a -> b) -> b -> Declarator a -> b
    forall a b. (a -> b -> b) -> b -> Declarator a -> b
    forall (t :: * -> *).
    (forall m. Monoid m => t m -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. t a -> [a])
    -> (forall a. t a -> Bool)
    -> (forall a. t a -> Int)
    -> (forall a. Eq a => a -> t a -> Bool)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> Foldable t
    $cfold :: forall m. Monoid m => Declarator m -> m
    fold :: forall m. Monoid m => Declarator m -> m
    $cfoldMap :: forall m a. Monoid m => (a -> m) -> Declarator a -> m
    foldMap :: forall m a. Monoid m => (a -> m) -> Declarator a -> m
    $cfoldMap' :: forall m a. Monoid m => (a -> m) -> Declarator a -> m
    foldMap' :: forall m a. Monoid m => (a -> m) -> Declarator a -> m
    $cfoldr :: forall a b. (a -> b -> b) -> b -> Declarator a -> b
    foldr :: forall a b. (a -> b -> b) -> b -> Declarator a -> b
    $cfoldr' :: forall a b. (a -> b -> b) -> b -> Declarator a -> b
    foldr' :: forall a b. (a -> b -> b) -> b -> Declarator a -> b
    $cfoldl :: forall b a. (b -> a -> b) -> b -> Declarator a -> b
    foldl :: forall b a. (b -> a -> b) -> b -> Declarator a -> b
    $cfoldl' :: forall b a. (b -> a -> b) -> b -> Declarator a -> b
    foldl' :: forall b a. (b -> a -> b) -> b -> Declarator a -> b
    $cfoldr1 :: forall a. (a -> a -> a) -> Declarator a -> a
    foldr1 :: forall a. (a -> a -> a) -> Declarator a -> a
    $cfoldl1 :: forall a. (a -> a -> a) -> Declarator a -> a
    foldl1 :: forall a. (a -> a -> a) -> Declarator a -> a
    $ctoList :: forall a. Declarator a -> [a]
    toList :: forall a. Declarator a -> [a]
    $cnull :: forall a. Declarator a -> Bool
    null :: forall a. Declarator a -> Bool
    $clength :: forall a. Declarator a -> Int
    length :: forall a. Declarator a -> Int
    $celem :: forall a. Eq a => a -> Declarator a -> Bool
    elem :: forall a. Eq a => a -> Declarator a -> Bool
    $cmaximum :: forall a. Ord a => Declarator a -> a
    maximum :: forall a. Ord a => Declarator a -> a
    $cminimum :: forall a. Ord a => Declarator a -> a
    minimum :: forall a. Ord a => Declarator a -> a
    $csum :: forall a. Num a => Declarator a -> a
    sum :: forall a. Num a => Declarator a -> a
    $cproduct :: forall a. Num a => Declarator a -> a
    product :: forall a. Num a => Declarator a -> a
    Foldable, Functor Declarator
    Foldable Declarator
    (Functor Declarator, Foldable Declarator) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> Declarator a -> f (Declarator b))
    -> (forall (f :: * -> *) a.
        Applicative f =>
        Declarator (f a) -> f (Declarator a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> Declarator a -> m (Declarator b))
    -> (forall (m :: * -> *) a.
        Monad m =>
        Declarator (m a) -> m (Declarator a))
    -> Traversable Declarator
    forall (t :: * -> *).
    (Functor t, Foldable t) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> t a -> f (t b))
    -> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> t a -> m (t b))
    -> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
    -> Traversable t
    forall (m :: * -> *) a.
    Monad m =>
    Declarator (m a) -> m (Declarator a)
    forall (f :: * -> *) a.
    Applicative f =>
    Declarator (f a) -> f (Declarator a)
    forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Declarator a -> m (Declarator b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Declarator a -> f (Declarator b)
    $ctraverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Declarator a -> f (Declarator b)
    traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Declarator a -> f (Declarator b)
    $csequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    Declarator (f a) -> f (Declarator a)
    sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    Declarator (f a) -> f (Declarator a)
    $cmapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Declarator a -> m (Declarator b)
    mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Declarator a -> m (Declarator b)
    $csequence :: forall (m :: * -> *) a.
    Monad m =>
    Declarator (m a) -> m (Declarator a)
    sequence :: forall (m :: * -> *) a.
    Monad m =>
    Declarator (m a) -> m (Declarator a)
    Traversable)

    declarator :: CParser i m => m (Declarator i)
    declarator :: forall i (m :: * -> *). CParser i m => m (Declarator i)
    declarator = ([Pointer] -> DirectDeclarator i -> Declarator i
    forall i. [Pointer] -> DirectDeclarator i -> Declarator i
    Declarator ([Pointer] -> DirectDeclarator i -> Declarator i)
    -> m [Pointer] -> m (DirectDeclarator i -> Declarator i)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m Pointer -> m [Pointer]
    forall a. m a -> m [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many m Pointer
    forall i (m :: * -> *). CParser i m => m Pointer
    pointer m (DirectDeclarator i -> Declarator i)
    -> m (DirectDeclarator i) -> m (Declarator i)
    forall a b. m (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> m (DirectDeclarator i)
    forall i (m :: * -> *). CParser i m => m (DirectDeclarator i)
    direct_declarator) m (Declarator i) -> String -> m (Declarator i)
    forall a. m a -> String -> m a
    forall (m :: * -> *) a. Parsing m => m a -> String -> m a
    <?> String
    "declarator"

    data DirectDeclarator i
      = DeclaratorRoot i
      | ArrayOrProto (DirectDeclarator i) (ArrayOrProto i)
      | DeclaratorParens (Declarator i)
      deriving (Typeable, DirectDeclarator i -> DirectDeclarator i -> Bool
    (DirectDeclarator i -> DirectDeclarator i -> Bool)
    -> (DirectDeclarator i -> DirectDeclarator i -> Bool)
    -> Eq (DirectDeclarator i)
    forall i. Eq i => DirectDeclarator i -> DirectDeclarator i -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall i. Eq i => DirectDeclarator i -> DirectDeclarator i -> Bool
    == :: DirectDeclarator i -> DirectDeclarator i -> Bool
    $c/= :: forall i. Eq i => DirectDeclarator i -> DirectDeclarator i -> Bool
    /= :: DirectDeclarator i -> DirectDeclarator i -> Bool
    Eq, Int -> DirectDeclarator i -> String -> String
    [DirectDeclarator i] -> String -> String
    DirectDeclarator i -> String
    (Int -> DirectDeclarator i -> String -> String)
    -> (DirectDeclarator i -> String)
    -> ([DirectDeclarator i] -> String -> String)
    -> Show (DirectDeclarator i)
    forall i. Show i => Int -> DirectDeclarator i -> String -> String
    forall i. Show i => [DirectDeclarator i] -> String -> String
    forall i. Show i => DirectDeclarator i -> String
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: forall i. Show i => Int -> DirectDeclarator i -> String -> String
    showsPrec :: Int -> DirectDeclarator i -> String -> String
    $cshow :: forall i. Show i => DirectDeclarator i -> String
    show :: DirectDeclarator i -> String
    $cshowList :: forall i. Show i => [DirectDeclarator i] -> String -> String
    showList :: [DirectDeclarator i] -> String -> String
    Show, (forall a b. (a -> b) -> DirectDeclarator a -> DirectDeclarator b)
    -> (forall a b. a -> DirectDeclarator b -> DirectDeclarator a)
    -> Functor DirectDeclarator
    forall a b. a -> DirectDeclarator b -> DirectDeclarator a
    forall a b. (a -> b) -> DirectDeclarator a -> DirectDeclarator b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a b. (a -> b) -> DirectDeclarator a -> DirectDeclarator b
    fmap :: forall a b. (a -> b) -> DirectDeclarator a -> DirectDeclarator b
    $c<$ :: forall a b. a -> DirectDeclarator b -> DirectDeclarator a
    <$ :: forall a b. a -> DirectDeclarator b -> DirectDeclarator a
    Functor, (forall m. Monoid m => DirectDeclarator m -> m)
    -> (forall m a. Monoid m => (a -> m) -> DirectDeclarator a -> m)
    -> (forall m a. Monoid m => (a -> m) -> DirectDeclarator a -> m)
    -> (forall a b. (a -> b -> b) -> b -> DirectDeclarator a -> b)
    -> (forall a b. (a -> b -> b) -> b -> DirectDeclarator a -> b)
    -> (forall b a. (b -> a -> b) -> b -> DirectDeclarator a -> b)
    -> (forall b a. (b -> a -> b) -> b -> DirectDeclarator a -> b)
    -> (forall a. (a -> a -> a) -> DirectDeclarator a -> a)
    -> (forall a. (a -> a -> a) -> DirectDeclarator a -> a)
    -> (forall a. DirectDeclarator a -> [a])
    -> (forall a. DirectDeclarator a -> Bool)
    -> (forall a. DirectDeclarator a -> Int)
    -> (forall a. Eq a => a -> DirectDeclarator a -> Bool)
    -> (forall a. Ord a => DirectDeclarator a -> a)
    -> (forall a. Ord a => DirectDeclarator a -> a)
    -> (forall a. Num a => DirectDeclarator a -> a)
    -> (forall a. Num a => DirectDeclarator a -> a)
    -> Foldable DirectDeclarator
    forall a. Eq a => a -> DirectDeclarator a -> Bool
    forall a. Num a => DirectDeclarator a -> a
    forall a. Ord a => DirectDeclarator a -> a
    forall m. Monoid m => DirectDeclarator m -> m
    forall a. DirectDeclarator a -> Bool
    forall a. DirectDeclarator a -> Int
    forall a. DirectDeclarator a -> [a]
    forall a. (a -> a -> a) -> DirectDeclarator a -> a
    forall m a. Monoid m => (a -> m) -> DirectDeclarator a -> m
    forall b a. (b -> a -> b) -> b -> DirectDeclarator a -> b
    forall a b. (a -> b -> b) -> b -> DirectDeclarator a -> b
    forall (t :: * -> *).
    (forall m. Monoid m => t m -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. t a -> [a])
    -> (forall a. t a -> Bool)
    -> (forall a. t a -> Int)
    -> (forall a. Eq a => a -> t a -> Bool)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> Foldable t
    $cfold :: forall m. Monoid m => DirectDeclarator m -> m
    fold :: forall m. Monoid m => DirectDeclarator m -> m
    $cfoldMap :: forall m a. Monoid m => (a -> m) -> DirectDeclarator a -> m
    foldMap :: forall m a. Monoid m => (a -> m) -> DirectDeclarator a -> m
    $cfoldMap' :: forall m a. Monoid m => (a -> m) -> DirectDeclarator a -> m
    foldMap' :: forall m a. Monoid m => (a -> m) -> DirectDeclarator a -> m
    $cfoldr :: forall a b. (a -> b -> b) -> b -> DirectDeclarator a -> b
    foldr :: forall a b. (a -> b -> b) -> b -> DirectDeclarator a -> b
    $cfoldr' :: forall a b. (a -> b -> b) -> b -> DirectDeclarator a -> b
    foldr' :: forall a b. (a -> b -> b) -> b -> DirectDeclarator a -> b
    $cfoldl :: forall b a. (b -> a -> b) -> b -> DirectDeclarator a -> b
    foldl :: forall b a. (b -> a -> b) -> b -> DirectDeclarator a -> b
    $cfoldl' :: forall b a. (b -> a -> b) -> b -> DirectDeclarator a -> b
    foldl' :: forall b a. (b -> a -> b) -> b -> DirectDeclarator a -> b
    $cfoldr1 :: forall a. (a -> a -> a) -> DirectDeclarator a -> a
    foldr1 :: forall a. (a -> a -> a) -> DirectDeclarator a -> a
    $cfoldl1 :: forall a. (a -> a -> a) -> DirectDeclarator a -> a
    foldl1 :: forall a. (a -> a -> a) -> DirectDeclarator a -> a
    $ctoList :: forall a. DirectDeclarator a -> [a]
    toList :: forall a. DirectDeclarator a -> [a]
    $cnull :: forall a. DirectDeclarator a -> Bool
    null :: forall a. DirectDeclarator a -> Bool
    $clength :: forall a. DirectDeclarator a -> Int
    length :: forall a. DirectDeclarator a -> Int
    $celem :: forall a. Eq a => a -> DirectDeclarator a -> Bool
    elem :: forall a. Eq a => a -> DirectDeclarator a -> Bool
    $cmaximum :: forall a. Ord a => DirectDeclarator a -> a
    maximum :: forall a. Ord a => DirectDeclarator a -> a
    $cminimum :: forall a. Ord a => DirectDeclarator a -> a
    minimum :: forall a. Ord a => DirectDeclarator a -> a
    $csum :: forall a. Num a => DirectDeclarator a -> a
    sum :: forall a. Num a => DirectDeclarator a -> a
    $cproduct :: forall a. Num a => DirectDeclarator a -> a
    product :: forall a. Num a => DirectDeclarator a -> a
    Foldable, Functor DirectDeclarator
    Foldable DirectDeclarator
    (Functor DirectDeclarator, Foldable DirectDeclarator) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> DirectDeclarator a -> f (DirectDeclarator b))
    -> (forall (f :: * -> *) a.
        Applicative f =>
        DirectDeclarator (f a) -> f (DirectDeclarator a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> DirectDeclarator a -> m (DirectDeclarator b))
    -> (forall (m :: * -> *) a.
        Monad m =>
        DirectDeclarator (m a) -> m (DirectDeclarator a))
    -> Traversable DirectDeclarator
    forall (t :: * -> *).
    (Functor t, Foldable t) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> t a -> f (t b))
    -> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> t a -> m (t b))
    -> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
    -> Traversable t
    forall (m :: * -> *) a.
    Monad m =>
    DirectDeclarator (m a) -> m (DirectDeclarator a)
    forall (f :: * -> *) a.
    Applicative f =>
    DirectDeclarator (f a) -> f (DirectDeclarator a)
    forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> DirectDeclarator a -> m (DirectDeclarator b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> DirectDeclarator a -> f (DirectDeclarator b)
    $ctraverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> DirectDeclarator a -> f (DirectDeclarator b)
    traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> DirectDeclarator a -> f (DirectDeclarator b)
    $csequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    DirectDeclarator (f a) -> f (DirectDeclarator a)
    sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    DirectDeclarator (f a) -> f (DirectDeclarator a)
    $cmapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> DirectDeclarator a -> m (DirectDeclarator b)
    mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> DirectDeclarator a -> m (DirectDeclarator b)
    $csequence :: forall (m :: * -> *) a.
    Monad m =>
    DirectDeclarator (m a) -> m (DirectDeclarator a)
    sequence :: forall (m :: * -> *) a.
    Monad m =>
    DirectDeclarator (m a) -> m (DirectDeclarator a)
    Traversable)

    data ArrayOrProto i
      = Array (ArrayType i)
      | Proto [ParameterDeclaration i] -- We don't include old prototypes.
      deriving (ArrayOrProto i -> ArrayOrProto i -> Bool
    (ArrayOrProto i -> ArrayOrProto i -> Bool)
    -> (ArrayOrProto i -> ArrayOrProto i -> Bool)
    -> Eq (ArrayOrProto i)
    forall i. Eq i => ArrayOrProto i -> ArrayOrProto i -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall i. Eq i => ArrayOrProto i -> ArrayOrProto i -> Bool
    == :: ArrayOrProto i -> ArrayOrProto i -> Bool
    $c/= :: forall i. Eq i => ArrayOrProto i -> ArrayOrProto i -> Bool
    /= :: ArrayOrProto i -> ArrayOrProto i -> Bool
    Eq, Int -> ArrayOrProto i -> String -> String
    [ArrayOrProto i] -> String -> String
    ArrayOrProto i -> String
    (Int -> ArrayOrProto i -> String -> String)
    -> (ArrayOrProto i -> String)
    -> ([ArrayOrProto i] -> String -> String)
    -> Show (ArrayOrProto i)
    forall i. Show i => Int -> ArrayOrProto i -> String -> String
    forall i. Show i => [ArrayOrProto i] -> String -> String
    forall i. Show i => ArrayOrProto i -> String
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: forall i. Show i => Int -> ArrayOrProto i -> String -> String
    showsPrec :: Int -> ArrayOrProto i -> String -> String
    $cshow :: forall i. Show i => ArrayOrProto i -> String
    show :: ArrayOrProto i -> String
    $cshowList :: forall i. Show i => [ArrayOrProto i] -> String -> String
    showList :: [ArrayOrProto i] -> String -> String
    Show, Typeable, (forall a b. (a -> b) -> ArrayOrProto a -> ArrayOrProto b)
    -> (forall a b. a -> ArrayOrProto b -> ArrayOrProto a)
    -> Functor ArrayOrProto
    forall a b. a -> ArrayOrProto b -> ArrayOrProto a
    forall a b. (a -> b) -> ArrayOrProto a -> ArrayOrProto b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a b. (a -> b) -> ArrayOrProto a -> ArrayOrProto b
    fmap :: forall a b. (a -> b) -> ArrayOrProto a -> ArrayOrProto b
    $c<$ :: forall a b. a -> ArrayOrProto b -> ArrayOrProto a
    <$ :: forall a b. a -> ArrayOrProto b -> ArrayOrProto a
    Functor, (forall m. Monoid m => ArrayOrProto m -> m)
    -> (forall m a. Monoid m => (a -> m) -> ArrayOrProto a -> m)
    -> (forall m a. Monoid m => (a -> m) -> ArrayOrProto a -> m)
    -> (forall a b. (a -> b -> b) -> b -> ArrayOrProto a -> b)
    -> (forall a b. (a -> b -> b) -> b -> ArrayOrProto a -> b)
    -> (forall b a. (b -> a -> b) -> b -> ArrayOrProto a -> b)
    -> (forall b a. (b -> a -> b) -> b -> ArrayOrProto a -> b)
    -> (forall a. (a -> a -> a) -> ArrayOrProto a -> a)
    -> (forall a. (a -> a -> a) -> ArrayOrProto a -> a)
    -> (forall a. ArrayOrProto a -> [a])
    -> (forall a. ArrayOrProto a -> Bool)
    -> (forall a. ArrayOrProto a -> Int)
    -> (forall a. Eq a => a -> ArrayOrProto a -> Bool)
    -> (forall a. Ord a => ArrayOrProto a -> a)
    -> (forall a. Ord a => ArrayOrProto a -> a)
    -> (forall a. Num a => ArrayOrProto a -> a)
    -> (forall a. Num a => ArrayOrProto a -> a)
    -> Foldable ArrayOrProto
    forall a. Eq a => a -> ArrayOrProto a -> Bool
    forall a. Num a => ArrayOrProto a -> a
    forall a. Ord a => ArrayOrProto a -> a
    forall m. Monoid m => ArrayOrProto m -> m
    forall a. ArrayOrProto a -> Bool
    forall a. ArrayOrProto a -> Int
    forall a. ArrayOrProto a -> [a]
    forall a. (a -> a -> a) -> ArrayOrProto a -> a
    forall m a. Monoid m => (a -> m) -> ArrayOrProto a -> m
    forall b a. (b -> a -> b) -> b -> ArrayOrProto a -> b
    forall a b. (a -> b -> b) -> b -> ArrayOrProto a -> b
    forall (t :: * -> *).
    (forall m. Monoid m => t m -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. t a -> [a])
    -> (forall a. t a -> Bool)
    -> (forall a. t a -> Int)
    -> (forall a. Eq a => a -> t a -> Bool)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> Foldable t
    $cfold :: forall m. Monoid m => ArrayOrProto m -> m
    fold :: forall m. Monoid m => ArrayOrProto m -> m
    $cfoldMap :: forall m a. Monoid m => (a -> m) -> ArrayOrProto a -> m
    foldMap :: forall m a. Monoid m => (a -> m) -> ArrayOrProto a -> m
    $cfoldMap' :: forall m a. Monoid m => (a -> m) -> ArrayOrProto a -> m
    foldMap' :: forall m a. Monoid m => (a -> m) -> ArrayOrProto a -> m
    $cfoldr :: forall a b. (a -> b -> b) -> b -> ArrayOrProto a -> b
    foldr :: forall a b. (a -> b -> b) -> b -> ArrayOrProto a -> b
    $cfoldr' :: forall a b. (a -> b -> b) -> b -> ArrayOrProto a -> b
    foldr' :: forall a b. (a -> b -> b) -> b -> ArrayOrProto a -> b
    $cfoldl :: forall b a. (b -> a -> b) -> b -> ArrayOrProto a -> b
    foldl :: forall b a. (b -> a -> b) -> b -> ArrayOrProto a -> b
    $cfoldl' :: forall b a. (b -> a -> b) -> b -> ArrayOrProto a -> b
    foldl' :: forall b a. (b -> a -> b) -> b -> ArrayOrProto a -> b
    $cfoldr1 :: forall a. (a -> a -> a) -> ArrayOrProto a -> a
    foldr1 :: forall a. (a -> a -> a) -> ArrayOrProto a -> a
    $cfoldl1 :: forall a. (a -> a -> a) -> ArrayOrProto a -> a
    foldl1 :: forall a. (a -> a -> a) -> ArrayOrProto a -> a
    $ctoList :: forall a. ArrayOrProto a -> [a]
    toList :: forall a. ArrayOrProto a -> [a]
    $cnull :: forall a. ArrayOrProto a -> Bool
    null :: forall a. ArrayOrProto a -> Bool
    $clength :: forall a. ArrayOrProto a -> Int
    length :: forall a. ArrayOrProto a -> Int
    $celem :: forall a. Eq a => a -> ArrayOrProto a -> Bool
    elem :: forall a. Eq a => a -> ArrayOrProto a -> Bool
    $cmaximum :: forall a. Ord a => ArrayOrProto a -> a
    maximum :: forall a. Ord a => ArrayOrProto a -> a
    $cminimum :: forall a. Ord a => ArrayOrProto a -> a
    minimum :: forall a. Ord a => ArrayOrProto a -> a
    $csum :: forall a. Num a => ArrayOrProto a -> a
    sum :: forall a. Num a => ArrayOrProto a -> a
    $cproduct :: forall a. Num a => ArrayOrProto a -> a
    product :: forall a. Num a => ArrayOrProto a -> a
    Foldable, Functor ArrayOrProto
    Foldable ArrayOrProto
    (Functor ArrayOrProto, Foldable ArrayOrProto) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> ArrayOrProto a -> f (ArrayOrProto b))
    -> (forall (f :: * -> *) a.
        Applicative f =>
        ArrayOrProto (f a) -> f (ArrayOrProto a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> ArrayOrProto a -> m (ArrayOrProto b))
    -> (forall (m :: * -> *) a.
        Monad m =>
        ArrayOrProto (m a) -> m (ArrayOrProto a))
    -> Traversable ArrayOrProto
    forall (t :: * -> *).
    (Functor t, Foldable t) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> t a -> f (t b))
    -> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> t a -> m (t b))
    -> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
    -> Traversable t
    forall (m :: * -> *) a.
    Monad m =>
    ArrayOrProto (m a) -> m (ArrayOrProto a)
    forall (f :: * -> *) a.
    Applicative f =>
    ArrayOrProto (f a) -> f (ArrayOrProto a)
    forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ArrayOrProto a -> m (ArrayOrProto b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ArrayOrProto a -> f (ArrayOrProto b)
    $ctraverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ArrayOrProto a -> f (ArrayOrProto b)
    traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ArrayOrProto a -> f (ArrayOrProto b)
    $csequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    ArrayOrProto (f a) -> f (ArrayOrProto a)
    sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    ArrayOrProto (f a) -> f (ArrayOrProto a)
    $cmapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ArrayOrProto a -> m (ArrayOrProto b)
    mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ArrayOrProto a -> m (ArrayOrProto b)
    $csequence :: forall (m :: * -> *) a.
    Monad m =>
    ArrayOrProto (m a) -> m (ArrayOrProto a)
    sequence :: forall (m :: * -> *) a.
    Monad m =>
    ArrayOrProto (m a) -> m (ArrayOrProto a)
    Traversable)

    array_or_proto :: CParser i m => m (ArrayOrProto i)
    array_or_proto :: forall i (m :: * -> *). CParser i m => m (ArrayOrProto i)
    array_or_proto = [m (ArrayOrProto i)] -> m (ArrayOrProto i)
    forall (t :: * -> *) (m :: * -> *) a.
    (Foldable t, MonadPlus m) =>
    t (m a) -> m a
    msum
      [ ArrayType i -> ArrayOrProto i
    forall i. ArrayType i -> ArrayOrProto i
    Array (ArrayType i -> ArrayOrProto i)
    -> m (ArrayType i) -> m (ArrayOrProto i)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m (ArrayType i) -> m (ArrayType i)
    forall (m :: * -> *) a. TokenParsing m => m a -> m a
    brackets m (ArrayType i)
    forall i (m :: * -> *). CParser i m => m (ArrayType i)
    array_type
      , [ParameterDeclaration i] -> ArrayOrProto i
    forall i. [ParameterDeclaration i] -> ArrayOrProto i
    Proto ([ParameterDeclaration i] -> ArrayOrProto i)
    -> m [ParameterDeclaration i] -> m (ArrayOrProto i)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m [ParameterDeclaration i] -> m [ParameterDeclaration i]
    forall (m :: * -> *) a. TokenParsing m => m a -> m a
    parens m [ParameterDeclaration i]
    forall i (m :: * -> *). CParser i m => m [ParameterDeclaration i]
    parameter_list
      ]

    -- TODO handle more stuff in array brackets
    data ArrayType i
      = VariablySized
      | Unsized
      | SizedByInteger Integer
      | SizedByIdentifier i
      deriving (Typeable, ArrayType i -> ArrayType i -> Bool
    (ArrayType i -> ArrayType i -> Bool)
    -> (ArrayType i -> ArrayType i -> Bool) -> Eq (ArrayType i)
    forall i. Eq i => ArrayType i -> ArrayType i -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall i. Eq i => ArrayType i -> ArrayType i -> Bool
    == :: ArrayType i -> ArrayType i -> Bool
    $c/= :: forall i. Eq i => ArrayType i -> ArrayType i -> Bool
    /= :: ArrayType i -> ArrayType i -> Bool
    Eq, Int -> ArrayType i -> String -> String
    [ArrayType i] -> String -> String
    ArrayType i -> String
    (Int -> ArrayType i -> String -> String)
    -> (ArrayType i -> String)
    -> ([ArrayType i] -> String -> String)
    -> Show (ArrayType i)
    forall i. Show i => Int -> ArrayType i -> String -> String
    forall i. Show i => [ArrayType i] -> String -> String
    forall i. Show i => ArrayType i -> String
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: forall i. Show i => Int -> ArrayType i -> String -> String
    showsPrec :: Int -> ArrayType i -> String -> String
    $cshow :: forall i. Show i => ArrayType i -> String
    show :: ArrayType i -> String
    $cshowList :: forall i. Show i => [ArrayType i] -> String -> String
    showList :: [ArrayType i] -> String -> String
    Show, (forall a b. (a -> b) -> ArrayType a -> ArrayType b)
    -> (forall a b. a -> ArrayType b -> ArrayType a)
    -> Functor ArrayType
    forall a b. a -> ArrayType b -> ArrayType a
    forall a b. (a -> b) -> ArrayType a -> ArrayType b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a b. (a -> b) -> ArrayType a -> ArrayType b
    fmap :: forall a b. (a -> b) -> ArrayType a -> ArrayType b
    $c<$ :: forall a b. a -> ArrayType b -> ArrayType a
    <$ :: forall a b. a -> ArrayType b -> ArrayType a
    Functor, (forall m. Monoid m => ArrayType m -> m)
    -> (forall m a. Monoid m => (a -> m) -> ArrayType a -> m)
    -> (forall m a. Monoid m => (a -> m) -> ArrayType a -> m)
    -> (forall a b. (a -> b -> b) -> b -> ArrayType a -> b)
    -> (forall a b. (a -> b -> b) -> b -> ArrayType a -> b)
    -> (forall b a. (b -> a -> b) -> b -> ArrayType a -> b)
    -> (forall b a. (b -> a -> b) -> b -> ArrayType a -> b)
    -> (forall a. (a -> a -> a) -> ArrayType a -> a)
    -> (forall a. (a -> a -> a) -> ArrayType a -> a)
    -> (forall a. ArrayType a -> [a])
    -> (forall a. ArrayType a -> Bool)
    -> (forall a. ArrayType a -> Int)
    -> (forall a. Eq a => a -> ArrayType a -> Bool)
    -> (forall a. Ord a => ArrayType a -> a)
    -> (forall a. Ord a => ArrayType a -> a)
    -> (forall a. Num a => ArrayType a -> a)
    -> (forall a. Num a => ArrayType a -> a)
    -> Foldable ArrayType
    forall a. Eq a => a -> ArrayType a -> Bool
    forall a. Num a => ArrayType a -> a
    forall a. Ord a => ArrayType a -> a
    forall m. Monoid m => ArrayType m -> m
    forall a. ArrayType a -> Bool
    forall a. ArrayType a -> Int
    forall a. ArrayType a -> [a]
    forall a. (a -> a -> a) -> ArrayType a -> a
    forall m a. Monoid m => (a -> m) -> ArrayType a -> m
    forall b a. (b -> a -> b) -> b -> ArrayType a -> b
    forall a b. (a -> b -> b) -> b -> ArrayType a -> b
    forall (t :: * -> *).
    (forall m. Monoid m => t m -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. t a -> [a])
    -> (forall a. t a -> Bool)
    -> (forall a. t a -> Int)
    -> (forall a. Eq a => a -> t a -> Bool)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> Foldable t
    $cfold :: forall m. Monoid m => ArrayType m -> m
    fold :: forall m. Monoid m => ArrayType m -> m
    $cfoldMap :: forall m a. Monoid m => (a -> m) -> ArrayType a -> m
    foldMap :: forall m a. Monoid m => (a -> m) -> ArrayType a -> m
    $cfoldMap' :: forall m a. Monoid m => (a -> m) -> ArrayType a -> m
    foldMap' :: forall m a. Monoid m => (a -> m) -> ArrayType a -> m
    $cfoldr :: forall a b. (a -> b -> b) -> b -> ArrayType a -> b
    foldr :: forall a b. (a -> b -> b) -> b -> ArrayType a -> b
    $cfoldr' :: forall a b. (a -> b -> b) -> b -> ArrayType a -> b
    foldr' :: forall a b. (a -> b -> b) -> b -> ArrayType a -> b
    $cfoldl :: forall b a. (b -> a -> b) -> b -> ArrayType a -> b
    foldl :: forall b a. (b -> a -> b) -> b -> ArrayType a -> b
    $cfoldl' :: forall b a. (b -> a -> b) -> b -> ArrayType a -> b
    foldl' :: forall b a. (b -> a -> b) -> b -> ArrayType a -> b
    $cfoldr1 :: forall a. (a -> a -> a) -> ArrayType a -> a
    foldr1 :: forall a. (a -> a -> a) -> ArrayType a -> a
    $cfoldl1 :: forall a. (a -> a -> a) -> ArrayType a -> a
    foldl1 :: forall a. (a -> a -> a) -> ArrayType a -> a
    $ctoList :: forall a. ArrayType a -> [a]
    toList :: forall a. ArrayType a -> [a]
    $cnull :: forall a. ArrayType a -> Bool
    null :: forall a. ArrayType a -> Bool
    $clength :: forall a. ArrayType a -> Int
    length :: forall a. ArrayType a -> Int
    $celem :: forall a. Eq a => a -> ArrayType a -> Bool
    elem :: forall a. Eq a => a -> ArrayType a -> Bool
    $cmaximum :: forall a. Ord a => ArrayType a -> a
    maximum :: forall a. Ord a => ArrayType a -> a
    $cminimum :: forall a. Ord a => ArrayType a -> a
    minimum :: forall a. Ord a => ArrayType a -> a
    $csum :: forall a. Num a => ArrayType a -> a
    sum :: forall a. Num a => ArrayType a -> a
    $cproduct :: forall a. Num a => ArrayType a -> a
    product :: forall a. Num a => ArrayType a -> a
    Foldable, Functor ArrayType
    Foldable ArrayType
    (Functor ArrayType, Foldable ArrayType) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> ArrayType a -> f (ArrayType b))
    -> (forall (f :: * -> *) a.
        Applicative f =>
        ArrayType (f a) -> f (ArrayType a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> ArrayType a -> m (ArrayType b))
    -> (forall (m :: * -> *) a.
        Monad m =>
        ArrayType (m a) -> m (ArrayType a))
    -> Traversable ArrayType
    forall (t :: * -> *).
    (Functor t, Foldable t) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> t a -> f (t b))
    -> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> t a -> m (t b))
    -> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
    -> Traversable t
    forall (m :: * -> *) a.
    Monad m =>
    ArrayType (m a) -> m (ArrayType a)
    forall (f :: * -> *) a.
    Applicative f =>
    ArrayType (f a) -> f (ArrayType a)
    forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ArrayType a -> m (ArrayType b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ArrayType a -> f (ArrayType b)
    $ctraverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ArrayType a -> f (ArrayType b)
    traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ArrayType a -> f (ArrayType b)
    $csequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    ArrayType (f a) -> f (ArrayType a)
    sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    ArrayType (f a) -> f (ArrayType a)
    $cmapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ArrayType a -> m (ArrayType b)
    mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ArrayType a -> m (ArrayType b)
    $csequence :: forall (m :: * -> *) a.
    Monad m =>
    ArrayType (m a) -> m (ArrayType a)
    sequence :: forall (m :: * -> *) a.
    Monad m =>
    ArrayType (m a) -> m (ArrayType a)
    Traversable)

    array_type :: CParser i m => m (ArrayType i)
    array_type :: forall i (m :: * -> *). CParser i m => m (ArrayType i)
    array_type = [m (ArrayType i)] -> m (ArrayType i)
    forall (t :: * -> *) (m :: * -> *) a.
    (Foldable t, MonadPlus m) =>
    t (m a) -> m a
    msum
      [ ArrayType i
    forall i. ArrayType i
    VariablySized ArrayType i -> m Char -> m (ArrayType i)
    forall a b. a -> m b -> m a
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ Char -> m Char
    forall (m :: * -> *). TokenParsing m => Char -> m Char
    symbolic Char
    '*'
      , Integer -> ArrayType i
    forall i. Integer -> ArrayType i
    SizedByInteger (Integer -> ArrayType i) -> m Integer -> m (ArrayType i)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m Integer
    forall (m :: * -> *). TokenParsing m => m Integer
    natural
      , i -> ArrayType i
    forall i. i -> ArrayType i
    SizedByIdentifier (i -> ArrayType i) -> m i -> m (ArrayType i)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m i
    forall i (m :: * -> *). CParser i m => m i
    identifier
      , ArrayType i -> m (ArrayType i)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ArrayType i
    forall i. ArrayType i
    Unsized
      ]

    direct_declarator :: CParser i m => m (DirectDeclarator i)
    direct_declarator :: forall i (m :: * -> *). CParser i m => m (DirectDeclarator i)
    direct_declarator = do
      ddecltor <- [m (DirectDeclarator i)] -> m (DirectDeclarator i)
    forall (t :: * -> *) (m :: * -> *) a.
    (Foldable t, MonadPlus m) =>
    t (m a) -> m a
    msum
        [ i -> DirectDeclarator i
    forall i. i -> DirectDeclarator i
    DeclaratorRoot (i -> DirectDeclarator i) -> m i -> m (DirectDeclarator i)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m i
    forall i (m :: * -> *). CParser i m => m i
    identifier
        , Declarator i -> DirectDeclarator i
    forall i. Declarator i -> DirectDeclarator i
    DeclaratorParens (Declarator i -> DirectDeclarator i)
    -> m (Declarator i) -> m (DirectDeclarator i)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m (Declarator i) -> m (Declarator i)
    forall (m :: * -> *) a. TokenParsing m => m a -> m a
    parens m (Declarator i)
    forall i (m :: * -> *). CParser i m => m (Declarator i)
    declarator
        ]
      aops <- many array_or_proto
      return $ foldl ArrayOrProto ddecltor aops

    data Pointer
      = Pointer [TypeQualifier]
      deriving (Typeable, Pointer -> Pointer -> Bool
    (Pointer -> Pointer -> Bool)
    -> (Pointer -> Pointer -> Bool) -> Eq Pointer
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Pointer -> Pointer -> Bool
    == :: Pointer -> Pointer -> Bool
    $c/= :: Pointer -> Pointer -> Bool
    /= :: Pointer -> Pointer -> Bool
    Eq, Int -> Pointer -> String -> String
    [Pointer] -> String -> String
    Pointer -> String
    (Int -> Pointer -> String -> String)
    -> (Pointer -> String)
    -> ([Pointer] -> String -> String)
    -> Show Pointer
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: Int -> Pointer -> String -> String
    showsPrec :: Int -> Pointer -> String -> String
    $cshow :: Pointer -> String
    show :: Pointer -> String
    $cshowList :: [Pointer] -> String -> String
    showList :: [Pointer] -> String -> String
    Show)

    pointer :: CParser i m => m Pointer
    pointer :: forall i (m :: * -> *). CParser i m => m Pointer
    pointer = do
      m Char -> m ()
    forall (f :: * -> *) a. Functor f => f a -> f ()
    void (m Char -> m ()) -> m Char -> m ()
    forall a b. (a -> b) -> a -> b
    $ Char -> m Char
    forall (m :: * -> *). TokenParsing m => Char -> m Char
    symbolic Char
    '*'
      [TypeQualifier] -> Pointer
    Pointer ([TypeQualifier] -> Pointer) -> m [TypeQualifier] -> m Pointer
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m TypeQualifier -> m [TypeQualifier]
    forall a. m a -> m [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many m TypeQualifier
    forall i (m :: * -> *). CParser i m => m TypeQualifier
    type_qualifier

    parameter_list :: CParser i m => m [ParameterDeclaration i]
    parameter_list :: forall i (m :: * -> *). CParser i m => m [ParameterDeclaration i]
    parameter_list =
      m (ParameterDeclaration i) -> m Char -> m [ParameterDeclaration i]
    forall (m :: * -> *) a sep. Alternative m => m a -> m sep -> m [a]
    sepBy m (ParameterDeclaration i)
    forall i (m :: * -> *). CParser i m => m (ParameterDeclaration i)
    parameter_declaration (m Char -> m [ParameterDeclaration i])
    -> m Char -> m [ParameterDeclaration i]
    forall a b. (a -> b) -> a -> b
    $ Char -> m Char
    forall (m :: * -> *). TokenParsing m => Char -> m Char
    symbolic Char
    ','

    data ParameterDeclaration i = ParameterDeclaration
      { forall i. ParameterDeclaration i -> [DeclarationSpecifier]
    parameterDeclarationSpecifiers :: [DeclarationSpecifier]
      , forall i.
    ParameterDeclaration i -> DeclaratorOrAbstractDeclarator i
    parameterDeclarationDeclarator :: DeclaratorOrAbstractDeclarator i
      } deriving (ParameterDeclaration i -> ParameterDeclaration i -> Bool
    (ParameterDeclaration i -> ParameterDeclaration i -> Bool)
    -> (ParameterDeclaration i -> ParameterDeclaration i -> Bool)
    -> Eq (ParameterDeclaration i)
    forall i.
    Eq i =>
    ParameterDeclaration i -> ParameterDeclaration i -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall i.
    Eq i =>
    ParameterDeclaration i -> ParameterDeclaration i -> Bool
    == :: ParameterDeclaration i -> ParameterDeclaration i -> Bool
    $c/= :: forall i.
    Eq i =>
    ParameterDeclaration i -> ParameterDeclaration i -> Bool
    /= :: ParameterDeclaration i -> ParameterDeclaration i -> Bool
    Eq, Int -> ParameterDeclaration i -> String -> String
    [ParameterDeclaration i] -> String -> String
    ParameterDeclaration i -> String
    (Int -> ParameterDeclaration i -> String -> String)
    -> (ParameterDeclaration i -> String)
    -> ([ParameterDeclaration i] -> String -> String)
    -> Show (ParameterDeclaration i)
    forall i.
    Show i =>
    Int -> ParameterDeclaration i -> String -> String
    forall i. Show i => [ParameterDeclaration i] -> String -> String
    forall i. Show i => ParameterDeclaration i -> String
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: forall i.
    Show i =>
    Int -> ParameterDeclaration i -> String -> String
    showsPrec :: Int -> ParameterDeclaration i -> String -> String
    $cshow :: forall i. Show i => ParameterDeclaration i -> String
    show :: ParameterDeclaration i -> String
    $cshowList :: forall i. Show i => [ParameterDeclaration i] -> String -> String
    showList :: [ParameterDeclaration i] -> String -> String
    Show, Typeable, (forall a b.
     (a -> b) -> ParameterDeclaration a -> ParameterDeclaration b)
    -> (forall a b.
        a -> ParameterDeclaration b -> ParameterDeclaration a)
    -> Functor ParameterDeclaration
    forall a b. a -> ParameterDeclaration b -> ParameterDeclaration a
    forall a b.
    (a -> b) -> ParameterDeclaration a -> ParameterDeclaration b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a b.
    (a -> b) -> ParameterDeclaration a -> ParameterDeclaration b
    fmap :: forall a b.
    (a -> b) -> ParameterDeclaration a -> ParameterDeclaration b
    $c<$ :: forall a b. a -> ParameterDeclaration b -> ParameterDeclaration a
    <$ :: forall a b. a -> ParameterDeclaration b -> ParameterDeclaration a
    Functor, (forall m. Monoid m => ParameterDeclaration m -> m)
    -> (forall m a.
        Monoid m =>
        (a -> m) -> ParameterDeclaration a -> m)
    -> (forall m a.
        Monoid m =>
        (a -> m) -> ParameterDeclaration a -> m)
    -> (forall a b. (a -> b -> b) -> b -> ParameterDeclaration a -> b)
    -> (forall a b. (a -> b -> b) -> b -> ParameterDeclaration a -> b)
    -> (forall b a. (b -> a -> b) -> b -> ParameterDeclaration a -> b)
    -> (forall b a. (b -> a -> b) -> b -> ParameterDeclaration a -> b)
    -> (forall a. (a -> a -> a) -> ParameterDeclaration a -> a)
    -> (forall a. (a -> a -> a) -> ParameterDeclaration a -> a)
    -> (forall a. ParameterDeclaration a -> [a])
    -> (forall a. ParameterDeclaration a -> Bool)
    -> (forall a. ParameterDeclaration a -> Int)
    -> (forall a. Eq a => a -> ParameterDeclaration a -> Bool)
    -> (forall a. Ord a => ParameterDeclaration a -> a)
    -> (forall a. Ord a => ParameterDeclaration a -> a)
    -> (forall a. Num a => ParameterDeclaration a -> a)
    -> (forall a. Num a => ParameterDeclaration a -> a)
    -> Foldable ParameterDeclaration
    forall a. Eq a => a -> ParameterDeclaration a -> Bool
    forall a. Num a => ParameterDeclaration a -> a
    forall a. Ord a => ParameterDeclaration a -> a
    forall m. Monoid m => ParameterDeclaration m -> m
    forall a. ParameterDeclaration a -> Bool
    forall a. ParameterDeclaration a -> Int
    forall a. ParameterDeclaration a -> [a]
    forall a. (a -> a -> a) -> ParameterDeclaration a -> a
    forall m a. Monoid m => (a -> m) -> ParameterDeclaration a -> m
    forall b a. (b -> a -> b) -> b -> ParameterDeclaration a -> b
    forall a b. (a -> b -> b) -> b -> ParameterDeclaration a -> b
    forall (t :: * -> *).
    (forall m. Monoid m => t m -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. t a -> [a])
    -> (forall a. t a -> Bool)
    -> (forall a. t a -> Int)
    -> (forall a. Eq a => a -> t a -> Bool)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> Foldable t
    $cfold :: forall m. Monoid m => ParameterDeclaration m -> m
    fold :: forall m. Monoid m => ParameterDeclaration m -> m
    $cfoldMap :: forall m a. Monoid m => (a -> m) -> ParameterDeclaration a -> m
    foldMap :: forall m a. Monoid m => (a -> m) -> ParameterDeclaration a -> m
    $cfoldMap' :: forall m a. Monoid m => (a -> m) -> ParameterDeclaration a -> m
    foldMap' :: forall m a. Monoid m => (a -> m) -> ParameterDeclaration a -> m
    $cfoldr :: forall a b. (a -> b -> b) -> b -> ParameterDeclaration a -> b
    foldr :: forall a b. (a -> b -> b) -> b -> ParameterDeclaration a -> b
    $cfoldr' :: forall a b. (a -> b -> b) -> b -> ParameterDeclaration a -> b
    foldr' :: forall a b. (a -> b -> b) -> b -> ParameterDeclaration a -> b
    $cfoldl :: forall b a. (b -> a -> b) -> b -> ParameterDeclaration a -> b
    foldl :: forall b a. (b -> a -> b) -> b -> ParameterDeclaration a -> b
    $cfoldl' :: forall b a. (b -> a -> b) -> b -> ParameterDeclaration a -> b
    foldl' :: forall b a. (b -> a -> b) -> b -> ParameterDeclaration a -> b
    $cfoldr1 :: forall a. (a -> a -> a) -> ParameterDeclaration a -> a
    foldr1 :: forall a. (a -> a -> a) -> ParameterDeclaration a -> a
    $cfoldl1 :: forall a. (a -> a -> a) -> ParameterDeclaration a -> a
    foldl1 :: forall a. (a -> a -> a) -> ParameterDeclaration a -> a
    $ctoList :: forall a. ParameterDeclaration a -> [a]
    toList :: forall a. ParameterDeclaration a -> [a]
    $cnull :: forall a. ParameterDeclaration a -> Bool
    null :: forall a. ParameterDeclaration a -> Bool
    $clength :: forall a. ParameterDeclaration a -> Int
    length :: forall a. ParameterDeclaration a -> Int
    $celem :: forall a. Eq a => a -> ParameterDeclaration a -> Bool
    elem :: forall a. Eq a => a -> ParameterDeclaration a -> Bool
    $cmaximum :: forall a. Ord a => ParameterDeclaration a -> a
    maximum :: forall a. Ord a => ParameterDeclaration a -> a
    $cminimum :: forall a. Ord a => ParameterDeclaration a -> a
    minimum :: forall a. Ord a => ParameterDeclaration a -> a
    $csum :: forall a. Num a => ParameterDeclaration a -> a
    sum :: forall a. Num a => ParameterDeclaration a -> a
    $cproduct :: forall a. Num a => ParameterDeclaration a -> a
    product :: forall a. Num a => ParameterDeclaration a -> a
    Foldable, Functor ParameterDeclaration
    Foldable ParameterDeclaration
    (Functor ParameterDeclaration, Foldable ParameterDeclaration) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> ParameterDeclaration a -> f (ParameterDeclaration b))
    -> (forall (f :: * -> *) a.
        Applicative f =>
        ParameterDeclaration (f a) -> f (ParameterDeclaration a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> ParameterDeclaration a -> m (ParameterDeclaration b))
    -> (forall (m :: * -> *) a.
        Monad m =>
        ParameterDeclaration (m a) -> m (ParameterDeclaration a))
    -> Traversable ParameterDeclaration
    forall (t :: * -> *).
    (Functor t, Foldable t) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> t a -> f (t b))
    -> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> t a -> m (t b))
    -> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
    -> Traversable t
    forall (m :: * -> *) a.
    Monad m =>
    ParameterDeclaration (m a) -> m (ParameterDeclaration a)
    forall (f :: * -> *) a.
    Applicative f =>
    ParameterDeclaration (f a) -> f (ParameterDeclaration a)
    forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ParameterDeclaration a -> m (ParameterDeclaration b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ParameterDeclaration a -> f (ParameterDeclaration b)
    $ctraverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ParameterDeclaration a -> f (ParameterDeclaration b)
    traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ParameterDeclaration a -> f (ParameterDeclaration b)
    $csequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    ParameterDeclaration (f a) -> f (ParameterDeclaration a)
    sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    ParameterDeclaration (f a) -> f (ParameterDeclaration a)
    $cmapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ParameterDeclaration a -> m (ParameterDeclaration b)
    mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ParameterDeclaration a -> m (ParameterDeclaration b)
    $csequence :: forall (m :: * -> *) a.
    Monad m =>
    ParameterDeclaration (m a) -> m (ParameterDeclaration a)
    sequence :: forall (m :: * -> *) a.
    Monad m =>
    ParameterDeclaration (m a) -> m (ParameterDeclaration a)
    Traversable)

    data DeclaratorOrAbstractDeclarator i
      = IsDeclarator (Declarator i)
      | IsAbstractDeclarator (AbstractDeclarator i)
      deriving (DeclaratorOrAbstractDeclarator i
    -> DeclaratorOrAbstractDeclarator i -> Bool
    (DeclaratorOrAbstractDeclarator i
     -> DeclaratorOrAbstractDeclarator i -> Bool)
    -> (DeclaratorOrAbstractDeclarator i
        -> DeclaratorOrAbstractDeclarator i -> Bool)
    -> Eq (DeclaratorOrAbstractDeclarator i)
    forall i.
    Eq i =>
    DeclaratorOrAbstractDeclarator i
    -> DeclaratorOrAbstractDeclarator i -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall i.
    Eq i =>
    DeclaratorOrAbstractDeclarator i
    -> DeclaratorOrAbstractDeclarator i -> Bool
    == :: DeclaratorOrAbstractDeclarator i
    -> DeclaratorOrAbstractDeclarator i -> Bool
    $c/= :: forall i.
    Eq i =>
    DeclaratorOrAbstractDeclarator i
    -> DeclaratorOrAbstractDeclarator i -> Bool
    /= :: DeclaratorOrAbstractDeclarator i
    -> DeclaratorOrAbstractDeclarator i -> Bool
    Eq, Int -> DeclaratorOrAbstractDeclarator i -> String -> String
    [DeclaratorOrAbstractDeclarator i] -> String -> String
    DeclaratorOrAbstractDeclarator i -> String
    (Int -> DeclaratorOrAbstractDeclarator i -> String -> String)
    -> (DeclaratorOrAbstractDeclarator i -> String)
    -> ([DeclaratorOrAbstractDeclarator i] -> String -> String)
    -> Show (DeclaratorOrAbstractDeclarator i)
    forall i.
    Show i =>
    Int -> DeclaratorOrAbstractDeclarator i -> String -> String
    forall i.
    Show i =>
    [DeclaratorOrAbstractDeclarator i] -> String -> String
    forall i. Show i => DeclaratorOrAbstractDeclarator i -> String
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: forall i.
    Show i =>
    Int -> DeclaratorOrAbstractDeclarator i -> String -> String
    showsPrec :: Int -> DeclaratorOrAbstractDeclarator i -> String -> String
    $cshow :: forall i. Show i => DeclaratorOrAbstractDeclarator i -> String
    show :: DeclaratorOrAbstractDeclarator i -> String
    $cshowList :: forall i.
    Show i =>
    [DeclaratorOrAbstractDeclarator i] -> String -> String
    showList :: [DeclaratorOrAbstractDeclarator i] -> String -> String
    Show, Typeable, (forall a b.
     (a -> b)
     -> DeclaratorOrAbstractDeclarator a
     -> DeclaratorOrAbstractDeclarator b)
    -> (forall a b.
        a
        -> DeclaratorOrAbstractDeclarator b
        -> DeclaratorOrAbstractDeclarator a)
    -> Functor DeclaratorOrAbstractDeclarator
    forall a b.
    a
    -> DeclaratorOrAbstractDeclarator b
    -> DeclaratorOrAbstractDeclarator a
    forall a b.
    (a -> b)
    -> DeclaratorOrAbstractDeclarator a
    -> DeclaratorOrAbstractDeclarator b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a b.
    (a -> b)
    -> DeclaratorOrAbstractDeclarator a
    -> DeclaratorOrAbstractDeclarator b
    fmap :: forall a b.
    (a -> b)
    -> DeclaratorOrAbstractDeclarator a
    -> DeclaratorOrAbstractDeclarator b
    $c<$ :: forall a b.
    a
    -> DeclaratorOrAbstractDeclarator b
    -> DeclaratorOrAbstractDeclarator a
    <$ :: forall a b.
    a
    -> DeclaratorOrAbstractDeclarator b
    -> DeclaratorOrAbstractDeclarator a
    Functor, (forall m. Monoid m => DeclaratorOrAbstractDeclarator m -> m)
    -> (forall m a.
        Monoid m =>
        (a -> m) -> DeclaratorOrAbstractDeclarator a -> m)
    -> (forall m a.
        Monoid m =>
        (a -> m) -> DeclaratorOrAbstractDeclarator a -> m)
    -> (forall a b.
        (a -> b -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b)
    -> (forall a b.
        (a -> b -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b)
    -> (forall b a.
        (b -> a -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b)
    -> (forall b a.
        (b -> a -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b)
    -> (forall a.
        (a -> a -> a) -> DeclaratorOrAbstractDeclarator a -> a)
    -> (forall a.
        (a -> a -> a) -> DeclaratorOrAbstractDeclarator a -> a)
    -> (forall a. DeclaratorOrAbstractDeclarator a -> [a])
    -> (forall a. DeclaratorOrAbstractDeclarator a -> Bool)
    -> (forall a. DeclaratorOrAbstractDeclarator a -> Int)
    -> (forall a.
        Eq a =>
        a -> DeclaratorOrAbstractDeclarator a -> Bool)
    -> (forall a. Ord a => DeclaratorOrAbstractDeclarator a -> a)
    -> (forall a. Ord a => DeclaratorOrAbstractDeclarator a -> a)
    -> (forall a. Num a => DeclaratorOrAbstractDeclarator a -> a)
    -> (forall a. Num a => DeclaratorOrAbstractDeclarator a -> a)
    -> Foldable DeclaratorOrAbstractDeclarator
    forall a. Eq a => a -> DeclaratorOrAbstractDeclarator a -> Bool
    forall a. Num a => DeclaratorOrAbstractDeclarator a -> a
    forall a. Ord a => DeclaratorOrAbstractDeclarator a -> a
    forall m. Monoid m => DeclaratorOrAbstractDeclarator m -> m
    forall a. DeclaratorOrAbstractDeclarator a -> Bool
    forall a. DeclaratorOrAbstractDeclarator a -> Int
    forall a. DeclaratorOrAbstractDeclarator a -> [a]
    forall a. (a -> a -> a) -> DeclaratorOrAbstractDeclarator a -> a
    forall m a.
    Monoid m =>
    (a -> m) -> DeclaratorOrAbstractDeclarator a -> m
    forall b a.
    (b -> a -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b
    forall a b.
    (a -> b -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b
    forall (t :: * -> *).
    (forall m. Monoid m => t m -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. t a -> [a])
    -> (forall a. t a -> Bool)
    -> (forall a. t a -> Int)
    -> (forall a. Eq a => a -> t a -> Bool)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> Foldable t
    $cfold :: forall m. Monoid m => DeclaratorOrAbstractDeclarator m -> m
    fold :: forall m. Monoid m => DeclaratorOrAbstractDeclarator m -> m
    $cfoldMap :: forall m a.
    Monoid m =>
    (a -> m) -> DeclaratorOrAbstractDeclarator a -> m
    foldMap :: forall m a.
    Monoid m =>
    (a -> m) -> DeclaratorOrAbstractDeclarator a -> m
    $cfoldMap' :: forall m a.
    Monoid m =>
    (a -> m) -> DeclaratorOrAbstractDeclarator a -> m
    foldMap' :: forall m a.
    Monoid m =>
    (a -> m) -> DeclaratorOrAbstractDeclarator a -> m
    $cfoldr :: forall a b.
    (a -> b -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b
    foldr :: forall a b.
    (a -> b -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b
    $cfoldr' :: forall a b.
    (a -> b -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b
    foldr' :: forall a b.
    (a -> b -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b
    $cfoldl :: forall b a.
    (b -> a -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b
    foldl :: forall b a.
    (b -> a -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b
    $cfoldl' :: forall b a.
    (b -> a -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b
    foldl' :: forall b a.
    (b -> a -> b) -> b -> DeclaratorOrAbstractDeclarator a -> b
    $cfoldr1 :: forall a. (a -> a -> a) -> DeclaratorOrAbstractDeclarator a -> a
    foldr1 :: forall a. (a -> a -> a) -> DeclaratorOrAbstractDeclarator a -> a
    $cfoldl1 :: forall a. (a -> a -> a) -> DeclaratorOrAbstractDeclarator a -> a
    foldl1 :: forall a. (a -> a -> a) -> DeclaratorOrAbstractDeclarator a -> a
    $ctoList :: forall a. DeclaratorOrAbstractDeclarator a -> [a]
    toList :: forall a. DeclaratorOrAbstractDeclarator a -> [a]
    $cnull :: forall a. DeclaratorOrAbstractDeclarator a -> Bool
    null :: forall a. DeclaratorOrAbstractDeclarator a -> Bool
    $clength :: forall a. DeclaratorOrAbstractDeclarator a -> Int
    length :: forall a. DeclaratorOrAbstractDeclarator a -> Int
    $celem :: forall a. Eq a => a -> DeclaratorOrAbstractDeclarator a -> Bool
    elem :: forall a. Eq a => a -> DeclaratorOrAbstractDeclarator a -> Bool
    $cmaximum :: forall a. Ord a => DeclaratorOrAbstractDeclarator a -> a
    maximum :: forall a. Ord a => DeclaratorOrAbstractDeclarator a -> a
    $cminimum :: forall a. Ord a => DeclaratorOrAbstractDeclarator a -> a
    minimum :: forall a. Ord a => DeclaratorOrAbstractDeclarator a -> a
    $csum :: forall a. Num a => DeclaratorOrAbstractDeclarator a -> a
    sum :: forall a. Num a => DeclaratorOrAbstractDeclarator a -> a
    $cproduct :: forall a. Num a => DeclaratorOrAbstractDeclarator a -> a
    product :: forall a. Num a => DeclaratorOrAbstractDeclarator a -> a
    Foldable, Functor DeclaratorOrAbstractDeclarator
    Foldable DeclaratorOrAbstractDeclarator
    (Functor DeclaratorOrAbstractDeclarator,
     Foldable DeclaratorOrAbstractDeclarator) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b)
     -> DeclaratorOrAbstractDeclarator a
     -> f (DeclaratorOrAbstractDeclarator b))
    -> (forall (f :: * -> *) a.
        Applicative f =>
        DeclaratorOrAbstractDeclarator (f a)
        -> f (DeclaratorOrAbstractDeclarator a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b)
        -> DeclaratorOrAbstractDeclarator a
        -> m (DeclaratorOrAbstractDeclarator b))
    -> (forall (m :: * -> *) a.
        Monad m =>
        DeclaratorOrAbstractDeclarator (m a)
        -> m (DeclaratorOrAbstractDeclarator a))
    -> Traversable DeclaratorOrAbstractDeclarator
    forall (t :: * -> *).
    (Functor t, Foldable t) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> t a -> f (t b))
    -> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> t a -> m (t b))
    -> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
    -> Traversable t
    forall (m :: * -> *) a.
    Monad m =>
    DeclaratorOrAbstractDeclarator (m a)
    -> m (DeclaratorOrAbstractDeclarator a)
    forall (f :: * -> *) a.
    Applicative f =>
    DeclaratorOrAbstractDeclarator (f a)
    -> f (DeclaratorOrAbstractDeclarator a)
    forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> DeclaratorOrAbstractDeclarator a
    -> m (DeclaratorOrAbstractDeclarator b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> DeclaratorOrAbstractDeclarator a
    -> f (DeclaratorOrAbstractDeclarator b)
    $ctraverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> DeclaratorOrAbstractDeclarator a
    -> f (DeclaratorOrAbstractDeclarator b)
    traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> DeclaratorOrAbstractDeclarator a
    -> f (DeclaratorOrAbstractDeclarator b)
    $csequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    DeclaratorOrAbstractDeclarator (f a)
    -> f (DeclaratorOrAbstractDeclarator a)
    sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    DeclaratorOrAbstractDeclarator (f a)
    -> f (DeclaratorOrAbstractDeclarator a)
    $cmapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> DeclaratorOrAbstractDeclarator a
    -> m (DeclaratorOrAbstractDeclarator b)
    mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> DeclaratorOrAbstractDeclarator a
    -> m (DeclaratorOrAbstractDeclarator b)
    $csequence :: forall (m :: * -> *) a.
    Monad m =>
    DeclaratorOrAbstractDeclarator (m a)
    -> m (DeclaratorOrAbstractDeclarator a)
    sequence :: forall (m :: * -> *) a.
    Monad m =>
    DeclaratorOrAbstractDeclarator (m a)
    -> m (DeclaratorOrAbstractDeclarator a)
    Traversable)

    parameter_declaration :: CParser i m => m (ParameterDeclaration i)
    parameter_declaration :: forall i (m :: * -> *). CParser i m => m (ParameterDeclaration i)
    parameter_declaration =
      [DeclarationSpecifier]
    -> DeclaratorOrAbstractDeclarator i -> ParameterDeclaration i
    forall i.
    [DeclarationSpecifier]
    -> DeclaratorOrAbstractDeclarator i -> ParameterDeclaration i
    ParameterDeclaration
        ([DeclarationSpecifier]
     -> DeclaratorOrAbstractDeclarator i -> ParameterDeclaration i)
    -> m [DeclarationSpecifier]
    -> m (DeclaratorOrAbstractDeclarator i -> ParameterDeclaration i)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m [DeclarationSpecifier]
    forall i (m :: * -> *). CParser i m => m [DeclarationSpecifier]
    declaration_specifiers
        m (DeclaratorOrAbstractDeclarator i -> ParameterDeclaration i)
    -> m (DeclaratorOrAbstractDeclarator i)
    -> m (ParameterDeclaration i)
    forall a b. m (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> m (DeclaratorOrAbstractDeclarator i)
    mbabstract
      where
       mbabstract :: m (DeclaratorOrAbstractDeclarator i)
    mbabstract =
         Declarator i -> DeclaratorOrAbstractDeclarator i
    forall i. Declarator i -> DeclaratorOrAbstractDeclarator i
    IsDeclarator (Declarator i -> DeclaratorOrAbstractDeclarator i)
    -> m (Declarator i) -> m (DeclaratorOrAbstractDeclarator i)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m (Declarator i) -> m (Declarator i)
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try m (Declarator i)
    forall i (m :: * -> *). CParser i m => m (Declarator i)
    declarator m (DeclaratorOrAbstractDeclarator i)
    -> m (DeclaratorOrAbstractDeclarator i)
    -> m (DeclaratorOrAbstractDeclarator i)
    forall a. m a -> m a -> m a
    forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
    <|>
         AbstractDeclarator i -> DeclaratorOrAbstractDeclarator i
    forall i. AbstractDeclarator i -> DeclaratorOrAbstractDeclarator i
    IsAbstractDeclarator (AbstractDeclarator i -> DeclaratorOrAbstractDeclarator i)
    -> m (AbstractDeclarator i) -> m (DeclaratorOrAbstractDeclarator i)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m (AbstractDeclarator i) -> m (AbstractDeclarator i)
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try m (AbstractDeclarator i)
    forall i (m :: * -> *). CParser i m => m (AbstractDeclarator i)
    abstract_declarator m (DeclaratorOrAbstractDeclarator i)
    -> m (DeclaratorOrAbstractDeclarator i)
    -> m (DeclaratorOrAbstractDeclarator i)
    forall a. m a -> m a -> m a
    forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
    <|>
         DeclaratorOrAbstractDeclarator i
    -> m (DeclaratorOrAbstractDeclarator i)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (AbstractDeclarator i -> DeclaratorOrAbstractDeclarator i
    forall i. AbstractDeclarator i -> DeclaratorOrAbstractDeclarator i
    IsAbstractDeclarator ([Pointer]
    -> Maybe (DirectAbstractDeclarator i) -> AbstractDeclarator i
    forall i.
    [Pointer]
    -> Maybe (DirectAbstractDeclarator i) -> AbstractDeclarator i
    AbstractDeclarator [] Maybe (DirectAbstractDeclarator i)
    forall a. Maybe a
    Nothing))

    data AbstractDeclarator i = AbstractDeclarator
      { forall i. AbstractDeclarator i -> [Pointer]
    abstractDeclaratorPointers :: [Pointer]
      , forall i.
    AbstractDeclarator i -> Maybe (DirectAbstractDeclarator i)
    abstractDeclaratorDirect :: Maybe (DirectAbstractDeclarator i)
      } deriving (Typeable, AbstractDeclarator i -> AbstractDeclarator i -> Bool
    (AbstractDeclarator i -> AbstractDeclarator i -> Bool)
    -> (AbstractDeclarator i -> AbstractDeclarator i -> Bool)
    -> Eq (AbstractDeclarator i)
    forall i.
    Eq i =>
    AbstractDeclarator i -> AbstractDeclarator i -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall i.
    Eq i =>
    AbstractDeclarator i -> AbstractDeclarator i -> Bool
    == :: AbstractDeclarator i -> AbstractDeclarator i -> Bool
    $c/= :: forall i.
    Eq i =>
    AbstractDeclarator i -> AbstractDeclarator i -> Bool
    /= :: AbstractDeclarator i -> AbstractDeclarator i -> Bool
    Eq, Int -> AbstractDeclarator i -> String -> String
    [AbstractDeclarator i] -> String -> String
    AbstractDeclarator i -> String
    (Int -> AbstractDeclarator i -> String -> String)
    -> (AbstractDeclarator i -> String)
    -> ([AbstractDeclarator i] -> String -> String)
    -> Show (AbstractDeclarator i)
    forall i. Show i => Int -> AbstractDeclarator i -> String -> String
    forall i. Show i => [AbstractDeclarator i] -> String -> String
    forall i. Show i => AbstractDeclarator i -> String
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: forall i. Show i => Int -> AbstractDeclarator i -> String -> String
    showsPrec :: Int -> AbstractDeclarator i -> String -> String
    $cshow :: forall i. Show i => AbstractDeclarator i -> String
    show :: AbstractDeclarator i -> String
    $cshowList :: forall i. Show i => [AbstractDeclarator i] -> String -> String
    showList :: [AbstractDeclarator i] -> String -> String
    Show, (forall a b.
     (a -> b) -> AbstractDeclarator a -> AbstractDeclarator b)
    -> (forall a b. a -> AbstractDeclarator b -> AbstractDeclarator a)
    -> Functor AbstractDeclarator
    forall a b. a -> AbstractDeclarator b -> AbstractDeclarator a
    forall a b.
    (a -> b) -> AbstractDeclarator a -> AbstractDeclarator b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a b.
    (a -> b) -> AbstractDeclarator a -> AbstractDeclarator b
    fmap :: forall a b.
    (a -> b) -> AbstractDeclarator a -> AbstractDeclarator b
    $c<$ :: forall a b. a -> AbstractDeclarator b -> AbstractDeclarator a
    <$ :: forall a b. a -> AbstractDeclarator b -> AbstractDeclarator a
    Functor, (forall m. Monoid m => AbstractDeclarator m -> m)
    -> (forall m a. Monoid m => (a -> m) -> AbstractDeclarator a -> m)
    -> (forall m a. Monoid m => (a -> m) -> AbstractDeclarator a -> m)
    -> (forall a b. (a -> b -> b) -> b -> AbstractDeclarator a -> b)
    -> (forall a b. (a -> b -> b) -> b -> AbstractDeclarator a -> b)
    -> (forall b a. (b -> a -> b) -> b -> AbstractDeclarator a -> b)
    -> (forall b a. (b -> a -> b) -> b -> AbstractDeclarator a -> b)
    -> (forall a. (a -> a -> a) -> AbstractDeclarator a -> a)
    -> (forall a. (a -> a -> a) -> AbstractDeclarator a -> a)
    -> (forall a. AbstractDeclarator a -> [a])
    -> (forall a. AbstractDeclarator a -> Bool)
    -> (forall a. AbstractDeclarator a -> Int)
    -> (forall a. Eq a => a -> AbstractDeclarator a -> Bool)
    -> (forall a. Ord a => AbstractDeclarator a -> a)
    -> (forall a. Ord a => AbstractDeclarator a -> a)
    -> (forall a. Num a => AbstractDeclarator a -> a)
    -> (forall a. Num a => AbstractDeclarator a -> a)
    -> Foldable AbstractDeclarator
    forall a. Eq a => a -> AbstractDeclarator a -> Bool
    forall a. Num a => AbstractDeclarator a -> a
    forall a. Ord a => AbstractDeclarator a -> a
    forall m. Monoid m => AbstractDeclarator m -> m
    forall a. AbstractDeclarator a -> Bool
    forall a. AbstractDeclarator a -> Int
    forall a. AbstractDeclarator a -> [a]
    forall a. (a -> a -> a) -> AbstractDeclarator a -> a
    forall m a. Monoid m => (a -> m) -> AbstractDeclarator a -> m
    forall b a. (b -> a -> b) -> b -> AbstractDeclarator a -> b
    forall a b. (a -> b -> b) -> b -> AbstractDeclarator a -> b
    forall (t :: * -> *).
    (forall m. Monoid m => t m -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. t a -> [a])
    -> (forall a. t a -> Bool)
    -> (forall a. t a -> Int)
    -> (forall a. Eq a => a -> t a -> Bool)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> Foldable t
    $cfold :: forall m. Monoid m => AbstractDeclarator m -> m
    fold :: forall m. Monoid m => AbstractDeclarator m -> m
    $cfoldMap :: forall m a. Monoid m => (a -> m) -> AbstractDeclarator a -> m
    foldMap :: forall m a. Monoid m => (a -> m) -> AbstractDeclarator a -> m
    $cfoldMap' :: forall m a. Monoid m => (a -> m) -> AbstractDeclarator a -> m
    foldMap' :: forall m a. Monoid m => (a -> m) -> AbstractDeclarator a -> m
    $cfoldr :: forall a b. (a -> b -> b) -> b -> AbstractDeclarator a -> b
    foldr :: forall a b. (a -> b -> b) -> b -> AbstractDeclarator a -> b
    $cfoldr' :: forall a b. (a -> b -> b) -> b -> AbstractDeclarator a -> b
    foldr' :: forall a b. (a -> b -> b) -> b -> AbstractDeclarator a -> b
    $cfoldl :: forall b a. (b -> a -> b) -> b -> AbstractDeclarator a -> b
    foldl :: forall b a. (b -> a -> b) -> b -> AbstractDeclarator a -> b
    $cfoldl' :: forall b a. (b -> a -> b) -> b -> AbstractDeclarator a -> b
    foldl' :: forall b a. (b -> a -> b) -> b -> AbstractDeclarator a -> b
    $cfoldr1 :: forall a. (a -> a -> a) -> AbstractDeclarator a -> a
    foldr1 :: forall a. (a -> a -> a) -> AbstractDeclarator a -> a
    $cfoldl1 :: forall a. (a -> a -> a) -> AbstractDeclarator a -> a
    foldl1 :: forall a. (a -> a -> a) -> AbstractDeclarator a -> a
    $ctoList :: forall a. AbstractDeclarator a -> [a]
    toList :: forall a. AbstractDeclarator a -> [a]
    $cnull :: forall a. AbstractDeclarator a -> Bool
    null :: forall a. AbstractDeclarator a -> Bool
    $clength :: forall a. AbstractDeclarator a -> Int
    length :: forall a. AbstractDeclarator a -> Int
    $celem :: forall a. Eq a => a -> AbstractDeclarator a -> Bool
    elem :: forall a. Eq a => a -> AbstractDeclarator a -> Bool
    $cmaximum :: forall a. Ord a => AbstractDeclarator a -> a
    maximum :: forall a. Ord a => AbstractDeclarator a -> a
    $cminimum :: forall a. Ord a => AbstractDeclarator a -> a
    minimum :: forall a. Ord a => AbstractDeclarator a -> a
    $csum :: forall a. Num a => AbstractDeclarator a -> a
    sum :: forall a. Num a => AbstractDeclarator a -> a
    $cproduct :: forall a. Num a => AbstractDeclarator a -> a
    product :: forall a. Num a => AbstractDeclarator a -> a
    Foldable, Functor AbstractDeclarator
    Foldable AbstractDeclarator
    (Functor AbstractDeclarator, Foldable AbstractDeclarator) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> AbstractDeclarator a -> f (AbstractDeclarator b))
    -> (forall (f :: * -> *) a.
        Applicative f =>
        AbstractDeclarator (f a) -> f (AbstractDeclarator a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> AbstractDeclarator a -> m (AbstractDeclarator b))
    -> (forall (m :: * -> *) a.
        Monad m =>
        AbstractDeclarator (m a) -> m (AbstractDeclarator a))
    -> Traversable AbstractDeclarator
    forall (t :: * -> *).
    (Functor t, Foldable t) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> t a -> f (t b))
    -> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> t a -> m (t b))
    -> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
    -> Traversable t
    forall (m :: * -> *) a.
    Monad m =>
    AbstractDeclarator (m a) -> m (AbstractDeclarator a)
    forall (f :: * -> *) a.
    Applicative f =>
    AbstractDeclarator (f a) -> f (AbstractDeclarator a)
    forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> AbstractDeclarator a -> m (AbstractDeclarator b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> AbstractDeclarator a -> f (AbstractDeclarator b)
    $ctraverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> AbstractDeclarator a -> f (AbstractDeclarator b)
    traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> AbstractDeclarator a -> f (AbstractDeclarator b)
    $csequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    AbstractDeclarator (f a) -> f (AbstractDeclarator a)
    sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    AbstractDeclarator (f a) -> f (AbstractDeclarator a)
    $cmapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> AbstractDeclarator a -> m (AbstractDeclarator b)
    mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> AbstractDeclarator a -> m (AbstractDeclarator b)
    $csequence :: forall (m :: * -> *) a.
    Monad m =>
    AbstractDeclarator (m a) -> m (AbstractDeclarator a)
    sequence :: forall (m :: * -> *) a.
    Monad m =>
    AbstractDeclarator (m a) -> m (AbstractDeclarator a)
    Traversable)

    abstract_declarator :: CParser i m => m (AbstractDeclarator i)
    abstract_declarator :: forall i (m :: * -> *). CParser i m => m (AbstractDeclarator i)
    abstract_declarator = do
      ptrs <- m Pointer -> m [Pointer]
    forall a. m a -> m [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many m Pointer
    forall i (m :: * -> *). CParser i m => m Pointer
    pointer
      -- If there are no pointers, there must be an abstract declarator.
      let p = if [Pointer] -> Bool
    forall a. [a] -> Bool
    forall (t :: * -> *) a. Foldable t => t a -> Bool
    null [Pointer]
    ptrs
            then DirectAbstractDeclarator i -> Maybe (DirectAbstractDeclarator i)
    forall a. a -> Maybe a
    Just (DirectAbstractDeclarator i -> Maybe (DirectAbstractDeclarator i))
    -> m (DirectAbstractDeclarator i)
    -> m (Maybe (DirectAbstractDeclarator i))
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m (DirectAbstractDeclarator i)
    forall i (m :: * -> *).
    CParser i m =>
    m (DirectAbstractDeclarator i)
    direct_abstract_declarator
            else (DirectAbstractDeclarator i -> Maybe (DirectAbstractDeclarator i)
    forall a. a -> Maybe a
    Just (DirectAbstractDeclarator i -> Maybe (DirectAbstractDeclarator i))
    -> m (DirectAbstractDeclarator i)
    -> m (Maybe (DirectAbstractDeclarator i))
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m (DirectAbstractDeclarator i) -> m (DirectAbstractDeclarator i)
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try m (DirectAbstractDeclarator i)
    forall i (m :: * -> *).
    CParser i m =>
    m (DirectAbstractDeclarator i)
    direct_abstract_declarator) m (Maybe (DirectAbstractDeclarator i))
    -> m (Maybe (DirectAbstractDeclarator i))
    -> m (Maybe (DirectAbstractDeclarator i))
    forall a. m a -> m a -> m a
    forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
    <|> Maybe (DirectAbstractDeclarator i)
    -> m (Maybe (DirectAbstractDeclarator i))
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Maybe (DirectAbstractDeclarator i)
    forall a. Maybe a
    Nothing
      AbstractDeclarator ptrs <$> p

    data DirectAbstractDeclarator i
      = ArrayOrProtoHere (ArrayOrProto i)
      | ArrayOrProtoThere (DirectAbstractDeclarator i) (ArrayOrProto i)
      | AbstractDeclaratorParens (AbstractDeclarator i)
      deriving (Typeable, DirectAbstractDeclarator i -> DirectAbstractDeclarator i -> Bool
    (DirectAbstractDeclarator i -> DirectAbstractDeclarator i -> Bool)
    -> (DirectAbstractDeclarator i
        -> DirectAbstractDeclarator i -> Bool)
    -> Eq (DirectAbstractDeclarator i)
    forall i.
    Eq i =>
    DirectAbstractDeclarator i -> DirectAbstractDeclarator i -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall i.
    Eq i =>
    DirectAbstractDeclarator i -> DirectAbstractDeclarator i -> Bool
    == :: DirectAbstractDeclarator i -> DirectAbstractDeclarator i -> Bool
    $c/= :: forall i.
    Eq i =>
    DirectAbstractDeclarator i -> DirectAbstractDeclarator i -> Bool
    /= :: DirectAbstractDeclarator i -> DirectAbstractDeclarator i -> Bool
    Eq, Int -> DirectAbstractDeclarator i -> String -> String
    [DirectAbstractDeclarator i] -> String -> String
    DirectAbstractDeclarator i -> String
    (Int -> DirectAbstractDeclarator i -> String -> String)
    -> (DirectAbstractDeclarator i -> String)
    -> ([DirectAbstractDeclarator i] -> String -> String)
    -> Show (DirectAbstractDeclarator i)
    forall i.
    Show i =>
    Int -> DirectAbstractDeclarator i -> String -> String
    forall i.
    Show i =>
    [DirectAbstractDeclarator i] -> String -> String
    forall i. Show i => DirectAbstractDeclarator i -> String
    forall a.
    (Int -> a -> String -> String)
    -> (a -> String) -> ([a] -> String -> String) -> Show a
    $cshowsPrec :: forall i.
    Show i =>
    Int -> DirectAbstractDeclarator i -> String -> String
    showsPrec :: Int -> DirectAbstractDeclarator i -> String -> String
    $cshow :: forall i. Show i => DirectAbstractDeclarator i -> String
    show :: DirectAbstractDeclarator i -> String
    $cshowList :: forall i.
    Show i =>
    [DirectAbstractDeclarator i] -> String -> String
    showList :: [DirectAbstractDeclarator i] -> String -> String
    Show, (forall a b.
     (a -> b)
     -> DirectAbstractDeclarator a -> DirectAbstractDeclarator b)
    -> (forall a b.
        a -> DirectAbstractDeclarator b -> DirectAbstractDeclarator a)
    -> Functor DirectAbstractDeclarator
    forall a b.
    a -> DirectAbstractDeclarator b -> DirectAbstractDeclarator a
    forall a b.
    (a -> b)
    -> DirectAbstractDeclarator a -> DirectAbstractDeclarator b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a b.
    (a -> b)
    -> DirectAbstractDeclarator a -> DirectAbstractDeclarator b
    fmap :: forall a b.
    (a -> b)
    -> DirectAbstractDeclarator a -> DirectAbstractDeclarator b
    $c<$ :: forall a b.
    a -> DirectAbstractDeclarator b -> DirectAbstractDeclarator a
    <$ :: forall a b.
    a -> DirectAbstractDeclarator b -> DirectAbstractDeclarator a
    Functor, (forall m. Monoid m => DirectAbstractDeclarator m -> m)
    -> (forall m a.
        Monoid m =>
        (a -> m) -> DirectAbstractDeclarator a -> m)
    -> (forall m a.
        Monoid m =>
        (a -> m) -> DirectAbstractDeclarator a -> m)
    -> (forall a b.
        (a -> b -> b) -> b -> DirectAbstractDeclarator a -> b)
    -> (forall a b.
        (a -> b -> b) -> b -> DirectAbstractDeclarator a -> b)
    -> (forall b a.
        (b -> a -> b) -> b -> DirectAbstractDeclarator a -> b)
    -> (forall b a.
        (b -> a -> b) -> b -> DirectAbstractDeclarator a -> b)
    -> (forall a. (a -> a -> a) -> DirectAbstractDeclarator a -> a)
    -> (forall a. (a -> a -> a) -> DirectAbstractDeclarator a -> a)
    -> (forall a. DirectAbstractDeclarator a -> [a])
    -> (forall a. DirectAbstractDeclarator a -> Bool)
    -> (forall a. DirectAbstractDeclarator a -> Int)
    -> (forall a. Eq a => a -> DirectAbstractDeclarator a -> Bool)
    -> (forall a. Ord a => DirectAbstractDeclarator a -> a)
    -> (forall a. Ord a => DirectAbstractDeclarator a -> a)
    -> (forall a. Num a => DirectAbstractDeclarator a -> a)
    -> (forall a. Num a => DirectAbstractDeclarator a -> a)
    -> Foldable DirectAbstractDeclarator
    forall a. Eq a => a -> DirectAbstractDeclarator a -> Bool
    forall a. Num a => DirectAbstractDeclarator a -> a
    forall a. Ord a => DirectAbstractDeclarator a -> a
    forall m. Monoid m => DirectAbstractDeclarator m -> m
    forall a. DirectAbstractDeclarator a -> Bool
    forall a. DirectAbstractDeclarator a -> Int
    forall a. DirectAbstractDeclarator a -> [a]
    forall a. (a -> a -> a) -> DirectAbstractDeclarator a -> a
    forall m a. Monoid m => (a -> m) -> DirectAbstractDeclarator a -> m
    forall b a. (b -> a -> b) -> b -> DirectAbstractDeclarator a -> b
    forall a b. (a -> b -> b) -> b -> DirectAbstractDeclarator a -> b
    forall (t :: * -> *).
    (forall m. Monoid m => t m -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. t a -> [a])
    -> (forall a. t a -> Bool)
    -> (forall a. t a -> Int)
    -> (forall a. Eq a => a -> t a -> Bool)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> Foldable t
    $cfold :: forall m. Monoid m => DirectAbstractDeclarator m -> m
    fold :: forall m. Monoid m => DirectAbstractDeclarator m -> m
    $cfoldMap :: forall m a. Monoid m => (a -> m) -> DirectAbstractDeclarator a -> m
    foldMap :: forall m a. Monoid m => (a -> m) -> DirectAbstractDeclarator a -> m
    $cfoldMap' :: forall m a. Monoid m => (a -> m) -> DirectAbstractDeclarator a -> m
    foldMap' :: forall m a. Monoid m => (a -> m) -> DirectAbstractDeclarator a -> m
    $cfoldr :: forall a b. (a -> b -> b) -> b -> DirectAbstractDeclarator a -> b
    foldr :: forall a b. (a -> b -> b) -> b -> DirectAbstractDeclarator a -> b
    $cfoldr' :: forall a b. (a -> b -> b) -> b -> DirectAbstractDeclarator a -> b
    foldr' :: forall a b. (a -> b -> b) -> b -> DirectAbstractDeclarator a -> b
    $cfoldl :: forall b a. (b -> a -> b) -> b -> DirectAbstractDeclarator a -> b
    foldl :: forall b a. (b -> a -> b) -> b -> DirectAbstractDeclarator a -> b
    $cfoldl' :: forall b a. (b -> a -> b) -> b -> DirectAbstractDeclarator a -> b
    foldl' :: forall b a. (b -> a -> b) -> b -> DirectAbstractDeclarator a -> b
    $cfoldr1 :: forall a. (a -> a -> a) -> DirectAbstractDeclarator a -> a
    foldr1 :: forall a. (a -> a -> a) -> DirectAbstractDeclarator a -> a
    $cfoldl1 :: forall a. (a -> a -> a) -> DirectAbstractDeclarator a -> a
    foldl1 :: forall a. (a -> a -> a) -> DirectAbstractDeclarator a -> a
    $ctoList :: forall a. DirectAbstractDeclarator a -> [a]
    toList :: forall a. DirectAbstractDeclarator a -> [a]
    $cnull :: forall a. DirectAbstractDeclarator a -> Bool
    null :: forall a. DirectAbstractDeclarator a -> Bool
    $clength :: forall a. DirectAbstractDeclarator a -> Int
    length :: forall a. DirectAbstractDeclarator a -> Int
    $celem :: forall a. Eq a => a -> DirectAbstractDeclarator a -> Bool
    elem :: forall a. Eq a => a -> DirectAbstractDeclarator a -> Bool
    $cmaximum :: forall a. Ord a => DirectAbstractDeclarator a -> a
    maximum :: forall a. Ord a => DirectAbstractDeclarator a -> a
    $cminimum :: forall a. Ord a => DirectAbstractDeclarator a -> a
    minimum :: forall a. Ord a => DirectAbstractDeclarator a -> a
    $csum :: forall a. Num a => DirectAbstractDeclarator a -> a
    sum :: forall a. Num a => DirectAbstractDeclarator a -> a
    $cproduct :: forall a. Num a => DirectAbstractDeclarator a -> a
    product :: forall a. Num a => DirectAbstractDeclarator a -> a
    Foldable, Functor DirectAbstractDeclarator
    Foldable DirectAbstractDeclarator
    (Functor DirectAbstractDeclarator,
     Foldable DirectAbstractDeclarator) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b)
     -> DirectAbstractDeclarator a -> f (DirectAbstractDeclarator b))
    -> (forall (f :: * -> *) a.
        Applicative f =>
        DirectAbstractDeclarator (f a) -> f (DirectAbstractDeclarator a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b)
        -> DirectAbstractDeclarator a -> m (DirectAbstractDeclarator b))
    -> (forall (m :: * -> *) a.
        Monad m =>
        DirectAbstractDeclarator (m a) -> m (DirectAbstractDeclarator a))
    -> Traversable DirectAbstractDeclarator
    forall (t :: * -> *).
    (Functor t, Foldable t) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> t a -> f (t b))
    -> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> t a -> m (t b))
    -> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
    -> Traversable t
    forall (m :: * -> *) a.
    Monad m =>
    DirectAbstractDeclarator (m a) -> m (DirectAbstractDeclarator a)
    forall (f :: * -> *) a.
    Applicative f =>
    DirectAbstractDeclarator (f a) -> f (DirectAbstractDeclarator a)
    forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> DirectAbstractDeclarator a -> m (DirectAbstractDeclarator b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> DirectAbstractDeclarator a -> f (DirectAbstractDeclarator b)
    $ctraverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> DirectAbstractDeclarator a -> f (DirectAbstractDeclarator b)
    traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> DirectAbstractDeclarator a -> f (DirectAbstractDeclarator b)
    $csequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    DirectAbstractDeclarator (f a) -> f (DirectAbstractDeclarator a)
    sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    DirectAbstractDeclarator (f a) -> f (DirectAbstractDeclarator a)
    $cmapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> DirectAbstractDeclarator a -> m (DirectAbstractDeclarator b)
    mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> DirectAbstractDeclarator a -> m (DirectAbstractDeclarator b)
    $csequence :: forall (m :: * -> *) a.
    Monad m =>
    DirectAbstractDeclarator (m a) -> m (DirectAbstractDeclarator a)
    sequence :: forall (m :: * -> *) a.
    Monad m =>
    DirectAbstractDeclarator (m a) -> m (DirectAbstractDeclarator a)
    Traversable)

    direct_abstract_declarator :: CParser i m => m (DirectAbstractDeclarator i)
    direct_abstract_declarator :: forall i (m :: * -> *).
    CParser i m =>
    m (DirectAbstractDeclarator i)
    direct_abstract_declarator = do
      ddecltor <- [m (DirectAbstractDeclarator i)] -> m (DirectAbstractDeclarator i)
    forall (t :: * -> *) (m :: * -> *) a.
    (Foldable t, MonadPlus m) =>
    t (m a) -> m a
    msum
        [ m (DirectAbstractDeclarator i) -> m (DirectAbstractDeclarator i)
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try (ArrayOrProto i -> DirectAbstractDeclarator i
    forall i. ArrayOrProto i -> DirectAbstractDeclarator i
    ArrayOrProtoHere (ArrayOrProto i -> DirectAbstractDeclarator i)
    -> m (ArrayOrProto i) -> m (DirectAbstractDeclarator i)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m (ArrayOrProto i)
    forall i (m :: * -> *). CParser i m => m (ArrayOrProto i)
    array_or_proto)
        , AbstractDeclarator i -> DirectAbstractDeclarator i
    forall i. AbstractDeclarator i -> DirectAbstractDeclarator i
    AbstractDeclaratorParens (AbstractDeclarator i -> DirectAbstractDeclarator i)
    -> m (AbstractDeclarator i) -> m (DirectAbstractDeclarator i)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m (AbstractDeclarator i) -> m (AbstractDeclarator i)
    forall (m :: * -> *) a. TokenParsing m => m a -> m a
    parens m (AbstractDeclarator i)
    forall i (m :: * -> *). CParser i m => m (AbstractDeclarator i)
    abstract_declarator
        ] m (DirectAbstractDeclarator i)
    -> String -> m (DirectAbstractDeclarator i)
    forall a. m a -> String -> m a
    forall (m :: * -> *) a. Parsing m => m a -> String -> m a
    <?> String
    "array, prototype, or parenthesised abstract declarator"
      aops <- many array_or_proto
      return $ foldl ArrayOrProtoThere ddecltor aops

    ------------------------------------------------------------------------
    -- Pretty printing

    instance Pretty CIdentifier where
      pretty :: forall ann. CIdentifier -> Doc ann
    pretty = String -> Doc ann
    forall a. IsString a => String -> a
    fromString (String -> Doc ann)
    -> (CIdentifier -> String) -> CIdentifier -> Doc ann
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . CIdentifier -> String
    unCIdentifier

    instance Pretty DeclarationSpecifier where
      pretty :: forall ann. DeclarationSpecifier -> Doc ann
    pretty DeclarationSpecifier
    dspec = case DeclarationSpecifier
    dspec of
        StorageClassSpecifier StorageClassSpecifier
    x -> StorageClassSpecifier -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. StorageClassSpecifier -> Doc ann
    pretty StorageClassSpecifier
    x
        TypeSpecifier TypeSpecifier
    x -> TypeSpecifier -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. TypeSpecifier -> Doc ann
    pretty TypeSpecifier
    x
        TypeQualifier TypeQualifier
    x -> TypeQualifier -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. TypeQualifier -> Doc ann
    pretty TypeQualifier
    x
        FunctionSpecifier FunctionSpecifier
    x -> FunctionSpecifier -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. FunctionSpecifier -> Doc ann
    pretty FunctionSpecifier
    x

    instance Pretty StorageClassSpecifier where
      pretty :: forall ann. StorageClassSpecifier -> Doc ann
    pretty StorageClassSpecifier
    storage = case StorageClassSpecifier
    storage of
        StorageClassSpecifier
    TYPEDEF -> Doc ann
    "typedef"
        StorageClassSpecifier
    EXTERN -> Doc ann
    "extern"
        StorageClassSpecifier
    STATIC -> Doc ann
    "static"
        StorageClassSpecifier
    AUTO -> Doc ann
    "auto"
        StorageClassSpecifier
    REGISTER -> Doc ann
    "register"

    instance Pretty TypeSpecifier where
      pretty :: forall ann. TypeSpecifier -> Doc ann
    pretty TypeSpecifier
    tySpec = case TypeSpecifier
    tySpec of
       TypeSpecifier
    VOID -> Doc ann
    "void"
       TypeSpecifier
    BOOL -> Doc ann
    "bool"
       TypeSpecifier
    CHAR -> Doc ann
    "char"
       TypeSpecifier
    SHORT -> Doc ann
    "short"
       TypeSpecifier
    INT -> Doc ann
    "int"
       TypeSpecifier
    LONG -> Doc ann
    "long"
       TypeSpecifier
    FLOAT -> Doc ann
    "float"
       TypeSpecifier
    DOUBLE -> Doc ann
    "double"
       TypeSpecifier
    SIGNED -> Doc ann
    "signed"
       TypeSpecifier
    UNSIGNED -> Doc ann
    "unsigned"
       Struct CIdentifier
    x -> Doc ann
    "struct" Doc ann -> Doc ann -> Doc ann
    forall ann. Doc ann -> Doc ann -> Doc ann
    <+> CIdentifier -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. CIdentifier -> Doc ann
    pretty CIdentifier
    x
       Enum CIdentifier
    x -> Doc ann
    "enum" Doc ann -> Doc ann -> Doc ann
    forall ann. Doc ann -> Doc ann -> Doc ann
    <+> CIdentifier -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. CIdentifier -> Doc ann
    pretty CIdentifier
    x
       TypeName CIdentifier
    x -> CIdentifier -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. CIdentifier -> Doc ann
    pretty CIdentifier
    x
       Template CIdentifier
    x [[TypeSpecifier]]
    args ->
         -- This code generates a c++ code of "template-identifier<template-argument1,template-argument2,..>" like "std::vector<int>".
         -- concat_with_space is used to concat multiple terms like "unsigned int".
         let concat_with_space :: [TypeSpecifier] -> Doc ann
    concat_with_space = [Doc ann] -> Doc ann
    forall a. Monoid a => [a] -> a
    mconcat ([Doc ann] -> Doc ann)
    -> ([TypeSpecifier] -> [Doc ann]) -> [TypeSpecifier] -> Doc ann
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Doc ann -> [Doc ann] -> [Doc ann]
    forall a. a -> [a] -> [a]
    intersperse Doc ann
    " ") ([Doc ann] -> [Doc ann])
    -> ([TypeSpecifier] -> [Doc ann]) -> [TypeSpecifier] -> [Doc ann]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ((TypeSpecifier -> Doc ann) -> [TypeSpecifier] -> [Doc ann]
    forall a b. (a -> b) -> [a] -> [b]
    map TypeSpecifier -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. TypeSpecifier -> Doc ann
    pretty)
         in CIdentifier -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. CIdentifier -> Doc ann
    pretty CIdentifier
    x Doc ann -> Doc ann -> Doc ann
    forall ann. Doc ann -> Doc ann -> Doc ann
    <+> Doc ann
    "<" Doc ann -> Doc ann -> Doc ann
    forall ann. Doc ann -> Doc ann -> Doc ann
    <+> [Doc ann] -> Doc ann
    forall a. Monoid a => [a] -> a
    mconcat (Doc ann -> [Doc ann] -> [Doc ann]
    forall a. a -> [a] -> [a]
    intersperse Doc ann
    "," (([TypeSpecifier] -> Doc ann) -> [[TypeSpecifier]] -> [Doc ann]
    forall a b. (a -> b) -> [a] -> [b]
    map [TypeSpecifier] -> Doc ann
    forall ann. [TypeSpecifier] -> Doc ann
    concat_with_space [[TypeSpecifier]]
    args))  Doc ann -> Doc ann -> Doc ann
    forall ann. Doc ann -> Doc ann -> Doc ann
    <+> Doc ann
    ">"
       TemplateConst String
    x -> String -> Doc ann
    forall ann. String -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    pretty String
    x
       TemplatePointer TypeSpecifier
    x -> TypeSpecifier -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. TypeSpecifier -> Doc ann
    pretty TypeSpecifier
    x Doc ann -> Doc ann -> Doc ann
    forall ann. Doc ann -> Doc ann -> Doc ann
    <+> Doc ann
    "*"

    instance Pretty TypeQualifier where
      pretty :: forall ann. TypeQualifier -> Doc ann
    pretty TypeQualifier
    tyQual = case TypeQualifier
    tyQual of
        TypeQualifier
    CONST -> Doc ann
    "const"
        TypeQualifier
    RESTRICT -> Doc ann
    "restrict"
        TypeQualifier
    VOLATILE -> Doc ann
    "volatile"

    instance Pretty FunctionSpecifier where
      pretty :: forall ann. FunctionSpecifier -> Doc ann
    pretty FunctionSpecifier
    funSpec = case FunctionSpecifier
    funSpec of
        FunctionSpecifier
    INLINE -> Doc ann
    "inline"

    instance Pretty i => Pretty (Declarator i) where
      pretty :: forall ann. Declarator i -> Doc ann
    pretty (Declarator [Pointer]
    ptrs DirectDeclarator i
    ddecltor) = case [Pointer]
    ptrs of
        [] -> DirectDeclarator i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. DirectDeclarator i -> Doc ann
    pretty DirectDeclarator i
    ddecltor
        Pointer
    _:[Pointer]
    _ -> [Pointer] -> Doc ann
    forall ann. [Pointer] -> Doc ann
    prettyPointers [Pointer]
    ptrs Doc ann -> Doc ann -> Doc ann
    forall ann. Doc ann -> Doc ann -> Doc ann
    <+> DirectDeclarator i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. DirectDeclarator i -> Doc ann
    pretty DirectDeclarator i
    ddecltor

    prettyPointers :: [Pointer] -> Doc ann
    prettyPointers :: forall ann. [Pointer] -> Doc ann
    prettyPointers [] = Doc ann
    ""
    prettyPointers (Pointer
    x : [Pointer]
    xs) = Pointer -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. Pointer -> Doc ann
    pretty Pointer
    x Doc ann -> Doc ann -> Doc ann
    forall a. Semigroup a => a -> a -> a
    <> [Pointer] -> Doc ann
    forall ann. [Pointer] -> Doc ann
    prettyPointers [Pointer]
    xs

    instance Pretty Pointer where
      pretty :: forall ann. Pointer -> Doc ann
    pretty (Pointer [TypeQualifier]
    tyQual) = Doc ann
    "*" Doc ann -> Doc ann -> Doc ann
    forall a. Semigroup a => a -> a -> a
    <> [Doc ann] -> Doc ann
    forall ann. [Doc ann] -> Doc ann
    hsep ((TypeQualifier -> Doc ann) -> [TypeQualifier] -> [Doc ann]
    forall a b. (a -> b) -> [a] -> [b]
    map TypeQualifier -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. TypeQualifier -> Doc ann
    pretty [TypeQualifier]
    tyQual)

    instance Pretty i => Pretty (DirectDeclarator i) where
      pretty :: forall ann. DirectDeclarator i -> Doc ann
    pretty DirectDeclarator i
    decltor = case DirectDeclarator i
    decltor of
        DeclaratorRoot i
    x -> i -> Doc ann
    forall ann. i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    pretty i
    x
        DeclaratorParens Declarator i
    x -> Doc ann
    "(" Doc ann -> Doc ann -> Doc ann
    forall a. Semigroup a => a -> a -> a
    <> Declarator i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. Declarator i -> Doc ann
    pretty Declarator i
    x Doc ann -> Doc ann -> Doc ann
    forall a. Semigroup a => a -> a -> a
    <> Doc ann
    ")"
        ArrayOrProto DirectDeclarator i
    ddecltor ArrayOrProto i
    aorp -> DirectDeclarator i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. DirectDeclarator i -> Doc ann
    pretty DirectDeclarator i
    ddecltor Doc ann -> Doc ann -> Doc ann
    forall a. Semigroup a => a -> a -> a
    <> ArrayOrProto i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. ArrayOrProto i -> Doc ann
    pretty ArrayOrProto i
    aorp

    instance Pretty i => Pretty (ArrayOrProto i) where
      pretty :: forall ann. ArrayOrProto i -> Doc ann
    pretty ArrayOrProto i
    aorp = case ArrayOrProto i
    aorp of
        Array ArrayType i
    x -> Doc ann
    "[" Doc ann -> Doc ann -> Doc ann
    forall a. Semigroup a => a -> a -> a
    <> ArrayType i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. ArrayType i -> Doc ann
    pretty ArrayType i
    x Doc ann -> Doc ann -> Doc ann
    forall a. Semigroup a => a -> a -> a
    <> Doc ann
    "]"
        Proto [ParameterDeclaration i]
    x -> Doc ann
    "(" Doc ann -> Doc ann -> Doc ann
    forall a. Semigroup a => a -> a -> a
    <> [ParameterDeclaration i] -> Doc ann
    forall a ann. Pretty a => [a] -> Doc ann
    prettyParams [ParameterDeclaration i]
    x Doc ann -> Doc ann -> Doc ann
    forall a. Semigroup a => a -> a -> a
    <> Doc ann
    ")"

    prettyParams :: (Pretty a) => [a] -> Doc ann
    prettyParams :: forall a ann. Pretty a => [a] -> Doc ann
    prettyParams [a]
    xs = case [a]
    xs of
      [] -> Doc ann
    ""
      [a
    x] -> a -> Doc ann
    forall ann. a -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    pretty a
    x
      a
    x : xs' :: [a]
    xs'@(a
    _:[a]
    _) -> a -> Doc ann
    forall ann. a -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    pretty a
    x Doc ann -> Doc ann -> Doc ann
    forall a. Semigroup a => a -> a -> a
    <> Doc ann
    "," Doc ann -> Doc ann -> Doc ann
    forall ann. Doc ann -> Doc ann -> Doc ann
    <+> [a] -> Doc ann
    forall a ann. Pretty a => [a] -> Doc ann
    prettyParams [a]
    xs'

    instance Pretty i => Pretty (ArrayType i) where
      pretty :: forall ann. ArrayType i -> Doc ann
    pretty ArrayType i
    at = case ArrayType i
    at of
        ArrayType i
    VariablySized -> Doc ann
    "*"
        SizedByInteger Integer
    n -> Integer -> Doc ann
    forall ann. Integer -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    pretty Integer
    n
        SizedByIdentifier i
    s -> i -> Doc ann
    forall ann. i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    pretty i
    s
        ArrayType i
    Unsized -> Doc ann
    ""

    instance Pretty i => Pretty (ParameterDeclaration i) where
      pretty :: forall ann. ParameterDeclaration i -> Doc ann
    pretty (ParameterDeclaration [DeclarationSpecifier]
    declSpecs DeclaratorOrAbstractDeclarator i
    decltor) = case [DeclarationSpecifier]
    declSpecs of
        [] -> Doc ann
    forall {ann}. Doc ann
    decltorDoc
        DeclarationSpecifier
    _:[DeclarationSpecifier]
    _ -> [Doc ann] -> Doc ann
    forall ann. [Doc ann] -> Doc ann
    hsep ((DeclarationSpecifier -> Doc ann)
    -> [DeclarationSpecifier] -> [Doc ann]
    forall a b. (a -> b) -> [a] -> [b]
    map DeclarationSpecifier -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. DeclarationSpecifier -> Doc ann
    pretty [DeclarationSpecifier]
    declSpecs) Doc ann -> Doc ann -> Doc ann
    forall ann. Doc ann -> Doc ann -> Doc ann
    <+> Doc ann
    forall {ann}. Doc ann
    decltorDoc
        where
          decltorDoc :: Doc ann
    decltorDoc = case DeclaratorOrAbstractDeclarator i
    decltor of
            IsDeclarator Declarator i
    x -> Declarator i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. Declarator i -> Doc ann
    pretty Declarator i
    x
            IsAbstractDeclarator AbstractDeclarator i
    x -> AbstractDeclarator i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. AbstractDeclarator i -> Doc ann
    pretty AbstractDeclarator i
    x

    instance Pretty i => Pretty (AbstractDeclarator i) where
      pretty :: forall ann. AbstractDeclarator i -> Doc ann
    pretty (AbstractDeclarator [Pointer]
    ptrs Maybe (DirectAbstractDeclarator i)
    mbDecltor) = case ([Pointer]
    ptrs, Maybe (DirectAbstractDeclarator i)
    mbDecltor) of
        ([Pointer]
    _, Maybe (DirectAbstractDeclarator i)
    Nothing) -> [Pointer] -> Doc ann
    forall ann. [Pointer] -> Doc ann
    prettyPointers [Pointer]
    ptrs
        ([], Just DirectAbstractDeclarator i
    x) -> DirectAbstractDeclarator i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. DirectAbstractDeclarator i -> Doc ann
    pretty DirectAbstractDeclarator i
    x
        (Pointer
    _:[Pointer]
    _, Just DirectAbstractDeclarator i
    x) -> [Pointer] -> Doc ann
    forall ann. [Pointer] -> Doc ann
    prettyPointers [Pointer]
    ptrs Doc ann -> Doc ann -> Doc ann
    forall ann. Doc ann -> Doc ann -> Doc ann
    <+> DirectAbstractDeclarator i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. DirectAbstractDeclarator i -> Doc ann
    pretty DirectAbstractDeclarator i
    x

    instance Pretty i => Pretty (DirectAbstractDeclarator i) where
      pretty :: forall ann. DirectAbstractDeclarator i -> Doc ann
    pretty DirectAbstractDeclarator i
    ddecltor = case DirectAbstractDeclarator i
    ddecltor of
        AbstractDeclaratorParens AbstractDeclarator i
    x -> Doc ann
    "(" Doc ann -> Doc ann -> Doc ann
    forall a. Semigroup a => a -> a -> a
    <> AbstractDeclarator i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. AbstractDeclarator i -> Doc ann
    pretty AbstractDeclarator i
    x Doc ann -> Doc ann -> Doc ann
    forall a. Semigroup a => a -> a -> a
    <> Doc ann
    ")"
        ArrayOrProtoHere ArrayOrProto i
    aop -> ArrayOrProto i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. ArrayOrProto i -> Doc ann
    pretty ArrayOrProto i
    aop
        ArrayOrProtoThere DirectAbstractDeclarator i
    ddecltor' ArrayOrProto i
    aop -> DirectAbstractDeclarator i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. DirectAbstractDeclarator i -> Doc ann
    pretty DirectAbstractDeclarator i
    ddecltor' Doc ann -> Doc ann -> Doc ann
    forall a. Semigroup a => a -> a -> a
    <> ArrayOrProto i -> Doc ann
    forall a ann. Pretty a => a -> Doc ann
    forall ann. ArrayOrProto i -> Doc ann
    pretty ArrayOrProto i
    aop

    ------------------------------------------------------------------------
    -- Utils

    many1 :: CParser i m => m a -> m [a]
    many1 :: forall i (m :: * -> *) a. CParser i m => m a -> m [a]
    many1 m a
    p = (:) (a -> [a] -> [a]) -> m a -> m ([a] -> [a])
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m a
    p m ([a] -> [a]) -> m [a] -> m [a]
    forall a b. m (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> m a -> m [a]
    forall a. m a -> m [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many m a
    p

    ------------------------------------------------------------------------
    -- YACC grammar

    -- $yacc
    --
    -- The parser above is derived from a modification of the YACC grammar
    -- for C99 found at <http://www.quut.com/c/ANSI-C-grammar-y-1999.html>,
    -- reproduced below.
    --
    -- @
    -- %token IDENTIFIER TYPE_NAME INTEGER
    --
    -- %token TYPEDEF EXTERN STATIC AUTO REGISTER INLINE RESTRICT
    -- %token CHAR SHORT INT LONG SIGNED UNSIGNED FLOAT DOUBLE CONST VOLATILE VOID
    -- %token BOOL COMPLEX IMAGINARY
    -- %token STRUCT UNION ENUM
    --
    -- %start parameter_list
    -- %%
    --
    -- declaration_specifiers
    -- 	: storage_class_specifier
    -- 	| storage_class_specifier declaration_specifiers
    -- 	| type_specifier
    -- 	| type_specifier declaration_specifiers
    -- 	| type_qualifier
    -- 	| type_qualifier declaration_specifiers
    -- 	| function_specifier
    -- 	| function_specifier declaration_specifiers
    -- 	;
    --
    -- storage_class_specifier
    -- 	: TYPEDEF
    -- 	| EXTERN
    -- 	| STATIC
    -- 	| AUTO
    -- 	| REGISTER
    -- 	;
    --
    -- type_specifier
    -- 	: VOID
    -- 	| CHAR
    -- 	| SHORT
    -- 	| INT
    -- 	| LONG
    -- 	| FLOAT
    -- 	| DOUBLE
    -- 	| SIGNED
    -- 	| UNSIGNED
    -- 	| BOOL
    -- 	| COMPLEX
    -- 	| IMAGINARY
    --  	| STRUCT IDENTIFIER
    -- 	| UNION IDENTIFIER
    -- 	| ENUM IDENTIFIER
    -- 	| TYPE_NAME
    -- 	;
    --
    -- type_qualifier
    -- 	: CONST
    -- 	| RESTRICT
    -- 	| VOLATILE
    -- 	;
    --
    -- function_specifier
    -- 	: INLINE
    -- 	;
    --
    -- declarator
    -- 	: pointer direct_declarator
    -- 	| direct_declarator
    -- 	;
    --
    -- direct_declarator
    -- 	: IDENTIFIER
    -- 	| '(' declarator ')'
    -- 	| direct_declarator '[' type_qualifier_list ']'
    -- 	| direct_declarator '[' type_qualifier_list '*' ']'
    -- 	| direct_declarator '[' '*' ']'
    --  	| direct_declarator '[' IDENTIFIER ']'
    -- 	| direct_declarator '[' INTEGER ']'
    -- 	| direct_declarator '[' ']'
    -- 	| direct_declarator '(' parameter_list ')'
    -- 	| direct_declarator '(' ')'
    -- 	;
    --
    -- pointer
    -- 	: '*'
    -- 	| '*' type_qualifier_list
    -- 	| '*' pointer
    -- 	| '*' type_qualifier_list pointer
    -- 	;
    --
    -- type_qualifier_list
    -- 	: type_qualifier
    -- 	| type_qualifier_list type_qualifier
    -- 	;
    --
    -- parameter_list
    -- 	: parameter_declaration
    -- 	| parameter_list ',' parameter_declaration
    -- 	;
    --
    -- parameter_declaration
    -- 	: declaration_specifiers declarator
    -- 	| declaration_specifiers abstract_declarator
    -- 	| declaration_specifiers
    -- 	;
    --
    -- abstract_declarator
    -- 	: pointer
    -- 	| direct_abstract_declarator
    -- 	| pointer direct_abstract_declarator
    -- 	;
    --
    -- direct_abstract_declarator
    -- 	: '(' abstract_declarator ')'
    -- 	| '[' ']'
    -- 	| direct_abstract_declarator '[' ']'
    -- 	| '[' '*' ']'
    -- 	| direct_abstract_declarator '[' '*' ']'
    -- 	| '[' IDENTIFIER ']'
    -- 	| direct_abstract_declarator '[' IDENTIFIER ']'
    -- 	| '[' INTEGER ']'
    -- 	| direct_abstract_declarator '[' INTEGER ']'
    -- 	| '(' ')'
    -- 	| '(' parameter_list ')'
    -- 	| direct_abstract_declarator '(' ')'
    -- 	| direct_abstract_declarator '(' parameter_list ')'
    -- 	;
    --
    -- %%
    -- #include \<stdio.h\>
    --
    -- extern char yytext[];
    -- extern int column;
    --
    -- void yyerror(char const *s)
    -- {
    -- 	fflush(stdout);
    -- 	printf("\n%*s\n%*s\n", column, "^", column, s);
    -- }
    -- @

    -- Utils
    ------------------------------------------------------------------------

    cppIdentParser :: (Monad m, CharParsing m) => Bool -> IdentifierStyle m -> m [Char]
    cppIdentParser :: forall (m :: * -> *).
    (Monad m, CharParsing m) =>
    Bool -> IdentifierStyle m -> m String
    cppIdentParser Bool
    useCpp IdentifierStyle m
    s = m String
    cidentParserWithNamespace
      where
        cidentParser :: m String
    cidentParser = ((:) (Char -> String -> String) -> m Char -> m (String -> String)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> IdentifierStyle m -> m Char
    forall (m :: * -> *). IdentifierStyle m -> m Char
    _styleStart IdentifierStyle m
    s m (String -> String) -> m String -> m String
    forall a b. m (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> m Char -> m String
    forall a. m a -> m [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many (IdentifierStyle m -> m Char
    forall (m :: * -> *). IdentifierStyle m -> m Char
    _styleLetter IdentifierStyle m
    s) m String -> String -> m String
    forall a. m a -> String -> m a
    forall (m :: * -> *) a. Parsing m => m a -> String -> m a
    <?> IdentifierStyle m -> String
    forall (m :: * -> *). IdentifierStyle m -> String
    _styleName IdentifierStyle m
    s)
        cidentParserWithNamespace :: m String
    cidentParserWithNamespace =
          if Bool
    useCpp
          then
            m String -> m String
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try ([String] -> String
    forall (t :: * -> *) a. Foldable t => t [a] -> [a]
    concat ([String] -> String) -> m [String] -> m String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> [m String] -> m [String]
    forall (t :: * -> *) (m :: * -> *) a.
    (Traversable t, Monad m) =>
    t (m a) -> m (t a)
    forall (m :: * -> *) a. Monad m => [m a] -> m [a]
    sequence [m String
    cidentParser, (String -> m String
    forall (m :: * -> *). CharParsing m => String -> m String
    string String
    "::"), m String
    cidentParserWithNamespace]) m String -> m String -> m String
    forall a. m a -> m a -> m a
    forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
    <|>
            m String
    cidentParser
          else
            m String
    cidentParser

    identNoLex :: (TokenParsing m, Monad m, IsString s) => Bool -> IdentifierStyle m -> m s
    identNoLex :: forall (m :: * -> *) s.
    (TokenParsing m, Monad m, IsString s) =>
    Bool -> IdentifierStyle m -> m s
    identNoLex Bool
    useCpp IdentifierStyle m
    s = (String -> s) -> m String -> m s
    forall a b. (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> s
    forall a. IsString a => String -> a
    fromString (m String -> m s) -> m String -> m s
    forall a b. (a -> b) -> a -> b
    $ m String -> m String
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try (m String -> m String) -> m String -> m String
    forall a b. (a -> b) -> a -> b
    $ do
      name <- Highlight -> m String -> m String
    forall a. Highlight -> m a -> m a
    forall (m :: * -> *) a. TokenParsing m => Highlight -> m a -> m a
    highlight (IdentifierStyle m -> Highlight
    forall (m :: * -> *). IdentifierStyle m -> Highlight
    _styleHighlight IdentifierStyle m
    s) (Bool -> IdentifierStyle m -> m String
    forall (m :: * -> *).
    (Monad m, CharParsing m) =>
    Bool -> IdentifierStyle m -> m String
    cppIdentParser Bool
    useCpp IdentifierStyle m
    s)
      when (HashSet.member name (_styleReserved s)) $ unexpected $ "reserved " ++ _styleName s ++ " " ++ show name
      return name

    ident' :: (TokenParsing m, Monad m, IsString s) => Bool -> IdentifierStyle m -> m s
    ident' :: forall (m :: * -> *) s.
    (TokenParsing m, Monad m, IsString s) =>
    Bool -> IdentifierStyle m -> m s
    ident' Bool
    useCpp IdentifierStyle m
    s = (String -> s) -> m String -> m s
    forall a b. (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> s
    forall a. IsString a => String -> a
    fromString (m String -> m s) -> m String -> m s
    forall a b. (a -> b) -> a -> b
    $ m String -> m String
    forall a. m a -> m a
    forall (m :: * -> *) a. TokenParsing m => m a -> m a
    token (m String -> m String) -> m String -> m String
    forall a b. (a -> b) -> a -> b
    $ m String -> m String
    forall a. m a -> m a
    forall (m :: * -> *) a. Parsing m => m a -> m a
    try (m String -> m String) -> m String -> m String
    forall a b. (a -> b) -> a -> b
    $ do
      name <- Highlight -> m String -> m String
    forall a. Highlight -> m a -> m a
    forall (m :: * -> *) a. TokenParsing m => Highlight -> m a -> m a
    highlight (IdentifierStyle m -> Highlight
    forall (m :: * -> *). IdentifierStyle m -> Highlight
    _styleHighlight IdentifierStyle m
    s) (Bool -> IdentifierStyle m -> m String
    forall (m :: * -> *).
    (Monad m, CharParsing m) =>
    Bool -> IdentifierStyle m -> m String
    cppIdentParser Bool
    useCpp IdentifierStyle m
    s)
      when (HashSet.member name (_styleReserved s)) $ unexpected $ "reserved " ++ _styleName s ++ " " ++ show name
      return name