Lines Matching full:if

62         if ($empty === null) {
73 * Return {@see PredictionContext::empty()} if `outerContext` is empty or null.
77 if ($outerContext === null) {
81 // If we are in RuleContext of start rule, s, then PredictionContext
82 // is EMPTY. Nobody called us. (if we are empty, return empty)
83 if ($outerContext->getParent() === null || $outerContext === RuleContext::emptyContext()) {
87 // If we have a parent, convert it to a PredictionContext graph
92 if (!$transition instanceof RuleTransition) {
115 if ($this->cachedHashCode === null) {
134 // share same graph if both same
135 if ($a->equals($b)) {
139 if ($a instanceof SingletonPredictionContext && $b instanceof SingletonPredictionContext) {
144 // If one is $ and rootIsWildcard, return $ as * wildcard
145 if ($rootIsWildcard) {
146 if ($a instanceof EmptyPredictionContext) {
150 if ($b instanceof EmptyPredictionContext) {
156 if ($a instanceof SingletonPredictionContext) {
160 if ($b instanceof SingletonPredictionContext) {
164 if (!$a instanceof ArrayPredictionContext || !$b instanceof ArrayPredictionContext) {
190 * @param bool $rootIsWildcard `true` if this is a local-context merge,
199 if ($mergeCache !== null) {
202 if ($previous !== null) {
208 if ($previous !== null) {
215 if ($rootMerge !== null) {
216 if ($mergeCache !== null) {
223 if ($a->returnState === $b->returnState) {
224 if ($a->parent === null || $b->parent === null) {
230 // If parent is same as existing a or b parent or reduced to a parent, return it
231 if ($parent === $a->parent) {
232 return $a; // ax + bx = ax, if a=b
235 if ($parent === $b->parent) {
236 return $b; // ax + bx = bx, if a=b
246 if ($mergeCache !== null) {
252 // see if we can collapse parents due to $+x parents if local ctx
255 if ($a === $b || ($a->parent !== null && $a->parent === $b->parent)) {
262 if ($singleParent !== null) {
267 if ($a->returnState > $b->returnState) {
275 if ($mergeCache !== null) {
288 if ($a->returnState > $b->returnState) {
297 if ($mergeCache !== null) {
325 * Special case of last merge if local context.
346 if ($rootIsWildcard) {
347 if ($a === self::empty()) {
351 if ($b === self::empty()) {
355 if ($a === self::empty() && $b === self::empty()) {
359 if ($a === self::empty()) {
367 if ($b === self::empty()) {
368 // x + $ = [$,x] ($ is always first if present)
409 if ($mergeCache !== null) {
412 if ($previous !== null) {
418 if ($previous !== null) {
436 if ($a->returnStates[$i] === $b->returnStates[$j]) {
446 if ($bothDollars || $ax_ax) {
450 if ($a_parent === null || $b_parent === null) {
478 if ($i < \count($a->returnStates)) {
492 // trim merged if we combined a few that had same stack tops
493 if ($k < \count($mergedParents)) {
495 if ($k === 1) {
499 if ($mergeCache !== null) {
514 // if we created same array as a or b, return that instead
516 if ($M === $a) {
517 if ($mergeCache !== null) {
524 if ($M === $b) {
525 if ($mergeCache !== null) {
532 if ($mergeCache !== null) {
547 if (!$uniqueParents->contains($parent)) {
565 if ($context->isEmpty()) {
571 if ($existing !== null) {
577 if ($existing !== null) {
588 if ($parentContext === null) {
594 if ($changed || ($parentContext !== null && !$parent->equals($parentContext))) {
595 if (!$changed) {
609 if (!$changed) {
619 if (\count($parents) === 0) {
624 if (!$context instanceof ArrayPredictionContext) {