Go to the previous, next section.

Conditionals

Conditional control flow can be generated using the builder's IF() function. The first argument to this function is the test and the second argument is the body of code that should be executed when the test is TRUE. The optional third argument is the body of code that should be executed when the test is FALSE. The builder's IF() function gets translated to a SUIF IF macro instruction.

For example, the following C conditional:

        if(i<0)
           i = -1*i;

can be created by the following builder structure:

        var_sym * iSym = the variable i 
        block i(iSym);
        block code(block::IF(block(i < block(0)),
                             block(i = block(-1)*i)));

Go to the previous, next section.