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/branches/rt-transition/system/smlnj/internal/int-sys.sml
ViewVC logotype

Diff of /sml/branches/rt-transition/system/smlnj/internal/int-sys.sml

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

revision 1207, Tue May 21 01:42:14 2002 UTC revision 1208, Tue May 21 02:22:43 2002 UTC
# Line 1  Line 1 
1  (* Copyright 1997 by AT&T Bell Laboratories *)  (* Copyright 1997 by AT&T Bell Laboratories *)
2  (* Copyright 1998 by Lucent Technologies *)  (* Copyright 1998 by Lucent Technologies *)
3  (* Copyright 1999 by Lucent Technologies *)  (* Copyright 1999 by Lucent Technologies *)
4    (* Copyright 2002 by Lucent Technologies *)
5  (* int-sys.sml *)  (* int-sys.sml *)
6    
7  (*  (*
# Line 40  Line 41 
41           Signals.overrideHandler (Signals.sigTERM, Signals.HANDLER handleTERM);           Signals.overrideHandler (Signals.sigTERM, Signals.HANDLER handleTERM);
42           ifSignal ("QUIT", handleTERM))           ifSignal ("QUIT", handleTERM))
43    
44        (* install "use" functionality *)
45      val _ = UseHook.useHook := Backend.Interact.useFile      val _ = UseHook.useHook := Backend.Interact.useFile
46    
47      local      (* put MLRISC controls into the main hierarchy of controls *)
48          (* register the MLRISC controls with the central controls      val _ = BasicControl.nest (Control.MLRISC.prefix,
49           * facility... *)                                 Control.MLRISC.registry,
50          structure C = Controls                                 Control.MLRISC.priority)
         structure CR = ControlRegistry  
   
         val priority = [10, 3]  
         val obscurity = 3  
         val prefix = "mlrisc"  
   
         val registry = CR.new { help = "MLRISC" }  
   
         val _ = BasicControl.nest (prefix, registry)  
   
         fun uc #"-" = #"_"  
           | uc c = Char.toUpper c  
         fun en n = SOME ("MLRISC_" ^ String.map uc n)  
   
         fun reg0 en c { cell, descr, stem } = let  
             val ctl = C.control { name = stem,  
                                   pri = priority,  
                                   obscurity = obscurity,  
                                   help = descr,  
                                   ctl = cell }  
         in  
             CR.register registry { ctl = C.stringControl c ctl,  
                                    envName = en stem }  
         end  
   
         fun reg x = reg0 en x  
         fun reg' x = reg0 (fn _ => NONE) x  
   
         val int_cvt = { tyName = "int",  
                         fromString = Int.fromString,  
                         toString = Int.toString }  
         val flag_cvt = { tyName = "bool",  
                          fromString = Bool.fromString,  
                          toString = Bool.toString }  
         val real_cvt = { tyName = "real",  
                          fromString = Real.fromString,  
                          toString = Real.toString }  
         val string_cvt = { tyName = "string",  
                            fromString = SOME,  
                            toString = fn x => x }  
         val stringList_cvt = { tyName = "string list",  
                                fromString = SOME o String.tokens Char.isSpace,  
                                toString = concat o  
                                         foldr (fn (s, r) => " " :: s :: r) [] }  
         val timing_cvt =  
             { tyName = "timing",  
               fromString = fn _ => (NONE : Control.MLRISC.cpu_time option),  
               toString = fn _ => "<timing>" }  
     in  
         val _ = app (reg' int_cvt) (!Control.MLRISC.counters)  
         val _ = app (reg int_cvt) (!Control.MLRISC.ints)  
         val _ = app (reg flag_cvt) (!Control.MLRISC.flags)  
         val _ = app (reg real_cvt) (!Control.MLRISC.reals)  
         val _ = app (reg string_cvt) (!Control.MLRISC.strings)  
         val _ = app (reg stringList_cvt) (!Control.MLRISC.stringLists)  
         val _ = app (reg' timing_cvt) (!Control.MLRISC.timings)  
     end  
51    
52      (* add cleanup code that resets the internal timers and stats      (* add cleanup code that resets the internal timers and stats
53       * when resuming from exportML... *)       * when resuming from exportML... *)

Legend:
Removed from v.1207  
changed lines
  Added in v.1208

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