Changeset 2345


Ignore:
Timestamp:
Feb 7, 2007, 1:42:43 AM (14 years ago)
Author:
yura
Message:
  • Advances in Java-bytecode generation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/compiler/rfp_asail_jbc.rf

    r2344 r2345  
    199199
    200200Func-To-JBC s.mv e.func-body, {
    201   e.func-body : e t.item e, <WriteLN> <WriteLN t.item>, t.item : {
     201  e.func-body : e t.item e, t.item : {
    202202    (DECL s.type t.var) =
    203203      <Bind-Var s.type t.var> :: s.i,
     
    229229    (FOR (e.cont-label) (e.break-label) (e.cond) (e.step) e.body) =
    230230      {
    231         e.cont-label : t = <Rfp2Java (LABEL e.cont-label)> ': ';;
    232       } :: e.cont,
    233       {
    234         e.break-label : t = <Rfp2Java (LABEL e.break-label)> ': ';;
    235       } :: e.break,
    236       <Box> :: s.acc,
    237       <Cond-To-JBC s.acc e.cond> :: e.cond,
    238       {
    239         e.step : (s.d e.var), s.d : \{ INC-ITER; DEC-ITER; } =
    240           <Lookup &Iter-Vars e.var> : e.new-var t.var1 t.var2,
    241           ('Expr '<Rfp2Java t.var1>' = 'e.new-var'.getLeft();')
    242           ('Expr '<Rfp2Java t.var2>' = 'e.new-var'.getRight();');;
    243       } :: e.split-vars,
    244       <? s.acc>
    245       (e.break e.cont 'for ( ; 'e.cond'; '<Step-To-JBC e.step>')')
    246       ('{' (
    247         e.split-vars <? &Res-Assigns> <Store &Res-Assigns /*empty*/>
    248         <ASAIL-To-JBC e.body>
    249       ) '}') : e;
     231        e.cont-label : t.label = <Bind-Label t.label>;
     232        <Label>;
     233      } :: s.cont-label,
     234      {
     235        e.break-label : t.label = <Bind-Label t.label>;
     236        <Label>;
     237      } :: s.break-label,
     238      <Label> :: s.for-label,
     239      <MVvisitLabel s.mv s.for-label>,
     240      //<Cond-To-JBC s.acc e.cond> : e,
     241      <MVvisitJumpInsn s.mv &IFEQ s.break-label>,
     242      //<ASAIL-To-JBC e.body> : e,
     243      <MVvisitLabel s.mv s.cont-label>,
     244      //<Step-To-JBC e.step> : e,
     245      <MVvisitJumpInsn s.mv &GOTO s.for-label>,
     246      <MVvisitLabel s.mv s.break-label>;
    250247    (LABEL (t.label) e.body) =
    251248      <Bind-Label t.label> :: s.l,
Note: See TracChangeset for help on using the changeset viewer.