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 1639 - (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 879 functor SpecificSymValFn (val arch: string
9 : blume 336 val os: SMLofNJ.SysInfo.os_kind) =
10 :     struct
11 :     local
12 : blume 386 val (arch, big, size) =
13 : blume 879 case arch 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 879 | arch => ErrorMsg.impossible
23 :     ("unknown architecture: " ^ arch)
24 :     val env0 = SymVal.default
25 :     { arch = arch, big = big, size = size, os = os,
26 : mblume 1639 version = #version_id SMLNJVersion.version }
27 : blume 433 val er = ref env0
28 :     in
29 :     fun symval s = let
30 :     fun get () = SymVal.look (!er) s
31 :     fun set v = er := SymVal.define (!er, s, v)
32 :     in
33 :     { get = get, set = set }
34 :     end
35 : blume 336 end
36 :     end

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