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/SMLNJ/src/MLRISC/IR/mlrisc-format-insn.sml
ViewVC logotype

Diff of /sml/branches/SMLNJ/src/MLRISC/IR/mlrisc-format-insn.sml

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

revision 410, Fri Sep 3 00:25:03 1999 UTC revision 411, Fri Sep 3 00:25:03 1999 UTC
# Line 1  Line 1 
1    (*
2     * This just provide a very simple pretty printing function.
3     * It is used for visualization.
4     *
5     * -- Allen
6     *
7     *)
8    
9  signature FORMAT_INSTRUCTION =  signature FORMAT_INSTRUCTION =
10  sig  sig
11     structure I  : INSTRUCTIONS     structure I  : INSTRUCTIONS
# Line 6  Line 14 
14    
15  end  end
16    
17  functor FormatInstructionFn(Emitter : EMITTER_NEW) : FORMAT_INSTRUCTION =  functor FormatInstructionFn
18       (Emitter : INSTRUCTION_EMITTER) : FORMAT_INSTRUCTION =
19  struct  struct
20     structure I = Emitter.I     structure I = Emitter.I
21    
22     fun toString regmap insn =     fun toString regmap insn =
23     let val buffer = StringStream.mkStreamBuf()     let val buffer = StringStream.mkStreamBuf()
24         val S      = StringStream.openStringOut buffer         val S      = StringStream.openStringOut buffer
25         val _      = AsmStream.withStream S Emitter.emitInstr (insn,regmap)         val _      = AsmStream.withStream S
26                        (fn _ =>
27                        let val Emitter.S.STREAM{emit,...} = Emitter.makeStream()
28                        in  emit (I.C.lookup regmap) insn
29                        end) ()
30         val text   = StringStream.getString buffer         val text   = StringStream.getString buffer
31         fun isSpace #" "  = true         fun isSpace #" "  = true
32           | isSpace #"\t" = true           | isSpace #"\t" = true
# Line 30  Line 43 
43    
44  end  end
45    
 (*  
  * $Log$  
  *)  

Legend:
Removed from v.410  
changed lines
  Added in v.411

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