[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

smalltalk translator crutch



'edt-b.st' adds a bit of crutch to the translator.  In desperation I
simplified the transformation for && and || dramatically.  The new
transformation requires only a single variable for any condition
expression, and can be implemented with a cute recursive algorithm.

dean

PS.  The transformation for the curious:

if (A) X;

becomes: 

{  Bool flag;

   flag = A;
   if (flag) X;
}

-----

  flag = A && B;

becomes:

  flag = A;
  if (flag) {
    flag = B;
  }

-----

  flag = A || B;

becomes:

  flag = A;
  if (!flag) {
    flag = B;
  }

-----

  flag = !A;

becomes:

  flag = A;
  flag = !flag;

-----


dean