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/compile/corehack.sml
ViewVC logotype

Annotation of /sml/trunk/src/cm/compile/corehack.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 879 - (view) (download)

1 : blume 592 (*
2 :     * Re-write top-level bindings of a given symbol with corresponding bindings
3 :     * of CoreSym.coreSym (i.e., "structure _Core").
4 :     *
5 :     * (C) 2000 Lucent Technologies, Bell Laboratories
6 :     *
7 :     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
8 :     *)
9 :     local
10 : blume 879 structure A = Ast
11 : blume 592 in
12 :     structure CoreHack : sig
13 :     val rewrite : A.dec * Symbol.symbol -> A.dec
14 :     end = struct
15 :     fun rewrite (d, esy) = let
16 :     fun strb (x as A.Strb { name, def, constraint }) =
17 :     if Symbol.eq (name, esy) then
18 :     A.Strb { name = CoreSym.coreSym, def = def,
19 :     constraint = constraint }
20 :     else x
21 :     | strb (A.MarkStrb (x, r)) = A.MarkStrb (strb x, r)
22 :     fun dec (A.StrDec l) = A.StrDec (map strb l)
23 :     | dec (A.LocalDec (d1, d2)) = A.LocalDec (d1, dec d2)
24 :     | dec (A.SeqDec l) = A.SeqDec (map dec l)
25 :     | dec (A.MarkDec (d, r)) = A.MarkDec (dec d, r)
26 :     | dec d = d
27 :     in
28 :     dec d
29 :     end
30 :     end
31 :     end

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