PredictionContext.mergeSingletons

@uml Merge two {@link SingletonPredictionContext} instances.

<p>Stack tops equal, parents merge is same; return left graph.<br> <embed src="images/SingletonMerge_SameRootSamePar.svg" type="image/svg+xml"/></p>

<p>Same stack top, parents differ; merge parents giving array node, then remainders of those graphs. A new root node is created to point to the merged parents.<br> <embed src="images/SingletonMerge_SameRootDiffPar.svg" type="image/svg+xml"/></p>

<p>Different stack tops pointing to same parent. Make array node for the root where both element in the root point to the same (original) parent.<br> <embed src="images/SingletonMerge_DiffRootSamePar.svg" type="image/svg+xml"/></p>

<p>Different stack tops pointing to different parents. Make array node for the root where each element points to the corresponding original parent.<br> <embed src="images/SingletonMerge_DiffRootDiffPar.svg" type="image/svg+xml"/></p>

@param a the first {@link SingletonPredictionContext} @param b the second {@link SingletonPredictionContext} @param rootIsWildcard {@code true} if this is a local-context merge, otherwise false to indicate a full-context merge @param mergeCache

Meta