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 299 - (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 295 type complainer = GenericVC.ErrorMsg.complainer
14 : blume 294
15 : blume 295 val compare : info * info -> order
16 : blume 294 val describe : info -> string
17 : blume 295 val offset : info -> int
18 :     val group : info -> AbsPath.t
19 :     val share : info -> bool option
20 : blume 299 val error : GeneralParams.info -> info -> complainer
21 : blume 294 end
22 :    
23 :     structure BinInfo :> BININFO = struct
24 :    
25 : blume 295 type complainer = GenericVC.ErrorMsg.complainer
26 : blume 297 type region = GenericVC.SourceMap.region
27 : blume 294
28 : blume 295 datatype info =
29 : blume 297 INFO of { group: AbsPath.t * region,
30 : blume 295 spec: string,
31 :     offset: int,
32 : blume 297 share: bool option }
33 : blume 294
34 : blume 295 fun compare (INFO i, INFO i') =
35 :     case Int.compare (#offset i, #offset i') of
36 : blume 297 EQUAL => AbsPath.compare (#1 (#group i), #1 (#group i'))
37 : blume 295 | unequal => unequal
38 :    
39 : blume 297 fun describe (INFO { group = (group, _), spec, offset, ... }) =
40 : blume 295 concat [AbsPath.name group, "@", Int.toString offset, "(", spec, ")"]
41 :    
42 : blume 297 fun group (INFO { group = (g, r), ... }) = g
43 : blume 295 fun offset (INFO { offset = os, ... }) = os
44 :     fun share (INFO { share = s, ... }) = s
45 : blume 297
46 : blume 299 fun error (gp: GeneralParams.info) (INFO { group, ... }) =
47 : blume 297 GroupReg.error (#groupreg gp) group
48 : blume 294 end

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