Changeset 2034 for to-imperative/trunk/compiler/rfp_as2as.rf
- Timestamp:
- Jul 27, 2006, 8:40:44 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
to-imperative/trunk/compiler/rfp_as2as.rf
r1706 r2034 8 8 $use "rfp_helper"; 9 9 $use "rfp_vars"; 10 $use "rfp_debug"; 10 11 11 12 $use Arithm Class List StdIO Table; … … 16 17 // transform { A; } : Pe into { A; } :: aux, aux : Pe 17 18 $func Unstick-Blocks e.Sentence = e.Sentence (e.Fe); 19 20 // remove blocks from Re 21 $func Flatten-Result s.N (e.Re) e.items = e.assigns s.N (e.Re); 18 22 19 23 $func Generate-In-Vars (e.in) e.branch = (e.in) e.branch; … … 50 54 }, 51 55 t.item : (s.link s.tag t.pragma t.name (e.in) (e.out) (BRANCH t.p e.branch)) = 52 <Unstick-Blocks e.branch> :: e.branch t,53 56 { 54 57 <Format-Exp e.in> : e.in = … … 56 59 (e.in) e.branch; 57 60 } :: (e.in) e.branch, 61 { 62 <In-Table? &RFP-Options DBG> = 63 <Add-Debug (RESULT t.p e.in) e.branch>; 64 e.branch; 65 } :: e.branch, 66 <Unstick-Blocks e.branch> :: e.branch t, 58 67 <Rename-Vars 0 (<Vars e.in>) () e.branch> :: e.branch, 59 68 (s.link s.tag t.pragma t.name (e.in) (e.out) (BRANCH t.p e.branch)); … … 92 101 } = 93 102 <Gener-Var-Indices 1 (<MSG e.Fes>) "aux" "block"> :: e.aux s, 94 eL (s.block t.Pragma e.br) (FORMAT e.aux)95 (RESULT e.aux) <Unstick-Blocks eR>;103 eL (s.block t.Pragma e.br) (FORMAT (PRAGMA) e.aux) 104 (RESULT (PRAGMA) e.aux) <Unstick-Blocks eR>; 96 105 eR : /*empty*/ = 97 106 eL (s.block t.Pragma e.br) (<MSG e.Fes>); 98 107 eL (s.block t.Pragma e.br) <Unstick-Blocks eR>; 99 108 }; 100 (RESULT t.Pragma e.Re) = 101 eL (RESULT t.Pragma e.Re) (<Format-Exp e.Re>); 109 (RESULT t.Pragma e.Re) eR = 110 <Flatten-Result 1 () e.Re> :: e.assigns s (e.Re), 111 { 112 eR : v = 113 eL e.assigns (RESULT t.Pragma e.Re) <Unstick-Blocks eR>; 114 eL e.assigns (RESULT t.Pragma e.Re) (<Format-Exp e.Re>); 115 }; 102 116 (ITER (BRANCH t.p1 e.body) t.IterVars (BRANCH t.p2 e.condition)) = 103 117 <Unstick-Blocks e.body> :: e.body t, … … 113 127 eL (ERROR t.Pragma) eR (FAIL); 114 128 }; 129 130 Flatten-Result s.N (e.Re) e.items, e.items : { 131 t1 e.rest, t1 : \{ (BLOCK e); (BLOCK? e); } = 132 <Gener-Var-Indices s.N (<Format-Exp e.Re>) "aux" "result"> :: e.aux1 s.N, 133 <Unstick-Blocks t1> :: e1 (e.Format), 134 <Gener-Var-Indices s.N (e.Format) "aux" "block"> :: e.aux2 s.N, 135 (RESULT (PRAGMA) e.Re) (FORMAT (PRAGMA) e.aux1) 136 e1 (FORMAT (PRAGMA) e.aux2) 137 <Flatten-Result s.N (e.aux1 e.aux2) e.rest>; 138 (PAREN e.r) e.rest = 139 <Flatten-Result s.N () e.r> :: e.assigns s.N (e.r), 140 e.assigns <Flatten-Result s.N (e.Re (PAREN e.r)) e.rest>; 141 (CALL t.p t.name e.r) e.rest = 142 <Flatten-Result s.N () e.r> :: e.assigns s.N (e.r), 143 e.assigns <Flatten-Result s.N (e.Re (CALL t.p t.name e.r)) e.rest>; 144 t1 e.rest = <Flatten-Result s.N (e.Re t1) e.rest>; 145 /*empty*/ = s.N (e.Re); 146 }; 147 115 148 116 149 /* … … 301 334 302 335 303 /////////////////////////// Vari bles Using Analysis /////////////////////////336 /////////////////////////// Variables Using Analysis ///////////////////////// 304 337 // 305 338 //$func Post-Comp (e.used-vars) e.comp-func = (e.used-vars) e.result-func;
Note: See TracChangeset
for help on using the changeset viewer.