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/semant/primitive.sml
ViewVC logotype

Annotation of /sml/trunk/src/cm/semant/primitive.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 278 - (view) (download)

1 : blume 274 (*
2 :     * "Primitive" classes in CM.
3 :     * - provide access to compiler internals in an orderly fashion
4 :     *
5 :     * (C) 1999 Lucent Technologies, Bell Laboratories
6 :     *
7 :     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
8 :     *)
9 : blume 270 signature PRIMITIVE = sig
10 :    
11 :     type primitive
12 :    
13 : blume 274 val fromString : string -> primitive option
14 : blume 273 val toString : primitive -> string
15 : blume 272
16 : blume 278 (* the domain of (lookup p) must always properly include (exports p) *)
17 : blume 270 val exports: primitive -> SymbolSet.set
18 : blume 278 val lookup: primitive -> Symbol.symbol -> GenericVC.BareEnvironment.cmEnv
19 : blume 270 end
20 :    
21 : blume 272 structure Primitive :> PRIMITIVE = struct
22 : blume 270
23 : blume 274 datatype primitive = CORE | HELPER
24 : blume 270
25 : blume 274 fun fromString "primitive_core" = SOME CORE
26 :     | fromString "primitive_helper" = SOME HELPER
27 :     | fromString _ = NONE
28 :    
29 :     fun toString CORE = "primitive_core"
30 :     | toString HELPER = "primitive_helper"
31 :    
32 :     fun exports p = (ignore Dummy.v; SymbolSet.empty)
33 : blume 278 fun lookup p s = (ignore Dummy.v; GenericVC.BareEnvironment.CM_NONE)
34 : blume 270 end

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