{-# LANGUAGE DeriveDataTypeable #-}
module Syntax.AS_Architecture where
import Common.Id
import Common.IRI
import Common.AS_Annotation
import Syntax.AS_Structured
import Data.Typeable
data ARCH_SPEC = Basic_arch_spec [Annoted UNIT_DECL_DEFN]
(Annoted UNIT_EXPRESSION) Range
| Arch_spec_name ARCH_SPEC_NAME
| Group_arch_spec (Annoted ARCH_SPEC) Range
deriving (Int -> ARCH_SPEC -> ShowS
[ARCH_SPEC] -> ShowS
ARCH_SPEC -> String
(Int -> ARCH_SPEC -> ShowS)
-> (ARCH_SPEC -> String)
-> ([ARCH_SPEC] -> ShowS)
-> Show ARCH_SPEC
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ARCH_SPEC] -> ShowS
$cshowList :: [ARCH_SPEC] -> ShowS
show :: ARCH_SPEC -> String
$cshow :: ARCH_SPEC -> String
showsPrec :: Int -> ARCH_SPEC -> ShowS
$cshowsPrec :: Int -> ARCH_SPEC -> ShowS
Show, Typeable)
data UNIT_DECL_DEFN = Unit_decl UNIT_NAME REF_SPEC [Annoted UNIT_TERM] Range
| Unit_defn UNIT_NAME UNIT_EXPRESSION Range
deriving (Int -> UNIT_DECL_DEFN -> ShowS
[UNIT_DECL_DEFN] -> ShowS
UNIT_DECL_DEFN -> String
(Int -> UNIT_DECL_DEFN -> ShowS)
-> (UNIT_DECL_DEFN -> String)
-> ([UNIT_DECL_DEFN] -> ShowS)
-> Show UNIT_DECL_DEFN
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UNIT_DECL_DEFN] -> ShowS
$cshowList :: [UNIT_DECL_DEFN] -> ShowS
show :: UNIT_DECL_DEFN -> String
$cshow :: UNIT_DECL_DEFN -> String
showsPrec :: Int -> UNIT_DECL_DEFN -> ShowS
$cshowsPrec :: Int -> UNIT_DECL_DEFN -> ShowS
Show, Typeable)
data UNIT_SPEC = Unit_type [Annoted SPEC] (Annoted SPEC) Range
| Spec_name SPEC_NAME
| Closed_unit_spec UNIT_SPEC Range
deriving (Int -> UNIT_SPEC -> ShowS
[UNIT_SPEC] -> ShowS
UNIT_SPEC -> String
(Int -> UNIT_SPEC -> ShowS)
-> (UNIT_SPEC -> String)
-> ([UNIT_SPEC] -> ShowS)
-> Show UNIT_SPEC
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UNIT_SPEC] -> ShowS
$cshowList :: [UNIT_SPEC] -> ShowS
show :: UNIT_SPEC -> String
$cshow :: UNIT_SPEC -> String
showsPrec :: Int -> UNIT_SPEC -> ShowS
$cshowsPrec :: Int -> UNIT_SPEC -> ShowS
Show, Typeable)
data REF_SPEC = Unit_spec UNIT_SPEC
| Refinement Bool UNIT_SPEC [G_mapping] REF_SPEC Range
| Arch_unit_spec (Annoted ARCH_SPEC) Range
| Compose_ref [REF_SPEC] Range
| Component_ref [UNIT_REF] Range
deriving (Int -> REF_SPEC -> ShowS
[REF_SPEC] -> ShowS
REF_SPEC -> String
(Int -> REF_SPEC -> ShowS)
-> (REF_SPEC -> String) -> ([REF_SPEC] -> ShowS) -> Show REF_SPEC
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [REF_SPEC] -> ShowS
$cshowList :: [REF_SPEC] -> ShowS
show :: REF_SPEC -> String
$cshow :: REF_SPEC -> String
showsPrec :: Int -> REF_SPEC -> ShowS
$cshowsPrec :: Int -> REF_SPEC -> ShowS
Show, Typeable)
data UNIT_REF = Unit_ref UNIT_NAME REF_SPEC Range
deriving (Int -> UNIT_REF -> ShowS
[UNIT_REF] -> ShowS
UNIT_REF -> String
(Int -> UNIT_REF -> ShowS)
-> (UNIT_REF -> String) -> ([UNIT_REF] -> ShowS) -> Show UNIT_REF
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UNIT_REF] -> ShowS
$cshowList :: [UNIT_REF] -> ShowS
show :: UNIT_REF -> String
$cshow :: UNIT_REF -> String
showsPrec :: Int -> UNIT_REF -> ShowS
$cshowsPrec :: Int -> UNIT_REF -> ShowS
Show, Typeable)
data UNIT_EXPRESSION = Unit_expression [UNIT_BINDING] (Annoted UNIT_TERM) Range
deriving (Int -> UNIT_EXPRESSION -> ShowS
[UNIT_EXPRESSION] -> ShowS
UNIT_EXPRESSION -> String
(Int -> UNIT_EXPRESSION -> ShowS)
-> (UNIT_EXPRESSION -> String)
-> ([UNIT_EXPRESSION] -> ShowS)
-> Show UNIT_EXPRESSION
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UNIT_EXPRESSION] -> ShowS
$cshowList :: [UNIT_EXPRESSION] -> ShowS
show :: UNIT_EXPRESSION -> String
$cshow :: UNIT_EXPRESSION -> String
showsPrec :: Int -> UNIT_EXPRESSION -> ShowS
$cshowsPrec :: Int -> UNIT_EXPRESSION -> ShowS
Show, Typeable)
data UNIT_BINDING = Unit_binding UNIT_NAME UNIT_SPEC Range
deriving (Int -> UNIT_BINDING -> ShowS
[UNIT_BINDING] -> ShowS
UNIT_BINDING -> String
(Int -> UNIT_BINDING -> ShowS)
-> (UNIT_BINDING -> String)
-> ([UNIT_BINDING] -> ShowS)
-> Show UNIT_BINDING
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UNIT_BINDING] -> ShowS
$cshowList :: [UNIT_BINDING] -> ShowS
show :: UNIT_BINDING -> String
$cshow :: UNIT_BINDING -> String
showsPrec :: Int -> UNIT_BINDING -> ShowS
$cshowsPrec :: Int -> UNIT_BINDING -> ShowS
Show, Typeable)
data UNIT_TERM = Unit_reduction (Annoted UNIT_TERM) RESTRICTION
| Unit_translation (Annoted UNIT_TERM) RENAMING
| Amalgamation [Annoted UNIT_TERM] Range
| Local_unit [Annoted UNIT_DECL_DEFN] (Annoted UNIT_TERM) Range
| Unit_appl UNIT_NAME [FIT_ARG_UNIT] Range
| Group_unit_term (Annoted UNIT_TERM) Range
deriving (Int -> UNIT_TERM -> ShowS
[UNIT_TERM] -> ShowS
UNIT_TERM -> String
(Int -> UNIT_TERM -> ShowS)
-> (UNIT_TERM -> String)
-> ([UNIT_TERM] -> ShowS)
-> Show UNIT_TERM
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UNIT_TERM] -> ShowS
$cshowList :: [UNIT_TERM] -> ShowS
show :: UNIT_TERM -> String
$cshow :: UNIT_TERM -> String
showsPrec :: Int -> UNIT_TERM -> ShowS
$cshowsPrec :: Int -> UNIT_TERM -> ShowS
Show, Typeable)
data FIT_ARG_UNIT = Fit_arg_unit (Annoted UNIT_TERM) [G_mapping] Range
deriving (Int -> FIT_ARG_UNIT -> ShowS
[FIT_ARG_UNIT] -> ShowS
FIT_ARG_UNIT -> String
(Int -> FIT_ARG_UNIT -> ShowS)
-> (FIT_ARG_UNIT -> String)
-> ([FIT_ARG_UNIT] -> ShowS)
-> Show FIT_ARG_UNIT
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FIT_ARG_UNIT] -> ShowS
$cshowList :: [FIT_ARG_UNIT] -> ShowS
show :: FIT_ARG_UNIT -> String
$cshow :: FIT_ARG_UNIT -> String
showsPrec :: Int -> FIT_ARG_UNIT -> ShowS
$cshowsPrec :: Int -> FIT_ARG_UNIT -> ShowS
Show, Typeable)
type ARCH_SPEC_NAME = IRI
type UNIT_NAME = IRI
instance GetRange ARCH_SPEC where
getRange :: ARCH_SPEC -> Range
getRange x :: ARCH_SPEC
x = case ARCH_SPEC
x of
Basic_arch_spec _ _ p :: Range
p -> Range
p
Arch_spec_name _ -> Range
nullRange
Group_arch_spec _ p :: Range
p -> Range
p
rangeSpan :: ARCH_SPEC -> [Pos]
rangeSpan x :: ARCH_SPEC
x = case ARCH_SPEC
x of
Basic_arch_spec a :: [Annoted UNIT_DECL_DEFN]
a b :: Annoted UNIT_EXPRESSION
b c :: Range
c -> [[Pos]] -> [Pos]
joinRanges [[Annoted UNIT_DECL_DEFN] -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan [Annoted UNIT_DECL_DEFN]
a, Annoted UNIT_EXPRESSION -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Annoted UNIT_EXPRESSION
b,
Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
c]
Arch_spec_name a :: ARCH_SPEC_NAME
a -> [[Pos]] -> [Pos]
joinRanges [ARCH_SPEC_NAME -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan ARCH_SPEC_NAME
a]
Group_arch_spec a :: Annoted ARCH_SPEC
a b :: Range
b -> [[Pos]] -> [Pos]
joinRanges [Annoted ARCH_SPEC -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Annoted ARCH_SPEC
a, Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
b]
instance GetRange UNIT_DECL_DEFN where
getRange :: UNIT_DECL_DEFN -> Range
getRange x :: UNIT_DECL_DEFN
x = case UNIT_DECL_DEFN
x of
Unit_decl _ _ _ p :: Range
p -> Range
p
Unit_defn _ _ p :: Range
p -> Range
p
rangeSpan :: UNIT_DECL_DEFN -> [Pos]
rangeSpan x :: UNIT_DECL_DEFN
x = case UNIT_DECL_DEFN
x of
Unit_decl a :: ARCH_SPEC_NAME
a b :: REF_SPEC
b c :: [Annoted UNIT_TERM]
c d :: Range
d -> [[Pos]] -> [Pos]
joinRanges [ARCH_SPEC_NAME -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan ARCH_SPEC_NAME
a, REF_SPEC -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan REF_SPEC
b,
[Annoted UNIT_TERM] -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan [Annoted UNIT_TERM]
c, Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
d]
Unit_defn a :: ARCH_SPEC_NAME
a b :: UNIT_EXPRESSION
b c :: Range
c -> [[Pos]] -> [Pos]
joinRanges [ARCH_SPEC_NAME -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan ARCH_SPEC_NAME
a, UNIT_EXPRESSION -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan UNIT_EXPRESSION
b,
Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
c]
instance GetRange UNIT_SPEC where
getRange :: UNIT_SPEC -> Range
getRange x :: UNIT_SPEC
x = case UNIT_SPEC
x of
Unit_type _ _ p :: Range
p -> Range
p
Spec_name _ -> Range
nullRange
Closed_unit_spec _ p :: Range
p -> Range
p
rangeSpan :: UNIT_SPEC -> [Pos]
rangeSpan x :: UNIT_SPEC
x = case UNIT_SPEC
x of
Unit_type a :: [Annoted SPEC]
a b :: Annoted SPEC
b c :: Range
c -> [[Pos]] -> [Pos]
joinRanges [[Annoted SPEC] -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan [Annoted SPEC]
a, Annoted SPEC -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Annoted SPEC
b,
Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
c]
Spec_name a :: ARCH_SPEC_NAME
a -> [[Pos]] -> [Pos]
joinRanges [ARCH_SPEC_NAME -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan ARCH_SPEC_NAME
a]
Closed_unit_spec a :: UNIT_SPEC
a b :: Range
b -> [[Pos]] -> [Pos]
joinRanges [UNIT_SPEC -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan UNIT_SPEC
a, Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
b]
instance GetRange REF_SPEC where
getRange :: REF_SPEC -> Range
getRange x :: REF_SPEC
x = case REF_SPEC
x of
Unit_spec _ -> Range
nullRange
Refinement _ _ _ _ p :: Range
p -> Range
p
Arch_unit_spec _ p :: Range
p -> Range
p
Compose_ref _ p :: Range
p -> Range
p
Component_ref _ p :: Range
p -> Range
p
rangeSpan :: REF_SPEC -> [Pos]
rangeSpan x :: REF_SPEC
x = case REF_SPEC
x of
Unit_spec a :: UNIT_SPEC
a -> [[Pos]] -> [Pos]
joinRanges [UNIT_SPEC -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan UNIT_SPEC
a]
Refinement a :: Bool
a b :: UNIT_SPEC
b c :: [G_mapping]
c d :: REF_SPEC
d e :: Range
e -> [[Pos]] -> [Pos]
joinRanges [Bool -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Bool
a, UNIT_SPEC -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan UNIT_SPEC
b,
[G_mapping] -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan [G_mapping]
c, REF_SPEC -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan REF_SPEC
d, Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
e]
Arch_unit_spec a :: Annoted ARCH_SPEC
a b :: Range
b -> [[Pos]] -> [Pos]
joinRanges [Annoted ARCH_SPEC -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Annoted ARCH_SPEC
a, Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
b]
Compose_ref a :: [REF_SPEC]
a b :: Range
b -> [[Pos]] -> [Pos]
joinRanges [[REF_SPEC] -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan [REF_SPEC]
a, Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
b]
Component_ref a :: [UNIT_REF]
a b :: Range
b -> [[Pos]] -> [Pos]
joinRanges [[UNIT_REF] -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan [UNIT_REF]
a, Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
b]
instance GetRange UNIT_REF where
getRange :: UNIT_REF -> Range
getRange x :: UNIT_REF
x = case UNIT_REF
x of
Unit_ref _ _ p :: Range
p -> Range
p
rangeSpan :: UNIT_REF -> [Pos]
rangeSpan x :: UNIT_REF
x = case UNIT_REF
x of
Unit_ref a :: ARCH_SPEC_NAME
a b :: REF_SPEC
b c :: Range
c -> [[Pos]] -> [Pos]
joinRanges [ARCH_SPEC_NAME -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan ARCH_SPEC_NAME
a, REF_SPEC -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan REF_SPEC
b,
Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
c]
instance GetRange UNIT_EXPRESSION where
getRange :: UNIT_EXPRESSION -> Range
getRange x :: UNIT_EXPRESSION
x = case UNIT_EXPRESSION
x of
Unit_expression _ _ p :: Range
p -> Range
p
rangeSpan :: UNIT_EXPRESSION -> [Pos]
rangeSpan x :: UNIT_EXPRESSION
x = case UNIT_EXPRESSION
x of
Unit_expression a :: [UNIT_BINDING]
a b :: Annoted UNIT_TERM
b c :: Range
c -> [[Pos]] -> [Pos]
joinRanges [[UNIT_BINDING] -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan [UNIT_BINDING]
a, Annoted UNIT_TERM -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Annoted UNIT_TERM
b,
Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
c]
instance GetRange UNIT_BINDING where
getRange :: UNIT_BINDING -> Range
getRange x :: UNIT_BINDING
x = case UNIT_BINDING
x of
Unit_binding _ _ p :: Range
p -> Range
p
rangeSpan :: UNIT_BINDING -> [Pos]
rangeSpan x :: UNIT_BINDING
x = case UNIT_BINDING
x of
Unit_binding a :: ARCH_SPEC_NAME
a b :: UNIT_SPEC
b c :: Range
c -> [[Pos]] -> [Pos]
joinRanges [ARCH_SPEC_NAME -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan ARCH_SPEC_NAME
a, UNIT_SPEC -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan UNIT_SPEC
b,
Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
c]
instance GetRange UNIT_TERM where
getRange :: UNIT_TERM -> Range
getRange x :: UNIT_TERM
x = case UNIT_TERM
x of
Unit_reduction _ _ -> Range
nullRange
Unit_translation _ _ -> Range
nullRange
Amalgamation _ p :: Range
p -> Range
p
Local_unit _ _ p :: Range
p -> Range
p
Unit_appl _ _ p :: Range
p -> Range
p
Group_unit_term _ p :: Range
p -> Range
p
rangeSpan :: UNIT_TERM -> [Pos]
rangeSpan x :: UNIT_TERM
x = case UNIT_TERM
x of
Unit_reduction a :: Annoted UNIT_TERM
a b :: RESTRICTION
b -> [[Pos]] -> [Pos]
joinRanges [Annoted UNIT_TERM -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Annoted UNIT_TERM
a, RESTRICTION -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan RESTRICTION
b]
Unit_translation a :: Annoted UNIT_TERM
a b :: RENAMING
b -> [[Pos]] -> [Pos]
joinRanges [Annoted UNIT_TERM -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Annoted UNIT_TERM
a, RENAMING -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan RENAMING
b]
Amalgamation a :: [Annoted UNIT_TERM]
a b :: Range
b -> [[Pos]] -> [Pos]
joinRanges [[Annoted UNIT_TERM] -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan [Annoted UNIT_TERM]
a, Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
b]
Local_unit a :: [Annoted UNIT_DECL_DEFN]
a b :: Annoted UNIT_TERM
b c :: Range
c -> [[Pos]] -> [Pos]
joinRanges [[Annoted UNIT_DECL_DEFN] -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan [Annoted UNIT_DECL_DEFN]
a, Annoted UNIT_TERM -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Annoted UNIT_TERM
b,
Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
c]
Unit_appl a :: ARCH_SPEC_NAME
a b :: [FIT_ARG_UNIT]
b c :: Range
c -> [[Pos]] -> [Pos]
joinRanges [ARCH_SPEC_NAME -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan ARCH_SPEC_NAME
a, [FIT_ARG_UNIT] -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan [FIT_ARG_UNIT]
b,
Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
c]
Group_unit_term a :: Annoted UNIT_TERM
a b :: Range
b -> [[Pos]] -> [Pos]
joinRanges [Annoted UNIT_TERM -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Annoted UNIT_TERM
a, Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
b]
instance GetRange FIT_ARG_UNIT where
getRange :: FIT_ARG_UNIT -> Range
getRange x :: FIT_ARG_UNIT
x = case FIT_ARG_UNIT
x of
Fit_arg_unit _ _ p :: Range
p -> Range
p
rangeSpan :: FIT_ARG_UNIT -> [Pos]
rangeSpan x :: FIT_ARG_UNIT
x = case FIT_ARG_UNIT
x of
Fit_arg_unit a :: Annoted UNIT_TERM
a b :: [G_mapping]
b c :: Range
c -> [[Pos]] -> [Pos]
joinRanges [Annoted UNIT_TERM -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Annoted UNIT_TERM
a, [G_mapping] -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan [G_mapping]
b,
Range -> [Pos]
forall a. GetRange a => a -> [Pos]
rangeSpan Range
c]