SCM Repository
Annotation of /sml/branches/FLINT/src/compiler/Semant/statenv/bindings.sml
Parent Directory
|
Revision Log
Revision 418 - (view) (download)
1 : | monnier | 249 | (* Copyright 1996 by AT&T Bell Laboratories *) |
2 : | (* bindings.sml *) | ||
3 : | |||
4 : | signature BINDINGS = | ||
5 : | sig | ||
6 : | |||
7 : | datatype binding | ||
8 : | = VALbind of VarCon.var | ||
9 : | | CONbind of VarCon.datacon | ||
10 : | | TYCbind of Types.tycon | ||
11 : | | SIGbind of Modules.Signature | ||
12 : | | STRbind of Modules.Structure | ||
13 : | | FSGbind of Modules.fctSig | ||
14 : | | FCTbind of Modules.Functor | ||
15 : | | FIXbind of Fixity.fixity | ||
16 : | |||
17 : | val binderGt : (Symbol.symbol * binding) * (Symbol.symbol * binding) -> bool | ||
18 : | |||
19 : | end (* signature BINDINGS *) | ||
20 : | |||
21 : | |||
22 : | structure Bindings : BINDINGS = | ||
23 : | struct | ||
24 : | |||
25 : | local structure S = Symbol | ||
26 : | structure T = Types | ||
27 : | structure V = VarCon | ||
28 : | structure M = Modules | ||
29 : | in | ||
30 : | |||
31 : | fun err s = ErrorMsg.impossible ("Bindings: "^s) | ||
32 : | |||
33 : | datatype binding | ||
34 : | = VALbind of V.var | ||
35 : | | CONbind of V.datacon | ||
36 : | | TYCbind of T.tycon | ||
37 : | | SIGbind of M.Signature | ||
38 : | | STRbind of M.Structure | ||
39 : | | FSGbind of M.fctSig | ||
40 : | | FCTbind of M.Functor | ||
41 : | | FIXbind of Fixity.fixity | ||
42 : | |||
43 : | (* used for statenv sorting in env/statenv.sml *) | ||
44 : | fun binderGt(bind1: S.symbol * binding, | ||
45 : | bind2: S.symbol * binding) = | ||
46 : | case (bind1,bind2) | ||
47 : | of ((n1,FIXbind _),(n2,FIXbind _)) => S.symbolGt(n1,n2) | ||
48 : | | ((_,FIXbind _),_) => true | ||
49 : | | (_,(_,FIXbind _)) => false | ||
50 : | | ((n1,VALbind _),(n2,VALbind _)) => S.symbolGt(n1,n2) | ||
51 : | | ((_,VALbind _),_) => true | ||
52 : | | (_,(_,VALbind _)) => false | ||
53 : | | ((n1,CONbind _),(n2,CONbind _)) => S.symbolGt(n1,n2) | ||
54 : | | ((_,CONbind _),_) => true | ||
55 : | | (_,(_,CONbind _)) => false | ||
56 : | | ((n1,TYCbind _),(n2,TYCbind _)) => S.symbolGt(n1,n2) | ||
57 : | | ((_,TYCbind _),_) => true | ||
58 : | | (_,(_,TYCbind _)) => false | ||
59 : | | ((n1,STRbind _),(n2,STRbind _)) => S.symbolGt(n1,n2) | ||
60 : | | ((_,STRbind _),_) => true | ||
61 : | | (_,(_,STRbind _)) => false | ||
62 : | | ((n1,FCTbind _),(n2,FCTbind _)) => S.symbolGt(n1,n2) | ||
63 : | | ((_,FCTbind _),_) => true | ||
64 : | | (_,(_,FCTbind _)) => false | ||
65 : | | ((n1,SIGbind _),(n2,SIGbind _)) => S.symbolGt(n1,n2) | ||
66 : | | ((_,SIGbind _),_) => true | ||
67 : | | (_,(_,SIGbind _)) => false | ||
68 : | | ((n1,FSGbind _), (n2,FSGbind _)) => S.symbolGt(n1,n2) | ||
69 : | |||
70 : | end (* local *) | ||
71 : | end (* structure Bindings *) | ||
72 : |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |