next up previous
Next: The C-Breeze Class Hierarchy Up: The MIR Format Previous: Details of the MIR


Tree Traversal of MIR Code

This section describes how to traverse MIR code.

Traversal of conditiongotoNode: Since conditiongotoNode inherits from gotoNode, unless a traverser (Visitor, Walker, or Changer) defines an at_conditiongoto() method, the traverser's at_goto() method will be invoked on the conditiongotoNode. In addition to traversing the conditiongotoNode, Walkers and Changers will traverse the indexNodes on the left and right of the conditional expression (the left() and right() fields).

Traversal of operandNode: Unless a traverser defines an at_operand() method, the traverser's at_expr() method will be invoked. Walkers and Changers will traverse the indexNode for the var() field, the idNodes in the id_list in the fields() field, and the indexNode in the index() field.

Traversal of threeAddrNode: By default, traversing a threeAddrNode will invoke at_stmt() if a traverser does not define an at_threeAddr() method. Traversing the threeAddrNode will also traverse the operandNodes in the lhs(), rhs1(), and rhs2() fields, assuming that the field is non-NULL, the typeNode in the sizeof_type() field, when the operator is a sizeof, and the operandNodes in the operand_list in the arg_list field, when the operator is a FUNC_CALL.


next up previous
Next: The C-Breeze Class Hierarchy Up: The MIR Format Previous: Details of the MIR
Adam C. Brown 2006-01-26