    module UU.Scanner.TokenShow() where

    import UU.Scanner.Token(Token,EnumValToken(..))
    import UU.Scanner.Position(Pos(..))
    import UU.Scanner.GenToken(GenToken(..))

    instance Show Token where
      showsPrec :: Line -> Token -> ShowS
    showsPrec Line
    _ Token
    token
        = Filename -> ShowS
    showString
           (case Token
    token of
             Reserved Filename
    key      Pos
    pos -> Filename
    "symbol "      Filename -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Filename
    key Filename -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Pos -> Filename
    maybeshow Pos
    pos
             ValToken EnumValToken
    tp Filename
    val   Pos
    pos -> EnumValToken -> Filename
    forall a. Show a => a -> Filename
    show EnumValToken
    tp Filename -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Filename
    " " Filename -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Filename
    val Filename -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Pos -> Filename
    maybeshow Pos
    pos
           )
    instance Show EnumValToken where
     show :: EnumValToken -> Filename
    show EnumValToken
    tp = case EnumValToken
    tp of
      EnumValToken
    TkOp         -> Filename
    "operator"
      EnumValToken
    TkConOp      -> Filename
    "con operator"
      EnumValToken
    TkString     -> Filename
    "string"
      EnumValToken
    TkChar       -> Filename
    "character"
      EnumValToken
    TkInteger8   -> Filename
    "octal integer"
      EnumValToken
    TkInteger10  -> Filename
    "decimal Integer"
      EnumValToken
    TkInteger16  -> Filename
    "hexadecimal integer"
      EnumValToken
    TkFraction   -> Filename
    "fraction (float,...)"
      EnumValToken
    TkVarid      -> Filename
    "lower case identifier"
      EnumValToken
    TkConid      -> Filename
    "upper case identifier"
      EnumValToken
    TkTextnm     -> Filename
    "text name"
      EnumValToken
    TkTextln     -> Filename
    "text lines"
      EnumValToken
    TkError      -> Filename
    "error in scanner:"

    maybeshow :: Pos -> String
    maybeshow :: Pos -> Filename
    maybeshow (Pos Line
    l Line
    c Filename
    fn) | Line
    l Line -> Line -> Bool
    forall a. Ord a => a -> a -> Bool
    <= Line
    0 Bool -> Bool -> Bool
    || Line
    c Line -> Line -> Bool
    forall a. Ord a => a -> a -> Bool
    <= Line
    0 =  Filename
    ""
                           | Bool
    otherwise        =  Filename
    " at line " Filename -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Line -> Filename
    forall a. Show a => a -> Filename
    show Line
    l
                                              Filename -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Filename
    ", column " Filename -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Line -> Filename
    forall a. Show a => a -> Filename
    show Line
    c
                                              Filename -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Filename
    " of file " Filename -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ ShowS
    forall a. Show a => a -> Filename
    show Filename
    fn