next up previous
Next: Hardware platform Up: The MIR Level Previous: The MIR Level


AST input

The code that the dismantler accepts as input must be a tree, and not a more general graph. If the input code is not a tree, the output of the dismantler is not guaranteed to be correct, reasonable, or meaningful. Two practices will ensure that the code the dismantler receives is a tree. First, use the dismantler as the first phase after parsing the input file. Second, use the ref_clone_changer::clone() method whenever you are assigning a node subclass pointer from a field in one object to a field in another object.

The dismantler also assumes that it may destructively change any Node in the input AST for use in the output AST. This assumption seriously affects what assumptions code using the dismantler can make both before and after using the dismantler. For example, any code which relies on a particular instance of Node being the same before and after dismantling is likely to have untold problems.



Adam C. Brown 2006-01-26