-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathExampleMixIds.hs
40 lines (32 loc) · 1.27 KB
/
ExampleMixIds.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{- |
Module : ./Common/ExampleMixIds.hs
Description : standard mixfix identifier
Copyright : (c) Christian Maeder and DFKI Bremen 2008
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : experimental
Portability : portable
mixfix identifiers for testing CASL's and HasCASL's mixfix analysis
-}
module Common.ExampleMixIds (stdOpsL, stdPreds, mkIds) where
import Common.Id
import Common.AnnoParser
import Common.Lexer
import qualified Data.Set as Set
stdOpsL :: [String]
stdOpsL =
[ "__^__", "__*__", "__+__", "[__]", "__div__", "__mod__", "__rem__"
, "__-__", "+__", "__E__", "__@@__", "[]", "__::__", "__:::__", "-__", "__!"
, "____p", "q____", "____x____", "{____}"
, "repeat__until__", "while__do__od", "__none__but__", "__one__done"
, "A[a[c,d],b]", "B[a[c,d],b]", "__B[a[c,d],b]__"
, "a[c,d]", "__a[c,d]__", "A[a]", "A__B", "A__", "__[a]", "__p"
, "__ --> __", "__{__}--__-->{__}__", "__[__]__", "[__]__", "__[__]" ]
stdPredsL :: [String]
stdPredsL =
[ "__<__", "__<=__", "__>__", "__>=__", "__!=__", "__<>__"
, "__/=__", "even__", "odd__", "__isEmpty", "__<=__<=__" ]
mkIds :: [String] -> Set.Set Id
mkIds = Set.fromList . map (parseString parseAnnoId)
stdPreds :: Set.Set Id
stdPreds = mkIds stdPredsL