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 279 - (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 279 val eq : primitive * primitive -> bool
14 :    
15 : blume 274 val fromString : string -> primitive option
16 : blume 273 val toString : primitive -> string
17 : blume 272
18 : blume 278 (* the domain of (lookup p) must always properly include (exports p) *)
19 : blume 270 val exports: primitive -> SymbolSet.set
20 : blume 278 val lookup: primitive -> Symbol.symbol -> GenericVC.BareEnvironment.cmEnv
21 : blume 270 end
22 :    
23 : blume 272 structure Primitive :> PRIMITIVE = struct
24 : blume 270
25 : blume 274 datatype primitive = CORE | HELPER
26 : blume 270
27 : blume 279 fun eq (p1 : primitive, p2) = p1 = p2
28 :    
29 : blume 274 fun fromString "primitive_core" = SOME CORE
30 :     | fromString "primitive_helper" = SOME HELPER
31 :     | fromString _ = NONE
32 :    
33 :     fun toString CORE = "primitive_core"
34 :     | toString HELPER = "primitive_helper"
35 :    
36 :     fun exports p = (ignore Dummy.v; SymbolSet.empty)
37 : blume 278 fun lookup p s = (ignore Dummy.v; GenericVC.BareEnvironment.CM_NONE)
38 : blume 270 end

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