Lines Matching defs:config

1073         foreach ($configs->elements() as $config) {
1074 if ($config->state instanceof RuleStopState) {
1075 $result->add($config, $this->mergeCache);
1080 if ($lookToEndOfRule && $config->state->onlyHasEpsilonTransitions()) {
1081 $nextTokens = $this->atn->nextTokens($config->state);
1084 $endOfRuleState = $this->atn->ruleToStopState[$config->state->ruleIndex];
1085 $result->add(new ATNConfig($config, $endOfRuleState), $this->mergeCache);
1189 * Sam's fix: each config has flag indicating if it has returned from
1190 * an expr[0] call. then just don't filter any config with that flag set.
1253 foreach ($configs->elements() as $config) {
1255 if ($config->alt !== 1) {
1260 $config->semanticContext->evalPrecedence($this->parser, $this->outerContext) :
1267 $statesFromAlt1[$config->state->stateNumber] = $config->context;
1269 if (!$updatedContext->equals($config->semanticContext)) {
1271 new ATNConfig($config, null, null, $updatedContext),
1275 $configSet->add($config, $this->mergeCache);
1279 foreach ($configs->elements() as $config) {
1280 if ($config->alt === 1) {
1288 if (!$config->isPrecedenceFilterSuppressed()) {
1289 $context = $statesFromAlt1[$config->state->stateNumber] ?? null;
1291 if ($context !== null && $config->context !== null && $context->equals($config->context)) {
1296 $configSet->add($config, $this->mergeCache);
1318 * alt i has at least one unpredicated config.
1521 * unpredicated config which behaves as "always true." If !complete
1591 ATNConfig $config,
1601 $config,
1616 ATNConfig $config,
1625 $this->log[] = \sprintf('closure(%s)', $config->toString(true));
1627 if ($config->reachesIntoOuterContext > 50) {
1632 if ($config->state instanceof RuleStopState) {
1635 if ($config->context !== null && !$config->context->isEmpty()) {
1636 for ($i =0; $i < $config->context->getLength(); $i++) {
1637 if ($config->context->getReturnState($i) === PredictionContext::EMPTY_RETURN_STATE) {
1640 new ATNConfig($config, $config->state, PredictionContext::empty(), null, null),
1648 $this->getRuleName($config->state->ruleIndex)
1653 $config,
1666 $returnState = $this->atn->states[$config->context->getReturnState($i)];
1667 $newContext = $config->context->getParent($i);// "pop" return state
1669 $c = new ATNConfig(null, $returnState, $newContext, $config->semanticContext, $config->alt);
1678 $c->reachesIntoOuterContext = $config->reachesIntoOuterContext;
1694 $configs->add($config, $this->mergeCache);
1700 $this->log[] = \sprintf('FALLING off rule %s.', $this->getRuleName($config->state->ruleIndex));
1705 $this->closure_($config, $configs, $closureBusy, $collectPredicates, $fullCtx, $depth, $treatEofAsEpsilon);
1712 ATNConfig $config,
1720 $p = $config->state;
1727 $configs->add($config, $this->mergeCache);
1731 if ($i === 0 && $this->canDropLoopEntryEdgeInLeftRecursiveRule($config)) {
1736 $c = $this->getEpsilonTarget($config, $t, $continueCollecting, $depth === 0, $fullCtx, $treatEofAsEpsilon);
1741 if ($config->state instanceof RuleStopState) {
1747 // We can't get here if incoming config was rule stop and we had context
1808 * The optimization is to avoid adding the loop entry config when
1816 * links, just ensure that all stack tops for config refer to key
1832 * config to the current config set for edge[0], the loop entry branch.
1834 * Conditions fail if any context for the current config is:
1877 * Closure is examining one config (some loopentrystate, some alt,
1893 protected function canDropLoopEntryEdgeInLeftRecursiveRule(ATNConfig $config) : bool
1895 $p = $config->state;
1904 if ($config->context === null) {
1910 || $config->context->isEmpty()
1911 || $config->context->hasEmptyPath()) {
1916 $numCtxs = $config->context->getLength();
1920 $returnState = $this->atn->states[$config->context->getReturnState($i)];
1945 $returnStateNumber = $config->context->getReturnState($i);
1999 ATNConfig $config,
2012 return $this->ruleTransition($config, $t);
2019 return $this->precedenceTransition($config, $t, $collectPredicates, $inContext, $fullCtx);
2026 return $this->predTransition($config, $t, $collectPredicates, $inContext, $fullCtx);
2033 return $this->actionTransition($config, $t);
2036 return new ATNConfig($config, $t->target);
2045 return new ATNConfig($config, $t->target);
2056 protected function actionTransition(ATNConfig $config, ActionTransition $t) : ATNConfig
2062 return new ATNConfig($config, $t->target);
2066 ATNConfig $config,
2093 * the config sets. It also obviates the need to test predicates
2108 $c = new ATNConfig($config, $pt->target);// no pred context
2111 $newSemCtx = SemanticContext::andContext($config->semanticContext, $pt->getPredicate());
2112 $c = new ATNConfig($config, $pt->target, null, $newSemCtx);
2115 $c = new ATNConfig($config, $pt->target);
2124 ATNConfig $config,
2153 // the config sets. It also obviates the need to test predicates
2167 $c = new ATNConfig($config, $pt->target);// no pred context
2170 $newSemCtx = SemanticContext::andContext($config->semanticContext, $pt->getPredicate());
2171 $c = new ATNConfig($config, $pt->target, null, $newSemCtx);
2174 $c = new ATNConfig($config, $pt->target);
2184 protected function ruleTransition(ATNConfig $config, RuleTransition $t) : ATNConfig
2190 $config->context
2195 $newContext = SingletonPredictionContext::create($config->context, $returnState->stateNumber);
2197 return new ATNConfig($config, $t->target, $newContext);
2229 The key is that we have a single state that has config's only associated
2235 associated with a single alt state in the state&rarr;config-list map.