Changeset 881


Ignore:
Timestamp:
Jun 29, 2003, 5:33:31 AM (18 years ago)
Author:
orlov
Message:
  • Generation of FLAT-EQ is removed and generation of TERM-EQ is added.
Location:
to-imperative/trunk/compiler
Files:
5 edited

Legend:

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

    r794 r881  
    244244    <Expr-Ref-To-CPP e.expr1> '.eq ('
    245245      <Expr-Ref-To-CPP e.expr2> ', ' <Expr-Int-To-CPP e.pos> ')';
    246   (FLAT-EQ e.expr1 (e.expr2) (e.pos)) =
    247     <Expr-Ref-To-CPP e.expr1> '.flat_eq ('
     246  (TERM-EQ e.expr1 (e.expr2) (e.pos)) =
     247    <Expr-Ref-To-CPP e.expr1> '.term_eq ('
    248248      <Expr-Ref-To-CPP e.expr2> ', ' <Expr-Int-To-CPP e.pos> ')';
    249249  (NOT e.cond) =
  • to-imperative/trunk/compiler/rfp_clashes.rf

    r769 r881  
    273273      t.var-e2 ((t.var-e2) (s.dir e.Pe-rest));
    274274  } : t.var-e2 (e.clash),
    275   {
    276     <Flat? e.Re> = (Flat? True);;
    277   } :: e.flat?,
    278   <Set-Var (Instantiated? True) e.flat? t.var-e1>,
    279   <Set-Var (Instantiated? True) e.flat? t.var-e2>,
     275  <Set-Var (Instantiated? True) t.var-e1>,
     276  <Set-Var (Instantiated? True) t.var-e2>,
    280277  <Store &Clashes <Compose-Clashes e.clash> e.rest>,
    281278  <Get-Var Clashes t.var-e1> :: e.clashes,
  • to-imperative/trunk/compiler/rfp_compile.rf

    r794 r881  
    2525$use Dos;
    2626
    27 /*
    28  * Functions for distinguishing flat symbols from not flat.
    29  */
    30 $const Flat-Symbols = &Char?- &Int?-;
    3127
    3228/*
     
    7874
    7975$func Length-of e.Re = e.length;
    80 
    81 $func? Flat-Const? e.const = ;
    8276
    8377$func? Hard-Exp? e.expr = ;
     
    771765
    772766Comp-Assign-to-Var (t.var (e.Re)) =
    773   {
    774     <Flat? e.Re> = (Flat? True);;
    775   } :: e.flat?,
    776   <Set-Var (Instantiated? True) e.flat? t.var>,
     767  <Set-Var (Instantiated? True) t.var>,
    777768  {
    778769    t.var : e.Re = /*empty*/;
     
    12451236    } :: e.Re-term,
    12461237    {
    1247       <Flat? e.Re> =
    1248         { <Var? t.Pt> = <Set-Var (Flat? True) t.Pt>;; },
    1249         FLAT-EQ;
    1250       <Flat? t.Pt> =
    1251         { e.Re-term : term, <Var? term> = <Set-Var (Flat? True) term>;; },
    1252         FLAT-EQ;
     1238      e.len : 1 = TERM-EQ;      // FIXME: здесь надо использовать
     1239                  //        калькулятор
    12531240      EQ;
    12541241    } :: s.eq,
     
    12651252        };
    12661253      } :: el (er),
    1267         (IF ((NOT (s.eq el (er) (e.pos)))) e.fail) :: e.cond,
     1254        (IF ((NOT (s.eq el (er) (e.pos)))) e.fail) :: t.cond,
    12681255        {
    12691256          e.assigns : $r e1 (SUBEXPR t.Pt e.def) e2 =
    1270             <CC-Eqs (e.fail) (e1 (SUBEXPR t.Pt e.def) e.cond e2)>;
    1271           e.cond <CC-Eqs (e.fail) (e.assigns) e.rest>;
     1257            <CC-Eqs (e.fail) (e1 (SUBEXPR t.Pt e.def) t.cond e2) e.rest>;
     1258          t.cond <CC-Eqs (e.fail) (e.assigns) e.rest>;
    12721259        };
    12731260      <Set-Var (Instantiated? True) t.Pt>,
     
    18941881
    18951882
    1896 Flat? {
    1897   term e.rest =
    1898     \{
    1899       <Get-Var Flat? term> : True;
    1900       term : \{
    1901         (REF e) = term;
    1902         (STATIC e) = <Get-Static term>;
    1903       } :: e.Re,
    1904         <Flat-Const? e.Re>;
    1905     },
    1906     <Flat? e.rest>;
    1907   /*empty*/;
    1908 };
    1909 
    1910 Flat-Const? {
    1911   (PAREN e) e = $fail;
    1912   (REF t.name) e.rest, {
    1913     <Middle 3 0 <Lookup &Const t.name>> :: e.const =
    1914       <Flat-Const? e.const> <Flat-Const? e.rest>;
    1915     <Flat-Const? e.rest>;
    1916   };
    1917   s.ObjectSymbol e.rest =
    1918     &Flat-Symbols : e s.f e, <Apply s.f s.ObjectSymbol> : e =
    1919     <Flat-Const? e.rest>;
    1920   /*empty*/;
    1921 };
    1922 
    1923 
    1924 
    19251883/*
    19261884 * Ends good if lengths of all variables in the upper level of e.expr can be
  • to-imperative/trunk/compiler/rfp_compile.rfi

    r769 r881  
    2323
    2424
    25 $func? Flat? e.Re = ;
    26 
    27 
    28 
    2925$func? Lookup-Func t.Fname = s.linkage s.tag t.pragma (e.Fin) (e.Fout);
    3026
  • to-imperative/trunk/compiler/rfp_vars.rf

    r795 r881  
    128128    e.info;
    129129  } :: e.info,
    130   /*
    131    * s-переменные помечаем как плоские.
    132    */
    133 //  {
    134 //    t.var : (SVAR e) =
    135 //      {
    136 //        e.info : e (Flat? e) e = e.info;
    137 //        e.info (Flat? True);
    138 //      };
    139 //    e.info;
    140 //  } :: e.info,
    141130  <Put &State (t.var e.info)>;
    142131
Note: See TracChangeset for help on using the changeset viewer.