4751N/ADescription : pretty printing of CASL architectural specifications
4751N/ACopyright : (c) Klaus Luettich, Uni Bremen 2002-2006
4751N/AMaintainer : Christian.Maeder@dfki.de
4751N/APortability : non-portable(Grothendieck)
4751N/APretty printing of CASL architectural specifications
4751N/Ainstance PrettyLG ARCH_SPEC where
4751N/A Basic_arch_spec aa ab _ -> sep [keyword (unitS ++ sS)
4751N/A <+> vcat (punctuate semi $ map (prettyLG lg) aa)
4751N/A , keyword resultS <+> prettyLG lg ab]
4751N/A Arch_spec_name aa -> pretty aa
4751N/A Group_arch_spec aa _ -> specBraces . rmTopKey $ prettyLG lg aa
4751N/Ainstance PrettyLG UNIT_REF where
4751N/A prettyLG lg (Unit_ref aa ab _) =
4751N/A fsep [structIRI aa, keyword toS, prettyLG lg ab]
4751N/Ainstance PrettyLG UNIT_DECL_DEFN where
4751N/A prettyLG lg ud = case ud of
4751N/A Unit_decl aa ab ac _ -> cat [structIRI aa <+> colon,
4751N/A sp1 <> fsep (prettyLG lg ab :
4751N/A keyword givenS : punctuate comma (map (prettyLG lg) ac))]
4751N/A cat [structIRI aa <+> equals, sp1 <> prettyLG lg ab]
4751N/Ainstance PrettyLG UNIT_SPEC where
4751N/A let ab' = rmTopKey $ printGroupSpec lg ab
4751N/A in if null aa then ab' else sep
4751N/A [ fsep . punctuate (space <> cross)
4751N/A $ map (rmTopKey . printGroupSpec lg) aa
4751N/A Closed_unit_spec aa _ -> fsep [keyword closedS, prettyLG lg aa]
4751N/Ainstance PrettyLG REF_SPEC where
4751N/A prettyLG lg rs = case rs of
4751N/A Unit_spec u -> prettyLG lg u
4751N/A Refinement b u m r _ -> fsep $
4751N/A prettyLG lg u : (if b then [] else [keyword behaviourallyS])
4751N/A ++ (if null m then [] else keyword viaS :
4751N/A punctuate comma (map pretty m))
4751N/A ++ [keyword toS, prettyLG lg r]
4751N/A fsep [keyword archS <+> keyword specS, prettyLG lg aa]
4751N/A Compose_ref aa _ -> case aa of
4751N/A x : xs -> sep $ prettyLG lg x :
4751N/A map ( \ s -> keyword thenS <+> prettyLG lg s) xs
4751N/A specBraces $ sepByCommas $ map (prettyLG lg) aa
4751N/Ainstance PrettyLG UNIT_EXPRESSION where
4751N/A prettyLG lg (Unit_expression aa ab _) =
4751N/A else fsep $ keyword lambdaS :
4751N/A punctuate semi (map (prettyLG lg) aa)
4751N/Ainstance PrettyLG UNIT_BINDING where
4751N/A prettyLG lg (Unit_binding aa ab _) =
4751N/Ainstance PrettyLG UNIT_TERM where
4751N/A prettyLG lg ut = case ut of
4751N/A Amalgamation aa _ -> case aa of
4751N/A x : xs -> sep $ prettyLG lg x :
4751N/A map ( \ s -> keyword andS <+> prettyLG lg s) xs
4751N/A fsep $ keyword localS : punctuate semi (map (prettyLG lg) aa)
4751N/A ++ [keyword withinS, prettyLG lg ab]
4751N/A Unit_appl aa ab _ -> fsep $ structIRI aa : map (prettyLG lg) ab
4751N/A Group_unit_term aa _ -> specBraces $ prettyLG lg aa
4751N/Ainstance PrettyLG FIT_ARG_UNIT where
4751N/A prettyLG lg (Fit_arg_unit aa ab _) = brackets $
4751N/A fsep $ prettyLG lg aa : if null ab then []
4751N/A else keyword fitS : punctuate comma (map pretty ab)