Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/mid-il/mid-il.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/mid-il/mid-il.sml

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

revision 2796, Thu Nov 6 04:17:54 2014 UTC revision 2813, Sat Nov 8 21:48:17 2014 UTC
# Line 100  Line 100 
100        | LoadSeq of ty * string        | LoadSeq of ty * string
101        | LoadImage of ty * string        | LoadImage of ty * string
102        | Input of input        | Input of input
103          | InputWithDefault of input
104        | Print of tys        | Print of tys
105    
106      fun resultArity (Add _) = 1      fun resultArity (Add _) = 1
# Line 162  Line 163 
163        | resultArity (LoadSeq _) = 1        | resultArity (LoadSeq _) = 1
164        | resultArity (LoadImage _) = 1        | resultArity (LoadImage _) = 1
165        | resultArity (Input _) = 0        | resultArity (Input _) = 0
166          | resultArity (InputWithDefault _) = 0
167        | resultArity (Print _) = 0        | resultArity (Print _) = 0
168    
169      fun arity (Add _) = 2      fun arity (Add _) = 2
# Line 224  Line 226 
226        | arity (LoadSeq _) = 0        | arity (LoadSeq _) = 0
227        | arity (LoadImage _) = 0        | arity (LoadImage _) = 0
228        | arity (Input _) = 0        | arity (Input _) = 0
229          | arity (InputWithDefault _) = 1
230        | arity (Print _) = ~1        | arity (Print _) = ~1
231    
232      fun isPure (MkDynamic _) = false      fun isPure (MkDynamic _) = false
# Line 231  Line 234 
234        | isPure (Prepend _) = false        | isPure (Prepend _) = false
235        | isPure (Concat _) = false        | isPure (Concat _) = false
236        | isPure (Input _) = false        | isPure (Input _) = false
237          | isPure (InputWithDefault _) = false
238        | isPure (Print _) = false        | isPure (Print _) = false
239        | isPure _ = true        | isPure _ = true
240    
# Line 294  Line 298 
298        | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)        | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
299        | same (LoadImage(a0,a1), LoadImage(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)        | same (LoadImage(a0,a1), LoadImage(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
300        | same (Input(a0), Input(b0)) = sameinput(a0, b0)        | same (Input(a0), Input(b0)) = sameinput(a0, b0)
301          | same (InputWithDefault(a0), InputWithDefault(b0)) = sameinput(a0, b0)
302        | same (Print(a0), Print(b0)) = sametys(a0, b0)        | same (Print(a0), Print(b0)) = sametys(a0, b0)
303        | same _ = false        | same _ = false
304    
# Line 357  Line 362 
362        | hash (LoadSeq(a0,a1)) = 0w277 + hashty a0 + hashstring a1        | hash (LoadSeq(a0,a1)) = 0w277 + hashty a0 + hashstring a1
363        | hash (LoadImage(a0,a1)) = 0w281 + hashty a0 + hashstring a1        | hash (LoadImage(a0,a1)) = 0w281 + hashty a0 + hashstring a1
364        | hash (Input(a0)) = 0w283 + hashinput a0        | hash (Input(a0)) = 0w283 + hashinput a0
365        | hash (Print(a0)) = 0w293 + hashtys a0        | hash (InputWithDefault(a0)) = 0w293 + hashinput a0
366          | hash (Print(a0)) = 0w307 + hashtys a0
367    
368      fun toString (Add(a0)) = concat["Add<", tyToString a0, ">"]      fun toString (Add(a0)) = concat["Add<", tyToString a0, ">"]
369        | toString (Sub(a0)) = concat["Sub<", tyToString a0, ">"]        | toString (Sub(a0)) = concat["Sub<", tyToString a0, ">"]
# Line 419  Line 425 
425        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
426        | toString (LoadImage(a0,a1)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ">"]        | toString (LoadImage(a0,a1)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ">"]
427        | toString (Input(a0)) = concat["Input<", inputToString a0, ">"]        | toString (Input(a0)) = concat["Input<", inputToString a0, ">"]
428          | toString (InputWithDefault(a0)) = concat["InputWithDefault<", inputToString a0, ">"]
429        | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]        | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]
430    
431    end    end

Legend:
Removed from v.2796  
changed lines
  Added in v.2813

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