    --  C -> Haskell Compiler: Abstract Syntax for Header Files
    --
    --  Author : Manuel M T Chakravarty
    --  Created: 7 March 99
    --
    --  Version $Revision: 1.10 $ from $Date: 2004/06/11 07:10:16 $
    --
    --  Copyright (c) [1999..2004] Manuel M T Chakravarty
    --
    --  This file is free software; you can redistribute it and/or modify
    --  it under the terms of the GNU General Public License as published by
    --  the Free Software Foundation; either version 2 of the License, or
    --  (at your option) any later version.
    --
    --  This file is distributed in the hope that it will be useful,
    --  but WITHOUT ANY WARRANTY; without even the implied warranty of
    --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    --  GNU General Public License for more details.
    --
    --- DESCRIPTION ---------------------------------------------------------------
    --
    --  Abstract syntax of C header files.
    --
    --- DOCU ----------------------------------------------------------------------
    --
    --  language: Haskell 98
    --
    --  The tree structure corresponds to the grammar in Appendix A of K&R.  This
    --  abstract syntax simplifies the concrete syntax by merging similar concrete
    --  constructs into a single type of abstract tree structure: declarations are
    --  merged with structure declarations, parameter declarations and type names,
    --  and declarators are merged with abstract declarators.
    --
    --  With K&R we refer to ``The C Programming Language'', second edition, Brain
    --  W. Kernighan and Dennis M. Ritchie, Prentice Hall, 1988.  This module
    --  supports the C99 `restrict' extension
    --  <http://www.lysator.liu.se/c/restrict.html>, `inline' functions, and also
    --  the GNU C `alignof' extension.
    --
    --- TODO ----------------------------------------------------------------------
    --

    module CAST (CHeader(..), CExtDecl(..), CFunDef(..), CStat(..), CBlockItem(..),
                 CDecl(..), CDeclSpec(..), CStorageSpec(..), CTypeSpec(..),
                 CTypeQual(..), CStructUnion(..),  CStructTag(..), CEnum(..),
                 CDeclr(..), CInit(..), CInitList, CDesignator(..), CExpr(..),
                 CAssignOp(..), CBinaryOp(..), CUnaryOp(..), CConst (..))
    where

    import Position   (Position, Pos(posOf), nopos)
    import Idents     (Ident)
    import Attributes (Attrs)
    import Binary     (Binary(..), putByte, getByte)

    -- a complete C header file (K&R A10) (EXPORTED)
    --
    data CHeader = CHeader [CExtDecl]
                           Attrs

    instance Pos CHeader where
      posOf :: CHeader -> Position
    posOf (CHeader [CExtDecl]
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CHeader where
      (CHeader [CExtDecl]
    _ Attrs
    at1) == :: CHeader -> CHeader -> Bool
    == (CHeader [CExtDecl]
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- external C declaration (K&R A10) (EXPORTED)
    --
    data CExtDecl = CDeclExt CDecl
                  | CFDefExt CFunDef
                  | CAsmExt  Attrs          -- a chunk of assembly code (which is
                                            -- not itself recorded)

    instance Pos CExtDecl where
      posOf :: CExtDecl -> Position
    posOf (CDeclExt CDecl
    decl) = CDecl -> Position
    forall a. Pos a => a -> Position
    posOf CDecl
    decl
      posOf (CFDefExt CFunDef
    fdef) = CFunDef -> Position
    forall a. Pos a => a -> Position
    posOf CFunDef
    fdef
      posOf (CAsmExt Attrs
    at)    = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CExtDecl where
      CDeclExt CDecl
    decl1 == :: CExtDecl -> CExtDecl -> Bool
    == CDeclExt CDecl
    decl2 = CDecl
    decl1 CDecl -> CDecl -> Bool
    forall a. Eq a => a -> a -> Bool
    == CDecl
    decl2
      CFDefExt CFunDef
    fdef1 == CFDefExt CFunDef
    fdef2 = CFunDef
    fdef1 CFunDef -> CFunDef -> Bool
    forall a. Eq a => a -> a -> Bool
    == CFunDef
    fdef2
      CAsmExt Attrs
    at1    == CAsmExt Attrs
    at2    =   Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- C function definition (K&R A10.1) (EXPORTED)
    --
    --  * The only type specifiers allowed are `extern' and `static'.
    --
    --  * The declarator must specify explicitly that the declared identifier has
    --   function type.
    --
    --  * The optional declaration list is for old-style function declarations.
    --
    --  * The statement must be a compound statement.
    --
    data CFunDef = CFunDef [CDeclSpec]      -- type specifier and qualifier
                           CDeclr           -- declarator
                           [CDecl]          -- optional declaration list
                           CStat            -- compound statement
                           Attrs

    instance Pos CFunDef where
      posOf :: CFunDef -> Position
    posOf (CFunDef [CDeclSpec]
    _ CDeclr
    _ [CDecl]
    _ CStat
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CFunDef where
      CFunDef [CDeclSpec]
    _ CDeclr
    _ [CDecl]
    _ CStat
    _ Attrs
    at1 == :: CFunDef -> CFunDef -> Bool
    == CFunDef [CDeclSpec]
    _ CDeclr
    _ [CDecl]
    _ CStat
    _ Attrs
    at2 = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- C statement (A9) (EXPORTED)
    --
    data CStat = CLabel    Ident            -- label
                           CStat
                           Attrs
               | CCase     CExpr            -- constant expression
                           CStat
                           Attrs
               | CCases    CExpr            -- case range
                           CExpr            -- `case lower .. upper :'
                           CStat
                           Attrs
               | CDefault  CStat            -- default case
                           Attrs
               | CExpr     (Maybe CExpr)    -- expression statement, maybe empty
                           Attrs
               | CCompound [CBlockItem]     -- list of declarations and statements
                           Attrs
               | CIf       CExpr            -- conditional expression
                           CStat
                           (Maybe CStat)    -- optional "else" case
                           Attrs
               | CSwitch   CExpr            -- selector
                           CStat
                           Attrs
               | CWhile    CExpr
                           CStat
                           Bool             -- `True' implies "do-while" statement
                           Attrs
               | CFor      (Either (Maybe CExpr)
                                   CDecl)
                           (Maybe CExpr)
                           (Maybe CExpr)
                           CStat
                           Attrs
               | CGoto     Ident            -- label
                           Attrs
               | CGotoPtr  CExpr            -- computed address
                           Attrs
               | CCont     Attrs            -- continue statement
               | CBreak    Attrs            -- break statement
               | CReturn   (Maybe CExpr)
                           Attrs
               | CAsm      Attrs            -- a chunk of assembly code (which is
                                            -- not itself recorded)

    instance Pos CStat where
      posOf :: CStat -> Position
    posOf (CLabel    Ident
    _ CStat
    _     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CCase     CExpr
    _ CStat
    _     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CCases    CExpr
    _ CExpr
    _ CStat
    _   Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CDefault  CStat
    _       Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CExpr     Maybe CExpr
    _       Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CCompound [CBlockItem]
    _       Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CIf       CExpr
    _ CStat
    _ Maybe CStat
    _   Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CSwitch   CExpr
    _ CStat
    _     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CWhile    CExpr
    _ CStat
    _ Bool
    _   Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CFor      Either (Maybe CExpr) CDecl
    _ Maybe CExpr
    _ Maybe CExpr
    _ CStat
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CGoto     Ident
    _       Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CGotoPtr     CExpr
    _    Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CCont             Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CBreak            Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CReturn   Maybe CExpr
    _       Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CAsm              Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CStat where
      (CLabel    Ident
    _ CStat
    _     Attrs
    at1) == :: CStat -> CStat -> Bool
    == (CLabel    Ident
    _ CStat
    _     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CCase     CExpr
    _ CStat
    _     Attrs
    at1) == (CCase     CExpr
    _ CStat
    _     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CCases    CExpr
    _ CExpr
    _ CStat
    _   Attrs
    at1) == (CCases    CExpr
    _ CExpr
    _ CStat
    _   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CDefault  CStat
    _       Attrs
    at1) == (CDefault  CStat
    _       Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CExpr     Maybe CExpr
    _       Attrs
    at1) == (CExpr     Maybe CExpr
    _       Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CCompound [CBlockItem]
    _       Attrs
    at1) == (CCompound [CBlockItem]
    _       Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CIf       CExpr
    _ CStat
    _ Maybe CStat
    _   Attrs
    at1) == (CIf       CExpr
    _ CStat
    _ Maybe CStat
    _   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CSwitch   CExpr
    _ CStat
    _     Attrs
    at1) == (CSwitch   CExpr
    _ CStat
    _     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CWhile    CExpr
    _ CStat
    _ Bool
    _   Attrs
    at1) == (CWhile    CExpr
    _ CStat
    _ Bool
    _   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CFor      Either (Maybe CExpr) CDecl
    _ Maybe CExpr
    _ Maybe CExpr
    _ CStat
    _ Attrs
    at1) == (CFor      Either (Maybe CExpr) CDecl
    _ Maybe CExpr
    _ Maybe CExpr
    _ CStat
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CGoto     Ident
    _       Attrs
    at1) == (CGoto     Ident
    _       Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CGotoPtr  CExpr
    _       Attrs
    at1) == (CGotoPtr  CExpr
    _       Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CCont             Attrs
    at1) == (CCont             Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CBreak            Attrs
    at1) == (CBreak            Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CReturn   Maybe CExpr
    _       Attrs
    at1) == (CReturn   Maybe CExpr
    _       Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CAsm              Attrs
    at1) == (CAsm              Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- C99 Block items, things that may appear in compound statements
    data CBlockItem = CBlockStmt    CStat
                    | CBlockDecl    CDecl
                    | CNestedFunDef CFunDef         -- GNU C has nested functions

    instance Pos CBlockItem where
      posOf :: CBlockItem -> Position
    posOf (CBlockStmt CStat
    stmt)  = CStat -> Position
    forall a. Pos a => a -> Position
    posOf CStat
    stmt
      posOf (CBlockDecl CDecl
    decl)  = CDecl -> Position
    forall a. Pos a => a -> Position
    posOf CDecl
    decl
      posOf (CNestedFunDef CFunDef
    fdef) = CFunDef -> Position
    forall a. Pos a => a -> Position
    posOf CFunDef
    fdef

    instance Eq CBlockItem where
      CBlockStmt    CStat
    stmt1 == :: CBlockItem -> CBlockItem -> Bool
    == CBlockStmt    CStat
    stmt2 = CStat
    stmt1 CStat -> CStat -> Bool
    forall a. Eq a => a -> a -> Bool
    == CStat
    stmt2
      CBlockDecl    CDecl
    decl1 == CBlockDecl    CDecl
    decl2 = CDecl
    decl1 CDecl -> CDecl -> Bool
    forall a. Eq a => a -> a -> Bool
    == CDecl
    decl2
      CNestedFunDef CFunDef
    fdef1 == CNestedFunDef CFunDef
    fdef2 = CFunDef
    fdef1 CFunDef -> CFunDef -> Bool
    forall a. Eq a => a -> a -> Bool
    == CFunDef
    fdef2

    -- C declaration (K&R A8), structure declaration (K&R A8.3), parameter
    -- declaration (K&R A8.6.3), and type name (K&R A8.8) (EXPORTED)
    --
    --  * Toplevel declarations (K&R A8):
    --
    --   - they require that the type specifier and qualifier list is not empty,
    --     but gcc allows it and just issues a warning; for the time being, we
    --     also allow it;
    --   - at most one storage class specifier is allowed per declaration;
    --   - declarators must be present and size expressions are not allowed, ie,
    --     the elements of K&R's init-declarator-list are represented by triples
    --     of the form `(Just declr, oinit, Nothing)', where `oinit' maybe
    --     `Nothing' or `Just init'; and
    --   - abstract declarators are not allowed.
    --
    --  * Structure declarations (K&R A8.3):
    --
    --   - do not allow storage specifiers;
    --   - do not allow initializers;
    --   - require a non-empty declarator-triple list, where abstract declarators
    --     are not allowed; and
    --   - each of the declarator-triples has to contain either a declarator or a
    --     size expression, or both, ie, it has the form `(Just decl, Nothing,
    --     Nothing)', `(Nothing, Nothing, Just size)', or `(Just decl, Nothing,
    --     Just size)'.
    --
    --  * Parameter declarations (K&R A8.6.3):
    --
    --   - allow neither initializers nor size expressions;
    --   - allow at most one declarator triple of the form `(Just declr, Nothing,
    --     Nothing)' (in case of an empty declarator, the list must be empty); and
    --   - allow abstract declarators.
    --
    --  * Type names (A8.8):
    --
    --   - do not allow storage specifiers;
    --   - allow neither initializers nor size expressions; and
    --   - allow at most one declarator triple of the form `(Just declr, Nothing,
    --     Nothing)' (in case of an empty declarator, the list must be empty),
    --     where the declarator must be abstract, ie, must not contain a declared
    --     identifier.
    --
    data CDecl = CDecl [CDeclSpec]          -- type specifier and qualifier
                       [(Maybe CDeclr,      -- declarator (may be omitted)
                         Maybe CInit,       -- optional initializer
                         Maybe CExpr)]      -- optional size (const expr)
                       Attrs

    instance Pos CDecl where
      posOf :: CDecl -> Position
    posOf (CDecl [CDeclSpec]
    _ [(Maybe CDeclr, Maybe CInit, Maybe CExpr)]
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CDecl where
      (CDecl [CDeclSpec]
    _ [(Maybe CDeclr, Maybe CInit, Maybe CExpr)]
    _ Attrs
    at1) == :: CDecl -> CDecl -> Bool
    == (CDecl [CDeclSpec]
    _ [(Maybe CDeclr, Maybe CInit, Maybe CExpr)]
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- C declaration specifiers and qualifiers (EXPORTED)
    --
    data CDeclSpec = CStorageSpec CStorageSpec
                   | CTypeSpec    CTypeSpec
                   | CTypeQual    CTypeQual
                   deriving (CDeclSpec -> CDeclSpec -> Bool
    (CDeclSpec -> CDeclSpec -> Bool)
    -> (CDeclSpec -> CDeclSpec -> Bool) -> Eq CDeclSpec
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CDeclSpec -> CDeclSpec -> Bool
    == :: CDeclSpec -> CDeclSpec -> Bool
    $c/= :: CDeclSpec -> CDeclSpec -> Bool
    /= :: CDeclSpec -> CDeclSpec -> Bool
    Eq)

    instance Pos CDeclSpec where
      posOf :: CDeclSpec -> Position
    posOf (CStorageSpec CStorageSpec
    sspec) = CStorageSpec -> Position
    forall a. Pos a => a -> Position
    posOf CStorageSpec
    sspec
      posOf (CTypeSpec    CTypeSpec
    tspec) = CTypeSpec -> Position
    forall a. Pos a => a -> Position
    posOf CTypeSpec
    tspec
      posOf (CTypeQual    CTypeQual
    tqual) = CTypeQual -> Position
    forall a. Pos a => a -> Position
    posOf CTypeQual
    tqual

    -- C storage class specifier (K&R A8.1) (EXPORTED)
    --
    data CStorageSpec = CAuto     Attrs
                      | CRegister Attrs
                      | CStatic   Attrs
                      | CExtern   Attrs
                      | CTypedef  Attrs     -- syntactic awkwardness of C
                      | CThread   Attrs     -- GNUC thread local storage

    instance Pos CStorageSpec where
      posOf :: CStorageSpec -> Position
    posOf (CAuto     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CRegister Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CStatic   Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CExtern   Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CTypedef  Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CThread   Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CStorageSpec where
      (CAuto     Attrs
    at1) == :: CStorageSpec -> CStorageSpec -> Bool
    == (CAuto     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CRegister Attrs
    at1) == (CRegister Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CStatic   Attrs
    at1) == (CStatic   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CExtern   Attrs
    at1) == (CExtern   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CTypedef  Attrs
    at1) == (CTypedef  Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CThread   Attrs
    at1) == (CThread   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- C type specifier (K&R A8.2) (EXPORTED)
    --
    data CTypeSpec = CVoidType    Attrs
                   | CCharType    Attrs
                   | CShortType   Attrs
                   | CIntType     Attrs
                   | CLongType    Attrs
                   | CFloatType   Attrs
                   | CFloat128Type Attrs
                   | CDoubleType  Attrs
                   | CSignedType  Attrs
                   | CUnsigType   Attrs
                   | CBoolType    Attrs
                   | CComplexType Attrs
                   | CSUType      CStructUnion
                                  Attrs
                   | CEnumType    CEnum
                                  Attrs
                   | CTypeDef     Ident             -- typedef name
                                  Attrs
                   | CTypeOfExpr  CExpr
                                  Attrs
                   | CTypeOfType  CDecl
                                  Attrs

    instance Pos CTypeSpec where
      posOf :: CTypeSpec -> Position
    posOf (CVoidType      Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CCharType      Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CShortType     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CIntType       Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CLongType      Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CFloatType     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CFloat128Type  Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CDoubleType    Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CSignedType    Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CUnsigType     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CBoolType      Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CComplexType   Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CSUType     CStructUnion
    _  Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CEnumType   CEnum
    _  Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CTypeDef    Ident
    _  Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CTypeOfExpr CExpr
    _  Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CTypeOfType CDecl
    _  Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CTypeSpec where
      (CVoidType     Attrs
    at1) == :: CTypeSpec -> CTypeSpec -> Bool
    == (CVoidType     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CCharType     Attrs
    at1) == (CCharType     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CShortType    Attrs
    at1) == (CShortType    Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CIntType      Attrs
    at1) == (CIntType      Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CLongType     Attrs
    at1) == (CLongType     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CFloatType    Attrs
    at1) == (CFloatType    Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CFloat128Type Attrs
    at1) == (CFloat128Type Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CDoubleType   Attrs
    at1) == (CDoubleType   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CSignedType   Attrs
    at1) == (CSignedType   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CUnsigType    Attrs
    at1) == (CUnsigType    Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CBoolType     Attrs
    at1) == (CBoolType     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CComplexType  Attrs
    at1) == (CComplexType  Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CSUType     CStructUnion
    _ Attrs
    at1) == (CSUType     CStructUnion
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CEnumType   CEnum
    _ Attrs
    at1) == (CEnumType   CEnum
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CTypeDef    Ident
    _ Attrs
    at1) == (CTypeDef    Ident
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CTypeOfExpr CExpr
    _ Attrs
    at1) == (CTypeOfExpr CExpr
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CTypeOfType CDecl
    _ Attrs
    at1) == (CTypeOfType CDecl
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- C type qualifier (K&R A8.2) (EXPORTED)
    --
    --  * plus `restrict' from C99 and `inline'
    --
    data CTypeQual = CConstQual Attrs
                   | CVolatQual Attrs
                   | CRestrQual Attrs
                   | CInlinQual Attrs

    instance Pos CTypeQual where
     posOf :: CTypeQual -> Position
    posOf (CConstQual Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
     posOf (CVolatQual Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
     posOf (CRestrQual Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
     posOf (CInlinQual Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CTypeQual where
      (CConstQual Attrs
    at1) == :: CTypeQual -> CTypeQual -> Bool
    == (CConstQual Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CVolatQual Attrs
    at1) == (CVolatQual Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CRestrQual Attrs
    at1) == (CRestrQual Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CInlinQual Attrs
    at1) == (CInlinQual Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- C structure of union declaration (K&R A8.3) (EXPORTED)
    --
    --  * in both case, either the identifier is present or the list must be
    --   non-empty
    --
    data CStructUnion = CStruct CStructTag
                                (Maybe Ident)
                                [CDecl]     --  *structure* declaration
                                Attrs

    instance Pos CStructUnion where
      posOf :: CStructUnion -> Position
    posOf (CStruct CStructTag
    _ Maybe Ident
    _ [CDecl]
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CStructUnion where
      (CStruct CStructTag
    _ Maybe Ident
    _ [CDecl]
    _ Attrs
    at1) == :: CStructUnion -> CStructUnion -> Bool
    == (CStruct CStructTag
    _ Maybe Ident
    _ [CDecl]
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- (EXPORTED)
    --
    data CStructTag = CStructTag
                    | CUnionTag
                    deriving (CStructTag -> CStructTag -> Bool
    (CStructTag -> CStructTag -> Bool)
    -> (CStructTag -> CStructTag -> Bool) -> Eq CStructTag
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CStructTag -> CStructTag -> Bool
    == :: CStructTag -> CStructTag -> Bool
    $c/= :: CStructTag -> CStructTag -> Bool
    /= :: CStructTag -> CStructTag -> Bool
    Eq)

    -- C enumeration declaration (K&R A8.4) (EXPORTED)
    --
    data CEnum = CEnum (Maybe Ident)
                       [(Ident,                     -- variant name
                         Maybe CExpr)]              -- explicit variant value
                       Attrs

    instance Pos CEnum where
      posOf :: CEnum -> Position
    posOf (CEnum Maybe Ident
    _ [(Ident, Maybe CExpr)]
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CEnum where
      (CEnum Maybe Ident
    _ [(Ident, Maybe CExpr)]
    _ Attrs
    at1) == :: CEnum -> CEnum -> Bool
    == (CEnum Maybe Ident
    _ [(Ident, Maybe CExpr)]
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- C declarator (K&R A8.5) and abstract declarator (K&R A8.8) (EXPORTED)
    --
    --  * We have one type qualifer list `[CTypeQual]' for each indirection (ie,
    --   each occurrence of `*' in the concrete syntax).
    --
    --  * We unfold K&R's direct-declarators nonterminal into declarators.  Note
    --   that `*(*x)' is equivalent to `**x'.
    --
    --  * Declarators (A8.5) and abstract declarators (A8.8) are represented in the
    --   same structure.  In the case of a declarator, the identifier in
    --   `CVarDeclr' must be present; in an abstract declarator it misses.
    --   `CVarDeclr Nothing ...' on its own is meaningless, it may only occur as
    --   part of a larger type (ie, there must be a pointer, an array, or function
    --   declarator around).
    --
    --  * The qualifiers list in a `CPtrDeclr' may not be empty.
    --
    --  * Old and new style function definitions are merged into a single case
    --   `CFunDeclr'.  In case of an old style definition, the parameter list is
    --   empty and the variadic flag is `False' (ie, the parameter names are not
    --   stored in the tree).  Remember, a new style definition with no parameters
    --   requires a single `void' in the argument list (according to the standard).
    --
    --  * We unfold K&R's parameter-type-list nonterminal into the declarator
    --   variant for functions.
    --
    data CDeclr = CVarDeclr (Maybe Ident)           -- declared identifier
                            Attrs
                | CPtrDeclr [CTypeQual]             -- indirections
                            CDeclr
                            Attrs
                | CArrDeclr CDeclr
                            [CTypeQual]
                            (Maybe CExpr)           -- array size
                            Attrs
                | CFunDeclr CDeclr
                            [CDecl]                 --  *parameter* declarations
                            Bool                    -- is variadic?
                            Attrs

    instance Pos CDeclr where
      posOf :: CDeclr -> Position
    posOf (CVarDeclr Maybe Ident
    _     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CPtrDeclr [CTypeQual]
    _ CDeclr
    _   Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CArrDeclr CDeclr
    _ [CTypeQual]
    _ Maybe CExpr
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CFunDeclr CDeclr
    _ [CDecl]
    _ Bool
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CDeclr where
      (CVarDeclr Maybe Ident
    _     Attrs
    at1) == :: CDeclr -> CDeclr -> Bool
    == (CVarDeclr Maybe Ident
    _     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CPtrDeclr [CTypeQual]
    _ CDeclr
    _   Attrs
    at1) == (CPtrDeclr [CTypeQual]
    _ CDeclr
    _   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CArrDeclr CDeclr
    _ [CTypeQual]
    _ Maybe CExpr
    _ Attrs
    at1) == (CArrDeclr CDeclr
    _ [CTypeQual]
    _ Maybe CExpr
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CFunDeclr CDeclr
    _ [CDecl]
    _ Bool
    _ Attrs
    at1) == (CFunDeclr CDeclr
    _ [CDecl]
    _ Bool
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- C initializer (K&R A8.7) (EXPORTED)
    --
    data CInit = CInitExpr CExpr
                           Attrs            -- assignment expression
               | CInitList CInitList
                           Attrs

    type CInitList = [([CDesignator], CInit)]

    instance Pos CInit where
      posOf :: CInit -> Position
    posOf (CInitExpr CExpr
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CInitList CInitList
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CInit where
      (CInitExpr CExpr
    _ Attrs
    at1) == :: CInit -> CInit -> Bool
    == (CInitExpr CExpr
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CInitList CInitList
    _ Attrs
    at1) == (CInitList CInitList
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- C initializer designator (EXPORTED)
    --
    data CDesignator = CArrDesig     CExpr
                                     Attrs
                     | CMemberDesig  Ident
                                     Attrs
                     | CRangeDesig   CExpr  -- GNUC array range designator
                                     CExpr
                                     Attrs

    instance Pos CDesignator where
      posOf :: CDesignator -> Position
    posOf (CArrDesig     CExpr
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CMemberDesig  Ident
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CRangeDesig CExpr
    _ CExpr
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CDesignator where
      (CArrDesig     CExpr
    _ Attrs
    at1) == :: CDesignator -> CDesignator -> Bool
    == (CArrDesig     CExpr
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CMemberDesig  Ident
    _ Attrs
    at1) == (CMemberDesig  Ident
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CRangeDesig CExpr
    _ CExpr
    _ Attrs
    at1) == (CRangeDesig CExpr
    _ CExpr
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- C expression (K&R A7) (EXPORTED)
    --
    --  * these can be arbitrary expression, as the argument of `sizeof' can be
    --   arbitrary, even if appearing in a constant expression
    --
    --  * GNU C extension: `alignof'
    --
    data CExpr = CComma       [CExpr]       -- comma expression list, n >= 2
                              Attrs
               | CAssign      CAssignOp     -- assignment operator
                              CExpr         -- l-value
                              CExpr         -- r-value
                              Attrs
               | CCond        CExpr         -- conditional
                       (Maybe CExpr)        -- true-expression (GNU allows omitting)
                              CExpr         -- false-expression
                              Attrs
               | CBinary      CBinaryOp     -- binary operator
                              CExpr         -- lhs
                              CExpr         -- rhs
                              Attrs
               | CCast        CDecl         -- type name
                              CExpr
                              Attrs
               | CUnary       CUnaryOp      -- unary operator
                              CExpr
                              Attrs
               | CSizeofExpr  CExpr
                              Attrs
               | CSizeofType  CDecl         -- type name
                              Attrs
               | CAlignofExpr CExpr
                              Attrs
               | CAlignofType CDecl         -- type name
                              Attrs
               | CIndex       CExpr         -- array
                              CExpr         -- index
                              Attrs
               | CCall        CExpr         -- function
                              [CExpr]       -- arguments
                              Attrs
               | CMember      CExpr         -- structure
                              Ident         -- member name
                              Bool          -- deref structure? (True for `->')
                              Attrs
               | CVar         Ident         -- identifier (incl. enumeration const)
                              Attrs
               | CConst       CConst                -- includes strings
                              Attrs
               | CCompoundLit CDecl         -- C99 compound literal
                              CInitList     -- type name & initialiser list
                              Attrs
               | CStatExpr    CStat         -- GNUC compound statement as expr
                              Attrs
               | CLabAddrExpr Ident         -- GNUC address of label
                              Attrs
               | CBuiltinExpr Attrs         -- place holder for GNUC builtin exprs

    instance Pos CExpr where
      posOf :: CExpr -> Position
    posOf (CComma       [CExpr]
    _     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CAssign      CAssignOp
    _ CExpr
    _ CExpr
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CCond        CExpr
    _ Maybe CExpr
    _ CExpr
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CBinary      CBinaryOp
    _ CExpr
    _ CExpr
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CCast        CDecl
    _ CExpr
    _   Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CUnary       CUnaryOp
    _ CExpr
    _   Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CSizeofExpr  CExpr
    _     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CSizeofType  CDecl
    _     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CAlignofExpr CExpr
    _     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CAlignofType CDecl
    _     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CIndex       CExpr
    _ CExpr
    _   Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CCall        CExpr
    _ [CExpr]
    _   Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CMember      CExpr
    _ Ident
    _ Bool
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CVar         Ident
    _     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CConst       CConst
    _     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CCompoundLit CDecl
    _ CInitList
    _   Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CStatExpr    CStat
    _     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CLabAddrExpr Ident
    _     Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CBuiltinExpr       Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CExpr where
      (CComma       [CExpr]
    _     Attrs
    at1) == :: CExpr -> CExpr -> Bool
    == (CComma       [CExpr]
    _     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CAssign      CAssignOp
    _ CExpr
    _ CExpr
    _ Attrs
    at1) == (CAssign      CAssignOp
    _ CExpr
    _ CExpr
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CCond        CExpr
    _ Maybe CExpr
    _ CExpr
    _ Attrs
    at1) == (CCond        CExpr
    _ Maybe CExpr
    _ CExpr
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CBinary      CBinaryOp
    _ CExpr
    _ CExpr
    _ Attrs
    at1) == (CBinary      CBinaryOp
    _ CExpr
    _ CExpr
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CCast        CDecl
    _ CExpr
    _   Attrs
    at1) == (CCast        CDecl
    _ CExpr
    _   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CUnary       CUnaryOp
    _ CExpr
    _   Attrs
    at1) == (CUnary       CUnaryOp
    _ CExpr
    _   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CSizeofExpr  CExpr
    _     Attrs
    at1) == (CSizeofExpr  CExpr
    _     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CSizeofType  CDecl
    _     Attrs
    at1) == (CSizeofType  CDecl
    _     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CAlignofExpr CExpr
    _     Attrs
    at1) == (CAlignofExpr CExpr
    _     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CAlignofType CDecl
    _     Attrs
    at1) == (CAlignofType CDecl
    _     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CIndex       CExpr
    _ CExpr
    _   Attrs
    at1) == (CIndex       CExpr
    _ CExpr
    _   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CCall        CExpr
    _ [CExpr]
    _   Attrs
    at1) == (CCall        CExpr
    _ [CExpr]
    _   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CMember      CExpr
    _ Ident
    _ Bool
    _ Attrs
    at1) == (CMember      CExpr
    _ Ident
    _ Bool
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CVar         Ident
    _     Attrs
    at1) == (CVar         Ident
    _     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CConst       CConst
    _     Attrs
    at1) == (CConst       CConst
    _     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CCompoundLit CDecl
    _ CInitList
    _   Attrs
    at1) == (CCompoundLit CDecl
    _ CInitList
    _   Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CStatExpr    CStat
    _     Attrs
    at1) == (CStatExpr    CStat
    _     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CLabAddrExpr Ident
    _     Attrs
    at1) == (CLabAddrExpr Ident
    _     Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CBuiltinExpr       Attrs
    at1) == (CBuiltinExpr       Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    -- C assignment operators (K&R A7.17) (EXPORTED)
    --
    data CAssignOp = CAssignOp
                   | CMulAssOp
                   | CDivAssOp
                   | CRmdAssOp              -- remainder and assignment
                   | CAddAssOp
                   | CSubAssOp
                   | CShlAssOp
                   | CShrAssOp
                   | CAndAssOp
                   | CXorAssOp
                   | COrAssOp
                   deriving (CAssignOp -> CAssignOp -> Bool
    (CAssignOp -> CAssignOp -> Bool)
    -> (CAssignOp -> CAssignOp -> Bool) -> Eq CAssignOp
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CAssignOp -> CAssignOp -> Bool
    == :: CAssignOp -> CAssignOp -> Bool
    $c/= :: CAssignOp -> CAssignOp -> Bool
    /= :: CAssignOp -> CAssignOp -> Bool
    Eq)

    -- C binary operators (K&R A7.6-15) (EXPORTED)
    --
    data CBinaryOp = CMulOp
                   | CDivOp
                   | CRmdOp                 -- remainder of division
                   | CAddOp
                   | CSubOp
                   | CShlOp                 -- shift left
                   | CShrOp                 -- shift right
                   | CLeOp                  -- less
                   | CGrOp                  -- greater
                   | CLeqOp                 -- less or equal
                   | CGeqOp                 -- greater or equal
                   | CEqOp                  -- equal
                   | CNeqOp                 -- not equal
                   | CAndOp                 -- bitwise and
                   | CXorOp                 -- exclusive bitwise or
                   | COrOp                  -- inclusive bitwise or
                   | CLndOp                 -- logical and
                   | CLorOp                 -- logical or
                   deriving (CBinaryOp -> CBinaryOp -> Bool
    (CBinaryOp -> CBinaryOp -> Bool)
    -> (CBinaryOp -> CBinaryOp -> Bool) -> Eq CBinaryOp
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CBinaryOp -> CBinaryOp -> Bool
    == :: CBinaryOp -> CBinaryOp -> Bool
    $c/= :: CBinaryOp -> CBinaryOp -> Bool
    /= :: CBinaryOp -> CBinaryOp -> Bool
    Eq)

    -- C unary operator (K&R A7.3-4) (EXPORTED)
    --
    data CUnaryOp = CPreIncOp               -- prefix increment operator
                  | CPreDecOp               -- prefix decrement operator
                  | CPostIncOp              -- postfix increment operator
                  | CPostDecOp              -- postfix decrement operator
                  | CAdrOp                  -- address operator
                  | CIndOp                  -- indirection operator
                  | CPlusOp                 -- prefix plus
                  | CMinOp                  -- prefix minus
                  | CCompOp                 -- one's complement
                  | CNegOp                  -- logical negation
                  deriving (CUnaryOp -> CUnaryOp -> Bool
    (CUnaryOp -> CUnaryOp -> Bool)
    -> (CUnaryOp -> CUnaryOp -> Bool) -> Eq CUnaryOp
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CUnaryOp -> CUnaryOp -> Bool
    == :: CUnaryOp -> CUnaryOp -> Bool
    $c/= :: CUnaryOp -> CUnaryOp -> Bool
    /= :: CUnaryOp -> CUnaryOp -> Bool
    Eq)

    -- C constant (K&R A2.5 & A7.2) (EXPORTED)
    --
    --  * we do not list enumeration constants here, as they are identifiers
    --
    data CConst = CIntConst   Integer
                              Attrs
                | CCharConst  Char
                              Attrs
                | CFloatConst String
                              Attrs
                | CStrConst   String
                              Attrs

    instance Pos CConst where
      posOf :: CConst -> Position
    posOf (CIntConst   Integer
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CCharConst  Char
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CFloatConst String
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at
      posOf (CStrConst   String
    _ Attrs
    at) = Attrs -> Position
    forall a. Pos a => a -> Position
    posOf Attrs
    at

    instance Eq CConst where
      (CIntConst   Integer
    _ Attrs
    at1) == :: CConst -> CConst -> Bool
    == (CIntConst   Integer
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CCharConst  Char
    _ Attrs
    at1) == (CCharConst  Char
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CFloatConst String
    _ Attrs
    at1) == (CFloatConst String
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2
      (CStrConst   String
    _ Attrs
    at1) == (CStrConst   String
    _ Attrs
    at2) = Attrs
    at1 Attrs -> Attrs -> Bool
    forall a. Eq a => a -> a -> Bool
    == Attrs
    at2

    {-! for CDecl derive : GhcBinary !-}
    {-! for CEnum derive : GhcBinary !-}
    {-! for CStructUnion derive : GhcBinary !-}
    {-! for CStructTag derive : GhcBinary !-}
    {-! for CExpr derive : GhcBinary !-}
    {-! for CInit derive : GhcBinary !-}
    {-! for CDeclr derive : GhcBinary !-}
    {-! for CDeclSpec derive : GhcBinary !-}
    {-! for CTypeSpec derive : GhcBinary !-}
    {-! for CStorageSpec derive : GhcBinary !-}
    {-! for CTypeQual derive : GhcBinary !-}
    {-! for CConst derive : GhcBinary !-}
    {-! for CUnaryOp derive : GhcBinary !-}
    {-! for CBinaryOp derive : GhcBinary !-}
    {-! for CAssignOp derive : GhcBinary !-}
    {-* Generated by DrIFT : Look, but Don't Touch. *-}
    instance Binary CDecl where
        put_ :: BinHandle -> CDecl -> IO ()
    put_ BinHandle
    bh (CDecl [CDeclSpec]
    aa [(Maybe CDeclr, Maybe CInit, Maybe CExpr)]
    ab Attrs
    ac) = do
                BinHandle -> [CDeclSpec] -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh [CDeclSpec]
    aa
                BinHandle -> [(Maybe CDeclr, Maybe CInit, Maybe CExpr)] -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh [(Maybe CDeclr, Maybe CInit, Maybe CExpr)]
    ab
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ac
        get :: BinHandle -> IO CDecl
    get BinHandle
    bh = do
        [CDeclSpec]
    aa <- BinHandle -> IO [CDeclSpec]
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
        [(Maybe CDeclr, Maybe CInit, Maybe CExpr)]
    ab <- BinHandle -> IO [(Maybe CDeclr, Maybe CInit, Maybe CExpr)]
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
        Attrs
    ac <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
        CDecl -> IO CDecl
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ([CDeclSpec]
    -> [(Maybe CDeclr, Maybe CInit, Maybe CExpr)] -> Attrs -> CDecl
    CDecl [CDeclSpec]
    aa [(Maybe CDeclr, Maybe CInit, Maybe CExpr)]
    ab Attrs
    ac)

    instance Binary CEnum where
        put_ :: BinHandle -> CEnum -> IO ()
    put_ BinHandle
    bh (CEnum Maybe Ident
    aa [(Ident, Maybe CExpr)]
    ab Attrs
    ac) = do
                BinHandle -> Maybe Ident -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Maybe Ident
    aa
                BinHandle -> [(Ident, Maybe CExpr)] -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh [(Ident, Maybe CExpr)]
    ab
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ac
        get :: BinHandle -> IO CEnum
    get BinHandle
    bh = do
        Maybe Ident
    aa <- BinHandle -> IO (Maybe Ident)
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
        [(Ident, Maybe CExpr)]
    ab <- BinHandle -> IO [(Ident, Maybe CExpr)]
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
        Attrs
    ac <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
        CEnum -> IO CEnum
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Maybe Ident -> [(Ident, Maybe CExpr)] -> Attrs -> CEnum
    CEnum Maybe Ident
    aa [(Ident, Maybe CExpr)]
    ab Attrs
    ac)

    instance Binary CStructUnion where
        put_ :: BinHandle -> CStructUnion -> IO ()
    put_ BinHandle
    bh (CStruct CStructTag
    aa Maybe Ident
    ab [CDecl]
    ac Attrs
    ad) = do
                BinHandle -> CStructTag -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CStructTag
    aa
                BinHandle -> Maybe Ident -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Maybe Ident
    ab
                BinHandle -> [CDecl] -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh [CDecl]
    ac
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ad
        get :: BinHandle -> IO CStructUnion
    get BinHandle
    bh = do
        CStructTag
    aa <- BinHandle -> IO CStructTag
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
        Maybe Ident
    ab <- BinHandle -> IO (Maybe Ident)
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
        [CDecl]
    ac <- BinHandle -> IO [CDecl]
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
        Attrs
    ad <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
        CStructUnion -> IO CStructUnion
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CStructTag -> Maybe Ident -> [CDecl] -> Attrs -> CStructUnion
    CStruct CStructTag
    aa Maybe Ident
    ab [CDecl]
    ac Attrs
    ad)

    instance Binary CStructTag where
        put_ :: BinHandle -> CStructTag -> IO ()
    put_ BinHandle
    bh CStructTag
    CStructTag = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    0
        put_ BinHandle
    bh CStructTag
    CUnionTag = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    1
        get :: BinHandle -> IO CStructTag
    get BinHandle
    bh = do
                Word8
    h <- BinHandle -> IO Word8
    getByte BinHandle
    bh
                case Word8
    h of
                  Word8
    0 -> do
                        CStructTag -> IO CStructTag
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CStructTag
    CStructTag
                  Word8
    1 -> do
                        CStructTag -> IO CStructTag
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CStructTag
    CUnionTag

    instance Binary CExpr where
        put_ :: BinHandle -> CExpr -> IO ()
    put_ BinHandle
    bh (CComma [CExpr]
    aa Attrs
    ab) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    0
                BinHandle -> [CExpr] -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh [CExpr]
    aa
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ab
        put_ BinHandle
    bh (CAssign CAssignOp
    ac CExpr
    ad CExpr
    ae Attrs
    af) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    1
                BinHandle -> CAssignOp -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CAssignOp
    ac
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    ad
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    ae
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    af
        put_ BinHandle
    bh (CCond CExpr
    ag Maybe CExpr
    ah CExpr
    ai Attrs
    aj) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    2
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    ag
                BinHandle -> Maybe CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Maybe CExpr
    ah
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    ai
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    aj
        put_ BinHandle
    bh (CBinary CBinaryOp
    ak CExpr
    al CExpr
    am Attrs
    an) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    3
                BinHandle -> CBinaryOp -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CBinaryOp
    ak
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    al
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    am
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    an
        put_ BinHandle
    bh (CCast CDecl
    ao CExpr
    ap Attrs
    aq) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    4
                BinHandle -> CDecl -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CDecl
    ao
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    ap
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    aq
        put_ BinHandle
    bh (CUnary CUnaryOp
    ar CExpr
    as Attrs
    at) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    5
                BinHandle -> CUnaryOp -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CUnaryOp
    ar
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    as
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    at
        put_ BinHandle
    bh (CSizeofExpr CExpr
    au Attrs
    av) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    6
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    au
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    av
        put_ BinHandle
    bh (CSizeofType CDecl
    aw Attrs
    ax) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    7
                BinHandle -> CDecl -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CDecl
    aw
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ax
        put_ BinHandle
    bh (CAlignofExpr CExpr
    ay Attrs
    az) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    8
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    ay
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    az
        put_ BinHandle
    bh (CAlignofType CDecl
    aA Attrs
    aB) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    9
                BinHandle -> CDecl -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CDecl
    aA
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    aB
        put_ BinHandle
    bh (CIndex CExpr
    aC CExpr
    aD Attrs
    aE) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    10
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    aC
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    aD
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    aE
        put_ BinHandle
    bh (CCall CExpr
    aF [CExpr]
    aG Attrs
    aH) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    11
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    aF
                BinHandle -> [CExpr] -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh [CExpr]
    aG
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    aH
        put_ BinHandle
    bh (CMember CExpr
    aI Ident
    aJ Bool
    aK Attrs
    aL) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    12
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    aI
                BinHandle -> Ident -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Ident
    aJ
                BinHandle -> Bool -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Bool
    aK
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    aL
        put_ BinHandle
    bh (CVar Ident
    aM Attrs
    aN) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    13
                BinHandle -> Ident -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Ident
    aM
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    aN
        put_ BinHandle
    bh (CConst CConst
    aO Attrs
    aP) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    14
                BinHandle -> CConst -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CConst
    aO
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    aP
        get :: BinHandle -> IO CExpr
    get BinHandle
    bh = do
                Word8
    h <- BinHandle -> IO Word8
    getByte BinHandle
    bh
                case Word8
    h of
                  Word8
    0 -> do
                        [CExpr]
    aa <- BinHandle -> IO [CExpr]
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ab <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ([CExpr] -> Attrs -> CExpr
    CComma [CExpr]
    aa Attrs
    ab)
                  Word8
    1 -> do
                        CAssignOp
    ac <- BinHandle -> IO CAssignOp
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr
    ad <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr
    ae <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    af <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CAssignOp -> CExpr -> CExpr -> Attrs -> CExpr
    CAssign CAssignOp
    ac CExpr
    ad CExpr
    ae Attrs
    af)
                  Word8
    2 -> do
                        CExpr
    ag <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Maybe CExpr
    ah <- BinHandle -> IO (Maybe CExpr)
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr
    ai <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    aj <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CExpr -> Maybe CExpr -> CExpr -> Attrs -> CExpr
    CCond CExpr
    ag Maybe CExpr
    ah CExpr
    ai Attrs
    aj)
                  Word8
    3 -> do
                        CBinaryOp
    ak <- BinHandle -> IO CBinaryOp
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr
    al <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr
    am <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    an <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CBinaryOp -> CExpr -> CExpr -> Attrs -> CExpr
    CBinary CBinaryOp
    ak CExpr
    al CExpr
    am Attrs
    an)
                  Word8
    4 -> do
                        CDecl
    ao <- BinHandle -> IO CDecl
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr
    ap <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    aq <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CDecl -> CExpr -> Attrs -> CExpr
    CCast CDecl
    ao CExpr
    ap Attrs
    aq)
                  Word8
    5 -> do
                        CUnaryOp
    ar <- BinHandle -> IO CUnaryOp
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr
    as <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    at <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CUnaryOp -> CExpr -> Attrs -> CExpr
    CUnary CUnaryOp
    ar CExpr
    as Attrs
    at)
                  Word8
    6 -> do
                        CExpr
    au <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    av <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CExpr -> Attrs -> CExpr
    CSizeofExpr CExpr
    au Attrs
    av)
                  Word8
    7 -> do
                        CDecl
    aw <- BinHandle -> IO CDecl
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ax <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CDecl -> Attrs -> CExpr
    CSizeofType CDecl
    aw Attrs
    ax)
                  Word8
    8 -> do
                        CExpr
    ay <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    az <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CExpr -> Attrs -> CExpr
    CAlignofExpr CExpr
    ay Attrs
    az)
                  Word8
    9 -> do
                        CDecl
    aA <- BinHandle -> IO CDecl
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    aB <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CDecl -> Attrs -> CExpr
    CAlignofType CDecl
    aA Attrs
    aB)
                  Word8
    10 -> do
                        CExpr
    aC <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr
    aD <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    aE <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CExpr -> CExpr -> Attrs -> CExpr
    CIndex CExpr
    aC CExpr
    aD Attrs
    aE)
                  Word8
    11 -> do
                        CExpr
    aF <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        [CExpr]
    aG <- BinHandle -> IO [CExpr]
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    aH <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CExpr -> [CExpr] -> Attrs -> CExpr
    CCall CExpr
    aF [CExpr]
    aG Attrs
    aH)
                  Word8
    12 -> do
                        CExpr
    aI <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Ident
    aJ <- BinHandle -> IO Ident
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Bool
    aK <- BinHandle -> IO Bool
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    aL <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CExpr -> Ident -> Bool -> Attrs -> CExpr
    CMember CExpr
    aI Ident
    aJ Bool
    aK Attrs
    aL)
                  Word8
    13 -> do
                        Ident
    aM <- BinHandle -> IO Ident
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    aN <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Ident -> Attrs -> CExpr
    CVar Ident
    aM Attrs
    aN)
                  Word8
    14 -> do
                        CConst
    aO <- BinHandle -> IO CConst
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    aP <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr -> IO CExpr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CConst -> Attrs -> CExpr
    CConst CConst
    aO Attrs
    aP)

    instance Binary CInit where
        put_ :: BinHandle -> CInit -> IO ()
    put_ BinHandle
    bh (CInitExpr CExpr
    aa Attrs
    ab) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    0
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    aa
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ab
        put_ BinHandle
    bh (CInitList CInitList
    ac Attrs
    ad) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    1
                BinHandle -> CInitList -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CInitList
    ac
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ad
        get :: BinHandle -> IO CInit
    get BinHandle
    bh = do
                Word8
    h <- BinHandle -> IO Word8
    getByte BinHandle
    bh
                case Word8
    h of
                  Word8
    0 -> do
                        CExpr
    aa <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ab <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CInit -> IO CInit
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CExpr -> Attrs -> CInit
    CInitExpr CExpr
    aa Attrs
    ab)
                  Word8
    1 -> do
                        CInitList
    ac <- BinHandle -> IO CInitList
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ad <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CInit -> IO CInit
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CInitList -> Attrs -> CInit
    CInitList CInitList
    ac Attrs
    ad)

    instance Binary CDesignator where
        put_ :: BinHandle -> CDesignator -> IO ()
    put_ BinHandle
    bh (CArrDesig CExpr
    aa Attrs
    ab) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    0
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    aa
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ab
        put_ BinHandle
    bh (CMemberDesig Ident
    ac Attrs
    ad) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    1
                BinHandle -> Ident -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Ident
    ac
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ad
        put_ BinHandle
    bh (CRangeDesig CExpr
    ae CExpr
    af Attrs
    ag) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    2
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    ae
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    af
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ag
        get :: BinHandle -> IO CDesignator
    get BinHandle
    bh = do
                Word8
    h <- BinHandle -> IO Word8
    getByte BinHandle
    bh
                case Word8
    h of
                  Word8
    0 -> do
                        CExpr
    aa <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ab <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CDesignator -> IO CDesignator
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CExpr -> Attrs -> CDesignator
    CArrDesig CExpr
    aa Attrs
    ab)
                  Word8
    1 -> do
                        Ident
    ac <- BinHandle -> IO Ident
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ad <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CDesignator -> IO CDesignator
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Ident -> Attrs -> CDesignator
    CMemberDesig Ident
    ac Attrs
    ad)
                  Word8
    2 -> do
                        CExpr
    ae <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CExpr
    af <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ag <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CDesignator -> IO CDesignator
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CExpr -> CExpr -> Attrs -> CDesignator
    CRangeDesig CExpr
    ae CExpr
    af Attrs
    ag)

    instance Binary CDeclr where
        put_ :: BinHandle -> CDeclr -> IO ()
    put_ BinHandle
    bh (CVarDeclr Maybe Ident
    aa Attrs
    ab) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    0
                BinHandle -> Maybe Ident -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Maybe Ident
    aa
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ab
        put_ BinHandle
    bh (CPtrDeclr [CTypeQual]
    ac CDeclr
    ad Attrs
    ae) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    1
                BinHandle -> [CTypeQual] -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh [CTypeQual]
    ac
                BinHandle -> CDeclr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CDeclr
    ad
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ae
        put_ BinHandle
    bh (CArrDeclr CDeclr
    af [CTypeQual]
    ag Maybe CExpr
    ah Attrs
    ai) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    2
                BinHandle -> CDeclr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CDeclr
    af
                BinHandle -> [CTypeQual] -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh [CTypeQual]
    ag
                BinHandle -> Maybe CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Maybe CExpr
    ah
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ai
        put_ BinHandle
    bh (CFunDeclr CDeclr
    ai [CDecl]
    aj Bool
    ak Attrs
    al) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    3
                BinHandle -> CDeclr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CDeclr
    ai
                BinHandle -> [CDecl] -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh [CDecl]
    aj
                BinHandle -> Bool -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Bool
    ak
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    al
        get :: BinHandle -> IO CDeclr
    get BinHandle
    bh = do
                Word8
    h <- BinHandle -> IO Word8
    getByte BinHandle
    bh
                case Word8
    h of
                  Word8
    0 -> do
                        Maybe Ident
    aa <- BinHandle -> IO (Maybe Ident)
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ab <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CDeclr -> IO CDeclr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Maybe Ident -> Attrs -> CDeclr
    CVarDeclr Maybe Ident
    aa Attrs
    ab)
                  Word8
    1 -> do
                        [CTypeQual]
    ac <- BinHandle -> IO [CTypeQual]
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CDeclr
    ad <- BinHandle -> IO CDeclr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ae <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CDeclr -> IO CDeclr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ([CTypeQual] -> CDeclr -> Attrs -> CDeclr
    CPtrDeclr [CTypeQual]
    ac CDeclr
    ad Attrs
    ae)
                  Word8
    2 -> do
                        CDeclr
    af <- BinHandle -> IO CDeclr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        [CTypeQual]
    ag <- BinHandle -> IO [CTypeQual]
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Maybe CExpr
    ah <- BinHandle -> IO (Maybe CExpr)
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ai <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CDeclr -> IO CDeclr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CDeclr -> [CTypeQual] -> Maybe CExpr -> Attrs -> CDeclr
    CArrDeclr CDeclr
    af [CTypeQual]
    ag Maybe CExpr
    ah Attrs
    ai)
                  Word8
    3 -> do
                        CDeclr
    ai <- BinHandle -> IO CDeclr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        [CDecl]
    aj <- BinHandle -> IO [CDecl]
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Bool
    ak <- BinHandle -> IO Bool
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    al <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CDeclr -> IO CDeclr
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CDeclr -> [CDecl] -> Bool -> Attrs -> CDeclr
    CFunDeclr CDeclr
    ai [CDecl]
    aj Bool
    ak Attrs
    al)

    instance Binary CDeclSpec where
        put_ :: BinHandle -> CDeclSpec -> IO ()
    put_ BinHandle
    bh (CStorageSpec CStorageSpec
    aa) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    0
                BinHandle -> CStorageSpec -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CStorageSpec
    aa
        put_ BinHandle
    bh (CTypeSpec CTypeSpec
    ab) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    1
                BinHandle -> CTypeSpec -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CTypeSpec
    ab
        put_ BinHandle
    bh (CTypeQual CTypeQual
    ac) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    2
                BinHandle -> CTypeQual -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CTypeQual
    ac
        get :: BinHandle -> IO CDeclSpec
    get BinHandle
    bh = do
                Word8
    h <- BinHandle -> IO Word8
    getByte BinHandle
    bh
                case Word8
    h of
                  Word8
    0 -> do
                        CStorageSpec
    aa <- BinHandle -> IO CStorageSpec
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CDeclSpec -> IO CDeclSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CStorageSpec -> CDeclSpec
    CStorageSpec CStorageSpec
    aa)
                  Word8
    1 -> do
                        CTypeSpec
    ab <- BinHandle -> IO CTypeSpec
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CDeclSpec -> IO CDeclSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CTypeSpec -> CDeclSpec
    CTypeSpec CTypeSpec
    ab)
                  Word8
    2 -> do
                        CTypeQual
    ac <- BinHandle -> IO CTypeQual
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CDeclSpec -> IO CDeclSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CTypeQual -> CDeclSpec
    CTypeQual CTypeQual
    ac)

    instance Binary CTypeSpec where
        put_ :: BinHandle -> CTypeSpec -> IO ()
    put_ BinHandle
    bh (CVoidType Attrs
    aa) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    0
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    aa
        put_ BinHandle
    bh (CCharType Attrs
    ab) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    1
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ab
        put_ BinHandle
    bh (CShortType Attrs
    ac) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    2
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ac
        put_ BinHandle
    bh (CIntType Attrs
    ad) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    3
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ad
        put_ BinHandle
    bh (CLongType Attrs
    ae) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    4
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ae
        put_ BinHandle
    bh (CFloatType Attrs
    af) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    5
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    af
        put_ BinHandle
    bh (CDoubleType Attrs
    ag) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    6
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ag
        put_ BinHandle
    bh (CSignedType Attrs
    ah) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    7
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ah
        put_ BinHandle
    bh (CUnsigType Attrs
    ai) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    8
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ai
        put_ BinHandle
    bh (CSUType CStructUnion
    aj Attrs
    ak) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    9
                BinHandle -> CStructUnion -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CStructUnion
    aj
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ak
        put_ BinHandle
    bh (CEnumType CEnum
    al Attrs
    am) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    10
                BinHandle -> CEnum -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CEnum
    al
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    am
        put_ BinHandle
    bh (CTypeDef Ident
    an Attrs
    ao) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    11
                BinHandle -> Ident -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Ident
    an
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ao
        put_ BinHandle
    bh (CTypeOfExpr CExpr
    ap Attrs
    aq) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    12
                BinHandle -> CExpr -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CExpr
    ap
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    aq
        put_ BinHandle
    bh (CTypeOfType CDecl
    ar Attrs
    as) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    13
                BinHandle -> CDecl -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh CDecl
    ar
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    as
        put_ BinHandle
    bh (CFloat128Type Attrs
    at) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    14
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    at
        put_ BinHandle
    bh (CBoolType Attrs
    at) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    15
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    at
        get :: BinHandle -> IO CTypeSpec
    get BinHandle
    bh = do
                Word8
    h <- BinHandle -> IO Word8
    getByte BinHandle
    bh
                case Word8
    h of
                  Word8
    0 -> do
                        Attrs
    aa <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeSpec
    CVoidType Attrs
    aa)
                  Word8
    1 -> do
                        Attrs
    ab <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeSpec
    CCharType Attrs
    ab)
                  Word8
    2 -> do
                        Attrs
    ac <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeSpec
    CShortType Attrs
    ac)
                  Word8
    3 -> do
                        Attrs
    ad <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeSpec
    CIntType Attrs
    ad)
                  Word8
    4 -> do
                        Attrs
    ae <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeSpec
    CLongType Attrs
    ae)
                  Word8
    5 -> do
                        Attrs
    af <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeSpec
    CFloatType Attrs
    af)
                  Word8
    6 -> do
                        Attrs
    ag <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeSpec
    CDoubleType Attrs
    ag)
                  Word8
    7 -> do
                        Attrs
    ah <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeSpec
    CSignedType Attrs
    ah)
                  Word8
    8 -> do
                        Attrs
    ai <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeSpec
    CUnsigType Attrs
    ai)
                  Word8
    9 -> do
                        CStructUnion
    aj <- BinHandle -> IO CStructUnion
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ak <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CStructUnion -> Attrs -> CTypeSpec
    CSUType CStructUnion
    aj Attrs
    ak)
                  Word8
    10 -> do
                        CEnum
    al <- BinHandle -> IO CEnum
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    am <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CEnum -> Attrs -> CTypeSpec
    CEnumType CEnum
    al Attrs
    am)
                  Word8
    11 -> do
                        Ident
    an <- BinHandle -> IO Ident
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ao <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Ident -> Attrs -> CTypeSpec
    CTypeDef Ident
    an Attrs
    ao)
                  Word8
    12 -> do
                        CExpr
    ap <- BinHandle -> IO CExpr
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    aq <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CExpr -> Attrs -> CTypeSpec
    CTypeOfExpr CExpr
    ap Attrs
    aq)
                  Word8
    13 -> do
                        CDecl
    ar <- BinHandle -> IO CDecl
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    as <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (CDecl -> Attrs -> CTypeSpec
    CTypeOfType CDecl
    ar Attrs
    as)
                  Word8
    14 -> do
                        Attrs
    at <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeSpec
    CFloat128Type Attrs
    at)
                  Word8
    15 -> do
                        Attrs
    at <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeSpec -> IO CTypeSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeSpec
    CBoolType Attrs
    at)

    instance Binary CStorageSpec where
        put_ :: BinHandle -> CStorageSpec -> IO ()
    put_ BinHandle
    bh (CAuto Attrs
    aa) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    0
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    aa
        put_ BinHandle
    bh (CRegister Attrs
    ab) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    1
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ab
        put_ BinHandle
    bh (CStatic Attrs
    ac) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    2
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ac
        put_ BinHandle
    bh (CExtern Attrs
    ad) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    3
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ad
        put_ BinHandle
    bh (CTypedef Attrs
    ae) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    4
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ae
        get :: BinHandle -> IO CStorageSpec
    get BinHandle
    bh = do
                Word8
    h <- BinHandle -> IO Word8
    getByte BinHandle
    bh
                case Word8
    h of
                  Word8
    0 -> do
                        Attrs
    aa <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CStorageSpec -> IO CStorageSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CStorageSpec
    CAuto Attrs
    aa)
                  Word8
    1 -> do
                        Attrs
    ab <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CStorageSpec -> IO CStorageSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CStorageSpec
    CRegister Attrs
    ab)
                  Word8
    2 -> do
                        Attrs
    ac <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CStorageSpec -> IO CStorageSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CStorageSpec
    CStatic Attrs
    ac)
                  Word8
    3 -> do
                        Attrs
    ad <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CStorageSpec -> IO CStorageSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CStorageSpec
    CExtern Attrs
    ad)
                  Word8
    4 -> do
                        Attrs
    ae <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CStorageSpec -> IO CStorageSpec
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CStorageSpec
    CTypedef Attrs
    ae)

    instance Binary CTypeQual where
        put_ :: BinHandle -> CTypeQual -> IO ()
    put_ BinHandle
    bh (CConstQual Attrs
    aa) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    0
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    aa
        put_ BinHandle
    bh (CVolatQual Attrs
    ab) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    1
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ab
        put_ BinHandle
    bh (CRestrQual Attrs
    ac) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    2
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ac
        put_ BinHandle
    bh (CInlinQual Attrs
    ad) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    3
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ad
        get :: BinHandle -> IO CTypeQual
    get BinHandle
    bh = do
                Word8
    h <- BinHandle -> IO Word8
    getByte BinHandle
    bh
                case Word8
    h of
                  Word8
    0 -> do
                        Attrs
    aa <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeQual -> IO CTypeQual
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeQual
    CConstQual Attrs
    aa)
                  Word8
    1 -> do
                        Attrs
    ab <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeQual -> IO CTypeQual
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeQual
    CVolatQual Attrs
    ab)
                  Word8
    2 -> do
                        Attrs
    ac <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeQual -> IO CTypeQual
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeQual
    CRestrQual Attrs
    ac)
                  Word8
    3 -> do
                        Attrs
    ad <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CTypeQual -> IO CTypeQual
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Attrs -> CTypeQual
    CInlinQual Attrs
    ad)

    instance Binary CConst where
        put_ :: BinHandle -> CConst -> IO ()
    put_ BinHandle
    bh (CIntConst Integer
    aa Attrs
    ab) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    0
                BinHandle -> Integer -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Integer
    aa
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ab
        put_ BinHandle
    bh (CCharConst Char
    ac Attrs
    ad) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    1
                BinHandle -> Char -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Char
    ac
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ad
        put_ BinHandle
    bh (CFloatConst String
    ae Attrs
    af) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    2
                BinHandle -> String -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh String
    ae
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    af
        put_ BinHandle
    bh (CStrConst String
    ag Attrs
    ah) = do
                BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    3
                BinHandle -> String -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh String
    ag
                BinHandle -> Attrs -> IO ()
    forall a. Binary a => BinHandle -> a -> IO ()
    put_ BinHandle
    bh Attrs
    ah
        get :: BinHandle -> IO CConst
    get BinHandle
    bh = do
                Word8
    h <- BinHandle -> IO Word8
    getByte BinHandle
    bh
                case Word8
    h of
                  Word8
    0 -> do
                        Integer
    aa <- BinHandle -> IO Integer
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ab <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CConst -> IO CConst
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Integer -> Attrs -> CConst
    CIntConst Integer
    aa Attrs
    ab)
                  Word8
    1 -> do
                        Char
    ac <- BinHandle -> IO Char
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ad <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CConst -> IO CConst
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Char -> Attrs -> CConst
    CCharConst Char
    ac Attrs
    ad)
                  Word8
    2 -> do
                        String
    ae <- BinHandle -> IO String
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    af <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CConst -> IO CConst
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (String -> Attrs -> CConst
    CFloatConst String
    ae Attrs
    af)
                  Word8
    3 -> do
                        String
    ag <- BinHandle -> IO String
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        Attrs
    ah <- BinHandle -> IO Attrs
    forall a. Binary a => BinHandle -> IO a
    get BinHandle
    bh
                        CConst -> IO CConst
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (String -> Attrs -> CConst
    CStrConst String
    ag Attrs
    ah)

    instance Binary CUnaryOp where
        put_ :: BinHandle -> CUnaryOp -> IO ()
    put_ BinHandle
    bh CUnaryOp
    CPreIncOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    0
        put_ BinHandle
    bh CUnaryOp
    CPreDecOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    1
        put_ BinHandle
    bh CUnaryOp
    CPostIncOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    2
        put_ BinHandle
    bh CUnaryOp
    CPostDecOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    3
        put_ BinHandle
    bh CUnaryOp
    CAdrOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    4
        put_ BinHandle
    bh CUnaryOp
    CIndOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    5
        put_ BinHandle
    bh CUnaryOp
    CPlusOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    6
        put_ BinHandle
    bh CUnaryOp
    CMinOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    7
        put_ BinHandle
    bh CUnaryOp
    CCompOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    8
        put_ BinHandle
    bh CUnaryOp
    CNegOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    9
        get :: BinHandle -> IO CUnaryOp
    get BinHandle
    bh = do
                Word8
    h <- BinHandle -> IO Word8
    getByte BinHandle
    bh
                case Word8
    h of
                  Word8
    0 -> CUnaryOp -> IO CUnaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CUnaryOp
    CPreIncOp
                  Word8
    1 -> CUnaryOp -> IO CUnaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CUnaryOp
    CPreDecOp
                  Word8
    2 -> CUnaryOp -> IO CUnaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CUnaryOp
    CPostIncOp
                  Word8
    3 -> CUnaryOp -> IO CUnaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CUnaryOp
    CPostDecOp
                  Word8
    4 -> CUnaryOp -> IO CUnaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CUnaryOp
    CAdrOp
                  Word8
    5 -> CUnaryOp -> IO CUnaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CUnaryOp
    CIndOp
                  Word8
    6 -> CUnaryOp -> IO CUnaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CUnaryOp
    CPlusOp
                  Word8
    7 -> CUnaryOp -> IO CUnaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CUnaryOp
    CMinOp
                  Word8
    8 -> CUnaryOp -> IO CUnaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CUnaryOp
    CCompOp
                  Word8
    9 -> CUnaryOp -> IO CUnaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CUnaryOp
    CNegOp

    instance Binary CBinaryOp where
        put_ :: BinHandle -> CBinaryOp -> IO ()
    put_ BinHandle
    bh CBinaryOp
    CMulOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    0
        put_ BinHandle
    bh CBinaryOp
    CDivOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    1
        put_ BinHandle
    bh CBinaryOp
    CRmdOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    2
        put_ BinHandle
    bh CBinaryOp
    CAddOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    3
        put_ BinHandle
    bh CBinaryOp
    CSubOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    4
        put_ BinHandle
    bh CBinaryOp
    CShlOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    5
        put_ BinHandle
    bh CBinaryOp
    CShrOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    6
        put_ BinHandle
    bh CBinaryOp
    CLeOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    7
        put_ BinHandle
    bh CBinaryOp
    CGrOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    8
        put_ BinHandle
    bh CBinaryOp
    CLeqOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    9
        put_ BinHandle
    bh CBinaryOp
    CGeqOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    10
        put_ BinHandle
    bh CBinaryOp
    CEqOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    11
        put_ BinHandle
    bh CBinaryOp
    CNeqOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    12
        put_ BinHandle
    bh CBinaryOp
    CAndOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    13
        put_ BinHandle
    bh CBinaryOp
    CXorOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    14
        put_ BinHandle
    bh CBinaryOp
    COrOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    15
        put_ BinHandle
    bh CBinaryOp
    CLndOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    16
        put_ BinHandle
    bh CBinaryOp
    CLorOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    17
        get :: BinHandle -> IO CBinaryOp
    get BinHandle
    bh = do
                Word8
    h <- BinHandle -> IO Word8
    getByte BinHandle
    bh
                case Word8
    h of
                  Word8
    0 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CMulOp
                  Word8
    1 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CDivOp
                  Word8
    2 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CRmdOp
                  Word8
    3 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CAddOp
                  Word8
    4 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CSubOp
                  Word8
    5 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CShlOp
                  Word8
    6 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CShrOp
                  Word8
    7 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CLeOp
                  Word8
    8 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CGrOp
                  Word8
    9 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CLeqOp
                  Word8
    10 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CGeqOp
                  Word8
    11 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CEqOp
                  Word8
    12 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CNeqOp
                  Word8
    13 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CAndOp
                  Word8
    14 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CXorOp
                  Word8
    15 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    COrOp
                  Word8
    16 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CLndOp
                  Word8
    17 -> CBinaryOp -> IO CBinaryOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CBinaryOp
    CLorOp

    instance Binary CAssignOp where
        put_ :: BinHandle -> CAssignOp -> IO ()
    put_ BinHandle
    bh CAssignOp
    CAssignOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    0
        put_ BinHandle
    bh CAssignOp
    CMulAssOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    1
        put_ BinHandle
    bh CAssignOp
    CDivAssOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    2
        put_ BinHandle
    bh CAssignOp
    CRmdAssOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    3
        put_ BinHandle
    bh CAssignOp
    CAddAssOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    4
        put_ BinHandle
    bh CAssignOp
    CSubAssOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    5
        put_ BinHandle
    bh CAssignOp
    CShlAssOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    6
        put_ BinHandle
    bh CAssignOp
    CShrAssOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    7
        put_ BinHandle
    bh CAssignOp
    CAndAssOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    8
        put_ BinHandle
    bh CAssignOp
    CXorAssOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    9
        put_ BinHandle
    bh CAssignOp
    COrAssOp = BinHandle -> Word8 -> IO ()
    putByte BinHandle
    bh Word8
    10
        get :: BinHandle -> IO CAssignOp
    get BinHandle
    bh = do
                Word8
    h <- BinHandle -> IO Word8
    getByte BinHandle
    bh
                case Word8
    h of
                  Word8
    0 -> CAssignOp -> IO CAssignOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CAssignOp
    CAssignOp
                  Word8
    1 -> CAssignOp -> IO CAssignOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CAssignOp
    CMulAssOp
                  Word8
    2 -> CAssignOp -> IO CAssignOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CAssignOp
    CDivAssOp
                  Word8
    3 -> CAssignOp -> IO CAssignOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CAssignOp
    CRmdAssOp
                  Word8
    4 -> CAssignOp -> IO CAssignOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CAssignOp
    CAddAssOp
                  Word8
    5 -> CAssignOp -> IO CAssignOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CAssignOp
    CSubAssOp
                  Word8
    6 -> CAssignOp -> IO CAssignOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CAssignOp
    CShlAssOp
                  Word8
    7 -> CAssignOp -> IO CAssignOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CAssignOp
    CShrAssOp
                  Word8
    8 -> CAssignOp -> IO CAssignOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CAssignOp
    CAndAssOp
                  Word8
    9 -> CAssignOp -> IO CAssignOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CAssignOp
    CXorAssOp
                  Word8
    10 -> CAssignOp -> IO CAssignOp
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return CAssignOp
    COrAssOp