Changeset 2381
 Timestamp:
 Feb 11, 2007, 3:12:23 AM (14 years ago)
 Location:
 toimperative/trunk/compiler
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

toimperative/trunk/compiler/rfp_as2as.rf
r2304 r2381 321 321 <RenameVars s.num (e.uppervars) (e.resvars) t.Catch> :: e.Catch, 322 322 () (e.newSnt (TRY e.TryBranch e.NOFAIL e.Catch)); 323 t.Statement : (NOT t.branch) = 324 (e.vars) (e.newSnt (NOT <RenameVars s.num (e.vars) (e.resvars) t.branch>)) e.rest; 323 325 /* 324 326 * Else proceed with the rest. 
toimperative/trunk/compiler/rfp_asail2asail.rf
r2350 r2381 1 1 // $Id$ 2 2 3 $use A rithm BoxList StdIO Table;3 $use Apply Arithm Box Class Compare List StdIO Table; 4 4 $use "rfp_helper"; 5 5 6 6 $func SimplifyInfix t.asailterm = t.asailterm; 7 7 $func SimplifyArithm e = e; 8 9 $func? SimplifyCmp s.op (expr1) (expr2) = e; 8 10 9 11 $func Simplify e.asail = e.asail; … … 26 28 Simplify { 27 29 t.first e.rest, t.first : { 28 (IFINTCMP s.op (e.arg1) (e.arg2) e.body) = 29 (IFINTCMP s.op (<SimplifyArithm (e.arg1)>) (<SimplifyArithm (e.arg2)>) 30 <Simplify e.body>); 30 (IFINTCMP s.op (e.arg1) (e.arg2) e.body) = { 31 <SimplifyCmp s.op (<SimplifyArithm (e.arg1)>) (<SimplifyArithm (e.arg2)>)> : { 32 (e1) (e2) = (IFINTCMP s.op (e1) (e2) <Simplify e.body>); 33 /*empty*/ = <Simplify e.body>; 34 };; 35 }; 31 36 (IF t.cond e.body) = (IF t.cond <Simplify e.body>); 32 37 (INT t.var e.expr) = (INT t.var <SimplifyArithm (e.expr)>); … … 237 242 }; 238 243 244 $func? Cmp s.fn (expr1) (expr2) = e; 245 246 SimplifyCmp s.op (expr1) (expr2) = 247 s.op : { "!=" = &"/="; ">" = &">"; "<" = &"<"; } :: s.op, 248 <Cmp s.op (expr1) (expr2)>; 249 250 Cmp { 251 s.fn (e11 tx e12) (e21 tx e22) = 252 <Cmp s.fn (e11 e12) (e21 e22)>; 253 s.fn (e1) (e2), <All &Int? (e1)>, <All &Int? (e2)> = 254 <Apply s.fn (<Foldr1 &"+" (e1)>) (<Foldr1 &"+" (e2)>)>; 255 s.fn (e1) (e2) = (e1) (e2); 256 }; 257 239 258 240 259 FreeIdx =
Note: See TracChangeset
for help on using the changeset viewer.