    {-# LANGUAGE CPP #-}

    module UU.Scanner.TokenParser where

    import UU.Parsing.Interface(IsParser(..), (<$), (<$>))
    import UU.Parsing.Derived(pListSep, pPacked)
    import UU.Scanner.Position(Pos)
    import UU.Scanner.GenTokenParser(pReserved, pValToken)
    import UU.Scanner.Token(Token,EnumValToken(..))

    -------------------------------------------------------------------------
    -- IsParsers for  Symbols
    -------------------------------------------------------------------------

    pKeyPos           :: IsParser p Token => String -> p Pos
    pKeyPos :: String -> p Pos
    pKeyPos  keyword :: String
    keyword  =  String -> p Pos
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    key -> p Pos
    pReserved String
    keyword

    pSpecPos          :: IsParser p Token => Char -> p Pos
    pSpecPos :: Char -> p Pos
    pSpecPos s :: Char
    s        =  String -> p Pos
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    key -> p Pos
    pReserved [Char
    s]

    pKey              :: IsParser p Token => String -> p String
    pKey :: String -> p String
    pKey  key :: String
    key         =  String
    key String -> p Pos -> p String
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ String -> p Pos
    forall (p :: * -> *). IsParser p Token => String -> p Pos
    pKeyPos String
    key

    pSpec             :: IsParser p Token => Char -> p String
    pSpec :: Char -> p String
    pSpec c :: Char
    c           =  [Char
    c] String -> p Pos -> p String
    forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    <$ Char -> p Pos
    forall (p :: * -> *). IsParser p Token => Char -> p Pos
    pSpecPos Char
    c

    pStringPos, pCharPos,
      pInteger8Pos, pInteger10Pos, pInteger16Pos, pFractionPos,
      pVaridPos, pConidPos,
      pTextnmPos, pTextlnPos, pIntegerPos, pVarsymPos, pConsymPos  :: IsParser p Token => p (String,Pos)

    pStringPos :: p (String, Pos)
    pStringPos     =   EnumValToken -> String -> p (String, Pos)
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    tp -> val -> p (val, Pos)
    pValToken EnumValToken
    TkString    ""
    pCharPos :: p (String, Pos)
    pCharPos       =   EnumValToken -> String -> p (String, Pos)
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    tp -> val -> p (val, Pos)
    pValToken EnumValToken
    TkChar      "\NUL"
    pInteger8Pos :: p (String, Pos)
    pInteger8Pos   =   EnumValToken -> String -> p (String, Pos)
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    tp -> val -> p (val, Pos)
    pValToken EnumValToken
    TkInteger8  "0"
    pInteger10Pos :: p (String, Pos)
    pInteger10Pos  =   EnumValToken -> String -> p (String, Pos)
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    tp -> val -> p (val, Pos)
    pValToken EnumValToken
    TkInteger10 "0"
    pInteger16Pos :: p (String, Pos)
    pInteger16Pos  =   EnumValToken -> String -> p (String, Pos)
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    tp -> val -> p (val, Pos)
    pValToken EnumValToken
    TkInteger16 "0"
    pFractionPos :: p (String, Pos)
    pFractionPos   =   EnumValToken -> String -> p (String, Pos)
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    tp -> val -> p (val, Pos)
    pValToken EnumValToken
    TkFraction  "0.0"
    pVaridPos :: p (String, Pos)
    pVaridPos      =   EnumValToken -> String -> p (String, Pos)
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    tp -> val -> p (val, Pos)
    pValToken EnumValToken
    TkVarid     "<identifier>"
    pConidPos :: p (String, Pos)
    pConidPos      =   EnumValToken -> String -> p (String, Pos)
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    tp -> val -> p (val, Pos)
    pValToken EnumValToken
    TkConid     "<Identifier>"
    pConsymPos :: p (String, Pos)
    pConsymPos     =   EnumValToken -> String -> p (String, Pos)
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    tp -> val -> p (val, Pos)
    pValToken EnumValToken
    TkConOp     "<conoperator>"
    pVarsymPos :: p (String, Pos)
    pVarsymPos     =   EnumValToken -> String -> p (String, Pos)
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    tp -> val -> p (val, Pos)
    pValToken EnumValToken
    TkOp        "<operator>"
    pTextnmPos :: p (String, Pos)
    pTextnmPos     =   EnumValToken -> String -> p (String, Pos)
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    tp -> val -> p (val, Pos)
    pValToken EnumValToken
    TkTextnm    "<name>"
    pTextlnPos :: p (String, Pos)
    pTextlnPos     =   EnumValToken -> String -> p (String, Pos)
    forall (p :: * -> *) key tp val.
    IsParser p (GenToken key tp val) =>
    tp -> val -> p (val, Pos)
    pValToken EnumValToken
    TkTextln    "<line>"
    pIntegerPos :: p (String, Pos)
    pIntegerPos    =   p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pInteger10Pos

    pString, pChar,
      pInteger8, pInteger10, pInteger16, pFraction,
      pVarid, pConid,
      pTextnm, pTextln, pInteger, pVarsym, pConsym  :: IsParser p Token => p String

    pString :: p String
    pString        = (String, Pos) -> String
    forall a b. (a, b) -> a
    fst ((String, Pos) -> String) -> p (String, Pos) -> p String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pStringPos
    pChar :: p String
    pChar          = (String, Pos) -> String
    forall a b. (a, b) -> a
    fst ((String, Pos) -> String) -> p (String, Pos) -> p String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pCharPos
    pInteger8 :: p String
    pInteger8      = (String, Pos) -> String
    forall a b. (a, b) -> a
    fst ((String, Pos) -> String) -> p (String, Pos) -> p String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pInteger8Pos
    pInteger10 :: p String
    pInteger10     = (String, Pos) -> String
    forall a b. (a, b) -> a
    fst ((String, Pos) -> String) -> p (String, Pos) -> p String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pInteger10Pos
    pInteger16 :: p String
    pInteger16     = (String, Pos) -> String
    forall a b. (a, b) -> a
    fst ((String, Pos) -> String) -> p (String, Pos) -> p String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pInteger16Pos
    pFraction :: p String
    pFraction      = (String, Pos) -> String
    forall a b. (a, b) -> a
    fst ((String, Pos) -> String) -> p (String, Pos) -> p String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pFractionPos
    pVarid :: p String
    pVarid         = (String, Pos) -> String
    forall a b. (a, b) -> a
    fst ((String, Pos) -> String) -> p (String, Pos) -> p String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pVaridPos
    pConid :: p String
    pConid         = (String, Pos) -> String
    forall a b. (a, b) -> a
    fst ((String, Pos) -> String) -> p (String, Pos) -> p String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pConidPos
    pVarsym :: p String
    pVarsym        = (String, Pos) -> String
    forall a b. (a, b) -> a
    fst ((String, Pos) -> String) -> p (String, Pos) -> p String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pVarsymPos
    pConsym :: p String
    pConsym        = (String, Pos) -> String
    forall a b. (a, b) -> a
    fst ((String, Pos) -> String) -> p (String, Pos) -> p String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pConsymPos
    pTextnm :: p String
    pTextnm        = (String, Pos) -> String
    forall a b. (a, b) -> a
    fst ((String, Pos) -> String) -> p (String, Pos) -> p String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pTextnmPos
    pTextln :: p String
    pTextln        = (String, Pos) -> String
    forall a b. (a, b) -> a
    fst ((String, Pos) -> String) -> p (String, Pos) -> p String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pTextlnPos
    pInteger :: p String
    pInteger       = (String, Pos) -> String
    forall a b. (a, b) -> a
    fst ((String, Pos) -> String) -> p (String, Pos) -> p String
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> p (String, Pos)
    forall (p :: * -> *). IsParser p Token => p (String, Pos)
    pIntegerPos

    pComma, pSemi, pOParen, pCParen, pOBrack, pCBrack, pOCurly, pCCurly
       :: IsParser p Token => p String

    pComma :: p String
    pComma  = Char -> p String
    forall (p :: * -> *). IsParser p Token => Char -> p String
    pSpec ','
    pSemi :: p String
    pSemi   = Char -> p String
    forall (p :: * -> *). IsParser p Token => Char -> p String
    pSpec ';'
    pOParen :: p String
    pOParen = Char -> p String
    forall (p :: * -> *). IsParser p Token => Char -> p String
    pSpec '('
    pCParen :: p String
    pCParen = Char -> p String
    forall (p :: * -> *). IsParser p Token => Char -> p String
    pSpec ')'
    pOBrack :: p String
    pOBrack = Char -> p String
    forall (p :: * -> *). IsParser p Token => Char -> p String
    pSpec '['
    pCBrack :: p String
    pCBrack = Char -> p String
    forall (p :: * -> *). IsParser p Token => Char -> p String
    pSpec ']'
    pOCurly :: p String
    pOCurly = Char -> p String
    forall (p :: * -> *). IsParser p Token => Char -> p String
    pSpec '{'
    pCCurly :: p String
    pCCurly = Char -> p String
    forall (p :: * -> *). IsParser p Token => Char -> p String
    pSpec '}'

    pCommaPos, pSemiPos, pOParenPos, pCParenPos, pOBrackPos, pCBrackPos, pOCurlyPos, pCCurlyPos
       :: IsParser p Token => p Pos

    pCommaPos :: p Pos
    pCommaPos  = Char -> p Pos
    forall (p :: * -> *). IsParser p Token => Char -> p Pos
    pSpecPos ','
    pSemiPos :: p Pos
    pSemiPos   = Char -> p Pos
    forall (p :: * -> *). IsParser p Token => Char -> p Pos
    pSpecPos ';'
    pOParenPos :: p Pos
    pOParenPos = Char -> p Pos
    forall (p :: * -> *). IsParser p Token => Char -> p Pos
    pSpecPos '('
    pCParenPos :: p Pos
    pCParenPos = Char -> p Pos
    forall (p :: * -> *). IsParser p Token => Char -> p Pos
    pSpecPos ')'
    pOBrackPos :: p Pos
    pOBrackPos = Char -> p Pos
    forall (p :: * -> *). IsParser p Token => Char -> p Pos
    pSpecPos '['
    pCBrackPos :: p Pos
    pCBrackPos = Char -> p Pos
    forall (p :: * -> *). IsParser p Token => Char -> p Pos
    pSpecPos ']'
    pOCurlyPos :: p Pos
    pOCurlyPos = Char -> p Pos
    forall (p :: * -> *). IsParser p Token => Char -> p Pos
    pSpecPos '{'
    pCCurlyPos :: p Pos
    pCCurlyPos = Char -> p Pos
    forall (p :: * -> *). IsParser p Token => Char -> p Pos
    pSpecPos '}'

    pCommas ::  IsParser p Token => p a -> p [a]
    pSemics ::  IsParser p Token => p a -> p [a]
    pParens ::  IsParser p Token => p a -> p a
    pBracks ::  IsParser p Token => p a -> p a
    pCurly  ::  IsParser p Token => p a -> p a

    pCommas :: p a -> p [a]
    pCommas  = p String -> p a -> p [a]
    forall (p :: * -> *) s a a1. IsParser p s => p a -> p a1 -> p [a1]
    pListSep p String
    forall (p :: * -> *). IsParser p Token => p String
    pComma
    pSemics :: p a -> p [a]
    pSemics  = p String -> p a -> p [a]
    forall (p :: * -> *) s a a1. IsParser p s => p a -> p a1 -> p [a1]
    pListSep p String
    forall (p :: * -> *). IsParser p Token => p String
    pSemi
    pParens :: p a -> p a
    pParens  = p String -> p String -> p a -> p a
    forall (p :: * -> *) s a b1 b.
    IsParser p s =>
    p a -> p b1 -> p b -> p b
    pPacked p String
    forall (p :: * -> *). IsParser p Token => p String
    pOParen p String
    forall (p :: * -> *). IsParser p Token => p String
    pCParen
    pBracks :: p a -> p a
    pBracks  = p String -> p String -> p a -> p a
    forall (p :: * -> *) s a b1 b.
    IsParser p s =>
    p a -> p b1 -> p b -> p b
    pPacked p String
    forall (p :: * -> *). IsParser p Token => p String
    pOBrack p String
    forall (p :: * -> *). IsParser p Token => p String
    pCBrack
    pCurly :: p a -> p a
    pCurly   = p String -> p String -> p a -> p a
    forall (p :: * -> *) s a b1 b.
    IsParser p s =>
    p a -> p b1 -> p b -> p b
    pPacked p String
    forall (p :: * -> *). IsParser p Token => p String
    pOCurly p String
    forall (p :: * -> *). IsParser p Token => p String
    pCCurly

    pParens_pCommas :: IsParser p Token => p a -> p [a]
    pBracks_pCommas :: IsParser p Token => p a -> p [a]
    pCurly_pSemics  :: IsParser p Token => p a -> p [a]

    pParens_pCommas :: p a -> p [a]
    pParens_pCommas = p [a] -> p [a]
    forall (p :: * -> *) a. IsParser p Token => p a -> p a
    pParens(p [a] -> p [a]) -> (p a -> p [a]) -> p a -> p [a]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    .p a -> p [a]
    forall (p :: * -> *) a. IsParser p Token => p a -> p [a]
    pCommas
    pBracks_pCommas :: p a -> p [a]
    pBracks_pCommas = p [a] -> p [a]
    forall (p :: * -> *) a. IsParser p Token => p a -> p a
    pBracks(p [a] -> p [a]) -> (p a -> p [a]) -> p a -> p [a]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    .p a -> p [a]
    forall (p :: * -> *) a. IsParser p Token => p a -> p [a]
    pCommas
    pCurly_pSemics :: p a -> p [a]
    pCurly_pSemics  = p [a] -> p [a]
    forall (p :: * -> *) a. IsParser p Token => p a -> p a
    pCurly (p [a] -> p [a]) -> (p a -> p [a]) -> p a -> p [a]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    .p a -> p [a]
    forall (p :: * -> *) a. IsParser p Token => p a -> p [a]
    pSemics