CSC448: Phases: Eliminate High Level Control [6/8] Previous pageContentsNext page

case StatIf:

        if (exp) statT else statF
    -->
        if (exp)
          goto l1;
        else
          goto l2;
      l1:
        skip;
        statT
        goto l3;
      l2:
        skip;
        statF
        goto l3;
      l3:
        skip

case StatWhile:

        while (exp) stat
    -->
        goto l2;
      l1:
        skip;
        stat
      l2:
        if (exp)
          goto l1
        else
          goto l3;
      l3:
        skip;

Previous pageContentsNext page