Lines Matching defs:t

58  * don't know if it's an ambiguity or a weakness in the strong LL(*) parsing
66 * don't get a conflict, it implies that the decision is sensitive to the outer
72 * This is slow because we can't save the results and have to "interpret" the
78 * that saves a lot of time but doesn't work in presence of predicates. The set
139 * closure, the DFA state configuration sets would be different and we couldn't
183 * `s.edge[t]` get the same physical target {@see DFAState}, or `null`. Once
187 * `dfa.edges[t]` null, or `dfa.edges[t]` to be non-null. The
190 * simulation. It could also race trying to get `dfa.edges[t]`, but either
267 * Don't keep around as it wastes huge amounts of memory. DoubleKeyMap
268 * isn't synchronized but we're ok since two threads shouldn't reuse same
479 $t = $input->LA(1);
482 $D = $this->getExistingTargetState($previousD, $t);
485 $D = $this->computeTargetState($dfa, $previousD, $t);
494 * means that input up to t actually finished entry rule
495 * at least for SLL decision. Full LL doesn't dip into outer
496 * so don't need special case.
606 if ($t !== IntStream::EOF) {
608 $t = $input->LA(1);
619 * @param int $t The next input symbol
622 * symbol `t`, or `null` if the target state for
625 public function getExistingTargetState(DFAState $previousD, int $t) : ?DFAState
629 if ($edges === null || $t + 1 < 0 || $t + 1 >= $edges->count()) {
633 return $edges[$t + 1];
642 * @param int $t The next input symbol
645 * symbol `t`. If `t` does not lead to a valid DFA
649 public function computeTargetState(DFA $dfa, DFAState $previousD, int $t) : ?DFAState
651 $reach = $this->computeReachSet($previousD->configs, $t, false);
654 $this->addDFAEdge($dfa, $previousD, $t, self::error());
715 $D = $this->addDFAEdge($dfa, $previousD, $t, $D);
769 $t = $input->LA(1);
773 $reach = $this->computeReachSet($previous, $t, $fullCtx);
777 * means that input up to t actually finished entry rule
778 * at least for LL decision. Full LL doesn't dip into outer
779 * so don't need special case.
843 if ($t !== IntStream::EOF) {
845 $t = $input->LA(1);
881 * the fact that we should predict alternative 1. We just can't say for
890 protected function computeReachSet(ATNConfigSet $closure, int $t, bool $fullCtx) : ?ATNConfigSet
915 // First figure out where we can reach on input t
918 $this->log[] = \sprintf('Testing %s at %s', $this->getTokenName($t), (string) $c);
926 if ($fullCtx || $t === IntStream::EOF) {
942 $target = $this->getReachableTarget($trans, $t);
968 if ($skippedStopStates === null && $t !== Token::EOF) {
970 // Don't pursue the closure if there is just one state.
972 // Also don't pursue the closure if there is unique alternative
977 // Also don't pursue the closure if there is unique alternative among the configurations.
987 $treatEofAsEpsilon = $t === Token::EOF;
994 if ($t === IntStream::EOF) {
1099 foreach ($p->getTransitions() as $i => $t) {
1100 $c = new ATNConfig(null, $t->target, $initialContext, null, $i + 1);
1110 * parrt internal source braindump that doesn't mess up external API spec.
1190 * an expr[0] call. then just don't filter any config with that flag set.
1730 foreach ($p->getTransitions() as $i => $t) {
1735 $continueCollecting = $collectPredicates && !$t instanceof ActionTransition;
1736 $c = $this->getEpsilonTarget($config, $t, $continueCollecting, $depth === 0, $fullCtx, $treatEofAsEpsilon);
1747 // We can't get here if incoming config was rule stop and we had context
1753 if ($t instanceof EpsilonTransition
1755 && $t->getOutermostPrecedenceReturn() === $this->dfa->atnStartState->ruleIndex) {
1776 if (!$t->isEpsilon() && !$closureBusy->add($c)) {
1782 if ($t instanceof RuleTransition) {
1783 // latch when newDepth goes negative - once we step out of the entry context we can't return
1815 * epsilon w/o exiting rule. We don't have to look at FOLLOW
1881 * How do we know this optimization doesn't mess up precedence in
1886 * of an expression. The precedence actually doesn't matter when
1900 * global FOLLOW so we can't perform optimization
1962 // which points to p but we don't need to check that
1982 // anything else ain't conforming
2000 Transition $t,
2006 switch ($t->getSerializationType()) {
2008 if (!$t instanceof RuleTransition) {
2012 return $this->ruleTransition($config, $t);
2015 if (!$t instanceof PrecedencePredicateTransition) {
2019 return $this->precedenceTransition($config, $t, $collectPredicates, $inContext, $fullCtx);
2022 if (!$t instanceof PredicateTransition) {
2026 return $this->predTransition($config, $t, $collectPredicates, $inContext, $fullCtx);
2029 if (!$t instanceof ActionTransition) {
2033 return $this->actionTransition($config, $t);
2036 return new ATNConfig($config, $t->target);
2044 if ($t->matches(Token::EOF, 0, 1)) {
2045 return new ATNConfig($config, $t->target);
2056 protected function actionTransition(ATNConfig $config, ActionTransition $t) : ATNConfig
2059 $this->log[] = \sprintf('ACTION edge %d:%d', $t->ruleIndex, $t->actionIndex);
2062 return new ATNConfig($config, $t->target);
2184 protected function ruleTransition(ATNConfig $config, RuleTransition $t) : ATNConfig
2189 $this->getRuleName($t->target->ruleIndex),
2194 $returnState = $t->followState;
2197 return new ATNConfig($config, $t->target, $newContext);
2232 we don't consider any conflicts that include alternative 2. So, we
2250 looking for input reasonably, I don't declare the state done. We
2267 public function getTokenName(int $t) : string
2269 if ($t === Token::EOF) {
2274 $displayName = $vocabulary->getDisplayName($t);
2276 if ($displayName === (string) $t) {
2280 return \sprintf('%s<%d>', $displayName, $t);
2322 * present in the DFA. If `from` is `null`, or if `t` is outside the
2332 * @param int $t The input symbol
2339 protected function addDFAEdge(DFA $dfa, ?DFAState $from, int $t, ?DFAState $to) : ?DFAState
2342 $this->log[] = \sprintf('EDGE %s -> %s upon %s', (string) $from, (string) $to, $this->getTokenName($t));
2351 if ($from === null || $t < -1 || $t > $this->atn->maxTokenType) {
2359 $from->edges[$t + 1] = $to;