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/main/specific-symval-fn.sml
ViewVC logotype

Annotation of /sml/trunk/src/cm/main/specific-symval-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 433 - (view) (download)

1 : blume 337 (*
2 :     * Building a host/OS-specific environments for CM "preprocessor" variables.
3 :     *
4 :     * (C) 1999 Lucent Technologies, Bell Laboratories
5 :     *
6 :     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
7 :     *)
8 : blume 336 functor SpecificSymValFn (structure MachDepVC: MACHDEP_VC
9 :     val os: SMLofNJ.SysInfo.os_kind) =
10 :     struct
11 :     local
12 : blume 386 val (arch, big, size) =
13 : blume 336 case MachDepVC.architecture of
14 : blume 386 "sparc" => ("SPARC", true, 32)
15 :     | "alpha32" => ("ALPHA", false, 32)
16 :     | "mipsel" => ("MIPS", false, 32)
17 :     | "mipseb" => ("MIPS", true, 32)
18 :     | "x86" => ("X86", false, 32)
19 :     | "hppa" => ("HPPA", false, 32)
20 :     | "rs6000" => ("RS6000", false, 32)
21 :     | "ppc" => ("PPC", false, 32)
22 : blume 336 | arch => GenericVC.ErrorMsg.impossible
23 :     ("unknown architecture: " ^ arch)
24 : blume 433 val env0 =
25 : blume 336 SymVal.default { arch = arch,
26 :     big = big,
27 :     size = size,
28 :     os = os,
29 :     version = #version_id GenericVC.version }
30 : blume 433 val er = ref env0
31 :     in
32 :     fun symval s = let
33 :     fun get () = SymVal.look (!er) s
34 :     fun set v = er := SymVal.define (!er, s, v)
35 :     in
36 :     { get = get, set = set }
37 :     end
38 : blume 336 end
39 :     end

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