Integer addition is a commutative operation, so the instructions involving constant operands can be used regardless of which operand is constant. The code selector must perform a distinct action in each of the five possible situations resulting from these conditions. Here the first rule specifies that one possible situation is to compute a value into an integer register by adding the contents of two integer registers. Two situations are specified by the second rule. In one the left operand is in an integer register and the right operand is an integer constant, and in the other the operands are reversed.
Actions are arbitrary functions.
They may or may not have results, and may or may not have side effects. The effect of the whole process is nothing more than the sum total of the effects of the actions. To get the specified actions executed, the user must first call functions that are generated from the set of rules. Action routines are invoked as a side effect of the parse.