public function readSequence(array $allowedTokenTypes)
	{
		$tokens = [];

		while($this->valid())
		{
			$token = $this->current();

			if(!$token->isOneOf($allowedTokenTypes))
			{
				break;
			}

			$tokens[] = $token;

			$this->next();
		}

		return $this->createTokenSequence($tokens);
	}
public function readSequence(array $allowedTokenTypes)
	{
		$tokens = [];

		while($this->valid())
		{
			$token = $this->current();

			if(!$token->isOneOf($allowedTokenTypes))
			{
				break;
			}

			$tokens[] = $token;

			$this->next();
		}

		return $this->createTokenSequence($tokens);
	}
public function readSequence ( array $ allowedTokenTypes ) { $ tokens = [ ] ; while ( $ this -> valid ( ) ) { $ token = $ this -> current ( ) ; if ( ! $ token -> isOneOf ( $ allowedTokenTypes ) ) { break ; } $ tokens [ ] = $ token ; $ this -> next ( ) ; } return $ this -> createTokenSequence ( $ tokens ) ; }
Get a TokenSequence containing only the allowed token types starting from the
current position of the cursor.

@param array<integer> $allowedTokenTypes
@return AbstractTokenSequence
Get a TokenSequence containing only the allowed token types starting from the current position of the cursor .