Code Generation/Example 1

From Wiki**3

< Code Generation
Revision as of 09:26, 9 May 2017 by Root (talk | contribs) (Postfix Code)

The Original Code

Consider the following C function: <c> int main() {

 int n = 45, i = 0, j = 1, *seg = &i;
 while (n-- > 0) {
   print(*seg = i + j);
   seg = (seg == &i) ? &j : &i;
 }
 return 0;

} </c>

Postfix Code

The Postfix code for the above function is as follows:

Postfix code
{{{2}}}