446N/ADescription : Parser for symbols in translations and reductions
446N/ACopyright : (c) Christian Maeder, Uni Bremen 2002-2006
446N/AMaintainer : Christian.Maeder@dfki.de
446N/AParsing symbols for translations and reductions
446N/A-- | parsing a possibly qualified identifier
446N/Asymb :: [String] -> GenParser Char st SYMB
446N/A return (Qual_id i t $ tokPos c)
4744N/A-- | parsing a type for an operation or a predicate
4744N/AopOrPredType :: [String] -> GenParser Char st TYPE
4744N/A if b then return (O_type (Op_type Partial [] s p))
4744N/A (ts, ps) <- sortId ks `separatedBy` crossT
4744N/A fmap O_type (opFunSort ks (s:ts) (c:ps))
4744N/A <|> return (P_type $ Pred_type (s:ts)
4744N/A <|> fmap O_type (opFunSort ks [s] [])
4744N/A <|> fmap P_type predUnitType
4744N/A-- | parsing one symbol or a mapping of one to second symbol
4744N/AsymbMap :: [String] -> GenParser Char st SYMB_OR_MAP
4744N/A do f <- pToken $ toKey mapsTo
5073N/A return (Symb_map s t $ tokPos f)
4744N/AsymbKind :: GenParser Char st (SYMB_KIND, Token)
4744N/A do q <- pluralKeyword predS
4744N/A do q <- pluralKeyword sortS
4744N/A return (Sorts_kind, q)) <?> "kind"
4744N/A-- | parse a possible kinded list of comma separated symbols
4744N/AsymbItems :: [String] -> GenParser Char st SYMB_ITEMS
4744N/A return (Symb_items Implicit is $ catPos ps)
4744N/A return (Symb_items k is $ catPos $ p:ps)
4744N/A-- | parse a comma separated list of symbols
4744N/Asymbs :: [String] -> GenParser Char st ([SYMB], [Token])
4744N/A do c <- commaT `followedWith` symb ks
4744N/A-- | parse a possible kinded list of symbol mappings
4744N/AsymbMapItems :: [String] -> GenParser Char st SYMB_MAP_ITEMS
4744N/A return (Symb_map_items Implicit [s] nullRange)
4744N/A return (Symb_map_items k is $ catPos $ p:ps)
4744N/A-- | parse a comma separated list of symbol mappings
4744N/AsymbMaps :: [String] -> GenParser Char st ([SYMB_OR_MAP], [Token])
4744N/A do c <- commaT `followedWith` symb ks