Parse_CspCASL.hs revision 8267b99c0d7a187abe6f87ad50530dc08f5d1cdc
6ea54752d184beb92c92fbae17ae9f7dd065d988Christian MaederCopyright : (c)
306763c67bb99228487345b32ab8c5c6cd41f23cChristian MaederLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
6ea54752d184beb92c92fbae17ae9f7dd065d988Christian MaederMaintainer : a.m.gimblett@swan.ac.uk
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu ProdescuStability : experimental
306763c67bb99228487345b32ab8c5c6cd41f23cChristian MaederParser for CSP-CASL specifications.
e9249d3ecd51a2b6a966a58669953e58d703adc6Till Mossakowski basicCspCaslSpec, dataDefn
556f473448dfcceee22afaa89ed7a364489cdbbbChristian Maederimport CASL.Parse_AS_Basic (basicSpec)
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maederimport Common.AnnoState (AParser, asKey)
556f473448dfcceee22afaa89ed7a364489cdbbbChristian Maederimport CspCASL.Parse_CspCASL_Process (csp_casl_process)
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederbasicCspCaslSpec :: AParser st BASIC_CSP_CASL_SPEC
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder-- The following is horrible, since if the spec _does_ end with "end",
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder-- it'll be parsed twice, the first time failing. Alas, the more
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder-- sensible version (afterwards, commented out), doesn't work, and I
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder-- don't know why not.
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederbasicCspCaslSpec = try (do asKey dataS
556f473448dfcceee22afaa89ed7a364489cdbbbChristian Maeder d <- dataDefn
556f473448dfcceee22afaa89ed7a364489cdbbbChristian Maeder asKey processS
556f473448dfcceee22afaa89ed7a364489cdbbbChristian Maeder p <- csp_casl_process
556f473448dfcceee22afaa89ed7a364489cdbbbChristian Maeder return (Basic_Csp_Casl_Spec d p)
556f473448dfcceee22afaa89ed7a364489cdbbbChristian Maeder <|> (do asKey dataS
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder d <- dataDefn
e9249d3ecd51a2b6a966a58669953e58d703adc6Till Mossakowski asKey processS
e9249d3ecd51a2b6a966a58669953e58d703adc6Till Mossakowski p <- csp_casl_process
27166b063721ef1a2efd8f00ab3d9bc820b315fbChristian Maeder return (Basic_Csp_Casl_Spec d p)
9f87aabedf02d74917d94fe1ac0300e07d3d4bc2Christian Maeder-- Hmmm, well, if this is the broken version, I'm not surprised. The
27166b063721ef1a2efd8f00ab3d9bc820b315fbChristian Maeder-- try should be around endS, not eof.
27166b063721ef1a2efd8f00ab3d9bc820b315fbChristian Maeder--cspCaslSpec = do asKey dataS
27166b063721ef1a2efd8f00ab3d9bc820b315fbChristian Maeder-- d <- dataDefn
27166b063721ef1a2efd8f00ab3d9bc820b315fbChristian Maeder-- asKey processS
27166b063721ef1a2efd8f00ab3d9bc820b315fbChristian Maeder-- p <- processDefn
63324a97283728a30932828a612c7b0b0f687624Christian Maeder-- (asKey endS)
e9249d3ecd51a2b6a966a58669953e58d703adc6Till Mossakowski-- return (Csp_Casl_Spec d p)
e9249d3ecd51a2b6a966a58669953e58d703adc6Till MossakowskidataDefn :: AParser st DATA_DEFN
e9249d3ecd51a2b6a966a58669953e58d703adc6Till MossakowskidataDefn = do d <- basicSpec csp_casl_keywords
e9249d3ecd51a2b6a966a58669953e58d703adc6Till Mossakowski return (Spec d)
53310804002cd9e3c9c5844db3b984abcf001788Christian MaederprocessDefn :: AParser st PROCESS
e9249d3ecd51a2b6a966a58669953e58d703adc6Till MossakowskiprocessDefn = do p <- csp_casl_process