protected List < ICompositeNode > internalFindValidReplaceRootNodeForChangeRegion ( List < ICompositeNode > nodesEnclosingRegion ) { List < ICompositeNode > result = new ArrayList < ICompositeNode > ( ) ; boolean mustSkipNext = false ; for ( int i = 0 ; i < nodesEnclosingRegion . size ( ) ; i ++ ) { ICompositeNode node = nodesEnclosingRegion . get ( i ) ; if ( node . getGrammarElement ( ) != null ) { if ( ! mustSkipNext ) { result . add ( node ) ; if ( isActionNode ( node ) ) { mustSkipNext = true ; } } else { mustSkipNext = isActionNode ( node ) ; } } } return result ; }
Investigates the composite nodes containing the changed region and collects a list of nodes which could possibly replaced by a partial parse . Such a node has a parent that consumes all his current lookahead tokens and all of these tokens are located before the changed region .