Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/semant/primitive.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 270, Tue May 11 07:45:42 1999 UTC revision 279, Tue May 18 08:10:36 1999 UTC
# Line 1  Line 1 
1    (*
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  signature PRIMITIVE = sig  signature PRIMITIVE = sig
10    
11      type primitive      type primitive
12    
13        val eq : primitive * primitive -> bool
14    
15        val fromString : string -> primitive option
16        val toString : primitive -> string
17    
18        (* the domain of (lookup p) must always properly include (exports p) *)
19      val exports: primitive -> SymbolSet.set      val exports: primitive -> SymbolSet.set
20        val lookup: primitive -> Symbol.symbol -> GenericVC.BareEnvironment.cmEnv
21  end  end
22    
23  structure Primitive = struct  structure Primitive :> PRIMITIVE = struct
24    
25        datatype primitive = CORE | HELPER
26    
27        fun eq (p1 : primitive, p2) = p1 = p2
28    
29        fun fromString "primitive_core" = SOME CORE
30          | fromString "primitive_helper" = SOME HELPER
31          | fromString _ = NONE
32    
33      type primitive = Dummy.t      fun toString CORE = "primitive_core"
34          | toString HELPER = "primitive_helper"
35    
36      fun exports p = Dummy.f ()      fun exports p = (ignore Dummy.v; SymbolSet.empty)
37        fun lookup p s = (ignore Dummy.v; GenericVC.BareEnvironment.CM_NONE)
38  end  end

Legend:
Removed from v.270  
changed lines
  Added in v.279

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