#NEWLINE# def transform_ForLoop( self , stmt ) : #NEWLINE# #INDENT# merge = self . enter_loop ( stmt . merge ) #NEWLINE# stmt . body = self . transform_block ( stmt . body ) #NEWLINE# stmt . merge = self . transform_merge ( merge , left_block = self . blocks . current ( ) , right_block = stmt . body ) #NEWLINE# stmt . start = self . transform_simple_expr ( stmt . start , 'start' ) #NEWLINE# stmt . stop = self . transform_simple_expr ( stmt . stop , 'stop' ) #NEWLINE# if self . is_none ( stmt . step ) : #NEWLINE# #INDENT# stmt . step = one ( stmt . start . type ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# stmt . step = self . transform_simple_expr ( stmt . step , 'step' ) #NEWLINE# #UNINDENT# if ( ( stmt . start . __class__ is Const ) and ( stmt . stop . __class__ is Const ) and ( stmt . step . __class__ is Const ) ) : #NEWLINE# #INDENT# if ( stmt . start . value >= stmt . stop . value ) : #NEWLINE# #INDENT# for ( var_name , ( input_value , _ ) ) in stmt . merge . iteritems ( ) : #NEWLINE# #INDENT# var = Var ( var_name , input_value . type ) #NEWLINE# self . blocks . append ( Assign ( var , input_value ) ) #NEWLINE# #UNINDENT# return None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( stmt . start . value + stmt . step . value ) >= stmt . stop . value ) : #NEWLINE# #INDENT# for ( var_name , ( input_value , _ ) ) in stmt . merge . iteritems ( ) : #NEWLINE# #INDENT# var = Var ( var_name , input_value . type ) #NEWLINE# self . blocks . append ( Assign ( var , input_value ) ) #NEWLINE# #UNINDENT# self . assign ( stmt . var , stmt . start ) #NEWLINE# self . blocks . top ( ) . extend ( stmt . body ) #NEWLINE# return None #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return stmt