#NEWLINE# def getMergedTree( self , bindlist ) : #NEWLINE# #INDENT# concatlist = [ ] #NEWLINE# last_msb = ( - 1 ) #NEWLINE# last_ptr = ( - 1 ) #NEWLINE# def bindkey( x ) : #NEWLINE# #INDENT# lsb = ( 0 if ( x . lsb is None ) else x . lsb . value ) #NEWLINE# ptr = ( 0 if ( not isinstance ( x . ptr , DFEvalValue ) ) else x . ptr . value ) #NEWLINE# term = self . getTerm ( x . dest ) #NEWLINE# length = ( abs ( ( self . optimize ( term . msb ) . value - self . optimize ( term . lsb ) . value ) ) + 1 ) #NEWLINE# return ( ( ptr * length ) + lsb ) #NEWLINE# #UNINDENT# for bind in sorted ( bindlist , key = bindkey ) : #NEWLINE# #INDENT# lsb = ( 0 if ( bind . lsb is None ) else bind . lsb . value ) #NEWLINE# if ( last_ptr != ( ( - 1 ) if ( not isinstance ( bind . ptr , DFEvalValue ) ) else bind . ptr . value ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( ( last_msb + 1 ) < lsb ) : #NEWLINE# #INDENT# concatlist . append ( DFUndefined ( ( ( last_msb - lsb ) - 1 ) ) ) #NEWLINE# #UNINDENT# concatlist . append ( bind . tree ) #NEWLINE# last_msb = ( ( - 1 ) if ( bind . msb is None ) else bind . msb . value ) #NEWLINE# last_ptr = ( ( - 1 ) if ( not isinstance ( bind . ptr , DFEvalValue ) ) else bind . ptr . value ) #NEWLINE# #UNINDENT# return DFConcat ( tuple ( reversed ( concatlist ) ) )