e071fb22ea9923a2a4ff41184d80ca46b55ee932Till MossakowskiDescription : Parser for CspCASL specifications
63f8854d42e766ff77125c6e532c5fce3b5ebdefChristian MaederCopyright : (c) Uni Bremen 2007
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu ProdescuLicense : GPLv2 or higher, see LICENSE.txt
8267b99c0d7a187abe6f87ad50530dc08f5d1cdcAndy GimblettMaintainer : a.m.gimblett@swan.ac.uk
8267b99c0d7a187abe6f87ad50530dc08f5d1cdcAndy GimblettStability : experimental
63f8854d42e766ff77125c6e532c5fce3b5ebdefChristian MaederPortability : portable
8267b99c0d7a187abe6f87ad50530dc08f5d1cdcAndy GimblettParser for CSP-CASL specifications.
45ec7dde04370e30e219a8ba6f4ce71d4bba3f2bChristian Maedermodule CspCASL.Parse_CspCASL (cspBasicExt) where
12b2ae689353ecbaad720a9af9f9be01c1a3fe2dChristian Maederinstance AParsable CspBasicExt where
12b2ae689353ecbaad720a9af9f9be01c1a3fe2dChristian Maeder aparser = cspBasicExt
12b2ae689353ecbaad720a9af9f9be01c1a3fe2dChristian MaedercspBasicExt :: AParser st CspBasicExt
8db2221917c1bc569614f3481bcdb3b988facaedChristian Maeder itemList cspKeywords channelS (const chanDecl) Channels
12b2ae689353ecbaad720a9af9f9be01c1a3fe2dChristian Maeder p <- asKey processS
8db2221917c1bc569614f3481bcdb3b988facaedChristian Maeder auxItemList cspStartKeys [p] procItem ProcItems
53f89daf88665d3ea96d871110a5c0d9d8326bd2Andy GimblettchanDecl :: AParser st CHANNEL_DECL
9f93b2a8b552789cd939d599504d39732672dc84Christian Maeder vs <- commaSep1 channel_name
38504dc968167ba2e82dd568edeae8d6af4dc145Christian Maeder es <- cspSortId
9f93b2a8b552789cd939d599504d39732672dc84Christian Maeder return (ChannelDecl vs es)
dfc58f5ec6492d1a9b9babd9cdcdbb15baa6e657Christian MaederprocItem :: AParser st PROC_ITEM
dfc58f5ec6492d1a9b9babd9cdcdbb15baa6e657Christian Maeder ep <- procDeclOrDefn
dfc58f5ec6492d1a9b9babd9cdcdbb15baa6e657Christian Maeder Left (fpn, vs) -> do
dfc58f5ec6492d1a9b9babd9cdcdbb15baa6e657Christian Maeder p <- csp_casl_process
dfc58f5ec6492d1a9b9babd9cdcdbb15baa6e657Christian Maeder return $ Proc_Eq (ParmProcname fpn vs) p
dfc58f5ec6492d1a9b9babd9cdcdbb15baa6e657Christian Maeder Right (pn, eas, al) -> case eas of
dfc58f5ec6492d1a9b9babd9cdcdbb15baa6e657Christian Maeder Left ss -> return $ Proc_Decl pn ss al
dfc58f5ec6492d1a9b9babd9cdcdbb15baa6e657Christian Maeder Right vds -> do
70a691ea12f53381209a3709cdd325df5fc0a0c8Christian Maeder p <- csp_casl_process
dfc58f5ec6492d1a9b9babd9cdcdbb15baa6e657Christian Maeder return $ Proc_Defn pn vds al p