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/compiler/ElabData/basics/primopid.sml
ViewVC logotype

Diff of /sml/trunk/compiler/ElabData/basics/primopid.sml

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

revision 4428, Tue Sep 19 17:42:58 2017 UTC revision 4429, Tue Sep 19 18:06:28 2017 UTC
# Line 15  Line 15 
15       represented as a string. See the file DEVNOTES/Flint/primop-list       represented as a string. See the file DEVNOTES/Flint/primop-list
16       for the catalog of primop names with their types and primop specs *)       for the catalog of primop names with their types and primop specs *)
17    
18    datatype primId = Prim of string | NonPrim    datatype primId = Prim of PrimopBinding.primop_bind | NonPrim
19    
20    datatype strPrimElem = PrimE of primId    datatype strPrimElem = PrimE of primId
21                         | StrE of strPrimInfo                         | StrE of strPrimInfo
# Line 29  Line 29 
29      | isPrimop NonPrim  = false      | isPrimop NonPrim  = false
30    
31    (* Used in TopLevel/main/compile.sml to identify callcc/capture primops *)    (* Used in TopLevel/main/compile.sml to identify callcc/capture primops *)
32    fun isPrimCallcc (Prim("callcc" | "capture")) = true    fun isPrimCallcc (Prim p) =
33          (case PrimopBinding.defnOf p
34             of (PrimOp.CALLCC | PrimOp.CAPTURE) => true
35              |  _ => false)
36      | isPrimCallcc _ = false      | isPrimCallcc _ = false
37    
38    (* Used in ElabData/modules/moduleutil.sml to identify cast primop *)    (* Used in ElabData/modules/moduleutil.sml to identify cast primop *)
39    fun isPrimCast (Prim "cast") = true    fun isPrimCast (Prim p) =
40          (case PrimOp.defnOf p
41            of PrimOp.CAST => true
42            |  _ => false)
43      | isPrimCast _ = false      | isPrimCast _ = false
44    
45    (* selStrPrimId : strPrimInfo * int -> strPrimInfo *)    (* selStrPrimId : strPrimInfo * int -> strPrimInfo *)
46    (* Select the prim ids for a substructure *)    (* Select the prim ids for a substructure *)
47    fun selStrPrimId([], slot) = []    fun selStrPrimId([], slot) = []  (* not a bug? DBM *)
48      | selStrPrimId(elems, slot) =      | selStrPrimId(elems, slot) =
49        (case List.nth(elems, slot)        (case List.nth(elems, slot)
50          of StrE elems' => elems'          of StrE elems' => elems'
# Line 49  Line 55 
55             structure *)             structure *)
56    
57    (* Select the prim id for a value component *)    (* Select the prim id for a value component *)
58    fun selValPrimFromStrPrim([], slot) = NonPrim    fun selValPrimFromStrPrim([], slot) = NonPrim (* not a bug? DBM *)
59      | selValPrimFromStrPrim(elems, slot) =      | selValPrimFromStrPrim(elems, slot) =
60        (case List.nth(elems, slot)        (case List.nth(elems, slot)
61          of PrimE(id) => id          of PrimE(id) => id
# Line 61  Line 67 
67             primId *)             primId *)
68    
69    fun ppPrim NonPrim = "<NonPrim>"    fun ppPrim NonPrim = "<NonPrim>"
70      | ppPrim (Prim p) = ("<PrimE "^p^">")      | ppPrim (Prim p) = ("<PrimE " ^ PrimOp.nameOf p ^">")
71    
72    fun ppStrInfo strelems =    fun ppStrInfo strelems =
73        let fun ppElem [] = ()        let fun ppElem [] = ()

Legend:
Removed from v.4428  
changed lines
  Added in v.4429

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