*/ private array $specifications, ) {} public function traverse(TokenStream $stream): Type { $token = $this; foreach ($this->specifications as $specification) { $token = $specification->manipulateToken($token); } if ($token !== $this) { return $token->traverse($stream); } return new UnresolvableType($this->symbol, "Cannot parse unknown symbol `$this->symbol`."); } public function symbol(): string { return $this->symbol; } }