lexerActionExecutor = $executor ?? ($oldConfig->lexerActionExecutor ?? null); $this->passedThroughNonGreedyDecision = $oldConfig ? self::checkNonGreedyDecision($oldConfig, $this->state) : false; } public function getLexerActionExecutor() : ?LexerActionExecutor { return $this->lexerActionExecutor; } public function isPassedThroughNonGreedyDecision() : bool { return $this->passedThroughNonGreedyDecision; } public function hashCode() : int { return Hasher::hash( $this->state->stateNumber, $this->alt, $this->context, $this->semanticContext, $this->passedThroughNonGreedyDecision, $this->lexerActionExecutor ); } public function equals(object $other) : bool { if ($this === $other) { return true; } if (!$other instanceof self) { return false; } if (!parent::equals($other)) { return false; } if ($this->passedThroughNonGreedyDecision !== $other->passedThroughNonGreedyDecision) { return false; } return Equality::equals($this->lexerActionExecutor, $other->lexerActionExecutor); } private static function checkNonGreedyDecision(LexerATNConfig $source, ATNState $target) : bool { return $source->passedThroughNonGreedyDecision || ($target instanceof DecisionState && $target->nonGreedy); } }