protected static XMemberFeatureCall getRootOfMemberFeatureCallSequence ( EObject leaf , EObject container , Procedure1 < XMemberFeatureCall > feedback ) { EObject call = leaf ; EObject obj = EcoreUtil2 . getContainerOfType ( leaf . eContainer ( ) , XExpression . class ) ; while ( obj != null && ( container == null || obj != container ) ) { if ( ! ( obj instanceof XMemberFeatureCall ) ) { obj = null ; } else { final EObject previous = call ; final XMemberFeatureCall fcall = ( XMemberFeatureCall ) obj ; call = fcall ; if ( fcall . getActualReceiver ( ) == previous ) { // Sequence of calls, with the '.' char. if ( feedback != null ) { feedback . apply ( fcall ) ; } obj = EcoreUtil2 . getContainerOfType ( call . eContainer ( ) , XExpression . class ) ; } else if ( fcall . getActualArguments ( ) . contains ( previous ) ) { // The sequence is an argument of a function call. call = previous ; obj = null ; } else { obj = null ; } } } return call instanceof XMemberFeatureCall ? ( XMemberFeatureCall ) call : null ; }
Replies the member feature call that is the root of a sequence of member feature calls .