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

SCM Repository

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

Diff of /branches/pure-cfg/src/compiler/mid-il/mid-il.sml

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

revision 1622, Fri Nov 11 20:07:50 2011 UTC revision 1623, Fri Nov 11 21:58:50 2011 UTC
# Line 79  Line 79 
79        | Inside of ImageInfo.info * int        | Inside of ImageInfo.info * int
80        | Input of ty * string * string        | Input of ty * string * string
81        | InputWithDefault of ty * string * string        | InputWithDefault of ty * string * string
82          | ToString of ty
83          | Print of int
84    
85      fun resultArity (Add _) = 1      fun resultArity (Add _) = 1
86        | resultArity (Sub _) = 1        | resultArity (Sub _) = 1
# Line 131  Line 133 
133        | resultArity (Inside _) = 1        | resultArity (Inside _) = 1
134        | resultArity (Input _) = 1        | resultArity (Input _) = 1
135        | resultArity (InputWithDefault _) = 1        | resultArity (InputWithDefault _) = 1
136          | resultArity (ToString _) = 1
137          | resultArity (Print _) = 0
138    
139      fun arity (Add _) = 2      fun arity (Add _) = 2
140        | arity (Sub _) = 2        | arity (Sub _) = 2
# Line 183  Line 187 
187        | arity (Inside _) = 2        | arity (Inside _) = 2
188        | arity (Input _) = 0        | arity (Input _) = 0
189        | arity (InputWithDefault _) = 1        | arity (InputWithDefault _) = 1
190          | arity (ToString _) = 1
191          | arity (Print _) = ~1
192    
193      fun same (Add(a0), Add(b0)) = samety(a0, b0)      fun same (Add(a0), Add(b0)) = samety(a0, b0)
194        | same (Sub(a0), Sub(b0)) = samety(a0, b0)        | same (Sub(a0), Sub(b0)) = samety(a0, b0)
# Line 235  Line 241 
241        | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)        | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
242        | same (Input(a0,a1,a2), Input(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)        | same (Input(a0,a1,a2), Input(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)
243        | same (InputWithDefault(a0,a1,a2), InputWithDefault(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)        | same (InputWithDefault(a0,a1,a2), InputWithDefault(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)
244          | same (ToString(a0), ToString(b0)) = samety(a0, b0)
245          | same (Print(a0), Print(b0)) = sameint(a0, b0)
246        | same _ = false        | same _ = false
247    
248      fun hash (Add(a0)) = 0w3 + hashty a0      fun hash (Add(a0)) = 0w3 + hashty a0
# Line 288  Line 296 
296        | hash (Inside(a0,a1)) = 0w229 + ImageInfo.hash a0 + hashint a1        | hash (Inside(a0,a1)) = 0w229 + ImageInfo.hash a0 + hashint a1
297        | hash (Input(a0,a1,a2)) = 0w233 + hashty a0 + hashstring a1 + hashstring a2        | hash (Input(a0,a1,a2)) = 0w233 + hashty a0 + hashstring a1 + hashstring a2
298        | hash (InputWithDefault(a0,a1,a2)) = 0w239 + hashty a0 + hashstring a1 + hashstring a2        | hash (InputWithDefault(a0,a1,a2)) = 0w239 + hashty a0 + hashstring a1 + hashstring a2
299          | hash (ToString(a0)) = 0w241 + hashty a0
300          | hash (Print(a0)) = 0w251 + hashint a0
301    
302      fun toString (Add(a0)) = concat["Add<", tyToString a0, ">"]      fun toString (Add(a0)) = concat["Add<", tyToString a0, ">"]
303        | toString (Sub(a0)) = concat["Sub<", tyToString a0, ">"]        | toString (Sub(a0)) = concat["Sub<", tyToString a0, ">"]
# Line 340  Line 350 
350        | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
351        | toString (Input(a0,a1,a2)) = concat["Input<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]        | toString (Input(a0,a1,a2)) = concat["Input<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]
352        | toString (InputWithDefault(a0,a1,a2)) = concat["InputWithDefault<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]        | toString (InputWithDefault(a0,a1,a2)) = concat["InputWithDefault<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]
353          | toString (ToString(a0)) = concat["ToString<", tyToString a0, ">"]
354          | toString (Print(a0)) = concat["Print<", intToString a0, ">"]
355    
356    end    end
357    

Legend:
Removed from v.1622  
changed lines
  Added in v.1623

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