Lines Matching defs:D

90  * implies that using X we might only use A B but we could also use A B C D to
91 * resolve conflict. Input A B C D could predict alternative 1 in one position
436 * - add an edge from previous DFA state to potentially new DFA state, D,
482 $D = $this->getExistingTargetState($previousD, $t);
484 if ($D === null) {
485 $D = $this->computeTargetState($dfa, $previousD, $t);
488 if ($D === null) {
492 if ($D === self::error()) {
520 if ($D->requiresFullContext && $this->mode !== PredictionMode::SLL) {
523 $conflictingAlts = $D->configs->getConflictingAlts();
525 if ($D->predicates !== null) {
536 $conflictingAlts = $this->evalSemanticContextMany($D->predicates, $outerContext, true);
558 (string) $D
571 $D->configs,
576 return $this->execATNWithFullContext($dfa, $D, $s0_closure, $input, $startIndex, $outerContext);
579 if ($D->isAcceptState) {
580 if ($D->predicates === null) {
581 return $D->prediction;
586 $alts = $this->evalSemanticContextMany($D->predicates, $outerContext, true);
590 throw $this->noViableAlt($input, $outerContext, $D->configs, $startIndex);
598 $this->reportAmbiguity($dfa, $D, $startIndex, $stopIndex, false, $alts, $D->configs);
604 $previousD = $D;
660 $D = new DFAState($reach);
681 $D->isAcceptState = true;
682 $D->configs->uniqueAlt = $predictedAlt;
683 $D->prediction = $predictedAlt;
687 $D->configs->setConflictingAlts($this->getConflictingAlts($reach));
688 $D->requiresFullContext = true;
691 $D->isAcceptState = true;
693 $conflictingAlts = $D->configs->getConflictingAlts();
699 $D->prediction = $conflictingAlts->minValue();
702 if ($D->isAcceptState && $D->configs->hasSemanticContext) {
706 $this->predicateDFAState($D, $decisionState);
709 if ($D->predicates !== null) {
710 $D->prediction = ATN::INVALID_ALT_NUMBER;
714 // All adds to dfa are done after we've created full D state
715 $D = $this->addDFAEdge($dfa, $previousD, $t, $D);
717 return $D;
754 DFAState $D, // how far we got before failing over
885 $this->reportAmbiguity($dfa, $D, $startIndex, $input->getIndex(), $foundExactAmbig, null, $reach);
2369 * Add state `D` to the DFA if it is not already present, and return
2370 * the actual instance stored in the DFA. If a state equivalent to `D`
2372 * method returns `D` after adding it to the DFA.
2374 * If `D` is {@see ParserATNSimulator::error()}, this method returns
2378 * @param DFAState $D The DFA state to add
2381 * the existing state if `D` is already in the DFA, or `D`
2386 protected function addDFAState(DFA $dfa, DFAState $D) : DFAState
2388 if ($D === self::error()) {
2389 return $D;
2392 $existing = $dfa->states->get($D);
2398 $D->stateNumber = $dfa->states->count();
2400 if (!$D->configs->isReadOnly()) {
2401 $D->configs->optimizeConfigs($this);
2402 $D->configs->setReadonly(true);
2405 $dfa->states->add($D);
2408 $this->log[] = \sprintf('Adding new DFA state: %s', (string) $D);
2411 return $D;
2481 DFAState $D,