private void normalizeBlocks ( Node n ) { if ( NodeUtil . isControlStructure ( n ) && ! n . isLabel ( ) && ! n . isSwitch ( ) ) { for ( Node c = n . getFirstChild ( ) ; c != null ; c = c . getNext ( ) ) { if ( NodeUtil . isControlStructureCodeBlock ( n , c ) && ! c . isBlock ( ) ) { Node newBlock = IR . block ( ) . srcref ( n ) ; n . replaceChild ( c , newBlock ) ; newBlock . setIsAddedBlock ( true ) ; if ( ! c . isEmpty ( ) ) { newBlock . addChildrenToFront ( c ) ; } c = newBlock ; reportChange ( ) ; } } } }
Add blocks to IF WHILE DO etc .