{-# LANGUAGE DeriveDataTypeable #-}
{- |
Module      :  ./COL/AS_COL.der.hs
Description :  Abstract syntax for COL extension of CASL
Copyright   :  (c) Till Mossakowski, Uni Bremen 2004
License     :  GPLv2 or higher, see LICENSE.txt

Maintainer  :  till@informatik.uni-bremen.de
Stability   :  provisional
Portability :  portable

Abstract syntax for COL extension of CASL
  Only the added syntax is specified
-}

module COL.AS_COL where

import Data.Data

import Common.Id
import Common.AS_Annotation

import CASL.AS_Basic_CASL

-- DrIFT command
{-! global: GetRange !-}

type COL_BASIC_SPEC = BASIC_SPEC () COL_SIG_ITEM ()

data COL_SIG_ITEM =
          Constructor_items [Annoted Id] Range
                 -- pos: ids
        | Observer_items [Annoted (Id, Maybe Int)] Range
                 -- pos: ids
             deriving (Int -> COL_SIG_ITEM -> ShowS
[COL_SIG_ITEM] -> ShowS
COL_SIG_ITEM -> String
(Int -> COL_SIG_ITEM -> ShowS)
-> (COL_SIG_ITEM -> String)
-> ([COL_SIG_ITEM] -> ShowS)
-> Show COL_SIG_ITEM
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [COL_SIG_ITEM] -> ShowS
$cshowList :: [COL_SIG_ITEM] -> ShowS
show :: COL_SIG_ITEM -> String
$cshow :: COL_SIG_ITEM -> String
showsPrec :: Int -> COL_SIG_ITEM -> ShowS
$cshowsPrec :: Int -> COL_SIG_ITEM -> ShowS
Show, COL_SIG_ITEM -> COL_SIG_ITEM -> Bool
(COL_SIG_ITEM -> COL_SIG_ITEM -> Bool)
-> (COL_SIG_ITEM -> COL_SIG_ITEM -> Bool) -> Eq COL_SIG_ITEM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: COL_SIG_ITEM -> COL_SIG_ITEM -> Bool
$c/= :: COL_SIG_ITEM -> COL_SIG_ITEM -> Bool
== :: COL_SIG_ITEM -> COL_SIG_ITEM -> Bool
$c== :: COL_SIG_ITEM -> COL_SIG_ITEM -> Bool
Eq, Typeable, Typeable COL_SIG_ITEM
Constr
DataType
Typeable COL_SIG_ITEM =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> COL_SIG_ITEM -> c COL_SIG_ITEM)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c COL_SIG_ITEM)
-> (COL_SIG_ITEM -> Constr)
-> (COL_SIG_ITEM -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c COL_SIG_ITEM))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c COL_SIG_ITEM))
-> ((forall b. Data b => b -> b) -> COL_SIG_ITEM -> COL_SIG_ITEM)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> COL_SIG_ITEM -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> COL_SIG_ITEM -> r)
-> (forall u. (forall d. Data d => d -> u) -> COL_SIG_ITEM -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> COL_SIG_ITEM -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> COL_SIG_ITEM -> m COL_SIG_ITEM)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> COL_SIG_ITEM -> m COL_SIG_ITEM)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> COL_SIG_ITEM -> m COL_SIG_ITEM)
-> Data COL_SIG_ITEM
COL_SIG_ITEM -> Constr
COL_SIG_ITEM -> DataType
(forall b. Data b => b -> b) -> COL_SIG_ITEM -> COL_SIG_ITEM
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> COL_SIG_ITEM -> c COL_SIG_ITEM
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c COL_SIG_ITEM
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> COL_SIG_ITEM -> u
forall u. (forall d. Data d => d -> u) -> COL_SIG_ITEM -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> COL_SIG_ITEM -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> COL_SIG_ITEM -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> COL_SIG_ITEM -> m COL_SIG_ITEM
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> COL_SIG_ITEM -> m COL_SIG_ITEM
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c COL_SIG_ITEM
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> COL_SIG_ITEM -> c COL_SIG_ITEM
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c COL_SIG_ITEM)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c COL_SIG_ITEM)
$cObserver_items :: Constr
$cConstructor_items :: Constr
$tCOL_SIG_ITEM :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> COL_SIG_ITEM -> m COL_SIG_ITEM
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> COL_SIG_ITEM -> m COL_SIG_ITEM
gmapMp :: (forall d. Data d => d -> m d) -> COL_SIG_ITEM -> m COL_SIG_ITEM
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> COL_SIG_ITEM -> m COL_SIG_ITEM
gmapM :: (forall d. Data d => d -> m d) -> COL_SIG_ITEM -> m COL_SIG_ITEM
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> COL_SIG_ITEM -> m COL_SIG_ITEM
gmapQi :: Int -> (forall d. Data d => d -> u) -> COL_SIG_ITEM -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> COL_SIG_ITEM -> u
gmapQ :: (forall d. Data d => d -> u) -> COL_SIG_ITEM -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> COL_SIG_ITEM -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> COL_SIG_ITEM -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> COL_SIG_ITEM -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> COL_SIG_ITEM -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> COL_SIG_ITEM -> r
gmapT :: (forall b. Data b => b -> b) -> COL_SIG_ITEM -> COL_SIG_ITEM
$cgmapT :: (forall b. Data b => b -> b) -> COL_SIG_ITEM -> COL_SIG_ITEM
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c COL_SIG_ITEM)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c COL_SIG_ITEM)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c COL_SIG_ITEM)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c COL_SIG_ITEM)
dataTypeOf :: COL_SIG_ITEM -> DataType
$cdataTypeOf :: COL_SIG_ITEM -> DataType
toConstr :: COL_SIG_ITEM -> Constr
$ctoConstr :: COL_SIG_ITEM -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c COL_SIG_ITEM
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c COL_SIG_ITEM
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> COL_SIG_ITEM -> c COL_SIG_ITEM
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> COL_SIG_ITEM -> c COL_SIG_ITEM
$cp1Data :: Typeable COL_SIG_ITEM
Data)


constructorS, constructorsS :: String
constructorS :: String
constructorS = "constructor"
constructorsS :: String
constructorsS = String
constructorS String -> ShowS
forall a. [a] -> [a] -> [a]
++ "s"

observerS, observersS :: String
observerS :: String
observerS = "observer"
observersS :: String
observersS = String
observerS String -> ShowS
forall a. [a] -> [a] -> [a]
++ "s"

col_reserved_words :: [String]
col_reserved_words :: [String]
col_reserved_words = [String
constructorS, String
constructorsS, String
observerS, String
observersS]

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

instance GetRange COL_SIG_ITEM where
  getRange :: COL_SIG_ITEM -> Range
getRange x :: COL_SIG_ITEM
x = case COL_SIG_ITEM
x of
    Constructor_items _ p :: Range
p -> Range
p
    Observer_items _ p :: Range
p -> Range
p
  rangeSpan :: COL_SIG_ITEM -> [Pos]
rangeSpan x :: COL_SIG_ITEM
x = case COL_SIG_ITEM
x of
    Constructor_items a :: [Annoted Id]
a b :: Range
b -> [[Pos]] -> [Pos]
joinRanges [[Annoted Id] -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan [Annoted Id]
a, Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
b]
    Observer_items a :: [Annoted (Id, Maybe Int)]
a b :: Range
b -> [[Pos]] -> [Pos]
joinRanges [[Annoted (Id, Maybe Int)] -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan [Annoted (Id, Maybe Int)]
a, Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
b]