Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/cm/stable/bininfo.sml
ViewVC logotype

Annotation of /sml/trunk/src/cm/stable/bininfo.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 305 - (view) (download)

1 : blume 295 (*
2 :     * Bundling information pertaining to the member of a stable group.
3 :     * - only includes information that does not require running
4 :     * the machine-dependent part of the compiler
5 :     *
6 :     * (C) 1999 Lucent Technologies, Bell Laboratories
7 :     *
8 :     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
9 :     *)
10 : blume 294 signature BININFO = sig
11 :    
12 :     type info
13 : blume 305 type ord_key = info
14 : blume 295 type complainer = GenericVC.ErrorMsg.complainer
15 : blume 305 type region = GenericVC.SourceMap.region
16 : blume 294
17 : blume 305 val new : { group: AbsPath.t * region,
18 :     spec: string,
19 :     offset: int,
20 :     share: bool option } -> info
21 :    
22 : blume 295 val compare : info * info -> order
23 : blume 294 val describe : info -> string
24 : blume 295 val offset : info -> int
25 :     val group : info -> AbsPath.t
26 :     val share : info -> bool option
27 : blume 299 val error : GeneralParams.info -> info -> complainer
28 : blume 294 end
29 :    
30 :     structure BinInfo :> BININFO = struct
31 :    
32 : blume 295 type complainer = GenericVC.ErrorMsg.complainer
33 : blume 297 type region = GenericVC.SourceMap.region
34 : blume 294
35 : blume 295 datatype info =
36 : blume 297 INFO of { group: AbsPath.t * region,
37 : blume 295 spec: string,
38 :     offset: int,
39 : blume 297 share: bool option }
40 : blume 294
41 : blume 305 type ord_key = info
42 :    
43 :     val new = INFO
44 :    
45 : blume 295 fun compare (INFO i, INFO i') =
46 :     case Int.compare (#offset i, #offset i') of
47 : blume 297 EQUAL => AbsPath.compare (#1 (#group i), #1 (#group i'))
48 : blume 295 | unequal => unequal
49 :    
50 : blume 297 fun describe (INFO { group = (group, _), spec, offset, ... }) =
51 : blume 295 concat [AbsPath.name group, "@", Int.toString offset, "(", spec, ")"]
52 :    
53 : blume 297 fun group (INFO { group = (g, r), ... }) = g
54 : blume 295 fun offset (INFO { offset = os, ... }) = os
55 :     fun share (INFO { share = s, ... }) = s
56 : blume 297
57 : blume 299 fun error (gp: GeneralParams.info) (INFO { group, ... }) =
58 : blume 297 GroupReg.error (#groupreg gp) group
59 : blume 294 end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0