public function Lexer::moveNext

Moves to the next token in the input string.

A token is an associative array containing three items:

  • 'value' : the string value of the token in the input string
  • 'type' : the type of the token (identifier, numeric, string, input parameter, none)
  • 'position' : the position of the token in the input string

Return value

array|null the next token; null if there is no more tokens left

1 call to Lexer::moveNext()
Lexer::skipUntil in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php
Tells the lexer to skip input tokens until it sees a token with the given value.

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php, line 135

Class

Lexer
Base class for writing simple lexers, i.e. for creating small DSLs.

Namespace

Doctrine\Common

Code

public function moveNext() {
  $this->peek = 0;
  $this->token = $this->lookahead;
  $this->lookahead = isset($this->tokens[$this->position]) ? $this->tokens[$this->position++] : null;
  return $this->lookahead !== null;
}