{-# OPTIONS -w -O0 #-}
{- |
Module      :  COL/ATC_COL.der.hs
Description :  generated Typeable, ShATermConvertible instances
Copyright   :  (c) DFKI Bremen 2008
License     :  GPLv2 or higher, see LICENSE.txt

Maintainer  :  Christian.Maeder@dfki.de
Stability   :  provisional
Portability :  non-portable(overlapping Typeable instances)

Automatic derivation of instances via DrIFT-rule Typeable, ShATermConvertible
  for the type(s):
'COL.AS_COL.COL_SIG_ITEM'
'COL.COLSign.COLSign'
-}

{-
  Generated by 'genRules' (automatic rule generation for DrIFT). Don't touch!!
  dependency files:
COL/AS_COL.hs
COL/COLSign.hs
-}

module COL.ATC_COL () where

import ATerm.Lib
import CASL.AS_Basic_CASL
import CASL.ATC_CASL
import COL.AS_COL
import COL.COLSign
import Common.AS_Annotation
import Common.Id
import Data.Typeable
import qualified Data.Map as Map
import qualified Data.Set as Set

{-! for COL.AS_COL.COL_SIG_ITEM derive : Typeable !-}
{-! for COL.COLSign.COLSign derive : Typeable !-}

{-! for COL.AS_COL.COL_SIG_ITEM derive : ShATermConvertible !-}
{-! for COL.COLSign.COLSign derive : ShATermConvertible !-}

-- Generated by DrIFT, look but don't touch!

_tcCOL_SIG_ITEMTc :: TyCon
_tcCOL_SIG_ITEMTc = mkTyCon "COL.AS_COL.COL_SIG_ITEM"
instance Typeable COL_SIG_ITEM where
    typeOf _ = mkTyConApp _tcCOL_SIG_ITEMTc []

instance ShATermConvertible COL_SIG_ITEM where
  toShATermAux att0 xv = case xv of
    Constructor_items a b -> do
      (att1, a') <- toShATerm' att0 a
      (att2, b') <- toShATerm' att1 b
      return $ addATerm (ShAAppl "Constructor_items" [a', b'] []) att2
    Observer_items a b -> do
      (att1, a') <- toShATerm' att0 a
      (att2, b') <- toShATerm' att1 b
      return $ addATerm (ShAAppl "Observer_items" [a', b'] []) att2
  fromShATermAux ix att0 = case getShATerm ix att0 of
    ShAAppl "Constructor_items" [a, b] _ ->
      case fromShATerm' a att0 of
      { (att1, a') ->
      case fromShATerm' b att1 of
      { (att2, b') ->
      (att2, Constructor_items a' b') }}
    ShAAppl "Observer_items" [a, b] _ ->
      case fromShATerm' a att0 of
      { (att1, a') ->
      case fromShATerm' b att1 of
      { (att2, b') ->
      (att2, Observer_items a' b') }}
    u -> fromShATermError "COL_SIG_ITEM" u

instance ShATermConvertible COLSign where
  toShATermAux att0 xv = case xv of
    COLSign a b -> do
      (att1, a') <- toShATerm' att0 a
      (att2, b') <- toShATerm' att1 b
      return $ addATerm (ShAAppl "COLSign" [a', b'] []) att2
  fromShATermAux ix att0 = case getShATerm ix att0 of
    ShAAppl "COLSign" [a, b] _ ->
      case fromShATerm' a att0 of
      { (att1, a') ->
      case fromShATerm' b att1 of
      { (att2, b') ->
      (att2, COLSign a' b') }}
    u -> fromShATermError "COLSign" u

_tcCOLSignTc :: TyCon
_tcCOLSignTc = mkTyCon "COL.COLSign.COLSign"
instance Typeable COLSign where
    typeOf _ = mkTyConApp _tcCOLSignTc []
